[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Why is defun not executed during load-file?
From: |
Jean Louis |
Subject: |
Why is defun not executed during load-file? |
Date: |
Sun, 30 May 2021 12:02:25 +0300 |
I have this in the hyperscope.el and upon load-file the last function
is not executed, it does not generate the functions. But if I evaluate
it specifically, it generates functions.
Is there any reason for that?
(defun hyperscope-generate-the-add-function-by-hyperdocument-type (type-name id
function-name)
(eval `(defun ,(intern (symbol-name function-name)) ()
,(format "Add new `%s' hyperdocument to Hyperscope." type-name)
(interactive)
(let* ((parent (hyperscope-select-set))
(prompt ,(format "New `%s' hyperdocument name: " type-name))
(name (read-from-minibuffer prompt)))
(hlink-add-generic name "" ,id parent nil)))))
(defun hyperscope-generate-add-functions-by-hyperdocument-types ()
(let ((types (hyperscope-hyperdocument-types)))
(while types
(let* ((type (pop types))
(id (nth 0 type))
(type (nth 1 type))
(type-name type)
(type (downcase (string-replace " " "-" type)))
(function-name (intern (format
"hyperscope-add-new-%s-hyperdocument" type))))
(hyperscope-generate-the-add-function-by-hyperdocument-type type-name
id function-name)))))
(hyperscope-generate-add-functions-by-hyperdocument-types)
- Why is defun not executed during load-file?,
Jean Louis <=
Re: Why is defun not executed during load-file?, Emanuel Berg, 2021/05/30