diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2023-04-08 22:51:50 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2023-04-08 22:51:50 +0200 |
| commit | 2c2fa7f04a72590e82971c91e7617efcc7044cf6 (patch) | |
| tree | 95d1ad12ffd700533e8ef45732799b1bf95f0333 | |
| parent | e18bc35dd9a283c5bc781453e3a9bf20b6332cf3 (diff) | |
Minor simplification
| -rw-r--r-- | cape.el | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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." |
