[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: WoMan Bug]

From: Michael Welsh Duggan
Subject: Re: address@hidden: WoMan Bug]
Date: Fri, 15 Sep 2006 01:58:39 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Michael Welsh Duggan <address@hidden> writes:

> Stefan Monnier <address@hidden> writes:
>>>> Would someone please fix this, then ack?
>>> The following patch would appear to fix this problem:
>> I believe the right patch is to change the marker's insertion type (so that
>> insertions are automatically made "before").  The patch below does that at
>> the spot caught by the OP.  There might be other places where we need some
>> fixup, so please try it and tell me if you hit the "Internal error" check
>> or not (and if you do, please provide a backtrace).
> Actually, this patch doesn't appear to change the marker insertion
> type at all.  Was something left out?

I take that back.  I simply misunderstood the code.  Ignore also my
followup patch, in favor of the following:

--- woman.el    04 Sep 2006 13:03:49 -0400      1.46
+++ woman.el    15 Sep 2006 01:57:31 -0400      
@@ -3442,9 +3442,7 @@
 (defsubst woman2-process-escapes-to-eol (&optional numeric)
   "Process remaining escape sequences up to eol.
 Handle numeric arguments specially if optional argument NUMERIC is non-nil."
-  (woman2-process-escapes
-   (save-excursion (end-of-line) (point-marker))
-   numeric))
+  (woman2-process-escapes (end-of-line) numeric))
 (defun woman2-nr (to)
   ".nr R +/-N M -- Assign +/-N (wrt to previous value, if any) to register R.
@@ -3645,6 +3643,7 @@
        (woman-registers woman-registers)
        fn request translations
+    (set-marker-insertion-type to t)
     ;; ?roff does not squeeze multiple spaces, but does fill, so...
     (fset 'canonically-space-region 'ignore)
     ;; Try to avoid spaces inheriting underlines from preceding text!
@@ -3897,10 +3896,15 @@
 (defun woman2-process-escapes (to &optional numeric)
-  "Process remaining escape sequences up to marker TO, preserving point.
+  "Process remaining escape sequences up to TO, preserving point.
 Optional argument NUMERIC, if non-nil, means the argument is numeric."
   ;; The first two cases below could be merged (maybe)!
   (let ((from (point)))
+    ;; Make sure TO is a move-after-insertion kind of marker.
+    (if (markerp to)
+        (unless (marker-insertion-type to)
+          (error "Internal error: wrong marker type"))
+      (setq to (copy-marker to t)))
     ;; Discard zero width filler character used to hide leading dots
     ;; and zero width characters \|, \^:
     (while (re-search-forward "\\\\[&|^]" to t)

Michael Welsh Duggan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]