summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Kanfer <zkanfer@gmail.com>2012-02-06 21:22:16 +0000
committerBastien Guerry <bzg@altern.org>2012-04-21 12:13:06 +0200
commit4e4a7eb029d0a7f4177a207a6f114a06b3396149 (patch)
treee3be4c4b3723373050d47c2b274824dd95fc538e
parent628431b06ffcbe38c1a977a97eafe6e7d23d4a1f (diff)
downloadorg-mode-4e4a7eb029d0a7f4177a207a6f114a06b3396149.tar.gz
org.el (org-read-date-display): Fix bug when displaying the overlay.
* org.el (org-read-date-display): Fix bug when displaying the overlay. TINYCHANGE
-rw-r--r--lisp/org.el58
1 files changed, 29 insertions, 29 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 0b66cb1..5019898 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15130,35 +15130,35 @@ user."
(when org-read-date-display-live
(when org-read-date-overlay
(delete-overlay org-read-date-overlay))
- (let ((p (point)))
- (end-of-line 1)
- (while (not (equal (buffer-substring
- (max (point-min) (- (point) 4)) (point))
- " "))
- (insert " "))
- (goto-char p))
- (let* ((ans (concat (buffer-substring (point-at-bol) (point-max))
- " " (or org-ans1 org-ans2)))
- (org-end-time-was-given nil)
- (f (org-read-date-analyze ans org-def org-defdecode))
- (fmts (if org-dcst
- org-time-stamp-custom-formats
- org-time-stamp-formats))
- (fmt (if (or org-with-time
- (and (boundp 'org-time-was-given) org-time-was-given))
- (cdr fmts)
- (car fmts)))
- (txt (concat "=> " (format-time-string fmt (apply 'encode-time f)))))
- (when (and org-end-time-was-given
- (string-match org-plain-time-of-day-regexp txt))
- (setq txt (concat (substring txt 0 (match-end 0)) "-"
- org-end-time-was-given
- (substring txt (match-end 0)))))
- (when org-read-date-analyze-futurep
- (setq txt (concat txt " (=>F)")))
- (setq org-read-date-overlay
- (make-overlay (1- (point-at-eol)) (point-at-eol)))
- (org-overlay-display org-read-date-overlay txt 'secondary-selection))))
+ (when (minibufferp (current-buffer))
+ (save-excursion
+ (end-of-line 1)
+ (while (not (equal (buffer-substring
+ (max (point-min) (- (point) 4)) (point))
+ " "))
+ (insert " ")))
+ (let* ((ans (concat (buffer-substring (point-at-bol) (point-max))
+ " " (or org-ans1 org-ans2)))
+ (org-end-time-was-given nil)
+ (f (org-read-date-analyze ans org-def org-defdecode))
+ (fmts (if org-dcst
+ org-time-stamp-custom-formats
+ org-time-stamp-formats))
+ (fmt (if (or org-with-time
+ (and (boundp 'org-time-was-given) org-time-was-given))
+ (cdr fmts)
+ (car fmts)))
+ (txt (concat "=> " (format-time-string fmt (apply 'encode-time f)))))
+ (when (and org-end-time-was-given
+ (string-match org-plain-time-of-day-regexp txt))
+ (setq txt (concat (substring txt 0 (match-end 0)) "-"
+ org-end-time-was-given
+ (substring txt (match-end 0)))))
+ (when org-read-date-analyze-futurep
+ (setq txt (concat txt " (=>F)")))
+ (setq org-read-date-overlay
+ (make-overlay (1- (point-at-eol)) (point-at-eol)))
+ (org-overlay-display org-read-date-overlay txt 'secondary-selection)))))
(defun org-read-date-analyze (ans org-def org-defdecode)
"Analyze the combined answer of the date prompt."