From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#29373: 24.5; doc string of `self-insert-uses-region-functions' Date: Mon, 20 Nov 2017 18:56:15 -0800 (PST) Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1511233033 2307 195.159.176.226 (21 Nov 2017 02:57:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 21 Nov 2017 02:57:13 +0000 (UTC) To: 29373@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 21 03:57:09 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 1eGykG-0008Rn-Gc for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Nov 2017 03:57:08 +0100 Original-Received: from localhost ([::1]:60684 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGykI-0001vQ-MK for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Nov 2017 21:57:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGykD-0001vJ-8m for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 21:57:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGykA-0005rU-7J for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 21:57:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41058) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGykA-0005rD-4G for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 21:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eGyk9-0006Pg-PZ for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 21:57:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Nov 2017 02:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29373 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.151123299624617 (code B ref -1); Tue, 21 Nov 2017 02:57:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Nov 2017 02:56:36 +0000 Original-Received: from localhost ([127.0.0.1]:49739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGyjj-0006Oz-PM for submit@debbugs.gnu.org; Mon, 20 Nov 2017 21:56:36 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:45673) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGyjh-0006Ok-W9 for submit@debbugs.gnu.org; Mon, 20 Nov 2017 21:56:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGyjb-0005lz-Qb for submit@debbugs.gnu.org; Mon, 20 Nov 2017 21:56:28 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:50570) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eGyjb-0005lZ-Mp for submit@debbugs.gnu.org; Mon, 20 Nov 2017 21:56:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGyja-0001Ts-Ak for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 21:56:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGyjX-0005ka-8m for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 21:56:26 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:37695) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eGyjX-0005k5-0t for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 21:56:23 -0500 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vAL2uKRZ009740 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 21 Nov 2017 02:56:21 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id vAL2uK9w019714 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 21 Nov 2017 02:56:20 GMT Original-Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vAL2uGcZ014966 for ; Tue, 21 Nov 2017 02:56:20 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4615.0 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:140186 Archived-At: Two lines of the doc string are too long. The doc string is close to incomprehensible. 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-mod= e' 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? Is this ONLY about `delete-selection-mode'? If not, what else is it for? 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. 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. 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. 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. Looking at the uses in the Emacs code, the aim seems to be only to prevent deletion of the region by `delete-selection-mode' before `self-insert-command' does its thing. Whether `self-insert-command' "uses" the region or "consumes" it, or even deletes it or ignores it, is irrelevant, AFAICT. All that matters is that this gives you a way to decide conditionally whether `delete-selection-mode' deletes the region on its pre-hook. In GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D/c/usr --host=3Di686-pc-mingw32'