help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to run a function when I save a file of a particular type


From: David Kastrup
Subject: Re: how to run a function when I save a file of a particular type
Date: Fri, 27 Oct 2006 16:26:17 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]