Stefan Monnier [Sat, 30 Apr 2022 02:18:09 +0000 (22:18 -0400)]
debug-early: Print bytecode in a more manageable way
* lisp/emacs-lisp/debug-early.el (debug-early-backtrace):
Escape newlines to and bytecodes to make backtraces slightly more
readable. Use `cl-prin1` when available.
Stefan Monnier [Fri, 29 Apr 2022 19:29:35 +0000 (15:29 -0400)]
CL types: Accept both `byte-code-function` and `compiled-function`
`type-of` returns `compiled-function` for bytecode functions, but the
predicate for those objects is called `byte-code-function-p`,
So accept both `compiled-function` and `byte-code-function` as type
names for those objects.
Add helper function to remove title bar when maximizing frames
* lisp/frame.el (toggle-frame-maximized): Mention it.
(frame-hide-title-bar-when-maximized): New function (bug#31968).
Adapted from code by Jonathan Kyle Mitchell.
Po Lu [Fri, 29 Apr 2022 05:48:02 +0000 (13:48 +0800)]
Handle IO errors when creating Motif drag window
* src/xterm.c (xm_drag_window_io_error_handler): New function.
(xm_get_drag_window): Use that as the IO error handler when the
temporary display is open.
Paul Eggert [Thu, 28 Apr 2022 20:40:13 +0000 (13:40 -0700)]
Pacify byte compiler etc. on org-compat, org-macs
Byte-compiler problem reported by Lars Ingebrigtsen in:
https://lists.gnu.org/r/emacs-devel/2022-04/msg01256.html
* lisp/org/org-compat.el (org-at-table.el-p):
Now declared in org-table, not org.
(org-string-collate-lessp): Define the ersatz
org-string-collate-lessp with the same API as the primary form, to
pacify check-declare-file when run on org-macs.
* lisp/org/org-macs.el (org-time-convert-to-integer): Declare.
Paul Eggert [Thu, 28 Apr 2022 19:50:39 +0000 (12:50 -0700)]
Change current-time back to list form
Change current-time and related functions back to using the
traditional list form. Also, add a new boolean variable
current-time-list that lets people try out (TICKS . HZ) form,
with the goal of smoothing the transition.
* src/timefns.c (CURRENT_TIME_LIST): Change default back to true.
(current-time-list): New boolean Lisp variable, which defaults to
CURRENT_TIME_LIST. All uses of CURRENT_TIME_LIST changed to
use current_time_list, and all documentation changed.
Eli Zaretskii [Thu, 28 Apr 2022 14:53:36 +0000 (17:53 +0300)]
Improve documentation of font- and face-related attribute functions
* lisp/faces.el (face-attribute):
* src/xfaces.c (Fx_family_fonts):
* src/font.c (Ffont_get, Ffont_put): Improve and clarify the doc
strings.
* doc/lispref/display.texi (Low-Level Font): Document the :type
attribute of a font. Improve documentation of 'font-get' and
'font-put'.
(Attribute Functions): Add cross-reference to the description of
face attributes.
Po Lu [Thu, 28 Apr 2022 12:50:47 +0000 (12:50 +0000)]
Simplify buffer flipping code on Haiku
* src/haikuterm.c (flush_dirty_back_buffers): Delete function.
(haiku_flush_dirty_back_buffer_on): New function.
(haiku_read_socket): Use that instead of looping over each frame
at the end.
Po Lu [Thu, 28 Apr 2022 02:50:18 +0000 (10:50 +0800)]
Stop overriding default Motif colors with our own
* src/xrdb.c (x_load_resources): Instead of specifying the Motif
defaults manually, let Motif set them itself. This makes
palettes provided by color servers work again.
Po Lu [Thu, 28 Apr 2022 01:31:29 +0000 (09:31 +0800)]
Handle display disconnects during DND
* src/xterm.c (handle_one_xevent): Keep track of the display the
drop target is on during DND finish.
(x_connection_closed, x_delete_terminal): Handle display
disconnects during DND correctly.
Stefan Monnier [Wed, 27 Apr 2022 22:14:56 +0000 (18:14 -0400)]
src/xdisp.c: Use same test in `redisplay_window` and `prepare_menu_bars`
This consolidates the test made in those two functions so as to make
sure they agree whether a window needs to be redisplayed.
At the same time, change this test so it uses the window's point
rather than the buffer's point when comparing to `w->last_point`.
* src/xdisp.c (needs_no_redisplay): New function, extracted from
`redisplay_window`.
(redisplay_window, prepare_menu_bars): Use it.
* src/window.c (window_point): New function, extracted from `Fwindow_point`.
(Fwindow_point): Use it.
* src/window.h (window_point): Declare it.
Sean Whitton [Tue, 26 Apr 2022 18:39:38 +0000 (11:39 -0700)]
New user option 'calc-kill-line-numbering'
* lisp/calc/calc.el (calc-kill-line-numbering): New defcustom.
* lisp/calc/calc-yank.el (calc-kill): Unless calc-kill-line-numbering
is non-nil, do not include line numbering in copied text (bug#55133).
* etc/NEWS:
* doc/misc/calc.texi (Killing from the Stack): Document the change.
Ken Brown [Wed, 27 Apr 2022 14:46:57 +0000 (10:46 -0400)]
Implement system_process_attributes on Cygwin
* src/sysdep.c (system_process_attributes) [CYGWIN]: Implement,
using the /proc filesystem. The code is identical to the
GNU/Linux code except for the 'ttname' attribute. (Bug#55153)
* lisp/textmodes/string-edit.el (string-edit)
(read-string-from-buffer): Rework the function arguments so that
they're more similar to `read-string'. Rename symbols throughout
the file from help-text to prompt.
* doc/emacs/killing.texi (Secondary Selection): Document it.
* lisp/isearch.el (isearch-mouse-2): Make isearch respond to
mouse-yank-at-point (bug#7787).
* lisp/mouse.el (mouse-yank-at-point): Mention it.
Po Lu [Wed, 27 Apr 2022 11:19:01 +0000 (19:19 +0800)]
Cleanups to PGTK code
* src/pgtkfns.c (pgtk_explicitly_set_name, pgtk_set_tab_bar_lines)
(pgtk_change_tab_bar_height, pgtk_set_child_frame_border_width)
(pgtk_set_internal_border_width, pgtk_set_cursor_type)
(pgtk_set_mouse_color, pgtk_set_override_redirect, xg_set_icon)
(pgtk_frame_parm_handlers, Fpgtk_set_monitor_scale_factor)
(pgtk_set_scroll_bar_default_width, pgtk_get_focus_frame)
(pgtk_hide_tip, Fx_show_tip, Fx_hide_tip, frame_geometry)
(syms_of_pgtkfns): Clean up coding style and delete incorrect
comments that mostly duplicate what is in xfns.c, and fix
comment coding style. Also rename functions from `x_' to
`pgtk_'.
Po Lu [Wed, 27 Apr 2022 01:10:18 +0000 (09:10 +0800)]
Clean up pointer blanking code
* src/xterm.c (XTtoggle_invisible_pointer): Dispatch to correct
function directly.
(x_probe_xfixes_extension): Return directly based on dpyinfo.
(xfixes_toggle_visible_pointer): Make conditional on
`HAVE_XFIXES'.
(make_invisible_cursor): Initialize `c' correctly.
(x_toggle_visible_pointer): Handle cursor allocation failures.
(x_free_frame_resources): Dispatch with
XTtoggle_visible_pointer.
(x_setup_pointer_blanking): Delete function.
(x_term_init): Initialize blank cursor here instead.
* src/xterm.h (struct x_display_info): New field
`fixes_pointer_blanking'.
Stefan Monnier [Tue, 26 Apr 2022 21:09:03 +0000 (17:09 -0400)]
nadvice.el: Auto-generate the doc describing the "how" arg
* lisp/emacs-lisp/nadvice.el (advice--make-how-alist): New macro.
(advice--how-alist): Use it.
(nadvice--make-docstring): New function.
(add-function, advice-add): Use it to auto-generate the table
describing the accepted values for `how`.
Stefan Monnier [Tue, 26 Apr 2022 20:39:41 +0000 (16:39 -0400)]
nadvice.el: Use OClosures
* lisp/emacs-lisp/nadvice.el (advice): New OClosure type.
(advice--how-alist): Make it hold prototype OClosures rather
than bytecode strings.
(advice--bytecodes): Delete var.
(advice--where): Make it an obsolete alias of new `advice--how`.
(oclosure-interactive-form, cl-print-object) <advice>: New methods.
(advice--make-1): Delete function.
(advice--make): Use `advice-copy` and `advice-cons`.
(advice--tweak): Use `advice-cons`.
(add-function, advice-add): Rename `where` arg to `how`.
Stefan Monnier [Tue, 26 Apr 2022 21:30:29 +0000 (17:30 -0400)]
Pretty print OClosure slot accessors
* lisp/emacs-lisp/oclosure.el (oclosure--accessor-cl-print): New function.
* lisp/emacs-lisp/cl-print.el (cl-print-object) <accessor>: New method.
* test/lisp/emacs-lisp/nadvice-tests.el (advice-test-call-interactively):
Avoid `defun` within a function.
Alex Schroeder [Sun, 24 Apr 2022 11:33:09 +0000 (13:33 +0200)]
Fix error in rcirc for IRC tags without values
* src/lisp/net/rcirc.el (rcirc-process-server-response-1): If the
optional value for a tag is not present, do not call
replace-regexp-in-string on it. If (match-string 2 tag) is
nil, the STRING argument for the replace-regexp-in-string is nil,
which results in an error.
Stefan Monnier [Tue, 26 Apr 2022 14:36:52 +0000 (10:36 -0400)]
New generic function `oclosure-interactive-form`
It's used by `interactive-form` when it encounters an OClosure.
This lets one compute the `interactive-form` of OClosures
dynamically by adding appropriate methods.
This does not include support for `command-modes` for Oclosures.
* lisp/simple.el (oclosure-interactive-form): New generic function.
* src/data.c (Finteractive_form): Delegate to
`oclosure-interactive-form` if the arg is an OClosure.
(syms_of_data): New symbol `Qoclosure_interactive_form`.
* src/eval.c (Fcommandp): Delegate to `interactive-form` if the arg is
an OClosure.
* src/lisp.h (VALID_DOCSTRING_P): New function, extracted from
`store_function_docstring`.
* src/doc.c (store_function_docstring): Use it.
* lisp/kmacro.el (kmacro): Don't carry any interactive form.
(oclosure-interactive-form) <kmacro>: New method, instead.
* test/lisp/emacs-lisp/oclosure-tests.el (oclosure-interactive-form)
<oclosure-test>: New method.
(oclosure-test-interactive-form): New test.
* lisp/help-fns.el (help-fns--insert-menu-bindings): Only insert
the heading if it turns out that we actually find the menu.
(help-fns--insert-bindings): Tweak calling convention.
Po Lu [Tue, 26 Apr 2022 04:38:52 +0000 (12:38 +0800)]
Fix event mask of activation client message
* src/xterm.c (x_alloc_lighter_color):
(x_get_scale_factor): Minor formatting fixes.
(x_ewmh_activate_frame): Fix event mask used to send message to
the root window.
Fix Ruby indentation with double splat as first block param
* lisp/progmodes/ruby-mode.el (ruby-smie--forward-token)
(ruby-smie--backward-token): Tokenize "**" separately from "|".
Problem reported at https://github.com/dgutov/robe/issues/136.
Po Lu [Tue, 26 Apr 2022 01:19:56 +0000 (01:19 +0000)]
Cache relief colors on Haiku since their computation is expensive
* src/haikufns.c (haiku_create_frame, haiku_create_tip_frame):
Clear `relief_background'.
* src/haikuterm.c (haiku_calculate_relief_colors): Cache relief
colors for each frame.
* src/haikuterm.h (struct haiku_output): New fields for caching
the last relief color.