emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/completions-highlight-modifications ecc7901 8/9: Simplify numeri


From: Jimmy Aguilar Mena
Subject: feature/completions-highlight-modifications ecc7901 8/9: Simplify numeric argument
Date: Sun, 15 Nov 2020 01:27:17 -0500 (EST)

branch: feature/completions-highlight-modifications
commit ecc7901ee8e3ae3a64a76610046a340e65455e99
Author: Jimmy Aguilar Mena <spacibba@aol.com>
Commit: Jimmy Aguilar Mena <spacibba@aol.com>

    Simplify numeric argument
    
    * lisp/completions-highlight.el (completions-highlight-this-completion)
    : Use prefix-numeric-value instead of manually check.
---
 lisp/completions-highlight.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lisp/completions-highlight.el b/lisp/completions-highlight.el
index f0da382..440ee3b 100644
--- a/lisp/completions-highlight.el
+++ b/lisp/completions-highlight.el
@@ -50,14 +50,13 @@
   "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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]