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> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 18 Oct 2017 17:17:02 +0000
Resent-Message-ID: <handler.28892.B.15083470112103 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 28892
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 28892 <at> debbugs.gnu.org
X-Debbugs-Original-To: <bug-gnu-emacs@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.15083470112103
          (code B ref -1); Wed, 18 Oct 2017 17:17:02 +0000
Received: (at submit) by debbugs.gnu.org; 18 Oct 2017 17:16:51 +0000
Received: from localhost ([127.0.0.1]:48540 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1e4rxa-0000Xq-Oh
	for submit <at> debbugs.gnu.org; Wed, 18 Oct 2017 13:16:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48415)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludovic@HIDDEN>) id 1e4r8m-0007YP-Bv
 for submit <at> debbugs.gnu.org; Wed, 18 Oct 2017 12:24:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ludovic@HIDDEN>) id 1e4r8g-0000sU-AI
 for submit <at> debbugs.gnu.org; Wed, 18 Oct 2017 12:24:15 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:46494)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <ludovic@HIDDEN>)
 id 1e4r8g-0000sO-6g
 for submit <at> debbugs.gnu.org; Wed, 18 Oct 2017 12:24:14 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39373)
 by lists.gnu.org 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 eggs.gnu.org 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 rmap1.bookmyname.com ([88.191.249.149]:52530
 helo=webmail.free.org) by eggs.gnu.org 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 webmail.free.org (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;
 format=flowed
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-Complaints-To: abuse_at_bookmyname.com
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Origin-Web-Site: webmail.bookmyname.com
X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x [fuzzy]
X-detected-operating-system: by eggs.gnu.org: 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> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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 
Ada
compiler suite) in a buffer named *gnatfind*.  We would like to be able 
to
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 
contents
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
   *gnatfind*;

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

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 ""))
                                           (cons 
(ada-gnat-xref-common-cmd) arg)
                                           " "))
              (gnatfind-buffer (get-buffer-create 
compilation-buffer-name))
              (saved-compilation-finish-functions 
compilation-finish-functions))
	;; 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 
compilation-result)
                     (if append
                         (with-current-buffer gnatfind-buffer
                           (let ((inhibit-read-only t)
                                 (prev-pos (point)))
                             (goto-char (point-max))
                             (insert "\n")
                             (insert-buffer-substring 
compilation-finished-buffer)
                             (goto-char prev-pos)
                             (kill-buffer compilation-finished-buffer)))
                       ;; else
                       (progn
                         (kill-buffer gnatfind-buffer)
                         (with-current-buffer 
compilation-finished-buffer
                           (rename-buffer compilation-buffer-name))))
                     (setq compilation-finish-functions
                        saved-compilation-finish-functions)))

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


-- 
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> debbugs.gnu.org>
References: <50fef6222795c046dd7754a79d3508ac@HIDDEN>
X-Gnu-PR-Message: ack 28892
X-Gnu-PR-Package: emacs
Reply-To: 28892 <at> debbugs.gnu.org
Date: Wed, 18 Oct 2017 17:17:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

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):
 bug-gnu-emacs@HIDDEN

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

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

--=20
28892: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D28892
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.