Re: [opensuse] kde and the kate editor [SOLVED]

2008-01-11 Thread David C. Rankin
Wendell Nichols wrote:
 Kate drives me nuts.  Its a good editor but every time you right click
 to edit a file in konqueror using kate it starts a new window.  If I use
 a command window and specify --use it will reuse an existing window if
 one is started for the session I specify.  However because kdeinit
 starts it I cannot pass a parm through konqueror. 
 So I get 30 kate windows on my desktop when all I want is one.  Ideally
 I'd like kate to open the file I've chosen in the instance of kate which
 is already open ON THAT DESKTOP.
 
 Has anyone figured this out?
 Sorry if this is an inappropriate forum... well not all that sorry
 wcn

Forwarded from Anders Lund kate development:

You can have Kate reuse an instance by adding -u (or --use to the
command line. For usage from within KDE, for example konqueror, edit the
properties for the Kate application.

You can read more in the online help (help:/kate) and at Kates website
at www.kate-editor.org

 Added by me -

In kde, just open menu editor, select kate and add --use to the command
line after kate %U. The command line will read: kate %U --use

Works like a charm!

-- 
David C. Rankin, J.D., P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] kde and the kate editor

2008-01-10 Thread Jonas Helgi Palsson
Hi

On Tuesday 08 January 2008 19:45:05 Wendell Nichols wrote:
 Kate drives me nuts.  Its a good editor but every time you right click
 to edit a file in konqueror using kate it starts a new window.  If I use
 a command window and specify --use it will reuse an existing window if
 one is started for the session I specify.  However because kdeinit
 starts it I cannot pass a parm through konqueror.
 So I get 30 kate windows on my desktop when all I want is one.  Ideally
 I'd like kate to open the file I've chosen in the instance of kate which
 is already open ON THAT DESKTOP.

 Has anyone figured this out?
 Sorry if this is an inappropriate forum... well not all that sorry
 wcn


Now the simple answer is (of course) DCOP!

But how to make it work was not so easy :-)

What you need to do is 
1. Keep track of which virtual desktop you are on
2. Keep track of which Kate process is on which virtual desktop
3. Use DCOP to instruct (the correct) Kate to open the selected file.


Here is a way to do it (with some quick'n'ugly scripts):

First make a directory to keep some tempfiles

mkdir ~/.kate_pid

then we make 2 bash scripts, put them in your ~/bin/ or where ever you fancy.

1: start_kate.sh
cut here---
#!/bin/bash
# Get current virtual desktop
VIRT_DESKTOP=$(dcop kwin KWinInterface currentDesktop)
#Now we start kate with all the arguments that we recived
kate $@
echo -n $!  ~/.kate_pid/kate_pid.$VIRT_DESKTOP
exit 0;
cut here---
2: kate_open_file.sh
cut here---
#!/bin/bash
# The encoding used, utf8 is the usual one
ENCODING=utf8
# We need to find out which virtual destop we are on
VIRT_DESKTOP=$(dcop kwin KWinInterface currentDesktop)
# We need to see if there is a pid file for that desktop
if [ -f ~/.kate_pid/kate_pid.$VIRT_DESKTOP ] ; then
#Yes there was, now we need to check if the kate process
#belonging to that pid is still alive
#First find the pid
KATE_PID=$(cat ~/.kate_pid/kate_pid.$VIRT_DESKTOP)
if [ $(dcop kate-$KATE_PID /dev/null 21; echo $?) -gt 0 ] ; then
#No it is not, so we start it
kate $@
# and record the pid for reuse
echo -n $!  ~/.kate_pid/kate_pid.$VIRT_DESKTOP
else
# now some DCOP magic
dcop kate-$KATE_PID KateApplication openURL $1 $ENCODING
fi
else
#there was no kate_pid file so we start kate.
kate $@
# and record the pid for reuse
echo -n $!  ~/.kate_pid/kate_pid.$VIRT_DESKTOP
fi
cut here---

Use the start_kate.sh wrapper to start Kate on a virtual desktop. (Not really 
needed)

Then make a new action in Konqueror to open files, and have it run:
/the/path/to/the/script/kate_open_file.sh %U

That should do it :-)

Notice that there is no error checking at all in the scripts, so if you use 
it, please make it better and post the result :-)

regards
Jonas
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] kde and the kate editor

