diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index 2a816221235..e8e79888ed8 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -1037,7 +1037,8 @@ starting at the first @samp{a}, it does. @cindex set of alternative characters, in regular expressions @cindex character set, in regular expressions @item @kbd{[ @dots{} ]} -is a @dfn{bracket expression}, which matches one of a set of characters. +is a @dfn{bracket expression} (a.k.a.@: @dfn{set of alternative +characters}), which matches one of a set of characters. In the simplest case, the characters between the two brackets are what this set can match. Thus, @samp{[ad]} matches either one @samp{a} or diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index e44b4aeb235..9886a3a6133 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -8528,7 +8528,7 @@ the effect of setting @code{ctl-arrow} to a non-@code{nil} value (make-glyph-code (+ i 64) 'escape-glyph))))) (aset disptab 127 (vector (make-glyph-code ?^ 'escape-glyph) - (make-glyph-code ?? 'escape-glyph))))) + (make-glyph-code ?? 'escape-glyph))) @end example @defun display-table-slot display-table slot diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 2f7412b4040..0f901b1d64f 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -853,7 +853,7 @@ native frame of @var{frame}). This tells on which side the tool bar on @var{frame} is and can be one of @code{left}, @code{top}, @code{right} or @code{bottom}. -The values @code{left} and @code{bottom} are only supported on builds +The values @code{left} and @code{right} are only supported on builds using the GTK+ toolkit; @code{bottom} is supported on all builds other than NS, and @code{top} is supported everywhere. diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 7c9893054d9..a0289d1f3cd 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -375,11 +375,13 @@ permits the whole expression to match is @samp{d}.) @item @samp{[ @dots{} ]} @cindex bracket expression (in regexp) +@cindex character alternative (in regexp) @cindex @samp{[} in regexp @cindex @samp{]} in regexp -is a @dfn{bracket expression}, which begins with @samp{[} and is -terminated by @samp{]}. In the simplest case, the characters between -the two brackets are what this bracket expression can match. +is a @dfn{bracket expression} (a.k.a.@: @dfn{character alternative}), +which begins with @samp{[} and is terminated by @samp{]}. In the +simplest case, the characters between the two brackets are what this +bracket expression can match. Thus, @samp{[ad]} matches either one @samp{a} or one @samp{d}, and @samp{[ad]*} matches any string composed of just @samp{a}s and @samp{d}s @@ -478,10 +480,10 @@ style; and although @samp{[*--]} is valid, @samp{[*+,-]} is clearer. @item @samp{[^ @dots{} ]} @cindex @samp{^} in regexp -@samp{[^} begins a @dfn{complemented bracket expression}. This -matches any character except the ones specified. Thus, -@samp{[^a-z0-9A-Z]} matches all characters @emph{except} ASCII letters and -digits. +@samp{[^} begins a @dfn{complemented bracket expression}, or +@dfn{complemented character alternative}. This matches any character +except the ones specified. Thus, @samp{[^a-z0-9A-Z]} matches all +characters @emph{except} ASCII letters and digits. @samp{^} is not special in a bracket expression unless it is the first character. The character following the @samp{^} is treated as if it @@ -588,13 +590,13 @@ an unquoted @samp{[} is special again and a @samp{]} not. @cindex alpha character class, regexp @cindex xdigit character class, regexp - Below is a table of the classes you can use in a bracket -expression, and what they mean. Note that the @samp{[} and @samp{]} -characters that enclose the class name are part of the name, so a -regular expression using these classes needs one more pair of -brackets. For example, a regular expression matching a sequence of -one or more letters and digits would be @samp{[[:alnum:]]+}, not -@samp{[:alnum:]+}. + Below is a table of the classes you can use in a bracket expression +(@pxref{Regexp Special, bracket expression}), and what they mean. +Note that the @samp{[} and @samp{]} characters that enclose the class +name are part of the name, so a regular expression using these classes +needs one more pair of brackets. For example, a regular expression +matching a sequence of one or more letters and digits would be +@samp{[[:alnum:]]+}, not @samp{[:alnum:]+}. @table @samp @item [:ascii:] @@ -2993,6 +2995,24 @@ POSIX does not define how other BRE escapes behave; for example, GNU @command{grep} treats @samp{\|} like Emacs does, but does not support all the Emacs escapes. +@item +In POSIX BREs, it is an implementation option whether @samp{^} is special +after @samp{\(}; GNU @command{grep} treats it like Emacs does. +In POSIX EREs, @samp{^} is always special outside of bracket expressions, +which means the ERE @samp{x^} never matches. +In Emacs regular expressions, @samp{^} is special only at the +beginning of the regular expression, or after @samp{\(}, @samp{\(?:} +or @samp{\|}. + +@item +In POSIX BREs, it is an implementation option whether @samp{$} is +special before @samp{\)}; GNU @command{grep} treats it like Emacs +does. In POSIX EREs, @samp{$} is always special outside of bracket +expressions (@pxref{Regexp Special, bracket expressions}), which means +the ERE @samp{$x} never matches. In Emacs regular expressions, +@samp{$} is special only at the end of the regular expression, or +before @samp{\)} or @samp{\|}. + @item In POSIX EREs @samp{@{}, @samp{(} and @samp{|} are special, and @samp{)} is special when matched with a preceding @samp{(}. @@ -3005,23 +3025,6 @@ POSIX does not define how other ERE escapes behave; for example, GNU @samp{grep -E} treats @samp{\1} like Emacs does, but does not support all the Emacs escapes. -@item -In POSIX BREs, it is an implementation option whether @samp{^} is special -after @samp{\(}; GNU @command{grep} treats it like Emacs does. -In POSIX EREs, @samp{^} is always special outside of bracket expressions, -which means the ERE @samp{x^} never matches. -In Emacs regular expressions, @samp{^} is special only at the -beginning of the regular expression, or after @samp{\(}, @samp{\(?:} -or @samp{\|}. - -@item -In POSIX BREs, it is an implementation option whether @samp{$} is special -before @samp{\)}; GNU @command{grep} treats it like Emacs does. -In POSIX EREs, @samp{$} is always special outside of bracket expressions, -which means the ERE @samp{$x} never matches. -In Emacs regular expressions, @samp{$} is special only at the -end of the regular expression, or before @samp{\)} or @samp{\|}. - @item In POSIX BREs and EREs, undefined results are produced by repetition operators at the start of a regular expression or subexpression diff --git a/etc/NEWS b/etc/NEWS index 08bf7599274..487eaf22feb 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -425,6 +425,15 @@ completion based on dictionaries that the server supports. *** 'pp-to-string' takes an additional 'pp-function' argument. This arg specifies the prettifying algorithm to use. + +** Emacs Lisp mode + +--- +*** ',@' now has 'prefix' syntax +Previously, the '@' character, which normally has 'symbol' syntax, +would combine with a following Lisp symbol and interfere with symbol +searching. + * New Modes and Packages in Emacs 30.1 diff --git a/lisp/leim/quail/latin-ltx.el b/lisp/leim/quail/latin-ltx.el index 21a01c85737..9be3d722504 100644 --- a/lisp/leim/quail/latin-ltx.el +++ b/lisp/leim/quail/latin-ltx.el @@ -244,7 +244,8 @@ system, including many technical ones. Examples: ;; (which is \varphi) are reversed in `ucs-names', so we define ;; them manually. Also ignore "GREEK SMALL LETTER EPSILON" and ;; add the correct value for \epsilon manually. - (unless (string-match-p "\\<\\(?:PHI\\|GREEK SMALL LETTER EPSILON\\)\\>" name) + (unless (string-match-p "\\" + name) (concat "\\" (funcall (if (match-end 1) #' capitalize #'downcase) (match-string 2 name))))) "\\`GREEK \\(?:SMALL\\|CAPITA\\(L\\)\\) LETTER \\([^- ]+\\)\\'") diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 40ea47ede40..bb7b266dd35 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -32,7 +32,6 @@ (require 'ansi-color) (require 'auth-source) (require 'format-spec) -(require 'ls-lisp) ;; Due to `tramp-handle-insert-directory'. (require 'parse-time) (require 'shell) (require 'subr-x) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index e214d610c91..48467a92c14 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -114,6 +114,7 @@ (declare-function zeroconf-service-host "zeroconf") (declare-function zeroconf-service-port "zeroconf") (declare-function zeroconf-service-txt "zeroconf") +(defvar tramp-gvfs-dbus-event-vector) ;; We don't call `dbus-ping', because this would load dbus.el. (defconst tramp-gvfs-enabled @@ -882,8 +883,6 @@ Operations not mentioned here will be handled by the default Emacs primitives.") (let ((method (tramp-file-name-method vec))) (and (stringp method) (member method tramp-gvfs-methods))))) -(defvar tramp-gvfs-dbus-event-vector) - ;;;###tramp-autoload (defun tramp-gvfs-file-name-handler (operation &rest args) "Invoke the GVFS related OPERATION and ARGS. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index fb8112c384d..da34f31fea6 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -38,6 +38,7 @@ (declare-function dired-compress-file "dired-aux") (declare-function dired-remove-file "dired-aux") (defvar dired-compress-file-suffixes) +(defvar ls-lisp-use-insert-directory-program) ;; Added in Emacs 28.1. (defvar process-file-return-signal-string) (defvar vc-handled-backends) @@ -2551,7 +2552,7 @@ The method used must be an out-of-band method." (access-file filename "Reading directory")) (with-parsed-tramp-file-name (expand-file-name filename) nil (if (and (featurep 'ls-lisp) - (not (symbol-value 'ls-lisp-use-insert-directory-program))) + (not ls-lisp-use-insert-directory-program)) (tramp-handle-insert-directory filename switches wildcard full-directory-p) (when (stringp switches) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index b98dff3b536..2264ccd0707 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -63,6 +63,23 @@ (declare-function file-notify-rm-watch "filenotify") (declare-function netrc-parse "netrc") (defvar auto-save-file-name-transforms) +(defvar ls-lisp-use-insert-directory-program) +(defvar tramp-prefix-format) +(defvar tramp-prefix-regexp) +(defvar tramp-method-regexp) +(defvar tramp-postfix-method-format) +(defvar tramp-postfix-method-regexp) +(defvar tramp-prefix-ipv6-format) +(defvar tramp-prefix-ipv6-regexp) +(defvar tramp-postfix-ipv6-format) +(defvar tramp-postfix-ipv6-regexp) +(defvar tramp-postfix-host-format) +(defvar tramp-postfix-host-regexp) +(defvar tramp-remote-file-name-spec-regexp) +(defvar tramp-file-name-structure) +(defvar tramp-file-name-regexp) +(defvar tramp-completion-method-regexp) +(defvar tramp-completion-file-name-regexp) ;; Reload `tramp-compat' when we reload `tramp-autoloads' of the GNU ;; ELPA package. @@ -824,23 +841,6 @@ Customize. See also `tramp-change-syntax'." :initialize #'custom-initialize-default :set #'tramp-set-syntax) -(defvar tramp-prefix-format) -(defvar tramp-prefix-regexp) -(defvar tramp-method-regexp) -(defvar tramp-postfix-method-format) -(defvar tramp-postfix-method-regexp) -(defvar tramp-prefix-ipv6-format) -(defvar tramp-prefix-ipv6-regexp) -(defvar tramp-postfix-ipv6-format) -(defvar tramp-postfix-ipv6-regexp) -(defvar tramp-postfix-host-format) -(defvar tramp-postfix-host-regexp) -(defvar tramp-remote-file-name-spec-regexp) -(defvar tramp-file-name-structure) -(defvar tramp-file-name-regexp) -(defvar tramp-completion-method-regexp) -(defvar tramp-completion-file-name-regexp) - (defun tramp-set-syntax (symbol value) "Set SYMBOL to value VALUE. Used in user option `tramp-syntax'. There are further variables @@ -4412,6 +4412,7 @@ Let-bind it when necessary.") (defun tramp-handle-insert-directory (filename switches &optional wildcard full-directory-p) "Like `insert-directory' for Tramp files." + (require 'ls-lisp) (unless switches (setq switches "")) ;; Mark trailing "/". (when (and (directory-name-p filename) @@ -4424,7 +4425,6 @@ Let-bind it when necessary.") (with-tramp-progress-reporter v 0 (format "Opening directory %s" filename) (let (ls-lisp-use-insert-directory-program start) ;; Silence byte compiler. - (ignore ls-lisp-use-insert-directory-program) (tramp-run-real-handler #'insert-directory (list filename switches wildcard full-directory-p)) diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 42f234790c5..9a72eb5f314 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -6132,9 +6132,13 @@ supported." (with-temp-buffer (insert (orgtbl-to-orgtbl table params)) (org-table-align) - (replace-regexp-in-string - "-|" "-+" - (replace-regexp-in-string "|-" "+-" (buffer-substring 1 (buffer-size)))))) + (goto-char (point-min)) + (while (search-forward "-|" nil t) + (replace-match "-+")) + (goto-char (point-min)) + (while (search-forward "|-" nil t) + (replace-match "+-")) + (buffer-string))) (defun orgtbl-to-unicode (table params) "Convert the `orgtbl-mode' TABLE into a table with unicode characters. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 7d5d786dea3..dff79ba7773 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -3769,8 +3769,9 @@ If NOERROR, return predicate, else erroring function." (if peg-after-p (make-overlay (point) (1+ (point)) nil t) (make-overlay (1- (point)) (point) nil nil nil))) - (do-it (label lpad rpad firstp) - (let* ((tweak-cursor-p (and firstp peg-after-p)) + (do-it (label lpad rpad i) + (let* ((firstp (zerop i)) + (tweak-cursor-p (and firstp peg-after-p)) (ov (make-ov)) (text (concat lpad label rpad))) (when tweak-cursor-p (put-text-property 0 1 'cursor 1 text)) @@ -3781,17 +3782,18 @@ If NOERROR, return predicate, else erroring function." (1 'eglot-type-hint-face) (2 'eglot-parameter-hint-face) (_ 'eglot-inlay-hint-face)))) + (overlay-put ov 'priority i) (overlay-put ov 'eglot--inlay-hint t) (overlay-put ov 'evaporate t) (overlay-put ov 'eglot--overlay t)))) - (if (stringp label) (do-it label left-pad right-pad t) + (if (stringp label) (do-it label left-pad right-pad 0) (cl-loop for i from 0 for ldetail across label do (eglot--dbind ((InlayHintLabelPart) value) ldetail (do-it value (and (zerop i) left-pad) (and (= i (1- (length label))) right-pad) - (zerop i)))))))))) + i))))))))) (jsonrpc-async-request (eglot--current-server-or-lose) :textDocument/inlayHint diff --git a/src/minibuf.c b/src/minibuf.c index d5f95968ae1..bcb7eb9375d 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1266,9 +1266,6 @@ minibuffer_unwind (void) set_window_buffer (window, Fcar (entry), 0, 0); Fset_window_start (window, Fcar (Fcdr (entry)), Qnil); Fset_window_point (window, Fcar (Fcdr (Fcdr (entry)))); - /* set-window-configuration may/will have unselected the - mini-window as the selected window. Restore it. */ - Fset_frame_selected_window (exp_MB_frame, window, Qnil); } else set_window_buffer (window, nth_minibuffer (0), 0, 0);