Browse Source

Merge branch 'maint'

Bastien Guerry 11 years ago
parent
commit
613333d665
4 changed files with 36 additions and 22 deletions
  1. 7 7
      lisp/org-agenda.el
  2. 18 3
      lisp/org-compat.el
  3. 7 7
      lisp/org-table.el
  4. 4 5
      lisp/org.el

+ 7 - 7
lisp/org-agenda.el

@@ -8294,7 +8294,7 @@ When called with a prefix argument, include all archive files as well."
       (when (next-single-property-change (point-at-eol) 'org-marker)
       (when (next-single-property-change (point-at-eol) 'org-marker)
 	(move-end-of-line 1)
 	(move-end-of-line 1)
 	(goto-char (next-single-property-change (point) 'org-marker))))
 	(goto-char (next-single-property-change (point) 'org-marker))))
-    (org-move-to-column col nil nil t))
+    (org-move-to-column col))
   (org-agenda-do-context-action))
   (org-agenda-do-context-action))
 
 
 (defun org-agenda-previous-item (n)
 (defun org-agenda-previous-item (n)
@@ -8306,7 +8306,7 @@ When called with a prefix argument, include all archive files as well."
 		  (move-end-of-line 0)
 		  (move-end-of-line 0)
 		  (previous-single-property-change (point) 'org-marker))))
 		  (previous-single-property-change (point) 'org-marker))))
       (if goto (goto-char goto))
       (if goto (goto-char goto))
-      (org-move-to-column col nil nil t)))
+      (org-move-to-column col)))
   (org-agenda-do-context-action))
   (org-agenda-do-context-action))
 
 
 (defun org-agenda-do-context-action ()
 (defun org-agenda-do-context-action ()
@@ -8813,7 +8813,7 @@ the same tree node, and the headline of the tree node in the Org-mode file."
       	(string-match (concat "^" (regexp-opt org-done-keywords-for-agenda))
       	(string-match (concat "^" (regexp-opt org-done-keywords-for-agenda))
 		      newhead)
 		      newhead)
 	(org-agenda-unmark-clocking-task))
 	(org-agenda-unmark-clocking-task))
-      (org-move-to-column col nil nil t))))
+      (org-move-to-column col))))
 
 
 (defun org-agenda-add-note (&optional arg)
 (defun org-agenda-add-note (&optional arg)
   "Add a time-stamped note to the entry at point."
   "Add a time-stamped note to the entry at point."
@@ -8969,7 +8969,7 @@ Called with a universal prefix arg, show the priority instead of setting it."
 	  (end-of-line 1)
 	  (end-of-line 1)
 	  (setq newhead (org-get-heading)))
 	  (setq newhead (org-get-heading)))
 	(org-agenda-change-all-lines newhead hdmarker)
 	(org-agenda-change-all-lines newhead hdmarker)
-	(org-move-to-column col nil nil t)))))
+	(org-move-to-column col)))))
 
 
 ;; FIXME: should fix the tags property of the agenda line.
 ;; FIXME: should fix the tags property of the agenda line.
 (defun org-agenda-set-tags (&optional tag onoff)
 (defun org-agenda-set-tags (&optional tag onoff)
@@ -9178,7 +9178,7 @@ Called with a universal prefix arg, show the priority instead of setting it."
       (goto-char (point-max))
       (goto-char (point-max))
       (while (not (bobp))
       (while (not (bobp))
 	(when (equal marker (org-get-at-bol 'org-marker))
 	(when (equal marker (org-get-at-bol 'org-marker))
-	  (org-move-to-column (- (window-width) (length stamp)) t nil t)
+	  (org-move-to-column (- (window-width) (length stamp)) t)
 	  (org-agenda-fix-tags-filter-overlays-at (point))
 	  (org-agenda-fix-tags-filter-overlays-at (point))
           (if (featurep 'xemacs)
           (if (featurep 'xemacs)
 	      ;; Use `duplicable' property to trigger undo recording
 	      ;; Use `duplicable' property to trigger undo recording
@@ -9280,7 +9280,7 @@ ARG is passed through to `org-deadline'."
 	  (org-clock-in arg)
 	  (org-clock-in arg)
 	  (setq newhead (org-get-heading)))
 	  (setq newhead (org-get-heading)))
 	(org-agenda-change-all-lines newhead hdmarker))
 	(org-agenda-change-all-lines newhead hdmarker))
-      (org-move-to-column col nil nil t))))
+      (org-move-to-column col))))
 
 
 (defun org-agenda-clock-out ()
 (defun org-agenda-clock-out ()
   "Stop the currently running clock."
   "Stop the currently running clock."
@@ -9300,7 +9300,7 @@ ARG is passed through to `org-deadline'."
 	    (setq newhead (org-get-heading))))))
 	    (setq newhead (org-get-heading))))))
     (org-agenda-change-all-lines newhead marker)
     (org-agenda-change-all-lines newhead marker)
     (move-marker marker nil)
     (move-marker marker nil)
-    (org-move-to-column col nil nil t)
+    (org-move-to-column col)
     (org-agenda-unmark-clocking-task)))
     (org-agenda-unmark-clocking-task)))
 
 
 (defun org-agenda-clock-cancel (&optional arg)
 (defun org-agenda-clock-cancel (&optional arg)

+ 18 - 3
lisp/org-compat.el

@@ -343,10 +343,25 @@ Works on both Emacs and XEmacs."
       (org-xemacs-without-invisibility (indent-line-to column))
       (org-xemacs-without-invisibility (indent-line-to column))
     (indent-line-to column)))
     (indent-line-to column)))
 
 
