emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8bf186b: Demote read-extended-command-predicate errors


From: Basil L. Contovounesios
Subject: master 8bf186b: Demote read-extended-command-predicate errors
Date: Sat, 27 Mar 2021 16:15:16 -0400 (EDT)

branch: master
commit 8bf186b2297dc0aeba76e8e743dec7efa6a568e4
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Demote read-extended-command-predicate errors
    
    For discussion, see the following thread:
    https://lists.gnu.org/r/emacs-devel/2021-03/msg00682.html
    
    * lisp/simple.el (read-extended-command): Demote errors when calling
    read-extended-command-predicate so M-x completion doesn't break.
---
 lisp/simple.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 959bd83..c48e644 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2005,9 +2005,14 @@ This function uses the `read-extended-command-predicate' 
user option."
            (complete-with-action action obarray string pred)))
        (lambda (sym)
          (and (commandp sym)
-              (or (null read-extended-command-predicate)
-                  (and (functionp read-extended-command-predicate)
-                       (funcall read-extended-command-predicate sym buffer)))))
+              (cond ((null read-extended-command-predicate))
+                    ((functionp read-extended-command-predicate)
+                     ;; Don't let bugs break M-x completion; interpret
+                     ;; them as the absence of a predicate.
+                     (condition-case-unless-debug err
+                         (funcall read-extended-command-predicate sym buffer)
+                       (error (message "read-extended-command-predicate: %s: 
%s"
+                                       sym (error-message-string err))))))))
        t nil 'extended-command-history))))
 
 (defun command-completion-using-modes-p (symbol buffer)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]