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

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

[elpa] externals/substitute af3472dc34 33/39: Do not operate on nil thin


From: ELPA Syncer
Subject: [elpa] externals/substitute af3472dc34 33/39: Do not operate on nil thing
Date: Mon, 16 Jan 2023 11:58:52 -0500 (EST)

branch: externals/substitute
commit af3472dc3486a8fdda397c6e2fb46b39cee57192
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Do not operate on nil thing
---
 substitute.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/substitute.el b/substitute.el
index 82a3daa2f9..15bc38a0a5 100644
--- a/substitute.el
+++ b/substitute.el
@@ -182,8 +182,10 @@ Report a `user-error' if no target is found."
   (cond
    ((region-active-p)
     (buffer-substring-no-properties (region-beginning) (region-end)))
-   (t (or (format "\\_<%s\\_>" (thing-at-point 'symbol t))
-          (user-error "No substitution target at point")))))
+   (t
+    (if-let ((thing (thing-at-point 'symbol t)))
+        (format "\\_<%s\\_>" thing)
+      (user-error "No substitution target at point")))))
 
 (defmacro substitute-command (fn doc &optional scope)
   "Produce substitute command using FN, DOC, and SCOPE."



reply via email to

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