From 0a6b6bf73514196b3c445116302195e374688dbd Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 15 Nov 2013 10:08:25 +0100 Subject: [PATCH 1/6] Enhance docstrings * ox.el (org-export-with-sub-superscripts): * org.el (org-use-sub-superscripts): Enhance docstrings. Thansk to Dieter and Nick for raising this. --- lisp/org.el | 24 ++++++++++++++---------- lisp/ox.el | 28 ++++++++++++++++------------ 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 8c0fe3547..50d44c39d 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -654,11 +654,15 @@ the following lines anywhere in the buffer: (defcustom org-use-sub-superscripts t "Non-nil means interpret \"_\" and \"^\" for display. -When this option is turned on, you can use TeX-like syntax for sub- and -superscripts. Several characters after \"_\" or \"^\" will be -considered as a single item - so grouping with {} is normally not -needed. For example, the following things will be parsed as single -sub- or superscripts. + +If you want to control how Org exports those characters, +see `org-export-with-sub-superscripts'. + +When this option is turned on, you can use TeX-like syntax for +sub- and superscripts within the buffer. Several characters after +\"_\" or \"^\" will be considered as a single item - so grouping +with {} is normally not needed. For example, the following things +will be parsed as single sub- or superscripts: 10^24 or 10^tau several digits will be considered 1 item. 10^-12 or 10^-tau a leading sign with digits or a word @@ -666,11 +670,11 @@ sub- or superscripts. terminated by almost any nonword/nondigit char. x_{i^2} or x^(2-i) braces or parenthesis do grouping. -Still, ambiguity is possible - so when in doubt use {} to enclose -the sub/superscript. If you set this variable to the symbol -`{}', the braces are *required* in order to trigger -interpretations as sub/superscript. This can be helpful in -documents that need \"_\" frequently in plain text." +Still, ambiguity is possible. So when in doubt, use {} to enclose +the sub/superscript. If you set this variable to the symbol `{}', +the braces are *required* in order to trigger interpretations as +sub/superscript. This can be helpful in documents that need \"_\" +frequently in plain text." :group 'org-startup :version "24.1" :type '(choice diff --git a/lisp/ox.el b/lisp/ox.el index 69dca6854..22fe8f99f 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -626,11 +626,18 @@ e.g. \"stat:nil\"" (defcustom org-export-with-sub-superscripts t "Non-nil means interpret \"_\" and \"^\" for export. +If you want to control how Org displays those characters, +see `org-use-sub-superscripts'. + When this option is turned on, you can use TeX-like syntax for -sub- and superscripts. Several characters after \"_\" or \"^\" -will be considered as a single item - so grouping with {} is -normally not needed. For example, the following things will be -parsed as single sub- or superscripts. +sub- and superscripts and see them exported correctly. + +You can also set the option with #+OPTIONS: ^:t + +Several characters after \"_\" or \"^\" will be considered as a +single item - so grouping with {} is normally not needed. For +example, the following things will be parsed as single sub- or +superscripts: 10^24 or 10^tau several digits will be considered 1 item. 10^-12 or 10^-tau a leading sign with digits or a word @@ -638,14 +645,11 @@ parsed as single sub- or superscripts. terminated by almost any nonword/nondigit char. x_{i^2} or x^(2-i) braces or parenthesis do grouping. -Still, ambiguity is possible - so when in doubt use {} to enclose -the sub/superscript. If you set this variable to the symbol -`{}', the braces are *required* in order to trigger -interpretations as sub/superscript. This can be helpful in -documents that need \"_\" frequently in plain text. - -This option can also be set with the OPTIONS keyword, -e.g. \"^:nil\"." +Still, ambiguity is possible. So when in doubt, use {} to enclose +the sub/superscript. If you set this variable to the symbol `{}', +the braces are *required* in order to trigger interpretations as +sub/superscript. This can be helpful in documents that need \"_\" +frequently in plain text." :group 'org-export-general :type '(choice (const :tag "Interpret them" t) From 19d74816656387d12ec3ff2c3256cbaff5e23bf5 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 29 Oct 2013 14:53:21 +0100 Subject: [PATCH 2/6] Change some defcustoms into defconsts * lisp/org.el (org-clock-string, org-closed-string) (org-deadline-string, org-scheduled-string) (org-archive-tag, org-comment-string, org-quote-string) (org-effort-property, org-latex-regexps): Turn variables into constants. * testing/lisp/test-org-element.el: Update tests. * testing/lisp/test-ox.el: Update tests. Also collect all syntax related constants in the same part of the file. --- lisp/org.el | 389 ++++++++++++++++--------------- testing/lisp/test-org-element.el | 57 ++--- testing/lisp/test-ox.el | 14 +- 3 files changed, 224 insertions(+), 236 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index a3c19589d..1f69b32e6 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -329,8 +329,204 @@ When MESSAGE is non-nil, display a message with the version." (defconst org-version (org-version)) -;;; Compatibility constants + +;;; Syntax Constants +;;;; Block + +(defconst org-block-regexp + "^[ \t]*#\\+begin_?\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\([^\000]+?\\)#\\+end_?\\1[ \t]*$" + "Regular expression for hiding blocks.") + +(defconst org-dblock-start-re + "^[ \t]*#\\+\\(?:BEGIN\\|begin\\):[ \t]+\\(\\S-+\\)\\([ \t]+\\(.*\\)\\)?" + "Matches the start line of a dynamic block, with parameters.") + +(defconst org-dblock-end-re "^[ \t]*#\\+\\(?:END\\|end\\)\\([: \t\r\n]\\|$\\)" + "Matches the end of a dynamic block.") + +;;;; Clock and Planning + +(defconst org-clock-string "CLOCK:" + "String used as prefix for timestamps clocking work hours on an item.") + +(defconst org-closed-string "CLOSED:" + "String used as the prefix for timestamps logging closing a TODO entry.") + +(defconst org-deadline-string "DEADLINE:" + "String to mark deadline entries. +A deadline is this string, followed by a time stamp. Should be a word, +terminated by a colon. You can insert a schedule keyword and +a timestamp with \\[org-deadline].") + +(defconst org-scheduled-string "SCHEDULED:" + "String to mark scheduled TODO entries. +A schedule is this string, followed by a time stamp. Should be a word, +terminated by a colon. You can insert a schedule keyword and +a timestamp with \\[org-schedule].") + +(defconst org-planning-or-clock-line-re + (concat "^[ \t]*" + (regexp-opt + (list org-clock-string org-closed-string org-deadline-string + org-scheduled-string) + t)) + "Matches a line with planning or clock info. +Matched keyword is in group 1.") + +;;;; Drawer + +(defconst org-drawer-regexp "^[ \t]*:\\(\\(?:\\w\\|[-_]\\)+\\):[ \t]*$" + "Matches first line of a hidden block. +Group 1 contains drawer's name.") + +(defconst org-property-start-re "^[ \t]*:PROPERTIES:[ \t]*$" + "Regular expression matching the first line of a property drawer.") + +(defconst org-property-end-re "^[ \t]*:END:[ \t]*$" + "Regular expression matching the last line of a property drawer.") + +(defconst org-clock-drawer-start-re "^[ \t]*:CLOCK:[ \t]*$" + "Regular expression matching the first line of a property drawer.") + +(defconst org-clock-drawer-end-re "^[ \t]*:END:[ \t]*$" + "Regular expression matching the first line of a property drawer.") + +(defconst org-property-drawer-re + (concat "\\(" org-property-start-re "\\)[^\000]*?\\(" + org-property-end-re "\\)\n?") + "Matches an entire property drawer.") + +(defconst org-clock-drawer-re + (concat "\\(" org-clock-drawer-start-re "\\)[^\000]*?\\(" + org-property-end-re "\\)\n?") + "Matches an entire clock drawer.") + +;;;; Headline + +(defconst org-heading-keyword-regexp-format + "^\\(\\*+\\)\\(?: +%s\\)\\(?: +\\(.*?\\)\\)?[ \t]*$" + "Printf format for a regexp matching a headline with some keyword. +This regexp will match the headline of any node which has the +exact keyword that is put into the format. The keyword isn't in +any group by default, but the stars and the body are.") + +(defconst org-heading-keyword-maybe-regexp-format + "^\\(\\*+\\)\\(?: +%s\\)?\\(?: +\\(.*?\\)\\)?[ \t]*$" + "Printf format for a regexp matching a headline, possibly with some keyword. +This regexp can match any headline with the specified keyword, or +without a keyword. The keyword isn't in any group by default, +but the stars and the body are.") + +(defconst org-archive-tag "ARCHIVE" + "The tag that marks a subtree as archived. +An archived subtree does not open during visibility cycling, and does +not contribute to the agenda listings.") + +(defconst org-comment-string "COMMENT" + "Entries starting with this keyword will never be exported. +An entry can be toggled between COMMENT and normal with +\\[org-toggle-comment].") + +(defconst org-quote-string "QUOTE" + "Entries starting with this keyword will be exported in fixed-width font. +Quoting applies only to the text in the entry following the headline, and does +not extend beyond the next headline, even if that is lower level. +An entry can be toggled between QUOTE and normal with +\\[org-toggle-fixed-width-section].") + +;;;; LaTeX Environments and Fragments + +(defconst org-latex-regexps + '(("begin" "^[ \t]*\\(\\\\begin{\\([a-zA-Z0-9\\*]+\\)[^\000]+?\\\\end{\\2}\\)" 1 t) + ;; ("$" "\\([ (]\\|^\\)\\(\\(\\([$]\\)\\([^ \r\n,.$].*?\\(\n.*?\\)\\{0,5\\}[^ \r\n,.$]\\)\\4\\)\\)\\([ .,?;:'\")]\\|$\\)" 2 nil) + ;; \000 in the following regex is needed for org-inside-LaTeX-fragment-p + ("$1" "\\([^$]\\|^\\)\\(\\$[^ \r\n,;.$]\\$\\)\\([- .,?;:'\")\000]\\|$\\)" 2 nil) + ("$" "\\([^$]\\|^\\)\\(\\(\\$\\([^ \r\n,;.$][^$\n\r]*?\\(\n[^$\n\r]*?\\)\\{0,2\\}[^ \r\n,.$]\\)\\$\\)\\)\\([- .,?;:'\")\000]\\|$\\)" 2 nil) + ("\\(" "\\\\([^\000]*?\\\\)" 0 nil) + ("\\[" "\\\\\\[[^\000]*?\\\\\\]" 0 nil) + ("$$" "\\$\\$[^\000]*?\\$\\$" 0 nil)) + "Regular expressions for matching embedded LaTeX.") + +;;;; Node Property + +(defconst org-effort-property "Effort" + "The property that is being used to keep track of effort estimates. +Effort estimates given in this property need to have the format H:MM.") + +;;;; Table + +(defconst org-table-any-line-regexp "^[ \t]*\\(|\\|\\+-[-+]\\)" + "Detect an org-type or table-type table.") + +(defconst org-table-line-regexp "^[ \t]*|" + "Detect an org-type table line.") + +(defconst org-table-dataline-regexp "^[ \t]*|[^-]" + "Detect an org-type table line.") + +(defconst org-table-hline-regexp "^[ \t]*|-" + "Detect an org-type table hline.") + +(defconst org-table1-hline-regexp "^[ \t]*\\+-[-+]" + "Detect a table-type table hline.") + +(defconst org-table-any-border-regexp "^[ \t]*[^|+ \t]" + "Detect the first line outside a table when searching from within it. +This works for both table types.") + +(defconst org-TBLFM-regexp "^[ \t]*#\\+TBLFM: " + "Detect a #+TBLFM line.") + +;;;; Timestamp + +(defconst org-ts-regexp "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^\r\n>]*?\\)>" + "Regular expression for fast time stamp matching.") + +(defconst org-ts-regexp-both "[[<]\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^]\r\n>]*?\\)[]>]" + "Regular expression for fast time stamp matching.") + +(defconst org-ts-regexp0 + "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\)\\( +[^]+0-9>\r\n -]+\\)?\\( +\\([0-9]\\{1,2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)" + "Regular expression matching time strings for analysis. +This one does not require the space after the date, so it can be used +on a string that terminates immediately after the date.") + +(defconst org-ts-regexp1 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\) *\\([^]+0-9>\r\n -]*\\)\\( \\([0-9]\\{1,2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)" + "Regular expression matching time strings for analysis.") + +(defconst org-ts-regexp2 (concat "<" org-ts-regexp1 "[^>\n]\\{0,16\\}>") + "Regular expression matching time stamps, with groups.") + +(defconst org-ts-regexp3 (concat "[[<]" org-ts-regexp1 "[^]>\n]\\{0,16\\}[]>]") + "Regular expression matching time stamps (also [..]), with groups.") + +(defconst org-tr-regexp (concat org-ts-regexp "--?-?" org-ts-regexp) + "Regular expression matching a time stamp range.") + +(defconst org-tr-regexp-both + (concat org-ts-regexp-both "--?-?" org-ts-regexp-both) + "Regular expression matching a time stamp range.") + +(defconst org-tsr-regexp (concat org-ts-regexp "\\(--?-?" + org-ts-regexp "\\)?") + "Regular expression matching a time stamp or time stamp range.") + +(defconst org-tsr-regexp-both + (concat org-ts-regexp-both "\\(--?-?" + org-ts-regexp-both "\\)?") + "Regular expression matching a time stamp or time stamp range. +The time stamps may be either active or inactive.") + +(defconst org-repeat-re + "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\\([.+]?\\+[0-9]+[hdwmy]\\(/[0-9]+[hdwmy]\\)?\\)" + "Regular expression for specifying repeated events. +After a match, group 1 contains the repeat expression.") + +(defconst org-time-stamp-formats '("<%Y-%m-%d %a>" . "<%Y-%m-%d %a %H:%M>") + "Formats for `format-time-string' which are used for time stamps.") + + ;;; The custom variables (defgroup org nil @@ -840,34 +1036,6 @@ effective." :tag "Org Keywords" :group 'org) -(defcustom org-deadline-string "DEADLINE:" - "String to mark deadline entries. -A deadline is this string, followed by a time stamp. Should be a word, -terminated by a colon. You can insert a schedule keyword and -a timestamp with \\[org-deadline]. -Changes become only effective after restarting Emacs." - :group 'org-keywords - :type 'string) - -(defcustom org-scheduled-string "SCHEDULED:" - "String to mark scheduled TODO entries. -A schedule is this string, followed by a time stamp. Should be a word, -terminated by a colon. You can insert a schedule keyword and -a timestamp with \\[org-schedule]. -Changes become only effective after restarting Emacs." - :group 'org-keywords - :type 'string) - -(defcustom org-closed-string "CLOSED:" - "String used as the prefix for timestamps logging closing a TODO entry." - :group 'org-keywords - :type 'string) - -(defcustom org-clock-string "CLOCK:" - "String used as prefix for timestamps clocking work hours on an item." - :group 'org-keywords - :type 'string) - (defcustom org-closed-keep-when-no-todo nil "Remove CLOSED: time-stamp when switching back to a non-todo state?" :group 'org-todo @@ -876,39 +1044,6 @@ Changes become only effective after restarting Emacs." :package-version '(Org . "8.0") :type 'boolean) -(defconst org-planning-or-clock-line-re (concat "^[ \t]*\\(" - org-scheduled-string "\\|" - org-deadline-string "\\|" - org-closed-string "\\|" - org-clock-string "\\)") - "Matches a line with planning or clock info.") - -(defcustom org-comment-string "COMMENT" - "Entries starting with this keyword will never be exported. -An entry can be toggled between COMMENT and normal with -\\[org-toggle-comment]. -Changes become only effective after restarting Emacs." - :group 'org-keywords - :type 'string) - -(defcustom org-quote-string "QUOTE" - "Entries starting with this keyword will be exported in fixed-width font. -Quoting applies only to the text in the entry following the headline, and does -not extend beyond the next headline, even if that is lower level. -An entry can be toggled between QUOTE and normal with -\\[org-toggle-fixed-width-section]." - :group 'org-keywords - :type 'string) - -(defconst org-drawer-regexp "^[ \t]*:\\(\\(?:\\w\\|[-_]\\)+\\):[ \t]*$" - "Matches first line of a hidden block. -Group 1 contains drawer's name.") - -(defconst org-repeat-re - "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\\([.+]?\\+[0-9]+[hdwmy]\\(/[0-9]+[hdwmy]\\)?\\)" - "Regular expression for specifying repeated events. -After a match, group 1 contains the repeat expression.") - (defgroup org-structure nil "Options concerning the general structure of Org-mode files." :tag "Org Structure" @@ -2861,10 +2996,6 @@ the time stamp will always be forced into the second line." :group 'org-time :type 'boolean) -(defconst org-time-stamp-formats '("<%Y-%m-%d %a>" . "<%Y-%m-%d %a %H:%M>") - "Formats for `format-time-string' which are used for time stamps. -It is not recommended to change this constant.") - (defcustom org-time-stamp-rounding-minutes '(0 5) "Number of minutes to round time stamps to. These are two values, the first applies when first creating a time stamp. @@ -3532,13 +3663,6 @@ or nil if the normal value should be used." :group 'org-properties :type '(choice (const nil) (function))) -(defcustom org-effort-property "Effort" - "The property that is being used to keep track of effort estimates. -Effort estimates given in this property need to have the format H:MM." - :group 'org-properties - :group 'org-progress - :type '(string :tag "Property")) - (defconst org-global-properties-fixed '(("VISIBILITY_ALL" . "folded children content all") ("CLOCK_MODELINE_TOTAL_ALL" . "current today repeat all auto")) @@ -4234,30 +4358,6 @@ Normal means, no org-mode-specific context." (declare-function speedbar-line-directory "speedbar" (&optional depth)) (declare-function table--at-cell-p "table" (position &optional object at-column)) -(defvar org-latex-regexps) - -;;; Autoload and prepare some org modules - -;; Some table stuff that needs to be defined here, because it is used -;; by the functions setting up org-mode or checking for table context. - -(defconst org-table-any-line-regexp "^[ \t]*\\(|\\|\\+-[-+]\\)" - "Detect an org-type or table-type table.") -(defconst org-table-line-regexp "^[ \t]*|" - "Detect an org-type table line.") -(defconst org-table-dataline-regexp "^[ \t]*|[^-]" - "Detect an org-type table line.") -(defconst org-table-hline-regexp "^[ \t]*|-" - "Detect an org-type table hline.") -(defconst org-table1-hline-regexp "^[ \t]*\\+-[-+]" - "Detect a table-type table hline.") -(defconst org-table-any-border-regexp "^[ \t]*[^|+ \t]" - "Detect the first line outside a table when searching from within it. -This works for both table types.") - -(defconst org-TBLFM-regexp "^[ \t]*#\\+TBLFM: " - "Detect a #+TBLFM line.") - ;;;###autoload (defun turn-on-orgtbl () "Unconditionally turn on `orgtbl-mode'." @@ -4454,16 +4554,6 @@ the hierarchy, it will be used." :group 'org-archive :type 'string) -(defcustom org-archive-tag "ARCHIVE" - "The tag that marks a subtree as archived. -An archived subtree does not open during visibility cycling, and does -not contribute to the agenda listings. -After changing this, font-lock must be restarted in the relevant buffers to -get the proper fontification." - :group 'org-archive - :group 'org-keywords - :type 'string) - (defcustom org-agenda-skip-archived-trees t "Non-nil means the agenda will skip any items located in archived trees. An archived tree is a tree marked with the tag ARCHIVE. The use of this @@ -4759,22 +4849,6 @@ means to push this value onto the list in the variable.") (cons (cons key (if previous (concat previous " " val) val)) remainder) (cons (cons key val) remainder)))) -(defconst org-block-regexp - "^[ \t]*#\\+begin_?\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\([^\000]+?\\)#\\+end_?\\1[ \t]*$" - "Regular expression for hiding blocks.") -(defconst org-heading-keyword-regexp-format - "^\\(\\*+\\)\\(?: +%s\\)\\(?: +\\(.*?\\)\\)?[ \t]*$" - "Printf format for a regexp matching a headline with some keyword. -This regexp will match the headline of any node which has the -exact keyword that is put into the format. The keyword isn't in -any group by default, but the stars and the body are.") -(defconst org-heading-keyword-maybe-regexp-format - "^\\(\\*+\\)\\(?: +%s\\)?\\(?: +\\(.*?\\)\\)?[ \t]*$" - "Printf format for a regexp matching a headline, possibly with some keyword. -This regexp can match any headline with the specified keyword, or -without a keyword. The keyword isn't in any group by default, -but the stars and the body are.") - (defcustom org-group-tags t "When non-nil (the default), use group tags. This can be turned on/off through `org-toggle-tags-groups'." @@ -5633,35 +5707,6 @@ This should be called after the variable `org-link-types' has changed." (org-make-link-regexps) -(defconst org-ts-regexp "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^\r\n>]*?\\)>" - "Regular expression for fast time stamp matching.") -(defconst org-ts-regexp-both "[[<]\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^]\r\n>]*?\\)[]>]" - "Regular expression for fast time stamp matching.") -(defconst org-ts-regexp0 - "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\)\\( +[^]+0-9>\r\n -]+\\)?\\( +\\([0-9]\\{1,2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)" - "Regular expression matching time strings for analysis. -This one does not require the space after the date, so it can be used -on a string that terminates immediately after the date.") -(defconst org-ts-regexp1 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\) *\\([^]+0-9>\r\n -]*\\)\\( \\([0-9]\\{1,2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)" - "Regular expression matching time strings for analysis.") -(defconst org-ts-regexp2 (concat "<" org-ts-regexp1 "[^>\n]\\{0,16\\}>") - "Regular expression matching time stamps, with groups.") -(defconst org-ts-regexp3 (concat "[[<]" org-ts-regexp1 "[^]>\n]\\{0,16\\}[]>]") - "Regular expression matching time stamps (also [..]), with groups.") -(defconst org-tr-regexp (concat org-ts-regexp "--?-?" org-ts-regexp) - "Regular expression matching a time stamp range.") -(defconst org-tr-regexp-both - (concat org-ts-regexp-both "--?-?" org-ts-regexp-both) - "Regular expression matching a time stamp range.") -(defconst org-tsr-regexp (concat org-ts-regexp "\\(--?-?" - org-ts-regexp "\\)?") - "Regular expression matching a time stamp or time stamp range.") -(defconst org-tsr-regexp-both - (concat org-ts-regexp-both "\\(--?-?" - org-ts-regexp-both "\\)?") - "Regular expression matching a time stamp or time stamp range. -The time stamps may be either active or inactive.") - (defvar org-emph-face nil) (defun org-do-emphasis-faces (limit) @@ -11828,13 +11873,6 @@ If not found, stay at current position and return nil." (if pos (goto-char pos)) pos)) -(defconst org-dblock-start-re - "^[ \t]*#\\+\\(?:BEGIN\\|begin\\):[ \t]+\\(\\S-+\\)\\([ \t]+\\(.*\\)\\)?" - "Matches the start line of a dynamic block, with parameters.") - -(defconst org-dblock-end-re "^[ \t]*#\\+\\(?:END\\|end\\)\\([: \t\r\n]\\|$\\)" - "Matches the end of a dynamic block.") - (defun org-create-dblock (plist) "Create a dynamic block section, with parameters taken from PLIST. PLIST must contain a :name entry which is used as name of the block." @@ -15052,28 +15090,6 @@ but in some other way.") "Some properties that are used by Org-mode for various purposes. Being in this list makes sure that they are offered for completion.") -(defconst org-property-start-re "^[ \t]*:PROPERTIES:[ \t]*$" - "Regular expression matching the first line of a property drawer.") - -(defconst org-property-end-re "^[ \t]*:END:[ \t]*$" - "Regular expression matching the last line of a property drawer.") - -(defconst org-clock-drawer-start-re "^[ \t]*:CLOCK:[ \t]*$" - "Regular expression matching the first line of a property drawer.") - -(defconst org-clock-drawer-end-re "^[ \t]*:END:[ \t]*$" - "Regular expression matching the first line of a property drawer.") - -(defconst org-property-drawer-re - (concat "\\(" org-property-start-re "\\)[^\000]*?\\(" - org-property-end-re "\\)\n?") - "Matches an entire property drawer.") - -(defconst org-clock-drawer-re - (concat "\\(" org-clock-drawer-start-re "\\)[^\000]*?\\(" - org-property-end-re "\\)\n?") - "Matches an entire clock drawer.") - (defun org-property-action () "Do an action on properties." (interactive) @@ -18202,17 +18218,6 @@ Revert to the normal definition outside of these fragments." ;;;; LaTeX fragments -(defvar org-latex-regexps - '(("begin" "^[ \t]*\\(\\\\begin{\\([a-zA-Z0-9\\*]+\\)[^\000]+?\\\\end{\\2}\\)" 1 t) - ;; ("$" "\\([ (]\\|^\\)\\(\\(\\([$]\\)\\([^ \r\n,.$].*?\\(\n.*?\\)\\{0,5\\}[^ \r\n,.$]\\)\\4\\)\\)\\([ .,?;:'\")]\\|$\\)" 2 nil) - ;; \000 in the following regex is needed for org-inside-LaTeX-fragment-p - ("$1" "\\([^$]\\|^\\)\\(\\$[^ \r\n,;.$]\\$\\)\\([- .,?;:'\")\000]\\|$\\)" 2 nil) - ("$" "\\([^$]\\|^\\)\\(\\(\\$\\([^ \r\n,;.$][^$\n\r]*?\\(\n[^$\n\r]*?\\)\\{0,2\\}[^ \r\n,.$]\\)\\$\\)\\)\\([- .,?;:'\")\000]\\|$\\)" 2 nil) - ("\\(" "\\\\([^\000]*?\\\\)" 0 nil) - ("\\[" "\\\\\\[[^\000]*?\\\\\\]" 0 nil) - ("$$" "\\$\\$[^\000]*?\\$\\$" 0 nil)) - "Regular expressions for matching embedded LaTeX.") - (defun org-inside-LaTeX-fragment-p () "Test if point is inside a LaTeX fragment. I.e. after a \\begin, \\(, \\[, $, or $$, without the corresponding closing diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el index 45a0bfa11..e533b6520 100644 --- a/testing/lisp/test-org-element.el +++ b/testing/lisp/test-org-element.el @@ -293,9 +293,8 @@ Some other text (ert-deftest test-org-element/clock-parser () "Test `clock' parser." ;; Running clock. - (let* ((org-clock-string "CLOCK:") - (clock (org-test-with-temp-text "CLOCK: [2012-01-01 sun. 00:01]" - (org-element-at-point)))) + (let ((clock (org-test-with-temp-text "CLOCK: [2012-01-01 sun. 00:01]" + (org-element-at-point)))) (should (eq (org-element-property :status clock) 'running)) (should (equal (org-element-property :raw-value @@ -303,11 +302,10 @@ Some other text "[2012-01-01 sun. 00:01]")) (should-not (org-element-property :duration clock))) ;; Closed clock. - (let* ((org-clock-string "CLOCK:") - (clock - (org-test-with-temp-text - "CLOCK: [2012-01-01 sun. 00:01]--[2012-01-01 sun. 00:02] => 0:01" - (org-element-at-point)))) + (let ((clock + (org-test-with-temp-text + "CLOCK: [2012-01-01 sun. 00:01]--[2012-01-01 sun. 00:02] => 0:01" + (org-element-at-point)))) (should (eq (org-element-property :status clock) 'closed)) (should (equal (org-element-property :raw-value (org-element-property :value clock)) @@ -2213,15 +2211,13 @@ Outside list" (should (string-match "CLOCK: \\[2012-01-01 .* 00:01\\]" - (let ((org-clock-string "CLOCK:")) - (org-test-parse-and-interpret "CLOCK: [2012-01-01 sun. 00:01]")))) + (org-test-parse-and-interpret "CLOCK: [2012-01-01 sun. 00:01]"))) ;; Closed clock. (should (string-match "CLOCK: \\[2012-01-01 .* 00:01\\]--\\[2012-01-01 .* 00:02\\] => 0:01" - (let ((org-clock-string "CLOCK:")) - (org-test-parse-and-interpret " -CLOCK: [2012-01-01 sun. 00:01]--[2012-01-01 sun. 00:02] => 0:01"))))) + (org-test-parse-and-interpret " +CLOCK: [2012-01-01 sun. 00:01]--[2012-01-01 sun. 00:02] => 0:01")))) (ert-deftest test-org-element/comment-interpreter () "Test comment interpreter." @@ -2317,16 +2313,13 @@ CLOCK: [2012-01-01 sun. 00:01]--[2012-01-01 sun. 00:02] => 0:01"))))) (ert-deftest test-org-element/planning-interpreter () "Test planning interpreter." - (let ((org-closed-string "CLOSED:") - (org-deadline-string "DEADLINE:") - (org-scheduled-string "SCHEDULED:")) - (should - (string-match - "\\* Headline + (should + (string-match + "\\* Headline DEADLINE: <2012-03-29 .*?> SCHEDULED: <2012-03-29 .*?> CLOSED: \\[2012-03-29 .*?\\]" - (org-test-parse-and-interpret - "* Headline -DEADLINE: <2012-03-29 thu.> SCHEDULED: <2012-03-29 thu.> CLOSED: [2012-03-29 thu.]"))))) + (org-test-parse-and-interpret + "* Headline +DEADLINE: <2012-03-29 thu.> SCHEDULED: <2012-03-29 thu.> CLOSED: [2012-03-29 thu.]")))) (ert-deftest test-org-element/property-drawer-interpreter () "Test property drawer interpreter." @@ -2561,20 +2554,12 @@ DEADLINE: <2012-03-29 thu.> SCHEDULED: <2012-03-29 thu.> CLOSED: [2012-03-29 thu (ert-deftest test-org-element/latex-fragment-interpreter () "Test latex fragment interpreter." - (let ((org-latex-regexps - '(("begin" "^[ ]*\\(\\\\begin{\\([a-zA-Z0-9\\*]+\\)[^]+?\\\\end{\\2}\\)" 1 t) - ("$1" "\\([^$]\\|^\\)\\(\\$[^ \n,;.$]\\$\\)\\([- .,?;:'\")]\\|$\\)" 2 nil) - ("$" "\\([^$]\\|^\\)\\(\\(\\$\\([^ \n,;.$][^$\n ]*?\\(\n[^$\n ]*?\\)\\{0,2\\}[^ \n,.$]\\)\\$\\)\\)\\([- .,?;:'\")]\\|$\\)" 2 nil) - ("\\(" "\\\\([^]*?\\\\)" 0 nil) - ("\\[" "\\\\\\[[^]*?\\\\\\]" 0 nil) - ("$$" "\\$\\$[^]*?\\$\\$" 0 nil)))) - (should (equal (org-test-parse-and-interpret "\\command{}") - "\\command{}\n")) - (should (equal (org-test-parse-and-interpret "$x$") "$x$\n")) - (should (equal (org-test-parse-and-interpret "$x+y$") "$x+y$\n")) - (should (equal (org-test-parse-and-interpret "$$x+y$$") "$$x+y$$\n")) - (should (equal (org-test-parse-and-interpret "\\(x+y\\)") "\\(x+y\\)\n")) - (should (equal (org-test-parse-and-interpret "\\[x+y\\]") "\\[x+y\\]\n")))) + (should (equal (org-test-parse-and-interpret "\\command{}") "\\command{}\n")) + (should (equal (org-test-parse-and-interpret "$x$") "$x$\n")) + (should (equal (org-test-parse-and-interpret "$x+y$") "$x+y$\n")) + (should (equal (org-test-parse-and-interpret "$$x+y$$") "$$x+y$$\n")) + (should (equal (org-test-parse-and-interpret "\\(x+y\\)") "\\(x+y\\)\n")) + (should (equal (org-test-parse-and-interpret "\\[x+y\\]") "\\[x+y\\]\n"))) (ert-deftest test-org-element/line-break-interpreter () "Test line break interpreter." diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el index c9b2eed89..940beeb00 100644 --- a/testing/lisp/test-ox.el +++ b/testing/lisp/test-ox.el @@ -401,16 +401,14 @@ Paragraph" ;; Clocks. (should (string-match "CLOCK: \\[2012-04-29 .* 10:45\\]" - (let ((org-clock-string "CLOCK:")) - (org-test-with-temp-text "CLOCK: [2012-04-29 sun. 10:45]" - (org-export-as (org-test-default-backend) - nil nil nil '(:with-clocks t)))))) + (org-test-with-temp-text "CLOCK: [2012-04-29 sun. 10:45]" + (org-export-as (org-test-default-backend) + nil nil nil '(:with-clocks t))))) (should (equal "" - (let ((org-clock-string "CLOCK:")) - (org-test-with-temp-text "CLOCK: [2012-04-29 sun. 10:45]" - (org-export-as (org-test-default-backend) - nil nil nil '(:with-clocks nil)))))) + (org-test-with-temp-text "CLOCK: [2012-04-29 sun. 10:45]" + (org-export-as (org-test-default-backend) + nil nil nil '(:with-clocks nil))))) ;; Drawers. (should (equal "" From a3d7cdcd9e76fa0346c098b473ee5d53b839745b Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sun, 17 Nov 2013 08:46:50 +0100 Subject: [PATCH 3/6] Fix version for org-(export-with|use)-sub-superscript * ox.el (org-export-with-sub-superscripts): * org.el (org-use-sub-superscripts): Fix version and enhance docstring again. --- lisp/org.el | 9 ++++++--- lisp/ox.el | 8 ++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 50d44c39d..2781c677c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -655,8 +655,10 @@ the following lines anywhere in the buffer: (defcustom org-use-sub-superscripts t "Non-nil means interpret \"_\" and \"^\" for display. -If you want to control how Org exports those characters, -see `org-export-with-sub-superscripts'. +If you want to control how Org exports those characters, see +`org-export-with-sub-superscripts'. `org-use-sub-superscripts' +used to be an alias for `org-export-with-sub-superscripts' in +Org <8.0, it is not anymore. When this option is turned on, you can use TeX-like syntax for sub- and superscripts within the buffer. Several characters after @@ -676,7 +678,8 @@ the braces are *required* in order to trigger interpretations as sub/superscript. This can be helpful in documents that need \"_\" frequently in plain text." :group 'org-startup - :version "24.1" + :version "24.4" + :package-version '(Org . "8.0") :type '(choice (const :tag "Always interpret" t) (const :tag "Only with braces" {}) diff --git a/lisp/ox.el b/lisp/ox.el index 22fe8f99f..c5f369924 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -626,8 +626,10 @@ e.g. \"stat:nil\"" (defcustom org-export-with-sub-superscripts t "Non-nil means interpret \"_\" and \"^\" for export. -If you want to control how Org displays those characters, -see `org-use-sub-superscripts'. +If you want to control how Org displays those characters, see +`org-use-sub-superscripts'. `org-export-with-sub-superscripts' +used to be an alias for `org-use-sub-superscripts' in Org <8.0, +it is not anymore. When this option is turned on, you can use TeX-like syntax for sub- and superscripts and see them exported correctly. @@ -651,6 +653,8 @@ the braces are *required* in order to trigger interpretations as sub/superscript. This can be helpful in documents that need \"_\" frequently in plain text." :group 'org-export-general + :version "24.4" + :package-version '(Org . "8.0") :type '(choice (const :tag "Interpret them" t) (const :tag "Curly brackets only" {}) From a6210cc9c24a8f6c2037650e07c2d26ea5a3ab33 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sun, 17 Nov 2013 09:12:41 +0100 Subject: [PATCH 4/6] Backport Paul's fixes from Emacs trunk (1/2) See http://article.gmane.org/gmane.emacs.diffs/123123 --- doc/org.texi | 42 +++++++++++++++++++++--------------------- etc/ORG-NEWS | 16 ++++++++-------- lisp/ob-core.el | 2 +- lisp/ob-python.el | 10 +++++----- lisp/org-agenda.el | 2 +- lisp/org-bibtex.el | 2 +- lisp/org-clock.el | 2 +- lisp/org-src.el | 2 +- lisp/org-table.el | 4 ++-- lisp/ox-ascii.el | 6 +++--- lisp/ox-html.el | 4 ++-- lisp/ox-latex.el | 10 +++++----- lisp/ox-md.el | 2 +- lisp/ox-odt.el | 29 ++++++++++++++--------------- lisp/ox-texinfo.el | 10 +++++----- lisp/ox.el | 8 ++++---- 16 files changed, 75 insertions(+), 76 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index 94f7ac30a..210eabb26 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -689,7 +689,7 @@ Using header arguments * System-wide header arguments:: Set global default values * Language-specific header arguments:: Set default values by language * Header arguments in Org mode properties:: Set default values for a buffer or heading -* Language-specific header arguments in Org mode properties:: Set langugage-specific default values for a buffer or heading +* Language-specific header arguments in Org mode properties:: Set language-specific default values for a buffer or heading * Code block specific header arguments:: The most common way to set values * Header arguments in function calls:: The most specific level @@ -3875,7 +3875,7 @@ Jump to line 255. Search for a link target @samp{<>}, or do a text search for @samp{my target}, similar to the search in internal links, see @ref{Internal links}. In HTML export (@pxref{HTML export}), such a file -link will become a HTML reference to the corresponding named anchor in +link will become an HTML reference to the corresponding named anchor in the linked file. @item *My Target In an Org file, restrict search to headlines. @@ -8056,7 +8056,7 @@ You may also test for properties (@pxref{Properties and Columns}) at the same time as matching tags. The properties may be real properties, or special properties that represent other metadata (@pxref{Special properties}). For example, the ``property'' @code{TODO} represents the TODO keyword of the -entry and the ``propety'' @code{PRIORITY} represents the PRIORITY keyword of +entry and the ``property'' @code{PRIORITY} represents the PRIORITY keyword of the entry. The ITEM special property cannot currently be used in tags/property searches@footnote{But @pxref{x-agenda-skip-entry-regexp, ,skipping entries based on regexp}.}. @@ -8548,7 +8548,7 @@ Limit the number of tagged entries. @end table When set to a positive integer, each option will exclude entries from other -catogories: for example, @code{(setq org-agenda-max-effort 100)} will limit +categories: for example, @code{(setq org-agenda-max-effort 100)} will limit the agenda to 100 minutes of effort and exclude any entry that as no effort property. If you want to include entries with no effort property, use a negative value for @code{org-agenda-max-effort}. @@ -9633,7 +9633,7 @@ or on a per-file basis with a line like @end example If you would like to move the table of contents to a different location, you -should turn off the detault table using @code{org-export-with-toc} or +should turn off the default table using @code{org-export-with-toc} or @code{#+OPTIONS} and insert @code{#+TOC: headlines N} at the desired location(s). @@ -10857,7 +10857,7 @@ recognized. See @ref{@LaTeX{} and PDF export} for more information. @cindex #+BEAMER_INNER_THEME @cindex #+BEAMER_OUTER_THEME Beamer export introduces a number of keywords to insert code in the -document's header. Four control appearance of the presentantion: +document's header. Four control appearance of the presentation: @code{#+BEAMER_THEME}, @code{#+BEAMER_COLOR_THEME}, @code{#+BEAMER_FONT_THEME}, @code{#+BEAMER_INNER_THEME} and @code{#+BEAMER_OUTER_THEME}. All of them accept optional arguments @@ -10976,7 +10976,7 @@ Here is a simple example Org document that is intended for Beamer export. @section HTML export @cindex HTML export -Org mode contains a HTML (XHTML 1.0 strict) exporter with extensive +Org mode contains an HTML (XHTML 1.0 strict) exporter with extensive HTML formatting, in ways similar to John Gruber's @emph{markdown} language, but with additional support for tables. @@ -10999,11 +10999,11 @@ language, but with additional support for tables. @table @kbd @orgcmd{C-c C-e h h,org-html-export-to-html} -Export as a HTML file. For an Org file @file{myfile.org}, +Export as an HTML file. For an Org file @file{myfile.org}, the HTML file will be @file{myfile.html}. The file will be overwritten without warning. @kbd{C-c C-e h o} -Export as a HTML file and immediately open it with a browser. +Export as an HTML file and immediately open it with a browser. @orgcmd{C-c C-e h H,org-html-export-as-html} Export to a temporary buffer. Do not create a file. @end table @@ -11030,7 +11030,7 @@ Export to a temporary buffer. Do not create a file. Org can export to various (X)HTML flavors. Setting the variable @code{org-html-doctype} allows you to export to different -(X)HTML variants. The exported HTML will be adjusted according to the sytax +(X)HTML variants. The exported HTML will be adjusted according to the syntax requirements of that variant. You can either set this variable to a doctype string directly, in which case the exporter will try to adjust the syntax automatically, or you can use a ready-made doctype. The ready-made options @@ -11177,7 +11177,7 @@ includes automatic links created by radio targets (@pxref{Radio targets}). Links to external files will still work if the target file is on the same @i{relative} path as the published Org file. Links to other @file{.org} files will be translated into HTML links under the assumption -that a HTML version also exists of the linked file, at the same relative +that an HTML version also exists of the linked file, at the same relative path. @samp{id:} links can then be used to jump to specific entries across files. For information related to linking files while publishing them to a publishing directory see @ref{Publishing links}. @@ -11774,10 +11774,10 @@ attribute. You may set it to: @code{t}: if you want to make the source block a float. It is the default value when a caption is provided. @item -@code{mulicolumn}: if you wish to include a source block which spans multiple -colums in a page. +@code{multicolumn}: if you wish to include a source block which spans multiple +columns in a page. @item -@code{nil}: if you need to avoid any floating evironment, even when a caption +@code{nil}: if you need to avoid any floating environment, even when a caption is provided. It is useful for source code that may not fit in a single page. @end itemize @@ -11839,7 +11839,7 @@ respectively, @code{:width} and @code{:thickness} attributes: @section Markdown export @cindex Markdown export -@code{md} export back-end generates Markdown syntax@footnote{Vanilla flavour, +@code{md} export back-end generates Markdown syntax@footnote{Vanilla flavor, as defined at @url{http://daringfireball.net/projects/markdown/}.} for an Org mode buffer. @@ -12862,7 +12862,7 @@ you are using. The FAQ covers this issue. @cindex export back-ends, built-in @vindex org-export-backends -On top of the aforemetioned back-ends, Org comes with other built-in ones: +On top of the aforementioned back-ends, Org comes with other built-in ones: @itemize @item @file{ox-man.el}: export to a man page. @@ -12895,8 +12895,8 @@ Convert the selected region into @code{Texinfo}. Convert the selected region into @code{MarkDown}. @end table -This is particularily useful for converting tables and lists in foreign -buffers. E.g., in a HTML buffer, you can turn on @code{orgstruct-mode}, then +This is particularly useful for converting tables and lists in foreign +buffers. E.g., in an HTML buffer, you can turn on @code{orgstruct-mode}, then use Org commands for editing a list, and finally select and convert the list with @code{M-x org-html-convert-region-to-html RET}. @@ -17274,8 +17274,8 @@ to become slow. Below are some tips on how to speed up the agenda commands. @enumerate @item -Reduce the number of Org agenda files: this will reduce the slowliness caused -by accessing to a hard drive. +Reduce the number of Org agenda files: this will reduce the slowness caused +by accessing a hard drive. @item Reduce the number of DONE and archived headlines: this way the agenda does not need to skip them. @@ -17913,7 +17913,7 @@ inspired some of the early development, including HTML export. He also asked for a way to narrow wide table columns. @item @i{Jason Dunsmore} has been maintaining the Org-Mode server at Rackspace for -several years now. He also sponsered the hosting costs until Rackspace +several years now. He also sponsored the hosting costs until Rackspace started to host us for free. @item @i{Thomas S. Dye} contributed documentation on Worg and helped integrating diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 15e6a0650..2f9d156ae 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -101,7 +101,7 @@ of the list. Add support for ell, imath, jmath, varphi, varpi, aleph, gimel, beth, dalet, cdots, S (§), dag, ddag, colon, therefore, because, triangleq, leq, geq, lessgtr, lesseqgtr, ll, lll, gg, ggg, prec, preceq, -preccurleyeq, succ, succeq, succurleyeq, setminus, nexist(s), mho, +preccurlyeq, succ, succeq, succurlyeq, setminus, nexist(s), mho, check, frown, diamond. Changes loz, vert, checkmark, smile and tilde. *** Anonymous export back-ends @@ -146,7 +146,7 @@ This makes java executable configurable for ditaa blocks. This enables SVG generation from latex code blocks. -*** New option: [[doc:org-habit-show-done-alwyays-green][org-habit-show-done-alwyays-green]] +*** New option: [[doc:org-habit-show-done-always-green][org-habit-show-done-always-green]] See [[http://lists.gnu.org/archive/html/emacs-orgmode/2013-05/msg00214.html][this message]] from Max Mikhanosha. @@ -277,8 +277,8 @@ manual for details and check [[http://orgmode.org/worg/org-8.0.html][this Worg p moved some contributions into the =contrib/= directory. The rationale for deciding that these files should live in =contrib/= - is either because they rely on third-part softwares that are not - included in Emacs, or because they are not targetting a significant + is either because they rely on third-party software that is not + included in Emacs, or because they are not targeting a significant user-base. - org-colview-xemacs.el @@ -395,7 +395,7 @@ Among the new/updated export options, three are of particular importance: - [[doc:org-export-allow-bind-keywords][org-export-allow-bind-keywords]] :: This option replaces the old option =org-export-allow-BIND= and the default value is =nil=, not =confirm=. - You will need to explicitely set this to =t= in your initialization + You will need to explicitly set this to =t= in your initialization file if you want to allow =#+BIND= keywords. - [[doc:org-export-with-planning][org-export-with-planning]] :: This new option controls the export of @@ -654,7 +654,7 @@ headlines and their content (but not subheadings) into the new file. This is useful when you want to quickly share an agenda containing the full list of notes. -**** New commands to drag an agenda line forward (=M-=) or backard (=M-=) +**** New commands to drag an agenda line forward (=M-=) or backward (=M-=) It sometimes handy to move agenda lines around, just to quickly reorganize your tasks, or maybe before saving the agenda to a file. Now you can use @@ -717,7 +717,7 @@ string is important to keep the agenda alignment clean. When [[doc:org-agenda-skip-scheduled-if-deadline-is-shown][org-agenda-skip-scheduled-if-deadline-is-shown]] is set to =repeated-after-deadline=, the agenda will skip scheduled items if they are -repeated beyond the current dealine. +repeated beyond the current deadline. **** New option for [[doc:org-agenda-skip-deadline-prewarning-if-scheduled][org-agenda-skip-deadline-prewarning-if-scheduled]] @@ -757,7 +757,7 @@ check against the name of the buffer. Using =#+TAGS: { Tag1 : Tag2 Tag3 }= will define =Tag1= as a /group tag/ (note the colon after =Tag1=). If you search for =Tag1=, it will return -headlines containing either =Tag1=, =Tag2= or =Tag3= (or any combinaison +headlines containing either =Tag1=, =Tag2= or =Tag3= (or any combination of those tags.) You can use group tags for sparse tree in an Org buffer, for creating diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 0ec945d6a..84caed7ea 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -318,7 +318,7 @@ Do not query the user." (message (format "Evaluation of this%scode-block%sis disabled." code-block block-name)))))) - ;; dynamically scoped for asynchroneous export + ;; dynamically scoped for asynchronous export (defvar org-babel-confirm-evaluate-answer-no) (defsubst org-babel-confirm-evaluate (info) diff --git a/lisp/ob-python.el b/lisp/ob-python.el index 2f91b535f..3c3f66468 100644 --- a/lisp/ob-python.el +++ b/lisp/ob-python.el @@ -156,14 +156,14 @@ Emacs-lisp table, otherwise return the results as a string." "Return the buffer associated with SESSION." (cdr (assoc session org-babel-python-buffers))) -(defun org-babel-python-with-earmufs (session) +(defun org-babel-python-with-earmuffs (session) (let ((name (if (stringp session) session (format "%s" session)))) (if (and (string= "*" (substring name 0 1)) (string= "*" (substring name (- (length name) 1)))) name (format "*%s*" name)))) -(defun org-babel-python-without-earmufs (session) +(defun org-babel-python-without-earmuffs (session) (let ((name (if (stringp session) session (format "%s" session)))) (if (and (string= "*" (substring name 0 1)) (string= "*" (substring name (- (length name) 1)))) @@ -190,9 +190,9 @@ then create. Return the initialized session." (if (not (version< "24.1" emacs-version)) (run-python cmd) (unless python-buffer - (setq python-buffer (org-babel-python-with-earmufs session))) + (setq python-buffer (org-babel-python-with-earmuffs session))) (let ((python-shell-buffer-name - (org-babel-python-without-earmufs python-buffer))) + (org-babel-python-without-earmuffs python-buffer))) (run-python cmd)))) ((and (eq 'python-mode org-babel-python-mode) (fboundp 'py-shell)) ; python-mode.el @@ -208,7 +208,7 @@ then create. Return the initialized session." (concat "Python-" (symbol-name session)))) (py-which-bufname bufname)) (py-shell) - (setq python-buffer (org-babel-python-with-earmufs bufname)))) + (setq python-buffer (org-babel-python-with-earmuffs bufname)))) (t (error "No function available for running an inferior Python"))) (setq org-babel-python-buffers diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 8bf122dbd..4dfa3e9e3 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -863,7 +863,7 @@ When set to the symbol `not-today', skip scheduled previously, but not scheduled today. When set to the symbol `repeated-after-deadline', skip scheduled -items if they are repeated beyond the current dealine." +items if they are repeated beyond the current deadline." :group 'org-agenda-skip :group 'org-agenda-daily/weekly :type '(choice diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el index 526439948..def9340e4 100644 --- a/lisp/org-bibtex.el +++ b/lisp/org-bibtex.el @@ -44,7 +44,7 @@ ;; Here is an example of a capture template that use some of this ;; information (:author :year :title :journal :pages): ;; -;; (setq org-capure-templates +;; (setq org-capture-templates ;; '((?b "* READ %?\n\n%a\n\n%:author (%:year): %:title\n \ ;; In %:journal, %:pages."))) ;; diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 2340ffc7c..3238c8ca9 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -667,7 +667,7 @@ previous clocking intervals." VALUE can be a number of minutes, or a string with format hh:mm or mm. When the string starts with a + or a - sign, the current value of the effort property will be changed by that amount. If the effort value is expressed -as an `org-effort-durations' (e.g. \"3h\"), the modificied value will be +as an `org-effort-durations' (e.g. \"3h\"), the modified value will be converted to a hh:mm duration. This command will update the \"Effort\" property of the currently diff --git a/lisp/org-src.el b/lisp/org-src.el index 99038576f..259186c0c 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -69,7 +69,7 @@ there are kept outside the narrowed region." This will save the content of the source code editing buffer into a newly created file, not the base buffer for this source block. -If you want to regularily save the base buffer instead of the source +If you want to regularly save the base buffer instead of the source code editing buffer, see `org-edit-src-auto-save-idle-delay' instead." :group 'org-edit-structure :version "24.4" diff --git a/lisp/org-table.el b/lisp/org-table.el index c191345e5..fa66ed0a1 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -97,11 +97,11 @@ this variable requires a restart of Emacs to become effective." Each template must define lines that will be treated as a comment and that must contain the \"BEGIN RECEIVE ORGTBL %n\" and \"END RECEIVE ORGTBL\" lines where \"%n\" will be replaced with the name of the table during -insertion of the tempate. The transformed table will later be inserted +insertion of the template. The transformed table will later be inserted between these lines. The template should also contain a minimal table in a multiline comment. -If multiline comments are not possible in the buffer language, +If multiline comments are not possible in the buffer language, you can pack it into a string that will not be used when the code is compiled or executed. Above the table will you need a line with the fixed string \"#+ORGTBL: SEND\", followed by instruction on how to diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el index b2a38d55f..55bda8368 100644 --- a/lisp/ox-ascii.el +++ b/lisp/ox-ascii.el @@ -459,7 +459,7 @@ Empty lines are not indented." (defun org-ascii--box-string (s info) "Return string S with a partial box to its left. -INFO is a plist used as a communicaton channel." +INFO is a plist used as a communication channel." (let ((utf8p (eq (plist-get info :ascii-charset) 'utf-8))) (format (if utf8p "╭────\n%s\n╰────" ",----\n%s\n`----") (replace-regexp-in-string @@ -680,7 +680,7 @@ generation. INFO is a plist used as a communication channel." (let ((text-width (if keyword (org-ascii--current-text-width keyword info) (- org-ascii-text-width org-ascii-global-margin))) - ;; Use a counter instead of retreiving ordinal of each + ;; Use a counter instead of retrieving ordinal of each ;; src-block. (count 0)) (mapconcat @@ -718,7 +718,7 @@ generation. INFO is a plist used as a communication channel." (let ((text-width (if keyword (org-ascii--current-text-width keyword info) (- org-ascii-text-width org-ascii-global-margin))) - ;; Use a counter instead of retreiving ordinal of each + ;; Use a counter instead of retrieving ordinal of each ;; src-block. (count 0)) (mapconcat diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 5f3879150..7edbf2ca4 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -153,7 +153,7 @@ \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">") ("xhtml-transitional" . "") - ("xhtml-framset" . "") ("xhtml-11" . "") @@ -3078,7 +3078,7 @@ CONTENTS is the contents of the object. INFO is a plist holding contextual information." (format "%s" contents)) -;;;; Tabel Cell +;;;; Table Cell (defun org-html-table-cell (table-cell contents info) "Transcode a TABLE-CELL element from Org to HTML. diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 014ed266a..3609881b6 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1319,13 +1319,13 @@ holding contextual information." (let* ((class (plist-get info :latex-class)) (level (org-export-get-relative-level headline info)) (numberedp (org-export-numbered-headline-p headline info)) - (class-sectionning (assoc class org-latex-classes)) + (class-sectioning (assoc class org-latex-classes)) ;; Section formatting will set two placeholders: one for ;; the title and the other for the contents. (section-fmt - (let ((sec (if (functionp (nth 2 class-sectionning)) - (funcall (nth 2 class-sectionning) level numberedp) - (nth (1+ level) class-sectionning)))) + (let ((sec (if (functionp (nth 2 class-sectioning)) + (funcall (nth 2 class-sectioning) level numberedp) + (nth (1+ level) class-sectioning)))) (cond ;; No section available for that LEVEL. ((not sec) nil) @@ -1616,7 +1616,7 @@ CONTENTS is nil. INFO is a plist holding contextual information." (value (org-remove-indentation (org-element-property :value latex-environment)))) (if (not (org-string-nw-p label)) value - ;; Environment is labelled: label must be within the environment + ;; Environment is labeled: label must be within the environment ;; (otherwise, a reference pointing to that element will count ;; the section instead). (with-temp-buffer diff --git a/lisp/ox-md.el b/lisp/ox-md.el index 811c4e580..78420170b 100644 --- a/lisp/ox-md.el +++ b/lisp/ox-md.el @@ -22,7 +22,7 @@ ;;; Commentary: -;; This library implements a Markdown back-end (vanilla flavour) for +;; This library implements a Markdown back-end (vanilla flavor) for ;; Org exporter, based on `html' back-end. See Org manual for more ;; information. diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el index 99c1353ce..975dbdb9f 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -597,7 +597,7 @@ INPUT-FMT-LIST in to a single class. Note that this variable inherently captures how LibreOffice based converters work. LibreOffice maps documents of various formats to classes like Text, Web, Spreadsheet, Presentation etc and -allow document of a given class (irrespective of it's source +allow document of a given class (irrespective of its source format) to be converted to any of the export formats associated with that class. @@ -920,7 +920,7 @@ Specifically, locale-dependent specifiers like \"%c\", \"%x\" are formatted as canonical Org timestamps. For finer control, avoid these %-specifiers. -Textutal specifiers like \"%b\", \"%h\", \"%B\", \"%a\", \"%A\" +Textual specifiers like \"%b\", \"%h\", \"%B\", \"%a\", \"%A\" etc., are displayed by the application in the default language and country specified in `org-odt-styles-file'. Note that the default styles file uses language \"en\" and country \"GB\". You @@ -1439,7 +1439,7 @@ original parsed data. INFO is a plist holding export options." ;; Update content.xml. (let* ( ;; `org-display-custom-times' should be accessed right - ;; within the context of the Org buffer. So obtain it's + ;; within the context of the Org buffer. So obtain its ;; value before moving on to temp-buffer context down below. (custom-time-fmts (if org-display-custom-times @@ -1720,7 +1720,7 @@ CONTENTS is nil. INFO is a plist holding contextual information." (and (eq (org-element-type prev) 'footnote-reference) (format "%s" "OrgSuperscript" ","))) - ;; Trancode footnote reference. + ;; Transcode footnote reference. (let ((n (org-export-get-footnote-number footnote-reference info))) (cond ((not (org-export-footnote-first-reference-p footnote-reference info)) @@ -2194,7 +2194,7 @@ SHORT-CAPTION are strings." (concat ;; Sneak in a bookmark. The bookmark is used when the ;; labeled element is referenced with a link that - ;; provides it's own description. + ;; provides its own description. (format "\n" label) ;; Label definition: Typically formatted as below: ;; CATEGORY SEQ-NO: LONG CAPTION @@ -2341,7 +2341,6 @@ used as a communication channel." (user-frame-params (list user-frame-style user-frame-attrs user-frame-anchor)) ;; (embed-as (or embed-as user-frame-anchor "paragraph")) - ;; extrac ;; ;; Handle `:width', `:height' and `:scale' properties. Read ;; them as numbers since we need them for computations. @@ -2371,7 +2370,7 @@ used as a communication channel." (title (and replaces (capitalize (symbol-name (org-element-type replaces))))) - ;; If yes, note down it's contents. It will go in to frame + ;; If yes, note down its contents. It will go in to frame ;; description. This quite useful for debugging. (desc (and replaces (org-element-property :value replaces)))) (org-odt--render-image/formula entity href width height @@ -2409,7 +2408,7 @@ used as a communication channel." (title (and replaces (capitalize (symbol-name (org-element-type replaces))))) - ;; If yes, note down it's contents. It will go in to frame + ;; If yes, note down its contents. It will go in to frame ;; description. This quite useful for debugging. (desc (and replaces (org-element-property :value replaces))) width height) @@ -2613,12 +2612,12 @@ used as a communication channel." INFO is a plist holding contextual information. Return non-nil, if ELEMENT is of type paragraph satisfying -PARAGRAPH-PREDICATE and it's sole content, save for whitespaces, +PARAGRAPH-PREDICATE and its sole content, save for whitespaces, is a link that satisfies LINK-PREDICATE. Return non-nil, if ELEMENT is of type link satisfying -LINK-PREDICATE and it's containing paragraph satisfies -PARAGRAPH-PREDICATE inaddtion to having no other content save for +LINK-PREDICATE and its containing paragraph satisfies +PARAGRAPH-PREDICATE in addition to having no other content save for leading and trailing whitespaces. Return nil, otherwise." @@ -2707,7 +2706,7 @@ Return nil, otherwise." (concat (number-to-string n) "."))) item-numbers ""))))) ;; Case 2: Locate a regular and numbered headline in the - ;; hierarchy. Display it's section number. + ;; hierarchy. Display its section number. (let ((headline (loop for el in (cons destination genealogy) when (and (eq (org-element-type el) 'headline) (not (org-export-low-level-p el info)) @@ -2720,7 +2719,7 @@ Return nil, otherwise." (mapconcat 'number-to-string (org-export-get-headline-number headline info) ".")))) ;; Case 4: Locate a regular headline in the hierarchy. Display - ;; it's title. + ;; its title. (let ((headline (loop for el in (cons destination genealogy) when (and (eq (org-element-type el) 'headline) (not (org-export-low-level-p el info))) @@ -3100,9 +3099,9 @@ holding contextual information." (defun org-odt-hfy-face-to-css (fn) "Create custom style for face FN. -When FN is the default face, use it's foreground and background +When FN is the default face, use its foreground and background properties to create \"OrgSrcBlock\" paragraph style. Otherwise -use it's color attribute to create a character style whose name +use its color attribute to create a character style whose name is obtained from FN. Currently all attributes of FN other than color are ignored. diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 0df660da2..43c1de215 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -957,7 +957,7 @@ holding contextual information." (let* ((class (plist-get info :texinfo-class)) (level (org-export-get-relative-level headline info)) (numberedp (org-export-numbered-headline-p headline info)) - (class-sectionning (assoc class org-texinfo-classes)) + (class-sectioning (assoc class org-texinfo-classes)) ;; Find the index type, if any (index (org-element-property :INDEX headline)) ;; Check if it is an appendix @@ -993,10 +993,10 @@ holding contextual information." ;; Section formatting will set two placeholders: one for the ;; title and the other for the contents. (section-fmt - (let ((sec (if (and (symbolp (nth 2 class-sectionning)) - (fboundp (nth 2 class-sectionning))) - (funcall (nth 2 class-sectionning) level numberedp) - (nth (1+ level) class-sectionning)))) + (let ((sec (if (and (symbolp (nth 2 class-sectioning)) + (fboundp (nth 2 class-sectioning))) + (funcall (nth 2 class-sectioning) level numberedp) + (nth (1+ level) class-sectioning)))) (cond ;; No section available for that LEVEL. ((not sec) nil) diff --git a/lisp/ox.el b/lisp/ox.el index c5f369924..8316ef26e 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -2870,7 +2870,7 @@ The copy will preserve local variables, visibility, contents and narrowing of the original buffer. If a region was active in BUFFER, contents will be narrowed to that region instead. -The resulting function can be evaled at a later time, from +The resulting function can be evaluated at a later time, from another buffer, effectively cloning the original buffer there. The function assumes BUFFER's major mode is `org-mode'." @@ -4682,7 +4682,7 @@ INFO is a plist used as a communication channel." "Return TABLE-ROW number. INFO is a plist used as a communication channel. Return value is zero-based and ignores separators. The function returns nil for -special colums and separators." +special columns and separators." (when (and (eq (org-element-property :type table-row) 'standard) (not (org-export-table-row-is-special-p table-row info))) (let ((number 0)) @@ -5874,7 +5874,7 @@ files or buffers, only the display. "Export dispatcher for Org mode. It provides an access to common export related tasks in a buffer. -Its interface comes in two flavours: standard and expert. +Its interface comes in two flavors: standard and expert. While both share the same set of bindings, only the former displays the valid keys associations in a dedicated buffer. @@ -5882,7 +5882,7 @@ Scrolling (resp. line-wise motion) in this buffer is done with SPC and DEL (resp. C-n and C-p) keys. Set variable `org-export-dispatch-use-expert-ui' to switch to one -flavour or the other. +flavor or the other. When ARG is \\[universal-argument], repeat the last export action, with the same set of options used back then, on the current buffer. From 4e798549fea189393f74583371809ab13e884b86 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sun, 17 Nov 2013 09:15:25 +0100 Subject: [PATCH 5/6] Backport Paul's fixes from Emacs trunk (2/2) See http://article.gmane.org/gmane.emacs.diffs/123123 --- lisp/org.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 2781c677c..f47caa11a 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -720,7 +720,7 @@ the following lines anywhere in the buffer: "Non-nil means preview LaTeX fragments when loading a new Org file. This can also be configured on a per-file basis by adding one of -the followinglines anywhere in the buffer: +the following lines anywhere in the buffer: #+STARTUP: latexpreview #+STARTUP: nolatexpreview" :group 'org-startup @@ -1044,7 +1044,7 @@ commands in the Help buffer using the `?' speed command." :last-refile "org-refile-last-stored" :last-capture-marker "org-capture-last-stored-marker") "Names for bookmarks automatically set by some Org commands. -This can provide strings as names for a number of bookmakrs Org sets +This can provide strings as names for a number of bookmarks Org sets automatically. The following keys are currently implemented: :last-capture :last-capture-marker @@ -19521,7 +19521,7 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command names." "Transpose words for Org. This uses the `org-mode-transpose-word-syntax-table' syntax table, which interprets characters in `org-emphasis-alist' as -word constituants." +word constituents." (interactive) (with-syntax-table org-mode-transpose-word-syntax-table (call-interactively 'transpose-words))) @@ -21127,7 +21127,7 @@ With prefix arg UNCOMPILED, load the uncompiled versions." (message "The following feature%s found in load-path, please check if that's correct:\n%s" (if (> (length load-uncore) 1) "s were" " was") load-uncore)) (if load-misses - (message "Some error occured while reloading Org feature%s\n%s\nPlease check *Messages*!\n%s" + (message "Some error occurred while reloading Org feature%s\n%s\nPlease check *Messages*!\n%s" (if (> (length load-misses) 1) "s" "") load-misses (org-version nil 'full)) (message "Successfully reloaded Org\n%s" (org-version nil 'full))))) From 36c8d8b4d22007e2d24104c31e3a76de83095b53 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 17 Nov 2013 09:52:54 +0100 Subject: [PATCH 6/6] org-footnote: Fix dual `org-load-hook' run * lisp/org-footnote.el (org-footnote-section): Do not require `org-element' when initializing the variable, since `org' is not provided yet. --- lisp/org-footnote.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el index e80f36fde..f4c9273b4 100644 --- a/lisp/org-footnote.el +++ b/lisp/org-footnote.el @@ -113,7 +113,7 @@ you will need to run the following command after the change: \\[universal-argument] \\[org-element-cache-reset]" :group 'org-footnote - :initialize 'custom-initialize-set + :initialize 'custom-initialize-default :set (lambda (var val) (set var val) (when (fboundp 'org-element-cache-reset)