unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* eshell - editing files
@ 2010-06-22  8:52 Gary
  2010-06-22  9:17 ` Richard Riley
  2010-06-22 13:03 ` Matt Lundin
  0 siblings, 2 replies; 11+ messages in thread
From: Gary @ 2010-06-22  8:52 UTC (permalink / raw)
  To: help-gnu-emacs

This may sound like a weird question. Is there any way to configure
eshell so that when I want to edit a file, e.g. by typing "emacs foo", I
instead get a new buffer with the file in? It kind of popped up because
if you do something with svn that requires editing something, I got
,----
| $ svn pe svn:ignore .
| emacs: Terminal type "dumb" is not powerful enough to run Emacs.
| It lacks the ability to position the cursor.
| If that is not the actual type of terminal you have,
| use the Bourne shell command `TERM=... export TERM' (C-shell:
| `setenv TERM ...') to specify the correct type.  It may be necessary
| to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.
| svn: system('emacs svn-prop.tmp') returned 256
`----




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

* Re: eshell - editing files
  2010-06-22  8:52 eshell - editing files Gary
@ 2010-06-22  9:17 ` Richard Riley
  2010-06-22 10:54   ` Gary
  2010-06-22 13:03 ` Matt Lundin
  1 sibling, 1 reply; 11+ messages in thread
From: Richard Riley @ 2010-06-22  9:17 UTC (permalink / raw)
  To: help-gnu-emacs

Gary <help-gnu-emacs@garydjones.name> writes:

> This may sound like a weird question. Is there any way to configure
> eshell so that when I want to edit a file, e.g. by typing "emacs foo", I
> instead get a new buffer with the file in? It kind of popped up because
> if you do something with svn that requires editing something, I got
> ,----
> | $ svn pe svn:ignore .
> | emacs: Terminal type "dumb" is not powerful enough to run Emacs.
> | It lacks the ability to position the cursor.
> | If that is not the actual type of terminal you have,
> | use the Bourne shell command `TERM=... export TERM' (C-shell:
> | `setenv TERM ...') to specify the correct type.  It may be necessary
> | to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.
> | svn: system('emacs svn-prop.tmp') returned 256
> `----
>

Set your EDITOR to use emacsclient.

The emacs wiki has more details.

http://www.emacswiki.org/emacs/EmacsClient#toc2




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

* Re: eshell - editing files
       [not found] <mailman.6.1277197523.11696.help-gnu-emacs@gnu.org>
@ 2010-06-22  9:21 ` Pascal J. Bourguignon
  2010-06-22 10:10 ` Tim X
  1 sibling, 0 replies; 11+ messages in thread
From: Pascal J. Bourguignon @ 2010-06-22  9:21 UTC (permalink / raw)
  To: help-gnu-emacs

Gary <help-gnu-emacs@garydjones.name> writes:

> This may sound like a weird question. Is there any way to configure
> eshell so that when I want to edit a file, e.g. by typing "emacs foo", I
> instead get a new buffer with the file in? It kind of popped up because
> if you do something with svn that requires editing something, I got
> ,----
> | $ svn pe svn:ignore .
> | emacs: Terminal type "dumb" is not powerful enough to run Emacs.
> | It lacks the ability to position the cursor.
> | If that is not the actual type of terminal you have,
> | use the Bourne shell command `TERM=... export TERM' (C-shell:
> | `setenv TERM ...') to specify the correct type.  It may be necessary
> | to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.
> | svn: system('emacs svn-prop.tmp') returned 256
> `----

Use emacsclient instead.

In your ~/.bashrc put:

export EDITOR=emacsclient
export VISUAL=$EDITOR


In your ~/.emacs put:

(server-start)


For eshell, I don't know how it takes its environment.  Perhaps it
just uses that of emacs, so you could also put in your ~/.emacs:

