emacs-devel
[Top][All Lists]
Advanced

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

Two questions about thumbs.el


From: Juanma Barranquero
Subject: Two questions about thumbs.el
Date: Mon, 26 Apr 2004 15:31:02 +0200

Fist: There are a few .el files with no copyright and no comment about
them being in the public domain.

Most of them are quite small or even trivial:

  forms-d2.el
  forms-pass.el
  patcomp.el
  obsolete/sc.el
  term/apollo.el
  term/bobcat.el
  term/vt*.el

but thumbs.el is a 700+ lines file. Shouldn't it have a copyright line?


Now, the real question:

(when (not (fboundp 'time-less-p))
  (defun time-less-p (t1 t2)
    "Say whether time T1 is less than time T2."
    (or (< (car t1) (car t2))
        (and (= (car t1) (car t2))
             (< (nth 1 t1) (nth 1 t2))))))

This code introduces a symbol time-less-p, which could confuse feature
checks. Wouldn't it be better:

(if (fboundp 'time-less-p)
    (defalias 'thumbs-time-less-p 'time-less-p)
  (defun thumbs-time-less-p (t1 t2)
    "Say whether time T1 is less than time T2."
    (or (< (car t1) (car t2))
        (and (= (car t1) (car t2))
             (< (nth 1 t1) (nth 1 t2)))))))


Third question (yeah, I lied on the subject): There are at least eight
versions of the time-less-p code:

calendar/time-date: time-less-p
calendar/timeclock: timeclock-time-less-p
pcomplete:          pcomplete-time-less-p
speedbar:           speedbar-check-obj-this-line (fragment)
thumbs:             time-less-p
autoload:           autoload-before-p
eshell/esh-util:    eshell-time-less-p
net/tramp-smb:      tramp-smb-time-less-p (fragment)

speedbar, eshell and tramp have a life outside of Emacs, so they need
their own definitions for compatibility, but the others could be
"reunified" by using calendar/time-date's version (time-date.elc is
quite small, about 4K).

Is there any reason not to do it, other than not wanting them to load
calendar/time-date.elc?

Note: I'm not sure about autoload, because without testing it I don't
know if there'll be a problem for autoload to use an autoloaded function.

                                                                Juanma







reply via email to

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