Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Tracker SCM

SCM Repository

[smlnj] Diff of /sml/trunk/sml-mode/sml-proc.el
ViewVC logotype

Diff of /sml/trunk/sml-mode/sml-proc.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 32, Thu Mar 12 16:54:39 1998 UTC revision 300, Thu May 27 22:01:36 1999 UTC
# Line 119  Line 119 
119  (defvar sml-default-arg ""  (defvar sml-default-arg ""
120    "*Default command line option to pass, if any.")    "*Default command line option to pass, if any.")
121    
122  (defvar sml-display-frame-alist  (defvar sml-make-command "CM.make()"
123    '((height . 24) (width . 80) (menu-bar-lines . 0))    "The command used by default by `sml-make'.")
   "*Alist of frame parameters used in creating dedicated ML interaction frames.  
 These supersede the values given in `default-frame-alist'.  
 You might like a larger screen  
124    
125    \(setcdr \(assoc 'height sml-display-frame-alist\) 40\)  (defvar sml-make-file-name "sources.cm"
126      "The name of the makefile that `sml-make' will look for (if non-nil).")
 or you might like a small font  
   
   \(setq sml-display-frame-alist  
         \(cons '\(font . \"7x14\"\) sml-display-frame-alist\)\)  
   
 in your `inferior-sml-load-hook', say. The parameters  
   
   '\(\(unsplittable . t\) \(icon-name . \"*sml*\"\)\)  
   
 are always added to sml-display-frame-alist by default, though the value of  
 icon-name is actually culled from `sml-program-name'.  
   
 See also the documentation for `modify-frame-parameters'.")  
   
 (defvar sml-dedicated-frame (if window-system t nil)  
   "*If non-nil, interaction buffers display in their own frame.  
 Default is equivalent to variable `window-system'.  
 If you reset this variable after starting the compiler, you might have  
 to reset the window-dedicated property of the window displaying the  
 interaction buffer. See `set-window-dedicated-p'.")  
127    
128  ;;(defvar sml-raise-on-error nil  ;;(defvar sml-raise-on-error nil
129  ;;  "*When non-nil, `sml-next-error' will raise the ML process's frame.")  ;;  "*When non-nil, `sml-next-error' will raise the ML process's frame.")
# Line 163  Line 140 
140  doesn't work very well -- e.g., SML/NJ nor Poly/ML incorrectly report  doesn't work very well -- e.g., SML/NJ nor Poly/ML incorrectly report
141  the line # of errors occurring in std_in.")  the line # of errors occurring in std_in.")
142    
143  (defvar sml-temp-file (make-temp-name "/tmp/ml")  (defvar sml-temp-file
144      (make-temp-name
145       (concat (file-name-as-directory (or (getenv "TMPDIR") "/tmp")) "/ml"))
146    "*Temp file that emacs uses to communicate with the ML process.    "*Temp file that emacs uses to communicate with the ML process.
147  See `sml-temp-threshold'. Defaults to \(make-temp-name \"/tmp/ml\"\)")  See `sml-temp-threshold'. Defaults to \(make-temp-name \"/tmp/ml\"\)")
148    
# Line 225  Line 204 
204  Set to \"use \\\"%s\\\"\" for SML/NJ or Edinburgh ML;  Set to \"use \\\"%s\\\"\" for SML/NJ or Edinburgh ML;
205  set to \"PolyML.use \\\"%s\\\"\" for Poly/ML, etc.")  set to \"PolyML.use \\\"%s\\\"\" for Poly/ML, etc.")
206    
207  (defvar sml-cd-command "System.Directory.cd \"%s\""  (defvar sml-cd-command "OS.FileSys.chDir \"%s\""
208    "*Command template for changing working directories under ML.    "*Command template for changing working directories under ML.
209  Set this to nil if your compiler can't change directories.  Set this to nil if your compiler can't change directories.
210    
# Line 285  Line 264 
264  (defvar sml-error-regexp sml-smlnj-error-regexp  (defvar sml-error-regexp sml-smlnj-error-regexp
265    "*Regexp for matching \(the start of\) an error message.")    "*Regexp for matching \(the start of\) an error message.")
266    
267    ;; font-lock support
268    (defvar inferior-sml-font-lock-keywords
269      `((,(concat "\\(" sml-prompt-regexp "\\)\\(.*\\)")
270         (1 font-lock-prompt-face)
271         (2 font-lock-command-face keep))
272        (,sml-error-regexp . font-lock-warning-face)
273        ("^\\[\\(.*GC #.*\n\\)*.*\\]" . font-lock-comment-face)
274        ("^GC #.*" . font-lock-comment-face)))
275    
276    ;; default faces values
277    (defvar font-lock-prompt-face
278      (if (facep 'font-lock-prompt-face)
279          'font-lock-prompt-face
280        'font-lock-keyword-face))
281    (defvar font-lock-command-face
282      (if (facep 'font-lock-command-face)
283          'font-lock-command-face
284        'font-lock-function-name-face))
285    
286    (defvar inferior-sml-font-lock-defaults
287      '(inferior-sml-font-lock-keywords nil nil nil nil))
288    
289  (defun sml-smlnj-error-parser (pt)  (defun sml-smlnj-error-parser (pt)
290   "This parses the SML/NJ error message at PT into a 5 element list   "This parses the SML/NJ error message at PT into a 5 element list
291    
# Line 341  Line 342 
342   sml-program-name  <option> \(default \"sml\"\)   sml-program-name  <option> \(default \"sml\"\)
343   sml-default-arg   <option> \(default \"\"\)   sml-default-arg   <option> \(default \"\"\)
344   sml-use-command   \"use \\\"%s\\\"\"   sml-use-command   \"use \\\"%s\\\"\"
345   sml-cd-command    \"System.Directory.cd \\\"%s\\\"\"   sml-cd-command    \"OS.FileSys.chDir \\\"%s\\\"\"
346   sml-prompt-regexp \"^[\\-=] *\"   sml-prompt-regexp \"^[\\-=] *\"
347   sml-error-regexp  sml-sml-nj-error-regexp   sml-error-regexp  sml-sml-nj-error-regexp
348   sml-error-parser  'sml-sml-nj-error-parser"   sml-error-parser  'sml-sml-nj-error-parser"
# Line 355  Line 356 
356       (setq sml-default-arg  arg)       (setq sml-default-arg  arg)
357       ;; buffer-local (compiler-local) variables       ;; buffer-local (compiler-local) variables
358       (setq-default sml-use-command   "use \"%s\""       (setq-default sml-use-command   "use \"%s\""
359                     sml-cd-command    "System.Directory.cd \"%s\""                     sml-cd-command    "OS.FileSys.chDir \"%s\""
360                     sml-prompt-regexp "^[\-=] *"                     sml-prompt-regexp "^[\-=] *"
361                     sml-error-regexp  sml-smlnj-error-regexp                     sml-error-regexp  sml-smlnj-error-regexp
362                     sml-error-parser  'sml-smlnj-error-parser)                     sml-error-parser  'sml-smlnj-error-parser)
# Line 371  Line 372 
372  (defvar sml-error-file nil)             ; file from which the last error came  (defvar sml-error-file nil)             ; file from which the last error came
373  (defvar sml-real-file nil)              ; used for finding source errors  (defvar sml-real-file nil)              ; used for finding source errors
374  (defvar sml-error-cursor nil)           ;   ditto  (defvar sml-error-cursor nil)           ;   ditto
 (defvar sml-error-barrier nil)          ;   ditto  
375    
376  (defun sml-proc-buffer ()  (defun sml-proc-buffer ()
377    "Returns the current ML process buffer,    "Returns the current ML process buffer,
# Line 487  Line 487 
487    (sml-mode-variables)    (sml-mode-variables)
488    
489    ;; For sequencing through error messages:    ;; For sequencing through error messages:
490    (make-local-variable 'sml-error-cursor)  
491    (setq sml-error-cursor (marker-position (point-max-marker)))    (set (make-local-variable 'sml-error-cursor) (point-max-marker))
492    (make-local-variable 'sml-error-barrier)    (set (make-local-variable 'sml-real-file) nil)
493    (setq sml-error-barrier (marker-position (point-max-marker)))    (set (make-local-variable 'font-lock-defaults)
494    (make-local-variable 'sml-real-file)         inferior-sml-font-lock-defaults)
   (setq sml-real-file (cons nil 0))  
495    
496    (make-local-variable 'sml-use-command)    (make-local-variable 'sml-use-command)
497    (make-local-variable 'sml-cd-command)    (make-local-variable 'sml-cd-command)
# Line 511  Line 510 
510  ;;; FOR RUNNING ML FROM EMACS  ;;; FOR RUNNING ML FROM EMACS
511    
512  ;;;###autoload  ;;;###autoload
513  (defun sml (&optional pfx)  (defun run-sml (&optional pfx)
514    "Run an inferior ML process, input and output via buffer *sml*.    "Run an inferior ML process, input and output via buffer *sml*.
515  With a prefix argument, this command allows you to specify any command  With a prefix argument, this command allows you to specify any command
516  line options to pass to the complier. The command runs hook functions  line options to pass to the complier. The command runs hook functions
# Line 542  Line 541 
541           (bname (format "*%s*" pname))           (bname (format "*%s*" pname))
542           (args (if (equal arg "") () (sml-args-to-list arg))))           (args (if (equal arg "") () (sml-args-to-list arg))))
543      (if (comint-check-proc bname)      (if (comint-check-proc bname)
544          (sml-pop-to-buffer t)           ;do nothing but switch buffer          (pop-to-buffer (sml-proc-buffer)) ;do nothing but switch buffer
545        (setq sml-buffer        (setq sml-buffer
546              (if (null args)              (if (null args)
547                  ;; there is a good reason for this; to ensure                  ;; there is a good reason for this; to ensure
# Line 583  Line 582 
582    "Switch to the ML process buffer.    "Switch to the ML process buffer.
583  With prefix argument, positions cursor at point, otherwise at end of buffer."  With prefix argument, positions cursor at point, otherwise at end of buffer."
584    (interactive "P")    (interactive "P")
585    (sml-pop-to-buffer t)    (if (sml-noproc) (save-excursion (run-sml t)))
586      (pop-to-buffer (sml-proc-buffer))
587    (cond ((not eob-p)    (cond ((not eob-p)
588           (push-mark (point) t)           (push-mark (point) t)
589           (goto-char (point-max)))))           (goto-char (point-max)))))
# Line 603  Line 603 
603    
604  See variables `sml-temp-threshold', `sml-temp-file' and `sml-use-command'."  See variables `sml-temp-threshold', `sml-temp-file' and `sml-use-command'."
605    (interactive "r\nP")    (interactive "r\nP")
606    (if (sml-noproc) (save-excursion (sml t)))    (if (sml-noproc) (save-excursion (run-sml t)))
607    (cond ((equal start end)    (cond ((equal start end)
608           (message "The region is zero (ignored)"))           (message "The region is zero (ignored)"))
609          ((and sml-use-command          ((and sml-use-command
# Line 622  Line 622 
622           (comint-send-string (sml-proc) ";\n")))           (comint-send-string (sml-proc) ";\n")))
623    (if and-go (switch-to-sml nil)))    (if and-go (switch-to-sml nil)))
624    
625  ;; Update the buffer-local variables sml-real-file and sml-error-barrier  ;; Update the buffer-local variables sml-real-file
626  ;; in the process buffer:  ;; in the process buffer:
627    
628  (defun sml-update-barrier (file pos)  (defun sml-update-barrier (&optional file pos)
629    (let ((buf (current-buffer)))    (let ((buf (current-buffer)))
630      (unwind-protect      (unwind-protect
631          (let* ((proc (sml-proc))          (let* ((proc (sml-proc))
632                 (pmark (marker-position (process-mark proc))))                 (pmark (marker-position (process-mark proc))))
633            (set-buffer (process-buffer proc))            (set-buffer (process-buffer proc))
634            ;; update buffer local variables            ;; update buffer local variables
635            (setq sml-real-file (and file (cons file pos)))            (setq sml-real-file (and file (cons file pos))))
           (setq sml-error-barrier pmark))  
636        (set-buffer buf))))        (set-buffer buf))))
637    
638  ;; Update the buffer-local error-cursor in proc-buffer to be its  ;; Update the buffer-local error-cursor in proc-buffer to be its
# Line 646  Line 645 
645                 (pmark (marker-position (process-mark proc))))                 (pmark (marker-position (process-mark proc))))
646            (set-buffer proc-buffer)            (set-buffer proc-buffer)
647            ;; update buffer local variable            ;; update buffer local variable
648            (setq sml-error-cursor pmark))            (set-marker sml-error-cursor pmark))
649        (set-buffer buf))))        (set-buffer buf))))
650    
651  ;; This is quite bogus, so it isn't bound to a key by default.  ;; This is quite bogus, so it isn't bound to a key by default.
# Line 691  Line 690 
690    
691  ;; simplified from frame.el in Emacs: special-display-popup-frame...  ;; simplified from frame.el in Emacs: special-display-popup-frame...
692    
 ;; Display BUFFER in its own frame, reusing an existing window if any.  
 ;; Return the window chosen.  
   
 (defun sml-display-popup-frame (buffer &optional args)  
   (let ((window (get-buffer-window buffer t)))  
     (if window  
         ;; If we have a window already, make it visible.  
         (let ((frame (window-frame window)))  
           (make-frame-visible frame)  
           (raise-frame frame)  
           window)  
       ;; otherwise no window yet, make one in a new frame.  
       (let* ((frame (make-frame (append args sml-display-frame-alist)))  
              (window (frame-selected-window frame)))  
         (set-window-buffer window buffer)  
         ;; XEmacs mostly ignores this  
         (set-window-dedicated-p window t)  
         window))))  
   
693  (defun sml-proc-frame ()  (defun sml-proc-frame ()
694    "Returns the current ML process buffer's frame, or creates one first."    "Returns the current ML process buffer's frame, or creates one first."
695    (let ((buffer (sml-proc-buffer)))    (let ((buffer (sml-proc-buffer)))
696      (window-frame      (window-frame (display-buffer buffer))))
697       (or  
698        ;; if its already displayed on some frame, take that as default...  ;;(defun sml-pop-to-buffer (warp)
699        (get-buffer-window buffer t)  ;;  "(Towards) handling multiple frames properly.
700        ;; ...irrespective of what sml-dedicated-frame says, otherwise  ;;Raises the frame, and warps the mouse over there, only if WARP is non-nil."
701        ;; create a new frame (or raise an old one) perhaps...  ;;  (let ((current (window-frame (selected-window)))
702        (and sml-dedicated-frame  ;;        (buffer  (sml-proc-buffer)))
703             (sml-display-popup-frame buffer  ;;    (let ((frame (sml-proc-frame)))
704                                      (list (cons 'icon-name buffer)  ;;      (if (eq current frame)
705                                            '(unsplittable . t))))  ;;          (pop-to-buffer buffer)           ; stay on the same frame.
706        ;; ...or default to the current frame anyway.  ;;        (select-frame frame)               ; XEmacs sometimes moves focus.
707        (frame-selected-window)))))  ;;        (select-window (get-buffer-window buffer)) ; necc. for XEmacs
708    ;;        ;; (raise-frame frame)
709  (defun sml-pop-to-buffer (warp)  ;;        (if warp (sml-warp-mouse frame))))))
   "(Towards) handling multiple frames properly.  
 Raises the frame, and warps the mouse over there, only if WARP is non-nil."  
   (let ((current (window-frame (selected-window)))  
         (buffer  (sml-proc-buffer)))  
     (let ((frame (sml-proc-frame)))  
       (if (eq current frame)  
           (pop-to-buffer buffer)           ; stay on the same frame.  
         (select-frame frame)               ; XEmacs sometimes moves focus.  
         (select-window (get-buffer-window buffer)) ; necc. for XEmacs  
         ;; (raise-frame frame)  
         (if warp (sml-warp-mouse frame))))))  
710    
711    
712  ;;; H A C K   A T T A C K !   X E M A C S   V E R S U S   E M A C S  ;;; H A C K   A T T A C K !   X E M A C S   V E R S U S   E M A C S
# Line 812  Line 781 
781  the command to send to the ML process\; a trailing \"\;\\n\" will be added  the command to send to the ML process\; a trailing \"\;\\n\" will be added
782  automatically."  automatically."
783    (interactive "P")    (interactive "P")
784    (if (sml-noproc) (save-excursion (sml t)))    (if (sml-noproc) (save-excursion (run-sml t)))
785    (if sml-use-command    (if sml-use-command
786        (let ((file        (let ((file
787               (car (comint-get-source "Load ML file: " sml-prev-l/c-dir/file               (car (comint-get-source "Load ML file: " sml-prev-l/c-dir/file
# Line 836  Line 805 
805    (interactive "DSML Directory: ")    (interactive "DSML Directory: ")
806    (let* ((buf (sml-proc-buffer))    (let* ((buf (sml-proc-buffer))
807           (proc (get-buffer-process buf))           (proc (get-buffer-process buf))
808           (dir (expand-file-name dir)))           (dir (expand-file-name dir))
809             (string (concat (format sml-cd-command dir) ";\n")))
810      (save-excursion      (save-excursion
811        (set-buffer buf)        (set-buffer buf)
812        (if sml-cd-command        (goto-char (point-max))
813            (process-send-string proc        (insert string)
814                                 (concat (format sml-cd-command dir) ";\n")))        (set-marker (process-mark proc) (point))
815          (if sml-cd-command (process-send-string proc string))
816        (cd dir))        (cd dir))
817      (setq sml-prev-l/c-dir/file (cons dir nil))))      (setq sml-prev-l/c-dir/file (cons dir nil))))
818    
819  ;;; PARSING ERROR MESSAGES  (defun sml-send-command (cmd &optional dir print)
820      "Send string to ML process, display this string in ML's buffer"
821      (if (sml-noproc) (save-excursion (run-sml t)))
822      (let* ((my-dir (or dir (expand-file-name default-directory)))
823             (cd-cmd (if my-dir (concat (format sml-cd-command my-dir) "; ") ""))
824             (buf (sml-proc-buffer))
825             (win (get-buffer-window buf 'visible))
826             (proc (get-buffer-process buf))
827             (string (concat cd-cmd cmd ";\n")))
828        (save-some-buffers t)
829        (save-excursion
830          (set-buffer buf)
831          (when win (select-window win))
832          (goto-char (point-max))
833          (when print (insert string))
834          (when my-dir (cd my-dir))
835          (sml-update-cursor buf)
836          (sml-update-barrier)
837          (set-marker (process-mark proc) (point-max))
838          (comint-send-string proc string))
839        (switch-to-sml t)))
840    
841    (defun sml-make (command)
842      "re-make a system using (by default) CM.
843       The exact command used can be specified by providing a prefix argument."
844      (interactive
845       ;; code taken straight from compile.el
846       (if (or current-prefix-arg (not sml-make-command))
847           (list (read-from-minibuffer "Compile command: "
848                                     sml-make-command nil nil
849                                     '(compile-history . 1)))
850         (list sml-make-command)))
851      (setq sml-make-command command)
852      ;; try to find a makefile up the sirectory tree
853      (let ((dir (and sml-make-file-name (expand-file-name default-directory))))
854        (while (and dir (not (file-exists-p (concat dir sml-make-file-name))))
855          (let ((newdir (file-name-directory (directory-file-name dir))))
856            (setq dir (if (equal newdir dir) nil newdir))))
857        (sml-send-command command dir t)))
858    
859  ;; to a very large extent "find-file-other-window" works admirably when the  ;;; PARSING ERROR MESSAGES
 ;; compiler is running in a dedicated, *unsplittable* window, and so all  
 ;; the goop in sml-file-other-frame-or-window is of questionable worth.  
 ;; unhappily, XEmacs doesn't (yet, will it ever?) implement the window  
 ;; unsplittable property, hence this nonsense...  
   
 (defun sml-file-other-frame-or-window (file &optional window)  
   "Find or make another frame on which to display FILE.  
 Start in ML interaction buffer, by hypothesis, and try not to use  
 this window to display the file (with bugs in it). FILE may already  
 be on display somewhere, so use that frame by default; otherwise,  
 try to find a window that is displaying an sml buffer; if there is  
 no such frame/window, find the nearest non-dedicated buffer or,  
 in the last resort, create a whole new frame.  
   
 If optional WINDOW is supplied, just use that window to display FILE."  
   (if window  
       (progn                            ; just reuse it  
         (set-window-buffer window (find-file-noselect file))  
         (select-window window))         ; assume "this" frame's selected)  
     (let* ((buf (find-file-noselect file))  
            (win (get-buffer-window buf t))  
            (frm (if win (window-frame win))))  
       (if frm  
           ;; buf is displayed in win on some frame: select frame & window  
           (progn (select-window win) (raise-frame (select-frame frm)))  
         (let* ((frame (selected-frame))   ;current frame & window  
                (window (selected-window)))  
           ;; look through all (but minibuffer) windows for an sml buffer  
           (while (and (not (eq window  
                                (select-window  
                                 (previous-window (selected-window) 'mini t))))  
                       (not (memq major-mode sml-source-modes))))  
           (if (not (eq window (selected-window)))  
               ;; found window displaying an sml buffer: use that window & frame  
               (raise-frame (select-frame (window-frame (selected-window))))  
             ;; otherwise, cycle through frames looking for a spare one  
             ;; select-frame also selects the top (or root) window  
             (while (and (not (eq frame (select-frame (previous-frame  
                                                       (selected-frame) nil))))  
                         (window-dedicated-p (selected-window))))  
             ;; if no suitable frame, create one and (belt & braces) select it  
             (if (eq frame (selected-frame))  
                 ;; sml-dedicated-frame iff window-dedicated-p (selected-window)  
                 (if sml-dedicated-frame  
                     (progn  
                       (sml-warp-mouse (select-frame (make-frame)))  
                       (set-window-buffer  
                        (frame-selected-window (selected-frame)) buf))  
                   (switch-to-buffer-other-window buf))  
               (raise-frame (selected-frame))))  
           (switch-to-buffer buf))))))  
860    
861  ;; This should need no modification to support other compilers.  ;; This should need no modification to support other compilers.
862    
# Line 946  Line 904 
904      (sml-error-overlay 'undo 1 1      (sml-error-overlay 'undo 1 1
905                         (and sml-error-file (get-file-buffer sml-error-file)))                         (and sml-error-file (get-file-buffer sml-error-file)))
906      ;; go to interaction buffer but don't raise it's frame      ;; go to interaction buffer but don't raise it's frame
907      (sml-pop-to-buffer nil)      (pop-to-buffer (sml-proc-buffer))
908      ;; go to the last remembered error, and search for the next one.      ;; go to the last remembered error, and search for the next one.
909      (goto-char sml-error-cursor)      (goto-char (marker-position sml-error-cursor))
910      (if (not (re-search-forward sml-error-regexp (point-max) t))      (if (not (re-search-forward sml-error-regexp (point-max) t))
911          ;; no more errors -- move point to the sml prompt at the end          ;; no more errors -- move point to the sml prompt at the end
912          (progn          (progn
# Line 956  Line 914 
914            (if sml-window (select-window sml-window)) ;return there, perhaps            (if sml-window (select-window sml-window)) ;return there, perhaps
915            (message "No error message(s) found."))            (message "No error message(s) found."))
916        ;; error found: point is at end of last match; set the cursor posn.        ;; error found: point is at end of last match; set the cursor posn.
917        (setq sml-error-cursor (point))        (set-marker sml-error-cursor (point))
918        ;; move the SML window's text up to this line        ;; move the SML window's text up to this line
919        (set-window-start (get-buffer-window proc-buffer) (match-beginning 0))        (set-window-start (get-buffer-window proc-buffer) (match-beginning 0))
920        (let* ((pos)        (let* ((pos)
# Line 975  Line 933 
933              (sml-bottle "Sorry, can't locate errors on std_in.")              (sml-bottle "Sorry, can't locate errors on std_in.")
934            (if (string= file sml-temp-file)            (if (string= file sml-temp-file)
935                ;; errors found in tmp file; seek the real file                ;; errors found in tmp file; seek the real file
               (if (< (point) sml-error-barrier)  
                   ;; weird. user cleared *sml* and use'd the tmp file?  
                   (sml-bottle "Temp file error report is not current.")  
936                  (if (not (car sml-real-file))                  (if (not (car sml-real-file))
937                      ;; sent from a buffer w/o a file attached.                      ;; sent from a buffer w/o a file attached.
938                      ;; DEAL WITH THIS EVENTUALLY.                      ;; DEAL WITH THIS EVENTUALLY.
939                      (sml-bottle "No real file associated with the temp file.")                      (sml-bottle "No real file associated with the temp file.")
940                    ;; real file and error-barrier                    ;; real file and error-barrier
941                    (setq file (car sml-real-file))                    (setq file (car sml-real-file))
942                    (setq pos (cdr sml-real-file))))))                  (setq pos (cdr sml-real-file)))))
943          (if (not (file-readable-p file))          (if (not (file-readable-p file))
944              (sml-bottle (concat "Can't read " file))              (sml-bottle (concat "Can't read " file))
945            ;; instead of (find-file-other-window file) to lookup the file            ;; instead of (find-file-other-window file) to lookup the file
946            (sml-file-other-frame-or-window file sml-window)            (find-file-other-window file)
947            ;; no good if the buffer's narrowed, still...            ;; no good if the buffer's narrowed, still...
948            (goto-char (or pos 1))        ; line 1 if no tmp file            (goto-char (or pos 1))        ; line 1 if no tmp file
949            (forward-line (1- line0))            (forward-line (1- line0))
# Line 1017  Line 972 
972  ;;; Set up the inferior mode keymap, using sml-mode bindings...  ;;; Set up the inferior mode keymap, using sml-mode bindings...
973    
974  (cond ((not inferior-sml-mode-map)  (cond ((not inferior-sml-mode-map)
975         (setq inferior-sml-mode-map         (setq inferior-sml-mode-map (nconc (make-sparse-keymap) comint-mode-map))
              (copy-keymap comint-mode-map))  
976         (install-sml-keybindings inferior-sml-mode-map)         (install-sml-keybindings inferior-sml-mode-map)
977         (define-key inferior-sml-mode-map "\C-c\C-s" 'sml)         (define-key inferior-sml-mode-map "\C-c\C-s" 'run-sml)
978         (define-key inferior-sml-mode-map "\t"       'comint-dynamic-complete)))         (define-key inferior-sml-mode-map "\t"       'comint-dynamic-complete)))
979    
980  ;;; H A C K   A T T A C K !   X E M A C S   /   E M A C S   K E Y S  ;;; H A C K   A T T A C K !   X E M A C S   /   E M A C S   K E Y S

Legend:
Removed from v.32  
changed lines
  Added in v.300

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0