Skip to content

Commit

Permalink
lisp/org.el: (org-save-all-org-buffers): Prevent `org-mode' reload
Browse files Browse the repository at this point in the history
* lisp/org.el: (org-save-all-org-buffers): Ensure `save-some-buffers' PRED returns boolean.

As of this upstream commit:

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a9ad3d477441feefa3bf6107d58281cb64e0e78a

`save-some-buffers' will call its PRED argument if it returns a function.
Since (derived-mode-p 'org-mode) returns the symbol org-mode,
and org-mode is a function, org-mode is reloaded in modified Org
buffers when calling `org-save-all-org-buffers'. Among other
undesirable behavior, this will cause the buffer's visibility to be
reset to its initial visibility.
  • Loading branch information
progfolio committed Oct 6, 2021
1 parent cc2490a commit f1fc22f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lisp/org.el
Original file line number Diff line number Diff line change
Expand Up @@ -15366,7 +15366,7 @@ The value is a list, with zero or more of the symbols `effort', `appt',
"Save all Org buffers without user confirmation."
(interactive)
(message "Saving all Org buffers...")
(save-some-buffers t (lambda () (derived-mode-p 'org-mode)))
(save-some-buffers t (lambda () (and (derived-mode-p 'org-mode) t)))
(when (featurep 'org-id) (org-id-locations-save))
(message "Saving all Org buffers... done"))

Expand Down

0 comments on commit f1fc22f

Please sign in to comment.