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

Re: If w3m-init-file is nil

In [emacs-w3m : No.11358] Leo wrote:
> At the end of w3m.el,

> (unless noninteractive
>   (if (string-match "\\.el\\'" w3m-init-file)
>       (or (load (concat w3m-init-file "c") t t t)
> 	  (load w3m-init-file t t t))
>     (load w3m-init-file t t))
>   (run-hooks 'w3m-load-hook))

> does not check whether w3m-init-file is a file or not. For example if I
> set it to nil in my init file, that form throws an error.

> So I suggest maybe checking w3m-init-file is string before doing
> string-match.

Its custom type is `file', i.e. a string:

;; wid-edit.el
(define-widget 'file 'string

You can set it to nil of course, but should we add nil-checks
also to every user option of which the type is string?