It seems strange that you want to do it, but you could do it by recommending a function, I suppose. Example:
(defadvice * (around ultimate-answer activate) (if (and (eq major-mode 'html-mode) (equal (ad-get-args 0) '(6 9))) (setq ad-return-value 42) ad-do-it))
After evaluating this advice, the * function will return 42 if it is given two arguments 6 and 9, but only in html-mode.
Sean
source share