[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)
- [elpa] externals/svg-tag-mode updated (ece58da936 -> 91179d9576), ELPA Syncer, 2024/08/28
- [elpa] externals/svg-tag-mode 4b163bd10f 02/12: Fix whitespace errors, ELPA Syncer, 2024/08/28
- [elpa] externals/svg-tag-mode 45e3d967ee 03/12: Increase consistency of whitespace, ELPA Syncer, 2024/08/28
- [elpa] externals/svg-tag-mode 325a42a7af 04/12: Make it easier to navigate between parts of the commentary, ELPA Syncer, 2024/08/28
- [elpa] externals/svg-tag-mode b2ede2a3e5 05/12: Enforce use of spaces for indentation, ELPA Syncer, 2024/08/28
- [elpa] externals/svg-tag-mode 416538ff8b 06/12: Avoid "if chains", ELPA Syncer, 2024/08/28
- [elpa] externals/svg-tag-mode d594e585fa 07/12: Use more appropriate conditionals,
ELPA Syncer <=
- [elpa] externals/svg-tag-mode 8f7523f55f 08/12: Fix indentation, ELPA Syncer, 2024/08/28
- [elpa] externals/svg-tag-mode b27ecbf6d1 09/12: Improve docstrings, ELPA Syncer, 2024/08/28
- [elpa] externals/svg-tag-mode 1c58c97f1a 10/12: Fix default value and custom type of svg-tag-tags, ELPA Syncer, 2024/08/28
- [elpa] externals/svg-tag-mode 91179d9576 12/12: Merge pull request #61 from tarsiiformes/cleanup, ELPA Syncer, 2024/08/28
- [elpa] externals/svg-tag-mode 0ba633b156 01/12: Autoload modes, ELPA Syncer, 2024/08/28
- [elpa] externals/svg-tag-mode 7f42a443e9 11/12: Revert "Added a match-data on tag that can be retrieved by callback", ELPA Syncer, 2024/08/28