all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to run a function when I save a file of a particular type
@ 2006-10-27 14:17 joearms
  2006-10-27 14:26 ` David Kastrup
  0 siblings, 1 reply; 2+ messages in thread
From: joearms @ 2006-10-27 14:17 UTC (permalink / raw)



How can I run a function (say foo) just before I save a file
with extension ".bar"

/Joe

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: how to run a function when I save a file of a particular type
  2006-10-27 14:17 how to run a function when I save a file of a particular type joearms
@ 2006-10-27 14:26 ` David Kastrup
  0 siblings, 0 replies; 2+ messages in thread
From: David Kastrup @ 2006-10-27 14:26 UTC (permalink / raw)


"joearms@gmail.com" <joearms@gmail.com> writes:

> How can I run a function (say foo) just before I save a file
> with extension ".bar"

(add-hook 'before-save-hook
  (lambda nil
    (and (stringp buffer-file-name)
         (string= (file-name-extension buffer-file-name t) ".bar")
         (foo))))

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-10-27 14:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-27 14:17 how to run a function when I save a file of a particular type joearms
2006-10-27 14:26 ` David Kastrup

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.