2008-01-10 Thread David C. Rankin
Jonas Helgi Palsson wrote:
 Hi
 
 On Tuesday 08 January 2008 19:45:05 Wendell Nichols wrote:
 Kate drives me nuts.  Its a good editor but every time you right click
 to edit a file in konqueror using kate it starts a new window.  If I use
 a command window and specify --use it will reuse an existing window if
 one is started for the session I specify.  However because kdeinit
 starts it I cannot pass a parm through konqueror.
 So I get 30 kate windows on my desktop when all I want is one.  Ideally
 I'd like kate to open the file I've chosen in the instance of kate which
 is already open ON THAT DESKTOP.

 Has anyone figured this out?
 Sorry if this is an inappropriate forum... well not all that sorry
 wcn
 
 
 Now the simple answer is (of course) DCOP!
 
 But how to make it work was not so easy :-)
 
 What you need to do is 
 1. Keep track of which virtual desktop you are on
 2. Keep track of which Kate process is on which virtual desktop
 3. Use DCOP to instruct (the correct) Kate to open the selected file.
 
 
 Here is a way to do it (with some quick'n'ugly scripts):
 
 First make a directory to keep some tempfiles
 
 mkdir ~/.kate_pid
 
 then we make 2 bash scripts, put them in your ~/bin/ or where ever you fancy.
 
 1: start_kate.sh
 cut here---
 #!/bin/bash
 # Get current virtual desktop
 VIRT_DESKTOP=$(dcop kwin KWinInterface currentDesktop)
 #Now we start kate with all the arguments that we recived
 kate $@
 echo -n $!  ~/.kate_pid/kate_pid.$VIRT_DESKTOP
 exit 0;
 cut here---
 2: kate_open_file.sh
 cut here---
 #!/bin/bash
 # The encoding used, utf8 is the usual one
 ENCODING=utf8
 # We need to find out which virtual destop we are on
 VIRT_DESKTOP=$(dcop kwin KWinInterface currentDesktop)
 # We need to see if there is a pid file for that desktop
 if [ -f ~/.kate_pid/kate_pid.$VIRT_DESKTOP ] ; then
 #Yes there was, now we need to check if the kate process
 #belonging to that pid is still alive
 #First find the pid
 KATE_PID=$(cat ~/.kate_pid/kate_pid.$VIRT_DESKTOP)
 if [ $(dcop kate-$KATE_PID /dev/null 21; echo $?) -gt 0 ] ; then
 #No it is not, so we start it
 kate $@
 # and record the pid for reuse
 echo -n $!  ~/.kate_pid/kate_pid.$VIRT_DESKTOP
 else
 # now some DCOP magic
 dcop kate-$KATE_PID KateApplication openURL $1 $ENCODING
 fi
 else
 #there was no kate_pid file so we start kate.
 kate $@
 # and record the pid for reuse
 echo -n $!  ~/.kate_pid/kate_pid.$VIRT_DESKTOP
 fi
 cut here---
 
 Use the start_kate.sh wrapper to start Kate on a virtual desktop. (Not really 
 needed)
 
 Then make a new action in Konqueror to open files, and have it run:
 /the/path/to/the/script/kate_open_file.sh %U
 
 That should do it :-)
 
 Notice that there is no error checking at all in the scripts, so if you use 
 it, please make it better and post the result :-)
 
 regards
 Jonas

It looks like the source of the problem was this change in the code:

Revision 499764 - (view) (download) (as text) (annotate) - [select for
diffs]
Modified Wed Jan 18 16:49:04 2006 UTC (23 months, 3 weeks ago) by alund
File length: 10186 byte(s)
Diff to previous 498190

* Kate will export the PID of the instance in the environment variable
KATE_PID. You can use that to do some initialization in your ~/.bashrc
file for example, if you like to open files in kate from the built in
terminal:

# If we are running in a konsole in kate,
# $KATE_PID is the pid of that kate application instance.
if [ -n $KATE_PID ] ; then
  # open files in this instance
  alias kate=kate -u -p $KATE_PID
  # allow creating a new instance
  alias kate_newinst=`which kate`
fi

The discussion continues and recognizes the difficulty in getting the
old behavior back.

Revision 495447 - (view) (download) (as text) (annotate) - [select for
diffs]
Modified Sun Jan 8 09:02:09 2006 UTC (2 years ago) by alund
File length: 9921 byte(s)
Diff to previous 465343

