emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch to disable links line in *info* buffer


From: Kim F. Storm
Subject: Re: Patch to disable links line in *info* buffer
Date: 07 Jun 2002 01:24:17 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Romain FRANCOISE <address@hidden> writes:

> Richard,
> 
> the change you made to info.el to make the links line show up at the top
> of the *info* buffer didn't seem to be very popular, and I myself find
> it quite useless, since I never ever had to copy this particular line
> out of the buffer.
> 
> Following Miles Bader's suggestion, I propose the following patch, it
> makes the behavior optional, and disabled by default. Does it look
> reasonable to you?
>

I would also like to hide the entire "duplicate" header line, as the
navigation buttons are in the "real" header line, and the file and
title is in the mode-line (and printed in nice big letters in the top
of the info buffer) -- so every bit of information in the header line
is superfluous in general ... except if you want to copy it.

I would then add a command `+' to toggle the visibility of the header
line in case you really need to look at or copy it.

The following patch to info.el does this:

Index: info.el
===================================================================
RCS file: /cvs/emacs/lisp/info.el,v
retrieving revision 1.302
diff -c -r1.302 info.el
*** info.el     3 Jun 2002 22:57:40 -0000       1.302
--- info.el     6 Jun 2002 22:09:46 -0000
***************
*** 1037,1043 ****
--- 1037,1053 ----
  ;;; 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))
+     (let ((buffer-read-only nil))
+       (add-text-properties (point-min) (1+ header-end) '(invisible t)))
      ))
+ 
+ (defun Info-toggle-header-visible ()
+   (interactive)
+   (let ((buffer-read-only nil))
+     (save-excursion
+       (goto-char (point-min))
+       (alter-text-property (point) (1+ (line-end-position)) 'invisible 
+                          #'(lambda (v) (null v))))))
  
  ;; Go to an info node specified with a filename-and-nodename string
  ;; of the sort that is found in pointers in nodes.
***************
*** 2095,2100 ****
--- 2105,2111 ----
    (define-key Info-mode-map "9" 'Info-nth-menu-item)
    (define-key Info-mode-map "0" 'undefined)
    (define-key Info-mode-map "?" 'Info-summary)
+   (define-key Info-mode-map "+" 'Info-toggle-header-visible)
    (define-key Info-mode-map "]" 'Info-forward-node)
    (define-key Info-mode-map "[" 'Info-backward-node)
    (define-key Info-mode-map "<" 'Info-top-node)

-- 
Kim F. Storm <address@hidden> http://www.cua.dk




reply via email to

[Prev in Thread] Current Thread [Next in Thread]