(require 'cl)
(setf (getenv "EDITOR") "emacsclient"
      (getenv "VISUAL") "emacsclient")


Then instead of typing:

    emacs foo
type:
    emacsclient foo

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/


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

* Re: eshell - editing files
       [not found] <mailman.6.1277197523.11696.help-gnu-emacs@gnu.org>
  2010-06-22  9:21 ` Pascal J. Bourguignon
@ 2010-06-22 10:10 ` Tim X
  1 sibling, 0 replies; 11+ messages in thread
From: Tim X @ 2010-06-22 10:10 UTC (permalink / raw)
  To: help-gnu-emacs

Gary <help-gnu-emacs@garydjones.name> writes:

> This may sound like a weird question. Is there any way to configure
> eshell so that when I want to edit a file, e.g. by typing "emacs foo", I
> instead get a new buffer with the file in? It kind of popped up because
> if you do something with svn that requires editing something, I got
> ,----
> | $ svn pe svn:ignore .
> | emacs: Terminal type "dumb" is not powerful enough to run Emacs.
> | It lacks the ability to position the cursor.
> | If that is not the actual type of terminal you have,
> | use the Bourne shell command `TERM=... export TERM' (C-shell:
> | `setenv TERM ...') to specify the correct type.  It may be necessary
> | to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.
> | svn: system('emacs svn-prop.tmp') returned 256
> `----
>
>

What you want to do is setup svn to use emacs as the editor via
emacscleint. You can either do this in svn config files or you can set
your shell EDITOR variable to emacsclient. 

tim

-- 
tcross (at) rapttech dot com dot au


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

* Re: eshell - editing files
  2010-06-22  9:17 ` Richard Riley
@ 2010-06-22 10:54   ` Gary
  2010-06-22 11:15     ` Thierry Volpiatto
  0 siblings, 1 reply; 11+ messages in thread
From: Gary @ 2010-06-22 10:54 UTC (permalink / raw)
  To: help-gnu-emacs

Richard Riley writes:
> Gary writes:
>
>> This may sound like a weird question. Is there any way to configure
>> eshell so that when I want to edit a file, e.g. by typing "emacs foo", I
>> instead get a new buffer with the file in? It kind of popped up because
>> if you do something with svn that requires editing something, I got
>> ,----
>> | $ svn pe svn:ignore .
>> | emacs: Terminal type "dumb" is not powerful enough to run Emacs.
..
> Set your EDITOR to use emacsclient.

It is, actually. Although I suspect it wasn't working correctly before
because of my confusion between EDITOR and my aliases. Now, however,
having set it explicitly to emacsclient:

,----
| /home/jg/work/drivers/lib/Src $ env | grep "EDITOR"
| EDITOR=emacsclient -t --alternate-editor=""
| 
| /home/jg/work/drivers/lib/Src $ svn pe svn:ignore .
| *ERROR*: Terminal type "dumb" is not powerful enough to run Emacs
| No changes to property 'svn:ignore' on '.'
`----




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

* Re: eshell - editing files
  2010-06-22 10:54   ` Gary
@ 2010-06-22 11:15     ` Thierry Volpiatto
  2010-06-22 11:31       ` Richard Riley
  2010-06-22 15:44       ` Gary
  0 siblings, 2 replies; 11+ messages in thread
From: Thierry Volpiatto @ 2010-06-22 11:15 UTC (permalink / raw)
  To: help-gnu-emacs

Gary <help-gnu-emacs@garydjones.name> writes:

> Richard Riley writes:
>> Gary writes:
>>
>>> This may sound like a weird question. Is there any way to configure
>>> eshell so that when I want to edit a file, e.g. by typing "emacs foo", I
>>> instead get a new buffer with the file in? It kind of popped up because
>>> if you do something with svn that requires editing something, I got
>>> ,----
>>> | $ svn pe svn:ignore .
>>> | emacs: Terminal type "dumb" is not powerful enough to run Emacs.
> ..
>> Set your EDITOR to use emacsclient.
>
> It is, actually. Although I suspect it wasn't working correctly before
> because of my confusion between EDITOR and my aliases. Now, however,
> having set it explicitly to emacsclient:
>
> ,----
> | /home/jg/work/drivers/lib/Src $ env | grep "EDITOR"
> | EDITOR=emacsclient -t --alternate-editor=""
> | 
> | /home/jg/work/drivers/lib/Src $ svn pe svn:ignore .
> | *ERROR*: Terminal type "dumb" is not powerful enough to run Emacs
> | No changes to property 'svn:ignore' on '.'
> `----

Are you running these commands from inside emacs? eshell? where?

If yes, because your EDITOR is bind to emacsclient -t, it try to open an
emacsclient inside the emacs terminal (eshell or something else) and it
fail because terminal is not powerful enough to run emacs.

If so, use as EDITOR:(make a script maybe)

emacsclient -a "" "$@"
or
emacsclient -a "emacs -Q" "$@"

Be sure also you have an emacs server running.

-- 
Thierry Volpiatto
Gpg key: http://pgp.mit.edu/




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

* Re: eshell - editing files
  2010-06-22 11:15     ` Thierry Volpiatto
@ 2010-06-22 11:31       ` Richard Riley
  2010-06-22 15:44       ` Gary
  1 sibling, 0 replies; 11+ messages in thread
From: Richard Riley @ 2010-06-22 11:31 UTC (permalink / raw)
  To: help-gnu-emacs

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> Gary <help-gnu-emacs@garydjones.name> writes:
>
>> Richard Riley writes:
>>> Gary writes:
>>>
>>>> This may sound like a weird question. Is there any way to configure
>>>> eshell so that when I want to edit a file, e.g. by typing "emacs foo", I
>>>> instead get a new buffer with the file in? It kind of popped up because
>>>> if you do something with svn that requires editing something, I got
>>>> ,----
>>>> | $ svn pe svn:ignore .
>>>> | emacs: Terminal type "dumb" is not powerful enough to run Emacs.
>> ..
>>> Set your EDITOR to use emacsclient.
>>
>> It is, actually. Although I suspect it wasn't working correctly before
>> because of my confusion between EDITOR and my aliases. Now, however,
>> having set it explicitly to emacsclient:
>>
>> ,----
>> | /home/jg/work/drivers/lib/Src $ env | grep "EDITOR"
>> | EDITOR=emacsclient -t --alternate-editor=""
>> | 
>> | /home/jg/work/drivers/lib/Src $ svn pe svn:ignore .
>> | *ERROR*: Terminal type "dumb" is not powerful enough to run Emacs
>> | No changes to property 'svn:ignore' on '.'
>> `----
>
> Are you running these commands from inside emacs? eshell? where?
>
> If yes, because your EDITOR is bind to emacsclient -t, it try to open an
> emacsclient inside the emacs terminal (eshell or something else) and it
> fail because terminal is not powerful enough to run emacs.
>
> If so, use as EDITOR:(make a script maybe)
>
> emacsclient -a "" "$@"
> or
> emacsclient -a "emacs -Q" "$@"
>
> Be sure also you have an emacs server running.

To simplify things, the whole point of the alternate-editor="" is that it starts the emacs
server for you.

I find it a lot easier to compartmentalise it all inside a script (edit
in the link above and simply set EDITOR to that script)

But yes, using -t would be wrong and isn't suggested in the linked
info. 

My edit command is currently set as 

,----
| #!/bin/bash
| # edit
| export GDK_NATIVE_WINDOWS=1
| exec emacsclient --alternate-editor="" "$@"
`----






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

* Re: eshell - editing files
  2010-06-22  8:52 eshell - editing files Gary
  2010-06-22  9:17 ` Richard Riley
@ 2010-06-22 13:03 ` Matt Lundin
  2010-06-22 15:21   ` Gary
  1 sibling, 1 reply; 11+ messages in thread
From: Matt Lundin @ 2010-06-22 13:03 UTC (permalink / raw)
  To: Gary; +Cc: help-gnu-emacs

Gary <help-gnu-emacs@garydjones.name> writes:

> This may sound like a weird question. Is there any way to configure
> eshell so that when I want to edit a file, e.g. by typing "emacs foo", I
> instead get a new buffer with the file in? It kind of popped up because
> if you do something with svn that requires editing something, I got

I have the following line in my eshell-aliases-file:

alias emacs find-file $1

Best,
Matt



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

* Re: eshell - editing files
  2010-06-22 13:03 ` Matt Lundin
@ 2010-06-22 15:21   ` Gary
  0 siblings, 0 replies; 11+ messages in thread
From: Gary @ 2010-06-22 15:21 UTC (permalink / raw)
  To: help-gnu-emacs

Matt Lundin writes:
> Gary writes:
>
>> This may sound like a weird question. Is there any way to configure
>> eshell so that when I want to edit a file, e.g. by typing "emacs foo", I
>> instead get a new buffer with the file in? It kind of popped up because
>> if you do something with svn that requires editing something, I got
>
> I have the following line in my eshell-aliases-file:
>
> alias emacs find-file $1

That's the kind of thing I was hoping to be able to do, because it
doesn't involve disturbing the ecosystem. Unfortunately, although I can
then happily do 'emacs foo', and get the file in a new buffer, svn, or
the environment variable, or something, doesn't play fair and still
tries to open a new emacs instance (or emacsclient, or whatever).




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

* Re: eshell - editing files
  2010-06-22 11:15     ` Thierry Volpiatto
  2010-06-22 11:31       ` Richard Riley
@ 2010-06-22 15:44       ` Gary
  2010-06-22 15:54         ` Richard Riley
  1 sibling, 1 reply; 11+ messages in thread
From: Gary @ 2010-06-22 15:44 UTC (permalink / raw)
  To: help-gnu-emacs

Thierry Volpiatto writes:
> Gary writes:
>> Richard Riley writes:
>>> Gary writes:
>>>> This may sound like a weird question. Is there any way to configure
>>>> eshell so that when I want to edit a file, e.g. by typing "emacs foo", I
>>>> instead get a new buffer with the file in?
...
>> ,----
>> | /home/jg/work/drivers/lib/Src $ env | grep "EDITOR"
>> | EDITOR=emacsclient -t --alternate-editor=""
>> |
>> | /home/jg/work/drivers/lib/Src $ svn pe svn:ignore .
>> | *ERROR*: Terminal type "dumb" is not powerful enough to run Emacs
>> | No changes to property 'svn:ignore' on '.'
>> `----
>
> Are you running these commands from inside emacs? eshell? where?

Yes, inside eshell, which is inside an emacsclient/server pair.

> If yes, because your EDITOR is bind to emacsclient -t, it try to open an
> emacsclient inside the emacs terminal (eshell or something else) and it
> fail because terminal is not powerful enough to run emacs.

Aha! Yes. Adding

(eshell/export "EDITOR=emacsclient")

to ~/.eshell/login makes everything work :) Yippee!

Thanks, all.




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

* Re: eshell - editing files
  2010-06-22 15:44       ` Gary
@ 2010-06-22 15:54         ` Richard Riley
  0 siblings, 0 replies; 11+ messages in thread
From: Richard Riley @ 2010-06-22 15:54 UTC (permalink / raw)
  To: help-gnu-emacs

Gary <help-gnu-emacs@garydjones.name> writes:

> Thierry Volpiatto writes:
>> Gary writes:
>>> Richard Riley writes:
>>>> Gary writes:
>>>>> This may sound like a weird question. Is there any way to configure
>>>>> eshell so that when I want to edit a file, e.g. by typing "emacs foo", I
>>>>> instead get a new buffer with the file in?
> ...
>>> ,----
>>> | /home/jg/work/drivers/lib/Src $ env | grep "EDITOR"
>>> | EDITOR=emacsclient -t --alternate-editor=""
>>> |
>>> | /home/jg/work/drivers/lib/Src $ svn pe svn:ignore .
>>> | *ERROR*: Terminal type "dumb" is not powerful enough to run Emacs
>>> | No changes to property 'svn:ignore' on '.'
>>> `----
>>
>> Are you running these commands from inside emacs? eshell? where?
>
> Yes, inside eshell, which is inside an emacsclient/server pair.
>
>> If yes, because your EDITOR is bind to emacsclient -t, it try to open an
>> emacsclient inside the emacs terminal (eshell or something else) and it
>> fail because terminal is not powerful enough to run emacs.
>
> Aha! Yes. Adding
>
> (eshell/export "EDITOR=emacsclient")
>
> to ~/.eshell/login makes everything work :) Yippee!
>
> Thanks, all.
>

If you follow the advice elsewhere in the thread and bind it to an edit
script and use the --alternate-editor="" in the script you wont have to
worry about starting the daemon yourself - emacsclient will do it for
you. 

The benefit is then that other apps can use EDITOR too without knowing
anything about emacs.







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

end of thread, other threads:[~2010-06-22 15:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-22  8:52 eshell - editing files Gary
2010-06-22  9:17 ` Richard Riley
2010-06-22 10:54   ` Gary
2010-06-22 11:15     ` Thierry Volpiatto
2010-06-22 11:31       ` Richard Riley
2010-06-22 15:44       ` Gary
2010-06-22 15:54         ` Richard Riley
2010-06-22 13:03 ` Matt Lundin
2010-06-22 15:21   ` Gary
     [not found] <mailman.6.1277197523.11696.help-gnu-emacs@gnu.org>
2010-06-22  9:21 ` Pascal J. Bourguignon
2010-06-22 10:10 ` Tim X

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