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


On Wed 2022-12-07 (13:56), Morten Bo Johansen wrote:

>   define no_mode_hook ()
>   {
>     if (re_fsearch("#!.*python[0-9]"))
>       python_mode();
>   }

Good hint!

jed starts in text mode when I edit a python source file, therefore I
have added to jed.rc:

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?


-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK         
Universitaet Stuttgart         E-Mail: horlacher@xxxxxxxxxxxxxxxxxxxx
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    http://www.tik.uni-stuttgart.de/
REF:<Y5CNdFwF8G49xonf@xxxxxxxxxxxxxxxx>
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.


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