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

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

Re: How to preprocess emacsclient with a mode choice?


From: Eli Zaretskii
Subject: Re: How to preprocess emacsclient with a mode choice?
Date: Sat, 30 Nov 2013 10:10:36 +0200

> Date: Fri, 29 Nov 2013 16:47:45 -0800 (PST)
> From: Rustom Mody <rustompmody@gmail.com>
> Injection-Date: Sat, 30 Nov 2013 00:47:46 +0000
> 
> On Saturday, November 30, 2013 1:16:27 AM UTC+5:30, Eli Zaretskii wrote:
> > > Date: Fri, 29 Nov 2013 09:49:09 -0800 (PST)
> > > From: Rustom Mody 
> > > 
> > > How to programmatically (ie in elisp) visit a file with a specific mode?
> > > say a .c file in text mode
> >
> > What's wrong with turning on the mode as part of the arguments you
> > pass to emacsclient?
> 
> You mean like this?
> emacsclient -e "(progn (find-file \"foo\") (auto-fill-mode) (raise-frame))"

Yes.

> Heh! thats better than anything I came up with -- thanks!

You are welcome.

> Still wonder what makes the raise-frame necessary...
> Also something fundamentally is different in the client-server relation 
> between this and:
> emacsclient foo
> 
> In the latter I have to do C-x #. In the former not

All of these because when you visit a file via --eval, Emacs doesn't
"know" you visited it via the client, so it doesn't do the special
magic for that.

However, since this is a very special case, I don't think a better
solution is needed.



reply via email to

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