]> git.eshelyaron.com Git - emacs.git/commitdiff
Simplify numeric argument
authorJimmy Aguilar Mena <spacibba@aol.com>
Sun, 15 Nov 2020 05:42:22 +0000 (06:42 +0100)
committerJimmy Aguilar Mena <spacibba@aol.com>
Fri, 20 Nov 2020 18:03:23 +0000 (19:03 +0100)
* lisp/completions-highlight.el (completions-highlight-this-completion)
: Use prefix-numeric-value instead of manually check.

lisp/completions-highlight.el

index f0da382c4cbf931a48e56c55cd0e88c938d091d8..440ee3b9ead7ddf325de01463796054c1e84fa3f 100644 (file)
   "Saves the Completions current-localmap to restore it disabling the mode.")
 
 ;; *Completions* side commands
-
 (defun completions-highlight-this-completion (&optional n)
   "Highlight the completion under point or near.
 N is set to 1 if not specified."
-  (setq n (or (and n (/ n (abs n)))
-             1))
-  (next-completion n)
-  (completions-highlight-next-completion (* -1 n)))
+  (setq n (prefix-numeric-value n))
+  (let ((sign (/ n (abs n))))
+    (next-completion sign)
+    (completions-highlight-next-completion (* -1 sign))))
 
 (defun completions-highlight-next-completion (n)
   "Move to and highlight the next item in the completion list.