From unknown Tue Aug 19 06:06:59 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#7593 <7593@debbugs.gnu.org> To: bug#7593 <7593@debbugs.gnu.org> Subject: Status: 24.0.50; No response from 'occur' (infinite loop when regexp matches empty string?) Reply-To: bug#7593 <7593@debbugs.gnu.org> Date: Tue, 19 Aug 2025 13:06:59 +0000 retitle 7593 24.0.50; No response from 'occur' (infinite loop when regexp m= atches empty string?) reassign 7593 emacs submitter 7593 Larry Denenberg severity 7593 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 08 13:57:38 2010 Received: (at submit) by debbugs.gnu.org; 8 Dec 2010 18:57:38 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PQPCr-0000oq-AE for submit@debbugs.gnu.org; Wed, 08 Dec 2010 13:57:38 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PQP3d-0000YZ-3J for submit@debbugs.gnu.org; Wed, 08 Dec 2010 13:48:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQP9O-0003YA-4z for submit@debbugs.gnu.org; Wed, 08 Dec 2010 13:54:03 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:52819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQP9O-0003Y5-1R for submit@debbugs.gnu.org; Wed, 08 Dec 2010 13:54:02 -0500 Received: from [140.186.70.92] (port=55736 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQP9M-0007Wr-4m for bug-gnu-emacs@gnu.org; Wed, 08 Dec 2010 13:54:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQP9B-0003UJ-PL for bug-gnu-emacs@gnu.org; Wed, 08 Dec 2010 13:53:59 -0500 Received: from smtp2go.com ([207.58.142.213]:38954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQP9B-0003Tc-LH for bug-gnu-emacs@gnu.org; Wed, 08 Dec 2010 13:53:49 -0500 Received: from [140.247.179.41] (helo=vegas.jjd.com) by smtp2go.com with esmtp (Exim 4.69) (envelope-from ) id 1PQP97-0003CN-1h; Wed, 08 Dec 2010 18:53:45 +0000 To: bug-gnu-emacs@gnu.org From: Larry Denenberg X-Mailer: MH-E 8.1; nmh 1.3; GNU Emacs 24.0.50 Date: Wed, 08 Dec 2010 13:53:36 -0500 Message-ID: <21977.1291834416@vegas.jjd.com> X-SMTP2Go-MailScanner-Information: Please contact support@smtp2go.com for more information X-SMTP2Go-MailScanner-ID: 1PQP97-0003CN-1h X-SMTP2Go-MailScanner: Found to be clean X-SMTP2Go-MailScanner-From: larry@denenberg.com Subject: 24.0.50; No response from 'occur' (infinite loop when regexp matches empty string?) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 08 Dec 2010 13:57:36 -0500 Cc: larry@denenberg.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) This bug manifests in all versions of GNU emacs that I have. The facts: 1) Start with 'emacs -nw -Q'. We see buffer *scratch* containing the initial greeting ';; This buffer is for notes . . .'. 2) Enter 'M-x occur'. We're now in the minibuffer with prompt 'List lines matching regexp:'. 3) Enter 'a*'. Emacs stops responding. I believe the problem is in function occur-engine (file replace.el), specifically the section labelled 'Highlight the matches'. ;; Highlight the matches (let ((len (length curstring)) (start 0)) (while (and (< start len) (string-match regexp curstring start)) (add-text-properties (match-beginning 0) (match-end 0) (append `(occur-match t) (when match-face ;; Use `face' rather than `font-lock-face' here ;; so as to override faces copied from the buffer. `(face ,match-face))) curstring) (setq start (match-end 0)))) When the given regexp matches a null string, the final line of code here does not change variable start, so we loop infinitely. /Larry Denenberg larry@denenberg.com http://larry.denenberg.com/ In GNU Emacs 24.0.50.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54) of 2010-08-10 on braeburn.aquamacs.org - Aquamacs Distribution 2.1dev Windowing system distributor `Apple', version 10.3.1038 configured using `configure '--with-ns' '--without-x' 'CFLAGS=-arch i386 -arch ppc' 'LDFLAGS=-arch i386 -arch ppc'' 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: nil value of $XMODIFIERS: nil locale-coding-system: nil default enable-multibyte-characters: t Major mode: Info Minor modes in effect: TeX-PDF-mode: t TeX-source-correlate-mode: t display-time-mode: t savehist-mode: t smart-frame-positioning-mode: t aquamacs-autoface-mode: t recentf-mode: t osx-key-mode: t show-paren-mode: t delete-selection-mode: t pc-selection-mode: t cua-mode: t tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-xface hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-xface /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-utils hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-utils /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-tool-bar hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-tool-bar /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-thread hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-thread /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-speed hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-speed /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-show hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-show /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-seq hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-seq /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-search hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-search /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-scan hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-scan /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-print hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-print /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-mime hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-mime /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-loaddefs hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-loaddefs /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-limit hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-limit /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-letter hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-letter /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-junk hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-junk /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-inc hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-inc /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-identity hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-identity /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-gnus hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-gnus /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-funcs hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-funcs /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-folder hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-folder /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-e hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-e /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-compat hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-compat /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-comp hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-comp /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-buffers hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-buffers /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-alias hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-alias /Users/larry/Emacs/mh-e-8.1/emacs/lisp/mh-e/mh-acros hides /Applications/Aquamacs.app/Contents/Resources/lisp/mh-e/mh-acros /Users/larry/Emacs/Bin/hebrew hides /Applications/Aquamacs.app/Contents/Resources/lisp/language/hebrew Features: (shadow emacsbug thai-util thai-word lao-util flyspell ispell cua-rect rect utf-7 compile comint ring find-func sort mule-util info mh-limit browse-url flow-fill cperl-mode dabbrev mh-thread multi-isearch mh-funcs mh-search mh-alias multi-prompt crm qp mail-extr mh-identity mh-letter mh-comp smiley mh-mime mh-gnus mh-show goto-addr gnus-cite gnus-art mm-uu mml2015 pgg pgg-parse pgg-def epg-config mm-view smime password-cache dig gnus-sum nnoo gnus-group gnus-undo nnmail mail-source format-spec gnus-start gnus-spec gnus-int message rfc822 mml mml-sec mm-decode mm-bodies mm-encode gmm-utils mailheader gnus-win gnus-range gnus gnus-ems nnheader mh-inc hl-line mh-tool-bar mh-seq mh-xface mh-utils mh-folder which-func imenu mh-scan mh-e mh-compat mailabbrev mh-acros mh-buffers mh-loaddefs time-stamp newcomment texmathp preview prv-emacs reftex-vcr reftex-dcr reftex-auc reftex reftex-vars bib-cite tex-fold tex-bar tex-buf toolbar-x noutline outline font-latex latex tex-style tex latexenc ebuff-menu electric url-http tls url-auth mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-gw url-cache url url-proxy url-privacy url-expand url-methods url-history url-cookie url-util url-parse auth-source gnus-util url-vars mm-util mail-prsvr mailcap mail-utils time-date package quail help-mode jka-compr time edmacro kmacro load-emacs-plugins aquamacs-mode-defaults auctex-config server preview-latex tex-site auto-loads smart-dnd aquamacs-aux savehist mouse-sel one-buffer-one-frame smart-frame-positioning drews_init color-theme-autoloads view saveplace visual-line aquamacs-bug aquamacs-autoface-mode aquamacs-editing sendmail recentf tree-widget cus-edit osxkeys emulate-mac-keyboard-mode frame-cmds strings misc-fns thingatpt+ thingatpt frame-fns avoid aquamacs-mac-fontsets fit-frame aquamacs-frame-setup aquamacs-tabbar tabbar-window cl cl-19 tabbar warnings cus-start cus-load load-emacs-pre-plugins aquamacs-site-start filladapt aquamacs-redo check-for-updates aquamacs-menu osx_defaults aquamacs-tool-bar aquamacs mac-extra-functions aquamacs-tools aquamacs-macros parse-time timezone paren delsel pc-select cua-base wid-edit regexp-opt advice advice-preload byte-opt bytecomp byte-compile debug help-fns image-file disp-table easy-mmode tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win easymenu 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 ns multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 18 00:11:39 2013 Received: (at 7593-done) by debbugs.gnu.org; 18 Dec 2013 05:11:39 +0000 Received: from localhost ([127.0.0.1]:56472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vt9Q2-0005Gj-PT for submit@debbugs.gnu.org; Wed, 18 Dec 2013 00:11:39 -0500 Received: from mail-pd0-f181.google.com ([209.85.192.181]:47592) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vt9Pz-0005GZ-Ly for 7593-done@debbugs.gnu.org; Wed, 18 Dec 2013 00:11:36 -0500 Received: by mail-pd0-f181.google.com with SMTP id p10so7708733pdj.40 for <7593-done@debbugs.gnu.org>; Tue, 17 Dec 2013 21:11:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=wlWhqIRNO3RCbZyo6xwrtEEHmSVif+43MAwh3Gtoq6s=; b=M85Js0UOwwOw/QbiThj2s3I1amaqmzF38RAJUdD7ZJ6UBi7cmCDbZANaf0LsWDSYTg PcSrrzVYbbcX3/TPemjrU9G0UoOSfUHz1PaO8+zT8Sj9AbR8Pd9ItMEzgEzDtjwcdoej 8l5aDsPBTa8qzBfDZKz7KZqozKZwRay9IkN3eFoCKh0cnUaGN/64IPJfmHS1qUMYU5jN ZSV5ASoSNA90SDuEejjKso+qfhYvrjKb1jEsPekqtACleK6nqmbocSBIeRZ4RE0kGEih u4watYeRh35oZelOwNQPBsqHwDIorwmx161CtsvkVY+zdn/fqGXtmDJ1dPRKjB06gQaT dm4g== X-Received: by 10.67.3.3 with SMTP id bs3mr32151549pad.46.1387343494685; Tue, 17 Dec 2013 21:11:34 -0800 (PST) Received: from tsparkle ([155.69.19.37]) by mx.google.com with ESMTPSA id ki1sm37963890pbd.1.2013.12.17.21.11.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Dec 2013 21:11:33 -0800 (PST) From: Chong Yidong To: Larry Denenberg Subject: Re: bug#7593: 24.0.50; No response from 'occur' (infinite loop when regexp matches empty string?) References: <21977.1291834416@vegas.jjd.com> Date: Wed, 18 Dec 2013 13:11:32 +0800 In-Reply-To: <21977.1291834416@vegas.jjd.com> (Larry Denenberg's message of "Wed, 08 Dec 2010 13:53:36 -0500") Message-ID: <87ppoupwu3.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 7593-done Cc: 7593-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > 1) Start with 'emacs -nw -Q'. We see buffer *scratch* containing the > initial greeting ';; This buffer is for notes . . .'. > > 2) Enter 'M-x occur'. We're now in the minibuffer with prompt > 'List lines matching regexp:'. > > 3) Enter 'a*'. Emacs stops responding. Fixed, thanks. From unknown Tue Aug 19 06:06:59 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 15 Jan 2014 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator