From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [david.hansen@physik.fu-berlin.de: WoMan Bug] Date: Thu, 14 Sep 2006 01:36:59 -0400 Message-ID: References: <87wt87vz03.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 1158212251 30090 80.91.229.2 (14 Sep 2006 05:37:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Sep 2006 05:37:31 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 14 07:37:25 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 1GNjuW-0007SR-W4 for ged-emacs-devel@m.gmane.org; Thu, 14 Sep 2006 07:37:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GNjuW-00073x-HY for ged-emacs-devel@m.gmane.org; Thu, 14 Sep 2006 01:37:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GNjuK-00073R-Gn for emacs-devel@gnu.org; Thu, 14 Sep 2006 01:37:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GNjuI-00072t-7Z for emacs-devel@gnu.org; Thu, 14 Sep 2006 01:37:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GNjuI-00072o-3q for emacs-devel@gnu.org; Thu, 14 Sep 2006 01:37:02 -0400 Original-Received: from [209.226.175.25] (helo=tomts5-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GNjw9-0008M8-NX; Thu, 14 Sep 2006 01:38:57 -0400 Original-Received: from localhost ([70.55.143.90]) by tomts5-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060914053700.FLQY18394.tomts5-srv.bellnexxia.net@localhost>; Thu, 14 Sep 2006 01:37:00 -0400 Original-Received: by localhost (Postfix, from userid 20848) id C14979022; Thu, 14 Sep 2006 01:36:59 -0400 (EDT) Original-To: Michael Welsh Duggan In-Reply-To: <87wt87vz03.fsf@cs.cmu.edu> (Michael Welsh Duggan's message of "Thu\, 14 Sep 2006 00\:43\:56 -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:59822 Archived-At: >> 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). Stefan --- woman.el 05 sep 2006 23:20:53 -0400 1.46 +++ woman.el 14 sep 2006 01:32:37 -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 (line-end-position) numeric)) (defun woman2-nr (to) ".nr R +/-N M -- Assign +/-N (wrt to previous value, if any) to register R. @@ -3897,10 +3895,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)