From 7e03fa2d8291473dac585eeae5e3f710600595c6 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 3 Sep 2023 09:59:16 +0200 Subject: [PATCH] Prefer reusing seq-remove in reftex * lisp/textmodes/reftex.el (reftex-remove-symbols-from-list): Make obsolete in favor of 'seq-remove'. Update single caller. --- lisp/textmodes/reftex.el | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index ae3ae1a198d..0a1fa8580d0 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el @@ -439,7 +439,7 @@ the label information is recompiled on next use." ;; When it is a symbol, remove all other symbols (and (symbolp entry) (not (memq entry list)) - (setq list (reftex-remove-symbols-from-list list))) + (setq list (seq-remove #'symbolp list))) ;; Add to list unless already member (unless (member entry list) (setq reftex-tables-dirty t @@ -1820,15 +1820,6 @@ When DIE is non-nil, throw an error if file not found." (push (pop list) rtn)) (nreverse rtn))) -(defun reftex-remove-symbols-from-list (list) - ;; Remove all symbols from list - (let (rtn) - (while list - (unless (symbolp (car list)) - (push (car list) rtn)) - (setq list (cdr list))) - (nreverse rtn))) - (defun reftex-uniquify (list &optional sort) ;; Return a list of all strings in LIST, but each only once, keeping order ;; unless SORT is set (faster!). @@ -2336,6 +2327,10 @@ Your bug report will be posted to the AUCTeX bug reporting list. (declare (obsolete "use variable `reftex-use-fonts' instead." "30.1")) reftex-use-fonts) +(defun reftex-remove-symbols-from-list (list) + (declare (obsolete seq-remove "30.1")) + (seq-remove #'symbolp list)) + (provide 'reftex) ;;; reftex.el ends here -- 2.39.2