emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Indentation in shell-script-mode in combination with global-font-lo


From: Lute Kamstra
Subject: Re: Indentation in shell-script-mode in combination with global-font-lock-mode.
Date: Fri, 05 Sep 2003 11:44:21 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

Lute Kamstra <address@hidden> writes:

>> I start Emacs with
>>
>>   emacs -q --no-site-file example.sh
>>
>> to end up in shell-script-mode.
>>
>> Lines terminated with an `\' are now indented as follows:
>>
>> first \
>>     second
>>
>> If I start font-locking by typing M-x global-font-lock-mode
>> indentation is like this:
>>
>> first \
>> second
>
> The bug is introduced by this change:
>
> 2003-06-01  Stefan Monnier  <address@hidden>
>
>       * progmodes/sh-script.el (sh-is-quoted-p): New fun.
>       (sh-font-lock-paren): Use it to allow \C in case patterns.
>       (sh-get-indent-info): Check the \n before the line for string-status.
>       (sh-feature): Remove unused var `function'.
>       (sh-get-indent-info): Remove unused variables.
>       (sh-prev-thing): Remove unused vars `going', `n', and `found'.
>       (sh-set-indent): Remove unused var `new-val' and `val0'.
>       (sh-learn-buffer-indent): Remove unused vars `last-pos' and `lines'.
>       (sh-guess-basic-offset): Remove unused var `return' and `j'.
>
> sh-get-indent-info is changed so that it checks the font of 
> (-1 (line-beginning-position)) as opposed to the font of
> (line-beginning-position) to determine the string status.
>
> With font-locking, the \ at the end of the line causes the \n
> following it to have font-lock-string-face, thus sh-get-indent-info
> erroneously concludes that it is inside a string and signals not to do
> any indenting for the current line.  So checking the preceding \n for
> font-lock-string-face is not a safe way to determine the string
> status.

The bug is fixed by this change:

2003-09-02  Glenn Morris  <address@hidden>

        * progmodes/sh-script.el (sh-font-lock-keywords): Use something
        other than font-lock-string-face to highlight backslashes.

Thanks Glenn.


  Lute.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]