diff options
author | Sebastien Delafond <seb@debian.org> | 2014-06-21 11:08:09 +0200 |
---|---|---|
committer | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:35 +0200 |
commit | 0a60a1ae5b73c4569a4bdfdd56a3eeb3fbc0b3dc (patch) | |
tree | 0e277c1c07e8d47b85bbc3c996febb70da50dfde /lisp | |
parent | 2d3359e41007641d7a8e5b088d9286aef64d99e7 (diff) | |
parent | 361fd4da7cfa870165cb1ec175cdbea55ca40e7e (diff) |
Imported Debian patch 8.2.7a-1
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ob-C.el | 2 | ||||
-rw-r--r-- | lisp/ob-R.el | 11 | ||||
-rw-r--r-- | lisp/ob-core.el | 9 | ||||
-rw-r--r-- | lisp/ob-exp.el | 1 | ||||
-rw-r--r-- | lisp/ob-haskell.el | 1 | ||||
-rw-r--r-- | lisp/ob-python.el | 2 | ||||
-rw-r--r-- | lisp/ob-screen.el | 4 | ||||
-rw-r--r-- | lisp/ob-tangle.el | 13 | ||||
-rw-r--r-- | lisp/org-agenda.el | 391 | ||||
-rw-r--r-- | lisp/org-attach.el | 4 | ||||
-rw-r--r-- | lisp/org-bbdb.el | 7 | ||||
-rw-r--r-- | lisp/org-capture.el | 6 | ||||
-rw-r--r-- | lisp/org-compat.el | 17 | ||||
-rw-r--r-- | lisp/org-element.el | 2 | ||||
-rw-r--r-- | lisp/org-entities.el | 6 | ||||
-rw-r--r-- | lisp/org-habit.el | 13 | ||||
-rw-r--r-- | lisp/org-list.el | 2 | ||||
-rw-r--r-- | lisp/org-loaddefs.el | 48 | ||||
-rw-r--r-- | lisp/org-macs.el | 6 | ||||
-rw-r--r-- | lisp/org-mobile.el | 2 | ||||
-rw-r--r-- | lisp/org-mouse.el | 13 | ||||
-rw-r--r-- | lisp/org-table.el | 8 | ||||
-rw-r--r-- | lisp/org-timer.el | 5 | ||||
-rw-r--r-- | lisp/org-version.el | 4 | ||||
-rw-r--r-- | lisp/org.el | 180 | ||||
-rw-r--r-- | lisp/ox-ascii.el | 30 | ||||
-rw-r--r-- | lisp/ox-beamer.el | 1 | ||||
-rw-r--r-- | lisp/ox-html.el | 39 | ||||
-rw-r--r-- | lisp/ox-icalendar.el | 35 | ||||
-rw-r--r-- | lisp/ox-latex.el | 21 | ||||
-rw-r--r-- | lisp/ox-md.el | 12 | ||||
-rw-r--r-- | lisp/ox-org.el | 50 | ||||
-rw-r--r-- | lisp/ox.el | 93 |
33 files changed, 534 insertions, 504 deletions
diff --git a/lisp/ob-C.el b/lisp/ob-C.el index c460be3..2fcec79 100644 --- a/lisp/ob-C.el +++ b/lisp/ob-C.el @@ -30,6 +30,8 @@ ;; - not much in the way of error feedback ;;; Code: +(eval-when-compile + (require 'cl)) (require 'ob) (require 'cc-mode) diff --git a/lisp/ob-R.el b/lisp/ob-R.el index 93d6fe2..b97fd91 100644 --- a/lisp/ob-R.el +++ b/lisp/ob-R.el @@ -173,12 +173,11 @@ This function is called by `org-babel-execute-src-block'." (defun org-babel-R-assign-elisp (name value colnames-p rownames-p) "Construct R code assigning the elisp VALUE to a variable named NAME." (if (listp value) - (let ((max (apply #'max (mapcar #'length (org-remove-if-not - #'sequencep value)))) - (min (apply #'min (mapcar #'length (org-remove-if-not - #'sequencep value)))) - (transition-file (org-babel-temp-file "R-import-"))) - ;; ensure VALUE has an orgtbl structure (depth of at least 2) + (let* ((lengths (mapcar 'length (org-remove-if-not 'sequencep value))) + (max (if lengths (apply 'max lengths) 0)) + (min (if lengths (apply 'min lengths) 0)) + (transition-file (org-babel-temp-file "R-import-"))) + ;; Ensure VALUE has an orgtbl structure (depth of at least 2). (unless (listp (car value)) (setq value (list value))) (with-temp-file transition-file (insert diff --git a/lisp/ob-core.el b/lisp/ob-core.el index e8943c6..eef408f 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -38,6 +38,7 @@ (defvar org-src-lang-modes) (defvar org-babel-library-of-babel) (declare-function show-all "outline" ()) +(declare-function org-every "org" (pred seq)) (declare-function org-reduce "org" (CL-FUNC CL-SEQ &rest CL-KEYS)) (declare-function org-mark-ring-push "org" (&optional pos buffer)) (declare-function tramp-compat-make-temp-file "tramp-compat" @@ -1348,7 +1349,7 @@ specified in the properties of the current outline entry." (org-entry-get org-babel-current-src-block-location (concat "header-args:" lang) 'inherit)))))) -(defvar org-src-preserve-indentation) +(defvar org-src-preserve-indentation) ;; declare defcustom from org-src (defun org-babel-parse-src-block-match () "Parse the results from a match of the `org-babel-src-block-regexp'." (let* ((block-indentation (length (match-string 1))) @@ -2100,9 +2101,9 @@ code ---- the results are extracted in the syntax of the source ((funcall proper-list-p result) (goto-char beg) (insert (concat (orgtbl-to-orgtbl - (if (or (eq 'hline (car result)) - (and (listp (car result)) - (listp (cdr (car result))))) + (if (org-every + (lambda (el) (or (listp el) (eq el 'hline))) + result) result (list result)) '(:fmt (lambda (cell) (format "%s" cell)))) "\n")) (goto-char beg) (when (org-at-table-p) (org-table-align))) diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el index 6d65496..761c9f1 100644 --- a/lisp/ob-exp.el +++ b/lisp/ob-exp.el @@ -24,6 +24,7 @@ ;;; Code: (require 'ob-core) +(require 'org-src) (eval-when-compile (require 'cl)) diff --git a/lisp/ob-haskell.el b/lisp/ob-haskell.el index 22240ad..0006670 100644 --- a/lisp/ob-haskell.el +++ b/lisp/ob-haskell.el @@ -147,7 +147,6 @@ specifying a variable of the same value." (concat "[" (mapconcat #'org-babel-haskell-var-to-haskell var ", ") "]") (format "%S" var))) -(defvar org-src-preserve-indentation) (defvar org-export-copy-to-kill-ring) (declare-function org-export-to-file "ox" (backend file diff --git a/lisp/ob-python.el b/lisp/ob-python.el index baa5764..7cee104 100644 --- a/lisp/ob-python.el +++ b/lisp/ob-python.el @@ -56,8 +56,6 @@ This will typically be either 'python or 'python-mode." :package-version '(Org . "8.0") :type 'symbol) -(defvar org-src-preserve-indentation) - (defcustom org-babel-python-hline-to "None" "Replace hlines in incoming tables with this when translating to python." :group 'org-babel diff --git a/lisp/ob-screen.el b/lisp/ob-screen.el index 2acbbeb..1d4ccdd 100644 --- a/lisp/ob-screen.el +++ b/lisp/ob-screen.el @@ -106,7 +106,7 @@ In case you want to use a different screen than one selected by your $PATH") (defun org-babel-screen-session-write-temp-file (session body) "Save BODY in a temp file that is named after SESSION." - (let ((tmpfile (concat "/tmp/screen.org-babel-session-" session))) + (let ((tmpfile (org-babel-temp-file "screen-"))) (with-temp-file tmpfile (insert body) @@ -121,7 +121,7 @@ The terminal should shortly flicker." (interactive) (let* ((session "org-babel-testing") (random-string (format "%s" (random 99999))) - (tmpfile "/tmp/org-babel-screen.test") + (tmpfile (org-babel-temp-file "ob-screen-test-")) (body (concat "echo '" random-string "' > " tmpfile "\nexit\n")) process tmp-string) (org-babel-execute:screen body org-babel-default-header-args:screen) diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index 37b2d92..3a43b42 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -225,13 +225,14 @@ used to limit the exported source code blocks by language." (concat base-name "." ext) base-name)))) (when file-name ;; Possibly create the parent directories for file. - (when (let ((m (funcall get-spec :mkdirp))) - (and m (not (string= m "no")))) - (make-directory (file-name-directory file-name) 'parents)) + (let ((m (funcall get-spec :mkdirp)) + (fnd (file-name-directory file-name))) + (and m fnd (not (string= m "no")) + (make-directory fnd 'parents))) ;; delete any old versions of file - (when (and (file-exists-p file-name) - (not (member file-name (mapcar #'car path-collector)))) - (delete-file file-name)) + (and (file-exists-p file-name) + (not (member file-name (mapcar #'car path-collector))) + (delete-file file-name)) ;; drop source-block to file (with-temp-buffer (when (fboundp lang-f) (ignore-errors (funcall lang-f))) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index e2a0629..42d62f3 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -390,32 +390,36 @@ the daily/weekly agenda, see `org-agenda-skip-function'.") (repeat :inline t :tag "Conditions for skipping" (choice :tag "Condition type" - (list :tag "Regexp matches" :inline t (const :format "" regexp) (regexp)) - (list :tag "Regexp does not match" :inline t (const :format "" notregexp) (regexp)) + (list :tag "Regexp matches" :inline t + (const :format "" 'regexp) + (regexp)) + (list :tag "Regexp does not match" :inline t + (const :format "" 'notregexp) + (regexp)) (list :tag "TODO state is" :inline t - (const todo) + (const 'todo) (choice - (const :tag "any not-done state" todo) - (const :tag "any done state" done) - (const :tag "any state" any) + (const :tag "Any not-done state" 'todo) + (const :tag "Any done state" 'done) + (const :tag "Any state" 'any) (list :tag "Keyword list" (const :format "" quote) (repeat (string :tag "Keyword"))))) (list :tag "TODO state is not" :inline t - (const nottodo) + (const 'nottodo) (choice - (const :tag "any not-done state" todo) - (const :tag "any done state" done) - (const :tag "any state" any) + (const :tag "Any not-done state" 'todo) + (const :tag "Any done state" 'done) + (const :tag "Any state" 'any) (list :tag "Keyword list" (const :format "" quote) (repeat (string :tag "Keyword"))))) - (const :tag "scheduled" scheduled) - (const :tag "not scheduled" notscheduled) - (const :tag "deadline" deadline) - (const :tag "no deadline" notdeadline) - (const :tag "timestamp" timestamp) - (const :tag "no timestamp" nottimestamp)))))) + (const :tag "scheduled" 'scheduled) + (const :tag "not scheduled" 'notscheduled) + (const :tag "deadline" 'deadline) + (const :tag "no deadline" 'notdeadline) + (const :tag "timestamp" 'timestamp) + (const :tag "no timestamp" 'nottimestamp)))))) (list :tag "Non-standard skipping condition" :value (org-agenda-skip-function) (const org-agenda-skip-function) @@ -649,7 +653,7 @@ of custom agenda commands." :tag "Org Agenda Match View" :group 'org-agenda) (defgroup org-agenda-search-view nil - "Options concerning the general tags/property/todo match agenda view." + "Options concerning the search agenda view." :tag "Org Agenda Search View" :group 'org-agenda) @@ -2092,11 +2096,9 @@ When nil, `q' will kill the single agenda buffer." org-agenda-info org-agenda-pre-window-conf org-agenda-columns-active - org-agenda-tag-filter-overlays org-agenda-tag-filter - org-agenda-cat-filter-overlays org-agenda-category-filter - org-agenda-re-filter-overlays + org-agenda-top-headline-filter org-agenda-regexp-filter org-agenda-markers org-agenda-last-search-view-search-was-boolean @@ -2158,10 +2160,11 @@ The following commands are available: nil t) (unless org-agenda-keep-modes (setq org-agenda-follow-mode org-agenda-start-with-follow-mode - org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode - org-agenda-clockreport-mode org-agenda-start-with-clockreport-mode - org-agenda-show-log org-agenda-start-with-log-mode)) - + org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode)) + (setq org-agenda-show-log org-agenda-start-with-log-mode) + (setq org-agenda-clockreport-mode org-agenda-start-with-clockreport-mode) + (add-to-invisibility-spec '(org-filtered)) + (add-to-invisibility-spec '(org-link)) (easy-menu-change '("Agenda") "Agenda Files" (append @@ -2604,7 +2607,7 @@ type." :package-version '(Org . "8.0") :group 'org-agenda-custom-commands :type '(choice (symbol :tag "No limit" nil) - (integer :tag "Max number of entries") + (integer :tag "Max number of TODOs") (repeat (cons (choice :tag "Agenda type" (const agenda) @@ -2612,7 +2615,7 @@ type." (const tags) (const search) (const timeline)) - (integer :tag "Max number of entries"))))) + (integer :tag "Max number of TODOs"))))) (defcustom org-agenda-max-tags nil "Maximum number of tagged entries to display in an agenda. @@ -2623,7 +2626,7 @@ type." :package-version '(Org . "8.0") :group 'org-agenda-custom-commands :type '(choice (symbol :tag "No limit" nil) - (integer :tag "Max number of entries") + (integer :tag "Max number of tagged entries") (repeat (cons (choice :tag "Agenda type" (const agenda) @@ -2631,7 +2634,7 @@ type." (const tags) (const search) (const timeline)) - (integer :tag "Max number of entries"))))) + (integer :tag "Max number of tagged entries"))))) (defcustom org-agenda-max-effort nil "Maximum cumulated effort duration for the agenda. @@ -2642,7 +2645,7 @@ to limit entries to in this type." :package-version '(Org . "8.0") :group 'org-agenda-custom-commands :type '(choice (symbol :tag "No limit" nil) - (integer :tag "Max number of entries") + (integer :tag "Max number of minutes") (repeat (cons (choice :tag "Agenda type" (const agenda) @@ -2650,7 +2653,7 @@ to limit entries to in this type." (const tags) (const search) (const timeline)) - (integer :tag "Max number of entries"))))) + (integer :tag "Max number of minutes"))))) (defvar org-keys nil) (defvar org-match nil) @@ -3324,19 +3327,12 @@ If AGENDA-BUFFER-NAME, use this as the buffer name for the agenda to write." (org-let (if nosettings nil org-agenda-exporter-settings) '(save-excursion (save-window-excursion - (org-agenda-mark-filtered-text) (let ((bs (copy-sequence (buffer-string))) beg content) - (org-agenda-unmark-filtered-text) (with-temp-buffer (rename-buffer org-agenda-write-buffer-name t) (set-buffer-modified-p nil) (insert bs) (org-agenda-remove-marked-text 'org-filtered) - (while (setq beg (text-property-any (point-min) (point-max) - 'org-filtered t)) - (delete-region - beg (or (next-single-property-change beg 'org-filtered) - (point-max)))) (run-hooks 'org-agenda-before-write-hook) (cond ((org-bound-and-true-p org-mobile-creating-agendas) @@ -3402,28 +3398,6 @@ If AGENDA-BUFFER-NAME, use this as the buffer name for the agenda to write." org-agenda-buffer-name))) (when open (org-open-file file))) -(defvar org-agenda-tag-filter-overlays nil) -(defvar org-agenda-cat-filter-overlays nil) -(defvar org-agenda-re-filter-overlays nil) - -(defun org-agenda-mark-filtered-text () - "Mark all text hidden by filtering with a text property." - (let ((inhibit-read-only t)) - (mapc - (lambda (o) - (when (equal (overlay-buffer o) (current-buffer)) - (put-text-property - (overlay-start o) (overlay-end o) - 'org-filtered t))) - (append org-agenda-tag-filter-overlays - org-agenda-cat-filter-overlays - org-agenda-re-filter-overlays)))) - -(defun org-agenda-unmark-filtered-text () - "Remove the filtering text property." - (let ((inhibit-read-only t)) - (remove-text-properties (point-min) (point-max) '(org-filtered t)))) - (defun org-agenda-remove-marked-text (property &optional value) "Delete all text marked with VALUE of PROPERTY. VALUE defaults to t." @@ -3432,7 +3406,7 @@ VALUE defaults to t." (while (setq beg (text-property-any (point-min) (point-max) property value)) (delete-region - beg (or (next-single-property-change beg 'org-filtered) + beg (or (next-single-property-change beg property) (point-max)))))) (defun org-agenda-add-entry-text () @@ -3557,7 +3531,6 @@ removed from the entry content. Currently only `planning' is allowed here." (defvar org-agenda-category-filter nil) (defvar org-agenda-regexp-filter nil) (defvar org-agenda-top-headline-filter nil) -(defvar org-agenda-tag-filter-while-redo nil) (defvar org-agenda-tag-filter-preset nil "A preset of the tags filter used for secondary agenda filtering. This must be a list of strings, each string must be a single tag preceded @@ -3609,10 +3582,12 @@ generating a new one." ;; does not have org variables local org-agenda-this-buffer-is-sticky)))) -(defun org-agenda-prepare-window (abuf) - "Setup agenda buffer in the window." - (let* ((awin (get-buffer-window abuf)) - wconf) +(defun org-agenda-prepare-window (abuf filter-alist) + "Setup agenda buffer in the window. +ABUF is the buffer for the agenda window. +FILTER-ALIST is an alist of filters we need to apply when +`org-agenda-persistent-filter' is non-nil." + (let* ((awin (get-buffer-window abuf)) wconf) (cond ((equal (current-buffer) abuf) nil) (awin (select-window awin)) @@ -3626,68 +3601,73 @@ generating a new one." ((equal org-agenda-window-setup 'reorganize-frame) (delete-other-windows) (org-switch-to-buffer-other-window abuf))) - ;; additional test in case agenda is invoked from within agenda - ;; buffer via elisp link + (setq org-agenda-tag-filter (cdr (assoc 'tag filter-alist))) + (setq org-agenda-category-filter (cdr (assoc 'cat filter-alist))) + (setq org-agenda-regexp-filter (cdr (assoc 're filter-alist))) + ;; Additional test in case agenda is invoked from within agenda + ;; buffer via elisp link. (unless (equal (current-buffer) abuf) (org-pop-to-buffer-same-window abuf)) (setq org-agenda-pre-window-conf (or org-agenda-pre-window-conf wconf)))) (defun org-agenda-prepare (&optional name) - (if (org-agenda-use-sticky-p) - (progn - ;; Popup existing buffer - (org-agenda-prepare-window (get-buffer org-agenda-buffer-name)) - (message "Sticky Agenda buffer, use `r' to refresh") - (or org-agenda-multi (org-agenda-fit-window-to-buffer)) - (throw 'exit "Sticky Agenda buffer, use `r' to refresh")) - (setq org-todo-keywords-for-agenda nil) - (setq org-drawers-for-agenda nil) - (unless org-agenda-persistent-filter - (setq org-agenda-tag-filter nil - org-agenda-category-filter nil - org-agenda-regexp-filter nil)) - (put 'org-agenda-tag-filter :preset-filter - org-agenda-tag-filter-preset) - (put 'org-agenda-category-filter :preset-filter - org-agenda-category-filter-preset) - (put 'org-agenda-regexp-filter :preset-filter - org-agenda-regexp-filter-preset) - (if org-agenda-multi + (let ((filter-alist (if org-agenda-persistent-filter + (list `(tag . ,org-agenda-tag-filter) + `(re . ,org-agenda-regexp-filter) + `(car . ,org-agenda-category-filter))))) + (if (org-agenda-use-sticky-p) (progn - (setq buffer-read-only nil) - (goto-char (point-max)) - (unless (or (bobp) org-agenda-compact-blocks - (not org-agenda-block-separator)) - (insert "\n" - (if (stringp org-agenda-block-separator) - org-agenda-block-separator - (make-string (window-width) org-agenda-block-separator)) - "\n")) - (narrow-to-region (point) (point-max))) - (setq org-done-keywords-for-agenda nil) - - ;; Setting any org variables that are in org-agenda-local-vars - ;; list need to be done after the prepare call - (org-agenda-prepare-window (get-buffer-create org-agenda-buffer-name)) - (setq buffer-read-only nil) - (org-agenda-reset-markers) - (let ((inhibit-read-only t)) (erase-buffer)) - (org-agenda-mode) - (setq org-agenda-buffer (current-buffer)) - (setq org-agenda-contributing-files nil) - (setq org-agenda-columns-active nil) - (org-agenda-prepare-buffers (org-agenda-files nil 'ifmode)) - (setq org-todo-keywords-for-agenda - (org-uniquify org-todo-keywords-for-agenda)) - (setq org-done-keywords-for-agenda - (org-uniquify org-done-keywords-for-agenda)) - (setq org-drawers-for-agenda (org-uniquify org-drawers-for-agenda)) - (setq org-agenda-last-prefix-arg current-prefix-arg) - (setq org-agenda-this-buffer-name org-agenda-buffer-name) - (and name (not org-agenda-name) - (org-set-local 'org-agenda-name name))) - (setq buffer-read-only nil))) + ;; Popup existing buffer + (org-agenda-prepare-window (get-buffer org-agenda-buffer-name) + filter-alist) + (message "Sticky Agenda buffer, use `r' to refresh") + (or org-agenda-multi (org-agenda-fit-window-to-buffer)) + (throw 'exit "Sticky Agenda buffer, use `r' to refresh")) + (setq org-todo-keywords-for-agenda nil) + (setq org-drawers-for-agenda nil) + (put 'org-agenda-tag-filter :preset-filter + org-agenda-tag-filter-preset) + (put 'org-agenda-category-filter :preset-filter + org-agenda-category-filter-preset) + (put 'org-agenda-regexp-filter :preset-filter + org-agenda-regexp-filter-preset) + (if org-agenda-multi + (progn + (setq buffer-read-only nil) + (goto-char (point-max)) + (unless (or (bobp) org-agenda-compact-blocks + (not org-agenda-block-separator)) + (insert "\n" + (if (stringp org-agenda-block-separator) + org-agenda-block-separator + (make-string (window-width) org-agenda-block-separator)) + "\n")) + (narrow-to-region (point) (point-max))) + (setq org-done-keywords-for-agenda nil) + + ;; Setting any org variables that are in org-agenda-local-vars + ;; list need to be done after the prepare call + (org-agenda-prepare-window + (get-buffer-create org-agenda-buffer-name) filter-alist) + (setq buffer-read-only nil) + (org-agenda-reset-markers) + (let ((inhibit-read-only t)) (erase-buffer)) + (org-agenda-mode) + (setq org-agenda-buffer (current-buffer)) + (setq org-agenda-contributing-files nil) + (setq org-agenda-columns-active nil) + (org-agenda-prepare-buffers (org-agenda-files nil 'ifmode)) + (setq org-todo-keywords-for-agenda + (org-uniquify org-todo-keywords-for-agenda)) + (setq org-done-keywords-for-agenda + (org-uniquify org-done-keywords-for-agenda)) + (setq org-drawers-for-agenda (org-uniquify org-drawers-for-agenda)) + (setq org-agenda-last-prefix-arg current-prefix-arg) + (setq org-agenda-this-buffer-name org-agenda-buffer-name) + (and name (not org-agenda-name) + (org-set-local 'org-agenda-name name))) + (setq buffer-read-only nil)))) (defvar org-agenda-overriding-columns-format) ; From org-colview.el (defun org-agenda-finalize () @@ -3739,13 +3719,15 @@ generating a new one." (save-excursion (goto-char (point-min)) (while (equal (forward-line) 0) - (when (setq mrk (or (get-text-property (point) 'org-hd-marker) - (get-text-property (point) 'org-hd-marker))) + (when (setq mrk (get-text-property (point) 'org-hd-marker)) (put-text-property (point-at-bol) (point-at-eol) 'tags (org-with-point-at mrk (delete-dups (mapcar 'downcase (org-get-tags-at)))))))))) (run-hooks 'org-agenda-finalize-hook) + (when org-agenda-top-headline-filter + (org-agenda-filter-top-headline-apply + org-agenda-top-headline-filter)) (when org-agenda-tag-filter (org-agenda-filter-apply org-agenda-tag-filter 'tag)) (when (get 'org-agenda-tag-filter :preset-filter) @@ -4326,14 +4308,6 @@ items if they have an hour specification like [h]h:mm." (setq p (plist-put p :tstart clocktable-start)) (setq p (plist-put p :tend clocktable-end)) (setq p (plist-put p :scope 'agenda)) - (when (and (eq org-agenda-clockreport-mode 'with-filter) - (setq filter (or org-agenda-tag-filter-while-redo - (get 'org-agenda-tag-filter :preset-filter)))) - (setq p (plist-put p :tags (mapconcat (lambda (x) - (if (string-match "[<>=]" x) - "" - x)) - filter "")))) (setq tbl (apply 'org-clock-get-clocktable p)) (insert tbl))) (goto-char (point-min)) @@ -6781,8 +6755,10 @@ The optional STRING argument forces conversion into a 5 character wide string HH:MM." (save-match-data (when - (or (string-match "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)\\([AaPp][Mm]\\)?\\> *" s) - (string-match "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?\\([AaPp][Mm]\\)\\> *" s)) + (and + (or (string-match "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)\\([AaPp][Mm]\\)?\\> *" s) + (string-match "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?\\([AaPp][Mm]\\)\\> *" s)) + (not (eq (get-text-property 1 'face s) 'org-link))) (let* ((h (string-to-number (match-string 1 s))) (m (if (match-end 3) (string-to-number (match-string 3 s)) 0)) (ampm (if (match-end 4) (downcase (match-string 4 s)))) @@ -7010,7 +6986,7 @@ The optional argument TYPE tells the agenda type." (cond ((< ta tb) -1) ((< tb ta) +1)))) -(defsubst org-cmp-ts (a b &optional type) +(defsubst org-cmp-ts (a b type) "Compare the timestamps values of entries A and B. When TYPE is \"scheduled\", \"deadline\", \"timestamp\" or \"timestamp_ia\", compare within each of these type. When TYPE @@ -7018,9 +6994,11 @@ is the empty string, compare all timestamps without respect of their type." (let* ((def (if org-sort-agenda-notime-is-late most-positive-fixnum -1)) (ta (or (and (string-match type (or (get-text-property 1 'type a) "")) - (get-text-property 1 'ts-date a)) def)) + (get-text-property 1 'ts-date a)) + def)) (tb (or (and (string-match type (or (get-text-property 1 'type b) "")) - (get-text-property 1 'ts-date b)) def))) + (get-text-property 1 'ts-date b)) + def))) (cond ((< ta tb) -1) ((< tb ta) +1)))) @@ -7046,7 +7024,7 @@ their type." (org-cmp-ts a b "deadline"))) (deadline-down (if deadline-up (- deadline-up) nil)) (tsia-up (and (org-em 'tsia-up 'tsia-down ss) - (org-cmp-ts a b "iatimestamp_ia"))) + (org-cmp-ts a b "timestamp_ia"))) (tsia-down (if tsia-up (- tsia-up) nil)) (ts-up (and (org-em 'ts-up 'ts-down ss) (org-cmp-ts a b "timestamp"))) @@ -7283,7 +7261,6 @@ in the agenda." (cat-preset (get 'org-agenda-category-filter :preset-filter)) (re-filter org-agenda-regexp-filter) (re-preset (get 'org-agenda-regexp-filter :preset-filter)) - (org-agenda-tag-filter-while-redo (or tag-filter tag-preset)) (cols org-agenda-columns-active) (line (org-current-line)) (window-line (- line (org-current-line (window-start)))) @@ -7316,9 +7293,12 @@ in the agenda." (put 'org-agenda-tag-filter :preset-filter tag-preset) (put 'org-agenda-category-filter :preset-filter cat-preset) (put 'org-agenda-regexp-filter :preset-filter re-preset) - (and (or tag-filter tag-preset) (org-agenda-filter-apply tag-filter 'tag)) - (and (or cat-filter cat-preset) (org-agenda-filter-apply cat-filter 'category)) - (and (or re-filter re-preset) (org-agenda-filter-apply re-filter 'regexp)) + (let ((tag (or tag-filter tag-preset)) + (cat (or cat-filter cat-preset)) + (re (or re-filter re-preset))) + (when tag (org-agenda-filter-apply tag 'tag)) + (when cat (org-agenda-filter-apply cat 'category)) + (when re (org-agenda-filter-apply re 'regexp))) (and top-hl-filter (org-agenda-filter-top-headline-apply top-hl-filter)) (and cols (org-called-interactively-p 'any) (org-agenda-columns)) (org-goto-line line) @@ -7344,7 +7324,7 @@ The category is that of the current line." (org-agenda-filter-apply (setq org-agenda-category-filter (list (concat "+" cat))) 'category)) - ((error "No category at point")))))) + (t (error "No category at point")))))) (defun org-find-top-headline (&optional pos) "Find the topmost parent headline and return it." @@ -7365,10 +7345,10 @@ The top headline is that of the current line." (progn (setq org-agenda-filtered-by-top-headline nil org-agenda-top-headline-filter nil) - (org-agenda-filter-show-all-cat)) - (let ((cat (org-find-top-headline (org-get-at-bol 'org-hd-marker)))) - (if cat (org-agenda-filter-top-headline-apply cat strip) - (error "No top-level category at point"))))) + (org-agenda-filter-show-all-top-filter)) + (let ((toph (org-find-top-headline (org-get-at-bol 'org-hd-marker)))) + (if toph (org-agenda-filter-top-headline-apply toph strip) + (error "No top-level headline at point"))))) (defvar org-agenda-regexp-filter nil) (defun org-agenda-filter-by-regexp (strip) @@ -7397,7 +7377,10 @@ With two prefix arguments, remove the regexp filters." (when org-agenda-category-filter (org-agenda-filter-show-all-cat)) (when org-agenda-regexp-filter - (org-agenda-filter-show-all-re))) + (org-agenda-filter-show-all-re)) + (when org-agenda-top-headline-filter + (org-agenda-filter-show-all-top-filter)) + (org-agenda-finalize)) (defun org-agenda-filter-by-tag (strip &optional char narrow) "Keep only those lines in the agenda buffer that have a specific tag. @@ -7500,8 +7483,7 @@ to switch to narrowing." (org-agenda-filter-apply org-agenda-tag-filter 'tag) (setq maybe-refresh t)) (t (error "Invalid tag selection character %c" char))) - (when (and maybe-refresh - (eq org-agenda-clockreport-mode 'with-filter)) + (when maybe-refresh (org-agenda-redo)))) (defun org-agenda-get-represented-tags () @@ -7622,13 +7604,12 @@ When NO-OPERATOR is non-nil, do not add the + operator to returned tags." ;; Deactivate `org-agenda-entry-text-mode' when filtering (if org-agenda-entry-text-mode (org-agenda-entry-text-mode)) (let (tags cat txt) - (setq org-agenda-filter-form - (org-agenda-filter-make-matcher filter type)) - (if (and (eq type 'category) - (not (equal (substring (car filter) 0 1) "-"))) - ;; Only set `org-agenda-filtered-by-category' to t - ;; when a unique category is used as the filter - (setq org-agenda-filtered-by-category t)) + (setq org-agenda-filter-form (org-agenda-filter-make-matcher filter type)) + ;; Only set `org-agenda-filtered-by-category' to t when a unique + ;; category is used as the filter: + (setq org-agenda-filtered-by-category + (and (eq type 'category) + (not (equal (substring (car filter) 0 1) "-")))) (org-agenda-set-mode-name) (save-excursion (goto-char (point-min)) @@ -7659,7 +7640,7 @@ When NO-OPERATOR is non-nil, do not add the + operator to returned tags." (tophl (and pos (org-find-top-headline pos)))) (if (and tophl (funcall (if negative 'identity 'not) (string= hl tophl))) - (org-agenda-filter-hide-line 'category))) + (org-agenda-filter-hide-line 'top-headline))) (beginning-of-line 2))) (if (get-char-property (point) 'invisible) (org-agenda-previous-line)) @@ -7669,50 +7650,35 @@ When NO-OPERATOR is non-nil, do not add the + operator to returned tags." (defun org-agenda-filter-hide-line (type) "Hide lines with TYPE in the agenda buffer." (let* ((b (max (point-min) (1- (point-at-bol)))) - (e (point-at-eol)) - (ov (make-overlay b e))) - (overlay-put ov 'invisible t) - (overlay-put ov 'intangible t) - (overlay-put ov 'type type) - (cond ((eq type 'tag) (push ov org-agenda-tag-filter-overlays)) - ((eq type 'category) (push ov org-agenda-cat-filter-overlays)) - ((eq type 'regexp) (push ov org-agenda-re-filter-overlays))))) - -(defun org-agenda-fix-tags-filter-overlays-at (&optional pos) - (setq pos (or pos (point))) + (e (point-at-eol))) + (let ((inhibit-read-only t)) + (add-text-properties + b e `(invisible org-filtered org-filter-type ,type))))) + +(defun org-agenda-remove-filter (type) + (interactive) + "Remove filter of type TYPE from the agenda buffer." (save-excursion - (dolist (ov (overlays-at pos)) - (when (and (overlay-get ov 'invisible) - (eq (overlay-get ov 'type) 'tag)) + (goto-char (point-min)) + (let ((inhibit-read-only t) pos) + (while (setq pos (text-property-any (point) (point-max) 'org-filter-type type)) (goto-char pos) - (if (< (overlay-start ov) (point-at-eol)) - (move-overlay ov (point-at-eol) - (overlay-end ov))))))) + (remove-text-properties + (point) (next-single-property-change (point) 'org-filter-type) + `(invisible org-filtered org-filter-type ,type)))) + (set (intern (format "org-agenda-%s-filter" (intern-soft type))) nil) + (setq org-agenda-filter-form nil) + (org-agenda-set-mode-name) + (org-agenda-finalize))) (defun org-agenda-filter-show-all-tag nil - "Remove tag filter overlays from the agenda buffer." - (mapc 'delete-overlay org-agenda-tag-filter-overlays) - (setq org-agenda-tag-filter-overlays nil - org-agenda-tag-filter nil - org-agenda-filter-form nil) - (org-agenda-set-mode-name)) - + (org-agenda-remove-filter 'tag)) (defun org-agenda-filter-show-all-re nil - "Remove regexp filter overlays from the agenda buffer." - (mapc 'delete-overlay org-agenda-re-filter-overlays) - (setq org-agenda-re-filter-overlays nil - org-agenda-regexp-filter nil - org-agenda-filter-form nil) - (org-agenda-set-mode-name)) - + (org-agenda-remove-filter 'regexp)) (defun org-agenda-filter-show-all-cat nil - "Remove category filter overlays from the agenda buffer." - (mapc 'delete-overlay org-agenda-cat-filter-overlays) - (setq org-agenda-cat-filter-overlays nil - org-agenda-filtered-by-category nil - org-agenda-category-filter nil - org-agenda-filter-form nil) - (org-agenda-set-mode-name)) + (org-agenda-remove-filter 'category)) +(defun org-agenda-filter-show-all-top-filter nil + (org-agenda-remove-filter 'top-headline)) (defun org-agenda-manipulate-query-add () "Manipulate the query by adding a search term with positive selection. @@ -8106,15 +8072,12 @@ so that the date SD will be in that range." (format " (maximum number of lines is %d)" (if (integerp arg) arg org-agenda-entry-text-maxlines)))))) -(defun org-agenda-clockreport-mode (&optional with-filter) - "Toggle clocktable mode in an agenda buffer. -With prefix arg WITH-FILTER, make the clocktable respect the current -agenda filter." - (interactive "P") +(defun org-agenda-clockreport-mode () + "Toggle clocktable mode in an agenda buffer." + (interactive) (org-agenda-check-type t 'agenda) - (if with-filter - (setq org-agenda-clockreport-mode 'with-filter) - (setq org-agenda-clockreport-mode (not org-agenda-clockreport-mode))) + (setq org-agenda-clockreport-mode (not org-agenda-clockreport-mode)) + (setq org-agenda-start-with-clockreport-mode org-agenda-clockreport-mode) (org-agenda-set-mode-name) (org-agenda-redo) (message "Clocktable mode is %s" @@ -8135,6 +8098,7 @@ With a double `C-u' prefix arg, show *only* log items, nothing else." nil 'clockcheck)) (special '(closed clock state)) (t (not org-agenda-show-log)))) + (setq org-agenda-start-with-log-mode org-agenda-show-log) (org-agenda-set-mode-name) (org-agenda-redo) (message "Log mode is %s" @@ -8252,10 +8216,7 @@ When called with a prefix argument, include all archive files as well." " Archives" (format " :%s:" org-archive-tag)) "") - (if org-agenda-clockreport-mode - (if (eq org-agenda-clockreport-mode 'with-filter) - " Clock{}" " Clock") - ""))) + (if org-agenda-clockreport-mode " Clock" ""))) (force-mode-line-update)) (define-obsolete-function-alias @@ -8623,7 +8584,8 @@ if it was hidden in the outline." (interactive "p") (let ((win (selected-window))) (org-agenda-goto t) - (org-recenter-heading 1) + (org-back-to-heading) + (set-window-start (selected-window) (point-at-bol)) (cond ((= more 0) (hide-subtree) @@ -8662,11 +8624,6 @@ if it was hidden in the outline." (message "Remote: SUBTREE AND ALL DRAWERS"))) (select-window win))) -(defun org-recenter-heading (n) - (save-excursion - (org-back-to-heading) - (recenter n))) - (defvar org-agenda-cycle-counter nil) (defun org-agenda-cycle-show (&optional n) "Show the current entry in another window, with default settings. @@ -9177,8 +9134,6 @@ Called with a universal prefix arg, show the priority instead of setting it." (when (equal marker (org-get-at-bol 'org-marker)) (remove-text-properties (point-at-bol) (point-at-eol) '(display)) (org-move-to-column (- (window-width) (length stamp)) t) - - (org-agenda-fix-tags-filter-overlays-at (point)) (if (featurep 'xemacs) ;; Use `duplicable' property to trigger undo recording (let ((ex (make-extent nil nil)) @@ -9190,7 +9145,7 @@ Called with a universal prefix arg, show the priority instead of setting it." (add-text-properties (1- (point)) (point-at-eol) (list 'display (org-add-props stamp nil - 'face 'secondary-selection)))) + 'face '(secondary-selection default))))) (beginning-of-line 1)) (beginning-of-line 0))))) @@ -9478,9 +9433,9 @@ a timestamp can be added there." (if org-adapt-indentation (org-indent-to-column 2))) (defun org-agenda-insert-diary-make-new-entry (text) - "Make new entry as last child of current entry. -Add TEXT as headline, and position the cursor in the second line so that -a timestamp can be added there." + "Make a new entry with TEXT as the first child of the current subtree. +Position the point in the line right after the new heading so +that a timestamp can be added there." (let ((org-show-following-heading t) (org-show-siblings t) (org-show-hierarchy-above t) diff --git a/lisp/org-attach.el b/lisp/org-attach.el index 07307e6..bcf7ba7 100644 --- a/lisp/org-attach.el +++ b/lisp/org-attach.el @@ -208,7 +208,9 @@ the directory and (if necessary) the corresponding ID will be created." (save-excursion (save-restriction (widen) - (goto-char org-entry-property-inherited-from) + (if (marker-position org-entry-property-inherited-from) + (goto-char org-entry-property-inherited-from) + (org-back-to-heading t)) (let (org-attach-allow-inheritance) (org-attach-dir create-if-not-exists-p))))) (org-attach-check-absolute-path attach-dir) diff --git a/lisp/org-bbdb.el b/lisp/org-bbdb.el index b9841a6..cfd5b3b 100644 --- a/lisp/org-bbdb.el +++ b/lisp/org-bbdb.el @@ -400,8 +400,11 @@ This is used by Org to re-create the anniversary hash table." (defun org-bbdb-complete-link () "Read a bbdb link with name completion." (require 'bbdb-com) - (concat "bbdb:" - (bbdb-record-name (car (bbdb-completing-read-record "Name: "))))) + (let ((rec (bbdb-completing-read-record "Name: "))) + (concat "bbdb:" + (bbdb-record-name (if (listp rec) + (car rec) + rec))))) (defun org-bbdb-anniv-export-ical () "Extract anniversaries from BBDB and convert them to icalendar format." diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 0433306..d8617d1 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1587,7 +1587,7 @@ The template may still contain \"%?\" for cursor positioning." (insert template) (goto-char (point-min)) (org-capture-steal-local-variables buffer) - (setq buffer-file-name nil) + (setq buffer-file-name nil mark-active nil) ;; %[] Insert contents of a file. (goto-char (point-min)) @@ -1674,7 +1674,9 @@ The template may still contain \"%?\" for cursor positioning." (or (equal (char-before) ?:) (insert ":")) (insert ins) (or (equal (char-after) ?:) (insert ":")) - (and (org-at-heading-p) (org-set-tags nil 'align))))) + (and (org-at-heading-p) + (let ((org-ignore-region t)) + (org-set-tags nil 'align)))))) ((equal char "C") (cond ((= (length clipboards) 1) (insert (car clipboards))) ((> (length clipboards) 1) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 70c41d5..90380a8 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -312,8 +312,7 @@ Works on both Emacs and XEmacs." (defun org-in-invisibility-spec-p (arg) "Is ARG a member of `buffer-invisibility-spec'?" (if (consp buffer-invisibility-spec) - (member arg buffer-invisibility-spec) - nil)) + (member arg buffer-invisibility-spec))) (defmacro org-xemacs-without-invisibility (&rest body) "Turn off extents with invisibility while executing BODY." @@ -347,18 +346,8 @@ Works on both Emacs and XEmacs." "Move to column COLUMN. Pass COLUMN and FORCE to `move-to-column'. Pass BUFFER to the XEmacs version of `move-to-column'." - (let* ((with-bracket-link - (save-excursion - (forward-line 0) - (looking-at (concat "^.*" org-bracket-link-regexp)))) - (buffer-invisibility-spec - (cond - ((or (not (derived-mode-p 'org-mode)) - (and with-bracket-link (org-invisible-p2))) - (remove '(org-link) buffer-invisibility-spec)) - (with-bracket-link - (remove t buffer-invisibility-spec)) - (t buffer-invisibility-spec)))) + (let ((buffer-invisibility-spec + (remove '(org-filtered) buffer-invisibility-spec))) (if (featurep 'xemacs) (org-xemacs-without-invisibility (move-to-column column force buffer)) diff --git a/lisp/org-element.el b/lisp/org-element.el index b44466e..0c959c0 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -3541,7 +3541,7 @@ Return a list whose CAR is `timestamp', and CDR a plist with `:month-end', `:day-end', `:hour-end', `:minute-end', `:repeater-type', `:repeater-value', `:repeater-unit', `:warning-type', `:warning-value', `:warning-unit', `:begin', -`:end', `:value' and `:post-blank' keywords. +`:end' and `:post-blank' keywords. Assume point is at the beginning of the timestamp." (save-excursion diff --git a/lisp/org-entities.el b/lisp/org-entities.el index ba1eed1..6324a62 100644 --- a/lisp/org-entities.el +++ b/lisp/org-entities.el @@ -27,9 +27,8 @@ ;;; Code: -(require 'org-macs) - -(declare-function org-table-align "org-table" ()) +(declare-function org-toggle-pretty-entities "org" ()) +(declare-function org-table-align "org-table" ()) (eval-when-compile (require 'cl)) @@ -568,6 +567,7 @@ Kind can be any of `latex', `html', `ascii', `latin1', or `utf8'." (goto-char pos) (org-table-align))) +(defvar org-pretty-entities) ;; declare defcustom from org (defun org-entities-help () "Create a Help buffer with all available entities." (interactive) diff --git a/lisp/org-habit.el b/lisp/org-habit.el index 721718d..6013756 100644 --- a/lisp/org-habit.el +++ b/lisp/org-habit.el @@ -351,14 +351,7 @@ current time." (let ((inhibit-read-only t) l c (buffer-invisibility-spec '(org-link)) (moment (time-subtract (current-time) - (list 0 (* 3600 org-extend-today-until) 0))) - disabled-overlays) - ;; Disable filters; this helps with alignment if there are links. - (mapc (lambda (ol) - (when (overlay-get ol 'invisible) - (overlay-put ol 'invisible nil) - (setq disabled-overlays (cons ol disabled-overlays)))) - (overlays-in (point-min) (point-max))) + (list 0 (* 3600 org-extend-today-until) 0)))) (save-excursion (goto-char (if line (point-at-bol) (point-min))) (while (not (eobp)) @@ -374,9 +367,7 @@ current time." (time-subtract moment (days-to-time org-habit-preceding-days)) moment (time-add moment (days-to-time org-habit-following-days)))))) - (forward-line))) - (mapc (lambda (ol) (overlay-put ol 'invisible t)) - disabled-overlays))) + (forward-line))))) (defun org-habit-toggle-habits () "Toggle display of habits in an agenda buffer." diff --git a/lisp/org-list.el b/lisp/org-list.el index d24dad2..2c4d687 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -2237,7 +2237,7 @@ item is invisible." t))))) (defun org-list-repair () - "Fix indentation, bullets and checkboxes is the list at point." + "Fix indentation, bullets and checkboxes in the list at point." (interactive) (unless (org-at-item-p) (error "This is not a list")) (let* ((struct (org-list-struct)) diff --git a/lisp/org-loaddefs.el b/lisp/org-loaddefs.el index 686f521..33548dd 100644 --- a/lisp/org-loaddefs.el +++ b/lisp/org-loaddefs.el @@ -14,7 +14,7 @@ ;;;;;; org-babel-pop-to-session-maybe org-babel-load-in-session-maybe ;;;;;; org-babel-expand-src-block-maybe org-babel-view-src-block-info ;;;;;; org-babel-execute-maybe org-babel-execute-safely-maybe) "ob-core" -;;;;;; "ob-core.el" "e719f4d2aa2a0ee79b861c81085a27b5") +;;;;;; "ob-core.el" "81e011c3c1419cbf51b1656694bf42f8") ;;; Generated autoloads from ob-core.el (autoload 'org-babel-execute-safely-maybe "ob-core" "\ @@ -258,7 +258,7 @@ Return a Library of Babel function call as a string. ;;;*** ;;;### (autoloads (org-babel-tangle org-babel-tangle-file) "ob-tangle" -;;;;;; "ob-tangle.el" "1e3955fc92c4a4b6ea38c07dd71712f5") +;;;;;; "ob-tangle.el" "1fc39a5a416a66ab63a506ccc0a122ff") ;;; Generated autoloads from ob-tangle.el (autoload 'org-babel-tangle-file "ob-tangle" "\ @@ -292,7 +292,7 @@ used to limit the exported source code blocks by language. ;;;;;; org-search-view org-agenda-list org-batch-store-agenda-views ;;;;;; org-store-agenda-views org-batch-agenda-csv org-batch-agenda ;;;;;; org-agenda org-toggle-sticky-agenda) "org-agenda" "org-agenda.el" -;;;;;; (21333 63965)) +;;;;;; (21410 28899)) ;;; Generated autoloads from org-agenda.el (autoload 'org-toggle-sticky-agenda "org-agenda" "\ @@ -621,7 +621,7 @@ This command is set with the variable `org-archive-default-command'. ;;;*** -;;;### (autoloads (org-attach) "org-attach" "org-attach.el" "a3eaede165711f6f923a70dfabdb1a1f") +;;;### (autoloads (org-attach) "org-attach" "org-attach.el" "5ca6eaa6ba7fa7c7eddc8d339f2a2170") ;;; Generated autoloads from org-attach.el (autoload 'org-attach "org-attach" "\ @@ -633,7 +633,7 @@ Shows a list of commands and prompts for another key to execute a command. ;;;*** ;;;### (autoloads (org-bbdb-anniversaries) "org-bbdb" "org-bbdb.el" -;;;;;; "6d7b511684571eabafd1a32f0ddeff53") +;;;;;; "5fed335fd36cec704d37da4b5f5d54a7") ;;; Generated autoloads from org-bbdb.el (autoload 'org-bbdb-anniversaries "org-bbdb" "\ @@ -644,8 +644,8 @@ Extract anniversaries from BBDB for display in the agenda. ;;;*** ;;;### (autoloads (org-capture-import-remember-templates org-capture -;;;;;; org-capture-string) "org-capture" "org-capture.el" (21333 -;;;;;; 63965)) +;;;;;; org-capture-string) "org-capture" "org-capture.el" (21410 +;;;;;; 28899)) ;;; Generated autoloads from org-capture.el (autoload 'org-capture-string "org-capture" "\ @@ -821,7 +821,7 @@ Otherwise, return nil. ;;;### (autoloads (org-agenda-columns org-insert-columns-dblock org-dblock-write:columnview ;;;;;; org-columns-number-to-string org-columns-compute org-columns ;;;;;; org-columns-get-format-and-top-level org-columns-remove-overlays) -;;;;;; "org-colview" "org-colview.el" (21333 63965)) +;;;;;; "org-colview" "org-colview.el" (21410 28900)) ;;; Generated autoloads from org-colview.el (autoload 'org-columns-remove-overlays "org-colview" "\ @@ -885,7 +885,7 @@ Turn on or update column view in the agenda. ;;;*** ;;;### (autoloads (org-check-version) "org-compat" "org-compat.el" -;;;;;; (21298 24953)) +;;;;;; (21410 28900)) ;;; Generated autoloads from org-compat.el (autoload 'org-check-version "org-compat" "\ @@ -910,7 +910,7 @@ tree can be found. ;;;*** ;;;### (autoloads (org-element-context org-element-at-point org-element-interpret-data) -;;;;;; "org-element" "org-element.el" "53f83fecf41bc921d8a3d1aef25bb7c1") +;;;;;; "org-element" "org-element.el" "8da6b3f915a04009e99d11787fab5bae") ;;; Generated autoloads from org-element.el (autoload 'org-element-interpret-data "org-element" "\ @@ -1156,7 +1156,7 @@ Dispatch to the appropriate function to store a link to an IRC session. ;;;*** ;;;### (autoloads (org-load-noerror-mustsuffix) "org-macs" "org-macs.el" -;;;;;; (21196 60375)) +;;;;;; (21406 31790)) ;;; Generated autoloads from org-macs.el (autoload 'org-load-noerror-mustsuffix "org-macs" "\ @@ -1167,7 +1167,7 @@ Load FILE with optional arguments NOERROR and MUSTSUFFIX. Drop the MUSTSUFFIX a ;;;*** ;;;### (autoloads (org-mobile-pull org-mobile-push) "org-mobile" -;;;;;; "org-mobile.el" "b989085b925c9d865acc0289896954d2") +;;;;;; "org-mobile.el" "c2e770357d2065c4eba6fc96b5c17573") ;;; Generated autoloads from org-mobile.el (autoload 'org-mobile-push "org-mobile" "\ @@ -1219,7 +1219,7 @@ line directly before or after the table. ;;;;;; org-table-begin org-table-align org-table-export org-table-import ;;;;;; org-table-convert-region org-table-create org-table-create-or-convert-from-region ;;;;;; org-table-create-with-table\.el) "org-table" "org-table.el" -;;;;;; "31377b4761d68473a76ddad9c4d2867a") +;;;;;; "01951e73ebf6c1b8f499bd5bd6222b1b") ;;; Generated autoloads from org-table.el (autoload 'org-table-create-with-table\.el "org-table" "\ @@ -1830,7 +1830,7 @@ provide ORGTBL directives for the generated table. ;;;*** ;;;### (autoloads (org-timer-set-timer org-timer-item org-timer-change-times-in-region -;;;;;; org-timer org-timer-start) "org-timer" "org-timer.el" "9bf9eb90ff82bc8da92125dbc7ae1b48") +;;;;;; org-timer org-timer-start) "org-timer" "org-timer.el" "54b0453041fa05a477a9da6054ed8b31") ;;; Generated autoloads from org-timer.el (autoload 'org-timer-start "org-timer" "\ @@ -1891,7 +1891,7 @@ replace any running timer. ;;;*** ;;;### (autoloads (org-git-version org-release) "org-version" "org-version.el" -;;;;;; (21334 16575)) +;;;;;; (21410 44951)) ;;; Generated autoloads from org-version.el (autoload 'org-release "org-version" "\ @@ -1917,7 +1917,7 @@ The location of ODT styles.") ;;;;;; org-run-like-in-org-mode turn-on-orgstruct++ turn-on-orgstruct ;;;;;; orgstruct-mode org-global-cycle org-cycle org-mode org-clock-persistence-insinuate ;;;;;; turn-on-orgtbl org-version org-babel-load-file org-babel-do-load-languages) -;;;;;; "org" "org.el" (21334 16446)) +;;;;;; "org" "org.el" (21410 28900)) ;;; Generated autoloads from org.el (autoload 'org-babel-do-load-languages "org" "\ @@ -2140,7 +2140,7 @@ Call the customize function with org as argument. ;;;### (autoloads (org-ascii-publish-to-utf8 org-ascii-publish-to-latin1 ;;;;;; org-ascii-publish-to-ascii org-ascii-export-to-ascii org-ascii-export-as-ascii) -;;;;;; "ox-ascii" "ox-ascii.el" "bbf90b3e0b7c93443be4a26d450175c7") +;;;;;; "ox-ascii" "ox-ascii.el" "5a2dd4135dfb852f9f7696cfda217c3d") ;;; Generated autoloads from ox-ascii.el (autoload 'org-ascii-export-as-ascii "ox-ascii" "\ @@ -2243,7 +2243,7 @@ Return output file name. ;;;### (autoloads (org-beamer-publish-to-pdf org-beamer-publish-to-latex ;;;;;; org-beamer-insert-options-template org-beamer-select-environment ;;;;;; org-beamer-export-to-pdf org-beamer-export-to-latex org-beamer-export-as-latex -;;;;;; org-beamer-mode) "ox-beamer" "ox-beamer.el" "a3f8823ff160fc8f658d6c2d54537799") +;;;;;; org-beamer-mode) "ox-beamer" "ox-beamer.el" "0348058cc4cbc1e72026db6215d71d9f") ;;; Generated autoloads from ox-beamer.el (autoload 'org-beamer-mode "ox-beamer" "\ @@ -2385,7 +2385,7 @@ Return output file name. ;;;### (autoloads (org-html-publish-to-html org-html-export-to-html ;;;;;; org-html-convert-region-to-html org-html-export-as-html org-html-htmlize-generate-css) -;;;;;; "ox-html" "ox-html.el" "715aa6cb7b7281e60f345059292288cd") +;;;;;; "ox-html" "ox-html.el" "d5c9c4a0e85bc0c8d4341a5ae06255a3") ;;; Generated autoloads from ox-html.el (put 'org-html-head-include-default-style 'safe-local-variable 'booleanp) @@ -2493,7 +2493,7 @@ Return output file name. ;;;### (autoloads (org-icalendar-combine-agenda-files org-icalendar-export-agenda-files ;;;;;; org-icalendar-export-to-ics) "ox-icalendar" "ox-icalendar.el" -;;;;;; "0b4a917e81efd32a15bc54b2f2274184") +;;;;;; "74a493ca40404cb8fd648526fd898b6f") ;;; Generated autoloads from ox-icalendar.el (autoload 'org-icalendar-export-to-ics "ox-icalendar" "\ @@ -2545,7 +2545,7 @@ The file is stored under the name chosen in ;;;### (autoloads (org-latex-publish-to-pdf org-latex-publish-to-latex ;;;;;; org-latex-export-to-pdf org-latex-export-to-latex org-latex-convert-region-to-latex -;;;;;; org-latex-export-as-latex) "ox-latex" "ox-latex.el" "103a0d4c998e0e3e10e96fb60c272269") +;;;;;; org-latex-export-as-latex) "ox-latex" "ox-latex.el" "8a65033d4b2c7667e8069256a6810fb1") ;;; Generated autoloads from ox-latex.el (autoload 'org-latex-export-as-latex "ox-latex" "\ @@ -2671,7 +2671,7 @@ Return output file name. ;;;*** ;;;### (autoloads (org-md-export-to-markdown org-md-convert-region-to-md -;;;;;; org-md-export-as-markdown) "ox-md" "ox-md.el" "c8ecd54d0044f42385f5d9c867c35b9a") +;;;;;; org-md-export-as-markdown) "ox-md" "ox-md.el" "050e805f316d1908d1309facb5cb7d5b") ;;; Generated autoloads from ox-md.el (autoload 'org-md-export-as-markdown "ox-md" "\ @@ -2796,7 +2796,7 @@ using `org-open-file'. ;;;*** ;;;### (autoloads (org-org-publish-to-org org-org-export-to-org org-org-export-as-org) -;;;;;; "ox-org" "ox-org.el" "b17991920074e6534f5f37f7ef471603") +;;;;;; "ox-org" "ox-org.el" "952b4282cdf7bddd86e2e7660934888f") ;;; Generated autoloads from ox-org.el (autoload 'org-org-export-as-org "ox-org" "\ @@ -2940,7 +2940,7 @@ this command to convert it. ;;;### (autoloads (org-export-dispatch org-export-to-file org-export-to-buffer ;;;;;; org-export-insert-default-template org-export-replace-region-by -;;;;;; org-export-string-as org-export-as) "ox" "ox.el" "0796c3365df1027b70fd024d67785c0d") +;;;;;; org-export-string-as org-export-as) "ox" "ox.el" "829116ef2e793a50081ae7245ef6c047") ;;; Generated autoloads from ox.el (autoload 'org-export-as "ox" "\ diff --git a/lisp/org-macs.el b/lisp/org-macs.el index ddd6e2e..96265ec 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -154,9 +154,9 @@ We use a macro so that the test can happen at compilation time." `(let ((,mpom ,pom)) (save-excursion (if (markerp ,mpom) (set-buffer (marker-buffer ,mpom))) - (save-excursion - (goto-char (or ,mpom (point))) - ,@body))))) + (org-with-wide-buffer + (goto-char (or ,mpom (point))) + ,@body))))) (def-edebug-spec org-with-point-at (form body)) (put 'org-with-point-at 'lisp-indent-function 1) diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el index f59d1c4..41a9958 100644 --- a/lisp/org-mobile.el +++ b/lisp/org-mobile.el @@ -1074,7 +1074,7 @@ be returned that indicates what went wrong." ;; which prevents correct insertion when point is invisible (org-show-subtree) (end-of-line 1) - (org-insert-heading-respect-content '(16) t) + (org-insert-heading-respect-content t) (org-demote)) (beginning-of-line) (insert "* ")) diff --git a/lisp/org-mouse.el b/lisp/org-mouse.el index 27dc0e0..74046c7 100644 --- a/lisp/org-mouse.el +++ b/lisp/org-mouse.el @@ -953,20 +953,23 @@ This means, between the beginning of line and the point." (point) (save-excursion (goto-char start) (org-back-to-heading) (point)))) - (outline-end-of-subtree) + (progn (org-end-of-subtree nil t) + (unless (eobp) (backward-char))) (end-of-line) (if (eobp) (newline) (forward-char))) (when (looking-at org-outline-regexp) (let ((level (- (match-end 0) (match-beginning 0)))) (when (> end (match-end 0)) - (outline-end-of-subtree) + (progn (org-end-of-subtree nil t) + (unless (eobp) (backward-char))) (end-of-line) (if (eobp) (newline) (forward-char)) (setq level (1+ level))) (org-paste-subtree level) (save-excursion - (outline-end-of-subtree) + (progn (org-end-of-subtree nil t) + (unless (eobp) (backward-char))) (when (bolp) (delete-char -1)))))))))) @@ -1003,8 +1006,8 @@ This means, between the beginning of line and the point." (org-mouse-main-buffer (current-buffer))) (when (eq (with-current-buffer buffer major-mode) 'org-mode) (let ((endmarker (with-current-buffer buffer - (outline-end-of-subtree) - (forward-char 1) + (org-end-of-subtree nil t) + (unless (eobp) (forward-char 1)) (copy-marker (point))))) (org-with-remote-undo buffer (with-current-buffer buffer diff --git a/lisp/org-table.el b/lisp/org-table.el index c952234..6d649ab 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -2712,7 +2712,8 @@ not overwrite the stored one." (or (fboundp 'calc-eval) (user-error "Calc does not seem to be installed, and is needed to evaluate the formula")) ;; Use <...> time-stamps so that Calc can handle them - (setq form (replace-regexp-in-string org-ts-regexp3 "<\\1>" form)) + (while (string-match (concat "\\[" org-ts-regexp1 "\\]") form) + (setq form (replace-match "<\\1>" nil nil form))) ;; I18n-ize local time-stamps by setting (system-time-locale "C") (when (string-match org-ts-regexp2 form) (let* ((ts (match-string 0 form)) @@ -3862,9 +3863,10 @@ With prefix ARG, apply the new formulas to the table." (push org-table-current-begin-pos org-show-positions) (let ((min (apply 'min org-show-positions)) (max (apply 'max org-show-positions))) - (goto-char min) (recenter 0) + (set-window-start (selected-window) (point-min)) (goto-char max) - (or (pos-visible-in-window-p max) (recenter -1)))) + (or (pos-visible-in-window-p max) + (set-window-start (selected-window) (point-max))))) (select-window win)))) (defun org-table-force-dataline () diff --git a/lisp/org-timer.el b/lisp/org-timer.el index 1a86ffa..8161699 100644 --- a/lisp/org-timer.el +++ b/lisp/org-timer.el @@ -186,7 +186,10 @@ it in the buffer." (insert (org-timer-value-string)))) (defun org-timer-value-string () - (format org-timer-format (org-timer-secs-to-hms (floor (org-timer-seconds))))) + "Set the timer string." + (format org-timer-format + (org-timer-secs-to-hms + (abs (floor (org-timer-seconds)))))) (defvar org-timer-timer-is-countdown nil) (defun org-timer-seconds () diff --git a/lisp/org-version.el b/lisp/org-version.el index 1e8bb89..0562de3 100644 --- a/lisp/org-version.el +++ b/lisp/org-version.el @@ -5,13 +5,13 @@ (defun org-release () "The release version of org-mode. Inserted by installing org-mode or when a release is made." - (let ((org-release "8.2.6")) + (let ((org-release "8.2.7a")) org-release)) ;;;###autoload (defun org-git-version () "The Git version of org-mode. Inserted by installing org-mode or when a release is made." - (let ((org-git-version "8.2.6-dist")) + (let ((org-git-version "8.2.7a-dist")) org-git-version)) ;;;###autoload (defvar org-odt-data-dir "/usr/share/emacs/etc/org" diff --git a/lisp/org.el b/lisp/org.el index 2a451ed..6fb0387 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -111,6 +111,8 @@ Stars are put in group 1 and the trimmed body in group 2.") (unless (boundp 'diary-fancy-buffer) (org-defvaralias 'diary-fancy-buffer 'fancy-diary-buffer)) +(declare-function org-add-archive-files "org-archive" (files)) + (declare-function org-inlinetask-at-task-p "org-inlinetask" ()) (declare-function org-inlinetask-outline-regexp "org-inlinetask" ()) (declare-function org-inlinetask-toggle-visibility "org-inlinetask" ()) @@ -118,7 +120,10 @@ Stars are put in group 1 and the trimmed body in group 2.") (declare-function org-clock-get-last-clock-out-time "org-clock" ()) (declare-function org-clock-timestamps-up "org-clock" (&optional n)) (declare-function org-clock-timestamps-down "org-clock" (&optional n)) +(declare-function org-clock-remove-overlays "org-clock" (&optional beg end noremove)) (declare-function org-clock-sum-current-item "org-clock" (&optional tstart)) +(declare-function org-clock-update-time-maybe "org-clock" ()) +(declare-function org-clocktable-shift "org-clock" (dir n)) (declare-function orgtbl-mode "org-table" (&optional arg)) (declare-function org-clock-out "org-clock" (&optional switch-to-state fail-quietly at-time)) @@ -133,6 +138,10 @@ Stars are put in group 1 and the trimmed body in group 2.") (declare-function org-agenda-list "org-agenda" (&optional arg start-day span)) (declare-function org-agenda-redo "org-agenda" (&optional all)) (declare-function org-table-align "org-table" ()) +(declare-function org-table-begin "org-table" (&optional table-type)) +(declare-function org-table-blank-field "org-table" ()) +(declare-function org-table-end "org-table" (&optional table-type)) +(declare-function org-table-insert-row "org-table" (&optional arg)) (declare-function org-table-paste-rectangle "org-table" ()) (declare-function org-table-maybe-eval-formula "org-table" ()) (declare-function org-table-maybe-recalculate-line "org-table" ()) @@ -179,6 +188,7 @@ Stars are put in group 1 and the trimmed body in group 2.") (intern (concat "org-babel-expand-body:" lang))))))) org-babel-load-languages)) +(declare-function org-babel-tangle-file "ob-tangle" (file &optional target-file lang)) ;;;###autoload (defun org-babel-load-file (file &optional compile) "Load Emacs Lisp source code blocks in the Org-mode FILE. @@ -5109,9 +5119,9 @@ Support for group tags is controlled by the option "\\(?: +\\(\\[#.\\]\\)\\)?" "\\(?: +" ;; Stats cookies can be stuck to body. - "\\(?:\\[[0-9%%/]+\\] *\\)?" + "\\(?:\\[[0-9%%/]+\\] *\\)*" "\\(%s\\)" - "\\(?: *\\[[0-9%%/]+\\]\\)?" + "\\(?: *\\[[0-9%%/]+\\]\\)*" "\\)" (org-re "\\(?:[ \t]+\\(:[[:alnum:]_@#%%:]+:\\)\\)?") "[ \t]*$") @@ -5474,7 +5484,7 @@ The following commands are available: (put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify) (defsubst org-fix-ellipsis-at-bol () - (save-excursion (goto-char (window-start)) (recenter 0))) + (save-excursion (set-window-start (selected-window) (window-start)))) (defun org-find-invisible-foreground () (let ((candidates (remove @@ -5881,7 +5891,7 @@ by a #." ((member dc1 '("+title:" "+author:" "+email:" "+date:")) (add-text-properties beg (match-end 3) - (if (member (intern (substring dc1 0 -1)) org-hidden-keywords) + (if (member (intern (substring dc1 1 -1)) org-hidden-keywords) '(font-lock-fontified t invisible t) '(font-lock-fontified t face org-document-info-keyword))) (add-text-properties @@ -6145,15 +6155,17 @@ Use `org-reduced-level' to remove the effect of `org-odd-levels'." (defvar org-font-lock-keywords nil) -(defsubst org-re-property (property &optional literal) - "Return a regexp matching a PROPERTY line. -Match group 3 will be set to the value if it exists." - (concat "^\\(?4:[ \t]*\\)\\(?1::\\(?2:" - (if literal property (regexp-quote property)) - "\\):\\)[ \t]+\\(?3:[^ \t\r\n].*?\\)\\(?5:[ \t]*\\)$")) +(defsubst org-re-property (property &optional literal allow-null) + "Return a regexp matching a PROPERTY line. + Match group 3 will be set to the value if it exists." + (concat "^\\(?4:[ \t]*\\)\\(?1::\\(?2:" + (if literal property (regexp-quote property)) + "\\):\\)[ \t]+\\(?3:[^ \t\r\n]" + (if allow-null "*") + ".*?\\)\\(?5:[ \t]*\\)$")) (defconst org-property-re - (org-re-property ".*?" 'literal) + (org-re-property ".*?" 'literal t) "Regular expression matching a property line. There are four matching groups: 1: :PROPKEY: including the leading and trailing colon, @@ -6729,7 +6741,8 @@ in special contexts. (setq has-children (org-list-has-child-p (point) struct))) (org-back-to-heading) (setq eoh (save-excursion (outline-end-of-heading) (point))) - (setq eos (save-excursion (1- (org-end-of-subtree t t)))) + (setq eos (save-excursion (org-end-of-subtree t t) + (when (bolp) (backward-char)) (point))) (setq has-children (or (save-excursion (let ((level (funcall outline-level))) @@ -6894,21 +6907,20 @@ With a numeric prefix, show all headlines up to that level." ;; buffers, where outline-regexp is needed. (defun org-overview () "Switch to overview mode, showing only top-level headlines. -Really, this shows all headlines with level equal or greater than the level +This shows all headlines with a level equal or greater than the level of the first headline in the buffer. This is important, because if the first headline is not level one, then (hide-sublevels 1) gives confusing results." (interactive) - (let ((pos (point)) - (level (save-excursion - (goto-char (point-min)) - (if (re-search-forward (concat "^" outline-regexp) nil t) - (progn - (goto-char (match-beginning 0)) - (funcall outline-level)))))) - (and level (hide-sublevels level)) - (recenter '(4)) - (goto-char pos))) + (save-excursion + (let ((level + (save-excursion + (goto-char (point-min)) + (if (re-search-forward (concat "^" outline-regexp) nil t) + (progn + (goto-char (match-beginning 0)) + (funcall outline-level)))))) + (and level (hide-sublevels level))))) (defun org-content (&optional arg) "Show all headlines in the buffer, like a table of contents. @@ -7105,13 +7117,11 @@ Otherwise make it visible." (pos-visible-in-window-p (save-excursion (org-end-of-subtree t) (point)))) -(defun org-first-headline-recenter (&optional N) - "Move cursor to the first headline and recenter the headline. -Optional argument N means put the headline into the Nth line of the window." +(defun org-first-headline-recenter () + "Move cursor to the first headline and recenter the headline." (goto-char (point-min)) (when (re-search-forward (concat "^\\(" org-outline-regexp "\\)") nil t) - (beginning-of-line) - (recenter (prefix-numeric-value N)))) + (set-window-start (selected-window) (point-at-bol)))) ;;; Saving and restoring visibility @@ -7545,23 +7555,22 @@ When NEXT is non-nil, check the next line instead." (looking-at "[ \t]*$"))))) (defun org-insert-heading (&optional arg invisible-ok) - "Insert a new heading or item with same depth at point. + "Insert a new heading or an item with the same depth at point. If point is at the beginning of a heading or a list item, insert -a heading or a list item before it. - -If point is at the beginning of a normal line, turn this line -into a heading. +a new heading or a new item above the current one. If point is +at the beginning of a normal line, turn the line into a heading. If point is in the middle of a headline or a list item, split the headline or the item and create a new headline/item with the text in the current line after point \(see `org-M-RET-may-split-line' on how to modify this behavior). -With one universal prefix argument: If point is within a list, -insert a heading instead of a list item. Otherwise, set the -value of `org-insert-heading-respect-content' to `t' for the -duration of the command. +With one universal prefirx argument, set the user option +`org-insert-heading-respect-content' to t for the duration of +the command. This modifies the behavior described above in this +ways: on list items and at the beginning of normal lines, force +the insertion of a heading after the current subtree. With two universal prefix arguments, insert the heading at the end of the grandparent subtree. For example, if point is within @@ -7589,12 +7598,19 @@ command." (or arg (not itemp)))) ;; At beginning of buffer or so high up that only a heading ;; makes sense. - (insert - (if (or (bobp) (org-previous-line-empty-p)) "" "\n") - (if (org-in-src-block-p) ",* " "* ")) + (cond ((and (bolp) (not respect-content)) (insert "* ")) + ((not respect-content) + (unless may-split (end-of-line)) + (insert "\n* ")) + ((re-search-forward org-outline-regexp-bol nil t) + (beginning-of-line) + (insert "* \n") + (backward-char)) + (t (goto-char (point-max)) + (insert "\n* "))) (run-hooks 'org-insert-heading-hook)) - ((and itemp (not (equal arg '(4)))) + ((and itemp (not (member arg '((4) (16))))) ;; Insert an item (org-insert-item)) @@ -7614,11 +7630,12 @@ command." nil)) ;; Get a level string to fall back on (fix-level - (save-excursion - (org-back-to-heading t) - (if (org-previous-line-empty-p) (setq empty-line-p t)) - (looking-at org-outline-regexp) - (make-string (1- (length (match-string 0))) ?*))) + (if (org-before-first-heading-p) "*" + (save-excursion + (org-back-to-heading t) + (if (org-previous-line-empty-p) (setq empty-line-p t)) + (looking-at org-outline-regexp) + (make-string (1- (length (match-string 0))) ?*)))) (stars (save-excursion (condition-case nil @@ -7650,8 +7667,12 @@ command." pos hide-previous previous-pos) ;; If we insert after content, move there and clean up whitespace - (when (and respect-content (not (org-on-heading-p))) - (org-end-of-subtree nil t) + (when (and respect-content + (not (org-looking-at-p org-outline-regexp-bol))) + (if (not (org-before-first-heading-p)) + (org-end-of-subtree nil t) + (re-search-forward org-outline-regexp-bol) + (beginning-of-line 0)) (skip-chars-backward " \r\n") (and (not (looking-back "^\*+")) (looking-at "[ \t]+") (replace-match "")) @@ -7680,10 +7701,9 @@ command." (setq initial-content (org-trim initial-content))) (goto-char pos)) ;; a normal line - (unless (bolp) - (setq initial-content (buffer-substring (point) (point-at-eol))) - (delete-region (point) (point-at-eol)) - (setq initial-content (org-trim initial-content))))) + (setq initial-content + (org-trim (buffer-substring (point) (point-at-eol)))) + (delete-region (point) (point-at-eol)))) ;; If we are at the beginning of the line, insert before it. Else after (cond @@ -7783,17 +7803,15 @@ This is a list with the following elements: (org-move-subtree-down) (end-of-line 1)) -(defun org-insert-heading-respect-content (&optional arg invisible-ok) +(defun org-insert-heading-respect-content (&optional invisible-ok) "Insert heading with `org-insert-heading-respect-content' set to t." - (interactive "P") - (let ((org-insert-heading-respect-content t)) - (org-insert-heading '(4) invisible-ok))) + (interactive) + (org-insert-heading '(4) invisible-ok)) (defun org-insert-todo-heading-respect-content (&optional force-state) "Insert TODO heading with `org-insert-heading-respect-content' set to t." - (interactive "P") - (let ((org-insert-heading-respect-content t)) - (org-insert-todo-heading force-state '(4)))) + (interactive) + (org-insert-todo-heading force-state '(4))) (defun org-insert-todo-heading (arg &optional force-heading) "Insert a new heading with the same level and TODO state as current heading. @@ -8150,7 +8168,8 @@ case." (save-match-data (save-excursion (outline-end-of-heading) (setq folded (outline-invisible-p))) - (outline-end-of-subtree)) + (progn (org-end-of-subtree nil t) + (unless (eobp) (backward-char)))) (outline-next-heading) (setq ne-end (org-back-over-empty-lines)) (setq end (point)) @@ -10592,6 +10611,10 @@ application the system uses for this file type." (move-marker org-open-link-marker nil) (run-hook-with-args 'org-follow-link-hook))) +(defsubst org-uniquify (list) + "Non-destructively remove duplicate elements from LIST." + (let ((res (copy-sequence list))) (delete-dups res))) + (defun org-offer-links-in-entry (buffer marker &optional nth zero) "Offer links in the current entry and return the selected link. If there is only one link, return it. @@ -13836,7 +13859,7 @@ a file becomes an N^2 operation - but with this variable set, it scales as N.") (defun org-scan-tags (action matcher todo-only &optional start-level) - "Sca headline tags with inheritance and produce output ACTION. + "Scan headline tags with inheritance and produce output ACTION. ACTION can be `sparse-tree' to produce a sparse tree in the current buffer, or `agenda' to produce an entry list for an agenda view. It can also be @@ -14744,8 +14767,8 @@ Returns the new tags string, or nil to not change the current settings." (if expert (set-buffer (get-buffer-create " *Org tags*")) (delete-other-windows) - (split-window-vertically) - (org-switch-to-buffer-other-window (get-buffer-create " *Org tags*"))) + (set-window-buffer (split-window-vertically) (get-buffer-create " *Org tags*")) + (org-switch-to-buffer-other-window " *Org tags*")) (erase-buffer) (org-set-local 'org-done-keywords done-keywords) (org-fast-tag-insert "Inherited" inherited i-face "\n") @@ -15269,7 +15292,10 @@ things up because then unnecessary parsing is avoided." '("SCHEDULED" "DEADLINE" "CLOCK" "CLOSED" "TIMESTAMP" "TIMESTAMP_IA"))) (catch 'match - (while (re-search-forward org-maybe-keyword-time-regexp end t) + (while (and (re-search-forward org-maybe-keyword-time-regexp end t) + (not (text-property-any 0 (length (match-string 0)) + 'face 'font-lock-comment-face + (match-string 0)))) (setq key (if (match-end 1) (substring (org-match-string-no-properties 1) 0 -1)) @@ -15397,7 +15423,7 @@ an empty drawer to delete." (if (and range (goto-char (car range)) (re-search-forward - (org-re-property property) + (org-re-property property nil t) (cdr range) t)) (progn (delete-region (match-beginning 0) (1+ (point-at-eol))) @@ -15562,7 +15588,7 @@ If it is not a string, an error is raised." (setq range (org-get-property-block beg end 'force)) (goto-char (car range)) (if (re-search-forward - (org-re-property property) (cdr range) t) + (org-re-property property nil t) (cdr range) t) (progn (delete-region (match-beginning 0) (match-end 0)) (goto-char (match-beginning 0))) @@ -15773,9 +15799,7 @@ This is computed according to `org-property-set-functions-alist'." (funcall set-function prompt (mapcar 'list (org-property-values property)) nil nil "" nil cur))))) - (if (equal val "") - cur - val))) + (org-trim val))) (defvar org-last-set-property nil) (defvar org-last-set-property-value nil) @@ -15853,8 +15877,10 @@ an empty drawer to delete." (org-icompleting-read "Property: " props nil t) (caar props)))) (list prop))) - (if (org-entry-delete nil property delete-empty-drawer) - (message "Property %s deleted" property))) + (if (not property) + (message "No property to delete in this entry") + (org-entry-delete nil property delete-empty-drawer) + (message "Property \"%s\" deleted" property))) (defun org-delete-property-globally (property) "Remove PROPERTY globally, from all entries." @@ -21819,9 +21845,7 @@ for the search purpose." "Return the reverse of STRING." (apply 'string (reverse (string-to-list string)))) -(defsubst org-uniquify (list) - "Non-destructively remove duplicate elements from LIST." - (let ((res (copy-sequence list))) (delete-dups res))) +;; defsubst org-uniquify must be defined before first use (defun org-uniquify-alist (alist) "Merge elements of ALIST with the same key. @@ -23273,14 +23297,6 @@ If there is no such heading, return nil." (forward-char -1)))))) (point)) -(defadvice outline-end-of-subtree (around prefer-org-version activate compile) - "Use Org version in org-mode, for dramatic speed-up." - (if (derived-mode-p 'org-mode) - (progn - (org-end-of-subtree nil t) - (unless (eobp) (backward-char 1))) - ad-do-it)) - (defun org-end-of-meta-data-and-drawers () "Jump to the first text after meta data and drawers in the current entry. This will move over empty lines, lines with planning time stamps, diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el index 6208cdb..b4efa53 100644 --- a/lisp/ox-ascii.el +++ b/lisp/ox-ascii.el @@ -192,8 +192,10 @@ original Org buffer at the same place." (defcustom org-ascii-indented-line-width 'auto "Additional indentation width for the first line in a paragraph. If the value is an integer, indent the first line of each -paragraph by this number. If it is the symbol `auto' preserve -indentation from original document." +paragraph by this width, unless it is located at the beginning of +a section, in which case indentation is removed from that line. +If it is the symbol `auto' preserve indentation from original +document." :group 'org-export-ascii :version "24.4" :package-version '(Org . "8.0") @@ -455,7 +457,7 @@ HOW determines the type of justification: it can be `left', Empty lines are not indented." (when (stringp s) (replace-regexp-in-string - "\\(^\\)\\(?:.*\\S-\\)" (make-string width ? ) s nil nil 1))) + "\\(^\\)[ \t]*\\S-" (make-string width ?\s) s nil nil 1))) (defun org-ascii--box-string (s info) "Return string S with a partial box to its left. @@ -473,7 +475,7 @@ INFO is a plist used as a communication channel." (case (org-element-type element) ;; Elements with an absolute width: `headline' and `inlinetask'. (inlinetask org-ascii-inlinetask-width) - ('headline + (headline (- org-ascii-text-width (let ((low-level-rank (org-export-low-level-p element info))) (if low-level-rank (* low-level-rank 2) org-ascii-global-margin)))) @@ -1418,12 +1420,16 @@ INFO is a plist holding contextual information." "Transcode a PARAGRAPH element from Org to ASCII. CONTENTS is the contents of the paragraph, as a string. INFO is the plist used as a communication channel." - (let ((contents (if (not (wholenump org-ascii-indented-line-width)) contents - (concat - (make-string org-ascii-indented-line-width ? ) - (replace-regexp-in-string "\\`[ \t]+" "" contents))))) - (org-ascii--fill-string - contents (org-ascii--current-text-width paragraph info) info))) + (org-ascii--fill-string + (if (not (wholenump org-ascii-indented-line-width)) contents + (concat + ;; Do not indent first paragraph in a section. + (unless (and (not (org-export-get-previous-element paragraph info)) + (eq (org-element-type (org-export-get-parent paragraph)) + 'section)) + (make-string org-ascii-indented-line-width ?\s)) + (replace-regexp-in-string "\\`[ \t]+" "" contents))) + (org-ascii--current-text-width paragraph info) info)) ;;;; Plain List @@ -1591,8 +1597,8 @@ contextual information." CONTENTS is the contents of the object. INFO is a plist holding contextual information." (if (org-element-property :use-brackets-p superscript) - (format "_{%s}" contents) - (format "_%s" contents))) + (format "^{%s}" contents) + (format "^%s" contents))) ;;;; Strike-through diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el index f3a79d7..1d487e9 100644 --- a/lisp/ox-beamer.el +++ b/lisp/ox-beamer.el @@ -1092,6 +1092,7 @@ aid, but the tag does not have any semantic meaning." envs) '((:endgroup)) '(("BMCOL" . ?|)))) + (org-tag-persistent-alist nil) (org-use-fast-tag-selection t) (org-fast-tag-selection-single-key t)) (org-set-tags) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 88e5720..3eaeb0a 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2596,18 +2596,17 @@ if its description is a single link targeting an image file." (defvar org-html-standalone-image-predicate) (defun org-html-standalone-image-p (element info) - "Test if ELEMENT is a standalone image. + "Non-nil if ELEMENT is a standalone image. INFO is a plist holding contextual information. -Return non-nil, if ELEMENT is of type paragraph and its sole -content, save for white spaces, is a link that qualifies as an -inline image. +An element or object is a standalone image when -Return non-nil, if ELEMENT is of type link and its containing -paragraph has no other content save white spaces. + - its type is `paragraph' and its sole content, save for white + spaces, is a link that qualifies as an inline image; -Return nil, otherwise. + - its type is `link' and its containing paragraph has no other + content save white spaces. Bind `org-html-standalone-image-predicate' to constrain paragraph further. For example, to check for only captioned standalone @@ -2618,19 +2617,21 @@ images, set it to: (paragraph element) (link (org-export-get-parent element))))) (and (eq (org-element-type paragraph) 'paragraph) - (or (not (and (boundp 'org-html-standalone-image-predicate) - (functionp org-html-standalone-image-predicate))) + (or (not (fboundp 'org-html-standalone-image-predicate)) (funcall org-html-standalone-image-predicate paragraph)) - (not (let ((link-count 0)) - (org-element-map (org-element-contents paragraph) - (cons 'plain-text org-element-all-objects) - (lambda (obj) (case (org-element-type obj) - (plain-text (org-string-nw-p obj)) - (link - (or (> (incf link-count) 1) - (not (org-html-inline-image-p obj info)))) - (otherwise t))) - info 'first-match 'link)))))) + (catch 'exit + (let ((link-count 0)) + (org-element-map (org-element-contents paragraph) + (cons 'plain-text org-element-all-objects) + #'(lambda (obj) + (when (case (org-element-type obj) + (plain-text (org-string-nw-p obj)) + (link (or (> (incf link-count) 1) + (not (org-html-inline-image-p obj info)))) + (otherwise t)) + (throw 'exit nil))) + info nil 'link) + (= link-count 1)))))) (defun org-html-link (link desc info) "Transcode a LINK object from Org to HTML. diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el index a60c2f9..cd48bbf 100644 --- a/lisp/ox-icalendar.el +++ b/lisp/ox-icalendar.el @@ -174,8 +174,7 @@ The anniversaries are defined in the BBDB database." (defcustom org-icalendar-include-sexps t "Non-nil means export to iCalendar files should also cover sexp entries. -These are entries like in the diary, but directly in an Org mode -file." +These are entries like in the diary, but directly in an Org file." :group 'org-export-icalendar :type 'boolean) @@ -302,14 +301,14 @@ which will be updated." INFO is a plist used as a communication channel. -a headline is blocked when either: +A headline is blocked when either - - It has children which are not all in a completed state. + - it has children which are not all in a completed state; - - It has a parent with the property :ORDERED:, and there are - siblings prior to it with incomplete status. + - it has a parent with the property :ORDERED:, and there are + siblings prior to it with incomplete status; - - Its parent is blocked because it has siblings that should be + - its parent is blocked because it has siblings that should be done first or is a child of a blocked grandparent entry." (or ;; Check if any child is not done. @@ -478,10 +477,10 @@ or subject for the event." ;;; Filters (defun org-icalendar-clear-blank-lines (headline back-end info) - "Remove trailing blank lines in HEADLINE export. + "Remove blank lines in HEADLINE export. HEADLINE is a string representing a transcoded headline. BACK-END and INFO are ignored." - (replace-regexp-in-string "^\\(?:[ \t]*\n\\)*" "" headline)) + (replace-regexp-in-string "^\\(?:[ \t]*\n\\)+" "" headline)) @@ -570,13 +569,19 @@ inlinetask within the section." ;; happen once ENTRY is one of them. (let ((counter 0)) (mapconcat - 'identity + #'identity (org-element-map (cons (org-element-property :title entry) (org-element-contents inside)) 'timestamp (lambda (ts) - (let ((uid (format "TS%d-%s" (incf counter) uid))) - (org-icalendar--vevent entry ts uid summary loc desc cat))) + (when (let ((type (org-element-property :type ts))) + (case (plist-get info :with-timestamps) + (active (memq type '(active active-range))) + (inactive (memq type '(inactive inactive-range))) + ((t) t))) + (let ((uid (format "TS%d-%s" (incf counter) uid))) + (org-icalendar--vevent + entry ts uid summary loc desc cat)))) info nil (and (eq type 'headline) 'inlinetask)) "")) ;; Task: First check if it is appropriate to export it. @@ -589,7 +594,7 @@ inlinetask within the section." (and (eq type 'headline) (not (org-icalendar-blocked-headline-p entry info)))) - ('t (eq todo-type 'todo)))) + ((t) (eq todo-type 'todo)))) (org-icalendar--vtodo entry uid summary loc desc cat)) ;; Diary-sexp: Collect every diary-sexp element within ;; ENTRY and its title, and transcode them. If ENTRY is @@ -597,7 +602,7 @@ inlinetask within the section." ;; separately. (when org-icalendar-include-sexps (let ((counter 0)) - (mapconcat 'identity + (mapconcat #'identity (org-element-map (cons (org-element-property :title entry) (org-element-contents inside)) @@ -613,7 +618,7 @@ inlinetask within the section." ;; inlinetask within it. In agenda export, this is independent ;; from the mark (or lack thereof) on the entry. (when (eq type 'headline) - (mapconcat 'identity + (mapconcat #'identity (org-element-map inside 'inlinetask (lambda (task) (org-icalendar-entry task nil info)) info) "")) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 53cc54f..2c0152b 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1526,17 +1526,16 @@ holding contextual information." (when priority (format "\\framebox{\\#%c} " priority)) title (when tags (format "\\hfill{}\\textsc{:%s:}" - (mapconcat 'identity tags ":")))))) - (format (concat "\\begin{center}\n" - "\\fbox{\n" - "\\begin{minipage}[c]{.6\\textwidth}\n" - "%s\n\n" - "\\rule[.8em]{\\textwidth}{2pt}\n\n" - "%s" - "\\end{minipage}\n" - "}\n" - "\\end{center}") - full-title contents)))))) + (mapconcat #'identity tags ":")))))) + (concat "\\begin{center}\n" + "\\fbox{\n" + "\\begin{minipage}[c]{.6\\textwidth}\n" + full-title "\n\n" + (and (org-string-nw-p contents) + (concat "\\rule[.8em]{\\textwidth}{2pt}\n\n" contents)) + "\\end{minipage}\n" + "}\n" + "\\end{center}")))))) ;;;; Italic diff --git a/lisp/ox-md.el b/lisp/ox-md.el index 1f841c8..f1c4db9 100644 --- a/lisp/ox-md.el +++ b/lisp/ox-md.el @@ -182,6 +182,14 @@ a communication channel." (and (plist-get info :with-priority) (let ((char (org-element-property :priority headline))) (and char (format "[#%c] " char))))) + (anchor + (when (plist-get info :with-toc) + (org-html--anchor + (or (org-element-property :CUSTOM_ID headline) + (concat "sec-" + (mapconcat 'number-to-string + (org-export-get-headline-number + headline info) "-")))))) ;; Headline text without tags. (heading (concat todo priority title))) (cond @@ -202,12 +210,12 @@ a communication channel." (replace-regexp-in-string "^" " " contents))))) ;; Use "Setext" style. ((eq org-md-headline-style 'setext) - (concat heading tags "\n" + (concat heading tags anchor "\n" (make-string (length heading) (if (= level 1) ?= ?-)) "\n\n" contents)) ;; Use "atx" style. - (t (concat (make-string level ?#) " " heading tags "\n\n" contents)))))) + (t (concat (make-string level ?#) " " heading tags anchor "\n\n" contents)))))) ;;;; Horizontal Rule diff --git a/lisp/ox-org.el b/lisp/ox-org.el index 3b2e55e..195b9d7 100644 --- a/lisp/ox-org.el +++ b/lisp/ox-org.el @@ -65,7 +65,7 @@ setting of `org-html-htmlize-output-type' is 'css." (entity . org-org-identity) (example-block . org-org-identity) (fixed-width . org-org-identity) - (footnote-definition . org-org-identity) + (footnote-definition . ignore) (footnote-reference . org-org-identity) (headline . org-org-headline) (horizontal-rule . org-org-identity) @@ -87,7 +87,7 @@ setting of `org-html-htmlize-output-type' is 'css." (quote-block . org-org-identity) (quote-section . org-org-identity) (radio-target . org-org-identity) - (section . org-org-identity) + (section . org-org-section) (special-block . org-org-identity) (src-block . org-org-identity) (statistics-cookie . org-org-identity) @@ -122,15 +122,16 @@ CONTENTS is its contents, as a string or nil. INFO is ignored." (defun org-org-headline (headline contents info) "Transcode HEADLINE element back into Org syntax. CONTENTS is its contents, as a string or nil. INFO is ignored." - (unless (plist-get info :with-todo-keywords) - (org-element-put-property headline :todo-keyword nil)) - (unless (plist-get info :with-tags) - (org-element-put-property headline :tags nil)) - (unless (plist-get info :with-priority) - (org-element-put-property headline :priority nil)) - (org-element-put-property headline :level - (org-export-get-relative-level headline info)) - (org-element-headline-interpreter headline contents)) + (unless (org-element-property :footnote-section-p headline) + (unless (plist-get info :with-todo-keywords) + (org-element-put-property headline :todo-keyword nil)) + (unless (plist-get info :with-tags) + (org-element-put-property headline :tags nil)) + (unless (plist-get info :with-priority) + (org-element-put-property headline :priority nil)) + (org-element-put-property headline :level + (org-export-get-relative-level headline info)) + (org-element-headline-interpreter headline contents))) (defun org-org-keyword (keyword contents info) "Transcode KEYWORD element back into Org syntax. @@ -144,6 +145,33 @@ keywords targeted at other export back-ends." org-element-block-name-alist)) (org-element-keyword-interpreter keyword nil))) +(defun org-org-section (section contents info) + "Transcode SECTION element back into Org syntax. +CONTENTS is the contents of the section. INFO is a plist used as +a communication channel." + (concat + (org-element-normalize-string contents) + ;; Insert footnote definitions appearing for the first time in this + ;; section. Indeed, some of them may not be available to narrowing + ;; so we make sure all of them are included in the result. + (let ((footnotes-alist + (org-element-map section 'footnote-reference + (lambda (fn) + (and (eq (org-element-property :type fn) 'standard) + (org-export-footnote-first-reference-p fn info) + (cons (org-element-property :label fn) + (org-export-get-footnote-definition fn info)))) + info))) + (and footnotes-alist + (concat "\n" + (mapconcat + (lambda (d) + (org-element-normalize-string + (concat (format "[%s] "(car d)) + (org-export-data (cdr d) info)))) + footnotes-alist "\n")))) + (make-string (or (org-element-property :post-blank section) 0) ?\n))) + ;;;###autoload (defun org-org-export-as-org (&optional async subtreep visible-only ext-plist) "Export current buffer to an Org buffer. @@ -1317,6 +1317,10 @@ The back-end could then be called with, for example: ;; - category :: tree ;; - type :: list of elements and objects ;; +;; + `:input-buffer' :: Name of input buffer. +;; - category :: option +;; - type :: string +;; ;; + `:input-file' :: Full path to input file, if any. ;; - category :: option ;; - type :: string or nil @@ -1765,17 +1769,19 @@ Assume buffer is in Org mode. Narrowing, if any, is ignored." (when (stringp value) (setq plist (plist-put plist property - (org-element-parse-secondary-string - value (org-element-restriction 'keyword)))))))))) + (or (org-element-parse-secondary-string + value (org-element-restriction 'keyword)) + ;; When TITLE keyword sets an empty + ;; string, make sure it doesn't + ;; appear as nil in the plist. + (and (eq property :title) "")))))))))) (defun org-export--get-buffer-attributes () "Return properties related to buffer attributes, as a plist." ;; Store full path of input file name, or nil. For internal use. (let ((visited-file (buffer-file-name (buffer-base-buffer)))) (list :input-file visited-file - :title (if (not visited-file) (buffer-name (buffer-base-buffer)) - (file-name-sans-extension - (file-name-nondirectory visited-file)))))) + :input-buffer (buffer-name (buffer-base-buffer))))) (defun org-export--get-global-options (&optional backend) "Return global export options as a plist. @@ -1788,23 +1794,22 @@ process." (all (append (and backend (org-export-get-all-options backend)) org-export-options-alist))) (dolist (cell all plist) - (let ((prop (car cell)) - (default-value (nth 3 cell))) - (unless (or (not default-value) (plist-member plist prop)) + (let ((prop (car cell))) + (unless (plist-member plist prop) (setq plist (plist-put plist prop - ;; Eval default value provided. If keyword is + ;; Evaluate default value provided. If keyword is ;; a member of `org-element-document-properties', ;; parse it as a secondary string before storing it. (let ((value (eval (nth 3 cell)))) - (if (not (stringp value)) value - (let ((keyword (nth 1 cell))) - (if (member keyword org-element-document-properties) - (org-element-parse-secondary-string - value (org-element-restriction 'keyword)) - value))))))))))) + (if (and (stringp value) + (member (nth 1 cell) + org-element-document-properties)) + (org-element-parse-secondary-string + value (org-element-restriction 'keyword)) + value))))))))) (defun org-export--list-bound-variables () "Return variables bound from BIND keywords in current buffer. @@ -1843,6 +1848,13 @@ an alist where associations are (VARIABLE-NAME VALUE)." ;; Return value in appropriate order of appearance. (nreverse (funcall collect-bind nil nil))))) +;; defsubst org-export-get-parent must be defined before first use, +;; was originally defined in the topology section + +(defsubst org-export-get-parent (blob) + "Return BLOB parent or nil. +BLOB is the element or object considered." + (org-element-property :parent blob)) ;;;; Tree Properties ;; @@ -2146,9 +2158,8 @@ INFO is a plist containing export directives." DATA is a parse tree, an element or an object or a secondary string. INFO is a plist holding export options. -Return transcoded string." - (let ((memo (gethash data (plist-get info :exported-data) 'no-memo))) - (if (not (eq memo 'no-memo)) memo +Return a string." + (or (gethash data (plist-get info :exported-data)) (let* ((type (org-element-type data)) (results (cond @@ -2174,9 +2185,9 @@ Return transcoded string." ;; Secondary string. ((not type) (mapconcat (lambda (obj) (org-export-data obj info)) data "")) - ;; Element/Object without contents or, as a special case, - ;; headline with archive tag and archived trees restricted - ;; to title only. + ;; Element/Object without contents or, as a special + ;; case, headline with archive tag and archived trees + ;; restricted to title only. ((or (not (org-element-contents data)) (and (eq type 'headline) (eq (plist-get info :with-archived-trees) 'headline) @@ -2201,16 +2212,16 @@ Return transcoded string." (lambda (element) (org-export-data element info)) (org-element-contents (if (or greaterp objectp) data - ;; Elements directly containing objects - ;; must have their indentation normalized - ;; first. + ;; Elements directly containing + ;; objects must have their indentation + ;; normalized first. (org-element-normalize-contents data - ;; When normalizing contents of the first - ;; paragraph in an item or a footnote - ;; definition, ignore first line's - ;; indentation: there is none and it - ;; might be misleading. + ;; When normalizing contents of the + ;; first paragraph in an item or + ;; a footnote definition, ignore + ;; first line's indentation: there is + ;; none and it might be misleading. (when (eq type 'paragraph) (let ((parent (org-export-get-parent data))) (and @@ -2227,10 +2238,10 @@ Return transcoded string." (puthash data (cond - ((not results) nil) + ((not results) "") ((memq type '(org-data plain-text nil)) results) - ;; Append the same white space between elements or objects as in - ;; the original buffer, and call appropriate filters. + ;; Append the same white space between elements or objects + ;; as in the original buffer, and call appropriate filters. (t (let ((results (org-export-filter-apply-functions @@ -2240,10 +2251,10 @@ Return transcoded string." (if (memq type org-element-all-elements) (concat (org-element-normalize-string results) (make-string post-blank ?\n)) - (concat results (make-string post-blank ? )))) + (concat results (make-string post-blank ?\s)))) info))) results))) - (plist-get info :exported-data)))))) + (plist-get info :exported-data))))) (defun org-export-data-with-backend (data backend info) "Convert DATA into BACKEND format. @@ -3011,6 +3022,14 @@ Return code as a string." (org-export-install-filters (org-combine-plists info (org-export-get-environment backend subtreep ext-plist)))) + ;; Special case: provide original file name or buffer name as + ;; default value for :title property. + (unless (plist-get info :title) + (plist-put + info :title + (let ((file (plist-get info :input-file))) + (if file (file-name-sans-extension (file-name-nondirectory file)) + (plist-get info :input-buffer))))) ;; Expand export-specific set of macros: {{{author}}}, ;; {{{date}}}, {{{email}}} and {{{title}}}. It must be done ;; once regular macros have been expanded, since document @@ -5106,11 +5125,7 @@ Return the new string." ;; `org-export-get-genealogy' returns the full genealogy of a given ;; element or object, from closest parent to full parse tree. -(defsubst org-export-get-parent (blob) - "Return BLOB parent or nil. -BLOB is the element or object considered." - (org-element-property :parent blob)) - +;; defsubst org-export-get-parent must be defined before first use (defun org-export-get-genealogy (blob) "Return full genealogy relative to a given element or object. |