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:52:41 -0400 Message-ID: <87fyetr80m.fsf@cs.cmu.edu> 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 1158299571 19046 80.91.229.2 (15 Sep 2006 05:52:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Sep 2006 05:52:51 +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:52:49 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 1GO6d5-000425-0p for ged-emacs-devel@m.gmane.org; Fri, 15 Sep 2006 07:52:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GO6d4-0007e4-F9 for ged-emacs-devel@m.gmane.org; Fri, 15 Sep 2006 01:52:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GO6ct-0007di-6T for emacs-devel@gnu.org; Fri, 15 Sep 2006 01:52:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GO6cs-0007dW-Np for emacs-devel@gnu.org; Fri, 15 Sep 2006 01:52:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GO6cs-0007dT-KR for emacs-devel@gnu.org; Fri, 15 Sep 2006 01:52:34 -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 1GO6ey-0001kQ-1L; Fri, 15 Sep 2006 01:54:44 -0400 Original-Received: from md5i by maru with local (Exim 4.63) (envelope-from ) id 1GO6cz-00029S-Qw; Fri, 15 Sep 2006 01:52:41 -0400 Original-To: Stefan Monnier In-Reply-To: (Stefan Monnier's message of "Thu\, 14 Sep 2006 01\:36\:59 -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:59856 Archived-At: 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). [patch elided] How about the following instead? --- woman.el 04 Sep 2006 13:03:49 -0400 1.46 +++ woman.el 15 Sep 2006 01:49:25 -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 (copy-marker (line-end-position) t) 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)