[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Warnings in init files (was: Include leaf in Emacs distribution)
From: |
Stefan Monnier |
Subject: |
Warnings in init files (was: Include leaf in Emacs distribution) |
Date: |
Fri, 23 Oct 2020 12:46:23 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> '(leaf server
> :doc "Lisp code for GNU Emacs running as server process"
> :defvar server-temp-file-regexp
> :defun server-running-p
> :config
> (setq server-temp-file-regexp
> (rx-to-string `(or (regexp ,server-temp-file-regexp) ".DS_Store")
> t))
> (unless (server-running-p)
> (server-start))))
That's not the solution I'm looking for since it requires that the user
explicitly silences the warnings using :defvar or :defun (i.e. no real
benefit compared to the "old style" config).
I was thinking of something more like:
(foo server
(setq server-temp-file-regexp
(rx-to-string `(or (regexp ,server-temp-file-regexp) ".DS_Store") t))
(unless (server-running-p)
(server-start)))
This should be sufficient (given a sufficiently clever handling of
`foo`) since you can go look inside `server.el` and find that those
functions and vars are indeed defined.
Of course, this is not the best example, since the old-style works just
as well without any cleverness:
(require 'server)
(setq server-temp-file-regexp
(rx-to-string `(or (regexp ,server-temp-file-regexp) ".DS_Store") t))
(unless (server-running-p)
(server-start)))
Tho I don't recommend this style since `require` is a bad habit in an
init file (in this case it's acceptable since the package will have to
be loaded at this point anyway).
Stefan
- Re: Include leaf in Emacs distribution, (continued)
- Re: Include leaf in Emacs distribution, Stefan Monnier, 2020/10/13
- Re: Include leaf in Emacs distribution, Thibaut Verron, 2020/10/13
- Re: Include leaf in Emacs distribution, Stefan Monnier, 2020/10/13
- Re: Include leaf in Emacs distribution, Thibaut Verron, 2020/10/13
- Re: Include leaf in Emacs distribution, Phil Sainty, 2020/10/18
- Re: Include leaf in Emacs distribution, Caio Henrique, 2020/10/13
- Re: Include leaf in Emacs distribution, Naoya Yamashita, 2020/10/22
- Re: Include leaf in Emacs distribution, John Wiegley, 2020/10/22
- Re: Include leaf in Emacs distribution, Stefan Monnier, 2020/10/23
- Re: Include leaf in Emacs distribution, Naoya Yamashita, 2020/10/23
- Warnings in init files (was: Include leaf in Emacs distribution),
Stefan Monnier <=
- Re: Include leaf in Emacs distribution, T.V Raman, 2020/10/23
- Re: Include leaf in Emacs distribution, Stefan Kangas, 2020/10/23
- Re: Include leaf in Emacs distribution, John Wiegley, 2020/10/23