jEdit Community - Resources for users of the jEdit Text Editor
New Edit Mode Not Being Applied/Used
Submitted by hurricanedavid on Thursday, 27 March, 2014 - 14:49
I created an edit mode and added an entry for it in the catalog: I can apply the mode manually through the buffer options, but it doesn't get used automatically. the file I want it to work on is a *.txt file. Could my new mode not be working because the txt one is being used?
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Solution-ish
by hurricanedavid on Fri, 11/04/2014 - 20:26
I got some answers on the mailing list, and will post them here for posterity...

----

For a few files I use often, the best solution was to paste in an exact filename match in the catalog file's < mode > tag, using pipes to separate multiples, if needed. (Thanks to Dale for this)

FILE_NAME_GLOB="dailyActions.txt"

This would automatically apply my custom mode to that particular text file. It overrides the wildcard "*.txt" mode because I specified the exact file name with no wildcards. The order of operations is shown below.

----

For lots of files that I don't use as often, I created a macro and put it in my right-click menu (or you could put it in your toolbar) for quick access. It would be too laborious to put a long list of files in the mode tag, especially when it could easily change. (Thanks to Alan E. for this)

The macro (very simple, once you know the syntax):

buffer.setMode("nameofmymode");


------
From: Dale Anson
Here is how the mode is selected by jEdit.

1) the filename is an exact match for the filename glob.
2) the filename matches the filename glob and the first line of the file matches the first line glob
3) the filename matches the filename glob
4) the first line of the file matches the first line glob
 
You can also use buffer-local
by Vampire on Thu, 15/05/2014 - 10:27
You can also use buffer-local properties to have a per-file assignment of jEdit edit mode.
new edit mode line of code di
by hurricanedavid on Thu, 27/03/2014 - 14:58
new edit mode line of code didn't show up in my initial post...

< MODE NAME="ToDo" FILE="ToDo.xml" FIRST_LINE_GLOB="*# ToDoFile*" / >
User login
Browse archives
« January 2018  
MoTuWeThFrSaSu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
33%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1092
Syndication
file   ver   dls
German Localization light   4.4.2.1   50949
Context Free Art (*.cfdg)   0.31   41174
JBuilder scheme   .001   17002
BBEdit scheme   1.0   16602
ColdFusion scheme   1.0   16586
R Edit Mode - extensive version   0.1   14869
Advanced HTML edit mode   1.0   14046
Matlab Edit Mode   1.0   13984
jEdit XP icons   1.0   13417
XP icons for jEdit   1.1   12440