From: Kaushal <kaushal.modi@gmail.com>
To: michael_heerdegen@web.de, 21047@debbugs.gnu.org
Subject: bug#21047: 25.0.50; Make M-x woman respect display-buffer-alist
Date: Mon, 13 Jul 2015 15:06:10 +0000 [thread overview]
Message-ID: <CAFyQvY35OLwTmO0u8kGYsDn0pmk2z+kwyMj=Rjr2LkkcL9qmZQ@mail.gmail.com> (raw)
In-Reply-To: <87wpyt5c26.fsf@web.de>
[-- Attachment #1: Type: text/plain, Size: 2670 bytes --]
Hi,
This was posted on the emacs-devel list a while back and it was suggested
that this be posted on bug-gnu-emacs.
The aim of this patch is that opening M-x woman buffers be controlled using
display-buffer-alist. Using display-buffer function instead of
switch-to-buffer function will allow the user to control how they want to
open the WoMan buffers (same window, other window, popup, etc)
The patch is below:
Date: Mon, 13 Jul 2015 11:00:39 -0400
Subject: [PATCH] Allow display-buffer-alist to control woman bufs
---
lisp/woman.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lisp/woman.el b/lisp/woman.el
index 75c3d2e..e903caa 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -1651,7 +1651,7 @@ Do not call directly!"
(setq woman-frame (make-frame)))))
(set-buffer (get-buffer-create bufname))
(condition-case nil
- (switch-to-buffer (current-buffer))
+ (display-buffer (current-buffer))
(error (pop-to-buffer (current-buffer))))
(buffer-disable-undo)
(setq buffer-read-only nil)
@@ -2061,14 +2061,14 @@ alist in `woman-buffer-alist' and return nil."
(if (zerop woman-buffer-number)
(let ((buffer (get-buffer (cdr (car woman-buffer-alist)))))
(if buffer
- (switch-to-buffer buffer)
+ (display-buffer buffer)
;; Delete alist element:
(setq woman-buffer-alist (cdr woman-buffer-alist))
nil))
(let* ((prev-ptr (nthcdr (1- woman-buffer-number) woman-buffer-alist))
(buffer (get-buffer (cdr (car (cdr prev-ptr))))))
(if buffer
- (switch-to-buffer buffer)
+ (display-buffer buffer)
;; Delete alist element:
(setcdr prev-ptr (cdr (cdr prev-ptr)))
(if (>= woman-buffer-number (length woman-buffer-alist))
--
1.9.2
On Wed, Jun 24, 2015 at 12:03 PM Michael Heerdegen <michael_heerdegen@web.de>
wrote:
> Hi Kaushal,
>
> > I was trying to make the WoMan buffers open as I intend to using
> > display-buffer-alist. But that was not working.
>
> I guess your message got lost here, better make a bug report, and
> better include a patch than the whole changed code.
>
> > can that change be made in the master?
>
> I think it would be an improvement.
>
> The very same applies to eww:
>
> --8<---------------cut here---------------start------------->8---
> (defun eww-setup-buffer ()
> (switch-to-buffer (get-buffer-create "*eww*")) ; <-----
> (let ((inhibit-read-only t))
> (remove-overlays)
> (erase-buffer))
> (unless (eq major-mode 'eww-mode)
> (eww-mode)))
> --8<---------------cut here---------------end--------------->8---
>
> Maybe there are more cases. It's surely worth discussing.
>
>
> Regards,
>
> Michael.
>
[-- Attachment #2: Type: text/html, Size: 4446 bytes --]
next parent reply other threads:[~2015-07-13 15:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAFyQvY27mYunAGy6yuzoMf5L03BFySwam_TKCXofMK3yR2fd3w@mail.gmail.com>
[not found] ` <87wpyt5c26.fsf@web.de>
2015-07-13 15:06 ` Kaushal [this message]
2015-08-20 17:35 ` bug#21047: 25.0.50; Make M-x woman respect display-buffer-alist Kaushal
2015-08-21 5:42 ` Stefan Monnier
2015-08-21 11:17 ` Kaushal
2015-08-21 12:25 ` martin rudalics
2015-08-21 12:30 ` Kaushal
2015-08-21 13:36 ` Kaushal
2015-08-21 15:11 ` martin rudalics
2015-08-21 15:13 ` Kaushal
2015-08-21 15:16 ` Kaushal
2015-08-21 15:30 ` martin rudalics
2015-08-21 15:33 ` Kaushal
2015-08-21 15:58 ` martin rudalics
2015-08-21 16:00 ` Kaushal
2015-08-24 8:16 ` martin rudalics
2015-08-24 10:46 ` Kaushal Modi
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='CAFyQvY35OLwTmO0u8kGYsDn0pmk2z+kwyMj=Rjr2LkkcL9qmZQ@mail.gmail.com' \
--to=kaushal.modi@gmail.com \
--cc=21047@debbugs.gnu.org \
--cc=michael_heerdegen@web.de \
/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).