unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Fortran (95/03) syntax highlighting
@ 2008-08-19 20:11 Izaak Beekman
  2008-08-20  9:50 ` Nikolaj Schumacher
       [not found] ` <mailman.17124.1219225804.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Izaak Beekman @ 2008-08-19 20:11 UTC (permalink / raw)
  To: help-gnu-emacs


[-- Attachment #1.1: Type: text/plain, Size: 771 bytes --]

I am a relatively new Emacs user, and was wondering if anyone can help me
with a few syntax highlighting issues.  I program in the 95/03 dialect only,
and am not terribly interested in f77 hacks etc.

Right now my main issues are:

1) Incorrect syntax highlighting in variable declarations with line
continuations.

2) No support for Fortran 03 syntax

3) .f95 and .f03 file-name-suffixes are not recognized.

I have included my .emacs file as an attachment.  This has been very
sloppily cobbled together from other peoples .emacs files and various small
enhancements I have made myself.  Comments and suggestions welcome.

-- 
Izaak Beekman
===================================
Princeton University
D309 Engineering Quadrangle
Princeton, NJ 08544

ibeekman@princeton.edu

[-- Attachment #1.2: Type: text/html, Size: 947 bytes --]

[-- Attachment #2: my.emacs --]
[-- Type: application/octet-stream, Size: 7072 bytes --]

;; .emacs initialization file


;; Are we running XEmacs or Emacs?
(defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))


;; Set up the keyboard so the delete key on both the regular keyboard
;; and the keypad delete the character under the cursor and to the right
;; under X, instead of the default, backspace behavior.
(global-set-key [delete] 'delete-char)
(global-set-key [kp-delete] 'delete-char)


;; Turn on font-lock mode for Emacs
(cond ((not running-xemacs)
       (global-font-lock-mode t)
))


;; Always end a file with a newline
(setq require-final-newline t)


;; Stop at the end of the file, not just add lines
(setq next-line-add-newlines nil)


;; Enable wheelmouse support by default
(if (not running-xemacs)
    (require 'mwheel) ; Emacs
  (mwheel-install) ; XEmacs
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



(setq make-backup-files 'non-nil)
(setq version-control t)
(setq kept-new-versions 3)
(setq kept-old-versions 3)
(setq require-final-newline 'nil)
(setq default-major-mode 'text-mode)
(setq text-mode-hook '(lambda () (auto-fill-mode 1)))
(setq visible-bell t)
(setq lpr-switches 
      '("-o number-up=2 gamma=400 page-left=9 page-right=9 page-top=9 page-bottom=9"))
(setq pr-switches 
      '("-o number-up=2 gamma=400 page-left=9 page-right=9 page-top=9 page-bottom=9"))
;;;;;;;;;;;;;;;;;;;
;      spell things
;;;;;;;;;;;;;;;;;;;

;; (setq-default ispell-program-name "/sw/share/aspell/ispell")
;; (setq ispell-dictionary "american")
;; (add-hook 'text-mode-hook 'flyspell-mode)
;; (autoload 'flyspell-mode "flyspell" "On-the-fly spelling checking" t)



;;;;;;;;;;;;;;;;;;;;;;
;  mail things
;;;;;;;;;;;;;;;;;;;;;;
;
;(setq mail-self-blind t)
;(setq mail-yank-prefix "|>  ")
;(setq mail-default-reply-to "ibeekman@princeton.edu")
;(setq rmail-file-name (expand-file-name "~/Mail/RMAIL"))
;(setq rmail-last-rmail-file (expand-file-name "~/Mail/"))
;(setq rmail-inbox-to-list (expand-file-name "~/Mail/"))
;(setq rmail-output-to-rmail-file (expand-file-name "~/Mail/"))



;;;;;;;;;;;;;;;;;;;;;;;
;  TeX things
;;;;;;;;;;;;;;;;;;;;;;;
;
(setq tex-dvi-view-command "xdvi -display $disp -S 20 -s 3 -bg #576 -fg white -hl blue4 -expert -geometry 850x1000+200+5")
;(setq tex-dvi-print-command "dvips -f * | lpr")



;;;;;;;;;;;;;;;;;;;;;;;
;  custom bindings
;;;;;;;;;;;;;;;;;;;;;;;
;
(global-set-key "\M-g"     'gdb)
(global-set-key "\M-m"     'compile)
(global-set-key "\M-n"     'next-error)
(global-set-key "\M-o"     'overwrite-mode)
(global-set-key "\C-z"     'shell)
(global-set-key "\M-1"     'shell-command)
(global-set-key "\M-2"     'another-shell)
(global-set-key "\C-x\C-g" 'goto-line)
(global-set-key "\C-x\C-]" 'what-line)
(global-set-key "\C-x\C-k" 'kill-other-buffer)
(global-set-key "\C-c\C-q" 'query-replace)
(global-set-key "\C-x\C-y" 'spell-buffer)
(global-set-key "\C-c\C-o" 'scroll-other-window)
(global-set-key "\C-c\C-t" 'current-line-to-top-of-screen)
(global-set-key "\C-c\C-e" 'clear-screen)
(global-set-key "\C-c\C-l" 'list-command-history)
(global-set-key "\C-c\C-s" 'ispell-buffer)



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;  remote connect commands
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (ssh to weno)
;; (defun ssh-to-weno ()
;;  "ssh ibeekman@weno.princeton.edu"
;;  (interactive)
;;  (ssh "ibeekman@weno.princeton.edu"))
;; (global-se
;;  t-key "\C-\M-a" 'ssh-to-weno)


;;
;;  custom functions
;;


;
; kills other buffer  
;


(defun kill-other-buffer (null)
  "Kills the buffer currently in other window"
  (interactive "B")
  (other-window 1)
  (kill-this-buffer)
  (other-window 1)
)


(defun my-colors (null)
  (set-background-color "#000") 
  (set-foreground-color "#0f9")
  (set-cursor-color "red")
  (set-mouse-color "cyan")
  (set-face-foreground 'bold "#fb0")
  (set-face-foreground 'highlight "black")
  (set-face-background 'highlight "#fb0")  
  (set-face-foreground 'modeline "white")
  (set-face-background 'modeline "black")
  (set-face-foreground 'region "#004")
  (set-face-background 'region "#8bb")
  (set-face-foreground 'underline "#fc0")
;  (set-face-foreground 'font-lock-type-face "gold")
;  (set-face-foreground 'font-lock-string-face "steelblue")
;  (set-face-foreground 'font-lock-keyword-face "yellowgreen")
;  (set-face-foreground 'font-lock-constant-face "gold")
;  (set-face-foreground 'font-lock-warning-face "#0f9")
;  (set-face-foreground 'font-lock-function-name-face "#0f9")
;  (set-face-foreground 'font-lock-variable-name-face "skyblue")
  )


;
; initialize (to my own preferences)
;
 
(defun initialize (directory)
  "Initializes EMACS session to personal preferences"
  (interactive "D")
  (tool-bar-mode)
  (my-colors ())
  (display-time)
  (line-number-mode 1)
;  (scroll-bar-mode 0)
;  (set-default-font "7x13")
;  (set-default-font "a14")
  (shell)
  (split-window-horizontally)
)
(initialize "/home/ibeekman")
(custom-set-variables
  ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 '(auto-compression-mode t nil (jka-compr))
 '(case-fold-search t)
 '(comint-completion-autolist t)
 '(comint-completion-recexact t)
 '(comint-input-autoexpand t)
 '(current-language-environment "English")
 '(default-input-method "rfc1345")
 '(explicit-shell-file-name "")
 '(f90-auto-keyword-case (quote upcase-word))
 '(f90-mode-hook (quote (f90-add-imenu-menu)))
 '(fortran-blink-matching-if t)
 '(global-font-lock-mode t nil (font-lock))
 '(global-hl-line-mode nil nil (hl-line))
 '(mouse-avoidance-mode (quote animate) nil (avoid))
 '(mouse-wheel-mode t nil (mwheel))
 '(remote-compile-host "crocco.princeton.edu")
 '(remote-compile-prompt-for-host t)
 '(remote-compile-prompt-for-user t)
 '(remote-compile-user "ibeekman")
 '(save-place t nil (saveplace))
 '(shell-input-autoexpand t)
 '(show-paren-mode t nil (paren))
 '(text-mode-hook (quote (turn-on-auto-fill (lambda nil (auto-fill-mode 1)))))
 '(tool-bar-mode t nil (tool-bar))
 '(transient-mark-mode t)
 '(uniquify-buffer-name-style (quote forward) nil (uniquify))
 '(vc-initial-comment t))
(custom-set-faces
  ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 )



(put 'downcase-region 'disabled nil)


(put 'upcase-region 'disabled nil)

;;  ;; add g95 to compilation mode
;;   (eval-after-load "compile"
;;      '(setq compilation-error-regexp-alist
;;          (cons '("^In file \\(.+\\):\\([0-9]+\\)" 1 2)
;;             compilation-error-regexp-alist)))


;; ;;; This was installed by package-install.el.
;; ;;; This provides support for the package system and
;; ;;; interfacing with ELPA, the package archive.
;; ;;; Move this code earlier if you want to reference
;; ;;; packages in your .emacs.
;; (when
;;     (load
;;      (expand-file-name "~/.emacs.d/elpa/package.el"))
;;   (package-initialize))

(add-hook 'com-int-output-filter-functions
	  'comint-watch-for-password-prompt)

(set-register ?e '(file . "~/.emacs"))
(set-register ?b '(file . "~/.bashrc"))
(set-register ?p '(file . "~/.bash_profile"))

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

* Re: Fortran (95/03) syntax highlighting
  2008-08-19 20:11 Fortran (95/03) syntax highlighting Izaak Beekman
@ 2008-08-20  9:50 ` Nikolaj Schumacher
  2008-08-20 17:01   ` Izaak Beekman
       [not found]   ` <mailman.17166.1219251721.18990.help-gnu-emacs@gnu.org>
       [not found] ` <mailman.17124.1219225804.18990.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 5+ messages in thread
From: Nikolaj Schumacher @ 2008-08-20  9:50 UTC (permalink / raw)
  To: Izaak Beekman; +Cc: help-gnu-emacs

"Izaak Beekman" <ibeekman@princeton.edu> wrote:

> 2) No support for Fortran 03 syntax

It's currently not supported by Emacs.  You could look for an
external package, but I wouldn't get my hopes up.

> 1) Incorrect syntax highlighting in variable declarations with line
> continuations.

If that's legal F95 syntax, I'd report it as a bug.  (M-x report-emacs-bug)

> 3) .f95 and .f03 file-name-suffixes are not recognized.

(add-to-list 'auto-mode-alist
             '("\\.[fF]\\(03\\|95\\)\\'" . f90-mode))

However, .f95 works out of the box here.  Are you using a recent Emacs?

> I have included my .emacs file as an attachment.  This has been very
> sloppily cobbled together from other peoples .emacs files and various small
> enhancements I have made myself.  Comments and suggestions welcome.

If you request comments, please paste in inline, so it can be easily
quoted.  Although I'd prefer to stay on-topic.

regards,
Nikolaj Schumacher




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

* Re: Fortran (95/03) syntax highlighting
       [not found] ` <mailman.17124.1219225804.18990.help-gnu-emacs@gnu.org>
@ 2008-08-20 16:46   ` Glenn Morris
  0 siblings, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2008-08-20 16:46 UTC (permalink / raw)
  To: help-gnu-emacs

Nikolaj Schumacher wrote:

> "Izaak Beekman" <ibeekman@princeton.edu> wrote:
>
>> 2) No support for Fortran 03 syntax
>
> It's currently not supported by Emacs.  You could look for an
> external package, but I wouldn't get my hopes up.

The development version of Emacs (to be released as 23.1 hopefully on
the order of six months) has supported F03 for the best part of a year.
I encourage people to try it out and report any problems or missing
features.

>> 1) Incorrect syntax highlighting in variable declarations with line
>> continuations.
>
> If that's legal F95 syntax, I'd report it as a bug.  (M-x report-emacs-bug)

Indeed.

>> 3) .f95 and .f03 file-name-suffixes are not recognized.

.f95 was in Emacs 22.1 (added to CVS over six years ago), released over
a year ago. There is no reason to use anything other than 22.2 nowadays
(22.3 coming soonish).

I have not added .f03 because it is my understanding that the adoption
of .f95 as an extension was basically a mistake, and that we were never
intended to change the name of our files every few years. Can't remember
where I got this idea from, pointers to corrections saying that .f03 is
a recommended extension are welcome.


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

* Re: Fortran (95/03) syntax highlighting
  2008-08-20  9:50 ` Nikolaj Schumacher
@ 2008-08-20 17:01   ` Izaak Beekman
       [not found]   ` <mailman.17166.1219251721.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Izaak Beekman @ 2008-08-20 17:01 UTC (permalink / raw)
  To: Nikolaj Schumacher; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1360 bytes --]

I am using Emacs 21.4.1  I would like to upgrade to 22.x but it's not
available through the standard channels on my workstation at work.

On Wed, Aug 20, 2008 at 5:50 AM, Nikolaj Schumacher <me@nschum.de> wrote:

> "Izaak Beekman" <ibeekman@princeton.edu> wrote:
>
> > 2) No support for Fortran 03 syntax
>
> It's currently not supported by Emacs.  You could look for an
> external package, but I wouldn't get my hopes up.
>
> > 1) Incorrect syntax highlighting in variable declarations with line
> > continuations.
>
> If that's legal F95 syntax, I'd report it as a bug.  (M-x report-emacs-bug)
>
> > 3) .f95 and .f03 file-name-suffixes are not recognized.
>
> (add-to-list 'auto-mode-alist
>             '("\\.[fF]\\(03\\|95\\)\\'" . f90-mode))
>
> However, .f95 works out of the box here.  Are you using a recent Emacs?
>
> > I have included my .emacs file as an attachment.  This has been very
> > sloppily cobbled together from other peoples .emacs files and various
> small
> > enhancements I have made myself.  Comments and suggestions welcome.
>
> If you request comments, please paste in inline, so it can be easily
> quoted.  Although I'd prefer to stay on-topic.
>
> regards,
> Nikolaj Schumacher
>



-- 
Izaak Beekman
===================================
Princeton University
D309 Engineering Quadrangle
Princeton, NJ 08544

ibeekman@princeton.edu

[-- Attachment #2: Type: text/html, Size: 2107 bytes --]

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

* Re: Fortran (95/03) syntax highlighting
       [not found]   ` <mailman.17166.1219251721.18990.help-gnu-emacs@gnu.org>
@ 2008-08-20 17:05     ` Glenn Morris
  0 siblings, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2008-08-20 17:05 UTC (permalink / raw)
  To: help-gnu-emacs

"Izaak Beekman" wrote:

> I am using Emacs 21.4.1  I would like to upgrade to 22.x but it's not
> available through the standard channels on my workstation at work.

All you need is ~ 150MB of disk space, then you can install your own.


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

end of thread, other threads:[~2008-08-20 17:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-19 20:11 Fortran (95/03) syntax highlighting Izaak Beekman
2008-08-20  9:50 ` Nikolaj Schumacher
2008-08-20 17:01   ` Izaak Beekman
     [not found]   ` <mailman.17166.1219251721.18990.help-gnu-emacs@gnu.org>
2008-08-20 17:05     ` Glenn Morris
     [not found] ` <mailman.17124.1219225804.18990.help-gnu-emacs@gnu.org>
2008-08-20 16:46   ` Glenn Morris

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).