summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2014-03-13 11:28:07 +0100
committerBastien Guerry <bzg@altern.org>2014-03-13 11:28:07 +0100
commit25f47777ef935c67bea9d044ffcf0acb9185b8a9 (patch)
treeba2c3900ca20aff00a19753a49d28f05590e17ba
parent423133efe9169381a8a6b3604fa25e01e1fec425 (diff)
downloadorg-mode-25f47777ef935c67bea9d044ffcf0acb9185b8a9.tar.gz
Complete commit 07158e
* org.el (org-refresh-category-properties) (org-complete-expand-structure-template) (org-buffer-property-keys, org-context): * org-mouse.el (org-mouse-context-menu): * org-list.el (org-list-send-list): * org-element.el (org-element--list-struct): * org-archive.el (org-all-archive-files): Allow spaces before any option keyword. * org.el (org-fontify-meta-lines-and-blocks-1): Fix fontification of all option keywords. Thanks to Alan Schmitt for raising the problem with fontification.
-rw-r--r--lisp/org-archive.el2
-rw-r--r--lisp/org-element.el2
-rw-r--r--lisp/org-list.el2
-rw-r--r--lisp/org-mouse.el2
-rw-r--r--lisp/org.el26
5 files changed, 16 insertions, 18 deletions
diff --git a/lisp/org-archive.el b/lisp/org-archive.el
index 2473d7d..700e59b 100644
--- a/lisp/org-archive.el
+++ b/lisp/org-archive.el
@@ -158,7 +158,7 @@ archive file is."
(save-restriction
(goto-char (point-min))
(while (re-search-forward
- "^\\(#\\+\\|[ \t]*:\\)ARCHIVE:[ \t]+\\(.*\\)"
+ "^[ \t]*\\(#\\+\\|:\\)ARCHIVE:[ \t]+\\(.*\\)"
nil t)
(setq file (org-extract-archive-file
(org-match-string-no-properties 2)))
diff --git a/lisp/org-element.el b/lisp/org-element.el
index 41df424..27e9bda 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -1284,7 +1284,7 @@ CONTENTS is the contents of the element."
(throw 'exit (sort struct 'car-less-than-car))))))
;; Skip blocks (any type) and drawers contents.
(cond
- ((and (looking-at "#\\+BEGIN\\(:\\|_\\S-+\\)")
+ ((and (looking-at "\\(?:[ \t]*\\)?#\\+BEGIN\\(:\\|_\\S-+\\)")
(re-search-forward
(format "^[ \t]*#\\+END%s[ \t]*$"
(org-match-string-no-properties 1))
diff --git a/lisp/org-list.el b/lisp/org-list.el
index 4b9744f..2ac15af 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -3044,7 +3044,7 @@ for this list."
(unless (org-at-item-p) (error "Not at a list item"))
(save-excursion
(re-search-backward "#\\+ORGLST" nil t)
- (unless (looking-at "#\\+ORGLST:[ \t]+SEND[ \t]+\\(\\S-+\\)[ \t]+\\(\\S-+\\)")
+ (unless (looking-at "\\(?:[ \t]\\)?#\\+ORGLST:[ \t]+SEND[ \t]+\\(\\S-+\\)[ \t]+\\(\\S-+\\)")
(if maybe (throw 'exit nil)
(error "Don't know how to transform this list"))))
(let* ((name (match-string 1))
diff --git a/lisp/org-mouse.el b/lisp/org-mouse.el
index 27dc0e0..3d623bf 100644
--- a/lisp/org-mouse.el
+++ b/lisp/org-mouse.el
@@ -638,7 +638,7 @@ This means, between the beginning of line and the point."
(progn (save-excursion (goto-char (region-beginning)) (insert "[["))
(save-excursion (goto-char (region-end)) (insert "]]")))]
["Insert Link Here" (org-mouse-yank-link ',event)]))))
- ((save-excursion (beginning-of-line) (looking-at "#\\+STARTUP: \\(.*\\)"))
+ ((save-excursion (beginning-of-line) (looking-at "[ \t]*#\\+STARTUP: \\(.*\\)"))
(popup-menu
`(nil
,@(org-mouse-list-options-menu (mapcar 'car org-startup-options)
diff --git a/lisp/org.el b/lisp/org.el
index 1ad5e69..1863c00 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5938,14 +5938,12 @@ by a #."
(add-text-properties
beg (match-end 0)
'(font-lock-fontified t face font-lock-comment-face)))
- ((not (member (char-after beg) '(?\ ?\t)))
- ;; just any other in-buffer setting, but not indented
+ (t ;; just any other in-buffer setting, but not indented
(org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
(add-text-properties
beg (match-end 0)
'(font-lock-fontified t face org-meta-line))
- t)
- (t nil))))))
+ t))))))
(defun org-fontify-drawers (limit)
"Fontify drawers."
@@ -9344,7 +9342,7 @@ call CMD."
(goto-char (point-min))
(put-text-property (point) (point-max) 'org-category def-cat)
(while (re-search-forward
- "^\\(#\\+CATEGORY:\\|[ \t]*:CATEGORY:\\)\\(.*\\)" nil t)
+ "^[ \t]*\\(#\\+CATEGORY:\\|[ \t]*:CATEGORY:\\)\\(.*\\)" nil t)
(setq pos (match-end 0)
optionp (equal (char-after (match-beginning 0)) ?#)
cat (org-trim (match-string 2)))
@@ -12137,7 +12135,7 @@ expands them."
(rpl (nth (if musep 2 1) cell))
(ind ""))
(delete-region start (point))
- (when (string-match "\\`#\\+" rpl)
+ (when (string-match "\\`[ \t]*#\\+" rpl)
(cond
((bolp))
((not (string-match "\\S-" (buffer-substring (point-at-bol) (point))))
@@ -15676,7 +15674,7 @@ formats in the current buffer."
(widen)
(goto-char (point-min))
(while (re-search-forward
- "^\\(#\\+COLUMNS:\\|[ \t]*:COLUMNS:\\)[ \t]*\\(.*\\)"
+ "^[ \t]*\\(#\\+COLUMNS:\\|[ \t]*:COLUMNS:\\)[ \t]*\\(.*\\)"
nil t)
(setq cfmt (match-string 2) s 0)
(while (string-match (org-re "%[0-9]*\\([-[:alnum:]_]+\\)")
@@ -21720,16 +21718,16 @@ and :keyword."
;; New the "medium" contexts: clocktables, source blocks
(cond ((org-in-clocktable-p)
(push (list :clocktable
- (and (or (looking-at "#\\+BEGIN: clocktable")
- (search-backward "#+BEGIN: clocktable" nil t))
- (match-beginning 0))
- (and (re-search-forward "#\\+END:?" nil t)
+ (and (or (looking-at "[ \t]*\\(#\\+BEGIN: clocktable\\)")
+ (re-search-backward "[ \t]*\\(#+BEGIN: clocktable\\)" nil t))
+ (match-beginning 1))
+ (and (re-search-forward "[ \t]*#\\+END:?" nil t)
(match-end 0))) clist))
((org-in-src-block-p)
(push (list :src-block
- (and (or (looking-at "#\\+BEGIN_SRC")
- (search-backward "#+BEGIN_SRC" nil t))
- (match-beginning 0))
+ (and (or (looking-at "[ \t]*\\(#\\+BEGIN_SRC\\)")
+ (re-search-backward "[ \t]*\\(#+BEGIN_SRC\\)" nil t))
+ (match-beginning 1))
(and (search-forward "#+END_SRC" nil t)
(match-beginning 0))) clist))))
(goto-char p)