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: Carsten Dominik
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/org.el
Date: Fri, 23 Sep 2005 11:45:40 -0400

Index: emacs/lisp/textmodes/org.el
diff -c emacs/lisp/textmodes/org.el:1.37 emacs/lisp/textmodes/org.el:1.38
*** emacs/lisp/textmodes/org.el:1.37    Wed Sep 21 11:40:15 2005
--- emacs/lisp/textmodes/org.el Fri Sep 23 15:45:39 2005
***************
*** 5,11 ****
  ;; Author: Carsten Dominik <dominik at science dot uva dot nl>
  ;; Keywords: outlines, hypermedia, calendar
  ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
! ;; Version: 3.15
  ;;
  ;; This file is part of GNU Emacs.
  ;;
--- 5,11 ----
  ;; Author: Carsten Dominik <dominik at science dot uva dot nl>
  ;; Keywords: outlines, hypermedia, calendar
  ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
! ;; Version: 3.16
  ;;
  ;; This file is part of GNU Emacs.
  ;;
***************
*** 80,85 ****
--- 80,96 ----
  ;;
  ;; Changes:
  ;; -------
+ ;; Version 3.16
+ ;;    - In tables, directly after the field motion commands like TAB and RET,
+ ;;      typing a character will blank the field.  Can be turned off with
+ ;;      variable `org-table-auto-blank-field'.
+ ;;    - Inactive timestamps with `C-c !'.  These do not trigger the agenda
+ ;;      and are not linked to the calendar.
+ ;;    - Additional key bindings to allow Org-mode to function on a tty emacs.
+ ;;    - `C-c C-h' prefix key replaced by `C-c C-x', and `C-c C-x C-h' replaced
+ ;;      by `C-c C-x b' (b=Browser).  This was necessary to recover the
+ ;;      standard meaning of C-h after a prefix key (show prefix bindings).
+ ;;
  ;; Version 3.15
  ;;    - QUOTE keyword at the beginning of an entry causes fixed-width export
  ;;      of unmodified entry text. `C-c :' toggles this keyword.
***************
*** 199,205 ****
  
  ;;; Customization variables
  
