[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/svg-tag-mode 416538ff8b 06/12: Avoid "if chains"
From: |
ELPA Syncer |
Subject: |
[elpa] externals/svg-tag-mode 416538ff8b 06/12: Avoid "if chains" |
Date: |
Wed, 28 Aug 2024 06:59:00 -0400 (EDT) |
branch: externals/svg-tag-mode
commit 416538ff8bb487312c21abdb11f6a6fa36200eb7
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Avoid "if chains"
Use either `cond' or `when'. In the latter case,
collect the conditions in just one place.
---
svg-tag-mode.el | 37 ++++++++++++++++++-------------------
1 file changed, 18 insertions(+), 19 deletions(-)
diff --git a/svg-tag-mode.el b/svg-tag-mode.el
index 752c2dc4d0..aabe76c808 100644
--- a/svg-tag-mode.el
+++ b/svg-tag-mode.el
@@ -160,12 +160,12 @@ FACE can either be a face, property list (i.e., an
anonymous
face), or a string (assumed to be the foreground attribute). If
ATTRIBUTE is not specified in FACE, then use the corresponding
attribute from ``svg-tag-default-face''."
- (if (facep face)
- (face-attribute face attribute nil 'default)
- (if (and (stringp face) (eq attribute :foreground))
- face
- (or (plist-get face attribute)
- (face-attribute 'svg-tag-default-face attribute nil 'default)))))
+ (cond ((facep face)
+ (face-attribute face attribute nil 'default))
+ ((and (stringp face) (eq attribute :foreground))
+ face)
+ ((plist-get face attribute))
+ ((face-attribute 'svg-tag-default-face attribute nil 'default))))
(defun svg-tag-make (tag &optional &rest args)
"Return a svg tag displaying TAG and using specified ARGS.
@@ -226,19 +226,18 @@ attribute from ``svg-tag-default-face''."
(next-single-property-change (point) 'display)
(next-single-property-change position 'display))))
- (if (eq svg-tag-action-at-point 'edit)
- (if (eq direction 'left)
- (font-lock-flush beg end )
- (if (and (not view-read-only) (not buffer-read-only))
- (font-lock-unfontify-region beg end))))
-
- (if (eq svg-tag-action-at-point 'echo)
- (if (eq direction 'entered)
- (let ((message-log-max nil))
- (message (concat "TAG: "
- (substring-no-properties
- (string-trim
- (buffer-substring beg end ))))))))))
+ (cond ((not (eq svg-tag-action-at-point 'edit)))
+ ((eq direction 'left)
+ (font-lock-flush beg end))
+ ((and (not view-read-only) (not buffer-read-only))
+ (font-lock-unfontify-region beg end)))
+
+ (when (and (eq svg-tag-action-at-point 'echo)
+ (eq direction 'entered))
+ (let ((message-log-max nil))
+ (message (concat "TAG: "
+ (substring-no-properties
+ (string-trim (buffer-substring beg end )))))))))
(defun svg-tag--build-keywords (item)
"Process an item in order to install it as a new keyword."
- [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 <=
- [elpa] externals/svg-tag-mode d594e585fa 07/12: Use more appropriate conditionals, ELPA Syncer, 2024/08/28
- [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