GNU bug report logs - #17769
24.4.50; [PATCH] rcirc-omit-mode: `recenter'ing a window that does not display current-buffer.

Previous Next

Package: emacs;

Reported by: Daimrod <daimrod <at> gmail.com>

Date: Fri, 13 Jun 2014 07:00:02 UTC

Severity: normal

Tags: patch

Merged with 17778

Found in version 24.4.50

Done: Leo Liu <sdl.web <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17769 in the body.
You can then email your comments to 17769 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#17769; Package emacs. (Fri, 13 Jun 2014 07:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daimrod <daimrod <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 13 Jun 2014 07:00:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Daimrod <daimrod <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4.50;
 [PATCH] rcirc-omit-mode: `recenter'ing a window that does not display
 current-buffer.
Date: Fri, 13 Jun 2014 15:59:33 +0900
[Message part 1 (text/plain, inline)]
Hi,

The attached patch prevents `rcirc-omit-mode' to call `recenter' when
`window-buffer' isn't the same as `current-buffer'.


If `rcirc-omit-mode' is enabled by the user interactively (e.g. with C-c
C-o) then it will do the right thing.

If `rcirc-omit-mode' was called from elisp (e.g. from a hook), then we
don't need to `recenter' the buffer, because it will be done the next
time the user switch to the buffer with `rcirc-next-active-buffer'.

I'm not an RCIRC expert, but I don't think anything else is required.
WDYT?

[0001-lisp-net-rcirc.el-rcirc-omit-mode-Do-not-recenter-if.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
--
Daimrod/Greg

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17769; Package emacs. (Fri, 13 Jun 2014 08:31:01 GMT) Full text and rfc822 format available.

Message #8 received at 17769 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daimrod <daimrod <at> gmail.com>
Cc: 17769 <at> debbugs.gnu.org
Subject: Re: bug#17769: 24.4.50;
 [PATCH] rcirc-omit-mode: `recenter'ing a window that does not
 display	current-buffer.
Date: Fri, 13 Jun 2014 11:29:44 +0300
> From: Daimrod <daimrod <at> gmail.com>
> Date: Fri, 13 Jun 2014 15:59:33 +0900
> 
> The attached patch prevents `rcirc-omit-mode' to call `recenter' when
> `window-buffer' isn't the same as `current-buffer'.
> 
> 
> If `rcirc-omit-mode' is enabled by the user interactively (e.g. with C-c
> C-o) then it will do the right thing.
> 
> If `rcirc-omit-mode' was called from elisp (e.g. from a hook), then we
> don't need to `recenter' the buffer, because it will be done the next
> time the user switch to the buffer with `rcirc-next-active-buffer'.
> 
> I'm not an RCIRC expert, but I don't think anything else is required.
> WDYT?

This doesn't sound like the right fix to me.  Instead, the code should
momentarily switch to the right window, and call recenter there.
That's surely what the author of this code intended, AFAIU.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17769; Package emacs. (Fri, 13 Jun 2014 09:15:02 GMT) Full text and rfc822 format available.

Message #11 received at 17769 <at> debbugs.gnu.org (full text, mbox):

From: Daimrod <daimrod <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 17769 <at> debbugs.gnu.org
Subject: Re: bug#17769: 24.4.50;
 [PATCH] rcirc-omit-mode: `recenter'ing a window that does not
 display	current-buffer.
