GNU bug report logs -
#74924
29.3; Buffer showing manpage jumps back to beginning
Previous Next
To reply to this bug, email your comments to 74924 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74924
; Package
emacs
.
(Tue, 17 Dec 2024 09:08:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Ture Pålsson <ture <at> turepalsson.se>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 17 Dec 2024 09:08:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
1. Run in a terminal window. Operating system seems not to matter; I can
reproduce on both macOS and Linux.
2. Set environment variable MANWIDTH to 80 .
3. Start Emacs ('emacs -nw -Q').
4. Do M-x man, enter the name of some manpage, and type RET.
5. Switch to the manpage window (C-x o), and scroll down by typing 'C-v'
a few times.
6. Switch back to the *scratch* window (C-x o again).
7. After about a second, the manpage window jumps back to the beginning
of the buffer.
My *guess* is that this is related to the changes in commit
7e387c9e5265b98dbb3b986f8ab8ac2217052831, but that may well be a red
herring.
In GNU Emacs 29.3 (build 1, aarch64-apple-darwin23.4.0, NS
appkit-2487.50 Version 14.4.1 (Build 23E224)) of 2024-04-28 built on
agaton
Repository revision: 8d7918ec1f42048ed994dfd0e4d582d8acaabd45
Repository branch: master
System Description: macOS 15.1.1
Configured using:
'configure --prefix=/Users/ture/Nobackup/emacsbuild --with-ns
--without-gif CPPFLAGS=-I/Users/ture/Nobackup/emacsbuild/include
LDFLAGS=-L/Users/ture/Nobackup/emacsbuild/lib'
Configured features:
ACL GMP GNUTLS JPEG LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER ZLIB
Important settings:
value of $LC_CTYPE: sv_SE.UTF-8
value of $LC_MESSAGES: C
value of $LANG: sv_SE.UTF-8
locale-coding-system: utf-8-unix
Major mode: Fundamental
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
blink-cursor-mode: t
buffer-read-only: t
line-number-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
view-mode: t
Load-path shadows:
/Users/ture/Library/Emacs Lisp/python hides /Applications/Emacs.app/Contents/Resources/lisp/progmodes/python
Features:
(shadow sort mail-extr emacsbug message yank-media puny dired
dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util text-property-search time-date mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils view term/screen
term/xterm xterm ture-theme ansi-color finder-inf package browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x
map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads kqueue cocoa ns multi-tty
make-network-process emacs)
Memory information:
((conses 16 81755 10005)
(symbols 48 8456 0)
(strings 32 27783 2349)
(string-bytes 1 757038)
(vectors 16 19632)
(vector-slots 8 929234 167765)
(floats 8 31 543)
(intervals 56 292 0)
(buffers 984 12))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74924
; Package
emacs
.
(Tue, 17 Dec 2024 13:21:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 74924 <at> debbugs.gnu.org (full text, mbox):
found 74924 29.3
found 74924 31.0.50
tags 74924 + confirmed
thanks
Ture Pålsson <ture <at> turepalsson.se> writes:
> 1. Run in a terminal window. Operating system seems not to matter; I can
> reproduce on both macOS and Linux.
>
> 2. Set environment variable MANWIDTH to 80 .
>
> 3. Start Emacs ('emacs -nw -Q').
>
> 4. Do M-x man, enter the name of some manpage, and type RET.
>
> 5. Switch to the manpage window (C-x o), and scroll down by typing 'C-v'
> a few times.
>
> 6. Switch back to the *scratch* window (C-x o again).
>
> 7. After about a second, the manpage window jumps back to the beginning
> of the buffer.
>
> My *guess* is that this is related to the changes in commit
> 7e387c9e5265b98dbb3b986f8ab8ac2217052831, but that may well be a red
> herring.
I can reproduce this on both 29.3 and master on GNU/Linux.
bug Marked as found in versions 31.0.50.
Request was from
Stefan Kangas <stefankangas <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Tue, 17 Dec 2024 13:21:02 GMT)
Full text and
rfc822 format available.
Added tag(s) confirmed.
Request was from
Stefan Kangas <stefankangas <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Tue, 17 Dec 2024 13:21:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74924
; Package
emacs
.
(Tue, 17 Dec 2024 13:36:03 GMT)
Full text and
rfc822 format available.
Message #15 received at 74924 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Tue, 17 Dec 2024 13:19:00 +0000, Stefan Kangas <stefankangas <at> gmail.com> said:
Stefan> found 74924 29.3
Stefan> found 74924 31.0.50
Stefan> tags 74924 + confirmed
Stefan> thanks
Stefan> Ture Pålsson <ture <at> turepalsson.se> writes:
>> 1. Run in a terminal window. Operating system seems not to matter; I can
>> reproduce on both macOS and Linux.
>>
>> 2. Set environment variable MANWIDTH to 80 .
>>
>> 3. Start Emacs ('emacs -nw -Q').
>>
>> 4. Do M-x man, enter the name of some manpage, and type RET.
>>
>> 5. Switch to the manpage window (C-x o), and scroll down by typing 'C-v'
>> a few times.
>>
>> 6. Switch back to the *scratch* window (C-x o again).
>>
>> 7. After about a second, the manpage window jumps back to the beginning
>> of the buffer.
>>
>> My *guess* is that this is related to the changes in commit
>> 7e387c9e5265b98dbb3b986f8ab8ac2217052831, but that may well be a red
>> herring.
Stefan> I can reproduce this on both 29.3 and master on GNU/Linux.
This code from man.el should be setq-localʼing Man-columns
unconditionally, I think (itʼs nil by default):
(when (or window-system
(not (or (getenv "MANWIDTH") (getenv "COLUMNS"))))
;; Since the page buffer is displayed beforehand,
;; we can select its window and get the window/frame width.
(setq-local Man-columns (Man-columns))
(setenv "COLUMNS" (number-to-string Man-columns)))
Robert
--
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74924
; Package
emacs
.
(Tue, 17 Dec 2024 13:38:02 GMT)
Full text and
rfc822 format available.
Message #18 received at 74924 <at> debbugs.gnu.org (full text, mbox):
> From: Ture Pålsson <ture <at> turepalsson.se>
> Date: Tue, 17 Dec 2024 10:07:18 +0100
>
>
> 1. Run in a terminal window. Operating system seems not to matter; I can
> reproduce on both macOS and Linux.
>
> 2. Set environment variable MANWIDTH to 80 .
>
> 3. Start Emacs ('emacs -nw -Q').
>
> 4. Do M-x man, enter the name of some manpage, and type RET.
>
> 5. Switch to the manpage window (C-x o), and scroll down by typing 'C-v'
> a few times.
>
> 6. Switch back to the *scratch* window (C-x o again).
>
> 7. After about a second, the manpage window jumps back to the beginning
> of the buffer.
Does the async command ('man' and the filter into which 'man' is
piped) still run when you do the above? Or is this after the
background formatting has ended? I'm guessing the former.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74924
; Package
emacs
.
(Sat, 28 Dec 2024 11:40:02 GMT)
Full text and
rfc822 format available.
Message #21 received at 74924 <at> debbugs.gnu.org (full text, mbox):
> Cc: Ture Pålsson <ture <at> turepalsson.se>, 74924 <at> debbugs.gnu.org
> From: Robert Pluim <rpluim <at> gmail.com>
> Date: Tue, 17 Dec 2024 14:34:37 +0100
>
> >>>>> On Tue, 17 Dec 2024 13:19:00 +0000, Stefan Kangas <stefankangas <at> gmail.com> said:
>
> Stefan> found 74924 29.3
> Stefan> found 74924 31.0.50
> Stefan> tags 74924 + confirmed
> Stefan> thanks
>
> Stefan> Ture Pålsson <ture <at> turepalsson.se> writes:
>
> >> 1. Run in a terminal window. Operating system seems not to matter; I can
> >> reproduce on both macOS and Linux.
> >>
> >> 2. Set environment variable MANWIDTH to 80 .
> >>
> >> 3. Start Emacs ('emacs -nw -Q').
> >>
> >> 4. Do M-x man, enter the name of some manpage, and type RET.
> >>
> >> 5. Switch to the manpage window (C-x o), and scroll down by typing 'C-v'
> >> a few times.
> >>
> >> 6. Switch back to the *scratch* window (C-x o again).
> >>
> >> 7. After about a second, the manpage window jumps back to the beginning
> >> of the buffer.
> >>
> >> My *guess* is that this is related to the changes in commit
> >> 7e387c9e5265b98dbb3b986f8ab8ac2217052831, but that may well be a red
> >> herring.
>
> Stefan> I can reproduce this on both 29.3 and master on GNU/Linux.
>
>
> This code from man.el should be setq-localʼing Man-columns
> unconditionally, I think (itʼs nil by default):
>
> (when (or window-system
> (not (or (getenv "MANWIDTH") (getenv "COLUMNS"))))
> ;; Since the page buffer is displayed beforehand,
> ;; we can select its window and get the window/frame width.
> (setq-local Man-columns (Man-columns))
> (setenv "COLUMNS" (number-to-string Man-columns)))
If this fixes the problem, please install on master, and thanks.
Added tag(s) patch.
Request was from
Stefan Kangas <stefankangas <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Thu, 02 Jan 2025 01:29:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74924
; Package
emacs
.
(Mon, 06 Jan 2025 19:26:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 74924 <at> debbugs.gnu.org (full text, mbox):
> This code from man.el should be setq-localʼing Man-columns
> unconditionally, I think (itʼs nil by default):
>
> (when (or window-system
> (not (or (getenv "MANWIDTH") (getenv "COLUMNS"))))
> ;; Since the page buffer is displayed beforehand,
> ;; we can select its window and get the window/frame width.
> (setq-local Man-columns (Man-columns))
> (setenv "COLUMNS" (number-to-string Man-columns)))
The problem is that the number returned by '(Man-columns)'
is inapplicable in case of "MANWIDTH".
So I will add a check for 'Man-columns' like below.
However, before pushing the patch, let's solve another problem
that the manpage window jumps back to the beginning
even on a window system. Here is the reproducible test case:
1. emacs -Q
2. M-x man RET man RET
3. C-M-v (scroll-other-window)
4. Reduce the width of the frame
5. manpage window jumps back to the beginning
So unless Martin has objections, I will also change
'with-current-buffer' to 'with-selected-window':
diff --git a/lisp/man.el b/lisp/man.el
index 29c3dec501c..ba4f01122e2 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -1300,8 +1300,9 @@ Man--window-state-change
(defun Man-fit-to-window (window)
"Adjust width of the buffer to fit columns into WINDOW boundaries."
(when (window-live-p window)
- (with-current-buffer (window-buffer window)
+ (with-selected-window window
(when (and (derived-mode-p 'Man-mode)
+ Man-columns
(not (eq Man-columns (Man-columns))))
(let ((proc (get-buffer-process (current-buffer))))
(unless (and proc (not (eq (process-status proc) 'exit)))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74924
; Package
emacs
.
(Wed, 08 Jan 2025 09:58:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 74924 <at> debbugs.gnu.org (full text, mbox):
> However, before pushing the patch, let's solve another problem
> that the manpage window jumps back to the beginning
> even on a window system. Here is the reproducible test case:
>
> 1. emacs -Q
> 2. M-x man RET man RET
> 3. C-M-v (scroll-other-window)
> 4. Reduce the width of the frame
> 5. manpage window jumps back to the beginning
Why does it do that? I can try to find out by myself but I hope you
already know better.
> So unless Martin has objections, I will also change
> 'with-current-buffer' to 'with-selected-window':
I don't have any objections but we'd have to say why it is necessary for
curing the above problem.
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74924
; Package
emacs
.
(Thu, 09 Jan 2025 07:49:02 GMT)
Full text and
rfc822 format available.
Message #32 received at 74924 <at> debbugs.gnu.org (full text, mbox):
>> However, before pushing the patch, let's solve another problem
>> that the manpage window jumps back to the beginning
>> even on a window system. Here is the reproducible test case:
>>
>> 1. emacs -Q
>> 2. M-x man RET man RET
>> 3. C-M-v (scroll-other-window)
>> 4. Reduce the width of the frame
>> 5. manpage window jumps back to the beginning
>
> Why does it do that? I can try to find out by myself but I hope you
> already know better.
After resizing the frame, 'man' have to regenerate the buffer's contents
with new width.
>> So unless Martin has objections, I will also change
>> 'with-current-buffer' to 'with-selected-window':
>
> I don't have any objections but we'd have to say why it is necessary for
> curing the above problem.
I didn't realize that the problem is worse and actually
'with-selected-window' is not much of help. This is the same
problem how to restore the point position after reverting Dired buffer,
but much worse. In Dired we can remember a file name under point.
But for the Man buffer we can't even use some context around point
because after regeneration, the text layout changes significantly.
For example, in 'M-x man RET man RET' there is such text:
The manual page associated with each of these arguments
We could remember the context "The manual page". But after
resizing it's split to next line:
The
manual page associated with each of these arguments
Ok, need to try using 'window-point-context-use-default-function'
and modify it to ignore whitespace changes in context strings.
But first need to move 'window-point-context-use-default-function'
to the new file lisp/window-x.el after you will push
Pranshu's patch that creates the new file lisp/window-x.el ;-)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74924
; Package
emacs
.
(Thu, 09 Jan 2025 08:54:01 GMT)
Full text and
rfc822 format available.
Message #35 received at 74924 <at> debbugs.gnu.org (full text, mbox):
> After resizing the frame, 'man' have to regenerate the buffer's contents
> with new width.
I see.
> Ok, need to try using 'window-point-context-use-default-function'
> and modify it to ignore whitespace changes in context strings.
I would make it a two step procedure.
- In a first step try to find an exact fix.
- In the second step ignore whitespace changes.
The second step is slightly more dangerous because it might get us false
positives.
> But first need to move 'window-point-context-use-default-function'
> to the new file lisp/window-x.el after you will push
> Pranshu's patch that creates the new file lisp/window-x.el ;-)
I'm still waiting for Eli's approval.
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74924
; Package
emacs
.
(Thu, 09 Jan 2025 09:05:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 74924 <at> debbugs.gnu.org (full text, mbox):
> Cc: Robert Pluim <rpluim <at> gmail.com>,
> Ture Pålsson <ture <at> turepalsson.se>,
> Stefan Kangas <stefankangas <at> gmail.com>, 74924 <at> debbugs.gnu.org
> Date: Thu, 9 Jan 2025 09:53:17 +0100
> From: martin rudalics via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>
> > After resizing the frame, 'man' have to regenerate the buffer's contents
> > with new width.
>
> I see.
>
> > Ok, need to try using 'window-point-context-use-default-function'
> > and modify it to ignore whitespace changes in context strings.
>
> I would make it a two step procedure.
>
> - In a first step try to find an exact fix.
>
> - In the second step ignore whitespace changes.
>
> The second step is slightly more dangerous because it might get us false
> positives.
>
> > But first need to move 'window-point-context-use-default-function'
> > to the new file lisp/window-x.el after you will push
> > Pranshu's patch that creates the new file lisp/window-x.el ;-)
>
> I'm still waiting for Eli's approval.
Sorry, I wasn't aware you were waiting for my approval. Where's the
message asking for the approval, so I could re-read it?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74924
; Package
emacs
.
(Thu, 09 Jan 2025 09:36:01 GMT)
Full text and
rfc822 format available.
Message #41 received at 74924 <at> debbugs.gnu.org (full text, mbox):
> Sorry, I wasn't aware you were waiting for my approval. Where's the
> message asking for the approval, so I could re-read it?
https://lists.gnu.org/archive/html/emacs-devel/2024-12/msg00702.html
Pranshu's last take on this is here
https://lists.gnu.org/archive/html/emacs-devel/2025-01/msg00002.html
martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74924
; Package
emacs
.
(Thu, 09 Jan 2025 14:40:02 GMT)
Full text and
rfc822 format available.
Message #44 received at 74924 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 9 Jan 2025 10:35:39 +0100
> Cc: juri <at> linkov.net, rpluim <at> gmail.com, ture <at> turepalsson.se,
> stefankangas <at> gmail.com, 74924 <at> debbugs.gnu.org
> From: martin rudalics <rudalics <at> gmx.at>
>
> > Sorry, I wasn't aware you were waiting for my approval. Where's the
> > message asking for the approval, so I could re-read it?
>
> https://lists.gnu.org/archive/html/emacs-devel/2024-12/msg00702.html
>
> Pranshu's last take on this is here
>
> https://lists.gnu.org/archive/html/emacs-devel/2025-01/msg00002.html
Thanks.
The NEWS entry should quote the function names 'like this'.
Other than that, please feel to install, unless there are specific
aspects or portions of the patch you'd like me to look closer at.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74924
; Package
emacs
.
(Thu, 09 Jan 2025 18:37:01 GMT)
Full text and
rfc822 format available.
Message #47 received at 74924 <at> debbugs.gnu.org (full text, mbox):
>> After resizing the frame, 'man' have to regenerate the buffer's contents
>> with new width.
>
> I see.
>
>> Ok, need to try using 'window-point-context-use-default-function'
>> and modify it to ignore whitespace changes in context strings.
>
> I would make it a two step procedure.
>
> - In a first step try to find an exact fix.
>
> - In the second step ignore whitespace changes.
>
> The second step is slightly more dangerous because it might get us false
> positives.
Ok, now I pushed the immediate fix for this bug report that checks
for 'Man-columns'. Then later will do this two step procedure
for a more general problem in window-x.el.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74924
; Package
emacs
.
(Fri, 10 Jan 2025 08:55:02 GMT)
Full text and
rfc822 format available.
Message #50 received at 74924 <at> debbugs.gnu.org (full text, mbox):
> Other than that, please feel to install, unless there are specific
> aspects or portions of the patch you'd like me to look closer at.
I installed the window.c, window.el and windows.texi parts. If you find
the changes of the latter too excessive, please tell me what I should
remove or slash them yourself. I found some problems with window-x.el
so that has to wait until Pranshu fixes them.
Thanks, martin
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74924
; Package
emacs
.
(Thu, 13 Feb 2025 10:00:02 GMT)
Full text and
rfc822 format available.
Message #53 received at 74924 <at> debbugs.gnu.org (full text, mbox):
Juri Linkov <juri <at> linkov.net> writes:
>>> After resizing the frame, 'man' have to regenerate the buffer's contents
>>> with new width.
>>
>> I see.
>>
>>> Ok, need to try using 'window-point-context-use-default-function'
>>> and modify it to ignore whitespace changes in context strings.
>>
>> I would make it a two step procedure.
>>
>> - In a first step try to find an exact fix.
>>
>> - In the second step ignore whitespace changes.
>>
>> The second step is slightly more dangerous because it might get us false
>> positives.
>
> Ok, now I pushed the immediate fix for this bug report that checks
> for 'Man-columns'. Then later will do this two step procedure
> for a more general problem in window-x.el.
Were you able to make any progress with this?
Removed tag(s) patch.
Request was from
Stefan Kangas <stefankangas <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Thu, 13 Feb 2025 10:00:03 GMT)
Full text and
rfc822 format available.
Severity set to 'minor' from 'normal'
Request was from
Stefan Kangas <stefankangas <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Thu, 13 Feb 2025 10:00:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 127 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.