summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-10-24 12:49:30 +0200
committerBastien Guerry <bzg@altern.org>2012-10-24 12:49:30 +0200
commit1886af4337e802806ff8873822ccbd2e3763aa07 (patch)
tree70233405bec692dc04cd83e6babe3241eb8b8120
parent886e4f56e53ba29919aefafcd9659610f18d4fa2 (diff)
parent1fc41ca61e8f7f08c57e55ad688482d956d3ccf3 (diff)
downloadorg-mode-1886af4337e802806ff8873822ccbd2e3763aa07.tar.gz
Merge branch 'maint'
Conflicts: lisp/org.el
-rw-r--r--lisp/org-lparse.el2
-rw-r--r--lisp/org.el41
2 files changed, 25 insertions, 18 deletions
diff --git a/lisp/org-lparse.el b/lisp/org-lparse.el
index 1413dd1..91b7cc9 100644
--- a/lisp/org-lparse.el
+++ b/lisp/org-lparse.el
@@ -475,6 +475,8 @@ This is a helper routine for interactive use."
(eval-when-compile
(require 'browse-url))
+(declare-function browse-url-file-url "browse-url" (file))
+
(defun org-lparse-do-convert (in-file out-fmt &optional prefix-arg)
"Workhorse routine for `org-export-odt-convert'."
(require 'browse-url)
diff --git a/lisp/org.el b/lisp/org.el
index 3984fc3..a1b6692 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -136,13 +136,13 @@ Stars are put in group 1 and the trimmed body in group 2.")
(declare-function org-table-maybe-recalculate-line "org-table" ())
(autoload 'org-element-at-point "org-element")
+(autoload 'org-element-type "org-element")
(declare-function org-element-at-point "org-element" (&optional keep-trail))
(declare-function org-element-type "org-element" (element))
(declare-function org-element-context "org-element" ())
(declare-function org-element-contents "org-element" (element))
(declare-function org-element-property "org-element" (property element))
-(declare-function org-element-paragraph-parser "org-element" (limit))
(declare-function org-element-map "org-element" (data types fun &optional info first-match no-recursion))
(declare-function org-element-nested-p "org-element" (elem-a elem-b))
(declare-function org-element-swap-A-B "org-element" (elem-a elem-b))
@@ -11073,24 +11073,26 @@ this is used for the GOTO interface."
(declare-function org-string-nw-p "org-macs" (s))
(defun org-refile-check-position (refile-pointer)
- "Check if the refile pointer matches the readline to which it points."
+ "Check if the refile pointer matches the headline to which it points."
(let* ((file (nth 1 refile-pointer))
(re (nth 2 refile-pointer))
(pos (nth 3 refile-pointer))
buffer)
- (when (org-string-nw-p re)
- (setq buffer (if (markerp pos)
- (marker-buffer pos)
- (or (find-buffer-visiting file)
- (find-file-noselect file))))
- (with-current-buffer buffer
- (save-excursion
- (save-restriction
- (widen)
- (goto-char pos)
- (beginning-of-line 1)
- (unless (org-looking-at-p re)
- (error "Invalid refile position, please clear the cache with `C-0 C-c C-w' before refiling"))))))))
+ (if (and (not (markerp pos)) (not file))
+ (error "Please save the buffer to a file before refiling")
+ (when (org-string-nw-p re)
+ (setq buffer (if (markerp pos)
+ (marker-buffer pos)
+ (or (find-buffer-visiting file)
+ (find-file-noselect file))))
+ (with-current-buffer buffer
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char pos)
+ (beginning-of-line 1)
+ (unless (org-looking-at-p re)
+ (error "Invalid refile position, please clear the cache with `C-0 C-c C-w' before refiling")))))))))
(defun org-refile-new-child (parent-target child)
"Use refile target PARENT-TARGET to add new CHILD below it."
@@ -16983,7 +16985,9 @@ end of the list."
(file-alist (mapcar (lambda (x)
(cons (file-truename x) x))
(org-agenda-files t)))
- (ctf (file-truename buffer-file-name))
+ (ctf (file-truename
+ (or buffer-file-name
+ (error "Please save the current buffer to a file"))))
x had)
(setq x (assoc ctf file-alist) had x)
@@ -17002,7 +17006,8 @@ These are the files which are being checked for agenda entries.
Optional argument FILE means use this file instead of the current."
(interactive)
(let* ((org-agenda-skip-unavailable-files nil)
- (file (or file buffer-file-name))
+ (file (or file buffer-file-name
+ (error "Current buffer does not visit a file")))
(true-file (file-truename file))
(afile (abbreviate-file-name file))
(files (delq nil (mapcar
@@ -17024,7 +17029,7 @@ Optional argument FILE means use this file instead of the current."
(defun org-check-agenda-file (file)
"Make sure FILE exists. If not, ask user what to do."
(when (not (file-exists-p file))
- (message "non-existent agenda file %s. [R]emove from list or [A]bort?"
+ (message "Non-existent agenda file %s. [R]emove from list or [A]bort?"
(abbreviate-file-name file))
(let ((r (downcase (read-char-exclusive))))
(cond