Always follow the configuration option for chosing a session  when none
is specified.
I commit this, since I can't see how else we can enable old style
behavior easily. The 'new' behavior can be achieved by keeping the
default configuration of starting a new session.
BUG: 119620


-- 
David C. Rankin, J.D., P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] kde and the kate editor

2008-01-09 Thread Wendell Nichols
Thanks to all who responded.  I've been through most of this and can't
find the love :)
Dragging files from konqueror to kate implies that I can view both apps,
which usually means resizing two apps just to open a file.  I do this
hundreds of times a day so having it easy is important.

Ive found that if you highlight a file, choose from the edit menu  edit
file type select kate from the list and press edit button; selet the
appliction tab, and in the command field change kate to kate --use. 
This will cause the file to be opened in an existing instance of kate. 
Unfortunately I can't get it to open in a particular instance, ie the
instance for that virtual desktop, which is what I'd like (I have 6 very
busy desktops, and I'd like an instance of kate for each one).  I could
have kate displayed on all desktops, but then there are 30 files open in
it, many of which have the same names making it hard to find the right file.

I suppose I should create an enhancement request to kde, but that would
take a lot of time and I'm way short of that...

thanks again..
wcn

Sunny wrote:
 On Jan 8, 2008 12:45 PM, Wendell Nichols [EMAIL PROTECTED] wrote:
   
 Kate drives me nuts.  Its a good editor but every time you right click
 to edit a file in konqueror using kate it starts a new window.  If I use
 a command window and specify --use it will reuse an existing window if
 one is started for the session I specify.  However because kdeinit
 starts it I cannot pass a parm through konqueror.
 So I get 30 kate windows on my desktop when all I want is one.  Ideally
 I'd like kate to open the file I've chosen in the instance of kate which
 is already open ON THAT DESKTOP.

 Has anyone figured this out?
 Sorry if this is an inappropriate forum... well not all that sorry
 wcn
 

 At this link there is a section Restore old behavior, check if it
 works for you:
 http://kate-editor.org/article/using_named_sessions


   
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] kde and the kate editor

2008-01-09 Thread David C. Rankin
Wendell Nichols wrote:
 Kate drives me nuts.  Its a good editor but every time you right click
 to edit a file in konqueror using kate it starts a new window.  If I use
 a command window and specify --use it will reuse an existing window if
 one is started for the session I specify.  However because kdeinit
 starts it I cannot pass a parm through konqueror. 
 So I get 30 kate windows on my desktop when all I want is one.  Ideally
 I'd like kate to open the file I've chosen in the instance of kate which
 is already open ON THAT DESKTOP.
 
 Has anyone figured this out?
 Sorry if this is an inappropriate forum... well not all that sorry
 wcn

It's driving me nuts too. I also have an old 9.3 box and konqueror
reuses the same kate instance.

Alright - who screwed Kate?

Better yet, who can make her happy again?

-- 
David C. Rankin, J.D., P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] kde and the kate editor

2008-01-09 Thread Rajko M.
On Wednesday 09 January 2008 02:43:51 pm Wendell Nichols wrote:

 Dragging files from konqueror to kate implies that I can view both apps,
 which usually means resizing two apps just to open a file.  I do this
 hundreds of times a day so having it easy is important.

It is enough to see the corner of the kate ie. already opened document. 
I dropped few files on another open document, and it opened it without  
glitch. 

-- 
Regards,
Rajko
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[opensuse] kde and the kate editor

2008-01-08 Thread Wendell Nichols
Kate drives me nuts.  Its a good editor but every time you right click
to edit a file in konqueror using kate it starts a new window.  If I use
a command window and specify --use it will reuse an existing window if
one is started for the session I specify.  However because kdeinit
starts it I cannot pass a parm through konqueror. 
So I get 30 kate windows on my desktop when all I want is one.  Ideally
I'd like kate to open the file I've chosen in the instance of kate which
is already open ON THAT DESKTOP.

Has anyone figured this out?
Sorry if this is an inappropriate forum... well not all that sorry
wcn
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] kde and the kate editor

2008-01-08 Thread M9.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



