From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: Undocumented hyperlinks in doc strings. Date: Thu, 9 Oct 2003 22:27:14 -0500 (CDT) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200310100327.h9A3REl20310@raven.dms.auburn.edu> References: <200310090050.h990oIa15681@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1065756854 3188 80.91.224.253 (10 Oct 2003 03:34:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Oct 2003 03:34:14 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Oct 10 05:34:12 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A7o2e-0003zN-00 for ; Fri, 10 Oct 2003 05:34:12 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1A7o2e-0007Zt-00 for ; Fri, 10 Oct 2003 05:34:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A7o18-0007Da-M1 for emacs-devel@quimby.gnus.org; Thu, 09 Oct 2003 23:32:38 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1A7o11-0007D3-C2 for emacs-devel@gnu.org; Thu, 09 Oct 2003 23:32:31 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1A7o0V-0006vb-5X for emacs-devel@gnu.org; Thu, 09 Oct 2003 23:32:30 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A7nzy-0006oN-7j; Thu, 09 Oct 2003 23:31:26 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id h9A3VNAJ021997; Thu, 9 Oct 2003 22:31:23 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id h9A3REl20310; Thu, 9 Oct 2003 22:27:14 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Thu, 09 Oct 2003 17:16:11 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:17013 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17013 Richard Stallman wrote: Perhaps it would be a good idea not to make a hyperlink to a face name unless the word "face" precedes or follows the face name. Would you like to implement that change? What about the diff below? It also changes `help-xref-symbol-regexp', because that variable is used with emacs-lisp-mode-syntax-table, meaning that newlines do not count as whitespace. As a consequence, preceding a variable, function or face by `symbol', `variable' and the like has no effect if the word is separated from the symbol by a newline. This means that a simple M-q can easily enable or disable several hyperlinks. This does not seem good. The change in `help-xref-symbol-regexp' treats newlines as any other whitespace. The exact specs for face hyperlinks would be: preceded by "face" or followed by whitespace (including newline), "face" and then a non word constituent character. The diff below also makes the comments in `help-make-xrefs' more in line with (elisp)Comment Tips. Most of this was done for me by C-M-q, but I made the double semicolons in the commented out code into triple semicolons myself, because that is how (elisp)Comment Tips wants code commented out. If you agree with the diff below, I could commit it and adjust the documentation in several places of the Elisp manual, documentation strings and the NEWS accordingly. ===File ~/help-mode-diff==================================== cd ~/emacscvsdir/emacs/lisp/ diff -c /home/teirllm/help-mode.old.el /home/teirllm/emacscvsdir/emacs/lisp/help-mode.el *** /home/teirllm/help-mode.old.el Tue Sep 2 07:33:28 2003 --- /home/teirllm/emacscvsdir/emacs/lisp/help-mode.el Thu Oct 9 21:17:17 2003 *************** *** 213,219 **** "\\(function\\|command\\)\\|" "\\(face\\)\\|" "\\(symbol\\)\\|" ! "\\(source \\(?:code \\)?\\(?:of\\|for\\)\\)\\)\\s-+\\)?" ;; Note starting with word-syntax character: "`\\(\\sw\\(\\sw\\|\\s_\\)+\\)'")) "Regexp matching doc string references to symbols. --- 213,220 ---- "\\(function\\|command\\)\\|" "\\(face\\)\\|" "\\(symbol\\)\\|" ! "\\(source \\(?:code \\)?\\(?:of\\|for\\)\\)\\)" ! "[ \t\n]+\\)?" ;; Note starting with word-syntax character: "`\\(\\sw\\(\\sw\\|\\s_\\)+\\)'")) "Regexp matching doc string references to symbols. *************** *** 342,352 **** (sym (intern-soft data))) (if sym (cond ! ((match-string 3) ; `variable' &c (and (boundp sym) ; `variable' doesn't ensure ; it's actually bound (help-xref-button 8 'help-variable sym))) ! ((match-string 4) ; `function' &c (and (fboundp sym) ; similarly (help-xref-button 8 'help-function sym))) ((match-string 5) ; `face' --- 343,353 ---- (sym (intern-soft data))) (if sym (cond ! ((match-string 3) ; `variable' &c (and (boundp sym) ; `variable' doesn't ensure ; it's actually bound (help-xref-button 8 'help-variable sym))) ! ((match-string 4) ; `function' &c (and (fboundp sym) ; similarly (help-xref-button 8 'help-function sym))) ((match-string 5) ; `face' *************** *** 354,365 **** (help-xref-button 8 'help-face sym))) ((match-string 6)) ; nothing for `symbol' ((match-string 7) ! ;; this used: ! ;; #'(lambda (arg) ! ;; (let ((location ! ;; (find-function-noselect arg))) ! ;; (pop-to-buffer (car location)) ! ;; (goto-char (cdr location)))) (help-xref-button 8 'help-function-def sym)) ((and (boundp sym) (fboundp sym)) ;; We can't intuit whether to use the --- 355,366 ---- (help-xref-button 8 'help-face sym))) ((match-string 6)) ; nothing for `symbol' ((match-string 7) ! ;;; this used: ! ;;; #'(lambda (arg) ! ;;; (let ((location ! ;;; (find-function-noselect arg))) ! ;;; (pop-to-buffer (car location)) ! ;;; (goto-char (cdr location)))) (help-xref-button 8 'help-function-def sym)) ((and (boundp sym) (fboundp sym)) ;; We can't intuit whether to use the *************** *** 370,376 **** ((fboundp sym) (help-xref-button 8 'help-function sym)) ((facep sym) ! (help-xref-button 8 'help-face sym))))))) ;; An obvious case of a key substitution: (save-excursion (while (re-search-forward --- 371,378 ---- ((fboundp sym) (help-xref-button 8 'help-function sym)) ((facep sym) ! (if (save-match-data (looking-at "[ \t\n]*face\\W")) ! (help-xref-button 8 'help-face sym)))))))) ;; An obvious case of a key substitution: (save-excursion (while (re-search-forward Diff finished at Thu Oct 9 21:26:20 ============================================================