From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24923: 25.1; Lisp watchpoints Date: Sun, 20 Nov 2016 18:11:43 +0200 Message-ID: <83lgwe9lmo.fsf@gnu.org> References: <87vavun235.fsf@users.sourceforge.net> <83eg2ie3lp.fsf@gnu.org> <87pom1mi3q.fsf@users.sourceforge.net> <83r36hcghy.fsf@gnu.org> <87fumwmc7q.fsf@users.sourceforge.net> <83fumvcs99.fsf@gnu.org> <874m32lx1e.fsf@users.sourceforge.net> <87k2bya0j6.fsf@gmx.net> <87wpfyjl1x.fsf@users.sourceforge.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1479658335 28973 195.159.176.226 (20 Nov 2016 16:12:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 20 Nov 2016 16:12:15 +0000 (UTC) Cc: 24923@debbugs.gnu.org, stephen.berman@gmx.net To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 20 17:12:09 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8Uiu-0006W1-GP for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Nov 2016 17:12:08 +0100 Original-Received: from localhost ([::1]:45380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8Uix-0005ud-UL for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Nov 2016 11:12:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8Uir-0005u1-PX for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2016 11:12:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8Uio-0002kR-I4 for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2016 11:12:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49103) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c8Uio-0002kH-Eq for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2016 11:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c8Uio-0006pK-7y for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2016 11:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Nov 2016 16:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24923 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 24923-submit@debbugs.gnu.org id=B24923.147965830426211 (code B ref 24923); Sun, 20 Nov 2016 16:12:02 +0000 Original-Received: (at 24923) by debbugs.gnu.org; 20 Nov 2016 16:11:44 +0000 Original-Received: from localhost ([127.0.0.1]:36269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8UiW-0006oh-IY for submit@debbugs.gnu.org; Sun, 20 Nov 2016 11:11:44 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51701) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8UiU-0006oP-Ok for 24923@debbugs.gnu.org; Sun, 20 Nov 2016 11:11:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8UiM-0002Yx-AM for 24923@debbugs.gnu.org; Sun, 20 Nov 2016 11:11:37 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:32792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8UiM-0002Yt-6y; Sun, 20 Nov 2016 11:11:34 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1673 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c8UiL-0000s1-FY; Sun, 20 Nov 2016 11:11:33 -0500 In-reply-to: <87wpfyjl1x.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 208.118.235.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:125902 Archived-At: > From: npostavs@users.sourceforge.net > Cc: 24923@debbugs.gnu.org, Eli Zaretskii > Date: Sun, 20 Nov 2016 09:14:02 -0500 > > > There are a few typos in the documentation: > > Thanks, reattaching just the fixed documentation commit. > diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi > index 6c0908a..c047d45 100644 > --- a/doc/lispref/debugging.texi > +++ b/doc/lispref/debugging.texi > @@ -69,6 +69,7 @@ Debugger > * Error Debugging:: Entering the debugger when an error happens. > * Infinite Loops:: Stopping and debugging a program that doesn't exit. > * Function Debugging:: Entering it when a certain function is called. > +* Variable Debugging:: Entering it when a variable is modified. This additional menu item should be also added to the master menu in elisp.texi. > +@deffn Command debug-on-variable-change variable > +This function arranges for the debugger to be called whenever > +@var{variable} is modified. > + > +It is implemented using the watchpoint mechanism, so it inherits the > +same characteristics and limitations: all aliases of @var{variable} > +will be watched together, only dynamic variables can be watched, and > +changes to the objects referenced by variables are not detected. For > +details, see @xref{Watching Variables}. ^^^^^ @xref already generates "See", capitalized, so you want @ref here. > diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi > index 418a416..1e0b098 100644 > --- a/doc/lispref/variables.texi > +++ b/doc/lispref/variables.texi > @@ -34,6 +34,7 @@ Variables > * Accessing Variables:: Examining values of variables whose names > are known only at run time. > * Setting Variables:: Storing new values in variables. > +* Watching Variables:: Running a function when a variable is changed. Likewise, this should be added to the master menu. > +@node Watching Variables > +@section Running a function when a variable is changed. > +@cindex variable watchpoints I'd add here an index entry that begins with "watchpoint", like this: @cindex watchpoints for Lisp variables That's for those who like using completion in Info-index command. > +variable settings, and invoking the debugger to track down unexpected > +changes to variables @pxref{Variable Debugging}. I believe you meant to put @pxref in parentheses. > +Each variable has a list of watch functions stored in its > +@code{watchers} symbol property, @xref{Symbol Properties}. ^^^^^ Either "see @ref" or "@pxref", because @xref generates a capitalized "See", and so is only appropriate at the beginning of a sentence. > +@defun add-variable-watcher symbol watch-function > +This function arranges for @var{watch-function} to be called whenever > +@var{symbol} (or any of its aliases @pxref{Variable Aliases}) are ^ > +modified. A comma is missing here. Also, I believe "is modified" reads better here. Or maybe replace the parentheses with commas, then plural should be okay, I think. > +@defun get-variable-watchers symbol > +This function returns the list of active watcher functions. Please mention SYMBOL here. Thanks.