Date: Fri, 13 Jun 2014 18:14:09 +0900
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Daimrod <daimrod <at> gmail.com>
>> Date: Fri, 13 Jun 2014 15:59:33 +0900
>> 
>> The attached patch prevents `rcirc-omit-mode' to call `recenter' when
>> `window-buffer' isn't the same as `current-buffer'.
>> 
>> 
>> If `rcirc-omit-mode' is enabled by the user interactively (e.g. with C-c
>> C-o) then it will do the right thing.
>> 
>> If `rcirc-omit-mode' was called from elisp (e.g. from a hook), then we
>> don't need to `recenter' the buffer, because it will be done the next
>> time the user switch to the buffer with `rcirc-next-active-buffer'.
>> 
>> I'm not an RCIRC expert, but I don't think anything else is required.
>> WDYT?
>
> This doesn't sound like the right fix to me.  Instead, the code should
> momentarily switch to the right window, and call recenter there.
> That's surely what the author of this code intended, AFAIU.

But the buffer might not be displayed in any window.

For example, when one invoked `rcirc-connect' with some channels by
default:
: (rcirc-connect "localhost" 6667 nil nil nil '("#bar") nil)

Then a buffer "#bar <at> localhost" will be created but not displayed.

Regards,

-- 
Daimrod/Greg




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17769; Package emacs. (Fri, 13 Jun 2014 09:40:02 GMT) Full text and rfc822 format available.

Message #14 received at 17769 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daimrod <daimrod <at> gmail.com>
Cc: 17769 <at> debbugs.gnu.org
Subject: Re: bug#17769: 24.4.50;
 [PATCH] rcirc-omit-mode: `recenter'ing a window that does not
 display	current-buffer.
Date: Fri, 13 Jun 2014 12:38:55 +0300
> From: Daimrod <daimrod <at> gmail.com>
> Cc: 17769 <at> debbugs.gnu.org
> Date: Fri, 13 Jun 2014 18:14:09 +0900
> 
> > This doesn't sound like the right fix to me.  Instead, the code should
> > momentarily switch to the right window, and call recenter there.
> > That's surely what the author of this code intended, AFAIU.
> 
> But the buffer might not be displayed in any window.

Then with-current-buffer is your friend, I think.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17769; Package emacs. (Fri, 13 Jun 2014 09:55:02 GMT) Full text and rfc822 format available.

Message #17 received at 17769 <at> debbugs.gnu.org (full text, mbox):

From: Daimrod <daimrod <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 17769 <at> debbugs.gnu.org
Subject: Re: bug#17769: 24.4.50;
 [PATCH] rcirc-omit-mode: `recenter'ing a window that does not
 display	current-buffer.
Date: Fri, 13 Jun 2014 18:54:04 +0900
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Daimrod <daimrod <at> gmail.com>
>> Cc: 17769 <at> debbugs.gnu.org
>> Date: Fri, 13 Jun 2014 18:14:09 +0900
>> 
>> > This doesn't sound like the right fix to me.  Instead, the code should
>> > momentarily switch to the right window, and call recenter there.
>> > That's surely what the author of this code intended, AFAIU.
>> 
>> But the buffer might not be displayed in any window.
>
> Then with-current-buffer is your friend, I think.

IIUC the goal isn't to recenter the window-buffer but the
current-buffer, but that cannot be done because it is not displayed on
any windows.

So, I with-current-buffer won't help, I would need to use
with-current-buffer-window.

Or did I misundertand you?

-- 
Daimrod/Greg




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17769; Package emacs. (Fri, 13 Jun 2014 12:22:01 GMT) Full text and rfc822 format available.

Message #20 received at 17769 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daimrod <daimrod <at> gmail.com>
Cc: 17769 <at> debbugs.gnu.org
Subject: Re: bug#17769: 24.4.50;
 [PATCH] rcirc-omit-mode: `recenter'ing a window that does not
 display	current-buffer.
Date: Fri, 13 Jun 2014 15:21:14 +0300
> From: Daimrod <daimrod <at> gmail.com>
> Cc: 17769 <at> debbugs.gnu.org
> Date: Fri, 13 Jun 2014 18:54:04 +0900
> 
> IIUC the goal isn't to recenter the window-buffer but the
> current-buffer, but that cannot be done because it is not displayed on
> any windows.

Then don't recenter if it is not displayed in any window on any frame.
But if it is displayed in some window, recenter that window.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17769; Package emacs. (Fri, 13 Jun 2014 12:52:02 GMT) Full text and rfc822 format available.

Message #23 received at 17769 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Daimrod <daimrod <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 17769 <at> debbugs.gnu.org
Subject: Re: bug#17769: 24.4.50;
 [PATCH] rcirc-omit-mode: `recenter'ing a window that does not
 display	current-buffer.
Date: Fri, 13 Jun 2014 08:51:20 -0400
> But the buffer might not be displayed in any window.

Then I guess it should check that get-buffer-window does return a window
and do nothing if it doesn't.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17769; Package emacs. (Fri, 13 Jun 2014 12:53:01 GMT) Full text and rfc822 format available.

Message #26 received at 17769 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>, Daimrod <daimrod <at> gmail.com>
Cc: 17769 <at> debbugs.gnu.org
Subject: Re: bug#17769: 24.4.50; [PATCH] rcirc-omit-mode: `recenter'ing a
 window that does not display	current-buffer.
Date: Fri, 13 Jun 2014 14:51:49 +0200
> But if it is displayed in some window, recenter that window.

Strictly spoken this should read "But if it is displayed in the selected
window, recenter that window."

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17769; Package emacs. (Fri, 13 Jun 2014 13:31:04 GMT) Full text and rfc822 format available.

Message #29 received at 17769 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: daimrod <at> gmail.com, 17769 <at> debbugs.gnu.org
Subject: Re: bug#17769: 24.4.50;
 [PATCH] rcirc-omit-mode: `recenter'ing a window that does not
 display	current-buffer.
Date: Fri, 13 Jun 2014 16:30:04 +0300
> Date: Fri, 13 Jun 2014 14:51:49 +0200
> From: martin rudalics <rudalics <at> gmx.at>
> CC: 17769 <at> debbugs.gnu.org
> 
>  > But if it is displayed in some window, recenter that window.
> 
> Strictly spoken this should read "But if it is displayed in the selected
> window, recenter that window."

No, because in that case it would already have been done by a normal
call to recenter.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17769; Package emacs. (Fri, 13 Jun 2014 14:24:02 GMT) Full text and rfc822 format available.

Message #32 received at 17769 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: daimrod <at> gmail.com, 17769 <at> debbugs.gnu.org
Subject: Re: bug#17769: 24.4.50; [PATCH] rcirc-omit-mode: `recenter'ing a
 window that does not display	current-buffer.
Date: Fri, 13 Jun 2014 16:23:18 +0200
>> Strictly spoken this should read "But if it is displayed in the selected
>> window, recenter that window."
>
> No, because in that case it would already have been done by a normal
> call to recenter.

Unless the selected window displayed another buffer.  Then you probably
mean something like

  (dolist (window (get-buffer-window-list buffer))
    (with-selected-window window (recenter)))

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17769; Package emacs. (Fri, 13 Jun 2014 16:10:02 GMT) Full text and rfc822 format available.

Message #35 received at 17769 <at> debbugs.gnu.org (full text, mbox):

From: Daimrod <daimrod <at> gmail.com>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 17769 <at> debbugs.gnu.org
Subject: Re: bug#17769: 24.4.50;
 [PATCH] rcirc-omit-mode: `recenter'ing a window that does not
 display	current-buffer.
Date: Sat, 14 Jun 2014 01:08:52 +0900
[Message part 1 (text/plain, inline)]
martin rudalics <rudalics <at> gmx.at> writes:

>>> Strictly spoken this should read "But if it is displayed in the selected
>>> window, recenter that window."
>>
>> No, because in that case it would already have been done by a normal
>> call to recenter.
>
> Unless the selected window displayed another buffer.  Then you probably
> mean something like
>
>   (dolist (window (get-buffer-window-list buffer))
>     (with-selected-window window (recenter)))

I see, thanks for inputs.

Here is an updated patch.

[0001-lisp-net-rcirc.el-rcirc-omit-mode-recenter-the-corre.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
--
Daimrod/Greg

Merged 17769 17778. Request was from Kan-Ru Chen (陳侃如) <kanru <at> kanru.info> to control <at> debbugs.gnu.org. (Sat, 14 Jun 2014 13:19:02 GMT) Full text and rfc822 format available.

Reply sent to Leo Liu <sdl.web <at> gmail.com>:
You have taken responsibility. (Thu, 19 Jun 2014 11:19:02 GMT) Full text and rfc822 format available.

Notification sent to Daimrod <daimrod <at> gmail.com>:
bug acknowledged by developer. (Thu, 19 Jun 2014 11:19:03 GMT) Full text and rfc822 format available.

Message #42 received at 17769-done <at> debbugs.gnu.org (full text, mbox):

From: Leo Liu <sdl.web <at> gmail.com>
To: Daimrod <daimrod <at> gmail.com>
Cc: martin rudalics <rudalics <at> gmx.at>, Eli Zaretskii <eliz <at> gnu.org>,
 17769-done <at> debbugs.gnu.org
Subject: Re: bug#17769: 24.4.50;
 [PATCH] rcirc-omit-mode: `recenter'ing a window that does not
 display	current-buffer.
Date: Thu, 19 Jun 2014 19:18:12 +0800
Fixed in 24.5.

On 2014-06-14 01:08 +0900, Daimrod wrote:
> I see, thanks for inputs.
>
> Here is an updated patch.

Thanks for the patch.

Leo




Reply sent to Leo Liu <sdl.web <at> gmail.com>:
You have taken responsibility. (Thu, 19 Jun 2014 11:19:03 GMT) Full text and rfc822 format available.

Notification sent to Kan-Ru Chen (陳侃如) <kanru <at> kanru.info>:
bug acknowledged by developer. (Thu, 19 Jun 2014 11:19:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 17 Jul 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 308 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.