emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [Accepted] Add an easy template for index (i), and move include fil


From: Carsten Dominik
Subject: [O] [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)

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 <address@hidden>
> X-Patchwork-Id: 768
> Message-Id: <address@hidden>
> To: address@hidden
> Cc: "Robert P. Goldman" <address@hidden>
> 
> From: Robert P. Goldman <address@hidden>
> 
> Implement Nick Dokos' suggestion for inserting #+INDEX.
> 
> Notes about this patch:
> 1.  It breaks some old user-visible behavior, since <i changes meaning.
>     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."
>           "<literal style=\"html\">?</literal>")
>      ("a" "#+begin_ascii\n?\n#+end_ascii")
>      ("A" "#+ascii: ")
> -    ("i" "#+include %file ?"
> +    ("i" "#+index: ?"
> +     "#+index: ?")
> +    ("I" "#+include %file ?"
>           "<include file=%file markup=\"?\">")
>      )
>    "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)
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]