Discussion:
launching a single instance of nedit for each text file
Yose Widjaja
2009-11-20 03:12:34 UTC
Permalink
Good day,

I was wondering if it is possible to enforce the settings of only ever
launching one nedit window for each text file? So, from the terminal, if I
do "nedit moo.txt" twice, the second one will just bring the existing window
to focus.

Is there such thing? If not, I guess the only way is to make a script which
manually goes through the windows to check if the file has been opened? Is
this possible?

Cheers
--
-- -- -- -- -- -- -- -- -- -- -- -- -- --
Yose Widjaja
Supreme Emperor @ Jormy Games
www.jormy.com
yose-***@public.gmane.org
-- -- -- -- -- -- -- -- -- -- -- -- -- --
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Bert Wesarg
2009-11-20 07:27:16 UTC
Permalink
Post by Yose Widjaja
Good day,
I was wondering if it is possible to enforce the settings of only ever
launching one nedit window for each text file? So, from the terminal, if I
do "nedit moo.txt" twice, the second one will just bring the existing window
to focus.
Is there such thing? If not, I guess the only way is to make a script which
manually goes through the windows to check if the file has been opened? Is
this possible?
Try using only the NEdit client. Its officially called nc, but it is
maybe installed as an different name, like nedit-nc or something. Than
replace all your calls 'nedit ...' with 'nc ...'.

You can read more in the help menu under 'Client/Server Mode'.

Bert
Post by Yose Widjaja
Cheers
--
-- -- -- -- -- -- -- -- -- -- -- -- -- --
Yose Widjaja
www.jormy.com
-- -- -- -- -- -- -- -- -- -- -- -- -- --
--
http://www.nedit.org/mailman/listinfo/discuss
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
TK Soh
2009-11-20 08:58:15 UTC
Permalink
Post by Bert Wesarg
Post by Yose Widjaja
Good day,
I was wondering if it is possible to enforce the settings of only ever
launching one nedit window for each text file? So, from the terminal, if I
do "nedit moo.txt" twice, the second one will just bring the existing window
to focus.
Is there such thing? If not, I guess the only way is to make a script which
manually goes through the windows to check if the file has been opened? Is
this possible?
Try using only the NEdit client. Its officially called nc, but it is
maybe installed as an different name, like nedit-nc or something. Than
replace all your calls 'nedit ...' with 'nc ...'.
You can read more in the help menu under 'Client/Server Mode'.
This is an old discussion. A lot of folks not aware of 'nc' somehow.
May we should rename the server binary (nedit) to something else, like
nedit-server and rename nc to nedit. Of course they are probably work
to be done to the source to support this.
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Bert Wesarg
2009-11-20 09:33:02 UTC
Permalink
Post by TK Soh
Post by Bert Wesarg
Post by Yose Widjaja
Good day,
I was wondering if it is possible to enforce the settings of only ever
launching one nedit window for each text file? So, from the terminal, if I
do "nedit moo.txt" twice, the second one will just bring the existing window
to focus.
Is there such thing? If not, I guess the only way is to make a script which
manually goes through the windows to check if the file has been opened? Is
this possible?
Try using only the NEdit client. Its officially called nc, but it is
maybe installed as an different name, like nedit-nc or something. Than
replace all your calls 'nedit ...' with 'nc ...'.
You can read more in the help menu under 'Client/Server Mode'.
This is an old discussion. A lot of folks not aware of 'nc' somehow.
May we should rename the server binary (nedit) to something else, like
nedit-server and rename nc to nedit. Of course they are probably work
to be done to the source to support this.
There is also the idea to merge these too binaries. I think your
proposal would be a good interim step to reach this goal.

Bert
Post by TK Soh
--
http://www.nedit.org/mailman/listinfo/discuss
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Wayne.Lydecker-o70QjBUuf8rQT0dZR+
2009-11-20 16:24:30 UTC
Permalink
Post by Bert Wesarg
Post by TK Soh
Post by Bert Wesarg
Post by Yose Widjaja
Good day,
I was wondering if it is possible to enforce the settings of only ever
launching one nedit window for each text file? So, from the terminal, if I
do "nedit moo.txt" twice, the second one will just bring the existing window
to focus.
Is there such thing? If not, I guess the only way is to make a script which
manually goes through the windows to check if the file has been opened? Is
this possible?
Try using only the NEdit client. Its officially called nc, but it is
maybe installed as an different name, like nedit-nc or something. Than
replace all your calls 'nedit ...' with 'nc ...'.
You can read more in the help menu under 'Client/Server Mode'.
This is an old discussion. A lot of folks not aware of 'nc' somehow.
May we should rename the server binary (nedit) to something else, like
nedit-server and rename nc to nedit. Of course they are probably work
to be done to the source to support this.
There is also the idea to merge these too binaries. I think your
proposal would be a good interim step to reach this goal.
Bert
Post by TK Soh
--
http://www.nedit.org/mailman/listinfo/discuss
I hate to rain on your parade, but if I remember correctly each
executable requires its own switches, and they are not compatible.

