all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Alan Mackenzie <acm@muc.de>
Cc: "N. Jackson" <nljlistbox2@gmail.com>, 21275@debbugs.gnu.org
Subject: bug#21275: 24.5; Selection deleted with electric pair mode in cc mode
Date: Wed, 19 Aug 2015 17:52:18 -0400	[thread overview]
Message-ID: <jwv37zfosr4.fsf-monnier+emacsbugs__29961.7034419954$1440105007$gmane$org@gnu.org> (raw)
In-Reply-To: <20150818150431.42639.qmail@mail.muc.de> (Alan Mackenzie's message of "18 Aug 2015 15:04:31 -0000")

> +(defun delete-selection-uses-region-p ()

The way I read it, this name says "a function which tells us if
delete-selection uses the region".

> +  "Return non-nil when the current command uses the region.

It's not about "the current command" but about self-insert-command
(which may be the current command or may be called by the current command).

> +(put 'c-electric-brace 'delete-selection 'delete-selection-uses-region-p)
> +(put 'c-electric-brace 'pending-delete 't)
> +(put 'c-electric-paren 'delete-selection 'delete-selection-uses-region-p)
> +(put 'c-electric-paren 'pending-delete 't)

An alternative would be to copy the `delete-selection' (and
`pending-delete') property of `self-insert-command'.  Probably in an
after-load, tho.


        Stefan





  parent reply	other threads:[~2015-08-19 21:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-16 13:31 bug#21275: 24.5; Selection deleted with electric pair mode in cc mode N. Jackson
     [not found] ` <mailman.8417.1439731993.904.bug-gnu-emacs@gnu.org>
2015-08-18 15:04   ` Alan Mackenzie
2015-08-18 16:43     ` N. Jackson
2015-08-19 21:52     ` Stefan Monnier [this message]
     [not found]     ` <jwv37zfosr4.fsf-monnier+emacsbugs@gnu.org>
2015-08-20 21:35       ` Drew Adams
2015-08-20 21:55         ` Alan Mackenzie
2015-08-21  5:46           ` Drew Adams
2015-08-21 13:42             ` Stefan Monnier
2015-08-21 15:01               ` Drew Adams
2015-08-19 17:22   ` Alan Mackenzie

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

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

  git send-email \
    --in-reply-to='jwv37zfosr4.fsf-monnier+emacsbugs__29961.7034419954$1440105007$gmane$org@gnu.org' \
    --to=monnier@iro.umontreal.ca \
    --cc=21275@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=nljlistbox2@gmail.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.