diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2025-07-25 09:50:34 +0200 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2025-07-25 09:50:34 +0200 |
| commit | b377adb68c8d124d6d6ef1cba21ac7862c6cb1c3 (patch) | |
| tree | c10a17d20c74335ded82ad0ea09009c46d57dc4e /lisp/magit-push.el | |
| parent | eda5d3682ab8af3961232d0d026c3a4b12adf3c2 (diff) | |
Use shorthand match-str instead of match-string-no-properties
Almost always would it be better to use `match-string-no-properties'
instead of `match-string', but because the name of the former is
excruciatingly long for a function that one often wants to use in
tight spaces and because it usually "does not really matter", I
usually went for the latter.
The problem is, it does matter. For example, even strings that are
usually only used by code may end up obfuscating debug statements.
So let's start doing the right thing, even though there surely will
be people frowning at the use of a shorthand.
The fake ("match-string" "match-string") shorthand is necessary to
protect literal `match-string' and `match-string-no-properties' from
being corrupted by interpreted as shorthand for the non-existent
`match-stringing' and `match-string-no-propertiesing'.
Unfortunately the shorthands have to be specified in each library
individually. Using "dir-locals.el" only works if the libraries
are compiled. At least this additional noise is neatly tucked away
at the end of the files.
It might turn out that out of the more than two hundred instances
where this replaces `match-string' with `match-string-no-properties'
we should have stuck with the former in an instance or two. That's
the price of progress and can be fixed once such regressions are
reported.
Diffstat (limited to 'lisp/magit-push.el')
| -rw-r--r-- | lisp/magit-push.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/magit-push.el b/lisp/magit-push.el index 1b8acb4..e433839 100644 --- a/lisp/magit-push.el +++ b/lisp/magit-push.el @@ -370,4 +370,9 @@ You can add this command as a suffix using something like: ;;; _ (provide 'magit-push) +;; Local Variables: +;; read-symbol-shorthands: ( +;; ("match-string" . "match-string") +;; ("match-str" . "match-string-no-properties")) +;; End: ;;; magit-push.el ends here |
