浏览代码

Merge branch 'maint'

Bastien Guerry 11 年之前
父节点
当前提交
6af8e429f8
共有 1 个文件被更改,包括 12 次插入10 次删除
  1. 12 10
      lisp/org-agenda.el

+ 12 - 10
lisp/org-agenda.el

@@ -9909,11 +9909,12 @@ current HH:MM time."
   "Drag an agenda line forward by ARG lines."
   (interactive "p")
   (let ((inhibit-read-only t) lst)
-    (if (save-excursion
-	  (dotimes (n arg)
-	    (beginning-of-line 2)
-	    (push (not (get-text-property (point) 'txt)) lst))
-	  (delq nil lst))
+    (if (or (not (get-text-property (point) 'txt))
+	    (save-excursion
+	      (dotimes (n arg)
+		(move-beginning-of-line 2)
+		(push (not (get-text-property (point) 'txt)) lst))
+	      (delq nil lst)))
 	(message "Cannot move line forward")
       (org-drag-line-forward arg))))
 
@@ -9921,11 +9922,12 @@ current HH:MM time."
   "Drag an agenda line backward by ARG lines."
   (interactive "p")
   (let ((inhibit-read-only t) lst)
-    (if (save-excursion
-	  (dotimes (n arg)
-	    (beginning-of-line 0)
-	    (push (not (get-text-property (point) 'txt)) lst))
-	  (delq nil lst))
+    (if (or (not (get-text-property (point) 'txt))
+	    (save-excursion
+	      (dotimes (n arg)
+		(move-beginning-of-line 0)
+		(push (not (get-text-property (point) 'txt)) lst))
+	      (delq nil lst)))
 	(message "Cannot move line backward")
       (org-drag-line-backward arg))))