[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit f49584599c 2/2: Hide placeholder commands from
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit f49584599c 2/2: Hide placeholder commands from execute-completing-read |
Date: |
Tue, 9 Apr 2024 12:59:59 -0400 (EDT) |
branch: elpa/git-commit
commit f49584599cb0057f8dfcf985f0d9111b4bf5f271
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Hide placeholder commands from execute-completing-read
---
lisp/magit-mode.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index ed5d6a67da..d03a21e836 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -411,6 +411,8 @@ Where applicable, other keymaps remap this command to
another,
which actually deletes the thing at point."
(interactive)
(user-error "There is no thing at point that could be deleted"))
+;; Starting with Emacs 28.1 we could use (declare (completion ignore)).
+(put 'magit-delete-thing 'completion-predicate #'ignore)
(defun magit-visit-thing ()
"This is a placeholder command, which may signal an error if called.
@@ -420,6 +422,7 @@ which actually visits the thing at point."
(if (eq transient-current-command 'magit-dispatch)
(call-interactively (key-binding (this-command-keys)))
(user-error "There is no thing at point that could be visited")))
+(put 'magit-visit-thing 'completion-predicate #'ignore)
(defun magit-edit-thing ()
"This is a placeholder command, which may signal an error if called.
@@ -430,6 +433,7 @@ buffer."
(if (eq transient-current-command 'magit-dispatch)
(call-interactively (key-binding (this-command-keys)))
(user-error "There is no thing at point that could be edited")))
+(put 'magit-edit-thing 'completion-predicate #'ignore)
(defun magit-browse-thing ()
"This is a placeholder command, which signals an error if called.
@@ -437,6 +441,7 @@ Where applicable, other keymaps remap this command to
another,
which actually visits thing at point using `browse-url'."
(interactive)
(user-error "There is no thing at point that could be browsed"))
+(put 'magit-browse-thing 'completion-predicate #'ignore)
(defun magit-copy-thing ()
"This is a placeholder command, which signals an error if called.
@@ -445,6 +450,7 @@ which actually copies some representation of the thing at
point
to the kill ring."
(interactive)
(user-error "There is no thing at point that we know how to copy"))
+(put 'magit-copy-thing 'completion-predicate #'ignore)
;;;###autoload
(defun magit-info ()