unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: How to preprocess emacsclient with a mode choice?
Date: Sat, 30 Nov 2013 10:10:36 +0200	[thread overview]
Message-ID: <8338me71j7.fsf@gnu.org> (raw)
In-Reply-To: <02822e31-032b-4fcb-87d4-f21716cd9ef5@googlegroups.com>

> 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	other threads:[~2013-11-30  8:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-28 14:48 How to preprocess emacsclient with a mode choice? Rustom Mody
2013-11-29 16:21 ` Kevin Rodgers
     [not found] ` <mailman.7480.1385742029.10748.help-gnu-emacs@gnu.org>
2013-11-29 17:49   ` Rustom Mody
2013-11-29 19:46     ` Eli Zaretskii
     [not found]     ` <mailman.7495.1385754413.10748.help-gnu-emacs@gnu.org>
2013-11-30  0:47       ` Rustom Mody
2013-11-30  8:10         ` Eli Zaretskii [this message]
     [not found]         ` <mailman.7608.1385799063.10748.help-gnu-emacs@gnu.org>
2013-12-02  4:59           ` Rustom Mody

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8338me71j7.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).