Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

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

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

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

revision 2724, Fri Jun 29 04:48:41 2007 UTC revision 2817, Wed Oct 31 04:07:04 2007 UTC
# Line 14  Line 14 
14    
15  ;; This program is free software; you can redistribute it and/or  ;; This program is free software; you can redistribute it and/or
16  ;; modify it under the terms of the GNU General Public License as  ;; modify it under the terms of the GNU General Public License as
17  ;; published by the Free Software Foundation; either version 2, or (at  ;; published by the Free Software Foundation; either version 3, or (at
18  ;; your option) any later version.  ;; your option) any later version.
19    
20  ;; This program is distributed in the hope that it will be useful, but  ;; This program is distributed in the hope that it will be useful, but
# Line 308  Line 308 
308        (progn (call-interactively 'run-sml)        (progn (call-interactively 'run-sml)
309               (get-buffer-process (current-buffer)))))               (get-buffer-process (current-buffer)))))
310    
311    (defun inferior-sml-next-error-hook ()
312      ;; Try to recognize SML/NJ type error message and to highlight finely the
313      ;; difference between the two types (in case they're large, it's not
314      ;; always obvious to spot it).
315      (save-current-buffer
316        (when (and (derived-mode-p 'sml-mode 'inferior-sml-mode)
317                   (boundp 'next-error-last-buffer)
318                   (bufferp next-error-last-buffer)
319                   (set-buffer next-error-last-buffer)
320                   (derived-mode-p 'inferior-sml-mode)
321                   ;; The position of `point' is not guaranteed :-(
322                   (looking-at ".*\n  operator domain: "))
323          (ignore-errors (require 'smerge-mode))
324          (if (not (fboundp 'smerge-refine-subst))
325              (remove-hook 'next-error-hook 'inferior-sml-next-error-hook)
326            (save-excursion
327              (let ((b1 (match-end 0))
328                    e1 b2 e2)
329                (when (re-search-forward "\n  in expression:\n" nil t)
330                  (setq e2 (match-beginning 0))
331                  (when (re-search-backward "\n  operand:         " b1 t)
332                    (setq e1 (match-beginning 0))
333                    (setq b2 (match-end 0))
334                    (smerge-refine-subst b1 e1 b2 e2
335                                         '((face . smerge-refined-change)))))))))))
336    
337  (define-derived-mode inferior-sml-mode comint-mode "Inferior-SML"  (define-derived-mode inferior-sml-mode comint-mode "Inferior-SML"
338    "Major mode for interacting with an inferior ML process.    "Major mode for interacting with an inferior ML process.
339    
# Line 355  Line 381 
381    (setq comint-prompt-regexp sml-prompt-regexp)    (setq comint-prompt-regexp sml-prompt-regexp)
382    (sml-mode-variables)    (sml-mode-variables)
383    
384      ;; We have to install it globally, 'cause it's run in the *source* buffer :-(
385      (add-hook 'next-error-hook 'inferior-sml-next-error-hook)
386    
387    ;; Make TAB add a " rather than a space at the end of a file name.    ;; Make TAB add a " rather than a space at the end of a file name.
388    (set (make-local-variable 'comint-completion-addsuffix) '(?/ . ?\"))    (set (make-local-variable 'comint-completion-addsuffix) '(?/ . ?\"))
389    

Legend:
Removed from v.2724  
changed lines
  Added in v.2817

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