|
From: Dale A. <da...@da...> - 2014-04-02 20:51:32
|
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 So in your case, the txt mode is selected because it matches rule #3 and wins out over your catalog entry which doesn't match until rule #4. Adding a filename glob to your catalog entry will make it match rule #2 and you'll win. For example, this is how the maven mode is selected for pom.xml file rather than the xml mode -- the maven catalog entry matches rule #1 and the xml catalog entry doesn't match until rule #3. Dale On Wed, Apr 2, 2014 at 11:30 AM, David G <jam...@gm...> wrote: > Yeah, I first tried both the filename and the first line at the same time > and it didn't work then, either. The docs seemed to say it was an OR > relationship between the two attributes, rather than an AND. > > Thanks for responding, though. > > I wonder if I could create a macro to assign my mode to the file > manually. At least then it would be just a button click away. > > Okay, I tried recording a macro, but all the macro did was bring up the > settings dialog. I even recorded myself doing it via the C-Enter action > bar, but no dice there. If anyone has an idea, I'd love to see it. > > > On Wed, Apr 2, 2014 at 1:14 PM, Alan Ezust <ala...@gm...> wrote: > >> >> http://jedit.org/users-guide/installing-modes.html >> >> If your filename is something.txt and there is already a FILE_NAME_GLOB >> for *.txt that rule can take precedence over the FIRST_LINE_GLOB. Perhaps >> if your user mode also had *.txt as its FILE_NAME_GLOB then jEdit might be >> able to check deeper and look at the FIRST_LINE to decide whether to use >> your mode or txt, but maybe it will always use your mode instead of txt, I >> am not sure. I would have to look into the code to find out more. >> >> >> On Wed, Apr 2, 2014 at 9:56 AM, David G <jam...@gm...> wrote: >> >>> 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? >>> >>> < MODE NAME="ToDo" FILE="ToDo.xml" FIRST_LINE_GLOB="*# ToDoFile*" / > >>> >>> Thanks for any help! >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> -- >>> ----------------------------------------------- >>> jEdit Users' List >>> jEd...@li... >>> https://lists.sourceforge.net/lists/listinfo/jedit-users >>> >>> >> > > > ------------------------------------------------------------------------------ > > -- > ----------------------------------------------- > jEdit Users' List > jEd...@li... > https://lists.sourceforge.net/lists/listinfo/jedit-users > > |