emacs-devel
[Top][All Lists]
Advanced

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

RE: bug#23873: Emacs 24.0.94: With function argdesc bitstring, Elisp man


From: Drew Adams
Subject: RE: bug#23873: Emacs 24.0.94: With function argdesc bitstring, Elisp manual does not say how to get arg list
Date: Fri, 1 Jul 2016 07:01:34 -0700 (PDT)

> In a few places, Hyperbole uses its own function to overload existing
> functions with its own and needs access to the function's argument
> signature to do this.  For reasons of backward compatibility,
> Hyperbole has not used defadvice.  In another case, we want to know if
> a function's signature has changed for a conditional dispatch.

Not a general solution, but this approach often works if the
signature changed:

(condition-case nil          ; Emacs 22+ accepts a default.
    (read-face-name "Face: " default-face)
  (wrong-number-of-arguments (read-face-name "Face: ")))

Or this:

(condition-case nil
    (funcall cmd arg)         ; Try to use string candidate `arg'.
  ;; If that didn't work, use a symbol or number candidate.
  (wrong-type-argument (funcall cmd (car (read-from-string arg))))
  (wrong-number-of-arguments (funcall #'icicle-help-on-candidate))) ; Punt



reply via email to

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