emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Steven E. Harris" <seh@panix.com>
To: emacs-orgmode@gnu.org
Subject: Problem with org-yank and delete-selection-mode
Date: Sun, 25 Jan 2009 12:00:46 -0500	[thread overview]
Message-ID: <u8wozgw1t.fsf@torus.sehlabs.com> (raw)

It's taken my a couple of months of running into this flaw to finally
stop and figure out what's wrong. I use either pending-delete-mode or
delete-selection-mode, depending on Emacs flavor, such that the
selected region gets deleted or replaced by a subsequent kill or yank
command. There's a strange interaction with yanking in org-mode, though,
where the yanked text gets inserted /before/ the delimited region
(assuming the point is before the mark) and the delimited text just gets
pushed out past the yanked text, as opposed to being /replaced/ by it.

Reading the header for delsel.el, I found documentation that requires
functions that delete, kill, or yank to exhibit a property
(`delete-selection') in order to work correctly with
delete-selection-mode. I found the following did the trick to get
org-yank to behave as expected:

,----
| (put 'org-yank 'delete-selection 'yank)
`----

It's not clear where such a definition belongs; delete-selection-mode
doesn't know about org-mode, and org-mode may not known about
delete-selection-mode. Should this fall to user-level customization?

-- 
Steven E. Harris

             reply	other threads:[~2009-01-25 17:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-25 17:00 Steven E. Harris [this message]
2009-01-25 17:38 ` Problem with org-yank and delete-selection-mode Carsten Dominik
2009-01-25 17:44   ` Steven E. Harris

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.orgmode.org/

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

  git send-email \
    --in-reply-to=u8wozgw1t.fsf@torus.sehlabs.com \
    --to=seh@panix.com \
    --cc=emacs-orgmode@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).