# HG changeset patch # User Carsten Dominik # Date 1108383124 0 # Node ID 978d83f0a49fc081aa2c404d757f7609ccb5ef92 # Parent f704b30efbdf0defc00aacfde29b044b8e4b9d57 (reftex-do-citation): Cleanup single optional argument to \cite. diff -r f704b30efbdf -r 978d83f0a49f lisp/textmodes/reftex-cite.el --- a/lisp/textmodes/reftex-cite.el Mon Feb 14 12:11:02 2005 +0000 +++ b/lisp/textmodes/reftex-cite.el Mon Feb 14 12:12:04 2005 +0000 @@ -679,9 +679,12 @@ (setq start (1+ start))))) ;; Should we cleanup empty optional arguments? ;; if the first is empty, it can be removed. If the second is empty, - ;; it has to go. + ;; it has to go. If there is only a single arg and empty, it can go + ;; as well. (when reftex-cite-cleanup-optional-args (cond + ((string-match "\\([a-zA-Z0-9]\\)\\[\\]{" string) + (setq string (replace-match "\\1{" nil nil string))) ((string-match "\\[\\]\\(\\[[a-zA-Z0-9., ]+\\]\\)" string) (setq string (replace-match "\\1" nil nil string))) ((string-match "\\[\\]\\[\\]" string)