]> git.eshelyaron.com Git - emacs.git/commitdiff
Use 'help-key' function in more places
authorStefan Kangas <stefankangas@gmail.com>
Mon, 17 Mar 2025 17:45:20 +0000 (18:45 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 20 Mar 2025 10:50:44 +0000 (12:50 +0200)
* lisp/dired-aux.el (dired-query):
* lisp/emacs-lisp/helper.el (Helper-help-map):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Use 'help-key'.
* lisp/net/tramp-cmds.el (tramp-rename-files):
* lisp/which-key.el (which-key--next-page-hint): Prefer 'help-key'
when available.
* lisp/help.el (help-key): Simplify.
* etc/symbol-releases.eld: Add 'help-key'.

(cherry picked from commit 69210eb84e7c3074c339b8aa2f380f66a80ae61b)

etc/symbol-releases.eld
lisp/emacs-lisp/map-ynp.el
lisp/help.el
lisp/net/tramp-cmds.el
lisp/which-key.el

index 93f0f5419f4752ab2b267cbeaf57b380a7c3ac6d..9732f60fc161cc56800c77b85688d3cc177042f0 100644 (file)
@@ -10,6 +10,7 @@
 
 (
  ("29.1" fun plistp)
+ ("29.1" fun help-key)
  ("28.1" fun always)
  ("27.1" fun project-files)
  ("26.1" fun flymake--diag-region)
index 952497032a2ff8ab60a0a9f52f5de6da5a0014a8..fc9912f189e01257a7ad88ef139425dc1c18c501 100644 (file)
@@ -173,7 +173,7 @@ The function's value is the number of actions taken."
                                          "%s(\\`y', \\`n', \\`!', \\`.', \\`q', %sor \\`%s') "
                                          minibuffer-prompt-properties)
                                   prompt user-keys
-                                  (key-description (vector help-char)))))
+                                  (help-key))))
                       (if minibuffer-auto-raise
                           (raise-frame (window-frame (minibuffer-window))))
                        (unwind-protect
@@ -198,7 +198,7 @@ The function's value is the number of actions taken."
                                  (format
                                   "%s(\\`y', \\`n', \\`!', \\`.', \\`q', %sor \\`%s') %s"
                                   prompt user-keys
-                                  (key-description (vector help-char))
+                                  (help-key)
                                   (if (equal char -1)
                                       "[end-of-keyboard-macro]"
                                     (single-key-description char))))))
@@ -279,7 +279,7 @@ Type \\`SPC' or \\`y' to %s the current %s;
                           (message (substitute-command-keys
                                     (format
                                      "Type \\`%s' for help"
-                                     (key-description (vector help-char)))))
+                                     (help-key))))
                          (beep)
                          (sit-for 1)
                          (funcall try-again))))
index 6cdf71cea398fab0b41d1b8a70e25e3f3fb88800..13f0bda0fb803d01be77c1e15390e1ce2f87fd32 100644 (file)
@@ -52,7 +52,7 @@ buffer.")
 
 (defun help-key ()
   "Return `help-char' in a format suitable for the `keymap-set' KEY argument."
-  (key-description (char-to-string help-char)))
+  (key-description (vector help-char)))
 
 (declare-function cl-describe-type "cl-extra")
 
index 9161d233b280b02306ee1f5a24ccee237e980ec3..e59a614d935fca24e5ffb11eabec213cb473596b 100644 (file)
@@ -548,7 +548,8 @@ ESC or `q' to quit without changing further buffers,
                 (new-bfn (and (stringp bfn) (string-replace source target bfn)))
                 (prompt (format-message
                          "Set visited file name to `%s' [Type yn!eq or %s] "
-                         new-bfn (key-description (vector help-char)))))
+                          new-bfn (if (fboundp 'help-key) (help-key) ; 29.1
+                                    (key-description (vector help-char))))))
            (when (and (buffer-live-p buffer) (stringp bfn)
                       (string-prefix-p source bfn)
                       ;; Skip, and don't ask again.
index dfc895c257672214fd78d0107772c12bdf723626..830c915e01cd247864ae276af250abbb5a98c4e3 100644 (file)
@@ -2213,7 +2213,8 @@ Actual lines: %s"
   (let* ((paging-key (concat prefix-keys " " which-key-paging-key))
          (paging-key-bound (eq 'which-key-C-h-dispatch
                                (key-binding (kbd paging-key))))
-         (key (key-description (vector help-char)))
+         (key (if (fboundp 'help-key) (help-key) ; 29.1
+                (key-description (vector help-char))))
          (key (if paging-key-bound
                   (concat key " or " which-key-paging-key)
                 key)))