From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Problem with org-yank and delete-selection-mode Date: Sun, 25 Jan 2009 18:38:38 +0100 Message-ID: <7B1F5D93-6399-4748-BB15-AC9CF010F7A8@uva.nl> References: Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LR8wX-00056F-FV for emacs-orgmode@gnu.org; Sun, 25 Jan 2009 12:38:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LR8wW-00055e-F3 for emacs-orgmode@gnu.org; Sun, 25 Jan 2009 12:38:44 -0500 Received: from [199.232.76.173] (port=35349 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LR8wW-00055X-Af for emacs-orgmode@gnu.org; Sun, 25 Jan 2009 12:38:44 -0500 Received: from ug-out-1314.google.com ([66.249.92.170]:55854) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LR8wV-0004bz-S5 for emacs-orgmode@gnu.org; Sun, 25 Jan 2009 12:38:44 -0500 Received: by ug-out-1314.google.com with SMTP id 36so133975uga.17 for ; Sun, 25 Jan 2009 09:38:42 -0800 (PST) In-Reply-To: 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: "Steven E. Harris" Cc: emacs-orgmode@gnu.org Hi Steven, this code belongs into org.el, where similar statements are already present for a couple of other functions: ;; Make `delete-selection-mode' work with org-mode and orgtbl-mode (put 'org-self-insert-command 'delete-selection t) (put 'orgtbl-self-insert-command 'delete-selection t) (put 'org-delete-char 'delete-selection 'supersede) (put 'org-delete-backward-char 'delete-selection 'supersede) I have added your line, thanks. - Carsten On Jan 25, 2009, at 6:00 PM, Steven E. Harris wrote: > 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 > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode