[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 4f80a8999c 113/366: transient--goto-argument-
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient 4f80a8999c 113/366: transient--goto-argument-description: Handle -- special case |
Date: |
Tue, 25 Jan 2022 18:54:32 -0500 (EST) |
branch: externals/transient
commit 4f80a8999caf470e9a67f8af7f4d9bffcaf77957
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
transient--goto-argument-description: Handle -- special case
---
lisp/transient.el | 57 +++++++++++++++++++++++++++++--------------------------
1 file changed, 30 insertions(+), 27 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index f844e843d6..4ef004a4ba 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2813,33 +2813,36 @@ location."
;; for options such as "--mainline parent-number"
(others "-\\(?:. \\|-[^[:space:]]+ \\)?[^[:space:]]+"))
(when (re-search-forward
- ;; Should start with whitespace and may have
- ;; any number of options before and/or after.
- (format
- "^[\t\s]+\\(?:%s, \\)*?\\(?1:%s\\)%s\\(?:, %s\\)*$"
- others
- ;; Options don't necessarily end in an "="
- ;; (e.g., "--gpg-sign[=<keyid>]")
- (string-remove-suffix "=" arg)
- ;; Simple options don't end in an "=". Splitting this
- ;; into 2 cases should make getting false positives
- ;; less likely.
- (if (string-suffix-p "=" arg)
- ;; "[^[:space:]]*[^.[:space:]]" matches the option
- ;; value, which is usually after the option name
- ;; and either '=' or '[='. The value can't end in
- ;; a period, as that means it's being used at the
- ;; end of a sentence. The space is for options
- ;; such as '--mainline parent-number'.
- "\\(?: \\|\\[?=\\)[^[:space:]]*[^.[:space:]]"
- ;; Either this doesn't match anything (e.g., "-a"),
- ;; or the option is followed by a value delimited
- ;; by a "[", "<", or ":". A space might appear
- ;; before this value, as in "-f <file>". The
- ;; space alternative is for options such as
- ;; "-m parent-number".
- "\\(?:\\(?: \\| ?[\\[<:]\\)[^[:space:]]*[^.[:space:]]\\)?")
- others)
+ (if (equal arg "--")
+ ;; Special case.
+ "^[\t\s]+\\(--\\(?: \\|$\\)\\|\\[--\\]\\)"
+ ;; Should start with whitespace and may have
+ ;; any number of options before and/or after.
+ (format
+ "^[\t\s]+\\(?:%s, \\)*?\\(?1:%s\\)%s\\(?:, %s\\)*$"
+ others
+ ;; Options don't necessarily end in an "="
+ ;; (e.g., "--gpg-sign[=<keyid>]")
+ (string-remove-suffix "=" arg)
+ ;; Simple options don't end in an "=". Splitting this
+ ;; into 2 cases should make getting false positives
+ ;; less likely.
+ (if (string-suffix-p "=" arg)
+ ;; "[^[:space:]]*[^.[:space:]]" matches the option
+ ;; value, which is usually after the option name
+ ;; and either '=' or '[='. The value can't end in
+ ;; a period, as that means it's being used at the
+ ;; end of a sentence. The space is for options
+ ;; such as '--mainline parent-number'.
+ "\\(?: \\|\\[?=\\)[^[:space:]]*[^.[:space:]]"
+ ;; Either this doesn't match anything (e.g., "-a"),
+ ;; or the option is followed by a value delimited
+ ;; by a "[", "<", or ":". A space might appear
+ ;; before this value, as in "-f <file>". The
+ ;; space alternative is for options such as
+ ;; "-m parent-number".
+ "\\(?:\\(?: \\| ?[\\[<:]\\)[^[:space:]]*[^.[:space:]]\\)?")
+ others))
nil t)
(goto-char (match-beginning 1)))))
- [elpa] externals/transient 101c0aeaa1 023/366: transient--insert-suffix: Fix move of last child of a group, (continued)
- [elpa] externals/transient 101c0aeaa1 023/366: transient--insert-suffix: Fix move of last child of a group, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 0d9a1b5536 107/366: manual: Document prefix slots, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7e2b98c701 109/366: Fix doc string typo, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 3fe1b7ea86 086/366: transient--kbd: New function, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 0312b9302d 099/366: transient-args: Remove SEPARATE argument, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7d0db2826b 100/366: transient-args: No longer support an object as PREFIX, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient a6ce1950e4 102/366: transient-args: Fall back to set, saved or default value, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 0cad5ebcb7 106/366: Fix doc string typos, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 824c684deb 108/366: Advertise current-transient-suffixes less, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient ccac95e5a8 112/366: transient-show-help: Don't error if argument is missing, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 4f80a8999c 113/366: transient--goto-argument-description: Handle -- special case,
Jonas Bernoulli <=
- [elpa] externals/transient 41cbf49529 118/366: transient--insert-suffix: Fix removing LOC, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 6ceb643f0b 132/366: Revert "Add .github/FUNDING.yml", Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 93c9f2a251 133/366: manual: Fix typo, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 83cb1e4caa 135/366: make: Copy indices for htmlified info manuals, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 171924893f 140/366: transient-infix-read: Work around another Ivy bug, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7977732485 141/366: transient-read-with-initial-input: Default to not doing that, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient ae2574ba70 143/366: transient--show: Don't show thin line without window system, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient e36190a6b4 145/366: manual: Fix typo, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient f10b821315 148/366: transient-set-level: Highlight the suffix in question, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient ba63f9d2b0 156/366: Contribute to GNU Emacs and assign to the Free Software Foundation, Jonas Bernoulli, 2022/01/25