emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master a0d2cff 44/51: ; Don't enter debugger for kill-all-local-v


From: Noam Postavsky
Subject: [elpa] master a0d2cff 44/51: ; Don't enter debugger for kill-all-local-variables case
Date: Sun, 13 May 2018 13:11:46 -0400 (EDT)

branch: master
commit a0d2cff79b188b7a23565ff2cfafbb8cf364616d
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    ; Don't enter debugger for kill-all-local-variables case
    
    * yasnippet.el (yas--watch-auto-fill): If we're called from
    kill-all-local-variables, we don't need to check this, because
    auto-fill-function will shortly be set to nil as well.
---
 yasnippet.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/yasnippet.el b/yasnippet.el
index bfce53c..562a1db 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -582,8 +582,16 @@ override bindings from other packages (e.g., 
`company-mode')."
   "The original value of `auto-fill-function'.")
 (make-variable-buffer-local 'yas--original-auto-fill-function)
 
-(defun yas--watch-auto-fill (_sym newval _op _where)
-  (when (and (null newval) (eq auto-fill-function 'yas--auto-fill))
+(defun yas--watch-auto-fill (_sym newval op _where)
+  (when (and (null newval) (eq auto-fill-function 'yas--auto-fill)
+             (fboundp 'backtrace-frames) ; Suppress compiler warning.
+             ;; If we're about to change `auto-fill-function' too,
+             ;; it's okay (probably).
+             (not (and (eq op 'makunbound)
+                       (not (eq (default-value 'auto-fill-function) 
'yas--auto-fill))
+                       (cl-member 'kill-all-local-variables
+                                  (backtrace-frames 'yas--watch-auto-fill)
+                                  :key (lambda (frame) (nth 1 frame))))))
     (debug nil "`yas--original-auto-fill-function' unexpectedly nil! Please 
report this backtrace (hit `c' to continue)")) )
 
 ;; Try to get more info on #873/919 (this only works for Emacs 26+).



reply via email to

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