Subject: bug#7378: 23.2; grep buffer misinterprets result if filename contains colon character

From: Robin Green <[email-masked]>
Date: Thu, 11 Nov 2010 20:47:36 +0000

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the [email-masked] mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug.  If you can, give
a recipe starting from `emacs -Q':

I did M-x rgrep and searched for a string which happened to be matched by some files, and one of the filenames happened to contain a colon character (':'). Emacs thought that the colon character indicated a line number would immediately follow, and it syntax highlighted the buffer accordingly. When I tried to visit the file in question by navigating to that line and pressing Enter, emacs asked me for which file to visit, because it had truncated the filename at the colon character.

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/usr/share/emacs/23.2/etc/DEBUG.

In GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2010-05-22 on cspcnh.swan.ac.uk
Windowing system distributor `The X.Org Foundation', version 11.0.10900000
configured using `configure  '--prefix=/usr' '--host=i686-pc-linux-gnu' '--build=i686-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--docdir=/usr/share/doc/emacs-23.2' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--disable-dependency-tracking' '--disable-silent-rules' '--enable-fast-install' '--libdir=/usr/lib' '--infodir=/usr/share/info/emacs' '--without-kerberos' '--without-kerberos5' '--without-hesiod' '--without-m17n-flt' '--without-xim' '--with-x' '--without-sound' '--with-xft' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' '--without-libotf' '--with-rsvg' '--without-dbus' '--with-gif' '--without-gpm' '--with-jpeg' '--with-png' '--without-tiff' '--with-xpm' '--without-gconf' 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu' 'CC=i686-pc-linux-gnu-gcc' 'CFLAGS=-march=native -pipe -O2' 'CPP=cpp''

Important settings:
  value of $LC_ALL: nil
  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_GB.utf8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Grep

Minor modes in effect:
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
i t ? <help-echo> <backspace> <backspace> <backspace> 
t h a t SPC f i l e ? SPC h w y ? <backspace> <backspace> 
<backspace> <backspace> w h y ? <return> <help-echo> 
<switch-frame> s <switch-frame> <help-echo> S o SPC 
w h a t SPC i s SPC t h e SPC " r i g h t SPC w a y 
" SPC t o SPC m a k e SPC a SPC w r a p p e r SPC s 
c r i p t ? S-SPC J u s t SPC u s e SPC h e r e b i 
n ? <return> <help-echo> C-x b <tab> n c - 4 <tab> 
<backspace> <backspace> <backspace> x - <tab> 4 <tab> 
<return> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> M-x 
r g r e p <return> h e r e b i n <return> * . e x * 
<return> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <return> M-x r g r e p <return> 
h e r e b i n <return> * . e x * <return> <home> C-k 
/ v a r / d b / p a l <tab> r e <tab> <return> <M-right> 
<M-left> C-x C-f <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
/ s c <tab> c <tab> C-g <M-right> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <return> C-g <help-echo> <switch-frame> 
<switch-frame> M-x r e p o r t - e m <tab> <return

Recent messages:
Checking "%inbox" is done
Checking "%inbox"
Checking "%inbox" is done
Checking "%inbox"
Checking "%inbox" is done
Making completion list... [2 times]
Grep exited abnormally with code 123
Grep finished (matches found)
Quit
Mark set
Quit

Load-path shadows:
/usr/share/emacs/site-lisp/coq hides /usr/share/emacs/site-lisp/ProofGeneral/coq/coq
/usr/share/emacs/site-lisp/coq-syntax hides /usr/share/emacs/site-lisp/ProofGeneral/coq/coq-syntax
/usr/share/emacs/site-lisp/coq-db hides /usr/share/emacs/site-lisp/ProofGeneral/coq/coq-db
/usr/share/emacs/site-lisp/semi/pgg-gpg hides /usr/share/emacs/23.2/lisp/pgg-gpg
/usr/share/emacs/site-lisp/flim/hex-util hides /usr/share/emacs/23.2/lisp/hex-util
/usr/share/emacs/site-lisp/semi/pgg-parse hides /usr/share/emacs/23.2/lisp/pgg-parse
/usr/share/emacs/site-lisp/semi/pgg-pgp5 hides /usr/share/emacs/23.2/lisp/pgg-pgp5
/usr/share/emacs/site-lisp/flim/md4 hides /usr/share/emacs/23.2/lisp/md4
/usr/share/emacs/site-lisp/flim/sha1 hides /usr/share/emacs/23.2/lisp/sha1
/usr/share/emacs/site-lisp/semi/pgg hides /usr/share/emacs/23.2/lisp/pgg
/usr/share/emacs/site-lisp/semi/pgg-def hides /usr/share/emacs/23.2/lisp/pgg-def
/usr/share/emacs/site-lisp/semi/pgg-pgp hides /usr/share/emacs/23.2/lisp/pgg-pgp
/usr/share/emacs/site-lisp/flim/hmac-def hides /usr/share/emacs/23.2/lisp/net/hmac-def
/usr/share/emacs/site-lisp/flim/sasl-ntlm hides /usr/share/emacs/23.2/lisp/net/sasl-ntlm
/usr/share/emacs/site-lisp/flim/hmac-md5 hides /usr/share/emacs/23.2/lisp/net/hmac-md5
/usr/share/emacs/site-lisp/flim/sasl-cram hides /usr/share/emacs/23.2/lisp/net/sasl-cram
/usr/share/emacs/site-lisp/flim/sasl hides /usr/share/emacs/23.2/lisp/net/sasl
/usr/share/emacs/site-lisp/flim/ntlm hides /usr/share/emacs/23.2/lisp/net/ntlm
/usr/share/emacs/site-lisp/flim/sasl-digest hides /usr/share/emacs/23.2/lisp/net/sasl-digest
/usr/share/emacs/site-lisp/wl/rfc2368 hides /usr/share/emacs/23.2/lisp/mail/rfc2368
/usr/share/emacs/site-lisp/wl/utf7 hides /usr/share/emacs/23.2/lisp/gnus/utf7
/usr/share/emacs/site-lisp/semi/smime hides /usr/share/emacs/23.2/lisp/gnus/smime

Features:
(shadow emacsbug erc-menu erc-join erc-ring erc-networks erc-pcomplete
erc-track erc-match erc-button erc-fill erc-stamp erc-netsplit
erc-goodies erc erc-backend erc-compat format-spec find-dired grep
compile help-mode ansi-color shell comint smtp sasl sasl-anonymous
sasl-login sasl-plain pcomplete vc-git info cus-edit wid-edit
multi-isearch tabify man view dired-x dired-aux dired wl-score
elmo-internal mule-util mel-q-ccl elmo-nntp elmo-imap4 time-stamp
elmo-net elmo-dop elmo-cache elmo-map modb-standard wl-mime mime-edit
pgg-parse pccl pccl-20 ccl signature mail-utils mime-setup
mail-mime-setup semi-setup mime-pgp pgg-def mime-play filename
mime-image wl-demo wl-draft eword-encode wl-template sendmail wl-news
derived wl-address wl-thread wl-action wl-summary ps-print ps-def lpr
wl-refile wl-message elmo-mime mmelmo-buffer mmelmo-imap mime-view
mime-conf calist semi-def mmimap mime-parse mmbuffer mmgeneric
wl-highlight elmo-multi wl-folder wl wl-e21 wl-util pp elmo-flag
elmo-localdir wl-vars epg-config wl-version elmo elmo-signal
elmo-msgdb modb modb-generic modb-entity mime elmo-util emu invisible
inv-19 poem poem-e20 poem-e20_3 utf7 eword-decode mel mime-def alist
std11 mcharset mcs-20 mcs-e20 pces pces-e20 pces-20 broken pcustom
elmo-date path-util elmo-vars poe elmo-version pym static apel-ver
product luna avoid magit-topgit cl cl-19 magit-svn magit diff-mode
log-edit pcvs-util add-log magit-key-mode assoc windmove emacsd-tile
edmacro kmacro winner ring server remember org-remember org-datetree
org byte-opt bytecomp byte-compile advice help-fns advice-preload
org-footnote org-src org-list org-faces org-compat org-macs easymenu
time-date noutline outline easy-mmode paren cus-start cus-load
site-exherbo eclectic-mode exheres-mode exheres-mode-keywords skeleton
sh-script executable cmake-mode thingatpt bbdb-autoloads bbdb
regexp-opt timezone proof-site proof-autoloads pg-vars tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd font-setting
tool-bar dnd fontset image fringe lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button
minibuffer faces cus-face files text-properties overlay md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process font-render-setting gtk x-toolkit x
multi-tty emacs)