GNU bug report logs - #13466
find-file-noselect scrolls current buffer

Previous Next

Package: emacs;

Reported by: Michael Brand <michael.ch.brand <at> gmail.com>

Date: Wed, 16 Jan 2013 19:26:02 UTC

Severity: minor

Tags: notabug

Done: Glenn Morris <rgm <at> gnu.org>

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 13466 in the body.
You can then email your comments to 13466 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#13466; Package emacs. (Wed, 16 Jan 2013 19:26:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Brand <michael.ch.brand <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 16 Jan 2013 19:26:03 GMT) Full text and rfc822 format available.

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

From: Michael Brand <michael.ch.brand <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: find-file-noselect scrolls current buffer
Date: Wed, 16 Jan 2013 19:27:56 +0100
Hi all

Although the issue seems to be independent of the mode it becomes
mainly annoying when an Org mode buffer scrolls unwantedly when a link
to an other Org mode buffer is followed. It depends on that the target
buffer has a mode hook that moves point, in my case to search a
file-specific config that I have to process myself. I was able to
drill down the issue to a find-file-noselect with a simple mode hook
with only end-of-buffer. I tried with org-mode-hook and
text-mode-hook, both show the issue. All GNU Emacs I had easily
available have the issue: GNU/Linux: 23.1.1. 23.3.1 24.2.1 24.2.92.1,
OS X: 23.3.1 24.1.1 24.2.2.

Minimal test to reproduce with text-mode-hook:

$ yes | nl | head -999 > /tmp/n
$ cp /tmp/n /tmp/m.txt
$ emacs -q /tmp/n
M-: (scroll-up)
M-: (add-hook 'text-mode-hook 'end-of-buffer)
M-: (find-file-noselect "/tmp/m.txt")

During the last step the buffer /tmp/n is scrolled which I consider a
bug. Note that when /tmp/m.txt is small this scrolling does not occur.
The same happens with find-file-other-window.

Is there a workaround how to use the hook? The save-excursion I have
around moving the point in the mode hook anyway is not enough.

Michael




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13466; Package emacs. (Wed, 16 Jan 2013 23:12:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Brand <michael.ch.brand <at> gmail.com>
Cc: 13466 <at> debbugs.gnu.org
Subject: Re: bug#13466: find-file-noselect scrolls current buffer
Date: Wed, 16 Jan 2013 18:10:22 -0500
> $ yes | nl | head -999 > /tmp/n
> $ cp /tmp/n /tmp/m.txt
> $ emacs -q /tmp/n
> M-: (scroll-up)
> M-: (add-hook 'text-mode-hook 'end-of-buffer)
> M-: (find-file-noselect "/tmp/m.txt")

The problem is end-of-buffer, which affects the selected-window, even if
it does not display the current-buffer.  Of course, its docstring says
not to use it from Lisp, so we could argue it's not quite a bug.
I.e. use

  M-: (add-hook 'text-mode-hook (lambda () (goto-char (point-max))))


-- Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13466; Package emacs. (Thu, 17 Jan 2013 18:46:02 GMT) Full text and rfc822 format available.

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

From: Michael Brand <michael.ch.brand <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 13466 <at> debbugs.gnu.org
Subject: Re: bug#13466: find-file-noselect scrolls current buffer
Date: Thu, 17 Jan 2013 19:44:28 +0100
Hi Stefan

Thank you for looking into this.

On Thu, Jan 17, 2013 at 12:10 AM, Stefan Monnier
<monnier <at> iro.umontreal.ca> wrote:
> The problem is end-of-buffer, which affects the selected-window, even if
> it does not display the current-buffer.  Of course, its docstring says
> not to use it from Lisp,

Interesting. I didn’t consider reading the docstring of
end-of-buffer...

> so we could argue it's not quite a bug.

Agreed, please close this “bug”.

> I.e. use
>   M-: (add-hook 'text-mode-hook (lambda () (goto-char (point-max))))

Yes, done. It uncovers an issue which I prefer to address on
emacs-orgmode <at> gnu.org:
“Follow link scrolls current buffer when table aligns”
http://lists.gnu.org/archive/html/emacs-orgmode/2013-01/msg00700.html

Michael




bug closed, send any further explanations to 13466 <at> debbugs.gnu.org and Michael Brand <michael.ch.brand <at> gmail.com> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 23 Jan 2013 18:48:02 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, 21 Feb 2013 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 127 days ago.

Previous Next


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