[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: the actions of the spacebar differ in GNU Emacs info [bad] and comma
From: |
Eli Zaretskii |
Subject: |
Re: the actions of the spacebar differ in GNU Emacs info [bad] and command line info [good] |
Date: |
Wed, 20 Dec 2000 19:51:57 +0200 |
[Please don't use fake addresses when posting here. We cannot fix
problems you report without being able to get back to you.]
> From: "Dan Jacobson" <jidanni@kimo.FiXcomTHiS.tw>
> Newsgroups: gnu.emacs.bug
> Date: Thu, 21 Dec 2000 00:43:52 +0800
>
> You page down with spacebar. you finally get to the end and then we
> see you are taken to the top menu item on the final screenful. I want
> to be taken to the top menu item of the entire page, not just the last
> screenful.
I made such a change for the next version of Emacs.
> Indeed what I want from Emacs Towers is hitting the spacebar be the
> same as flipping pages in a paper manual, it is in command line info,
> but broke in GNU Emacs info, and there are an amazing amount of
> functions that would need to be fixed if you look at the .el's, for
> such a simple request, so a few more lines added to one of these
> 'advice' calls might be easier.
I managed to get what you wanted with a simple change in a single
function (I also added a defcustom, for people who prefer the previous
behavior; note that the default is still the old behavior):
Index: lisp/info.el
===================================================================
RCS file: /cvs/emacs/lisp/info.el,v
retrieving revision 1.248
retrieving revision 1.249
diff -c -r1.248 -r1.249
*** lisp/info.el 2000/11/19 22:10:52 1.248
--- lisp/info.el 2000/12/04 16:36:44 1.249
***************
*** 126,131 ****
--- 126,144 ----
:type '(repeat directory)
:group 'info)
+ (defcustom Info-scroll-prefer-subnodes t
+ "*If non-nil, \\<Info-mode-map>\\[Info-scroll-up] in a menu visits subnodes.
+ If this is non-nil, and you scroll far enough in a node that its menu
+ appears on the screen, the next \\<Info-mode-map>\\[Info-scroll-up]
+ moves to a subnode indicated by the following menu item. This means
+ that you visit a subnode before getting to the end of the menu.
+
+ Setting this option to nil results in behavior similar to the stand-alone
+ Info reader program, which visits the first subnode from the menu only
+ when you hit the end of the current node."
+ :type 'boolean
+ :group 'info)
+
(defvar Info-current-file nil
"Info file that Info is now looking at, or nil.
This is the name that was specified in Info, not the actual file name.
***************
*** 1619,1631 ****
(defun Info-scroll-up ()
"Scroll one screenful forward in Info, considering all nodes as one
sequence.
Once you scroll far enough in a node that its menu appears on the screen
! but after point, the next scroll moves into its first subnode.
! When you scroll past the end of a node, that goes to the next node; if
! this node has no successor, it moves to the parent node's successor,
! and so on. If point is inside the menu of a node, it moves to
! subnode indicated by the following menu item. (That case won't
! normally result from this command, but can happen in other ways.)"
(interactive)
(if (or (< (window-start) (point-min))
--- 1632,1647 ----
(defun Info-scroll-up ()
"Scroll one screenful forward in Info, considering all nodes as one
sequence.
Once you scroll far enough in a node that its menu appears on the screen
! but after point, the next scroll moves into its first subnode, unless
! `Info-scroll-prefer-subnodes' is nil.
! When you scroll past the end of a node, that goes to the next node if
! `Info-scroll-prefer-subnodes' is non-nil and to the first subnode otherwise;
! if this node has no successor, it moves to the parent node's successor,
! and so on. If `Info-scroll-prefer-subnodes' is non-nil and point is inside
! the menu of a node, it moves to subnode indicated by the following menu
! item. (That case won't normally result from this command, but can happen
! in other ways.)"
(interactive)
(if (or (< (window-start) (point-min))
***************
*** 1634,1645 ****
(let* ((case-fold-search t)
(virtual-end (save-excursion
(goto-char (point-min))
! (if (search-forward "\n* Menu:" nil t)
(point)
(point-max)))))
(if (or (< virtual-end (window-start))
(pos-visible-in-window-p virtual-end))
! (Info-next-preorder)
(scroll-up))))
(defun Info-scroll-down ()
--- 1650,1665 ----
(let* ((case-fold-search t)
(virtual-end (save-excursion
(goto-char (point-min))
! (if (and Info-scroll-prefer-subnodes
! (search-forward "\n* Menu:" nil t))
(point)
(point-max)))))
(if (or (< virtual-end (window-start))
(pos-visible-in-window-p virtual-end))
! (cond
! (Info-scroll-prefer-subnodes (Info-next-preorder))
! ((Info-no-error (Info-goto-node (Info-extract-menu-counting 1))))
! (t (Info-next-preorder)))
(scroll-up))))
(defun Info-scroll-down ()