Experimenting with `goto-char' and `re-search-backwards' indicates
that this limitation no longer applies. The rewrite using nadvice in
commit 8b62d7427e12bbf07ab3454cc061a6b43ded56dd might have eliminated
this issue.
Phil Sainty [Fri, 12 Aug 2022 07:47:33 +0000 (19:47 +1200)]
* lisp/emacs-lisp/trace.el: Allow trace context args to be forms
This lifts the restriction of context arguments needing to be
functions, when calling trace functions from lisp code.
(trace--read-extra-args, trace-entry-message, trace-entry-message):
Move the output formatting already used for interactive context into
the trace-*-message functions for use in non-interactive cases as
well. Previously it was necessary for context functions to format
their output in a trace-aware manner, making a custom wrapper function
necessary to obtain well-formatted output even when the desired
context had an existing function.
(trace-function-internal, trace-make-advice): Move the generation of
an 'empty' context function into `trace-make-advice', which now takes
care of generating a function for any non-function context.
(trace-make-context): New function returning a context function for
an expression argument; extracted from `trace--read-extra-args'.
(trace--read-extra-args, trace-make-advice): Call it.
(trace-is-traceable-p): New predicate function used for filtering
interactive completions.
(trace--read-function): New function, split from `trace--read-args'.
Changed to use the new `trace-is-traceable-p' predicate.
(trace--read-extra-args): New function, split from `trace--read-args'.
Changed to allow the user to enter an empty string at the context
expression prompt (previously an error; now treated as "nil"), and to
cause a "nil" context expression to produce no context output in the
trace buffer.
(trace--read-args): Removed function. Replaced by the combination of
`trace--read-function' and `trace--read-extra-args'.
(trace-function-foreground, trace-function-background): Updated
interactive specs to use the new functions.
(trace--read-library, trace--library-defuns, trace--library-autoloads)
(trace--library-provides-autoload-p): New functions for establishing
traceable functions related to specific libraries.
(trace--after-load-alist): New variable.
(trace--after-load, trace--after-load-function)
(trace--remove-after-load, trace--remove-after-load-all):
New functions for optionally re-processing the `trace-regexp',
`untrace-regexp', and `trace-library' calls via
`after-load-functions'.
Sean Whitton [Thu, 7 Jul 2022 16:34:04 +0000 (09:34 -0700)]
Use notmuch thread:{} operator instead of performing two searches
This also avoids some command line length limit problems (bug#56442).
* gnus-search.el (gnus-search-run-search): Delete notmuch method.
(gnus-search-indexed-search-command): In the notmuch method, when
searching for threads, wrap whole query in thread:{} operator, and
always use --output=files, never --output=threads (bug#56442).
Restore how (read-from-minibuffer ... read-expression-map) worked
* lisp/simple.el (read-expression-map): Don't override RET and C-j
here, since that leads to breakages of other usages of this map
(bug#56548).
(read--expression-map): New map.
(read--expression): Use it.
Prune animation cache when images are no longer reachable
* lisp/image.el (image-animate-timeout): Eject cached animated
images that are no longer reachable (bug#56546).
* src/image.c (Fclear_image_cache): Allow specifying a cached
animated image to eject.
(gif_load, webp_load): Adjust what to use as the caching key --
the identity of the list itself is apparently changed by some
callers.
* lisp/language/indian.el ("Tamil"): Change the default input method
of the Tamil language environment to the new input method.
* lisp/leim/quail/indian.el
(quail-tamil-itrans-compute-syllable-table): New function extracted
from...
(quail-tamil-itrans-syllable-table): ... here. Use the above
function.
(quail-tamil-itrans--consonant-order): Auxiliary variable for the
above function.
(quail-tamil-itrans-compute-signs-table): Add new VARIOUS argument.
(quail-tamil-itrans-various-signs-and-digits-table)
(quail-tamil-itrans-various-signs-table): Adjust call to the above
function.
("tamil-phonetic"): Add new input method.
(tamil-input): New group for the input method.
(tamil-translation-rules): New defcustom for the input method to
change the translation rules.
(tamil--syllable-table, tamil--signs-table, tamil--hashtables)
(tamil--vowel-signs): Internal variables used by the input method.
(tamil--setter, tamil--make-tables)
(tamil--update-quail-rules): Internal functions for the input method.
(bug#56323)
Andrea Corallo [Fri, 8 Jul 2022 08:27:45 +0000 (10:27 +0200)]
Mark async worker tmp file as utf-8-emacs-unix (bug#48029)
* lisp/emacs-lisp/comp.el (comp-final): Mark async worker tmp file
as utf-8.
* test/src/comp-tests.el (48029-1): New test.
* test/src/comp-resources/comp-test-funcs.el
(comp-test-48029-nonascii-žžž-f): New function.
Michael Albinus [Wed, 13 Jul 2022 11:21:45 +0000 (13:21 +0200)]
Adapt Tramp version (don't merge)
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.5.3.28.2".
(customize-package-emacs-version-alist):
Add Tramp version integrated in Emacs 28.2.
Po Lu [Wed, 13 Jul 2022 03:01:59 +0000 (11:01 +0800)]
Fix closing displays when preserving selections is enabled
* src/frame.c (delete_frame): Bind `x-auto-preserve-selections'
to nil if deleting display.
* src/xselect.c (x_clear_frame_selections): Pass original frame
to that function.
* src/xterm.c (x_preserve_selections): Fix determining the new
owner.
(syms_of_xterm): New defsym `x-auto-preserve-selections'.
* src/xterm.h: Update prototypes.
* doc/emacs/files.texi (Image Mode): Adjust documentation.
* lisp/image/image-converter.el (image-convert): Let the converter
know whether it's a file or not.
Stefan Kangas [Tue, 12 Jul 2022 14:32:07 +0000 (16:32 +0200)]
Make pcomplete/{rsh,rlogin} into alias for pcomplete/ssh
* lisp/pcmpl-unix.el (pcomplete/rlogin, pcomplete/rsh): Make into
aliases for 'pcomplete/ssh', as "rsh" and "rlogin" is more often than
not aliases for "ssh" on modern machines.
* lisp/eshell/em-dirs.el (eshell-dirs-initialize): Properly handle
indexing for variable aliases.
* lisp/eshell/esh-var (eshell-variable-aliases-list): Properly handle
indexing for variable aliases, and add SIMPLE-FUNCTION entry for
aliases.
(eshell-get-variable): Update how variable alias functions are called.
* test/lisp/eshell/em-alias-tests.el
(em-alias-test/alias-arg-vars-indices)
(em-alias-test/alias-arg-vars-split-indices)
(em-alias-test/alias-all-args-var-split-indices):
* test/lisp/eshell/em-dirs-tests.el (em-dirs-test/pwd-var-indices)
(em-dirs-test/oldpwd-var-indices)
(em-dirs-test/directory-ring-var-indices):
* test/lisp/eshell/esh-var-tests.el
(esh-var-test/inside-emacs-var-split-indices)
(esh-var-test/last-result-var-split-indices): New tests.
(esh-var-test/last-arg-var-split-indices): Expand test to check
conversion behavior inside double quotes (bug#56509).
Jim Porter [Sat, 9 Jul 2022 01:41:07 +0000 (18:41 -0700)]
Allow Eshell variable aliases to point to other aliases
In particular, this resolves an issue where '$+' referenced the real
environment variable '$PWD' instead of the Eshell variable alias of
the same name. This meant that changing directories in Eshell
wouldn't update the value of '$+'.
* lisp/eshell/esh-var.el (eshell-get-variable): Allow Eshell variable
aliaes to point to other aliases.
* test/lisp/eshell/em-dirs-tests.el (em-dirs-test/pwd-var)
(em-dirs-test/short-pwd-var): Adapt tests to check this case
(bug#56509).
Jim Porter [Mon, 4 Jul 2022 03:05:29 +0000 (20:05 -0700)]
Improve tests/organization for built-in variables
* lisp/eshell/em-dirs.el (eshell-inside-emacs)
(eshell-dirs-initialize): Move 'INSIDE_EMACS' from here...
* lisp/eshell/esh-var.el (eshell-inside-emacs)
(eshell-variable-aliases-alist): ... to here, and improve doc string.
* test/lisp/eshell/eshell-tests.el (eshell-test/inside-emacs-var):
Move from here...
* test/lisp/eshell/esh-var-tests.el (esh-var-test/inside-emacs-var):
... to here.
(esh-var-test/last-arg-var-indices)
(esh-var-test/last-arg-var-split-indices): New tests.
* test/lisp/eshell/em-alias-tests.el:
* test/lisp/eshell/em-dirs-tests.el:
* test/lisp/eshell-em-script-tests.el: New files.
* doc/misc/eshell.texi (Built-ins): Fix 'cd' documentation; it works
with the directory ring, not the directory stack. Move built-in
variables documentation from here...
(Variables): ... to here, and add documentation for missing built-in
variables.
* src/buffer.c (Fmake_indirect_buffer): Kill the local
buffer-stale-function variable instead of setting it
buffer-locally to the default value. This should have the same
effect, but is less confusing.
Stefan Kangas [Tue, 12 Jul 2022 11:41:28 +0000 (13:41 +0200)]
Don't mention cl-cXXXr aliases in cl-lib manual
* doc/misc/cl.texi (Lists, List Functions, Efficiency Concerns): Don't
mention 'cl-cXXXr' compatibility aliases for built-in 'cXXXr'
functions. They shouldn't be used in new code.
Stefan Kangas [Tue, 12 Jul 2022 10:11:43 +0000 (12:11 +0200)]
Make remote-shell-program default to ssh only
* lisp/files.el (remote-shell-program): Default to "ssh" only. The
other commands in this list have severe security issues, and it is
easy enough for users to customize them manually if they want to.
See also the discussion in: https://debbugs.gnu.org/56461
* lisp/play/gomoku.el (gomoku-X): Use blue rather than green for
crosses on bright background for better legibility.
(Red for naughts could be adjusted but seems just about bearable.)
This fixes bug #56502. That function and these variables were manipulated by
the former file emacs-lisp/lmenu.el that was finally expunged from directory
obsolete/ by Stefan Kangas on 2020-05-15. There remain references to them in
the *.c, and *.m files.
* src/keyboard.c (syms_of_keyboard): Remove declarations of the symbol and
variable.