[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/command cf35039 2/5: Add the mode-based declare helper
From: |
Lars Ingebrigtsen |
Subject: |
scratch/command cf35039 2/5: Add the mode-based declare helper |
Date: |
Sat, 13 Feb 2021 17:13:37 -0500 (EST) |
branch: scratch/command
commit cf350392ea6700139a74d79b18d25149360d128d
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Add the mode-based declare helper
---
lisp/simple.el | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lisp/simple.el b/lisp/simple.el
index df106e2..ede6c6b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1975,6 +1975,11 @@ BUFFER."
(buffer-local-value 'major-mode buffer)
(command-modes symbol))))
+(defun completion-with-mode-p (modes buffer)
+ (apply #'provided-mode-derived-p
+ (buffer-local-value 'major-mode buffer)
+ modes))
+
(defun completion-on-button-p (_symbol _buffer)
"Say whether SYMBOL should be offered as a completion.
This is true if SYMBOL is a command that's in the local map at