From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Carsten Dominik Newsgroups: gmane.emacs.orgmode,gmane.emacs.devel Subject: Re: Weird behaviour with org-yank and org-startup-indented Date: Thu, 21 Oct 2010 19:38:23 +0200 Message-ID: <9948E9DE-A91D-41D8-A480-0C292B1199A3@gmail.com> References: <87bp6vpks7.fsf@keller.adm.naquadah.org> <3B1391C6-72E9-4BAA-9197-7B27B26249BC@gmail.com> <87wrpcdgl0.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1287684024 20791 80.91.229.12 (21 Oct 2010 18:00:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 21 Oct 2010 18:00:24 +0000 (UTC) Cc: Julien Danjou , Org Mode , Stefan Monnier , Emacs developers To: Chong Yidong Original-X-From: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Thu Oct 21 20:00:21 2010 Return-path: Envelope-to: geo-emacs-orgmode@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P8zR7-0000dP-1g for geo-emacs-orgmode@m.gmane.org; Thu, 21 Oct 2010 20:00:21 +0200 Original-Received: from localhost ([127.0.0.1]:57849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8zR5-00022c-ER for geo-emacs-orgmode@m.gmane.org; Thu, 21 Oct 2010 14:00:19 -0400 Original-Received: from [140.186.70.92] (port=43031 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8z65-0000oy-Q7 for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 13:38:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8z63-00069V-FO for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 13:38:37 -0400 Original-Received: from mail-ey0-f169.google.com ([209.85.215.169]:55390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8z63-00063U-5X; Thu, 21 Oct 2010 13:38:35 -0400 Original-Received: by mail-ey0-f169.google.com with SMTP id d26so263796eyd.0 for ; Thu, 21 Oct 2010 10:38:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=Tu1EY1LNKCgPNus4vupAEfcUEJqZrHz3R64aPYsDn1U=; b=Bkd4do7SO29bnbsUkFr/rFFJvN1eiQIoraXOk4b1lrvPxNixs5sKV41VIDA/SrpNA4 2KdgLFvhsmlu3CwcRn4DEjaffp7x2ifl6xghvIz68mICMnUnC9hyhzE8Dr56RBRLnCMT 4ifM7/8x+c2JGjH3cLx4iC0mF7QNOi6bDKyIY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=XKdolWAwL38WX5+UT68nb6u5w+gh2K8FIStkIIUSft/XbcgsIjCOy8/us7RXsZ8e6E 42WOPCAewHMIlxDcLTh4+l6qegHNkSlAo7wmIBEEoAso339LC26yqGmoqmzQvsqywkd5 z/GUBb2mBqYHmkm51u0XZmK4Xx5hT1D09+dcw= Original-Received: by 10.213.112.212 with SMTP id x20mr4862885ebp.82.1287682714694; Thu, 21 Oct 2010 10:38:34 -0700 (PDT) Original-Received: from [192.168.1.12] (dc5146846e.adsl.wanadoo.nl [81.70.132.110]) by mx.google.com with ESMTPS id q51sm2053876eeh.16.2010.10.21.10.38.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 21 Oct 2010 10:38:33 -0700 (PDT) In-Reply-To: <87wrpcdgl0.fsf@stupidchicken.com> X-Mailer: Apple Mail (2.936) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-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 Xref: news.gmane.org gmane.emacs.orgmode:32286 gmane.emacs.devel:131941 Archived-At: On 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. 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. Ah, this is interesting, thank you very much! > > 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. I'll go with Stefan's solution, using with-silent-modifications. I had already code that would restore buffer-modified-flag, but apparently this was not enough. Thanks! - Carsten _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Weird behaviour with org-yank and org-startup-indented Date: Thu, 21 Oct 2010 19:38:23 +0200 Message-ID: <9948E9DE-A91D-41D8-A480-0C292B1199A3@gmail.com> References: <87bp6vpks7.fsf@keller.adm.naquadah.org> <3B1391C6-72E9-4BAA-9197-7B27B26249BC@gmail.com> <87wrpcdgl0.fsf@stupidchicken.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=43031 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8z65-0000oy-Q7 for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 13:38:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8z63-00069V-FO for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 13:38:37 -0400 In-Reply-To: <87wrpcdgl0.fsf@stupidchicken.com> 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: Chong Yidong Cc: Julien Danjou , Org Mode , Stefan Monnier , Emacs developers On 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. 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. Ah, this is interesting, thank you very much! > > 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. I'll go with Stefan's solution, using with-silent-modifications. I had already code that would restore buffer-modified-flag, but apparently this was not enough. Thanks! - Carsten