From 1cdb4d2077c4e402bf2b2991e8395f0ccdedd1d1 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 21 Oct 2021 19:55:24 +0300 Subject: * lisp/menu-bar.el (menu-bar-keymap): Add optional arg KEYMAP (bug#50067). * lisp/mouse.el (context-menu-global): Use 'menu-bar-keymap' with its arg KEYMAP set to 'global-map'. --- lisp/menu-bar.el | 9 ++++++--- lisp/mouse.el | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 1cc126b5017..f19dc9e7c97 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -2696,10 +2696,13 @@ This command is to be used when you click the mouse in the menubar." (cdr menu-bar-item-cons) 0)))) -(defun menu-bar-keymap () +(defun menu-bar-keymap (&optional keymap) "Return the current menu-bar keymap. +The ordering of the return value respects `menu-bar-final-items'. -The ordering of the return value respects `menu-bar-final-items'." +It's possible to use the KEYMAP argument to override the default keymap +that is the currently active maps. For example, the argument KEYMAP +could provide `global-map' where items are limited to the global map only." (let ((menu-bar '()) (menu-end '())) (map-keymap @@ -2712,7 +2715,7 @@ The ordering of the return value respects `menu-bar-final-items'." ;; sorting. (push (cons pos menu-item) menu-end) (push menu-item menu-bar)))) - (lookup-key (menu-bar-current-active-maps) [menu-bar])) + (lookup-key (or keymap (menu-bar-current-active-maps)) [menu-bar])) `(keymap ,@(nreverse menu-bar) ,@(mapcar #'cdr (sort menu-end (lambda (a b) diff --git a/lisp/mouse.el b/lisp/mouse.el index bcb58d153a8..7bac6dd07bf 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -364,7 +364,7 @@ Some context functions add menu items below the separator." (when (consp binding) (define-key-after menu (vector key) (copy-sequence binding)))) - (lookup-key global-map [menu-bar])) + (menu-bar-keymap global-map)) menu) (defun context-menu-local (menu _click) -- cgit v1.2.3 From 2b7655ca0e36a3de40c0a94eed701277a12ba146 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 21 Oct 2021 21:09:03 +0300 Subject: ; More accurate doc string for 'tab-bar-format' * lisp/tab-bar.el (tab-bar-format): Make the doc string more accurate. (Bug#51247) --- lisp/tab-bar.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index a3316bf4496..10ff57bfd0a 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -706,8 +706,13 @@ the formatted tab name to display in the tab bar." Every item in the list is a function that returns a string, or a list of menu-item elements, or nil. Adding a function to the list causes the tab bar to show -that string, or display a menu with those menu items when -you click on the tab bar. +that string, or display a tab button which, when clicked, +will invoke the command that is the binding of the menu item. +The menu-item binding of nil will produce a tab clicking +on which will select that tab. The menu-item's title is +displayed as the label of the tab. +If a function returns nil, it doesn't directly affect the +tab bar appearance, but can do that by some side-effect. If the list ends with `tab-bar-format-align-right' and `tab-bar-format-global', then after enabling `display-time-mode' (or any other mode that uses `global-mode-string'), -- cgit v1.2.3 From ee6bdd6eef329434427c6a7b22613bd33249d00a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 21 Oct 2021 22:13:09 +0300 Subject: Fix non-interactive behavior of 'kill-region' * lisp/simple.el (kill-region): Actually ignore BEG and END when REGION is non-nil. Doc fix. (Bug#51320) --- lisp/simple.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/simple.el b/lisp/simple.el index bec4aa4738e..4aa373d6701 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5285,11 +5285,12 @@ Lisp programs should use this function for killing text. Supply two arguments, character positions BEG and END indicating the stretch of text to be killed. If the optional argument REGION is non-nil, the function ignores BEG and END, and kills the current - region instead." + region instead. Interactively, REGION is always non-nil, and so + this command always kills the current region." ;; Pass mark first, then point, because the order matters when ;; calling `kill-append'. (interactive (list (mark) (point) 'region)) - (unless (and beg end) + (unless (or region (and beg end)) (user-error "The mark is not set now, so there is no region")) (condition-case nil (let ((string (if region -- cgit v1.2.3 From 5bc522b4f45f17c44449a05df562d8f0ae00bcb4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 21 Oct 2021 22:29:37 +0300 Subject: ; * lisp/simple.el (kill-region): A better fix for bug#51320. --- lisp/simple.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/simple.el b/lisp/simple.el index 4aa373d6701..e3657cc079e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5289,9 +5289,12 @@ Supply two arguments, character positions BEG and END indicating the this command always kills the current region." ;; Pass mark first, then point, because the order matters when ;; calling `kill-append'. - (interactive (list (mark) (point) 'region)) - (unless (or region (and beg end)) - (user-error "The mark is not set now, so there is no region")) + (interactive (progn + (let ((beg (mark)) + (end (point))) + (unless (and beg end) + (user-error "The mark is not set now, so there is no region")) + (list beg end 'region)))) (condition-case nil (let ((string (if region (funcall region-extract-function 'delete) -- cgit v1.2.3 From d2849cc645f349080fd74ffbe082178bc12cd02b Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 22 Oct 2021 10:16:17 +0200 Subject: Fix 'calculate-lisp-indent' when "[" starts containing sexp (Bug#51312) * lisp/emacs-lisp/lisp-mode.el (calculate-lisp-indent): Handle arbitrary paren syntax after skipping whitespace backwards within containing sexp (Bug#51312). --- lisp/emacs-lisp/lisp-mode.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index fc7a7362cd7..bb00a97f8e3 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -1075,10 +1075,11 @@ is the buffer position of the start of the containing expression." ;; Handle prefix characters and whitespace ;; following an open paren. (Bug#1012) (backward-prefix-chars) - (while (not (or (looking-back "^[ \t]*\\|([ \t]+" - (line-beginning-position)) - (and containing-sexp - (>= (1+ containing-sexp) (point))))) + (while (not (save-excursion + (skip-chars-backward " \t") + (or (= (point) (line-beginning-position)) + (and containing-sexp + (= (point) (1+ containing-sexp)))))) (forward-sexp -1) (backward-prefix-chars)) (setq calculate-lisp-indent-last-sexp (point))) -- cgit v1.2.3 From 24083c8d1330baf9ceda16b79ee3d285b7156023 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Thu, 21 Oct 2021 15:53:35 +0200 Subject: * lisp/net/eww.el (eww-retrieve-command): Add :tag. --- lisp/net/eww.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/net/eww.el b/lisp/net/eww.el index bb6583c2a9a..238900db0c3 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -145,12 +145,12 @@ The string will be passed through `substitute-command-keys'." "Command to retrieve an URL via an external program. If nil, `url-retrieve' is used to download the data. If `sync', `url-retrieve-synchronously' is used. -For other non-nil values, this should be a list where the first item -is the program, and the rest are the arguments." +For other non-nil values, this should be a list of strings where +the first item is the program, and the rest are the arguments." :version "28.1" :type '(choice (const :tag "Use `url-retrieve'" nil) (const :tag "Use `url-retrieve-synchronously'" sync) - (repeat string))) + (repeat :tag "Command/args" string ))) (defcustom eww-use-external-browser-for-content-type "\\`\\(video/\\|audio/\\|application/ogg\\)" @@ -1901,7 +1901,7 @@ Use link at point if there is one, else the current page's URL." (defun eww-set-character-encoding (charset) "Set character encoding to CHARSET. If CHARSET is nil then use UTF-8." - (interactive "zUse character set (default utf-8): " eww-mode) + (interactive "zUse character set (default `utf-8'): " eww-mode) (if (null charset) (eww-reload nil 'utf-8) (eww-reload nil charset))) -- cgit v1.2.3 From caf87d80fa07234d96cb747eb4d415f8a223db43 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Thu, 21 Oct 2021 16:22:48 +0200 Subject: * lisp/repeat.el (repeat-keep-prefix): Expand description. --- lisp/repeat.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/repeat.el b/lisp/repeat.el index 42590b7e6d9..b875b749b64 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -355,7 +355,7 @@ of the specified number of seconds." "Timer activated after the last key typed in the repeating key sequence.") (defcustom repeat-keep-prefix t - "Keep the prefix arg of the previous command." + "Whether to keep the prefix arg of the previous command when repeating." :type 'boolean :group 'convenience :version "28.1") -- cgit v1.2.3 From 9c37b812da17078f218d8f6351333108020114a3 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Fri, 22 Oct 2021 12:15:06 +0200 Subject: ; * lisp/repeat.el (repeat-mode): Fix docstring typo. --- lisp/repeat.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/repeat.el b/lisp/repeat.el index b875b749b64..ac08952eaa8 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -387,7 +387,7 @@ the map can't be set on the command symbol property `repeat-map'.") "Toggle Repeat mode. When Repeat mode is enabled, and the command symbol has the property named `repeat-map', this map is activated temporarily for the next command. -See `describe-repeat-maps' for a list of all repeatable command." +See `describe-repeat-maps' for a list of all repeatable commands." :global t :group 'convenience (if (not repeat-mode) (remove-hook 'post-command-hook 'repeat-post-hook) -- cgit v1.2.3 From 1f6cdeb12c3cb8a86159cae9bfd638d8139c123e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 22 Oct 2021 16:38:11 +0200 Subject: Ensure valid end/beginning lines in message-mark-inserted-region * lisp/gnus/message.el (message-mark-inserted-region): Ensure there's a newline before inserting the end line (bug#51324). --- lisp/gnus/message.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lisp') diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index d460f9bd922..bbf1c78a01f 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -2395,6 +2395,8 @@ If VERBATIM, use slrn style verbatim marks (\"#v+\" and \"#v-\")." (save-excursion ;; add to the end of the region first, otherwise end would be invalid (goto-char end) + (unless (bolp) + (insert "\n")) (insert (if verbatim "#v-\n" message-mark-insert-end)) (goto-char beg) (insert (if verbatim "#v+\n" message-mark-insert-begin)))) -- cgit v1.2.3 From 9b6b5e37ef9106d9d77cf4785dc61feef531b8cf Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 22 Oct 2021 16:57:04 +0200 Subject: Regexp-quote github domains in bug-reference * lisp/progmodes/bug-reference.el (bug-reference--build-forge-setup-entry): Regexp-quote the domain (bug#51316). --- lisp/progmodes/bug-reference.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el index fd435eadfe8..d7b12db2211 100644 --- a/lisp/progmodes/bug-reference.el +++ b/lisp/progmodes/bug-reference.el @@ -270,7 +270,8 @@ via the internet it might also be http.") ;; possibly different projects are also supported. (cl-defmethod bug-reference--build-forge-setup-entry (host-domain (_forge-type (eql github)) protocol) - `(,(concat "[/@]" host-domain "[/:]\\([.A-Za-z0-9_/-]+\\)\\.git") + `(,(concat "[/@]" (regexp-quote host-domain) + "[/:]\\([.A-Za-z0-9_/-]+\\)\\.git") "\\(\\([.A-Za-z0-9_/-]+\\)?\\(?:#\\)\\([0-9]+\\)\\)\\>" ,(lambda (groups) (let ((ns-project (nth 1 groups))) -- cgit v1.2.3 From 06c944cff1a8a348b9c01a92891bd12576c0896d Mon Sep 17 00:00:00 2001 From: "Itai Y. Efrat" Date: Fri, 22 Oct 2021 17:07:56 +0200 Subject: Fix rfc6068-parse-mailto-url autoload * lisp/net/browse-url.el (rfc6068-parse-mailto-url): Fix autoload cookie (bug#51333). --- lisp/net/browse-url.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index b21c66ef14b..3af37e412d9 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -1600,7 +1600,7 @@ used instead of `browse-url-new-window-flag'." ;; --- mailto --- -(autoload 'rfc6068-parse-mailto-url "rfc2368") +(autoload 'rfc6068-parse-mailto-url "rfc6068") ;;;###autoload (defun browse-url-mail (url &optional new-window) -- cgit v1.2.3