all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org, bob@rattlesnake.com
Subject: Re: Patch to disable links line in *info* buffer
Date: Tue, 11 Jun 2002 20:34:43 -0600 (MDT)	[thread overview]
Message-ID: <200206120234.g5C2YhK04365@aztec.santafe.edu> (raw)
In-Reply-To: <m17HlZk-000IeXC@localhost> (bob@rattlesnake.com)

    By the way, how do you fix an instance of a `plain vanilla' Emacs from
    the current CVS sources so that you can move around an Info file using
    the next, prev, and up key and mouse bindings?

I think the change below should fix that.  I also cleaned it up some,
to make it easier to make other changes in handling the header line
and the buffer's node line.

There are some other undesirable things in this code.  For instance,
the items in the text line have a mouse-face that works, and only
mouse-2 follows the link.  But when in the header line, there is no
mouse-face, and both mouse-1 and mouse-2 follow the link.
The discrepancy between them seems ugly.

If the links are hidden in the line in th ebufer, this discrepancy
will go away.


*** info.el.~1.304.~	Mon Jun 10 04:28:29 2002
--- info.el	Tue Jun 11 21:02:20 2002
***************
*** 999,1005 ****
  	(if Info-enable-active-nodes (eval active-expression))
  	(Info-fontify-node)
  	(if Info-use-header-line
! 	    (Info-setup-header-line)
  	  (setq Info-header-line nil)
  	  (setq header-line-format nil)) ; so the header line isn't displayed
  	(run-hooks 'Info-selection-hook)))))
--- 999,1012 ----
  	(if Info-enable-active-nodes (eval active-expression))
  	(Info-fontify-node)
  	(if Info-use-header-line
! 	    (progn
! 	      (setq Info-header-line
! 		    (get-text-property (point-min) 'header-line))
! 	      (setq header-line-format 'Info-header-line)
! ;;; It is useful to be able to copy the links line out of the buffer
! ;;; with M-w.
! ;;;           (narrow-to-region (1+ header-end) (point-max))
! 	      )
  	  (setq Info-header-line nil)
  	  (setq header-line-format nil)) ; so the header line isn't displayed
  	(run-hooks 'Info-selection-hook)))))
***************
*** 1016,1044 ****
  			") "
  			(or Info-current-node ""))))))
  \f
- ;; Skip the node header and make it into a header-line.  This function
- ;; should be called when the node is already narrowed.
- (defun Info-setup-header-line ()
-   (goto-char (point-min))
-   (let* ((case-fold-search t)
- 	 (header-end (save-excursion (forward-line 1) (1- (point))))
- 	 ;; If we find neither Next: nor Prev: link, show the entire
- 	 ;; node header.  Otherwise, don't show the File: and Node:
- 	 ;; parts, to avoid wasting precious space on information that
- 	 ;; is available in the mode line.
- 	 (header-beg (if (re-search-forward
- 			  "\\(next\\|prev[ious]*\\): "
- 			  header-end t)
- 			 (match-beginning 1)
- 		       (point))))
-     (set (make-local-variable 'Info-header-line)
- 	 (buffer-substring header-beg header-end))
-     (setq header-line-format 'Info-header-line)
- ;;; It is useful to be able to copy the links line out of the buffer
- ;;; with M-w.
- ;;;    (narrow-to-region (1+ header-end) (point-max))
-     ))
- \f
  ;; Go to an info node specified with a filename-and-nodename string
  ;; of the sort that is found in pointers in nodes.
  
--- 1023,1028 ----
***************
*** 2347,2352 ****
--- 2331,2337 ----
    (setq Info-tag-table-buffer nil)
    (make-local-variable 'Info-history)
    (make-local-variable 'Info-index-alternatives)
+   (make-local-variable 'Info-header-line)
    (set (make-local-variable 'tool-bar-map) info-tool-bar-map)
    ;; This is for the sake of the invisible text we use handling titles.
    (make-local-variable 'line-move-ignore-invisible)
***************
*** 2601,2615 ****
    ;; Only fontify the node if it hasn't already been done.  [We pass in
    ;; LIMIT arg to `next-property-change' because it seems to search past
    ;; (point-max).]
