diff --git a/Makefile b/Makefile index 801db0644..9a96ffab3 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-agenda.el b/lisp/org-agenda.el index 3d574bc36..99bbe6a37 100755 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6593,6 +6593,9 @@ If ERROR is non-nil, throw an error, otherwise just return nil." "Exit agenda by killing agenda buffer or burying it when `org-agenda-sticky' is non-NIL" (interactive) + (if (and (eq org-indirect-buffer-display 'other-window) + org-last-indirect-buffer) + (delete-window (get-buffer-window org-last-indirect-buffer))) (if org-agenda-columns-active (org-columns-quit) (if org-agenda-sticky @@ -7313,10 +7316,16 @@ so that the date SD will be in that range." (remove-hook 'pre-command-hook 'org-unhighlight-once) (org-unhighlight)) +(defvar org-agenda-pre-follow-window-conf nil) (defun org-agenda-follow-mode () "Toggle follow mode in an agenda buffer." (interactive) + (unless org-agenda-follow-mode + (setq org-agenda-pre-follow-window-conf + (current-window-configuration))) (setq org-agenda-follow-mode (not org-agenda-follow-mode)) + (unless org-agenda-follow-mode + (set-window-configuration org-agenda-pre-follow-window-conf)) (org-agenda-set-mode-name) (org-agenda-do-context-action) (message "Follow mode is %s" @@ -7925,8 +7934,7 @@ use the dedicated frame)." (unless (or (eq org-indirect-buffer-display 'new-frame) (eq org-indirect-buffer-display 'dedicated-frame)) (unwind-protect - (progn - (unless (and indirect-window (window-live-p indirect-window))) + (unless (and indirect-window (window-live-p indirect-window)) (setq indirect-window (split-window agenda-window))) (and indirect-window (select-window indirect-window)) (switch-to-buffer org-last-indirect-buffer :norecord) diff --git a/lisp/org-element.el b/lisp/org-element.el index 2f2fc45b8..83c6557fd 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -760,11 +760,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 d9efa9b57..3b985bd13 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 31fc5e7fa..d0f4e1294 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 865b495be..0565043c0 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 be4103006..6716a61a4 100644 --- a/testing/lisp/test-org-element.el +++ b/testing/lisp/test-org-element.el @@ -739,23 +739,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." @@ -765,23 +773,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."