I do have an idea though. Rename the current nedit executable to
something else and replace it with a script. If first time run
it could inquire which executable to run. After that it would
read the configuration file and launch the correct executable.

This would force first timers to know about the two executables
and help them pick the correct one. It doesn't solve the single
executable problem though. Only fixing the switches will do that.

-- Wayne.
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Offer Kaye
2009-11-23 15:23:35 UTC
Permalink
Post by Wayne.Lydecker-o70QjBUuf8rQT0dZR+
I hate to rain on your parade, but if I remember correctly each
executable requires its own switches, and they are not compatible.
I do have an idea though.  Rename the current nedit executable to
something else and replace it with a script.  If first time run
it could inquire which executable to run.  After that it would
read the configuration file and launch the correct executable.
This would force first timers to know about the two executables
and help them pick the correct one.  It doesn't solve the single
executable problem though.  Only fixing the switches will do that.
-- Wayne.
A bit late to the discussion but I would like to request not to get
rid of the nedit executable, e.g. by merging nedit and nc into a
single one. While the behavior of nc is usually what you want, it
isn't always and it would not be a good thing not to have the nedit
option.

Thanks,
--
Offer Kaye
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
TK Soh
2009-11-24 00:53:52 UTC
Permalink
Post by Offer Kaye
Post by Wayne.Lydecker-o70QjBUuf8rQT0dZR+
I hate to rain on your parade, but if I remember correctly each
executable requires its own switches, and they are not compatible.
I do have an idea though.  Rename the current nedit executable to
something else and replace it with a script.  If first time run
it could inquire which executable to run.  After that it would
read the configuration file and launch the correct executable.
This would force first timers to know about the two executables
and help them pick the correct one.  It doesn't solve the single
executable problem though.  Only fixing the switches will do that.
-- Wayne.
A bit late to the discussion but I would like to request not to get
rid of the nedit executable, e.g. by merging nedit and nc into a
single one. While the behavior of nc is usually what you want, it
isn't always and it would not be a good thing not to have the nedit
option.
Can you give some scenario where you don't want to use nc?
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Aaron W. Hsu
2009-11-24 01:09:05 UTC
Permalink
Hey TK,

--On Tuesday, November 24, 2009 12:53:52 AM +0000 TK Soh
Post by TK Soh
Can you give some scenario where you don't want to use nc?
I can give an example. Specifically, I use the nedit binary as my
default editor with

EDITOR=/usr/bin/nedit

Because many clients will launch that editor and block on that program's
exit. It does no good if the program returns before I am finished
editing. For example, when using NEdit as my text editor for mail
composition, or for News clients.

I think that the current layout, with nedit as one thing, and nc as
another is probably the right way to go. It's easier for me, for one
thing, and it's really not that hard to learn about nc. The only issue
is that netcat is also listed as nc, so I vote to change the executable
name to ncl.

Aaron W. Hsu
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
TK Soh
2009-11-24 02:04:37 UTC
Permalink
Post by Aaron W. Hsu
Hey TK,
--On Tuesday, November 24, 2009 12:53:52 AM +0000 TK Soh
Post by TK Soh
Can you give some scenario where you don't want to use nc?
I can give an example. Specifically, I use the nedit binary as my
default editor with
 EDITOR=/usr/bin/nedit
Because many clients will launch that editor and block on that program's
exit. It does no good if the program returns before I am finished
editing. For example, when using NEdit as my text editor for mail
composition, or for News clients.
Will 'nc -wait' work for you?
Post by Aaron W. Hsu
I think that the current layout, with nedit as one thing, and nc as
another is probably the right way to go. It's easier for me, for one
thing, and it's really not that hard to learn about nc. The only issue
is that netcat is also listed as nc, so I vote to change the executable
name to ncl.
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Waring, Stephen
2009-11-24 11:33:49 UTC
Permalink
Could you not use
EDITOR='/usr/bin/nedit -wait'

