From: Carsten Dominik Date: Mon, 14 Feb 2005 12:12:04 +0000 (+0000) Subject: (reftex-do-citation): Cleanup single X-Git-Tag: ttn-vms-21-2-B4~2292 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3ee26b0c2088615cae3ead63b22714d54ffee2ae;p=emacs.git (reftex-do-citation): Cleanup single optional argument to \cite. --- diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el index 6369f9637db..bfe2cd8282b 100644 --- a/lisp/textmodes/reftex-cite.el +++ b/lisp/textmodes/reftex-cite.el @@ -679,9 +679,12 @@ While entering the regexp, completion on knows citation keys is possible. (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)