Laurence Warne [Tue, 9 Aug 2022 07:33:18 +0000 (08:33 +0100)]
Fix python escape code fontification for multi-line literals
* lisp/progmodes/python.el (python--string-bytes-literal-matcher): Go
backward one char after a match so that consecutive escape codes are
highlighted
(python--not-raw-string-literal-start-regexp): Make regular expression
more comprehensive, so multi-line bytes literals are not caught
(python-rx): Accept one to three octal digits in octal escape codes
instead of always three
Michael Albinus [Tue, 9 Aug 2022 16:12:27 +0000 (18:12 +0200)]
Further Tramp fixes for Android 12
* lisp/net/tramp-adb.el (tramp-adb-handle-file-attributes)
(tramp-adb-handle-directory-files-and-attributes)
(tramp-adb-handle-file-name-all-completions): Pipe "ls" output
through "cat", in order to avoid quoting special characters.
(tramp-adb-sh-fix-ls-output): Remove fix for file names with spaces.
Stefan Kangas [Tue, 9 Aug 2022 15:55:21 +0000 (17:55 +0200)]
Improve message regarding missing LEIM
* lisp/international/ja-dic-utl.el (skkdic-lookup-key):
* lisp/international/mule-diag.el (list-input-methods-1):
* lisp/international/quail.el (quail-use-package): Explain that LEIM
is installed together with Emacs.
Stefan Kangas [Tue, 9 Aug 2022 12:29:12 +0000 (14:29 +0200)]
Replace utility functions with seq-uniq
* lisp/gnus/gnus-util.el (gnus-delete-duplicates):
* lisp/ibuf-ext.el (ibuffer-remove-duplicates): Redefine as
obsolete function alias for 'seq-uniq'. Update callers.
* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--shorten-autoload): New function.
(loaddefs-generate--make-autoload): Use it to drop optional nil
values from the `autoloads' forms. This makes the loaddefs.el
file about 12K shorter.
Stefan Kangas [Tue, 9 Aug 2022 13:37:53 +0000 (15:37 +0200)]
Make ibuffer-split-list obsolete in favor of seq-group-by
* lisp/ibuf-ext.el (ibuffer-split-list): Make obsolete in favor of
'seq-group-by'.
(ibuffer-generate-filter-groups): Don't use above obsolete
function.
Alan Mackenzie [Tue, 9 Aug 2022 10:46:21 +0000 (10:46 +0000)]
CC Mode: Allow the insertion of long strings of letters in reasonable time
This fix allows M-: (insert (make-string 1000000 ?y)) to work fast when
inserted between C++ raw string delimiters after (setq long-line-threshold
nil).
* lisp/progmodes/cc-langs.el (c-symbol-key): Replace a "*" by "\\{,1000\\}" in
a regexp.
Po Lu [Tue, 9 Aug 2022 07:43:30 +0000 (15:43 +0800)]
Factor out some duplicate code from handle_one_xevent
* src/xterm.c (xi_disable_devices): New function.
(handle_one_xevent): Use that to disable an array of device IDs
instead of copypasting the same block of code over and over
again.
Po Lu [Tue, 9 Aug 2022 03:06:06 +0000 (11:06 +0800)]
Fix handling of XI_DeviceChanged events
* src/xterm.c (xi_get_scroll_valuator): New function.
(xi_handle_device_changed): New function.
(handle_one_xevent): Factor out most of the device changed code
to that function, and make it specifically query for the device
information. (bug#57020)
Stefan Kangas [Mon, 8 Aug 2022 19:28:53 +0000 (21:28 +0200)]
Don't mention XEmacs toolbar in ediff manual
* doc/misc/ediff.texi (Other Session Commands): Don't mention XEmacs
specific toolbar support for now. This can be changed back once the
toolbar is ported to Emacs.
Arash Esbati [Mon, 8 Aug 2022 13:58:35 +0000 (15:58 +0200)]
Improve collecting of citation keys
* lisp/textmodes/reftex-cite.el (reftex-all-used-citation-keys):
Improve regexp for matching various cite commands incl. optional
arguments.
Recognize comments more robustly and don't interpret the control
symbol \% as a comment starter. (bug#56655)
* test/lisp/textmodes/reftex-tests.el
(reftex-all-used-citation-keys): New test.
Allow specifying how args are to be stored in `command-history'
* doc/lispref/functions.texi (Declare Form): Document
`interactive-args'
* lisp/replace.el (replace-string): Store the correct interactive
arguments (bug#45607).
* lisp/emacs-lisp/byte-run.el (byte-run--set-interactive-args):
New function.
(defun-declarations-alist): Use it.
* src/callint.c (fix_command): Remove the old hack (which now
longer works since interactive specs are byte-compiled) and
instead rely on `interactive-args'.
* lisp/emacs-lisp/lisp-mode.el (lisp-current-defun-name): Use
edebug specs to find the name (if they exist), and default to
returning the top-level symbol if there isn't a define-like form
(bug#49592).
Stefan Kangas [Mon, 8 Aug 2022 11:18:36 +0000 (13:18 +0200)]
Remove redundant local variables in tests
* test/lisp/calc/calc-tests.el:
* test/lisp/progmodes/python-tests.el: Remove redundant local
variables.
* test/src/coding-tests.el: Pacify byte-compiler without using local
variable.
Stefan Kangas [Mon, 8 Aug 2022 09:13:58 +0000 (11:13 +0200)]
Don't autoload obsolete library tpu-extras.el
* lisp/obsolete/tpu-edt.el: Remove autoloads of obsolete library
tpu-extras.el.
* lisp/obsolete/tpu-extras.el: Don't set generated-autoload-file
to tpu-edt.el.
Stefan Kangas [Sun, 7 Aug 2022 17:23:36 +0000 (19:23 +0200)]
Clean up some local variable sections
* lisp/filesets.el:
* lisp/mh-e/mh-*.el:
* lisp/progmodes/python.el (python): Don't set options that are
already set in .dir-locals.el.
* lisp/textmodes/ispell.el: Remove redundant local variables.
* lisp/gnus/nnmaildir.el: Remove local variables that conflicts with
Emacs defaults.
Po Lu [Mon, 8 Aug 2022 03:44:53 +0000 (11:44 +0800)]
Improve handling of pointer focus under the input extension
* src/xfns.c (x_relative_mouse_position)
(Fx_mouse_absolute_pixel_position, compute_tip_xy): Use
x_query_pointer instead of XQueryPointer.
* src/xterm.c (xi_populate_device_from_info): Set new attachment
field.
(xi_handle_focus_change): Set client pointer.
(xi_focus_handle_for_device, xi_handle_interaction): Use
attached keyboard device to handle focus.
(x_query_pointer): New function.
(XTmouse_position, x_scroll_bar_report_motion)
(x_horizontal_scroll_bar_report_motion, handle_one_xevent): Use
x_query_pointer instead of XQueryPointer.
(x_term_init): Initialize client pointer device.
* src/xterm.h (struct xi_device_t): New field `attachment'.
(struct x_display_info): New field `client_pointer_device'.
* src/xterm.c (xi_handle_focus_change): Pacify a wrong warning on
gcc (Debian 10.2.1-6).
xterm.c: In function ‘xi_handle_focus_change’:
xterm.c:12564:25: warning: ‘source’ may be used uninitialized in
this function [-Wmaybe-uninitialized]
12564 | ie.device = source->name;
| ~~~~~~^~~~~~
Eli Zaretskii [Sun, 7 Aug 2022 14:03:52 +0000 (17:03 +0300)]
Fix 'vertical-motion' in bidi-reordered text
* src/xdisp.c (move_it_vertically_backward): Fix the case of long
bidi-reordered lines when starting from its last (top-most) screen
line.
(move_it_by_lines): Fix logic of detection when going by lines
overshoots.
Stefan Kangas [Sun, 7 Aug 2022 11:51:39 +0000 (13:51 +0200)]
Declare unused function ediff-user-grabbed-mouse obsolete
* lisp/vc/ediff-init.el (ediff-user-grabbed-mouse): Declare unused
function obsolete. As far as I can tell, this has been unused
since 1996.
* lisp/vc/ediff-wind.el (ediff-mouse-pixel-position): Make
variable obsolete. It is only used in the above obsolete funct
* lisp/vc/ediff-mult.el (ediff-filegroup-action)
(ediff-registry-action):
* lisp/vc/ediff-util.el (ediff-setup): Don't set above unused
variable.
* lisp/vc/ediff-init.el (ediff-spy-after-mouse): Make obsolete.
* lisp/vc/ediff-util.el (ediff-setup): Don't add above obsolete
function to pre-command-hook.
Stefan Kangas [Sun, 7 Aug 2022 11:16:53 +0000 (13:16 +0200)]
; Improve time-convert call in recently changed test
* test/lisp/eshell/em-pred-tests.el
(eshell-parse-file-name-attributes): Use t instead of nil as
second argument to 'time-convert'.
Suggested by Stefan Monnier <monnier@iro.umontreal.ca>.
Stefan Kangas [Sun, 7 Aug 2022 10:57:53 +0000 (12:57 +0200)]
Merge from origin/emacs-28
7ffcba4213 * etc/PROBLEMS: Problems with Alacritty and Emoji. (Bug#5... df95118e83 Link from (emacs)Init Syntax to (elisp)Introduction 7793cf0c3d Don't mention removed XEmacs support in reftex manual 3d1cf1b47a Don't mention removed XEmacs support in idlwave manual 7ff60c62a9 ; * admin/make-tarball.txt: Fix last change. 2fd5590d0c ; * lisp/play/fortune.el (fortune-ask-file): Doc fix.
When load-force-doc-strings is true, read (#$ . POS) as the (unibyte)
string referred to. This feature was lost by mistake in the recent
nonrecursive reader rewrite.
Noticed by Stefan Monnier.
* src/lread.c (get_lazy_string): New function (code mostly recycled
from an old version).
(read0): Detect (#$ . FIXNUM) and retrieve the string if appropriate.
* test/src/lread-resources/lazydoc.el:
* test/src/lread-tests.el (lread-force-load-doc-strings):
New test.
Fix two problems with our handling of X timestamps
1) We're not properly updating the X interaction timestamp after
receiving certain input events, and
2) X events sent in response to emacsclient commands get stale
timestamps because the timestamp tracking doesn't take into account
that interactions with the user can occur outside the X input
event channel.
* src/xterm.c:
(x_display_set_last_user_time_1): New function.
(x_display_set_last_user_time): Call it.
(x_ewmh_activate_frame): Refactor.
(x_focus_frame): Don't call XSetInputFocus if we can use EWMH activation.
(server_timestamp_predicate): New function.
(x_get_server_time): New function.
(x_note_oob_interaction): New function.
(x_create_terminal): Register new function as terminal hook.
* src/termhooks.h: New hook: note_oob_interaction_hook.
Alan Mackenzie [Sat, 6 Aug 2022 21:11:18 +0000 (21:11 +0000)]
CC Mode: Optimize font-locking stanzas for long raw strings.
Also replace some regexp searches which had caused regexp engine stack
overflows with simple end-of-line calls.
* lisp/progmodes/cc-fonts.el (c-make-syntactic-matcher)
(c-make-font-lock-search-form): Start the generated functions with a skipping
of comments and strings.
(c-make-font-lock-BO-decl-search-function): Start the generated function with
a (fast) movement to the start of any literal.
* lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings)
(c-after-change-mark-abnormal-strings): Replace complicated regexp searches
for end of logical line with basic Lisp functions.
Michael Albinus [Sat, 6 Aug 2022 16:09:35 +0000 (18:09 +0200)]
Adapt Tramp for Android 12
* lisp/net/tramp-adb.el (tramp-methods): Use "%d".
(tramp-adb-handle-directory-files-and-attributes): Fix "." and
".." in listing.
(tramp-adb-sh-fix-ls-output): Fix file names with spaces.
(tramp-adb-maybe-open-connection): Compute args from `tramp-login-args'.
* lisp/net/tramp.el (tramp-methods): Adapt docstring.
(tramp-handle-make-process): Check for adb device if indicated.