From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Geoff Odhner Newsgroups: gmane.emacs.bugs Subject: regex bug with pattern "\\*/" matching end of buffer */ Date: Tue, 26 Apr 2005 14:07:25 -0400 Message-ID: <200504261807.j3QI7PL2005677@monster.franklin.com> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1114538802 19897 80.91.229.2 (26 Apr 2005 18:06:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 26 Apr 2005 18:06:42 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 26 20:06:39 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DQURM-0005Ap-V2 for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Apr 2005 20:05:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DQUX7-0001rw-S9 for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Apr 2005 14:11:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DQUW1-0001RO-US for bug-gnu-emacs@gnu.org; Tue, 26 Apr 2005 14:10:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DQUW0-0001QR-MZ for bug-gnu-emacs@gnu.org; Tue, 26 Apr 2005 14:10:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DQUW0-0000ZF-Ft for bug-gnu-emacs@gnu.org; Tue, 26 Apr 2005 14:10:32 -0400 Original-Received: from [63.88.59.84] (helo=opal.franklin.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DQUWx-0006fG-Ex for bug-gnu-emacs@gnu.org; Tue, 26 Apr 2005 14:11:31 -0400 Original-Received: from monster.franklin.com (monster [192.9.200.226]) by opal.franklin.com (8.12.10+Sun/8.12.10) with ESMTP id j3QI7kPG019241; Tue, 26 Apr 2005 14:07:46 -0400 (EDT) Original-Received: from monster.franklin.com (localhost.localdomain [127.0.0.1]) by monster.franklin.com (8.12.11/8.12.10) with ESMTP id j3QI7P0o005681; Tue, 26 Apr 2005 14:07:25 -0400 Original-Received: (from geoff@localhost) by monster.franklin.com (8.12.11/8.12.11/Submit) id j3QI7PL2005677; Tue, 26 Apr 2005 14:07:25 -0400 Original-To: bug-gnu-emacs@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:11235 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:11235 This bug report will be sent to the Free Software Foundation, not to your local site managers! Please write in English, because the Emacs maintainers do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. In GNU Emacs 21.3.1 (i686-pc-linux-gnu, X toolkit) of 2005-03-24 on monster configured using `configure --prefix=/home/geoff/i686 --with-toolkit-scroll-bars' Important settings: value of $LC_ALL: C value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 locale-coding-system: nil default-enable-multibyte-characters: t Please describe exactly what actions triggered the bug and the precise symptoms of the bug: If I have a file with the following line (no trailing space): char ch; /* sample comment */ then I put the cursor on it and execute the following elisp code: (save-restriction (narrow-to-region (progn (beginning-of-line) (point)) (progn (end-of-line) (point))) (goto-char (point-min)) (while (and (re-search-forward "/\\*" nil t) (not (eobp))) (replace-match "/-*" nil nil)) (goto-char (point-min)) (while (and (re-search-forward "\\*/" nil t) (not (eobp))) (replace-match "*-/" nil nil))) it will give me the following line as the result: char ch; /-* sample comment */ In contrast, what I expect is this: char ch; /-* sample comment *-/ If I add a trailing space, then I get appropriate behavior. Regards, Geoff Odhner Recent input: r e p l s t C-x 0 A-s w i d e A-z k r e l SPC A-z C-x C-v A-z A-z A-z A-s SPC A-z A-z Recent messages: Undo! Mark set [2 times] Line eaten Mark set [2 times] Line inserted Undo! [2 times] Wrote /home/geoff/ggoo/elisp/el/lines-G.el Undo! [2 times] Loading emacsbug...done