diff --git a/configure.ac b/configure.ac index fc95bcd09b6..b4fed263cf5 100644 --- a/configure.ac +++ b/configure.ac @@ -4185,8 +4185,12 @@ XWIDGETS_OBJ= if test "$with_xwidgets" != "no"; then if test "$USE_GTK_TOOLKIT" = "GTK3" && test "$window_system" != "none"; then WEBKIT_REQUIRED=2.12 - WEBKIT_MODULES="webkit2gtk-4.0 >= $WEBKIT_REQUIRED" + WEBKIT_MODULES="webkit2gtk-4.1 >= $WEBKIT_REQUIRED" EMACS_CHECK_MODULES([WEBKIT], [$WEBKIT_MODULES]) + if test "$HAVE_WEBKIT" = "no"; then + WEBKIT_MODULES="webkit2gtk-4.0 >= $WEBKIT_REQUIRED" + EMACS_CHECK_MODULES([WEBKIT], [$WEBKIT_MODULES]) + fi HAVE_XWIDGETS=$HAVE_WEBKIT XWIDGETS_OBJ="xwidget.o" if test "$HAVE_X_WINDOWS" = "yes" && test "${with_cairo}" = "no"; then diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index deb1021283f..55f07e86f76 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -2553,7 +2553,7 @@ variable names have underscores replaced with dashes. For instance, @code{mode_line_format} stores the value of @code{mode-line-format}. @item overlays -The inveral tree containing this buffer's overlays. +The interval tree containing this buffer's overlays. @item last_selected_window This is the last window that was selected with this buffer in it, or @code{nil} diff --git a/doc/misc/org.org b/doc/misc/org.org index 14699e77395..ad889a5c622 100644 --- a/doc/misc/org.org +++ b/doc/misc/org.org @@ -5291,7 +5291,7 @@ The following commands help to work with properties: Set a property in the current entry. Both the property and the value can be inserted using completion. -- {{{kbd(S-RIGHT)}}} (~org-property-next-allowed-values~), {{{kbd(S-LEFT)}}} (~org-property-previous-allowed-value~) :: +- {{{kbd(S-RIGHT)}}} (~org-property-next-allowed-value~), {{{kbd(S-LEFT)}}} (~org-property-previous-allowed-value~) :: #+kindex: S-RIGHT #+kindex: S-LEFT @@ -10252,9 +10252,9 @@ the other commands, point needs to be in the desired line. Unmark entry for bulk action. -- {{{kbd(U)}}} (~org-agenda-bulk-remove-all-marks~) :: +- {{{kbd(U)}}} (~org-agenda-bulk-unmark-all~) :: #+kindex: U - #+findex: org-agenda-bulk-remove-all-marks + #+findex: org-agenda-bulk-unmark-all Unmark all marked entries for bulk action. @@ -11692,9 +11692,9 @@ When the variable ~org-export-dispatch-use-expert-ui~ is set to a non-~nil~ value, Org prompts in the minibuffer. To switch back to the hierarchical menu, press {{{kbd(?)}}}. -- {{{kbd(C-c C-e)}}} (~org-export~) :: +- {{{kbd(C-c C-e)}}} (~org-export-dispatch~) :: #+kindex: C-c C-e - #+findex: org-export + #+findex: org-export-dispatch Invokes the export dispatcher interface. The options show default settings. The {{{kbd(C-u)}}} prefix argument preserves options from @@ -12232,7 +12232,7 @@ with the custom ID =theory=, you can use The following command allows navigating to the included document: -- {{{kbd(C-c ')}}} (~org-edit~special~) :: +- {{{kbd(C-c ')}}} (~org-edit-special~) :: #+kindex: C-c ' #+findex: org-edit-special @@ -14363,10 +14363,10 @@ executable. Without it, export cannot finish. :DESCRIPTION: Invoking export. :END: -- {{{kbd(C-c C-e o o)}}} (~org-export-to-odt~) :: +- {{{kbd(C-c C-e o o)}}} (~org-odt-export-to-odt~) :: #+kindex: C-c C-e o o - #+findex: org-export-to-odt + #+findex: org-odt-export-to-odt Export as OpenDocument Text file. #+cindex: @samp{EXPORT_FILE_NAME}, property diff --git a/etc/NEWS b/etc/NEWS index 840705d8613..c212fb29cc6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -83,50 +83,9 @@ mistaken compositions, this will now work as well. This works like 'kill-matching-buffers', but without asking for confirmation. -+++ -** New helper variable 'transpose-sexps-function'. -Emacs now can set this variable to customize the behavior of the -'transpose-sexps' function. - -+++ -** New function 'transpose-sexps-default-function'. -The previous implementation is moved into its own function, to be -bound by 'transpose-sexps-function'. - -** New function 'treesit-transpose-sexps'. -Tree-sitter now unconditionally sets 'transpose-sexps-function' for all -tree-sitter enabled modes. This functionality utilizes the new -'transpose-sexps-function'. - -** Commands and variables to move by program statements - -*** New variable 'forward-sentence-function'. -Major modes can now set this variable to customize the behavior of the -'forward-sentence' command. - -*** New function 'forward-sentence-default-function'. -The previous implementation of 'forward-sentence' is moved into its -own function, to be bound by 'forward-sentence-function'. - -*** New buffer-local variable 'treesit-sentence-type-regexp'. -Similarly to 'treesit-defun-type-regexp', this variable is used to -define "sentences" in tree-sitter enabled modes. - -*** New function 'treesit-forward-sentence'. -All tree-sitter enabled modes that define 'treesit-sentence-type-regexp' -now set 'forward-sentence-function' to call 'treesit-forward-sentence'. - -*** New buffer-local variable 'treesit-sexp-type-regexp'. -Similarly to 'treesit-defun-type-regexp', this variable is used to -define "sexps" in tree-sitter enabled modes. - -*** New function 'treesit-forward-sexp'. -Tree-sitter conditionally sets 'forward-sexp-function' for major modes -that have defined 'treesit-sexp-type-regexp' to enable sexp-related -motion commands. - * Changes in Specialized Modes and Packages in Emacs 30.1 + --- ** Variable order and truncation can now be configured in 'gdb-many-windows'. The new user option 'gdb-locals-table-row-config' allows users to @@ -265,11 +224,59 @@ these built in programs in a subprocess. When a 'touchscreen-begin' or 'touchscreen-end' event is passed as the POSITION argument, it will behave as if that event was a mouse event. ++++ ** New functions for handling touch screen events. The new functions 'touch-screen-track-tap' and 'touch-screen-track-drag' handle tracking common touch screen gestures from within a command. +** Functions and variables to transpose sexps + ++++ +*** New helper variable 'transpose-sexps-function'. +Emacs now can set this variable to customize the behavior of the +'transpose-sexps' function. + ++++ +*** New function 'transpose-sexps-default-function'. +The previous implementation is moved into its own function, to be +bound by 'transpose-sexps-function'. + +*** New function 'treesit-transpose-sexps'. +Tree-sitter now unconditionally sets 'transpose-sexps-function' for all +tree-sitter enabled modes. This functionality utilizes the new +'transpose-sexps-function'. + +** Functions and variables to move by program statements + +*** New variable 'forward-sentence-function'. +Major modes can now set this variable to customize the behavior of the +'forward-sentence' command. + +*** New function 'forward-sentence-default-function'. +The previous implementation of 'forward-sentence' is moved into its +own function, to be bound by 'forward-sentence-function'. + +*** New buffer-local variable 'treesit-sentence-type-regexp'. +Similarly to 'treesit-defun-type-regexp', this variable is used to +define "sentences" in tree-sitter enabled modes. + +*** New function 'treesit-forward-sentence'. +All tree-sitter enabled modes that define 'treesit-sentence-type-regexp' +now set 'forward-sentence-function' to call 'treesit-forward-sentence'. + +** Functions and variables to move by program sexps + +*** New buffer-local variable 'treesit-sexp-type-regexp'. +Similarly to 'treesit-defun-type-regexp', this variable is used to +define "sexps" in tree-sitter enabled modes. + +*** New function 'treesit-forward-sexp'. +Tree-sitter conditionally sets 'forward-sexp-function' for major modes +that have defined 'treesit-sexp-type-regexp' to enable sexp-related +motion commands. +>>>>>>> origin/master + ** New or changed byte-compilation warnings --- diff --git a/lisp/comint.el b/lisp/comint.el index c5589324a14..9d2c245247f 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -383,7 +383,8 @@ This variable is buffer-local." "\\(?:" (regexp-opt password-word-equivalents) "\\|Response\\)" "\\(?:\\(?:, try\\)? *again\\| (empty for no passphrase)\\| (again)\\)?" ;; "[[:alpha:]]" used to be "for", which fails to match non-English. - "\\(?: [[:alpha:]]+ .+\\)?[[:blank:]]*[::៖][[:space:]]*\\'" + "\\(?: [[:alpha:]]+ .+\\)?[[:blank:]]*" + "[" (apply #'string password-colon-equivalents) "][[:space:]]*\\'" ;; The ccrypt encryption dialog doesn't end with a colon, so ;; treat it specially. "\\|^Enter encryption key: (repeat) *\\'" diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 833e88887f9..b578b99954c 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -2042,6 +2042,22 @@ If FOR-EFFECT is non-nil, the return value is assumed to be of no importance." (let ((side-effect-free (if byte-compile-delete-errors byte-compile-side-effect-free-ops byte-compile-side-effect-and-error-free-ops)) + ;; Ops taking and produce a single value on the stack. + (unary-ops '( byte-not byte-length byte-list1 byte-nreverse + byte-car byte-cdr byte-car-safe byte-cdr-safe + byte-symbolp byte-consp byte-stringp + byte-listp byte-integerp byte-numberp + byte-add1 byte-sub1 byte-negate + ;; There are more of these but the list is + ;; getting long and the gain is typically small. + )) + ;; Ops producing a single result without looking at the stack. + (producer-ops '( byte-constant byte-varref + byte-point byte-point-max byte-point-min + byte-following-char byte-preceding-char + byte-current-column + byte-eolp byte-eobp byte-bolp byte-bobp + byte-current-buffer byte-widen)) (add-depth 0) (keep-going 'first-time) ;; Create a cons cell as head of the list so that removing the first @@ -2151,31 +2167,39 @@ If FOR-EFFECT is non-nil, the return value is assumed to be of no importance." ;; be larger than necessary. (setq add-depth 1)) t))))) - ;; - ;; dup varset-X discard --> varset-X - ;; dup varbind-X discard --> varbind-X - ;; dup stack-set-X discard --> stack-set-X-1 - ;; (the varbind variant can emerge from other optimizations) - ;; - ((and (eq 'byte-dup (car lap0)) - (eq 'byte-discard (car lap2)) - (memq (car lap1) '(byte-varset byte-varbind - byte-stack-set))) - (setq keep-going t) + ;; + ;; dup varset discard(N) --> varset discard(N-1) + ;; dup varbind discard(N) --> varbind discard(N-1) + ;; dup stack-set(M) discard(N) --> stack-set(M-1) discard(N-1), M>1 + ;; (the varbind variant can emerge from other optimizations) + ;; + ((and (eq 'byte-dup (car lap0)) + (memq (car lap2) '(byte-discard byte-discardN)) + (or (memq (car lap1) '(byte-varset byte-varbind)) + (and (eq (car lap1) 'byte-stack-set) + (> (cdr lap1) 1)))) (setcdr prev (cdr rest)) ; remove dup - (setcdr (cdr rest) (cdddr rest)) ; remove discard - (cond ((not (eq (car lap1) 'byte-stack-set)) - (byte-compile-log-lap " %s %s %s\t-->\t%s" - lap0 lap1 lap2 lap1)) - ((eql (cdr lap1) 1) - (byte-compile-log-lap " %s %s %s\t-->\t" - lap0 lap1 lap2)) - (t - (let ((n (1- (cdr lap1)))) - (byte-compile-log-lap " %s %s %s\t-->\t%s" - lap0 lap1 lap2 - (cons (car lap1) n)) - (setcdr lap1 n))))) + (let ((new1 (if (eq (car lap1) 'byte-stack-set) + (cons 'byte-stack-set (1- (cdr lap1))) + lap1)) + (n (if (eq (car lap2) 'byte-discard) 1 (cdr lap2)))) + (setcar (cdr rest) new1) + (cl-assert (> n 0)) + (cond + ((> n 1) + (let ((new2 (if (> n 2) + (cons 'byte-discardN (1- n)) + (cons 'byte-discard nil)))) + (byte-compile-log-lap " %s %s %s\t-->\t%s %s" + lap0 lap1 lap2 new1 new2) + (setcar (cddr rest) new2))) + (t + (byte-compile-log-lap " %s %s %s\t-->\t%s" + lap0 lap1 lap2 new1) + ;; discard(0) = nop, remove + (setcdr (cdr rest) (cdddr rest))))) + (setq keep-going t)) + ;; ;; not goto-X-if-nil --> goto-X-if-non-nil ;; not goto-X-if-non-nil --> goto-X-if-nil @@ -2421,12 +2445,7 @@ If FOR-EFFECT is non-nil, the return value is assumed to be of no importance." ;; const, varref, point etc. ;; ((and (eq (car (nth 2 rest)) 'byte-return) - (memq (car lap1) '( byte-constant byte-varref - byte-point byte-point-max byte-point-min - byte-following-char byte-preceding-char - byte-current-column - byte-eolp byte-eobp byte-bolp byte-bobp - byte-current-buffer byte-widen)) + (memq (car lap1) producer-ops) (or (memq (car lap0) '( byte-discard byte-discardN byte-discardN-preserve-tos byte-stack-set)) @@ -2438,26 +2457,15 @@ If FOR-EFFECT is non-nil, the return value is assumed to be of no importance." lap0 lap1 (nth 2 rest) lap1 (nth 2 rest))) ;; - ;; discardN-preserve-tos OP return --> OP return - ;; dup OP return --> OP return - ;; where OP is 1->1 in stack use, like `not'. + ;; (discardN-preserve-tos|dup) UNARY return --> UNARY return + ;; where UNARY takes and produces a single value on the stack ;; ;; FIXME: ideally we should run this backwards, so that we could do ;; discardN-preserve-tos OP1...OPn return -> OP1..OPn return ;; but that would require a different approach. ;; ((and (eq (car (nth 2 rest)) 'byte-return) - (memq (car lap1) - '( byte-not - byte-symbolp byte-consp byte-stringp - byte-listp byte-integerp byte-numberp - byte-list1 - byte-car byte-cdr byte-car-safe byte-cdr-safe - byte-length - byte-add1 byte-sub1 byte-negate byte-nreverse - ;; There are more of these but the list is - ;; getting long and the gain is small. - )) + (memq (car lap1) unary-ops) (or (memq (car lap0) '(byte-discardN-preserve-tos byte-dup)) (and (eq (car lap0) 'byte-stack-set) (eql (cdr lap0) 1)))) @@ -2785,14 +2793,32 @@ If FOR-EFFECT is non-nil, the return value is assumed to be of no importance." (push newjmp (cdr rest))) t))))) - ;; - ;; const discardN-preserve-tos ==> discardN const - ;; const stack-set(1) ==> discard const - ;; - ((and (eq (car lap0) 'byte-constant) + ;; + ;; UNARY discardN-preserve-tos --> discardN-preserve-tos UNARY + ;; where UNARY takes and produces a single value on the stack + ;; + ((and (memq (car lap0) unary-ops) (or (eq (car lap1) 'byte-discardN-preserve-tos) (and (eq (car lap1) 'byte-stack-set) - (eql (cdr lap1) 1)))) + (eql (cdr lap1) 1))) + ;; unless followed by return (which will eat the discard) + (not (eq (car lap2) 'byte-return))) + (setq keep-going t) + (byte-compile-log-lap " %s %s\t-->\t%s %s" lap0 lap1 lap1 lap0) + (setcar rest lap1) + (setcar (cdr rest) lap0)) + + ;; + ;; PRODUCER discardN-preserve-tos(X) --> discard(X) PRODUCER + ;; where PRODUCER pushes a result without looking at the stack: + ;; const, varref, point etc. + ;; + ((and (memq (car lap0) producer-ops) + (or (eq (car lap1) 'byte-discardN-preserve-tos) + (and (eq (car lap1) 'byte-stack-set) + (eql (cdr lap1) 1))) + ;; unless followed by return (which will eat the discard) + (not (eq (car lap2) 'byte-return))) (setq keep-going t) (let ((newdiscard (if (eql (cdr lap1) 1) (cons 'byte-discard nil) @@ -2801,6 +2827,7 @@ If FOR-EFFECT is non-nil, the return value is assumed to be of no importance." " %s %s\t-->\t%s %s" lap0 lap1 newdiscard lap0) (setf (car rest) newdiscard) (setf (cadr rest) lap0))) + (t ;; If no rule matched, advance and try again. (setq prev (cdr prev)))))))) diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index 33bd0bfd5cd..bf49f274bfd 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -134,7 +134,10 @@ the `clone' function." (package-vc-install name spec)) ((listp spec) (package-vc--archives-initialize) - (package-vc--unpack (cadr pkg-descs) spec))))))) + (package-vc--unpack + (or (cadr (assoc name package-archive-contents)) + (package-desc-create :name name :kind 'vc)) + spec))))))) ;;;###autoload (defcustom package-vc-selected-packages '() @@ -269,9 +272,9 @@ Populate `package-vc--archive-spec-alist' with the result. If optional argument ASYNC is non-nil, perform the downloads asynchronously." (dolist (archive package-archives) - (condition-case-unless-debug nil + (condition-case err (package--download-one-archive archive "elpa-packages.eld" async) - (error (message "Failed to download `%s' archive." (car archive)))))) + (error (message "Failed to download `%s' archive: %S" (car archive) err))))) (add-hook 'package-read-archive-hook #'package-vc--read-archive-data 20) @@ -426,8 +429,8 @@ version of that package." ((let* ((pac package-archive-contents) (desc (cadr (assoc (car pkg) pac)))) (if desc - (let ((reqs (package-desc-reqs pkg))) - (push pkg to-install) + (let ((reqs (package-desc-reqs desc))) + (push desc to-install) (mapc #'search reqs)) (push pkg missing)))))) (version-order (a b) @@ -600,8 +603,6 @@ PKG-SPEC is a package specification, a property list describing how to fetch and build the package. See `package-vc--archive-spec-alist' for details. The optional argument REV specifies a specific revision to checkout. This overrides the `:branch' attribute in PKG-SPEC." - (unless pkg-desc - (setq pkg-desc (package-desc-create :name (car pkg-spec) :kind 'vc))) (pcase-let* (((map :lisp-dir) pkg-spec) (name (package-desc-name pkg-desc)) (dirname (package-desc-full-name pkg-desc)) diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 46c3c2fa175..1b8f5ff8018 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -172,7 +172,10 @@ inserted. They return the string as it should be inserted." :type 'hook) (defcustom eshell-password-prompt-regexp - (format "\\(%s\\)[^::៖]*[::៖]\\s *\\'" (regexp-opt password-word-equivalents)) + (format "%s[^%s]*[%s]\\s *\\'" + (regexp-opt password-word-equivalents t) + (apply #'string password-colon-equivalents) + (apply #'string password-colon-equivalents)) "Regexp matching prompts for passwords in the inferior process. This is used by `eshell-watch-for-password-prompt'." :type 'regexp diff --git a/lisp/international/emoji.el b/lisp/international/emoji.el index bcd4aac4f29..b920582fee0 100644 --- a/lisp/international/emoji.el +++ b/lisp/international/emoji.el @@ -68,38 +68,86 @@ representing names. For instance: (defvar emoji--all-bases nil) (defvar emoji--derived nil) (defvar emoji--names (make-hash-table :test #'equal)) -(defvar emoji--done-derived nil) (define-multisession-variable emoji--recent (list "😀" "😖")) (defvar emoji--insert-buffer) -;;;###autoload -(defun emoji-insert () +;;;###autoload (autoload 'emoji-insert "emoji" nil t) +(transient-define-prefix emoji-insert () "Choose and insert an emoji glyph." + :variable-pitch t + [:class transient-columns + :setup-children emoji--setup-suffixes + :description emoji--group-description] (interactive "*") (emoji--init) - (unless (fboundp 'emoji--command-Emoji) - (emoji--define-transient)) - (funcall (intern "emoji--command-Emoji"))) + (emoji--setup-prefix 'emoji-insert "Emoji" nil + `(("Recent" ,@(multisession-value emoji--recent)) + ,@emoji--labels))) -;;;###autoload -(defun emoji-recent () +;;;###autoload (autoload 'emoji-recent "emoji" nil t) +(transient-define-prefix emoji-recent () "Choose and insert one of the recently-used emoji glyphs." + :variable-pitch t + [:class transient-columns + :setup-children emoji--setup-suffixes + :description emoji--group-description] (interactive "*") (emoji--init) - (unless (fboundp 'emoji--command-Emoji) - (emoji--define-transient)) - (funcall (emoji--define-transient - (cons "Recent" (multisession-value emoji--recent)) t))) + (emoji--setup-prefix 'emoji-recent "Recent" t + (multisession-value emoji--recent))) -;;;###autoload -(defun emoji-search () +;;;###autoload (autoload 'emoji-search "emoji" nil t) +(transient-define-prefix emoji-search () "Choose and insert an emoji glyph by typing its Unicode name. This command prompts for an emoji name, with completion, and inserts it. It recognizes the Unicode Standard names of emoji, and also consults the `emoji-alternate-names' alist." + :variable-pitch t + [:class transient-columns + :setup-children emoji--setup-suffixes + :description emoji--group-description] (interactive "*") (emoji--init) - (emoji--choose-emoji)) + (pcase-let ((`(,glyph . ,derived) (emoji--read-emoji))) + (if derived + (emoji--setup-prefix 'emoji-search "Choose Emoji" + (list glyph) + (cons glyph derived)) + (emoji--add-recent glyph) + (insert glyph)))) + +(defun emoji--setup-prefix (command title done-derived spec) + (transient-setup + command nil nil + :scope (if (eq transient-current-command command) + (cons (oref (transient-suffix-object) title) + (oref (transient-suffix-object) done-derived)) + (cons title done-derived)) + :value (if (eq transient-current-command command) + (oref (transient-suffix-object) children) + spec))) + +(defun emoji--setup-suffixes (_) + (transient-parse-suffixes + (oref transient--prefix command) + (pcase-let ((`(,title . ,done-derived) (oref transient--prefix scope))) + (emoji--layout (oref transient--prefix command) title + (oref transient--prefix value) done-derived)))) + +(defun emoji--group-description () + (car (oref transient--prefix scope))) + +(defclass emoji--narrow (transient-suffix) + ((title :initarg :title) + (done-derived :initarg :done-derived) + (children :initarg :children))) + +(transient-define-suffix emoji-insert-glyph () + "Insert the emoji you selected." + (interactive nil not-a-mode) + (let ((glyph (oref (transient-suffix-object) description))) + (emoji--add-recent glyph) + (insert glyph))) ;;;###autoload (defun emoji-list () @@ -179,11 +227,10 @@ the name is not known." 'help-echo (emoji--name glyph)))) (insert "\n\n")))) -(defun emoji--fontify-glyph (glyph &optional inhibit-derived) +(defun emoji--fontify-glyph (glyph &optional done-derived) (propertize glyph 'face - (if (and (not inhibit-derived) - (or (null emoji--done-derived) - (not (gethash glyph emoji--done-derived))) + (if (and (not (or (eq done-derived t) + (member glyph done-derived))) (gethash glyph emoji--derived)) ;; If this emoji has derivations, use a special face ;; to tell the user. @@ -206,33 +253,30 @@ the name is not known." :interactive nil (setq-local truncate-lines t)) -(defun emoji-list-select (event) +;;;###autoload (autoload 'emoji-list-select "emoji" nil t) +(transient-define-prefix emoji-list-select (event) "Select the emoji under point." + :variable-pitch t + [:class transient-columns + :setup-children emoji--setup-suffixes + :description emoji--group-description] (interactive (list last-nonmenu-event) emoji-list-mode) (mouse-set-point event) (let ((glyph (get-text-property (point) 'emoji-glyph))) (unless glyph (error "No emoji under point")) - (let ((derived (gethash glyph emoji--derived)) - (end-func - (lambda () - (let ((buf emoji--insert-buffer)) - (quit-window) - (if (buffer-live-p buf) - (switch-to-buffer buf) - (error "Buffer disappeared")))))) - (if (not derived) - ;; Glyph without derivations. - (progn - (emoji--add-recent glyph) - (funcall end-func) - (insert glyph)) - ;; Pop up a transient to choose between derivations. - (let ((emoji--done-derived (make-hash-table :test #'equal))) - (setf (gethash glyph emoji--done-derived) t) - (funcall - (emoji--define-transient (cons "Choose Emoji" (cons glyph derived)) - nil end-func))))))) + (let ((buf emoji--insert-buffer)) + (quit-window) + (if (buffer-live-p buf) + (switch-to-buffer buf) + (error "Buffer disappeared"))) + (let ((derived (gethash glyph emoji--derived))) + (if derived + (emoji--setup-prefix 'emoji-list-select "Choose Emoji" + (list glyph) + (cons glyph derived)) + (emoji--add-recent glyph) + (insert glyph))))) (defun emoji-list-help () "Display the name of the emoji at point." @@ -476,97 +520,51 @@ the name is not known." (setq parent elem)) (nconc elem (list glyph))))) -(defun emoji--define-transient (&optional alist inhibit-derived - end-function) - (unless alist - (setq alist (cons "Emoji" emoji--labels))) - (let* ((mname (pop alist)) - (name (intern (format "emoji--command-%s" mname))) - (emoji--done-derived (or emoji--done-derived - (make-hash-table :test #'equal))) - (has-subs (consp (cadr alist))) - (layout - (if has-subs - ;; Define sub-maps. - (cl-loop for entry in - (emoji--compute-prefix - (if (equal mname "Emoji") - (cons (list "Recent") alist) - alist)) - collect (list - (car entry) - (emoji--compute-name (cdr entry)) - (if (equal (cadr entry) "Recent") - (emoji--recent-transient end-function) - (emoji--define-transient - (cons (concat mname " > " (cadr entry)) - (cddr entry)))))) - ;; Insert an emoji. - (cl-loop for glyph in alist - for i in (append (number-sequence ?a ?z) - (number-sequence ?A ?Z) - (number-sequence ?0 ?9) - (number-sequence ?! ?/)) - collect (let ((this-glyph glyph)) - (list - (string i) - (emoji--fontify-glyph - glyph inhibit-derived) - (let ((derived - (and (not inhibit-derived) - (not (gethash glyph - emoji--done-derived)) - (gethash glyph emoji--derived)))) - (if derived - ;; We have a derived glyph, so add - ;; another level. - (progn - (setf (gethash glyph - emoji--done-derived) - t) - (emoji--define-transient - (cons (concat mname " " glyph) - (cons glyph derived)) - t end-function)) - ;; Insert the emoji. - (lambda () - (interactive nil not-a-mode) - ;; Allow switching to the correct - ;; buffer. - (when end-function - (funcall end-function)) - (emoji--add-recent this-glyph) - (insert this-glyph))))))))) - (args (apply #'vector mname - (emoji--columnize layout - (if has-subs 2 8))))) - ;; There's probably a better way to do this... - (setf (symbol-function name) - (lambda () - (interactive nil not-a-mode) - (transient-setup name))) - (pcase-let ((`(,class ,slots ,suffixes ,docstr ,_body) - (transient--expand-define-args (list args)))) - (put name 'interactive-only t) - (put name 'function-documentation docstr) - (put name 'transient--prefix - (apply (or class 'transient-prefix) :command name - (cons :variable-pitch (cons t slots)))) - (put name 'transient--layout - (transient-parse-suffixes name suffixes))) - name)) +(defun emoji--layout (command title spec done-derived) + (let ((has-subs (consp (cadr spec)))) + (emoji--columnize + (if has-subs + (cl-loop for (key desc . glyphs) in (emoji--compute-prefix spec) + collect + (list key + (emoji--compute-name (cons desc glyphs)) + command + :class 'emoji--narrow + :title (concat title " > " desc) + :done-derived (or (string-suffix-p "Recent" desc) + done-derived) + :children glyphs)) + (cl-loop for glyph in spec + for char in (emoji--char-sequence) + for key = (string char) + for derived = (and (not (or (eq done-derived t) + (member glyph done-derived))) + (gethash glyph emoji--derived)) + collect + (if derived + (list key + (emoji--fontify-glyph glyph done-derived) + command + :class 'emoji--narrow + :title (concat title " " glyph) + :done-derived (or (eq done-derived t) + (cons glyph done-derived)) + :children (cons glyph derived)) + (list key + (emoji--fontify-glyph glyph done-derived) + 'emoji-insert-glyph)))) + (if has-subs 2 8)))) -(defun emoji--recent-transient (end-function) - "Create a function to display a dynamically generated menu." - (lambda () - (interactive) - (funcall (emoji--define-transient - (cons "Recent" (multisession-value emoji--recent)) - t end-function)))) +(defun emoji--char-sequence () + (append (number-sequence ?a ?z) + (number-sequence ?A ?Z) + (number-sequence ?0 ?9) + (number-sequence ?! ?/))) (defun emoji--add-recent (glyph) "Add GLYPH to the set of recently used emojis." (let ((recent (multisession-value emoji--recent))) + (set-text-properties 0 (length glyph) nil glyph) (setq recent (delete glyph recent)) (push glyph recent) ;; Shorten the list. @@ -684,20 +682,6 @@ We prefer the earliest unique letter." (gethash name emoji--all-bases)))) (cons glyph (gethash glyph emoji--derived)))))) -(defun emoji--choose-emoji () - (pcase-let ((`(,glyph . ,derived) (emoji--read-emoji))) - (if (not derived) - ;; Simple glyph with no derivations. - (progn - (emoji--add-recent glyph) - (insert glyph)) - ;; Choose a derived version. - (let ((emoji--done-derived (make-hash-table :test #'equal))) - (setf (gethash glyph emoji--done-derived) t) - (funcall - (emoji--define-transient - (cons "Choose Emoji" (cons glyph derived)))))))) - (defvar-keymap emoji-zoom-map "+" #'emoji-zoom-increase "-" #'emoji-zoom-decrease) diff --git a/lisp/international/mule-conf.el b/lisp/international/mule-conf.el index 979e685e32a..a27aaf9e522 100644 --- a/lisp/international/mule-conf.el +++ b/lisp/international/mule-conf.el @@ -1734,6 +1734,20 @@ included; callers should bind `case-fold-search' to t." :version "27.1" :group 'processes) +;; (describe-char-fold-equivalences ?:) +;; The last entry is taken from history. +(defcustom password-colon-equivalents + '(?\u003a ; ?\N{COLON} + ?\uff1a ; ?\N{FULLWIDTH COLON} + ?\ufe55 ; ?\N{SMALL COLON} + ?\ufe13 ; ?\N{PRESENTATION FORM FOR VERTICAL COLON} + ?\u17d6 ; ?\N{KHMER SIGN CAMNUC PII KUUH} + ) + "List of characters equivalent to trailing colon in \"password\" prompts." + :type '(repeat character) + :version "30.1" + :group 'processes) + ;; The old code-pages library is obsoleted by coding systems based on ;; the charsets defined in this file but might be required by user ;; code. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 73d47804e5d..404bad56a59 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -2780,7 +2780,7 @@ it is disabled. ;;; Generated autoloads from emacs-lisp/byte-opt.el -(register-definition-prefixes "byte-opt" '("byte-" "disassemble-offset")) +(register-definition-prefixes "byte-opt" '("byte" "disassemble-offset")) ;;; Generated autoloads from emacs-lisp/bytecomp.el @@ -2921,7 +2921,7 @@ and corresponding effects. ;;; Generated autoloads from progmodes/c-ts-common.el -(register-definition-prefixes "c-ts-common" '("c-ts-")) +(register-definition-prefixes "c-ts-common" '("c-ts-common-")) ;;; Generated autoloads from progmodes/c-ts-mode.el @@ -7881,36 +7881,53 @@ Display-Line-Numbers mode. (fn &optional ARG)" t) (defvar header-line-indent "" "\ -String to indent at the start if the header line. -This is used in `header-line-indent-mode', and buffers that have -this switched on should have a `header-line-format' that look like: +String of spaces to indent the beginning of header-line due to line numbers. +This is intended to be used in `header-line-format', and requires +the `header-line-indent-mode' to be turned on, in order for the width +of this string to be kept updated when the line-number width changes +on display. An example of a `header-line-format' that uses this +variable might look like this: (\"\" header-line-indent THE-REST...) +where THE-REST is the format string which produces the actual text +of the header-line. Also see `header-line-indent-width'.") (defvar header-line-indent-width 0 "\ -The width of the current line numbers displayed. -This is updated when `header-line-indent-mode' is switched on. - +The width of the current line number display in the window. +This is measured in units of the frame's canonical columns. +This is updated when `header-line-indent-mode' is switched on, +and is intended for use in `:align-to' display specifications +that are part of `header-line-format', when portions of header-line +text should be aligned to respective parts of buffer text. Also see `header-line-indent'.") (autoload 'header-line-indent-mode "display-line-numbers" "\ -Mode to indent the header line in `display-line-numbers-mode' buffers. +Minor mode to help with alignment of header line when line numbers are shown. -This means that the header line will be kept indented so that it -has blank space that's as wide as the displayed line numbers in -the buffer. +This minor mode should be turned on in buffers which display header-line +that needs to be aligned with buffer text when `display-line-numbers-mode' +is turned on in the buffer. -Buffers that have this switched on should have a -`header-line-format' that look like: +Buffers that have this switched on should have a `header-line-format' +that uses the `header-line-indent' or the `header-line-indent-width' +variables, which this mode will keep up-to-date with the current +display of line numbers. For example, a `header-line-format' that +looks like this: (\"\" header-line-indent THE-REST...) -The `header-line-indent-width' variable is also kept updated, and -has the width of `header-line-format'. This can be used, for -instance, in `:align-to' specs, like: +will make sure the text produced by THE-REST (which should be +a header-line format string) is always indented to be aligned on +display with the first column of buffer text. + +The `header-line-indent-width' variable is also kept updated, +and can be used, for instance, in `:align-to' specs as part +of `header-line-format', like this: (space :align-to (+ header-line-indent-width 10)) +See also `line-number-display-width'. + This is a minor mode. If called interactively, toggle the `Header-Line-Indent mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable @@ -9741,15 +9758,9 @@ Emerge two RCS revisions of a file, with another revision as ancestor. ;;; Generated autoloads from international/emoji.el -(autoload 'emoji-insert "emoji" "\ -Choose and insert an emoji glyph." t) -(autoload 'emoji-recent "emoji" "\ -Choose and insert one of the recently-used emoji glyphs." t) -(autoload 'emoji-search "emoji" "\ -Choose and insert an emoji glyph by typing its Unicode name. -This command prompts for an emoji name, with completion, and -inserts it. It recognizes the Unicode Standard names of emoji, -and also consults the `emoji-alternate-names' alist." t) + (autoload 'emoji-insert "emoji" nil t) + (autoload 'emoji-recent "emoji" nil t) + (autoload 'emoji-search "emoji" nil t) (autoload 'emoji-list "emoji" "\ List emojis and insert the one that's selected. Select the emoji by typing \\\\[emoji-list-select] on its picture. @@ -9765,6 +9776,11 @@ If called from Lisp, return the name as a string; return nil if the name is not known. (fn GLYPH &optional INTERACTIVE)" t) + (autoload 'emoji-list-select "emoji" nil t) +(autoload 'emoji--init "emoji" "\ + + +(fn &optional FORCE INHIBIT-ADJUST)") (autoload 'emoji-zoom-increase "emoji" "\ Increase the size of the character under point. FACTOR is the multiplication factor for the size. @@ -15821,7 +15837,7 @@ it is disabled. ;;; Generated autoloads from progmodes/hideshow.el -(defvar hs-special-modes-alist (mapcar #'purecopy '((c-mode "{" "}" "/[*/]" nil nil) (c++-mode "{" "}" "/[*/]" nil nil) (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil) (mhtml-mode "{\\|<[^/>]*?" "}\\|]*[^/]>" "