diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2011-08-25 01:58:29 +0200 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2011-10-23 09:30:13 +0200 |
commit | dfcb6faef11a2439b56b18a6289803361d402130 (patch) | |
tree | 4f31535b19997c95fdd5ba7de4ceb76cd875c20e /lisp/org-docbook.el | |
parent | 440ec7e2daac77cd6002f4b1ce749319ab16b065 (diff) |
Provide more consistent regexps for headlines
* lisp/org-agenda.el (org-search-view): Simplify regexp.
(org-agenda-get-todos): Use new format string.
* lisp/org-archive.el (org-archive-all-done): Simplify regexp.
* lisp/org-ascii.el (org-export-as-ascii): More accurate regexp.
* lisp/org-colview-xemacs.el (org-columns-capture-view): Use new
format string and new string.
* lisp/org-colview.el (org-columns-capture-view): Use new format
string and new string.
* lisp/org-docbook.el (org-export-as-docbook): More accurate
regexp. Also use new regexp to match generic headlines.
* lisp/org-exp.el (org-export-protect-quoted-subtrees): More accurate
regexp. Also use new regexp to match generic headlines.
* lisp/org-html.el (org-export-as-html): More accurate regexp. Also
use new regexp to match generic headlines.
* lisp/org-mouse.el (org-mouse-match-todo-keyword): Removed unused
and now erroneous function.
* lisp/org.el (org-heading-regexp, org-heading-keyword-regexp-format):
New variables.
(org-set-regexps-and-options): Create regexps according to the
following rule: use spaces only to separate elements from an headline,
while allowing mixed tabs and spaces for any indentation job.
(org-nl-done-regexp, org-looking-at-done-regexp): Removed variables.
(org-set-font-lock-defaults): Fontify again headlines with a keyword
and no other text. Use new format strings.
(org-get-heading, org-toggle-comment, org-prepare-agenda-buffers,
org-toggle-fixed-width-section): Use new format string.
(org-todo): More accurate regexps.
(org-point-at-end-of-empty-headline): Simplify regexp.
(org-insert-heading): Headline can sometimes be nil.
This patch attempts to reduce the number of hard-coded headlines, by
providing two format strings and one generic string to cover most of
the cases of headline construction.
Diffstat (limited to 'lisp/org-docbook.el')
-rw-r--r-- | lisp/org-docbook.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index 13cb0395d..ae454c56d 100644 --- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -498,8 +498,9 @@ publishing directory." ;; We will use HTML table formatter to export tables to DocBook ;; format, so need to set html-table-tag here. (html-table-tag (plist-get opt-plist :html-table-tag)) - (quote-re0 (concat "^[ \t]*" org-quote-string "\\>")) - (quote-re (concat "^\\(\\*+\\)\\([ \t]+" org-quote-string "\\>\\)")) + (quote-re0 (concat "^ *" org-quote-string "\\( +\\|[ \t]*$\\)")) + (quote-re (format org-heading-keyword-regexp-format + org-quote-string)) (inquote nil) (infixed nil) (inverse nil) @@ -969,7 +970,7 @@ publishing directory." (push (cons num 1) footref-seen)))))) (cond - ((string-match "^\\(\\*+\\)[ \t]+\\(.*\\)" line) + ((string-match "\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$" line) ;; This is a headline (setq level (org-tr-level (- (match-end 1) (match-beginning 1) level-offset)) |