This has the benefit of using your current nc session, but lets programs such as crontab wait until you close the tab.

Regards
Steve Waring

-----Original Message-----
From: Aaron W. Hsu [mailto:arcfide-***@public.gmane.org]
Sent: Tuesday, November 24, 2009 1:09 AM
To: General NEdit discussion list
Subject: Re: launching a single instance of nedit for each text file

Hey TK,

--On Tuesday, November 24, 2009 12:53:52 AM +0000 TK Soh
Post by TK Soh
Can you give some scenario where you don't want to use nc?
I can give an example. Specifically, I use the nedit binary as my
default editor with

EDITOR=/usr/bin/nedit

Because many clients will launch that editor and block on that program's
exit. It does no good if the program returns before I am finished
editing. For example, when using NEdit as my text editor for mail
composition, or for News clients.

I think that the current layout, with nedit as one thing, and nc as
another is probably the right way to go. It's easier for me, for one
thing, and it's really not that hard to learn about nc. The only issue
is that netcat is also listed as nc, so I vote to change the executable
name to ncl.

Aaron W. Hsu


___________________________ Disclaimer Notice ____________________
This message and any attachments are confidential and should only
be read by those to whom they are addressed. If you are not the
intended recipient, please contact us, delete the message from your
computer and destroy any copies. Any distribution or copying without
our prior permission is prohibited.

Internet communications are not always secure and therefore the
E.ON Group does not accept legal responsibility for this message.
The recipient is responsible for verifying its authenticity before
acting on the contents. Any views or opinions presented are solely
those of the author and do not necessarily
represent those of the E.ON Group.

E.ON UK plc, Westwood Way, Westwood Business Park,
Coventry, CV4 8LG.
Registered in England & Wales No. 2366970

Telephone +44 (0) 2476 192000
Fax +44 (0) 2476 42 5432
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Bert Wesarg
2009-11-24 11:44:45 UTC
Permalink
On Tue, Nov 24, 2009 at 12:33, Waring, Stephen
Post by Waring, Stephen
Could you not use
EDITOR='/usr/bin/nedit -wait'
No. Because nedit does not have the -wait option, nc has. See TK Soh's mail.

Bert
Post by Waring, Stephen
This has the benefit of using your current nc session, but lets programs such as crontab wait until you close the tab.
Regards
Steve Waring
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Offer Kaye
2009-11-25 10:17:51 UTC
Permalink
Post by TK Soh
Can you give some scenario where you don't want to use nc?
1. If nedit server was not opened with -svrname, nc from separate Unix
desktops will all belong to the same nedit server and show up in the
Windows menu file list. Not a huge issue (solution is to *always* use
-svrname) but it can be annoying if you forget the flag and I'm not
sure how many people especially casual nedit users(*) are familiar
with -svrname.

2. In any situation when I would want to start a new seperate nedit
windows. Of course even with a merged binary this could be done with a
new nedit server but this depends on which options you would give to
this new merged binary. If you removed the "-server" flag and the only
behaviour would be "open new server if none exists otherwise use
existing one" this could become annoying as it would force me to use
only a single nedit window.

(*) P.S. - I'm guessing most people on this list are not casual users
so perhaps you would have a hard time understanding this, but I know
many people who basically use NEdit as a Unix variant of Notepad and
have no idea about any of its abilities. Just as an example the other
day I showed someone who had been using NEdit for quite some time that
you could run a shell command such as "sort -u" or "grep" on a text
selection and he was amazed. These are not stupid people (engineers
mostly) but they just don't focus on nedit as an important tool to
study and understand. So probably for anyone on this list, using
"-svrname" is obvious and not an issue. However I strongly suspect
that most users do not even know of nedit command line flags and would
be bitten by any nedit issues for which the only solution would be to
use a command line flag.

