From a782d2eb266d14122f85222240c94b7ddc0d5ce5 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 9 Apr 2018 11:42:26 +0200 Subject: emacs: added toggle for org-publish-current-file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- emacs/init.org | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'emacs/init.org') diff --git a/emacs/init.org b/emacs/init.org index 704e84d..43a4379 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -1453,6 +1453,19 @@ perform this first: (require 'ox-man) #+END_SRC +Setup a function to toggle =org-publish-current-file= on save: + +#+BEGIN_SRC elisp +(defun toggle-org-publish-current-file-on-save () + (interactive) + (if (memq 'org-publish-current-file after-save-hook) + (progn + (remove-hook 'after-save-hook 'org-publish-current-file t) + (message "Disabled org-publish-current-file for current buffer...")) + (add-hook 'after-save-hook 'org-publish-current-file nil t) + (message "Enabled org-publish-current-file for current buffer..."))) +#+END_SRC + ** Agenda Custom commands for =org-agenda=. -- cgit v1.2.3