[O] [PATCH] Don't prompt for bad links during babel export.
From: Robert P. Goldman rpgold...@real-time.com Previously, when trying to look for the header of a source block during export, org would prompt the user to add a new heading if it couldn't find a match. This prompt is not appropriate for non-interactive use. Patch to org-babel-exp-in-export-file macro to bind org-link-search-inhibit-query. --- Here's a patch I found the need for while I was debugging the org-babel export on included files. When org-babel was unable to find a link during its search for header arguments, it would inappropriately prompt me to create that header! lisp/ob-exp.el |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el index 20a7cda..d700f6d 100644 --- a/lisp/ob-exp.el +++ b/lisp/ob-exp.el @@ -93,7 +93,8 @@ source block function.) (set-buffer (get-file-buffer org-current-export-file)) (save-restriction (condition-case nil -(org-open-link-from-string link) +(let ((org-link-search-inhibit-query t)) + (org-open-link-from-string link)) (error (when heading (goto-char (point-min)) (re-search-forward (regexp-quote heading) nil t -- 1.7.3.5
[O] [PATCH] Revised my #+index preprocessor to fontify index entries.
From: Robert P. Goldman rpgold...@real-time.com --- The previous patch wasn't quite right because, e.g., it would index #+INDEX: =Class= as \\index{=Class=} instead of \\index{\texttt{Class}} This patch attempts to fix that. Question: would you prefer to have this reformulated as some kind of unified patch with the earlier one? lisp/org-latex.el | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 731d6e6..b8f7019 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1,4 +1,4 @@ -;;; org-latex.el --- LaTeX exporter for org-mode +;; org-latex.el --- LaTeX exporter for org-mode ;; ;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ;; @@ -2331,9 +2331,15 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER. (let ((case-fold-search t)) (re-search-forward ^[ \t]*#\\+index:[ \t]*\\(.*?\\)[ \t]*$ nil t)) ( (match-end 1) (match-beginning 1))) +;; (message Found a #+INDEX match...) (let ((entry (match-string 1))) -;; (message Found a #+INDEX match...) - (replace-match (format \\index{%s} entry) t t))) + (replace-match (format \\index{%s} entry) t t) + ;; now process font directives in the index entry + (re-search-forward ^[ \t]*index{\\([^}]\\)} nil t) + ;; (message (format Trying to fontify string %s (match-string 1))) + (save-restriction + (narrow-to-region (match-beginning 1) (match-end 1)) + (org-export-latex-fontify ;; Convert center (goto-char (point-min)) -- 1.7.3.5
[O] Translate #+INDEX to Latex \index{} on export
The following email contains a patch that will cause the latex export preprocessor to rewrite #+INDEX: lines in an org file into LaTeX style \index{} entries. As far as I can tell, this should be The Right Thing --- latex doesn't seem to do anything bad if there are index entries without makeindex. So no downside. And it doesn't seem right to have to do #+INDEX for HTML export and #+LATEX: \index{} for latex export. I believe that this should be complemented by some additional code that would: 1. Add code to turn on and off index generation and appropriately add the makeindex package and the \makeindex 2. Possibly add code to turn /off/ this translation in the case where the user wishes to have HTML and Latex documents indexed differently. Cheers, r
[O] [PATCH] Make the latex export preprocessor rewrite #+INDEX to \index.
From: Robert P. Goldman rpgold...@real-time.com --- lisp/org-latex.el | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index e7307ef..731d6e6 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1775,6 +1775,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER. (end-of-line 1) (insert \n) + + (defun org-export-latex-fixed-width (opt) When OPT is non-nil convert fixed-width sections to LaTeX. (goto-char (point-min)) @@ -2322,6 +2324,17 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER. (and (looking-at [ \t]*ORG-VERSE-END.*) (org-replace-match-keep-properties \\end{verse} t t))) + ;; Convert #+INDEX to LaTeX \\index. + (goto-char (point-min)) + (while + (and + (let ((case-fold-search t)) +(re-search-forward ^[ \t]*#\\+index:[ \t]*\\(.*?\\)[ \t]*$ nil t)) + ( (match-end 1) (match-beginning 1))) +(let ((entry (match-string 1))) +;; (message Found a #+INDEX match...) + (replace-match (format \\index{%s} entry) t t))) + ;; Convert center (goto-char (point-min)) (while (search-forward ORG-CENTER-START nil t) -- 1.7.3.5
[O] [PATCH] Add an easy template for index (i), and move include file to I from i.
From: Robert P. Goldman rpgold...@real-time.com 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) -- 1.7.3.5
[O] Minor manual addition
I have been having trouble remembering the use of easy templates, because I tende to look it up relative to Literal Examples (which is why I want to use them), and not using the facility name (which for some reason I find very difficult to remember). The patch adds a cross-reference from the discussion of Literal Examples to the Easy Templates that make Literal Examples easy to use in an org file. I hope this addition is inoffensive and helpful!
[O] [PATCH] Add a cross-reference from Literal Examples to Easy Templates.
From: Robert P. Goldman rpgold...@real-time.com Easy templates are especially useful for entering the begin and end pairs that arise in supplying literal examples. --- doc/org.texi |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index 8ca4426..17922d4 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -8916,6 +8916,10 @@ If the syntax for the label format conflicts with the language syntax, use a HTML export also allows examples to be published as text areas, @xref{Text areas in HTML export}. +Because the @code{#+BEGIN_...} and @code{#+END_...} patterns need to be added +so often, shortcuts are provided using the Easy Templates facility +(@pxref{Easy Templates}). + @table @kbd @kindex C-c ' @item C-c ' -- 1.7.3.5
[Orgmode] Patch for typo in org-beamer.el
Attached please find a patch to org-beamer that fixes a small typo in a regexp --- desctiption instead of description. cheers, r ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] [PATCH] Fixed typo in regex in org-beamer-place-default-actions-for-lists
From: Robert P. Goldman rpgold...@real-time.com --- lisp/org-beamer.el |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lisp/org-beamer.el b/lisp/org-beamer.el index 49b3499..453ba8a 100644 --- a/lisp/org-beamer.el +++ b/lisp/org-beamer.el @@ -373,7 +373,7 @@ The need to be after the begin statement of the environment. (let (dovl) (goto-char (point-min)) (while (re-search-forward - ^[ \t]*begin{\\(itemize\\|enumerate\\|desctiption\\)}[ \t\n]*item( ?\\([^\n]*\\|\\[[^][\n*]\\]\\)\\)?[ \t]*\\S- nil t) + ^[ \t]*begin{\\(itemize\\|enumerate\\|description\\)}[ \t\n]*item( ?\\([^\n]*\\|\\[[^][\n*]\\]\\)\\)?[ \t]*\\S- nil t) (if (setq dovl (cdr (assoc BEAMER_dovl (get-text-property (match-end 0) 'org-props -- 1.7.2.2 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode