summaryrefslogtreecommitdiff
path: root/lisp/textmodes/reftex-cite.el
diff options
context:
space:
mode:
authorCarsten Dominik <dominik@science.uva.nl>2005-02-14 12:12:04 +0000
committerCarsten Dominik <dominik@science.uva.nl>2005-02-14 12:12:04 +0000
commit3ee26b0c2088615cae3ead63b22714d54ffee2ae (patch)
tree15ae4a8a32bd551794d2923e69c3e94ab2543a24 /lisp/textmodes/reftex-cite.el
parenta4869139832f3cc3f54cc1aa1c5b45a0e26e9655 (diff)
downloademacs-3ee26b0c2088615cae3ead63b22714d54ffee2ae.tar.gz
(reftex-do-citation): Cleanup single
optional argument to \cite.
Diffstat (limited to 'lisp/textmodes/reftex-cite.el')
-rw-r--r--lisp/textmodes/reftex-cite.el5
1 files changed, 4 insertions, 1 deletions
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)