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

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

[nongnu] elpa/swift-mode c67b950 388/496: Fixes which-function-mode hang


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode c67b950 388/496: Fixes which-function-mode hang when running swift-mode:current-defun-name in a non swift-mode buffer.
Date: Sun, 29 Aug 2021 11:34:13 -0400 (EDT)

branch: elpa/swift-mode
commit c67b950d019041a98742443320d898810ce78357
Author: John <john@olivetoast.com>
Commit: John <john@olivetoast.com>

    Fixes which-function-mode hang when running swift-mode:current-defun-name 
in a non swift-mode buffer.
    
    This affected users who have which-function-mode enabled globally.
---
 swift-mode.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/swift-mode.el b/swift-mode.el
index 063c967..d3159e9 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -215,7 +215,9 @@ Signal `scan-error' if it hits opening parentheses."
 
   (delete-overlay swift-mode:anchor-overlay)
 
-  (add-hook 'which-func-functions #'swift-mode:current-defun-name)
+  (add-hook 'which-func-functions (lambda ()
+                                    (when (equal (with-current-buffer 
(current-buffer) major-mode) 'swift-mode)
+                                      (swift-mode:current-defun-name))))
   (setq-local add-log-current-defun-function #'swift-mode:current-defun-name))
 
 ;;;###autoload (add-to-list 'auto-mode-alist '("\\.swift\\'" . swift-mode))



reply via email to

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