LISTING FOR >spec>install>1136>emacs-fortran-mode COMPILED BY Multics LISP Compiler, Version 2.13c, July 11, 1983 ON 08/20/86 2252.9 mst Wed IN BEHALF OF Martinson.SysMaint.a ;;; *********************************************************** ;;; * * ;;; * Copyright, (C) Honeywell Information Systems Inc., 1982 * ;;; * * ;;; * Copyright (c) 1978 by Massachusetts Institute of * ;;; * Technology and Honeywell Information Systems, Inc. * ;;; * * ;;; *********************************************************** ;;; ;;; ;;; ;;; Fortran mode extension for Multics EMACS ;;; Written by Paul Schauble DVCP mail station C34 HVN 357-4531 ;;; On January 17, 1979 ;;; HISTORY COMMENTS: ;;; 1) change(86-04-23,Margolin), approve(86-04-23,MCR7325), ;;; audit(86-08-12,Harvey), install(86-08-20,MR12.0-1136): ;;; Added missing *expr declarations. ;;; END HISTORY COMMENTS ;;; (%include e-macros) (defvar fortran-mode-hook nil) (declare (special fortran-begin-comment-line fortran-end-comment-line fill-prefix current-buffer-mode compiler compile-options buffer-uid mode-identification error-list-builder buffer-minor-modes error-list e-list)) (declare (*expr conditional-new-line cv_dec_check_ exit-error-scan-mode internedp kill-contents-of-line)) ;;; ;;; Mode initialization ;;; (defun fortran-mode () (mapc '(lambda (x) (set-key (car x) (cadr x))) '((esc-/; fortran-comment-line) (^xc fortran-begin-comment-block) (esc-/: fortran-label) (^i fortran-indent-statement) (esc-^m fortran-continue) (esc-^c compile-buffer) (/' fortran-abbrev-expander) (esc-p undefined-command) ; I don't know what these (esc-n undefined-command) ; mean to Fortran (^x^d locate-next-error) (^xt exit-error-scan-mode))) (setq current-buffer-mode 'Fortran) (setq fill-prefix " ") (if (line-is-blank) (without-saving (kill-contents-of-line) (insert-string " "))) (register-local-var 'fortran-begin-comment-line) (register-local-var 'fortran-end-comment-line) (register-local-var 'compiler) (register-local-var 'compile-options) (register-local-var 'mode-identification) (register-local-var 'error-list-builder) (setq fortran-begin-comment-line "c ========================================" fortran-end-comment-line fortran-begin-comment-line compiler "ft " compile-options " -tb" error-list-builder 'fortran-error-list-builder mode-identification -1) (if (boundp 'error-list) ; end error scan mode if needed. (if error-list (exit-error-scan-mode)) else (setq error-list nil e-list nil)) (if fortran-mode-hook (errset (funcall fortran-mode-hook)))) ;;; ;;; One time initialization, done when file is loaded ;;; (mapc '(lambda (item) ;; initial list of abbrevs (putprop (car item) (cdr item) 'fortran-abbrev)) '((in integer/ nil nil) (su subroutine/ nil nil) (di dimension/ nil nil) (co continue t t) (re return t t) (fu function/ nil nil) (au automatic/ nil nil) (eq equivalence/ /( nil nil) (ex external/ nil nil) (cn common/ nil nil) (fo format/ /( t nil) (im implicit/ nil nil) ) ) ;;; ;;; Basic Fortran formating 1/17/79 ;;; (defun fortran-set-begin-comment () (setq fortran-begin-comment-line (trim-minibuf-response "Begin comment block: " NL ))) (defun fortran-set-end-comment () (setq fortran-end-comment-line (trim-minibuf-response "End comment block: " NL))) (defun fortran-begin-comment-block () (if (memq 'comment buffer-minor-modes) (conditional-new-line fortran-end-comment-line) (setq fill-prefix " ") (new-line) (negate-minor-mode 'comment) else (conditional-new-line fortran-begin-comment-line) (setq fill-prefix "c ") (new-line) (assert-minor-mode 'comment) )) (defun fortran-continue () (conditional-new-line " & ")) (defun fortran-comment-line () (conditional-new-line "c ")) (defun fortran-label () (save-excursion (go-to-beginning-of-line) (delete-white-sides)) (delete-white-sides) (if (> (cur-hpos) 5) (display-error "Statement number too long") else (whitespace-to-hpos 6) )) (defun fortran-indent-statement () (if (< (cur-hpos) 6) (whitespace-to-hpos 6) else (insert-char TAB))) ;;; ;;; Fortran abbrevs - January 29, 1979 ;;; (defun set-fortran-abbrev n (if (< n 2) (display-error "Too few arguments") else (let ((lab nil) (el nil)) (do i 3 (1+ i) (> i n) ((lambda (x) (cond ((eq x 'label) (setq lab t)) ((eq x 'eol) (setq el t)) (t (display-error (catenate "Invalid option: " x))))) (arg i))) (putprop (arg 1) (list (arg 2) lab el) 'fortran-abbrev)))) (defun fortran-abbrev-expander () (prog (the-abbr) (with-mark m (backward-char) (backward-char) (setq the-abbr (internedp (point-mark-to-string m))) (setq the-abbr (if (symbolp the-abbr) (get the-abbr 'fortran-abbrev) else nil)) (if the-abbr (if (cadr the-abbr) (fortran-label)) (without-saving (wipe-point-mark m)) (insert-string (car the-abbr)) (redisplay) (if (caddr the-abbr) (if (or (lastlinep) (save-excursion (next-line) (line-is-blank))) (new-line))) else (go-to-mark m) (release-mark m) (display-error "Undefined abbreviation")) ))) ;;; Language dependant part of error scanner. (defun fortran-error-list-builder () (if (= buffer-uid -1) (let ((er-list nil) (line-num)) (do-forever (go-to-beginning-of-line) (if (or (looking-at "WARNING") (looking-at "ERROR")) (go-to-end-of-line) (with-mark m (skip-back-to-whitespace) (setq line-num (point-mark-to-string m))) (do-times 5 (backward-char)) (setq line-num (if (looking-at "line") (let ((z (cv_dec_check_ line-num))) (if (= 0 (car z)) (cadr z))))) ;; line-num is now fixnum of source error line number or nil if message ;; had no line number (go-to-beginning-of-line) (setq er-list (cons (cons (set-mark) line-num) er-list))) (insert-string " ") (if (firstlinep) (stop-doing) else (prev-line))) ;; er-list is now list of ( . ) ;; return it as the defun value. er-list) else ;; Buffer does not contain a compilation, return error 'not-compile)) ;; ;; Change History ;; ;; Original begun 1/17/79 ;; 1/29/79 Added fortran-compile and supporting extended commands. ;; 1/30/79 Added fortran-abbrev-expanded and supporting commands. ;; 1/31/79 Modified fortran-abbrev-expanded package to make the ;; label and new-line hacks available to user abbrevs. ;; 2/1/79 Modified fortran-compile into compile buffer. Changed ;; supporting commands to accepts args on command line rather ;; than in minibuffer. Changed handling of local variables ;; to be unconditionally set in each buffer. ;; 2/3/79 Added without-saving to all deletes, so that normal use ;; does not crud up the kill-ring. ;; 2/3/79 Changed abbrev-expanded to simplify use of properties. ;; Added abbrev im for implicit. ;; 2/3/79 Changed fortran-abbrev-expander to not do automatic ;; new-lines if the next line is not empty. Changed ;; fortran-label so that it doesn't lose if done more than ;; once to a line. ;; 2/11/79 Added first edition of fortran-next-error. Scans backwards. ;; 3/2/79 Changed compile-buffer and error scanner to be language ;; independant and move them to a common segment. Also changed ;; the error scanner to keep a mark list and to work forwards. INCLUDE FILE >spec>install>1136>executable>e-macros.incl.lisp ;;; BEGIN INCLUDE FILE e-macros.incl.lisp ;;; Declares for use by Emacs programs and extenstions. Also loads ;;; in e_macros_, which contains macro definitions. ;;; HISTORY COMMENTS: ;;; 1) change(85-01-01,Margolin), approve(86-02-24,MCR7186), ;;; audit(86-08-12,Harvey), install(86-08-20,MR12.0-1136): ;;; Written: New Year's Day 1985, by excerpting the old e-macros.incl.lisp ;;; and leaving out all the definitions and qwerty junk (don't ask). ;;; 2) change(86-02-24,Margolin), approve(86-02-24,MCR7325), ;;; audit(86-08-12,Harvey), install(86-08-20,MR12.0-1136): ;;; Alphabetized declarations, and added more declarations for documented ;;; functions, and also for some undocumented functions. ;;; END HISTORY COMMENTS (%include backquote) (declare ;basic editor stuff (*expr apply-catenate assert-minor-mode backward-char backward-n-chars charlisten charset-member command-abort command-quit copy-region cur-hpos curline-as-string curbuf-as-string curchar curline-as-string delete-char delete-word destroy-buffer-contents dont-notice-modified-buffer e_cline_ e_lap_$reverse-search-string e_lap_$trim empty-buffer-p error_table_ establish-local-var exchange-point-and-mark firstlinep forward-char forward-n-chars forward-regexp-search-in-line forward-search forward-search-in-line get-char get-search-string go-to-beginning-of-buffer go-to-beginning-of-line go-to-buffer go-to-end-of-buffer go-to-end-of-line go-to-hpos go-to-mark go-to-or-create-buffer insert-char insert-string kill-backwards-to-mark kill-forward-to-mark kill-pop kill-to-end-of-line killsave-string lastlinep loadfile looking-at lowercase map-over-emacs-commands mark-on-current-line-p mark-reached merge-kills-forward merge-kills-reverse move-mark minibuf-response minibuffer-clear negate-minor-mode new-line next-line nullstringp pathname_ pathname_$component point-mark-to-string point>markp prev-line printable process-char produce-named-mark-list read-in-file release-mark reverse-search register-local-var reverse-search-in-line search-back-first-charset-line search-back-first-not-charset-line search-failure-annunciator search-for-first-charset-line search-for-first-not-charset-line set-emacs-epilogue-handler set-buffer-self-destruct set-key set-mark-here set-mark set-perm-key set-the-mark set-the-mark-here skip-to-whitespace skip-to-whitespace-in-line wipe-point-mark wipe-region write-out-file trim-minibuf-response yesp yank) (*fexpr define-autoload-lib)) (declare ;redisplay stuff (*expr end-local-displays init-local-displays ring-tty-bell local-display-generator local-display-generator-nnl next-screen prev-screen local-display-current-line find-buffer-in-window select-buffer-window window-info select-buffer-find-window select-other-window select-window buffer-on-display-in-window redisplay full-redisplay)) (declare ;extended stuff (*expr forward-word backward-word skip-over-whitespace skip-back-whitespace skip-over-whitespace-in-line skip-back-whitespace-in-line skip-back-to-whitespace skip-to-whitespace rubout-char date display-buffer-as-printout delete-white-sides lefthand-char format-to-col whitespace-to-hpos line-is-blank decimal-rep register-option minibuffer-clear)) (declare (*lexpr display-error display-com-error display-error-noabort display-error-remark comout-get-output display-com-error-noabort minibuffer-print minibuffer-response trim-minibuffer-response intern-minibuffer-response minibuffer-remark minibuffer-print-noclear report-error report-error-noabort)) (declare (special TAB NL SPACE ESC curpointpos current-buffer dont-stash numarg der-wahrer-mark fpathname fill-column completion-list curlinel BACKSPACE read-only-flag buffer-modified-flag previous-buffer current-buffer-mode env-dir process-dir minibuffer-end-string NLCHARSTRING undo null-pointer)) ;;; Load in macro packages (eval-when (eval compile) (or (status feature e-defcom) (progn (load (catenate (car (namelist (truename infile))) ">e_define_command_")) (sstatus feature e-defcom))) (or (status feature e-macros) (load (catenate (car (namelist (truename infile))) ">e_macros_")))) ;;; END INCLUDE FILE e-macros.incl.lisp INCLUDE FILE >ldd>include>backquote.incl.lisp ;;; ;;; backquote.incl.lisp - BSG 10/9/79 ;;; Loads lisp_backquote_ into either the compiler or interpreter ;;; environment. ;;; ;;; Modified 10/30/82 by Richard Lamson to use eval-when and ;;; (status feature backquote) ;;; (eval-when (eval compile) (or (status feature backquote) (load (catenate (car (namelist (truename infile))) ">lisp_backquote_")))) Functions Defined Name Offset Offset Name fortran-abbrev-expander 462 0 fortran-mode fortran-begin-comment-block 164 144 fortran-set-begin-comment fortran-comment-line 232 154 fortran-set-end-comment fortran-continue 225 164 fortran-begin-comment-block fortran-error-list-builder 641 225 fortran-continue fortran-indent-statement 314 232 fortran-comment-line fortran-label 237 237 fortran-label fortran-mode 0 314 fortran-indent-statement fortran-set-begin-comment 144 334 set-fortran-abbrev fortran-set-end-comment 154 462 fortran-abbrev-expander set-fortran-abbrev 334 641 fortran-error-list-builder Functions Referenced arg get next-line assert-minor-mode go-to-beginning-of-line point-mark-to-string backward-char go-to-end-of-line prev-line catenate go-to-mark putprop conditional-new-line insert-char redisplay cur-hpos insert-string register-local-var cv_dec_check_ internedp release-mark delete-white-sides kill-contents-of-line set-key display-error lastlinep set-mark exit-error-scan-mode line-is-blank skip-back-to-whitespace firstlinep looking-at trim-minibuf-response fortran-label negate-minor-mode whitespace-to-hpos funcall new-line wipe-point-mark ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved