From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Donovan Newsgroups: gmane.emacs.bugs Subject: Re: long_to_cons doesn't always return a cons Date: Mon, 25 Jun 2007 10:48:54 -0400 Message-ID: <20070625144854.GL16296@google.com> References: <20070613160854.7F899D4B5@localhost> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1182782963 4554 80.91.229.12 (25 Jun 2007 14:49:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 25 Jun 2007 14:49:23 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: Richard Stallman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 25 16:49:21 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I2psU-0006DG-Sp for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Jun 2007 16:49:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I2psU-00011Y-Dh for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Jun 2007 10:49:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I2psS-000116-KM for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2007 10:49:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I2psQ-00010M-Qm for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2007 10:49:15 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I2psQ-00010J-NZ for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2007 10:49:14 -0400 Original-Received: from smtp-out.google.com ([216.239.45.13]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I2psO-0000sW-BH; Mon, 25 Jun 2007 10:49:12 -0400 Original-Received: from smtp1.nyc.corp.google.com (smtp1.nyc.corp.google.com [172.26.64.81]) by smtp-out.google.com with ESMTP id l5PEmxs6011017; Mon, 25 Jun 2007 07:49:00 -0700 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=received:date:from:to:cc:subject:message-id:references: mime-version:content-type:content-disposition:in-reply-to:user-agent; b=Uk44XB9K3wOCrr3JFfUsLLzkAzVEZQNOCfN/tv5xleq2+I8PJDwJLuQz70qJK0MI8 mpWT2x+Jw743gLWfzSZiA== Original-Received: from localhost (adonovan.nyc.corp.google.com [172.26.77.66]) by smtp1.nyc.corp.google.com with ESMTP id l5PEmsko024442; Mon, 25 Jun 2007 07:48:54 -0700 Original-Received: by localhost (Postfix, from userid 10556) id 54F86C78B; Mon, 25 Jun 2007 10:48:54 -0400 (EDT) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 X-detected-kernel: Genre and OS details not recognized. X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:15995 Archived-At: On Sun, Jun 17, 2007 at 05:49:12PM -0400, Richard Stallman wrote: > Does this fix it? > > *** fileio.c 22 Mar 2007 11:13:17 -0400 1.580 > --- fileio.c 17 Jun 2007 10:56:38 -0400 > *************** > *** 5692,5702 **** > See Info node `(elisp)Modification Time' for more details. */) > () > { > ! Lisp_Object tcons; > ! tcons = long_to_cons ((unsigned long) current_buffer->modtime); > ! if (CONSP (tcons)) > ! return list2 (XCAR (tcons), XCDR (tcons)); > ! return tcons; > } > > DEFUN ("set-visited-file-modtime", Fset_visited_file_modtime, > --- 5692,5700 ---- > See Info node `(elisp)Modification Time' for more details. */) > () > { > ! if (! current_buffer->modtime) > ! return make_number (0); > ! return make_time ((time_t) current_buffer->modtime); > } > > DEFUN ("set-visited-file-modtime", Fset_visited_file_modtime, I confess I'm not building from CVS but using the emacs-snapshot package instead, so I haven't tested this patch. From the point of view of visited-file-modtime, this change looks good to me. Of course, long_to_cons still doesn't meet its spec in the case where the top 16 bits are zero, so any other place where this function is called might suffer from a similar problem. If I were you, I would additionally update the docstring for long-to-cons and cons-to-long to mention the special treatment of values in this range. cheers alan