jed-users mailing list

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

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


Ulli Horlacher <framstag@xxxxxxxxxxxxxxxxxxxx> wrote:

> define text_mode_hook() {
>   if (re_fsearch("^#!.*python[0-9]")) python_mode();
> }
> 
> This works!
> .. but also if this regexp is ANYWHERE in my file :-}
> ^ matches begin-of-line
> Is there a regexp for begin-of-buffer?

You could use

  if (re_looking_at("^#!.*python[0-9]")) python_mode();

instead.


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


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