unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: Ari Roponen <ari.roponen@gmail.com>, 22332@debbugs.gnu.org
Subject: bug#22332: 25.0.50; woman moves point in a wrong buffer
Date: Sat, 9 Jan 2016 11:36:13 -0500	[thread overview]
Message-ID: <CAFyQvY1K_A4_Zz9QPucjdg5i8M4f5K=y7i8B729YLjmXhC_A-g@mail.gmail.com> (raw)
In-Reply-To: <5690D1EE.4000306@gmx.at>

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

Hi Martin, Ari,

I should have read the documentation of WoMan-find-buffer before sending
that earlier patch.

Here's a patch to fix that.
- The display-buffer is still retained in WoMan-find-buffer so that the
display-buffer-alist rules can apply. But after that the switch-to-buffer
calls are added so that (1) the point switches to the WoMan buffer, and (2)
WoMan-find-buffer returns the buffer name (instead of the window name,
which display-buffer returns).


Ari: Please let us know if the patch fixes the bug for you. I have verified
it to fix it for me locally.
Martin: Can you please commit this patch once it is verified by Ari and you?

Thanks.


======

From db908f6fc7bd64266744a32664d9c60fb132595a Mon Sep 17 00:00:00 2001
From: Kaushal Modi <kaushal.modi@gmail.com>
Date: Sat, 9 Jan 2016 11:29:40 -0500
Subject: [PATCH] WoMan-find-buffer switches to/returns buffer

- Fix for bug #22332
---
 lisp/woman.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/woman.el b/lisp/woman.el
index 4ca7dbe..24dbd63 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -2061,20 +2061,23 @@ WoMan-find-buffer
   (if (zerop woman-buffer-number)
       (let ((buffer (get-buffer (cdr (car woman-buffer-alist)))))
  (if buffer
-    (display-buffer buffer)
+            (progn
+              (display-buffer buffer)
+              (switch-to-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
-  (display-buffer buffer)
+          (progn
+            (display-buffer buffer)
+            (switch-to-buffer buffer))
  ;; Delete alist element:
  (setcdr prev-ptr (cdr (cdr prev-ptr)))
  (if (>= woman-buffer-number (length woman-buffer-alist))
     (setq woman-buffer-number 0))
  nil))))
-

 ;;; Syntax and display tables:

-- 
2.6.0.rc0.24.gec371ff

[-- Attachment #2: Type: text/html, Size: 3460 bytes --]

  reply	other threads:[~2016-01-09 16:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08 18:24 bug#22332: 25.0.50; woman moves point in a wrong buffer Ari Roponen
2016-01-09  9:25 ` martin rudalics
2016-01-09 16:36   ` Kaushal Modi [this message]
2016-01-09 16:54     ` martin rudalics
2016-01-09 17:19       ` Kaushal Modi
2016-01-09 17:29         ` Ari Roponen
2016-01-09 17:42           ` martin rudalics
2016-01-09 22:32             ` Kaushal Modi
2016-01-10 10:53               ` martin rudalics
2016-02-04  5:41                 ` Kaushal Modi
2016-02-04  7:55                   ` martin rudalics
2016-02-04  8:44                   ` Ari Roponen
2016-02-04 16:36                     ` Kaushal Modi
2016-02-18 16:20                       ` Kaushal Modi
2016-02-20  2:41                         ` John Wiegley
2016-02-20  6:17                           ` Lars Ingebrigtsen
2016-02-20  7:58                     ` Lars Ingebrigtsen
2016-01-09 17:42         ` martin rudalics

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='CAFyQvY1K_A4_Zz9QPucjdg5i8M4f5K=y7i8B729YLjmXhC_A-g@mail.gmail.com' \
    --to=kaushal.modi@gmail.com \
    --cc=22332@debbugs.gnu.org \
    --cc=ari.roponen@gmail.com \
    --cc=rudalics@gmx.at \
    /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).