This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: Patch: external editor changes
- To: Keith Seitz <keiths at cygnus dot com>
- Subject: Re: Patch: external editor changes
- From: Tom Tromey <tromey at redhat dot com>
- Date: 02 Oct 2001 17:03:20 -0600
- Cc: Insight List <insight at sourceware dot cygnus dot com>
- References: <Pine.GSO.4.33.0110021331000.27855-100000@makita.cygnus.com>
- Reply-To: tromey at redhat dot com
>>>>> "Keith" == Keith Seitz <keiths@cygnus.com> writes:
Keith> I won't even pretend to understand how this stuff works. The
Keith> --tclcommand option is supposed to just source a tcl file into
Keith> the interpreter when Insight is initialized. The testsuite uses
Keith> this. I guess someone found it convenient to use for this,
Keith> too. :-(
There are 3 command line options:
* --tclcommand, which sources a Tcl file
* --enable-external-editor, which used to just set a boolean
* --editor-command, the argument to this is a Tcl command to run
(with certain arguments appended) to edit a file
I changed it so --enable-external-editor is just ignored, --tclcommand
is untouched, and --editor-command overrides the user's editor setting.
Tom> +namespace eval Editor {
Keith> Aside: why a namespace instead of a class?
This seemed better because you can't instantiate Editor.
I can change this if you want.
>> + $popups(source) add command -label "Open Source in external editor" \
>> + -command [list $parent edit]
Keith> "[list $parent edit]" almost equal to "[code $parent edit]"?
I only reindented this piece of code. I agree [code...] is better.
I'll change it.
Keith> You say that you set your external editor command to
Keith> "emacsclient --no-wait +%d %s". I presume that %d and %s are
Keith> substituted with line and file name, right?
Yes.
Keith> Did we ever document this somewhere?
No, but I will.
Keith> What does emacsclient do? (Now you've got my curiosity peaked.)
It contacts an already-running Emacs and tells it to edit a file.
Run server-start in Emacs to start the Emacs side.
I put `(server-start)' into my .emacs.
Keith> Otherwise, I'd say CHECK IT IN!!
I will do this soon.
If you want me to make the namespace->class change, tell me and I will.
Keith> (And tell me how to use it with XEmacs!)
XEmacs may come with `gnuclient', which is like emacsclient but
better. (I'm not certain; I don't use XEmacs.)
Tom