From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Steven E. Harris" Subject: Problem with org-yank and delete-selection-mode Date: Sun, 25 Jan 2009 12:00:46 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LR8M1-00070P-Nd for emacs-orgmode@gnu.org; Sun, 25 Jan 2009 12:01:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LR8Ly-0006zW-D0 for emacs-orgmode@gnu.org; Sun, 25 Jan 2009 12:00:59 -0500 Received: from [199.232.76.173] (port=43964 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LR8Ly-0006zH-45 for emacs-orgmode@gnu.org; Sun, 25 Jan 2009 12:00:58 -0500 Received: from main.gmane.org ([80.91.229.2]:53529 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LR8Lx-0008A6-Ct for emacs-orgmode@gnu.org; Sun, 25 Jan 2009 12:00:57 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LR8Lv-00085k-5w for emacs-orgmode@gnu.org; Sun, 25 Jan 2009 17:00:55 +0000 Received: from c-24-131-239-140.hsd1.pa.comcast.net ([24.131.239.140]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Jan 2009 17:00:55 +0000 Received: from seh by c-24-131-239-140.hsd1.pa.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Jan 2009 17:00:55 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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