679 |
(setq start (1+ start))))) |
(setq start (1+ start))))) |
680 |
;; Should we cleanup empty optional arguments? |
;; Should we cleanup empty optional arguments? |
681 |
;; if the first is empty, it can be removed. If the second is empty, |
;; if the first is empty, it can be removed. If the second is empty, |
682 |
;; it has to go. |
;; it has to go. If there is only a single arg and empty, it can go |
683 |
|
;; as well. |
684 |
(when reftex-cite-cleanup-optional-args |
(when reftex-cite-cleanup-optional-args |
685 |
(cond |
(cond |
686 |
|
((string-match "\\([a-zA-Z0-9]\\)\\[\\]{" string) |
687 |
|
(setq string (replace-match "\\1{" nil nil string))) |
688 |
((string-match "\\[\\]\\(\\[[a-zA-Z0-9., ]+\\]\\)" string) |
((string-match "\\[\\]\\(\\[[a-zA-Z0-9., ]+\\]\\)" string) |
689 |
(setq string (replace-match "\\1" nil nil string))) |
(setq string (replace-match "\\1" nil nil string))) |
690 |
((string-match "\\[\\]\\[\\]" string) |
((string-match "\\[\\]\\[\\]" string) |