From triska@gmx.at Tue Nov 18 20:01:19 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.8 required=4.0 tests=AWL,BAYES_00,FOURLA, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 19 Nov 2008 04:01:19 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAJ41GTn019905 for ; Tue, 18 Nov 2008 20:01:17 -0800 Received: from mx10.gnu.org ([199.232.76.166]:35633) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L2eFX-0005zG-MN for emacs-pretest-bug@gnu.org; Tue, 18 Nov 2008 23:01:07 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L2eFd-0001aT-BU for emacs-pretest-bug@gnu.org; Tue, 18 Nov 2008 23:01:15 -0500 Received: from mail.gmx.net ([213.165.64.20]:41319) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1L2eFc-0001aJ-QB for emacs-pretest-bug@gnu.org; Tue, 18 Nov 2008 23:01:13 -0500 Received: (qmail invoked by alias); 19 Nov 2008 04:01:10 -0000 Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212] by mail.gmx.net (mp003) with SMTP; 19 Nov 2008 05:01:10 +0100 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX1/9UjoYnQn9jsl6R8uvOnTGhlCi981SUDGeu3H0EW OdtmGXOJRVgjV+ Received: by mt-computer.local (Postfix, from userid 502) id AFF45BBF1F9; Wed, 19 Nov 2008 05:01:09 +0100 (CET) From: Markus Triska To: emacs-pretest-bug@gnu.org Subject: 23.0.60; directory-files unexpectedly non-nil Message-Id: <20081119040109.AFF45BBF1F9@mt-computer.local> Date: Wed, 19 Nov 2008 05:01:09 +0100 (CET) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.5 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Let ~/tmp be initially empty, and create these 7 files in it via: for i in 0085-ottosson.ps.gz 0091-lindgren.ps.gz \ 0104-pettersson-carlsson.ps.gz 0108-carlsson.ps.gz \ 0118-lindgren.ps.gz 1076.pdf apl_slides.pdf; do touch $i; done As expected, (directory-files "~/tmp" nil "nonexistent") then yields "nil". However, after I evaluate (in emacs -Q) the forms: (defun my-log (start end old) (write-region (point-min) (point-min) "/tmp/my-log-file.tmp" t 'silent)) (add-hook 'after-change-functions 'my-log) the new result of (directory-files "~/tmp" nil "nonexistent") is unexpectedly: ("apl_slides.pdf") using OSX. In Ubuntu Intrepid, the new result is, again unexpectedly: ("1076.pdf") In GNU Emacs 23.0.60.2 (i386-apple-darwin8.11.1, GTK+ Version 2.12.9) of 2008-11-05 on mt-computer.local Windowing system distributor `The XFree86 Project, Inc', version 11.0.40400000 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.UTF-8 value of $XMODIFIERS: nil locale-coding-system: nil default-enable-multibyte-characters: t From cyd@stupidchicken.com Sat Dec 6 17:02:23 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.0 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1374-done) by emacsbugs.donarmstrong.com; 7 Dec 2008 01:02:24 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB712L6K021653 for <1374-done@emacsbugs.donarmstrong.com>; Sat, 6 Dec 2008 17:02:22 -0800 Received: by cyd.mit.edu (Postfix, from userid 1000) id 4C04457E1D1; Sat, 6 Dec 2008 20:02:24 -0500 (EST) From: Chong Yidong To: Markus Triska Cc: 1374-done@debbugs.gnu.org Subject: Re: 23.0.60; directory-files unexpectedly non-nil Date: Sat, 06 Dec 2008 20:02:24 -0500 Message-ID: <87d4g44x27.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii This bug arose because the after-change-functions were triggered in the code conversion work buffer, whereas directory-files assumed that decoding a file name does not run arbitrary elisp code (otherwise, a compiled regexp gets corrupted). I've changed it so that inhibit-modification-hooks is disabled in the code conversion buffer. Thanks for the bug report. From markus.triska@gmx.at Sun Dec 7 00:49:45 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.9 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1374-done) by emacsbugs.donarmstrong.com; 7 Dec 2008 08:49:45 +0000 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id mB78nfhd011400 for <1374-done@emacsbugs.donarmstrong.com>; Sun, 7 Dec 2008 00:49:43 -0800 Received: (qmail invoked by alias); 07 Dec 2008 08:49:35 -0000 Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212] by mail.gmx.net (mp010) with SMTP; 07 Dec 2008 09:49:35 +0100 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX1+hmzlqymehDxVMqnFtborF2JDDkLKN7YszShGFnA WHHeUHlxP7iwX+ Received: by mt-computer.local (Postfix, from userid 502) id 918B2BD9C5A; Sun, 7 Dec 2008 09:49:29 +0100 (CET) From: Markus Triska To: Chong Yidong Cc: 1374-done@debbugs.gnu.org Subject: Re: 23.0.60; directory-files unexpectedly non-nil References: <87d4g44x27.fsf@cyd.mit.edu> Date: Sun, 07 Dec 2008 09:49:29 +0100 In-Reply-To: <87d4g44x27.fsf@cyd.mit.edu> (Chong Yidong's message of "Sat, 06 Dec 2008 20:02:24 -0500") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Y-GMX-Trusted: 0 X-FuHaFi: 0.71 Chong Yidong writes: > compiled regexp gets corrupted). I've changed it so that > inhibit-modification-hooks is disabled in the code conversion buffer. Thank you; an unfortunate consequence is that modifications of the code conversion buffer can now no longer be traced by after-change-functions; I'm trying to trace down a different problem (#1125), and would like to log buffer modifications as completely as possible. Is there a better fix for this problem, i.e., can the regexp be preserved differently? From cyd@stupidchicken.com Sun Dec 7 06:11:36 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.0 required=4.0 tests=AWL,BAYES_00,FOURLA autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1374-done) by emacsbugs.donarmstrong.com; 7 Dec 2008 14:11:36 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB7EBXLj014069 for <1374-done@emacsbugs.donarmstrong.com>; Sun, 7 Dec 2008 06:11:34 -0800 Received: by cyd.mit.edu (Postfix, from userid 1000) id 97DCA57E1D3; Sun, 7 Dec 2008 09:11:36 -0500 (EST) From: Chong Yidong To: Markus Triska Cc: 1374-done@debbugs.gnu.org Subject: Re: 23.0.60; directory-files unexpectedly non-nil References: <87d4g44x27.fsf@cyd.mit.edu> Date: Sun, 07 Dec 2008 09:11:36 -0500 In-Reply-To: (Markus Triska's message of "Sun, 07 Dec 2008 09:49:29 +0100") Message-ID: <87zlj8f52f.fsf@cyd.mit.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Markus Triska writes: > Chong Yidong writes: > >> compiled regexp gets corrupted). I've changed it so that >> inhibit-modification-hooks is disabled in the code conversion buffer. > > Thank you; an unfortunate consequence is that modifications of the code > conversion buffer can now no longer be traced by after-change-functions; > I'm trying to trace down a different problem (#1125), and would like to > log buffer modifications as completely as possible. Is there a better > fix for this problem, i.e., can the regexp be preserved differently? In general, I think we don't want to let user code run during code conversion, because there may be other situations like this. For the purposes of your bug tracking, try reverting the change I made, and changing directory_files_internal so that it recompiles the regexp after each call to DECODE_FILE: *** trunk/src/dired.c.~1.157.~ 2008-11-10 14:07:49.000000000 -0500 --- trunk/src/dired.c 2008-12-07 09:07:19.000000000 -0500 *************** *** 153,176 **** GCPRO5 (match, directory, list, dirfilename, encoded_directory); dirfilename = Fdirectory_file_name (directory); - if (!NILP (match)) - { - CHECK_STRING (match); - - /* MATCH might be a flawed regular expression. Rather than - catching and signaling our own errors, we just call - compile_pattern to do the work for us. */ - /* Pass 1 for the MULTIBYTE arg - because we do make multibyte strings if the contents warrant. */ - # ifdef WINDOWSNT - /* Windows users want case-insensitive wildcards. */ - bufp = compile_pattern (match, 0, - buffer_defaults.case_canon_table, 0, 1); - # else /* !WINDOWSNT */ - bufp = compile_pattern (match, 0, Qnil, 0, 1); - # endif /* !WINDOWSNT */ - } - /* Note: ENCODE_FILE and DECODE_FILE can GC because they can run run_pre_post_conversion_on_str which calls Lisp directly and indirectly. */ --- 153,158 ---- *************** *** 179,187 **** encoded_directory = (STRING_MULTIBYTE (directory) ? ENCODE_FILE (directory) : directory); - /* Now *bufp is the compiled form of MATCH; don't call anything - which might compile a new regexp until we're done with the loop! */ - BLOCK_INPUT; d = opendir (SDATA (dirfilename)); UNBLOCK_INPUT; --- 161,166 ---- *************** *** 242,247 **** --- 221,237 ---- immediate_quit = 1; QUIT; + if (!NILP (match)) + { + CHECK_STRING (match); + # ifdef WINDOWSNT + bufp = compile_pattern (match, 0, + buffer_defaults.case_canon_table, 0, 1); + # else /* !WINDOWSNT */ + bufp = compile_pattern (match, 0, Qnil, 0, 1); + # endif /* !WINDOWSNT */ + } + if (NILP (match) || (0 <= re_search (bufp, SDATA (name), len, 0, len, 0))) wanted = 1; From unknown Mon Aug 18 14:19:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Wed, 14 Jan 2009 15:24:04 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator