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

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

Re: Why is defun not executed during load-file?


From: Emanuel Berg
Subject: Re: Why is defun not executed during load-file?
Date: Sun, 30 May 2021 21:56:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier wrote:

> Try to `M-: macroexpand-all '(defun
> hyperscope-generate-add-functions-by-hyperdocument-types
> ...)) to see that your code doesn't do what you think:
> `hyperscope-generate-add-functions-by-hyperdocument-types`
> needs to be a macro.

OK, in this case you mean?

Because in general you don't need a macro to generate
a function?

I wrote this:

(defmacro file-to-variable (file var)
  `(setq ,var ,(file-to-string file)) )

(defmacro file-to-variable-integer (file var)
  `(setq ,var ,(string-to-number (file-to-string file))) )

I wrote that to get a function? Don't remember...

https://dataswamp.org/~incal/emacs-init/file-write-to.el

Also from the unofficial code:

(defun syms-status (sym-list)
  (mapcar (lambda (s) (list s (symbol-value s))) sym-list))

(defmacro vars-status (&rest sym-list)
  `(syms-status ',sym-list))

Also don't remember :)

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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