This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch: external editor changes


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]