emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [OT] emacsclient -t (was Re: [OT] Have you also got hooked by Vim?)
@ 2011-01-21 17:41 Jeff Horn
  2011-01-21 17:45 ` Jeff Horn
  2011-01-21 17:54 ` Erik Iverson
  0 siblings, 2 replies; 3+ messages in thread
From: Jeff Horn @ 2011-01-21 17:41 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: Matt Lundin, emacs-orgmode, Dan Davison

On Thu, Jan 20, 2011 at 11:00 AM, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
> Matt Lundin <mdl@imapmail.org> writes:
>
>> Jeff Horn <jrhorn424@gmail.com> writes:
>>
>>> On Wed, Jan 19, 2011 at 9:51 PM, Matt Lundin <mdl@imapmail.org> wrote:
>>>> alias emacs="emacsclient -t -a /usr/bin/emacs"
>>>
>>> Thanks for sharing this. My manual doesn't mention the -t flag. What
>>> does it do? (I didn't know about -a, but it looks nifty)
>>>
>>
>> Now that I consider this further (and read the emacs man page), I'm not
>> sure if the -t flag is correct here. (It may be new to emacs 24).
>>
>> In any case, "-nw" is the tried and true flag for doing this.
>
> IIRC, -t is the same as -nw and is present from emacs 23.1 (maybe
> earlier) onwards.  Very useful when connecting from a non-graphical
> terminal (e.g. a mobile phone) to an existing Emacs running on
> X... something I do frequently via =screen= for emulating a persistent
> connection.

So IIUC, I have a windowed Emacsen running on a box where I work. If I
run `emacsclient -t somefile.txt` from an SSH connection to that box,
it uses the server that was started by the windowed emacs, but instead
of opening the file in the windowed emacs, it re-routes it to my SSH
session?

This would be extremely useful to me. However, when I tried that on my
box just now, the terminal session froze and the windowed emacs was
brought to the front without the correct buffer being displayed...
wonder what I'm doing wrong... This is in my bash profile:

function ec(){
    emacsclient $1 --alternate-editor="" -t &
}

Any clues?

-- 
Jeffrey Horn
http://www.failuretorefrain.com/jeff/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OT] emacsclient -t (was Re: [OT] Have you also got hooked by Vim?)
  2011-01-21 17:41 [OT] emacsclient -t (was Re: [OT] Have you also got hooked by Vim?) Jeff Horn
@ 2011-01-21 17:45 ` Jeff Horn
  2011-01-21 17:54 ` Erik Iverson
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Horn @ 2011-01-21 17:45 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: Matt Lundin, emacs-orgmode, Dan Davison

On Fri, Jan 21, 2011 at 12:41 PM, Jeff Horn <jrhorn424@gmail.com> wrote:
> On Thu, Jan 20, 2011 at 11:00 AM, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
>> Matt Lundin <mdl@imapmail.org> writes:
>>
>>> Jeff Horn <jrhorn424@gmail.com> writes:
>>>
>>>> On Wed, Jan 19, 2011 at 9:51 PM, Matt Lundin <mdl@imapmail.org> wrote:
>>>>> alias emacs="emacsclient -t -a /usr/bin/emacs"
>>>>
>>>> Thanks for sharing this. My manual doesn't mention the -t flag. What
>>>> does it do? (I didn't know about -a, but it looks nifty)
>>>>
>>>
>>> Now that I consider this further (and read the emacs man page), I'm not
>>> sure if the -t flag is correct here. (It may be new to emacs 24).
>>>
>>> In any case, "-nw" is the tried and true flag for doing this.
>>
>> IIRC, -t is the same as -nw and is present from emacs 23.1 (maybe
>> earlier) onwards.  Very useful when connecting from a non-graphical
>> terminal (e.g. a mobile phone) to an existing Emacs running on
>> X... something I do frequently via =screen= for emulating a persistent
>> connection.
>
> So IIUC, I have a windowed Emacsen running on a box where I work. If I
> run `emacsclient -t somefile.txt` from an SSH connection to that box,
> it uses the server that was started by the windowed emacs, but instead
> of opening the file in the windowed emacs, it re-routes it to my SSH
> session?
>
> This would be extremely useful to me. However, when I tried that on my
> box just now, the terminal session froze and the windowed emacs was
> brought to the front without the correct buffer being displayed...
> wonder what I'm doing wrong... This is in my bash profile:
>
> function ec(){
>    emacsclient $1 --alternate-editor="" -t &
> }
>
> Any clues?

Always too quick to e-mail... the trailing & was causing issues. I
want this when I'm sitting at the box, but don't when I'm not. Time to
figure out how to write a conditional for bash...

-- 
Jeffrey Horn
http://www.failuretorefrain.com/jeff/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OT] emacsclient -t (was Re: [OT] Have you also got hooked by Vim?)
  2011-01-21 17:41 [OT] emacsclient -t (was Re: [OT] Have you also got hooked by Vim?) Jeff Horn
  2011-01-21 17:45 ` Jeff Horn
@ 2011-01-21 17:54 ` Erik Iverson
  1 sibling, 0 replies; 3+ messages in thread
From: Erik Iverson @ 2011-01-21 17:54 UTC (permalink / raw)
  To: Jeff Horn; +Cc: Matt Lundin, emacs-orgmode, Dan Davison



Jeff Horn wrote:
> On Thu, Jan 20, 2011 at 11:00 AM, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
>> Matt Lundin <mdl@imapmail.org> writes:
>>
>>> Jeff Horn <jrhorn424@gmail.com> writes:
>>>
>>>> On Wed, Jan 19, 2011 at 9:51 PM, Matt Lundin <mdl@imapmail.org> wrote:
>>>>> alias emacs="emacsclient -t -a /usr/bin/emacs"
>>>> Thanks for sharing this. My manual doesn't mention the -t flag. What
>>>> does it do? (I didn't know about -a, but it looks nifty)
>>>>
>>> Now that I consider this further (and read the emacs man page), I'm not
>>> sure if the -t flag is correct here. (It may be new to emacs 24).
>>>
>>> In any case, "-nw" is the tried and true flag for doing this.
>> IIRC, -t is the same as -nw and is present from emacs 23.1 (maybe
>> earlier) onwards.  Very useful when connecting from a non-graphical
>> terminal (e.g. a mobile phone) to an existing Emacs running on
>> X... something I do frequently via =screen= for emulating a persistent
>> connection.
> 
> So IIUC, I have a windowed Emacsen running on a box where I work. If I
> run `emacsclient -t somefile.txt` from an SSH connection to that box,
> it uses the server that was started by the windowed emacs, but instead
> of opening the file in the windowed emacs, it re-routes it to my SSH
> session?

Even possibly better, if you've got X-forwarding enabled on your
SSH connection, you can start a windowed emacs instance on your
local machine that exactly matches the one on the server, even
with all the same buffers open, processes running, etc.

I use this type of setup at home.  You need to start emacs in
'daemon' mode, see 
http://emacs-fu.blogspot.com/2009/02/emacs-daemon.html , for
example.  That site has examples of how to use it.

One caveat. I use Ubuntu, and I think I had to do something
special with my Xauth file for this to work, please follow
up if you run into trouble and use Ubuntu, and I'll be glad
to look into what I did.

--Erik

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-21 17:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-21 17:41 [OT] emacsclient -t (was Re: [OT] Have you also got hooked by Vim?) Jeff Horn
2011-01-21 17:45 ` Jeff Horn
2011-01-21 17:54 ` Erik Iverson

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).