bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#55163: 29.0.50; master 4a1f69ebca (TICKS . HZ) for current-time brok


From: Eli Zaretskii
Subject: bug#55163: 29.0.50; master 4a1f69ebca (TICKS . HZ) for current-time broke lsp-mode
Date: Fri, 29 Apr 2022 13:54:03 +0300

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: 55163@debbugs.gnu.org,  Eli Zaretskii <eliz@gnu.org>,  Vincenzo Pupillo
>  <v.pupillo@gmail.com>
> Date: Fri, 29 Apr 2022 11:54:07 +0200
> 
> Lars Ingebrigtsen <larsi@gnus.org> writes:
> 
> > Thanks; makes sense to me.  And it was worth a try to modernise these
> > functions, but it doesn't seem like the world is ready yet (and it's
> > hard to see a practical way forward without deprecating all the current
> > time-related functions and creating new ones, which we probably don't
> > want to do).
> 
> Thinking about this slightly more, perhaps it's worth doing?  Because we
> currently have some interfaces in this area that could be more efficient
> or elegant.
> 
> The time functions commonly used are don't have particularly
> discoverable names -- current-time and float-time are probably the ones
> used most.  Another common source of times are
> (file-attribute-modification-time (file-attributes ...)), which is
> commonly called in loops, and generates a lot of unnecessary garbage.
> 
> So perhaps we could come up with a set of new functions in this area
> that are more efficient and avoid using the old time formats.
> 
> Off the top of my head, we could have
> (file-attribute file 'modification-time) (i.e., have a &rest to specify
> the attributes, and don't return a list if there's one attribute, which
> is common).  And we could have `time' instead of `current-time', with
> (time 'float) instead of `float-time' and even (time 'decoded) instead
> of `decode-time'.  Or `time-float', `time-decoded' with no parameters...
> 
> And so on.  That is, I think this might be an opportunity to overhaul
> Emacs in this area -- introduce efficient functions with consistent
> naming, and then obsolete the old ones after a while.

I don't understand how this is related to making the time rfesolution
explicit in time objects.  The main problem in that area wa how we can
know the resolution of each timestamp, not how to expose that to Lisp.

In the particular example you mention, how can Emacs know what is the
resolution of a file's last modification time?

What did I miss?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]