diff options
| author | Glenn Morris | 2002-04-28 22:09:55 +0000 |
|---|---|---|
| committer | Glenn Morris | 2002-04-28 22:09:55 +0000 |
| commit | 1bb3ae5c0b337d3b05eb4cd34bdfddf6267c1001 (patch) | |
| tree | befecdfefe792ed19ceaee9b227d5f6a77b582f0 | |
| parent | e72706be3813445cecba06db398f1a48aa8cf372 (diff) | |
| download | emacs-1bb3ae5c0b337d3b05eb4cd34bdfddf6267c1001.tar.gz emacs-1bb3ae5c0b337d3b05eb4cd34bdfddf6267c1001.zip | |
(f90-xemacs-flag): New variable to put the test for Emacs flavor in one
place.
| -rw-r--r-- | lisp/progmodes/f90.el | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 32970166326..f88d94cca46 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el | |||
| @@ -242,6 +242,9 @@ The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil." | |||
| 242 | :type 'boolean | 242 | :type 'boolean |
| 243 | :group 'f90) | 243 | :group 'f90) |
| 244 | 244 | ||
| 245 | (defconst f90-xemacs-flag (string-match "XEmacs\\|Lucid" emacs-version) | ||
| 246 | "Non-nil means f90-mode thinks it is running under XEmacs.") | ||
| 247 | |||
| 245 | (defconst f90-keywords-re | 248 | (defconst f90-keywords-re |
| 246 | (regexp-opt '("allocatable" "allocate" "assign" "assignment" "backspace" | 249 | (regexp-opt '("allocatable" "allocate" "assign" "assignment" "backspace" |
| 247 | "block" "call" "case" "character" "close" "common" "complex" | 250 | "block" "call" "case" "character" "close" "common" "complex" |
| @@ -441,7 +444,7 @@ The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil." | |||
| 441 | 444 | ||
| 442 | 445 | ||
| 443 | ;; menus | 446 | ;; menus |
| 444 | (if (string-match "XEmacs" emacs-version) | 447 | (if f90-xemacs-flag |
| 445 | (defvar f90-xemacs-menu | 448 | (defvar f90-xemacs-menu |
| 446 | '("F90" | 449 | '("F90" |
| 447 | ["Indent Subprogram" f90-indent-subprogram t] | 450 | ["Indent Subprogram" f90-indent-subprogram t] |
| @@ -672,11 +675,8 @@ program\\|select\\|subroutine\\|type\\|where\\|forall\\)\\>") | |||
| 672 | 675 | ||
| 673 | ;; When compiling under GNU Emacs, load imenu during compilation. If | 676 | ;; When compiling under GNU Emacs, load imenu during compilation. If |
| 674 | ;; you have 19.22 or earlier, comment this out, or get imenu. | 677 | ;; you have 19.22 or earlier, comment this out, or get imenu. |
| 675 | (and (fboundp 'eval-when-compile) | 678 | (or f90-xemacs-flag (eval-when-compile (require 'imenu))) |
| 676 | (eval-when-compile | 679 | |
| 677 | (if (not (string-match "XEmacs" emacs-version)) | ||
| 678 | (require 'imenu)) | ||
| 679 | ())) | ||
| 680 | 680 | ||
| 681 | ;; abbrevs have generally two letters, except standard types `c, `i, `r, `t | 681 | ;; abbrevs have generally two letters, except standard types `c, `i, `r, `t |
| 682 | (defvar f90-mode-abbrev-table nil) | 682 | (defvar f90-mode-abbrev-table nil) |
| @@ -829,15 +829,13 @@ with no args, if that value is non-nil." | |||
| 829 | (setq normal-auto-fill-function 'f90-do-auto-fill) | 829 | (setq normal-auto-fill-function 'f90-do-auto-fill) |
| 830 | (setq indent-tabs-mode nil) | 830 | (setq indent-tabs-mode nil) |
| 831 | ;; Setting up things for font-lock | 831 | ;; Setting up things for font-lock |
| 832 | (if (string-match "XEmacs" emacs-version) | 832 | (when f90-xemacs-flag |
| 833 | (progn | 833 | (put 'f90-mode 'font-lock-keywords-case-fold-search t) |
| 834 | (put 'f90-mode 'font-lock-keywords-case-fold-search t) | 834 | (when (and (featurep 'menubar) |
| 835 | (if (and (featurep 'menubar) | 835 | current-menubar |
| 836 | current-menubar | 836 | (not (assoc "F90" current-menubar))) |
| 837 | (not (assoc "F90" current-menubar))) | 837 | (set-buffer-menubar (copy-sequence current-menubar)) |
| 838 | (progn | 838 | (add-submenu nil f90-xemacs-menu))) |
| 839 | (set-buffer-menubar (copy-sequence current-menubar)) | ||
| 840 | (add-submenu nil f90-xemacs-menu))))) | ||
| 841 | ;; XEmacs: (Don't need a special case, since both emacsen work alike -sb) | 839 | ;; XEmacs: (Don't need a special case, since both emacsen work alike -sb) |
| 842 | (make-local-variable 'font-lock-defaults) | 840 | (make-local-variable 'font-lock-defaults) |
| 843 | (setq font-lock-defaults | 841 | (setq font-lock-defaults |
| @@ -1227,10 +1225,10 @@ Marks are pushed and highlight (grey shadow) is turned on." | |||
| 1227 | (goto-char pos) | 1225 | (goto-char pos) |
| 1228 | (setq program (f90-beginning-of-subprogram)) | 1226 | (setq program (f90-beginning-of-subprogram)) |
| 1229 | ;; The keywords in the preceding lists assume case-insensitivity. | 1227 | ;; The keywords in the preceding lists assume case-insensitivity. |
| 1230 | (if (string-match "XEmacs" emacs-version) | 1228 | (if f90-xemacs-flag |
| 1231 | (zmacs-activate-region) | 1229 | (zmacs-activate-region) |
| 1232 | (setq mark-active t) | 1230 | (setq mark-active t |
| 1233 | (setq deactivate-mark nil)) | 1231 | deactivate-mark nil)) |
| 1234 | program)) | 1232 | program)) |
| 1235 | 1233 | ||
| 1236 | (defun f90-comment-region (beg-region end-region) | 1234 | (defun f90-comment-region (beg-region end-region) |
| @@ -1399,7 +1397,7 @@ If run in the middle of a line, the line is not broken." | |||
| 1399 | (goto-char save-point) | 1397 | (goto-char save-point) |
| 1400 | (set-marker end-region-mark nil) | 1398 | (set-marker end-region-mark nil) |
| 1401 | (set-marker save-point nil) | 1399 | (set-marker save-point nil) |
| 1402 | (if (string-match "XEmacs" emacs-version) | 1400 | (if f90-xemacs-flag |
| 1403 | (zmacs-deactivate-region) | 1401 | (zmacs-deactivate-region) |
| 1404 | (deactivate-mark)))) | 1402 | (deactivate-mark)))) |
| 1405 | 1403 | ||
| @@ -1512,7 +1510,7 @@ is non-nil, call `f90-update-line' after inserting the continuation marker." | |||
| 1512 | (zerop (forward-line 1)))) | 1510 | (zerop (forward-line 1)))) |
| 1513 | (setq f90-cache-position (point))) | 1511 | (setq f90-cache-position (point))) |
| 1514 | (setq f90-cache-position nil) | 1512 | (setq f90-cache-position nil) |
| 1515 | (if (string-match "XEmacs" emacs-version) | 1513 | (if f90-xemacs-flag |
| 1516 | (zmacs-deactivate-region) | 1514 | (zmacs-deactivate-region) |
| 1517 | (deactivate-mark)))) | 1515 | (deactivate-mark)))) |
| 1518 | 1516 | ||
| @@ -1615,15 +1613,14 @@ Any other key combination is executed normally." | |||
| 1615 | (interactive) | 1613 | (interactive) |
| 1616 | (let (e c) | 1614 | (let (e c) |
| 1617 | (insert last-command-char) | 1615 | (insert last-command-char) |
| 1618 | (if (string-match "XEmacs" emacs-version) | 1616 | (if (not f90-xemacs-flag) |
| 1619 | (progn | 1617 | (setq c (read-event)) |
| 1620 | (setq e (next-command-event)) | 1618 | (setq e (next-command-event) |
| 1621 | (setq c (event-to-character e))) | 1619 | c (event-to-character e))) |
| 1622 | (setq c (read-event))) | ||
| 1623 | ;; insert char if not equal to `?' | 1620 | ;; insert char if not equal to `?' |
| 1624 | (if (or (eq c ??) (eq c help-char)) | 1621 | (if (or (eq c ??) (eq c help-char)) |
| 1625 | (f90-abbrev-help) | 1622 | (f90-abbrev-help) |
| 1626 | (if (string-match "XEmacs" emacs-version) | 1623 | (if f90-xemacs-flag |
| 1627 | (setq unread-command-event e) | 1624 | (setq unread-command-event e) |
| 1628 | (setq unread-command-events (list c)))))) | 1625 | (setq unread-command-events (list c)))))) |
| 1629 | 1626 | ||