- Subject: Re: [jed-users] #!/usr/bin/python3 does not trigger python mode
- From: Guenter Milde <milde@xxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 6 Dec 2022 18:57:20 +0100
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]