From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: master 941a2e7: todo-mode: don't assume an ordering of tests Date: Tue, 30 May 2017 20:48:56 -0400 Message-ID: References: <20170530005055.14646.47570@vcs0.savannah.gnu.org> <20170530005057.4720C20ACA@vcs0.savannah.gnu.org> <87vaoiafgf.fsf@rosalinde> <877f0y9l7g.fsf@rosalinde> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1496191783 1114 195.159.176.226 (31 May 2017 00:49:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 31 May 2017 00:49:43 +0000 (UTC) User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) Cc: emacs-devel@gnu.org To: Stephen Berman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 31 02:49:36 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFrpQ-0008O1-OG for ged-emacs-devel@m.gmane.org; Wed, 31 May 2017 02:49:36 +0200 Original-Received: from localhost ([::1]:56842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFrpV-0003mo-Pk for ged-emacs-devel@m.gmane.org; Tue, 30 May 2017 20:49:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFros-0003mi-1E for emacs-devel@gnu.org; Tue, 30 May 2017 20:49:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFror-0001UX-42 for emacs-devel@gnu.org; Tue, 30 May 2017 20:49:02 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFron-0001RX-Dt; Tue, 30 May 2017 20:48:57 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1dFrom-0001Z8-Re; Tue, 30 May 2017 20:48:56 -0400 X-Spook: Narco banners Bridge assassination Sundevil BROMURE X-Ran: {S53S_r=;"Rhoa^``(aH".(*2k[2:@tU}>Z<=&j@%v}qgaIB<6~%w*kK|0lB#JoboVETdd X-Hue: yellow X-Attribution: GM In-Reply-To: <877f0y9l7g.fsf@rosalinde> (Stephen Berman's message of "Tue, 30 May 2017 21:52:03 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215359 Archived-At: Stephen Berman wrote: > Do you have any idea why our results differ? I have no idea how todo-default-todo-file can get set to the right value for you. (Maybe it's because you have files in ~/.emacs.d/todo, and I don't?) > This backtrace means that the variables todo-current-todo-file, > todo-global-current-todo-file, and todo-default-todo-file all evaluated > to nil. I don't see how that could happen with the test file, and when > I start Emacs with -Q, eval the test file, instrument todo-show, run ert > on the test todo-test-item-highlighting, and step through todo-show and > todo-check-file, I see that todo-default-todo-file gets assigned > todo-test-1.todo from the todo-resources directory as its value. todo-default-todo-file is a variable defined in 'todo-mode.el' Its value is nil Original value was "todo-test-1" It is nil because the test file requires todo-mode before it sets todo-directory. It mismatches its default because the default changes when todo-directory does. (This seems to me like a not great way for a defcustom to behave.) So another solution that works for me is to not require todo-mode till after you set todo-directory. As the FIXME comment in the test file indicates, this setting of global variables isn't a good way to behave. BTW, the test will hang with a "Do you want to convert.." prompt if an old todo file exists in ~/.emacs.d. Maybe make a macro that sets HOME to a temporary directory with a copy of the input files, and use it in each test. > So I have no idea how this error could arise. And I also don't see > how adding the sexp `(todo-test-get-archive 2)' prevents it, since > that just displays the file todo-test-1.toda in todo-archive-mode (and > that file becomes the buffer-local value of todo-current-todo-file). > > Can you reproduce the error, Yes. > and if so, could you try debugging it? See above. :) > if you don't have time for that, could you tell me why you used that > specific change to avoid the error? I looked at it very briefly, and thought: "nothing is telling todo-test-item-highlighting which source file to use; todo-test-get-archive is the only place in the file that seems to set a source file; I'll stick that in; now it works.".