All-ASCII strings cannot have substrings with non-ASCII characters in
them; use this fact to avoid searching entirely.
* src/fns.c (Fstring_search): For multibyte non-ASCII needle and
unibyte haystack, don't check if the haystack is all-ASCII; it's a
waste of time. For multibyte non-ASCII needle and multibyte
all-ASCII haystack, fail immediately.
* test/src/fns-tests.el (string-search): Add more test cases.
Alan Mackenzie [Thu, 19 Nov 2020 10:31:50 +0000 (10:31 +0000)]
In attempted recursive minibuffer use, display error message in correct frame
This was problematic when minibuffer-follows-selected-frame was non-nil.
Introduce a new parameter DONT-SET-FRAME to set-window-configuration.
* doc/lispref/windows.texi (Window Configurations): Describe the new &optional
parameter to set-window-configuration.
* etc/NEWS (Lisp Changes): Note the new parameter to set-window-configuration.
* src/keyboard.c (read_char_help_form_unwind): Add a new Qnil argument to the
call of Fset_window_configuration.
* src/minibuf.c (read_minibuf): Cons up a Qt with the window configuration in
the argument to record_unwind_protect for the window configuration (twice).
* src/window.c (Fset_window_configuration): Add the new &optional parameter
and document it in the doc string. At the final do_switch_frame operation,
restore the original frame when DONT-SET-FRAME is non-nil.
(restore_window_configuration): Handle the new parameter when the supplied
argument is a cons.
Stefan Kangas [Thu, 19 Nov 2020 05:12:25 +0000 (06:12 +0100)]
Add new variable cperl-tags-file-name
* lisp/progmodes/cperl-mode.el (cperl-tags-file-name): New variable.
(cperl-write-tags): Use above new variable instead of hardcoding
filename "TAGS". (Bug#8802)
This avoids unnecessary body duplication in expansion and macro
recursion (causing macro-expansions at runtime), making it clearer
what is going on.
* lisp/progmodes/gdb-mi.el (gdb-wait-for-pending): Make it a function,
remove lambda quoting, η-reduce and simplify.
(gdb-thread-exited, gdb-thread-selected): Adapt callers.
The :local tag does not currently work as intended (it results in a
default value of bibtex-unify-case-convert of nil rather than
identity), and no other bibtex.el user option is automatically
buffer-local, so revert this recent change.
For discussion, see the following emacs-devel thread:
https://lists.gnu.org/r/emacs-devel/2020-11/msg00734.html
* lisp/textmodes/bibtex.el (bibtex-unify-case-convert): Don't make
automatically buffer-local for consistency with other user options,
and because the :local tag doesn't have the intended results.
Michael Albinus [Wed, 18 Nov 2020 10:32:38 +0000 (11:32 +0100)]
Preserve `dired-filename' text properties in Tramp
* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory):
Restore `dired-filename' text property, which has been destroyed
by `decode-coding-region'. (Bug#44682)
Alan Mackenzie [Tue, 17 Nov 2020 16:51:49 +0000 (16:51 +0000)]
Enhance syntax-tests.el to test nestable comments (Lisp style)
Also add some tests for braces and parse-partial-sexp amongst Lisp style
comments.
* test/src/syntax-tests.el (\;-in, \;-out): Add syntax for { and }.
(top-level): Add new tests for Lisp style comments.
(\#|-in, \#|-out): New functions.
(top-level): Add new tests for nested Lisp style comments, and mixtures of
nested comments with "ordinary" comments.
* test/src/syntax-resources/syntax-comments.txt (top-level): Add new test
fragments for #|...|#, etc.
Stefan Kangas [Tue, 17 Nov 2020 11:13:13 +0000 (12:13 +0100)]
Add command to filter package menu by name or description
* lisp/emacs-lisp/package.el (package-menu-filter-by-description):
(package-menu-filter-by-name-or-description): New commands to filter
the package menu. (Bug#44699)
(package-menu-mode-map): Bind the above new commands.
(package-menu-mode-menu): Add new commands to the menu.
* doc/emacs/package.texi (Package Menu): Document new commands.
Ruthra Kumar [Mon, 16 Nov 2020 22:04:36 +0000 (23:04 +0100)]
Use 'eshell-find-alias-function' instead of fboundp
* lisp/eshell/esh-cmd.el (eshell-invoke-directly): Fix problem
with (require 'em-tramp) making password prompting from "sudo
bash" no longer work (bug#43772).
Glenn Morris [Mon, 16 Nov 2020 17:05:31 +0000 (09:05 -0800)]
Merge from origin/emacs-27
75723ec212 (origin/emacs-27) ; * lisp/emacs-lisp/benchmark.el (benchm... 53e2a612ad ; * lib-src/make-fingerprint.c: Update commentary. 286c632772 Reformat argument commentary in etags.c 4ec740866a Make the invocation of combine-change-calls in comment-reg... 66bcec8838 * lisp/progmodes/cc-langs.el (c-<>-notable-chars-re): Fix ... 03eeab469e ; Update the expected result files in test/manual/etags. d875a22bc6 Update the various INSTALL files
Glenn Morris [Mon, 16 Nov 2020 16:59:47 +0000 (08:59 -0800)]
Merge from origin/emacs-27
19da602991 Fix input method translation near read-only text 5aabf2cc7f Fix display of truncated R2L lines on TTY frames daff3bda10 Avoid crashes when a reversed glyph row starts with a comp... b697bb91a1 ; * .gitignore: src/fingerprint.c not generated since 2019...
Juri Linkov [Sun, 15 Nov 2020 20:32:39 +0000 (22:32 +0200)]
New user options 'copy-region-blink-delay' and 'delete-pair-blink-delay'
* lisp/emacs-lisp/lisp.el (delete-pair-blink-delay): New defcustom.
(delete-pair): Use it. (Bug#4136)
* lisp/simple.el (copy-region-blink-delay): New defcustom.
(indicate-copied-region): Use it. (Bug#42865)
Thanks to Sean Whitton <spwhitton@spwhitton.name>.
(indicate-copied-region): Use 'query-replace-descr' not to show
newlines literally. Use "Copied text" instead of misleading
"Saved text" (bug#42865).
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
The comments above the regexp for the 'gnu' rule contained
references to the previous string regexp, which has been difficult
to follow ever since the translation to rx. Move the comments
to their proper places, and add some guiding notes.
Alan Mackenzie [Sun, 15 Nov 2020 13:23:15 +0000 (13:23 +0000)]
Make the invocation of combine-change-calls in comment-region valid
This fixes bug #44581. The problem was that whitespace outside of the (BEG
END) region was being deleted, and this made the invocation of
combine-change-calls with (BEG END) invalid.
* lisp/newcomment.el (comment-region-default): Amend the second argument to
combine-change-calls.
Stefan Kangas [Sun, 15 Nov 2020 01:41:36 +0000 (02:41 +0100)]
Make initial frame match frame-title-format
* src/xterm.c (x_term_init):
* src/w32term.c (w32_initialize_display_info): Sync initial frame
title with new value of Vframe_title_format.
Problem reported by Angelo Graziosi <angelo.g0@libero.it>.
Stefan Kangas [Sat, 14 Nov 2020 23:53:32 +0000 (00:53 +0100)]
Run menu-item :filter function before showing binding
* lisp/help.el (describe-map): Fix running `menu-item' :filter
functions. This fixes a mistake in the previous conversion of this
defun from the old C function describe_map. See the discussion in
Bug#39149.
* test/src/keymap-tests.el
(keymap---get-keyelt/runs-menu-item-filter)
(describe-buffer-bindings/menu-item-filter-show-binding)
(describe-buffer-bindings/menu-item-filter-hide-binding):
New tests.
(keymap-tests--test-menu-item-filter): New defun.
Eli Zaretskii [Sat, 14 Nov 2020 13:55:35 +0000 (15:55 +0200)]
Update the various INSTALL files
* nt/INSTALL.W64:
* nt/INSTALL:
* INSTALL: Update the installation information, in particular the
fact that HarfBuzz is now preferred as the shaping library.
Eli Zaretskii [Sat, 14 Nov 2020 13:20:30 +0000 (15:20 +0200)]
Fix input method translation near read-only text
* lisp/international/quail.el (quail-input-method): Don't disable
input method when the character after point has the read-only
property. Suggested by Evgeny Zajcev <lg.zevlg@gmail.com>
(Bug#44466)
* doc/emacs/mule.texi (Input Methods): Document that input methods
are inhibited in read-only text.
Eli Zaretskii [Sat, 14 Nov 2020 13:02:13 +0000 (15:02 +0200)]
Make Calc windows dedicated by default
* lisp/calc/calc.el (calc-make-windows-dedicated): New defcustom.
(calc, calc-trail-display): Set Calc windows dedicated if
calc-make-windows-dedicated is non-nil. Patch by Boruch Baum
<boruch_baum@gmx.com>. (Bug#44108)
Eli Zaretskii [Sat, 14 Nov 2020 12:43:42 +0000 (14:43 +0200)]
Make 'prefer-utf-8' heed inhibit-*-detection variables
* lisp/international/mule-conf.el (prefer-utf-8): Inhibit
detection of null bytes and ISO escape sequences if the respective
inhibit-*-detection variables say so. (Bug#44486)
Jared Finder [Sun, 1 Nov 2020 05:25:47 +0000 (21:25 -0800)]
Face-changing text properties and help-echo now work with xterm-mouse.
* src/dispnew.c (update_mouse_position): New function for mouse
movement logic in 'handle_one_term_event' that can be shared across
different mouse backends.
(display--update-for-mouse-movement): New lisp function, call it.
* lisp/xt-mouse.el (xterm-mouse--handle-mouse-movement): New function
that calls 'display--update-for-mouse-movement'.
(xterm-mouse-translate-1): Call it.
* src/term.c (handle_one_term_event): Inline logic from
'term_mouse_movement' and call 'update_mouse_position'.
(term_mouse_movement): Delete.
Eli Zaretskii [Sat, 14 Nov 2020 11:56:12 +0000 (13:56 +0200)]
Fix display of truncated R2L lines on TTY frames
* src/xdisp.c (extend_face_to_end_of_line): Use a while-loop, not
a do-while loop, to avoid appending an extra glyph at the end of a
line that is one character shorter than the window-width. This is
needed to fix display of reversed glyph rows that are almost as
wide as the window, because append_space_for_newline already added
one space glyph.
Eli Zaretskii [Sat, 14 Nov 2020 11:43:16 +0000 (13:43 +0200)]
Avoid crashes when a reversed glyph row starts with a composition
* src/dispnew.c (build_frame_matrix_from_leaf_window): Add an
assertion to prevent us from overwriting non-char glyphs with the
vertical border glyph.
* src/xdisp.c (extend_face_to_end_of_line): Account for one glyph
possibly inserted by append_space_for_newline. (Bug#44506)
Remove a kludgey correction for an off-by-one error in column
counting, which is no longer needed.
Eric Abrahamsen [Wed, 11 Nov 2020 18:48:37 +0000 (10:48 -0800)]
Save instantiated gnus-search engines in an alist
So we aren't re-instantiating (and potentially configuring) them with
every search.
* lisp/gnus/gnus-search.el (gnus-search-engine-instance-alist): New
variable holding server->engine mapping.
(gnus-search-server-to-engine): See if we've already instantiated this
server. If so, return it. If not, instantiate it and save in the above
variable.
(gnus-search-shutdown): Shutdown function clearing the above alist.
Eric Abrahamsen [Fri, 13 Nov 2020 04:02:09 +0000 (20:02 -0800)]
Make sure Gnus search groups search topics recursively
* lisp/gnus/gnus-group.el (gnus-group-make-search-group,
gnus-group-read-ephemeral-search-group): If a search is initiated from
a topic line, make sure we get all the groups under that topic (and
under sub-topics).
* lisp/international/ucs-normalize.el
(quick-check-composition-list-to-regexp): Don't add an explicit
pattern for U+1161..U+1175 and U+11a8..U+11c2 since these are already
part of `combining-chars'.
Michael Albinus [Fri, 13 Nov 2020 15:55:08 +0000 (16:55 +0100)]
Some minor Tramp fixes, resulting from test campaign
* lisp/net/tramp.el (tramp-handle-write-region):
* lisp/net/tramp-adb.el (tramp-adb-handle-write-region):
* lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
* lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Use `current-time'
if needed.
* lisp/net/tramp-gvfs.el (tramp-gvfs-gio-mapping):
(tramp-gvfs-do-copy-or-rename-file): Remove "gvfs-rename", it is
not trustworthy.
* test/lisp/net/tramp-tests.el (tramp-test07-file-exists-p): Check also for
symlinked files in trash.
(tramp-test20-file-modes): Revert last change, it was a thinko.
Robert Pluim [Thu, 12 Nov 2020 15:51:49 +0000 (16:51 +0100)]
Emit required version when Harfbuzz is not found but Cairo is
* configure.ac: Define harfbuzz_required_ver with required
harfbuzz version, and put it in the warning message emitted when
Cairo is found but not HarfBuzz.
* lisp/progmodes/project.el (project-find-file): Don't say
anything about recognizing file names, as that may lead the user
to think that it'll check whether the string at point is an
existing file (bug#44588).
Stefan Kangas [Mon, 9 Nov 2020 21:23:04 +0000 (22:23 +0100)]
Fix mistake in describe-buffer-bindings
* src/keymap.c (Fdescribe_buffer_bindings): Fix a call in
describe-buffer-bindings. This fixes a mistake in my previous commit
to prefer the Lisp version of describe-map-tree (8a1441310aa1), where
0 was accidentally converted to Qt in two places.
Eli Zaretskii [Wed, 11 Nov 2020 19:46:43 +0000 (21:46 +0200)]
Avoid crashes in the daemon due to user interaction
* src/minibuf.c (read_minibuf): Avoid crashes in the daemon if the
init file invokes some kind of minibuffer interaction, by not
updating the selected frame if it's the initial frame.
(Bug#44583)
Juri Linkov [Wed, 11 Nov 2020 19:18:31 +0000 (21:18 +0200)]
In dired-query use read-char-from-minibuffer with bound help-char (bug#42708)
* lisp/dired-aux.el (dired-query): Replace read-char-choice call
with read-char-from-minibuffer.
* lisp/subr.el (read-char-choice): Restore the previous version
that uses read-key.
(read-char-from-minibuffer): Bind help-char to help-form-show
when help-form is non-nil.
* lisp/progmodes/python.el
(python-font-lock-keywords-maximum-decoration): `symbol-name'
should not be quantified by a `+' as it is redundant and performs
very badly (bug#44572).