From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bruno Barbier Newsgroups: gmane.emacs.help Subject: Re: Waiting for 'compile' to finish Date: Thu, 09 Jan 2025 23:02:03 +0100 Message-ID: <6780475d.050a0220.1ffe1.d6ae@mx.google.com> References: <87o70fn4v6.fsf@neko.mail-host-address-is-not-set> <67802efc.df0a0220.135ebe.4c33@mx.google.com> <67803e66.df0a0220.358b08.b693@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9464"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Marco Antoniotti Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 09 23:03:04 2025 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tW0cJ-0002NW-ET for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 09 Jan 2025 23:03:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tW0bV-0001Qw-6u; Thu, 09 Jan 2025 17:02:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tW0bT-0001QC-1Y for help-gnu-emacs@gnu.org; Thu, 09 Jan 2025 17:02:11 -0500 Original-Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tW0bQ-0000rO-1i for help-gnu-emacs@gnu.org; Thu, 09 Jan 2025 17:02:09 -0500 Original-Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4362bae4d7dso11010615e9.1 for ; Thu, 09 Jan 2025 14:02:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736460126; x=1737064926; darn=gnu.org; h=content-transfer-encoding:mime-version:date:references:in-reply-to :subject:cc:to:from:message-id:from:to:cc:subject:date:message-id :reply-to; bh=vtK+c6OamDxlrm9bwXqdcN1rGYbFGxgZV6IjIAAxyDo=; b=AxJZmxYBYPrY2ciDLahhd3f8kG2xJXK0kHDh/ejL0o4laqOv+QKbaZjvSRrxUX4rBm D7HFYn4aiipdQ9DgO7M9crGutZaHNz4kNA7ehvpE5hsW1zDjZUo/SFaiYLQKCpGcm4+c 1dn1xCOoJwN8KmaH/AoZk2zBWQ74tjAT0H4X3ILedkJIhdeE7SyD2OKDwYmOAE4tRgBa 0bqE6oHGKiBO8eEB5Fpc+mU0xXneVaQpLsKQRsC3WcR4FEnZkdgkXPI8lEzFsFoI7kEj TzEVvdGIBsjeg0zHzHiJBlfRHOkDuEWylwV5vCksIMaruXFlZhna8cPH5/qw5H/TPYx3 8wFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736460126; x=1737064926; h=content-transfer-encoding:mime-version:date:references:in-reply-to :subject:cc:to:from:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=vtK+c6OamDxlrm9bwXqdcN1rGYbFGxgZV6IjIAAxyDo=; b=hQCcsjZciCITk/3u9Zsu7shvDyMk4XE6yTfZCHf1/8Ey30U9NK4HOJ9Mnu3jhy816N uBha9ygw5MDSffcc9cVSbf92cENEk4R8mlssE7fyaW4MqJYBFxBBy42sIw//O+i3HQiX nQT9XobrvWdrv1RdAEcDEgDmLzoBYdxYbt1FG5x5d7cu/F7pvQsLl7Bsg3uHcHSo6tre FyXuRQHz0Or9kQRRtzz7I/rQi2VhAVilD6zY/Cy16fb51IKg1RehlyGUTGSqqBoD+FZ8 grBg+UiMwiYksaNd5Gn75i5xzs5hI3nn5xapadTQ65HytYOofAnjPpuzvm70gas1ZPfM fuAw== X-Gm-Message-State: AOJu0YyKewj21F6c6N8TtyjuJwYulFhEq6uZLjjjPe4zMyORCcs4Nmuk nji7DdO1LR5NWeOcF2atE2CY/CfJ69+C/EnyWPhsOgO9KANFI2CH X-Gm-Gg: ASbGncvRPnPQ6/Ihq1VVk529pge31prfx29RmtsiIvHDOHBG2vwQrmqZIcqX3RXbzkT JNk23MKkMdNIyiGjiyCDuxo3mtK2pxY6Pt+swIF7fjMUnTP5cHvR7Fy6YClrwrhK8kJCHMX9RcV Kef6bo8MRwfuXdO7KQ8Ym8kQ8Zq65IxBcQmlIF9Red3pEA0GcZO9tTMvWQJwp6Ez32WY9S1nlwr DJcFK8rr8gpkKrWIN12nsJmhYI6CiMx/zARRWrKkUTs8Hc8E0QbNSA= X-Google-Smtp-Source: AGHT+IFw/8q1nGk4BKggnL4L6u0eijmCutg0htRmPbvwoGhiziiWyBTTlbhSTsLcPzJStcm9w8mMLg== X-Received: by 2002:a05:600c:3ca0:b0:436:1c0c:bfb6 with SMTP id 5b1f17b1804b1-436e270620emr69656185e9.27.1736460126162; Thu, 09 Jan 2025 14:02:06 -0800 (PST) Original-Received: from localhost ([2a01:e0a:505:3460:1c18:688d:ece4:372e]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9e37bd0sm32446995e9.26.2025.01.09.14.02.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 14:02:05 -0800 (PST) Original-Received: by localhost (sSMTP sendmail emulation); Thu, 09 Jan 2025 23:02:03 +0100 In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=brubar.cs@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:149191 Archived-At: Marco Antoniotti writes: > Yep. That much I surmised. It does not seem to be mentioned in the Info > documentation. Here is a function that compiles and do something when done using `compilation-exit-message-function'. (defun my-compile (cmd on-exit) "Compile using CMD. Return the buffer. Call ON-EXIT when done." (let ((buffer (compile cmd))) (with-current-buffer buffer (add-function :around (local 'compilation-exit-message-function) (lambda (old-fun process-status exit-status msg) (let ((mm (funcall old-fun process-status exit-status= msg))) (funcall on-exit process-status exit-status msg) mm)))) buffer)) Here is an example about how to use it. (defun my-compile-echo-result (process-status exit-status msg) "An ON-EXIT example that just displays OK or Failed." (message "Compilation: %s" (if (eq 0 exit-status) "OK." "Failed!"))) ;; A compilation that succeeds. (my-compile "sleep 1; echo ok" #'my-compile-echo-result) ;; A compilation that fails. (my-compile "sleep 1; oops" #'my-compile-echo-result) Hoping this may help you, Bruno > All the best > > MA > > On Thu, Jan 9, 2025 at 10:23=E2=80=AFPM Bruno Barbier wrote: > >> Marco Antoniotti writes: >> >> > Thanks, I'll check it out. But where is this documented? >> > >> >> It seems that the only documentation is the variable definition itself: >> >> C-h v compilation-exit-message-function >> >> >> Bruno >> > > > --=20 > Marco Antoniotti > Somewhere over the Rainbow