unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* On syntax decoration of identifiers containing underscore and statements word [f90]
@ 2013-05-16 22:14 Angelo Graziosi
  2013-05-17  0:37 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Angelo Graziosi @ 2013-05-16 22:14 UTC (permalink / raw)
  To: emacs

I noticed that in f90-mode, identifiers of variables like

  a_close = 0
  a_read = 0
  a_open = 0
  ...

are decorated with "a_" in black and the statement word (close, read, 
open..) in magenta.

While identifiers of variables like

   a_clos = 0
   a_program = 0
   a_if = 0
   ...

are all in black. Shouldn't they be all in black?


Ciao,
   Angelo.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: On syntax decoration of identifiers containing underscore and statements word [f90]
  2013-05-16 22:14 On syntax decoration of identifiers containing underscore and statements word [f90] Angelo Graziosi
@ 2013-05-17  0:37 ` Stefan Monnier
  2013-05-17 10:53   ` Angelo Graziosi
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2013-05-17  0:37 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: emacs

> I noticed that in f90-mode, identifiers of variables like
[...]
> are all in black. Shouldn't they be all in black?

Indeed.  I installed the patch below which should fix those problems.


        Stefan


=== modified file 'lisp/progmodes/f90.el'
--- lisp/progmodes/f90.el	2013-05-15 00:52:07 +0000
+++ lisp/progmodes/f90.el	2013-05-17 00:34:20 +0000
@@ -319,6 +319,8 @@
 ;; User options end here.
 
 (defconst f90-keywords-re
+  (concat
+   "\\_<"
   (regexp-opt '("allocatable" "allocate" "assign" "assignment" "backspace"
                 "block" "call" "case" "character" "close" "common" "complex"
                 "contains" "continue" "cycle" "data" "deallocate"
@@ -342,10 +344,13 @@
                 ;; F2008.
                 "contiguous" "submodule" "concurrent" "codimension"
                 "sync all" "sync memory" "critical" "image_index"
-                ) 'words)
+                 ))
+   "\\_>")
   "Regexp used by the function `f90-change-keywords'.")
 
 (defconst f90-keywords-level-3-re
+  (concat
+   "\\_<"
   (regexp-opt
    '("allocatable" "allocate" "assign" "assignment" "backspace"
      "close" "deallocate" "dimension" "endfile" "entry" "equivalence"
@@ -363,7 +368,8 @@
      ;; "concurrent" is only in the sense of "do [,] concurrent", but given
      ;; the [,] it's simpler to just do every instance (cf "do while").
      "contiguous" "concurrent" "codimension" "sync all" "sync memory"
-     ) 'words)
+      ))
+   "\\_>")
   "Keyword-regexp for font-lock level >= 3.")
 
 (defconst f90-procedures-re
@@ -428,6 +434,8 @@
   "Regexp matching intrinsic operators.")
 
 (defconst f90-hpf-keywords-re
+  (concat
+   "\\_<"
   (regexp-opt
    ;; Intrinsic procedures.
    '("all_prefix" "all_scatter" "all_suffix" "any_prefix"
@@ -447,10 +455,13 @@
      "align" "distribute" "dynamic" "independent" "inherit" "processors"
      "realign" "redistribute" "template"
      ;; Keywords.
-     "block" "cyclic" "extrinsic" "new" "onto" "pure" "with") 'words)
+      "block" "cyclic" "extrinsic" "new" "onto" "pure" "with"))
+   "\\_>")
   "Regexp for all HPF keywords, procedures and directives.")
 
 (defconst f90-constants-re
+  (concat
+   "\\_<"
   (regexp-opt '( ;; F2003 iso_fortran_env constants.
                 "iso_fortran_env"
                 "input_unit" "output_unit" "error_unit"
@@ -482,7 +493,8 @@
                 "integer_kinds" "iostat_inquire_internal_unit"
                 "logical_kinds" "real_kinds" "real32" "real64" "real128"
                 "lock_type" "atomic_int_kind" "atomic_logical_kind"
-                ) 'words)
+                 ))
+   "\\_>")
   "Regexp for Fortran intrinsic constants.")
 
 ;; cf f90-looking-at-type-like.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: On syntax decoration of identifiers containing underscore and statements word [f90]
  2013-05-17  0:37 ` Stefan Monnier
@ 2013-05-17 10:53   ` Angelo Graziosi
  0 siblings, 0 replies; 3+ messages in thread
From: Angelo Graziosi @ 2013-05-17 10:53 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs

Ciao Stefan,

Il 17/05/2013 2.37, Stefan Monnier ha scritto:
>> I noticed that in f90-mode, identifiers of variables like
> [...]
>> are all in black. Shouldn't they be all in black?
>
> Indeed.  I installed the patch below which should fix those problems.
>

It works very well! Thanks..

..but I have to flag another little issue..

In the code

   public ExitProcess
   interface
      subroutine ExitProcess(uExitCode) bind(C,name='ExitProcess')
        import
        !GCC$ ATTRIBUTES STDCALL :: ExitProcess
        integer(UINT_T), intent(in), value :: uExitCode
      end subroutine ExitProcess
   end interface

the identifier "ExitProcess" after "public" (first line) has: "Exit" in 
magenta and "Process" in cyan. Shouldn't it be all in 
black?("ExitProcess" after "subroutine" is all in blue as expected)


Sorry if I flag this a piece at the time, but only when I notice that I 
can flag... :(


Ciao,
  Angelo.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-17 10:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-16 22:14 On syntax decoration of identifiers containing underscore and statements word [f90] Angelo Graziosi
2013-05-17  0:37 ` Stefan Monnier
2013-05-17 10:53   ` Angelo Graziosi

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).