emacs-devel
[Top][All Lists]
Advanced

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

check argument count in defcustom :safe?


From: Stephen Leake
Subject: check argument count in defcustom :safe?
Date: Sat, 11 Apr 2015 10:42:32 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt)

I have changed the signature of a defcustom variable; it used to require
a function taking 2 args, now it takes 3. So I'd like to have the :safe
predicate check the argument count, not just `functionp'.

The argument count is only available for byte-compiled functions, so I'd
have to skip that check for non-compiled. But most of the time, the
check will be useful.

The low-level C code that executes byte code checks the argument count,
but I don't see any way to access the argument count from lisp. Am I
missing something?

To be specific, here's the defcustom:

(defcustom ada-case-identifier 'ada-mixed-case
  "..."
  :type '(choice (const ada-mixed-case)
                 (const ada-lower-case)
                 (const ada-upper-case))
  :group 'ada
  :safe  'functionp)

What can I add to the :safe expression to check the argument count?

-- 
-- Stephe



reply via email to

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