Explorar o código

org.el (org-ctrl-c-ctrl-c): Throw a user error when trying to toggle a blocked checkbox

* org.el (org-ctrl-c-ctrl-c): Throw a user error when trying
to toggle a blocked checkbox.
Bastien Guerry %!s(int64=12) %!d(string=hai) anos
pai
achega
a62beff06d
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      lisp/org.el

+ 4 - 2
lisp/org.el

@@ -19122,8 +19122,10 @@ This command does many different things, depending on context:
 	  (org-list-struct-fix-ind struct parents)
 	  (setq block-item
 		(org-list-struct-fix-box struct parents prevs orderedp)))
-	(org-list-struct-apply-struct struct old-struct)
-	(org-update-checkbox-count-maybe)
+	(if (equal struct old-struct)
+	    (user-error "Cannot toggle this checkbox (unchecked subitems?)")
+	  (org-list-struct-apply-struct struct old-struct)
+	  (org-update-checkbox-count-maybe))
 	(when block-item
 	  (message
 	   "Checkboxes were removed due to unchecked box at line %d"