Merge branch 'master' of orgmode.org:org-mode

This commit is contained in:
David Arroyo Menendez 2013-11-19 08:13:57 +01:00
commit dcddfae281
3 changed files with 511 additions and 276 deletions

File diff suppressed because it is too large Load Diff

View File

@ -10520,11 +10520,29 @@ application the system uses for this file type."
(apply cmd (nreverse args1)))) (apply cmd (nreverse args1))))
((member type '("http" "https" "ftp" "news")) ((member type '("http" "https" "ftp" "news"))
(browse-url (concat type ":" (org-link-escape-browser path)))) ;; In the example of the http Org link
;; [[http://lists.gnu.org/archive/cgi-bin/namazu.cgi?idxname=emacs-orgmode&query=%252Bsubject:"Release+8.2"]]
;; to open a browser with +subject:"Release 8.2" in the
;; query field the variable `path' contains
;; [...]=%2Bsubject:"Release+8.2", `url-encode-url'
;; converts correct to [...]=%2Bsubject:%22Release+8.2%22
;; and `org-link-escape-browser' converts wrong to
;; [...]=%252Bsubject:%22Release+8.2%22.
;;
;; `url-encode-url' is available since Emacs 24.3.1 and
;; `org-link-escape-browser' can be removed altogether
;; once Org drops support for Emacs 24.1 and 24.2.
(browse-url (funcall (if (fboundp 'url-encode-url)
#'url-encode-url
#'org-link-escape-browser)
(concat type ":" path))))
((string= type "doi") ((string= type "doi")
(browse-url (concat org-doi-server-url ;; See comments for type http above
(org-link-escape-browser path)))) (browse-url (funcall (if (fboundp 'url-encode-url)
#'url-encode-url
#'org-link-escape-browser)
(concat org-doi-server-url path))))
((member type '("message")) ((member type '("message"))
(browse-url (concat type ":" path))) (browse-url (concat type ":" path)))
@ -15226,15 +15244,14 @@ is a string only get exactly this property. SPECIFIC can be a string, the
specific property we are interested in. Specifying it can speed specific property we are interested in. Specifying it can speed
things up because then unnecessary parsing is avoided." things up because then unnecessary parsing is avoided."
(setq which (or which 'all)) (setq which (or which 'all))
(org-with-wide-buffer
(org-with-point-at pom (org-with-point-at pom
(let ((clockstr (substring org-clock-string 0 -1)) (let ((clockstr (substring org-clock-string 0 -1))
(excluded '("TODO" "TAGS" "ALLTAGS" "PRIORITY" "BLOCKED")) (excluded '("TODO" "TAGS" "ALLTAGS" "PRIORITY" "BLOCKED"))
(case-fold-search nil) (case-fold-search nil)
beg end range props sum-props key key1 value string clocksum clocksumt) beg end range props sum-props key key1 value string clocksum clocksumt)
(save-excursion (when (and (derived-mode-p 'org-mode)
(when (condition-case nil (ignore-errors (org-back-to-heading t)))
(and (derived-mode-p 'org-mode) (org-back-to-heading t))
(error nil))
(setq beg (point)) (setq beg (point))
(setq sum-props (get-text-property (point) 'org-summaries)) (setq sum-props (get-text-property (point) 'org-summaries))
(setq clocksum (get-text-property (point) :org-clock-minutes) (setq clocksum (get-text-property (point) :org-clock-minutes)

View File

@ -205,14 +205,14 @@ mode holding TEXT. If the string \"<point>\" appears in TEXT
then remove it and place the point there before running BODY, then remove it and place the point there before running BODY,
otherwise place the point at the beginning of the inserted text." otherwise place the point at the beginning of the inserted text."
(declare (indent 1)) (declare (indent 1))
(let ((inside-text (if (stringp text) text (eval text)))) `(let ((inside-text (if (stringp ,text) ,text (eval ,text))))
`(with-temp-buffer (with-temp-buffer
(org-mode) (org-mode)
,(let ((point (string-match (regexp-quote "<point>") inside-text))) (let ((point (string-match (regexp-quote "<point>") inside-text)))
(if point (if point
`(progn (insert `(replace-match "" nil nil inside-text)) (progn (insert (replace-match "" nil nil inside-text))
(goto-char ,(match-beginning 0))) (goto-char (match-beginning 0)))
`(progn (insert ,inside-text) (progn (insert inside-text)
(goto-char (point-min))))) (goto-char (point-min)))))
,@body))) ,@body)))
(def-edebug-spec org-test-with-temp-text (form body)) (def-edebug-spec org-test-with-temp-text (form body))
@ -220,16 +220,17 @@ otherwise place the point at the beginning of the inserted text."
(defmacro org-test-with-temp-text-in-file (text &rest body) (defmacro org-test-with-temp-text-in-file (text &rest body)
"Run body in a temporary file buffer with Org-mode as the active mode." "Run body in a temporary file buffer with Org-mode as the active mode."
(declare (indent 1)) (declare (indent 1))
(let ((file (make-temp-file "org-test")) (let ((results (gensym)))
(inside-text (if (stringp text) text (eval text))) `(let ((file (make-temp-file "org-test"))
(results (gensym))) (kill-buffer-query-functions nil)
`(let ((kill-buffer-query-functions nil) ,results) (inside-text (if (stringp ,text) ,text (eval ,text)))
(with-temp-file ,file (insert ,inside-text)) ,results)
(find-file ,file) (with-temp-file file (insert inside-text))
(find-file file)
(org-mode) (org-mode)
(setq ,results (progn ,@body)) (setq ,results (progn ,@body))
(save-buffer) (kill-buffer (current-buffer)) (save-buffer) (kill-buffer (current-buffer))
(delete-file ,file) (delete-file file)
,results))) ,results)))
(def-edebug-spec org-test-with-temp-text-in-file (form body)) (def-edebug-spec org-test-with-temp-text-in-file (form body))