Mercurial > emacs
comparison lisp/textmodes/reftex-cite.el @ 60056:978d83f0a49f
(reftex-do-citation): Cleanup single
optional argument to \cite.
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Mon, 14 Feb 2005 12:12:04 +0000 |
parents | a588c86a429c |
children | 58a53f588384 7e3f621f1dd4 |
comparison
equal
deleted
inserted
replaced
60055:f704b30efbdf | 60056:978d83f0a49f |
---|---|
677 (setq nth (1+ nth))))) | 677 (setq nth (1+ nth))))) |
678 (setq string (replace-match (concat "[" value "]") t t string)) | 678 (setq string (replace-match (concat "[" value "]") t t string)) |
679 (setq start (1+ start))))) | 679 (setq start (1+ start))))) |
680 ;; Should we cleanup empty optional arguments? | 680 ;; Should we cleanup empty optional arguments? |
681 ;; if the first is empty, it can be removed. If the second is empty, | 681 ;; if the first is empty, it can be removed. If the second is empty, |
682 ;; it has to go. | 682 ;; it has to go. If there is only a single arg and empty, it can go |
683 ;; as well. | |
683 (when reftex-cite-cleanup-optional-args | 684 (when reftex-cite-cleanup-optional-args |
684 (cond | 685 (cond |
686 ((string-match "\\([a-zA-Z0-9]\\)\\[\\]{" string) | |
687 (setq string (replace-match "\\1{" nil nil string))) | |
685 ((string-match "\\[\\]\\(\\[[a-zA-Z0-9., ]+\\]\\)" string) | 688 ((string-match "\\[\\]\\(\\[[a-zA-Z0-9., ]+\\]\\)" string) |
686 (setq string (replace-match "\\1" nil nil string))) | 689 (setq string (replace-match "\\1" nil nil string))) |
687 ((string-match "\\[\\]\\[\\]" string) | 690 ((string-match "\\[\\]\\[\\]" string) |
688 (setq string (replace-match "" t t string))))) | 691 (setq string (replace-match "" t t string))))) |
689 (insert string)) | 692 (insert string)) |