- Subject: [jed-users] Re: #!/usr/bin/python3 does not trigger python mode
- From: Morten Bo Johansen <mbj@xxxxxxxxx>
- Date: Wed, 7 Dec 2022 15:09:39 +0100
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]