Browse Source

Merge branch 'maint'

Bastien Guerry 13 years ago
parent
commit
5508053d63
5 changed files with 34 additions and 8 deletions
  1. 10 3
      lisp/org-agenda.el
  2. 1 1
      lisp/org-clock.el
  3. 4 0
      lisp/org-table.el
  4. 2 1
      lisp/org-timer.el
  5. 17 3
      lisp/org.el

+ 10 - 3
lisp/org-agenda.el

@@ -3534,6 +3534,9 @@ generating a new one."
 	(while (org-activate-bracket-links (point-max))
 	(while (org-activate-bracket-links (point-max))
 	  (add-text-properties (match-beginning 0) (match-end 0)
 	  (add-text-properties (match-beginning 0) (match-end 0)
 			       '(face org-link)))
 			       '(face org-link)))
+	(while (org-activate-plain-links (point-max))
+	  (add-text-properties (match-beginning 0) (match-end 0)
+			       '(face org-link)))
 	(org-agenda-align-tags)
 	(org-agenda-align-tags)
 	(unless org-agenda-with-colors
 	(unless org-agenda-with-colors
 	  (remove-text-properties (point-min) (point-max) '(face nil))))
 	  (remove-text-properties (point-min) (point-max) '(face nil))))
@@ -3548,7 +3551,11 @@ generating a new one."
 	(org-agenda-fontify-priorities))
 	(org-agenda-fontify-priorities))
       (when (and org-agenda-dim-blocked-tasks org-blocker-hook)
       (when (and org-agenda-dim-blocked-tasks org-blocker-hook)
 	(org-agenda-dim-blocked-tasks))
 	(org-agenda-dim-blocked-tasks))
-      (org-agenda-mark-clocking-task)
+      ;; We need to widen when `org-agenda-finalize' is called from
+      ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in')
+      (save-restriction
+      	(widen)
+	(org-agenda-mark-clocking-task))
       (when org-agenda-entry-text-mode
       (when org-agenda-entry-text-mode
 	(org-agenda-entry-text-hide)
 	(org-agenda-entry-text-hide)
 	(org-agenda-entry-text-show))
 	(org-agenda-entry-text-show))
@@ -8664,7 +8671,7 @@ ARG is passed through to `org-schedule'."
 	(goto-char pos)
 	(goto-char pos)
 	(setq ts (org-schedule arg time)))
 	(setq ts (org-schedule arg time)))
       (org-agenda-show-new-time marker ts "S"))
       (org-agenda-show-new-time marker ts "S"))
-    (message "Item scheduled for %s" ts)))
+    (message "%s" ts)))
 
 
 (defun org-agenda-deadline (arg &optional time)
 (defun org-agenda-deadline (arg &optional time)
   "Schedule the item at point.
   "Schedule the item at point.
@@ -8684,7 +8691,7 @@ ARG is passed through to `org-deadline'."
 	(goto-char pos)
 	(goto-char pos)
 	(setq ts (org-deadline arg time)))
 	(setq ts (org-deadline arg time)))
       (org-agenda-show-new-time marker ts "D"))
       (org-agenda-show-new-time marker ts "D"))
-    (message "Deadline for this item set to %s" ts)))
+    (message "%s" ts)))
 
 
 (defun org-agenda-clock-in (&optional arg)
 (defun org-agenda-clock-in (&optional arg)
   "Start the clock on the currently selected item."
   "Start the clock on the currently selected item."

+ 1 - 1
lisp/org-clock.el

@@ -1453,7 +1453,7 @@ to, overriding the existing value of `org-clock-out-switch-to-state'."
 	    (delq 'org-mode-line-string global-mode-string))
 	    (delq 'org-mode-line-string global-mode-string))
       (setq frame-title-format org-frame-title-format-backup)
       (setq frame-title-format org-frame-title-format-backup)
       (force-mode-line-update)
       (force-mode-line-update)
-      (if fail-quietly (throw 'exit t) (error "No active clock")))
+      (if fail-quietly (throw 'exit t) (user-error "No active clock")))
     (let ((org-clock-out-switch-to-state
     (let ((org-clock-out-switch-to-state
 	   (if switch-to-state
 	   (if switch-to-state
 	       (completing-read "Switch to state: "
 	       (completing-read "Switch to state: "

+ 4 - 0
lisp/org-table.el

@@ -1594,6 +1594,7 @@ should be done in reverse order."
   (interactive "P")
   (interactive "P")
   (let* ((thisline (org-current-line))
   (let* ((thisline (org-current-line))
 	 (thiscol (org-table-current-column))
 	 (thiscol (org-table-current-column))
+	 (otc org-table-overlay-coordinates)
 	 beg end bcol ecol tend tbeg column lns pos)
 	 beg end bcol ecol tend tbeg column lns pos)
     (when (equal thiscol 0)
     (when (equal thiscol 0)
       (if (org-called-interactively-p 'any)
       (if (org-called-interactively-p 'any)
@@ -1642,12 +1643,15 @@ should be done in reverse order."
 				  x))
 				  x))
 		      (org-split-string (buffer-substring beg end) "\n")))
 		      (org-split-string (buffer-substring beg end) "\n")))
     (setq lns (org-do-sort lns "Table" with-case sorting-type))
     (setq lns (org-do-sort lns "Table" with-case sorting-type))
+    (when org-table-overlay-coordinates
+      (org-table-toggle-coordinate-overlays))
     (delete-region beg end)
     (delete-region beg end)
     (move-marker beg nil)
     (move-marker beg nil)
     (move-marker end nil)
     (move-marker end nil)
     (insert (mapconcat 'cdr lns "\n") "\n")
     (insert (mapconcat 'cdr lns "\n") "\n")
     (org-goto-line thisline)
     (org-goto-line thisline)
     (org-table-goto-column thiscol)
     (org-table-goto-column thiscol)
+    (when otc (org-table-toggle-coordinate-overlays))
     (message "%d lines sorted, based on column %d" (length lns) column)))
     (message "%d lines sorted, based on column %d" (length lns) column)))
 
 
 ;;;###autoload
 ;;;###autoload

+ 2 - 1
lisp/org-timer.el

@@ -162,7 +162,8 @@ With prefix arg STOP, stop it entirely."
   (run-hooks 'org-timer-stop-hook)
   (run-hooks 'org-timer-stop-hook)
   (setq org-timer-start-time nil
   (setq org-timer-start-time nil
 	org-timer-pause-time nil)
 	org-timer-pause-time nil)
-  (org-timer-set-mode-line 'off))
+  (org-timer-set-mode-line 'off)
+  (message "Timer stopped"))
 
 
 ;;;###autoload
 ;;;###autoload
 (defun org-timer (&optional restart no-insert-p)
 (defun org-timer (&optional restart no-insert-p)

+ 17 - 3
lisp/org.el

@@ -8161,11 +8161,12 @@ a time stamp, by a property or by priority.
 
 
 The command prompts for the sorting type unless it has been given to the
 The command prompts for the sorting type unless it has been given to the
 function through the SORTING-TYPE argument, which needs to be a character,
 function through the SORTING-TYPE argument, which needs to be a character,
-\(?n ?N ?a ?A ?t ?T ?s ?S ?d ?D ?p ?P ?r ?R ?f ?F).  Here is the
+\(?n ?N ?a ?A ?t ?T ?s ?S ?d ?D ?p ?P ?o ?O ?r ?R ?f ?F).  Here is the
 precise meaning of each character:
 precise meaning of each character:
 
 
 n   Numerically, by converting the beginning of the entry/item to a number.
 n   Numerically, by converting the beginning of the entry/item to a number.
 a   Alphabetically, ignoring the TODO keyword and the priority, if any.
 a   Alphabetically, ignoring the TODO keyword and the priority, if any.
+o   By order of TODO keywords.
 t   By date/time, either the first active time stamp in the entry, or, if
 t   By date/time, either the first active time stamp in the entry, or, if
     none exist, by the first inactive one.
     none exist, by the first inactive one.
 s   By the scheduled date/time.
 s   By the scheduled date/time.
@@ -8185,6 +8186,13 @@ Comparing entries ignores case by default.  However, with an optional argument
 WITH-CASE, the sorting considers case as well."
 WITH-CASE, the sorting considers case as well."
   (interactive "P")
   (interactive "P")
   (let ((case-func (if with-case 'identity 'downcase))
   (let ((case-func (if with-case 'identity 'downcase))
+	(cmstr
+	 ;; The clock marker is lost when using `sort-subr', let's
+	 ;; store the clocking string.
+	 (when (equal (marker-buffer org-clock-marker) (current-buffer))
+	   (save-excursion
+	     (goto-char org-clock-marker)
+	     (looking-back "^.*") (match-string-no-properties 0))))
         start beg end stars re re2
         start beg end stars re re2
         txt what tmp)
         txt what tmp)
     ;; Find beginning and end of region to sort
     ;; Find beginning and end of region to sort
@@ -8241,7 +8249,7 @@ WITH-CASE, the sorting considers case as well."
       (message
       (message
        "Sort %s: [a]lpha  [n]umeric  [p]riority  p[r]operty  todo[o]rder  [f]unc
        "Sort %s: [a]lpha  [n]umeric  [p]riority  p[r]operty  todo[o]rder  [f]unc
                [t]ime [s]cheduled  [d]eadline  [c]reated
                [t]ime [s]cheduled  [d]eadline  [c]reated
-               A/N/T/S/D/C/P/O/F means reversed:"
+               A/N/P/R/O/F/T/S/D/C means reversed:"
        what)
        what)
       (setq sorting-type (read-char-exclusive))
       (setq sorting-type (read-char-exclusive))
 
 
@@ -8340,6 +8348,12 @@ WITH-CASE, the sorting considers case as well."
           ((= dcst ?f) compare-func)
           ((= dcst ?f) compare-func)
           ((member dcst '(?p ?t ?s ?d ?c)) '<)))))
           ((member dcst '(?p ?t ?s ?d ?c)) '<)))))
     (run-hooks 'org-after-sorting-entries-or-items-hook)
     (run-hooks 'org-after-sorting-entries-or-items-hook)
+    ;; Reset the clock marker if needed
+    (when cmstr
+      (save-excursion
+	(goto-char start)
+	(search-forward cmstr nil t)
+	(move-marker org-clock-marker (point))))
     (message "Sorting entries...done")))
     (message "Sorting entries...done")))
 
 
 (defun org-do-sort (table what &optional with-case sorting-type)
 (defun org-do-sort (table what &optional with-case sorting-type)
@@ -8351,7 +8365,7 @@ the car of the elements of the table.
 If WITH-CASE is non-nil, the sorting will be case-sensitive."
 If WITH-CASE is non-nil, the sorting will be case-sensitive."
   (unless sorting-type
   (unless sorting-type
     (message
     (message
-     "Sort %s: [a]lphabetic. [n]umeric. [t]ime.  A/N/T means reversed:"
+     "Sort %s: [a]lphabetic, [n]umeric, [t]ime.  A/N/T means reversed:"
      what)
      what)
     (setq sorting-type (read-char-exclusive)))
     (setq sorting-type (read-char-exclusive)))
   (let ((dcst (downcase sorting-type))
   (let ((dcst (downcase sorting-type))