From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: [Accepted] Add an easy template for index (i), and move include file to I from i. Date: Wed, 4 May 2011 09:49:57 +0200 (CEST) Message-ID: <20110504074957.9C6D143B460@u016822.science.uva.nl> References: <1304005134-31639-2-git-send-email-rpgoldman@sift.info> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHWqN-0003xz-LD for emacs-orgmode@gnu.org; Wed, 04 May 2011 03:50:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHWqM-0000ar-DN for emacs-orgmode@gnu.org; Wed, 04 May 2011 03:49:59 -0400 Received: from u016822.science.uva.nl ([146.50.39.34]:53578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHWqM-0000aj-6E for emacs-orgmode@gnu.org; Wed, 04 May 2011 03:49:58 -0400 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: emacs-orgmode@gnu.org Patch 768 (http://patchwork.newartisans.com/patch/768/) is now "Accepted". Maintainer comment: I added documentation in org.texi This relates to the following submission: http://mid.gmane.org/%3C1304005134-31639-2-git-send-email-rpgoldman%40sift.info%3E Here is the original message containing the patch: > Content-Type: text/plain; charset="utf-8" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Subject: [O] Add an easy template for index (i), > and move include file to I from i. > Date: Thu, 28 Apr 2011 20:38:54 -0000 > From: Robert Goldman > X-Patchwork-Id: 768 > Message-Id: <1304005134-31639-2-git-send-email-rpgoldman@sift.info> > To: emacs-orgmode@gnu.org > Cc: "Robert P. Goldman" > > From: Robert P. Goldman > > Implement Nick Dokos' suggestion for inserting #+INDEX. > > Notes about this patch: > 1. It breaks some old user-visible behavior, since Per Nick's posting, we expect that if index is used, it will be used > more commonly than include file. However, since this is a custom, > behavior could be changed. Indeed, we could put index on capital > I with a suggestion that users who are indexing should swap in their > customizations. > 2. I modified the docstring for org-structure-template-alist, which did > not explain the function of the "?" in the string. Someone should > check and verify I didn't get this wrong. > 3. There doesn't seem to be a Muse tag equivalent for #+index, so I > just made the Muse equivalent of #+index be #+index. I don't know > org-mtags enough to know if this is appropriate. > > --- > lisp/org.el | 9 ++++++--- > 1 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/lisp/org.el b/lisp/org.el > index e17c90f..fdff7ef 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -10753,14 +10753,17 @@ This function can be used in a hook." > "?") > ("a" "#+begin_ascii\n?\n#+end_ascii") > ("A" "#+ascii: ") > - ("i" "#+include %file ?" > + ("i" "#+index: ?" > + "#+index: ?") > + ("I" "#+include %file ?" > "") > ) > "Structure completion elements. > This is a list of abbreviation keys and values. The value gets inserted > if you type `<' followed by the key and then press the completion key, > usually `M-TAB'. %file will be replaced by a file name after prompting > -for the file using completion. > +for the file using completion. The cursor will be placed at the position > +of the `?` in the template. > There are two templates for each key, the first uses the original Org syntax, > the second uses Emacs Muse-like syntax tags. These Muse-like tags become > the default when the /org-mtags.el/ module has been loaded. See also the > @@ -10779,7 +10782,7 @@ expands them." > (let ((l (buffer-substring (point-at-bol) (point))) > a) > (when (and (looking-at "[ \t]*$") > - (string-match "^[ \t]*<\\([a-z]+\\)$"l) > + (string-match "^[ \t]*<\\([a-zA-Z]+\\)$" l) > (setq a (assoc (match-string 1 l) org-structure-template-alist))) > (org-complete-expand-structure-template (+ -1 (point-at-bol) > (match-beginning 1)) a) >