GNU bug report logs - #30908
woman2-roff-buffer fails to restore set-text-properties, etc. on error

Previous Next

Package: emacs;

Reported by: Ivan Shmakov <ivan <at> siamics.net>

Date: Thu, 22 Mar 2018 18:13:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 25.1.1

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ivan Shmakov <ivan <at> siamics.net>
To: submit <at> debbugs.gnu.org
Subject: woman2-roff-buffer fails to restore set-text-properties,
 etc. on error 
Date: Thu, 22 Mar 2018 18:12:49 +0000
[Message part 1 (text/plain, inline)]
Package: emacs
Version: 25.1.1
Tags: patch

	The woman2-roff-buffer function uses unwind-protect to restore
	the canonically-space-region, insert-and-inherit and
	set-text-properties functions it temporarily overrides.

	Unfortunately, the first thing (conditionally) called in the
	‘unwind’ branch is the woman2-format-paragraphs function, which
	may result in error, thus precluding said restoration, leading to:

set-text-properties is an alias for ‘ignore’.

(set-text-properties &rest IGNORE)

Do nothing and return nil.
This function accepts any number of arguments, but ignores them.

	Please thus consider the patch MIMEd.

-- 
FSF associate member #7257  np. Sacred Armor of Antiriad — Traxer
[Message part 2 (text/diff, inline)]
--- woman.el.~1~	2017-11-05 15:00:52.696647297 +0000
+++ woman.el	2018-03-22 17:47:44.014986089 +0000
@@ -3710,13 +3710,14 @@ defun woman2-roff-buffer ()
 	       (set-marker to (woman-find-next-control-line)))
              ;; Call the appropriate function:
              (funcall fn to)))
-      (if (not (eobp))			; This should not happen, but ...
-	  (woman2-format-paragraphs (copy-marker (point-max) t)
-                                    woman-left-margin))
-      (fset 'canonically-space-region canonically-space-region)
-      (fset 'set-text-properties set-text-properties)
-      (fset 'insert-and-inherit insert-and-inherit)
-      (set-marker to nil))))
+      (unwind-protect
+          (if (not (eobp))             ; This should not happen, but ...
+              (woman2-format-paragraphs (copy-marker (point-max) t)
+                                        woman-left-margin))
+        (fset 'canonically-space-region canonically-space-region)
+        (fset 'set-text-properties set-text-properties)
+        (fset 'insert-and-inherit insert-and-inherit)
+        (set-marker to nil)))))
 
 (defun woman-find-next-control-line (&optional pat)
   "Find and return start of next control line.

This bug report was last modified 7 years and 26 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.