summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-09-29 11:10:11 +0200
committerBastien Guerry <bzg@altern.org>2012-09-29 11:10:11 +0200
commitecbd57effb7f0cac556eccac62a5d4bac8366815 (patch)
treebd0fb65d0152977640b64f55cbceb281bf0c493d
parent33213dc99a7ff72936023d1d3369b94b3eaeadee (diff)
parente6228c448e84f64ced8c48d13aa13881466fae8d (diff)
downloadorg-mode-ecbd57effb7f0cac556eccac62a5d4bac8366815.tar.gz
Merge branch 'maint' of orgmode.org:org-mode into maint
-rw-r--r--Makefile1
-rw-r--r--lisp/org-element.el13
-rw-r--r--mk/default.mk11
-rw-r--r--mk/targets.mk7
-rw-r--r--testing/lisp/test-ob.el4
-rw-r--r--testing/lisp/test-org-element.el67
6 files changed, 66 insertions, 37 deletions
diff --git a/Makefile b/Makefile
index 801db06..9a96ffa 100644
--- a/Makefile
+++ b/Makefile
@@ -49,6 +49,7 @@ helpall::
help helpall::
$(info make config - check main configuration)
helpall::
+ $(info make config-version - check Org version)
$(info make config-test - check test configuration)
$(info make config-exe - check executables configuration)
$(info make config-cmd - check command configuration)
diff --git a/lisp/org-element.el b/lisp/org-element.el
index 038d2b5..3d67ae7 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -746,11 +746,14 @@ Assume point is at beginning of the headline."
(point)))))
;; Clean RAW-VALUE from any quote or comment string.
(when (or quotedp commentedp)
- (setq raw-value
- (replace-regexp-in-string
- (concat "\\(" org-quote-string "\\|" org-comment-string "\\) +")
- ""
- raw-value)))
+ (let ((case-fold-search nil))
+ (setq raw-value
+ (replace-regexp-in-string
+ (concat
+ (regexp-opt (list org-quote-string org-comment-string))
+ "\\(?: \\|$\\)")
+ ""
+ raw-value))))
;; Clean TAGS from archive tag, if any.
(when archivedp (setq tags (delete org-archive-tag tags)))
(let ((headline
diff --git a/mk/default.mk b/mk/default.mk
index d9efa9b..3b985bd 100644
--- a/mk/default.mk
+++ b/mk/default.mk
@@ -67,9 +67,16 @@ BTEST = $(BATCH) \
# BATCH = $(EMACS) -batch -vanilla # XEmacs
BATCH = $(EMACS) -batch -Q
+# Emacs must be started in toplevel directory
+BATCHO = $(BATCH) \
+ --eval '(add-to-list '"'"'load-path "./lisp")'
+
+# How to show Org version
+SHOWVER = $(BATCHO) \
+ --eval '(org-version nil '"'"'full '"'"'message)'
+
# How to generate local.mk
-MAKE_LOCAL_MK = $(BATCH) \
- --eval '(add-to-list '"'"'load-path "./lisp")' \
+MAKE_LOCAL_MK = $(BATCHO) \
--eval '(load "org-compat.el")' \
--eval '(load "../mk/org-fixup.el")' \
--eval '(org-make-local-mk)'
diff --git a/mk/targets.mk b/mk/targets.mk
index 31fc5e7..d0f4e12 100644
--- a/mk/targets.mk
+++ b/mk/targets.mk
@@ -31,7 +31,7 @@ endif
clean-install cleanelc cleandirs cleanaddcontrib \
cleanlisp cleandoc cleandocs cleantest \
compile compile-dirty uncompiled \
- config config-test config-exe config-all config-eol
+ config config-test config-exe config-all config-eol config-version
CONF_BASE = EMACS DESTDIR ORGCM ORG_MAKE_DOC
CONF_DEST = lispdir infodir datadir testdir
@@ -64,7 +64,10 @@ config-cmd config-all::
$(info )
$(info ========= Commands used by make)
$(foreach var,$(CONF_CALL),$(info $(var) = $($(var))$(EOL)))
-config config-test config-exe config-all::
+config config-test config-exe config-all config-version::
+ $(info ========= Org version)
+ $(info make: Org-mode version $(ORGVERSION) ($(GITVERSION) => $(lispdir)))
+ @echo -n "emacs: " ; $(SHOWVER)
@echo ""
oldorg: compile info # what the old makefile did when no target was specified
diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
index 865b495..0565043 100644
--- a/testing/lisp/test-ob.el
+++ b/testing/lisp/test-ob.el
@@ -1007,11 +1007,11 @@ Line 3\"
(org-test-with-temp-text "Block two has a space after the name.
#+name: foo
- #+begin_src emacs-lisp
+ #+begin_src emacs-lisp
1
#+end_src emacs-lisp
-#+name: foo
+#+name: foo
#+begin_src emacs-lisp
2
#+end_src
diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el
index d0191b9..6fc3d43 100644
--- a/testing/lisp/test-org-element.el
+++ b/testing/lisp/test-org-element.el
@@ -727,23 +727,31 @@ CLOCK: [2012-01-01 sun. 00:01]--[2012-01-01 sun. 00:02] => 0:01"
(should-not (org-element-property :quotedp (org-element-at-point)))))
;; Standard position.
(org-test-with-temp-text "* QUOTE Headline"
- (let ((org-quote-string "QUOTE"))
- (let ((headline (org-element-at-point)))
- (should (org-element-property :quotedp headline))
- ;; Test removal from raw value.
- (should (equal (org-element-property :raw-value headline) "Headline"))))
- ;; Case sensitivity.
- (let ((org-quote-string "Quote"))
- (should-not (org-element-property :quotedp (org-element-at-point)))))
+ (let* ((org-quote-string "QUOTE")
+ (headline (org-element-at-point)))
+ (should (org-element-property :quotedp headline))
+ ;; Test removal from raw value.
+ (should (equal (org-element-property :raw-value headline) "Headline"))))
+ ;; Case sensitivity.
+ (org-test-with-temp-text "* QUOTE Headline"
+ (let* ((org-quote-string "Quote")
+ (headline (org-element-at-point)))
+ (should-not (org-element-property :quotedp headline))
+ (should (equal (org-element-property :raw-value headline)
+ "QUOTE Headline"))))
;; With another keyword.
(org-test-with-temp-text "* TODO QUOTE Headline"
- (let ((org-quote-string "QUOTE")
- (org-todo-keywords '((sequence "TODO" "DONE"))))
- (should (org-element-property :quotedp (org-element-at-point)))))
+ (let* ((org-quote-string "QUOTE")
+ (org-todo-keywords '((sequence "TODO" "DONE")))
+ (headline (org-element-at-point)))
+ (should (org-element-property :quotedp headline))
+ (should (equal (org-element-property :raw-value headline) "Headline"))))
;; With the keyword only.
(org-test-with-temp-text "* QUOTE"
- (let ((org-quote-string "QUOTE"))
- (should (org-element-property :quotedp (org-element-at-point))))))
+ (let* ((org-quote-string "QUOTE")
+ (headline (org-element-at-point)))
+ (should (org-element-property :quotedp headline))
+ (should (equal (org-element-property :raw-value headline) "")))))
(ert-deftest test-org-element/headline-comment-keyword ()
"Test COMMENT keyword recognition."
@@ -753,23 +761,30 @@ CLOCK: [2012-01-01 sun. 00:01]--[2012-01-01 sun. 00:02] => 0:01"
(should-not (org-element-property :commentedp (org-element-at-point)))))
;; Standard position.
(org-test-with-temp-text "* COMMENT Headline"
- (let ((org-comment-string "COMMENT"))
- (let ((headline (org-element-at-point)))
- (should (org-element-property :commentedp headline))
- ;; Test removal from raw value.
- (should (equal (org-element-property :raw-value headline) "Headline"))))
- ;; Case sensitivity.
- (let ((org-comment-string "Comment"))
- (should-not (org-element-property :commentedp (org-element-at-point)))))
+ (let ((org-comment-string "COMMENT")
+ (headline (org-element-at-point)))
+ (should (org-element-property :commentedp headline))
+ (should (equal (org-element-property :raw-value headline) "Headline"))))
+ ;; Case sensitivity.
+ (org-test-with-temp-text "* COMMENT Headline"
+ (let* ((org-comment-string "Comment")
+ (headline (org-element-at-point)))
+ (should-not (org-element-property :commentedp headline))
+ (should (equal (org-element-property :raw-value headline)
+ "COMMENT Headline"))))
;; With another keyword.
(org-test-with-temp-text "* TODO COMMENT Headline"
- (let ((org-comment-string "COMMENT")
- (org-todo-keywords '((sequence "TODO" "DONE"))))
- (should (org-element-property :commentedp (org-element-at-point)))))
+ (let* ((org-comment-string "COMMENT")
+ (org-todo-keywords '((sequence "TODO" "DONE")))
+ (headline (org-element-at-point)))
+ (should (org-element-property :commentedp headline))
+ (should (equal (org-element-property :raw-value headline) "Headline"))))
;; With the keyword only.
(org-test-with-temp-text "* COMMENT"
- (let ((org-comment-string "COMMENT"))
- (should (org-element-property :commentedp (org-element-at-point))))))
+ (let* ((org-comment-string "COMMENT")
+ (headline (org-element-at-point)))
+ (should (org-element-property :commentedp headline))
+ (should (equal (org-element-property :raw-value headline) "")))))
(ert-deftest test-org-element/headline-archive-tag ()
"Test ARCHIVE tag recognition."