reddit / emacs

Reminder: use-package is not part of stock Emacs

flexibeast · 2022-08-06 13:58
`use-package` is not part of stock Emacs, so it can't be assumed that it's installed and available for an arbitrary Emacs user. Any `use-package`-based instructions for installing and setting up a package should also be accompanied by instructions that don't require its presence. Otherwise, it might present problems for new Emacs users who aren't using a `use-package`-based Emacs distro. (i don't have `use-package` installed myself, not because i have anything against it, but just because i haven't felt any need to move my decades-old config of thousands of lines across to using it.)
nv-elisp · 2022-08-06 14:16
It will be eventually. It's in the works. use-package declarations are a clean way to show common configuration options, too. Its a duplication of effort for every package to instruct new users how to install and load packages. At most, I'd recommend pointing them to the appropriate documentation.
Horrih · 2022-08-06 14:24
Well i disagree. For some simple packages, why not. But some of the more complicated ones can have a wiki thousands of lines long. This could mean duplicating everything, but in the verbose standard emacs way. This dillutes information and requires more maintainance from the devs A use package example should be mostly trivially translated to standard emacs custom/eval-after-load/require. On a side note, use-package is if i remember well on the way to get merged. It was gathering FSF agreements from contributors. And its maintainer john Wiegley, is also the current emacs lead.
thetemp_ · 2022-08-06 15:35
I agree with this. If use-package does become part of stock Emacs, great. But until then, it shouldn't be assumed that anyone has it installed, especially someone who's new to Emacs. The assumption should be that if you use use-package, you already know how it works and can translate regular elisp into your favored use-package keywords. The other direction makes no sense, because you can't expect people who don't use use-package to have studied exactly what use-package does. Seems ironic that a package improves convenience for so many but also creates a barrier to entry for newer ones. The biggest benefit I saw when I was using use-package was that it sets up autoloads for everything. But when you're talking about a package that you maintain, why would you rely on use-package to do that? Most packages I've looked at already have any necessary autoloads set up. At one point someone here told me that I didn't need use-package. Turned out they were right. It's just as easy (and more visually appealing) to use page breaks with header comments to organize my configuration. I do have a few macros to help with functions that are frequent and verbose, but they aren't strictly necessary. So I came to the conclusion for myself that use-package was overkill. Obviously, that's just an opinion. Personally, I think people should be able to configure any package via the Easy Customization interface, even for setting keybindings... But everybody seems to hate the Easy Customization interface for some reason, so that idea probably isn't going anywhere.
vifon · 2022-08-06 15:48
A companion reminder to this one: `use-package-always-ensure` isn't enabled by default either. While not having `use-package` installed has a relatively obvious fix, having it installed and getting instructions assuming `use-package-always-ensure` is non-nil can be quite more confusing for the new users.
[deleted] · 2022-08-06 15:55
[deleted]
[deleted] · 2022-08-06 16:40
[deleted]
jcmkk3 · 2022-08-06 18:06
I'm always happy to see more examples. A couple of examples (of varying complexity) would be: - [protesilaos](https://protesilaos.com/emacs/dotemacs) - [crafted-emacs](https://github.com/SystemCrafters/crafted-emacs) - [cosine.blue](https://git.sr.ht/~chambln/dots/tree/master/item/pkgs/emacs)
SingilarityZero · 2022-08-06 19:07
Been using emacs for a bit, never really got to a vanilla install, always used a distro. Tried a vanilla install and didn't know use package wasn't vanilla (I just assumed seeing it was so widespread in readme's) . I would have appreciated seeing this earlier. I do get the counter arguments though, a worthwhile compromise might be asking some of the big packages to do this, seeing as they were the first ones you reach for as a beginner. At the end of the day it's just a slight detour on a beginner's journey.
guitmz · 2022-08-06 19:55
While I like use-package, I currently don’t use it and it is still comfortable (maybe even more obvious than with it?). I am still a beginner and my opinion can change but it is fun to know how to go by without it
guitmz · 2022-08-06 19:56
Look for spartan-emacs too
frozeninfate · 2022-08-06 21:40
Not OP, but here is mine: https://github.com/accelbread/dotfiles/tree/master/emacs I used to use use-package, but it caused me more pain than it helped, so I ended up getting rid of it. With use-package its hard to configure things unless you are just using packages with a few settings flipped, and it forces you into organizing your configuration per used package rather than by intent and functionality. I also now just use page breaks to organize my config.
manphiz · 2022-08-06 22:54
I remember that the fundamental issue is the license, which is why use-package is in melpa instead of GNU elpa. To be considered to be GNU elpa compatible, all code owners have to sign the agreement to change the code license which is almost impossible to happen.
arthurno1 · 2022-08-06 22:54
They can just assume vanilla Emacs as Emacs devs assume themselves and write M-x package-install *insert-your-package-name-here* RET. I don't see why every person feel obliged to list use-package, straight, quelpa, and god knows what more. I understand people are trying to be helpful, but in some cases it is more helpful to actually not be too helpful. I personally assume that if someone prefer straight to included package.el or use-package, they will know how or at least bother to lookup how to use those tools. Not to be rude or to be against any package or so, just a practical thing.
arthurno1 · 2022-08-06 23:29
> IMO this is fairly similar to someone who runs Linux From Scratch on their workstation complaining that repo READMEs only cover installing using a package manager and not installing via `configure && make && make install. Your analogy is not really at the point. Someone running LFS wouldn't download a .rpm or .deb or whichever is your brand and try to install that. They would download the original source in compressed tar format, or nowadays cloned it from public repository, and follow whatever instructions are included with the sources, /configure & co, cmake, scons whatever. I guess Op is referring to instructions often fond in public repos which are rather installation from the "original source" than from the .deb or .rpm. > There are strong arguments as to why use-package or something similar (I prefer straight.el w/ use-package wrapper.) is a better workflow for those +/- 2 STDDEV of the media in the userbase. If you choose to live outside those boundaries then you assume some responsibility as a consequence. The Op is talking about instructions in Readme files. You are regressing. You might be correct, and it might be better workflow, or it might not be that at all, but it does not matter here, since it is a different discussion. You are regressing. Until use-package is not part of official Emacs and is not included in the core, you can't assume people have it installed. It is not about use-package be or not to be. > If you choose to live outside those boundaries then you assume some responsibility as a consequence. You are not "living outside boundaries" if you assume that users don't have an external package installed, regardless of how popular it might be. > the magic boilerplate the use-package does to simplify package initialization is pretty well-documented and not all that complicated so the cost of that choice to live outside the normal boundaries is not onerous enough to be making demands of the package authors. I prefer package authors to tell me which variables are available for me to tweak them, and eventual requirements if there are some, not to teach me the syntax how to write and where to put tweaks.
arthurno1 · 2022-08-06 23:34
> Is your emacs config on a public repo? would like to see something without use-package. Look under "[packages](https://github.com/amno1/.emacs.d/blob/main/init.org)".
vfclists · 2022-08-07 00:10
`use-package` is not Lisp. You can learn a lot of Elisp by not using `use-package`, but who has time to learn a lot of Elisp before they can start using the editor efficiently?
7890yuiop · 2022-08-07 00:59
https://github.com/jwiegley/use-package/issues/282
manphiz · 2022-08-07 01:00
Wow! It's really happening!
flexibeast · 2022-08-07 01:58
Sure, agreed. And until it *is* actually in stock Emacs, it can be *actively misleading and confusing to new users* to give them instructions which *won't necessarily work* on their setup. "I followed the installation instructions in your README, but I just get a message about "(void-function use-package)". Which is the message that will result when a new Emacs user, who's just installed Emacs via their Linux distro's package manager, follows someone's instructions (in a README or subreddit comment) that says "You just need to do (use-package 'the-package)". i'm *not* saying people shouldn't use `use-package`. All i'm saying is that one *can't* assume that someone *does* have `use-package` installed, because not everyone who starts using Emacs will be starting from a distro that provides (cf. the example in the previous paragraph). Please at least say something to the new user like "Make sure `use-package` is installed, and then put `(use-package 'the-package [etc])` in your config - this will set everything up for you".
flexibeast · 2022-08-07 02:07
My primary concern is about users getting told that to install and do initial basic setup for a package, they should should write something like: (use-package 'the-package :config blah) This isn't going to work for any new user who isn't using `use-package` (perhaps via an Emacs distro). Do we simply not care about such users? i agree with what u/nv-lisp [wrote ](https://old.reddit.com/r/emacs/comments/whoyz0/reminder_usepackage_is_not_part_of_stock_emacs/ij6rtaq/): > Its a duplication of effort for every package to instruct new users how to install and load packages. At most, I'd recommend pointing them to the appropriate documentation. Also, the non-`use-package` apprach is not *necessarily* verbose. Someone who's just installed my Ebuku package via the package manager, for example, who then wants to specify a certain setting doesn't need anything more in their config than (setq ebuku-recent-count 10)
flexibeast · 2022-08-07 02:10
> Not really sympathetic to this argument. IMO this is fairly similar to someone who runs Linux From Scratch So you feel that the overwhelming majority of new Emacs users are using a `use-package`-based distro? My experience is that there are still non-insignificant numbers of new users who aren't - and not because they're actively trying to avoid using a distro, but simply because they're not necessarily aware that they exist. Like, someone who installs Ubuntu and then decides to check out Emacs via installing it through the package manager.
mclearc · 2022-08-07 03:10
1. I don't understand what the connection is between use-package and "distros". Plenty of people use use-package without any sort of "distro." And there are distros that don't use use-package (e.g. prelude). 2. The general worry strikes me as infantalizing. If someone is using Emacs and adding packages, then they are likely using package-install. Which means they are unlikely to be just randomly looking for setup instructions on the internet/github/gitlab/etc. If they are not using package.el (e.g. they are using straight) then they probably can figure out what they are doing with setup via whatever instructions are present on the host page (e.g. github, etc.). 3. Part of coming to terms with Emacs is learning to RTM. Perhaps telling people not to mindlessly copy things off the web is simply shouting into the void, but people have to learn one way or another.
[deleted] · 2022-08-07 03:31
Whoever knows how to deal with use-package can easily translate it to vanilla config.
flexibeast · 2022-08-07 03:41
You seem to be misunderstanding what i'm arguing. i'm *not* saying "Don't use `use-package`", not at all. All i'm saying is that a number of new users won't have `use-package` installed, and so giving them instructions that only involve `use-package` *won't work* - it will result in errors like "(void-function use-package)".
flexibeast · 2022-08-07 03:51
> I don't understand what the connection is between use-package and "distros". Plenty of people use use-package without any sort of "distro." And there are distros that don't use use-package (e.g. prelude). A number of people who use distros which provide `use-package` assume that `use-package` is part of Emacs itself, not something being provided by the distro. So they give instructions to new users assuming that `use-package` is available. It might be, if that new user is using a distro that provides `use-package`, or it might not be, if they're just using stock Emacs. And in the latter case, a new user who tries to follow instructions that say "Evaluate this form: (use-package ...)" will get the error message "(void-function use-package)". Which is not helpful. This issue is something i've noticed not only in package READMEs, but in comments on this sub. The user hasn't provided any information indicating that `use-package` is available on their setup, but people regularly assume it is, and write comments along the lines of "Okay, so just put this in your config: (use-package ...)" > If someone is using Emacs and adding packages, then they are likely using package-install. Not necessarily. Someone using Spacemacs, for example, will be using Spacemacs' "layers" instead. And `use-package` can be used in such a way that it installs packages for you if they're not already installed. In both instances, `package-install` (or the `package` interface in general) doesn't come into it.
TheKrister2 · 2022-08-07 10:11
If they blindly copy-paste from someone else's personal config and it doesn't work, that's their problem. Sure, some people might go out of their way to document it like it's supposed to be used by everyone, but it is first and foremost a personal config. It only needs as much documentation as you yourself feel is necessary, even if that means none at all.
Ghosty141 · 2022-08-07 10:37
They are not using a distro but simply using use package. I mean do you think most people just blindly copy some code and be like “yup thats gotta work“. If its a oneliner sure, but for anything more complicated you tend to read the code and notice what that use-package means and then google it.
Ghosty141 · 2022-08-07 10:41
I mean isnt it a bad example for your argument when it comes to new user usability to show configs who build their own functions or progn macros to do the package handling themselves? Only the last one which is pretty trivial uses a custom macro which for a new user is pretty much as indirect as using use pckage.
flexibeast · 2022-08-07 10:47
Where have i written about someone's personal config? In my post, i wrote: > Any use-package-based instructions for installing and setting up a package should also be accompanied by instructions that don't require its presence. However, in [the comment to which you're replying](https://old.reddit.com/r/emacs/comments/whoyz0/reminder_usepackage_is_not_part_of_stock_emacs/ij9duen/), i agreed with u/nv-elisp's comment: > Its a duplication of effort for every package to instruct new users how to install and load packages. At most, I'd recommend pointing them to the appropriate documentation But in that same comment, i also wrote: > it can be actively misleading and confusing to new users to give them instructions which won't necessarily work on their setup. "I followed the installation instructions in your README, but I just get a message about "(void-function use-package)". So i'm clearly talking about instructions in package READMEs. Then, in [this comment](https://old.reddit.com/r/emacs/comments/whoyz0/reminder_usepackage_is_not_part_of_stock_emacs/ij9qvq8/), i wrote: > This issue is something i've noticed not only in package READMEs, but in comments on this sub. The user hasn't provided any information indicating that use-package is available on their setup, but people regularly assume it is, and write comments along the lines of "Okay, so just put this in your config: (use-package ...)" So, again, i'm talking about situations where users are *specifically being provided with instructions* for using a given package, in the form of a package README or a HOWTO comment on this sub, not a situation where they're looking at someone's config and blindly copy-pasting. The core of what i'm trying to get at is expressed in [this reply of mine elsethread](https://old.reddit.com/r/emacs/comments/whoyz0/reminder_usepackage_is_not_part_of_stock_emacs/ij9purc/): > You seem to be misunderstanding what i'm arguing. i'm not saying "Don't use use-package", not at all. All i'm saying is that a number of new users won't have use-package installed, and so giving them instructions that only involve use-package won't work - it will result in errors like "(void-function use-package)" and [in this comment](https://old.reddit.com/r/emacs/comments/whoyz0/reminder_usepackage_is_not_part_of_stock_emacs/ij9duen/): > All i'm saying is that one can't assume that someone does have use-package installed, because not everyone who starts using Emacs will be starting from a distro that provides [it] (cf. the example in the previous paragraph). Please at least say something to the new user like "Make sure use-package is installed, and then put (use-package 'the-package [etc]) in your config - this will set everything up for you". All that said, u/arthurno1 [wrote](https://old.reddit.com/r/emacs/comments/whoyz0/reminder_usepackage_is_not_part_of_stock_emacs/ij8vfk3/): > The Op is talking about instructions in Readme files. You are regressing. You might be correct, and it might be better workflow, or it might not be that at all, but it does not matter here, since it is a different discussion. You are regressing. Until use-package is not part of official Emacs and is not included in the core, you can't assume people have it installed. It is not about use-package be or not to be. which correctly identifies what i'm trying to say, but is currently sitting at -3 points. i've no problem with people disagreeing with my actual point, as u/nv-elisp did, but people are seemingly determined to keep arguing against things i haven't actually *said*, let alone *believe* - i am *not* anti-`use-package` in general, but think it's a good thing for Emacs, and will be even more so once it becomes part of stock. So it's clear that it's wasting my time to continue to participate in this discussion.
flexibeast · 2022-08-07 11:02
See [this comment](https://old.reddit.com/r/emacs/comments/whoyz0/reminder_usepackage_is_not_part_of_stock_emacs/ijaouxq/). The only reason i'm talking about Emacs distros, *which i enthusiastically support the existence of*, is that people seem to be assuming that `use-package`, which *i also enthusiastically support the existence of*, is part of stock Emacs due to it being part of some Emacs distros. It is not, even though it is planned to be. So it's not correct to assume that a given Emacs user will have `use-package` installed and available, *because it's not currently provided by Emacs out-of-the-box*. And in that situation, giving a new Emacs user specific instructions involving a `(use-package ...)` form *without* also e.g. saying "(You might need to install `use-package` first)" might turn out to be problematic for that user when they get a "void-function" error because they're not using or distro or haven't installed `use-package` separately and `use-package` *is not provided by Emacs out-of-the-box*.
arthurno1 · 2022-08-07 11:56
> is currently sitting at -3 points. i've no problem with people disagreeing with my actual point, as u/nv-elisp did, but people are seemingly determined to keep arguing against things i haven't actually said, let alone believe - i am not anti-use-package in general That is a current theme in this reddit, entire Reddit and social media in general. People are not reading *and* reflecting deeply; it is all white and black, Twitter/Tik-tok - one-liner is all we want. That one-line determines if you are with us, and if not you are against us, we don't have time for arguing ... Unfortunately. The mob rules. Even worse is to see, if a comment gets one downvote, it is very likely spiraling further down. That probably because people who really don't care to reflect, or lack knowledge or information, are assuming that someone else did the thinking for them, and are just following the flow, or the mob to be more correct. The smaller the community, the less likely it is to happen, but the bigger a community gets, the more likely it is to happen. Obviously, such community gets more non-technical users who don't know how software and building software works, but they still feel the urge to express their emotions about something or someone. It is like they need to see *their* opinion *win* like a discussion is some kind of competition. It is a shame because it hurts the community in the long run. People who understands things at a deeper level usually censor themselves from posting in such discussions, as this thread showcases. If you noticed, the usual names that post interesting/important stuff or devs are usually absent from such discussions, and names that you usually don't see much, but relatively new and inexperienced users will be loud. /u/nv-elisp is the only more experienced user I recognize here, most others I don't. I think, I am not really a psychologist, and haven't studied group dynamics, but I have noticed that social media and mailing lists seem to work that way. Maybe I am wrong, might be just my personal experience, but I mean, you should be prepared for that. If your words can be misunderstood, they will be! On social media, you can't ever be overly clear :). It sucks, but so it is.
colemaker360 · 2022-08-07 13:09
Agreed. There’s also not a lot of easy to find resources explaining why you may or may not want to enable this setting. I remember being surprised to discover you can use use-package for configuring things that aren’t actually (M)ELPA packages, but built-ins. Not being familiar with what was built-in coupled with having always-ensure set wrong made troubleshooting that a pain. The whole ensure setting was poorly designed.
thetemp_ · 2022-08-07 14:27
Not at the moment. Looks like many good examples have been provided already. One pointer regarding the pagebreaks: (Those are the characters that look like `^L` by default. You see them in `describe-bindings` as dividers between the different keymaps.) There are at least 3 packages that will make them look like horizontal lines instead of `^L` (really ought to be a default setting, IMO). But there is a [simple function on Xah Lee's site](http://xahlee.info/emacs/emacs/emacs_form_feed_section_paging.html) that does the trick just fine. Adding that to `emacs-lisp-mode-hook` and `help-mode-hook` goes a long way towards helping things look "tidy."
nv-elisp · 2022-08-07 14:32
Agreed. Reddit has a cultural allergy to criticism and substantial debate. It also rewards laziness. I don't post nearly as much as I would if that were not the case. That's probably for the best, though.
arthurno1 · 2022-08-07 18:06
> I don't post nearly as much as I would if that were not the case. Prettu much same here.
jcmkk3 · 2022-08-07 19:58
I wasn't actually arguing that use-package was bad. I was just stating that I enjoy seeing examples of other ways to configure outside of use-package and provided some that I thought were interesting enough to share. The macros in those configs are almost all related to ensuring that packages are installed or that the config is skipped. The other config is mostly handled by built-in functionality.
FitPandaFu · 2022-08-07 23:49
haha nice
github-alphapapa · 2022-08-08 17:06
I just link `use-package` to the use-package repo in my readme, so the user can follow the link if needed.
github-alphapapa · 2022-08-08 17:07
I just link to the use-package repo in the instructions. Anyone can click a link, right?
github-alphapapa · 2022-08-08 17:09
Soapbox time: Let's stop calling DOOM, Spacemacs, etc. "distros." They are not *distributions of Emacs*--they are *configurations of Emacs.* A *distribution of Emacs* would be, e.g. the Debian package of Emacs, the GNU Guix package of Emacs, the Win32 zip file on the GNU site, the Aquamacs build, etc. It's an important distinction.
jcmkk3 · 2022-08-10 15:41
Are you sure that it is going to end up in emacs core? I know that is John’s intention, but based on what I’ve seen on the emacs development list, I’m not sure that there’s unanimous buy-in about that. Maybe I missed a thread.
nv-elisp · 2022-08-10 16:28
> based on what I’ve seen on the emacs development list, I’m not sure that there’s unanimous buy-in about that Show me a proposed feature with unanimous buy-in on the mailing list.
jcmkk3 · 2022-08-10 16:45
I guess that’s not really the point of the comment. It is more about the fact that you stated that use-package was going to be added to the core like it was fact, but I feel like that is a bit deceiving. Maybe a more nuanced statement is “based on the package author’s intention to add the package to the core, his position within the emacs development team, and the popularity of the package, it is likely that it will eventually be added”
nv-elisp · 2022-08-10 16:52
By all means, feel deceived.