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

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

Re: f90-mode - auto-fill and font-lock


From: Stefan Monnier
Subject: Re: f90-mode - auto-fill and font-lock
Date: 03 Dec 2001 20:52:08 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.50

>>>>> "Glenn" == Glenn Morris <address@hidden> writes:
> (1) The e-mail address specified in the variable `bug-f90-mode' appears to
>     be invalid.

The variable should probably just be removed (users can just use
M-x report-emacs-bug).  Dave?

> PS. Blatant ingratiation - can I just take a moment to say that I *love*
> Emacs 21! Thanks for all the hard work!

Please, take your time ;-)

> --- f90.el.ORIG       Sat Dec  1 19:14:16 2001
> +++ f90.el    Sat Dec  1 19:15:55 2001
> @@ -372,7 +372,8 @@
>     '("\\<\\(program\\|call\\|module\\|subroutine\\|function\\|use\\)\\>[ 
> \t]*\\(\\sw+\\)?"
>       (1 font-lock-keyword-face) (2 font-lock-function-name-face nil t))
>     ;; Special highlighting of "module procedure foo-list"
> -   '("\\<\\(module[ \t]*procedure\\)\\>" (1 font-lock-keyword-face t))
> +   '("\\<\\(module[ \t]*procedure\\)\\>"
> +      (1 (if (f90-in-comment) font-lock-comment-face font-lock-keyword-face) 
> t))

The `t' after `font-lock-keyword-face' tells font-lock that it's OK to put
the face on top of a preexisting one (f.ex. a comment or sting face).  So it
seems that it was a conscious decision.  It seems to be because `module' is
already highlighted by the pattern just above.  I don't know F90 syntax so
I can't tell how it should be fixed.  Maybe replacing the first regexp
with the following is all that's needed ?

"\\<\\(program\\|call\\|module\\(?:[ 
\t]*procedure\\)?\\|subroutine\\|function\\|use\\)\\>[ \t]*\\(\\sw+\\)?"

Or swapping the two regexps...

> @@ -1472,14 +1473,14 @@
>    (interactive)
>    (let (ctype)
>      (cond ((f90-in-string)
> -        (insert "&") (newline) (insert "&"))
> +        (insert "&") (newline 1) (insert "&"))
>         ((f90-in-comment)
>          (setq ctype (f90-get-present-comment-type))
> -        (newline)
> +        (newline 1)
>          (insert ctype))
>         (t (insert "&")
>            (if (not no-update) (f90-update-line))
> -          (newline)
> +          (newline 1)
>            (if f90-beginning-ampersand (insert "&")))))
>    (f90-indent-line))
   
The default auto-filling function (comment-indent-new-line) uses
(if soft (insert-and-inherit ?\n) (newline 1)) but f90's
function does not have soft, so I'm not sure whether it should use hard
newlines or not.  Would anyone use `use-hard-newlines' with f90 anyway?


        Stefan



reply via email to

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