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/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 534, Thu Feb 17 22:14:04 2000 UTC revision 535, Fri Feb 18 16:49:10 2000 UTC
# Line 1  Line 1 
1  ;;; sml-proc.el. Comint based interaction mode for Standard ML.  ;;; sml-proc.el --- Comint based interaction mode for Standard ML.
   
 (defconst rcsid-sml-proc "@(#)$Name$:$Id$")  
2    
3  ;; Copyright (C) 1989, Lars Bo Nielsen, 1994,1997 Matthew J. Morley  ;; Copyright (C) 1989, Lars Bo Nielsen, 1994,1997 Matthew J. Morley
4    
# Line 33  Line 31 
31  ;; under 18.59 (or anywhere without comint, if there are such places).  ;; under 18.59 (or anywhere without comint, if there are such places).
32  ;; See sml-mode.el for further information.  ;; See sml-mode.el for further information.
33    
34  ;;; DESCRIPTION  ;;; Commentary:
35    
36  ;; Inferior-sml-mode is for interacting with an ML process run under  ;; Inferior-sml-mode is for interacting with an ML process run under
37  ;; emacs. This uses the comint package so you get history, expansion,  ;; emacs. This uses the comint package so you get history, expansion,
# Line 80  Line 78 
78  ;; does not understand `use', but has the benefit of allowing better error  ;; does not understand `use', but has the benefit of allowing better error
79  ;; reporting.  ;; reporting.
80    
81  ;; ===================================================================  ;; Bugs:
82    
83    ;; Todo:
84    
85  ;;; INFERIOR ML MODE VARIABLES  ;; - Keep improving `sml-compile'.
86    ;; - ignore warnings (if requested) for next-error
87    
88    ;;; Code:
89    
90  (require 'sml-mode)  (require 'sml-mode)
91  (require 'sml-util)  (require 'sml-util)
# Line 103  Line 106 
106    :group 'sml-proc    :group 'sml-proc
107    :type '(string))    :type '(string))
108    
109  (defvar sml-compile-command "CM.make()"  (defcustom sml-host-name ""
110    "The command used by default by `sml-make'.")    "*Host on which to run ML."
111      :group 'sml-proc
112      :type '(string))
113    
114  (defvar sml-make-file-name "sources.cm"  (defcustom sml-config-file "~/.smlproc.sml"
115    "The name of the makefile that `sml-make' will look for (if non-nil).")    "*File that should be fed to the ML process when started."
116      :group 'sml-proc
117      :type '(string))
118    
119  ;;(defvar sml-raise-on-error nil  (defcustom sml-compile-command "CM.make()"
120  ;;  "*When non-nil, `sml-next-error' will raise the ML process's frame.")    "The command used by default by `sml-compile'.
121    See also `sml-compile-commands-alist'.")
122    
123    (defcustom sml-compile-commands-alist
124      '(("CMB.make()" . "all-files.cm")
125        ("CMB.make()" . "pathconfig")
126        ("CM.make()" . "sources.cm")
127        ("use \"load-all\"" . "load-all"))
128      "*Commands used by default by `sml-compile'.
129    Each command is associated with its \"main\" file.
130    It is perfectly OK to associate several files with a command or several
131    commands with the same file.")
132    
133  (defvar inferior-sml-mode-hook nil  (defvar inferior-sml-mode-hook nil
134    "*This hook is run when the inferior ML process is started.    "*This hook is run when the inferior ML process is started.
135  All buffer local customisations for the interaction buffers go here.")  All buffer local customisations for the interaction buffers go here.")
136    
 (defvar inferior-sml-load-hook nil  
   "*Hook run when inferior-sml-mode (sml-proc.el) is loaded into Emacs.  
 This is a good place to put your preferred key bindings.")  
   
137  (defvar sml-error-overlay nil  (defvar sml-error-overlay nil
138    "*Non-nil means use an overlay to highlight errorful code in the buffer.    "*Non-nil means use an overlay to highlight errorful code in the buffer.
139  The actual value is the name of a face to use for the overlay.  The actual value is the name of a face to use for the overlay.
# Line 132  Line 146 
146    
147  MULTIPLE PROCESS SUPPORT (Whoever wants multi-process support anyway?)  MULTIPLE PROCESS SUPPORT (Whoever wants multi-process support anyway?)
148  =====================================================================  =====================================================================
149  sml-mode supports, in a fairly simple fashion, running multiple ML  `sml-mode' supports, in a fairly simple fashion, running multiple ML
150  processes. To run multiple ML processes, you start the first up with  processes. To run multiple ML processes, you start the first up with
151  \\[sml]. It will be in a buffer named *sml*. Rename this buffer with  \\[sml]. It will be in a buffer named *sml*. Rename this buffer with
152  \\[rename-buffer]. You may now start up a new process with another  \\[rename-buffer]. You may now start up a new process with another
# Line 160  Line 174 
174    the process attached to buffer `sml-buffer'.    the process attached to buffer `sml-buffer'.
175    
176  This process selection is performed by function `sml-proc' which looks  This process selection is performed by function `sml-proc' which looks
177  at the value of `sml-buffer' -- which must be a lisp buffer object, or  at the value of `sml-buffer' -- which must be a Lisp buffer object, or
178  a string \(or nil\).  a string \(or nil\).
179    
180  Whenever \\[sml] fires up a new process, it resets `sml-buffer' to be  Whenever \\[sml] fires up a new process, it resets `sml-buffer' to be
# Line 234  Line 248 
248  (defconst inferior-sml-font-lock-defaults  (defconst inferior-sml-font-lock-defaults
249    '(inferior-sml-font-lock-keywords nil nil nil nil))    '(inferior-sml-font-lock-keywords nil nil nil nil))
250    
251    
252  ;;; CODE  ;;; CODE
253    
254  (defmap inferior-sml-mode-map  (defmap inferior-sml-mode-map
# Line 251  Line 266 
266  (defvar sml-error-cursor nil)           ;   ditto  (defvar sml-error-cursor nil)           ;   ditto
267    
268  (defun sml-proc-buffer ()  (defun sml-proc-buffer ()
269    "Returns the current ML process buffer,    "Return the current ML process buffer.
270  or the current buffer if it is in `inferior-sml-mode'. Raises an error  or the current buffer if it is in `inferior-sml-mode'. Raises an error
271  if the variable `sml-buffer' does not appear to point to an existing  if the variable `sml-buffer' does not appear to point to an existing
272  buffer."  buffer."
# Line 261  Line 276 
276               ;; buffer-name returns nil if the buffer has been killed               ;; buffer-name returns nil if the buffer has been killed
277               (and buf (buffer-name buf) buf)))               (and buf (buffer-name buf) buf)))
278        ;; no buffer found, make a new one        ;; no buffer found, make a new one
279        (run-sml t)))        (call-interactively 'run-sml)))
   
 (defun sml-proc ()  
   "Returns the current ML process. See variable `sml-buffer'."  
   (assert (eq major-mode 'inferior-sml-mode))  
   (or (get-buffer-process (current-buffer))  
       (progn (run-sml t) (get-buffer-process (current-buffer)))))  
280    
281  (defun sml-buffer (echo)  (defun sml-buffer (echo)
282    "Make the current buffer the current `sml-buffer' if that is sensible.    "Make the current buffer the current `sml-buffer' if that is sensible.
283  Lookup variable `sml-buffer' to see why this might be useful."  Lookup variable `sml-buffer' to see why this might be useful.
284    If prefix argument ECHO is set, then it only reports on the current state."
285    (interactive "P")    (interactive "P")
286    (when (and (not echo) (eq major-mode 'inferior-sml-mode))    (when (not echo)
287      (setq sml-buffer (current-buffer)))      (setq sml-buffer
288    (message "ML process buffer is %s."            (if (eq major-mode 'inferior-sml-mode) (current-buffer)
289                (read-buffer "Set ML process buffer to: " nil t))))
290      (message "ML process buffer is now %s."
291             (or (ignore-errors (buffer-name (get-buffer sml-buffer)))             (or (ignore-errors (buffer-name (get-buffer sml-buffer)))
292                 "undefined")))                 "undefined")))
293    
294  (defun inferior-sml-mode ()  (defun sml-proc ()
295      "Return the current ML process.  See variable `sml-buffer'."
296      (assert (eq major-mode 'inferior-sml-mode))
297      (or (get-buffer-process (current-buffer))
298          (progn (call-interactively 'run-sml)
299                 (get-buffer-process (current-buffer)))))
300    
301    (define-derived-mode inferior-sml-mode comint-mode "Inferior-SML"
302    "Major mode for interacting with an inferior ML process.    "Major mode for interacting with an inferior ML process.
303    
304  The following commands are available:  The following commands are available:
# Line 323  Line 342 
342      to the end of the process' output, and sends it.      to the end of the process' output, and sends it.
343  DEL converts tabs to spaces as it moves back.  DEL converts tabs to spaces as it moves back.
344  TAB file name completion, as in shell-mode, etc.."  TAB file name completion, as in shell-mode, etc.."
   (interactive)  
   (kill-all-local-variables)  
   (comint-mode)  
345    (setq comint-prompt-regexp sml-prompt-regexp)    (setq comint-prompt-regexp sml-prompt-regexp)
346    (sml-mode-variables)    (sml-mode-variables)
347    
# Line 338  Line 354 
354    ;; compilation support (used for next-error)    ;; compilation support (used for next-error)
355    (set (make-local-variable 'compilation-error-regexp-alist)    (set (make-local-variable 'compilation-error-regexp-alist)
356         sml-error-regexp-alist)         sml-error-regexp-alist)
357    (compilation-shell-minor-mode 1)    (compilation-minor-mode 1)
358      ;; eliminate compilation-minor-mode's map since its Mouse-2 binding
359      ;; is just too unbearable.
360      (add-to-list 'minor-mode-overriding-map-alist
361                   (cons 'compilation-minor-mode (make-sparse-keymap)))
362    ;; I'm sure people might kill me for that    ;; I'm sure people might kill me for that
363    (setq compilation-error-screen-columns nil)    (setq compilation-error-screen-columns nil)
364    (make-local-variable 'sml-endof-error-alist)    (make-local-variable 'sml-endof-error-alist)
365    ;;(make-local-variable 'sml-error-overlay)    ;;(make-local-variable 'sml-error-overlay)
366    
367    (setq major-mode 'inferior-sml-mode)    (setq mode-line-process '(": %s")))
   (setq mode-name "Inferior ML")  
   (setq mode-line-process '(": %s"))  
   (use-local-map inferior-sml-mode-map)  
   ;;(add-hook 'kill-emacs-hook 'sml-temp-tidy)  
   
   (run-hooks 'inferior-sml-mode-hook))  
368    
369  ;;; FOR RUNNING ML FROM EMACS  ;;; FOR RUNNING ML FROM EMACS
370    
371  ;;;###autoload  ;;;###autoload
372  (defun run-sml (&optional pfx)  (autoload 'run-sml "sml-proc" nil t)
373    "Run an inferior ML process, input and output via buffer *sml*.  (defalias 'run-sml 'sml-run)
374  With a prefix argument, this command allows you to specify any command  (defun sml-run (cmd arg &optional host)
375  line options to pass to the complier. The command runs hook functions    "Run the program CMD with given arguments ARG.
376  on `comint-mode-hook' and `inferior-sml-mode-hook' in that order.  The command is run in buffer *CMD* using mode `inferior-sml-mode'.
377    If the buffer already exists and has a running process, then
378  If there is a process already running in *sml*, just switch to that  just go to this buffer.
379  buffer instead.  
380    This updates `sml-buffer' to the new buffer.
381  In fact the name of the buffer created is chosen to reflect the name  You can have several inferior M(or L process running, but only one (> s
 of the program name specified by `sml-program-name', or entered at the  
 prompt. You can have several inferior ML process running, but only one  
382  current one -- given by `sml-buffer' (qv).  current one -- given by `sml-buffer' (qv).
383    
384    If a prefix argument is used, the user is also prompted for a HOST
385    on which to run CMD using `remote-shell-program'.
386    
387  \(Type \\[describe-mode] in the process buffer for a list of commands.)"  \(Type \\[describe-mode] in the process buffer for a list of commands.)"
388    (interactive "P")    (interactive
389    (let ((cmd (if pfx     (list
390                   (read-string "ML command: " sml-program-name)                   (read-string "ML command: " sml-program-name)
391                 sml-program-name))      (if (or current-prefix-arg (> (length sml-default-arg) 0))
         (args (if pfx  
392                    (read-string "Any args: " sml-default-arg)                    (read-string "Any args: " sml-default-arg)
393                  sml-default-arg)))        sml-default-arg)
394      (sml-run cmd args)))      (if (or current-prefix-arg (> (length sml-host-name) 0))
395            (read-string "On host: " sml-host-name)
396  (defun sml-run (cmd arg)        sml-host-name)))
   "Run the ML program CMD with given arguments ARGS.  
 This usually updates `sml-buffer' to a buffer named *CMD*."  
397    (let* ((pname (file-name-nondirectory cmd))    (let* ((pname (file-name-nondirectory cmd))
398           (args (if (equal arg "") () (sml-args-to-list arg))))           (args (if (equal arg "") () (split-string arg)))
399             (file (when (and sml-config-file (file-exists-p sml-config-file))
400                     sml-config-file)))
401      ;; and this -- to keep these as defaults even if      ;; and this -- to keep these as defaults even if
402      ;; they're set in the mode hooks.      ;; they're set in the mode hooks.
403      (setq sml-program-name cmd)      (setq sml-program-name cmd)
404      (setq sml-default-arg arg)      (setq sml-default-arg arg)
405      (setq sml-buffer (apply 'make-comint pname cmd nil args))      (setq sml-host-name host)
406        ;; For remote execution, use `remote-shell-program'
407        (when (> (length host) 0)
408          (setq args (list* host "cd" default-directory ";" cmd args))
409          (setq cmd remote-shell-program))
410        ;; go for it
411        (setq sml-buffer (apply 'make-comint pname cmd file args))
412    
413      (set-buffer sml-buffer)      (pop-to-buffer sml-buffer)
414      (message (format "Starting \"%s\" in background." pname))      ;;(message (format "Starting \"%s\" in background." pname))
415      (inferior-sml-mode)      (inferior-sml-mode)
416      (goto-char (point-max))      (goto-char (point-max))
417      sml-buffer))      sml-buffer))
418    
419  (defun sml-args-to-list (string)  (defun switch-to-sml (eobp)
   (let ((where (string-match "[ \t]" string)))  
     (cond ((null where) (list string))  
           ((not (= where 0))  
            (cons (substring string 0 where)  
                  (sml-args-to-list (substring string (+ 1 where)  
                                               (length string)))))  
           (t (let ((pos (string-match "[^ \t]" string)))  
                (if (null pos)  
                    nil  
                    (sml-args-to-list (substring string pos  
                                                 (length string)))))))))  
   
 (defun switch-to-sml (eob-p)  
420    "Switch to the ML process buffer.    "Switch to the ML process buffer.
421  With prefix argument, positions cursor at point, otherwise at end of buffer."  Move point to the end of buffer unless prefix argument EOBP is set."
422    (interactive "P")    (interactive "P")
423    (pop-to-buffer (sml-proc-buffer))    (pop-to-buffer (sml-proc-buffer))
424    (cond ((not eob-p)    (unless eobp
425           (push-mark (point) t)           (push-mark (point) t)
426           (goto-char (point-max)))))      (goto-char (point-max))))
427    
428  ;; Fakes it with a "use <temp-file>;" if necessary.  ;; Fakes it with a "use <temp-file>;" if necessary.
429    
430  (defun sml-send-region (start end &optional and-go)  (defun sml-send-region (start end &optional and-go)
431    "Send current region to the inferior ML process.    "Send current region START..END to the inferior ML process.
432  Prefix argument means switch-to-sml afterwards.  Prefix AND-GO argument means switch-to-sml afterwards.
433    
434  The region is written out to a temporary file and a \"use <temp-file>\" command  The region is written out to a temporary file and a \"use <temp-file>\" command
435  is sent to the compiler.  is sent to the compiler.
# Line 448  Line 455 
455    
456  (defun sml-send-function (&optional and-go)  (defun sml-send-function (&optional and-go)
457    "Send current paragraph to the inferior ML process.    "Send current paragraph to the inferior ML process.
458  With a prefix argument switch to the sml buffer as well  With a prefix argument AND-GO switch to the sml buffer as well
459  \(cf. `sml-send-region'\)."  \(cf. `sml-send-region'\)."
460    (interactive "P")    (interactive "P")
461    (save-excursion    (save-excursion
# Line 464  Line 471 
471    
472  (defun sml-send-buffer (&optional and-go)  (defun sml-send-buffer (&optional and-go)
473    "Send buffer to inferior shell running ML process.    "Send buffer to inferior shell running ML process.
474  With a prefix argument switch to the sml buffer as well  With a prefix argument AND-GO switch to the sml buffer as well
475  \(cf. `sml-send-region'\)."  \(cf. `sml-send-region'\)."
476    (interactive "P")    (interactive "P")
477    (if (memq major-mode sml-source-modes)    (if (memq major-mode sml-source-modes)
# Line 475  Line 482 
482  ;; bind if she wishes, since its easier to type C-c r than C-u C-c C-r.  ;; bind if she wishes, since its easier to type C-c r than C-u C-c C-r.
483    
484  (defun sml-send-region-and-go (start end)  (defun sml-send-region-and-go (start end)
485    "Send current region to the inferior ML process, and go there."    "Send current region START..END to the inferior ML process, and go there."
486    (interactive "r")    (interactive "r")
487    (sml-send-region start end t))    (sml-send-region start end t))
488    
# Line 488  Line 495 
495    
496  (defun sml-drag-region (event)  (defun sml-drag-region (event)
497    "Highlight the text the mouse is dragged over, and send it to ML.    "Highlight the text the mouse is dragged over, and send it to ML.
498  This must be bound to a button-down mouse event, currently \\[sml-drag-region].  This must be bound to a button-down mouse EVENT, currently \\[sml-drag-region].
499    
500  If you drag the mouse (ie, keep the mouse button depressed) the  If you drag the mouse (ie, keep the mouse button depressed) the
501  program text sent to the complier is delimited by where you started  program text sent to the complier is delimited by where you started
# Line 523  Line 530 
530  ;;; LOADING AND IMPORTING SOURCE FILES:  ;;; LOADING AND IMPORTING SOURCE FILES:
531    
532  (defvar sml-prev-dir/file nil  (defvar sml-prev-dir/file nil
533    "Caches the (directory . file) pair used in the last `sml-load-file'    "Cache for (DIRECTORY . FILE) pair last.
534  or `sml-cd' command. Used for determining the default in the next one.")  Set in `sml-load-file' and `sml-cd' commands.
535    Used to determine the default in the next `ml-load-file'.")
536    
537  (defun sml-load-file (&optional and-go)  (defun sml-load-file (&optional and-go)
538    "Load an ML file into the current inferior ML process.    "Load an ML file into the current inferior ML process.
539  With a prefix argument switch to sml buffer as well.  With a prefix argument AND-GO switch to sml buffer as well.
540    
541  This command uses the ML command template `sml-use-command' to construct  This command uses the ML command template `sml-use-command' to construct
542  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
# Line 570  Line 578 
578      (when and-go (switch-to-sml nil))))      (when and-go (switch-to-sml nil))))
579    
580  (defun sml-compile (command)  (defun sml-compile (command)
581    "re-make a system using (by default) CM.    "Pass a COMMAND to the SML process to compile the current program.
582     The exact command used can be specified by providing a prefix argument."  
583    You can then use the command \\[next-error] to find the next error message
584    and move to the source code that caused it.
585    
586    Interactively, prompts for the command if `compilation-read-command' is
587    non-nil.  With prefix arg, always prompts."
588    (interactive    (interactive
589     ;; code taken straight from compile.el     (let* ((dir default-directory)
590              (cmd "cd \"."))
591         ;; look for files to determine the default command
592         (while (and (stringp dir)
593                     (dolist (cf sml-compile-commands-alist 1)
594                       (when (file-exists-p (expand-file-name (cdr cf) dir))
595                         (setq cmd (concat cmd "\"; " (car cf))) (return nil))))
596           (let ((newdir (file-name-directory (directory-file-name dir))))
597             (setq dir (unless (equal newdir dir) newdir))
598             (setq cmd (concat cmd "/.."))))
599         (setq cmd
600               (cond
601                ((local-variable-p 'sml-compile-command) sml-compile-command)
602                ((string-match "^\\s-*cd\\s-+\"\\.\"\\s-*;\\s-*" cmd)
603                 (substring cmd (match-end 0)))
604                ((string-match "^\\s-*cd\\s-+\"\\(\\./\\)" cmd)
605                 (replace-match "" t t cmd 1))
606                ((string-match ";" cmd) cmd)
607                (t sml-compile-command)))
608         ;; code taken from compile.el
609     (if (or compilation-read-command current-prefix-arg)     (if (or compilation-read-command current-prefix-arg)
610         (list (read-from-minibuffer "Compile command: "         (list (read-from-minibuffer "Compile command: "
611                                   sml-compile-command nil nil                                       cmd nil nil '(compile-history . 1)))
612                                   '(compile-history . 1)))         (list cmd))))
613       (list sml-compile-command)))       ;; ;; now look for command's file to determine the directory
614    (setq sml-compile-command command)       ;; (setq dir default-directory)
615         ;; (while (and (stringp dir)
616         ;;             (dolist (cf sml-compile-commands-alist t)
617         ;;               (when (and (equal cmd (car cf))
618         ;;                          (file-exists-p (expand-file-name (cdr cf) dir)))
619         ;;                 (return nil))))
620         ;;   (let ((newdir (file-name-directory (directory-file-name dir))))
621         ;;     (setq dir (unless (equal newdir dir) newdir))))
622         ;; (setq dir (or dir default-directory))
623         ;; (list cmd dir)))
624      (set (make-local-variable 'sml-compile-command) command)
625    (save-some-buffers (not compilation-ask-about-save) nil)    (save-some-buffers (not compilation-ask-about-save) nil)
626    ;; try to find a makefile up the directory tree    (let ((dir default-directory))
627    (let ((dir (when sml-make-file-name default-directory)))      (when (string-match "^\\s-*cd\\s-+\"\\([^\"]+\\)\"\\s-*;" command)
628      (while (and dir (not (file-exists-p (concat dir sml-make-file-name))))        (setq dir (expand-file-name (match-string 1 command)))
629        (let ((newdir (file-name-directory (directory-file-name dir))))        (setq command (replace-match "" t t command)))
         (setq dir (unless (equal newdir dir) newdir))))  
     (unless dir (setq dir default-directory))  
630      (with-current-buffer (sml-proc-buffer)      (with-current-buffer (sml-proc-buffer)
631        (setq default-directory dir)        (setq default-directory dir)
632        (sml-send-string (concat (format sml-cd-command dir) "; " command) t t))))        (sml-send-string (concat (format sml-cd-command dir) "; " command) t t))))
# Line 616  Line 656 
656          (column (string-to-number (compile-buffer-substring (third f)))))          (column (string-to-number (compile-buffer-substring (third f)))))
657      ;; record the end of error, if any      ;; record the end of error, if any
658      (when (fourth f)      (when (fourth f)
659        (let* ((endline (string-to-number (compile-buffer-substring (fourth f))))        (let ((endlinestr (compile-buffer-substring (fourth f))))
660               (endcol (string-to-number (compile-buffer-substring (fifth f))))          (when endlinestr
661              (let* ((endline (string-to-number endlinestr))
662                     (endcol (string-to-number
663                              (or (compile-buffer-substring (fifth f)) "0")))
664               (linediff (- endline linenum)))               (linediff (- endline linenum)))
665          (push (list err linediff (if (= 0 linediff) (- endcol column) endcol))          (push (list err linediff (if (= 0 linediff) (- endcol column) endcol))
666                sml-endof-error-alist)))                    sml-endof-error-alist)))))
667      ;; build the error descriptor      ;; build the error descriptor
668      (if (string= (car sml-temp-file) (first f))      (if (string= (car sml-temp-file) (first f))
669          ;; special case for code sent via sml-send-region          ;; special case for code sent via sml-send-region
# Line 651  Line 694 
694          (goto-char pos)))))          (goto-char pos)))))
695    
696  (defun sml-error-overlay (undo &optional beg end)  (defun sml-error-overlay (undo &optional beg end)
697    "Move `sml-error-overlay' so it surrounds the text region in the    "Move `sml-error-overlay' to the text region in the current buffer.
698  current buffer. If the buffer-local variable `sml-error-overlay' is  If the buffer-local variable `sml-error-overlay' is
699  non-nil it should be an overlay \(or extent, in XEmacs speak\)\; this  non-nil it should be an overlay \(or extent, in XEmacs speak\)\; this
700  function moves the overlay over the current region. If the optional  function moves the overlay over the current region. If the optional
701  BUFFER argument is given, move the overlay in that buffer instead of  BUFFER argument is given, move the overlay in that buffer instead of
# Line 675  Line 718 
718    
719  ;;; 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
720    
721  (if window-system  ;;(define-key sml-mode-map [(meta shift down-mouse-1)] 'sml-drag-region)
     (cond ((string-match "\\(Lucid\\|XEmacs\\)" emacs-version)  
            ;; LUCID (19.10) or later...  
            (define-key sml-mode-map '(meta shift button1) 'sml-drag-region))  
           (t  
            ;; GNU, post circa 19.19  
            (define-key sml-mode-map [M-S-down-mouse-1] 'sml-drag-region))))  
   
 ;;; ...and do the user's customisations.  
722    
 (run-hooks 'inferior-sml-load-hook)  
   
 ;;; Here is where sml-proc.el ends  
723  (provide 'sml-proc)  (provide 'sml-proc)
724    
725    ;;; sml-proc.el ends here

Legend:
Removed from v.534  
changed lines
  Added in v.535

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