diff options
| author | Carsten Dominik | 2007-06-21 10:27:11 +0000 |
|---|---|---|
| committer | Carsten Dominik | 2007-06-21 10:27:11 +0000 |
| commit | 5152b5975b0c9948a1f375bd2d25590c832df8b7 (patch) | |
| tree | 0eb5170c7e9988dfbc595496833db4b9826099c3 | |
| parent | dddf9c0cbbc79bf5d9ba7d871f8081688cc0aa6c (diff) | |
| download | emacs-5152b5975b0c9948a1f375bd2d25590c832df8b7.tar.gz emacs-5152b5975b0c9948a1f375bd2d25590c832df8b7.zip | |
(org-export-with-footnotes): New option.
(org-export-as-html): Fixed replacement bug for XEmacs.
(org-agenda-default-appointment-duration): New option.
| -rw-r--r-- | lisp/textmodes/org.el | 260 |
1 files changed, 185 insertions, 75 deletions
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el index f5a955a92f4..c51e8c85f21 100644 --- a/lisp/textmodes/org.el +++ b/lisp/textmodes/org.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <dominik at science dot uva dot nl> | 5 | ;; Author: Carsten Dominik <dominik at science dot uva dot nl> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ | 7 | ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ |
| 8 | ;; Version: 4.78 | 8 | ;; Version: 4.79 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -97,6 +97,16 @@ | |||
| 97 | (get-text-property 0 'test (format "%s" x))) | 97 | (get-text-property 0 'test (format "%s" x))) |
| 98 | "Does format transport text properties?") | 98 | "Does format transport text properties?") |
| 99 | 99 | ||
| 100 | (defmacro org-re (s) | ||
| 101 | "Replace posix classes in regular expression." | ||
| 102 | (if (featurep 'xemacs) | ||
| 103 | (let ((ss s)) | ||
| 104 | (save-match-data | ||
| 105 | (while (string-match "\\[:alnum:\\]" ss) | ||
| 106 | (setq ss (replace-match "a-zA-Z0-9" t t ss))) | ||
| 107 | ss)) | ||
| 108 | s)) | ||
| 109 | |||
| 100 | ;;; The custom variables | 110 | ;;; The custom variables |
| 101 | 111 | ||
| 102 | (defgroup org nil | 112 | (defgroup org nil |
| @@ -388,6 +398,16 @@ contexts. See `org-show-hierarchy-above' for valid contexts." | |||
| 388 | :tag "Org Cycle" | 398 | :tag "Org Cycle" |
| 389 | :group 'org-structure) | 399 | :group 'org-structure) |
| 390 | 400 | ||
| 401 | (defcustom org-drawers nil | ||
| 402 | "Names of drawers. Drawers are not opened by cycling on the headline above. | ||
| 403 | Drawers only open with a TAB on the drawer line itself. A drawer looks like | ||
| 404 | this: | ||
| 405 | :DRAWERNAME: | ||
| 406 | ..... | ||
| 407 | :END:" | ||
| 408 | :group 'org-structure | ||
| 409 | :type '(repeat (string :tag "Drawer Name"))) | ||
| 410 | |||
| 391 | (defcustom org-cycle-global-at-bob t | 411 | (defcustom org-cycle-global-at-bob t |
| 392 | "Cycle globally if cursor is at beginning of buffer and not at a headline. | 412 | "Cycle globally if cursor is at beginning of buffer and not at a headline. |
| 393 | This makes it possible to do global cycling without having to use S-TAB or | 413 | This makes it possible to do global cycling without having to use S-TAB or |
| @@ -432,6 +452,7 @@ Special case: when 0, never leave empty lines in collapsed view." | |||
| 432 | :type 'integer) | 452 | :type 'integer) |
| 433 | 453 | ||
| 434 | (defcustom org-cycle-hook '(org-cycle-hide-archived-subtrees | 454 | (defcustom org-cycle-hook '(org-cycle-hide-archived-subtrees |
| 455 | org-cycle-hide-drawers | ||
| 435 | org-cycle-show-empty-lines | 456 | org-cycle-show-empty-lines |
| 436 | org-optimize-window-after-visibility-change) | 457 | org-optimize-window-after-visibility-change) |
| 437 | "Hook that is run after `org-cycle' has changed the buffer visibility. | 458 | "Hook that is run after `org-cycle' has changed the buffer visibility. |
| @@ -2327,6 +2348,17 @@ the headline/diary entry." | |||
| 2327 | (const :tag "Never" nil) | 2348 | (const :tag "Never" nil) |
| 2328 | (const :tag "When at beginning of entry" beg))) | 2349 | (const :tag "When at beginning of entry" beg))) |
| 2329 | 2350 | ||
| 2351 | |||
| 2352 | (defcustom org-agenda-default-appointment-duration nil | ||
| 2353 | "Default duration for appointments that only have a starting time. | ||
| 2354 | When nil, no duration is specified in such cases. | ||
| 2355 | When non-nil, this must be the number of minutes, e.g. 60 for one hour." | ||
| 2356 | :group 'org-agenda-prefix | ||
| 2357 | :type '(choice | ||
| 2358 | (integer :tag "Minutes") | ||
| 2359 | (const :tag "No default duration"))) | ||
| 2360 | |||
| 2361 | |||
| 2330 | (defcustom org-agenda-remove-tags nil | 2362 | (defcustom org-agenda-remove-tags nil |
| 2331 | "Non-nil means, remove the tags from the headline copy in the agenda. | 2363 | "Non-nil means, remove the tags from the headline copy in the agenda. |
| 2332 | When this is the symbol `prefix', only remove tags when | 2364 | When this is the symbol `prefix', only remove tags when |
| @@ -2549,6 +2581,14 @@ This option can also be set with the +OPTIONS line, e.g. \"*:nil\"." | |||
| 2549 | :group 'org-export-translation | 2581 | :group 'org-export-translation |
| 2550 | :type 'boolean) | 2582 | :type 'boolean) |
| 2551 | 2583 | ||
| 2584 | (defcustom org-export-with-footnotes t | ||
| 2585 | "If nil, export [1] as a footnote marker. | ||
| 2586 | Lines starting with [1] will be formatted as footnotes. | ||
| 2587 | |||
| 2588 | This option can also be set with the +OPTIONS line, e.g. \"f:nil\"." | ||
| 2589 | :group 'org-export-translation | ||
| 2590 | :type 'boolean) | ||
| 2591 | |||
| 2552 | (defcustom org-export-with-sub-superscripts t | 2592 | (defcustom org-export-with-sub-superscripts t |
| 2553 | "Non-nil means, interpret \"_\" and \"^\" for export. | 2593 | "Non-nil means, interpret \"_\" and \"^\" for export. |
| 2554 | When this option is turned on, you can use TeX-like syntax for sub- and | 2594 | When this option is turned on, you can use TeX-like syntax for sub- and |
| @@ -3008,6 +3048,8 @@ Use customize to modify this, or restart Emacs after changing it." | |||
| 3008 | :tag "Org Faces" | 3048 | :tag "Org Faces" |
| 3009 | :group 'org-font-lock) | 3049 | :group 'org-font-lock) |
| 3010 | 3050 | ||
| 3051 | ;; FIXME: convert that into a macro? Not critical, because this | ||
| 3052 | ;; is only executed a few times at load time. | ||
| 3011 | (defun org-compatible-face (specs) | 3053 | (defun org-compatible-face (specs) |
| 3012 | "Make a compatible face specification. | 3054 | "Make a compatible face specification. |
| 3013 | XEmacs and Emacs 21 do not know about the `min-colors' attribute. | 3055 | XEmacs and Emacs 21 do not know about the `min-colors' attribute. |
| @@ -3285,6 +3327,9 @@ to the part of the headline after the DONE keyword." | |||
| 3285 | 3327 | ||
| 3286 | ;;; Variables for pre-computed regular expressions, all buffer local | 3328 | ;;; Variables for pre-computed regular expressions, all buffer local |
| 3287 | 3329 | ||
| 3330 | (defvar org-drawer-regexp nil | ||
| 3331 | "Matches first line of a hidden block.") | ||
| 3332 | (make-variable-buffer-local 'org-drawer-regexp) | ||
| 3288 | (defvar org-todo-regexp nil | 3333 | (defvar org-todo-regexp nil |
| 3289 | "Matches any of the TODO state keywords.") | 3334 | "Matches any of the TODO state keywords.") |
| 3290 | (make-variable-buffer-local 'org-todo-regexp) | 3335 | (make-variable-buffer-local 'org-todo-regexp) |
| @@ -3508,7 +3553,7 @@ means to push this value onto the list in the variable.") | |||
| 3508 | (cond | 3553 | (cond |
| 3509 | ((equal e "{") (push '(:startgroup) tgs)) | 3554 | ((equal e "{") (push '(:startgroup) tgs)) |
| 3510 | ((equal e "}") (push '(:endgroup) tgs)) | 3555 | ((equal e "}") (push '(:endgroup) tgs)) |
| 3511 | ((string-match "^\\([[:alnum:]_@]+\\)(\\(.\\))$" e) | 3556 | ((string-match (org-re "^\\([[:alnum:]_@]+\\)(\\(.\\))$") e) |
| 3512 | (push (cons (match-string 1 e) | 3557 | (push (cons (match-string 1 e) |
| 3513 | (string-to-char (match-string 2 e))) | 3558 | (string-to-char (match-string 2 e))) |
| 3514 | tgs)) | 3559 | tgs)) |
| @@ -3524,6 +3569,10 @@ means to push this value onto the list in the variable.") | |||
| 3524 | (setq org-done-keywords (list (org-last org-todo-keywords-1)))) | 3569 | (setq org-done-keywords (list (org-last org-todo-keywords-1)))) |
| 3525 | (setq org-ds-keyword-length (+ 2 (max (length org-deadline-string) | 3570 | (setq org-ds-keyword-length (+ 2 (max (length org-deadline-string) |
| 3526 | (length org-scheduled-string))) | 3571 | (length org-scheduled-string))) |
| 3572 | org-drawer-regexp | ||
| 3573 | (concat "^[ \t]*:\\(" | ||
| 3574 | (mapconcat 'regexp-quote org-drawers "\\|") | ||
| 3575 | "\\):[ \t]*$") | ||
| 3527 | org-not-done-keywords | 3576 | org-not-done-keywords |
| 3528 | (org-delete-all org-done-keywords (copy-sequence org-todo-keywords-1)) | 3577 | (org-delete-all org-done-keywords (copy-sequence org-todo-keywords-1)) |
| 3529 | org-todo-regexp | 3578 | org-todo-regexp |
| @@ -3544,7 +3593,8 @@ means to push this value onto the list in the variable.") | |||
| 3544 | org-todo-line-tags-regexp | 3593 | org-todo-line-tags-regexp |
| 3545 | (concat "^\\(\\*+\\)[ \t]*\\(?:\\(" | 3594 | (concat "^\\(\\*+\\)[ \t]*\\(?:\\(" |
| 3546 | (mapconcat 'regexp-quote org-todo-keywords-1 "\\|") | 3595 | (mapconcat 'regexp-quote org-todo-keywords-1 "\\|") |
| 3547 | "\\)\\>\\)? *\\(.*?\\([ \t]:[[:alnum:]:_@]+:[ \t]*\\)?$\\)") | 3596 | (org-re |
| 3597 | "\\)\\>\\)? *\\(.*?\\([ \t]:[[:alnum:]:_@]+:[ \t]*\\)?$\\)")) | ||
| 3548 | org-looking-at-done-regexp | 3598 | org-looking-at-done-regexp |
| 3549 | (concat "^" "\\(?:" | 3599 | (concat "^" "\\(?:" |
| 3550 | (mapconcat 'regexp-quote org-done-keywords "\\|") "\\)" | 3600 | (mapconcat 'regexp-quote org-done-keywords "\\|") "\\)" |
| @@ -3973,7 +4023,7 @@ that will be added to PLIST. Returns the string that was modified." | |||
| 3973 | "Matches plain link, without spaces.") | 4023 | "Matches plain link, without spaces.") |
| 3974 | 4024 | ||
| 3975 | (defconst org-bracket-link-regexp | 4025 | (defconst org-bracket-link-regexp |
| 3976 | "\\[\\[\\([^]]+\\)\\]\\(\\[\\([^]]+\\)\\]\\)?\\]" | 4026 | "\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]" |
| 3977 | "Matches a link in double brackets.") | 4027 | "Matches a link in double brackets.") |
| 3978 | 4028 | ||
| 3979 | (defconst org-bracket-link-analytic-regexp | 4029 | (defconst org-bracket-link-analytic-regexp |
| @@ -4249,7 +4299,7 @@ between words." | |||
| 4249 | "\\)\\>"))) | 4299 | "\\)\\>"))) |
| 4250 | 4300 | ||
| 4251 | (defun org-activate-tags (limit) | 4301 | (defun org-activate-tags (limit) |
| 4252 | (if (re-search-forward "[ \t]\\(:[[:alnum:]_@:]+:\\)[ \r\n]" limit t) | 4302 | (if (re-search-forward (org-re "[ \t]\\(:[[:alnum:]_@:]+:\\)[ \r\n]") limit t) |
| 4253 | (progn | 4303 | (progn |
| 4254 | (add-text-properties (match-beginning 1) (match-end 1) | 4304 | (add-text-properties (match-beginning 1) (match-end 1) |
| 4255 | (list 'mouse-face 'highlight | 4305 | (list 'mouse-face 'highlight |
| @@ -4426,6 +4476,14 @@ between words." | |||
| 4426 | (org-table-justify-field-maybe) | 4476 | (org-table-justify-field-maybe) |
| 4427 | (call-interactively 'org-table-next-field))))) | 4477 | (call-interactively 'org-table-next-field))))) |
| 4428 | 4478 | ||
| 4479 | ((and org-drawers | ||
| 4480 | (save-excursion | ||
| 4481 | (beginning-of-line 1) | ||
| 4482 | (looking-at org-drawer-regexp))) | ||
| 4483 | ;; Toggle block visibility | ||
| 4484 | (org-flag-drawer | ||
| 4485 | (not (get-char-property (match-end 0) 'invisible)))) | ||
| 4486 | |||
| 4429 | ((eq arg t) ;; Global cycling | 4487 | ((eq arg t) ;; Global cycling |
| 4430 | 4488 | ||
| 4431 | (cond | 4489 | (cond |
| @@ -6100,7 +6158,8 @@ this heading." | |||
| 6100 | (progn | 6158 | (progn |
| 6101 | (if (re-search-forward | 6159 | (if (re-search-forward |
| 6102 | (concat "\\(^\\|\r\\)" | 6160 | (concat "\\(^\\|\r\\)" |
| 6103 | (regexp-quote heading) "[ \t]*\\(:[[:alnum:]_@:]+:\\)?[ \t]*\\($\\|\r\\)") | 6161 | (regexp-quote heading) |
| 6162 | (org-re "[ \t]*\\(:[[:alnum:]_@:]+:\\)?[ \t]*\\($\\|\r\\)")) | ||
| 6104 | nil t) | 6163 | nil t) |
| 6105 | (goto-char (match-end 0)) | 6164 | (goto-char (match-end 0)) |
| 6106 | ;; Heading not found, just insert it at the end | 6165 | ;; Heading not found, just insert it at the end |
| @@ -6182,6 +6241,28 @@ When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag." | |||
| 6182 | (goto-char end))))) | 6241 | (goto-char end))))) |
| 6183 | (message "%d trees archived" cntarch))) | 6242 | (message "%d trees archived" cntarch))) |
| 6184 | 6243 | ||
| 6244 | (defun org-cycle-hide-drawers (state) | ||
| 6245 | "Re-hide all archived subtrees after a visibility state change." | ||
| 6246 | (when (not (memq state '(overview folded))) | ||
| 6247 | (save-excursion | ||
| 6248 | (let* ((globalp (memq state '(contents all))) | ||
| 6249 | (beg (if globalp (point-min) (point))) | ||
| 6250 | (end (if globalp (point-max) (org-end-of-subtree t)))) | ||
| 6251 | (goto-char beg) | ||
| 6252 | (while (re-search-forward org-drawer-regexp end t) | ||
| 6253 | (org-flag-drawer t)))))) | ||
| 6254 | |||
| 6255 | (defun org-flag-drawer (flag) | ||
| 6256 | (save-excursion | ||
| 6257 | (beginning-of-line 1) | ||
| 6258 | (when (looking-at "^[ \t]*:[a-zA-Z][a-zA-Z0-9]*:") | ||
| 6259 | (let ((b (match-end 0))) | ||
| 6260 | (if (re-search-forward | ||
| 6261 | "^[ \t]*:END:" | ||
| 6262 | (save-excursion (outline-next-heading) (point)) t) | ||
| 6263 | (outline-flag-region b (point-at-eol) flag) | ||
| 6264 | (error ":END: line missing")))))) | ||
| 6265 | |||
| 6185 | (defun org-cycle-hide-archived-subtrees (state) | 6266 | (defun org-cycle-hide-archived-subtrees (state) |
| 6186 | "Re-hide all archived subtrees after a visibility state change." | 6267 | "Re-hide all archived subtrees after a visibility state change." |
| 6187 | (when (and (not org-cycle-open-archived-trees) | 6268 | (when (and (not org-cycle-open-archived-trees) |
| @@ -6219,7 +6300,7 @@ If ONOFF is `on' or `off', don't toggle but set to this state." | |||
| 6219 | (let (res current) | 6300 | (let (res current) |
| 6220 | (save-excursion | 6301 | (save-excursion |
| 6221 | (beginning-of-line) | 6302 | (beginning-of-line) |
| 6222 | (if (re-search-forward "[ \t]:\\([[:alnum:]_@:]+\\):[ \t]*$" | 6303 | (if (re-search-forward (org-re "[ \t]:\\([[:alnum:]_@:]+\\):[ \t]*$") |
| 6223 | (point-at-eol) t) | 6304 | (point-at-eol) t) |
| 6224 | (progn | 6305 | (progn |
| 6225 | (setq current (match-string 1)) | 6306 | (setq current (match-string 1)) |
| @@ -8168,8 +8249,8 @@ not overwrite the stored one." | |||
| 8168 | n)))) | 8249 | n)))) |
| 8169 | (setq fmt (replace-match "" t t fmt))) | 8250 | (setq fmt (replace-match "" t t fmt))) |
| 8170 | (if (string-match "[NT]" fmt) | 8251 | (if (string-match "[NT]" fmt) |
| 8171 | (setq numbers (equal (match-string 0 fmt) "N")) | 8252 | (setq numbers (equal (match-string 0 fmt) "N") |
| 8172 | fmt (replace-match "" t t fmt)) | 8253 | fmt (replace-match "" t t fmt))) |
| 8173 | (if (string-match "L" fmt) | 8254 | (if (string-match "L" fmt) |
| 8174 | (setq literal t | 8255 | (setq literal t |
| 8175 | fmt (replace-match "" t t fmt))) | 8256 | fmt (replace-match "" t t fmt))) |
| @@ -10198,7 +10279,7 @@ according to FMT (default from `org-email-link-description-format')." | |||
| 10198 | ;; We are using a headline, clean up garbage in there. | 10279 | ;; We are using a headline, clean up garbage in there. |
| 10199 | (if (string-match org-todo-regexp s) | 10280 | (if (string-match org-todo-regexp s) |
| 10200 | (setq s (replace-match "" t t s))) | 10281 | (setq s (replace-match "" t t s))) |
| 10201 | (if (string-match ":[[:alnum:]_@:]+:[ \t]*$" s) | 10282 | (if (string-match (org-re ":[[:alnum:]_@:]+:[ \t]*$") s) |
| 10202 | (setq s (replace-match "" t t s))) | 10283 | (setq s (replace-match "" t t s))) |
| 10203 | (setq s (org-trim s)) | 10284 | (setq s (org-trim s)) |
| 10204 | (if (string-match (concat "^\\(" org-quote-string "\\|" | 10285 | (if (string-match (concat "^\\(" org-quote-string "\\|" |
| @@ -10552,7 +10633,7 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file." | |||
| 10552 | path (match-string 1)) | 10633 | path (match-string 1)) |
| 10553 | (throw 'match t)) | 10634 | (throw 'match t)) |
| 10554 | (save-excursion | 10635 | (save-excursion |
| 10555 | (when (org-in-regexp "\\(:[[:alnum:]_@:]+\\):[ \t]*$") | 10636 | (when (org-in-regexp (org-re "\\(:[[:alnum:]_@:]+\\):[ \t]*$")) |
| 10556 | (setq type "tags" | 10637 | (setq type "tags" |
| 10557 | path (match-string 1)) | 10638 | path (match-string 1)) |
| 10558 | (while (string-match ":" path) | 10639 | (while (string-match ":" path) |
| @@ -10780,7 +10861,7 @@ in all files. If AVOID-POS is given, ignore matches near that position." | |||
| 10780 | (when (equal (string-to-char s) ?*) | 10861 | (when (equal (string-to-char s) ?*) |
| 10781 | ;; Anchor on headlines, post may include tags. | 10862 | ;; Anchor on headlines, post may include tags. |
| 10782 | (setq pre "^\\*+[ \t]*\\(?:\\sw+\\)?[ \t]*" | 10863 | (setq pre "^\\*+[ \t]*\\(?:\\sw+\\)?[ \t]*" |
| 10783 | post "[ \t]*\\(?:[ \t]+:[[:alnum:]_@:+]:[ \t]*\\)?$" | 10864 | post (org-re "[ \t]*\\(?:[ \t]+:[[:alnum:]_@:+]:[ \t]*\\)?$") |
| 10784 | s (substring s 1))) | 10865 | s (substring s 1))) |
| 10785 | (remove-text-properties | 10866 | (remove-text-properties |
| 10786 | 0 (length s) | 10867 | 0 (length s) |
| @@ -11533,7 +11614,7 @@ See also the variable `org-reverse-note-order'." | |||
| 11533 | (goto-char (point-min)) | 11614 | (goto-char (point-min)) |
| 11534 | (if (re-search-forward | 11615 | (if (re-search-forward |
| 11535 | (concat "^\\*+[ \t]+" (regexp-quote heading) | 11616 | (concat "^\\*+[ \t]+" (regexp-quote heading) |
| 11536 | "\\([ \t]+:[[:alnum:]@_:]*\\)?[ \t]*$") | 11617 | (org-re "\\([ \t]+:[[:alnum:]@_:]*\\)?[ \t]*$")) |
| 11537 | nil t) | 11618 | nil t) |
| 11538 | (setq org-goto-start-pos (match-beginning 0)))) | 11619 | (setq org-goto-start-pos (match-beginning 0)))) |
| 11539 | 11620 | ||
| @@ -11727,7 +11808,7 @@ At all other locations, this simply calls `ispell-complete-word'." | |||
| 11727 | (catch 'exit | 11808 | (catch 'exit |
| 11728 | (let* ((end (point)) | 11809 | (let* ((end (point)) |
| 11729 | (beg1 (save-excursion | 11810 | (beg1 (save-excursion |
| 11730 | (skip-chars-backward "[:alnum:]_@") | 11811 | (skip-chars-backward (org-re "[:alnum:]_@")) |
| 11731 | (point))) | 11812 | (point))) |
| 11732 | (beg (save-excursion | 11813 | (beg (save-excursion |
| 11733 | (skip-chars-backward "a-zA-Z0-9_:$") | 11814 | (skip-chars-backward "a-zA-Z0-9_:$") |
| @@ -12090,7 +12171,13 @@ be removed." | |||
| 12090 | (looking-at (concat outline-regexp "\\( *\\)[^\r\n]*")) | 12171 | (looking-at (concat outline-regexp "\\( *\\)[^\r\n]*")) |
| 12091 | (goto-char (match-end 1)) | 12172 | (goto-char (match-end 1)) |
| 12092 | (setq col (current-column)) | 12173 | (setq col (current-column)) |
| 12093 | (goto-char (1+ (match-end 0))) | 12174 | (goto-char (match-end 0)) |
| 12175 | (if (eobp) (insert "\n")) | ||
| 12176 | (forward-char 1) | ||
| 12177 | (when (looking-at "[ \t]*:PROPERTIES:[ \t]*$") | ||
| 12178 | (goto-char (match-end 0)) | ||
| 12179 | (if (eobp) (insert "\n")) | ||
| 12180 | (forward-char 1)) | ||
| 12094 | (if (and (not (looking-at outline-regexp)) | 12181 | (if (and (not (looking-at outline-regexp)) |
| 12095 | (looking-at (concat "[^\r\n]*?" org-keyword-time-regexp | 12182 | (looking-at (concat "[^\r\n]*?" org-keyword-time-regexp |
| 12096 | "[^\r\n]*")) | 12183 | "[^\r\n]*")) |
| @@ -12344,7 +12431,7 @@ from the `before-change-functions' in the current buffer." | |||
| 12344 | 12431 | ||
| 12345 | (defun org-priority (&optional action) | 12432 | (defun org-priority (&optional action) |
| 12346 | "Change the priority of an item by ARG. | 12433 | "Change the priority of an item by ARG. |
| 12347 | ACTION can be set, up, or down." | 12434 | ACTION can be `set', `up', `down', or a character." |
| 12348 | (interactive) | 12435 | (interactive) |
| 12349 | (setq action (or action 'set)) | 12436 | (setq action (or action 'set)) |
| 12350 | (let (current new news have remove) | 12437 | (let (current new news have remove) |
| @@ -12355,9 +12442,11 @@ ACTION can be set, up, or down." | |||
| 12355 | have t) | 12442 | have t) |
| 12356 | (setq current org-default-priority)) | 12443 | (setq current org-default-priority)) |
| 12357 | (cond | 12444 | (cond |
| 12358 | ((eq action 'set) | 12445 | ((or (eq action 'set) (integerp action)) |
| 12359 | (message "Priority %c-%c, SPC to remove: " org-highest-priority org-lowest-priority) | 12446 | (if (integerp action) |
| 12360 | (setq new (read-char-exclusive)) | 12447 | (setq new action) |
| 12448 | (message "Priority %c-%c, SPC to remove: " org-highest-priority org-lowest-priority) | ||
| 12449 | (setq new (read-char-exclusive))) | ||
| 12361 | (cond ((equal new ?\ ) (setq remove t)) | 12450 | (cond ((equal new ?\ ) (setq remove t)) |
| 12362 | ((or (< (upcase new) org-highest-priority) (> (upcase new) org-lowest-priority)) | 12451 | ((or (< (upcase new) org-highest-priority) (> (upcase new) org-lowest-priority)) |
| 12363 | (error "Priority must be between `%c' and `%c'" | 12452 | (error "Priority must be between `%c' and `%c'" |
| @@ -12405,7 +12494,8 @@ inclusion. When TODO-ONLY is non-nil, only lines with a TODO keyword | |||
| 12405 | are included in the output." | 12494 | are included in the output." |
| 12406 | (let* ((re (concat "[\n\r]" outline-regexp " *\\(\\<\\(" | 12495 | (let* ((re (concat "[\n\r]" outline-regexp " *\\(\\<\\(" |
| 12407 | (mapconcat 'regexp-quote org-todo-keywords-1 "\\|") | 12496 | (mapconcat 'regexp-quote org-todo-keywords-1 "\\|") |
| 12408 | "\\>\\)\\)? *\\(.*?\\)\\(:[[:alnum:]_@:]+:\\)?[ \t]*$")) | 12497 | (org-re |
| 12498 | "\\>\\)\\)? *\\(.*?\\)\\(:[[:alnum:]_@:]+:\\)?[ \t]*$"))) | ||
| 12409 | (props (list 'face nil | 12499 | (props (list 'face nil |
| 12410 | 'done-face 'org-done | 12500 | 'done-face 'org-done |
| 12411 | 'undone-face nil | 12501 | 'undone-face nil |
| @@ -12502,7 +12592,7 @@ also TODO lines." | |||
| 12502 | 12592 | ||
| 12503 | ;; Parse the string and create a lisp form | 12593 | ;; Parse the string and create a lisp form |
| 12504 | (let ((match0 match) | 12594 | (let ((match0 match) |
| 12505 | (re "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL=\\([0-9]+\\)\\|[[:alnum:]_@]+\\)") | 12595 | (re (org-re "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL=\\([0-9]+\\)\\|[[:alnum:]_@]+\\)")) |
| 12506 | minus tag mm | 12596 | minus tag mm |
| 12507 | tagsmatch todomatch tagsmatcher todomatcher kwd matcher | 12597 | tagsmatch todomatch tagsmatcher todomatcher kwd matcher |
| 12508 | orterms term orlist re-p level-p) | 12598 | orterms term orlist re-p level-p) |
| @@ -12722,7 +12812,8 @@ Returns the new tags string, or nil to not change the current settings." | |||
| 12722 | groups ingroup) | 12812 | groups ingroup) |
| 12723 | (save-excursion | 12813 | (save-excursion |
| 12724 | (beginning-of-line 1) | 12814 | (beginning-of-line 1) |
| 12725 | (if (looking-at ".*[ \t]\\(:[[:alnum:]_@:]+:\\)[ \t]*\\(\r\\|$\\)") | 12815 | (if (looking-at |
| 12816 | (org-re ".*[ \t]\\(:[[:alnum:]_@:]+:\\)[ \t]*\\(\r\\|$\\)")) | ||
| 12726 | (setq ov-start (match-beginning 1) | 12817 | (setq ov-start (match-beginning 1) |
| 12727 | ov-end (match-end 1) | 12818 | ov-end (match-end 1) |
| 12728 | ov-prefix "") | 12819 | ov-prefix "") |
| @@ -12857,7 +12948,8 @@ Returns the new tags string, or nil to not change the current settings." | |||
| 12857 | (delete-region (point) (point-at-eol)) | 12948 | (delete-region (point) (point-at-eol)) |
| 12858 | (org-fast-tag-insert "Current" current c-face) | 12949 | (org-fast-tag-insert "Current" current c-face) |
| 12859 | (org-set-current-tags-overlay current ov-prefix) | 12950 | (org-set-current-tags-overlay current ov-prefix) |
| 12860 | (while (re-search-forward "\\[.\\] \\([[:alnum:]_@]+\\)" nil t) | 12951 | (while (re-search-forward |
| 12952 | (org-re "\\[.\\] \\([[:alnum:]_@]+\\)") nil t) | ||
| 12861 | (setq tg (match-string 1)) | 12953 | (setq tg (match-string 1)) |
| 12862 | (add-text-properties (match-beginning 1) (match-end 1) | 12954 | (add-text-properties (match-beginning 1) (match-end 1) |
| 12863 | (list 'face | 12955 | (list 'face |
| @@ -12877,7 +12969,7 @@ Returns the new tags string, or nil to not change the current settings." | |||
| 12877 | (error "Not on a heading")) | 12969 | (error "Not on a heading")) |
| 12878 | (save-excursion | 12970 | (save-excursion |
| 12879 | (beginning-of-line 1) | 12971 | (beginning-of-line 1) |
| 12880 | (if (looking-at ".*[ \t]\\(:[[:alnum:]_@:]+:\\)[ \t]*\\(\r\\|$\\)") | 12972 | (if (looking-at (org-re ".*[ \t]\\(:[[:alnum:]_@:]+:\\)[ \t]*\\(\r\\|$\\)")) |
| 12881 | (org-match-string-no-properties 1) | 12973 | (org-match-string-no-properties 1) |
| 12882 | ""))) | 12974 | ""))) |
| 12883 | 12975 | ||
| @@ -12886,7 +12978,8 @@ Returns the new tags string, or nil to not change the current settings." | |||
| 12886 | (let (tags) | 12978 | (let (tags) |
| 12887 | (save-excursion | 12979 | (save-excursion |
| 12888 | (goto-char (point-min)) | 12980 | (goto-char (point-min)) |
| 12889 | (while (re-search-forward "[ \t]:\\([[:alnum:]_@:]+\\):[ \t\r\n]" nil t) | 12981 | (while (re-search-forward |
| 12982 | (org-re "[ \t]:\\([[:alnum:]_@:]+\\):[ \t\r\n]") nil t) | ||
| 12890 | (mapc (lambda (x) (add-to-list 'tags x)) | 12983 | (mapc (lambda (x) (add-to-list 'tags x)) |
| 12891 | (org-split-string (org-match-string-no-properties 1) ":")))) | 12984 | (org-split-string (org-match-string-no-properties 1) ":")))) |
| 12892 | (mapcar 'list tags))) | 12985 | (mapcar 'list tags))) |
| @@ -13593,8 +13686,9 @@ With prefix ARG, change that many days." | |||
| 13593 | ((org-pos-in-match-range pos 8) 'minute) | 13686 | ((org-pos-in-match-range pos 8) 'minute) |
| 13594 | ((or (org-pos-in-match-range pos 4) | 13687 | ((or (org-pos-in-match-range pos 4) |
| 13595 | (org-pos-in-match-range pos 5)) 'day) | 13688 | (org-pos-in-match-range pos 5)) 'day) |
| 13596 | ((and (> pos (match-end 8)) (< pos (match-end 0))) | 13689 | ((and (> pos (or (match-end 8) (match-end 5))) |
| 13597 | (- pos (match-end 8))) | 13690 | (< pos (match-end 0))) |
| 13691 | (- pos (or (match-end 8) (match-end 5)))) | ||
| 13598 | (t 'day)))) | 13692 | (t 'day)))) |
| 13599 | ans)) | 13693 | ans)) |
| 13600 | 13694 | ||
| @@ -14108,7 +14202,7 @@ the returned times will be formatted strings." | |||
| 14108 | (when (setq time (get-text-property p :org-clock-minutes)) | 14202 | (when (setq time (get-text-property p :org-clock-minutes)) |
| 14109 | (save-excursion | 14203 | (save-excursion |
| 14110 | (beginning-of-line 1) | 14204 | (beginning-of-line 1) |
| 14111 | (when (and (looking-at "\\(\\*+\\)[ \t]+\\(.*?\\)\\([ \t]+:[[:alnum:]_@:]+:\\)?[ \t]*$") | 14205 | (when (and (looking-at (org-re "\\(\\*+\\)[ \t]+\\(.*?\\)\\([ \t]+:[[:alnum:]_@:]+:\\)?[ \t]*$")) |
| 14112 | (setq level (- (match-end 1) (match-beginning 1))) | 14206 | (setq level (- (match-end 1) (match-beginning 1))) |
| 14113 | (<= level maxlevel)) | 14207 | (<= level maxlevel)) |
| 14114 | (setq hlc (if emph (or (cdr (assoc level hlchars)) "") "") | 14208 | (setq hlc (if emph (or (cdr (assoc level hlchars)) "") "") |
| @@ -15686,10 +15780,10 @@ MATCH is being ignored." | |||
| 15686 | "\\)\\>")) | 15780 | "\\)\\>")) |
| 15687 | (tags (nth 2 org-stuck-projects)) | 15781 | (tags (nth 2 org-stuck-projects)) |
| 15688 | (tags-re (if (member "*" tags) | 15782 | (tags-re (if (member "*" tags) |
| 15689 | "^\\*+.*:[[:alnum:]_@]+:[ \t]*$" | 15783 | (org-re "^\\*+.*:[[:alnum:]_@]+:[ \t]*$") |
| 15690 | (concat "^\\*+.*:\\(" | 15784 | (concat "^\\*+.*:\\(" |
| 15691 | (mapconcat 'identity tags "\\|") | 15785 | (mapconcat 'identity tags "\\|") |
| 15692 | "\\):[[:alnum:]_@:]*[ \t]*$"))) | 15786 | (org-re "\\):[[:alnum:]_@:]*[ \t]*$")))) |
| 15693 | (gen-re (nth 3 org-stuck-projects)) | 15787 | (gen-re (nth 3 org-stuck-projects)) |
| 15694 | (re-list | 15788 | (re-list |
| 15695 | (delq nil | 15789 | (delq nil |
| @@ -16450,7 +16544,17 @@ only the correctly processes TXT should be returned - this is used by | |||
| 16450 | (if s1 (setq s1 (org-get-time-of-day s1 'string t))) | 16544 | (if s1 (setq s1 (org-get-time-of-day s1 'string t))) |
| 16451 | (if s2 (setq s2 (org-get-time-of-day s2 'string t)))) | 16545 | (if s2 (setq s2 (org-get-time-of-day s2 'string t)))) |
| 16452 | 16546 | ||
| 16453 | (when (string-match "\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$" txt) | 16547 | (when (and s1 (not s2) org-agenda-default-appointment-duration |
| 16548 | (string-match "\\([0-9]+\\):\\([0-9]+\\)" s1)) | ||
| 16549 | (let ((m (+ (string-to-number (match-string 2 s1)) | ||
| 16550 | (* 60 (string-to-number (match-string 1 s1))) | ||
| 16551 | org-agenda-default-appointment-duration)) | ||
| 16552 | h) | ||
| 16553 | (setq h (/ m 60) m (- m (* h 60))) | ||
| 16554 | (setq s2 (format "%02d:%02d" h m)))) | ||
| 16555 | |||
| 16556 | (when (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$") | ||
| 16557 | txt) | ||
| 16454 | ;; Tags are in the string | 16558 | ;; Tags are in the string |
| 16455 | (if (or (eq org-agenda-remove-tags t) | 16559 | (if (or (eq org-agenda-remove-tags t) |
| 16456 | (and org-agenda-remove-tags | 16560 | (and org-agenda-remove-tags |
| @@ -17189,7 +17293,7 @@ the new TODO state." | |||
| 17189 | (let ((buffer-read-only)) | 17293 | (let ((buffer-read-only)) |
| 17190 | (save-excursion | 17294 | (save-excursion |
| 17191 | (goto-char (if line (point-at-bol) (point-min))) | 17295 | (goto-char (if line (point-at-bol) (point-min))) |
| 17192 | (while (re-search-forward "\\([ \t]+\\):[[:alnum:]_@:]+:[ \t]*$" | 17296 | (while (re-search-forward (org-re "\\([ \t]+\\):[[:alnum:]_@:]+:[ \t]*$") |
| 17193 | (if line (point-at-eol) nil) t) | 17297 | (if line (point-at-eol) nil) t) |
| 17194 | (delete-region (match-beginning 1) (match-end 1)) | 17298 | (delete-region (match-beginning 1) (match-end 1)) |
| 17195 | (goto-char (match-beginning 1)) | 17299 | (goto-char (match-beginning 1)) |
| @@ -17250,7 +17354,7 @@ the tags of the current headline come last." | |||
| 17250 | (org-back-to-heading t) | 17354 | (org-back-to-heading t) |
| 17251 | (condition-case nil | 17355 | (condition-case nil |
| 17252 | (while t | 17356 | (while t |
| 17253 | (if (looking-at "[^\r\n]+?:\\([[:alnum:]_@:]+\\):[ \t]*\\([\n\r]\\|\\'\\)") | 17357 | (if (looking-at (org-re "[^\r\n]+?:\\([[:alnum:]_@:]+\\):[ \t]*\\([\n\r]\\|\\'\\)")) |
| 17254 | (setq tags (append (org-split-string | 17358 | (setq tags (append (org-split-string |
| 17255 | (org-match-string-no-properties 1) ":") | 17359 | (org-match-string-no-properties 1) ":") |
| 17256 | tags))) | 17360 | tags))) |
| @@ -17917,6 +18021,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]." | |||
| 17917 | (:archived-trees . org-export-with-archived-trees) | 18021 | (:archived-trees . org-export-with-archived-trees) |
| 17918 | (:emphasize . org-export-with-emphasize) | 18022 | (:emphasize . org-export-with-emphasize) |
| 17919 | (:sub-superscript . org-export-with-sub-superscripts) | 18023 | (:sub-superscript . org-export-with-sub-superscripts) |
| 18024 | (:footnotes . org-export-with-footnotes) | ||
| 17920 | (:TeX-macros . org-export-with-TeX-macros) | 18025 | (:TeX-macros . org-export-with-TeX-macros) |
| 17921 | (:LaTeX-fragments . org-export-with-LaTeX-fragments) | 18026 | (:LaTeX-fragments . org-export-with-LaTeX-fragments) |
| 17922 | (:skip-before-1st-heading . org-export-skip-text-before-1st-heading) | 18027 | (:skip-before-1st-heading . org-export-skip-text-before-1st-heading) |
| @@ -17973,6 +18078,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]." | |||
| 17973 | (":" . :fixed-width) | 18078 | (":" . :fixed-width) |
| 17974 | ("|" . :tables) | 18079 | ("|" . :tables) |
| 17975 | ("^" . :sub-superscript) | 18080 | ("^" . :sub-superscript) |
| 18081 | ("f" . :footnotes) | ||
| 17976 | ("*" . :emphasize) | 18082 | ("*" . :emphasize) |
| 17977 | ("TeX" . :TeX-macros) | 18083 | ("TeX" . :TeX-macros) |
| 17978 | ("LaTeX" . :LaTeX-fragments) | 18084 | ("LaTeX" . :LaTeX-fragments) |
| @@ -18720,7 +18826,9 @@ underlined headlines. The default is 3." | |||
| 18720 | (setq txt (org-html-expand-for-ascii txt)) | 18826 | (setq txt (org-html-expand-for-ascii txt)) |
| 18721 | 18827 | ||
| 18722 | (if (and (memq org-export-with-tags '(not-in-toc nil)) | 18828 | (if (and (memq org-export-with-tags '(not-in-toc nil)) |
| 18723 | (string-match "[ \t]+:[[:alnum:]_@:]+:[ \t]*$" txt)) | 18829 | (string-match |
| 18830 | (org-re "[ \t]+:[[:alnum:]_@:]+:[ \t]*$") | ||
| 18831 | txt)) | ||
| 18724 | (setq txt (replace-match "" t t txt))) | 18832 | (setq txt (replace-match "" t t txt))) |
| 18725 | (if (string-match quote-re0 txt) | 18833 | (if (string-match quote-re0 txt) |
| 18726 | (setq txt (replace-match "" t t txt))) | 18834 | (setq txt (replace-match "" t t txt))) |
| @@ -18867,7 +18975,7 @@ underlined headlines. The default is 3." | |||
| 18867 | (insert "\n")) | 18975 | (insert "\n")) |
| 18868 | (setq char (nth (- umax level) (reverse org-export-ascii-underline))) | 18976 | (setq char (nth (- umax level) (reverse org-export-ascii-underline))) |
| 18869 | (unless org-export-with-tags | 18977 | (unless org-export-with-tags |
| 18870 | (if (string-match "[ \t]+\\(:[[:alnum:]_@:]+:\\)[ \t]*$" title) | 18978 | (if (string-match (org-re "[ \t]+\\(:[[:alnum:]_@:]+:\\)[ \t]*$") title) |
| 18871 | (setq title (replace-match "" t t title)))) | 18979 | (setq title (replace-match "" t t title)))) |
| 18872 | (if org-export-with-section-numbers | 18980 | (if org-export-with-section-numbers |
| 18873 | (setq title (concat (org-section-number level) " " title))) | 18981 | (setq title (concat (org-section-number level) " " title))) |
| @@ -18953,7 +19061,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff." | |||
| 18953 | #+EMAIL: %s | 19061 | #+EMAIL: %s |
| 18954 | #+LANGUAGE: %s | 19062 | #+LANGUAGE: %s |
| 18955 | #+TEXT: Some descriptive text to be emitted. Several lines OK. | 19063 | #+TEXT: Some descriptive text to be emitted. Several lines OK. |
| 18956 | #+OPTIONS: H:%d num:%s toc:%s \\n:%s @:%s ::%s |:%s ^:%s *:%s TeX:%s LaTeX:%s skip:%s | 19064 | #+OPTIONS: H:%d num:%s toc:%s \\n:%s @:%s ::%s |:%s ^:%s f:%s *:%s TeX:%s LaTeX:%s skip:%s |
| 18957 | #+CATEGORY: %s | 19065 | #+CATEGORY: %s |
| 18958 | #+SEQ_TODO: %s | 19066 | #+SEQ_TODO: %s |
| 18959 | #+TYP_TODO: %s | 19067 | #+TYP_TODO: %s |
| @@ -18972,6 +19080,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff." | |||
| 18972 | org-export-with-fixed-width | 19080 | org-export-with-fixed-width |
| 18973 | org-export-with-tables | 19081 | org-export-with-tables |
| 18974 | org-export-with-sub-superscripts | 19082 | org-export-with-sub-superscripts |
| 19083 | org-export-with-footnotes | ||
| 18975 | org-export-with-emphasize | 19084 | org-export-with-emphasize |
| 18976 | org-export-with-TeX-macros | 19085 | org-export-with-TeX-macros |
| 18977 | org-export-with-LaTeX-fragments | 19086 | org-export-with-LaTeX-fragments |
| @@ -19338,7 +19447,9 @@ lang=\"%s\" xml:lang=\"%s\"> | |||
| 19338 | (org-search-todo-below | 19447 | (org-search-todo-below |
| 19339 | line lines level)))) | 19448 | line lines level)))) |
| 19340 | (if (and (memq org-export-with-tags '(not-in-toc nil)) | 19449 | (if (and (memq org-export-with-tags '(not-in-toc nil)) |
| 19341 | (string-match "[ \t]+:[[:alnum:]_@:]+:[ \t]*$" txt)) | 19450 | (string-match |
| 19451 | (org-re "[ \t]+:[[:alnum:]_@:]+:[ \t]*$") | ||
| 19452 | txt)) | ||
| 19342 | (setq txt (replace-match "" t t txt))) | 19453 | (setq txt (replace-match "" t t txt))) |
| 19343 | (if (string-match quote-re0 txt) | 19454 | (if (string-match quote-re0 txt) |
| 19344 | (setq txt (replace-match "" t t txt))) | 19455 | (setq txt (replace-match "" t t txt))) |
| @@ -19550,24 +19661,26 @@ lang=\"%s\" xml:lang=\"%s\"> | |||
| 19550 | ;; TODO items | 19661 | ;; TODO items |
| 19551 | (if (and (string-match org-todo-line-regexp line) | 19662 | (if (and (string-match org-todo-line-regexp line) |
| 19552 | (match-beginning 2)) | 19663 | (match-beginning 2)) |
| 19553 | (if (member (match-string 2 line) org-done-keywords) | 19664 | |
| 19554 | (setq line (replace-match | 19665 | (setq line |
| 19555 | "<span class=\"done\">\\2</span>" | 19666 | (concat (substring line 0 (match-beginning 2)) |
| 19556 | t nil line 2)) | 19667 | "<span class=\"" |
| 19557 | (setq line | 19668 | (if (member (match-string 2 line) |
| 19558 | (concat (substring line 0 (match-beginning 2)) | 19669 | org-done-keywords) |
| 19559 | "<span class=\"todo\">" (match-string 2 line) | 19670 | "done" "todo") |
| 19560 | "</span>" (substring line (match-end 2)))))) | 19671 | "\">" (match-string 2 line) |
| 19672 | "</span>" (substring line (match-end 2))))) | ||
| 19561 | 19673 | ||
| 19562 | ;; Does this contain a reference to a footnote? | 19674 | ;; Does this contain a reference to a footnote? |
| 19563 | (while (string-match "\\([^* \t].*?\\)\\[\\([0-9]+\\)\\]" line) | 19675 | (when org-export-with-footnotes |
| 19564 | (let ((n (match-string 2 line))) | 19676 | (while (string-match "\\([^* \t].*?\\)\\[\\([0-9]+\\)\\]" line) |
| 19565 | (setq line | 19677 | (let ((n (match-string 2 line))) |
| 19566 | (replace-match | 19678 | (setq line |
| 19567 | (format | 19679 | (replace-match |
| 19568 | "%s<sup><a class=\"footref\" name=\"fnr.%s\" href=\"#fn.%s\">%s</a></sup>" | 19680 | (format |
| 19569 | (match-string 1 line) n n n) | 19681 | "%s<sup><a class=\"footref\" name=\"fnr.%s\" href=\"#fn.%s\">%s</a></sup>" |
| 19570 | t t line)))) | 19682 | (match-string 1 line) n n n) |
| 19683 | t t line))))) | ||
| 19571 | 19684 | ||
| 19572 | (cond | 19685 | (cond |
| 19573 | ((string-match "^\\(\\*+\\)[ \t]*\\(.*\\)" line) | 19686 | ((string-match "^\\(\\*+\\)[ \t]*\\(.*\\)" line) |
| @@ -19671,11 +19784,12 @@ lang=\"%s\" xml:lang=\"%s\"> | |||
| 19671 | (if (string-match "^ [-+*]-\\|^[ \t]*$" line) (org-open-par)) | 19784 | (if (string-match "^ [-+*]-\\|^[ \t]*$" line) (org-open-par)) |
| 19672 | 19785 | ||
| 19673 | ;; Is this the start of a footnote? | 19786 | ;; Is this the start of a footnote? |
| 19674 | (when (string-match "^[ \t]*\\[\\([0-9]+\\)\\]" line) | 19787 | (when org-export-with-footnotes |
| 19675 | (org-close-par-maybe) | 19788 | (when (string-match "^[ \t]*\\[\\([0-9]+\\)\\]" line) |
| 19676 | (let ((n (match-string 1 line))) | 19789 | (org-close-par-maybe) |
| 19677 | (setq line (replace-match | 19790 | (let ((n (match-string 1 line))) |
| 19678 | (format "<p class=\"footnote\"><sup><a class=\"footnum\" name=\"fn.%s\" href=\"#fnr.%s\">%s</a></sup>" n n n) t t line)))) | 19791 | (setq line (replace-match |
| 19792 | (format "<p class=\"footnote\"><sup><a class=\"footnum\" name=\"fn.%s\" href=\"#fnr.%s\">%s</a></sup>" n n n) t t line))))) | ||
| 19679 | 19793 | ||
| 19680 | ;; Check if the line break needs to be conserved | 19794 | ;; Check if the line break needs to be conserved |
| 19681 | (cond | 19795 | (cond |
| @@ -20052,7 +20166,7 @@ But it has the disadvantage, that Org-mode's HTML conversions cannot be used." | |||
| 20052 | 20166 | ||
| 20053 | (defun org-export-cleanup-toc-line (s) | 20167 | (defun org-export-cleanup-toc-line (s) |
| 20054 | "Remove tags and time staps from lines going into the toc." | 20168 | "Remove tags and time staps from lines going into the toc." |
| 20055 | (if (string-match " +:[[:alnum:]_@:]+: *$" s) | 20169 | (if (string-match (org-re " +:[[:alnum:]_@:]+: *$") s) |
| 20056 | (setq s (replace-match "" t t s))) | 20170 | (setq s (replace-match "" t t s))) |
| 20057 | (when org-export-remove-timestamps-from-toc | 20171 | (when org-export-remove-timestamps-from-toc |
| 20058 | (while (string-match org-maybe-keyword-time-regexp s) | 20172 | (while (string-match org-maybe-keyword-time-regexp s) |
| @@ -20192,7 +20306,7 @@ When TITLE is nil, just close all open levels." | |||
| 20192 | (when title | 20306 | (when title |
| 20193 | ;; If title is nil, this means this function is called to close | 20307 | ;; If title is nil, this means this function is called to close |
| 20194 | ;; all levels, so the rest is done only if title is given | 20308 | ;; all levels, so the rest is done only if title is given |
| 20195 | (when (string-match "\\(:[[:alnum:]_@:]+:\\)[ \t]*$" title) | 20309 | (when (string-match (org-re "\\(:[[:alnum:]_@:]+:\\)[ \t]*$") title) |
| 20196 | (setq title (replace-match | 20310 | (setq title (replace-match |
| 20197 | (if org-export-with-tags | 20311 | (if org-export-with-tags |
| 20198 | (save-match-data | 20312 | (save-match-data |
| @@ -21641,6 +21755,7 @@ not an indirect buffer" | |||
| 21641 | (beginning-of-line 1) | 21755 | (beginning-of-line 1) |
| 21642 | (cond | 21756 | (cond |
| 21643 | ((looking-at "#") (setq column 0)) | 21757 | ((looking-at "#") (setq column 0)) |
| 21758 | ((looking-at "\\*+ ") (setq column 0)) | ||
| 21644 | (t | 21759 | (t |
| 21645 | (beginning-of-line 0) | 21760 | (beginning-of-line 0) |
| 21646 | (while (and (not (bobp)) (looking-at "[ \t]*[\n:#|]")) | 21761 | (while (and (not (bobp)) (looking-at "[ \t]*[\n:#|]")) |
| @@ -21798,16 +21913,16 @@ move point." | |||
| 21798 | (pos (point)) | 21913 | (pos (point)) |
| 21799 | (re (concat "^" outline-regexp)) | 21914 | (re (concat "^" outline-regexp)) |
| 21800 | level l) | 21915 | level l) |
| 21801 | (org-back-to-heading t) | 21916 | (when (condition-case nil (org-back-to-heading t) (error nil)) |
| 21802 | (setq level (funcall outline-level)) | 21917 | (setq level (funcall outline-level)) |
| 21803 | (catch 'exit | 21918 | (catch 'exit |
| 21804 | (or previous (forward-char 1)) | 21919 | (or previous (forward-char 1)) |
| 21805 | (while (funcall fun re nil t) | 21920 | (while (funcall fun re nil t) |
| 21806 | (setq l (funcall outline-level)) | 21921 | (setq l (funcall outline-level)) |
| 21807 | (when (< l level) (goto-char pos) (throw 'exit nil)) | 21922 | (when (< l level) (goto-char pos) (throw 'exit nil)) |
| 21808 | (when (= l level) (goto-char (match-beginning 0)) (throw 'exit t))) | 21923 | (when (= l level) (goto-char (match-beginning 0)) (throw 'exit t))) |
| 21809 | (goto-char pos) | 21924 | (goto-char pos) |
| 21810 | nil))) | 21925 | nil)))) |
| 21811 | 21926 | ||
| 21812 | (defun org-show-siblings () | 21927 | (defun org-show-siblings () |
| 21813 | "Show all siblings of the current headline." | 21928 | "Show all siblings of the current headline." |
| @@ -21965,11 +22080,6 @@ Still experimental, may disappear in the furture." | |||
| 21965 | ;; make tree, check each match with the callback | 22080 | ;; make tree, check each match with the callback |
| 21966 | (org-occur "CLOSED: +\\[\\(.*?\\)\\]" nil callback))) | 22081 | (org-occur "CLOSED: +\\[\\(.*?\\)\\]" nil callback))) |
| 21967 | 22082 | ||
| 21968 | |||
| 21969 | (defun test () | ||
| 21970 | (interactive) | ||
| 21971 | (message "hihi: %s" (org-item-indent-positions))) | ||
| 21972 | |||
| 21973 | ;;;; Finish up | 22083 | ;;;; Finish up |
| 21974 | 22084 | ||
| 21975 | (provide 'org) | 22085 | (provide 'org) |