aboutsummaryrefslogtreecommitdiff
path: root/emacs/init.org
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2018-04-09 11:42:26 +0200
committerMiquel Sabaté Solà <msabate@suse.com>2018-04-09 11:42:26 +0200
commita782d2eb266d14122f85222240c94b7ddc0d5ce5 (patch)
tree166b6e0a415d3112a7af3d4c4366792ba599bfc9 /emacs/init.org
parent7f43c0bf1961adacb2b9e4b496e148919e20fad5 (diff)
downloaddotfiles-a782d2eb266d14122f85222240c94b7ddc0d5ce5.tar.gz
dotfiles-a782d2eb266d14122f85222240c94b7ddc0d5ce5.zip
emacs: added toggle for org-publish-current-file
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'emacs/init.org')
-rw-r--r--emacs/init.org13
1 files changed, 13 insertions, 0 deletions
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=.