emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r100401: Derive Fortran modes from pr


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100401: Derive Fortran modes from prog-mode.
Date: Thu, 20 May 2010 18:13:57 -0700
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100401
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Thu 2010-05-20 18:13:57 -0700
message:
  Derive Fortran modes from prog-mode.
  * progmodes/fortran.el (fortran-mode):
  * progmodes/f90.el (f90-mode): Derive from prog-mode.
modified:
  lisp/ChangeLog
  lisp/progmodes/f90.el
  lisp/progmodes/fortran.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-05-21 01:05:50 +0000
+++ b/lisp/ChangeLog    2010-05-21 01:13:57 +0000
@@ -7,6 +7,9 @@
 
 2010-05-21  Glenn Morris  <address@hidden>
 
+       * progmodes/fortran.el (fortran-mode):
+       * progmodes/f90.el (f90-mode): Derive from prog-mode.
+
        * loadup.el [CANNOT_DUMP]: Update for bootstrap-emacs no longer
        having a relative path in src/Makefile.in.
 

=== modified file 'lisp/progmodes/f90.el'
--- a/lisp/progmodes/f90.el     2010-02-19 02:36:10 +0000
+++ b/lisp/progmodes/f90.el     2010-05-21 01:13:57 +0000
@@ -1008,7 +1008,7 @@
   :regexp "\\(?:[^[:word:]_`]\\|^\\)\\(`?[[:word:]_]+\\)[^[:word:]_]*")
 
 ;;;###autoload
-(defun f90-mode ()
+(define-derived-mode f90-mode prog-mode "F90"
   "Major mode for editing Fortran 90,95 code in free format.
 For fixed format code, use `fortran-mode'.
 
@@ -1065,13 +1065,9 @@
 
 Turning on F90 mode calls the value of the variable `f90-mode-hook'
 with no args, if that value is non-nil."
-  (interactive)
-  (kill-all-local-variables)
-  (setq major-mode 'f90-mode
-        mode-name "F90"
-        local-abbrev-table f90-mode-abbrev-table)
-  (set-syntax-table f90-mode-syntax-table)
-  (use-local-map f90-mode-map)
+  :group 'f90
+  :syntax-table f90-mode-syntax-table
+  :abbrev-table f90-mode-abbrev-table
   (set (make-local-variable 'indent-line-function) 'f90-indent-line)
   (set (make-local-variable 'indent-region-function) 'f90-indent-region)
   (set (make-local-variable 'require-final-newline) mode-require-final-newline)
@@ -1094,8 +1090,7 @@
        'f90-beginning-of-subprogram)
   (set (make-local-variable 'end-of-defun-function) 'f90-end-of-subprogram)
   (set (make-local-variable 'add-log-current-defun-function)
-       #'f90-current-defun)
-  (run-mode-hooks 'f90-mode-hook))
+       #'f90-current-defun))
 
 
 ;; Inline-functions.

=== modified file 'lisp/progmodes/fortran.el'
--- a/lisp/progmodes/fortran.el 2010-04-10 02:14:47 +0000
+++ b/lisp/progmodes/fortran.el 2010-05-21 01:13:57 +0000
@@ -778,7 +778,7 @@
 
 
 ;;;###autoload
-(defun fortran-mode ()
+(define-derived-mode fortran-mode prog-mode "Fortran"
   "Major mode for editing Fortran code in fixed format.
 For free format code, use `f90-mode'.
 
@@ -848,13 +848,9 @@
 
 Turning on Fortran mode calls the value of the variable `fortran-mode-hook'
 with no args, if that value is non-nil."
-  (interactive)
-  (kill-all-local-variables)
-  (setq major-mode 'fortran-mode
-        mode-name "Fortran"
-        local-abbrev-table fortran-mode-abbrev-table)
-  (set-syntax-table fortran-mode-syntax-table)
-  (use-local-map fortran-mode-map)
+  :group 'fortran
+  :syntax-table fortran-mode-syntax-table
+  :abbrev-table fortran-mode-abbrev-table
   (set (make-local-variable 'indent-line-function) 'fortran-indent-line)
   (set (make-local-variable 'indent-region-function)
        (lambda (start end)
@@ -906,8 +902,7 @@
        #'fortran-current-defun)
   (set (make-local-variable 'dabbrev-case-fold-search) 'case-fold-search)
   (set (make-local-variable 'gud-find-expr-function) 'fortran-gud-find-expr)
-  (add-hook 'hack-local-variables-hook 'fortran-hack-local-variables nil t)
-  (run-mode-hooks 'fortran-mode-hook))
+  (add-hook 'hack-local-variables-hook 'fortran-hack-local-variables nil t))
 
 
 (defun fortran-line-length (nchars &optional global)


reply via email to

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