# HG changeset patch # User Richard M. Stallman # Date 720181282 0 # Node ID a6da00e1c5ad1ae52585ffaa7442fb45317f0d42 # Parent 6c2a714566d3d0bd7a2eda8df5a4f9af8cb7a240 (fortran-tab-mode): Add defvar. (fortran-analyze-file-format): Bind i. (fortran-tab-mode-string): Add defvar. (fortran-tab-mode): Use `arg' as variable, not as function. (fortran-prepare-abbrev-list-buffer): New function. (fortran-abbrev-help): Call that. diff -r 6c2a714566d3 -r a6da00e1c5ad lisp/progmodes/fortran.el --- a/lisp/progmodes/fortran.el Tue Oct 27 10:14:08 1992 +0000 +++ b/lisp/progmodes/fortran.el Tue Oct 27 10:21:22 1992 +0000 @@ -1,10 +1,10 @@ ;;; fortran.el --- Fortran mode for GNU Emacs -;;; Copyright (c) 1991 Free Software Foundation, Inc. +;;; Copyright (c) 1992 Free Software Foundation, Inc. ;; Author: Michael D. Prange ;; Maintainer: bug-fortran-mode@erl.mit.edu -;; Version 1.28.3 +;; Version 1.28.3a ;; Keywords: languages ;; This file is part of GNU Emacs. @@ -102,10 +102,19 @@ ;;;###autoload (defvar fortran-tab-mode-default nil - "*Default tabbing/carriage control style for empty files in fortran mode. -t indicates that tab-digit style of continuation control will be used. -nil indicates that continuation lines are marked with a character in -column 6.") + "*Default tabbing/carriage control style for empty files in Fortran mode. +A value of t specifies tab-digit style of continuation control. +A value of nil specifies that continuation lines are marked +with a character in column 6.") + +(defvar fortran-tab-mode nil + "*tabbing/carriage control style for Fortran mode. +A value of t specifies tab-digit style of continuation control. +A value of nil specifies that continuation lines are marked +with a character in column 6.") + +;; Buffer local, used to display mode line. +(defvar fortran-tab-mode-string) (defvar fortran-do-indent 3 "*Extra indentation applied to `do' blocks.") @@ -476,9 +485,19 @@ (interactive) (message "Listing abbrev table...") (require 'abbrevlist) - (list-one-abbrev-table fortran-mode-abbrev-table "*Help*") + (display-buffer (fortran-prepare-abbrev-list-buffer)) (message "Listing abbrev table...done")) +(defun fortran-prepare-abbrev-list-buffer () + (save-excursion + (set-buffer (get-buffer-create "*Abbrevs*")) + (erase-buffer) + (insert-abbrev-table-description fortran-mode-abbrev-table t) + (goto-char (point-min)) + (set-buffer-modified-p nil) + (edit-abbrevs-mode)) + (get-buffer-create "*Abbrevs*")) + (defun fortran-column-ruler () "Inserts a column ruler momentarily above current line, till next keystroke. The ruler is defined by the value of `fortran-column-ruler'. @@ -939,21 +958,21 @@ "Return 0 if Fixed format is used, 1 if Tab formatting is used. Use `fortran-tab-mode-default' if no non-comment statements are found in the file before the end or the first `fortran-analyze-depth' lines." - (save-excursion - (goto-char (point-min)) - (setq i 0) - (while (not (or - (eobp) - (looking-at "\t") - (looking-at " ") - (> i fortran-analyze-depth))) - (forward-line) - (setq i (1+ i))) - (cond - ((looking-at "\t") 1) - ((looking-at " ") 0) - (fortran-tab-mode-default 1) - (t 0)))) + (let ((i 0)) + (save-excursion + (goto-char (point-min)) + (while (not (or + (eobp) + (looking-at "\t") + (looking-at " ") + (> i fortran-analyze-depth))) + (forward-line) + (setq i (1+ i))) + (cond + ((looking-at "\t") 1) + ((looking-at " ") 0) + (fortran-tab-mode-default 1) + (t 0))))) (defun fortran-tab-mode (arg) "Toggle `fortran-tab-mode' which indicates style of continuation lines. @@ -965,7 +984,7 @@ (if (null arg) (not fortran-tab-mode) (if (numberp arg) (> (prefix-numeric-value arg) 0) - (arg)))) + arg))) (if fortran-tab-mode (fortran-setup-tab-format-style) (fortran-setup-fixed-format-style))