From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master c5e89be: On C-y, stop some text property entries being written into buffer-undo-list Date: Wed, 22 Apr 2015 10:34:20 -0400 Message-ID: References: <20150422095031.27238.96994@vcs.savannah.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1429713292 17674 80.91.229.3 (22 Apr 2015 14:34:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Apr 2015 14:34:52 +0000 (UTC) Cc: Alan Mackenzie To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 22 16:34:43 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ykvjf-00027X-4H for ged-emacs-devel@m.gmane.org; Wed, 22 Apr 2015 16:34:43 +0200 Original-Received: from localhost ([::1]:35541 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ykvje-0005OG-9E for ged-emacs-devel@m.gmane.org; Wed, 22 Apr 2015 10:34:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkvjO-0005O9-JL for emacs-devel@gnu.org; Wed, 22 Apr 2015 10:34:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkvjK-0006mu-GM for emacs-devel@gnu.org; Wed, 22 Apr 2015 10:34:26 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:48562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkvjK-0006mi-CK for emacs-devel@gnu.org; Wed, 22 Apr 2015 10:34:22 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t3MEYKNP000901; Wed, 22 Apr 2015 10:34:20 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 121DF33E7; Wed, 22 Apr 2015 10:34:20 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Wed, 22 Apr 2015 09:50:31 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5284=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5284> : inlines <2775> : streams <1426747> : uri <1913052> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:185781 Archived-At: > + (with-silent-modifications > + (let ((inhibit-read-only t)) > + (dolist (handler yank-handled-properties) > + (let ((prop (car handler)) > + (fun (cdr handler)) > + (run-start start)) > + (while (< run-start end) > + (let ((value (get-text-property run-start prop)) > + (run-end (next-single-property-change > + run-start prop nil end))) > + (funcall fun value run-start run-end) Running the hook functions within with-silent-modifications sounds dangerous since they may make modifications which shouldn't be ignored (only the hooks can know). > + (if (eq yank-excluded-properties t) > + (set-text-properties start end nil) > + (remove-list-of-text-properties start end yank-excluded-properties))))) This is the part that needs to be wrapped. Stefan