Wendell Nichols schreef:
 Kate drives me nuts.  Its a good editor but every time you right click
 to edit a file in konqueror using kate it starts a new window.  If I use
 a command window and specify --use it will reuse an existing window if
 one is started for the session I specify.  However because kdeinit
 starts it I cannot pass a parm through konqueror. 
 So I get 30 kate windows on my desktop when all I want is one.  Ideally
 I'd like kate to open the file I've chosen in the instance of kate which
 is already open ON THAT DESKTOP.
 
 Has anyone figured this out?
 Sorry if this is an inappropriate forum... well not all that sorry
 wcn

How about opening the files from within kate?

- --


Have a nice day,

M9.   Now, is the only time that exists.



  OS:  Linux 2.6.24-rc6-git11-3-default x86_64
  Huidige gebruiker:  [EMAIL PROTECTED]
  Systeem:  openSUSE 11.0 (x86_64) Alpha0
  KDE:  3.5.8 release 30
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFHg9T1X5/X5X6LpDgRAiBjAKClzR8MzKLaIicn5Fi2vHfbukz6zwCeNqM0
j3p2bK9LeXXs7BVwGN5LSL0=
=fpz+
-END PGP SIGNATURE-
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] kde and the kate editor

2008-01-08 Thread Dog Walker
On Jan 8, 2008 10:45 AM, Wendell Nichols [EMAIL PROTECTED] wrote:
 Kate drives me nuts.  Its a good editor but every time you right click
 to edit a file in konqueror using kate it starts a new window.  If I use
 a command window and specify --use it will reuse an existing window if
 one is started for the session I specify.  However because kdeinit
 starts it I cannot pass a parm through konqueror.
 So I get 30 kate windows on my desktop when all I want is one.  Ideally
 I'd like kate to open the file I've chosen in the instance of kate which
 is already open ON THAT DESKTOP.

 Has anyone figured this out?
 Sorry if this is an inappropriate forum... well not all that sorry
 wcn

Open first file with Kate, which should give you a Kate session. Drag
subsequent files from Konqueror to the Kate instance.
-- 
I have seen the future and I'm not in it!
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] kde and the kate editor

2008-01-08 Thread David Bolt
On Tue, 8 Jan 2008, Wendell Nichols wrote:-

Kate drives me nuts.  Its a good editor but every time you right click
to edit a file in konqueror using kate it starts a new window.  If I use
a command window and specify --use it will reuse an existing window if
one is started for the session I specify.  However because kdeinit
starts it I cannot pass a parm through konqueror.
So I get 30 kate windows on my desktop when all I want is one.  Ideally
I'd like kate to open the file I've chosen in the instance of kate which
is already open ON THAT DESKTOP.

Has anyone figured this out?

I haven't figured it out but I can say that it used to work.

I still have a 9.3 system up and running, and when asking Konqueror to
open a file in Kate, it will reuse a presently running Kate. I don't
know if this is the same in 10.0, but trying it in 10.1 doesn't work.


Regards,
David Bolt

-- 
Team Acorn: http://www.distributed.net/ OGR-P2 @ ~100Mnodes RC5-72 @ ~15Mkeys
SUSE 10.1 32bit  | openSUSE 10.2 32bit | openSUSE 10.3 32bit | openSUSE 11.0a0
SUSE 10.1 64bit  | openSUSE 10.2 64bit | openSUSE 10.3 64bit
RISC OS 3.6  | TOS 4.02| openSUSE 10.3 PPC   |RISC OS 3.11
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [opensuse] kde and the kate editor

2008-01-08 Thread Sunny
On Jan 8, 2008 12:45 PM, Wendell Nichols [EMAIL PROTECTED] wrote:
 Kate drives me nuts.  Its a good editor but every time you right click
 to edit a file in konqueror using kate it starts a new window.  If I use
 a command window and specify --use it will reuse an existing window if
 one is started for the session I specify.  However because kdeinit
 starts it I cannot pass a parm through konqueror.
 So I get 30 kate windows on my desktop when all I want is one.  Ideally
 I'd like kate to open the file I've chosen in the instance of kate which
 is already open ON THAT DESKTOP.

 Has anyone figured this out?
 Sorry if this is an inappropriate forum... well not all that sorry
 wcn

At this link there is a section Restore old behavior, check if it
works for you:
http://kate-editor.org/article/using_named_sessions


-- 
Svetoslav Milenov (Sunny)

Even the most advanced equipment in the hands of the ignorant is just
a pile of scrap.
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]