浏览代码

org.el: Display a message when a checkbox could not be updated

* lisp/org.el (org-ctrl-c-ctrl-c): Display a message when the
checkbox item at point could not be updated.

* lisp/org-list.el (org-list-write-struct): Return the updated
structure.
Bastien 7 年之前
父节点
当前提交
b5b7bb8446
共有 2 个文件被更改,包括 8 次插入3 次删除
  1. 3 1
      lisp/org-list.el
  2. 5 2
      lisp/org.el

+ 3 - 1
lisp/org-list.el

@@ -2012,7 +2012,9 @@ doesn't correspond anymore to the real list in buffer."
       ;; 5. Eventually fix checkboxes.
       (org-list-struct-fix-box struct parents prevs))
     ;; 6. Apply structure modifications to buffer.
-    (org-list-struct-apply-struct struct old-struct)))
+    (org-list-struct-apply-struct struct old-struct))
+  ;; 7. Return the updated structure
+  struct)
 
 
 

+ 5 - 2
lisp/org.el

@@ -20282,8 +20282,11 @@ This command does many different things, depending on context:
 	     ;; item of the list and no argument is provided, simply
 	     ;; toggle checkbox of that item, if any.
 	     (org-list-set-checkbox begin struct new-box)))
-	   (org-list-write-struct
-	    struct (org-list-parents-alist struct) old-struct)
+	   (when (equal
+		  (org-list-write-struct
+		   struct (org-list-parents-alist struct) old-struct)
+		  old-struct)
+	     (message "Cannot update this checkbox"))
 	   (org-update-checkbox-count-maybe)))
 	((or `property-drawer `node-property)
 	 (call-interactively #'org-property-action))