Philipp Haselwarter
unread,May 28, 2012, 5:08:04 AM5/28/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to help-gn...@gnu.org
Your code modifies `after-save-hook', which is a global variable, every
time `org-mode-hook' is run.
`add-hook' also allows to modify hooks buffer-locally. From its
docstring:
> The optional fourth argument, LOCAL, if non-nil, says to modify
> the hook's buffer-local value rather than its global value.
> This makes the hook buffer-local, and it makes t a member of the
> buffer-local value. That acts as a flag to run the hook
> functions of the global value as well as in the local value.
You can use this to change the value of `after-save-hook' only in those
buffers that run the `org-mode-hook'. This should do:
(add-hook
'org-mode-hook
(lambda nil
(add-hook 'after-save-hook
(lambda nil (org-mobile-push))
nil 'local))) ;Only in the current buffer
--
Philipp Haselwarter