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

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

Re: Setting Group Ownership


From: Tim Haynes
Subject: Re: Setting Group Ownership
Date: Tue, 10 Dec 2002 14:45:11 +0000
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-debian-linux-gnu)

"CarlC" <carlc@snowbd.com> writes:

> When a file is saved I would like to set the file's group owner to an
> environment variable. This is on a Linux box. I know that I can use
> after-save-hook. I assume that I would have to call a shell command to do
> this. I don't know how access an environment variable and call the chgrp
> command from emacs. Any help would be appreciated.

Consider:

M-: (shell-command (concat "echo " (getenv "HOME")))

change a couple of things, you might have got what you want? :8)

~Tim
-- 
A spark of life                             |piglet@stirfried.vegetable.org.uk
On a wire from heaven                       |http://spodzone.org.uk/
>From help-gnu-emacs-bounces@gnu.org  Tue Dec 10 10:05:11 2002
Path: 
shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!eusc.inter.net!newsfeed.stueberl.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail
From: David Kastrup <David.Kastrup@t-online.de>
Newsgroups: gnu.emacs.help
Date: 10 Dec 2002 15:59:36 +0100
Organization: T-Online
Lines: 28
Sender: dak@lola.goethe.zz
Message-ID: <x5pts9ex7r.fsf@lola.goethe.zz>
References: <6hnJ9.5028$ci6.42894520@news-text.cableinet.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.t-online.com 1039532377 02 10472 6ALLEojTSZAc-j 021210 14:59:37
X-Complaints-To: abuse@t-online.com
X-Sender: 520018396234-0001@t-dialin.net
X-Face: 2FEFf>]>q>2iw=B6,xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl
        \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN;i";
        /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^
        Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50
Xref: shelby.stanford.edu gnu.emacs.help:107950
To: help-gnu-emacs@gnu.org
Subject: Re: How to use set-fill-column as a hook?
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 10 Dec 2002 15:05:11 -0000

Adam <a24061@void.yahoo.void.com> writes:

> I have the following in ~/.emacs:
> 
> (add-hook 'text-mode-hook 'turn-on-auto-fill)
> (add-hook 'latex-mode-hook 'turn-on-auto-fill)
> 
> I now want to set the fill-column differently for LaTeX files.
> 
> This doesn't do anything (I verified with C-h v that the value of 
> fill-column is 70, the default):
> (add-hook 'latex-mode-hook '('set-fill-column 100))
> 
> This gives an error when starting emacs:
> (add-hook 'latex-mode-hook ('set-fill-column 100))
> 
> What's the correct syntax?

(add-hook 'latex-mode-hook (lambda() (set-fill-column 100)))

> Also, once I've done that, can I set it differently for mail-mode and 
> text-mode?

Sure, just the same like above.  Of course, latex-mode also runs
text-mode-hook, but it might run it before latex-mode-hook.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
>From help-gnu-emacs-bounces@gnu.org  Tue Dec 10 10:30:14 2002
Path: 
shelby.stanford.edu!newsfeed.stanford.edu!nntp.cs.ubc.ca!nntp-relay.ihug.net!ihug.co.nz!west.cox.net!cox.net!news-hub.cableinet.net!blueyonder!internal-news-hub.cableinet.net!news-text.cableinet.net.POSTED!53ab2750!not-for-mail
From: Adam <a24061@void.yahoo.void.com>
Newsgroups: gnu.emacs.help
References: <6hnJ9.5028$ci6.42894520@news-text.cableinet.net>
        <x5pts9ex7r.fsf@lola.goethe.zz>
Lines: 33
Organization: n/a
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
Message-ID: <JJnJ9.5043$ZA6.43162800@news-text.cableinet.net>
Date: Tue, 10 Dec 2002 15:27:37 GMT
NNTP-Posting-Host: 80.194.70.67
X-Complaints-To: abuse@blueyonder.co.uk
X-Trace: news-text.cableinet.net 1039534057 80.194.70.67 (Tue, 10 Dec 2002
        15:27:37 GMT)
NNTP-Posting-Date: Tue, 10 Dec 2002 15:27:37 GMT
Xref: shelby.stanford.edu gnu.emacs.help:107951
To: help-gnu-emacs@gnu.org
Subject: Re: How to use set-fill-column as a hook?
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Tue, 10 Dec 2002 15:30:14 -0000

On Tuesday 10 December 2002 14:59, David Kastrup wrote:

>> What's the correct syntax?
> 
> (add-hook 'latex-mode-hook (lambda() (set-fill-column 100)))
> 
>> Also, once I've done that, can I set it differently for mail-mode and
>> text-mode?
> 
> Sure, just the same like above.  Of course, latex-mode also runs
> text-mode-hook, but it might run it before latex-mode-hook.

OK, that's exactly what I wanted but things are occurring in the 
wrong order. I now have the following in my .emacs file: 

(add-hook 'text-mode-hook 'turn-on-auto-fill)
(add-hook 'latex-mode-hook 'turn-on-auto-fill)
(add-hook 'html-mode-hook 'turn-off-auto-fill)
(add-hook 'latex-mode-hook (lambda() (set-fill-column 100)))
(add-hook 'mail-mode-hook (lambda() (set-fill-column 60)))
(add-hook 'text-mode-hook (lambda() (set-fill-column 80)))

When I start Emacs in *scratch*, fill-column = 70 (default). If I open a 
text or LaTeX file, it changes to 80. If I "C-x m", it changes to 60.

So mail-mode is picking up turn-on-auto-fill from text-mode, but its own 
set-fill-column is overriding that of text-mode.

But latex-mode's set-fill-column is being overridden by the text-mode-hook. 
Any ideas on how to change that?

-- Adam


reply via email to

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