From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: man mode mouse over SEE ALSO items Date: Wed, 21 Apr 2004 08:40:43 -0600 Organization: Information Handling Services, Electronic Systems Development Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <16518.34795.676580.999220@ihs.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1082560933 26923 80.91.224.253 (21 Apr 2004 15:22:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Apr 2004 15:22:13 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 21 17:21:54 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BGJXu-0000W7-00 for ; Wed, 21 Apr 2004 17:21:54 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BGJX9-0000Qx-Iv for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Apr 2004 11:21:07 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BGJ4R-0002rX-1q for bug-gnu-emacs@gnu.org; Wed, 21 Apr 2004 10:51:27 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BGIwN-0000Os-Fq for bug-gnu-emacs@gnu.org; Wed, 21 Apr 2004 10:43:39 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BGIwM-0000Ob-HF for bug-gnu-emacs@gnu.org; Wed, 21 Apr 2004 10:43:06 -0400 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.24) id 1BGIv7-0000PD-J6 for gnu-emacs-bug@gnu.org; Wed, 21 Apr 2004 10:41:49 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BGIvY-00008s-J9 for gnu-emacs-bug@gnu.org; Wed, 21 Apr 2004 10:42:49 -0400 Original-Received: from [170.207.70.222] (helo=mail1.ihs.com) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BGIvX-00007n-C4 for gnu-emacs-bug@gnu.org; Wed, 21 Apr 2004 10:42:15 -0400 Original-Received: from briard.ihs.com (esd80.ihs.com [170.207.51.80]) by mail1.ihs.com (8.12.10/8.12.10) with SMTP id i3LEeYE1013472 for ; Wed, 21 Apr 2004 08:40:35 -0600 (MDT) Original-To: gnu-emacs-bug@gnu.org Original-Newsgroups: gnu.emacs.bug In-Reply-To: X-Mailer: VM 7.15 under Emacs 19.34.3 X-IHS-MailScanner: Found to be clean X-IHS-MailScanner-SpamCheck: X-IHS-MailScanner-Envelope-Sender: kevinr@ihs.com X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:7688 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:7688 > Here's a patch. Note that it does not handle hyphenated references. That patch seems to have been corrupted, so I'm resending it. > 2004-04-20 Kevin Rodgers > > * man.el (Man-mode-reference-map): New variable and prefix command. > (Man-mouse-follow-manual-reference): New command. > (Man-build-references-alist): Add mouse-face, keymap, help-echo, > and Man-manual-reference text properties to each reference. *** emacs-21.3/lisp/man.el.orig Fri Oct 18 19:21:09 2002 --- emacs-21.3/lisp/man.el Tue Apr 20 10:27:15 2004 *************** *** 228,233 **** --- 228,236 ---- (defvar Man-mode-map nil "Keymap for Man mode.") + (defvar Man-mode-reference-map nil + "Keymap for highlighted references in Man mode.") + (defvar Man-mode-hook nil "Hook run when Man mode is enabled.") *************** *** 354,359 **** --- 357,368 ---- (define-key Man-mode-map "?" 'describe-mode) ) + (if Man-mode-reference-map + nil + (define-prefix-command 'Man-mode-reference-map) + (define-key Man-mode-reference-map [mouse-2] + 'Man-mouse-follow-manual-reference)) + ;; ====================================================================== ;; utilities *************** *** 904,910 **** (setq runningpoint (point)) (if (re-search-forward Man-hyphenated-reference-regexp end t) (let* ((word (Man-match-substring 0)) ! (len (1- (length word)))) (if hyphenated (setq word (concat hyphenated word) hyphenated nil --- 913,926 ---- (setq runningpoint (point)) (if (re-search-forward Man-hyphenated-reference-regexp end t) (let* ((word (Man-match-substring 0)) ! (len (1- (length word))) ! (inhibit-read-only t)) ! (add-text-properties (match-beginning 0) (match-end 0) ! `(mouse-face highlight ! keymap Man-mode-reference-map ! help-echo "mouse-2: \ ! follow this reference" ! Man-manual-reference ,word)) (if hyphenated (setq word (concat hyphenated word) hyphenated nil *************** *** 1121,1126 **** --- 1137,1151 ---- (Man-getpage-in-background (Man-translate-references (aheadsym Man-refpages-alist))))) + (defun Man-mouse-follow-manual-reference (click) + "Get the highlighted manpage under the mouse." + (interactive "e") + (save-excursion + (set-buffer (window-buffer (posn-window (event-start click)))) + (Man-follow-manual-reference + (get-text-property (posn-point (event-start click)) + 'Man-manual-reference)))) + (defun Man-kill () "Kill the buffer containing the manpage." (interactive) -- Kevin Rodgers