help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Non-matching string failing alist search


From: uzibalqa
Subject: Non-matching string failing alist search
Date: Sun, 21 Aug 2022 23:38:15 +0000

I am adding to a list `scrip' but when `word' is not present in the `car' 
values 
of `alist-t1' I get an error.  

Debugger entered--Lisp error: 
(void-function nil)  nil(#("yoor" 0 5 (fontified t))) 
replace-regexp-in-string(#("yoor" 0 5 (fontified t)) nil #("yoor" 0 5 
(fontified t))) 
(add-to-list 'nscrip

What can I do in the case that the string passed to word does not exist in 
`alist-t1'?  


    (defconst alist-t1 '( ("year" . "2022") ))

    (add-to-list 'nscrip
       (replace-regexp-in-string
        word (cdr (assoc word alist-t1))
        word))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]