aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2005-06-14 15:33:45 +0000
committerJuanma Barranquero2005-06-14 15:33:45 +0000
commit4b9e737811fbf253db0418f2f78be43ee9a5cbf2 (patch)
tree9dedcb6c196ac4c2b4c458c5eabbd3ebbcd1f48d
parent1939ac922fbae817e08ca325b6c56964b26cdc36 (diff)
downloademacs-4b9e737811fbf253db0418f2f78be43ee9a5cbf2.tar.gz
emacs-4b9e737811fbf253db0418f2f78be43ee9a5cbf2.zip
(org-promote, org-evaluate-time-range, org-agenda-next-date-line,
org-agenda-previous-date-line, org-agenda-error, org-open-at-point, org-table-move-row, org-format-table-table-html-using-table-generate-source, org-shiftcursor-error, org-ctrl-c-ctrl-c): Follow error conventions.
-rw-r--r--lisp/textmodes/org.el228
1 files changed, 114 insertions, 114 deletions
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index c88f288a242..635bb6b5a98 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -1,4 +1,4 @@
1;;; org.el --- Outline-based notes management and organizer 1;;; org.el --- Outline-based notes management and organizer
2;; Carstens outline-mode for keeping track of everything. 2;; Carstens outline-mode for keeping track of everything.
3;; Copyright (c) 2004, 2005 Free Software Foundation 3;; Copyright (c) 2004, 2005 Free Software Foundation
4;; 4;;
@@ -445,7 +445,7 @@ is used instead.")
445 (goto-char (point-min)) 445 (goto-char (point-min))
446 (while (re-search-forward re nil t) 446 (while (re-search-forward re nil t)
447 (setq key (match-string 1) value (match-string 2)) 447 (setq key (match-string 1) value (match-string 2))
448 (cond 448 (cond
449 ((equal key "CATEGORY") 449 ((equal key "CATEGORY")
450 (if (string-match "[ \t]+$" value) 450 (if (string-match "[ \t]+$" value)
451 (setq value (replace-match "" t t value))) 451 (setq value (replace-match "" t t value)))
@@ -485,7 +485,7 @@ is used instead.")
485 org-todo-kwd-max-priority (1- (length org-todo-keywords)) 485 org-todo-kwd-max-priority (1- (length org-todo-keywords))
486 org-ds-keyword-length (+ 2 (max (length org-deadline-string) 486 org-ds-keyword-length (+ 2 (max (length org-deadline-string)
487 (length org-scheduled-string))) 487 (length org-scheduled-string)))
488 org-done-string 488 org-done-string
489 (nth (1- (length org-todo-keywords)) org-todo-keywords) 489 (nth (1- (length org-todo-keywords)) org-todo-keywords)
490 org-todo-regexp 490 org-todo-regexp
491 (concat "\\<\\(" (mapconcat 'regexp-quote org-todo-keywords 491 (concat "\\<\\(" (mapconcat 'regexp-quote org-todo-keywords
@@ -565,7 +565,7 @@ When nil, cursor will remain in the current window."
565 565
566(defcustom org-select-agenda-window t 566(defcustom org-select-agenda-window t
567 "Non-nil means, after creating an agenda, move cursor into Agenda window. 567 "Non-nil means, after creating an agenda, move cursor into Agenda window.
568When nil, cursor will remain in the current window." 568When nil, cursor will remain in the current window."
569 :group 'org-agenda 569 :group 'org-agenda
570 :type 'boolean) 570 :type 'boolean)
571 571
@@ -601,7 +601,7 @@ When nil, always start on the current day."
601When nil, date-less entries will only be shown if `org-agenda' is called 601When nil, date-less entries will only be shown if `org-agenda' is called
602with a prefix argument. 602with a prefix argument.
603When non-nil, the TODO entries will be listed at the top of the agenda, before 603When non-nil, the TODO entries will be listed at the top of the agenda, before
604the entries for specific days." 604the entries for specific days."
605 :group 'org-agenda 605 :group 'org-agenda
606 :type 'boolean) 606 :type 'boolean)
607 607
@@ -646,7 +646,7 @@ priority.
646Leaving out `category-keep' would mean that items will be sorted across 646Leaving out `category-keep' would mean that items will be sorted across
647categories by priority." 647categories by priority."
648 :group 'org-agenda 648 :group 'org-agenda
649 :type '(repeat 649 :type '(repeat
650 (choice 650 (choice
651 (const time-up) 651 (const time-up)
652 (const time-down) 652 (const time-down)
@@ -722,7 +722,7 @@ the variable `org-agenda-time-grid'."
722 :group 'org-agenda 722 :group 'org-agenda
723 :type 'boolean) 723 :type 'boolean)
724 724
725(defcustom org-agenda-time-grid 725(defcustom org-agenda-time-grid
726 '((daily today require-timed) 726 '((daily today require-timed)
727 "----------------" 727 "----------------"
728 (800 1000 1200 1400 1600 1800 2000)) 728 (800 1000 1200 1400 1600 1800 2000))
@@ -741,7 +741,7 @@ The second item is a string which will be places behing the grid time.
741The third item is a list of integers, indicating the times that should have 741The third item is a list of integers, indicating the times that should have
742a grid line." 742a grid line."
743 :group 'org-agenda 743 :group 'org-agenda
744 :type 744 :type
745 '(list 745 '(list
746 (set :greedy t :tag "Grid Display Options" 746 (set :greedy t :tag "Grid Display Options"
747 (const :tag "Show grid in single day agenda display" daily) 747 (const :tag "Show grid in single day agenda display" daily)
@@ -835,7 +835,7 @@ unnecessary clutter."
835 835
836(defcustom org-archive-location "%s_archive::" 836(defcustom org-archive-location "%s_archive::"
837 "The location where subtrees should be archived. 837 "The location where subtrees should be archived.
838This string consists of two parts, separated by a double-colon. 838This string consists of two parts, separated by a double-colon.
839 839
840The first part is a file name - when omitted, archiving happens in the same 840The first part is a file name - when omitted, archiving happens in the same
841file. %s will be replaced by the current file name (without directory part). 841file. %s will be replaced by the current file name (without directory part).
@@ -864,7 +864,7 @@ Here are a few examples:
864 864
865You may set this option on a per-file basis by adding to the buffer a 865You may set this option on a per-file basis by adding to the buffer a
866line like 866line like
867 867
868#+ARCHIVE: basement::** Finished Tasks" 868#+ARCHIVE: basement::** Finished Tasks"
869 :group 'org-structure 869 :group 'org-structure
870 :type 'string) 870 :type 'string)
@@ -1556,7 +1556,7 @@ When this is non-nil, the headline after the keyword is set to the
1556 "Face for items scheduled previously, and not yet done." 1556 "Face for items scheduled previously, and not yet done."
1557 :group 'org-faces) 1557 :group 'org-faces)
1558 1558
1559(defface org-link 1559(defface org-link
1560 '((((type tty) (class color)) (:foreground "cyan" :weight bold)) 1560 '((((type tty) (class color)) (:foreground "cyan" :weight bold))
1561 (((class color) (background light)) (:foreground "Purple")) 1561 (((class color) (background light)) (:foreground "Purple"))
1562 (((class color) (background dark)) (:foreground "Cyan")) 1562 (((class color) (background dark)) (:foreground "Cyan"))
@@ -1663,7 +1663,7 @@ sets it back to nil.")
1663 1663
1664;;;###autoload 1664;;;###autoload
1665(define-derived-mode org-mode outline-mode "Org" 1665(define-derived-mode org-mode outline-mode "Org"
1666 "Outline-based notes management and organizer, alias 1666 "Outline-based notes management and organizer, alias
1667\"Carstens outline-mode for keeping track of everything.\" 1667\"Carstens outline-mode for keeping track of everything.\"
1668 1668
1669Org-mode develops organizational tasks around a NOTES file which 1669Org-mode develops organizational tasks around a NOTES file which
@@ -1728,7 +1728,7 @@ The following commands are available:
1728;;; Font-Lock stuff 1728;;; Font-Lock stuff
1729 1729
1730(defvar org-mouse-map (make-sparse-keymap)) 1730(defvar org-mouse-map (make-sparse-keymap))
1731(define-key org-mouse-map 1731(define-key org-mouse-map
1732 (if org-xemacs-p [button2] [mouse-2]) 'org-open-at-mouse) 1732 (if org-xemacs-p [button2] [mouse-2]) 'org-open-at-mouse)
1733(define-key org-mouse-map 1733(define-key org-mouse-map
1734 (if org-xemacs-p [button3] [mouse-3]) 'org-find-file-at-mouse) 1734 (if org-xemacs-p [button3] [mouse-3]) 'org-find-file-at-mouse)
@@ -1804,9 +1804,9 @@ The following commands are available:
1804 (list (concat "\\<" org-scheduled-string) '(0 'org-warning t)) 1804 (list (concat "\\<" org-scheduled-string) '(0 'org-warning t))
1805 ;; '("\\(\\s-\\|^\\)\\(\\*\\([a-zA-Z]+\\)\\*\\)\\([^a-zA-Z*]\\|$\\)" 1805 ;; '("\\(\\s-\\|^\\)\\(\\*\\([a-zA-Z]+\\)\\*\\)\\([^a-zA-Z*]\\|$\\)"
1806 ;; (3 'bold)) 1806 ;; (3 'bold))
1807 ;; '("\\(\\s-\\|^\\)\\(/\\([a-zA-Z]+\\)/\\)\\([^a-zA-Z*]\\|$\\)" 1807 ;; '("\\(\\s-\\|^\\)\\(/\\([a-zA-Z]+\\)/\\)\\([^a-zA-Z*]\\|$\\)"
1808 ;; (3 'italic)) 1808 ;; (3 'italic))
1809 ;; '("\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)" 1809 ;; '("\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)"
1810 ;; (3 'underline)) 1810 ;; (3 'underline))
1811 '("\\<FIXME\\>" (0 'org-warning t)) 1811 '("\\<FIXME\\>" (0 'org-warning t))
1812 (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string "\\)\\>") 1812 (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string "\\)\\>")
@@ -1825,7 +1825,7 @@ The following commands are available:
1825 (if org-noutline-p ; FIXME: I am not sure if eval will work 1825 (if org-noutline-p ; FIXME: I am not sure if eval will work
1826 ; on XEmacs if noutline is ever ported 1826 ; on XEmacs if noutline is ever ported
1827 '((eval . (list "^\\(\\*+\\).*" 1827 '((eval . (list "^\\(\\*+\\).*"
1828 0 '(nth 1828 0 '(nth
1829 (% (- (match-end 1) (match-beginning 1) 1) 1829 (% (- (match-end 1) (match-beginning 1) 1)
1830 org-n-levels) 1830 org-n-levels)
1831 org-level-faces) 1831 org-level-faces)
@@ -1839,7 +1839,7 @@ The following commands are available:
1839 (set (make-local-variable 'font-lock-defaults) 1839 (set (make-local-variable 'font-lock-defaults)
1840 '(org-font-lock-keywords t nil nil backward-paragraph)) 1840 '(org-font-lock-keywords t nil nil backward-paragraph))
1841 (kill-local-variable 'font-lock-keywords) nil)) 1841 (kill-local-variable 'font-lock-keywords) nil))
1842 1842
1843(defun org-unfontify-region (beg end &optional maybe_loudly) 1843(defun org-unfontify-region (beg end &optional maybe_loudly)
1844 "Remove fontification and activation overlays from links." 1844 "Remove fontification and activation overlays from links."
1845 (font-lock-default-unfontify-region beg end) 1845 (font-lock-default-unfontify-region beg end)
@@ -2239,7 +2239,7 @@ in the region."
2239 (org-back-to-heading t) 2239 (org-back-to-heading t)
2240 (let* ((level (save-match-data (funcall outline-level))) 2240 (let* ((level (save-match-data (funcall outline-level)))
2241 (up-head (make-string (1- level) ?*))) 2241 (up-head (make-string (1- level) ?*)))
2242 (if (= level 1) (error "Cannot promote to level 0. UNDO to recover.")) 2242 (if (= level 1) (error "Cannot promote to level 0. UNDO to recover"))
2243 (replace-match up-head nil t) 2243 (replace-match up-head nil t)
2244 (if org-adapt-indentation 2244 (if org-adapt-indentation
2245 (org-fixup-indentation "^ " "" "^ ?\\S-")))) 2245 (org-fixup-indentation "^ " "" "^ ?\\S-"))))
@@ -2558,7 +2558,7 @@ heading be marked DONE, and the current time will be added."
2558 (end-of-line 0)) 2558 (end-of-line 0))
2559 ;; Make the heading visible, and the following as well 2559 ;; Make the heading visible, and the following as well
2560 (let ((org-show-following-heading t)) (org-show-hierarchy-above)) 2560 (let ((org-show-following-heading t)) (org-show-hierarchy-above))
2561 (if (re-search-forward 2561 (if (re-search-forward
2562 (concat "^" (regexp-quote (make-string level ?*)) "[ \t]") 2562 (concat "^" (regexp-quote (make-string level ?*)) "[ \t]")
2563 nil t) 2563 nil t)
2564 (progn (goto-char (match-beginning 0)) (insert "\n") 2564 (progn (goto-char (match-beginning 0)) (insert "\n")
@@ -2617,11 +2617,11 @@ At all other locations, this simply calls `ispell-complete-word'."
2617 (table (cond 2617 (table (cond
2618 (opt 2618 (opt
2619 (setq type :opt) 2619 (setq type :opt)
2620 (mapcar (lambda (x) 2620 (mapcar (lambda (x)
2621 (string-match "^#\\+\\(\\([A-Z_]+:?\\).*\\)" x) 2621 (string-match "^#\\+\\(\\([A-Z_]+:?\\).*\\)" x)
2622 (cons (match-string 2 x) (match-string 1 x))) 2622 (cons (match-string 2 x) (match-string 1 x)))
2623 (org-split-string (org-get-current-options) "\n"))) 2623 (org-split-string (org-get-current-options) "\n")))
2624 (texp 2624 (texp
2625 (setq type :tex) 2625 (setq type :tex)
2626 org-html-entities) 2626 org-html-entities)
2627 ((string-match "\\`\\*+[ \t]*\\'" 2627 ((string-match "\\`\\*+[ \t]*\\'"
@@ -2631,7 +2631,7 @@ At all other locations, this simply calls `ispell-complete-word'."
2631 (t (progn (ispell-complete-word arg) (throw 'exit nil))))) 2631 (t (progn (ispell-complete-word arg) (throw 'exit nil)))))
2632 (completion (try-completion pattern table))) 2632 (completion (try-completion pattern table)))
2633 (cond ((eq completion t) 2633 (cond ((eq completion t)
2634 (if (equal type :opt) 2634 (if (equal type :opt)
2635 (insert (substring (cdr (assoc (upcase pattern) table)) 2635 (insert (substring (cdr (assoc (upcase pattern) table))
2636 (length pattern))))) 2636 (length pattern)))))
2637 ((null completion) 2637 ((null completion)
@@ -2639,7 +2639,7 @@ At all other locations, this simply calls `ispell-complete-word'."
2639 (ding)) 2639 (ding))
2640 ((not (string= pattern completion)) 2640 ((not (string= pattern completion))
2641 (delete-region beg end) 2641 (delete-region beg end)
2642 (if (string-match " +$" completion) 2642 (if (string-match " +$" completion)
2643 (setq completion (replace-match "" t t completion))) 2643 (setq completion (replace-match "" t t completion)))
2644 (insert completion) 2644 (insert completion)
2645 (if (get-buffer-window "*Completions*") 2645 (if (get-buffer-window "*Completions*")
@@ -2876,9 +2876,9 @@ ACTION can be set, up, or down."
2876 (save-match-data 2876 (save-match-data
2877 (if (not (string-match org-priority-regexp s)) 2877 (if (not (string-match org-priority-regexp s))
2878 (* 1000 (- org-lowest-priority org-default-priority)) 2878 (* 1000 (- org-lowest-priority org-default-priority))
2879 (* 1000 (- org-lowest-priority 2879 (* 1000 (- org-lowest-priority
2880 (string-to-char (match-string 2 s))))))) 2880 (string-to-char (match-string 2 s)))))))
2881 2881
2882;;; Timestamps 2882;;; Timestamps
2883 2883
2884(defvar org-last-changed-timestamp nil) 2884(defvar org-last-changed-timestamp nil)
@@ -2910,7 +2910,7 @@ at the cursor, it will be modified."
2910 (setq time (let ((this-command this-command)) 2910 (setq time (let ((this-command this-command))
2911 (org-read-date arg 'totime))) 2911 (org-read-date arg 'totime)))
2912 (and (org-at-timestamp-p) (replace-match 2912 (and (org-at-timestamp-p) (replace-match
2913 (setq org-last-changed-timestamp 2913 (setq org-last-changed-timestamp
2914 (format-time-string fmt time)) 2914 (format-time-string fmt time))
2915 t t)) 2915 t t))
2916 (message "Timestamp updated")) 2916 (message "Timestamp updated"))
@@ -2940,8 +2940,8 @@ but this can be configured with the variables `parse-time-months' and
2940 2940
2941While prompting, a calendar is popped up - you can also select the 2941While prompting, a calendar is popped up - you can also select the
2942date with the mouse (button 1). The calendar shows a period of three 2942date with the mouse (button 1). The calendar shows a period of three
2943month. To scroll it to other months, use the keys `>' and `<'. 2943month. To scroll it to other months, use the keys `>' and `<'.
2944If you don't like the calendar, turn it off with 2944If you don't like the calendar, turn it off with
2945 \(setq org-popup-calendar-for-date-prompt nil). 2945 \(setq org-popup-calendar-for-date-prompt nil).
2946 2946
2947With optional argument TO-TIME, the date will immediately be converted 2947With optional argument TO-TIME, the date will immediately be converted
@@ -2955,7 +2955,7 @@ used to insert the time stamp into the buffer to include the time."
2955 ;; Default time is either today, or, when entering a range, 2955 ;; Default time is either today, or, when entering a range,
2956 ;; the range start. 2956 ;; the range start.
2957 (if (save-excursion 2957 (if (save-excursion
2958 (re-search-backward 2958 (re-search-backward
2959 (concat org-ts-regexp "--\\=") 2959 (concat org-ts-regexp "--\\=")
2960 (- (point) 20) t)) 2960 (- (point) 20) t))
2961 (apply 2961 (apply
@@ -3066,7 +3066,7 @@ This is used by `org-read-date' in a temporary keymap for the calendar buffer."
3066 (time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date)))) 3066 (time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
3067 (setq ans1 (format-time-string "%Y-%m-%d" time))) 3067 (setq ans1 (format-time-string "%Y-%m-%d" time)))
3068 (if (active-minibuffer-window) (exit-minibuffer)))) 3068 (if (active-minibuffer-window) (exit-minibuffer))))
3069 3069
3070(defun org-check-deadlines (ndays) 3070(defun org-check-deadlines (ndays)
3071 "Check if there are any deadlines due or past due. 3071 "Check if there are any deadlines due or past due.
3072A deadline is considered due if it happens within `org-deadline-warning-days' 3072A deadline is considered due if it happens within `org-deadline-warning-days'
@@ -3106,7 +3106,7 @@ days in order to avoid rounding problems."
3106 (goto-char (point-at-bol)) 3106 (goto-char (point-at-bol))
3107 (re-search-forward org-tr-regexp (point-at-eol) t)) 3107 (re-search-forward org-tr-regexp (point-at-eol) t))
3108 (if (not (org-at-date-range-p)) 3108 (if (not (org-at-date-range-p))
3109 (error "Not at a time-stamp range, and none found in current line."))) 3109 (error "Not at a time-stamp range, and none found in current line")))
3110 (let* ((ts1 (match-string 1)) 3110 (let* ((ts1 (match-string 1))
3111 (ts2 (match-string 2)) 3111 (ts2 (match-string 2))
3112 (havetime (or (> (length ts1) 15) (> (length ts2) 15))) 3112 (havetime (or (> (length ts1) 15) (> (length ts2) 15)))
@@ -3358,10 +3358,10 @@ The following commands are available:
3358 (add-hook 'post-command-hook 'org-agenda-post-command-hook nil 'local) 3358 (add-hook 'post-command-hook 'org-agenda-post-command-hook nil 'local)
3359 (add-hook 'pre-command-hook 'org-unhighlight nil 'local) 3359 (add-hook 'pre-command-hook 'org-unhighlight nil 'local)
3360 (setq org-agenda-follow-mode nil) 3360 (setq org-agenda-follow-mode nil)
3361 (easy-menu-change 3361 (easy-menu-change
3362 '("Agenda") "Agenda Files" 3362 '("Agenda") "Agenda Files"
3363 (append 3363 (append
3364 (list 3364 (list
3365 ["Edit File List" (customize-variable 'org-agenda-files) t] 3365 ["Edit File List" (customize-variable 'org-agenda-files) t]
3366 "--") 3366 "--")
3367 (mapcar 'org-file-menu-entry org-agenda-files))) 3367 (mapcar 'org-file-menu-entry org-agenda-files)))
@@ -3422,7 +3422,7 @@ The following commands are available:
3422(defvar org-agenda-keymap (copy-keymap org-agenda-mode-map) 3422(defvar org-agenda-keymap (copy-keymap org-agenda-mode-map)
3423 "Local keymap for agenda entries from Org-mode.") 3423 "Local keymap for agenda entries from Org-mode.")
3424 3424
3425(define-key org-agenda-keymap 3425(define-key org-agenda-keymap
3426 (if org-xemacs-p [(button2)] [(mouse-2)]) 'org-agenda-goto-mouse) 3426 (if org-xemacs-p [(button2)] [(mouse-2)]) 'org-agenda-goto-mouse)
3427(define-key org-agenda-keymap 3427(define-key org-agenda-keymap
3428 (if org-xemacs-p [(button3)] [(mouse-3)]) 'org-agenda-show-mouse) 3428 (if org-xemacs-p [(button3)] [(mouse-3)]) 'org-agenda-show-mouse)
@@ -3434,7 +3434,7 @@ The following commands are available:
3434 ["Show" org-agenda-show t] 3434 ["Show" org-agenda-show t]
3435 ["Go To (other window)" org-agenda-goto t] 3435 ["Go To (other window)" org-agenda-goto t]
3436 ["Go To (one window)" org-agenda-switch-to t] 3436 ["Go To (one window)" org-agenda-switch-to t]
3437 ["Follow Mode" org-agenda-follow-mode 3437 ["Follow Mode" org-agenda-follow-mode
3438 :style toggle :selected org-agenda-follow-mode :active t] 3438 :style toggle :selected org-agenda-follow-mode :active t]
3439 "--" 3439 "--"
3440 ["Cycle TODO" org-agenda-todo t] 3440 ["Cycle TODO" org-agenda-todo t]
@@ -3552,7 +3552,7 @@ dates."
3552 (org-respect-restriction t) 3552 (org-respect-restriction t)
3553 (past t) 3553 (past t)
3554 s e rtn d) 3554 s e rtn d)
3555 (setq org-agenda-redo-command 3555 (setq org-agenda-redo-command
3556 (list 'progn 3556 (list 'progn
3557 (list 'switch-to-buffer-other-window (current-buffer)) 3557 (list 'switch-to-buffer-other-window (current-buffer))
3558 (list 'org-timeline include-all))) 3558 (list 'org-timeline include-all)))
@@ -3561,7 +3561,7 @@ dates."
3561 (setq day-numbers (delq nil (mapcar (lambda(x) 3561 (setq day-numbers (delq nil (mapcar (lambda(x)
3562 (if (>= x today) x nil)) 3562 (if (>= x today) x nil))
3563 day-numbers)))) 3563 day-numbers))))
3564 (switch-to-buffer-other-window 3564 (switch-to-buffer-other-window
3565 (get-buffer-create org-agenda-buffer-name)) 3565 (get-buffer-create org-agenda-buffer-name))
3566 (setq buffer-read-only nil) 3566 (setq buffer-read-only nil)
3567 (erase-buffer) 3567 (erase-buffer)
@@ -3576,7 +3576,7 @@ dates."
3576 (setq date (calendar-gregorian-from-absolute d)) 3576 (setq date (calendar-gregorian-from-absolute d))
3577 (setq s (point)) 3577 (setq s (point))
3578 (if dotodo 3578 (if dotodo
3579 (setq rtn (org-agenda-get-day-entries 3579 (setq rtn (org-agenda-get-day-entries
3580 entry date :todo :timestamp)) 3580 entry date :todo :timestamp))
3581 (setq rtn (org-agenda-get-day-entries entry date :timestamp))) 3581 (setq rtn (org-agenda-get-day-entries entry date :timestamp)))
3582 (if (or rtn (equal d today)) 3582 (if (or rtn (equal d today))
@@ -3632,7 +3632,7 @@ NDAYS defaults to `org-agenda-ndays'."
3632 (day-numbers (list start)) 3632 (day-numbers (list start))
3633 (inhibit-redisplay t) 3633 (inhibit-redisplay t)
3634 s e rtn rtnall file date d start-pos end-pos todayp nd) 3634 s e rtn rtnall file date d start-pos end-pos todayp nd)
3635 (setq org-agenda-redo-command 3635 (setq org-agenda-redo-command
3636 (list 'org-agenda include-all start-day ndays)) 3636 (list 'org-agenda include-all start-day ndays))
3637 ;; Make the list of days 3637 ;; Make the list of days
3638 (setq ndays (or ndays org-agenda-ndays) 3638 (setq ndays (or ndays org-agenda-ndays)
@@ -3644,7 +3644,7 @@ NDAYS defaults to `org-agenda-ndays'."
3644 (if (not (equal (current-buffer) (get-buffer org-agenda-buffer-name))) 3644 (if (not (equal (current-buffer) (get-buffer org-agenda-buffer-name)))
3645 (progn 3645 (progn
3646 (delete-other-windows) 3646 (delete-other-windows)
3647 (switch-to-buffer-other-window 3647 (switch-to-buffer-other-window
3648 (get-buffer-create org-agenda-buffer-name)))) 3648 (get-buffer-create org-agenda-buffer-name))))
3649 (setq buffer-read-only nil) 3649 (setq buffer-read-only nil)
3650 (erase-buffer) 3650 (erase-buffer)
@@ -3662,7 +3662,7 @@ NDAYS defaults to `org-agenda-ndays'."
3662 rtn (org-agenda-get-day-entries 3662 rtn (org-agenda-get-day-entries
3663 file date :todo)) 3663 file date :todo))
3664 (setq rtnall (append rtnall rtn)))) 3664 (setq rtnall (append rtnall rtn))))
3665 (when rtnall 3665 (when rtnall
3666 (insert "ALL CURRENTLY OPEN TODO ITEMS:\n") 3666 (insert "ALL CURRENTLY OPEN TODO ITEMS:\n")
3667 (add-text-properties (point-min) (1- (point)) 3667 (add-text-properties (point-min) (1- (point))
3668 (list 'face 'org-link)) 3668 (list 'face 'org-link))
@@ -3696,12 +3696,12 @@ NDAYS defaults to `org-agenda-ndays'."
3696 (extract-calendar-year date))) 3696 (extract-calendar-year date)))
3697 (put-text-property s (1- (point)) 'face 3697 (put-text-property s (1- (point)) 'face
3698 'org-link) 3698 'org-link)
3699 (if rtnall (insert 3699 (if rtnall (insert
3700 (org-finalize-agenda-entries ;; FIXME: condition needed 3700 (org-finalize-agenda-entries ;; FIXME: condition needed
3701 (org-agenda-add-time-grid-maybe 3701 (org-agenda-add-time-grid-maybe
3702 rtnall nd todayp)) 3702 rtnall nd todayp))
3703 "\n")) 3703 "\n"))
3704 (put-text-property s (1- (point)) 'day d)))) 3704 (put-text-property s (1- (point)) 'day d))))
3705 (goto-char (point-min)) 3705 (goto-char (point-min))
3706 (setq buffer-read-only t) 3706 (setq buffer-read-only t)
3707 (if org-fit-agenda-window 3707 (if org-fit-agenda-window
@@ -3791,7 +3791,7 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3791 (error "Not allowed")) 3791 (error "Not allowed"))
3792 (setq org-agenda-ndays 3792 (setq org-agenda-ndays
3793 (if (equal org-agenda-ndays 1) 7 1)) 3793 (if (equal org-agenda-ndays 1) 7 1))
3794 (org-agenda include-all-loc 3794 (org-agenda include-all-loc
3795 (or (get-text-property (point) 'day) 3795 (or (get-text-property (point) 'day)
3796 starting-day)) 3796 starting-day))
3797 (org-agenda-set-mode-name) 3797 (org-agenda-set-mode-name)
@@ -3806,7 +3806,7 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3806 (if (not (re-search-forward "^\\S-" nil t arg)) 3806 (if (not (re-search-forward "^\\S-" nil t arg))
3807 (progn 3807 (progn
3808 (backward-char 1) 3808 (backward-char 1)
3809 (error "No next date after this line in this buffer."))) 3809 (error "No next date after this line in this buffer")))
3810 (goto-char (match-beginning 0))) 3810 (goto-char (match-beginning 0)))
3811 3811
3812(defun org-agenda-previous-date-line (&optional arg) 3812(defun org-agenda-previous-date-line (&optional arg)
@@ -3814,7 +3814,7 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3814 (interactive "p") 3814 (interactive "p")
3815 (beginning-of-line 1) 3815 (beginning-of-line 1)
3816 (if (not (re-search-backward "^\\S-" nil t arg)) 3816 (if (not (re-search-backward "^\\S-" nil t arg))
3817 (error "No previous date before this line in this buffer."))) 3817 (error "No previous date before this line in this buffer")))
3818 3818
3819;; Initialize the highlight 3819;; Initialize the highlight
3820(defvar org-hl (funcall (if org-xemacs-p 'make-extent 'make-overlay) 1 1)) 3820(defvar org-hl (funcall (if org-xemacs-p 'make-extent 'make-overlay) 1 1))
@@ -3880,7 +3880,7 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3880 "Get the (Emacs Calendar) diary entries for DATE." 3880 "Get the (Emacs Calendar) diary entries for DATE."
3881 (let* ((fancy-diary-buffer "*temporary-fancy-diary-buffer*") 3881 (let* ((fancy-diary-buffer "*temporary-fancy-diary-buffer*")
3882 (diary-display-hook '(fancy-diary-display)) 3882 (diary-display-hook '(fancy-diary-display))
3883 (list-diary-entries-hook 3883 (list-diary-entries-hook
3884 (cons 'org-diary-default-entry list-diary-entries-hook)) 3884 (cons 'org-diary-default-entry list-diary-entries-hook))
3885 entries 3885 entries
3886 (org-disable-diary t)) 3886 (org-disable-diary t))
@@ -3904,12 +3904,12 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3904 (kill-buffer fancy-diary-buffer))) 3904 (kill-buffer fancy-diary-buffer)))
3905 (when entries 3905 (when entries
3906 (setq entries (org-split-string entries "\n")) 3906 (setq entries (org-split-string entries "\n"))
3907 (setq entries 3907 (setq entries
3908 (mapcar 3908 (mapcar
3909 (lambda (x) 3909 (lambda (x)
3910 (setq x (org-format-agenda-item "" x "Diary" 'time)) 3910 (setq x (org-format-agenda-item "" x "Diary" 'time))
3911 ;; Extend the text properties to the beginning of the line 3911 ;; Extend the text properties to the beginning of the line
3912 (add-text-properties 3912 (add-text-properties
3913 0 (length x) 3913 0 (length x)
3914 (text-properties-at (1- (length x)) x) 3914 (text-properties-at (1- (length x)) x)
3915 x) 3915 x)
@@ -3950,7 +3950,7 @@ date. Itt also removes lines that contain only whitespace."
3950 0 (length string) 3950 0 (length string)
3951 (list 'mouse-face 'highlight 3951 (list 'mouse-face 'highlight
3952 'keymap org-agenda-keymap 3952 'keymap org-agenda-keymap
3953 'help-echo 3953 'help-echo
3954 (format 3954 (format
3955 "mouse-2 or RET jump to diary file %s" 3955 "mouse-2 or RET jump to diary file %s"
3956 (abbreviate-file-name (buffer-file-name))) 3956 (abbreviate-file-name (buffer-file-name)))
@@ -3972,7 +3972,7 @@ Needed to avoid empty dates which mess up holiday display."
3972These are the files which are being checked for agenda entries. 3972These are the files which are being checked for agenda entries.
3973Optional argument FILE means, use this file instead of the current. 3973Optional argument FILE means, use this file instead of the current.
3974It is possible (but not recommended) to add this function to the 3974It is possible (but not recommended) to add this function to the
3975`org-mode-hook'." 3975`org-mode-hook'."
3976 (interactive) 3976 (interactive)
3977 (catch 'exit 3977 (catch 'exit
3978 (let* ((file (or file (buffer-file-name) 3978 (let* ((file (or file (buffer-file-name)
@@ -3987,7 +3987,7 @@ It is possible (but not recommended) to add this function to the
3987 org-agenda-files)))) 3987 org-agenda-files))))
3988 (if (not present) 3988 (if (not present)
3989 (progn 3989 (progn
3990 (setq org-agenda-files 3990 (setq org-agenda-files
3991 (cons afile org-agenda-files)) 3991 (cons afile org-agenda-files))
3992 ;; Make sure custom.el does not end up with Org-mode 3992 ;; Make sure custom.el does not end up with Org-mode
3993 (let ((org-mode-hook nil) (default-major-mode 'fundamental-mode)) 3993 (let ((org-mode-hook nil) (default-major-mode 'fundamental-mode))
@@ -4004,7 +4004,7 @@ Optional argument FILE means, use this file instead of the current."
4004 (let* ((file (or file (buffer-file-name))) 4004 (let* ((file (or file (buffer-file-name)))
4005 (true-file (file-truename file)) 4005 (true-file (file-truename file))
4006 (afile (abbreviate-file-name file)) 4006 (afile (abbreviate-file-name file))
4007 (files (delq nil (mapcar 4007 (files (delq nil (mapcar
4008 (lambda (x) 4008 (lambda (x)
4009 (if (equal true-file 4009 (if (equal true-file
4010 (file-truename x)) 4010 (file-truename x))
@@ -4089,7 +4089,7 @@ also be written as
4089 4089
4090The function expects the lisp variables `entry' and `date' to be provided 4090The function expects the lisp variables `entry' and `date' to be provided
4091by the caller, because this is how the calendar works. Don't use this 4091by the caller, because this is how the calendar works. Don't use this
4092function from a program - use `org-agenda-get-day-entries' instead." 4092function from a program - use `org-agenda-get-day-entries' instead."
4093 (org-agenda-maybe-reset-markers) 4093 (org-agenda-maybe-reset-markers)
4094 (org-compile-agenda-prefix-format org-agenda-prefix-format) 4094 (org-compile-agenda-prefix-format org-agenda-prefix-format)
4095 (setq args (or args '(:deadline :scheduled :timestamp))) 4095 (setq args (or args '(:deadline :scheduled :timestamp)))
@@ -4131,7 +4131,7 @@ the documentation of `org-diary'."
4131 (if (org-region-active-p) 4131 (if (org-region-active-p)
4132 ;; Respect a region to restrict search 4132 ;; Respect a region to restrict search
4133 (narrow-to-region (region-beginning) (region-end))) 4133 (narrow-to-region (region-beginning) (region-end)))
4134 ;; If we work for the calendar or many files, 4134 ;; If we work for the calendar or many files,
4135 ;; get rid of any restriction 4135 ;; get rid of any restriction
4136 (widen)) 4136 (widen))
4137 ;; The way we repeatedly append to `results' makes it O(n^2) :-( 4137 ;; The way we repeatedly append to `results' makes it O(n^2) :-(
@@ -4197,7 +4197,7 @@ the documentation of `org-diary'."
4197 (goto-char (match-beginning 1)) 4197 (goto-char (match-beginning 1))
4198 (setq marker (org-agenda-new-marker (point-at-bol)) 4198 (setq marker (org-agenda-new-marker (point-at-bol))
4199 txt (org-format-agenda-item "" (match-string 1)) 4199 txt (org-format-agenda-item "" (match-string 1))
4200 priority 4200 priority
4201 (+ (org-get-priority txt) 4201 (+ (org-get-priority txt)
4202 (if org-todo-kwd-priority-p 4202 (if org-todo-kwd-priority-p
4203 (- org-todo-kwd-max-priority -2 4203 (- org-todo-kwd-max-priority -2
@@ -4269,7 +4269,7 @@ the documentation of `org-diary'."
4269 (if deadlinep 4269 (if deadlinep
4270 (add-text-properties 4270 (add-text-properties
4271 0 (length txt) 4271 0 (length txt)
4272 (list 'face 4272 (list 'face
4273 (if donep 'org-done 'org-warning) 4273 (if donep 'org-done 'org-warning)
4274 'undone-face 'org-warning 4274 'undone-face 'org-warning
4275 'done-face 'org-done 4275 'done-face 'org-done
@@ -4329,8 +4329,8 @@ the documentation of `org-diary'."
4329 (setq txt org-agenda-no-heading-message)) 4329 (setq txt org-agenda-no-heading-message))
4330 (when txt 4330 (when txt
4331 (add-text-properties 4331 (add-text-properties
4332 0 (length txt) 4332 0 (length txt)
4333 (append 4333 (append
4334 (list 'org-marker (org-agenda-new-marker pos) 4334 (list 'org-marker (org-agenda-new-marker pos)
4335 'org-hd-marker (org-agenda-new-marker pos1) 4335 'org-hd-marker (org-agenda-new-marker pos1)
4336 'priority (+ (- 10 diff) (org-get-priority txt)) 4336 'priority (+ (- 10 diff) (org-get-priority txt))
@@ -4422,7 +4422,7 @@ the documentation of `org-diary'."
4422 (setq hdmarker (org-agenda-new-marker (match-end 1))) 4422 (setq hdmarker (org-agenda-new-marker (match-end 1)))
4423 (goto-char (match-end 1)) 4423 (goto-char (match-end 1))
4424 (looking-at "\\*+[ \t]*\\([^\r\n]+\\)") 4424 (looking-at "\\*+[ \t]*\\([^\r\n]+\\)")
4425 (setq txt (org-format-agenda-item 4425 (setq txt (org-format-agenda-item
4426 (format (if (= d1 d2) "" "(%d/%d): ") 4426 (format (if (= d1 d2) "" "(%d/%d): ")
4427 (1+ (- d0 d1)) (1+ (- d2 d1))) 4427 (1+ (- d0 d1)) (1+ (- d2 d1)))
4428 (match-string 1) nil (if (= d0 d1) timestr)))) 4428 (match-string 1) nil (if (= d0 d1) timestr))))
@@ -4504,7 +4504,7 @@ only the correctly processes TXT should be returned - this is used by
4504 (setq s0 (match-string 0 ts) 4504 (setq s0 (match-string 0 ts)
4505 s1 (match-string (if plain 1 2) ts) 4505 s1 (match-string (if plain 1 2) ts)
4506 s2 (match-string (if plain 8 4) ts)) 4506 s2 (match-string (if plain 8 4) ts))
4507 4507
4508 ;; If the times are in TXT (not in DOTIMES), and the prefix will list 4508 ;; If the times are in TXT (not in DOTIMES), and the prefix will list
4509 ;; them, we might want to remove them there to avoid duplication. 4509 ;; them, we might want to remove them there to avoid duplication.
4510 ;; The user can turn this off with a variable. 4510 ;; The user can turn this off with a variable.
@@ -4517,7 +4517,7 @@ only the correctly processes TXT should be returned - this is used by
4517 ;; Normalize the time(s) to 24 hour 4517 ;; Normalize the time(s) to 24 hour
4518 (if s1 (setq s1 (org-get-time-of-day s1 'string))) 4518 (if s1 (setq s1 (org-get-time-of-day s1 'string)))
4519 (if s2 (setq s2 (org-get-time-of-day s2 'string)))) 4519 (if s2 (setq s2 (org-get-time-of-day s2 'string))))
4520 4520
4521 ;; Create the final string 4521 ;; Create the final string
4522 (if noprefix 4522 (if noprefix
4523 (setq rtn txt) 4523 (setq rtn txt)
@@ -4529,7 +4529,7 @@ only the correctly processes TXT should be returned - this is used by
4529 category (if (symbolp category) (symbol-name category) category)) 4529 category (if (symbolp category) (symbol-name category) category))
4530 ;; Evaluate the compiled format 4530 ;; Evaluate the compiled format
4531 (setq rtn (concat (eval org-prefix-format-compiled) txt))) 4531 (setq rtn (concat (eval org-prefix-format-compiled) txt)))
4532 4532
4533 ;; And finally add the text properties 4533 ;; And finally add the text properties
4534 (add-text-properties 4534 (add-text-properties
4535 0 (length rtn) (list 'category (downcase category) 4535 0 (length rtn) (list 'category (downcase category)
@@ -4560,11 +4560,11 @@ only the correctly processes TXT should be returned - this is used by
4560 (while (setq time (pop gridtimes)) 4560 (while (setq time (pop gridtimes))
4561 (unless (and remove (member time have)) 4561 (unless (and remove (member time have))
4562 (setq time (int-to-string time)) 4562 (setq time (int-to-string time))
4563 (push (org-format-agenda-item 4563 (push (org-format-agenda-item
4564 nil string "" ;; FIXME: put a category? 4564 nil string "" ;; FIXME: put a category?
4565 (concat (substring time 0 -2) ":" (substring time -2))) 4565 (concat (substring time 0 -2) ":" (substring time -2)))
4566 new) 4566 new)
4567 (put-text-property 4567 (put-text-property
4568 1 (length (car new)) 'face 'org-time-grid (car new)))) 4568 1 (length (car new)) 'face 'org-time-grid (car new))))
4569 (if (member 'time-up org-agenda-sorting-strategy) 4569 (if (member 'time-up org-agenda-sorting-strategy)
4570 (append new list) 4570 (append new list)
@@ -4603,7 +4603,7 @@ If not found, return nil.
4603The optional STRING argument forces conversion into a 5 character wide string 4603The optional STRING argument forces conversion into a 5 character wide string
4604HH:MM." 4604HH:MM."
4605 (save-match-data 4605 (save-match-data
4606 (when 4606 (when
4607 (or 4607 (or
4608 (string-match 4608 (string-match
4609 "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)\\([AaPp][Mm]\\)?\\> *" s) 4609 "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)\\([AaPp][Mm]\\)?\\> *" s)
@@ -4659,7 +4659,7 @@ HH:MM."
4659 (category-up (org-cmp-category a b)) 4659 (category-up (org-cmp-category a b))
4660 (category-down (if category-up (- category-up) nil)) 4660 (category-down (if category-up (- category-up) nil))
4661 (category-keep (if category-up +1 nil))) ; FIXME +1 or -1? 4661 (category-keep (if category-up +1 nil))) ; FIXME +1 or -1?
4662 (cdr (assoc 4662 (cdr (assoc
4663 (eval (cons 'or org-agenda-sorting-strategy)) 4663 (eval (cons 'or org-agenda-sorting-strategy))
4664 '((-1 . t) (1 . nil) (nil . nil)))))) 4664 '((-1 . t) (1 . nil) (nil . nil))))))
4665 4665
@@ -4674,7 +4674,7 @@ and by additional input from the age of a schedules or deadline entry."
4674(defun org-agenda-goto (&optional highlight) 4674(defun org-agenda-goto (&optional highlight)
4675 "Go to the Org-mode file which contains the item at point." 4675 "Go to the Org-mode file which contains the item at point."
4676 (interactive) 4676 (interactive)
4677 (let* ((marker (or (get-text-property (point) 'org-marker) 4677 (let* ((marker (or (get-text-property (point) 'org-marker)
4678 (org-agenda-error))) 4678 (org-agenda-error)))
4679 (buffer (marker-buffer marker)) 4679 (buffer (marker-buffer marker))
4680 (pos (marker-position marker))) 4680 (pos (marker-position marker)))
@@ -4691,7 +4691,7 @@ and by additional input from the age of a schedules or deadline entry."
4691(defun org-agenda-switch-to () 4691(defun org-agenda-switch-to ()
4692 "Go to the Org-mode file which contains the item at point." 4692 "Go to the Org-mode file which contains the item at point."
4693 (interactive) 4693 (interactive)
4694 (let* ((marker (or (get-text-property (point) 'org-marker) 4694 (let* ((marker (or (get-text-property (point) 'org-marker)
4695 (org-agenda-error))) 4695 (org-agenda-error)))
4696 (buffer (marker-buffer marker)) 4696 (buffer (marker-buffer marker))
4697 (pos (marker-position marker))) 4697 (pos (marker-position marker)))
@@ -4738,7 +4738,7 @@ and by additional input from the age of a schedules or deadline entry."
4738 (org-agenda-error))) 4738 (org-agenda-error)))
4739 4739
4740(defun org-agenda-error () 4740(defun org-agenda-error ()
4741 (error "Command not allowed in this line.")) 4741 (error "Command not allowed in this line"))
4742 4742
4743(defvar org-last-heading-marker (make-marker) 4743(defvar org-last-heading-marker (make-marker)
4744 "Marker pointing to the headline that last changed its TODO state 4744 "Marker pointing to the headline that last changed its TODO state
@@ -4805,7 +4805,7 @@ the new TODO state."
4805 (beginning-of-line 1) 4805 (beginning-of-line 1)
4806 (add-text-properties (point-at-bol) (point-at-eol) props) 4806 (add-text-properties (point-at-bol) (point-at-eol) props)
4807 (if fixface 4807 (if fixface
4808 (add-text-properties 4808 (add-text-properties
4809 (point-at-bol) (point-at-eol) 4809 (point-at-bol) (point-at-eol)
4810 (list 'face 4810 (list 'face
4811 (if org-last-todo-state-is-todo 4811 (if org-last-todo-state-is-todo
@@ -4902,7 +4902,7 @@ be used to request time specification in the time stamp."
4902All the standard commands work: block, weekly etc" 4902All the standard commands work: block, weekly etc"
4903 (interactive) 4903 (interactive)
4904 (require 'diary-lib) 4904 (require 'diary-lib)
4905 (let* ((char (progn 4905 (let* ((char (progn
4906 (message "Diary entry: [d]ay [w]eekly [m]onthly [y]early [a]nniversary [b]lock [c]yclic") 4906 (message "Diary entry: [d]ay [w]eekly [m]onthly [y]early [a]nniversary [b]lock [c]yclic")
4907 (read-char-exclusive))) 4907 (read-char-exclusive)))
4908 (cmd (cdr (assoc char 4908 (cmd (cdr (assoc char
@@ -4932,7 +4932,7 @@ All the standard commands work: block, weekly etc"
4932 (progn 4932 (progn
4933 (fset 'calendar-cursor-to-date 4933 (fset 'calendar-cursor-to-date
4934 (lambda (&optional error) 4934 (lambda (&optional error)
4935 (calendar-gregorian-from-absolute 4935 (calendar-gregorian-from-absolute
4936 (get-text-property point 'day)))) 4936 (get-text-property point 'day))))
4937 (call-interactively cmd)) 4937 (call-interactively cmd))
4938 (fset 'calendar-cursor-to-date oldf))))) 4938 (fset 'calendar-cursor-to-date oldf)))))
@@ -4955,7 +4955,7 @@ the cursor position."
4955 (progn 4955 (progn
4956 (fset 'calendar-cursor-to-date 4956 (fset 'calendar-cursor-to-date
4957 (lambda (&optional error) 4957 (lambda (&optional error)
4958 (calendar-gregorian-from-absolute 4958 (calendar-gregorian-from-absolute
4959 (get-text-property point 'day)))) 4959 (get-text-property point 'day))))
4960 (call-interactively cmd)) 4960 (call-interactively cmd))
4961 (fset 'calendar-cursor-to-date oldf)))) 4961 (fset 'calendar-cursor-to-date oldf))))
@@ -5005,7 +5005,7 @@ This is a command that has to be installed in `calendar-mode-map'."
5005 (unless day 5005 (unless day
5006 (error "Don't know which date to convert")) 5006 (error "Don't know which date to convert"))
5007 (setq date (calendar-gregorian-from-absolute day)) 5007 (setq date (calendar-gregorian-from-absolute day))
5008 (setq s (concat 5008 (setq s (concat
5009 "Gregorian: " (calendar-date-string date) "\n" 5009 "Gregorian: " (calendar-date-string date) "\n"
5010 "ISO: " (calendar-iso-date-string date) "\n" 5010 "ISO: " (calendar-iso-date-string date) "\n"
5011 "Day of Yr: " (calendar-day-of-year-string date) "\n" 5011 "Day of Yr: " (calendar-day-of-year-string date) "\n"
@@ -5064,7 +5064,7 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
5064 (setq type (match-string 1) 5064 (setq type (match-string 1)
5065 path (match-string 2))) 5065 path (match-string 2)))
5066 (unless path 5066 (unless path
5067 (error "No link found.")) 5067 (error "No link found"))
5068 ;; Remove any trailing spaces in path 5068 ;; Remove any trailing spaces in path
5069 (if (string-match " +\\'" path) 5069 (if (string-match " +\\'" path)
5070 (setq path (replace-match "" t t path))) 5070 (setq path (replace-match "" t t path)))
@@ -5118,9 +5118,9 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
5118 5118
5119 ((string= type "shell") 5119 ((string= type "shell")
5120 (let ((cmd path)) 5120 (let ((cmd path))
5121 (while (string-match "@{" cmd) 5121 (while (string-match "@{" cmd)
5122 (setq cmd (replace-match "<" t t cmd))) 5122 (setq cmd (replace-match "<" t t cmd)))
5123 (while (string-match "@}" cmd) 5123 (while (string-match "@}" cmd)
5124 (setq cmd (replace-match ">" t t cmd))) 5124 (setq cmd (replace-match ">" t t cmd)))
5125 (if (or (not org-confirm-shell-links) 5125 (if (or (not org-confirm-shell-links)
5126 (yes-or-no-p (format "Execute \"%s\" in the shell? " cmd))) 5126 (yes-or-no-p (format "Execute \"%s\" in the shell? " cmd)))
@@ -5217,7 +5217,7 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
5217 (widen) 5217 (widen)
5218 (goto-char (point-max)) 5218 (goto-char (point-max))
5219 (if (re-search-backward 5219 (if (re-search-backward
5220 (concat "^Message-ID:\\s-+" (regexp-quote 5220 (concat "^Message-ID:\\s-+" (regexp-quote
5221 (or article ""))) 5221 (or article "")))
5222 nil t) 5222 nil t)
5223 (rmail-what-message)))))) 5223 (rmail-what-message))))))
@@ -5304,7 +5304,7 @@ For file links, arg negates `org-line-numbers-in-file-links'."
5304 (or (bbdb-record-name (bbdb-current-record)) 5304 (or (bbdb-record-name (bbdb-current-record))
5305 (bbdb-record-company (bbdb-current-record)))) 5305 (bbdb-record-company (bbdb-current-record))))
5306 link (org-make-link cpltxt))) 5306 link (org-make-link cpltxt)))
5307 5307
5308 ((eq major-mode 'calendar-mode) 5308 ((eq major-mode 'calendar-mode)
5309 (let ((cd (calendar-cursor-to-date))) 5309 (let ((cd (calendar-cursor-to-date)))
5310 (setq link 5310 (setq link
@@ -5330,8 +5330,8 @@ For file links, arg negates `org-line-numbers-in-file-links'."
5330 folder) 5330 folder)
5331 (setq folder (replace-match "" t t folder))) 5331 (setq folder (replace-match "" t t folder)))
5332 (setq cpltxt (concat author " on: " subject)) 5332 (setq cpltxt (concat author " on: " subject))
5333 (setq link (concat cpltxt "\n " 5333 (setq link (concat cpltxt "\n "
5334 (org-make-link 5334 (org-make-link
5335 "vm:" folder "#" message-id)))))) 5335 "vm:" folder "#" message-id))))))
5336 5336
5337 ((eq major-mode 'wl-summary-mode) 5337 ((eq major-mode 'wl-summary-mode)
@@ -5343,7 +5343,7 @@ For file links, arg negates `org-line-numbers-in-file-links'."
5343 (author (wl-summary-line-from)) ; FIXME: how to get author name? 5343 (author (wl-summary-line-from)) ; FIXME: how to get author name?
5344 (subject "???")) ; FIXME: How to get subject of email? 5344 (subject "???")) ; FIXME: How to get subject of email?
5345 (setq cpltxt (concat author " on: " subject)) 5345 (setq cpltxt (concat author " on: " subject))
5346 (setq link (concat cpltxt "\n " 5346 (setq link (concat cpltxt "\n "
5347 (org-make-link 5347 (org-make-link
5348 "wl:" wl-summary-buffer-folder-name 5348 "wl:" wl-summary-buffer-folder-name
5349 "#" message-id))))) 5349 "#" message-id)))))
@@ -5357,7 +5357,7 @@ For file links, arg negates `org-line-numbers-in-file-links'."
5357 (author (mail-fetch-field "from")) 5357 (author (mail-fetch-field "from"))
5358 (subject (mail-fetch-field "subject"))) 5358 (subject (mail-fetch-field "subject")))
5359 (setq cpltxt (concat author " on: " subject)) 5359 (setq cpltxt (concat author " on: " subject))
5360 (setq link (concat cpltxt "\n " 5360 (setq link (concat cpltxt "\n "
5361 (org-make-link 5361 (org-make-link
5362 "rmail:" folder "#" message-id))))))) 5362 "rmail:" folder "#" message-id)))))))
5363 5363
@@ -5411,7 +5411,7 @@ For file links, arg negates `org-line-numbers-in-file-links'."
5411 (if (org-xor org-line-numbers-in-file-links arg) 5411 (if (org-xor org-line-numbers-in-file-links arg)
5412 (setq cpltxt 5412 (setq cpltxt
5413 (concat cpltxt 5413 (concat cpltxt
5414 ":" (int-to-string 5414 ":" (int-to-string
5415 (+ (if (bolp) 1 0) (count-lines 5415 (+ (if (bolp) 1 0) (count-lines
5416 (point-min) (point))))))) 5416 (point-min) (point)))))))
5417 (setq link (org-make-link cpltxt))) 5417 (setq link (org-make-link cpltxt)))
@@ -5581,7 +5581,7 @@ If the variable `org-adapt-indentation' is non-nil, the entire text is
5581also indented so that it starts in the same column as the headline 5581also indented so that it starts in the same column as the headline
5582\(i.e. after the stars). 5582\(i.e. after the stars).
5583 5583
5584See also the variable `org-reverse-note-order'." 5584See also the variable `org-reverse-note-order'."
5585 (catch 'quit 5585 (catch 'quit
5586 (let* ((txt (buffer-substring (point-min) (point-max))) 5586 (let* ((txt (buffer-substring (point-min) (point-max)))
5587 (fastp current-prefix-arg) 5587 (fastp current-prefix-arg)
@@ -6071,7 +6071,7 @@ If the field at the cursor is empty, copy into it the content of the nearest
6071non-empty field above. With argument N, use the Nth non-empty field. 6071non-empty field above. With argument N, use the Nth non-empty field.
6072If the current field is not empty, it is copied down to the next row, and 6072If the current field is not empty, it is copied down to the next row, and
6073the cursor is moved with it. Therefore, repeating this command causes the 6073the cursor is moved with it. Therefore, repeating this command causes the
6074column to be filled row-by-row. 6074column to be filled row-by-row.
6075If the variable `org-table-copy-increment' is non-nil and the field is an 6075If the variable `org-table-copy-increment' is non-nil and the field is an
6076integer, it will be incremented while copying." 6076integer, it will be incremented while copying."
6077 (interactive "p") 6077 (interactive "p")
@@ -6162,7 +6162,7 @@ When called interactively, column is also displayed in echo area."
6162(defun org-table-goto-column (n &optional on-delim force) 6162(defun org-table-goto-column (n &optional on-delim force)
6163 "Move the cursor to the Nth column in the current table line. 6163 "Move the cursor to the Nth column in the current table line.
6164With optional argument ON-DELIM, stop with point before the left delimiter 6164With optional argument ON-DELIM, stop with point before the left delimiter
6165of the field. 6165of the field.
6166If there are less than N fields, just go to after the last delimiter. 6166If there are less than N fields, just go to after the last delimiter.
6167However, when FORCE is non-nil, create new columns if necessary." 6167However, when FORCE is non-nil, create new columns if necessary."
6168 (let ((pos (point-at-eol))) 6168 (let ((pos (point-at-eol)))
@@ -6363,7 +6363,7 @@ If TABLE-TYPE is non-nil, also chack for table.el-type tables."
6363 (if (not (org-at-table-p)) 6363 (if (not (org-at-table-p))
6364 (progn 6364 (progn
6365 (goto-char pos) 6365 (goto-char pos)
6366 (error "Cannot move row further."))) 6366 (error "Cannot move row further")))
6367 (goto-char pos) 6367 (goto-char pos)
6368 (beginning-of-line 1) 6368 (beginning-of-line 1)
6369 (setq pos (point)) 6369 (setq pos (point))
@@ -6450,7 +6450,7 @@ with `org-table-paste-rectangle'"
6450 (goto-char beg) 6450 (goto-char beg)
6451 (org-table-check-inside-data-field) 6451 (org-table-check-inside-data-field)
6452 (setq l01 (count-lines (point-min) (point)) 6452 (setq l01 (count-lines (point-min) (point))
6453 c01 (org-table-current-column)) 6453 c01 (org-table-current-column))
6454 (goto-char end) 6454 (goto-char end)
6455 (org-table-check-inside-data-field) 6455 (org-table-check-inside-data-field)
6456 (setq l02 (count-lines (point-min) (point)) 6456 (setq l02 (count-lines (point-min) (point))
@@ -6471,7 +6471,7 @@ with `org-table-paste-rectangle'"
6471 (setq l1 (1+ l1))))) 6471 (setq l1 (1+ l1)))))
6472 (setq org-table-clip (nreverse region)) 6472 (setq org-table-clip (nreverse region))
6473 (if cut (org-table-align)))) 6473 (if cut (org-table-align))))
6474 6474
6475(defun org-table-paste-rectangle () 6475(defun org-table-paste-rectangle ()
6476 "Paste a rectangular region into a table. 6476 "Paste a rectangular region into a table.
6477The upper right corner ends up in the current field. All involved fields 6477The upper right corner ends up in the current field. All involved fields
@@ -6582,7 +6582,7 @@ blank, and the content is appended to the field above."
6582 (+ (length org-table-clip) arg) 6582 (+ (length org-table-clip) arg)
6583 arg) 6583 arg)
6584 (length org-table-clip))) 6584 (length org-table-clip)))
6585 (setq org-table-clip 6585 (setq org-table-clip
6586 (mapcar 'list (org-wrap (mapconcat 'car org-table-clip " ") 6586 (mapcar 'list (org-wrap (mapconcat 'car org-table-clip " ")
6587 nil nlines))) 6587 nil nlines)))
6588 (goto-char beg) 6588 (goto-char beg)
@@ -6637,7 +6637,7 @@ The return value is a list of lines, without newlines at the end."
6637 (setq ll (org-do-wrap words w))) 6637 (setq ll (org-do-wrap words w)))
6638 ll)) 6638 ll))
6639 (t (error "Cannot wrap this"))))) 6639 (t (error "Cannot wrap this")))))
6640 6640
6641 6641
6642(defun org-do-wrap (words width) 6642(defun org-do-wrap (words width)
6643 "Create lines of maximum width WIDTH (in characters) from word list WORDS." 6643 "Create lines of maximum width WIDTH (in characters) from word list WORDS."
@@ -6962,7 +6962,7 @@ table editor in arbitrary modes.")
6962 6962
6963;;;###autoload 6963;;;###autoload
6964(defun orgtbl-mode (&optional arg) 6964(defun orgtbl-mode (&optional arg)
6965 "The `org-mode' table editor as a minor mode for use in other modes." 6965 "The `org-mode' table editor as a minor mode for use in other modes."
6966 (interactive) 6966 (interactive)
6967 (if (eq major-mode 'org-mode) 6967 (if (eq major-mode 'org-mode)
6968 ;; Exit without error, in case some hook functions calls this 6968 ;; Exit without error, in case some hook functions calls this
@@ -6971,7 +6971,7 @@ table editor in arbitrary modes.")
6971 (setq orgtbl-mode 6971 (setq orgtbl-mode
6972 (if arg (> (prefix-numeric-value arg) 0) (not orgtbl-mode))) 6972 (if arg (> (prefix-numeric-value arg) 0) (not orgtbl-mode)))
6973 (if orgtbl-mode 6973 (if orgtbl-mode
6974 (progn 6974 (progn
6975 (set (make-local-variable (quote org-table-may-need-update)) t) 6975 (set (make-local-variable (quote org-table-may-need-update)) t)
6976 (make-local-hook (quote before-change-functions)) 6976 (make-local-hook (quote before-change-functions))
6977 (add-hook 'before-change-functions 'org-before-change-function 6977 (add-hook 'before-change-functions 'org-before-change-function
@@ -6979,7 +6979,7 @@ table editor in arbitrary modes.")
6979 (set (make-local-variable 'org-old-auto-fill-inhibit-regexp) 6979 (set (make-local-variable 'org-old-auto-fill-inhibit-regexp)
6980 auto-fill-inhibit-regexp) 6980 auto-fill-inhibit-regexp)
6981 (set (make-local-variable 'auto-fill-inhibit-regexp) 6981 (set (make-local-variable 'auto-fill-inhibit-regexp)
6982 (if auto-fill-inhibit-regexp 6982 (if auto-fill-inhibit-regexp
6983 (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp) 6983 (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp)
6984 "[ \t]*|")) 6984 "[ \t]*|"))
6985 (easy-menu-add orgtbl-mode-menu) 6985 (easy-menu-add orgtbl-mode-menu)
@@ -7050,11 +7050,11 @@ table editor in arbitrary modes.")
7050 7050
7051;; Special treatment needed for TAB and RET 7051;; Special treatment needed for TAB and RET
7052 7052
7053(define-key orgtbl-mode-map [(return)] 7053(define-key orgtbl-mode-map [(return)]
7054 (orgtbl-make-binding 'orgtbl-ret [(return)] "\C-m")) 7054 (orgtbl-make-binding 'orgtbl-ret [(return)] "\C-m"))
7055(define-key orgtbl-mode-map "\C-m" 7055(define-key orgtbl-mode-map "\C-m"
7056 (orgtbl-make-binding 'orgtbl-ret "\C-m" [(return)])) 7056 (orgtbl-make-binding 'orgtbl-ret "\C-m" [(return)]))
7057(define-key orgtbl-mode-map [(tab)] 7057(define-key orgtbl-mode-map [(tab)]
7058 (orgtbl-make-binding 'orgtbl-tab [(tab)] "\C-i")) 7058 (orgtbl-make-binding 'orgtbl-tab [(tab)] "\C-i"))
7059(define-key orgtbl-mode-map "\C-i" 7059(define-key orgtbl-mode-map "\C-i"
7060 (orgtbl-make-binding 'orgtbl-tab "\C-i" [(tab)])) 7060 (orgtbl-make-binding 'orgtbl-tab "\C-i" [(tab)]))
@@ -7164,7 +7164,7 @@ a reduced column width."
7164 ["Fill Rectangle" org-table-wrap-region :active (org-at-table-p) :keys "C-c C-q"]) 7164 ["Fill Rectangle" org-table-wrap-region :active (org-at-table-p) :keys "C-c C-q"])
7165 "--" 7165 "--"
7166 ["Which Column?" org-table-current-column :active (org-at-table-p) :keys "C-c ?"] 7166 ["Which Column?" org-table-current-column :active (org-at-table-p) :keys "C-c ?"]
7167 ["Sum Column/Rectangle" org-table-sum 7167 ["Sum Column/Rectangle" org-table-sum
7168 :active (or (org-at-table-p) (org-region-active-p)) :keys "C-c +"] 7168 :active (or (org-at-table-p) (org-region-active-p)) :keys "C-c +"]
7169 ["Eval Formula" org-table-eval-formula :active (org-at-table-p) :keys "C-c ="] 7169 ["Eval Formula" org-table-eval-formula :active (org-at-table-p) :keys "C-c ="]
7170 )) 7170 ))
@@ -7676,7 +7676,7 @@ and all options lines."
7676 (let* ((filename (concat (file-name-sans-extension (buffer-file-name)) 7676 (let* ((filename (concat (file-name-sans-extension (buffer-file-name))
7677 ".txt")) 7677 ".txt"))
7678 (buffer (find-file-noselect filename)) 7678 (buffer (find-file-noselect filename))
7679 (ore (concat 7679 (ore (concat
7680 (org-make-options-regexp 7680 (org-make-options-regexp
7681 '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO" 7681 '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO"
7682 "STARTUP" "ARCHIVE" 7682 "STARTUP" "ARCHIVE"
@@ -7908,7 +7908,7 @@ headlines. The default is 3. Lower levels will become bulleted lists."
7908 ;; This is a headline 7908 ;; This is a headline
7909 (progn 7909 (progn
7910 (setq level (- (match-end 1) (match-beginning 1)) 7910 (setq level (- (match-end 1) (match-beginning 1))
7911 txt (save-match-data 7911 txt (save-match-data
7912 (org-html-expand 7912 (org-html-expand
7913 (match-string 3 line))) 7913 (match-string 3 line)))
7914 todo 7914 todo
@@ -8191,7 +8191,7 @@ But it has the disadvantage, that Org-mode's HTML conversions cannot be used."
8191 (insert (mapconcat 'identity lines "\n")) 8191 (insert (mapconcat 'identity lines "\n"))
8192 (goto-char (point-min)) 8192 (goto-char (point-min))
8193 (if (not (re-search-forward "|[^+]" nil t)) 8193 (if (not (re-search-forward "|[^+]" nil t))
8194 (error "Error processing table.")) 8194 (error "Error processing table"))
8195 (table-recognize-table) 8195 (table-recognize-table)
8196 (with-current-buffer (get-buffer-create " org-tmp2 ") (erase-buffer)) 8196 (with-current-buffer (get-buffer-create " org-tmp2 ") (erase-buffer))
8197 (table-generate-source 'html " org-tmp2 ") 8197 (table-generate-source 'html " org-tmp2 ")
@@ -8566,7 +8566,7 @@ a reduced column width."
8566 8566
8567(defun org-shiftcursor-error () 8567(defun org-shiftcursor-error ()
8568 "Throw an error because Shift-Cursor command was applied in wrong context." 8568 "Throw an error because Shift-Cursor command was applied in wrong context."
8569 (error "This command is only active in tables and on headlines.")) 8569 (error "This command is only active in tables and on headlines"))
8570 8570
8571(defun org-shifttab () 8571(defun org-shifttab ()
8572 "Call `(org-cycle t)' or `org-table-previous-field'." 8572 "Call `(org-cycle t)' or `org-table-previous-field'."
@@ -8697,7 +8697,7 @@ the automatic table editor has been turned off."
8697 (if (y-or-n-p "Convert inactive region to table? ") 8697 (if (y-or-n-p "Convert inactive region to table? ")
8698 (org-table-convert-region (region-beginning) (region-end) arg) 8698 (org-table-convert-region (region-beginning) (region-end) arg)
8699 (error "Abort"))) 8699 (error "Abort")))
8700 (t (error "No table at point, and no region to make one."))))) 8700 (t (error "No table at point, and no region to make one")))))
8701 8701
8702(defun org-return () 8702(defun org-return ()
8703 "Call `org-table-next-row' or `newline'." 8703 "Call `org-table-next-row' or `newline'."
@@ -8822,7 +8822,7 @@ the automatic table editor has been turned off."
8822 ["Fill Rectangle" org-table-wrap-region (org-at-table-p)]) 8822 ["Fill Rectangle" org-table-wrap-region (org-at-table-p)])
8823 "--" 8823 "--"
8824 ["Which Column?" org-table-current-column (org-at-table-p)] 8824 ["Which Column?" org-table-current-column (org-at-table-p)]
8825 ["Sum Column/Rectangle" org-table-sum 8825 ["Sum Column/Rectangle" org-table-sum
8826 (or (org-at-table-p) (org-region-active-p))] 8826 (or (org-at-table-p) (org-region-active-p))]
8827 ["Eval Formula" org-table-eval-formula (org-at-table-p)] 8827 ["Eval Formula" org-table-eval-formula (org-at-table-p)]
8828 "--" 8828 "--"
@@ -8865,10 +8865,10 @@ With optional NODE, go directly to that node."
8865 (Info-goto-node (format "(org)%s" (or node "")))) 8865 (Info-goto-node (format "(org)%s" (or node ""))))
8866 8866
8867(defun org-install-agenda-files-menu () 8867(defun org-install-agenda-files-menu ()
8868 (easy-menu-change 8868 (easy-menu-change
8869 '("Org") "File List for Agenda" 8869 '("Org") "File List for Agenda"
8870 (append 8870 (append
8871 (list 8871 (list
8872 ["Edit File List" (customize-variable 'org-agenda-files) t] 8872 ["Edit File List" (customize-variable 'org-agenda-files) t]
8873 ["Add Current File to List" org-add-file t] 8873 ["Add Current File to List" org-add-file t]
8874 ["Remove Current File from List" org-remove-file t] 8874 ["Remove Current File from List" org-remove-file t]
@@ -8983,7 +8983,7 @@ that can be added."
8983;; Functions needed for compatibility with old outline.el 8983;; Functions needed for compatibility with old outline.el
8984 8984
8985;; The following functions capture almost the entire compatibility code 8985;; The following functions capture almost the entire compatibility code
8986;; between the different versions of outline-mode. The only other place 8986;; between the different versions of outline-mode. The only other place
8987;; where this is important are the font-lock-keywords. Search for 8987;; where this is important are the font-lock-keywords. Search for
8988;; `org-noutline-p' to find it. 8988;; `org-noutline-p' to find it.
8989 8989
@@ -9048,7 +9048,7 @@ If INVISIBLE-OK is non-nil, an invisible heading line is ok too."
9048This function considers both visible and invisible heading lines. 9048This function considers both visible and invisible heading lines.
9049With argument, move up ARG levels." 9049With argument, move up ARG levels."
9050 (if org-noutline-p 9050 (if org-noutline-p
9051 (if (fboundp 'outline-up-heading-all) 9051 (if (fboundp 'outline-up-heading-all)
9052 (outline-up-heading-all arg) ; emacs 21 version of outline.el 9052 (outline-up-heading-all arg) ; emacs 21 version of outline.el
9053 (outline-up-heading arg t)) ; emacs 22 version of outline.el 9053 (outline-up-heading arg t)) ; emacs 22 version of outline.el
9054 (org-back-to-heading t) 9054 (org-back-to-heading t)
@@ -9104,8 +9104,8 @@ When ENTRY is non-nil, show the entire entry."
9104 9104
9105(defun org-show-subtree () 9105(defun org-show-subtree ()
9106 "Show everything after this heading at deeper levels." 9106 "Show everything after this heading at deeper levels."
9107 (outline-flag-region 9107 (outline-flag-region
9108 (point) 9108 (point)
9109 (save-excursion 9109 (save-excursion
9110 (outline-end-of-subtree) (outline-next-heading) (point)) 9110 (outline-end-of-subtree) (outline-next-heading) (point))
9111 (if org-noutline-p nil ?\n))) 9111 (if org-noutline-p nil ?\n)))
@@ -9116,7 +9116,7 @@ Show the heading too, if it is currently invisible."
9116 (interactive) 9116 (interactive)
9117 (save-excursion 9117 (save-excursion
9118 (org-back-to-heading t) 9118 (org-back-to-heading t)
9119 (outline-flag-region 9119 (outline-flag-region
9120 (1- (point)) 9120 (1- (point))
9121 (save-excursion 9121 (save-excursion
9122 (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") nil 'move) 9122 (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") nil 'move)