From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Shmakov Newsgroups: gmane.emacs.bugs Subject: bug#18246: enriched-encode: should set inhibit-point-motion-hooks, too Date: Mon, 11 Aug 2014 12:09:27 +0000 Message-ID: <87sil3qlc8.fsf@violet.siamics.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1407759019 27936 80.91.229.3 (11 Aug 2014 12:10:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Aug 2014 12:10:19 +0000 (UTC) To: 18246@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 11 14:10:14 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1XGoQY-0002dS-JP for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Aug 2014 14:10:14 +0200 Original-Received: from localhost ([::1]:35418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGoQY-0008Ui-0N for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Aug 2014 08:10:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGoQR-0008Ro-CL for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2014 08:10:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGoQN-0004jQ-3a for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2014 08:10:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGoQM-0004iq-RY for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2014 08:10:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XGoQM-00010z-6P for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2014 08:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Shmakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Aug 2014 12:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18246 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: submit@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14077589963884 (code B ref -1); Mon, 11 Aug 2014 12:10:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Aug 2014 12:09:56 +0000 Original-Received: from localhost ([127.0.0.1]:38697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGoQC-00010V-Kn for submit@debbugs.gnu.org; Mon, 11 Aug 2014 08:09:56 -0400 Original-Received: from fely.am-1.org ([78.47.74.50]:50178) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGoQ9-00010M-Go for submit@debbugs.gnu.org; Mon, 11 Aug 2014 08:09:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net; s=a2013295; h=Content-Type:MIME-Version:Message-ID:Date:Sender:Subject:To:From; bh=mtpXjEeGtYrS9Q6hj+hhsuzhsa2Aer691MlxLtqlRRU=; b=AyNY3p1G6+u4uW1xYKQXd5OtS64CtTaeLVAAiNYo+FmYRpsIn7vvcbGtpMAvX7QVa9l9ywM09ZXhe3jndIpZvKXjgUqOAJMQ2kir+3kGA4yg/Mg2LB91WMTv8raUveibPw8gnzlP6Q+n4x7Vu/taNNw2BeRcKeYIZEnOnL1FiRs=; Original-Received: from [2a02:2560:6d4:26ca::1:1d] (helo=violet.siamics.net) by fely.am-1.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XGoQ8-0000Z8-FI for submit@debbugs.gnu.org; Mon, 11 Aug 2014 12:09:48 +0000 Original-Received: from localhost ([::1] helo=violet.siamics.net) by violet.siamics.net with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XGoPq-0002KZ-1Y for submit@debbugs.gnu.org; Mon, 11 Aug 2014 19:09:30 +0700 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:92411 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Package: emacs While enriched-encode already sets inhibit-read-only to t to avoid issues with any text bearing the read-only property [1] in the encoded part, it doesn=E2=80=99t yet set inhibit-point-motion-hooks, which easily results in incorrect encoding should text being encoded contain parts protected with the =E2=80=98intangible=E2=80=99 prop= erty. Example: (with-temp-buffer (insert "Hello, world!\n") (re-search-backward "\\<") (put-text-property (point) (point-max) 'intangible t) (put-text-property (+ -1 (point)) (+ 1 (point)) 'face 'bold) (put-text-property (+ 2 (point)) (+ 3 (point)) 'face 'italic) (enriched-encode (point-min) (point-max) nil) (buffer-substring-no-properties (point-min) (point-max))) "Content-Type: text/enriched Text-Width: 72 Hello, <italic>world! " With the trivial patch MIMEd, this results in the following (correct) string instead: "Content-Type: text/enriched Text-Width: 72 Hello, world! " [1] http://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Proper= ties.html --=20 FSF associate member #7257 http://boycottsystemd.org/ =E2=80=A6 3013 B6A0= 230E 334A --=-=-= Content-Type: text/x-diff Content-Disposition: inline --- a/lisp/textmodes/enriched.el +++ b/lisp/textmodes/enriched.el @@ -314,7 +314,8 @@ the region, and the START and END of each region." ;;;###autoload (defun enriched-encode (from to orig-buf) (if enriched-verbose (message "Enriched: encoding document...")) - (let ((inhibit-read-only t)) + (let ((inhibit-read-only t) + (inhibit-point-motion-hooks t)) (save-restriction (narrow-to-region from to) (delete-to-left-margin) --=-=-=--