[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: comint-mode broken in GNU Emacs 21.2.1?

From: Kevin Rodgers
Subject: Re: comint-mode broken in GNU Emacs 21.2.1?
Date: Thu, 18 Sep 2003 16:39:01 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv: Gecko/20020406 Netscape6/6.2.2

Vincent Montressor wrote:

I'm having trouble using comint-mode under GNU Emacs 21.2.1:

% emacs -nw -q

        M-x compile

Change compile command to something that accepts interactive input, such as cat:

        C-a C-k cat RET

Go to the end of the compilation buffer and enter comint-mode:

        C-x o M->

        M-x comint-mode

Type something and hit RET:

        hello, world RET

Emacs issues the following error:

        error in process filter: Wrong type argument: markerp, nil

I'll bet you're using my compile-input.el hack written way back in 1996.
Try this version, which adds comint-accum-marker to the comint-mode emulation:

;;; compile-input.el

(defun compile-enable-input ()
  "Enable user input to *compilation* buffers.
To do so, add this function to compilation-mode-hook."
  ;; Emulate comint-mode:
  (require 'comint)
  (set (make-local-variable 'comint-input-ring)
       (make-ring comint-input-ring-size))
  (set (make-local-variable 'comint-last-input-start)
  (set-marker comint-last-input-start (point-min))
  (set (make-local-variable 'comint-last-input-end)
  (set-marker comint-last-input-end (point-min))
  (set (make-local-variable 'comint-last-output-start)
  (set-marker comint-last-output-start (point-max))
  (set (make-local-variable 'comint-accum-marker)
  (set-marker comint-accum-marker nil)
  (add-hook (make-local-variable 'pre-command-hook)
  ;; Move point to EOB on input:
  (set (make-local-variable 'comint-scroll-to-bottom-on-input)
  ;; Restore useful bindings for input:
  (local-unset-key " ")                 ; was scroll-up
  (local-unset-key "\^?")               ; was scroll-down
  ;; Add bindings to send input to compilation process:
  (local-set-key "\C-c\C-d" 'comint-send-eof)
  (local-set-key "\C-m" 'comint-send-input)
  ;; Enable input:
  (set (make-local-variable 'compile-disable-input) nil))

(add-hook 'compilation-mode-hook 'compile-enable-input)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]