[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: long_to_cons doesn't always return a cons
From: |
Alan Donovan |
Subject: |
Re: long_to_cons doesn't always return a cons |
Date: |
Mon, 25 Jun 2007 10:48:54 -0400 |
User-agent: |
Mutt/1.5.11 |
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