GNU bug report logs - #24245
25.0.93; AUCTeX TeX-function-p

Previous Next

Package: auctex;

Reported by: <4854nw+cqdha1cwehn9k <at> guerrillamail.com>

Date: Tue, 16 Aug 2016 20:28:01 UTC

Severity: wishlist

Done: Mosè Giordano <mose <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Robert Cochran <robert-emacs <at> cochranmail.com>
To: <4854nw+cqdha1cwehn9k <at> guerrillamail.com>
Cc: 24245 <at> debbugs.gnu.org
Subject: bug#24245: 25.0.93; AUCTeX TeX-function-p
Date: Fri, 19 Aug 2016 09:42:24 -0700
<4854nw+cqdha1cwehn9k <at> guerrillamail.com> writes:

> What is the actual purpose of the Lisp function `TeX-function-p' found
> in AUCTeX ‘tex.el’?
>
> (defun TeX-function-p (arg)
>   "Return non-nil if ARG is callable as a function."
>   (or (and (fboundp 'byte-code-function-p)
>        (byte-code-function-p arg))
>       (and (listp arg)
>        (eq (car arg) 'lambda))
>       (and (symbolp arg)
> 	   (fboundp arg))))
>
> How this code is better of `functionp'?
> If there is no actual design improvement of `TeX-function-p' over
> `functionp', the latter is supposed to be faster as it is built-in.

It's not 'better'. A blame of the AUCTeX repository shows that
`TeX-function-p` was written (and last touched) in 1994. The only
history that's in the Emacs repository commit-wise about `functionp`
dates back to 2010, and the files within it show relevant history from
2005 (which aren't in the repo as their own commits). Doubtless it's
hard to pin down without the complete history, but it's likely
`TeX-function-p` was written before `functionp`.

> A similar function, `message-functionp', in `message.el' has been
> removed. See Debian Bug report log #223493.

I'd imagine this case is slightly different, as Gnus is an Emacs builtin
(since 1997 if the logs are accurate), so there's a tighter intergration
with the progression of Emacs than AUCTeX. I'm sure that it's a similar
situation here: the invention of `message-functionp` predates that of
`functionp`.

I'd also like to point out that the original reporter reported it
because he was apparently having autoload issues, so `message-functionp`
wasn't defined, which is probably how it got noticed in the first place.

It's probably a good idea to fix it in the AUCTeX repository by removing
`TeX-function-p` and do a M-% for `functionp` and ensuring nothing gets
borked when you do so. I believe the phrase is "patches welcome". :)

(Disclaimer: This is independent and likely incomplete research, along
with what are my best guesses so far as the history bits. Anyone that
sees I've gotten something wrong or missed an important point, please
report in.)

HTH

-- 
~Robert Cochran

GPG Fingerprint - E778 2DD4 FEA6 6A68 6F26  AD2D E5C3 EB36 4886 8871




This bug report was last modified 8 years and 316 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.