From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: info-look Date: Tue, 27 Jun 2006 08:26:41 +0200 Message-ID: NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1151389530 24805 80.91.229.2 (27 Jun 2006 06:25:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 27 Jun 2006 06:25:30 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 27 08:25:20 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fv70b-0007jP-A0 for ged-emacs-devel@m.gmane.org; Tue, 27 Jun 2006 08:25:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fv70a-0004Fh-Gx for ged-emacs-devel@m.gmane.org; Tue, 27 Jun 2006 02:25:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fv70O-0004Fb-F7 for emacs-devel@gnu.org; Tue, 27 Jun 2006 02:25:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fv70K-0004FM-O0 for emacs-devel@gnu.org; Tue, 27 Jun 2006 02:24:59 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fv70K-0004FJ-Ja for emacs-devel@gnu.org; Tue, 27 Jun 2006 02:24:56 -0400 Original-Received: from [213.165.64.21] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1Fv7CN-00085i-0D for emacs-devel@gnu.org; Tue, 27 Jun 2006 02:37:23 -0400 Original-Received: (qmail invoked by alias); 27 Jun 2006 06:24:53 -0000 Original-Received: from N848P019.adsl.highway.telekom.at (EHLO MACHNO) [62.47.49.243] by mail.gmx.net (mp039) with SMTP; 27 Jun 2006 08:24:53 +0200 X-Authenticated: #14592706 Original-To: emacs-devel@gnu.org X-Y-GMX-Trusted: 0 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:56215 Archived-At: Please consider the following patch for `info-look.el'. It's primary aim is to permit manual lookups directly from - single-quoted symbol names as found in Elisp doc-strings, and - symbol names in help-buffers and custom-buffers, including unlispified tag names of customizable variables. 2006-06-27 Martin Rudalics * info-look.el (info-lookup-guess-custom-symbol): New function for retrieving symbol at point in custom buffers. (info-lookup-maybe-add-help): Add backquote and comma to ignored characters in regexps of help specifications for emacs-lisp-mode and lisp-interaction-mode. Add specifications for custom-mode and help-mode. *** info-look.el Tue Apr 11 16:23:50 2006 --- info-look.el Wed Jun 7 15:45:44 2006 *************** *** 566,571 **** --- 566,610 ---- (concat prefix name)))) (error nil))) + (defun info-lookup-guess-custom-symbol () + "Get symbol at point in custom buffers." + (condition-case nil + (save-excursion + (let* ((case-fold-search t) + (ignored-chars "][()`',:.\" \t\n") + (significant-chars (concat "^" ignored-chars)) + beg end) + (cond + ((and (memq (get-char-property (point) 'face) + '(custom-variable-tag custom-variable-tag-face)) + (setq beg (previous-single-char-property-change + (point) 'face nil (line-beginning-position))) + (setq end (next-single-char-property-change + (point) 'face nil (line-end-position))) + (> end beg)) + (subst-char-in-string + ?\ ?\- (buffer-substring-no-properties beg end))) + ((or (and (looking-at (concat "[" significant-chars "]")) + (save-excursion + (skip-chars-backward significant-chars) + (setq beg (point))) + (skip-chars-forward significant-chars) + (setq end (point)) + (> end beg)) + (and (looking-at "[ \t\n]") + (looking-back (concat "[" significant-chars "]")) + (setq end (point)) + (skip-chars-backward significant-chars) + (setq beg (point)) + (> end beg)) + (and (skip-chars-forward ignored-chars) + (setq beg (point)) + (skip-chars-forward significant-chars) + (setq end (point)) + (> end beg))) + (buffer-substring-no-properties beg end))))) + (error nil))) + ;;;###autoload (defun info-complete-symbol (&optional mode) "Perform completion on symbol preceding point." *************** *** 789,795 **** (info-lookup-maybe-add-help :mode 'emacs-lisp-mode ! :regexp "[^][()'\" \t\n]+" :doc-spec '(;; Commands with key sequences appear in nodes as `foo' and ;; those without as `M-x foo'. ("(emacs)Command Index" nil "`\\(M-x[ \t\n]+\\)?" "'") --- 828,834 ---- (info-lookup-maybe-add-help :mode 'emacs-lisp-mode ! :regexp "[^][()`',\" \t\n]+" :doc-spec '(;; Commands with key sequences appear in nodes as `foo' and ;; those without as `M-x foo'. ("(emacs)Command Index" nil "`\\(M-x[ \t\n]+\\)?" "'") *************** *** 806,812 **** (info-lookup-maybe-add-help :mode 'lisp-interaction-mode ! :regexp "[^][()'\" \t\n]+" :parse-rule 'ignore :other-modes '(emacs-lisp-mode)) --- 845,851 ---- (info-lookup-maybe-add-help :mode 'lisp-interaction-mode ! :regexp "[^][()`',\" \t\n]+" :parse-rule 'ignore :other-modes '(emacs-lisp-mode)) *************** *** 912,917 **** --- 951,968 ---- ;; This gets functions in evaluated classes. Other ;; possible patterns don't seem to work too well. "`" "("))) + + (info-lookup-maybe-add-help + :mode 'custom-mode + :ignore-case t + :regexp "[^][()`',:\" \t\n]+" + :parse-rule 'info-lookup-guess-custom-symbol + :other-modes '(emacs-lisp-mode)) + + (info-lookup-maybe-add-help + :mode 'help-mode + :regexp "[^][()`',:\" \t\n]+" + :other-modes '(emacs-lisp-mode)) (provide 'info-look)