I have a collection of alists, ptc-1
through ptc-5
. Would it be possible
to make the following code more compact, rather having to add more sections
if there are more alists?
(let ( (v "") )
(setq v (cdr (assoc word ptc-1)))
(unless (null v)
(add-to-list 'ptc
(replace-regexp-in-string word v word)))
(setq v (cdr (assoc word alist-2)))
(unless (null v)
(add-to-list 'ptc
(replace-regexp-in-string word v word)))
(setq v (cdr (assoc word alist-3)))
(unless (null v)
(add-to-list 'ptc
(replace-regexp-in-string word v word)))
(setq v (cdr (assoc word alist-4)))
(unless (null v)
(add-to-list 'ptc
(replace-regexp-in-string word v word)))
(setq v (cdr (assoc word alist-5)))
(unless (null v)
(add-to-list 'ptc
(replace-regexp-in-string word v word))) )