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

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

[elpa] externals/cape 2c2fa7f04a 4/5: Minor simplification


From: ELPA Syncer
Subject: [elpa] externals/cape 2c2fa7f04a 4/5: Minor simplification
Date: Sat, 8 Apr 2023 16:57:25 -0400 (EDT)

branch: externals/cape
commit 2c2fa7f04a72590e82971c91e7617efcc7044cf6
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Minor simplification
---
 cape.el | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/cape.el b/cape.el
index 1e9587b00c..ec9cbbacdb 100644
--- a/cape.el
+++ b/cape.el
@@ -138,14 +138,13 @@ The buffers are scanned for completion candidates by 
`cape-line'."
 
 (defun cape--case-replace (flag input str)
   "Replace case of STR depending on INPUT and FLAG."
-  (if (and (if (eq flag 'case-replace) case-replace flag)
+  (or (and (if (eq flag 'case-replace) case-replace flag)
            (not (equal input ""))
-           (string-prefix-p input str t))
-      (save-match-data
-        (if (string-match input input)
-            (replace-match str nil nil input)
-          str))
-    str))
+           (string-prefix-p input str t)
+           (save-match-data
+             (and (string-match input input)
+                  (replace-match str nil nil input))))
+      str))
 
 (defmacro cape--silent (&rest body)
   "Silence BODY."



reply via email to

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