GNU logs - #28892, boring messages

Message sent to bug-gnu-emacs@HIDDEN:

X-Loop: help-debbugs@HIDDEN
Subject: bug#28892: 24.5; Allow multiple compilations to append to an existing compilation buffer
Resent-From: Ludovic Brenta <ludovic@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at>>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 18 Oct 2017 17:17:02 +0000
Resent-Message-ID: <handler.28892.B.15083470112103 <at>>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 28892
X-GNU-PR-Package: emacs
To: 28892 <at>
X-Debbugs-Original-To: <bug-gnu-emacs@HIDDEN>
Received: via spool by submit <at> id=B.15083470112103
          (code B ref -1); Wed, 18 Oct 2017 17:17:02 +0000
Received: (at submit) by; 18 Oct 2017 17:16:51 +0000
Received: from localhost ([]:48540
	by with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at>>)
	id 1e4rxa-0000Xq-Oh
	for submit <at>; Wed, 18 Oct 2017 13:16:51 -0400
Received: from ([]:48415)
 by with esmtp (Exim 4.84_2)
 (envelope-from <ludovic@HIDDEN>) id 1e4r8m-0007YP-Bv
 for submit <at>; Wed, 18 Oct 2017 12:24:20 -0400
Received: from Debian-exim by with spam-scanned (Exim 4.71)
 (envelope-from <ludovic@HIDDEN>) id 1e4r8g-0000sU-AI
 for submit <at>; Wed, 18 Oct 2017 12:24:15 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
Received: from ([2001:4830:134:3::11]:46494)
 by with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <ludovic@HIDDEN>)
 id 1e4r8g-0000sO-6g
 for submit <at>; Wed, 18 Oct 2017 12:24:14 -0400
Received: from ([2001:4830:134:3::10]:39373)
 by with esmtp (Exim 4.71)
 (envelope-from <ludovic@HIDDEN>) id 1e4r8e-00046q-Qc
 for bug-gnu-emacs@HIDDEN; Wed, 18 Oct 2017 12:24:13 -0400
Received: from Debian-exim by with spam-scanned (Exim 4.71)
 (envelope-from <ludovic@HIDDEN>) id 1e4r8Y-0000ph-Np
 for bug-gnu-emacs@HIDDEN; Wed, 18 Oct 2017 12:24:12 -0400
Received: from ([]:52530 by with esmtp (Exim 4.71)
 (envelope-from <ludovic@HIDDEN>) id 1e4r8Y-0000n9-D2
 for bug-gnu-emacs@HIDDEN; Wed, 18 Oct 2017 12:24:06 -0400
Received: by (Postfix, from userid 5000)
 id C8CF4507A58C; Wed, 18 Oct 2017 18:24:02 +0200 (CEST)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
Content-Transfer-Encoding: 7bit
Date: Wed, 18 Oct 2017 17:24:02 +0100
From: Ludovic Brenta <ludovic@HIDDEN>
Message-ID: <50fef6222795c046dd7754a79d3508ac@HIDDEN>
X-Sender: ludovic@HIDDEN
User-Agent: Roundcube Webmail/0.5.3
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-detected-operating-system: by FreeBSD 8.x [fuzzy]
X-detected-operating-system: by GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Mailman-Approved-At: Wed, 18 Oct 2017 13:16:49 -0400
X-BeenThere: debbugs-submit <at>
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <>
List-Unsubscribe: <>, 
 <mailto:debbugs-submit-request <at>>
List-Archive: <>
List-Post: <mailto:debbugs-submit <at>>
List-Help: <mailto:debbugs-submit-request <at>>
List-Subscribe: <>, 
 <mailto:debbugs-submit-request <at>>
Errors-To: debbugs-submit-bounces <at>
Sender: "Debbugs-submit" <debbugs-submit-bounces <at>>
X-Spam-Score: -5.0 (-----)

Severity: wishlist

There are use cases for compilation-mode that would benefit from an
"append" feature.  For example, M-x grep places results in a *grep*
compilation buffer and it would be nice to be able to start a new grep
command that appends to the same buffer.

We use this for cross-references emitted by gnatfind (part of the GNU 
compiler suite) in a buffer named *gnatfind*.  We would like to be able 
call gnatfind with a prefix argument to append new references to this
buffer, without moving point in the *gnatfind* buffer.

Currently, compilation-start unconditionally empties the compilation
buffer before doing anything.

I have a crude workaround consisting in starting the new gnatfind
compilation in a new temporary buffer (created with
generate-new-buffer-name), waiting for the compilation to finish, and
finally, in a compilation-finished-functions hook, appending the 
of the temporary buffer to the *gnatfind* buffer.  This has drawbacks:

* compilation-start raises the new *gnatfind*<2> buffer before starting
   the compilation, disrupting any browsing the user was doing in

* the new contents are added to *gnatfind* only after the compilation

So I think some adjustments to compilation-start (i.e. a new argument)
would be necessary for a full solution.

For the record here is my current workaround:

(defun ada-gnat-xref-all (identifier file line col local-only append)
   "For `ada-xref-all-function'."
   (let* ((arg (ada-gnat-xref-common-args identifier file line col)))
     (setq arg (cons "-r" arg))
     (when local-only (setq arg (append arg (list file))))

     (with-current-buffer (gnat-run-buffer); for default-directory
       (let* ((compilation-buffer-name "*gnatfind*")
              (compilation-error "reference")
              (command-and-args (mapconcat (lambda (a) (or a ""))
(ada-gnat-xref-common-cmd) arg)
                                           " "))
              (gnatfind-buffer (get-buffer-create 
	;; compilation-environment is buffer-local; don't set in 'let'
	(setq compilation-environment (ada-prj-get 'proc_env))

	;; WORKAROUND: the 'compilation' API doesn't let us specify "append", 
so we use this.
         (add-hook 'compilation-finish-functions
                   (lambda (compilation-finished-buffer 
                     (if append
                         (with-current-buffer gnatfind-buffer
                           (let ((inhibit-read-only t)
                                 (prev-pos (point)))
                             (goto-char (point-max))
                             (insert "\n")
                             (goto-char prev-pos)
                             (kill-buffer compilation-finished-buffer)))
                       ;; else
                         (kill-buffer gnatfind-buffer)
                           (rename-buffer compilation-buffer-name))))
                     (setq compilation-finish-functions

         ;; Now start the compilation in a new temporary buffer.
         (compilation-start command-and-args
                            (lambda (_name)
                              ;; If the result starts with a space, the 
                              ;; is hidden but no fontification occurs 
in it, so we
                              ;; return a name for a visible buffer.

Ludovic Brenta.

Message sent:

Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Ludovic Brenta <ludovic@HIDDEN>
Subject: bug#28892: Acknowledgement (24.5; Allow multiple compilations to
 append to an existing compilation buffer)
Message-ID: <handler.28892.B.15083470112103.ack <at>>
References: <50fef6222795c046dd7754a79d3508ac@HIDDEN>
X-Gnu-PR-Message: ack 28892
X-Gnu-PR-Package: emacs
Reply-To: 28892 <at>
Date: Wed, 18 Oct 2017 17:17:02 +0000

Thank you for filing a new bug report with

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):

If you wish to submit further information on this problem, please
send it to 28892 <at>

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems

Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.