From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: patch to add new link type "infoi" that leverages Info-index command Date: Mon, 10 Nov 2014 10:17:22 +0100 Message-ID: <87y4rjqusd.fsf@nicolasgoaziou.fr> References: <87k338qii9.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xnl5U-0000hr-QI for Emacs-orgmode@gnu.org; Mon, 10 Nov 2014 04:16:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xnl5M-0003GM-99 for Emacs-orgmode@gnu.org; Mon, 10 Nov 2014 04:16:40 -0500 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:59713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xnl5M-0003EP-3e for Emacs-orgmode@gnu.org; Mon, 10 Nov 2014 04:16:32 -0500 In-Reply-To: (Richard Kim's message of "Sun, 9 Nov 2014 19:58:40 -0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Richard Kim Cc: Emacs-orgmode@gnu.org Richard Kim writes: > Thanks for your feedback. I agree that using the same link type is better. > Hence I took an alternate approach as detailed in the attached patch. > Enhanced org-info-follow-link to attempt index lookup if node lookup fails. > Following is my check in message found in the attached patch: Thanks. I think it is better, indeed. Some minor comments follow. > Subject: [PATCH] Enhanced org-info-follow-link to attempt index lookup if node > lookup fails. > > Info index is almost always finer grain than info nodes. For example > with this change, [[info:libc#close]] brings up not only > "(libc)Opening and Closing Files" info node, but also place the cursor > on the line that documents "close" function within the node. This is > done by looking up "close"in the index upon failing to find a node > named "close". Hence one can now link function, variable and other > names that are in the index rather than being limited to info node > names. Typically there are far more index items than there are node > names. For example libc manual has about 700 nodes, but over > 4000 concept, type, function, and variables index items. You need to reformat a bit the commit message, according to Org mode rules (see ). E.g., --8<---------------cut here---------------start------------->8--- [PATCH] org-info: info links may attempt index lookup * lisp/org-info.el (org-info-follow-link): Attempt index lookup if node lookup fails. * doc/org.texi (External links): Update info links. Info index is almost always... TINYCHANGE --8<---------------cut here---------------end--------------->8--- You may also want to update "orgguide.texi". > + ;; If nodename-or-index is invalid node name, then look it > + ;; up in the index. > + (condition-case nil > + (Info-find-node filename nodename-or-index) > + (user-error (Info-find-node filename "Top") > + (condition-case nil > + (Info-index nodename-or-index) > + (user-error (message "Could not find '%s' node or index entry." > + nodename-or-index)))))) `message' is not needed. Also, error message shouldn't end on a full stop: (user-error "Could not find '%s' node or index entry" nodename-or-index) > (message "Could not open: %s" name))) Not directly related to your patch, but shouldn't it be (user-error "Could not open: %s" name) Regards,