From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dan Jacobson Newsgroups: gmane.emacs.bugs Subject: bug#70531: insert timestamps and serial numbers along with \f\n in error-file Date: Tue, 23 Apr 2024 18:11:37 +0800 Message-ID: <87le54bd7q.n.fsf@jidanni.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23468"; mail-complaints-to="usenet@ciao.gmane.io" To: 70531@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 23 12:13:08 2024 Return-path: Envelope-to: geb-bug-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 1rzD99-0005pU-94 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Apr 2024 12:13:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzD8r-0004Hz-Pd; Tue, 23 Apr 2024 06:12:49 -0400 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 1rzD8p-0004He-Pj for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2024 06:12:47 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzD8p-0007c9-GD for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2024 06:12:47 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rzD95-0004hX-RC for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2024 06:13:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dan Jacobson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Apr 2024 10:13:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70531 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.171386713417482 (code B ref -1); Tue, 23 Apr 2024 10:13:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Apr 2024 10:12:14 +0000 Original-Received: from localhost ([127.0.0.1]:51201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzD8G-0004Xi-Q5 for submit@debbugs.gnu.org; Tue, 23 Apr 2024 06:12:13 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:47988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzD8D-0004W0-II for submit@debbugs.gnu.org; Tue, 23 Apr 2024 06:12:10 -0400 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 1rzD7r-0004Cs-N8 for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2024 06:11:47 -0400 Original-Received: from iguana.tulip.relay.mailchannels.net ([23.83.218.253]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzD7p-0007Yt-Hu for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2024 06:11:47 -0400 X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id D05025C1DBC for ; Tue, 23 Apr 2024 10:11:42 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a258.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 6B2705C1D55 for ; Tue, 23 Apr 2024 10:11:42 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1713867102; a=rsa-sha256; cv=none; b=NDSlQlSNaK38DGIg5VYg7pmy78n77WkDJ2NebEcRSBZ3EfKdpAoku1JUg1klb6Dnw2NvKk j38EHj4NcXsJwFA8eITB5nX8bj2kExJhyEsWQzAaJpIHM6xDjoFG81rmF3RcWy4By7tsfO Z4pdxPJsI4AIFxlVAT6xB7Gn8f2lExKtilvyFtuiBfbO7WlCAtfidMbLEB9wXTQjBa+iAZ RQUw/3mYl+OPeyh9XLibfxe/KfHsjbQl/l199GNa2/1KPS0iYmJGCDWIo8DIdLlggpkNLK QCjK00w4jwvSVbzGoQhpyQBWUGGlUjpXdPcLNRuVzQvBwgPXr7TZNGlLkukFDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1713867102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=YWADl80KbeFTCYXMsiJ9WcZ/4ZUfrdoFeXuKEEAC660=; b=YEFYnZ5q1k9VGp3scVMVTFyOGb4xcVgVQiheOrHexu/XNgmvuIGFaS5zRtG2uueyyv/O+a v2Q2qhHXNzBzNKzn9s8u0XmG0i+S4F/ud5Q6jWLr+f3mUcg/bdyhwiBS93dHI+LVAnsW45 RhW+Ap6DBI06G/ad2V5oQIAPPqu0Duix/kY4cfR2U2d1SNhlDjWu4rsec6DTVb5CFgaU9f M28CVqVm3GriYh6EN8AMkL7byIJlBLNGKNrfCUyuKySsdYD/h38IfL1OWawVUjN19u0hYx hLmfd6FTsDiiyV9UA5+CRKHIq1YzJ+kqGCYaW8NYN8BumEIdaXbuEL4tSAL6Rw== ARC-Authentication-Results: i=1; rspamd-796b8f565b-fz6tr; auth=pass smtp.auth=dreamhost smtp.mailfrom=jidanni@jidanni.org X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jidanni@jidanni.org X-MailChannels-Auth-Id: dreamhost X-Cold-Imminent: 30d5edf26b789220_1713867102673_3211557914 X-MC-Loop-Signature: 1713867102673:1965732406 X-MC-Ingress-Time: 1713867102673 Original-Received: from pdx1-sub0-mail-a258.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.102.9.179 (trex/6.9.2); Tue, 23 Apr 2024 10:11:42 +0000 Original-Received: from jidanni.org (114-41-23-16.dynamic-ip.hinet.net [114.41.23.16]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jidanni@jidanni.org) by pdx1-sub0-mail-a258.dreamhost.com (Postfix) with ESMTPSA id 4VNyZk1jMkzHc for ; Tue, 23 Apr 2024 03:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jidanni.org; s=dreamhost; t=1713867102; bh=YWADl80KbeFTCYXMsiJ9WcZ/4ZUfrdoFeXuKEEAC660=; h=From:To:Subject:Date:Content-Type:Content-Transfer-Encoding; b=UHkG+jH+qqmtrcUtAw7Vl+xkAZOo/FTbqIi+yW7gJ+3eTlcX8viYxbgnYsSScteB9 t2ZbjhHxjediceIiVhX5/N+vS9KB8xba/Gy1yHY+eoqJosALYCD0gN3ua6W1KbYY3k Avirz5JfTu5jl79c3FwPQV/wwnnYw7l1yM5Su6CMSRusYtrhY44lR6KV5pnBvEJHc8 YvgOO+BHY8EuGz9RuJAAk8nVhh68PpJmA7c/SkGvQiwpeXPJxHkGr9AenarzbDRpKj 6YYXfNDbKeDVADwRPl+tnqV/WV2Om5k7Pc9O7xn+HKD2p6D9zx+h3LLIvPXDKJA6T1 lT0IxjP5jBsiw== Received-SPF: pass client-ip=23.83.218.253; envelope-from=jidanni@jidanni.org; helo=iguana.tulip.relay.mailchannels.net 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283879 Archived-At: shell-command-on-region is an interactive native-compiled Lisp function in ‘simple.el’. In it there is this code: (when (and error-file (file-exists-p error-file)) (if (< 0 (file-attribute-size (file-attributes error-file))) (with-current-buffer (get-buffer-create error-buffer) (goto-char (point-max)) ;; Insert a separator if there's already text here. (unless (bobp) (insert "\f\n")) Problem is the user cannot tell which stuff, the stuff above the \f\n, or the stuff below the \f\n is newer! You might think that after a few years the user will figure it out and remember it. But the user also worries "maybe where the message gets inserted also depends which part of the error buffer I was looking at last moments before." even if not the case. All this could be cleared up, if along with inserting the \f\n, a timestamp were inserted. Or at least a serial number: \f\nError group 1: \f\nError group 2: etc. Best of all would be to use both a timestamp and a serial number. In fact (insert "\f\n") makes a heavy assumption that the user usually doesn't have any \f's of their own in that file. But it is a bad thing to have it hardwired in the first place, requiring the user to change the entire function in order to choose a different separator. So maybe have it a variable, set to \f\n by default, or better something like ("\f\n" . some-counter . some-time-stamp . "\n"). emacs-version "29.3"