diff options
| author | Carsten Dominik | 2006-11-13 08:37:36 +0000 |
|---|---|---|
| committer | Carsten Dominik | 2006-11-13 08:37:36 +0000 |
| commit | 761311e3e22348a5c82872ea79936a42b48a9e96 (patch) | |
| tree | bcd28d3c66f98b3e577242598de6f700e4347f42 | |
| parent | 55a314a5c2c62d5059e10b844af34d17726c0d02 (diff) | |
| download | emacs-761311e3e22348a5c82872ea79936a42b48a9e96.tar.gz emacs-761311e3e22348a5c82872ea79936a42b48a9e96.zip | |
(org-metaleft): Call `org-outdent-item' on bullets.
(org-metaright): Call `org-indent-item' on bullets.
(org-timestamp-change): Set `org-last-changed-timestamp'.
(org-current-line): Make sure (bolp) returns correct result.
(org-agenda-change-all-lines): Make sure highlighting TODO always
works.
| -rw-r--r-- | lisp/textmodes/org.el | 64 |
1 files changed, 20 insertions, 44 deletions
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el index dd4cd2e71b2..50cee6736cb 100644 --- a/lisp/textmodes/org.el +++ b/lisp/textmodes/org.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <dominik at science dot uva dot nl> | 5 | ;; Author: Carsten Dominik <dominik at science dot uva dot nl> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ | 7 | ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ |
| 8 | ;; Version: 4.54 | 8 | ;; Version: 4.55 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -61,6 +61,9 @@ | |||
| 61 | ;; | 61 | ;; |
| 62 | ;; Recent changes | 62 | ;; Recent changes |
| 63 | ;; -------------- | 63 | ;; -------------- |
| 64 | ;; Version 4.55 | ||
| 65 | ;; - Bug fixes. | ||
| 66 | ;; | ||
| 64 | ;; Version 4.54 | 67 | ;; Version 4.54 |
| 65 | ;; - Improvements to fast tag selection | 68 | ;; - Improvements to fast tag selection |
| 66 | ;; + show status also in target line. | 69 | ;; + show status also in target line. |
| @@ -164,7 +167,7 @@ | |||
| 164 | 167 | ||
| 165 | ;;; Customization variables | 168 | ;;; Customization variables |
| 166 | 169 | ||
| 167 | (defvar org-version "4.54" | 170 | (defvar org-version "4.55" |
| 168 | "The version number of the file org.el.") | 171 | "The version number of the file org.el.") |
| 169 | (defun org-version () | 172 | (defun org-version () |
| 170 | (interactive) | 173 | (interactive) |
| @@ -467,7 +470,7 @@ The highlights created by `org-preview-latex-fragment' always need | |||
| 467 | :group 'org-time | 470 | :group 'org-time |
| 468 | :type 'boolean) | 471 | :type 'boolean) |
| 469 | 472 | ||
| 470 | (defcustom org-show-hierarchy-above '((default t)) | 473 | (defcustom org-show-hierarchy-above '((default . t)) |
| 471 | "Non-nil means, show full hierarchy when showing a spot in the tree. | 474 | "Non-nil means, show full hierarchy when showing a spot in the tree. |
| 472 | Turning this off makes sparse trees more compact, but also less clear. | 475 | Turning this off makes sparse trees more compact, but also less clear. |
| 473 | Instead of t, this can also be an alist specifying this option for different | 476 | Instead of t, this can also be an alist specifying this option for different |
| @@ -497,7 +500,7 @@ contexts. Valid contexts are | |||
| 497 | (const default)) | 500 | (const default)) |
| 498 | (boolean))))) | 501 | (boolean))))) |
| 499 | 502 | ||
| 500 | (defcustom org-show-following-heading '((default t)) | 503 | (defcustom org-show-following-heading '((default . t)) |
| 501 | "Non-nil means, show heading following match in `org-occur'. | 504 | "Non-nil means, show heading following match in `org-occur'. |
| 502 | When doing an `org-occur' it is useful to show the headline which | 505 | When doing an `org-occur' it is useful to show the headline which |
| 503 | follows the match, even if they do not match the regexp. This makes it | 506 | follows the match, even if they do not match the regexp. This makes it |
| @@ -3275,7 +3278,9 @@ The following commands are available: | |||
| 3275 | (let ((current-prefix-arg arg)) (call-interactively command))) | 3278 | (let ((current-prefix-arg arg)) (call-interactively command))) |
| 3276 | 3279 | ||
| 3277 | (defsubst org-current-line (&optional pos) | 3280 | (defsubst org-current-line (&optional pos) |
| 3278 | (+ (if (bolp) 1 0) (count-lines (point-min) (or pos (point))))) | 3281 | (save-excursion |
| 3282 | (and pos (goto-char pos)) | ||
| 3283 | (+ (if (bolp) 1 0) (count-lines (point-min) (point))))) | ||
| 3279 | 3284 | ||
| 3280 | (defun org-current-time () | 3285 | (defun org-current-time () |
| 3281 | "Current time, possibly rounded to `org-time-stamp-rounding-minutes'." | 3286 | "Current time, possibly rounded to `org-time-stamp-rounding-minutes'." |
| @@ -6412,7 +6417,8 @@ in the timestamp determines what will be changed." | |||
| 6412 | (setcar (nthcdr 1 time0) (or (nth 1 time0) 0)) | 6417 | (setcar (nthcdr 1 time0) (or (nth 1 time0) 0)) |
| 6413 | (setcar (nthcdr 2 time0) (or (nth 1 time0) 0)) | 6418 | (setcar (nthcdr 2 time0) (or (nth 1 time0) 0)) |
| 6414 | (setq time (apply 'encode-time time0)))) | 6419 | (setq time (apply 'encode-time time0)))) |
| 6415 | (org-insert-time-stamp time with-hm inactive) | 6420 | (setq org-last-changed-timestamp |
| 6421 | (org-insert-time-stamp time with-hm inactive)) | ||
| 6416 | (org-clock-update-time-maybe) | 6422 | (org-clock-update-time-maybe) |
| 6417 | (goto-char pos) | 6423 | (goto-char pos) |
| 6418 | ;; Try to recenter the calendar window, if any | 6424 | ;; Try to recenter the calendar window, if any |
| @@ -6774,7 +6780,7 @@ the returned times will be formatted strings." | |||
| 6774 | (apply 'encode-time (org-parse-time-string te))))) | 6780 | (apply 'encode-time (org-parse-time-string te))))) |
| 6775 | (move-marker ins (point)) | 6781 | (move-marker ins (point)) |
| 6776 | (setq ipos (point)) | 6782 | (setq ipos (point)) |
| 6777 | ;; FIXME: does not yet use org-insert-time-stamp or custom format | 6783 | ;; FIXME: does not yet use org-insert-time-stamp |
| 6778 | (insert-before-markers "Clock summary at [" | 6784 | (insert-before-markers "Clock summary at [" |
| 6779 | (substring | 6785 | (substring |
| 6780 | (format-time-string (cdr org-time-stamp-formats)) | 6786 | (format-time-string (cdr org-time-stamp-formats)) |
| @@ -7472,7 +7478,7 @@ NDAYS defaults to `org-agenda-ndays'." | |||
| 7472 | (d (- nt n1))) | 7478 | (d (- nt n1))) |
| 7473 | (- sd (+ (if (< d 0) 7 0) d))))) | 7479 | (- sd (+ (if (< d 0) 7 0) d))))) |
| 7474 | (day-numbers (list start)) | 7480 | (day-numbers (list start)) |
| 7475 | ;FIXME (inhibit-redisplay t) | 7481 | (inhibit-redisplay t) |
| 7476 | s e rtn rtnall file date d start-pos end-pos todayp nd) | 7482 | s e rtn rtnall file date d start-pos end-pos todayp nd) |
| 7477 | (setq org-agenda-redo-command | 7483 | (setq org-agenda-redo-command |
| 7478 | (list 'org-agenda-list (list 'quote include-all) start-day ndays)) | 7484 | (list 'org-agenda-list (list 'quote include-all) start-day ndays)) |
| @@ -7575,6 +7581,7 @@ the list to these. When using \\[universal-argument], you will be prompted | |||
| 7575 | for a keyword. A numeric prefix directly selects the Nth keyword in | 7581 | for a keyword. A numeric prefix directly selects the Nth keyword in |
| 7576 | `org-todo-keywords'." | 7582 | `org-todo-keywords'." |
| 7577 | (interactive "P") | 7583 | (interactive "P") |
| 7584 | (require 'calendar) | ||
| 7578 | (org-compile-prefix-format 'todo) | 7585 | (org-compile-prefix-format 'todo) |
| 7579 | (org-set-sorting-strategy 'todo) | 7586 | (org-set-sorting-strategy 'todo) |
| 7580 | (let* ((today (time-to-days (current-time))) | 7587 | (let* ((today (time-to-days (current-time))) |
| @@ -8249,7 +8256,7 @@ the documentation of `org-diary'." | |||
| 8249 | "[^\n\r]*\\)")) | 8256 | "[^\n\r]*\\)")) |
| 8250 | (deadline-re (concat ".*\\(\n[^*].*\\)?" org-deadline-time-regexp)) | 8257 | (deadline-re (concat ".*\\(\n[^*].*\\)?" org-deadline-time-regexp)) |
| 8251 | (sched-re (concat ".*\\(\n[^*].*\\)?" org-scheduled-time-regexp)) | 8258 | (sched-re (concat ".*\\(\n[^*].*\\)?" org-scheduled-time-regexp)) |
| 8252 | ; FIXME why was this wriong? (sched-re (concat ".*\n?.*?" org-scheduled-time-regexp)) | 8259 | ; FIXME why was this wrong? (sched-re (concat ".*\n?.*?" org-scheduled-time-regexp)) |
| 8253 | marker priority category tags | 8260 | marker priority category tags |
| 8254 | ee txt) | 8261 | ee txt) |
| 8255 | (goto-char (point-min)) | 8262 | (goto-char (point-min)) |
| @@ -8990,7 +8997,6 @@ The new content of the line will be NEWHEAD (as modified by | |||
| 8990 | If FIXFACE is non-nil, the face of each item is modified acording to | 8997 | If FIXFACE is non-nil, the face of each item is modified acording to |
| 8991 | the new TODO state." | 8998 | the new TODO state." |
| 8992 | (let* (props m pl undone-face done-face finish new dotime cat tags) | 8999 | (let* (props m pl undone-face done-face finish new dotime cat tags) |
| 8993 | ; (setq newhead (org-format-agenda-item "x" newhead "x" nil 'noprefix)) | ||
| 8994 | (save-excursion | 9000 | (save-excursion |
| 8995 | (goto-char (point-max)) | 9001 | (goto-char (point-max)) |
| 8996 | (beginning-of-line 1) | 9002 | (beginning-of-line 1) |
| @@ -9017,9 +9023,8 @@ the new TODO state." | |||
| 9017 | (point-at-bol) (point-at-eol) | 9023 | (point-at-bol) (point-at-eol) |
| 9018 | (list 'face | 9024 | (list 'face |
| 9019 | (if org-last-todo-state-is-todo | 9025 | (if org-last-todo-state-is-todo |
| 9020 | undone-face done-face))) | 9026 | undone-face done-face)))) |
| 9021 | (org-agenda-highlight-todo 'line)) | 9027 | (org-agenda-highlight-todo 'line) |
| 9022 | ;; (org-agenda-align-tags 'line) ;; done below by finalize | ||
| 9023 | (beginning-of-line 1)) | 9028 | (beginning-of-line 1)) |
| 9024 | (error "Line update did not work"))) | 9029 | (error "Line update did not work"))) |
| 9025 | (beginning-of-line 0))) | 9030 | (beginning-of-line 0))) |
| @@ -9440,37 +9445,6 @@ MATCH can contain positive and negative selection of tags, like | |||
| 9440 | (interactive "P") | 9445 | (interactive "P") |
| 9441 | (org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match)))) | 9446 | (org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match)))) |
| 9442 | 9447 | ||
| 9443 | ;; FIXME: remove this function. | ||
| 9444 | (defun org-make-tags-matcher-old (match) | ||
| 9445 | "Create the TAGS matcher form for the tags-selecting string MATCH." | ||
| 9446 | (unless match | ||
| 9447 | ;; Get a new match request, with completion | ||
| 9448 | (setq org-last-tags-completion-table | ||
| 9449 | (or org-tag-alist | ||
| 9450 | org-last-tags-completion-table)) | ||
| 9451 | (setq match (completing-read | ||
| 9452 | "Tags: " 'org-tags-completion-function nil nil nil | ||
| 9453 | 'org-tags-history))) | ||
| 9454 | ;; parse the string and create a lisp form | ||
| 9455 | (let ((match0 match) minus tag mm matcher orterms term orlist) | ||
| 9456 | (setq orterms (org-split-string match "|")) | ||
| 9457 | (while (setq term (pop orterms)) | ||
| 9458 | (while (string-match "^&?\\([-+:]\\)?\\([A-Za-z_@0-9]+\\)" term) | ||
| 9459 | (setq minus (and (match-end 1) | ||
| 9460 | (equal (match-string 1 term) "-")) | ||
| 9461 | tag (match-string 2 term) | ||
| 9462 | term (substring term (match-end 0)) | ||
| 9463 | mm (list 'member (downcase tag) 'tags-list) | ||
| 9464 | mm (if minus (list 'not mm) mm)) | ||
| 9465 | (push mm matcher)) | ||
| 9466 | (push (if (> (length matcher) 1) (cons 'and matcher) (car matcher)) | ||
| 9467 | orlist) | ||
| 9468 | (setq matcher nil)) | ||
| 9469 | (setq matcher (if (> (length orlist) 1) (cons 'or orlist) (car orlist))) | ||
| 9470 | ;; Return the string and lisp forms of the matcher | ||
| 9471 | (cons match0 matcher))) | ||
| 9472 | |||
| 9473 | |||
| 9474 | (defun org-make-tags-matcher (match) | 9448 | (defun org-make-tags-matcher (match) |
| 9475 | "Create the TAGS//TODO matcher form for the selection string MATCH." | 9449 | "Create the TAGS//TODO matcher form for the selection string MATCH." |
| 9476 | (unless match | 9450 | (unless match |
| @@ -16599,6 +16573,7 @@ See the individual commands for more information." | |||
| 16599 | ((org-at-table-p) (org-call-with-arg 'org-table-move-column 'left)) | 16573 | ((org-at-table-p) (org-call-with-arg 'org-table-move-column 'left)) |
| 16600 | ((or (org-on-heading-p) (org-region-active-p)) | 16574 | ((or (org-on-heading-p) (org-region-active-p)) |
| 16601 | (call-interactively 'org-do-promote)) | 16575 | (call-interactively 'org-do-promote)) |
| 16576 | ((org-at-item-p) (call-interactively 'org-outdent-item)) | ||
| 16602 | (t (call-interactively 'backward-word)))) | 16577 | (t (call-interactively 'backward-word)))) |
| 16603 | 16578 | ||
| 16604 | (defun org-metaright (&optional arg) | 16579 | (defun org-metaright (&optional arg) |
| @@ -16611,6 +16586,7 @@ See the individual commands for more information." | |||
| 16611 | ((org-at-table-p) (call-interactively 'org-table-move-column)) | 16586 | ((org-at-table-p) (call-interactively 'org-table-move-column)) |
| 16612 | ((or (org-on-heading-p) (org-region-active-p)) | 16587 | ((or (org-on-heading-p) (org-region-active-p)) |
| 16613 | (call-interactively 'org-do-demote)) | 16588 | (call-interactively 'org-do-demote)) |
| 16589 | ((org-at-item-p) (call-interactively 'org-indent-item)) | ||
| 16614 | (t (call-interactively 'forward-word)))) | 16590 | (t (call-interactively 'forward-word)))) |
| 16615 | 16591 | ||
| 16616 | (defun org-metaup (&optional arg) | 16592 | (defun org-metaup (&optional arg) |