From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.bugs Subject: bug#38173: describe-variable: Also tell user *where* variable was changed Date: Wed, 13 Nov 2019 12:10:37 +1300 Message-ID: <9a2ece93c5474cdd68e6f7253408dba8@webmail.orcon.net.nz> References: <87pnhxyjxp.8.fsf@jidanni.org> <878solyfr2.8.fsf@jidanni.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="172668"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Orcon Webmail Cc: Katsumi Yamaoka , 38173@debbugs.gnu.org To: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 13 00:11:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iUfJX-000in9-2a for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Nov 2019 00:11:11 +0100 Original-Received: from localhost ([::1]:40348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUfJV-0007II-7C for geb-bug-gnu-emacs@m.gmane.org; Tue, 12 Nov 2019 18:11:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45628) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUfJP-0007IB-Ev for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 18:11:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUfJO-0005fw-FK for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 18:11:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49784) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUfJO-0005fg-CQ for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 18:11:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iUfJO-0000hK-2W for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2019 18:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Nov 2019 23:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38173 X-GNU-PR-Package: emacs Original-Received: via spool by 38173-submit@debbugs.gnu.org id=B38173.15736002452660 (code B ref 38173); Tue, 12 Nov 2019 23:11:02 +0000 Original-Received: (at 38173) by debbugs.gnu.org; 12 Nov 2019 23:10:45 +0000 Original-Received: from localhost ([127.0.0.1]:58605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUfJ6-0000gq-JH for submit@debbugs.gnu.org; Tue, 12 Nov 2019 18:10:44 -0500 Original-Received: from smtp-1.orcon.net.nz ([60.234.4.34]:55867) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iUfJ5-0000gh-0Y for 38173@debbugs.gnu.org; Tue, 12 Nov 2019 18:10:43 -0500 Original-Received: from [10.253.37.70] (port=55122 helo=webmail.orcon.net.nz) by smtp-1.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1iUfIz-0001CJ-Qi; Wed, 13 Nov 2019 12:10:37 +1300 Original-Received: from wlgwil-nat-office.catalyst.net.nz ([202.78.240.7]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Wed, 13 Nov 2019 12:10:37 +1300 In-Reply-To: <878solyfr2.8.fsf@jidanni.org> X-Sender: psainty@orcon.net.nz X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:171477 Archived-At: On 2019-11-12 15:45, 積丹尼 Dan Jacobson wrote: > It's like telling users "you transferred $123 from your bank > account" but not telling users who they transferred it to. That's pretty crucial information for a bank transfer. Not so much for every arbitrary variable change (and I think you'd need to be making an incredible number of bank transactions for the analogy to hold up :) Logging every change of every variable made during the execution of a computer program might carry a noticeable cost, vs the absolutely tiny number of cases where the logged information would ever be inspected, so it's not obvious that this would be worthwhile on the whole? However, since 26.1 you can do this yourself on a case-by-case basis when you wish to investigate some particular situation. See: C-h f add-variable-watcher and remove-variable-watcher, and commands M-x [cancel-]debug-on-variable-change Some extremely basic logging without invoking the debugger might be something like: (defun var-watcher-backtrace (symbol newval operation where) "Used with `add-variable-watcher' to log details to *Messages*." (let ((frames (backtrace-frames))) (message "%S %S %S %S %S" symbol newval operation where (pp-to-string frames)))) (add-variable-watcher 'foo 'var-watcher-backtrace) I suppose the variable watcher mechanism could check another variable to decide whether to do the sort of "global watching" being requested here. Then users could turn the behaviour on if desired. -Phil