GNU bug report logs - #17631
24.3.50; the following should return t

Previous Next

Package: emacs;

Reported by: Samuel Lê <samuel.le <at> gmail.com>

Date: Thu, 29 May 2014 15:43:01 UTC

Severity: normal

Tags: notabug

Found in version 24.3.50

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17631 in the body.
You can then email your comments to 17631 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#17631; Package emacs. (Thu, 29 May 2014 15:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Samuel Lê <samuel.le <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 29 May 2014 15:43:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Samuel Lê <samuel.le <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; the following should return t
Date: Thu, 29 May 2014 16:38:02 +0200
I ran this code, as someone recommanded on the #emacs chan of freenode:
(with-temp-buffer
  (insert "foo Bar")
  (goto-char (point-min))
  (re-search-forward "[[:upper:]]")
  (looking-at "Bar"))

t was expected, but instead I got returned nil.



In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10)
 of 2013-08-17 on debianSam
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
System Description:    Debian GNU/Linux 7.5 (wheezy)

Configured using:
 `configure --prefix=/opt/emacs24'

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

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-track-minor-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
  recentf-mode: t
  hi-lock-mode: t
  elisp-slime-nav-mode: t
  paredit-mode: t
  hl-line-mode: t
  idle-highlight-mode: t
  shell-dirtrack-mode: t
  eldoc-mode: t
  global-auto-complete-mode: t
  auto-complete-mode: t
  ido-ubiquitous-mode: t
  show-paren-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t

Recent input:
m p - b u g g e <backspace> <backspace> <backspace>
f f e r ` SPC d o ? <return> ( SPC <backspace> I SPC
r a n SPC i n <backspace> t SPC f o <backspace> r o
m t h <backspace> <backspace> SPC t h e SPC s <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> f o
r <tab> I SPC r a n SPC y o u SPC <backspace> r SPC
c o d e SPC f r o m SPC t h e SPC * s c r a t c h (
<backspace> * SPC b u f f e r SPC b y SPC t h e SPC
w a y , SPC n o t h i n g SPC h a p p e n d <backspace>
e d SPC ( e x e p t <backspace> <backspace> <backspace>
c e p t SPC t h e SPC n i l SPC d i d <backspace> s
p l a y SPC s h o r t l y SPC i n t h e <backspace>
<backspace> <backspace> SPC t h e SPC m e s s a g e
SPC b a r SPC a t SPC t h e SPC b o t t o m SPC o f
SPC e m a c s _ <backspace> ) <return> C-x o C-x C-e
<help-echo> <up> <up> <up> <up> C-a <C-right> <right>
C-k d o <left> M-> <up> C-e C-x C-e <help-echo> <down-mouse-1>
<mouse-1> C-x k <return> <down-mouse-1> <mouse-1> <help-echo>
<down-mouse-1> <mouse-1> <backspace> <backspace> C-x
u C-x u C-x u C-x u <down> <down> <down> <down> <down>
<down> <down> <return> <return> M-x r e p o <retur
n>

Recent messages:
Wrote /home/sam/.emacs.d/char-utils.el
Mark set
Quit
call-interactively: End of buffer [3 times]
Mark set [3 times]
nil [2 times]
up-list: Scan error: "Unbalanced parentheses", 662, 793
Mark set
Entering debugger...
Undo! [4 times]
End of buffer [2 times]

Load-path shadows:
/home/sam/.emacs.d/elpa/flymake-0.4.16/flymake hides
/opt/emacs24/share/emacs/24.3.50/lisp/progmodes/flymake

Features:
(shadow sort flyspell ispell mail-extr emacsbug message rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils
debug network-stream starttls tls erc-list 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 pp dabbrev
fuzzy mule-util tabify recentf tree-widget hi-lock misearch
multi-isearch vc-git ffap url-parse url-vars elisp-slime-nav paredit
hl-line saveplace idle-highlight-mode elpy yasnippet help-mode pyvenv
grep python rx nose json idomenu imenu highlight-indentation flymake
find-file-in-project etags elpy-refactor ecb warnings ecb-symboldef
ecb-analyse ecb-compatibility ecb-winman-support ecb-autogen autoload
lisp-mnt ecb-tod ecb-cycle ecb-eshell ecb-help ecb-jde
ecb-method-browser ecb-semantic ecb-file-browser ecb-speedbar ecb-layout
ecb-create-layout ecb-compilation ecb-common-browser assoc ecb-navigate
ecb-mode-line ecb-face tree-buffer ecb-upgrade ecb-cedet-wrapper
semantic/db-mode semantic/db-find semantic/db-ref semantic/analyze
semantic/sort semantic/scope semantic/analyze/fcn semantic/db eieio-base
semantic/format semantic/tag-ls semantic/find semantic/ctxt
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local cedet wid-edit ecb-util tramp tramp-compat
auth-source eieio byte-opt bytecomp byte-compile cconv eieio-core
gnus-util mm-util mail-prsvr password-cache tramp-loaddefs trampver
format-spec ess-toolbar ess-mouse mouseme thingatpt browse-url ess-menu
ess-swv ess-noweb ess-noweb-font-lock-mode ess-bugs-l essd-els ess-sas-d
ess-sas-l ess-sas-a shell pcomplete ess-arc-d ess-vst-d ess-xls-d
ess-lsp-l ess-sta-d ess-sta-l cc-vars cc-defs make-regexp ess-sp6-d
ess-sp5-d ess-sp3-d ess-julia ess-r-d ess-tracebug compile ess-roxy
easy-mmode hideshow ess-help reporter ess-developer ess-r-args eldoc
ess-s-l speedbar sb-image ezimage dframe ess ess-inf comint ansi-color
ring ess-mode ess-noweb-mode ess-utils ess-custom executable ess-compat
ess-site auto-complete-config auto-complete cl-macs gv popup cl
zenburn-theme ecb-autoloads edmacro kmacro cl-loaddefs cl-lib smex
starter-kit-misc ido-ubiquitous advice help-fns ido paren
starter-kit-defuns uniquify info easymenu package time-date tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
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
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
gfilenotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17631; Package emacs. (Thu, 29 May 2014 15:52:02 GMT) Full text and rfc822 format available.

Message #8 received at 17631 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Samuel Lê <samuel.le <at> gmail.com>
Cc: 17631 <at> debbugs.gnu.org
Subject: Re: bug#17631: 24.3.50; the following should return t
Date: Thu, 29 May 2014 11:51:42 -0400
Samuel Lê wrote:

> I ran this code, as someone recommanded on the #emacs chan of freenode:
> (with-temp-buffer
>   (insert "foo Bar")
>   (goto-char (point-min))
>   (re-search-forward "[[:upper:]]")
>   (looking-at "Bar"))
>
> t was expected, but instead I got returned nil.

Your expectation is incorrect, for two reasons:

1.    `[:upper:]'
     This matches any upper-case letter, as determined by the current
     case table (*note Case Tables::).  If `case-fold-search' is
     non-`nil', this also matches any lower-case letter.

2. re-search-forward leaves point at the end of the match, ie after "B"
in this case.

Compare:

 (with-temp-buffer
   (insert "foo Bar")
   (goto-char (point-min))
   (let (case-fold-search)
     (re-search-forward "[[:upper:]]")
     (looking-at "ar")))

The help-gnu-emacs mailing list is probably a better place to discuss
these things, but feel free to keep talking about it here.
I'll close this report though, since it is not a bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17631; Package emacs. (Thu, 29 May 2014 15:53:03 GMT) Full text and rfc822 format available.

Message #11 received at 17631 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Samuel Lê <samuel.le <at> gmail.com>
Cc: 17631 <at> debbugs.gnu.org
Subject: Re: bug#17631: 24.3.50; the following should return t
Date: Thu, 29 May 2014 18:52:32 +0300
> Date: Thu, 29 May 2014 16:38:02 +0200
> From: Samuel Lê <samuel.le <at> gmail.com>
> 
> I ran this code, as someone recommanded on the #emacs chan of freenode:
> (with-temp-buffer
>   (insert "foo Bar")
>   (goto-char (point-min))
>   (re-search-forward "[[:upper:]]")
>   (looking-at "Bar"))
> 
> t was expected, but instead I got returned nil.

You need to bind case-fold-search to nil.




Added tag(s) notabug. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 29 May 2014 16:22:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 17631 <at> debbugs.gnu.org and Samuel Lê <samuel.le <at> gmail.com> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 29 May 2014 16:22:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 27 Jun 2014 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 46 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.