Po Lu [Fri, 29 Jul 2022 08:20:32 +0000 (16:20 +0800)]
Implement monitor refresh rate synchronization on X
* src/xfns.c (x_set_parent_frame, Fx_create_frame): Disable
vsync on child and embedded frames.
* src/xmenu.c (x_menu_show): Fix XMenu position calculation in
child frames.
* src/xterm.c (x_sync_is_frame_drawn_event)
(x_sync_wait_for_frame_drawn_event): New functions.
(x_sync_update_begin): Wait for frame to be drawn if not double
buffered.
(x_sync_update_finish): Set FRAME_X_WAITING_FOR_DRAW (f).
(show_back_buffer): Wait for frame to be drawn before flipping
buffers.
(XTframe_up_to_date): Set FRAME_X_WAITING_FOR_DRAW if bumped.
(handle_one_xevent): Handle frame drawn events.
* src/xterm.h (struct x_output): New fields for frame dirtyness
and vsync.
Po Lu [Fri, 29 Jul 2022 02:13:54 +0000 (10:13 +0800)]
Implement extended frame synchronization
* src/xterm.c (x_atom_refs): New atom _NET_WM_FRAME_TIMINGS.
(x_sync_update_finish, x_sync_update_begin): New frame.
(x_update_begin, x_update_end, XTframe_up_to_date): Begin and
end frames accordingly if extended frame synchronization is
enabled.
(handle_one_xevent): Ignore timing and frame drawn events.
* src/xterm.h (struct x_display_info): New atom.
(FRAME_X_COUNTER_VALUE): New macro.
Po Lu [Fri, 29 Jul 2022 00:50:55 +0000 (08:50 +0800)]
Don't offer meaningless selection targets during drag-and-drop
* lisp/select.el (xselect-dnd-target-available-p): New function.
(selection-converter-alist): Register it as the availability
function for DND specific targets.
Add an optional 'lock' parameter to 'narrow-to-region'
* src/editfns.c (Fnarrow_to_region): Add the parameter to the
function, and handle it. Update docstring.
(unwind_locked_begv, unwind_locked_zv): New functions.
(Fwiden): Do nothing when restrictions are locked. Update
docstring.
(syms_of_editfns): Replace the 'inhibit-widen' symbol and variable
with a 'restrictions-locked' symbol and variable. Update docstring.
* src/xdisp.c (handle_fontified_prop): Use Fnarrow_to_region with
the new parameter.
(unwind_narrowed_zv): Remove function.
* src/process.c (Finternal_default_process_filter): Add a third
argument to Fnarrow_to_region.
* src/lread.c (readevalloop): Add a third argument to
Fnarrow_to_region.
* src/bytecode.c (exec_byte_code): Add a third argument to
Fnarrow_to_region.
* etc/NEWS (like): Mention the new parameter of 'narrow-to-region'.
* doc/lispref/positions.texi (Narrowing): Document it.
Stefan Kangas [Thu, 28 Jul 2022 13:32:42 +0000 (15:32 +0200)]
Delete fast-lock.el and lazy-lock.el
The 'font-lock-support-mode' is occasionally useful for debugging
purposes, so it remains as a defvar.
Ref: https://lists.gnu.org/r/emacs-devel/2020-08/msg00125.html
* lisp/obsolete/fast-lock.el:
* lisp/obsolete/lazy-lock.el: Delete libraries obsolete since
22.1. (Bug#56560)
* lisp/font-lock.el (font-lock-support-mode): Make into a defvar and
delete any mention of 'lazy-lock-mode' and 'fast-lock-mode'.
(font-lock-turn-on-thing-lock, font-lock-turn-off-thing-lock):
Drop support for obsolete modes lazy-lock and fast-lock.
(font-lock-after-fontify-buffer)
(font-lock-after-unfontify-buffer): Make into obsolete function
aliases for 'ignore'. Adjust callers.
(font-lock-keywords, font-lock-inhibit-thing-lock): Adjust
documentation to not mention lazy-lock and fast-lock.
* lisp/font-core.el (font-lock-defaults): Adjust documentation to
not mention 'font-lock-inhibit-thing-lock'.
* lisp/mail/rmail.el (rmail-variables): Don't inhibit obsolete
lazy-lock-mode and fast-lock-mode.
* lisp/emacs-lisp/warnings.el (warning-suppress-action)
(warning-suppress-log-action): Removed.
New icon.
(warnings-suppress): New helper function.
(display-warning): Use it (bug#46025).
* lisp/help.el (describe-bindings): Don't force buttons on
(bug#56691).
* lisp/outline.el (outline-minor-mode-use-buttons): Default
buttons on in special-mode buffers.
* lisp/outline.el (outline-minor-mode-buttons): Remove.
(outline-open, outline-close): New icons.
(outline-minor-mode-highlight-buffer): Use the new predicate to
switch on/off.
(outline--make-button): Remove.
(outline--make-button-overlay): Use icons.el instantiation.
(outline--valid-emoji-p): Remove.
(outline--valid-char-p): Remove.
(outline--insert-open-button, outline--insert-close-button): Make
point movement better in *Help* buffers.
* doc/emacs/custom.texi (Specific Customization): Mention it.
* doc/emacs/display.texi (Icons): New node.
* doc/lispref/display.texi (Icons): New node.
* lisp/button.el (buttonize):
(button--properties, buttonize-region): Allow not overriding faces.
* lisp/cus-edit.el (custom-save-all): Save icons.
(custom-icon): New widget.
(custom-icon-value-create, custom-toggle-hide-icon)
(custom--icons-widget-value, custom-icon-set): Helper functions
for the widget.
(customize-icon): Main command.
(custom-icon-state-set, custom-icon-state): Helper functions.
(custom-theme-set-icons): Function to be used by theme writers.
(custom-set-icons): Function to be used in .emacs.
(custom-save-icons): New function.
* lisp/custom.el (custom-push-theme): Add icons.
* lisp/emacs-lisp/icons.el: New file.
* test/lisp/emacs-lisp/icons-tests.el: Add some tests.
Ensure that we don't call print-unreadable-function from " prin1"
* src/print.c (PRINTPREPARE): Bind the current buffer so that we
can retrieve it later.
(print_vectorlike): Use it (bug#56773).
(syms_of_print): New internal `print--unreadable-callback-buffer'
variable.
Po Lu [Thu, 28 Jul 2022 07:17:04 +0000 (07:17 +0000)]
Fix race conditions in mouse button handling on Haiku
* src/haiku_support.cc (class EmacsView): New field
`grabbed_buttons'. Remove `previous_buttons'.
(BasicMouseDown, BasicMouseUp): Accept new parameter `message'.
Use data from that message instead.
(MouseDown, MouseUp): Pass the current message to BasicMouseUp
and BasicMouseDown.
Paul Pogonyshev [Wed, 27 Jul 2022 19:20:55 +0000 (21:20 +0200)]
Release the desktop lock in 'kill-emacs-hook'
* lisp/desktop.el: Run 'desktop--on-kill' in 'kill-emacs-hook'.
(desktop--on-kill): New function, refactored from 'desktop-kill'.
(desktop-kill): Call 'desktop--on-kill'. (Bug#56800)
Stefan Kangas [Wed, 27 Jul 2022 22:25:33 +0000 (00:25 +0200)]
Drop support for obsolete "Lisp Code Directory" from ffap
Ref: https://flex.phys.tohoku.ac.jp/texi/faq/faq_146.html
Note also that the host "archive.cis.ohio-state.edu" is unknown.
* lisp/ffap.el (ffap-alist): Drop support for obsolete "Lisp Code
Directory".
(ffap-lcd): Make obsolete.
Stefan Kangas [Wed, 27 Jul 2022 21:33:03 +0000 (23:33 +0200)]
Drop support for XEmacs package EFS
EFS is a long defunct XEmacs-specific fork of Ange FTP that is
superseded by TRAMP.
* lisp/ffap.el (ffap-ftp-default-user)
(ffap-replace-file-component, ffap-host-to-filename):
* lisp/gnus/mml.el (mml-parse-file-name):
* lisp/gnus/nnheader.el (nnheader-re-read-dir):
* lisp/net/browse-url.el (browse-url-filename-alist):
* lisp/speedbar.el (speedbar-check-vc): Drop support for XEmacs
package EFS.
Eli Zaretskii [Wed, 27 Jul 2022 17:05:44 +0000 (20:05 +0300)]
Speed up Isearch in very long lines under line truncation
* src/xdisp.c (strings_with_newlines): New function.
(forward_to_next_line_start): Call 'strings_with_newlines' in
buffers with very long lines, to avoid falling back on slow
iteration. (Bug#56682)
F. Jason Park [Wed, 6 Jul 2022 07:40:42 +0000 (00:40 -0700)]
Avoid mutating default value of erc-server-last-peers
* lisp/erc/erc-backend.el (erc-server-last-peers): Leave default as
nil instead of a quoted constant.
(erc-server-connect): Initialize `erc-server-last-peers' to a new
value local to a server buffer.
(erc-message): Operate on server's local `erc-server-last-peers' value
instead of the global default. Prefer replacing value instead of
mutating CDR to make for easier testing.
(erc-server-PRIVMSG): Create a new `erc-server-last-peers' for easier
testing. (Bug#56449)
F. Jason Park [Sun, 24 Jul 2022 12:14:24 +0000 (05:14 -0700)]
Ensure erc-dcc-chat-setup runs in the right buffer
* lisp/erc/erc-dcc.el (erc-dcc-chat-setup): Ensure initialization runs
in the intended buffer regardless of the value of `erc-join-buffer'.
(erc-dcc--send-final-turbo-ack, erc-dcc-get-filter): Rename internal
variable formerly known as `erc-dcc--X-send-final-turbo-ack'.
F. Jason Park [Sun, 24 Jul 2022 12:14:24 +0000 (05:14 -0700)]
Allow non-IRC line delimiters with ERC test server
* test/lisp/erc/resources/erc-d/erc-d.el (erc-d-server-fqdn,
erc-d--initialize-client, erc-d--log, erc-d--send, erc-d--filter,
erc-d-run): Add new variable and use it. Also optionally accept
keyword arguments in `erc-d-run'.
* test/lisp/erc/resources/erc-d/erc-d-tests.el
(erc-d-run-direct-foreign-protocol): Add test demoing newline-only
line-wise protocol.
* test/lisp/erc/resources/erc-d/resources/foreign.eld: New file.
* lisp/net/tramp-compat.el (tramp-compat-string-equal-ignore-case):
New defalias.
* lisp/net/tramp-gvfs.el (tramp-gvfs-handler-mounted-unmounted): Use it.
Po Lu [Wed, 27 Jul 2022 05:01:41 +0000 (13:01 +0800)]
Remove workaround for some input method problems
* src/xterm.c (handle_one_xevent): Remove modifier key
workaround for some input method problems, since they cause more
problems than they fix. (bug#56782)
Po Lu [Wed, 27 Jul 2022 03:21:34 +0000 (11:21 +0800)]
Fix NS stretch glyph display
* src/nsterm.m (ns_draw_window_cursor): Just draw hollow cursor.
There is no need to draw the phys cursor glyph.
(ns_dumpglyphs_stretch): Delete function.
(ns_draw_glyph_string): New function. Port code from X and use
it instead. (bug#56787)
Alan Mackenzie [Tue, 26 Jul 2022 19:43:13 +0000 (19:43 +0000)]
CC Mode: correct the calculation and handling of c-use-category.
This fixes bug #56629. The use of c-use-category was inconsistent, with the
result that it would be nil at compilation time, but t at run time. This
resulted in wrongly writing syntax-table text properties to <s and >s, yet
testing for category properties on them.
* lisp/progmodes/cc-defs.el (c-use-category): Move to after the definition of
c-<-as-paren-syntax and c->-as-paren-syntax so as correctly to be able to use
their values. Put an eval-when-compile around the calculation of its value,
to reduce the chances of future failure.
(c-mark-<-as-paren, c-mark->-as-paren, c-unmark-<->-as-paren, c-sc-scan-lists)
(c-sc-parse-partial-sexp): Wrap c-use-category in (eval-when-compile ...) as
an optimization, preventing the XEmacs code also being generated.
* lisp/minibuffer.el (minibuffer-local-must-match-map): Remove the
M-X binding here, because it's nonsensical outside
read-extended-command (bug#56741).
* lisp/simple.el (read-extended-command-mode-map)
(read-extended-command-mode): New minor mode to bind `M-X' in
read-extended-command.
(read-extended-command-1): Use it.
Like duplicate-line but duplicates the region instead if active.
Rectangular regions are duplicated on the right-hand side.
The region remains active afterwards, to facilitate further
duplication or other operations on the same text.
Po Lu [Tue, 26 Jul 2022 08:12:06 +0000 (16:12 +0800)]
Fix flicker when moving tooltips between frames during mouse drag-and-drop
* src/haikufns.c (Fx_show_tip):
* src/nsfns.m (Fx_show_tip): Allow sharing existing tooltip
frames between any two frames.
* src/xfns.c (Fx_show_tip): Allow that but only between frames
on the same X display.
Improvement for long lines in buffers with font locking.
* src/xdisp.c (get_narrowed_width): Factored out from 'get_narrowed_len'.
(get_narrowed_len): Updated to use 'get_narrowed_width'.
(get_closer_narrowed_begv): New function.
(SET_WITH_NARROWED_BEGV): Add parameter to the macro.
(back_to_previous_line_start): Use the new function.
(get_visually_first_element, move_it_vertically_backward): Update the
calls to the macro.
* src/dispextern.h: Prototype of 'get_closer_narrowed_begv'.
Fix the prototypes of 'get_narrowed_begv' and 'get_narrowed_zv'.