From: Simon Law <sfllaw@sfllaw.ca>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Chong Yidong <cyd@gnu.org>, 11520-done@debbugs.gnu.org
Subject: bug#11520: 24.1.50; delete-selection-mode conflicts with electric-pair-mode
Date: Mon, 22 Oct 2012 21:07:15 -0400 [thread overview]
Message-ID: <CABMJL3+5Zn1DDnMsY9VVbCEhE2DMMbdfnDJtnFdb8rsbzn+Lpw@mail.gmail.com> (raw)
In-Reply-To: <jwvbofvxklv.fsf-monnier+emacs@gnu.org>
On Mon, Oct 22, 2012 at 8:46 AM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> Attached is a patch against trunk.
>
> Thanks, I really appreciate the addition of docstrings.
> it's got a few cosmetic problems, so I've installed it and then
> installed a subsequent patch on top of it.
>
> Here are the issues I noticed:
> - a hook is a symbol whose value contains a list of functions (modulo
> a few subtleties). The functions themselves are not hooks.
> E.g. delete-selection-pre-hook is not a hook, just a function that's
> typically added on a particular hook.
Yeah, I wasn't sure about delete-selection-pre-hook, but that's what
the function was already called, so I wasn't going to change the API
there.
> And the symbol symbol is named with "-hook" (rather than with
> "-hooks") for normal hooks and "-functions" for abnormal hooks.
Ah, I read that it was either one or the other in
http://www.gnu.org/software/emacs/manual/html_node/elisp/Hooks.html.
Perhaps that documentation should discourage the -hooks convention?
> - symbols in docstrings are written `foo' rather than 'foo.
In delete-selection-helper, you mean? Yes, that appears to be a
copy-paste error.
> - docstrings normally don't end with a line-separator (i.e. the closing
> " should not be on its own line).
Whoops. Thanks for catching that.
> - there's no self-insert-iso in Emacs, so I'd rather not touch it.
delete-selection-mode.el used to touch self-insert-iso, as does
cua-rect.el. Is this something to clean up, or is there something I'm
missing?
> - use the imperative for the first line of a docstring.
Will do.
> - `keep' is not a value handled specially by delete-selection-helper,
> so it is handled as a hook, luckily there's no function on this hook
> (an unbound symbol is treated by `run-hook' as a symbol bound to nil)
> so it ends up behaving like nil, which is indeed what we need; so the
> end behavior is correct, but only "by accident".
Gosh, I don't know how that snuck in there. That was a think-o.
Finally, I noticed that you created self-insert-uses-region-functions,
but there is no defvar or docstring for that. For future reference, is
it normal that packages have hidden hooks like that?
Thanks for the cleanup!
--
Cheers,
Simon - http://ca.linkedin.com/in/sfllaw/
next prev parent reply other threads:[~2012-10-23 1:07 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-19 20:07 bug#11520: 24.1.50; delete-selection-mode conflicts with electric-pair-mode Simon Law
2012-05-19 22:41 ` bug#11520: Workaround Simon Law
2012-05-20 14:54 ` bug#11520: 24.1.50; delete-selection-mode conflicts with electric-pair-mode Stefan Monnier
2012-05-20 16:31 ` Drew Adams
2012-05-21 4:19 ` Simon Law
2012-06-11 21:24 ` Simon Law
2012-07-14 5:23 ` Chong Yidong
2012-07-14 6:42 ` Simon Law
2012-07-15 14:39 ` Chong Yidong
2012-07-15 16:33 ` Simon Law
2012-07-18 12:13 ` Stefan Monnier
2012-07-18 13:55 ` Drew Adams
2012-10-08 22:25 ` Stefan Monnier
2012-10-21 23:12 ` Simon Law
2012-10-22 12:46 ` Stefan Monnier
2012-10-23 1:07 ` Simon Law [this message]
2012-10-23 15:10 ` Stefan Monnier
[not found] ` <b47bddfc-e35c-4ab2-8f4f-3e0a51bec33c@default>
2014-08-18 15:21 ` Stefan Monnier
[not found] ` <<jwvboft8hsz.fsf-monnier+emacs@gnu.org>
2014-07-24 17:34 ` Drew Adams
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=CABMJL3+5Zn1DDnMsY9VVbCEhE2DMMbdfnDJtnFdb8rsbzn+Lpw@mail.gmail.com \
--to=sfllaw@sfllaw.ca \
--cc=11520-done@debbugs.gnu.org \
--cc=cyd@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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).