Remove old backport version of universal-argument--description
authorJeremy Bryant <jb@jeremybryant.net>
Tue, 9 Apr 2024 21:54:39 +0000 (22:54 +0100)
committerJustin Burkett <justin@burkett.cc>
Wed, 1 May 2024 12:50:59 +0000 (08:50 -0400)
In preparation for the move to Emacs core, this is no longer needed.
Furthermore, the backport was of emacs25 on 2015-12-04 so is unlikely
to affect most current installations in the meantime.

* which-key.el: Remove old backport of 2025-12-04.
(which-key--full-prefix): Use built-in universal-argument--description.

which-key.el

index 0e14c76df950b497a458fb735651c0fc64abd320..0d44a61020aac6503e46404ca23cd2f9336b0272 100644 (file)
@@ -2194,32 +2194,13 @@ Actual lines: %s"
       (which-key--propertize (format "[%s paging/help]" key)
                              'face 'which-key-note-face))))
 
-(eval-and-compile
-  (if (fboundp 'universal-argument--description)
-      (defalias 'which-key--universal-argument--description
-        #'universal-argument--description)
-    (defun which-key--universal-argument--description ()
-      ;; Backport of the definition of universal-argument--description in
-      ;; emacs25 on 2015-12-04
-      (when prefix-arg
-        (concat "C-u"
-                (pcase prefix-arg
-                  (`(-) " -")
-                  (`(,(and (pred integerp) n))
-                   (let ((str ""))
-                     (while (and (> n 4) (= (mod n 4) 0))
-                       (setq str (concat str " C-u"))
-                       (setq n (/ n 4)))
-                     (if (= n 4) str (format " %s" prefix-arg))))
-                  (_ (format " %s" prefix-arg))))))))
-
 (defun which-key--full-prefix (prefix-keys &optional -prefix-arg dont-prop-keys)
   "Return a description of the full key sequence up to now.
 Include prefix arguments."
   (let* ((left (eq which-key-show-prefix 'left))
          (prefix-arg (if -prefix-arg -prefix-arg prefix-arg))
          (str (concat
-               (which-key--universal-argument--description)
+               (universal-argument--description)
                (when prefix-arg " ")
                prefix-keys))
          (dash (if (and (not (string= prefix-keys ""))