[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new fboundp behavior weird
From: |
Vitalie Spinu |
Subject: |
Re: new fboundp behavior weird |
Date: |
Sun, 30 Dec 2012 12:57:15 +0100 |
User-agent: |
Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.2.91 (gnu/linux) |
>> Vitalie Spinu <address@hidden>
>> on Sun, 30 Dec 2012 11:25:25 +0100 wrote:
>> Thierry Volpiatto <address@hidden>
>> on Sat, 29 Dec 2012 22:36:16 +0100 wrote:
VS> [...]
TV> (defalias 'toto 'titi)
TV> (debugger-special-form-p 'toto) ; Used in 24.2
TV> =>nil ; OK
TV> (special-form-p 'toto) ; Used in 24.3
TV> =>
TV> Debugger entered--Lisp error: (void-function toto)
TV> indirect-function(toto)
TV> (setq object (indirect-function object))
TV> (if (and (symbolp object) (fboundp object)) (setq object
(indirect-function object)))
VS> Interesting. This part from emacs 24.2 debugger-special-form-p is
VS> apparently missing:
VS> (subrp (symbol-function symbol))
VS> Does that mean that emacs 24.3 has special forms that are not built-in?
Well, not really. I have just checked the trunk; indirect-function call
misses 'no-error argument. It probably should be:
Modified lisp/subr.el
diff --git a/lisp/subr.el b/lisp/subr.el
index 1e50903..3b27e7b 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2805,7 +2805,7 @@ Otherwise, return nil."
(defun special-form-p (object)
"Non-nil if and only if OBJECT is a special form."
(if (and (symbolp object) (fboundp object))
- (setq object (indirect-function object)))
+ (setq object (indirect-function object 'no-error)))
(and (subrp object) (eq (cdr (subr-arity object)) 'unevalled)))
(defun field-at-pos (pos)
This fixes the problem.
A slightly off topic naive question. Why is the function cell void by
default and not nil? Is this useful for anything?
Vitalie
Re: new fboundp behavior weird, Andreas Schwab, 2012/12/29
Re: new fboundp behavior weird, Stefan Monnier, 2012/12/30