bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

regex bug with pattern "\\*/" matching end of buffer */


From: Geoff Odhner
Subject: regex bug with pattern "\\*/" matching end of buffer */
Date: Tue, 26 Apr 2005 14:07:25 -0400

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 via email to

[Prev in Thread] Current Thread [Next in Thread]