jEdit Community - Resources for users of the jEdit Text Editor
File to open automatically in buffertab mode
Submitted by tj_sony on Wednesday, 9 April, 2008 - 05:52
I have a file opened in buffertab mode - C:\temp\

Through some internal processing, when I click on C:\temp\, an empty file - C:\temp\123.bbb gets created in the folder C:\temp\.

But what I need is, the empty file 123.bbb which gets created in the folder C:\temp\ should open automatically in buffertab mode instead of me doing it manually.

Could someone please help me with this.
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Please use this mail
by tj_sony on Wed, 09/04/2008 - 06:06
Please use this mail.

Sorry for the confusion created with my previous mails.
command line
by Robert Schwenn on Wed, 09/04/2008 - 18:12
I think, Your "internal processing" is an external process (?) and thus should fire a system command to start jedit and load the file, i.e.:

javaw -jar path\jedit.jar - reuseview path_of_file_to_load

BTW: What's buffertab mode? If You mean that the BufferTab plugin is loaded - it doesn't matter...
Buffertabs issue again
by tj_sony on Thu, 10/04/2008 - 04:25
I think am not clear with my problem.

I have a buffertab named containing some contents inside it. This file is in the path C:\temp\

Through some processing, when I click on the buffertab, an empty file 123.bbb gets created in the folder C:\temp\.

But what I need is, the empty file 123.bbb which gets created in the folder C:\temp\ should open automatically as a buffertab with the name 123.bbb in the textArea instead of me doing it manually.

Likewise, I have many files which should do the same above operation when I am in the jedit textArea.
by Robert Schwenn on Thu, 10/04/2008 - 20:11
If You want to be clear, please tell about "some processing". I really don't understand, which file should be opened at witch time.

To open a file "automatically" can only mean, that any program has to do this at the right time, doesn't it? And one option is that any program could fire the described system command. In Your case it seems that this program could be Your "some processing", whatever this should be...

Another option could be, that a jEdit macro opens the buffer. But of course the macro has to be launched at the right time - but when ...?

Buffertab issue again
by tj_sony on Fri, 11/04/2008 - 04:24
I have a buffertab named 123.xml. When I click on the tab 123.xml, it creates an empty file 123.tex in the folder C:\temp\. Then I open 123.tex manually from my customized jedit. So this opens as a buffertab and the file is an empty file with the name 123.tex. When I click on the tab 123.tex, with the help of SAXTransformer the 123.xml get convertes to 123.tex and the file 123.tex gets filled up with the tex contents.

What I need is, instead of me opening the 123.tex manually, when I click on 123.xml, the 123.tex should open as a buffertab automatically inside the textArea.
look for the magic process
by Robert Schwenn on Fri, 11/04/2008 - 20:06
Well, when a buffertab is "clicked", normally nothing happens except that the matching buffer is activated. If Your click leads to a newly created file, this only can mean, that You (or someone for You) has hooked some kind of action on this click, doesn't it?

So, why don't use the same action not only to create the file but also load it in jEdit?

If the creation of the new file was a black box for You, You could try to write a beanshell macro that opens this file. Then You have to tell the Action Hooks plugin to launch the macro every time a buffer is activated (maybe using events BufferUpdate.LOADED and EditPaneUpdate.BUFFER_CHANGED). But of course it could happen, that the macro is launched before the file is created...

Another option could be to disable the old process of file creation and use the macro (described above) not to open an existing file but to open a new buffer and save it with the desired name...

Hope, we understand us a bit better now Eye-wink

User login
Browse archives
« February 2018  
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
Yes, I'd like to have translations
No, that'd be bad (please comment)
Total votes: 1092
file   ver   dls
German Localization light   51081
Context Free Art (*.cfdg)   0.31   41260
JBuilder scheme   .001   17053
BBEdit scheme   1.0   16658
ColdFusion scheme   1.0   16636
R Edit Mode - extensive version   0.1   14919
Advanced HTML edit mode   1.0   14092
Matlab Edit Mode   1.0   14038
jEdit XP icons   1.0   13463
XP icons for jEdit   1.1   12487