home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sa104os2.zip / SATHR104.ZIP / SATHER / CONTRIB / SATHER.EL < prev   
Lisp/Scheme  |  1994-10-25  |  20KB  |  552 lines

  1. ;; .sather-mode.el -- Emacs mode for editing Sather 1.0 programs.
  2. ;;
  3. ;; Author: Stephen M. Omohundro <om@icsi.berkeley.edu>
  4. ;; Copyright (C) International Computer Science Institute, 1990
  5. ;; $Id: sather1.el,v 1.1 1994/08/08 18:39:11 gomes Exp $
  6. ;; COPYRIGHT NOTICE: This code is provided WITHOUT ANY WARRANTY
  7. ;; and is subject to the terms of the SATHER LIBRARY GENERAL PUBLIC
  8. ;; LICENSE contained in the file: sather/doc/license.txt of the
  9. ;; Sather distribution. The license is also available from ICSI,
  10. ;; 1947 Center St., Suite 600, Berkeley CA 94704, USA.
  11. ;;-----------------------------------------------------------------
  12. ;; Changes:
  13. ;; Aug 8 (gomes) Fixed syntax errors and updated error-message syntax
  14. ;;
  15. ;; (gomes) ;;;;;;;;;;;;;  IMPORTANT PROBABLE ERROR ;;;;;;;;;;;;;;;;;;;;;
  16. ;; Added support for compilation mode.  Had problems with the
  17. ;; standard compile.el (could not get it to handle the regexp for sather
  18. ;; error messages correctly - found a different one which worked much better.
  19. ;; Path is hard coded and WILL PROBABLY NEED TO BE RESET.
  20. ;; This should be the standard compile.el file, but it looks like there
  21. ;; is some problem at ICSI causing an older (epoch?) compile.el file to
  22. ;; be loaded.
  23. ;; If you have problems with the compilation mode - just delete the code
  24. ;; marked Compilation support (towards the end of this file)
  25. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  26. ;;
  27. ;; Jun16 18:49 1994(gomes):Adding C-c C-w sather-which-class from hws
  28. ;; Jun 7 10:54 1994(gomes): Added old sather mode code to
  29. ;;    document  modifications. Doesn't work so well in lisp!
  30. ;; (gomes) Changed back copyright and end indentation (around line 228)
  31. ;; (gomes) Eliminated long copyright - should probably be put back....
  32. ;; (gomes) Added command to create type (in addition to create class) 
  33. ;; (gomes) Jun 7: Changed the way end indents so that it lines up with the
  34. ;; rest of the block 
  35. ;; 
  36. ;; Major mode for editing Sather programs. (based on earlier Eiffel mode 
  37. ;; including modifications made by Bob Weiner of Motorola.)
  38. ;;
  39. ;; The following two statements, placed in a .emacs file or site-init.el,
  40. ;; will cause this file to be autoloaded, and sather-mode invoked, when
  41. ;; visiting .sa files:
  42. ;;
  43. ;;    (autoload 'sather-mode "sather.el" "Sather mode" t nil)
  44. ;;      (setq auto-mode-alist
  45. ;;            (append
  46. ;;              (list (cons "\\.sa$" 'sather-mode))
  47. ;;              auto-mode-alist))
  48.   
  49. (defvar sather-mode-map nil 
  50.   "Keymap for Sather mode.")
  51.  
  52.  
  53. (if sather-mode-map ()
  54.   (let ((map (make-sparse-keymap)))
  55.     (define-key map "\C-cw" 'sather-which-class)
  56.     (define-key map "\C-cc" 'sather-class)
  57.     (define-key map "\C-ct" 'sather-type)
  58.     (define-key map "\C-cm" 'doc-modification)
  59.     (define-key map "\t" 'sather-indent-line)
  60.     (define-key map [C-tab] 'sather-indent-line)
  61.     (define-key map "\r" 'sather-return)
  62.     (define-key map "\177" 'backward-delete-char-untabify)
  63.     (define-key map "\M-;" 'sather-comment)
  64.     (setq sather-mode-map map))
  65. )
  66.  
  67. (defvar sather-mode-syntax-table nil
  68.   "Syntax table in use in Sather-mode buffers.")
  69.  
  70. (if sather-mode-syntax-table
  71.     ()
  72.   (let ((table (make-syntax-table)))
  73.     (modify-syntax-entry ?\\ "\\" table)
  74.     (modify-syntax-entry ?/ ". 14" table)
  75.     (modify-syntax-entry ?* ". 23" table)
  76.     (modify-syntax-entry ?+ "." table)
  77.     (modify-syntax-entry ?- "." table)
  78.     (modify-syntax-entry ?= "." table)
  79.     (modify-syntax-entry ?% "." table)
  80.     (modify-syntax-entry ?< "." table)
  81.     (modify-syntax-entry ?> "." table)
  82.     (modify-syntax-entry ?& "." table)
  83.     (modify-syntax-entry ?| "." table)
  84.     (modify-syntax-entry ?\' "\"" table)
  85.     (setq sather-mode-syntax-table table)))
  86.  
  87. (defconst sather-indent 3
  88.   "*This variable gives the indentation in Sather-mode")
  89.  
  90. (defconst sather-comment-col 32
  91.   "*This variable gives the desired comment column for comments to the 
  92. right of text.")
  93.  
  94. (defvar sather-site "@icsi.berkeley.edu"
  95.   "*Mailing address of site where mode is being used. Should include
  96. initial \@ sign. Use nil for none.")
  97.  
  98. (defvar sather-short-copyright 
  99. "-- Copyright (C) 1994, International Computer Science Institute\n"
  100. "*Short copyright notice to be inserted in the header. Should be commented
  101. and include trailing newline. Use nil for none.")
  102.  
  103. (defvar sather-long-copyright 
  104. "-- COPYRIGHT NOTICE: This code is provided WITHOUT ANY WARRANTY
  105. -- and is subject to the terms of the SATHER LIBRARY GENERAL PUBLIC
  106. -- LICENSE contained in the file: sather/doc/license.txt of the
  107. -- Sather distribution. The license is also available from ICSI,
  108. -- 1947 Center St., Suite 600, Berkeley CA 94704, USA. \n"
  109. "*Long copyright notice to be inserted in the header. Should be commented
  110. and have trailing newlines. Use nil for none.")
  111.  
  112. (defun sather-mode ()
  113.   "A major editing mode for the language Sather.
  114. Comments are begun with --.
  115. Paragraphs are separated by blank lines
  116. Delete converts tabs to spaces as it moves back.
  117. Tab anywhere on a line indents it according to Sather conventions.
  118. M-; inserts and indents a comment on the line, or indents an existing
  119. comment if there is one.
  120. Return indents to the expected indentation for the new line. A class 
  121. skeleton is inserted (along with a file header if neccessary) with:
  122.  
  123.  C-c c class
  124.  
  125.  
  126. Variables controlling style:
  127.    sather-indent          Indentation of Sather statements.
  128.    sather-comment-col     Goal column for inline comments.
  129.    sather-site            Mailing address of site for header.
  130.    sather-short-copyright Short copyright message for header.
  131.    sather-long-copyright  Long copyright message for header.
  132.  
  133. Turning on Sather mode calls the value of the variable sather-mode-hook 
  134. with no args, if that value is non-nil."
  135.   (interactive)
  136.   (kill-all-local-variables)
  137.   (use-local-map sather-mode-map)
  138.   (setq major-mode 'sather-mode)
  139.   (setq mode-name "Sather")
  140.   (set-syntax-table sather-mode-syntax-table)
  141.   (make-local-variable 'indent-line-function)
  142.   (setq indent-line-function 'sather-indent-line)
  143.   (make-local-variable 'comment-start-skip)
  144.   (setq comment-start-skip "--+[ \t]*")
  145.   (make-local-variable 'comment-start)
  146.   (setq comment-start "--")
  147.   (make-local-variable 'paragraph-start)
  148.   (setq paragraph-start (concat "^$\\|" page-delimiter))
  149.   (make-local-variable 'paragraph-separate)
  150.   (setq paragraph-separate paragraph-start)
  151.   (make-local-variable 'paragraph-ignore-fill-prefix)
  152.   (setq paragraph-ignore-fill-prefix t)
  153.   (make-local-variable 'require-final-newline)
  154.   (setq require-final-newline t)
  155.   (run-hooks 'sather-mode-hook))
  156.  
  157. (defun sather-header ()
  158.   "Insert the file header at point."
  159.    (let ((header (read-string "File header: " 
  160.                  (concat "-- " (buffer-name) ": "))))
  161.     (insert header "\n"
  162.         "-- Author: " (user-full-name) " <" (user-login-name) 
  163.            sather-site ">\n"
  164.         sather-short-copyright "-- $\Id$\n--\n" sather-long-copyright 
  165. "-------------------------------------------------------------------\n"
  166. "-- Changes:\n"
  167. "-------------------------------------------------------------------\n"
  168. )))     
  169.  
  170. ;;(insert "-- Author: " (user-full-name) " <" (user-login-name) "> "
  171. ;;        sather-short-copyright "-- $\Id$\n"  
  172. ;;"-------------------------------------------------------------------\n"
  173. ;;"--Changes: \n"
  174. ;;"-------------------------------------------------------------------\n"
  175. ;;))
  176.  
  177. (defun sather-class ()
  178.   "Insert a 'class' template."
  179.   (interactive)
  180.   (if (not (s-empty-line-p))
  181.       (progn (end-of-line)(newline)))
  182.   (beginning-of-line)
  183.   (if (s-prev-class-p) nil (sather-header))
  184.   (let ((cname (read-string "Class: ")))
  185.     (insert 
  186.      "class " (upcase cname) " is\n\n"
  187.      "end; -- class " (upcase cname) "\n\n"
  188.      "-------------------------------------------------------------------\n")
  189.     )
  190.   (re-search-backward "\nend")
  191.   (sather-indent-line))
  192.  
  193. (defun sather-type ()
  194.   "Insert a 'type' template."
  195.   (interactive)
  196.   (if (not (s-empty-line-p))
  197.       (progn (end-of-line)(newline)))
  198.   (beginning-of-line)
  199.   (if (s-prev-class-p) nil (sather-header))
  200.   (let ((cname (read-string "Type: ")))
  201.     (insert 
  202.      "type " (upcase cname) " is\n\n"
  203.      "end; -- type " (upcase cname) "\n\n"
  204.      "-------------------------------------------------------------------\n")
  205.     )
  206.   (re-search-backward "\nend")
  207.   (sather-indent-line))
  208.  
  209. (defun s-prev-class-p ()
  210.   "True if there is a class definition before this one."
  211.   (interactive)
  212.   (save-excursion
  213.     (re-search-backward 
  214.      "^[ \t]*\\(value class\\|abstract class\\|external class\\|class\\)\
  215. [ \t\n]" nil t)))
  216.  
  217. (defun sather-return ()
  218.   "Return and Sather indent the new line."
  219.   (interactive)
  220.   (newline)
  221.   (sather-indent-line))
  222.  
  223. (defun sather-indent-line ()
  224.   "Indent the current line as Sather code."
  225.   (interactive)
  226.   (save-excursion
  227.     (beginning-of-line)
  228.     (delete-horizontal-space)
  229.     (indent-to (s-calc-indent)))
  230.   (skip-chars-forward " \t"))
  231.  
  232. ;; A line is one of the following:
  233. ;;    blank 
  234. ;;    just a comment
  235. ;;    block-cont: starts with end, elsif, else, when, then, against
  236. ;;    block-head: ends with is, or starts with if, loop, case, typecase,
  237. ;;                assert, or protect.
  238. ;;    none of the above
  239.  
  240. (defun s-calc-indent ()
  241.   "Return the appropriate indentation for this line as an int."
  242.   (cond 
  243. ;;   (
  244. ;;    (s-starts-with-end-p)
  245. ;;     (+ sather-indent (s-get-block-indent));Now end is in same col as block
  246. ;;    ) 
  247.     
  248.    ((s-empty-line-p)            ;an empty line 
  249.     (+ sather-indent (s-get-block-indent))) ;go in one from block
  250.    ((s-comment-line-p)             ;a comment line
  251.     (s-comment-indent))
  252.    ((s-starts-with-class-p) 0)
  253.    ((s-starts-with-pre-p) (* 2 sather-indent))
  254.    ((s-ends-with-is-p) sather-indent)  
  255.    ((s-block-cont-p)              ;begins with block-cont keyword 
  256.     (s-get-block-indent))          ;indent same as block
  257.    (t                              ;block-head or something else
  258.     (+ sather-indent (s-get-block-indent))))) ;go one in from block
  259.  
  260. (defun s-starts-with-class-p ()
  261.   "True if line starts with value class, type, external class or\
  262. class."
  263.   (save-excursion
  264.     (beginning-of-line)
  265.     (looking-at "^[ \t]*\\(value class\\|type\\|external class\
  266. \\|class\\)[ \t\n]")))
  267.  
  268. (defun s-starts-with-end-p ()
  269.   "True if line starts with keyword end"
  270.   (save-excursion
  271.     (beginning-of-line)
  272.     (looking-at "^[ \t]*end")))
  273.  
  274. (defun s-special-match-class-begin-p ()
  275.   "True if part of extended class beginning."
  276.   (interactive)
  277.   (save-excursion
  278.     (let ((pt0  (point))
  279.       (pt1 
  280.        (re-search-backward "^[ \t]*\\(value class\\|type\\|external class\
  281. \\|class\\)[ \t\n]"))
  282.        (pt2  (re-search-forward "\\( is\\)")))
  283.       (if (= pt0 (- pt2 2)) 1 nil))))
  284.  
  285. (defun s-starts-with-pre-p ()
  286.   "True if line starts with either pre or post."
  287.   (save-excursion
  288.     (beginning-of-line)
  289.     (looking-at "^[ \t]*\\(pre\\|post\\)[ \t\n]")))
  290.  
  291. (defun sather-comment ()
  292.   "Edit a comment on the line. If one exists, reindents it and moves to 
  293. it, otherwise creates one. Gets rid of trailing blanks, puts one space 
  294. between comment header comment text, leaves point at front of comment. 
  295. If comment is alone on a line it reindents relative to surrounding text. 
  296. If it is before any code, it is put at the line beginning.  Uses the 
  297. variable sather-comment-col to set goal start on lines after text."
  298.   (interactive)
  299.   (cond ((s-comment-line-p)             ;just a comment on the line
  300.          (beginning-of-line)
  301.          (delete-horizontal-space)
  302.          (indent-to (s-comment-indent))
  303.          (forward-char 2)(delete-horizontal-space)(insert " "))
  304.         ((s-comment-on-line-p)          ;comment already at end of line
  305.          (cond ((s-ends-with-end-p)     ;end comments come immediately
  306.                 (s-goto-comment-beg)(delete-horizontal-space)(insert " ")
  307.                 (forward-char 2)(delete-horizontal-space)(insert " "))
  308.                (t
  309.                 (s-goto-comment-beg)(delete-horizontal-space)
  310.                 (if (< (current-column) sather-comment-col)
  311.                     (indent-to sather-comment-col)
  312.                   (insert " "))
  313.                 (forward-char 2)
  314.         (delete-horizontal-space)
  315.         (insert " "))))
  316.         ((s-empty-line-p)               ;put just a comment on line
  317.          (beginning-of-line)
  318.          (delete-horizontal-space)
  319.          (indent-to (s-comment-indent))
  320.          (insert "-- "))
  321.         ((s-ends-with-end-p)            ;end comments come immediately
  322.          (end-of-line)(delete-horizontal-space)(insert " -- "))
  323.         (t                              ;put comment at end of line
  324.          (end-of-line)
  325.          (delete-horizontal-space)
  326.          (if (< (current-column) sather-comment-col)
  327.              (indent-to sather-comment-col)
  328.            (insert " "))
  329.          (insert "-- "))))
  330.  
  331. (defun s-ends-with-end-p ()
  332.   "t if line ends with 'end' or 'end;' and a comment."
  333.   (save-excursion
  334.     (beginning-of-line)
  335.     (looking-at "^\\(.*[ \t]+\\)?end;?[ \t]*\\($\\|--\\)")))
  336.  
  337. (defun s-empty-line-p ()
  338.   "True if current line is empty."
  339.   (save-excursion
  340.     (beginning-of-line)
  341.     (looking-at "^[ \t]*$")))
  342.  
  343. (defun s-comment-line-p ()
  344.   "t if current line is just a comment."
  345.   (save-excursion
  346.     (beginning-of-line)
  347.     (skip-chars-forward " \t")
  348.     (looking-at "--")))
  349.  
  350. (defun s-comment-on-line-p ()
  351.   "t if current line contains a comment."
  352.   (save-excursion
  353.     (beginning-of-line)
  354.     (looking-at "[^\n]*--")))
  355.  
  356. (defun s-in-comment-p ()
  357.   "t if point is in a comment."
  358.   (save-excursion
  359.     (and (/= (point) (point-max)) (forward-char 1))
  360.     (search-backward "--" (save-excursion (beginning-of-line) 
  361.                       (point)) t)))
  362.  
  363. (defun s-current-indentation ()
  364.   "Returns current line indentation."
  365.   (save-excursion
  366.     (beginning-of-line)
  367.     (skip-chars-forward " \t")
  368.     (current-indentation)))
  369.  
  370. (defun s-goto-comment-beg ()
  371.   "Point to beginning of comment on line.  Assumes line contains a 
  372. comment."
  373.   (beginning-of-line)
  374.   (search-forward "--" nil t)
  375.   (backward-char 2))
  376.  
  377. (defun s-block-cont-p ()
  378.      "t if line continues the indentation of enclosing block. Begins with 
  379. end, elsif, else, when, then, or against."
  380.   (save-excursion
  381.     (beginning-of-line)
  382.     (looking-at "^[ \t]*\\(end\\|elsif\\|else\\|when\\|then\\|against\\)\
  383. [ ;\t\n]")))
  384.  
  385. (defun s-ends-with-is-p ()
  386.   "t if current line ends with the keyword 'is' and an optional comment."
  387.   (save-excursion
  388.     (end-of-line)
  389.     (let ((end (point)))
  390.       (beginning-of-line)
  391.       (re-search-forward "\\(^\\|[ \t]\\)is[ \t]*\\($\\|--\\)" end t))))
  392.  
  393. (defun s-move-to-prev-non-comment ()
  394.   "Moves point to previous line excluding comment lines and blank lines. 
  395. Returns t if successful, nil if not."
  396.   (beginning-of-line)
  397.   (re-search-backward "^[ \t]*\\([^ \t---\n]\\|-[^---]\\)" nil t))
  398.  
  399. (defun s-move-to-prev-non-blank ()
  400.   "Moves point to previous line excluding blank lines. 
  401. Returns t if successful, nil if not."
  402.   (beginning-of-line)
  403.   (re-search-backward "^[ \t]*[^ \t\n]" nil t))
  404.  
  405. (defun s-comment-indent ()
  406.   "Return indentation for a comment line."
  407.     (save-excursion
  408.       (let ((in (s-get-block-indent))
  409.         (prev-is-blank
  410.           (save-excursion (and (= (forward-line -1) 0) 
  411.                    (s-empty-line-p)))))
  412.       (if (or (and prev-is-blank (= in 0)) 
  413.                     ;move to prev line if there is one
  414.           (not (s-move-to-prev-non-blank))) 
  415.       0                ;early comments start to the left
  416.     (cond ((s-ends-with-is-p)    ;line ends in 'is,' indent twice
  417.            (+ sather-indent (s-current-indentation)))
  418.           ((s-comment-line-p)         ;is a comment, same indentation
  419.            (s-current-indentation))
  420.           (t                          ;otherwise indent once
  421.         (+ sather-indent (s-current-indentation))))))))
  422.  
  423. (defun s-quoted-string-on-line-p ()
  424.   "t if a Sather quoted string begins, ends, or is continued on current 
  425. line."
  426.   (save-excursion
  427.     (beginning-of-line)
  428.     ;; Line must either start with optional whitespace immediately 
  429.     ;; followed by a '\\' or include a '\"'.  It must either end with a
  430.     ;; '\\' character or must include a second '\"' character.
  431.     (looking-at "^\\([ \t]*\\\\\\|[^\"\n]*\"\\)[^\"\n]*\\(\\\\$\\|\"\\)")))
  432.  
  433. (defun s-in-quoted-string-p ()
  434.   "t if point is in a quoted string."
  435.   (let ((pt (point)) front)
  436.     (save-excursion
  437.       ;; Line must either start with optional whitespace immediately 
  438.       ;; followed by a '\\' or include a '\"'.
  439.       (if (re-search-backward "\\(^[ \t]*\\\\\\|\"\\)"
  440.                   (save-excursion (beginning-of-line) 
  441.                           (point)) t)
  442.       (progn (setq front (point))
  443.          (forward-char 1)
  444.          ;; Line must either end with a '\\' character or must
  445.          ;; include a second '\"' character.
  446.          (and (re-search-forward
  447.             "\\(\\\\$\\|\"\\)"
  448.             (save-excursion (end-of-line) (point)) t)
  449.               (>= (point) pt)
  450.               (<= front pt)
  451.               t)))
  452.       )))
  453.  
  454. (defun s-get-block-indent ()
  455.   "Return the outer indentation of the current block. Returns 0 or less 
  456. if it can't find one. Looks for first unpaired is, if, loop, case, 
  457. typecase, or protect."
  458.   (save-excursion
  459.     (let ((depth 1))
  460.       (while (and (> depth 0)
  461.           ;; Search for start of keyword
  462.           (re-search-backward
  463.            "\\(^\\|[ \t]\\)\\(is[ \t]*\\($\\|--\\)\\|if \\|loop\
  464. \\|case \\|typecase \\|protect\\|end\\)" nil t))
  465.     (goto-char (match-beginning 2))
  466.     (cond ((or (s-in-comment-p)
  467.            ;;(s-in-quoted-string-p) leave out for now
  468.            )
  469.            nil)                       ;ignore it
  470.           ((looking-at "end")         ;end of block
  471.            (setq depth (1+ depth)))
  472.           ((looking-at "is")
  473.            (cond ((s-special-match-class-begin-p) (setq depth -2))
  474.              ((= depth 1)(setq depth -1))
  475.              (t (setq depth -2))))
  476.           (t                          ;head of block
  477.            (setq depth (1- depth)))))
  478.       (cond ((> depth 0)        ;check whether we hit top of file
  479.          0)
  480.         ((= depth -1)        ;Hit an "is" in a routine def
  481.          sather-indent)
  482.         ((= depth -2)        ;Hit class def or outside rout
  483.          0)
  484.         (t (current-indentation))))))
  485.  
  486. (defun doc-modification (EXPLICIT)
  487.   "Insert a brief modification log at the top of the buffer. Looks for
  488.   an occurrence of the value of user variable doc-modifications-keyword 
  489.   if non-nil."
  490.   (interactive "P")
  491.   (beginning-of-buffer) 
  492.   (cond ((re-search-forward "Changes:") nil t)) (end-of-line)
  493.   (insert "\n--*" (brief-current-time-string) "("(user-login-name) "):")
  494.   )
  495.  
  496. (defun brief-current-time-string ()
  497.   (let ((decoded-time (get-decoded-time)))
  498.     (format "%s%s %s:%s %s" 
  499.         (nth 4 decoded-time)    ;month
  500.         (nth 3 decoded-time)    ;date
  501.         (nth 2 decoded-time)    ;hour
  502.         (nth 1 decoded-time)    ;minute
  503.         (nth 5 decoded-time)    ;year
  504.         )))
  505.  
  506. (defun get-decoded-time ()
  507.   "Return the current time as a list of strings representing: 
  508.   second, minute, hour, date, month, year, day-of-week, and the 
  509.   full time-string."
  510.   ;;"Sat Jan 12 18:22:40 1991"
  511.   ;; 012345678901234567890123
  512.   ;;           1         2
  513.   (let ((time-string (current-time-string)))
  514.     (list (substring time-string 17 19)
  515.       (substring time-string 14 16)
  516.       (substring time-string 11 13)
  517.       
  518.       (substring time-string 8 10)
  519.       (substring time-string 4 7)
  520.       (substring time-string 20 24)
  521.       
  522.       (substring time-string 0 3)
  523.       time-string)))
  524.  
  525. (defun sather-which-class ()
  526.   (interactive)
  527.   (save-excursion
  528.     (re-search-backward "\\(class \\|type \\)")
  529.     (message (buffer-substring (point) (progn (end-of-line) (point))))
  530.     )
  531. )
  532. ;;;;;;;;;;;;;;;;;;;;;;;  Compilation Support ;;;;;;;;;;;;;;;;;;;;
  533. ;;  May cause problems - Has not been used with the latest 
  534. ;;  version of the compiler.  Will update it when I get around to
  535. ;;  using it again!
  536. ;;  Deleting this whole section should let the rest work fine
  537. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  538. (setq compile-file "/usr/local/share/lib/emacs/19.25/lisp/compile.el")
  539. (setq compile-sather "cs -com .commands")
  540.  
  541. (if (file-exists-p compile-file)
  542.     (progn
  543.       (load compile-file)
  544.       (setq sather-error-regexp '("Error in file: \\([^,]+\\), line: +\\([0-9]+\\), character no: \\([0-9]+\\)" 1 2 3))
  545.       (setq compilation-error-regexp-alist (cons sather-error-regexp compilation-error-regexp-alist))
  546.       (setq compile-command compile-sather)
  547. ))
  548. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  549.  
  550. (provide 'sather-mode)
  551.  
  552.