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

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

[elpa] externals/lentic 02073c4f1c 285/333: Remove buffer-list-update-ho


From: ELPA Syncer
Subject: [elpa] externals/lentic 02073c4f1c 285/333: Remove buffer-list-update-hook.
Date: Tue, 27 Feb 2024 13:00:45 -0500 (EST)

branch: externals/lentic
commit 02073c4f1c376c99511e0e637a15ed0da18405a8
Author: Phillip Lord <phillip.lord@russet.org.uk>
Commit: Phillip Lord <phillip.lord@russet.org.uk>

    Remove buffer-list-update-hook.
    
    The hook function is too computationally intensive, and has mostly been
    obsoleted because the display is updated explicitly in most places.
    
    Closes #42.
---
 lentic-mode.el | 10 ++--------
 lentic.el      | 10 ++++++++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/lentic-mode.el b/lentic-mode.el
index 931bbefa2f..970d438b68 100644
--- a/lentic-mode.el
+++ b/lentic-mode.el
@@ -294,22 +294,18 @@ See also `lentic-mode-move-lentic-window'."
                       lentic-config))
                   ""))))
 
-(defun lentic-mode-buffer-list-update-hook ()
+(defun lentic-mode-update-all-display ()
   (if lentic-emergency
       (setq lentic-mode-line
             (format " %s[Emergency]" lentic-mode-line-lighter))
     (-map
      (lambda (b)
-       (with-current-buffer
+       (lentic-when-with-current-buffer
            b
          (lentic-mode-update-mode-line)))
      (buffer-list))
     (force-mode-line-update t)))
 
-(add-hook 'buffer-list-update-hook
-          'lentic-mode-buffer-list-update-hook)
-
-
 ;; ** lentic self-doc
 
 ;; #+begin_src: emacs-lisp
@@ -323,8 +319,6 @@ See also `lentic-mode-move-lentic-window'."
   (interactive)
   (lentic-doc-external-view 'lentic))
 
-
-
 ;;;###autoload
 (define-minor-mode lentic-mode
   "Documentation"
diff --git a/lentic.el b/lentic.el
index a63feeac05..c733e42fe2 100644
--- a/lentic.el
+++ b/lentic.el
@@ -834,12 +834,14 @@ repeated errors.")
 (defun lentic-emergency ()
   "Stop lentic from working due to code problem."
   (interactive)
-  (setq lentic-emergency t))
+  (setq lentic-emergency t)
+  (lentic-update-all-display))
 
 (defun lentic-unemergency ()
   "Start lentic working after stop due to code problem."
   (interactive)
-  (setq lentic-emergency nil))
+  (setq lentic-emergency nil)
+  (lentic-update-all-display))
 
 (defun lentic-hook-fail (err hook)
   "Give an informative message when we have to fail.
@@ -1266,6 +1268,10 @@ same top-left location. Update details depend on CONF."
   "Update the display with information about lentic's state."
   (when (fboundp 'lentic-mode-update-mode-line)
     (lentic-mode-update-mode-line)))
+
+(defun lentic-update-all-display ()
+  (when (fboundp 'lentic-mode-update-all-display)
+    (lentic-mode-update-all-display)))
 ;; #+end_src
 
 



reply via email to

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