Vaddi3 · 2022-10-21 15:02
If we evaluate
(describe-symbol 'features)
and go to the last element of the list we are going to find an `emacs` feature. What does it provide? All we get from evaluating `(describe-symbol 'emacs)` is `1`, and `(describe-package 'emacs)` doesn't give us much information either:
> Package emacs is built-in.
>
> Status: Built-In.
>
> Version: 28.2
>
> Summary: the extensible text editor
Also, is this "package" related to the commonly used practice, when using `use-package`, of writing something like
(use-package emacs
:init
(setq create-lockfiles nil))
to keep things organized?
usaoc · 2022-10-21 15:12
See [the initialization of `features` in `fns.c`](https://github.com/emacs-mirror/emacs/blob/693443bbf7d87e5508fe109f35d81e064400f3db/src/fns.c#L6193).
Vaddi3 · 2022-10-21 15:14
I can't read C code :(
usaoc · 2022-10-21 15:16
Well, the equivalent Lisp code is basically `(defvar features (list 'emacs) "…")`, so nothing actually `provide`s `emacs` in a sense.
Vaddi3 · 2022-10-21 15:18
so is it "providing" the C parts of Emacs?
usaoc · 2022-10-21 15:30
Maybe. It was added in Emacs 22.1, but I can’t tell what the exact rationale was as the [commit message](https://github.com/emacs-mirror/emacs/commit/780a7814436dd62e3a1e8a888fde43fb899dcfdc) didn’t mention anything.
DPaluche · 2022-10-21 18:17
Wrapping vanilla emacs config in a use package seems pretty silly to me.
arthurno1 · 2022-10-21 19:39
It is not silly, it let's one gather all loose config piece into one-spot instead of having them scattered around in your init file and you can also use some of use-package features to control when the code is executed, syntax for defining keys, diminishing modes on mode-line etc. It let's one create more structured code, so I understand those users. I don't know, at least I think so, I don't use use-package since few years back, so I may be wrong :-). Of course you don't need to do so., With some discipline [or some other waysl](https://github.com/amno1/.emacs.d/blob/main/init.org) it is possible to achieve similar well structured setup, lazy loading etc.
thblt · 2022-10-21 21:26
Something to do with package.el maybe, so a package can declare a dependency on a specific version of `emacs` without having the package system try to find a package with that name?
vifon · 2022-10-21 22:20
Unlikely as package.el was introduced in Emacs 24.1
[deleted] · 2022-10-22 00:35
There are these two young fish swimming along and they happen to meet an older fish swimming the other way, who nods at them and says “Morning, boys. How’s the water?” And the two young fish swim on for a bit, and then eventually one of them looks over at the other and goes “What the hell is water?”
qZeta · 2022-10-22 06:17
> doesn't give us much information either:
Ah, but it does: it has a package version, and thus can be used within `Package-Requires`, e.g.
;; Package-Requires: ((emacs "25.1"))
This allows package maintainers to specify the required minimum Emacs version.
takutekato · 2022-10-22 07:21
I don't know really, but for my (somtimes) dynamically produced `eval-after-load` expression, I use `'emacs` as the feature to have that executed instantly as it's always loaded.
cinquante28 · 2022-10-23 23:36
I use it as a `#ifdef preprocessor` if i want to wrap some commands to false i.e: `(when (not (featurep 'emacs)) disabled-things)`