all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: Property for treating a string as a single character when deleting
Date: Mon, 11 Aug 2014 23:29:10 +0200	[thread overview]
Message-ID: <877g2esok9.fsf@debian.uxu> (raw)
In-Reply-To: mailman.6973.1407769404.1147.help-gnu-emacs@gnu.org

Tom <adatgyujto@gmail.com> writes:

> Is there a property or some other way to treat a
> string as a single character? I know I can add the
> intangible property and then cursor movements jumps
> over the string like its a single character. Is there
> a property for making the string behave like this for
> deletion too? So, for example, when I backspace at
> the rightmost character of the string then the whole
> string is deleted at once like it's a single
> character.

You mean like `backward-kill-word', which I have (and
probably you to) at M-DEL - do you want this encoded in
the text so that you don't have to hit Meta, just DEL?
Is that really worth doing? And for what mode? If this
is what you want to do, and you really want it, I think
you would have to locally rebind the DEL key to a
defun; the defun will then do `backward-word', then
`thing-at-point' (or some other combo to that extent),
then examine the properties, and determine if your
special mark is there, if so, the whole thing would be
deleted, if not, the DEL would just do
delete-backward-char as usual. Or, if you don't insist
on the "property method", you could have DEL react to
the char to be deleted - if it is a string delimiter,
search for the corresponding delimiter - if there is a
hit, ... and so on. This all seem like a lot of work
for a really slim gain - and I'm not even sure there is
a gain, because perhaps you'll start "deleting" other
things that way, and expect the whole thing to be
killed, only it won't. I can only speak (for) my mind,
and that would be confused by this. M-DEL is such a
close and comfortable and ingrained way - why not just
use it?

-- 
underground experts united


       reply	other threads:[~2014-08-11 21:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.6973.1407769404.1147.help-gnu-emacs@gnu.org>
2014-08-11 21:29 ` Emanuel Berg [this message]
2014-08-12  3:33 ` Property for treating a string as a single character when deleting Pascal J. Bourguignon
2014-08-11 15:02 Tom
2014-08-12  2:16 ` Stefan Monnier

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=877g2esok9.fsf@debian.uxu \
    --to=embe8573@student.uu.se \
    --cc=help-gnu-emacs@gnu.org \
    /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.