Re: [julia-users] Re: edit() with foreground emacs

2016-04-14 Thread daniel . matz
OK, yeah, I had the same problem when I had EDITOR="emacs -nw", so that it 
didn't launch the GUI but just opened up in the terminal.

Maybe we should make an issue and ask that edit be made a little more 
clever.  In your case, it could perhaps detect that there isn't a windowing 
system available, and then use run instead of spawn.  And in my case, 
perhaps it could notice the -nw flag and use run instead of spawn.

On Thursday, April 14, 2016 at 10:09:55 AM UTC-5, Josef Sachs wrote:
>
> > On Thu, 14 Apr 2016 07:46:18 -0700 (PDT), daniel matz said: 
>
> > I'm on Mac OS X with Julia 0.4.3.  The edit function is defined in 
> > interactiveutil.jl 
> > . 
>
>
> > What is the output if you run this at the REPL: 
>
> > Base.editor() 
>
> (when I unset JULIA_EDITOR) 
> Base.editor() == ["emacs"] 
>
> > What happens if you do this at the REPL: 
>
> > run(`emacs Makefile`) 
>
> That runs emacs until I exit it, at which time I am back at the Julia 
> REPL. 
> That is what I want edit() to do. 
>
> > If you notice in the definition of edit that I linked to, when the 
> > editor is emacs, it uses spawn instead of run. 
>
> Yes, that's the problem.  I want emacs to be invoked with run(), not with 
> spawn().  My JULIA_EDITOR=mvim (where mvim is a symbolic link to emacs) 
> kludge works, but it's a kludge. 
>


Re: [julia-users] Re: edit() with foreground emacs

2016-04-14 Thread Josef Sachs
> On Thu, 14 Apr 2016 07:46:18 -0700 (PDT), daniel matz said:

> I'm on Mac OS X with Julia 0.4.3.  The edit function is defined in
> interactiveutil.jl
> .

> What is the output if you run this at the REPL:

> Base.editor()

(when I unset JULIA_EDITOR)
Base.editor() == ["emacs"]

> What happens if you do this at the REPL:

> run(`emacs Makefile`)

That runs emacs until I exit it, at which time I am back at the Julia REPL.
That is what I want edit() to do.

> If you notice in the definition of edit that I linked to, when the
> editor is emacs, it uses spawn instead of run.

Yes, that's the problem.  I want emacs to be invoked with run(), not with
spawn().  My JULIA_EDITOR=mvim (where mvim is a symbolic link to emacs)
kludge works, but it's a kludge.


Re: [julia-users] Re: edit() with foreground emacs

2016-04-14 Thread daniel . matz
I'm on Mac OS X with Julia 0.4.3.

The edit function is defined in interactiveutil.jl 
.

What is the output if you run this at the REPL:

Base.editor()

What happens if you do this at the REPL:

run(`emacs Makefile`)

If you notice in the definition of edit that I linked to, when the editor 
is emacs, it uses spawn instead of run.

On Wednesday, April 13, 2016 at 4:16:45 PM UTC-5, Josef Sachs wrote:
>
> > On Wed, 13 Apr 2016 14:03:08 -0700 (PDT), daniel matz said: 
>
> > It seems to work for me.  What were you trying to set JULIA_EDITOR 
> > to when you were trying emacs?  Were you trying to use console emacs 
> > with emacs -nw? 
>
> > On Wednesday, April 13, 2016 at 7:46:21 AM UTC-5, Josef Sachs wrote: 
> >> 
> >> Is there a way that I can use edit() to start emacs in the 
> >> foreground with support for line number? 
> >> 
> >> As a kludge, I am currently setting JULIA_EDITOR=mvim, and I have a 
> >> mvim in my PATH that is a symbolic link to emacs. 
>
> My EDITOR is set to emacs.  I am connected to an Ubuntu system via ssh, 
> with no X Window System.  When I unset JULIA_EDITOR and run julia, 
>
> julia> edit("Makefile") 
> emacs: standard input is not a tty 
>
> Maybe that's what you mean by "console emacs"? 
>
> Are you running the X Window System?  If so, then running emacs in the 
> background would work. 
>


[julia-users] Re: edit() with foreground emacs

2016-04-13 Thread Josef Sachs
> On Wed, 13 Apr 2016 14:03:08 -0700 (PDT), daniel matz said:

> It seems to work for me.  What were you trying to set JULIA_EDITOR
> to when you were trying emacs?  Were you trying to use console emacs
> with emacs -nw?

> On Wednesday, April 13, 2016 at 7:46:21 AM UTC-5, Josef Sachs wrote:
>> 
>> Is there a way that I can use edit() to start emacs in the
>> foreground with support for line number?
>> 
>> As a kludge, I am currently setting JULIA_EDITOR=mvim, and I have a
>> mvim in my PATH that is a symbolic link to emacs.

My EDITOR is set to emacs.  I am connected to an Ubuntu system via ssh,
with no X Window System.  When I unset JULIA_EDITOR and run julia,

julia> edit("Makefile")
emacs: standard input is not a tty

Maybe that's what you mean by "console emacs"?

Are you running the X Window System?  If so, then running emacs in the
background would work.


[julia-users] Re: edit() with foreground emacs

2016-04-13 Thread daniel . matz
It seems to work for me.

What were you trying to set JULIA_EDITOR to when you were trying emacs? 
 Were you trying to use console emacs with emacs -nw?

On Wednesday, April 13, 2016 at 7:46:21 AM UTC-5, Josef Sachs wrote:
>
> Is there a way that I can use edit() to start emacs in the foreground 
> with support for line number? 
>
> As a kludge, I am currently setting JULIA_EDITOR=mvim, and I have a 
> mvim in my PATH that is a symbolic link to emacs. 
>