unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Geoff Odhner <geoff@franklin.com>
Subject: regex bug with pattern "\\*/" matching end of buffer */
Date: Tue, 26 Apr 2005 14:07:25 -0400	[thread overview]
Message-ID: <200504261807.j3QI7PL2005677@monster.franklin.com> (raw)

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:
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> r e p l <tab> s t <tab> <return> C-x 0 
<help-echo> <switch-frame> <down-mouse-1> <mouse-movement> 
<mouse-1> <kp-subtract> <up> <kp-add> A-s <f2> <up> 
<up> <up> <return> <up> <up> <return> <f10> <f2> w 
i d <tab> e <tab> <return> <C-kp-add> A-z <f2> k <return> 
<f2> r e l SPC <return> <f3> <S-kp-add> A-z C-x C-v 
<return> <next> <next> <next> <down-mouse-1> <mouse-1> 
<C-kp-add> A-z <down-mouse-1> <mouse-1> <kp-subtract> 
<down> <kp-add> A-z <up> A-z A-s <down-mouse-1> <mouse-1> 
<down-mouse-1> <mouse-1> <down-mouse-1> <mouse-1> SPC 
<S-kp-add> A-z A-z <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <menu-bar> <help-menu> 
<report-emacs-bug>

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

             reply	other threads:[~2005-04-26 18:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-26 18:07 Geoff Odhner [this message]
     [not found] <20050430231850.495369F50E@mirror.positive-internet.com>
2005-05-02 12:54 ` regex bug with pattern "\\*/" matching end of buffer */ Geoff Odhner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200504261807.j3QI7PL2005677@monster.franklin.com \
    --to=geoff@franklin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).