From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chong Yidong Subject: Re: [Orgmode] Weird behaviour with org-yank and org-startup-indented Date: Wed, 20 Oct 2010 11:33:31 -0400 Message-ID: <87wrpcdgl0.fsf@stupidchicken.com> References: <87bp6vpks7.fsf@keller.adm.naquadah.org> <3B1391C6-72E9-4BAA-9197-7B27B26249BC@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: (Julien Danjou's message of "Wed, 20 Oct 2010 14:31:09 +0200") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org, emacs-devel@gnu.org List-Id: emacs-orgmode.gnu.org Julien Danjou writes: > In a Org buffer with org-startup-indented set to t, type: > > ** TODO abcdefgh > > Go on `c', activate mark press C-e, press M-w (kill-ring-save). > [Wrong primary selection appears] The problem is in org-indent-refresh-section, which is run from a timer. This function first moves point and then calls remove-text-properties, which is considered a buffer change. Since the mark is active, the selection code saves the region to saved-region-selection, from which it is later saved to the primary selection. There are a few possible fixes, but I am yet not sure which is best. One is to avoid setting saved-region-selection inside a timer. Another is for save-excursion to inhibit writing to saved-region-selection; a third is not to treat remove-text-properties as a trigger for saving the primary selection.