From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lennart Borgman Subject: Re: [Orgmode] Weird behaviour with org-yank and org-startup-indented Date: Wed, 20 Oct 2010 17:37:08 +0200 Message-ID: References: <87bp6vpks7.fsf@keller.adm.naquadah.org> <3B1391C6-72E9-4BAA-9197-7B27B26249BC@gmail.com> <87wrpcdgl0.fsf@stupidchicken.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <87wrpcdgl0.fsf@stupidchicken.com> 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: Chong Yidong Cc: emacs-devel@gnu.org, emacs-orgmode@gnu.org, Carsten Dominik List-Id: emacs-orgmode.gnu.org On Wed, Oct 20, 2010 at 5:33 PM, Chong Yidong wrote= : > 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. =C2=A0Since 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. =C2=A0Anot= her > 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. Another possibility is to protect remove-text-properties from marking the buffer as changed (just as font-lock does).