[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy f8d80a4055 1/2: Pacify apostrophe quoting warnings
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy f8d80a4055 1/2: Pacify apostrophe quoting warnings in docstrings |
Date: |
Sun, 29 May 2022 07:35:45 -0400 (EDT) |
branch: externals/ivy
commit f8d80a4055514f92d94f128f5fcb1cda79e5cd22
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>
Pacify apostrophe quoting warnings in docstrings
Byte-compilation in Emacs 29 now warns about unquoted apostrophes
appearing in certain contexts in docstrings.
* counsel.el (counsel-emacs-url-p): Simplify.
(counsel-grep-post-action-hook, counsel-url-expansions-alist)
(counsel-compile--probe-make-help):
* ivy.el (ivy-set-sources, ivy-re-builders-alist)
(ivy-magic-slash-non-match-action): Fix quoting and escaping in
docstrings.
---
counsel.el | 62 +++++++++++++++++++++++++++++++-------------------------------
ivy.el | 15 ++++++++-------
2 files changed, 39 insertions(+), 38 deletions(-)
diff --git a/counsel.el b/counsel.el
index bf0235f974..c18c6385a6 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1388,8 +1388,10 @@ INITIAL-INPUT can be given as the initial minibuffer
input."
(defcustom counsel-grep-post-action-hook nil
"Hook that runs after the point moves to the next candidate.
-Typical value: '(recenter)."
- :type 'hook)
+A typical example of what to add to this hook is the function
+`recenter'."
+ :type 'hook
+ :options '(recenter))
(defcustom counsel-git-grep-cmd-function
#'counsel-git-grep-cmd-function-default
"How a git-grep shell call is built from the input.
@@ -2234,40 +2236,38 @@ See variable `counsel-up-directory-level'."
(defun counsel-emacs-url-p ()
"Return a Debbugs issue URL at point."
- (when (counsel-require-program "git" t)
- (let ((url (counsel-at-git-issue-p)))
- (when url
- (let ((origin (shell-command-to-string
- "git remote get-url origin")))
- (when (string-match "git.sv.gnu.org:/srv/git/emacs.git" origin)
- (format "https://debbugs.gnu.org/cgi/bugreport.cgi?bug=%s"
- (substring url 1))))))))
+ (let ((url (and (counsel-require-program "git" t)
+ (counsel-at-git-issue-p))))
+ (when url
+ (let ((origin (shell-command-to-string "git remote get-url origin")))
+ (when (string-match-p "git.sv.gnu.org:/srv/git/emacs.git" origin)
+ (format "https://bugs.gnu.org/%s" (substring url 1)))))))
(defvar counsel-url-expansions-alist nil
"Map of regular expressions to expansions.
-This variable should take the form of a list of (REGEXP . FORMAT)
-pairs.
+The value of this variable is a list of pairs (REGEXP . FORMAT).
-`counsel-url-expand' will expand the word at point according to
+`counsel-url-expand' expands the word at point according to
FORMAT for the first matching REGEXP. FORMAT can be either a
-string or a function. If it is a string, it will be used as the
-format string for the `format' function, with the word at point
-as the next argument. If it is a function, it will be called
-with the word at point as the sole argument.
+string or a function. If it is a string, it is used as the
+format string for the function `format', with the word at point
+as the next argument. If it is a function, it is called with the
+word at point as the sole argument.
For example, a pair of the form:
- '(\"\\`BSERV-[[:digit:]]+\\'\" . \"https://jira.atlassian.com/browse/%s\")
-will expand to URL `https://jira.atlassian.com/browse/BSERV-100'
-when the word at point is BSERV-100.
-
-If the format element is a function, more powerful
-transformations are possible. As an example,
- '(\"\\`issue\\([[:digit:]]+\\)\\'\" .
+ \\='(\"\\\\\\=`BSERV-[[:digit:]]+\\\\\\='\" .
+ \"https://jira.atlassian.com/browse/%s\")
+expands to the URL `https://jira.atlassian.com/browse/BSERV-100'
+when the word at point is \"BSERV-100\".
+
+If FORMAT is a function, more powerful transformations are
+possible. As an example,
+ \\='(\"\\\\\\=`issue\\\\([[:digit:]]+\\\\)\\\\\\='\" .
(lambda (word)
- (concat \"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=\"
- (match-string 1 word))))
-trims the \"issue\" prefix from the word at point before creating the URL.")
+ (concat \"https://bugs.gnu.org/\" (match-string 1 word))))
+trims the \"issue\" prefix from the word at point before creating
+the URL.")
(defun counsel-url-expand ()
"Expand word at point using `counsel-url-expansions-alist'.
@@ -6544,10 +6544,10 @@ sub-directories that builds may be invoked in."
(defun counsel-compile--probe-make-help (dir)
"Return a list of Make targets based on help for DIR.
-It is quite common for a 'make help' invocation to return a human
-readable list of targets. Often common targets are marked with a
-leading asterisk. The exact search pattern is controlled by
-`counsel-compile-help-pattern'."
+It is quite common for a \"make help\" invocation to return a
+human readable list of targets. Often common targets are marked
+with a leading asterisk. The exact search pattern is controlled
+by `counsel-compile-help-pattern'."
(let ((default-directory dir)
primary-targets targets)
;; Only proceed if the help target exists.
diff --git a/ivy.el b/ivy.el
index dac9a3139e..98f5d4c0d5 100644
--- a/ivy.el
+++ b/ivy.el
@@ -277,8 +277,8 @@ Example:
(cl-subseq recentf-list 0 20))
(ivy-set-sources
- 'counsel-locate
- '((small-recentf)
+ \\='counsel-locate
+ \\='((small-recentf)
(original-source)))"
(setq ivy--sources-list
(plist-put ivy--sources-list cmd sources)))
@@ -1822,7 +1822,7 @@ Possible choices: `ivy--regex', `regexp-quote',
`ivy--regex-plus', `ivy--regex-fuzzy', `ivy--regex-ignore-order'.
If a function returns a list, it should format like this:
-'((\"matching-regexp\" . t) (\"non-matching-regexp\") ...).
+\\='((\"matching-regexp\" . t) (\"non-matching-regexp\") ...).
The matches will be filtered in a sequence, you can mix the
regexps that should match and that should not match as you
@@ -3205,10 +3205,11 @@ parts beyond their respective faces `ivy-confirm-face'
and
(sort (copy-sequence collection) sort)
collection)))
-(defcustom ivy-magic-slash-non-match-action
'ivy-magic-slash-non-match-cd-selected
- "Action to take when a slash is added to the end of a non existing directory.
-Possible choices are 'ivy-magic-slash-non-match-cd-selected,
-'ivy-magic-slash-non-match-create, or nil"
+(defcustom ivy-magic-slash-non-match-action
+ 'ivy-magic-slash-non-match-cd-selected
+ "Action to take when a slash is appended to a nonexistent directory.
+Possible choices are `ivy-magic-slash-non-match-cd-selected',
+`ivy-magic-slash-non-match-create', or nil"
:type '(choice
(const :tag "Use currently selected directory"
ivy-magic-slash-non-match-cd-selected)