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#29373: 24.5; doc string of `self-insert-uses-region-functions' Date: Fri, 24 Nov 2017 12:50:42 +0200 Message-ID: <83h8tk9chp.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1511520734 20766 195.159.176.226 (24 Nov 2017 10:52:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 24 Nov 2017 10:52:14 +0000 (UTC) Cc: 29373-done@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 24 11:52:06 2017 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 1eIBaX-0004qo-PF for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Nov 2017 11:52:05 +0100 Original-Received: from localhost ([::1]:48462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIBaf-0000Bp-6w for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Nov 2017 05:52:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIBaX-0008To-Ok for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2017 05:52:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eIBaU-0008Jt-6I for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2017 05:52:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46069) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eIBaU-0008Jj-3S for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2017 05:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eIBaT-00085p-RX for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2017 05:52:01 -0500 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Nov 2017 10:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 29373 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 29373@debbugs.gnu.org, eliz@gnu.org, drew.adams@oracle.com Original-Received: via spool by 29373-done@debbugs.gnu.org id=D29373.151152067531046 (code D ref 29373); Fri, 24 Nov 2017 10:52:01 +0000 Original-Received: (at 29373-done) by debbugs.gnu.org; 24 Nov 2017 10:51:15 +0000 Original-Received: from localhost ([127.0.0.1]:54749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eIBZj-00084g-1K for submit@debbugs.gnu.org; Fri, 24 Nov 2017 05:51:15 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eIBZh-00084R-2x for 29373-done@debbugs.gnu.org; Fri, 24 Nov 2017 05:51:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eIBZW-0007ey-85 for 29373-done@debbugs.gnu.org; Fri, 24 Nov 2017 05:51:08 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIBZW-0007eu-4W; Fri, 24 Nov 2017 05:51:02 -0500 Original-Received: from [176.228.60.248] (port=2829 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eIBZV-0000c4-Hy; Fri, 24 Nov 2017 05:51:01 -0500 In-reply-to: (message from Drew Adams on Mon, 20 Nov 2017 18:56:15 -0800 (PST)) 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:140299 Archived-At: > Date: Mon, 20 Nov 2017 18:56:15 -0800 (PST) > From: Drew Adams > > Two lines of the doc string are too long. Longer than 79 characters? I didn't find any such lines. > The doc string is close to incomprehensible. Such derogatory remarks are best kept out of bug reports. The facts are grave enough to tell we should fix this. > Special hook to tell if `self-insert-command' will use the region. > It must be called via `run-hook-with-args-until-success' with no arguments. > Any `post-self-insert-command' which consumes the region should > register a function on this hook so that things like `delete-selection-mode' > can refrain from consuming the region. > > HOW does this hook "tell if `self-insert-command' will use the region"? > What does a function on this hook need to do or return, to tell that? > And what does it mean for `self-insert-command' to "use the region"? > > What does "any `post-self-insert-command'" even mean? What is meant by > "consumes the region"? Does "consume" mean the same thing in each > occurrence here? What is meant by "registering" a function on a hook? post-self-insert-command really meant to refer to post-self-insert-hook. > A guess is that this is just a way to conditionalize the treatment of > `self-insert-command' by `delete-selection-mode'. In some mode > (`electric-pair-mode'), you want to use a certain function as the value > of property `delete-selection' for symbol `self-insert-command'. > > If so, then things would likely be clearer if that was said. I clarified that. > In that case, it needs to be understood that `delete-selection-mode' > checks the value of property `delete-selection' on > `self-insert-command', and if that value is nil or is a function that > returns nil then `delete-selection-mode' does nothing. The first part was already in delsel.el. I made clear that self-insert-command uses this hook via delete-selection-uses-region-p. > Say that, together with the fact that the function value of property > `delete-selection-mode' for `self-insert-command' runs the hook > functions in order, returning nil if any of them returns non-nil. This is the usual behavior of run-hook-with-args-until-success. > So a function on the hook should return non-nil when its aim is to > prevent deletion of the region by `self-insert-command'. Say that. Done.