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

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

[elpa] externals/popper 0e16eb9b86 050/102: Tweaks to readme, major-mode


From: ELPA Syncer
Subject: [elpa] externals/popper 0e16eb9b86 050/102: Tweaks to readme, major-mode identification code
Date: Fri, 8 Sep 2023 15:58:53 -0400 (EDT)

branch: externals/popper
commit 0e16eb9b866ec199c0595cea93749efe3ddde896
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>

    Tweaks to readme, major-mode identification code
---
 README.org | 17 ++++++++---------
 popper.el  |  8 +++-----
 2 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/README.org b/README.org
index 0511ad8024..a44ceadd63 100644
--- a/README.org
+++ b/README.org
@@ -191,13 +191,13 @@ To specify popups to auto-hide, use a cons cell with the 
=hide= symbol when spec
 
 #+begin_src emacs-lisp
   (setq popper-reference-buffers
-      '("\\*Messages\\*"
-        ("\\*Async Shell Command\\*" . hide)
+      '(("Output\\*$" . hide)
         (completion-list-mode . hide)
-        occur-mode))
+        occur-mode
+        "\\*Messages\\*"))
 #+end_src
 
-This assignment will suppress async shell command output and the Completions 
buffer. The other entries are treated as normal popups.
+This assignment will suppress all buffers ending in =Output*= and the 
Completions buffer. The other entries are treated as normal popups.
 
 You can combine the hiding feature with predicates for classifying buffers as 
popups:
 
@@ -205,13 +205,12 @@ You can combine the hiding feature with predicates for 
classifying buffers as po
   (defun popper-shell-output-empty-p (buf)
     (and (string-match-p "\\*Async Shell Command\\*" (buffer-name buf))
          (= (buffer-size buf) 0)))
-  
-  (setq popper-reference-buffers
-        '("\\*Messages\\*"
-          (popper-shell-output-empty-p . hide)))
+
+  (add-to-list 'popper-reference-buffers
+               '(popper-shell-output-empty-p . hide))
 #+END_SRC
 
-This assignment will suppress display of the async shell command output buffer 
only when there is no output (stdout). Once it is hidden it will be treated as 
a popup on par with the Messages buffer.
+This assignment will suppress display of the async shell command output buffer 
only when there is no output (stdout). Once it is hidden it will be treated as 
a popup on par with other entries in =popper-reference-buffers=.
 
 * Technical notes
 =popper= uses a buffer local variable (=popper-popup-status=) to identify if a 
given buffer should be treated as a popup. Matching is always by buffer and not 
window, so having two windows of a buffer, one treated as a popup and one as a 
regular window, isn't possible (although you can do this with indirect clones). 
In addition, it maintains an alist of popup windows/buffers for cycling through.
diff --git a/popper.el b/popper.el
index bbcc144fab..347c4fc937 100644
--- a/popper.el
+++ b/popper.el
@@ -601,11 +601,9 @@ If BUFFER is not specified act on the current buffer 
instead."
     (pcase elm
       ((pred stringp) 'name)
       ((and (pred symbolp)
-            (guard (or (get elm 'derived-mode-parent)
-                       (get elm 'mode-class)
-                       (not (boundp elm))
-                       (not (fboundp elm))
-                       (commandp elm))))
+            (guard (or (memq 'derived-mode-parent (symbol-plist elm))
+                       (memq 'mode-class (symbol-plist elm))
+                       (string= "-mode" (substring (symbol-name elm) -5)))))
        'mode)
       ((pred functionp) 'pred)
       ((pred consp) 'cons)))



reply via email to

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