Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
need help customizing font-lock colors in syntax highlighting (fortran)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
bcbar...@gmail.com  
View profile  
 More options Mar 31 2008, 3:41 pm
Newsgroups: gnu.emacs.help
From: bcbar...@gmail.com
Date: Mon, 31 Mar 2008 12:41:35 -0700 (PDT)
Local: Mon, Mar 31 2008 3:41 pm
Subject: need help customizing font-lock colors in syntax highlighting (fortran)
Hello,

I've been using emacs for a long time, mostly for Fortran and Python
programming.  I'm currently porting some code from fixed-format to
free-format Fortran, which means the extension of the source file
would change from ".f" to ".f90" -- and the code, which is standard
Fortran 95, would have the F90 filter (f90.el by Glenn Morris) applied
instead of the fortran.el (fortran mode) filter.

In the old fortran mode filter, intrinsics such as mod, exp, and
others would be highlighting in a different color (say, pink) than the
control flow commands such as if/endif, do/enddo (which would be in
purple).  In the F90 mode, these commands are all highlighted in the
same color.  I find this to be undesirable, but I'm not sure how to
change it.  Poking around the f90.el source and google tells me it
will involve something like set-face-foreground of a font-lock mode,
but I don't know what to do.

Can anyone help me out in getting my syntax highlighting customized?
Or should I email the maintainer of the filters?  I am using emacs
22.1 on Fedora 8 and also Aquamacs 1.3 (based on emacs 22.1) on OS X
Leopard.

thanks,

Brian


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Glenn Morris  
View profile  
 More options Apr 1 2008, 3:29 am
Newsgroups: gnu.emacs.help
From: Glenn Morris <rgm+n...@stanford.edu>
Date: Tue, 01 Apr 2008 00:29:14 -0700
Local: Tues, Apr 1 2008 3:29 am
Subject: Re: need help customizing font-lock colors in syntax highlighting (fortran)

bcbar...@gmail.com wrote:
> In the old fortran mode filter, intrinsics such as mod, exp, and
> others would be highlighting in a different color (say, pink) than the
> control flow commands such as if/endif, do/enddo (which would be in
> purple). In the F90 mode, these commands are all highlighted in the
> same color. I find this to be undesirable, but I'm not sure how to
> change it.

I don't really know why it is like it is, but it is. Anyway, add to
~/.emacs:

(eval-after-load "f90"
  '(progn
     (setq f90-font-lock-keywords-3
      (append f90-font-lock-keywords-2
          (list
           f90-keywords-level-3-re
           f90-operators-re
           (list f90-procedures-re '(1 font-lock-builtin-face keep))
           "\\<real\\>"))
      f90-font-lock-keywords-4 (append f90-font-lock-keywords-3
          (list f90-hpf-keywords-re)))))


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Dyballa  
View profile  
 More options Apr 1 2008, 4:59 am
Newsgroups: gnu.emacs.help
From: Peter Dyballa <Peter_Dyba...@Web.DE>
Date: Tue, 1 Apr 2008 10:59:14 +0200
Local: Tues, Apr 1 2008 4:59 am
Subject: Re: need help customizing font-lock colors in syntax highlighting (fortran)

Am 31.03.2008 um 21:41 schrieb bcbarnes:

> In the F90 mode, these commands are all highlighted in the
> same color.  I find this to be undesirable, but I'm not sure how to
> change it.  Poking around the f90.el source and google tells me it
> will involve something like set-face-foreground of a font-lock mode,
> but I don't know what to do.

In case you want to change the colour, you can start with C-u C-x =  
on a character in the unwanted face (font and colour). A *Help*  
buffer opens, allowing you to customise the settings in the  
"paragraph" where it describes the text properties.

In your case it will fail, because apparently different sorts of key  
words are mixed. So you would change the face for all of them again,  
for the whole set or "mixed" case.

--
Greetings

   Pete

A morning without coffee is like something without something else.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bcbar...@gmail.com  
View profile  
 More options Apr 1 2008, 11:54 am
Newsgroups: gnu.emacs.help
From: bcbar...@gmail.com
Date: Tue, 1 Apr 2008 08:54:38 -0700 (PDT)
Local: Tues, Apr 1 2008 11:54 am
Subject: Re: need help customizing font-lock colors in syntax highlighting (fortran)
On Apr 1, 2:29 am, Glenn Morris <rgm+n...@stanford.edu> wrote:

Excellent, Glenn!  That does exactly what I wanted.  Tested in both
emacs 22.1 and Aquamacs 1.3 / OS X.  Thanks.

-Brian


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google