0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 20:37:51 +00:00

Deprecate `org-hide-block-toggle-all'

* lisp/org.el (org-hide-block-toggle-all): move...
* lisp/org-compat.el (org-hide-block-toggle-all): ... here.
This commit is contained in:
Nicolas Goaziou 2020-04-18 12:16:27 +02:00
parent cd9e000d86
commit 4fbc36a057
2 changed files with 16 additions and 4 deletions

View file

@ -661,6 +661,22 @@ an error. Return a non-nil value when toggling is successful."
(interactive)
(ignore-errors (org-hide-block-toggle)))
(defun org-hide-block-toggle-all ()
"Toggle the visibility of all blocks in the current buffer."
(declare (obsolete "please notify Org mailing list if you use this function."
"Org 9.4"))
(let ((start (point-min))
(end (point-max)))
(save-excursion
(goto-char start)
(while (and (< (point) end)
(re-search-forward "^[ \t]*#\\+begin_?\
\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\([^\000]+?\\)#\\+end_?\\1[ \t]*$" end t))
(save-excursion
(save-match-data
(goto-char (match-beginning 0))
(org-hide-block-toggle)))))))
(defmacro org-with-silent-modifications (&rest body)
(declare (obsolete "use `with-silent-modifications' instead." "Org 9.2")
(debug (body)))

View file

@ -6005,10 +6005,6 @@ Return a non-nil value when toggling is successful."
(no-error nil)
(t (user-error "Not at a block")))))
(defun org-hide-block-toggle-all ()
"Toggle the visibility of all blocks in the current buffer."
(org-block-map 'org-hide-block-toggle))
(defun org-hide-block-all ()
"Fold all blocks in the current buffer."
(interactive)