! (defvar org-version "3.15"
    "The version number of the file org.el.")
  (defun org-version ()
    (interactive)
--- 210,216 ----
  
  ;;; Customization variables
  
! (defvar org-version "3.16"
    "The version number of the file org.el.")
  (defun org-version ()
    (interactive)
***************
*** 843,848 ****
--- 854,866 ----
    :group 'org-structure
    :type 'hook)
  
+ (defcustom org-level-color-stars-only nil
+   "Non-nil means fontify only the stars in each headline.
+ When nil, the entire headline is fontified.
+ After changin this, requires restart of Emacs to become effective."
+   :group 'org-structure
+   :type 'boolean)
+ 
  (defcustom org-adapt-indentation t
    "Non-nil means, adapt indentation when promoting and demoting.
  When this is set and the *entire* text in an entry is indented, the
***************
*** 852,857 ****
--- 870,883 ----
    :group 'org-structure
    :type 'boolean)
  
+ (defcustom org-enable-fixed-width-editor t
+   "Non-nil means, lines starting with \":\" are treated as fixed-width.
+ This currently only means, they are never auto-wrapped.
+ When nil, such lines will be treated like ordinary lines.
+ See also the QUOTE keyword."
+   :group 'org-structure
+   :type 'boolean)
+ 
  (defcustom org-cycle-emulate-tab t
    "Where should `org-cycle' emulate TAB.
  nil    Never
***************
*** 1155,1178 ****
    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
  very good at guessing when a re-align will be necessary, but you can always
! force one with `C-c C-c'.
  
  If you would like to use the optimized version in Org-mode, but the
  un-optimized version in OrgTbl-mode, see the variable `orgtbl-optimized'.
  
  This variable can be used to turn on and off the table editor during a 
session,
! but in order to toggle optimization, a restart is required."
    :group 'org-table
    :type '(choice
          (const :tag "off" nil)
          (const :tag "on" t)
          (const :tag "on, optimized" optimized)))
  
  (defcustom org-table-default-size "5x2"
    "The default size for newly created tables, Columns x Rows."
    :group 'org-table
--- 1181,1214 ----
    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
  very good at guessing when a re-align will be necessary, but you can always
! force one with \\[org-ctrl-c-ctrl-c].
  
  If you would like to use the optimized version in Org-mode, but the
  un-optimized version in OrgTbl-mode, see the variable `orgtbl-optimized'.
  
  This variable can be used to turn on and off the table editor during a 
session,
! but in order to toggle optimization, a restart is required.
! 
! See also the variable `org-table-auto-blank-field'."
    :group 'org-table
    :type '(choice
          (const :tag "off" nil)
          (const :tag "on" t)
          (const :tag "on, optimized" optimized)))
  
+ (defcustom org-table-auto-blank-field t
+   "Non-nil means, automatically blank table field when starting to type into 
it.
+ This only happens when typing immediately after a field motion
+ command (TAB, S-TAB or RET).
+ Only relevant when `org-enable-table-editor' is equal to `optimized'."
+   :group 'org-table
+   :type 'boolean)
+ 
  (defcustom org-table-default-size "5x2"
    "The default size for newly created tables, Columns x Rows."
    :group 'org-table
***************
*** 1248,1261 ****
    :group 'org-table
    :type 'boolean)
  
- ;; FIXME: Should this one be in another group?  Which one?
- (defcustom org-enable-fixed-width-editor t
-   "Non-nil means, lines starting with \":\" are treated as fixed-width.
- This currently only means, they are never auto-wrapped.
- When nil, such lines will be treated like ordinary lines."
-   :group 'org-table
-   :type 'boolean)
- 
  (defgroup org-table-calculation nil
    "Options concerning tables in Org-mode."
    :tag "Org Table Calculation"
--- 1284,1289 ----
***************
*** 1978,1994 ****
         (append
          (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)
                              nil t)))
!           '(("^\\(\\(\\*+\\)[^\r\n]*\\)[\n\r]"
!              (1 (nth (% (- (match-end 2) (match-beginning 2) 1)
!                         org-n-levels)
!                      org-level-faces)
!                 nil t))))
          org-font-lock-extra-keywords))
      (set (make-local-variable 'font-lock-defaults)
         '(org-font-lock-keywords t nil nil backward-paragraph))
--- 2006,2024 ----
         (append
          (if org-noutline-p     ; FIXME:  I am not sure if eval will work
                                 ; on XEmacs if noutline is ever ported
!             `((eval . (list "^\\(\\*+\\).*"
!                             ,(if org-level-color-stars-only 1 0)
!                             '(nth   ;; FIXME:  1<->0 ????
                                  (% (- (match-end 1) (match-beginning 1) 1)
                                     org-n-levels)
                                  org-level-faces)
                              nil t)))
!           `(("^\\(\\(\\*+\\)[^\r\n]*\\)[\n\r]"
!              (,(if org-level-color-stars-only 2 0)
!               (nth (% (- (match-end 2) (match-beginning 2) 1)
!                       org-n-levels)
!                    org-level-faces)
!               nil t))))
          org-font-lock-extra-keywords))
      (set (make-local-variable 'font-lock-defaults)
         '(org-font-lock-keywords t nil nil backward-paragraph))
***************
*** 2806,2812 ****
                 (insert " "))
             (if (and (equal type :opt) (assoc completion table))
                 (message "%s" (substitute-command-keys
!                          "Press \\[org-complete] again to insert example 
settings"))))
            (t
             (message "Making completion list...")
             (let ((list (sort (all-completions pattern table) 'string<)))
--- 2836,2842 ----
                 (insert " "))
             (if (and (equal type :opt) (assoc completion table))
                 (message "%s" (substitute-command-keys
!                               "Press \\[org-complete] again to insert example 
settings"))))
            (t
             (message "Making completion list...")
             (let ((list (sort (all-completions pattern table) 'string<)))
***************
*** 2913,2919 ****
     (format-time-string (car org-time-stamp-formats)
                       (org-read-date nil 'to-time)))
    (message "%s" (substitute-command-keys
!           "Use \\[org-timestamp-up-day] and \\[org-timestamp-down-day] to 
change the date.")))
  
  (defun org-schedule ()
    "Insert the SCHEDULED: string to schedule a TODO item.
--- 2943,2949 ----
     (format-time-string (car org-time-stamp-formats)
                       (org-read-date nil 'to-time)))
    (message "%s" (substitute-command-keys
!                "Use \\[org-timestamp-up-day] and \\[org-timestamp-down-day] 
to change the date.")))
  
  (defun org-schedule ()
    "Insert the SCHEDULED: string to schedule a TODO item.
***************
*** 2925,2931 ****
     (format-time-string (car org-time-stamp-formats)
                       (org-read-date nil 'to-time)))
    (message "%s" (substitute-command-keys
!           "Use \\[org-timestamp-up-day] and \\[org-timestamp-down-day] to 
change the date.")))
  
  
  (defun org-occur (regexp &optional callback)
--- 2955,2961 ----
     (format-time-string (car org-time-stamp-formats)
                       (org-read-date nil 'to-time)))
    (message "%s" (substitute-command-keys
!                "Use \\[org-timestamp-up-day] and \\[org-timestamp-down-day] 
to change the date.")))
  
  
  (defun org-occur (regexp &optional callback)
***************
*** 3077,3082 ****
--- 3107,3127 ----
        (if org-time-was-given (setq fmt (cdr org-time-stamp-formats)))
        (insert (format-time-string fmt time))))))
  
+ (defun org-time-stamp-inactive (&optional arg)
+   "Insert an inactive time stamp.
+ An inactive time stamp is enclosed in square brackets instead of angle
+ brackets.  It is inactive in the sense that it does not trigger agenda 
entries,
+ does not link to the calendar and cannot be changed with the S-cursor keys."
+   (interactive "P")
+   (let ((fmt (if arg (cdr org-time-stamp-formats)
+              (car org-time-stamp-formats)))
+       (org-time-was-given nil)
+       time)
+     (setq time (org-read-date arg 'totime))
+     (if org-time-was-given (setq fmt (cdr org-time-stamp-formats)))
+     (setq fmt (concat "[" (substring fmt 1 -1) "]"))
+     (insert (format-time-string fmt time))))
+ 
  ;;; FIXME: Make the function take "Fri" as "next friday"
  (defun org-read-date (&optional with-time to-time)
    "Read a date and make things smooth for the user.
***************
*** 3539,3544 ****
--- 3584,3591 ----
  (define-key org-agenda-mode-map "w"        'org-agenda-week-view)
  (define-key org-agenda-mode-map (org-key 'S-right) 'org-agenda-date-later)
  (define-key org-agenda-mode-map (org-key 'S-left) 'org-agenda-date-earlier)
+ (define-key org-agenda-mode-map [?\C-c ?\C-x (right)] 'org-agenda-date-later)
+ (define-key org-agenda-mode-map [?\C-c ?\C-x (left)] 'org-agenda-date-earlier)
  
  (define-key org-agenda-mode-map ">" 'org-agenda-date-prompt)
  (let ((l '(1 2 3 4 5 6 7 8 9 0)))
***************
*** 3574,3579 ****
--- 3621,3628 ----
  (define-key org-agenda-mode-map "-" 'org-agenda-priority-down)
  (define-key org-agenda-mode-map (org-key 'S-up) 'org-agenda-priority-up)
  (define-key org-agenda-mode-map (org-key 'S-down) 'org-agenda-priority-down)
+ (define-key org-agenda-mode-map [?\C-c ?\C-x (up)] 'org-agenda-priority-up)
+ (define-key org-agenda-mode-map [?\C-c ?\C-x (down)] 
'org-agenda-priority-down)
  (define-key org-agenda-mode-map [(right)] 'org-agenda-later)
  (define-key org-agenda-mode-map [(left)] 'org-agenda-earlier)
  
***************
*** 6321,6327 ****
  
  (defun org-table-check-inside-data-field ()
    "Is point inside a table data field?
! I.e. not on a hline or before the first or after the last column?"
    (if (or (not (org-at-table-p))
          (= (org-table-current-column) 0)
          (org-at-table-hline-p)
--- 6370,6377 ----
  
  (defun org-table-check-inside-data-field ()
    "Is point inside a table data field?
! I.e. not on a hline or before the first or after the last column?
! This actually throws an error, so it aborts the current command."
    (if (or (not (org-at-table-p))
          (= (org-table-current-column) 0)
          (org-at-table-hline-p)
***************
*** 7014,7026 ****
                     (format "%d:%02d:%02d" h m s))))
        (kill-new sres)
        (if (interactive-p)
!           (message "%s"
!                    (concat
!                     (format "Sum of %d items: %-20s     "  (length numbers) 
sres)
!                     (substitute-command-keys
!                      "(\\[yank] will insert result into buffer)")
!                     ))
!         )
        sres))))
  
  (defun org-table-get-number-for-summing (s)
--- 7064,7073 ----
                     (format "%d:%02d:%02d" h m s))))
        (kill-new sres)
        (if (interactive-p)
!           (message "s"
!                    (substitute-command-keys
!                     (format "Sum of %d items: %-20s     (\\[yank] will insert 
result into buffer)"
!                             (length numbers) sres))))
        sres))))
  
  (defun org-table-get-number-for-summing (s)
***************
*** 7126,7132 ****
         (stored-list (org-table-get-stored-formulas))
         (stored (cdr (assoc scol stored-list)))
         (eq (cond
!             ((and stored equation (string-match "^ *= *$" equation))
               stored)
              ((stringp equation)
               equation)
--- 7173,7179 ----
         (stored-list (org-table-get-stored-formulas))
         (stored (cdr (assoc scol stored-list)))
         (eq (cond
!             ((and stored equation (string-match "^ *=? *$" equation))
               stored)
              ((stringp equation)
               equation)
***************
*** 7294,7300 ****
    (when org-table-formula-evaluate-inline
      (let* ((field (org-trim (or (org-table-get-field) "")))
           named eq)
!       (when (string-match "^:?=\\(.+\\)" field)
        (setq named (equal (string-to-char field) ?:)
              eq (match-string 1 field))
        (if (fboundp 'calc-eval)
--- 7341,7347 ----
    (when org-table-formula-evaluate-inline
      (let* ((field (org-trim (or (org-table-get-field) "")))
           named eq)
!       (when (string-match "^:?=\\(.*\\)" field)
        (setq named (equal (string-to-char field) ?:)
              eq (match-string 1 field))
        (if (fboundp 'calc-eval)
***************
*** 7916,7923 ****
          '("\C-c\M-w"           org-table-copy-region)
          '("\C-c\C-y"           org-table-paste-rectangle)
          '("\C-c-"              org-table-insert-hline)
!         '([(shift tab)]        org-table-previous-field)
!         '("\C-c\C-c"           org-ctrl-c-ctrl-c)
          '("\C-m"               org-table-next-row)
          (list (org-key 'S-return) 'org-table-copy-down)
          '([(meta return)]      org-table-wrap-region)
--- 7963,7969 ----
          '("\C-c\M-w"           org-table-copy-region)
          '("\C-c\C-y"           org-table-paste-rectangle)
          '("\C-c-"              org-table-insert-hline)
! ;       '([(shift tab)]        org-table-previous-field)
          '("\C-m"               org-table-next-row)
          (list (org-key 'S-return) 'org-table-copy-down)
          '([(meta return)]      org-table-wrap-region)
***************
*** 7946,7961 ****
        (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)])))
      (when orgtbl-optimized
        ;; If the user wants maximum table support, we need to hijack
        ;; some standard editing functions
!       (substitute-key-definition 'self-insert-command 
'orgtbl-self-insert-command
!                                orgtbl-mode-map global-map)
!       (substitute-key-definition 'delete-char 'orgtbl-delete-char
!                                orgtbl-mode-map global-map)
!       (substitute-key-definition 'delete-backward-char 
'orgtbl-delete-backward-char
!                                orgtbl-mode-map global-map)
!       (define-key org-mode-map "|" 'self-insert-command))
      (easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu"
        '("OrgTbl"
        ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"]
--- 7992,8009 ----
        (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)])))
+     (define-key orgtbl-mode-map "\C-i"
+       (orgtbl-make-binding 'orgtbl-tab 104 [(shift tab)]))
+     (define-key orgtbl-mode-map "\C-c\C-c"
+       (orgtbl-make-binding 'org-ctrl-c-ctrl-c 105 "\C-c\C-c"))
      (when orgtbl-optimized
        ;; If the user wants maximum table support, we need to hijack
        ;; some standard editing functions
!       (org-remap orgtbl-mode-map
!                'self-insert-command 'orgtbl-self-insert-command
!                'delete-char 'orgtbl-delete-char
!                'delete-backward-char 'orgtbl-delete-backward-char)
!       (define-key orgtbl-mode-map "|" 'org-force-self-insert))
      (easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu"
        '("OrgTbl"
        ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"]
***************
*** 7980,7988 ****
         "--"
         ["Insert Hline" org-table-insert-hline :active (org-at-table-p) :keys 
"C-c -"])
        ("Rectangle"
!        ["Copy Rectangle" org-copy-special :active (org-at-table-p) :keys "C-c 
M-w"]
!        ["Cut Rectangle" org-cut-special :active (org-at-table-p) :keys "C-c 
C-w"]
!        ["Paste Rectangle" org-paste-special :active (org-at-table-p) :keys 
"C-c C-y"]
         ["Fill Rectangle" org-table-wrap-region :active (org-at-table-p) :keys 
"C-c C-q"])
        "--"
        ["Set Column Formula" org-table-eval-formula :active (org-at-table-p) 
:keys "C-c ="]
--- 8028,8036 ----
         "--"
         ["Insert Hline" org-table-insert-hline :active (org-at-table-p) :keys 
"C-c -"])
        ("Rectangle"
!        ["Copy Rectangle" org-copy-special :active (org-at-table-p) :keys "C-c 
C-x M-w"]
!        ["Cut Rectangle" org-cut-special :active (org-at-table-p) :keys "C-c 
C-x C-w"]
!        ["Paste Rectangle" org-paste-special :active (org-at-table-p) :keys 
"C-c C-x C-y"]
         ["Fill Rectangle" org-table-wrap-region :active (org-at-table-p) :keys 
"C-c C-q"])
        "--"
        ["Set Column Formula" org-table-eval-formula :active (org-at-table-p) 
:keys "C-c ="]
***************
*** 8018,8023 ****
--- 8066,8082 ----
  overwritten, and the table is not marked as requiring realignment."
    (interactive "p")
    (if (and (org-at-table-p)
+          (or
+           (and org-table-auto-blank-field
+                (member last-command
+                        '(orgtbl-hijacker-command-100
+                          orgtbl-hijacker-command-101
+                          orgtbl-hijacker-command-102
+                          orgtbl-hijacker-command-103
+                          orgtbl-hijacker-command-104
+                          orgtbl-hijacker-command-105))
+                (org-table-blank-field))
+           t)
           (eq N 1)
           (looking-at "[^|\n]*  +|"))
        (let (org-table-may-need-update)
***************
*** 8029,8034 ****
--- 8088,8098 ----
      (let (orgtbl-mode)
        (call-interactively (key-binding (vector last-input-event))))))
  
+ (defun org-force-self-insert (N)
+   "Needed to enforce self-insert under remapping."
+   (interactive "p")
+   (self-insert-command N))
+ 
  (defun orgtbl-delete-backward-char (N)
    "Like `delete-backward-char', insert whitespace at field end in tables.
  When deleting backwards, in tables this function will insert whitespace in
***************
*** 9344,9366 ****
  ;;                     i k                 @                                
expendable from outline-mode
  ;;   0123456789                          !    %^&     ()_{}    "      `'    
free
  
! (define-key org-mode-map "\C-i" 'org-cycle)
  (define-key org-mode-map [(meta tab)] 'org-complete)
! (define-key org-mode-map "\M-\C-i" 'org-complete)
! (define-key org-mode-map [(meta shift left)] 'org-shiftmetaleft)
! (define-key org-mode-map [(meta left)] 'org-metaleft)
! (define-key org-mode-map [(meta shift right)] 'org-shiftmetaright)
! (define-key org-mode-map [(meta shift up)] 'org-shiftmetaup)
! (define-key org-mode-map [(meta shift down)] 'org-shiftmetadown)
  (define-key org-mode-map [(meta right)] 'org-metaright)
! (define-key org-mode-map [(meta up)] 'org-metaup)
! (define-key org-mode-map [(meta down)] 'org-metadown)
! ;(define-key org-mode-map "\C-c\C-h\C-w" 'org-cut-subtree)
! ;(define-key org-mode-map "\C-c\C-h\M-w" 'org-copy-subtree)
! ;(define-key org-mode-map "\C-c\C-h\C-y" 'org-paste-subtree)
! (define-key org-mode-map "\C-c\C-h\C-w" 'org-cut-special)
! (define-key org-mode-map "\C-c\C-h\M-w" 'org-copy-special)
! (define-key org-mode-map "\C-c\C-h\C-y" 'org-paste-special)
  (define-key org-mode-map "\C-c$"    'org-archive-subtree)
  (define-key org-mode-map "\C-c\C-j" 'org-goto)
  (define-key org-mode-map "\C-c\C-t" 'org-todo)
--- 9408,9462 ----
  ;;                     i k                 @                                
expendable from outline-mode
  ;;   0123456789                          !    %^&     ()_{}    "      `'    
free
  
! ;; TAB key with modifiers
! (define-key org-mode-map "\C-i"       'org-cycle)
  (define-key org-mode-map [(meta tab)] 'org-complete)
! (define-key org-mode-map "\M-\C-i"    'org-complete)            ; for tty 
emacs
! ;; The following line is necessary under Suse GNU/Linux
! (unless org-xemacs-p
!   (define-key org-mode-map [S-iso-lefttab]  'org-shifttab))
! (define-key org-mode-map [(shift tab)]    'org-shifttab)
! 
! (define-key org-mode-map (org-key 'S-return)   'org-table-copy-down)
! (define-key org-mode-map "\C-c\C-xc"           'org-table-copy-down)     ; tty
! (define-key org-mode-map [(meta shift return)] 'org-insert-todo-heading)
! (define-key org-mode-map "\C-c\C-xM"           'org-insert-todo-heading) ; tty
! (define-key org-mode-map [(meta return)]       'org-meta-return)
! (define-key org-mode-map "\C-c\C-xm"           'org-meta-return)  ; tty emacs
! (define-key org-mode-map [?\e (return)]        'org-meta-return)   ; tty emacs
! 
! ;; Cursor keys with modifiers
! (define-key org-mode-map [(meta left)]  'org-metaleft)
! (define-key org-mode-map [?\e (left)]   'org-metaleft)          ; for tty 
emacs
! (define-key org-mode-map "\C-c\C-xl"    'org-metaleft)          ; for tty 
emacs
  (define-key org-mode-map [(meta right)] 'org-metaright)
! (define-key org-mode-map [?\e (right)]  'org-metaright)         ; for tty 
emacs
! (define-key org-mode-map "\C-c\C-xr"    'org-metaright)         ; for tty 
emacs
! (define-key org-mode-map [(meta up)]    'org-metaup)
! (define-key org-mode-map [?\e (up)]     'org-metaup)            ; for tty 
emacs
! (define-key org-mode-map "\C-c\C-xu"    'org-metaup)            ; for tty 
emacs
! (define-key org-mode-map [(meta down)]  'org-metadown)
! (define-key org-mode-map [?\e (down)]   'org-metadown)          ; for tty 
emacs
! (define-key org-mode-map "\C-c\C-xd"    'org-metadown)          ; for tty 
emacs
! 
! (define-key org-mode-map [(meta shift left)]       'org-shiftmetaleft)
! (define-key org-mode-map "\C-c\C-xL"               'org-shiftmetaleft)  ; tty
! (define-key org-mode-map [(meta shift right)]      'org-shiftmetaright)
! (define-key org-mode-map "\C-c\C-xR"               'org-shiftmetaright) ; tty
! (define-key org-mode-map [(meta shift up)]         'org-shiftmetaup)
! (define-key org-mode-map "\C-c\C-xU"               'org-shiftmetaup)    ; tty
! (define-key org-mode-map [(meta shift down)]       'org-shiftmetadown)
! (define-key org-mode-map "\C-c\C-xD"               'org-shiftmetadown)  ; tty
! (define-key org-mode-map (org-key 'S-up)       'org-shiftup)
! (define-key org-mode-map [?\C-c ?\C-x (up)]    'org-shiftup)
! (define-key org-mode-map (org-key 'S-down)     'org-shiftdown)
! (define-key org-mode-map [?\C-c ?\C-x (down)]  'org-shiftdown)
! (define-key org-mode-map (org-key 'S-left)     'org-timestamp-down-day)
! (define-key org-mode-map [?\C-c ?\C-x (left)]  'org-timestamp-down-day)
! (define-key org-mode-map (org-key 'S-right)    'org-timestamp-up-day)
! (define-key org-mode-map [?\C-c ?\C-x (right)] 'org-timestamp-up-day)
! 
! ;; All the other keys
  (define-key org-mode-map "\C-c$"    'org-archive-subtree)
  (define-key org-mode-map "\C-c\C-j" 'org-goto)
  (define-key org-mode-map "\C-c\C-t" 'org-todo)
***************
*** 9372,9382 ****
  (define-key org-mode-map "\C-c/"    'org-occur)   ; Minor-mode reserved
  (define-key org-mode-map "\C-c\C-m" 'org-insert-heading)
  (define-key org-mode-map "\M-\C-m"  'org-insert-heading)
- (define-key org-mode-map [(meta shift return)] 'org-insert-todo-heading)
  (define-key org-mode-map "\C-c\C-l" 'org-insert-link)
  (define-key org-mode-map "\C-c\C-o" 'org-open-at-point)
  (define-key org-mode-map "\C-c\C-z" 'org-time-stamp)  ; Alternative binding
  (define-key org-mode-map "\C-c."    'org-time-stamp)  ; Minor-mode reserved
  (define-key org-mode-map "\C-c,"    'org-priority)    ; Minor-mode reserved
  (define-key org-mode-map "\C-c\C-y" 'org-evaluate-time-range)
  (define-key org-mode-map "\C-c>"    'org-goto-calendar)
--- 9468,9478 ----
  (define-key org-mode-map "\C-c/"    'org-occur)   ; Minor-mode reserved
  (define-key org-mode-map "\C-c\C-m" 'org-insert-heading)
  (define-key org-mode-map "\M-\C-m"  'org-insert-heading)
  (define-key org-mode-map "\C-c\C-l" 'org-insert-link)
  (define-key org-mode-map "\C-c\C-o" 'org-open-at-point)
  (define-key org-mode-map "\C-c\C-z" 'org-time-stamp)  ; Alternative binding
  (define-key org-mode-map "\C-c."    'org-time-stamp)  ; Minor-mode reserved
+ (define-key org-mode-map "\C-c!"    'org-time-stamp-inactive) ; Minor-mode r.
  (define-key org-mode-map "\C-c,"    'org-priority)    ; Minor-mode reserved
  (define-key org-mode-map "\C-c\C-y" 'org-evaluate-time-range)
  (define-key org-mode-map "\C-c>"    'org-goto-calendar)
***************
*** 9384,9402 ****
  (define-key org-mode-map "\C-c["    'org-add-file)
  (define-key org-mode-map "\C-c]"    'org-remove-file)
  (define-key org-mode-map "\C-c\C-r"       'org-timeline)
- (define-key org-mode-map (org-key 'S-up)    'org-shiftup)
- (define-key org-mode-map (org-key 'S-down)  'org-shiftdown)
- (define-key org-mode-map (org-key 'S-left)  'org-timestamp-down-day)
- (define-key org-mode-map (org-key 'S-right) 'org-timestamp-up-day)
  (define-key org-mode-map "\C-c-"          'org-table-insert-hline)
- ;; The following line is necessary for German keyboards under Suse GNU/Linux
- (unless org-xemacs-p
-   (define-key org-mode-map [S-iso-lefttab]  'org-shifttab))
- (define-key org-mode-map [(shift tab)]    'org-shifttab)
  (define-key org-mode-map "\C-c\C-c"       'org-ctrl-c-ctrl-c)
  (define-key org-mode-map "\C-m"           'org-return)
- (define-key org-mode-map (org-key 'S-return) 'org-table-copy-down)
- (define-key org-mode-map [(meta return)]  'org-meta-return)
  (define-key org-mode-map "\C-c?"          'org-table-current-column)
  (define-key org-mode-map "\C-c "          'org-table-blank-field)
  (define-key org-mode-map "\C-c+"          'org-table-sum)
--- 9480,9488 ----
***************
*** 9411,9422 ****
  (define-key org-mode-map "\C-c\C-x\C-a"   'org-export-as-ascii)
  (define-key org-mode-map "\C-c\C-xv"      'org-export-copy-visible)
  (define-key org-mode-map "\C-c\C-x\C-v"   'org-export-copy-visible)
  ;(define-key org-mode-map "\C-c\C-xo"      'org-export-as-opml)
  ;(define-key org-mode-map "\C-c\C-x\C-o"   'org-export-as-opml)
  (define-key org-mode-map "\C-c\C-xt"      'org-insert-export-options-template)
  (define-key org-mode-map "\C-c:"          'org-toggle-fixed-width-section)
  (define-key org-mode-map "\C-c\C-xh"      'org-export-as-html)
! (define-key org-mode-map "\C-c\C-x\C-h"   'org-export-as-html-and-open)
  
  (defsubst org-table-p () (org-at-table-p))
  
--- 9497,9514 ----
  (define-key org-mode-map "\C-c\C-x\C-a"   'org-export-as-ascii)
  (define-key org-mode-map "\C-c\C-xv"      'org-export-copy-visible)
  (define-key org-mode-map "\C-c\C-x\C-v"   'org-export-copy-visible)
+ ;; OPML support is only planned
  ;(define-key org-mode-map "\C-c\C-xo"      'org-export-as-opml)
  ;(define-key org-mode-map "\C-c\C-x\C-o"   'org-export-as-opml)
  (define-key org-mode-map "\C-c\C-xt"      'org-insert-export-options-template)
  (define-key org-mode-map "\C-c:"          'org-toggle-fixed-width-section)
  (define-key org-mode-map "\C-c\C-xh"      'org-export-as-html)
! (define-key org-mode-map "\C-c\C-xb"      'org-export-as-html-and-open)
! (define-key org-mode-map "\C-c\C-x\C-b"   'org-export-as-html-and-open)
! 
! (define-key org-mode-map "\C-c\C-x\C-w"   'org-cut-special)
! (define-key org-mode-map "\C-c\C-x\M-w"   'org-copy-special)
! (define-key org-mode-map "\C-c\C-x\C-y"   'org-paste-special)
  
  (defsubst org-table-p () (org-at-table-p))
  
***************
*** 9426,9431 ****
--- 9518,9529 ----
  overwritten, and the table is not marked as requiring realignment."
    (interactive "p")
    (if (and (org-table-p)
+          (or
+           (and org-table-auto-blank-field
+                (member last-command
+                        '(org-cycle org-return org-shifttab org-ctrl-c-ctrl-c))
+                (org-table-blank-field))
+           t)
           (eq N 1)
           (looking-at "[^|\n]*  +|"))
        (let (org-table-may-need-update)
***************
*** 9480,9509 ****
  ;; How to do this: Measure non-white length of current string
  ;; If equal to column width, we should realign.
  
  (when (eq org-enable-table-editor 'optimized)
    ;; If the user wants maximum table support, we need to hijack
    ;; some standard editing functions
!   (substitute-key-definition 'self-insert-command 'org-self-insert-command
!                            org-mode-map global-map)
!   (substitute-key-definition 'delete-char 'org-delete-char
!                            org-mode-map global-map)
!   (substitute-key-definition 'delete-backward-char 'org-delete-backward-char
!                            org-mode-map global-map)
!   (define-key org-mode-map "|" 'self-insert-command))
  
  (defun org-shiftcursor-error ()
    "Throw an error because Shift-Cursor command was applied in wrong context."
    (error "This command is only active in tables and on headlines"))
  
  (defun org-shifttab ()
!   "Call `(org-cycle t)' or `org-table-previous-field'."
    (interactive)
    (cond
     ((org-at-table-p) (org-table-previous-field))
     (t (org-cycle '(4)))))
  
  (defun org-shiftmetaleft ()
!   "Call `org-promote-subtree' or `org-table-delete-column'."
    (interactive)
    (cond
     ((org-at-table-p) (org-table-delete-column))
--- 9578,9619 ----
  ;; How to do this: Measure non-white length of current string
  ;; If equal to column width, we should realign.
  
+ (defun org-remap (map &rest commands)
+   "In MAP, remap the functions given in COMMANDS.
+ COMMANDS is a list of alternating OLDDEF NEWDEF command names."
+   (let (new old)
+     (while commands
+       (setq old (pop commands) new (pop commands))
+       (if (fboundp 'command-remapping)
+         (define-key map (vector 'remap old) new)
+       (substitute-key-definition old new map global-map)))))
+   
  (when (eq org-enable-table-editor 'optimized)
    ;; If the user wants maximum table support, we need to hijack
    ;; some standard editing functions
!   (org-remap org-mode-map
!            'self-insert-command 'org-self-insert-command
!            'delete-char 'org-delete-char
!            'delete-backward-char 'org-delete-backward-char)
!   (define-key org-mode-map "|" 'org-force-self-insert))
  
  (defun org-shiftcursor-error ()
    "Throw an error because Shift-Cursor command was applied in wrong context."
    (error "This command is only active in tables and on headlines"))
  
  (defun org-shifttab ()
!   "Global visibility cycling or move to previous table field.
! Calls `(org-cycle t)' or `org-table-previous-field', depending on context.
! See the individual commands for more information."
    (interactive)
    (cond
     ((org-at-table-p) (org-table-previous-field))
     (t (org-cycle '(4)))))
  
  (defun org-shiftmetaleft ()
!   "Promote subtree or delete table column.
! Calls `org-promote-subtree' or `org-table-delete-column', depending on 
context.
! See the individual commands for more information."
    (interactive)
    (cond
     ((org-at-table-p) (org-table-delete-column))
***************
*** 9511,9517 ****
     (t (org-shiftcursor-error))))
  
  (defun org-shiftmetaright ()
!   "Call `org-demote-subtree' or `org-table-insert-column'."
    (interactive)
    (cond
     ((org-at-table-p) (org-table-insert-column))
--- 9621,9629 ----
     (t (org-shiftcursor-error))))
  
  (defun org-shiftmetaright ()
!   "Demote subtree or insert table column.
! Calls `org-demote-subtree' or `org-table-insert-column', depending on context.
! See the individual commands for more information."
    (interactive)
    (cond
     ((org-at-table-p) (org-table-insert-column))
***************
*** 9519,9532 ****
     (t (org-shiftcursor-error))))
  
  (defun org-shiftmetaup (&optional arg)
!   "Call `org-move-subtree-up' or `org-table-kill-row'."
    (interactive "P")
    (cond
     ((org-at-table-p) (org-table-kill-row))
     ((org-on-heading-p) (org-move-subtree-up arg))
     (t (org-shiftcursor-error))))
  (defun org-shiftmetadown (&optional arg)
!   "Call `org-move-subtree-down' or `org-table-insert-row'."
    (interactive "P")
    (cond
     ((org-at-table-p) (org-table-insert-row arg))
--- 9631,9648 ----
     (t (org-shiftcursor-error))))
  
  (defun org-shiftmetaup (&optional arg)
!   "Move subtree up or kill table row.
! Calls `org-move-subtree-up' or `org-table-kill-row', depending on context.
! See the individual commands for more information."
    (interactive "P")
    (cond
     ((org-at-table-p) (org-table-kill-row))
     ((org-on-heading-p) (org-move-subtree-up arg))
     (t (org-shiftcursor-error))))
  (defun org-shiftmetadown (&optional arg)
!   "Move subtree down or insert table row.
! Calls `org-move-subtree-down' or `org-table-insert-row', depending on context.
! See the individual commands for more information."
    (interactive "P")
    (cond
     ((org-at-table-p) (org-table-insert-row arg))
***************
*** 9534,9540 ****
     (t (org-shiftcursor-error))))
  
  (defun org-metaleft (&optional arg)
!   "Call `org-do-promote' or `org-table-move-column' to left."
    (interactive "P")
    (cond
     ((org-at-table-p) (org-table-move-column 'left))
--- 9650,9658 ----
     (t (org-shiftcursor-error))))
  
  (defun org-metaleft (&optional arg)
!   "Promote heading or move table column to left.
! Calls `org-do-promote' or `org-table-move-column', depending on context.
! See the individual commands for more information."
    (interactive "P")
    (cond
     ((org-at-table-p) (org-table-move-column 'left))
***************
*** 9542,9548 ****
     (t (backward-word (prefix-numeric-value arg)))))
  
  (defun org-metaright (&optional arg)
!   "Call `org-do-demote' or `org-table-move-column' to right."
    (interactive "P")
    (cond
     ((org-at-table-p) (org-table-move-column nil))
--- 9660,9668 ----
     (t (backward-word (prefix-numeric-value arg)))))
  
  (defun org-metaright (&optional arg)
!   "Demote subtree or move table column to right.
! Calls `org-do-demote' or `org-table-move-column', depending on context.
! See the individual commands for more information."
    (interactive "P")
    (cond
     ((org-at-table-p) (org-table-move-column nil))
***************
*** 9550,9556 ****
     (t (forward-word (prefix-numeric-value arg)))))
  
  (defun org-metaup (&optional arg)
!   "Call `org-move-subtree-up' or `org-table-move-row' up."
    (interactive "P")
    (cond
     ((org-at-table-p) (org-table-move-row 'up))
--- 9670,9678 ----
     (t (forward-word (prefix-numeric-value arg)))))
  
  (defun org-metaup (&optional arg)
!   "Move subtree up or move table row up.
! Calls `org-move-subtree-up' or `org-table-move-row', depending on context.
! See the individual commands for more information."
    (interactive "P")
    (cond
     ((org-at-table-p) (org-table-move-row 'up))
***************
*** 9558,9564 ****
     (t (org-shiftcursor-error))))
  
  (defun org-metadown (&optional arg)
!   "Call `org-move-subtree-down' or `org-table-move-row' down."
    (interactive "P")
    (cond
     ((org-at-table-p) (org-table-move-row nil))
--- 9680,9688 ----
     (t (org-shiftcursor-error))))
  
  (defun org-metadown (&optional arg)
!   "Move subtree down or move table row down.
! Calls `org-move-subtree-down' or `org-table-move-row', depending on context.
! See the individual commands for more information."
    (interactive "P")
    (cond
     ((org-at-table-p) (org-table-move-row nil))
***************
*** 9566,9598 ****
     (t (org-shiftcursor-error))))
  
  (defun org-shiftup (&optional arg)
!   "Call `org-timestamp-up' or `org-priority-up'."
    (interactive "P")
    (cond
     ((org-at-timestamp-p) (org-timestamp-up arg))
     (t (org-priority-up))))
  
  (defun org-shiftdown (&optional arg)
!   "Call `org-timestamp-down' or `org-priority-down'."
    (interactive "P")
    (cond
     ((org-at-timestamp-p) (org-timestamp-down arg))
     (t (org-priority-down))))
  
  (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 ()
!   "Call either `org-table-copy' or `org-cut-subtree'."
    (interactive)
    (call-interactively
     (if (org-at-table-p) 'org-table-cut-region 'org-cut-subtree)))
  
  (defun org-paste-special (arg)
!   "Call either `org-table-paste-rectangle' or `org-paste-subtree'."
    (interactive "P")
    (if (org-at-table-p)
        (org-table-paste-rectangle)
--- 9690,9732 ----
     (t (org-shiftcursor-error))))
  
  (defun org-shiftup (&optional arg)
!   "Increase item in timestamp or increase priority of current item.
! Calls `org-timestamp-up' or `org-priority-up', depending on context.
! See the individual commands for more information."
    (interactive "P")
    (cond
     ((org-at-timestamp-p) (org-timestamp-up arg))
     (t (org-priority-up))))
  
  (defun org-shiftdown (&optional arg)
!   "Decrease item in timestamp or decrease priority of current item.
! Calls `org-timestamp-down' or `org-priority-down', depending on context.
! See the individual commands for more information."
    (interactive "P")
    (cond
     ((org-at-timestamp-p) (org-timestamp-down arg))
     (t (org-priority-down))))
  
  (defun org-copy-special ()
!   "Copy region in table or copy current subtree.
! Calls `org-table-copy' or `org-copy-subtree', depending on context.
! See the individual commands for more information."
    (interactive)
    (call-interactively
     (if (org-at-table-p) 'org-table-copy-region 'org-copy-subtree)))
  
  (defun org-cut-special ()
!   "Cut region in table or cut current subtree.
! Calls `org-table-copy' or `org-cut-subtree', depending on context.
! See the individual commands for more information."
    (interactive)
    (call-interactively
     (if (org-at-table-p) 'org-table-cut-region 'org-cut-subtree)))
  
  (defun org-paste-special (arg)
!   "Paste rectangular region into table, or past subtree relative to level.
! Calls `org-table-paste-rectangle' or `org-paste-subtree', depending on 
context.
! See the individual commands for more information."
    (interactive "P")
    (if (org-at-table-p)
        (org-table-paste-rectangle)
***************
*** 9605,9611 ****
  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")
    (let  ((org-enable-table-editor t))
      (cond
--- 9739,9746 ----
  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.
! If the cursor is on a #+TBLFM line, re-apply the formulae to the table."
    (interactive "P")
    (let  ((org-enable-table-editor t))
      (cond
***************
*** 9629,9635 ****
          (skip-chars-backward " \r\n\t")
          (if (org-at-table-p) (org-table-recalculate t))))
         (t
!       (let ((org-inhibit-startup t)) (org-mode)))))
       ((org-region-active-p)
        (org-table-convert-region (region-beginning) (region-end) arg))
       ((and (region-beginning) (region-end))
--- 9764,9770 ----
          (skip-chars-backward " \r\n\t")
          (if (org-at-table-p) (org-table-recalculate t))))
         (t
!       (org-mode-restart))))
       ((org-region-active-p)
        (org-table-convert-region (region-beginning) (region-end) arg))
       ((and (region-beginning) (region-end))
***************
*** 9638,9645 ****
        (error "Abort")))
       (t (error "No table at point, and no region to make one")))))
  
  (defun org-return ()
!   "Call `org-table-next-row' or `newline'."
    (interactive)
    (cond
     ((org-at-table-p)
--- 9773,9789 ----
        (error "Abort")))
       (t (error "No table at point, and no region to make one")))))
  
+ (defun org-mode-restart ()
+   "Restart Org-mode, to scan again for special lines.
+ Also updates the keyword regular expressions."
+   (interactive)
+   (let ((org-inhibit-startup t)) (org-mode))
+   (message "Org-mode restarted to refresh keyword and special line setup"))
+ 
  (defun org-return ()
!   "Goto next table row or insert a newline.
! Calls `org-table-next-row' or `newline', depending on context.
! See the individual commands for more information."
    (interactive)
    (cond
     ((org-at-table-p)
***************
*** 9648,9654 ****
     (t (newline))))
  
  (defun org-meta-return (&optional arg)
!   "Call `org-insert-heading' or `org-table-wrap-region'."
    (interactive "P")
    (cond
     ((org-at-table-p)
--- 9792,9800 ----
     (t (newline))))
  
  (defun org-meta-return (&optional arg)
!   "Insert a new heading or wrap a region in a table.
! Calls `org-insert-heading' or `org-table-wrap-region', depending on context.
! See the individual commands for more information."
    (interactive "P")
    (cond
     ((org-at-table-p)
***************
*** 9716,9721 ****
--- 9862,9868 ----
  (easy-menu-define org-org-menu org-mode-map "Org menu"
    '("Org"
      ["Cycle Visibility" org-cycle (or (bobp) (outline-on-heading-p))]
+     ["Cycle Global Visibility" org-shifttab (not (org-at-table-p))]
      ["Sparse Tree" org-occur t]
      ["Show All" show-all t]
      "--"
***************
*** 9752,9757 ****
--- 9899,9905 ----
       ["Priority Down" org-shiftdown t])
      ("Dates and Scheduling"
       ["Timestamp" org-time-stamp t]
+      ["Timestamp (inactive)" org-time-stamp-inactive t]
       ("Change Date"
        ["1 Day Later" org-timestamp-up-day t]
        ["1 Day Earlier" org-timestamp-down-day t]
***************
*** 9795,9800 ****
--- 9943,9950 ----
       "--"
       ["Build Full Customize Menu" org-create-customize-menu
        (fboundp 'customize-menu-create)])
+     "--"
+     ["Refresh setup" org-mode-restart t]
      ))
  
  (defun org-info (&optional node)




reply via email to

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