emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/textmodes/org.el


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/org.el
Date: Fri, 01 Jul 2005 10:38:24 -0400

Index: emacs/lisp/textmodes/org.el
diff -c emacs/lisp/textmodes/org.el:1.25 emacs/lisp/textmodes/org.el:1.26
*** emacs/lisp/textmodes/org.el:1.25    Wed Jun 29 07:01:26 2005
--- emacs/lisp/textmodes/org.el Fri Jul  1 14:38:23 2005
***************
*** 1,4 ****
! ;; org.el --- Outline-based notes management and organizer 
  ;; Carstens outline-mode for keeping track of everything.
  ;; Copyright (c) 2004, 2005 Free Software Foundation
  ;;
--- 1,4 ----
! ;; org.el --- Outline-based notes management and organizer
  ;; Carstens outline-mode for keeping track of everything.
  ;; Copyright (c) 2004, 2005 Free Software Foundation
  ;;
***************
*** 455,461 ****
            (goto-char (point-min))
            (while (re-search-forward re nil t)
              (setq key (match-string 1) value (match-string 2))
!             (cond 
               ((equal key "CATEGORY")
                (if (string-match "[ \t]+$" value)
                    (setq value (replace-match "" t t value)))
--- 455,461 ----
            (goto-char (point-min))
            (while (re-search-forward re nil t)
              (setq key (match-string 1) value (match-string 2))
!             (cond
               ((equal key "CATEGORY")
                (if (string-match "[ \t]+$" value)
                    (setq value (replace-match "" t t value)))
***************
*** 495,501 ****
            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 
            (nth (1- (length org-todo-keywords)) org-todo-keywords)
            org-todo-regexp
            (concat "\\<\\(" (mapconcat 'regexp-quote org-todo-keywords
--- 495,501 ----
            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
            (nth (1- (length org-todo-keywords)) org-todo-keywords)
            org-todo-regexp
            (concat "\\<\\(" (mapconcat 'regexp-quote org-todo-keywords
***************
*** 575,581 ****
  
  (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." 
    :group 'org-agenda
    :type 'boolean)
  
--- 575,581 ----
  
  (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."
    :group 'org-agenda
    :type 'boolean)
  
***************
*** 594,600 ****
  ;; require a variable ndays treatment.
  (defcustom org-agenda-start-on-weekday 1
    "Non-nil means, start the overview always on the specified weekday.
! 0 Denotes Sunday, 1 denotes Monday etc.
  When nil, always start on the current day."
    :group 'org-agenda
    :type '(choice (const :tag "Today" nil)
--- 594,600 ----
  ;; require a variable ndays treatment.
  (defcustom org-agenda-start-on-weekday 1
    "Non-nil means, start the overview always on the specified weekday.
! 0 denotes Sunday, 1 denotes Monday etc.
  When nil, always start on the current day."
    :group 'org-agenda
    :type '(choice (const :tag "Today" nil)
***************
*** 611,617 ****
  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." 
    :group 'org-agenda
    :type 'boolean)
  
--- 611,617 ----
  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."
    :group 'org-agenda
    :type 'boolean)
  
***************
*** 623,630 ****
  (defcustom org-calendar-to-agenda-key [?c]
    "The key to be installed in `calendar-mode-map' for switching to the agenda.
  The command `org-calendar-goto-agenda' will be bound to this key.  The
! default is the character `c' because then`c' can be used to switch back and
! force between agenda and calendar."
    :group 'org-agenda
    :type 'sexp)
  
--- 623,630 ----
  (defcustom org-calendar-to-agenda-key [?c]
    "The key to be installed in `calendar-mode-map' for switching to the agenda.
  The command `org-calendar-goto-agenda' will be bound to this key.  The
! default is the character `c' because then `c' can be used to switch back and
! forth between agenda and calendar."
    :group 'org-agenda
    :type 'sexp)
  
***************
*** 632,638 ****
    "Sorting structure for the agenda items of a single day.
  This is a list of symbols which will be used in sequence to determine
  if an entry should be listed before another entry.  The following
! symbols are recognized.
  
  time-up         Put entries with time-of-day indications first, early first
  time-down       Put entries with time-of-day indications first, late first
--- 632,638 ----
    "Sorting structure for the agenda items of a single day.
  This is a list of symbols which will be used in sequence to determine
  if an entry should be listed before another entry.  The following
! symbols are recognized:
  
  time-up         Put entries with time-of-day indications first, early first
  time-down       Put entries with time-of-day indications first, late first
***************
*** 656,662 ****
  Leaving out `category-keep' would mean that items will be sorted across
  categories by priority."
    :group 'org-agenda
!   :type '(repeat 
            (choice
             (const time-up)
             (const time-down)
--- 656,662 ----
  Leaving out `category-keep' would mean that items will be sorted across
  categories by priority."
    :group 'org-agenda
!   :type '(repeat
            (choice
             (const time-up)
             (const time-down)
***************
*** 725,738 ****
  (defcustom org-agenda-use-time-grid t
    "Non-nil means, show a time grid in the agenda schedule.
  A time grid is a set of lines for specific times (like every two hours between
! 8:00 and 20:00.  The items scheduled for a day at specific times are
  sorted in between these lines.
! For deails about when the grid will be shown, and what it will look like, see
  the variable `org-agenda-time-grid'."
    :group 'org-agenda
    :type 'boolean)
  
! (defcustom org-agenda-time-grid 
    '((daily today require-timed)
      "----------------"
      (800 1000 1200 1400 1600 1800 2000))
--- 725,738 ----
  (defcustom org-agenda-use-time-grid t
    "Non-nil means, show a time grid in the agenda schedule.
  A time grid is a set of lines for specific times (like every two hours between
! 8:00 and 20:00).  The items scheduled for a day at specific times are
  sorted in between these lines.
! For details about when the grid will be shown, and what it will look like, see
  the variable `org-agenda-time-grid'."
    :group 'org-agenda
    :type 'boolean)
  
! (defcustom org-agenda-time-grid
    '((daily today require-timed)
      "----------------"
      (800 1000 1200 1400 1600 1800 2000))
***************
*** 751,757 ****
  The third item is a list of integers, indicating the times that should have
  a grid line."
    :group 'org-agenda
!   :type 
    '(list
      (set :greedy t :tag "Grid Display Options"
           (const :tag "Show grid in single day agenda display" daily)
--- 751,757 ----
  The third item is a list of integers, indicating the times that should have
  a grid line."
    :group 'org-agenda
!   :type
    '(list
      (set :greedy t :tag "Grid Display Options"
           (const :tag "Show grid in single day agenda display" daily)
***************
*** 845,854 ****
  
  (defcustom org-archive-location "%s_archive::"
    "The location where subtrees should be archived.
! 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).
  Archiving to a different file is useful to keep archived entries from
  contributing to the Org-mode Agenda.
  
--- 845,854 ----
  
  (defcustom org-archive-location "%s_archive::"
    "The location where subtrees should be archived.
! 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).
  Archiving to a different file is useful to keep archived entries from
  contributing to the Org-mode Agenda.
  
***************
*** 874,880 ****
  
  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)
--- 874,880 ----
  
  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)
***************
*** 915,921 ****
  When nil, it becomes possible to put several links into a line.
  Note that in tables, a link never extends accross fields, so in a table
  it is always possible to put several links into a line.
! Changing this varable requires a re-launch of Emacs of become effective."
    :group 'org-link
    :type 'boolean)
  
--- 915,921 ----
  When nil, it becomes possible to put several links into a line.
  Note that in tables, a link never extends accross fields, so in a table
  it is always possible to put several links into a line.
! Changing this variable requires a re-launch of Emacs to become effective."
    :group 'org-link
    :type 'boolean)
  
***************
*** 980,986 ****
                   (const find-file-other-frame)))))
  
  (defcustom org-usenet-links-prefer-google nil
!   "Non-nil means, `org-store-link' will create web links to google groups.
  When nil, Gnus will be used for such links.
  Using a prefix arg to the command \\[org-store-link] (`org-store-link')
  negates this setting for the duration of the command."
--- 980,986 ----
                   (const find-file-other-frame)))))
  
  (defcustom org-usenet-links-prefer-google nil
!   "Non-nil means, `org-store-link' will create web links to Google groups.
  When nil, Gnus will be used for such links.
  Using a prefix arg to the command \\[org-store-link] (`org-store-link')
  negates this setting for the duration of the command."
***************
*** 1119,1131 ****
  When nil, such lines will be treated like ordinary lines.
  
  When equal to the symbol `optimized', the table editor will be optimized to
! do the following
  - Use automatic overwrite mode in front of whitespace in table fields.
!   This make the structure of the table stay in tact as long as the edited
    field does not exceed the column width.
  - Minimize the number of realigns.  Normally, the table is aligned each time
    TAB or RET are pressed to move to another field.  With optimization this
!   happens only if changes to a field might have  changed the column width.
  Optimization requires replacing the functions `self-insert-command',
  `delete-char', and `backward-delete-char' in Org-mode buffers, with a
  slight (in fact: unnoticeable) speed impact for normal typing.  Org-mode is
--- 1119,1131 ----
  When nil, such lines will be treated like ordinary lines.
  
  When equal to the symbol `optimized', the table editor will be optimized to
! do the following:
  - Use automatic overwrite mode in front of whitespace in table fields.
!   This makes the structure of the table stay intact as long as the edited
    field does not exceed the column width.
  - Minimize the number of realigns.  Normally, the table is aligned each time
    TAB or RET are pressed to move to another field.  With optimization this
!   happens only if changes to a field might have changed the column width.
  Optimization requires replacing the functions `self-insert-command',
  `delete-char', and `backward-delete-char' in Org-mode buffers, with a
  slight (in fact: unnoticeable) speed impact for normal typing.  Org-mode is
***************
*** 1330,1336 ****
  
  (defcustom org-export-default-language "en"
    "The default language of HTML export, as a string.
! This should have an association in `org-export-language-setup'"
    :group 'org-export
    :type 'string)
  
--- 1330,1336 ----
  
  (defcustom org-export-default-language "en"
    "The default language of HTML export, as a string.
! This should have an association in `org-export-language-setup'."
    :group 'org-export
    :type 'string)
  
***************
*** 1498,1504 ****
    :type 'boolean)
  
  (defcustom org-export-html-show-new-buffer nil
!   "Non-nil means,  popup buffer containing the exported html text.
  Otherwise, the buffer will just be saved to a file and stay hidden."
    :group 'org-export
    :type 'boolean)
--- 1498,1504 ----
    :type 'boolean)
  
  (defcustom org-export-html-show-new-buffer nil
!   "Non-nil means, popup buffer containing the exported HTML text.
  Otherwise, the buffer will just be saved to a file and stay hidden."
    :group 'org-export
    :type 'boolean)
***************
*** 1635,1641 ****
    "Face for items scheduled previously, and not yet done."
    :group 'org-faces)
  
! (defface org-link 
    '((((type tty) (class color)) (:foreground "cyan" :weight bold))
      (((class color) (background light)) (:foreground "Purple"))
      (((class color) (background dark)) (:foreground "Cyan"))
--- 1635,1641 ----
    "Face for items scheduled previously, and not yet done."
    :group 'org-faces)
  
! (defface org-link
    '((((type tty) (class color)) (:foreground "cyan" :weight bold))
      (((class color) (background light)) (:foreground "Purple"))
      (((class color) (background dark)) (:foreground "Cyan"))
***************
*** 1664,1670 ****
      (((class color) (background light)) (:foreground "DarkGoldenrod"))
      (((class color) (background dark)) (:foreground "LightGoldenrod"))
      (t (:bold t :italic t)))
!   "Face used for level 2 headlines."
    :group 'org-faces)
  
  (defvar org-level-faces
--- 1664,1670 ----
      (((class color) (background light)) (:foreground "DarkGoldenrod"))
      (((class color) (background dark)) (:foreground "LightGoldenrod"))
      (t (:bold t :italic t)))
!   "Face used for time grids."
    :group 'org-faces)
  
  (defvar org-level-faces
***************
*** 1742,1748 ****
  
  ;;;###autoload
  (define-derived-mode org-mode outline-mode "Org"
!   "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
--- 1742,1748 ----
  
  ;;;###autoload
  (define-derived-mode org-mode outline-mode "Org"
!   "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
***************
*** 1814,1820 ****
            (org-cycle '(4)) (org-cycle '(4))))))))
  
  (defun org-fill-paragraph (&optional justify)
!   "Re-align a table, pass through to fill-paragraph if no table."
    (save-excursion
      (beginning-of-line 1)
      (looking-at "\\s-*\\(|\\|\\+-+\\)")))
--- 1814,1820 ----
            (org-cycle '(4)) (org-cycle '(4))))))))
  
  (defun org-fill-paragraph (&optional justify)
!   "Re-align a table, pass through to `fill-paragraph' if no table."
    (save-excursion
      (beginning-of-line 1)
      (looking-at "\\s-*\\(|\\|\\+-+\\)")))
***************
*** 1825,1831 ****
  ;;; Font-Lock stuff
  
  (defvar org-mouse-map (make-sparse-keymap))
! (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)
--- 1825,1831 ----
  ;;; Font-Lock stuff
  
  (defvar org-mouse-map (make-sparse-keymap))
! (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)
***************
*** 1901,1909 ****
            (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*]\\|$\\)" 
            ;; (3 'italic))
!           ;; '("\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)" 
            ;; (3 'underline))
            (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string "\\)\\>")
                  '(1 'org-warning t))
--- 1901,1909 ----
            (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*]\\|$\\)"
            ;; (3 'italic))
!           ;; '("\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)"
            ;; (3 'underline))
            (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string "\\)\\>")
                  '(1 'org-warning t))
***************
*** 1924,1930 ****
            (if org-noutline-p     ; FIXME:  I am not sure if eval will work
                                   ; on XEmacs if noutline is ever ported
                '((eval . (list "^\\(\\*+\\).*"
!                               0 '(nth 
                                    (% (- (match-end 1) (match-beginning 1) 1)
                                       org-n-levels)
                                    org-level-faces)
--- 1924,1930 ----
            (if org-noutline-p     ; FIXME:  I am not sure if eval will work
                                   ; on XEmacs if noutline is ever ported
                '((eval . (list "^\\(\\*+\\).*"
!                               0 '(nth
                                    (% (- (match-end 1) (match-beginning 1) 1)
                                       org-n-levels)
                                    org-level-faces)
***************
*** 1938,1944 ****
      (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)
--- 1938,1944 ----
      (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)
***************
*** 1956,1968 ****
    "Visibility cycling for Org-mode.
  
  - When this function is called with a prefix argument, rotate the entire
!   buffer through 3 states (global cycling)
    1. OVERVIEW: Show only top-level headlines.
    2. CONTENTS: Show all headlines of all levels, but no body text.
    3. SHOW ALL: Show everything.
  
  - When point is at the beginning of a headline, rotate the subtree started
!   by this line through 3 different states (local cycling)
    1. FOLDED:   Only the main headline is shown.
    2. CHILDREN: The main headline and the direct children are shown.  From
                 this state, you can move to one of the children and
--- 1956,1968 ----
    "Visibility cycling for Org-mode.
  
  - When this function is called with a prefix argument, rotate the entire
!   buffer through 3 states (global cycling):
    1. OVERVIEW: Show only top-level headlines.
    2. CONTENTS: Show all headlines of all levels, but no body text.
    3. SHOW ALL: Show everything.
  
  - When point is at the beginning of a headline, rotate the subtree started
!   by this line through 3 different states (local cycling):
    1. FOLDED:   Only the main headline is shown.
    2. CHILDREN: The main headline and the direct children are shown.  From
                 this state, you can move to one of the children and
***************
*** 2218,2231 ****
  
  ;;  FIXME:  It may not be a good idea to temper with the prefix argument...
  (defun org-goto-ret (&optional arg)
!   "Finish org-goto by going to the new location."
    (interactive "P")
    (setq org-selected-point (point)
          current-prefix-arg arg)
    (throw 'exit nil))
  
  (defun org-goto-left ()
!   "Finish org-goto by going to the new location."
    (interactive)
    (if (org-on-heading-p)
        (progn
--- 2218,2231 ----
  
  ;;  FIXME:  It may not be a good idea to temper with the prefix argument...
  (defun org-goto-ret (&optional arg)
!   "Finish `org-goto' by going to the new location."
    (interactive "P")
    (setq org-selected-point (point)
          current-prefix-arg arg)
    (throw 'exit nil))
  
  (defun org-goto-left ()
!   "Finish `org-goto' by going to the new location."
    (interactive)
    (if (org-on-heading-p)
        (progn
***************
*** 2236,2242 ****
      (error "Not on a heading")))
  
  (defun org-goto-right ()
!   "Finish org-goto by going to the new location."
    (interactive)
    (if (org-on-heading-p)
        (progn
--- 2236,2242 ----
      (error "Not on a heading")))
  
  (defun org-goto-right ()
!   "Finish `org-goto' by going to the new location."
    (interactive)
    (if (org-on-heading-p)
        (progn
***************
*** 2248,2254 ****
      (error "Not on a heading")))
  
  (defun org-goto-quit ()
!   "Finish org-goto without cursor motion."
    (interactive)
    (setq org-selected-point nil)
    (throw 'exit nil))
--- 2248,2254 ----
      (error "Not on a heading")))
  
  (defun org-goto-quit ()
!   "Finish `org-goto' without cursor motion."
    (interactive)
    (setq org-selected-point nil)
    (throw 'exit nil))
***************
*** 2657,2663 ****
                  (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 
                     (concat "^" (regexp-quote (make-string level ?*)) "[ \t]")
                     nil t)
                    (progn (goto-char (match-beginning 0)) (insert "\n")
--- 2657,2663 ----
                  (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
                     (concat "^" (regexp-quote (make-string level ?*)) "[ \t]")
                     nil t)
                    (progn (goto-char (match-beginning 0)) (insert "\n")
***************
*** 2717,2730 ****
             (table (cond
                     (opt
                      (setq type :opt)
!                     (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 
                      (setq type :tex)
                      org-html-entities)
!                    (form 
                      (setq type :form)
                      '(("sum") ("sumv") ("sumh")))
                     ((string-match "\\`\\*+[ \t]*\\'"
--- 2717,2730 ----
             (table (cond
                     (opt
                      (setq type :opt)
!                     (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
                      (setq type :tex)
                      org-html-entities)
!                    (form
                      (setq type :form)
                      '(("sum") ("sumv") ("sumh")))
                     ((string-match "\\`\\*+[ \t]*\\'"
***************
*** 2734,2740 ****
                     (t (progn (ispell-complete-word arg) (throw 'exit nil)))))
             (completion (try-completion pattern table)))
        (cond ((eq completion t)
!              (if (equal type :opt) 
                   (insert (substring (cdr (assoc (upcase pattern) table))
                                      (length pattern)))))
              ((null completion)
--- 2734,2740 ----
                     (t (progn (ispell-complete-word arg) (throw 'exit nil)))))
             (completion (try-completion pattern table)))
        (cond ((eq completion t)
!              (if (equal type :opt)
                   (insert (substring (cdr (assoc (upcase pattern) table))
                                      (length pattern)))))
              ((null completion)
***************
*** 2742,2748 ****
               (ding))
              ((not (string= pattern completion))
               (delete-region beg end)
!              (if (string-match " +$" completion) 
                   (setq completion (replace-match "" t t completion)))
               (insert completion)
               (if (get-buffer-window "*Completions*")
--- 2742,2748 ----
               (ding))
              ((not (string= pattern completion))
               (delete-region beg end)
!              (if (string-match " +$" completion)
                   (setq completion (replace-match "" t t completion)))
               (insert completion)
               (if (get-buffer-window "*Completions*")
***************
*** 2879,2885 ****
  The tree will show the lines where the regexp matches, and all higher
  headlines above the match.  It will also show the heading after the match,
  to make sure editing the matching entry is easy.
! if CALLBACK is non-nil, it is a function which is called to confirm
  that the match should indeed be shown."
    (interactive "sRegexp: ")
    (setq regexp (org-check-occur-regexp regexp))
--- 2879,2885 ----
  The tree will show the lines where the regexp matches, and all higher
  headlines above the match.  It will also show the heading after the match,
  to make sure editing the matching entry is easy.
! If CALLBACK is non-nil, it is a function which is called to confirm
  that the match should indeed be shown."
    (interactive "sRegexp: ")
    (setq regexp (org-check-occur-regexp regexp))
***************
*** 2979,2987 ****
    (save-match-data
      (if (not (string-match org-priority-regexp s))
          (* 1000 (- org-lowest-priority org-default-priority))
!       (* 1000 (- org-lowest-priority 
                   (string-to-char (match-string 2 s)))))))
!       
  ;;; Timestamps
  
  (defvar org-last-changed-timestamp nil)
--- 2979,2987 ----
    (save-match-data
      (if (not (string-match org-priority-regexp s))
          (* 1000 (- org-lowest-priority org-default-priority))
!       (* 1000 (- org-lowest-priority
                   (string-to-char (match-string 2 s)))))))
! 
  ;;; Timestamps
  
  (defvar org-last-changed-timestamp nil)
***************
*** 3013,3019 ****
        (setq time (let ((this-command this-command))
                     (org-read-date arg 'totime)))
        (and (org-at-timestamp-p) (replace-match
!                                  (setq org-last-changed-timestamp 
                                         (format-time-string fmt time))
                                   t t))
        (message "Timestamp updated"))
--- 3013,3019 ----
        (setq time (let ((this-command this-command))
                     (org-read-date arg 'totime)))
        (and (org-at-timestamp-p) (replace-match
!                                  (setq org-last-changed-timestamp
                                         (format-time-string fmt time))
                                   t t))
        (message "Timestamp updated"))
***************
*** 3043,3050 ****
  
  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 
         \(setq org-popup-calendar-for-date-prompt nil).
  
  With optional argument TO-TIME, the date will immediately be converted
--- 3043,3050 ----
  
  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
         \(setq org-popup-calendar-for-date-prompt nil).
  
  With optional argument TO-TIME, the date will immediately be converted
***************
*** 3058,3064 ****
             ;; Default time is either today, or, when entering a range,
             ;; the range start.
             (if (save-excursion
!                  (re-search-backward 
                    (concat org-ts-regexp "--\\=")
                    (- (point) 20) t))
                 (apply
--- 3058,3064 ----
             ;; Default time is either today, or, when entering a range,
             ;; the range start.
             (if (save-excursion
!                  (re-search-backward
                    (concat org-ts-regexp "--\\=")
                    (- (point) 20) t))
                 (apply
***************
*** 3150,3156 ****
  
  (defun org-eval-in-calendar (form)
    "Eval FORM in the calendar window and return to current window.
! Also, store the cursor date in variable ans2."
    (let ((sw (selected-window)))
      (select-window (get-buffer-window "*Calendar*"))
      (eval form)
--- 3150,3156 ----
  
  (defun org-eval-in-calendar (form)
    "Eval FORM in the calendar window and return to current window.
! Also, store the cursor date in variable `ans2'."
    (let ((sw (selected-window)))
      (select-window (get-buffer-window "*Calendar*"))
      (eval form)
***************
*** 3169,3175 ****
             (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'
--- 3169,3175 ----
             (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'
***************
*** 3324,3330 ****
         (>= (match-end n) pos)))
  
  (defun org-at-timestamp-p ()
!   "Determine if the cursor is  or at a timestamp."
    (interactive)
    (let* ((tsr org-ts-regexp2)
           (pos (point))
--- 3324,3330 ----
         (>= (match-end n) pos)))
  
  (defun org-at-timestamp-p ()
!   "Determine if the cursor is at a timestamp."
    (interactive)
    (let* ((tsr org-ts-regexp2)
           (pos (point))
***************
*** 3461,3470 ****
    (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 
     '("Agenda") "Agenda Files"
     (append
!     (list 
       ["Edit File List" (customize-variable 'org-agenda-files) t]
       "--")
     (mapcar 'org-file-menu-entry org-agenda-files)))
--- 3461,3470 ----
    (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
     '("Agenda") "Agenda Files"
     (append
!     (list
       ["Edit File List" (customize-variable 'org-agenda-files) t]
       "--")
     (mapcar 'org-file-menu-entry org-agenda-files)))
***************
*** 3526,3532 ****
  (defvar org-agenda-keymap (copy-keymap org-agenda-mode-map)
    "Local keymap for agenda entries from Org-mode.")
  
! (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)
--- 3526,3532 ----
  (defvar org-agenda-keymap (copy-keymap org-agenda-mode-map)
    "Local keymap for agenda entries from Org-mode.")
  
! (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)
***************
*** 3538,3544 ****
      ["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 
       :style toggle :selected org-agenda-follow-mode :active t]
      "--"
      ["Cycle TODO" org-agenda-todo t]
--- 3538,3544 ----
      ["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
       :style toggle :selected org-agenda-follow-mode :active t]
      "--"
      ["Cycle TODO" org-agenda-todo t]
***************
*** 3659,3665 ****
           (org-respect-restriction t)
           (past t)
           s e rtn d)
!     (setq org-agenda-redo-command 
            (list 'progn
                  (list 'switch-to-buffer-other-window (current-buffer))
                  (list 'org-timeline include-all)))
--- 3659,3665 ----
           (org-respect-restriction t)
           (past t)
           s e rtn d)
!     (setq org-agenda-redo-command
            (list 'progn
                  (list 'switch-to-buffer-other-window (current-buffer))
                  (list 'org-timeline include-all)))
***************
*** 3668,3674 ****
          (setq day-numbers (delq nil (mapcar (lambda(x)
                                                (if (>= x today) x nil))
                                              day-numbers))))
!     (switch-to-buffer-other-window 
       (get-buffer-create org-agenda-buffer-name))
      (setq buffer-read-only nil)
      (erase-buffer)
--- 3668,3674 ----
          (setq day-numbers (delq nil (mapcar (lambda(x)
                                                (if (>= x today) x nil))
                                              day-numbers))))
!     (switch-to-buffer-other-window
       (get-buffer-create org-agenda-buffer-name))
      (setq buffer-read-only nil)
      (erase-buffer)
***************
*** 3683,3689 ****
        (setq date (calendar-gregorian-from-absolute d))
        (setq s (point))
        (if dotodo
!           (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))
--- 3683,3689 ----
        (setq date (calendar-gregorian-from-absolute d))
        (setq s (point))
        (if dotodo
!           (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))
***************
*** 3739,3745 ****
           (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 
            (list 'org-agenda include-all start-day ndays))
      ;; Make the list of days
      (setq ndays (or ndays org-agenda-ndays)
--- 3739,3745 ----
           (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
            (list 'org-agenda include-all start-day ndays))
      ;; Make the list of days
      (setq ndays (or ndays org-agenda-ndays)
***************
*** 3751,3757 ****
      (if (not (equal (current-buffer) (get-buffer org-agenda-buffer-name)))
          (progn
            (delete-other-windows)
!           (switch-to-buffer-other-window 
             (get-buffer-create org-agenda-buffer-name))))
      (setq buffer-read-only nil)
      (erase-buffer)
--- 3751,3757 ----
      (if (not (equal (current-buffer) (get-buffer org-agenda-buffer-name)))
          (progn
            (delete-other-windows)
!           (switch-to-buffer-other-window
             (get-buffer-create org-agenda-buffer-name))))
      (setq buffer-read-only nil)
      (erase-buffer)
***************
*** 3769,3775 ****
                  rtn (org-agenda-get-day-entries
                       file date :todo))
            (setq rtnall (append rtnall rtn))))
!       (when rtnall 
          (insert "ALL CURRENTLY OPEN TODO ITEMS:\n")
          (add-text-properties (point-min) (1- (point))
                               (list 'face 'org-link))
--- 3769,3775 ----
                  rtn (org-agenda-get-day-entries
                       file date :todo))
            (setq rtnall (append rtnall rtn))))
!       (when rtnall
          (insert "ALL CURRENTLY OPEN TODO ITEMS:\n")
          (add-text-properties (point-min) (1- (point))
                               (list 'face 'org-link))
***************
*** 3803,3814 ****
                              (extract-calendar-year date)))
              (put-text-property s (1- (point)) 'face
                                 'org-link)
!             (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))))            
      (goto-char (point-min))
      (setq buffer-read-only t)
      (if org-fit-agenda-window
--- 3803,3814 ----
                              (extract-calendar-year date)))
              (put-text-property s (1- (point)) 'face
                                 'org-link)
!             (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))))
      (goto-char (point-min))
      (setq buffer-read-only t)
      (if org-fit-agenda-window
***************
*** 3897,3915 ****
    (unless (boundp 'starting-day)
      (error "Not allowed"))
    (setq org-agenda-ndays 7)
!   (org-agenda include-all-loc 
                (or (get-text-property (point) 'day)
                    starting-day))
    (org-agenda-set-mode-name)
    (message "Switched to week view"))
  
  (defun org-agenda-day-view ()
!   "Switch to weekly view for agenda."
    (interactive)
    (unless (boundp 'starting-day)
      (error "Not allowed"))
    (setq org-agenda-ndays 1)
!   (org-agenda include-all-loc 
                (or (get-text-property (point) 'day)
                    starting-day))
    (org-agenda-set-mode-name)
--- 3897,3915 ----
    (unless (boundp 'starting-day)
      (error "Not allowed"))
    (setq org-agenda-ndays 7)
!   (org-agenda include-all-loc
                (or (get-text-property (point) 'day)
                    starting-day))
    (org-agenda-set-mode-name)
    (message "Switched to week view"))
  
  (defun org-agenda-day-view ()
!   "Switch to daily view for agenda."
    (interactive)
    (unless (boundp 'starting-day)
      (error "Not allowed"))
    (setq org-agenda-ndays 1)
!   (org-agenda include-all-loc
                (or (get-text-property (point) 'day)
                    starting-day))
    (org-agenda-set-mode-name)
***************
*** 3957,3963 ****
             (if org-agenda-follow-mode "on" "off")))
  
  (defun org-agenda-toggle-diary ()
!   "Toggle follow mode in an agenda buffer."
    (interactive)
    (setq org-agenda-include-diary (not org-agenda-include-diary))
    (org-agenda-redo)
--- 3957,3963 ----
             (if org-agenda-follow-mode "on" "off")))
  
  (defun org-agenda-toggle-diary ()
!   "Toggle diary inclusion in an agenda buffer."
    (interactive)
    (setq org-agenda-include-diary (not org-agenda-include-diary))
    (org-agenda-redo)
***************
*** 3966,3972 ****
             (if org-agenda-include-diary "on" "off")))
  
  (defun org-agenda-toggle-time-grid ()
!   "Toggle follow mode in an agenda buffer."
    (interactive)
    (setq org-agenda-use-time-grid (not org-agenda-use-time-grid))
    (org-agenda-redo)
--- 3966,3972 ----
             (if org-agenda-include-diary "on" "off")))
  
  (defun org-agenda-toggle-time-grid ()
!   "Toggle time-grid in an agenda buffer."
    (interactive)
    (setq org-agenda-use-time-grid (not org-agenda-use-time-grid))
    (org-agenda-redo)
***************
*** 3997,4003 ****
    "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 
            (cons 'org-diary-default-entry list-diary-entries-hook))
           entries
           (org-disable-diary t))
--- 3997,4003 ----
    "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
            (cons 'org-diary-default-entry list-diary-entries-hook))
           entries
           (org-disable-diary t))
***************
*** 4021,4032 ****
          (kill-buffer fancy-diary-buffer)))
      (when entries
        (setq entries (org-split-string entries "\n"))
!       (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 
                  0 (length x)
                  (text-properties-at (1- (length x)) x)
                  x)
--- 4021,4032 ----
          (kill-buffer fancy-diary-buffer)))
      (when entries
        (setq entries (org-split-string entries "\n"))
!       (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
                  0 (length x)
                  (text-properties-at (1- (length x)) x)
                  x)
***************
*** 4034,4043 ****
               entries)))))
  
  (defun org-agenda-cleanup-fancy-diary ()
!   "Remove unwanted stuff in buffer created by fancy-diary-display.
  This gets rid of the date, the underline under the date, and
  the dummy entry installed by `org-mode' to ensure non-empty diary for each
! date.  Itt also removes lines that contain only whitespace."
    (goto-char (point-min))
    (if (looking-at ".*?:[ \t]*")
        (progn
--- 4034,4043 ----
               entries)))))
  
  (defun org-agenda-cleanup-fancy-diary ()
!   "Remove unwanted stuff in buffer created by `fancy-diary-display'.
  This gets rid of the date, the underline under the date, and
  the dummy entry installed by `org-mode' to ensure non-empty diary for each
! date.  It also removes lines that contain only whitespace."
    (goto-char (point-min))
    (if (looking-at ".*?:[ \t]*")
        (progn
***************
*** 4067,4073 ****
            0 (length string)
            (list 'mouse-face 'highlight
                  'keymap org-agenda-keymap
!                 'help-echo 
                  (format
                   "mouse-2 or RET jump to diary file %s"
                   (abbreviate-file-name (buffer-file-name)))
--- 4067,4073 ----
            0 (length string)
            (list 'mouse-face 'highlight
                  'keymap org-agenda-keymap
!                 'help-echo
                  (format
                   "mouse-2 or RET jump to diary file %s"
                   (abbreviate-file-name (buffer-file-name)))
***************
*** 4089,4095 ****
  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'." 
    (interactive)
    (catch 'exit
      (let* ((file (or file (buffer-file-name)
--- 4089,4095 ----
  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'."
    (interactive)
    (catch 'exit
      (let* ((file (or file (buffer-file-name)
***************
*** 4104,4110 ****
                                 org-agenda-files))))
        (if (not present)
            (progn
!             (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))
--- 4104,4110 ----
                                 org-agenda-files))))
        (if (not present)
            (progn
!             (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))
***************
*** 4121,4127 ****
    (let* ((file (or file (buffer-file-name)))
           (true-file (file-truename file))
           (afile (abbreviate-file-name file))
!          (files (delq nil (mapcar 
                             (lambda (x)
                               (if (equal true-file
                                          (file-truename x))
--- 4121,4127 ----
    (let* ((file (or file (buffer-file-name)))
           (true-file (file-truename file))
           (afile (abbreviate-file-name file))
!          (files (delq nil (mapcar
                             (lambda (x)
                               (if (equal true-file
                                          (file-truename x))
***************
*** 4168,4174 ****
    "Return diary information from org-files.
  This function can be used in a \"sexp\" diary entry in the Emacs calendar.
  It accesses org files and extracts information from those files to be
- 
  listed in the diary.  The function accepts arguments specifying what
  items should be listed.  The following arguments are allowed:
  
--- 4168,4173 ----
***************
*** 4207,4213 ****
  
  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." 
    (org-agenda-maybe-reset-markers)
    (org-compile-prefix-format org-agenda-prefix-format)
    (setq args (or args '(:deadline :scheduled :timestamp)))
--- 4206,4212 ----
  
  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."
    (org-agenda-maybe-reset-markers)
    (org-compile-prefix-format org-agenda-prefix-format)
    (setq args (or args '(:deadline :scheduled :timestamp)))
***************
*** 4249,4255 ****
                    (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, 
                  ;; get rid of any restriction
                  (widen))
                ;; The way we repeatedly append to `results' makes it O(n^2) :-(
--- 4248,4254 ----
                    (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,
                  ;; get rid of any restriction
                  (widen))
                ;; The way we repeatedly append to `results' makes it O(n^2) :-(
***************
*** 4315,4321 ****
        (goto-char (match-beginning 1))
        (setq marker (org-agenda-new-marker (point-at-bol))
              txt (org-format-agenda-item "" (match-string 1))
!             priority 
              (+ (org-get-priority txt)
                 (if org-todo-kwd-priority-p
                           (- org-todo-kwd-max-priority -2
--- 4314,4320 ----
        (goto-char (match-beginning 1))
        (setq marker (org-agenda-new-marker (point-at-bol))
              txt (org-format-agenda-item "" (match-string 1))
!             priority
              (+ (org-get-priority txt)
                 (if org-todo-kwd-priority-p
                           (- org-todo-kwd-max-priority -2
***************
*** 4332,4338 ****
      (nreverse ee)))
  
  (defconst org-agenda-no-heading-message
!   "No heading for this item in buffer or region")
  
  (defun org-agenda-get-timestamps ()
    "Return the date stamp information for agenda display."
--- 4331,4337 ----
      (nreverse ee)))
  
  (defconst org-agenda-no-heading-message
!   "No heading for this item in buffer or region.")
  
  (defun org-agenda-get-timestamps ()
    "Return the date stamp information for agenda display."
***************
*** 4387,4393 ****
                (if deadlinep
                    (add-text-properties
                     0 (length txt)
!                    (list 'face 
                           (if donep 'org-done 'org-warning)
                           'undone-face 'org-warning
                           'done-face 'org-done
--- 4386,4392 ----
                (if deadlinep
                    (add-text-properties
                     0 (length txt)
!                    (list 'face
                           (if donep 'org-done 'org-warning)
                           'undone-face 'org-warning
                           'done-face 'org-done
***************
*** 4447,4454 ****
                (setq txt org-agenda-no-heading-message))
              (when txt
                (add-text-properties
!                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))
--- 4446,4453 ----
                (setq txt org-agenda-no-heading-message))
              (when txt
                (add-text-properties
!                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))
***************
*** 4540,4546 ****
                    (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 
                               (format (if (= d1 d2) "" "(%d/%d): ")
                                       (1+ (- d0 d1)) (1+ (- d2 d1)))
                               (match-string 1) nil (if (= d0 d1) timestr))))
--- 4539,4545 ----
                    (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
                               (format (if (= d1 d2) "" "(%d/%d): ")
                                       (1+ (- d0 d1)) (1+ (- d2 d1)))
                               (match-string 1) nil (if (= d0 d1) timestr))))
***************
*** 4622,4628 ****
            (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.
--- 4621,4627 ----
            (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.
***************
*** 4635,4641 ****
          ;; 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)
--- 4634,4640 ----
          ;; 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)
***************
*** 4647,4653 ****
                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)
--- 4646,4652 ----
                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)
***************
*** 4678,4688 ****
        (while (setq time (pop gridtimes))
          (unless (and remove (member time have))
            (setq time (int-to-string time))
!           (push (org-format-agenda-item 
                   nil string "" ;; FIXME: put a category?
                   (concat (substring time 0 -2) ":" (substring time -2)))
                  new)
!           (put-text-property 
             1 (length (car new)) 'face 'org-time-grid (car new))))
        (if (member 'time-up org-agenda-sorting-strategy)
            (append new list)
--- 4677,4687 ----
        (while (setq time (pop gridtimes))
          (unless (and remove (member time have))
            (setq time (int-to-string time))
!           (push (org-format-agenda-item
                   nil string "" ;; FIXME: put a category?
                   (concat (substring time 0 -2) ":" (substring time -2)))
                  new)
!           (put-text-property
             1 (length (car new)) 'face 'org-time-grid (car new))))
        (if (member 'time-up org-agenda-sorting-strategy)
            (append new list)
***************
*** 4721,4727 ****
  The optional STRING argument forces conversion into a 5 character wide string
  HH:MM."
    (save-match-data
!     (when 
       (or
        (string-match
         "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)\\([AaPp][Mm]\\)?\\> *" s)
--- 4720,4726 ----
  The optional STRING argument forces conversion into a 5 character wide string
  HH:MM."
    (save-match-data
!     (when
       (or
        (string-match
         "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)\\([AaPp][Mm]\\)?\\> *" s)
***************
*** 4743,4749 ****
    (mapconcat 'identity (sort list 'org-entries-lessp) "\n"))
  
  (defsubst org-cmp-priority (a b)
!   "Compare the priorities of string a and b."
    (let ((pa (or (get-text-property 1 'priority a) 0))
          (pb (or (get-text-property 1 'priority b) 0)))
      (cond ((> pa pb) +1)
--- 4742,4748 ----
    (mapconcat 'identity (sort list 'org-entries-lessp) "\n"))
  
  (defsubst org-cmp-priority (a b)
!   "Compare the priorities of strings A and B."
    (let ((pa (or (get-text-property 1 'priority a) 0))
          (pb (or (get-text-property 1 'priority b) 0)))
      (cond ((> pa pb) +1)
***************
*** 4751,4757 ****
            (t nil))))
  
  (defsubst org-cmp-category (a b)
!   "Compare the string values of categories of strings a and b."
    (let ((ca (or (get-text-property 1 'category a) ""))
          (cb (or (get-text-property 1 'category b) "")))
      (cond ((string-lessp ca cb) -1)
--- 4750,4756 ----
            (t nil))))
  
  (defsubst org-cmp-category (a b)
!   "Compare the string values of categories of strings A and B."
    (let ((ca (or (get-text-property 1 'category a) ""))
          (cb (or (get-text-property 1 'category b) "")))
      (cond ((string-lessp ca cb) -1)
***************
*** 4759,4765 ****
            (t nil))))
  
  (defsubst org-cmp-time (a b)
!   "Compare the time-of-day values of strings a and b."
    (let* ((def (if org-sort-agenda-notime-is-late 2401 -1))
           (ta (or (get-text-property 1 'time-of-day a) def))
           (tb (or (get-text-property 1 'time-of-day b) def)))
--- 4758,4764 ----
            (t nil))))
  
  (defsubst org-cmp-time (a b)
!   "Compare the time-of-day values of strings A and B."
    (let* ((def (if org-sort-agenda-notime-is-late 2401 -1))
           (ta (or (get-text-property 1 'time-of-day a) def))
           (tb (or (get-text-property 1 'time-of-day b) def)))
***************
*** 4777,4783 ****
           (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 
            (eval (cons 'or org-agenda-sorting-strategy))
            '((-1 . t) (1 . nil) (nil . nil))))))
  
--- 4776,4782 ----
           (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
            (eval (cons 'or org-agenda-sorting-strategy))
            '((-1 . t) (1 . nil) (nil . nil))))))
  
***************
*** 4792,4798 ****
  (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) 
                       (org-agenda-error)))
           (buffer (marker-buffer marker))
           (pos (marker-position marker)))
--- 4791,4797 ----
  (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)
                       (org-agenda-error)))
           (buffer (marker-buffer marker))
           (pos (marker-position marker)))
***************
*** 4809,4815 ****
  (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) 
                       (org-agenda-error)))
           (buffer (marker-buffer marker))
           (pos (marker-position marker)))
--- 4808,4814 ----
  (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)
                       (org-agenda-error)))
           (buffer (marker-buffer marker))
           (pos (marker-position marker)))
***************
*** 4895,4901 ****
      (move-to-column col)))
  
  (defun org-agenda-change-all-lines (newhead hdmarker &optional fixface)
!   "Change all lines in the agenda buffer which match hdmarker.
  The new content of the line will be NEWHEAD (as modified by
  `org-format-agenda-item').  HDMARKER is checked with
  `equal' against all `org-hd-marker' text properties in the file.
--- 4894,4900 ----
      (move-to-column col)))
  
  (defun org-agenda-change-all-lines (newhead hdmarker &optional fixface)
!   "Change all lines in the agenda buffer which match HDMARKER.
  The new content of the line will be NEWHEAD (as modified by
  `org-format-agenda-item').  HDMARKER is checked with
  `equal' against all `org-hd-marker' text properties in the file.
***************
*** 4923,4929 ****
                  (beginning-of-line 1)
                  (add-text-properties (point-at-bol) (point-at-eol) props)
                  (if fixface
!                     (add-text-properties 
                       (point-at-bol) (point-at-eol)
                       (list 'face
                             (if org-last-todo-state-is-todo
--- 4922,4928 ----
                  (beginning-of-line 1)
                  (add-text-properties (point-at-bol) (point-at-eol) props)
                  (if fixface
!                     (add-text-properties
                       (point-at-bol) (point-at-eol)
                       (list 'face
                             (if org-last-todo-state-is-todo
***************
*** 5017,5026 ****
  
  (defun org-agenda-diary-entry ()
    "Make a diary entry, like the `i' command from the calendar.
! All the standard commands work: block, weekly etc"
    (interactive)
    (require 'diary-lib)
!   (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
--- 5016,5025 ----
  
  (defun org-agenda-diary-entry ()
    "Make a diary entry, like the `i' command from the calendar.
! All the standard commands work: block, weekly etc."
    (interactive)
    (require 'diary-lib)
!   (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
***************
*** 5050,5056 ****
            (progn
              (fset 'calendar-cursor-to-date
                    (lambda (&optional error)
!                     (calendar-gregorian-from-absolute 
                       (get-text-property point 'day))))
              (call-interactively cmd))
          (fset 'calendar-cursor-to-date oldf)))))
--- 5049,5055 ----
            (progn
              (fset 'calendar-cursor-to-date
                    (lambda (&optional error)
!                     (calendar-gregorian-from-absolute
                       (get-text-property point 'day))))
              (call-interactively cmd))
          (fset 'calendar-cursor-to-date oldf)))))
***************
*** 5073,5079 ****
            (progn
              (fset 'calendar-cursor-to-date
                    (lambda (&optional error)
!                     (calendar-gregorian-from-absolute 
                       (get-text-property point 'day))))
              (call-interactively cmd))
          (fset 'calendar-cursor-to-date oldf))))
--- 5072,5078 ----
            (progn
              (fset 'calendar-cursor-to-date
                    (lambda (&optional error)
!                     (calendar-gregorian-from-absolute
                       (get-text-property point 'day))))
              (call-interactively cmd))
          (fset 'calendar-cursor-to-date oldf))))
***************
*** 5123,5129 ****
      (unless day
        (error "Don't know which date to convert"))
      (setq date (calendar-gregorian-from-absolute day))
!     (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"
--- 5122,5128 ----
      (unless day
        (error "Don't know which date to convert"))
      (setq date (calendar-gregorian-from-absolute day))
!     (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"
***************
*** 5236,5244 ****
  
           ((string= type "shell")
            (let ((cmd path))
!             (while (string-match "@{" cmd) 
                (setq cmd (replace-match "<" t t 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)))
--- 5235,5243 ----
  
           ((string= type "shell")
            (let ((cmd path))
!             (while (string-match "@{" cmd)
                (setq cmd (replace-match "<" t t 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)))
***************
*** 5335,5341 ****
                  (widen)
                  (goto-char (point-max))
                  (if (re-search-backward
!                      (concat "^Message-ID:\\s-+" (regexp-quote 
                                                    (or article "")))
                       nil t)
                      (rmail-what-message))))))
--- 5334,5340 ----
                  (widen)
                  (goto-char (point-max))
                  (if (re-search-backward
!                      (concat "^Message-ID:\\s-+" (regexp-quote
                                                    (or article "")))
                       nil t)
                      (rmail-what-message))))))
***************
*** 5422,5428 ****
                      (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
--- 5421,5427 ----
                      (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
***************
*** 5448,5455 ****
                             folder)
               (setq folder (replace-match "" t t folder)))
           (setq cpltxt (concat author " on: " subject))
!          (setq link (concat cpltxt "\n  " 
!                             (org-make-link 
                               "vm:" folder "#" message-id))))))
  
       ((eq major-mode 'wl-summary-mode)
--- 5447,5454 ----
                             folder)
               (setq folder (replace-match "" t t folder)))
           (setq cpltxt (concat author " on: " subject))
!          (setq link (concat cpltxt "\n  "
!                             (org-make-link
                               "vm:" folder "#" message-id))))))
  
       ((eq major-mode 'wl-summary-mode)
***************
*** 5461,5467 ****
               (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  " 
                             (org-make-link
                              "wl:" wl-summary-buffer-folder-name
                             "#" message-id)))))
--- 5460,5466 ----
               (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  "
                             (org-make-link
                              "wl:" wl-summary-buffer-folder-name
                             "#" message-id)))))
***************
*** 5475,5481 ****
                  (author (mail-fetch-field "from"))
                  (subject (mail-fetch-field "subject")))
              (setq cpltxt (concat author  " on: " subject))
!             (setq link (concat cpltxt "\n  " 
                                 (org-make-link
                                  "rmail:" folder "#" message-id)))))))
  
--- 5474,5480 ----
                  (author (mail-fetch-field "from"))
                  (subject (mail-fetch-field "subject")))
              (setq cpltxt (concat author  " on: " subject))
!             (setq link (concat cpltxt "\n  "
                                 (org-make-link
                                  "rmail:" folder "#" message-id)))))))
  
***************
*** 5529,5535 ****
        (if (org-xor org-line-numbers-in-file-links arg)
            (setq cpltxt
                  (concat cpltxt
!                         ":" (int-to-string 
                               (+ (if (bolp) 1 0) (count-lines
                                                   (point-min) (point)))))))
        (setq link (org-make-link cpltxt)))
--- 5528,5534 ----
        (if (org-xor org-line-numbers-in-file-links arg)
            (setq cpltxt
                  (concat cpltxt
!                         ":" (int-to-string
                               (+ (if (bolp) 1 0) (count-lines
                                                   (point-min) (point)))))))
        (setq link (org-make-link cpltxt)))
***************
*** 5555,5561 ****
    (if a (not b) b))
  
  (defun org-get-header (header)
!   "Find a header field in the current buffer."
    (save-excursion
      (goto-char (point-min))
      (let ((case-fold-search t) s)
--- 5554,5560 ----
    (if a (not b) b))
  
  (defun org-get-header (header)
!   "Find a HEADER field in the current buffer."
    (save-excursion
      (goto-char (point-min))
      (let ((case-fold-search t) s)
***************
*** 5664,5670 ****
  UP/DOWN=headline   TAB=cycle visibility  [Q]uit   RET/<left>/<right>=Store
  RET at beg-of-buf -> Append to file as level 2 headline
  RET on headline   -> Store as sublevel entry to current headline
! <left>/<right>    -> before/after current headline, same headings level")
  
  ;;;###autoload
  (defun org-remember-handler ()
--- 5663,5669 ----
  UP/DOWN=headline   TAB=cycle visibility  [Q]uit   RET/<left>/<right>=Store
  RET at beg-of-buf -> Append to file as level 2 headline
  RET on headline   -> Store as sublevel entry to current headline
! <left>/<right>    -> Before/after current headline, same headings level")
  
  ;;;###autoload
  (defun org-remember-handler ()
***************
*** 5699,5705 ****
  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'."  
    (catch 'quit
      (let* ((txt (buffer-substring (point-min) (point-max)))
             (fastp current-prefix-arg)
--- 5698,5704 ----
  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'."
    (catch 'quit
      (let* ((txt (buffer-substring (point-min) (point-max)))
             (fastp current-prefix-arg)
***************
*** 5874,5880 ****
  The region goes from BEG0 to END0, but these borders will be moved
  slightly, to make sure a beginning of line in the first line is included.
  When NSPACE is non-nil, it indicates the minimum number of spaces that
! separate columns (default: just one space)"
    (let* ((beg (min beg0 end0))
           (end (max beg0 end0))
           (tabsep t)
--- 5873,5879 ----
  The region goes from BEG0 to END0, but these borders will be moved
  slightly, to make sure a beginning of line in the first line is included.
  When NSPACE is non-nil, it indicates the minimum number of spaces that
! separate columns (default: just one space)."
    (let* ((beg (min beg0 end0))
           (end (max beg0 end0))
           (tabsep t)
***************
*** 6207,6213 ****
  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.  
  If the variable `org-table-copy-increment' is non-nil and the field is an
  integer, it will be incremented while copying."
    (interactive "p")
--- 6206,6212 ----
  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.
  If the variable `org-table-copy-increment' is non-nil and the field is an
  integer, it will be incremented while copying."
    (interactive "p")
***************
*** 6305,6311 ****
  (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. 
  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)))
--- 6304,6310 ----
  (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.
  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)))
***************
*** 6326,6332 ****
  
  (defun org-at-table-p (&optional table-type)
    "Return t if the cursor is inside an org-type table.
! If TABLE-TYPE is non-nil, also chack for table.el-type tables."
    (if org-enable-table-editor
        (save-excursion
          (beginning-of-line 1)
--- 6325,6331 ----
  
  (defun org-at-table-p (&optional table-type)
    "Return t if the cursor is inside an org-type table.
! If TABLE-TYPE is non-nil, also check for table.el-type tables."
    (if org-enable-table-editor
        (save-excursion
          (beginning-of-line 1)
***************
*** 6490,6500 ****
      (org-table-modify-formulas 'swap col (if left (1- col) (1+ col)))))
  
  (defun org-table-move-row-down ()
!   "move table row down."
    (interactive)
    (org-table-move-row nil))
  (defun org-table-move-row-up ()
!   "move table row up."
    (interactive)
    (org-table-move-row 'up))
  
--- 6489,6499 ----
      (org-table-modify-formulas 'swap col (if left (1- col) (1+ col)))))
  
  (defun org-table-move-row-down ()
!   "Move table row down."
    (interactive)
    (org-table-move-row nil))
  (defun org-table-move-row-up ()
!   "Move table row up."
    (interactive)
    (org-table-move-row 'up))
  
***************
*** 6590,6596 ****
  (defun org-table-copy-region (beg end &optional cut)
    "Copy rectangular region in table to clipboard.
  A special clipboard is used which can only be accessed
! with `org-table-paste-rectangle'"
    (interactive "rP")
    (let* (l01 c01 l02 c02 l1 c1 l2 c2 ic1 ic2
           region cols
--- 6589,6595 ----
  (defun org-table-copy-region (beg end &optional cut)
    "Copy rectangular region in table to clipboard.
  A special clipboard is used which can only be accessed
! with `org-table-paste-rectangle'."
    (interactive "rP")
    (let* (l01 c01 l02 c02 l1 c1 l2 c2 ic1 ic2
           region cols
***************
*** 6598,6604 ****
      (goto-char beg)
      (org-table-check-inside-data-field)
      (setq l01 (count-lines (point-min) (point))
!           c01 (org-table-current-column)) 
      (goto-char end)
      (org-table-check-inside-data-field)
      (setq l02 (count-lines (point-min) (point))
--- 6597,6603 ----
      (goto-char beg)
      (org-table-check-inside-data-field)
      (setq l01 (count-lines (point-min) (point))
!           c01 (org-table-current-column))
      (goto-char end)
      (org-table-check-inside-data-field)
      (setq l02 (count-lines (point-min) (point))
***************
*** 6620,6626 ****
      (setq org-table-clip (nreverse region))
      (if cut (org-table-align))
      org-table-clip))
!   
  (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
--- 6619,6625 ----
      (setq org-table-clip (nreverse region))
      (if cut (org-table-align))
      org-table-clip))
! 
  (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
***************
*** 6731,6737 ****
                               (+ (length org-table-clip) arg)
                             arg)
                         (length org-table-clip)))
!         (setq org-table-clip 
                (mapcar 'list (org-wrap (mapconcat 'car org-table-clip " ")
                                        nil nlines)))
          (goto-char beg)
--- 6730,6736 ----
                               (+ (length org-table-clip) arg)
                             arg)
                         (length org-table-clip)))
!         (setq org-table-clip
                (mapcar 'list (org-wrap (mapconcat 'car org-table-clip " ")
                                        nil nlines)))
          (goto-char beg)
***************
*** 6787,6793 ****
                 (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."
--- 6786,6792 ----
                 (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."
***************
*** 6851,6857 ****
    "Toggle the visibility of table vertical lines.
  The effect is immediate and on all tables in the file.
  With prefix ARG, make lines invisible when ARG is positive, make lines
! visible when ARG is not positive"
    (interactive "P")
    (let ((action (cond
                   ((and arg (> (prefix-numeric-value arg) 0)) 'on)
--- 6850,6856 ----
    "Toggle the visibility of table vertical lines.
  The effect is immediate and on all tables in the file.
  With prefix ARG, make lines invisible when ARG is positive, make lines
! visible when ARG is not positive."
    (interactive "P")
    (let ((action (cond
                   ((and arg (> (prefix-numeric-value arg) 0)) 'on)
***************
*** 7003,7009 ****
              "\n")))
  
  (defun org-table-get-stored-formulas ()
!   "Return an alist withh the t=stored formulas directly after current table."
    (interactive)
    (let (col eq eq-alist strings string)
      (save-excursion
--- 7002,7008 ----
              "\n")))
  
  (defun org-table-get-stored-formulas ()
!   "Return an alist with the stored formulas directly after current table."
    (interactive)
    (let (col eq eq-alist strings string)
      (save-excursion
***************
*** 7069,7075 ****
    "Alist with parameter names, derived from the `$' line.")
  
  (defun org-table-get-specials ()
!   "Get the column nmaes and local parameters for this table."
    (save-excursion
      (let ((beg (org-table-begin)) (end (org-table-end))
            names name fields field cnt)
--- 7068,7074 ----
    "Alist with parameter names, derived from the `$' line.")
  
  (defun org-table-get-specials ()
!   "Get the column names and local parameters for this table."
    (save-excursion
      (let ((beg (org-table-begin)) (end (org-table-end))
            names name fields field cnt)
***************
*** 7115,7128 ****
                    dfield (match-string 1 dfield)))
          (cond
           ((equal dfield "=sumh")
!           (org-table-get-field 
             nil (org-table-sum
                  (save-excursion (org-table-goto-column 1) (point))
                  (point) nlast)))
           ((member dfield '("=sum" "=sumv"))
            (setq col (org-table-current-column)
                  bolpos (point-at-bol))
!           (org-table-get-field 
             nil (org-table-sum
                  (save-excursion
                    (goto-char (org-table-begin))
--- 7114,7127 ----
                    dfield (match-string 1 dfield)))
          (cond
           ((equal dfield "=sumh")
!           (org-table-get-field
             nil (org-table-sum
                  (save-excursion (org-table-goto-column 1) (point))
                  (point) nlast)))
           ((member dfield '("=sum" "=sumv"))
            (setq col (org-table-current-column)
                  bolpos (point-at-bol))
!           (org-table-get-field
             nil (org-table-sum
                  (save-excursion
                    (goto-char (org-table-begin))
***************
*** 7144,7150 ****
    :type 'boolean)
  
  (defvar org-recalc-commands nil
!   "List of commands triggering the reccalculation of a line.
  Will be filled automatically during use.")
  
  (defvar org-recalc-marks
--- 7143,7149 ----
    :type 'boolean)
  
  (defvar org-recalc-commands nil
!   "List of commands triggering the recalculation of a line.
  Will be filled automatically during use.")
  
  (defvar org-recalc-marks
***************
*** 7194,7203 ****
      (setq epos (point-at-eol))
      (save-excursion
        (beginning-of-line 1)
!       (org-table-get-field 
         1 (if (looking-at "^[ \t]*| *\\([#!$* ]\\) *|")
               (concat " "
!                      (setq new (or forcenew 
                                     (cadr (member (match-string 1) marks))))
                       " ")
             " # ")))
--- 7193,7202 ----
      (setq epos (point-at-eol))
      (save-excursion
        (beginning-of-line 1)
!       (org-table-get-field
         1 (if (looking-at "^[ \t]*| *\\([#!$* ]\\) *|")
               (concat " "
!                      (setq new (or forcenew
                                     (cadr (member (match-string 1) marks))))
                       " ")
             " # ")))
***************
*** 7266,7272 ****
    $1+$2;%.2f          Same, and format result to two digits after dec.point
    exp($2)+exp($1)     Math functions can be used
    $;%.1f              Reformat current cell to 1 digit after dec.point
!   ($3-32)*5/9         degrees F -> C conversion
  
  When called with a raw \\[universal-argument] prefix, the formula is applied 
to the current
  field, and to the same same column in all following rows, until reaching a
--- 7265,7271 ----
    $1+$2;%.2f          Same, and format result to two digits after dec.point
    exp($2)+exp($1)     Math functions can be used
    $;%.1f              Reformat current cell to 1 digit after dec.point
!   ($3-32)*5/9         Degrees F -> C conversion
  
  When called with a raw \\[universal-argument] prefix, the formula is applied 
to the current
  field, and to the same same column in all following rows, until reaching a
***************
*** 7306,7312 ****
                    n (string-to-number (or (match-string 1 fmt) "")))
              (if (= c ?p) (org-set-calc-mode 'calc-internal-prec n)
                (org-set-calc-mode 'calc-float-format
!                                  (list (cdr (assoc c '((?n. float) (?f. fix) 
                                                         (?s. sci) (?e. eng))))
                                         n)))
              (setq fmt (replace-match "" t t fmt)))
--- 7305,7311 ----
                    n (string-to-number (or (match-string 1 fmt) "")))
              (if (= c ?p) (org-set-calc-mode 'calc-internal-prec n)
                (org-set-calc-mode 'calc-float-format
!                                  (list (cdr (assoc c '((?n. float) (?f. fix)
                                                         (?s. sci) (?e. eng))))
                                         n)))
              (setq fmt (replace-match "" t t fmt)))
***************
*** 7350,7356 ****
  
        (when org-table-formula-debug
          (with-output-to-temp-buffer "*Help*"
!           (princ (format "Substitution history of formula                   
  Orig:   %s
  $xyz->  %s
  $1->    %s\n" orig formula form))
--- 7349,7355 ----
  
        (when org-table-formula-debug
          (with-output-to-temp-buffer "*Help*"
!           (princ (format "Substitution history of formula
  Orig:   %s
  $xyz->  %s
  $1->    %s\n" orig formula form))
***************
*** 7429,7435 ****
          (and all (message "Re-applying formulas to %d lines...done" cnt)))))
  
  (defun org-table-formula-substitute-names (f)
!   "Replace $const with values in stirng F."
    (let ((start 0) a n1 n2 nn1 nn2 s (f1 f))
      ;; First, check for column names
      (while (setq start (string-match org-table-column-name-regexp f start))
--- 7428,7434 ----
          (and all (message "Re-applying formulas to %d lines...done" cnt)))))
  
  (defun org-table-formula-substitute-names (f)
!   "Replace $const with values in string F."
    (let ((start 0) a n1 n2 nn1 nn2 s (f1 f))
      ;; First, check for column names
      (while (setq start (string-match org-table-column-name-regexp f start))
***************
*** 7451,7457 ****
      (setq start 0)
      (while (setq start (string-match "\\$\\([a-zA-Z][a-zA-Z0-9]*\\)" f start))
        (setq start (1+ start))
!       (if (setq a (save-match-data 
                      (org-table-get-constant (match-string 1 f))))
            (setq f (replace-match (concat "(" a ")") t t f))))
      (if org-table-formula-debug
--- 7450,7456 ----
      (setq start 0)
      (while (setq start (string-match "\\$\\([a-zA-Z][a-zA-Z0-9]*\\)" f start))
        (setq start (1+ start))
!       (if (setq a (save-match-data
                      (org-table-get-constant (match-string 1 f))))
            (setq f (replace-match (concat "(" a ")") t t f))))
      (if org-table-formula-debug
***************
*** 7523,7529 ****
  
  ;;;###autoload
  (defun orgtbl-mode (&optional arg)
!   "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
--- 7522,7528 ----
  
  ;;;###autoload
  (defun orgtbl-mode (&optional arg)
!   "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
***************
*** 7545,7551 ****
            (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 
                     (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp)
                   "[ \t]*|"))
            (easy-menu-add orgtbl-mode-menu)
--- 7544,7550 ----
            (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
                     (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp)
                   "[ \t]*|"))
            (easy-menu-add orgtbl-mode-menu)
***************
*** 7562,7572 ****
  
  (defun orgtbl-make-binding (fun n &rest keys)
    "Create a function for binding in the table minor mode.
! FUN is the command to call inside a table. N is used to create a unique
! command name. KEYS are keys that should be checked in for a command
  to execute outside of tables."
    (eval
!    (list 'defun 
           (intern (concat "orgtbl-hijacker-command-" (int-to-string n)))
           '(arg)
           (concat "In tables, run `" (symbol-name fun) "'.\n"
--- 7561,7571 ----
  
  (defun orgtbl-make-binding (fun n &rest keys)
    "Create a function for binding in the table minor mode.
! FUN is the command to call inside a table.  N is used to create a unique
! command name.  KEYS are keys that should be checked in for a command
  to execute outside of tables."
    (eval
!    (list 'defun
           (intern (concat "orgtbl-hijacker-command-" (int-to-string n)))
           '(arg)
           (concat "In tables, run `" (symbol-name fun) "'.\n"
***************
*** 7588,7594 ****
  (defun orgtbl-error ()
    "Error when there is no default binding for a table key."
    (interactive)
!   (error "This key is has no function outside tables"))
  
  (defun orgtbl-setup ()
    "Setup orgtbl keymaps."
--- 7587,7593 ----
  (defun orgtbl-error ()
    "Error when there is no default binding for a table key."
    (interactive)
!   (error "This key has no function outside tables"))
  
  (defun orgtbl-setup ()
    "Setup orgtbl keymaps."
***************
*** 7628,7638 ****
              cmd (orgtbl-make-binding fun nfunc key))
        (define-key orgtbl-mode-map key cmd))
      ;; Special treatment needed for TAB and RET
!     (define-key orgtbl-mode-map [(return)] 
        (orgtbl-make-binding 'orgtbl-ret 100 [(return)] "\C-m"))
!     (define-key orgtbl-mode-map "\C-m" 
        (orgtbl-make-binding 'orgtbl-ret 101 "\C-m" [(return)]))
!     (define-key orgtbl-mode-map [(tab)] 
        (orgtbl-make-binding 'orgtbl-tab 102 [(tab)] "\C-i"))
      (define-key orgtbl-mode-map "\C-i"
        (orgtbl-make-binding 'orgtbl-tab 103 "\C-i" [(tab)])))
--- 7627,7637 ----
              cmd (orgtbl-make-binding fun nfunc key))
        (define-key orgtbl-mode-map key cmd))
      ;; Special treatment needed for TAB and RET
!     (define-key orgtbl-mode-map [(return)]
        (orgtbl-make-binding 'orgtbl-ret 100 [(return)] "\C-m"))
!     (define-key orgtbl-mode-map "\C-m"
        (orgtbl-make-binding 'orgtbl-ret 101 "\C-m" [(return)]))
!     (define-key orgtbl-mode-map [(tab)]
        (orgtbl-make-binding 'orgtbl-tab 102 [(tab)] "\C-i"))
      (define-key orgtbl-mode-map "\C-i"
        (orgtbl-make-binding 'orgtbl-tab 103 "\C-i" [(tab)])))
***************
*** 7680,7686 ****
          ["Recalculate line" org-table-recalculate :active (org-at-table-p) 
:keys "C-c *"]
          ["Recalculate all" (org-table-recalculate '(4)) :active 
(org-at-table-p) :keys "C-u C-c *"]
          ["Toggle Recalculate Mark" org-table-rotate-recalc-marks :active 
(org-at-table-p) :keys "C-c #"]
!         ["Sum Column/Rectangle" org-table-sum 
           :active (or (org-at-table-p) (org-region-active-p)) :keys "C-c +"]
          ["Which Column?" org-table-current-column :active (org-at-table-p) 
:keys "C-c ?"]
          ["Debug Formulas"
--- 7679,7685 ----
          ["Recalculate line" org-table-recalculate :active (org-at-table-p) 
:keys "C-c *"]
          ["Recalculate all" (org-table-recalculate '(4)) :active 
(org-at-table-p) :keys "C-u C-c *"]
          ["Toggle Recalculate Mark" org-table-rotate-recalc-marks :active 
(org-at-table-p) :keys "C-c #"]
!         ["Sum Column/Rectangle" org-table-sum
           :active (or (org-at-table-p) (org-region-active-p)) :keys "C-c +"]
          ["Which Column?" org-table-current-column :active (org-at-table-p) 
:keys "C-c ?"]
          ["Debug Formulas"
***************
*** 8262,8268 ****
    (let* ((filename (concat (file-name-sans-extension (buffer-file-name))
                             ".txt"))
           (buffer (find-file-noselect filename))
!          (ore (concat 
                 (org-make-options-regexp
                  '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO"
                    "STARTUP" "ARCHIVE"
--- 8261,8267 ----
    (let* ((filename (concat (file-name-sans-extension (buffer-file-name))
                             ".txt"))
           (buffer (find-file-noselect filename))
!          (ore (concat
                 (org-make-options-regexp
                  '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO"
                    "STARTUP" "ARCHIVE"
***************
*** 8494,8500 ****
                             ;; This is a headline
                             (progn
                               (setq level (- (match-end 1) (match-beginning 1))
!                                    txt (save-match-data 
                                           (org-html-expand
                                            (match-string 3 line)))
                                     todo
--- 8493,8499 ----
                             ;; This is a headline
                             (progn
                               (setq level (- (match-end 1) (match-beginning 1))
!                                    txt (save-match-data
                                           (org-html-expand
                                            (match-string 3 line)))
                                     todo
***************
*** 8681,8687 ****
          (org-format-table-table-html-using-table-generate-source olines)))))
  
  (defun org-format-org-table-html (lines)
!   "Format a table into html."
    (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines)))
    (setq lines (nreverse lines))
    (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines)))
--- 8680,8686 ----
          (org-format-table-table-html-using-table-generate-source olines)))))
  
  (defun org-format-org-table-html (lines)
!   "Format a table into HTML."
    (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines)))
    (setq lines (nreverse lines))
    (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines)))
***************
*** 8724,8730 ****
      newstr))
  
  (defun org-format-table-table-html (lines)
!   "Format a table generated by table.el into html.
  This conversion does *not* use `table-generate-source' from table.el.
  This has the advantage that Org-mode's HTML conversions can be used.
  But it has the disadvantage, that no cell- or row-spanning is allowed."
--- 8723,8729 ----
      newstr))
  
  (defun org-format-table-table-html (lines)
!   "Format a table generated by table.el into HTML.
  This conversion does *not* use `table-generate-source' from table.el.
  This has the advantage that Org-mode's HTML conversions can be used.
  But it has the disadvantage, that no cell- or row-spanning is allowed."
***************
*** 8768,8774 ****
      html))
  
  (defun org-format-table-table-html-using-table-generate-source (lines)
!   "Format a table into html, using `table-generate-source' from table.el.
  This has the advantage that cell- or row-spanning is allowed.
  But it has the disadvantage, that Org-mode's HTML conversions cannot be used."
    (require 'table)
--- 8767,8773 ----
      html))
  
  (defun org-format-table-table-html-using-table-generate-source (lines)
!   "Format a table into HTML, using `table-generate-source' from table.el.
  This has the advantage that cell- or row-spanning is allowed.
  But it has the disadvantage, that Org-mode's HTML conversions cannot be used."
    (require 'table)
***************
*** 9109,9115 ****
    (if (and (org-table-p)
             (eq N 1)
             (string-match "|" (buffer-substring (point-at-bol) (point)))
!            (looking-at ".*?|"))           
        (let ((pos (point)))
          (backward-delete-char N)
          (skip-chars-forward "^|")
--- 9108,9114 ----
    (if (and (org-table-p)
             (eq N 1)
             (string-match "|" (buffer-substring (point-at-bol) (point)))
!            (looking-at ".*?|"))
        (let ((pos (point)))
          (backward-delete-char N)
          (skip-chars-forward "^|")
***************
*** 9241,9247 ****
  (defun org-copy-special ()
    "Call either `org-table-copy' or `org-copy-subtree'."
    (interactive)
!   (call-interactively 
     (if (org-at-table-p) 'org-table-copy-region 'org-copy-subtree)))
  
  (defun org-cut-special ()
--- 9240,9246 ----
  (defun org-copy-special ()
    "Call either `org-table-copy' or `org-copy-subtree'."
    (interactive)
!   (call-interactively
     (if (org-at-table-p) 'org-table-copy-region 'org-copy-subtree)))
  
  (defun org-cut-special ()
***************
*** 9262,9268 ****
  When the cursor is inside a table created by the table.el package,
  activate that table.  Otherwise, if the cursor is at a normal table
  created with org.el, re-align that table.  This command works even if
! the automatic table editor has been turned off. 
  If the cursor is in one of the special #+KEYWORD lines, this triggers
  scanning the buffer for these lines and updating the information."
    (interactive "P")
--- 9261,9267 ----
  When the cursor is inside a table created by the table.el package,
  activate that table.  Otherwise, if the cursor is at a normal table
  created with org.el, re-align that table.  This command works even if
! the automatic table editor has been turned off.
  If the cursor is in one of the special #+KEYWORD lines, this triggers
  scanning the buffer for these lines and updating the information."
    (interactive "P")
***************
*** 9351,9357 ****
       ["Recalculate line" org-table-recalculate (org-at-table-p)]
       ["Recalculate all" (lambda () (interactive) (org-table-recalculate 
'(4))) :active (org-at-table-p) :keys "C-u C-c *"]
       ["Toggle Recalculate Mark" org-table-rotate-recalc-marks 
(org-at-table-p)]
!      ["Sum Column/Rectangle" org-table-sum 
        (or (org-at-table-p) (org-region-active-p))]
       ["Which Column?" org-table-current-column (org-at-table-p)])
      ["Debug Formulas"
--- 9350,9356 ----
       ["Recalculate line" org-table-recalculate (org-at-table-p)]
       ["Recalculate all" (lambda () (interactive) (org-table-recalculate 
'(4))) :active (org-at-table-p) :keys "C-u C-c *"]
       ["Toggle Recalculate Mark" org-table-rotate-recalc-marks 
(org-at-table-p)]
!      ["Sum Column/Rectangle" org-table-sum
        (or (org-at-table-p) (org-region-active-p))]
       ["Which Column?" org-table-current-column (org-at-table-p)])
      ["Debug Formulas"
***************
*** 9461,9470 ****
    (Info-goto-node (format "(org)%s" (or node ""))))
  
  (defun org-install-agenda-files-menu ()
!   (easy-menu-change 
     '("Org") "File List for Agenda"
     (append
!     (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]
--- 9460,9469 ----
    (Info-goto-node (format "(org)%s" (or node ""))))
  
  (defun org-install-agenda-files-menu ()
!   (easy-menu-change
     '("Org") "File List for Agenda"
     (append
!     (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]
***************
*** 9474,9480 ****
  ;;; Documentation
  
  (defun org-customize ()
!   "Call the customize function with org as argument."
    (interactive)
    (customize-browse 'org))
  
--- 9473,9479 ----
  ;;; Documentation
  
  (defun org-customize ()
!   "Call the customize function with `org' as argument."
    (interactive)
    (customize-browse 'org))
  
***************
*** 9579,9585 ****
  ;; 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 
  ;; where this is important are the font-lock-keywords.  Search for
  ;; `org-noutline-p' to find it.
  
--- 9578,9584 ----
  ;; 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
  ;; where this is important are the font-lock-keywords.  Search for
  ;; `org-noutline-p' to find it.
  
***************
*** 9613,9619 ****
        (equal (char-before) ?\r))))
  
  (defun org-back-to-heading (&optional invisible-ok)
!   "Move to previous heading line, or beg of this line if it's a heading.
  Only visible heading lines are considered, unless INVISIBLE-OK is non-nil."
    (if org-noutline-p
        (outline-back-to-heading invisible-ok)
--- 9612,9618 ----
        (equal (char-before) ?\r))))
  
  (defun org-back-to-heading (&optional invisible-ok)
!   "Move to previous heading line, or beginning of this line if it's a heading.
  Only visible heading lines are considered, unless INVISIBLE-OK is non-nil."
    (if org-noutline-p
        (outline-back-to-heading invisible-ok)
***************
*** 9644,9650 ****
  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) 
            (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)
--- 9643,9649 ----
  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)
            (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)
***************
*** 9700,9707 ****
  
  (defun org-show-subtree ()
    "Show everything after this heading at deeper levels."
!   (outline-flag-region 
!    (point) 
     (save-excursion
       (outline-end-of-subtree) (outline-next-heading) (point))
     (if org-noutline-p nil ?\n)))
--- 9699,9706 ----
  
  (defun org-show-subtree ()
    "Show everything after this heading at deeper levels."
!   (outline-flag-region
!    (point)
     (save-excursion
       (outline-end-of-subtree) (outline-next-heading) (point))
     (if org-noutline-p nil ?\n)))
***************
*** 9712,9718 ****
    (interactive)
    (save-excursion
      (org-back-to-heading t)
!     (outline-flag-region 
       (1- (point))
       (save-excursion
         (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") nil 'move)
--- 9711,9717 ----
    (interactive)
    (save-excursion
      (org-back-to-heading t)
!     (outline-flag-region
       (1- (point))
       (save-excursion
         (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") nil 'move)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]