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.
Po Lu [Mon, 25 Jul 2022 02:07:30 +0000 (10:07 +0800)]
Fix mouse face handling with tooltips
* src/xterm.c (handle_one_xevent): Clear last_mouse_motion_frame
and last_mouse_glyph_frame on LeaveNotify. Otherwise, mouse
face will be restored by gui_redo_mouse_highlight and will not
be restored if an EnterNotify is later sent on top of the same
glyph.
Michael Albinus [Sun, 24 Jul 2022 14:02:10 +0000 (16:02 +0200)]
Refactor Tramp
* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
Use `tramp-adb-handle-get-remote-gid' and
`tramp-adb-handle-get-remote-uid'.
(tramp-adb-handle-file-attributes): Use `tramp-convert-file-attributes'.
(tramp-do-parse-file-attributes-with-ls): Remove ID-FORMAT.
(tramp-adb-handle-directory-files-and-attributes):
Use `tramp-skeleton-directory-files-and-attributes'.
(tramp-adb-handle-file-local-copy): Use `tramp-skeleton-file-local-copy'.
(tramp-adb-handle-copy-file, tramp-adb-handle-rename-file):
Use `tramp-barf-if-file-missing'.
(tramp-adb-handle-get-remote-uid)
(tramp-adb-handle-get-remote-gid): New defuns.
* lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
Use `tramp-archive-handle-directory-files'.
(tramp-archive-handle-directory-files): New defun.
* lisp/net/tramp-cache.el (tramp-file-property-p): New defun.
* lisp/net/tramp-compat.el (tramp-compat-take): New defalias.
* lisp/net/tramp-crypt.el (tramp-crypt-do-copy-or-rename-file):
Use `tramp-barf-if-file-missing'.
(tramp-crypt-handle-directory-files):
Use `tramp-skeleton-directory-files'.
* lisp/net/tramp-fuse.el (tramp-fuse-handle-directory-files):
Use `tramp-skeleton-directory-files'.
* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file):
Use `tramp-barf-if-file-missing'.
* lisp/net/tramp-rclone.el (tramp-rclone-do-copy-or-rename-file):
Use `tramp-barf-if-file-missing'.
* lisp/net/tramp-sh.el (tramp-readlink-file-truename)
(tramp-stat-file-attributes)
(tramp-stat-directory-files-and-attributes): New defconsts.
(tramp-perl-file-attributes)
(tramp-perl-directory-files-and-attributes): Adapt.
(tramp-sh-handle-make-symbolic-link): Flush TARGET file properties.
(tramp-sh-handle-file-truename): Use `tramp-readlink-file-truename'
(tramp-sh-handle-file-exists-p)
(tramp-sh-handle-file-executable-p)
(tramp-sh-handle-file-readable-p)
(tramp-sh-handle-file-directory-p)
(tramp-sh-handle-file-writable-p): Adapt check of file properties.
(tramp-sh-handle-file-attributes): Simplify.
(tramp-do-file-attributes-with-ls): Remove ID-FORMAT. Combine two
remote commands. Compute both versions of uid and gid together.
(tramp-do-file-attributes-with-perl)
(tramp-do-directory-files-and-attributes-with-perl):
Remove ID-FORMAT.
(tramp-do-file-attributes-with-stat): Remove ID-FORMAT. Use
`tramp-stat-file-attributes'.
(tramp-sh-handle-directory-files-and-attributes):
Use `tramp-skeleton-directory-files-and-attributes'.
(tramp-do-directory-files-and-attributes-with-stat):
Remove ID-FORMAT. Use `tramp-stat-directory-files-and-attributes'.
(tramp-sh-handle-copy-directory): Use `tramp-skeleton-copy-directory'.
(tramp-do-copy-or-rename-file): Use `tramp-barf-if-file-missing'.
(tramp-sh-handle-file-local-copy): Use `tramp-skeleton-file-local-copy'.
(tramp-sh-handle-write-region): Combine two remote commands.
(tramp-sh-gio-monitor-process-filter): Simplify `cond' call.
(tramp-expand-script): Extend for ls, readling and stat.
(tramp-open-connection-setup-interactive-shell): Do not set
`tramp-end-of-output'.
(tramp-open-connection-setup-interactive-shell): Do not send
prompt formatting command, it's superfluous.
(tramp-send-command-and-check): Rearrange in order to accept also
heredoc scripts.
(tramp-convert-file-attributes): Move function to tramp.el.
(tramp-get-remote-id): Set connection property.
(tramp-get-remote-uid-with-id): Use it.
(tramp-get-remote-python): Don't check for python2 anymore.
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Use `tramp-handle-directory-files'.
(tramp-smb-handle-copy-directory): Use `tramp-skeleton-copy-directory'.
(tramp-smb-handle-directory-files): Remove.
(tramp-smb-handle-file-attributes): Use `tramp-convert-file-attributes'.
(tramp-smb-do-file-attributes-with-stat): Remove ID-FORMAT.
(tramp-smb-handle-file-local-copy): Use `tramp-skeleton-file-local-copy'.
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file):
Use `tramp-barf-if-file-missing'.
(tramp-sudoedit-file-attributes): New defconst.
(tramp-sudoedit-handle-file-attributes): Simplify code.
* lisp/net/tramp.el (tramp-setup-debug-buffer): Set debug buffer
as not modified.
(tramp-barf-if-file-missing, tramp-skeleton-copy-directory)
(tramp-skeleton-directory-files)
(tramp-skeleton-directory-files-and-attributes)
(tramp-skeleton-file-local-copy): New macros.
(tramp-handle-copy-directory): Use `tramp-skeleton-copy-directory'.
(tramp-handle-directory-files): Use `tramp-skeleton-directory-files'.
(tramp-handle-file-local-copy): Use `tramp-skeleton-file-local-copy'.
(tramp-handle-insert-file-contents): Use `tramp-barf-if-file-missing'.
(tramp-get-process-attributes, tramp-action-out-of-band):
Simplify `cond' call.
(tramp-check-cached-permissions): Simplify.
(tramp-make-tramp-temp-file): Reimplement.
Po Lu [Sun, 24 Jul 2022 13:32:42 +0000 (21:32 +0800)]
Throw errors in XDS handler directly
* lisp/x-dnd.el (x-dnd-xds-testing): New defvar.
(x-dnd-handle-direct-save): Signal errors directly if it is
true.
* test/lisp/x-dnd-tests.el (x-dnd-xds-testing): New defvar.
(x-dnd-tests-do-direct-save-internal): Bind it to t around
x-begin-drag. (bug#56712)
* lisp/vc/diff-mode.el (diff-whitespace-style): New user option.
(diff-setup-whitespace): Use it (Bug#56679).
(top level): require 'whitespace.
(whitespace-style, whitespace-trailing-regexp): Remove defvars.
Stefan Kangas [Sun, 24 Jul 2022 07:55:01 +0000 (09:55 +0200)]
Merge from origin/emacs-28
b4067394dc Set `default-directory' of Tramp archive connection buffer 2529e82002 ; * doc/lispref/functions.texi (Declare Form): Fix typo. 54c4ceb009 Update the documentation of 'declare' forms 7263631dca Fix bookmark support for Help functions in native-compilat...
* etc/NEWS: Mention how to suppress the warning.
* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings): Amend doc string.
* lisp/subr.el: Use `macroexp-warn-and-return` to delay the warning
until codegen time (which makes it suppressible) and to prevent
repeated warnings.
* test/lisp/international/ccl-tests.el (shift):
* test/src/data-tests.el (data-tests-ash-lsh):
Suppress warning in tests of `lsh` itself.
For discussion, see:
https://lists.gnu.org/r/emacs-devel/2022-07/msg00761.html
* src/pdumper.c (dump_buffer): Dump new field
long_line_optimizations_p introduced in commit e7b5912b23 of
2022-07-16 "Improvements to long lines handling."
(dump_buffer) [CHECK_STRUCTS]: Update hash accordingly
for --enable-checking=structs.
Use `ash` instead of `lsh` in verilog-mode (bug#56641)
* lisp/progmodes/verilog-mode.el (verilog-simplify-range-expression):
Use `ash`; the result will be the same because the first argument is
nonnegative.
Eli Zaretskii [Sat, 23 Jul 2022 09:54:07 +0000 (12:54 +0300)]
Update the documentation of 'declare' forms
* doc/lispref/compile.texi (Native-Compilation Variables): Mention
the 'declare' alternative for 'native-comp-speed'.
* doc/lispref/functions.texi (Declare Form): Document 'declare'
forms that were previously undocumented.
* lisp/faces.el (region): Don't use the Gtk region face, because
it produces low contrast combinations (bug#46493).
* src/gtkutil.h:
* src/gtkutil.c (xg_check_special_colors): Remove.
Eli Zaretskii [Sat, 23 Jul 2022 08:11:47 +0000 (11:11 +0300)]
Fix bookmark support for Help functions in native-compilation builds
* lisp/help.el (describe-key--helper, describe-function--helper):
New helper functions.
(describe-key): Call 'describe-key--helper' instead of a
lambda-function.
* lisp/help-fns.el (describe-function): Call
'describe-function--helper' instead of a lambda-function.
(Bug#56643)
New user option to disable deleting current input in comint mouse-2
* etc/NEWS: Announce the user option (bug#56646).
* lisp/comint.el (comint-delete-old-input): New user option to disable
deleting current input when insert an old input using mouse-2.
(comint-insert-input): Use it.
Po Lu [Sat, 23 Jul 2022 07:00:12 +0000 (15:00 +0800)]
Fix PGTK DND after a source leaves without dropping anything
* lisp/pgtk-dnd.el (pgtk-dnd-clear-data-on-motion): New flag.
(pgtk-dnd-handle-gdk): Set flag upon drag-leave. Clear state
upon drag-motion if it is set.
Po Lu [Sat, 23 Jul 2022 01:35:20 +0000 (09:35 +0800)]
Improve efficiency of DND tooltip movement
* src/xterm.c (x_dnd_begin_drag_and_drop): Clear new flag.
(x_dnd_update_tooltip_position): Save last tooltip X and Y
somewhere, so we don't move it upon client lists being updated.
Po Lu [Fri, 22 Jul 2022 07:37:28 +0000 (15:37 +0800)]
Fix handling hscroll during drag-and-drop
* lisp/x-dnd.el (x-dnd-hscroll-flags): Delete function.
(x-dnd-get-modifiers, x-dnd-wheel-modifier-type): New functions.
(x-dnd-mwheel-scroll): Use that to determine hscroll instead.
* src/window.c (set_window_hscroll): Mark window as needing
redisplay if the hscroll really changed.