[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: chmod after file write
From: |
Kai Großjohann |
Subject: |
Re: chmod after file write |
Date: |
Fri, 11 Oct 2002 09:51:15 +0200 |
User-agent: |
Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu) |
Ted Zlatanov <address@hidden> writes:
> Very often I need to do a chmod for specific files after saving them,
> for instance I would like a rule that all files matching
>
> .*lifelogs.com:.*html
>
> should have permissions "a+r" set after writing. I don't want to set
> the umask open for all new files on this host, so I can't do it
> through the shell variables. Is there a hook I can use in tramp, and
> a command I can run in that hook to do what I want?
There is no predefined functionality in Tramp for doing this. It
seems that set-default-file-modes sets a default which is Emacs-wide,
so this is not a solution for you. Hm.
But it seems to me that any mechanism for this should not be specific
to Tramp, instead it should work for any files.
How about writing a function that looks up the right modes in an
alist and then invoke that function from after-save-hook? Would that
work?
I'm thinking that shell mode might have a mechanism for this. I
vaguely recall that someone mentioned that shell mode can make sure
that the file is executable after it is saved. Maybe that mechanism
is general enough to be (ab)used for your purpose.
Let us know your findings, it's an interesting subject. (I hope the
other readers here won't mind :-)
kai
--
~/.signature is: umop ap!sdn (Frank Nobis)