all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#30908: woman2-roff-buffer fails to restore set-text-properties, etc. on error
@ 2018-03-22 18:12 Ivan Shmakov
  2018-03-23  0:52 ` Noam Postavsky
  0 siblings, 1 reply; 5+ messages in thread
From: Ivan Shmakov @ 2018-03-22 18:12 UTC (permalink / raw)
  To: 30908

[-- Attachment #1: Type: text/plain, Size: 735 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/diff, Size: 1211 bytes --]

--- 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-26 12:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-22 18:12 bug#30908: woman2-roff-buffer fails to restore set-text-properties, etc. on error Ivan Shmakov
2018-03-23  0:52 ` Noam Postavsky
2018-03-23  3:24   ` Ivan Shmakov
2018-03-23 10:20     ` Noam Postavsky
2018-04-26 12:01       ` Noam Postavsky

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.