From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: I was asked something in a *compilation* window Date: Tue, 25 Jun 2002 09:50:59 -0600 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <3D189163.4000907@ihs.com> References: <87sn3hvchm.fsf@jidanni.org> <3D135B1B.2080600@ihs.com> <874rftmvle.fsf@pot.cnuce.cnr.it> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000201080609040402010101" X-Trace: main.gmane.org 1025020474 10809 127.0.0.1 (25 Jun 2002 15:54:34 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 25 Jun 2002 15:54:34 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17MseH-0002oD-00 for ; Tue, 25 Jun 2002 17:54:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17MseX-00057n-00; Tue, 25 Jun 2002 11:54:49 -0400 Original-Received: from chi6-1.relay.mail.uu.net ([199.171.54.98]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 17Msaq-0004sI-00 for ; Tue, 25 Jun 2002 11:51:00 -0400 Original-Received: from mail.fu-berlin.de by chi6sosrv13.alter.net with ESMTP (peer crosschecked as: mail.fu-berlin.de [160.45.11.165]) id QQmuuh17619 for ; Tue, 25 Jun 2002 15:51:01 GMT Original-Received: by mail.fu-berlin.de (Smail3.2.0.98) from Curry.ZEDAT.FU-Berlin.DE (160.45.10.36) with esmtp id ; Tue, 25 Jun 2002 17:50:58 +0200 (MEST) Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.fu-berlin.de with bsmtp id ; Tue, 25 Jun 2002 17:50:57 +0200 (MEST) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: 170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 194 X-Orig-NNTP-Posting-Host: 170.207.51.80 X-Orig-X-Trace: fu-berlin.de 1025020257 13466375 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:2267 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:2267 This is a multi-part message in MIME format. --------------000201080609040402010101 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Francesco Potorti` wrote: > kevinr@ihs.com (Kevin Rodgers) writes: > I wrote a small patch to compile.el (compile-internal) and a very small > add-on (compile-input.el) way back in October, 1996 for Karl Berry to > enable user input in *compile* buffers. I'll post it again if anyone's > interested. > > I think that would be a useful addition to Emacs. OK, here's what we came up with back then. -- Kevin Rodgers --------------000201080609040402010101 Content-Type: text/plain; name="compile.el-compile-disable-input.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="compile.el-compile-disable-input.patch" >From kevinr@airedale Fri Oct 18 07:50:16 1996 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] [nil "Fri" "18" "October" "1996" "07:50:11" "-0600" "Kevin Rodgers" "kevinr@airedale" nil nil "Re: standard input in *compile* buffers" "^From:" nil nil "10" nil "standard input in *compile* buffers" nil nil nil] nil) Return-Path: Received: from ihs.com by airedale.ihsyp (SMI-8.6/SMI-SVR4) id HAA03501; Fri, 18 Oct 1996 07:50:15 -0600 Received: from airedale.ihsyp (airedale.ihs.com) by ihs.com (4.1/SMI-4.1) id AA02413; Fri, 18 Oct 96 07:50:04 MDT Received: by airedale.ihsyp (SMI-8.6/SMI-SVR4) id HAA03498; Fri, 18 Oct 1996 07:50:11 -0600 Message-Id: <199610181350.HAA03498@airedale.ihsyp> Reply-To: kevin.rodgers@ihs.com X-Newsreader: TIN [version 1.2 PL2] Content-Length: 2296 From: kevinr@airedale (Kevin Rodgers) Organization: IHS Electronic Systems Development To: GNU Emacs bug reports Cc: kb@cs.umb.edu (K. Berry) Subject: Re: standard input in *compile* buffers Newsgroups: gnu.emacs.bug Date: Fri, 18 Oct 1996 07:50:11 -0600 In article <199610122106.AA05911@terminus.cs.umb.edu> kb@cs.umb.edu (K. Berry) wrote: >Since it's not possible to actually type input in *compile* buffers, >could input be redirected from /dev/null so programs aren't fooled? >Naturally, it would be even nicer to actually be able to interact in the >buffer. In that case, the redirection could be optional. Here's a slightly improved version of the patch I submitted, which makes the redirection optional (controlled by the new variable compile- disable-input) as Karl suggested. Its default value makes compile behave the same whether the platform supports asynchronous processes or not. With my first patch, I had wondered whether `process-send-eof' should not be called until after the compilation process' sentinel, filter, and marker were set; but it seems to work fine just as it is. Fri Oct 18 07:29:27 1996 Kevin Rodgers * compile.el (compile-disable-input): Define. (compile-internal): If compile-disable-input is non-nil, send an EOF to the compilation process. *** lisp/compile.el.orig Fri Apr 26 13:44:02 1996 --- lisp/compile.el Thu Oct 17 13:50:32 1996 *************** *** 358,363 **** --- 358,369 ---- (cons msg code))) (cons msg code))))))) + (defvar compile-disable-input t + "*If non-nil, redirect input for compilation processes from `/dev/null'. + + This only affects platforms that support asynchronous processes (see + start-process); synchronous compilation processes never accept input.") + (defun compile-internal (command error-message &optional name-of-mode parser regexp-alist name-function) *************** *** 445,450 **** --- 451,458 ---- (proc (start-process-shell-command (downcase mode-name) outbuf command))) + (if compile-disable-input + (process-send-eof proc)) (set-process-sentinel proc 'compilation-sentinel) (set-process-filter proc 'compilation-filter) (set-marker (process-mark proc) (point) outbuf) -- Kevin Rodgers Project Engineer Information Handling Services Electronic Systems Development 15 Inverness Way East, M/S A201 GO BUFFS! Englewood CO 80112-5776 USA 1+ (303) 397-2807[voice]/754-3975[fax] --------------000201080609040402010101 Content-Type: text/plain; name="compile-input.el" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="compile-input.el" >From kevinr@airedale Fri Oct 18 07:55:21 1996 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] [nil "Fri" "18" "October" "1996" "07:55:17" "-0600" "Kevin Rodgers" "kevinr@airedale" nil nil "Re: standard input in *compile* buffers" "^From:" nil nil "10" nil "standard input in *compile* buffers" nil nil nil] nil) Return-Path: Received: from ihs.com by airedale.ihsyp (SMI-8.6/SMI-SVR4) id HAA03512; Fri, 18 Oct 1996 07:55:20 -0600 Received: from airedale.ihsyp (airedale.ihs.com) by ihs.com (4.1/SMI-4.1) id AA02584; Fri, 18 Oct 96 07:55:09 MDT Received: by airedale.ihsyp (SMI-8.6/SMI-SVR4) id HAA03509; Fri, 18 Oct 1996 07:55:17 -0600 Message-Id: <199610181355.HAA03509@airedale.ihsyp> In-Reply-To: <199610181350.HAA03498@airedale.ihsyp> References: <199610181350.HAA03498@airedale.ihsyp> Reply-To: kevin.rodgers@ihs.com X-Mailer: VM 5.96 (beta) Content-Length: 1835 From: kevinr@airedale (Kevin Rodgers) X-Organization: IHS Electronic Systems Development To: GNU Emacs bug reports , GNU Emacs source code Cc: kb@cs.umb.edu (K. Berry) Subject: Re: standard input in *compile* buffers Newsgroups: gnu.emacs.bug Date: Fri, 18 Oct 1996 07:55:17 -0600 I wrote [in gnu.emacs.bug]: >Here's a slightly improved version of the patch I submitted, which makes >the redirection optional (controlled by the new variable compile- >disable-input) as Karl suggested. And here's a slightly improved version of compile-input.el, which unsets compile-disable-input: ;;; 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) (make-marker)) (set-marker comint-last-input-start (point-min)) (set (make-local-variable 'comint-last-input-end) (make-marker)) (set-marker comint-last-input-end (point-min)) (set (make-local-variable 'comint-last-output-start) (make-marker)) (set-marker comint-last-output-start (point-max)) (add-hook (make-local-variable 'pre-command-hook) 'comint-preinput-scroll-to-bottom) ;; Move point to EOB on input: (set (make-local-variable 'comint-scroll-to-bottom-on-input) 'this) ;; Restore useful bindings for input: (local-unset-key " ") ; scroll-up (local-unset-key "\^?") ; 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) -- Kevin Rodgers Project Engineer Information Handling Services Electronic Systems Development 15 Inverness Way East, M/S A201 GO BUFFS! Englewood CO 80112-5776 USA 1+ (303) 397-2807[voice]/754-3975[fax] --------------000201080609040402010101--