emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/svg-tag-mode d594e585fa 07/12: Use more appropriate con


From: ELPA Syncer
Subject: [elpa] externals/svg-tag-mode d594e585fa 07/12: Use more appropriate conditionals
Date: Wed, 28 Aug 2024 06:59:00 -0400 (EDT)

branch: externals/svg-tag-mode
commit d594e585faf9ea55c416329ca9494ab41256c02e
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Use more appropriate conditionals
    
    - It is better to avoid using `if' when there is no ELSE part.
    - It is better to avoid using `when' when the returned value
      matters.
---
 svg-tag-mode.el | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/svg-tag-mode.el b/svg-tag-mode.el
index aabe76c808..4a77dfe587 100644
--- a/svg-tag-mode.el
+++ b/svg-tag-mode.el
@@ -132,8 +132,8 @@
 This is in contrast to merely setting it to 0."
   (let (p)
     (while plist
-      (if (not (eq property (car plist)))
-          (setq p (plist-put p (car plist) (nth 1 plist))))
+      (unless (eq property (car plist))
+        (setq p (plist-put p (car plist) (nth 1 plist))))
       (setq plist (cddr plist)))
     p))
 
@@ -246,18 +246,18 @@ attribute from ``svg-tag-default-face''."
                      (format "\\(%s\\)" (car item))))
          (tag      `(funcall ',(nth 0 (cdr item)) (match-string 1)))
          (callback (nth 1 (cdr item)))
-         (map (when callback
-                (let ((map (make-sparse-keymap)))
-                  (define-key map [mouse-1] callback)
-                  map)))
+         (map      (and callback
+                        (let ((map (make-sparse-keymap)))
+                          (define-key map [mouse-1] callback)
+                          map)))
          (help     (nth 2 (cdr item))))
     (setq tag ``(face nil
                  display ,,tag
                  match-data ,(substring-no-properties (match-string 1))
                  cursor-sensor-functions (svg-tag--cursor-function)
-                 ,@(if ,callback '(pointer hand))
-                 ,@(if ,help `(help-echo ,,help))
-                 ,@',(if map `(keymap ,map))))
+                 ,@(and ,callback '(pointer hand))
+                 ,@(and ,help `(help-echo ,,help))
+                 ,@',(and map `(keymap ,map))))
     `(,pattern 1 ,tag)))
 
 (defun svg-tag--remove-text-properties (oldfun start end props &rest args)



reply via email to

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