forked from mirrors/org-mode
Backport commit 284c470 from Emacs master branch
Backslash cleanup in Elisp source files 284c470ef752967fcd8bae6a450dc138462b1e49 Paul Eggert Thu Sep 17 16:09:39 2015 -0700
This commit is contained in:
parent
41e9733d2f
commit
c86a10b0bc
|
@ -558,7 +558,7 @@ be saved in the second match data.")
|
|||
|
||||
(defvar org-babel-result-w-name-regexp
|
||||
(concat org-babel-result-regexp
|
||||
"\\([^ ()\f\t\n\r\v]+\\)\\(\(\\(.*\\)\)\\|\\)"))
|
||||
"\\([^ ()\f\t\n\r\v]+\\)\\((\\(.*\\))\\|\\)"))
|
||||
|
||||
(defvar org-babel-min-lines-for-block-output 10
|
||||
"The minimum number of lines for block output.
|
||||
|
@ -2674,7 +2674,7 @@ block but are passed literally to the \"example-block\"."
|
|||
(setq index (point))
|
||||
(while (and (re-search-forward (org-babel-noweb-wrap) nil t))
|
||||
(save-match-data (setf source-name (match-string 1)))
|
||||
(save-match-data (setq evaluate (string-match "\(.*\)" source-name)))
|
||||
(save-match-data (setq evaluate (string-match "(.*)" source-name)))
|
||||
(save-match-data
|
||||
(setq prefix
|
||||
(buffer-substring (match-beginning 0)
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
(value (cdr pair)))
|
||||
(setq body
|
||||
(replace-regexp-in-string
|
||||
(concat "\$" (regexp-quote name))
|
||||
(concat "$" (regexp-quote name))
|
||||
(if (stringp value) value (format "%S" value))
|
||||
body
|
||||
t
|
||||
|
|
|
@ -130,7 +130,7 @@ blocks.")
|
|||
(value (cdr pair)))
|
||||
(setq body
|
||||
(replace-regexp-in-string
|
||||
(concat "\$" (regexp-quote name))
|
||||
(concat "$" (regexp-quote name))
|
||||
(if (stringp value) value (format "%S" value))
|
||||
body))))
|
||||
vars)
|
||||
|
|
|
@ -64,14 +64,14 @@ To add files to this list use the `org-babel-lob-ingest' command."
|
|||
|
||||
(defconst org-babel-block-lob-one-liner-regexp
|
||||
(concat
|
||||
"^\\([ \t]*?\\)#\\+call:[ \t]+\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
|
||||
"\(\\([^\n]*?\\)\)\\(\\[.+\\]\\|\\)[ \t]*\\(\\([^\n]*\\)\\)?")
|
||||
"^\\([ \t]*?\\)#\\+call:[ \t]+\\([^()\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
|
||||
"(\\([^\n]*?\\))\\(\\[.+\\]\\|\\)[ \t]*\\(\\([^\n]*\\)\\)?")
|
||||
"Regexp to match non-inline calls to predefined source block functions.")
|
||||
|
||||
(defconst org-babel-inline-lob-one-liner-regexp
|
||||
(concat
|
||||
"\\([^\n]*?\\)call_\\([^\(\)[:space:]\n]+?\\)\\(\\[\\(.*?\\)\\]\\|\\(\\)\\)"
|
||||
"\(\\(.*?\\)\)\\(\\[\\(.*?\\)\\]\\)?")
|
||||
"\\([^\n]*?\\)call_\\([^()[:space:]\n]+?\\)\\(\\[\\(.*?\\)\\]\\|\\(\\)\\)"
|
||||
"(\\(.*?\\))\\(\\[\\(.*?\\)\\]\\)?")
|
||||
"Regexp to match inline calls to predefined source block functions.")
|
||||
|
||||
(defconst org-babel-lob-one-liner-regexp
|
||||
|
|
|
@ -61,7 +61,7 @@ if ischar(ans), fid = fopen('%s', 'w'); fprintf(fid, '%%s\\n', ans); fclose(fid)
|
|||
else, dlmwrite('%s', ans, '\\t')
|
||||
end")
|
||||
|
||||
(defvar org-babel-octave-eoe-indicator "\'org_babel_eoe\'")
|
||||
(defvar org-babel-octave-eoe-indicator "'org_babel_eoe'")
|
||||
|
||||
(defvar org-babel-octave-eoe-output "ans = org_babel_eoe")
|
||||
|
||||
|
@ -128,7 +128,7 @@ specifying a variable of the same value."
|
|||
(if (listp (car var)) "; " ",")) "]")
|
||||
(cond
|
||||
((stringp var)
|
||||
(format "\'%s\'" var))
|
||||
(format "'%s'" var))
|
||||
(t
|
||||
(format "%s" var)))))
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ the variable."
|
|||
(setq ref (substring ref 0 (match-beginning 0))))
|
||||
;; assign any arguments to pass to source block
|
||||
(when (string-match
|
||||
"^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)\(\\(.*\\)\)$" ref)
|
||||
"^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\(.*\\))$" ref)
|
||||
(setq new-refere (match-string 1 ref))
|
||||
(setq new-header-args (match-string 3 ref))
|
||||
(setq new-referent (match-string 5 ref))
|
||||
|
@ -234,7 +234,7 @@ returned, or an empty string or \"*\" both of which are
|
|||
interpreted to mean the entire range and as such are equivalent
|
||||
to \"0:-1\"."
|
||||
(if (and (> (length index) 0) (string-match "^\\([^,]*\\),?" index))
|
||||
(let* ((ind-re "\\(\\([-[:digit:]]+\\):\\([-[:digit:]]+\\)\\|\*\\)")
|
||||
(let* ((ind-re "\\(\\([-[:digit:]]+\\):\\([-[:digit:]]+\\)\\|\\*\\)")
|
||||
(lgth (length lis))
|
||||
(portion (match-string 1 index))
|
||||
(remainder (substring index (match-end 0)))
|
||||
|
|
|
@ -119,7 +119,7 @@ This function is called by `org-babel-execute-src-block'."
|
|||
('dbi (format "dbish --batch %s < %s | sed '%s' > %s"
|
||||
(or cmdline "")
|
||||
(org-babel-process-file-name in-file)
|
||||
"/^+/d;s/^\|//;s/(NULL)/ /g;$d"
|
||||
"/^+/d;s/^|//;s/(NULL)/ /g;$d"
|
||||
(org-babel-process-file-name out-file)))
|
||||
('monetdb (format "mclient -f tab %s < %s > %s"
|
||||
(or cmdline "")
|
||||
|
@ -202,7 +202,7 @@ This function is called by `org-babel-execute-src-block'."
|
|||
(lambda (pair)
|
||||
(setq body
|
||||
(replace-regexp-in-string
|
||||
(format "\$%s" (car pair)) ;FIXME: "\$" == "$"!
|
||||
(format "$%s" (car pair))
|
||||
(let ((val (cdr pair)))
|
||||
(if (listp val)
|
||||
(let ((data-file (org-babel-temp-file "sql-data-")))
|
||||
|
|
|
@ -119,7 +119,7 @@ This function is called by `org-babel-execute-src-block'."
|
|||
(lambda (pair)
|
||||
(setq body
|
||||
(replace-regexp-in-string
|
||||
(format "\$%s" (car pair)) ;FIXME: "\$" == "$"!
|
||||
(format "$%s" (car pair))
|
||||
(let ((val (cdr pair)))
|
||||
(if (listp val)
|
||||
(let ((data-file (org-babel-temp-file "sqlite-data-")))
|
||||
|
|
|
@ -332,7 +332,7 @@ Insert the source-code specified by SPEC into the current source
|
|||
code file. This function uses `comment-region' which assumes
|
||||
that the appropriate major-mode is set. SPEC has the form:
|
||||
|
||||
\(start-line file link source-name params body comment)"
|
||||
(start-line file link source-name params body comment)"
|
||||
(let* ((start-line (nth 0 spec))
|
||||
(file (if org-babel-tangle-use-relative-file-links
|
||||
(file-relative-name (nth 1 spec))
|
||||
|
|
|
@ -4642,7 +4642,8 @@ in `org-agenda-text-search-extra-files'."
|
|||
(goto-char (1- end))
|
||||
(throw :skip t)))
|
||||
(if todo-only
|
||||
(cons (concat "^\*+[ \t]+" org-not-done-regexp)
|
||||
(cons (concat "^\\*+[ \t]+"
|
||||
org-not-done-regexp)
|
||||
regexps+)
|
||||
regexps+))
|
||||
(goto-char beg)
|
||||
|
|
|
@ -1295,7 +1295,7 @@ make this the default behavior.)"
|
|||
(looking-at
|
||||
(concat "^[ \t]*" org-clock-string
|
||||
" \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}"
|
||||
" *\\sw+\.? +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$")))
|
||||
" *\\sw+.? +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$")))
|
||||
(message "Matched %s" (match-string 1))
|
||||
(setq ts (concat "[" (match-string 1) "]"))
|
||||
(goto-char (match-end 1))
|
||||
|
|
|
@ -4042,30 +4042,30 @@ Assuming TREE is a variable containing an Org buffer parse tree,
|
|||
the following example will return a flat list of all `src-block'
|
||||
and `example-block' elements in it:
|
||||
|
||||
\(org-element-map tree \\='(example-block src-block) #\\='identity)
|
||||
(org-element-map tree \\='(example-block src-block) #\\='identity)
|
||||
|
||||
The following snippet will find the first headline with a level
|
||||
of 1 and a \"phone\" tag, and will return its beginning position:
|
||||
|
||||
\(org-element-map tree \\='headline
|
||||
\(lambda (hl)
|
||||
\(and (= (org-element-property :level hl) 1)
|
||||
\(member \"phone\" (org-element-property :tags hl))
|
||||
\(org-element-property :begin hl)))
|
||||
(org-element-map tree \\='headline
|
||||
(lambda (hl)
|
||||
(and (= (org-element-property :level hl) 1)
|
||||
(member \"phone\" (org-element-property :tags hl))
|
||||
(org-element-property :begin hl)))
|
||||
nil t)
|
||||
|
||||
The next example will return a flat list of all `plain-list' type
|
||||
elements in TREE that are not a sub-list themselves:
|
||||
|
||||
\(org-element-map tree \\='plain-list #\\='identity nil nil \\='plain-list)
|
||||
(org-element-map tree \\='plain-list #\\='identity nil nil \\='plain-list)
|
||||
|
||||
Eventually, this example will return a flat list of all `bold'
|
||||
type objects containing a `latex-snippet' type object, even
|
||||
looking into captions:
|
||||
|
||||
\(org-element-map tree \\='bold
|
||||
\(lambda (b)
|
||||
\(and (org-element-map b \\='latex-snippet #\\='identity nil t) b))
|
||||
(org-element-map tree \\='bold
|
||||
(lambda (b)
|
||||
(and (org-element-map b \\='latex-snippet #\\='identity nil t) b))
|
||||
nil nil nil t)"
|
||||
;; Ensure TYPES and NO-RECURSION are a list, even of one element.
|
||||
(let* ((types (if (listp types) types (list types)))
|
||||
|
|
|
@ -259,7 +259,7 @@ positions, and the definition, when inlined."
|
|||
|
||||
This matches only pure definitions like [1] or [fn:name] at the
|
||||
beginning of a line. It does not match references like
|
||||
\[fn:name:definition], where the footnote text is included and
|
||||
[fn:name:definition], where the footnote text is included and
|
||||
defined locally.
|
||||
|
||||
The return value will be nil if not at a footnote definition, and
|
||||
|
|
|
@ -622,11 +622,11 @@ point-at-bol:
|
|||
|
||||
will get the following structure:
|
||||
|
||||
\(\(1 0 \"- \" nil \"[X]\" nil 97\)
|
||||
\(18 2 \"1. \" nil nil nil 34\)
|
||||
\(34 2 \"5. \" \"5\" nil nil 55\)
|
||||
\(97 0 \"- \" nil nil nil 131\)
|
||||
\(109 2 \"+ \" nil nil \"tag\" 131\)
|
||||
((1 0 \"- \" nil \"[X]\" nil 97)
|
||||
(18 2 \"1. \" nil nil nil 34)
|
||||
(34 2 \"5. \" \"5\" nil nil 55)
|
||||
(97 0 \"- \" nil nil nil 131)
|
||||
(109 2 \"+ \" nil nil \"tag\" 131))
|
||||
|
||||
Assume point is at an item."
|
||||
(save-excursion
|
||||
|
@ -2036,7 +2036,7 @@ previous item, plus ARGS extra arguments.
|
|||
|
||||
FUNCTION is applied on items in reverse order.
|
||||
|
||||
As an example, \(org-apply-on-list \(lambda \(result\) \(1+ result\)\) 0\)
|
||||
As an example, \(org-apply-on-list \(lambda \(result) \(1+ result)) 0)
|
||||
will return the number of items in the current list.
|
||||
|
||||
Sublists of the list are skipped. Cursor is always at the
|
||||
|
@ -2952,13 +2952,13 @@ For example, the following list:
|
|||
|
||||
will be parsed as:
|
||||
|
||||
\(ordered
|
||||
\(nil \"first item\"
|
||||
\(unordered
|
||||
\(nil \"sub-item one\"\)
|
||||
\(nil \"[CBON] sub-item two\"\)\)
|
||||
\"more text in first item\"\)
|
||||
\(3 \"last item\"\)\)
|
||||
(ordered
|
||||
(nil \"first item\"
|
||||
(unordered
|
||||
(nil \"sub-item one\")
|
||||
(nil \"[CBON] sub-item two\"))
|
||||
\"more text in first item\")
|
||||
(3 \"last item\"))
|
||||
|
||||
Point is left at list end."
|
||||
(defvar parse-item) ;FIXME: Or use `cl-labels' or `letrec'.
|
||||
|
|
|
@ -3392,7 +3392,7 @@ formulas that use a range of rows or columns, it may often be better
|
|||
to anchor the formula with \"I\" row markers, or to offset from the
|
||||
borders of the table using the @< @> $< $> makers."
|
||||
(let (n nmax len char (start 0))
|
||||
(while (string-match "\\([@$]\\)\\(<+\\|>+\\)\\|\\(remote([^\)]+)\\)"
|
||||
(while (string-match "\\([@$]\\)\\(<+\\|>+\\)\\|\\(remote([^)]+)\\)"
|
||||
s start)
|
||||
(if (match-end 3)
|
||||
(setq start (match-end 3))
|
||||
|
|
60
lisp/org.el
60
lisp/org.el
|
@ -680,7 +680,7 @@ core modules, nor modules from the CONTRIB directory). Just add symbols
|
|||
to the end of the list. If the package is called org-xyz.el, then you need
|
||||
to add the symbol `xyz', and the package must have a call to:
|
||||
|
||||
\(provide \\='org-xyz)
|
||||
(provide \\='org-xyz)
|
||||
|
||||
For export specific modules, see also `org-export-backends'."
|
||||
:group 'org
|
||||
|
@ -764,26 +764,26 @@ need to make a change while Emacs is running, use the customize
|
|||
interface or run the following code, where VAL stands for the new
|
||||
value of the variable, after updating it:
|
||||
|
||||
\(progn
|
||||
\(setq org-export-registered-backends
|
||||
\(org-remove-if-not
|
||||
\(lambda (backend)
|
||||
\(let ((name (org-export-backend-name backend)))
|
||||
\(or (memq name val)
|
||||
\(catch \\='parentp
|
||||
\(dolist (b val)
|
||||
\(and (org-export-derived-backend-p b name)
|
||||
\(throw \\='parentp t)))))))
|
||||
(progn
|
||||
(setq org-export-registered-backends
|
||||
(org-remove-if-not
|
||||
(lambda (backend)
|
||||
(let ((name (org-export-backend-name backend)))
|
||||
(or (memq name val)
|
||||
(catch \\='parentp
|
||||
(dolist (b val)
|
||||
(and (org-export-derived-backend-p b name)
|
||||
(throw \\='parentp t)))))))
|
||||
org-export-registered-backends))
|
||||
\(let ((new-list (mapcar #\\='org-export-backend-name
|
||||
(let ((new-list (mapcar #\\='org-export-backend-name
|
||||
org-export-registered-backends)))
|
||||
\(dolist (backend val)
|
||||
\(cond
|
||||
\((not (load (format \"ox-%s\" backend) t t))
|
||||
\(message \"Problems while trying to load export back-end \\=`%s\\='\"
|
||||
(dolist (backend val)
|
||||
(cond
|
||||
((not (load (format \"ox-%s\" backend) t t))
|
||||
(message \"Problems while trying to load export back-end \\=`%s\\='\"
|
||||
backend))
|
||||
\((not (memq backend new-list)) (push backend new-list))))
|
||||
\(set-default \\='org-export-backends new-list)))
|
||||
((not (memq backend new-list)) (push backend new-list))))
|
||||
(set-default \\='org-export-backends new-list)))
|
||||
|
||||
Adding a back-end to this list will also pull the back-end it
|
||||
depends on, if any."
|
||||
|
@ -3191,7 +3191,7 @@ its value is 0.
|
|||
|
||||
For example,
|
||||
|
||||
\(:days \"%dd\" :hours \"%d\" :require-hours t :minutes \":%02d\"
|
||||
(:days \"%dd\" :hours \"%d\" :require-hours t :minutes \":%02d\"
|
||||
:require-minutes t)
|
||||
|
||||
means durations longer than a day will be expressed in days,
|
||||
|
@ -3201,7 +3201,7 @@ hour).
|
|||
|
||||
The value
|
||||
|
||||
\(:days \"%dd\" :minutes \"%dm\")
|
||||
(:days \"%dd\" :minutes \"%dm\")
|
||||
|
||||
means durations longer than a day will be expressed in days and
|
||||
minutes, and durations less than a day will be expressed entirely
|
||||
|
@ -4041,8 +4041,8 @@ images at the same place."
|
|||
|
||||
(defcustom org-format-latex-header "\\documentclass{article}
|
||||
\\usepackage[usenames]{color}
|
||||
\[PACKAGES]
|
||||
\[DEFAULT-PACKAGES]
|
||||
[PACKAGES]
|
||||
[DEFAULT-PACKAGES]
|
||||
\\pagestyle{empty} % do not remove
|
||||
% The settings below are copied from fullpage.sty
|
||||
\\setlength{\\textwidth}{\\paperwidth}
|
||||
|
@ -4128,7 +4128,7 @@ a string.
|
|||
|
||||
A cell is of the format
|
||||
|
||||
\(\"options\" \"package\" SNIPPET-FLAG)
|
||||
(\"options\" \"package\" SNIPPET-FLAG)
|
||||
|
||||
If SNIPPET-FLAG is non-nil, the package also needs to be included
|
||||
when compiling LaTeX snippets into images for inclusion into
|
||||
|
@ -4157,7 +4157,7 @@ Each element is either a cell or a string.
|
|||
|
||||
A cell is of the format:
|
||||
|
||||
\(\"options\" \"package\" SNIPPET-FLAG)
|
||||
(\"options\" \"package\" SNIPPET-FLAG)
|
||||
|
||||
SNIPPET-FLAG, when non-nil, indicates that this package is also
|
||||
needed when turning LaTeX snippets into images for inclusion into
|
||||
|
@ -7441,7 +7441,7 @@ a block. Return a non-nil value when toggling is successful."
|
|||
(defconst org-goto-help
|
||||
"Browse buffer copy, to find location or copy text.%s
|
||||
RET=jump to location C-g=quit and return to previous location
|
||||
\[Up]/[Down]=next/prev headline TAB=cycle visibility [/] org-occur")
|
||||
[Up]/[Down]=next/prev headline TAB=cycle visibility [/] org-occur")
|
||||
|
||||
(defvar org-goto-start-pos) ; dynamically scoped parameter
|
||||
|
||||
|
@ -11675,7 +11675,7 @@ on the system \"/user@host:\"."
|
|||
(setq level (org-reduced-level
|
||||
(- (match-end 1) (match-beginning 1)))
|
||||
txt (org-link-display-format (match-string 4))
|
||||
txt (replace-regexp-in-string "\\( *\[[0-9]+/?[0-9]*%?\]\\)+$" "" txt)
|
||||
txt (replace-regexp-in-string "\\( *[[0-9]+/?[0-9]*%?]\\)+$" "" txt)
|
||||
re (format org-complex-heading-regexp-format
|
||||
(regexp-quote (match-string 4))))
|
||||
(when org-refile-use-outline-path
|
||||
|
@ -16876,7 +16876,7 @@ While prompting, a calendar is popped up - you can also select the
|
|||
date with the mouse (button 1). The calendar shows a period of three
|
||||
months. To scroll it to other months, use the keys `>' and `<'.
|
||||
If you don't like the calendar, turn it off with
|
||||
\(setq org-read-date-popup-calendar nil)
|
||||
(setq org-read-date-popup-calendar nil)
|
||||
|
||||
With optional argument TO-TIME, the date will immediately be converted
|
||||
to an internal time.
|
||||
|
@ -18472,7 +18472,7 @@ If EXCLUDE-TMP is non-nil, ignore temporary buffers."
|
|||
((eq predicate 'files)
|
||||
(lambda (b) (with-current-buffer b (derived-mode-p 'org-mode))))
|
||||
((eq predicate 'export)
|
||||
(lambda (b) (string-match "\*Org .*Export" (buffer-name b))))
|
||||
(lambda (b) (string-match "\\*Org .*Export" (buffer-name b))))
|
||||
((eq predicate 'agenda)
|
||||
(lambda (b)
|
||||
(with-current-buffer b
|
||||
|
@ -18481,7 +18481,7 @@ If EXCLUDE-TMP is non-nil, ignore temporary buffers."
|
|||
(member (file-truename bfn) agenda-files)))))
|
||||
(t (lambda (b) (with-current-buffer b
|
||||
(or (derived-mode-p 'org-mode)
|
||||
(string-match "\*Org .*Export"
|
||||
(string-match "\\*Org .*Export"
|
||||
(buffer-name b)))))))))
|
||||
(delq nil
|
||||
(mapcar
|
||||
|
@ -24087,7 +24087,7 @@ no special treatment. In particular, a simple \\[universal-argument] prefix \
|
|||
will just
|
||||
plainly yank the text as it is.
|
||||
|
||||
\[1] The test checks if the first non-white line is a heading
|
||||
[1] The test checks if the first non-white line is a heading
|
||||
and if there are no other headings with fewer stars."
|
||||
(interactive "P")
|
||||
(org-yank-generic 'yank arg))
|
||||
|
|
|
@ -2781,7 +2781,7 @@ Bind `org-html-standalone-image-predicate' to constrain paragraph
|
|||
further. For example, to check for only captioned standalone
|
||||
images, set it to:
|
||||
|
||||
\(lambda (paragraph) (org-element-property :caption paragraph))"
|
||||
(lambda (paragraph) (org-element-property :caption paragraph))"
|
||||
(let ((paragraph (case (org-element-type element)
|
||||
(paragraph element)
|
||||
(link (org-export-get-parent element)))))
|
||||
|
|
|
@ -426,9 +426,9 @@ references."
|
|||
If #+LATEX_CLASS is set in the buffer, use its value and the
|
||||
associated information. Here is the structure of each cell:
|
||||
|
||||
\(class-name
|
||||
(class-name
|
||||
header-string
|
||||
\(numbered-section . unnumbered-section)
|
||||
(numbered-section . unnumbered-section)
|
||||
...)
|
||||
|
||||
The header string
|
||||
|
@ -499,11 +499,11 @@ section string and will be replaced by the title of the section.
|
|||
Instead of a cons cell (numbered . unnumbered), you can also
|
||||
provide a list of 2 or 4 elements,
|
||||
|
||||
\(numbered-open numbered-close)
|
||||
(numbered-open numbered-close)
|
||||
|
||||
or
|
||||
|
||||
\(numbered-open numbered-close unnumbered-open unnumbered-close)
|
||||
(numbered-open numbered-close unnumbered-open unnumbered-close)
|
||||
|
||||
providing opening and closing strings for a LaTeX environment
|
||||
that should represent the document section. The opening clause
|
||||
|
@ -879,21 +879,21 @@ listings package, and if you want to have color, the color
|
|||
package. Just add these to `org-latex-packages-alist', for
|
||||
example using customize, or with something like:
|
||||
|
||||
\(require \\='ox-latex)
|
||||
\(add-to-list \\='org-latex-packages-alist \\='(\"\" \"listings\"))
|
||||
\(add-to-list \\='org-latex-packages-alist \\='(\"\" \"color\"))
|
||||
(require \\='ox-latex)
|
||||
(add-to-list \\='org-latex-packages-alist \\='(\"\" \"listings\"))
|
||||
(add-to-list \\='org-latex-packages-alist \\='(\"\" \"color\"))
|
||||
|
||||
Alternatively,
|
||||
|
||||
\(setq org-latex-listings \\='minted)
|
||||
(setq org-latex-listings \\='minted)
|
||||
|
||||
causes source code to be exported using the minted package as
|
||||
opposed to listings. If you want to use minted, you need to add
|
||||
the minted package to `org-latex-packages-alist', for example
|
||||
using customize, or with
|
||||
|
||||
\(require \\='ox-latex)
|
||||
\(add-to-list \\='org-latex-packages-alist \\='(\"newfloat\" \"minted\"))
|
||||
(require \\='ox-latex)
|
||||
(add-to-list \\='org-latex-packages-alist \\='(\"newfloat\" \"minted\"))
|
||||
|
||||
In addition, it is necessary to install pygments
|
||||
\(http://pygments.org), and to configure the variable
|
||||
|
@ -946,9 +946,9 @@ These options are supplied as a comma-separated list to the
|
|||
a list containing two strings: the name of the option, and the
|
||||
value. For example,
|
||||
|
||||
\(setq org-latex-listings-options
|
||||
(setq org-latex-listings-options
|
||||
\\='((\"basicstyle\" \"\\\\small\")
|
||||
\(\"keywordstyle\" \"\\\\color{black}\\\\bfseries\\\\underbar\")))
|
||||
(\"keywordstyle\" \"\\\\color{black}\\\\bfseries\\\\underbar\")))
|
||||
|
||||
will typeset the code in a small size font with underlined, bold
|
||||
black keywords.
|
||||
|
@ -999,8 +999,8 @@ These options are supplied within square brackets in
|
|||
be a list containing two strings: the name of the option, and the
|
||||
value. For example,
|
||||
|
||||
\(setq org-latex-minted-options
|
||||
'\((\"bgcolor\" \"bg\") \(\"frame\" \"lines\")))
|
||||
(setq org-latex-minted-options
|
||||
'((\"bgcolor\" \"bg\") (\"frame\" \"lines\")))
|
||||
|
||||
will result in src blocks being exported with
|
||||
|
||||
|
@ -1026,8 +1026,8 @@ block-specific options, you may use the following syntax:
|
|||
It is used during export of src blocks by the listings and minted
|
||||
latex packages. For example,
|
||||
|
||||
\(setq org-latex-custom-lang-environments
|
||||
'\(\(python \"pythoncode\"\)\)\)
|
||||
(setq org-latex-custom-lang-environments
|
||||
'((python \"pythoncode\")))
|
||||
|
||||
would have the effect that if org encounters begin_src python
|
||||
during latex export it will output
|
||||
|
|
|
@ -210,8 +210,8 @@ in this list - but it does not hurt if it is present."
|
|||
It is used during export of src blocks by the listings and
|
||||
man packages. For example,
|
||||
|
||||
\(setq org-man-custom-lang-environments
|
||||
'\(\(python \"pythoncode\"\)\)\)
|
||||
(setq org-man-custom-lang-environments
|
||||
'((python \"pythoncode\")))
|
||||
|
||||
would have the effect that if org encounters begin_src python
|
||||
during man export."
|
||||
|
|
|
@ -245,13 +245,13 @@ standard Emacs.")
|
|||
(defvar org-odt-automatic-styles '()
|
||||
"Registry of automatic styles for various OBJECT-TYPEs.
|
||||
The variable has the following form:
|
||||
\(\(OBJECT-TYPE-A
|
||||
\(\(OBJECT-NAME-A.1 OBJECT-PROPS-A.1\)
|
||||
\(OBJECT-NAME-A.2 OBJECT-PROPS-A.2\) ...\)\)
|
||||
\(OBJECT-TYPE-B
|
||||
\(\(OBJECT-NAME-B.1 OBJECT-PROPS-B.1\)
|
||||
\(OBJECT-NAME-B.2 OBJECT-PROPS-B.2\) ...\)\)
|
||||
...\).
|
||||
((OBJECT-TYPE-A
|
||||
((OBJECT-NAME-A.1 OBJECT-PROPS-A.1)
|
||||
(OBJECT-NAME-A.2 OBJECT-PROPS-A.2) ...))
|
||||
(OBJECT-TYPE-B
|
||||
((OBJECT-NAME-B.1 OBJECT-PROPS-B.1)
|
||||
(OBJECT-NAME-B.2 OBJECT-PROPS-B.2) ...))
|
||||
...).
|
||||
|
||||
OBJECT-TYPEs could be \"Section\", \"Table\", \"Figure\" etc.
|
||||
OBJECT-PROPS is (typically) a plist created by passing
|
||||
|
@ -306,7 +306,7 @@ according to the default face identified by the `htmlfontify'.")
|
|||
|
||||
This is an alist where each element is of the form:
|
||||
|
||||
\(STYLE-NAME ATTACH-FMT REF-MODE REF-FMT)
|
||||
(STYLE-NAME ATTACH-FMT REF-MODE REF-FMT)
|
||||
|
||||
ATTACH-FMT controls how labels and captions are attached to an
|
||||
entity. It may contain following specifiers - %e and %c. %e is
|
||||
|
@ -333,7 +333,7 @@ See also `org-odt-format-label'.")
|
|||
|
||||
This is a list where each entry is of the form:
|
||||
|
||||
\(CATEGORY-HANDLE OD-VARIABLE LABEL-STYLE CATEGORY-NAME ENUMERATOR-PREDICATE)
|
||||
(CATEGORY-HANDLE OD-VARIABLE LABEL-STYLE CATEGORY-NAME ENUMERATOR-PREDICATE)
|
||||
|
||||
CATEGORY_HANDLE identifies the captionable entity in question.
|
||||
|
||||
|
@ -685,11 +685,11 @@ The default value simply returns the value of CONTENTS."
|
|||
"Function to format headline text.
|
||||
|
||||
This function will be called with 5 arguments:
|
||||
TODO the todo keyword \(string or nil\).
|
||||
TODO-TYPE the type of todo \(symbol: `todo', `done', nil\)
|
||||
PRIORITY the priority of the headline \(integer or nil\)
|
||||
TEXT the main headline text \(string\).
|
||||
TAGS the tags string, separated with colons \(string or nil\).
|
||||
TODO the todo keyword (string or nil).
|
||||
TODO-TYPE the type of todo (symbol: `todo', `done', nil)
|
||||
PRIORITY the priority of the headline (integer or nil)
|
||||
TEXT the main headline text (string).
|
||||
TAGS the tags string, separated with colons (string or nil).
|
||||
|
||||
The function result will be used as headline text."
|
||||
:group 'org-export-odt
|
||||
|
@ -867,11 +867,11 @@ ON-OR-OFF := t | nil
|
|||
For example, with the following configuration
|
||||
|
||||
\(setq org-odt-table-styles
|
||||
'\(\(\"TableWithHeaderRowsAndColumns\" \"Custom\"
|
||||
\(\(use-first-row-styles . t\)
|
||||
\(use-first-column-styles . t\)\)\)
|
||||
\(\"TableWithHeaderColumns\" \"Custom\"
|
||||
\(\(use-first-column-styles . t\)\)\)\)\)
|
||||
'((\"TableWithHeaderRowsAndColumns\" \"Custom\"
|
||||
((use-first-row-styles . t)
|
||||
(use-first-column-styles . t)))
|
||||
(\"TableWithHeaderColumns\" \"Custom\"
|
||||
((use-first-column-styles . t)))))
|
||||
|
||||
1. A table associated with \"TableWithHeaderRowsAndColumns\"
|
||||
style will use the following table-cell styles -
|
||||
|
|
|
@ -75,12 +75,12 @@ CDR of each element is in one of the following forms:
|
|||
alternating keys and values, specifying parameters for the
|
||||
publishing process.
|
||||
|
||||
\(:property value :property value ... )
|
||||
(:property value :property value ... )
|
||||
|
||||
2. A meta-project definition, specifying of a list of
|
||||
sub-projects:
|
||||
|
||||
\(:components (\"project-1\" \"project-2\" ...))
|
||||
(:components (\"project-1\" \"project-2\" ...))
|
||||
|
||||
When the CDR of an element of org-publish-project-alist is in
|
||||
this second form, the elements of the list after `:components'
|
||||
|
|
|
@ -153,9 +153,9 @@ If nil it will default to `buffer-file-coding-system'."
|
|||
If #+TEXINFO_CLASS is set in the buffer, use its value and the
|
||||
associated information. Here is the structure of each cell:
|
||||
|
||||
\(class-name
|
||||
(class-name
|
||||
header-string
|
||||
\(numbered-section . unnumbered-section)
|
||||
(numbered-section . unnumbered-section)
|
||||
...)
|
||||
|
||||
|
||||
|
@ -1655,7 +1655,7 @@ none."
|
|||
(re-search-forward "requires a sectioning" nil t))
|
||||
(setq errors (concat errors " [invalid section command]")))
|
||||
(when (save-excursion
|
||||
(re-search-forward "\\[unexpected\]" nil t))
|
||||
(re-search-forward "\\[unexpected\ ]" nil t))
|
||||
(setq errors (concat errors " [unexpected error]")))
|
||||
(when (save-excursion
|
||||
(re-search-forward "misplaced " nil t))
|
||||
|
|
54
lisp/ox.el
54
lisp/ox.el
|
@ -883,7 +883,7 @@ output is restricted to body only, \"s\" when it is restricted to
|
|||
the current subtree, \"v\" when only visible elements are
|
||||
considered for export, \"f\" when publishing functions should be
|
||||
passed the FORCE argument and \"a\" when the export should be
|
||||
asynchronous). Also, \[?] allows to switch back to standard
|
||||
asynchronous). Also, [?] allows to switch back to standard
|
||||
mode."
|
||||
:group 'org-export-general
|
||||
:version "24.4"
|
||||
|
@ -1129,19 +1129,19 @@ keywords are understood:
|
|||
or
|
||||
|
||||
\\='(?l \"Export to LaTeX\"
|
||||
\(?p \"As PDF file\" org-latex-export-to-pdf)
|
||||
\(?o \"As PDF file and open\"
|
||||
\(lambda (a s v b)
|
||||
\(if a (org-latex-export-to-pdf t s v b)
|
||||
\(org-open-file
|
||||
\(org-latex-export-to-pdf nil s v b)))))))
|
||||
(?p \"As PDF file\" org-latex-export-to-pdf)
|
||||
(?o \"As PDF file and open\"
|
||||
(lambda (a s v b)
|
||||
(if a (org-latex-export-to-pdf t s v b)
|
||||
(org-open-file
|
||||
(org-latex-export-to-pdf nil s v b)))))))
|
||||
|
||||
or the following, which will be added to the previous
|
||||
sub-menu,
|
||||
|
||||
\\='(?l 1
|
||||
\((?B \"As TEX buffer (Beamer)\" org-beamer-export-as-latex)
|
||||
\(?P \"As PDF file (Beamer)\" org-beamer-export-to-pdf)))
|
||||
((?B \"As TEX buffer (Beamer)\" org-beamer-export-as-latex)
|
||||
(?P \"As PDF file (Beamer)\" org-beamer-export-to-pdf)))
|
||||
|
||||
:options-alist
|
||||
|
||||
|
@ -1215,12 +1215,12 @@ keywords are understood:
|
|||
As an example, here is how one could define \"my-latex\" back-end
|
||||
as a variant of `latex' back-end with a custom template function:
|
||||
|
||||
\(org-export-define-derived-backend \\='my-latex \\='latex
|
||||
(org-export-define-derived-backend \\='my-latex \\='latex
|
||||
:translate-alist \\='((template . my-latex-template-fun)))
|
||||
|
||||
The back-end could then be called with, for example:
|
||||
|
||||
\(org-export-to-buffer \\='my-latex \"*Test my-latex*\")"
|
||||
(org-export-to-buffer \\='my-latex \"*Test my-latex*\")"
|
||||
(declare (indent 2))
|
||||
(let (blocks filters menu-entry options transcoders contents)
|
||||
(while (keywordp (car body))
|
||||
|
@ -1679,7 +1679,7 @@ DATA is the parse tree. OPTIONS is the plist holding export
|
|||
options.
|
||||
|
||||
Return an alist whose key is a headline and value is its
|
||||
associated numbering \(in the shape of a list of numbers\) or nil
|
||||
associated numbering \(in the shape of a list of numbers) or nil
|
||||
for a footnotes section."
|
||||
(let ((numbering (make-vector org-export-max-depth 0)))
|
||||
(org-element-map data 'headline
|
||||
|
@ -4039,7 +4039,7 @@ PATH is the link path. DESC is its description."
|
|||
Optional argument is a set of RULES defining inline images. It
|
||||
is an alist where associations have the following shape:
|
||||
|
||||
\(TYPE . REGEXP)
|
||||
(TYPE . REGEXP)
|
||||
|
||||
Applying a rule means apply REGEXP against LINK's path when its
|
||||
type is TYPE. The function will return a non-nil value if any of
|
||||
|
@ -4095,7 +4095,7 @@ Return value can be an object or an element:
|
|||
- If LINK path matches a target object (i.e. <<path>>) return it.
|
||||
|
||||
- If LINK path exactly matches the name affiliated keyword
|
||||
\(i.e. #+NAME: path) of an element, return that element.
|
||||
(i.e. #+NAME: path) of an element, return that element.
|
||||
|
||||
- If LINK path exactly matches any headline name, return that
|
||||
element.
|
||||
|
@ -5790,10 +5790,10 @@ no argument. It is always called within the current process,
|
|||
from BUFFER, with point at its beginning. Export back-ends can
|
||||
use it to set a major mode there, e.g,
|
||||
|
||||
\(defun org-latex-export-as-latex
|
||||
\(&optional async subtreep visible-only body-only ext-plist)
|
||||
\(interactive)
|
||||
\(org-export-to-buffer \\='latex \"*Org LATEX Export*\"
|
||||
(defun org-latex-export-as-latex
|
||||
(&optional async subtreep visible-only body-only ext-plist)
|
||||
(interactive)
|
||||
(org-export-to-buffer \\='latex \"*Org LATEX Export*\"
|
||||
async subtreep visible-only body-only ext-plist (lambda () (LaTeX-mode))))
|
||||
|
||||
This function returns BUFFER."
|
||||
|
@ -5850,13 +5850,13 @@ argument and happens asynchronously when ASYNC is non-nil. It
|
|||
has to return a file name, or nil. Export back-ends can use this
|
||||
to send the output file through additional processing, e.g,
|
||||
|
||||
\(defun org-latex-export-to-latex
|
||||
\(&optional async subtreep visible-only body-only ext-plist)
|
||||
\(interactive)
|
||||
\(let ((outfile (org-export-output-file-name \".tex\" subtreep)))
|
||||
\(org-export-to-file \\='latex outfile
|
||||
(defun org-latex-export-to-latex
|
||||
(&optional async subtreep visible-only body-only ext-plist)
|
||||
(interactive)
|
||||
(let ((outfile (org-export-output-file-name \".tex\" subtreep)))
|
||||
(org-export-to-file \\='latex outfile
|
||||
async subtreep visible-only body-only ext-plist
|
||||
\(lambda (file) (org-latex-compile file)))
|
||||
(lambda (file) (org-latex-compile file)))
|
||||
|
||||
The function returns either a file name returned by POST-PROCESS,
|
||||
or FILE."
|
||||
|
@ -6186,7 +6186,7 @@ is nil when this menu hasn't been selected yet.
|
|||
|
||||
EXPERTP, when non-nil, triggers expert UI. In that case, no help
|
||||
buffer is provided, but indications about currently active
|
||||
options are given in the prompt. Moreover, \[?] allows to switch
|
||||
options are given in the prompt. Moreover, [?] allows to switch
|
||||
back to standard interface."
|
||||
(let* ((fontify-key
|
||||
(lambda (key &optional access-key)
|
||||
|
@ -6238,8 +6238,8 @@ back to standard interface."
|
|||
(concat
|
||||
;; Options are hard-coded.
|
||||
(format "[%s] Body only: %s [%s] Visible only: %s
|
||||
\[%s] Export scope: %s [%s] Force publishing: %s
|
||||
\[%s] Async export: %s\n\n"
|
||||
[%s] Export scope: %s [%s] Force publishing: %s
|
||||
[%s] Async export: %s\n\n"
|
||||
(funcall fontify-key "C-b" t)
|
||||
(funcall fontify-value
|
||||
(if (memq 'body options) "On " "Off"))
|
||||
|
|
Loading…
Reference in New Issue