jEdit Community - Resources for users of the jEdit Text Editor
Mode Selection
Submitted by gsawyer9 on Friday, 1 May, 2009 - 20:14
How (when) does jEdit determine the mode to be used when editing a file?

My current project has many makefiles named "something.mak." I've set jEdit's makefile mode file name glob to "(*.mak,Makefile,makefile)" but the makefiles are opened in text mode. I can manually change it to makefile mode, but I often forget.

Does anyone know what I'm doing wrong?

Thanks,
Gary.
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
How/where did you modify the
by elberry on Fri, 01/05/2009 - 21:39
How/where did you modify the file name glob?

If you modified it in the catalog under your settings directory, I believe you need to copy over the makefile.xml to that same directory.

If you modified it in the catalog under your application directory, you might have to remove the mak entry under the apdl mode definition.


<MODE NAME="apdl" FILE="apdl.xml"
FILE_NAME_GLOB="*.{ans,inp,mak,mac}" />


Or move the makefile definition above it.

Also, you might want to change your filename glob to look like the one above.


FILE_NAME_GLOB="*.{mak,Makefile,makefile}"


Learn from the past. Live in the present. Plan for the future.
11101000
Blog
 
Now I'm really confused. In
by gsawyer9 on Fri, 01/05/2009 - 22:34
Now I'm really confused. In my ignorance, I simply changed the "File name glob" value under Utilities->Global Options with the "makefile" mode selected. Does this not change the way files are matched with modes?

Would "*.{mak,Makefile,makefile}" select "Makefile" or "something.Makefile?"
 
Ah. k. You should be able to
by elberry on Fri, 01/05/2009 - 22:55
Ah. k. You should be able to do that.

I'm not exactly sure what that does, but it appears to override it for that mode.

If that's the case, try removing "mak" under the apdl one.

Learn from the past. Live in the present. Plan for the future.
11101000
Blog
 
Actually, that's the first th
by gsawyer9 on Sat, 02/05/2009 - 18:51
Actually, that's the first thing I did in this exercise, although I didn't think to mention it in my first post. I noticed that my makefiles were being opened in apdl mode (which I don't currently use) so I removed the mak extension from it and added it to the makefile mode. No joy.

I originally thought it would be easy to teach jEdit about our makefiles, but I may need to try to re-train myself. It might be possible.
 
For me, it works perfectly. P
by Robert Schwenn on Sat, 02/05/2009 - 20:49
For me, it works perfectly. Please check the following points:

1. It may be necessary to manually re-load files, witch have been open in another edit mode before, because the edit mode seems to be saved as a persistent property (at least sometimes).

2. Are You sure that the glob is really set to "*.{mak,Makefile,makefile}"? Note the dot ".". It's not in the original pattern ("*makefile").

Robert
 
That's the clue I needed!
by gsawyer9 on Sat, 02/05/2009 - 21:26
That's the clue I needed!

I changed my makefile glob to "*{mak,Makefile,makefile}" and it seems to work. (I think it may alias "some-name-ending-in-mak-without-an-extension" as a makefile, but I don't think we currently have any.)

My thanks, gentlemen.

Best,
Gary.
User login
Browse archives
« April 2024  
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
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82348
Context Free Art (*.cfdg)   0.31   46055
JBuilder scheme   .001   18495
BBEdit scheme   1.0   18116
ColdFusion scheme   1.0   18024
R Edit Mode - extensive version   0.1   17473
Advanced HTML edit mode   1.0   16206
Matlab Edit Mode   1.0   16068
jEdit XP icons   1.0   15229
XP icons for jEdit   1.1   14293