!   (unless (and (< (next-property-change (point-min) nil (point-max))
! 		  (point-max))
! 	       ;; But do put the text properties if the local-map property
! 	       ;; is inconsistent with Info-use-header-line's value.
! 	       (eq
! 		(= (next-single-property-change
! 		    (point-min) 'local-map nil (point-max))
! 		   (point-max))
! 		(null Info-use-header-line)))
      (save-excursion
        (let ((buffer-read-only nil)
  	    (case-fold-search t))
--- 2586,2593 ----
    ;; Only fontify the node if it hasn't already been done.  [We pass in
    ;; LIMIT arg to `next-property-change' because it seems to search past
    ;; (point-max).]
!   (unless (< (next-property-change (point-min) nil (point-max))
! 	     (point-max))
      (save-excursion
        (let ((buffer-read-only nil)
  	    (case-fold-search t))
***************
*** 2630,2653 ****
  				   'help-echo
  				   (concat "Go to node "
  					   (buffer-substring nbeg nend)))
! 		;; Don't bind mouse events on the header line if we
! 		;; aren't going to display the header line.
! 		(when Info-use-header-line
! 		  (let ((fun (cdr (assoc tag '(("Prev" . Info-prev)
! 					       ("Next" . Info-next)
! 					       ("Up" . Info-up))))))
! 		    (when fun
! 		      (let ((keymap (make-sparse-keymap)))
! 			(define-key keymap [header-line mouse-1] fun)
! 			(define-key keymap [header-line mouse-2] fun)
! 			(put-text-property tbeg nend 'local-map keymap)))))
! 		(if (not Info-use-header-line)
! 		    ;; In case they switched Info-use-header-line off
! 		    ;; in the middle of an Info session, some text
! 		    ;; properties may have been left lying around from
! 		    ;; past visits of this node.  Remove them.
! 		    (remove-text-properties tbeg nend '(local-map nil)))
! 		  ))))
  	(goto-char (point-min))
  	(while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\|\\.+\\)$"
  				  nil t)
--- 2608,2641 ----
  				   'help-echo
  				   (concat "Go to node "
  					   (buffer-substring nbeg nend)))
! 		;; Always set up the text property keymap.
! 		;; It will be used either in the buffer
! 		;; or copied in the header line.
! 		(let ((fun (cdr (assoc tag '(("Prev" . Info-prev)
! 					     ("Next" . Info-next)
! 					     ("Up" . Info-up))))))
! 		  (when fun
! 		    (let ((keymap (make-sparse-keymap)))
! 		      (define-key keymap [header-line mouse-1] fun)
! 		      (define-key keymap [header-line mouse-2] fun)
! 		      (define-key keymap [header-line down-mouse-1] 'ignore)
! 		      (define-key keymap [mouse-2] fun)
! 		      (put-text-property tbeg nend 'keymap keymap))))
! 		  )))
! 	  (goto-char (point-min))
! 	  (let* ((header-end (save-excursion (end-of-line) (point)))
! 		 ;; If we find neither Next: nor Prev: link, show the entire
! 		 ;; node header.  Otherwise, don't show the File: and Node:
! 		 ;; parts, to avoid wasting precious space on information that
! 		 ;; is available in the mode line.
! 		 (header-beg (if (re-search-forward
! 				  "\\(next\\|prev[ious]*\\): "
! 				  header-end t)
! 				 (match-beginning 1)
! 			       (point))))
! 	    (put-text-property (point-min) (1+ (point-min))
! 			       'header-line
! 			       (buffer-substring header-beg header-end))))
  	(goto-char (point-min))
  	(while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\|\\.+\\)$"
  				  nil t)

  reply	other threads:[~2002-06-12  2:34 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-06 18:32 Patch to disable links line in *info* buffer Romain FRANCOISE
2002-06-06 23:24 ` Kim F. Storm
2002-06-07 23:22 ` Richard Stallman
2002-06-08  0:52   ` Kim F. Storm
2002-06-08 21:39     ` Romain FRANCOISE
2002-06-08 22:08       ` Alex Schroeder
2002-06-08 22:30       ` Robert J. Chassell
2002-06-09  4:11         ` Miles Bader
2002-06-09 10:56           ` Robert J. Chassell
2002-06-09  5:16         ` Eli Zaretskii
2002-06-10 13:59         ` Stefan Monnier
2002-06-10 16:46           ` Robert J. Chassell
2002-06-10 17:28             ` Stefan Monnier
2002-06-10 20:50               ` Robert J. Chassell
2002-06-10 22:18                 ` Thien-Thi Nguyen
2002-06-10 22:24                   ` Stefan Monnier
2002-06-11 11:15                   ` Robert J. Chassell
2002-06-11 21:00                     ` Thien-Thi Nguyen
2002-06-11  5:26                 ` Eli Zaretskii
2002-06-10 20:58               ` Robert J. Chassell
2002-06-10 21:52                 ` Stefan Monnier
2002-06-11  9:36               ` Andreas Schwab
2002-06-10 19:57             ` Kim F. Storm
2002-06-11 19:25             ` Richard Stallman
2002-06-11 20:01               ` Jason Rumney
2002-06-11 23:45                 ` Kim F. Storm
2002-06-12 12:14                   ` Richard Stallman
2002-06-12 22:15                     ` Kim F. Storm
2002-06-13 21:46                       ` Richard Stallman
2002-06-13 23:22                         ` Kim F. Storm
2002-06-19 13:10                           ` Kim F. Storm
2002-06-19 15:02                             ` Stefan Monnier
2002-06-21 21:40                               ` Kim F. Storm
2002-06-21 23:56                                 ` Kim F. Storm
2002-06-21  9:40                             ` Richard Stallman
2002-06-13 15:34                   ` Robert J. Chassell
2002-06-13 17:17                     ` Andreas Schwab
     [not found]             ` <200206130905.g5D95ie06537@aztec.santafe.edu>
2002-06-13 11:36               ` Robert J. Chassell
2002-06-13 23:18                 ` Kim F. Storm
2002-06-14 15:47                 ` Richard Stallman
2002-06-17 19:28             ` Patch for emacs-lisp-intro.texi Christian Egli
2002-06-11 19:25           ` Patch to disable links line in *info* buffer Richard Stallman
2002-06-09 23:04       ` Kim F. Storm
2002-06-10 10:15       ` Richard Stallman
2002-06-10 10:25         ` Eli Zaretskii
2002-06-09 15:18     ` Richard Stallman
2002-06-09 15:58       ` Kai Großjohann
2002-06-09 23:38       ` Kim F. Storm
2002-06-10 23:43         ` Richard Stallman
2002-06-10  5:14       ` Karl Eichwalder
2002-06-10  5:24         ` Miles Bader
2002-06-10 23:43         ` Richard Stallman
2002-06-11  0:12           ` Miles Bader
2002-06-11  5:27             ` Eli Zaretskii
2002-06-11  7:05             ` Miles Bader
2002-06-11 13:20               ` Robert J. Chassell
2002-06-12  2:34                 ` Richard Stallman [this message]
2002-06-12 10:33                   ` Robert J. Chassell
2002-06-12 23:47                     ` Richard Stallman
2002-06-13 13:20                       ` Robert J. Chassell
2002-06-14 15:47                         ` Richard Stallman
2002-06-14 19:00                         ` Karl Eichwalder
2002-06-12  2:32               ` Richard Stallman
2002-06-12  2:53                 ` Miles Bader
2002-06-12 18:21                   ` Karl Eichwalder
2002-06-12 21:36               ` Alex Schroeder
2002-06-11  4:17           ` Karl Eichwalder
2002-06-11  5:29             ` Eli Zaretskii
2002-06-11 15:26               ` Karl Eichwalder
2002-06-09  5:13   ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2002-06-07 13:35 David Ponce
2002-06-07 13:56 David Ponce

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200206120234.g5C2YhK04365@aztec.santafe.edu \
    --to=rms@gnu.org \
    --cc=bob@rattlesnake.com \
    --cc=emacs-devel@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.