Browse Source

Small bug fixes for inserting tabulators and for cursor positioning.

Carsten Dominik 17 years ago
parent
commit
a476426a73
2 changed files with 23 additions and 6 deletions
  1. 15 0
      lisp/ChangeLog
  2. 8 6
      lisp/org.el

+ 15 - 0
lisp/ChangeLog

@@ -1,5 +1,20 @@
+2008-06-15  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org.el (org-beginning-of-line): Cater for the case when there
+	are toags but no headline text.
+	(org-align-tags-here): Convert to tabs only when indent-tabs-mode
+	it set.
+
 2008-06-13  Carsten Dominik  <dominik@science.uva.nl>
 
+	* org-mhe.el (org-mhe-get-message-folder-from-index): Make sure
+	the return value is nil instead of "nil" when there is no match.
+
+	* org-exp.el (org-insert-centered): Use fill-column instead of
+	80.
+	(org-export-as-ascii): Use string-width to measure the width of
+	the heading.
+
 	* org.el (org-diary-to-ical-string): No longer kill buffer
 	FROMBUF, this is now done by the caller.
 

+ 8 - 6
lisp/org.el

@@ -9560,7 +9560,7 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
 	  (setq p (point))
 	  (insert (make-string (- ncol (current-column)) ?\ ))
 	  (setq ncol (current-column))
-	  (tabify p (point-at-eol))
+	  (when indent-tabs-mode (tabify p (point-at-eol)))
 	  (org-move-to-column (min ncol col) t))
       (goto-char pos))))
 
@@ -14020,7 +14020,7 @@ If this is a headline, and `org-special-ctrl-a/e' is set, ignore tags on the
 first attempt, and only move to after the tags when the cursor is already
 beyond the end of the headline."
   (interactive "P")
-  (let ((pos (point)))
+  (let ((pos (point)) refpos)
     (beginning-of-line 1)
     (if (bobp)
 	nil
@@ -14032,16 +14032,18 @@ beyond the end of the headline."
 	(forward-char 1)))
     (when org-special-ctrl-a/e
       (cond
-       ((and (looking-at org-todo-line-regexp)
+       ((and (looking-at org-complex-heading-regexp)
 	     (= (char-after (match-end 1)) ?\ ))
+	(setq refpos (min (1+ (or (match-end 3) (match-end 2) (match-end 1)))
+			  (point-at-eol)))
 	(goto-char
 	 (if (eq org-special-ctrl-a/e t)
-	     (cond ((> pos (match-beginning 3)) (match-beginning 3))
-		   ((= pos (point)) (match-beginning 3))
+	     (cond ((> pos refpos) refpos)
+		   ((= pos (point)) refpos)
 		   (t (point)))
 	   (cond ((> pos (point)) (point))
 		 ((not (eq last-command this-command)) (point))
-		 (t (match-beginning 3))))))
+		 (t refpos)))))
        ((org-at-item-p)
 	(goto-char
 	 (if (eq org-special-ctrl-a/e t)