jed-users mailing list

[2022 Date Index] [2022 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [jed-users] #!/usr/bin/python3 does not trigger python mode


Am  5.12.22 schrieb Ulli Horlacher:

> I have file starting with

> #!/usr/bin/python3 

> but this does not trigger jed python mode, it is still text mode.

> Where/what is the hook for it?

In a config/setup file (e.g. .jedrc):

Void add_mode_for_extension (String mode, String ext);

or extend the "_jed_set_mode_hooks", e.g.

% set modes based on filename or more complicated patterns
static define set_modes_hook(ext)
{
   switch (path_basename(buffer_filename()))
     { case ".pycmailrc":  python_mode(); return 1; }
     { case "Makefile":    make_mode();   return 1; }
     { case ".bashrc":     sh_mode();  return 1; }
   return(0);
}
append_to_hook("_jed_set_mode_hooks", &set_modes_hook);

Günter
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.


[2022 date index] [2022 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]