From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: Misc. minor compile.el issues Date: Fri, 06 Dec 2002 15:14:21 -0500 Sender: emacs-devel-admin@gnu.org Message-ID: <200212062014.gB6KELU09529@rum.cs.yale.edu> References: <5xn0nkasst.fsf@kfs2.cua.dk> <200212061655.gB6GtA208490@rum.cs.yale.edu> <5xisy6j44w.fsf@kfs2.cua.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1039206667 7469 80.91.224.249 (6 Dec 2002 20:31:07 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 6 Dec 2002 20:31:07 +0000 (UTC) Cc: "Stefan Monnier" , emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18KP7p-0001wH-00 for ; Fri, 06 Dec 2002 21:31:05 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18KPGb-0002ed-00 for ; Fri, 06 Dec 2002 21:40:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18KP0D-0005fI-00; Fri, 06 Dec 2002 15:23:13 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18KOzM-0005Ro-00 for emacs-devel@gnu.org; Fri, 06 Dec 2002 15:22:20 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18KOzK-0005R0-00 for emacs-devel@gnu.org; Fri, 06 Dec 2002 15:22:19 -0500 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18KOrf-0003pG-00 for emacs-devel@gnu.org; Fri, 06 Dec 2002 15:14:23 -0500 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id gB6KELU09529; Fri, 6 Dec 2002 15:14:21 -0500 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: storm@cua.dk (Kim F. Storm) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:9936 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:9936 > > > Related to this, I would like the setup function to be able to > > > access the buffer and/or window for the compilation process (e.g. > > > to set buffer-local variables). > > > > AFAIK, you can use (current-buffer). No need for `outbuf'. > > Am I missing something ? > > AFAICS, the setup function is (typically) not called with > current-buffer == outbuf. Huh? The only place where it is called seems to be in: (with-current-buffer outbuf (compilation-mode name-of-mode) ;; In what way is it non-ergonomic ? -stef ;; (toggle-read-only 1) ;;; Non-ergonomic. (set (make-local-variable 'compilation-parse-errors-function) parser) (set (make-local-variable 'compilation-error-message) error-message) (set (make-local-variable 'compilation-error-regexp-alist) error-regexp-alist) (set (make-local-variable 'compilation-enter-directory-regexp-alist) enter-regexp-alist) (set (make-local-variable 'compilation-leave-directory-regexp-alist) leave-regexp-alist) (set (make-local-variable 'compilation-file-regexp-alist) file-regexp-alist) (set (make-local-variable 'compilation-nomessage-regexp-alist) nomessage-regexp-alist) (set (make-local-variable 'compilation-arguments) (list command error-message name-of-mode parser error-regexp-alist name-function enter-regexp-alist leave-regexp-alist file-regexp-alist nomessage-regexp-alist)) ;; This proves a good idea if the buffer's going to scroll ;; with lazy-lock on. (set (make-local-variable 'lazy-lock-defer-on-scrolling) t) (setq default-directory thisdir compilation-directory-stack (list default-directory)) (set-window-start outwin (point-min)) (or (eq outwin (selected-window)) (set-window-point outwin (point-min))) (compilation-set-window-height outwin) (if compilation-process-setup-function (funcall compilation-process-setup-function)) I don't see anything between the with-current-buffer and the call to compilation-process-setup-function which could change current-buffer. Stefan