]> code.delx.au - gnu-emacs/commitdiff
(org-promote, org-evaluate-time-range, org-agenda-next-date-line,
authorJuanma Barranquero <lekktu@gmail.com>
Tue, 14 Jun 2005 15:33:45 +0000 (15:33 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Tue, 14 Jun 2005 15:33:45 +0000 (15:33 +0000)
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.

lisp/textmodes/org.el

index c88f288a2424b751c87a49eafb5c7548e3de79f4..635bb6b5a9817e8d9ec909172cf16c900276a2ac 100644 (file)
@@ -1,4 +1,4 @@
-;;; org.el --- Outline-based notes management and organizer 
+;;; org.el --- Outline-based notes management and organizer
 ;; Carstens outline-mode for keeping track of everything.
 ;; Copyright (c) 2004, 2005 Free Software Foundation
 ;;
@@ -445,7 +445,7 @@ is used instead.")
           (goto-char (point-min))
           (while (re-search-forward re nil t)
             (setq key (match-string 1) value (match-string 2))
-            (cond 
+            (cond
              ((equal key "CATEGORY")
               (if (string-match "[ \t]+$" value)
                   (setq value (replace-match "" t t value)))
@@ -485,7 +485,7 @@ is used instead.")
           org-todo-kwd-max-priority (1- (length org-todo-keywords))
           org-ds-keyword-length (+ 2 (max (length org-deadline-string)
                                           (length org-scheduled-string)))
-          org-done-string 
+          org-done-string
           (nth (1- (length org-todo-keywords)) org-todo-keywords)
           org-todo-regexp
           (concat "\\<\\(" (mapconcat 'regexp-quote org-todo-keywords
@@ -565,7 +565,7 @@ When nil, cursor will remain in the current window."
 
 (defcustom org-select-agenda-window t
   "Non-nil means, after creating an agenda, move cursor into Agenda window.
-When nil, cursor will remain in the current window." 
+When nil, cursor will remain in the current window."
   :group 'org-agenda
   :type 'boolean)
 
@@ -601,7 +601,7 @@ When nil, always start on the current day."
 When nil, date-less entries will only be shown if `org-agenda' is called
 with a prefix argument.
 When non-nil, the TODO entries will be listed at the top of the agenda, before
-the entries for specific days." 
+the entries for specific days."
   :group 'org-agenda
   :type 'boolean)
 
@@ -646,7 +646,7 @@ priority.
 Leaving out `category-keep' would mean that items will be sorted across
 categories by priority."
   :group 'org-agenda
-  :type '(repeat 
+  :type '(repeat
           (choice
            (const time-up)
            (const time-down)
@@ -722,7 +722,7 @@ the variable `org-agenda-time-grid'."
   :group 'org-agenda
   :type 'boolean)
 
-(defcustom org-agenda-time-grid 
+(defcustom org-agenda-time-grid
   '((daily today require-timed)
     "----------------"
     (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.
 The third item is a list of integers, indicating the times that should have
 a grid line."
   :group 'org-agenda
-  :type 
+  :type
   '(list
     (set :greedy t :tag "Grid Display Options"
          (const :tag "Show grid in single day agenda display" daily)
@@ -835,7 +835,7 @@ unnecessary clutter."
 
 (defcustom org-archive-location "%s_archive::"
   "The location where subtrees should be archived.
-This string consists of two parts, separated by a double-colon.  
+This string consists of two parts, separated by a double-colon.
 
 The first part is a file name - when omitted, archiving happens in the same
 file.  %s will be replaced by the current file name (without directory part).
@@ -864,7 +864,7 @@ Here are a few examples:
 
 You may set this option on a per-file basis by adding to the buffer a
 line like
+
 #+ARCHIVE: basement::** Finished Tasks"
   :group 'org-structure
   :type 'string)
@@ -1556,7 +1556,7 @@ When this is non-nil, the headline after the keyword is set to the
   "Face for items scheduled previously, and not yet done."
   :group 'org-faces)
 
-(defface org-link 
+(defface org-link
   '((((type tty) (class color)) (:foreground "cyan" :weight bold))
     (((class color) (background light)) (:foreground "Purple"))
     (((class color) (background dark)) (:foreground "Cyan"))
@@ -1663,7 +1663,7 @@ sets it back to nil.")
 
 ;;;###autoload
 (define-derived-mode org-mode outline-mode "Org"
-  "Outline-based notes management and organizer, alias 
+  "Outline-based notes management and organizer, alias
 \"Carstens outline-mode for keeping track of everything.\"
 
 Org-mode develops organizational tasks around a NOTES file which
@@ -1728,7 +1728,7 @@ The following commands are available:
 ;;; Font-Lock stuff
 
 (defvar org-mouse-map (make-sparse-keymap))
-(define-key org-mouse-map 
+(define-key org-mouse-map
   (if org-xemacs-p [button2] [mouse-2]) 'org-open-at-mouse)
 (define-key org-mouse-map
   (if org-xemacs-p [button3] [mouse-3]) 'org-find-file-at-mouse)
@@ -1804,9 +1804,9 @@ The following commands are available:
           (list (concat "\\<" org-scheduled-string) '(0 'org-warning t))
           ;; '("\\(\\s-\\|^\\)\\(\\*\\([a-zA-Z]+\\)\\*\\)\\([^a-zA-Z*]\\|$\\)"
           ;; (3 'bold))
-          ;; '("\\(\\s-\\|^\\)\\(/\\([a-zA-Z]+\\)/\\)\\([^a-zA-Z*]\\|$\\)" 
+          ;; '("\\(\\s-\\|^\\)\\(/\\([a-zA-Z]+\\)/\\)\\([^a-zA-Z*]\\|$\\)"
           ;; (3 'italic))
-          ;; '("\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)" 
+          ;; '("\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)"
           ;; (3 'underline))
           '("\\<FIXME\\>" (0 'org-warning t))
           (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string "\\)\\>")
@@ -1825,7 +1825,7 @@ The following commands are available:
           (if org-noutline-p     ; FIXME:  I am not sure if eval will work
                                  ; on XEmacs if noutline is ever ported
               '((eval . (list "^\\(\\*+\\).*"
-                              0 '(nth 
+                              0 '(nth
                                   (% (- (match-end 1) (match-beginning 1) 1)
                                      org-n-levels)
                                   org-level-faces)
@@ -1839,7 +1839,7 @@ The following commands are available:
     (set (make-local-variable 'font-lock-defaults)
          '(org-font-lock-keywords t nil nil backward-paragraph))
     (kill-local-variable 'font-lock-keywords) nil))
-    
+
 (defun org-unfontify-region (beg end &optional maybe_loudly)
   "Remove fontification and activation overlays from links."
   (font-lock-default-unfontify-region beg end)
@@ -2239,7 +2239,7 @@ in the region."
   (org-back-to-heading t)
   (let* ((level (save-match-data (funcall outline-level)))
          (up-head (make-string (1- level) ?*)))
-    (if (= level 1) (error "Cannot promote to level 0. UNDO to recover."))
+    (if (= level 1) (error "Cannot promote to level 0. UNDO to recover"))
     (replace-match up-head nil t)
     (if org-adapt-indentation
         (org-fixup-indentation "^ " "" "^ ?\\S-"))))
@@ -2558,7 +2558,7 @@ heading be marked DONE, and the current time will be added."
                 (end-of-line 0))
               ;; Make the heading visible, and the following as well
               (let ((org-show-following-heading t)) (org-show-hierarchy-above))
-              (if (re-search-forward 
+              (if (re-search-forward
                    (concat "^" (regexp-quote (make-string level ?*)) "[ \t]")
                    nil t)
                   (progn (goto-char (match-beginning 0)) (insert "\n")
@@ -2617,11 +2617,11 @@ At all other locations, this simply calls `ispell-complete-word'."
            (table (cond
                    (opt
                     (setq type :opt)
-                    (mapcar (lambda (x) 
+                    (mapcar (lambda (x)
                               (string-match "^#\\+\\(\\([A-Z_]+:?\\).*\\)" x)
                               (cons (match-string 2 x) (match-string 1 x)))
                             (org-split-string (org-get-current-options) "\n")))
-                   (texp 
+                   (texp
                     (setq type :tex)
                     org-html-entities)
                    ((string-match "\\`\\*+[ \t]*\\'"
@@ -2631,7 +2631,7 @@ At all other locations, this simply calls `ispell-complete-word'."
                    (t (progn (ispell-complete-word arg) (throw 'exit nil)))))
            (completion (try-completion pattern table)))
       (cond ((eq completion t)
-             (if (equal type :opt) 
+             (if (equal type :opt)
                  (insert (substring (cdr (assoc (upcase pattern) table))
                                     (length pattern)))))
             ((null completion)
@@ -2639,7 +2639,7 @@ At all other locations, this simply calls `ispell-complete-word'."
              (ding))
             ((not (string= pattern completion))
              (delete-region beg end)
-             (if (string-match " +$" completion) 
+             (if (string-match " +$" completion)
                  (setq completion (replace-match "" t t completion)))
              (insert completion)
              (if (get-buffer-window "*Completions*")
@@ -2876,9 +2876,9 @@ ACTION can be set, up, or down."
   (save-match-data
     (if (not (string-match org-priority-regexp s))
         (* 1000 (- org-lowest-priority org-default-priority))
-      (* 1000 (- org-lowest-priority 
+      (* 1000 (- org-lowest-priority
                  (string-to-char (match-string 2 s)))))))
-      
+
 ;;; Timestamps
 
 (defvar org-last-changed-timestamp nil)
@@ -2910,7 +2910,7 @@ at the cursor, it will be modified."
       (setq time (let ((this-command this-command))
                    (org-read-date arg 'totime)))
       (and (org-at-timestamp-p) (replace-match
-                                 (setq org-last-changed-timestamp 
+                                 (setq org-last-changed-timestamp
                                        (format-time-string fmt time))
                                  t t))
       (message "Timestamp updated"))
@@ -2940,8 +2940,8 @@ but this can be configured with the variables `parse-time-months' and
 
 While prompting, a calendar is popped up - you can also select the
 date with the mouse (button 1).  The calendar shows a period of three
-month.  To scroll it to other months, use the keys `>' and `<'.  
-If you don't like the calendar, turn it off with 
+month.  To scroll it to other months, use the keys `>' and `<'.
+If you don't like the calendar, turn it off with
        \(setq org-popup-calendar-for-date-prompt nil).
 
 With 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."
            ;; Default time is either today, or, when entering a range,
            ;; the range start.
            (if (save-excursion
-                 (re-search-backward 
+                 (re-search-backward
                   (concat org-ts-regexp "--\\=")
                   (- (point) 20) t))
                (apply
@@ -3066,7 +3066,7 @@ This is used by `org-read-date' in a temporary keymap for the calendar buffer."
            (time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
       (setq ans1 (format-time-string "%Y-%m-%d" time)))
     (if (active-minibuffer-window) (exit-minibuffer))))
-          
+
 (defun org-check-deadlines (ndays)
   "Check if there are any deadlines due or past due.
 A deadline is considered due if it happens within `org-deadline-warning-days'
@@ -3106,7 +3106,7 @@ days in order to avoid rounding problems."
       (goto-char (point-at-bol))
       (re-search-forward org-tr-regexp (point-at-eol) t))
     (if (not (org-at-date-range-p))
-        (error "Not at a time-stamp range, and none found in current line.")))
+        (error "Not at a time-stamp range, and none found in current line")))
   (let* ((ts1 (match-string 1))
          (ts2 (match-string 2))
          (havetime (or (> (length ts1) 15) (> (length ts2) 15)))
@@ -3358,10 +3358,10 @@ The following commands are available:
   (add-hook 'post-command-hook 'org-agenda-post-command-hook nil 'local)
   (add-hook 'pre-command-hook 'org-unhighlight nil 'local)
   (setq org-agenda-follow-mode nil)
-  (easy-menu-change 
+  (easy-menu-change
    '("Agenda") "Agenda Files"
    (append
-    (list 
+    (list
      ["Edit File List" (customize-variable 'org-agenda-files) t]
      "--")
    (mapcar 'org-file-menu-entry org-agenda-files)))
@@ -3422,7 +3422,7 @@ The following commands are available:
 (defvar org-agenda-keymap (copy-keymap org-agenda-mode-map)
   "Local keymap for agenda entries from Org-mode.")
 
-(define-key org-agenda-keymap 
+(define-key org-agenda-keymap
   (if org-xemacs-p [(button2)] [(mouse-2)]) 'org-agenda-goto-mouse)
 (define-key org-agenda-keymap
   (if org-xemacs-p [(button3)] [(mouse-3)]) 'org-agenda-show-mouse)
@@ -3434,7 +3434,7 @@ The following commands are available:
     ["Show" org-agenda-show t]
     ["Go To (other window)" org-agenda-goto t]
     ["Go To (one window)" org-agenda-switch-to t]
-    ["Follow Mode" org-agenda-follow-mode 
+    ["Follow Mode" org-agenda-follow-mode
      :style toggle :selected org-agenda-follow-mode :active t]
     "--"
     ["Cycle TODO" org-agenda-todo t]
@@ -3552,7 +3552,7 @@ dates."
          (org-respect-restriction t)
          (past t)
          s e rtn d)
-    (setq org-agenda-redo-command 
+    (setq org-agenda-redo-command
           (list 'progn
                 (list 'switch-to-buffer-other-window (current-buffer))
                 (list 'org-timeline include-all)))
@@ -3561,7 +3561,7 @@ dates."
         (setq day-numbers (delq nil (mapcar (lambda(x)
                                               (if (>= x today) x nil))
                                             day-numbers))))
-    (switch-to-buffer-other-window 
+    (switch-to-buffer-other-window
      (get-buffer-create org-agenda-buffer-name))
     (setq buffer-read-only nil)
     (erase-buffer)
@@ -3576,7 +3576,7 @@ dates."
       (setq date (calendar-gregorian-from-absolute d))
       (setq s (point))
       (if dotodo
-          (setq rtn (org-agenda-get-day-entries 
+          (setq rtn (org-agenda-get-day-entries
                      entry date :todo :timestamp))
         (setq rtn (org-agenda-get-day-entries entry date :timestamp)))
       (if (or rtn (equal d today))
@@ -3632,7 +3632,7 @@ NDAYS defaults to `org-agenda-ndays'."
          (day-numbers (list start))
          (inhibit-redisplay t)
          s e rtn rtnall file date d start-pos end-pos todayp nd)
-    (setq org-agenda-redo-command 
+    (setq org-agenda-redo-command
           (list 'org-agenda include-all start-day ndays))
     ;; Make the list of days
     (setq ndays (or ndays org-agenda-ndays)
@@ -3644,7 +3644,7 @@ NDAYS defaults to `org-agenda-ndays'."
     (if (not (equal (current-buffer) (get-buffer org-agenda-buffer-name)))
         (progn
           (delete-other-windows)
-          (switch-to-buffer-other-window 
+          (switch-to-buffer-other-window
            (get-buffer-create org-agenda-buffer-name))))
     (setq buffer-read-only nil)
     (erase-buffer)
@@ -3662,7 +3662,7 @@ NDAYS defaults to `org-agenda-ndays'."
                 rtn (org-agenda-get-day-entries
                      file date :todo))
           (setq rtnall (append rtnall rtn))))
-      (when rtnall 
+      (when rtnall
         (insert "ALL CURRENTLY OPEN TODO ITEMS:\n")
         (add-text-properties (point-min) (1- (point))
                              (list 'face 'org-link))
@@ -3696,12 +3696,12 @@ NDAYS defaults to `org-agenda-ndays'."
                             (extract-calendar-year date)))
             (put-text-property s (1- (point)) 'face
                                'org-link)
-            (if rtnall (insert 
+            (if rtnall (insert
                         (org-finalize-agenda-entries ;; FIXME: condition needed
                          (org-agenda-add-time-grid-maybe
                           rtnall nd todayp))
                         "\n"))
-            (put-text-property s (1- (point)) 'day d))))            
+            (put-text-property s (1- (point)) 'day d))))
     (goto-char (point-min))
     (setq buffer-read-only t)
     (if org-fit-agenda-window
@@ -3791,7 +3791,7 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
     (error "Not allowed"))
   (setq org-agenda-ndays
         (if (equal org-agenda-ndays 1) 7 1))
-  (org-agenda include-all-loc 
+  (org-agenda include-all-loc
               (or (get-text-property (point) 'day)
                   starting-day))
   (org-agenda-set-mode-name)
@@ -3806,7 +3806,7 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
   (if (not (re-search-forward "^\\S-" nil t arg))
       (progn
         (backward-char 1)
-        (error "No next date after this line in this buffer.")))
+        (error "No next date after this line in this buffer")))
   (goto-char (match-beginning 0)))
 
 (defun org-agenda-previous-date-line (&optional arg)
@@ -3814,7 +3814,7 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
   (interactive "p")
   (beginning-of-line 1)
   (if (not (re-search-backward "^\\S-" nil t arg))
-      (error "No previous date before this line in this buffer.")))
+      (error "No previous date before this line in this buffer")))
 
 ;; Initialize the highlight
 (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'."
   "Get the (Emacs Calendar) diary entries for DATE."
   (let* ((fancy-diary-buffer "*temporary-fancy-diary-buffer*")
          (diary-display-hook '(fancy-diary-display))
-         (list-diary-entries-hook 
+         (list-diary-entries-hook
           (cons 'org-diary-default-entry list-diary-entries-hook))
          entries
          (org-disable-diary t))
@@ -3904,12 +3904,12 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
         (kill-buffer fancy-diary-buffer)))
     (when entries
       (setq entries (org-split-string entries "\n"))
-      (setq entries 
-            (mapcar 
+      (setq entries
+            (mapcar
              (lambda (x)
                (setq x (org-format-agenda-item "" x "Diary" 'time))
                ;; Extend the text properties to the beginning of the line
-               (add-text-properties 
+               (add-text-properties
                 0 (length x)
                 (text-properties-at (1- (length x)) x)
                 x)
@@ -3950,7 +3950,7 @@ date.  Itt also removes lines that contain only whitespace."
           0 (length string)
           (list 'mouse-face 'highlight
                 'keymap org-agenda-keymap
-                'help-echo 
+                'help-echo
                 (format
                  "mouse-2 or RET jump to diary file %s"
                  (abbreviate-file-name (buffer-file-name)))
@@ -3972,7 +3972,7 @@ Needed to avoid empty dates which mess up holiday display."
 These are the files which are being checked for agenda entries.
 Optional argument FILE means, use this file instead of the current.
 It is possible (but not recommended) to add this function to the
-`org-mode-hook'." 
+`org-mode-hook'."
   (interactive)
   (catch 'exit
     (let* ((file (or file (buffer-file-name)
@@ -3987,7 +3987,7 @@ It is possible (but not recommended) to add this function to the
                                org-agenda-files))))
       (if (not present)
           (progn
-            (setq org-agenda-files 
+            (setq org-agenda-files
                   (cons afile org-agenda-files))
             ;; Make sure custom.el does not end up with Org-mode
             (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."
   (let* ((file (or file (buffer-file-name)))
          (true-file (file-truename file))
          (afile (abbreviate-file-name file))
-         (files (delq nil (mapcar 
+         (files (delq nil (mapcar
                            (lambda (x)
                              (if (equal true-file
                                         (file-truename x))
@@ -4089,7 +4089,7 @@ also be written as
 
 The function expects the lisp variables `entry' and `date' to be provided
 by the caller, because this is how the calendar works.  Don't use this
-function from a program - use `org-agenda-get-day-entries' instead." 
+function from a program - use `org-agenda-get-day-entries' instead."
   (org-agenda-maybe-reset-markers)
   (org-compile-agenda-prefix-format org-agenda-prefix-format)
   (setq args (or args '(:deadline :scheduled :timestamp)))
@@ -4131,7 +4131,7 @@ the documentation of `org-diary'."
                   (if (org-region-active-p)
                       ;; Respect a region to restrict search
                       (narrow-to-region (region-beginning) (region-end)))
-                ;; If we work for the calendar or many files, 
+                ;; If we work for the calendar or many files,
                 ;; get rid of any restriction
                 (widen))
               ;; The way we repeatedly append to `results' makes it O(n^2) :-(
@@ -4197,7 +4197,7 @@ the documentation of `org-diary'."
       (goto-char (match-beginning 1))
       (setq marker (org-agenda-new-marker (point-at-bol))
             txt (org-format-agenda-item "" (match-string 1))
-            priority 
+            priority
             (+ (org-get-priority txt)
                (if org-todo-kwd-priority-p
                          (- org-todo-kwd-max-priority -2
@@ -4269,7 +4269,7 @@ the documentation of `org-diary'."
               (if deadlinep
                   (add-text-properties
                    0 (length txt)
-                   (list 'face 
+                   (list 'face
                          (if donep 'org-done 'org-warning)
                          'undone-face 'org-warning
                          'done-face 'org-done
@@ -4329,8 +4329,8 @@ the documentation of `org-diary'."
               (setq txt org-agenda-no-heading-message))
             (when txt
               (add-text-properties
-               0 (length txt) 
-               (append 
+               0 (length txt)
+               (append
                 (list 'org-marker (org-agenda-new-marker pos)
                       'org-hd-marker (org-agenda-new-marker pos1)
                       'priority (+ (- 10 diff) (org-get-priority txt))
@@ -4422,7 +4422,7 @@ the documentation of `org-diary'."
                   (setq hdmarker (org-agenda-new-marker (match-end 1)))
                   (goto-char (match-end 1))
                   (looking-at "\\*+[ \t]*\\([^\r\n]+\\)")
-                  (setq txt (org-format-agenda-item 
+                  (setq txt (org-format-agenda-item
                              (format (if (= d1 d2) "" "(%d/%d): ")
                                      (1+ (- d0 d1)) (1+ (- d2 d1)))
                              (match-string 1) nil (if (= d0 d1) timestr))))
@@ -4504,7 +4504,7 @@ only the correctly processes TXT should be returned - this is used by
           (setq s0 (match-string 0 ts)
                 s1 (match-string (if plain 1 2) ts)
                 s2 (match-string (if plain 8 4) ts))
-          
+
           ;; If the times are in TXT (not in DOTIMES), and the prefix will list
           ;; them, we might want to remove them there to avoid duplication.
           ;; 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
         ;; Normalize the time(s) to 24 hour
         (if s1 (setq s1 (org-get-time-of-day s1 'string)))
         (if s2 (setq s2 (org-get-time-of-day s2 'string))))
-      
+
       ;; Create the final string
       (if noprefix
           (setq rtn txt)
@@ -4529,7 +4529,7 @@ only the correctly processes TXT should be returned - this is used by
               category (if (symbolp category) (symbol-name category) category))
         ;; Evaluate the compiled format
         (setq rtn (concat (eval org-prefix-format-compiled) txt)))
-      
+
       ;; And finally add the text properties
       (add-text-properties
        0 (length rtn) (list 'category (downcase category)
@@ -4560,11 +4560,11 @@ only the correctly processes TXT should be returned - this is used by
       (while (setq time (pop gridtimes))
         (unless (and remove (member time have))
           (setq time (int-to-string time))
-          (push (org-format-agenda-item 
+          (push (org-format-agenda-item
                  nil string "" ;; FIXME: put a category?
                  (concat (substring time 0 -2) ":" (substring time -2)))
                 new)
-          (put-text-property 
+          (put-text-property
            1 (length (car new)) 'face 'org-time-grid (car new))))
       (if (member 'time-up org-agenda-sorting-strategy)
           (append new list)
@@ -4603,7 +4603,7 @@ If not found, return nil.
 The optional STRING argument forces conversion into a 5 character wide string
 HH:MM."
   (save-match-data
-    (when 
+    (when
      (or
       (string-match
        "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)\\([AaPp][Mm]\\)?\\> *" s)
@@ -4659,7 +4659,7 @@ HH:MM."
          (category-up (org-cmp-category a b))
          (category-down (if category-up (- category-up) nil))
          (category-keep (if category-up +1 nil)))  ; FIXME +1 or -1?
-    (cdr (assoc 
+    (cdr (assoc
           (eval (cons 'or org-agenda-sorting-strategy))
           '((-1 . t) (1 . nil) (nil . nil))))))
 
@@ -4674,7 +4674,7 @@ and by additional input from the age of a schedules or deadline entry."
 (defun org-agenda-goto (&optional highlight)
   "Go to the Org-mode file which contains the item at point."
   (interactive)
-  (let* ((marker (or (get-text-property (point) 'org-marker) 
+  (let* ((marker (or (get-text-property (point) 'org-marker)
                      (org-agenda-error)))
          (buffer (marker-buffer marker))
          (pos (marker-position marker)))
@@ -4691,7 +4691,7 @@ and by additional input from the age of a schedules or deadline entry."
 (defun org-agenda-switch-to ()
   "Go to the Org-mode file which contains the item at point."
   (interactive)
-  (let* ((marker (or (get-text-property (point) 'org-marker) 
+  (let* ((marker (or (get-text-property (point) 'org-marker)
                      (org-agenda-error)))
          (buffer (marker-buffer marker))
          (pos (marker-position marker)))
@@ -4738,7 +4738,7 @@ and by additional input from the age of a schedules or deadline entry."
       (org-agenda-error)))
 
 (defun org-agenda-error ()
-  (error "Command not allowed in this line."))
+  (error "Command not allowed in this line"))
 
 (defvar org-last-heading-marker (make-marker)
   "Marker pointing to the headline that last changed its TODO state
@@ -4805,7 +4805,7 @@ the new TODO state."
                 (beginning-of-line 1)
                 (add-text-properties (point-at-bol) (point-at-eol) props)
                 (if fixface
-                    (add-text-properties 
+                    (add-text-properties
                      (point-at-bol) (point-at-eol)
                      (list 'face
                            (if org-last-todo-state-is-todo
@@ -4902,7 +4902,7 @@ be used to request time specification in the time stamp."
 All the standard commands work: block, weekly etc"
   (interactive)
   (require 'diary-lib)
-  (let* ((char (progn 
+  (let* ((char (progn
                  (message "Diary entry: [d]ay [w]eekly [m]onthly [y]early [a]nniversary [b]lock [c]yclic")
                  (read-char-exclusive)))
          (cmd (cdr (assoc char
@@ -4932,7 +4932,7 @@ All the standard commands work: block, weekly etc"
           (progn
             (fset 'calendar-cursor-to-date
                   (lambda (&optional error)
-                    (calendar-gregorian-from-absolute 
+                    (calendar-gregorian-from-absolute
                      (get-text-property point 'day))))
             (call-interactively cmd))
         (fset 'calendar-cursor-to-date oldf)))))
@@ -4955,7 +4955,7 @@ the cursor position."
           (progn
             (fset 'calendar-cursor-to-date
                   (lambda (&optional error)
-                    (calendar-gregorian-from-absolute 
+                    (calendar-gregorian-from-absolute
                      (get-text-property point 'day))))
             (call-interactively cmd))
         (fset 'calendar-cursor-to-date oldf))))
@@ -5005,7 +5005,7 @@ This is a command that has to be installed in `calendar-mode-map'."
     (unless day
       (error "Don't know which date to convert"))
     (setq date (calendar-gregorian-from-absolute day))
-    (setq s (concat 
+    (setq s (concat
              "Gregorian:  " (calendar-date-string date) "\n"
              "ISO:        " (calendar-iso-date-string date) "\n"
              "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."
             (setq type (match-string 1)
                   path (match-string 2)))
         (unless path
-          (error "No link found."))
+          (error "No link found"))
         ;; Remove any trailing spaces in path
         (if (string-match " +\\'" path)
             (setq path (replace-match "" t t path)))
@@ -5118,9 +5118,9 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
 
          ((string= type "shell")
           (let ((cmd path))
-            (while (string-match "@{" cmd) 
+            (while (string-match "@{" cmd)
               (setq cmd (replace-match "<" t t cmd)))
-            (while (string-match "@}" cmd) 
+            (while (string-match "@}" cmd)
               (setq cmd (replace-match ">" t t cmd)))
             (if (or (not org-confirm-shell-links)
                     (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."
                 (widen)
                 (goto-char (point-max))
                 (if (re-search-backward
-                     (concat "^Message-ID:\\s-+" (regexp-quote 
+                     (concat "^Message-ID:\\s-+" (regexp-quote
                                                   (or article "")))
                      nil t)
                     (rmail-what-message))))))
@@ -5304,7 +5304,7 @@ For file links, arg negates `org-line-numbers-in-file-links'."
                     (or (bbdb-record-name (bbdb-current-record))
                         (bbdb-record-company (bbdb-current-record))))
             link (org-make-link cpltxt)))
-     
+
      ((eq major-mode 'calendar-mode)
       (let ((cd (calendar-cursor-to-date)))
         (setq link
@@ -5330,8 +5330,8 @@ For file links, arg negates `org-line-numbers-in-file-links'."
                            folder)
              (setq folder (replace-match "" t t folder)))
          (setq cpltxt (concat author " on: " subject))
-         (setq link (concat cpltxt "\n  " 
-                            (org-make-link 
+         (setq link (concat cpltxt "\n  "
+                            (org-make-link
                              "vm:" folder "#" message-id))))))
 
      ((eq major-mode 'wl-summary-mode)
@@ -5343,7 +5343,7 @@ For file links, arg negates `org-line-numbers-in-file-links'."
              (author (wl-summary-line-from)) ; FIXME: how to get author name?
              (subject "???"))   ; FIXME: How to get subject of email?
         (setq cpltxt (concat author  " on: " subject))
-        (setq link (concat cpltxt "\n  " 
+        (setq link (concat cpltxt "\n  "
                            (org-make-link
                             "wl:" wl-summary-buffer-folder-name
                            "#" message-id)))))
@@ -5357,7 +5357,7 @@ For file links, arg negates `org-line-numbers-in-file-links'."
                 (author (mail-fetch-field "from"))
                 (subject (mail-fetch-field "subject")))
             (setq cpltxt (concat author  " on: " subject))
-            (setq link (concat cpltxt "\n  " 
+            (setq link (concat cpltxt "\n  "
                                (org-make-link
                                 "rmail:" folder "#" message-id)))))))
 
@@ -5411,7 +5411,7 @@ For file links, arg negates `org-line-numbers-in-file-links'."
       (if (org-xor org-line-numbers-in-file-links arg)
           (setq cpltxt
                 (concat cpltxt
-                        ":" (int-to-string 
+                        ":" (int-to-string
                              (+ (if (bolp) 1 0) (count-lines
                                                  (point-min) (point)))))))
       (setq link (org-make-link cpltxt)))
@@ -5581,7 +5581,7 @@ If the variable `org-adapt-indentation' is non-nil, the entire text is
 also indented so that it starts in the same column as the headline
 \(i.e. after the stars).
 
-See also the variable `org-reverse-note-order'."  
+See also the variable `org-reverse-note-order'."
   (catch 'quit
     (let* ((txt (buffer-substring (point-min) (point-max)))
            (fastp current-prefix-arg)
@@ -6071,7 +6071,7 @@ If the field at the cursor is empty, copy into it the content of the nearest
 non-empty field above.  With argument N, use the Nth non-empty field.
 If the current field is not empty, it is copied down to the next row, and
 the cursor is moved with it.  Therefore, repeating this command causes the
-column to be filled row-by-row.  
+column to be filled row-by-row.
 If the variable `org-table-copy-increment' is non-nil and the field is an
 integer, it will be incremented while copying."
   (interactive "p")
@@ -6162,7 +6162,7 @@ When called interactively, column is also displayed in echo area."
 (defun org-table-goto-column (n &optional on-delim force)
   "Move the cursor to the Nth column in the current table line.
 With optional argument ON-DELIM, stop with point before the left delimiter
-of the field. 
+of the field.
 If there are less than N fields, just go to after the last delimiter.
 However, when FORCE is non-nil, create new columns if necessary."
   (let ((pos (point-at-eol)))
@@ -6363,7 +6363,7 @@ If TABLE-TYPE is non-nil, also chack for table.el-type tables."
     (if (not (org-at-table-p))
         (progn
           (goto-char pos)
-          (error "Cannot move row further.")))
+          (error "Cannot move row further")))
     (goto-char pos)
     (beginning-of-line 1)
     (setq pos (point))
@@ -6450,7 +6450,7 @@ with `org-table-paste-rectangle'"
     (goto-char beg)
     (org-table-check-inside-data-field)
     (setq l01 (count-lines (point-min) (point))
-          c01 (org-table-current-column)) 
+          c01 (org-table-current-column))
     (goto-char end)
     (org-table-check-inside-data-field)
     (setq l02 (count-lines (point-min) (point))
@@ -6471,7 +6471,7 @@ with `org-table-paste-rectangle'"
           (setq l1 (1+ l1)))))
     (setq org-table-clip (nreverse region))
     (if cut (org-table-align))))
-  
+
 (defun org-table-paste-rectangle ()
   "Paste a rectangular region into a table.
 The 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."
                              (+ (length org-table-clip) arg)
                            arg)
                        (length org-table-clip)))
-        (setq org-table-clip 
+        (setq org-table-clip
               (mapcar 'list (org-wrap (mapconcat 'car org-table-clip " ")
                                       nil nlines)))
         (goto-char beg)
@@ -6637,7 +6637,7 @@ The return value is a list of lines, without newlines at the end."
                (setq ll (org-do-wrap words w)))
              ll))
           (t (error "Cannot wrap this")))))
-           
+
 
 (defun org-do-wrap (words width)
   "Create lines of maximum width WIDTH (in characters) from word list WORDS."
@@ -6962,7 +6962,7 @@ table editor in arbitrary modes.")
 
 ;;;###autoload
 (defun orgtbl-mode (&optional arg)
-  "The `org-mode' table editor as a minor mode for use in other modes." 
+  "The `org-mode' table editor as a minor mode for use in other modes."
   (interactive)
   (if (eq major-mode 'org-mode)
       ;; Exit without error, in case some hook functions calls this
@@ -6971,7 +6971,7 @@ table editor in arbitrary modes.")
     (setq orgtbl-mode
           (if arg (> (prefix-numeric-value arg) 0) (not orgtbl-mode)))
     (if orgtbl-mode
-        (progn 
+        (progn
           (set (make-local-variable (quote org-table-may-need-update)) t)
           (make-local-hook (quote before-change-functions))
           (add-hook 'before-change-functions 'org-before-change-function
@@ -6979,7 +6979,7 @@ table editor in arbitrary modes.")
           (set (make-local-variable 'org-old-auto-fill-inhibit-regexp)
                auto-fill-inhibit-regexp)
           (set (make-local-variable 'auto-fill-inhibit-regexp)
-               (if auto-fill-inhibit-regexp 
+               (if auto-fill-inhibit-regexp
                    (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp)
                  "[ \t]*|"))
           (easy-menu-add orgtbl-mode-menu)
@@ -7050,11 +7050,11 @@ table editor in arbitrary modes.")
 
 ;; Special treatment needed for TAB and RET
 
-(define-key orgtbl-mode-map [(return)] 
+(define-key orgtbl-mode-map [(return)]
   (orgtbl-make-binding 'orgtbl-ret [(return)] "\C-m"))
-(define-key orgtbl-mode-map "\C-m" 
+(define-key orgtbl-mode-map "\C-m"
   (orgtbl-make-binding 'orgtbl-ret "\C-m" [(return)]))
-(define-key orgtbl-mode-map [(tab)] 
+(define-key orgtbl-mode-map [(tab)]
   (orgtbl-make-binding 'orgtbl-tab [(tab)] "\C-i"))
 (define-key orgtbl-mode-map "\C-i"
   (orgtbl-make-binding 'orgtbl-tab "\C-i" [(tab)]))
@@ -7164,7 +7164,7 @@ a reduced column width."
      ["Fill Rectangle" org-table-wrap-region :active (org-at-table-p) :keys "C-c C-q"])
     "--"
     ["Which Column?" org-table-current-column :active (org-at-table-p) :keys "C-c ?"]
-    ["Sum Column/Rectangle" org-table-sum 
+    ["Sum Column/Rectangle" org-table-sum
      :active (or (org-at-table-p) (org-region-active-p)) :keys "C-c +"]
     ["Eval Formula" org-table-eval-formula :active (org-at-table-p) :keys "C-c ="]
     ))
@@ -7676,7 +7676,7 @@ and all options lines."
   (let* ((filename (concat (file-name-sans-extension (buffer-file-name))
                            ".txt"))
          (buffer (find-file-noselect filename))
-         (ore (concat 
+         (ore (concat
                (org-make-options-regexp
                 '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO"
                   "STARTUP" "ARCHIVE"
@@ -7908,7 +7908,7 @@ headlines.  The default is 3.  Lower levels will become bulleted lists."
                            ;; This is a headline
                            (progn
                              (setq level (- (match-end 1) (match-beginning 1))
-                                   txt (save-match-data 
+                                   txt (save-match-data
                                          (org-html-expand
                                           (match-string 3 line)))
                                    todo
@@ -8191,7 +8191,7 @@ But it has the disadvantage, that Org-mode's HTML conversions cannot be used."
     (insert (mapconcat 'identity lines "\n"))
     (goto-char (point-min))
     (if (not (re-search-forward "|[^+]" nil t))
-        (error "Error processing table."))
+        (error "Error processing table"))
     (table-recognize-table)
     (with-current-buffer (get-buffer-create " org-tmp2 ") (erase-buffer))
     (table-generate-source 'html " org-tmp2 ")
@@ -8566,7 +8566,7 @@ a reduced column width."
 
 (defun org-shiftcursor-error ()
   "Throw an error because Shift-Cursor command was applied in wrong context."
-  (error "This command is only active in tables and on headlines."))
+  (error "This command is only active in tables and on headlines"))
 
 (defun org-shifttab ()
   "Call `(org-cycle t)' or `org-table-previous-field'."
@@ -8697,7 +8697,7 @@ the automatic table editor has been turned off."
       (if (y-or-n-p "Convert inactive region to table? ")
           (org-table-convert-region (region-beginning) (region-end) arg)
         (error "Abort")))
-     (t (error "No table at point, and no region to make one.")))))
+     (t (error "No table at point, and no region to make one")))))
 
 (defun org-return ()
   "Call `org-table-next-row' or `newline'."
@@ -8822,7 +8822,7 @@ the automatic table editor has been turned off."
       ["Fill Rectangle" org-table-wrap-region (org-at-table-p)])
      "--"
      ["Which Column?" org-table-current-column (org-at-table-p)]
-     ["Sum Column/Rectangle" org-table-sum 
+     ["Sum Column/Rectangle" org-table-sum
       (or (org-at-table-p) (org-region-active-p))]
      ["Eval Formula" org-table-eval-formula (org-at-table-p)]
      "--"
@@ -8865,10 +8865,10 @@ With optional NODE, go directly to that node."
   (Info-goto-node (format "(org)%s" (or node ""))))
 
 (defun org-install-agenda-files-menu ()
-  (easy-menu-change 
+  (easy-menu-change
    '("Org") "File List for Agenda"
    (append
-    (list 
+    (list
      ["Edit File List" (customize-variable 'org-agenda-files) t]
      ["Add Current File to List" org-add-file t]
      ["Remove Current File from List" org-remove-file t]
@@ -8983,7 +8983,7 @@ that can be added."
 ;; Functions needed for compatibility with old outline.el
 
 ;; The following functions capture almost the entire compatibility code
-;; between the different versions of outline-mode.  The only other place 
+;; between the different versions of outline-mode.  The only other place
 ;; where this is important are the font-lock-keywords.  Search for
 ;; `org-noutline-p' to find it.
 
@@ -9048,7 +9048,7 @@ If INVISIBLE-OK is non-nil, an invisible heading line is ok too."
 This function considers both visible and invisible heading lines.
 With argument, move up ARG levels."
   (if org-noutline-p
-      (if (fboundp 'outline-up-heading-all) 
+      (if (fboundp 'outline-up-heading-all)
           (outline-up-heading-all arg)   ; emacs 21 version of outline.el
         (outline-up-heading arg t))      ; emacs 22 version of outline.el
     (org-back-to-heading t)
@@ -9104,8 +9104,8 @@ When ENTRY is non-nil, show the entire entry."
 
 (defun org-show-subtree ()
   "Show everything after this heading at deeper levels."
-  (outline-flag-region 
-   (point) 
+  (outline-flag-region
+   (point)
    (save-excursion
      (outline-end-of-subtree) (outline-next-heading) (point))
    (if org-noutline-p nil ?\n)))
@@ -9116,7 +9116,7 @@ Show the heading too, if it is currently invisible."
   (interactive)
   (save-excursion
     (org-back-to-heading t)
-    (outline-flag-region 
+    (outline-flag-region
      (1- (point))
      (save-excursion
        (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") nil 'move)