]> code.delx.au - gnu-emacs/blobdiff - lisp/org/org.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / org / org.el
index 3abf62704bb90563a6721037fc526274a18e2afa..1921a59bbd051147a4cff71f4f4c2ca581c37e04 100644 (file)
@@ -15069,7 +15069,7 @@ a *different* entry, you cannot use these techniques."
          (if (not scope)
              (progn
                (org-agenda-prepare-buffers
-                (list (buffer-file-name (current-buffer))))
+                (and buffer-file-name (list buffer-file-name)))
                (setq res (org-scan-tags func matcher todo-only start-level)))
            ;; Get the right scope
            (cond
@@ -15081,7 +15081,7 @@ a *different* entry, you cannot use these techniques."
              (setq scope (org-agenda-files t))
              (setq scope (org-add-archive-files scope)))
             ((eq scope 'file)
-             (setq scope (list (buffer-file-name))))
+             (setq scope (and buffer-file-name (list buffer-file-name))))
             ((eq scope 'file-with-archives)
              (setq scope (org-add-archive-files (list (buffer-file-name))))))
            (org-agenda-prepare-buffers scope)
@@ -17459,8 +17459,7 @@ When SUPPRESS-TMP-DELAY is non-nil, suppress delays like \"--2d\"."
                         (+ (if (eq org-ts-what 'hour) n 0)   (nth 2 time0))
                         (+ (if (eq org-ts-what 'day) n 0)    (nth 3 time0))
                         (+ (if (eq org-ts-what 'month) n 0)  (nth 4 time0))
-                        (+ (if (eq org-ts-what 'year) n 0)   (nth 5 time0))
-                        (nthcdr 6 time0)))
+                        (+ (if (eq org-ts-what 'year) n 0)   (nth 5 time0))))
       (when (and (member org-ts-what '(hour minute))
                 extra
                 (string-match "-\\([012][0-9]\\):\\([0-5][0-9]\\)" extra))