Thread View: gnu.epoch.misc
2 messages
2 total messages
Started by Brian L. Kahn
Wed, 17 Jun 1992 17:38
mouse bindings for info
Author: Brian L. Kahn
Date: Wed, 17 Jun 1992 17:38
Date: Wed, 17 Jun 1992 17:38
96 lines
3629 bytes
3629 bytes
There are other mouse bindings and enhancements for info mode. This
one works really well for me, and it has been stable for a while.
Basically, clicking with the middle button on a menu item or cross
reference takes you to that place. Clicking on one of the header
things (next, prev, up) takes you to the node.
---------snip snip-------------------
;;; info-mode mouse bindings for epoch
;;; Brian L. Kahn, blk@mitre.org, Tue Jun 9 12:53:52 1992
(defun Info-remove-cr (string)
"Replaces newline in STRING with a space."
(mapconcat
(function (lambda (x)
(char-to-string (if (char-equal x ?\n) ? x))))
string
""))
(defun x-Info-select (args)
"Selects menu item, follows *Note: reference, Up/Next/Prev/File."
(mouse::set-point args)
(cond ; check if line 1 or menu area or main text
((save-excursion (not (re-search-backward "$" nil t)))
;; we are on the first line
(if (not (re-search-backward "[, ] " nil t))
;; back up to last field or margin
(beginning-of-line))
;; onto field name
(re-search-forward "\\<" nil t)
(cond ((looking-at "Up") (Info-up))
((looking-at "Next") (Info-next))
((looking-at "Prev") (Info-prev))
((looking-at "Node") (Info-goto-node "Top"))
((looking-at "File") (Info-directory))
))
((save-excursion (re-search-backward "^\* Menu:" nil t))
;; we are in the menu area
(end-of-line) ; limit of node name search
(push-mark (point))
(re-search-backward "^\*")
(cond
((save-excursion (re-search-forward "::\\s-" (mark) 'no-err))
;; node name is first
(re-search-forward "^\\*\\s-*\\(.*\\)::\\s-" (mark))
)
((save-excursion (re-search-forward ":\\s-" (mark) 'no-err))
;; node name comes second
(re-search-forward ":\\s-*\\([^.]*\\)" (mark))
)
(t (error "Unrecognized menu format.")
))
(Info-goto-node
(buffer-substring (match-beginning 1) (match-end 1))
)
(pop-mark)
)
(t
;; in main text, look for footnote
(forward-word 1) ; in case mouse is on the word "*note"
(if (not (re-search-backward "\*note" nil t))
(error "Can't find a menu item or footnote."))
(forward-word 2)
(forward-word -1)
(re-search-forward "[^:]*" nil t)
(Info-follow-reference
(Info-remove-cr
(buffer-substring (match-beginning 0) (match-end 0)))))
))
;;; Info doesn't call an info mode hook - fix that!
(require 'info)
(defvar Info-mode-orig (symbol-function 'Info-mode))
(defun Info-mode ()
"Info mode with Info-mode-hook."
(funcall Info-mode-orig)
(run-hooks 'Info-mode-hook)
)
(setq Info-mode-hook
(func
(local-set-mouse mouse-middle mouse-down 'x-Info-select)
(local-set-mouse mouse-middle mouse-up ())
(message
"[middle]-Go to menu item, follow reference, File/Next/Prev/Up.")))
--
B< Brian Kahn blk@security.mitre.org "may the farce be with you"
mouse bindings for info
Author: Marc Andreessen
Date: Wed, 17 Jun 1992 07:23
Date: Wed, 17 Jun 1992 07:23
20 lines
1345 bytes
1345 bytes
There are other mouse bindings and enhancements for info mode. This one works really well for me, and it has been stable for a while. Basically, clicking with the middle button on a menu item or cross reference takes you to that place. Clicking on one of the header things (next, prev, up) takes you to the node. I'm not sure how many people know about this yet, but the tek package for Epoch includes a version of the GNU v19 info with Epoch point-n-click support. It's up for FTP at archive.cis.ohio-state.edu in the elisp archive and also as part of the Epoch ``add-ons'' at cs.uiuc.edu. Marc -- Marc Andreessen Epoch Development Team University of Illinois at Urbana-Champaign marca@ncsa.uiuc.edu
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads