unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Augusto Stoffel <arstoffel@gmail.com>
To: 57408@debbugs.gnu.org
Subject: bug#57408: [PATCH] New value 'thrifty' for Man-notify-method
Date: Thu, 25 Aug 2022 18:32:50 +0200	[thread overview]
Message-ID: <87r114cmh9.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 133 bytes --]

Fiddling with buffer-display-alist can be a bit tricky[1], so I'd like to
suggest the following additional Man-notify-method value.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-New-option-thrifty-for-Man-notify-method.patch --]
[-- Type: text/x-patch, Size: 1850 bytes --]

From 4150463ed4743ba6e78c29b0ed690ebf809c85de Mon Sep 17 00:00:00 2001
From: Augusto Stoffel <arstoffel@gmail.com>
Date: Thu, 25 Aug 2022 18:21:39 +0200
Subject: [PATCH] New option thrifty for Man-notify-method

* lisp/man.el (Man-notify-when-ready): Accept new 'thrifty' notify
method.
(Man-notify-method): Explain what 'thrifty' does.
---
 lisp/man.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/man.el b/lisp/man.el
index d66f63972a..7ba7bee417 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -168,13 +168,14 @@ Man-notify-method
 bully      -- make the manpage the current buffer and only window (sf)
 aggressive -- make the manpage the current buffer in the other window (sf)
 friendly   -- display manpage in the other window but don't make current (sf)
+thrifty    -- reuse an existing manpage window if possible (sf)
 polite     -- don't display manpage, but prints message and beep when ready
 quiet      -- like `polite', but don't beep
 meek       -- make no indication that the manpage is ready
 
 Any other value of `Man-notify-method' is equivalent to `meek'."
   :type '(radio (const newframe) (const pushy) (const bully)
-		(const aggressive) (const friendly)
+		(const aggressive) (const friendly) (const thrifty)
 		(const polite) (const quiet) (const meek))
   :group 'man)
 
@@ -1229,6 +1230,11 @@ Man-notify-when-ready
        (and (frame-live-p saved-frame)
             (select-frame saved-frame))
        (display-buffer man-buffer 'not-this-window))
+      ('thrifty
+       (and (frame-live-p saved-frame)
+            (select-frame saved-frame))
+       (display-buffer man-buffer '(display-buffer-reuse-mode-window
+                                    (mode . Man-mode))))
       ('polite
        (beep)
        (message "Manual buffer %s is ready" (buffer-name man-buffer)))
-- 
2.37.2


[-- Attachment #3: Type: text/plain, Size: 203 bytes --]


[1]: For instance, Man-getpage-in-background may display a manpage
buffer before setting its major mode, so setting
    (setq display-buffer-alist '(((derived-mode . Man-mode) ... )) ...)
doesn't work.

             reply	other threads:[~2022-08-25 16:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25 16:32 Augusto Stoffel [this message]
2022-08-26 11:12 ` bug#57408: [PATCH] New value 'thrifty' for Man-notify-method Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r114cmh9.fsf@gmail.com \
    --to=arstoffel@gmail.com \
    --cc=57408@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).