auctex
[Top][All Lists]
 On Jan 6, 2011, at 1:21 PM, Massmann, M. (Michael) wrote:Dear all,I'm sorry noone has gotten back to you yet (unless they did sooff list).I’m new to Emacs: I hope my question is not too stupid.Welcome.I’m trying to augment my LaTeX-math-list by a keybinding to insert \mathsf{}, akin to the \mathcal{} provided by Auctex by default. Actually I'm pretty sure that it provides \mathsf{} as well.  Seefor example LaTeX-font-list, but perhaps you wanted somethingelse.  Ah, now I see that  c x inserts \mathcal{x}.I have added (?\M-s LaTeX-math-sf) to LaTeX-math-list and then defined (defun LaTeX-math-sf (char)  "Insert a {\\mathscr CHAR}."  (insert "\\mathsf{" (char-to-string char) "}")) Yet when I execute the keybinding I get an error message saying: “Wrong type argument: commandp, LaTeX-math-sf”In Emacs, a command is a special type of function which can becalled by the used.  It has to have an "interactive"specification so that Emacs knows how to get the argument whencalled from a keybinding.  So something like(defun LaTeX-math-sf (char)  "Insert a {\\mathscr CHAR}."  (interactive "*c")  (insert "\\mathsf{" (char-to-string char) "}"))should work.  In fact, if I were you, I would just copyLaTeX-math-cal' and change the \mathcal to \mathsf.  That wayyou know it's going to work the same for both.I’d be most grateful if someone could indicate what I’m doing wrong. Any hint is most welcome. Thanks!I hope that helps.-Ivan