From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.devel Subject: Re: [david.hansen@physik.fu-berlin.de: WoMan Bug] Date: Fri, 15 Sep 2006 01:58:39 -0400 Message-ID: <87bqphr7qo.fsf@cs.cmu.edu> References: <87wt87vz03.fsf@cs.cmu.edu> <87k645r8uz.fsf@cs.cmu.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1158299930 19914 80.91.229.2 (15 Sep 2006 05:58:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Sep 2006 05:58:50 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 15 07:58:47 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GO6iq-00053G-AF for ged-emacs-devel@m.gmane.org; Fri, 15 Sep 2006 07:58:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GO6ip-0002pc-WC for ged-emacs-devel@m.gmane.org; Fri, 15 Sep 2006 01:58:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GO6if-0002pW-Ax for emacs-devel@gnu.org; Fri, 15 Sep 2006 01:58:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GO6ie-0002pI-NO for emacs-devel@gnu.org; Fri, 15 Sep 2006 01:58:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GO6ie-0002pF-Hw for emacs-devel@gnu.org; Fri, 15 Sep 2006 01:58:32 -0400 Original-Received: from [205.201.10.244] (helo=maru) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GO6kj-0002O6-PH; Fri, 15 Sep 2006 02:00:42 -0400 Original-Received: from md5i by maru with local (Exim 4.63) (envelope-from ) id 1GO6il-0002Mk-LU; Fri, 15 Sep 2006 01:58:39 -0400 Original-To: Stefan Monnier In-Reply-To: <87k645r8uz.fsf@cs.cmu.edu> (Michael Welsh Duggan's message of "Fri\, 15 Sep 2006 01\:34\:28 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:59857 Archived-At: Michael Welsh Duggan writes: > Stefan Monnier 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 tab-stop-list) + (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 (md5i@cs.cmu.edu)