-(defun org-move-to-column (column &optional force buffer ignore-invisible)
-  (let ((buffer-invisibility-spec ignore-invisible))
+(defun org-move-to-column (column &optional force buffer)
+  "Move to column COLUMN.
+Pass COLUMN and FORCE to `move-to-column'.
+Pass BUFFER to the XEmacs version of `move-to-column'."
+  (let ((buffer-invisibility-spec
+	 (if (or
+	      ;; Ignore all visibility spec in agenda
+	      (not (derived-mode-p 'org-mode))
+	      ;; Ignore bracket links elsewere
+	      (and (save-excursion
+		     (forward-line 0)
+		     (looking-at (concat "^.*" org-bracket-link-regexp)))
+		   (member '(org-link)
+			   buffer-invisibility-spec)))
+	     t
+	   buffer-invisibility-spec)))
     (if (featurep 'xemacs)
     (if (featurep 'xemacs)
-	(org-xemacs-without-invisibility (move-to-column column force buffer))
+	(org-xemacs-without-invisibility
+	 (move-to-column column force buffer))
       (move-to-column column force))))
       (move-to-column column force))))
 
 
 (defun org-get-x-clipboard-compat (value)
 (defun org-get-x-clipboard-compat (value)

+ 7 - 7
lisp/org-table.el

@@ -1142,12 +1142,12 @@ copying.  In the case of a timestamp, increment by one day."
 		   (< (string-to-number txt) 100000000))
 		   (< (string-to-number txt) 100000000))
 	      (setq txt (format "%d" (+ (string-to-number txt) 1))))
 	      (setq txt (format "%d" (+ (string-to-number txt) 1))))
 	  (insert txt)
 	  (insert txt)
-	  (org-move-to-column col nil nil t)
+	  (org-move-to-column col)
 	  (if (and org-table-copy-increment (org-at-timestamp-p t))
 	  (if (and org-table-copy-increment (org-at-timestamp-p t))
 	      (org-timestamp-up-day)
 	      (org-timestamp-up-day)
 	    (org-table-maybe-recalculate-line))
 	    (org-table-maybe-recalculate-line))
 	  (org-table-align)
 	  (org-table-align)
-	  (org-move-to-column col nil nil t))
+	  (org-move-to-column col))
       (user-error "No non-empty field found"))))
       (user-error "No non-empty field found"))))
 
 
 (defun org-table-check-inside-data-field (&optional noerror)
 (defun org-table-check-inside-data-field (&optional noerror)
@@ -1376,12 +1376,12 @@ However, when FORCE is non-nil, create new columns if necessary."
       t
       t
     (let ((col (current-column))
     (let ((col (current-column))
 	  (end (org-table-end)))
 	  (end (org-table-end)))
-      (org-move-to-column col nil nil t)
+      (org-move-to-column col)
       (while (and (< (point) end)
       (while (and (< (point) end)
 		  (or (not (= (current-column) col))
 		  (or (not (= (current-column) col))
 		      (org-at-table-hline-p)))
 		      (org-at-table-hline-p)))
 	(beginning-of-line 2)
 	(beginning-of-line 2)
-	(org-move-to-column col nil nil t))
+	(org-move-to-column col))
       (if (and (org-at-table-p)
       (if (and (org-at-table-p)
 	       (not (org-at-table-hline-p)))
 	       (not (org-at-table-hline-p)))
 	  t
 	  t
@@ -1530,7 +1530,7 @@ first dline below it is used.  When ABOVE is non-nil, the one above is used."
     (beginning-of-line tonew)
     (beginning-of-line tonew)
     (insert txt)
     (insert txt)
     (beginning-of-line 0)
     (beginning-of-line 0)
-    (org-move-to-column col nil nil t)
+    (org-move-to-column col)
     (unless (or hline1p hline2p
     (unless (or hline1p hline2p
 		(not (or (not org-table-fix-formulas-confirm)
 		(not (or (not org-table-fix-formulas-confirm)
 			 (funcall org-table-fix-formulas-confirm
 			 (funcall org-table-fix-formulas-confirm
@@ -1582,7 +1582,7 @@ With prefix ABOVE, insert above the current line."
     (beginning-of-line (if above 1 2))
     (beginning-of-line (if above 1 2))
     (insert line "\n")
     (insert line "\n")
     (beginning-of-line (if above 1 -1))
     (beginning-of-line (if above 1 -1))
-    (org-move-to-column col nil nil t)
+    (org-move-to-column col)
     (and org-table-overlay-coordinates (org-table-align))))
     (and org-table-overlay-coordinates (org-table-align))))
 
 
 ;;;###autoload
 ;;;###autoload
@@ -1622,7 +1622,7 @@ In particular, this does handle wide and invisible characters."
 	(dline (org-table-current-dline)))
 	(dline (org-table-current-dline)))
     (kill-region (point-at-bol) (min (1+ (point-at-eol)) (point-max)))
     (kill-region (point-at-bol) (min (1+ (point-at-eol)) (point-max)))
     (if (not (org-at-table-p)) (beginning-of-line 0))
     (if (not (org-at-table-p)) (beginning-of-line 0))
-    (org-move-to-column col nil nil t)
+    (org-move-to-column col)
     (when (or (not org-table-fix-formulas-confirm)
     (when (or (not org-table-fix-formulas-confirm)
 	      (funcall org-table-fix-formulas-confirm "Fix formulas? "))
 	      (funcall org-table-fix-formulas-confirm "Fix formulas? "))
       (org-table-fix-formulas "@" (list (cons (number-to-string dline) "INVALID"))
       (org-table-fix-formulas "@" (list (cons (number-to-string dline) "INVALID"))

+ 4 - 5
lisp/org.el

@@ -14533,6 +14533,7 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
 
 
 (defun org-align-tags-here (to-col)
 (defun org-align-tags-here (to-col)
   ;; Assumes that this is a headline
   ;; Assumes that this is a headline
+  "Align tags on the current headline to TO-COL."
   (let ((pos (point)) (col (current-column)) ncol tags-l p)
   (let ((pos (point)) (col (current-column)) ncol tags-l p)
     (beginning-of-line 1)
     (beginning-of-line 1)
     (if	(and (looking-at (org-re ".*?\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"))
     (if	(and (looking-at (org-re ".*?\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"))
@@ -14551,7 +14552,7 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
 	  (insert (make-string (- ncol (current-column)) ?\ ))
 	  (insert (make-string (- ncol (current-column)) ?\ ))
 	  (setq ncol (current-column))
 	  (setq ncol (current-column))
 	  (when indent-tabs-mode (tabify p (point-at-eol)))
 	  (when indent-tabs-mode (tabify p (point-at-eol)))
-	  (org-move-to-column (min ncol col) t nil t))
+	  (org-move-to-column (min ncol col)))
       (goto-char pos))))
       (goto-char pos))))
 
 
 (defun org-set-tags-command (&optional arg just-align)
 (defun org-set-tags-command (&optional arg just-align)
@@ -14610,9 +14611,7 @@ If DATA is nil or the empty string, any tags will be removed."
 (defun org-set-tags (&optional arg just-align)
 (defun org-set-tags (&optional arg just-align)
   "Set the tags for the current headline.
   "Set the tags for the current headline.
 With prefix ARG, realign all tags in headings in the current buffer.
 With prefix ARG, realign all tags in headings in the current buffer.
-When JUST-ALIGN is non-nil, only align tags.
-When JUST-ALIGN is 'ignore-column, align tags without trying to set
-the column by ignoring invisible text."
+When JUST-ALIGN is non-nil, only align tags."
   (interactive "P")
   (interactive "P")
   (if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
   (if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
       (let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level)
       (let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level)
@@ -14709,7 +14708,7 @@ the column by ignoring invisible text."
 	  (and (not (featurep 'xemacs)) c0 indent-tabs-mode (tabify p0 (point)))
 	  (and (not (featurep 'xemacs)) c0 indent-tabs-mode (tabify p0 (point)))
 	  tags)
 	  tags)
 	 (t (error "Tags alignment failed")))
 	 (t (error "Tags alignment failed")))
-	(org-move-to-column col nil nil (not (eq just-align 'ignore-column)))
+	(org-move-to-column col)
 	(unless just-align
 	(unless just-align
 	  (run-hooks 'org-after-tags-change-hook))))))
 	  (run-hooks 'org-after-tags-change-hook))))))