# -*- mode: snippet -*- # name: bar # key: bar # type: command # condition: (and (texmathp) 'auto) # group: math # -- (let ((argument t)) (condition-case nil (progn (backward-sexp) (kill-sexp) (delete-char 1)) (error (setq argument 'nil))) (insert "\\bar{" (if argument (current-kill 0) "") "}"))