Regards,
--
Offer Kaye
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
TK Soh
2009-11-26 00:02:15 UTC
Permalink
Post by Offer Kaye
Post by TK Soh
Can you give some scenario where you don't want to use nc?
1. If nedit server was not opened with -svrname, nc from separate Unix
desktops will all belong to the same nedit server and show up in the
Windows menu file list. Not a huge issue (solution is to *always* use
-svrname) but it can be annoying if you forget the flag and I'm not
sure how many people especially casual nedit users(*) are familiar
with -svrname.
2. In any situation when I would want to start a new seperate nedit
windows. Of course even with a merged binary this could be done with a
new nedit server but this depends on which options you would give to
this new merged binary. If you removed the "-server" flag and the only
behaviour would be "open new server if none exists otherwise use
existing one" this could become annoying as it would force me to use
only a single nedit window.
(*) P.S. - I'm guessing most people on this list are not casual users
so perhaps you would have a hard time understanding this, but I know
many people who basically use NEdit as a Unix variant of Notepad and
have no idea about any of its abilities. Just as an example the other
day I showed someone who had been using NEdit for quite some time that
you could run a shell command such as "sort -u" or "grep" on a text
selection and he was amazed. These are not stupid people (engineers
mostly) but they just don't focus on nedit as an important tool to
study and understand. So probably for anyone on this list, using
"-svrname" is obvious and not an issue. However I strongly suspect
that most users do not even know of nedit command line flags and would
be bitten by any nedit issues for which the only solution would be to
use a command line flag.
No offense. But I first reaction to your comment is "what a shame..."

The developers spent a lot of effort putting in those 'extras', but
all that the [casual] users need is a notepad.

On the other hand, I suspect these users won't care much about what we
are trying to do here either, as long as it remain [somewhat]
transparent to them.
Post by Offer Kaye
Regards,
--
Offer Kaye
--
http://www.nedit.org/mailman/listinfo/discuss
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Yose Widjaja
2009-11-30 07:28:37 UTC
Permalink
Actually, as a long-time nedit user I might want to chime in about these
"extras". They are awesome, and it's as simple as that.

One of these extras being allowing different fonts for highlighting with 4
different style of fonts. The big thing is that these fonts can be of
different size, and coupled with regular expressions my C-source code is a
lot more readable because of this (types and class names which start with
capital letters are now in huge fonts). And they look very stylish as well.

At my uni, everytime someone seems me coding, they always ask, what text
editor is that? They're always surprised to find out that it was nedit.

Granted, there's still a lot of the extras that I don't even know about (I
mean, I just knew about this nedit-nc thing recently, and I'll be
integrating that into my coding IDE). But eventually they get used. But
features such as rectangular select etc are useful themselves. And the macro
system has saved me so much time throughout the years.

To sum it up, nedit is awesome, and big kudos to the developers.

p.s what's the chances it'll be ported to windows? it's just the motif
library that's stopping that from happening isn't it?
Post by TK Soh
Post by Offer Kaye
Post by TK Soh
Can you give some scenario where you don't want to use nc?
1. If nedit server was not opened with -svrname, nc from separate Unix
desktops will all belong to the same nedit server and show up in the
Windows menu file list. Not a huge issue (solution is to *always* use
-svrname) but it can be annoying if you forget the flag and I'm not
sure how many people especially casual nedit users(*) are familiar
with -svrname.
2. In any situation when I would want to start a new seperate nedit
windows. Of course even with a merged binary this could be done with a
new nedit server but this depends on which options you would give to
this new merged binary. If you removed the "-server" flag and the only
behaviour would be "open new server if none exists otherwise use
existing one" this could become annoying as it would force me to use
only a single nedit window.
(*) P.S. - I'm guessing most people on this list are not casual users
so perhaps you would have a hard time understanding this, but I know
many people who basically use NEdit as a Unix variant of Notepad and
have no idea about any of its abilities. Just as an example the other
day I showed someone who had been using NEdit for quite some time that
you could run a shell command such as "sort -u" or "grep" on a text
selection and he was amazed. These are not stupid people (engineers
mostly) but they just don't focus on nedit as an important tool to
study and understand. So probably for anyone on this list, using
"-svrname" is obvious and not an issue. However I strongly suspect
that most users do not even know of nedit command line flags and would
be bitten by any nedit issues for which the only solution would be to
use a command line flag.
No offense. But I first reaction to your comment is "what a shame..."
The developers spent a lot of effort putting in those 'extras', but
all that the [casual] users need is a notepad.
On the other hand, I suspect these users won't care much about what we
are trying to do here either, as long as it remain [somewhat]
transparent to them.
Post by Offer Kaye
Regards,
--
Offer Kaye
--
http://www.nedit.org/mailman/listinfo/discuss
--
http://www.nedit.org/mailman/listinfo/discuss
--
-- -- -- -- -- -- -- -- -- -- -- -- -- --
Yose Widjaja
Supreme Emperor @ Jormy Games
www.jormy.com
yose-***@public.gmane.org
-- -- -- -- -- -- -- -- -- -- -- -- -- --
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Loading...