unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: 29373-done@debbugs.gnu.org
Subject: bug#29373: 24.5; doc string of `self-insert-uses-region-functions'
Date: Fri, 24 Nov 2017 12:50:42 +0200	[thread overview]
Message-ID: <83h8tk9chp.fsf@gnu.org> (raw)
In-Reply-To: <d8b52361-9340-4a18-b2fd-557c78c382d7@default> (message from Drew Adams on Mon, 20 Nov 2017 18:56:15 -0800 (PST))

> Date: Mon, 20 Nov 2017 18:56:15 -0800 (PST)
> From: Drew Adams <drew.adams@oracle.com>
> 
> 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.





  reply	other threads:[~2017-11-24 10:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21  2:56 bug#29373: 24.5; doc string of `self-insert-uses-region-functions' Drew Adams
2017-11-24 10:50 ` Eli Zaretskii [this message]
     [not found] <<d8b52361-9340-4a18-b2fd-557c78c382d7@default>
     [not found] ` <<83h8tk9chp.fsf@gnu.org>
2017-11-24 16:43   ` Drew Adams
2017-11-24 17:07     ` Eli Zaretskii
     [not found] <<<d8b52361-9340-4a18-b2fd-557c78c382d7@default>
     [not found] ` <<<83h8tk9chp.fsf@gnu.org>
     [not found]   ` <<86584c33-6e52-4cf5-8e22-bb9952b296b2@default>
     [not found]     ` <<83y3mv8v1r.fsf@gnu.org>
2017-11-24 17:33       ` Drew Adams
2017-11-25 23:56         ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83h8tk9chp.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=29373-done@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).