* Re: An anonymous IRC user's opinion @ 2024-10-06 7:32 Abraham S.A.H. via Emacs development discussions. 2024-10-06 8:10 ` Emanuel Berg 2024-10-06 8:44 ` Dr. Arne Babenhauserheide 0 siblings, 2 replies; 138+ messages in thread From: Abraham S.A.H. via Emacs development discussions. @ 2024-10-06 7:32 UTC (permalink / raw) To: Arne Bab; +Cc: Emacs Devel Some thoughts about what have been discussed in this topic: ** The plague of pre-configuration: Isn't Emacs usable without any pre-configuration, out of the box? I think it is. One can install Emacs and use it right away as an editor without any initial configurations. Emacs — without any prior customisation and configuration — already provides much more features compared to many code/text editors that I know and have worked with. However, current Emacs' vanilla setup is not all of what make most Emacs newcomers interested in Emacs and/or discover Emacs. So they tend to start customising and tweaking Emacs right away, rather than using it first. I'm not sure, but I think this tendency is not something that Emacs devs or community can prevent. But at least, Emacs has to say to it to the user that you can use me without any prior configuration for most of the simple use cases of a text editor. Another problem is that most of those newcomers start doing that without reading Emacs' manual. Now, that one has to be clearly discouraged. Doesn't matter how intuitive an interface is designed, it's always good to come with a manual, and Emacs comes with a very good one. And it's always advised to use a tool after or alongside reading its documentation. \f ** The audience of Doom: I think, Doom and Spacemacs were and are (at least, partially) successful in attracting: 1. Previous vi, vim, or neovim users; 2. Anyone who likes VI and VIM key bindings. Amongst whom are beginners or those who don't like to do the required configuration to achieve a similar look and feel to Doom and Spacemacs. However, it is not as much attractive for other people than those. But still there are people using Doom/Spacemacs not being from those two groups. \f ** A wizard to do the magic work: What about an initial interactive wizard buffer? Many complicated software actually come with that. Prompting user to choose some important options and to declare his/her use case and to notify him about some important tips. An initial interactive wizard will force a beginner to pay attention to notes, tips, suggestions, and warning along helping him/her to interactively configure and prepare his/her Emacs for its first use. The interface would use a mechanism much like Emacs' Custom buffers. That would just open for the first time Emacs is opened or such thing. -- Best Regards, Abraham Sent with Tutanota; https://tuta.com ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 7:32 An anonymous IRC user's opinion Abraham S.A.H. via Emacs development discussions. @ 2024-10-06 8:10 ` Emanuel Berg 2024-10-06 8:44 ` Dr. Arne Babenhauserheide 1 sibling, 0 replies; 138+ messages in thread From: Emanuel Berg @ 2024-10-06 8:10 UTC (permalink / raw) To: emacs-devel Abraham S.A.H." via "Emacs development discussions. wrote: > Another problem is that most of those newcomers start doing > that without reading Emacs' manual. Now, that one has to be > clearly discouraged. We can assume the opposite, that people will not read it. I don't know if "everyone" did that in the 70s, in the 90/00s only the most dedicated guys read books and manuals and now, we can assume that this is an almost foreign concept to young people. Why on Earth should you read a book if you want to use software, what does that have to do with it and why not just use the software right now? And while it is good there is documentation, these people thinking like that are not entirely wrong. I start to agree with them more and more. > Doesn't matter how intuitive an interface is designed, it's > always good to come with a manual, and Emacs comes with > a very good one. Those are different things, let's do both as good as we can and as much energy people feel it is meaningful to put into it. Improve documentation, improve interface, improve computation, improve some alternative backend that no one ever heard of - we take it. Everything that makes it better and make people active, with us. Enough with the long period of everyone piling up their own .emacs - can't have that anymore, there are too few of us to afford it. -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 7:32 An anonymous IRC user's opinion Abraham S.A.H. via Emacs development discussions. 2024-10-06 8:10 ` Emanuel Berg @ 2024-10-06 8:44 ` Dr. Arne Babenhauserheide 2024-10-06 9:01 ` Emanuel Berg ` (3 more replies) 1 sibling, 4 replies; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-06 8:44 UTC (permalink / raw) To: Abraham S.A.H.; +Cc: Emacs Devel [-- Attachment #1: Type: text/plain, Size: 2312 bytes --] "Abraham S.A.H." <arash.sah@tuta.io> writes: > Isn't Emacs usable without any pre-configuration, out of the box? It is a good editor without any pre-configuration (it even ships org-mode). But to be a good Web-IDE, C++ or Scheme programming environment, Server automation plattform, and so forth, it requires configuration. Which might be a reason why it is discovered by writers, and why Spacemacs and Doom capture new people. > Another problem is that most of those newcomers start doing that > without reading Emacs' manual. Now, that one has to be clearly > discouraged. Doesn't matter how intuitive an interface is designed, > it's always good to come with a manual, and Emacs comes with a very > good one. And it's always advised to use a tool after or alongside > reading its documentation. No. Any software that says that you have to read the manual first is doomed to fail for most people. One of the best features of nano is that the important keybindings are shown directly on the screen. No documentation needed. We obviously can’t have *no* explanation, but if people have to read more than an 80x30 screen of explanations, it’s too much. > \f > > ** The audience of Doom: > > I think, Doom and Spacemacs were and are (at least, partially) > successful in attracting: > > 1. Previous vi, vim, or neovim users; > 2. Anyone who likes VI and VIM key bindings. You miss people who want their editor to look cool. There are a lot of visiual attractions built right into doom and Spacemacs from the start. > \f > > ** A wizard to do the magic work: > > What about an initial interactive wizard buffer? Many complicated > software actually come with that. Prompting user to choose some > important options and to declare his/her use case and to notify him > about some important tips. Once we have a wizard, it becomes even more likely that people will stop before even starting. > An initial interactive wizard will force a beginner to pay attention > to notes, tips, suggestions, and warning along helping him/her to > interactively configure and prepare his/her Emacs for its first use. I don’t like the "force" here. Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 8:44 ` Dr. Arne Babenhauserheide @ 2024-10-06 9:01 ` Emanuel Berg 2024-10-06 9:09 ` Emanuel Berg ` (2 subsequent siblings) 3 siblings, 0 replies; 138+ messages in thread From: Emanuel Berg @ 2024-10-06 9:01 UTC (permalink / raw) To: emacs-devel Dr. Arne Babenhauserheide wrote: > No. Any software that says that you have to read the manual > first is doomed to fail for most people. > > One of the best features of nano is that the important > keybindings are shown directly on the screen. > No documentation needed. > > We obviously can't have *no* explanation, but if people have > to read more than an 80x30 screen of explanations, it's > too much. +1 Very much so. > You miss people who want their editor to look cool. How it looks is a huge part of it. And it is not just superficial. We have trained eyes. If it looks good, it is good. This is like ... decoded automatically. So it should be good, and this should be reflected in that it also looks good. But you can also put some extra effort to make it look even better :) -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 8:44 ` Dr. Arne Babenhauserheide 2024-10-06 9:01 ` Emanuel Berg @ 2024-10-06 9:09 ` Emanuel Berg 2024-10-06 9:32 ` Abraham S.A.H. via Emacs development discussions. 2024-10-09 3:30 ` Richard Stallman 3 siblings, 0 replies; 138+ messages in thread From: Emanuel Berg @ 2024-10-06 9:09 UTC (permalink / raw) To: emacs-devel Dr. Arne Babenhauserheide wrote: > One of the best features of nano is that the important > keybindings are shown directly on the screen. > No documentation needed. It is interesting you should say that, because I thought about that recently when I did this interface: https://dataswamp.org/~incal/bad-www/img/studio.png Note the [h] button that will hide all the buttons if you don't wat to see them :) What do you think? I am full cycle, GUI -> CLI -> TUI. Tired of typing those long commands, but it was fun while it lasted. Better just pushing a button. We have a full keyboard of keys plus shortcuts, that must be enough? What interface people expect today I don't know and there seems to be quite some variety in the smartphone app world. HTML/CSS maybe is prevailing as technology, but I mean how it looks to the user? -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 8:44 ` Dr. Arne Babenhauserheide 2024-10-06 9:01 ` Emanuel Berg 2024-10-06 9:09 ` Emanuel Berg @ 2024-10-06 9:32 ` Abraham S.A.H. via Emacs development discussions. 2024-10-06 11:28 ` Dr. Arne Babenhauserheide 2024-10-06 12:55 ` Emanuel Berg 2024-10-09 3:30 ` Richard Stallman 3 siblings, 2 replies; 138+ messages in thread From: Abraham S.A.H. via Emacs development discussions. @ 2024-10-06 9:32 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: Emacs Devel > No. Any software that says that you have to read the manual first is > doomed to fail for most people. I think you missed the phrase “or alongside”. We already know that one can still use Emacs without reading its manual, though not Emacs’ full potential. Being well documented is always a great advantage. And having the personality to read and consider before action so as well. Best is to make tools that can be used without reading manuals or education, as much as possible; while still keeping them well-documented and well-recorded. However, most physical equipments (not pieces of software), even very small or simple ones come with dedicated manuals, which are sometimes a hundred in pages. It includes most of the tools that I have in my home. Most of them are usable without reading their manual, of course. But, if you don’t read the manual, you will never notice some of their more specialised features. For slightly more complex hardware, like microwaves, or AC splits you will definitely can’t properly use your tool without reading its manual and you will most probably will break it, sooner or later. And about software, advanced programs even with much less functionality than Emacs come with manuals and a user usually needs to read those to make a proper use of them. I think more than half of the programs that I have on my Linux system are useless without their docs and manuals. And the matter is even worse on Windows, most professional applications can’t be even utilized without a proper Education! People take courses to understand how to use them. All these examples of software and hardware don’t seem to be doomed or going to be doomed. Any tool needs prior knowledge at some degree. When it’s more powerful, has and needs more documentation. Like programming languages which are very powerful and not possible to be used without reading stuff first. > You miss people who want their editor to look cool. There are a lot of > visiual attractions built right into doom and Spacemacs from the start. True. They are in “But still there are people using Doom/Spacemacs not being from those two groups.” -- Best Regards, Abraham Sent with Tutanota; https://tuta.com ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 9:32 ` Abraham S.A.H. via Emacs development discussions. @ 2024-10-06 11:28 ` Dr. Arne Babenhauserheide 2024-10-06 13:10 ` Emanuel Berg 2024-10-06 12:55 ` Emanuel Berg 1 sibling, 1 reply; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-06 11:28 UTC (permalink / raw) To: Abraham S.A.H. via Emacs development discussions.; +Cc: Abraham S.A.H. [-- Attachment #1: Type: text/plain, Size: 1271 bytes --] "Abraham S.A.H." via "Emacs development discussions." <emacs-devel@gnu.org> writes: >> No. Any software that says that you have to read the manual first is >> doomed to fail for most people. > Best is to make tools that can be used without reading manuals or > education, as much as possible; while still keeping them > well-documented and well-recorded. I wholeheartedly agree. > I think more than half of > the programs that I have on my Linux system are useless without their > docs and manuals. That’s different for me, but I enjoy the Guile info manual a lot; especially read from Emacs. That’s often nicer that Googling for solutions with Python. > All these examples of software and hardware don’t seem to be doomed or > going to be doomed. Any tool needs prior knowledge at some degree. For most tools you already have that prior knowledge from other software; and often you can discover by trial and error (just clicking buttons). Which key is an awesome improvement for this discovery. Clicking ESC even shows all M- bindings. And I just learned about C-h b. That’s a command we should show more prominently. Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1121 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 11:28 ` Dr. Arne Babenhauserheide @ 2024-10-06 13:10 ` Emanuel Berg 0 siblings, 0 replies; 138+ messages in thread From: Emanuel Berg @ 2024-10-06 13:10 UTC (permalink / raw) To: emacs-devel Dr. Arne Babenhauserheide wrote: > And I just learned about C-h b. That's a command we should > show more prominently. Here, read this interview, if you'd like - https://sachachua.com/blog/2024/04/emacs-interview-daniel-semyonov/ this guy [hello if you are reading this] learned to program just using the on-line help (that means Emacs' help, on-line means not printed on paper). And many people did that, this is the first time I heard it in the Emacs world but using the help system and that's all. The F1 keys on Windows if you remember. (Not sure if I do. What did the F10 key do?) So, one wonders, why is it better to read the manual ONCE cover to cover in a book than bringing the help up whenever one needs it, one short paragraph at a time, on the screen? To me, if I had to pick only one, the computer version, I would take that and not the book. (No, the help isn't _the_ manual, but it is _a_ manual, why not.) People are different and we have different resources, it is all good and we shouldn't assume anyone has done anything IMO. -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 9:32 ` Abraham S.A.H. via Emacs development discussions. 2024-10-06 11:28 ` Dr. Arne Babenhauserheide @ 2024-10-06 12:55 ` Emanuel Berg 2024-10-09 3:29 ` Richard Stallman 1 sibling, 1 reply; 138+ messages in thread From: Emanuel Berg @ 2024-10-06 12:55 UTC (permalink / raw) To: emacs-devel Abraham S.A.H." via "Emacs development discussions. wrote: >> No. Any software that says that you have to read the manual >> first is doomed to fail for most people. > > I think you missed the phrase "or alongside". We already > know that one can still use Emacs without reading its > manual, though not Emacs' full potential. You read the manuals for your TI-83 scientific calculator and Makita impact driver as well? -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 12:55 ` Emanuel Berg @ 2024-10-09 3:29 ` Richard Stallman 2024-10-09 20:20 ` Emanuel Berg 0 siblings, 1 reply; 138+ messages in thread From: Richard Stallman @ 2024-10-09 3:29 UTC (permalink / raw) To: Emanuel Berg; +Cc: emacs-devel [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > You read the manuals for your TI-83 scientific calculator and > Makita impact driver as well? I have a feeling that question is sarcastic. Sarcasm make the point unclear, so it leads to misunderstandings and confusion. I don't use either of those products, so I can't guess what the point was. Also, it tends to suggest hostility (even if none is actually meant). That often hurts feelings and makes the discussion acrimonious. Therefore we ask people to avoid sarcasm in our discussions. See https://gnu.org/philosophy/kind-communication.html. Can you please restate your point without sarcasm, so it will be clear? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 3:29 ` Richard Stallman @ 2024-10-09 20:20 ` Emanuel Berg 2024-10-10 8:57 ` Dr. Arne Babenhauserheide 0 siblings, 1 reply; 138+ messages in thread From: Emanuel Berg @ 2024-10-09 20:20 UTC (permalink / raw) To: emacs-devel Richard Stallman wrote: >> You read the manuals for your TI-83 scientific calculator >> and Makita impact driver as well? > > I have a feeling that question is sarcastic. Oh, I'm never sarcastic. People never understand what I mean, here and in life in geneal, just imagine how it would be if I went around being sarcastic. Now you made me think ... What I meant was: Does he read ALL tech manuals? Or just SOME? If he reads some, is it because some stuff is more complicated or is it because some stuff - that he cares more for it and is more active with and around it? > Sarcasm make the point unclear, so it leads to > misunderstandings and confusion. I don't use either of those > products, so I can't guess what the point was. > > Also, it tends to suggest hostility (even if none is > actually meant). That often hurts feelings and makes the > discussion acrimonious. > > Therefore we ask people to avoid sarcasm in our discussions. > See https://gnu.org/philosophy/kind-communication.html. Yes, I know, and I agree. You could add a paragraph what you should do when you feel hurt. Not when you feel a lot hurt, then instinct takes over anyway, but when you go from happy to sad because of something someone said, be it the thing itself or how it was formulated and put forward. The only thing I've come up with is immediately as yourself, "did this person intend to be a jerk to you?" I have found that whatever answer you reach, it tends to have removed some of the hurtness already. You can also visualize yourself from the outside. You see a guy with a keyboard, not feeling good, hurting, even, and you see it is you, but still you have removed yourself from pain and you can stay out as long as needed, and when you return, you know about the pain, because it happened, and you remember it, but you don't FEEL it in the same way. -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 20:20 ` Emanuel Berg @ 2024-10-10 8:57 ` Dr. Arne Babenhauserheide 0 siblings, 0 replies; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-10 8:57 UTC (permalink / raw) To: emacs-devel [-- Attachment #1: Type: text/plain, Size: 838 bytes --] Emanuel Berg <incal@dataswamp.org> writes: >> Therefore we ask people to avoid sarcasm in our discussions. >> See https://gnu.org/philosophy/kind-communication.html. > > Yes, I know, and I agree. You could add a paragraph what you > should do when you feel hurt. That is a good point, though not a simple one. > "did this person intend to be a jerk to you?" That’s the common method of "putting yourself in their shoes". I just checked if nonviolent communication could be an option, but that doesn’t fit: https://en.wikipedia.org/wiki/Nonviolent_Communication#Components And sadly there’s no Englisch version of the page about Streitkultur: https://de.wikipedia.org/wiki/Streitkultur#Streitkultur_lernen Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 8:44 ` Dr. Arne Babenhauserheide ` (2 preceding siblings ...) 2024-10-06 9:32 ` Abraham S.A.H. via Emacs development discussions. @ 2024-10-09 3:30 ` Richard Stallman 2024-10-09 6:48 ` Dr. Arne Babenhauserheide ` (2 more replies) 3 siblings, 3 replies; 138+ messages in thread From: Richard Stallman @ 2024-10-09 3:30 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: arash.sah, emacs-devel [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > Isn't Emacs usable without any pre-configuration, out of the box? > It is a good editor without any pre-configuration (it even ships > org-mode). But to be a good Web-IDE, C++ or Scheme programming > environment, Server automation plattform, and so forth, it requires > configuration. Between there to what follows > Which might be a reason why it is discovered by writers, and why > Spacemacs and Doom capture new people. there is an yawning gulf. My imagination can't get me from one to the other. Can you please explain how to cross? You listed Web-IDE, C++ or Scheme programming environment, and Server automation plattform as kinds of work a user might want Emacs set up for. Choosing Spacemacs first, does it do some of those three things? Does Doom do some of those three things? Aldo, when you say that each of them requires "configuration", could you make that more concrete? What sort of configuration does "Web IDE" require? What sort for Scheme programming environment? And so on. I'm not asking for all the details, just an overall idea. Could we easily add those missing kinds of configuration to Emacs? If we did, would that make Emacs competitive with Spacemacs and Doom? We generally try to make all sorts of packages for various uses of Emacs coexist in a single Emacs job. I get the impression people are assuming that these different configurations are mutually incompatible, so that it is necessary to choose which one to install. Is that what people assume? If people do, why so? Why can't users select one at run time? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 3:30 ` Richard Stallman @ 2024-10-09 6:48 ` Dr. Arne Babenhauserheide 2024-10-09 20:22 ` Emanuel Berg 2024-10-09 11:09 ` Johan Myréen 2024-10-10 13:58 ` Richard Stallman 2 siblings, 1 reply; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-09 6:48 UTC (permalink / raw) To: Richard Stallman; +Cc: arash.sah, emacs-devel [-- Attachment #1: Type: text/plain, Size: 2798 bytes --] Richard Stallman <rms@gnu.org> writes: > > It is a good editor without any pre-configuration (it even ships > > org-mode). But to be a good Web-IDE, C++ or Scheme programming > > environment, Server automation plattform, and so forth, it requires > > configuration. > > Between there to what follows > > > Which might be a reason why it is discovered by writers, and why > > Spacemacs and Doom capture new people. > > there is an yawning gulf. My imagination can't get me from one to the > other. Can you please explain how to cross? > > You listed Web-IDE, C++ or Scheme programming environment, and Server > automation plattform as kinds of work a user might want Emacs set up > for. Choosing Spacemacs first, does it do some of those three things? > Does Doom do some of those three things? Yes: both Spacemacs and Doom provide ready-made configurations that can be activated to get an environment optimized for that task. > Aldo, when you say that each of them requires "configuration", could > you make that more concrete? What sort of configuration does "Web > IDE" require? What sort for Scheme programming environment? And so > on. I'm not asking for all the details, just an overall idea. Activating the correct set of modes, installing some packages, tweaking some customizations. > Could we easily add those missing kinds of configuration to Emacs? > If we did, would that make Emacs competitive with Spacemacs and Doom? That’s the point, yes: improving the newcomer experience of regular Emacs. But note that Spacemacs and Doom are simply configurations of Emacs, though pretty far from Vanilla Emacs. > so that it is necessary to choose which one to install. > > Is that what people assume? If people do, why so? Why can't > users select one at run time? I do not assume that. It’s rather that a C++ IDE and a writing system and Scheme Programming and a Web-IDE have a lot of overlap, so some of the modes they use are the same, sometimes with a bit different setup. For long-time users that’s great: all the different things interact nicely. That’s something not found elsewhere. But for new users it means that they can’t just activate the C++-mode, but instead they have to track down the right configuration options. There are already some optimized setups for C++ (and for others, too), but which one of these are good for the specific task is hard to figure out and they are not really discoverable from Emacs. And that’s also a step that most users today won’t do. They see that Emacs doesn’t solve their current problem out of the box and switch to a program that does. Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 6:48 ` Dr. Arne Babenhauserheide @ 2024-10-09 20:22 ` Emanuel Berg 0 siblings, 0 replies; 138+ messages in thread From: Emanuel Berg @ 2024-10-09 20:22 UTC (permalink / raw) To: emacs-devel Dr. Arne Babenhauserheide wrote: > That's the point, yes: improving the newcomer experience Good word! Much better than "beginner". If we have newcomers, where are they, and how are we communicating with them? Becuse then I think we should just ask, what problems do you experience? It is quite possible they have completely unrelated issues to the ones we think they have. -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 3:30 ` Richard Stallman 2024-10-09 6:48 ` Dr. Arne Babenhauserheide @ 2024-10-09 11:09 ` Johan Myréen 2024-10-09 13:13 ` Eli Zaretskii 2024-10-10 13:58 ` Richard Stallman 2 siblings, 1 reply; 138+ messages in thread From: Johan Myréen @ 2024-10-09 11:09 UTC (permalink / raw) To: emacs-devel [-- Attachment #1: Type: text/plain, Size: 4466 bytes --] I see this more as a documentation problem. Emacs lacks "official" documentation on how to configure an environment to do certain things, which includes installing certain Elisp packages, and configuring them. I'm going to use software development as an example. In the good old days software development meant editing a few C files in Emacs and then running make. This no longer meets the expectations people have of a software development environment. For example, creating a contemporary environment to write and build software using the Rust programming language and Emacs, you need Rust mode, rust-ts-mode for Treesitter integration, Eglot to communicate with rust-analyzer (a Language Server implementation for Rust) for completion and goto definition, Company mode for code completion, Magit for version control, DAP mode for debugging, and so on. Many of these packages have alternative implementations, for example rustic-mode instead of rust-mode. I'm not saying you can't edit Rust code without all these packages, but these packages combined provide the minimum that the competition (e.g. Visual Studio Code) offers. The packages are all available for Emacs, which is fine. The problem is that there is no single source for how to put together the Rust environment for Emacs using the packages. I would prefer official Gnu Emacs documentation telling me what packages are needed (including a description of pros and cons of competing modes), how to install them, and what configuration is needed. In the absence of official documentation, you will have to search the net for tutorials on the subject. These third party tutorials are often of quite low quality. Many of them are out of date, and, what's worse, often contain irrelevant and extremely opinionated information, like disabling the Emacs menu and toolbars, enabling evil mode, etc. A beginner can have trouble filtering out what's essential and what's not. As another example, at some point the web page describing how to use Emacs for Clojure programming said to start with completely removing the .emacs file and the .emacs.d directory. No explanation was given what these files are, what they might be needed for, or what the consequences of this removal would be. Not even a suggestion to make a backup of the files was given. On Wed, 9 Oct 2024 at 06:30, Richard Stallman <rms@gnu.org> wrote: > [[[ To any NSA and FBI agents reading my email: please consider ]]] > [[[ whether defending the US Constitution against all enemies, ]]] > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > > > Isn't Emacs usable without any pre-configuration, out of the box? > > > It is a good editor without any pre-configuration (it even ships > > org-mode). But to be a good Web-IDE, C++ or Scheme programming > > environment, Server automation plattform, and so forth, it requires > > configuration. > > Between there to what follows > > > Which might be a reason why it is discovered by writers, and why > > Spacemacs and Doom capture new people. > > there is an yawning gulf. My imagination can't get me from one to the > other. Can you please explain how to cross? > > You listed Web-IDE, C++ or Scheme programming environment, and Server > automation plattform as kinds of work a user might want Emacs set up > for. Choosing Spacemacs first, does it do some of those three things? > Does Doom do some of those three things? > > Aldo, when you say that each of them requires "configuration", could > you make that more concrete? What sort of configuration does "Web > IDE" require? What sort for Scheme programming environment? And so > on. I'm not asking for all the details, just an overall idea. > > Could we easily add those missing kinds of configuration to Emacs? > If we did, would that make Emacs competitive with Spacemacs and Doom? > > We generally try to make all sorts of packages for various uses of > Emacs coexist in a single Emacs job. I get the impression people are > assuming that these different configurations are mutually incompatible, > so that it is necessary to choose which one to install. > > Is that what people assume? If people do, why so? Why can't > users select one at run time? > > -- > Dr Richard Stallman (https://stallman.org) > Chief GNUisance of the GNU Project (https://gnu.org) > Founder, Free Software Foundation (https://fsf.org) > Internet Hall-of-Famer (https://internethalloffame.org) > > > > [-- Attachment #2: Type: text/html, Size: 5412 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 11:09 ` Johan Myréen @ 2024-10-09 13:13 ` Eli Zaretskii 2024-10-09 13:38 ` tomas ` (3 more replies) 0 siblings, 4 replies; 138+ messages in thread From: Eli Zaretskii @ 2024-10-09 13:13 UTC (permalink / raw) To: Johan Myréen; +Cc: emacs-devel > From: Johan Myréen <johan.myreen@gmail.com> > Date: Wed, 9 Oct 2024 14:09:13 +0300 > > I see this more as a documentation problem. Emacs lacks "official" documentation on how to configure an > environment to do certain things, which includes installing certain Elisp packages, and configuring them. My analysis is different. Emacs lacks volunteers who'd sit down and write documentation on how to configure Emacs for this or that job. Once that is written, and written well, admitting it into Emacs is usually a no-brainer. Mind you: the above is an extremely non-trivial job, because the sheer number of possible "jobs" which Emacs can support is mind-boggling. Even if someone describes in excruciating detail how to configure Emacs for Rust development, that only helps people who need to develop programs in Rust, but doesn't help at all to, say, someone who needs to write a thesis about some academic subject, or read email from Gmail or even develop C++ programs, or... > In the good old days software development meant editing a few C files in Emacs and then running make. > This no longer meets the expectations people have of a software development environment. For example, > creating a contemporary environment to write and build software using the Rust programming language and > Emacs, you need Rust mode, rust-ts-mode for Treesitter integration, Eglot to communicate with > rust-analyzer (a Language Server implementation for Rust) for completion and goto definition, Company > mode for code completion, Magit for version control, DAP mode for debugging, and so on. Many of these > packages have alternative implementations, for example rustic-mode instead of rust-mode. This is an exaggeration to some degree. rust-ts-mode is part of Emacs, and could be turned on automatically when a Rust file is visited; we didn't do that because we are unsure whether users of an unbundled Rust mode will protest. Eglot is part of Emacs, but it cannot be started automatically because the LSP server, which is a separate piece of software, needs to be installed and configured first; are we supposed to be held responsible for that as well? We do have TAGS support for Rust (goto definition etc., so alternative to LSP), and the new etags-regen-mode might just make the job of using TAGS much easier and seamless. Magit is nice, but not really necessary, since we have VC built in, which doesn't need to be configured. DAP is not necessary, since Emacs has a GDB front-end (which doesn't need to be configured, just invoked with a single command), and GDB supports debugging Rust programs. So things are not that bad, are they? I do agree that good tutorials which would mention all this stuff would make things better, at least for those who read documentation (how many do?), but that needs volunteers to sit down and write that up. Would you please consider doing something like that for some jobs with which you are familiar? > I'm not saying you can't edit Rust code without all these packages, but these packages combined provide > the minimum that the competition (e.g. Visual Studio Code) offers. I'm guessing VSCode comes with pre-configured LSP servers, a single Rust mode, and a single Git interface. Am I mistaken? If so, is that how we want to treat our users? will they agree to be treated like that? ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 13:13 ` Eli Zaretskii @ 2024-10-09 13:38 ` tomas 2024-10-09 16:02 ` Dr. Arne Babenhauserheide ` (2 subsequent siblings) 3 siblings, 0 replies; 138+ messages in thread From: tomas @ 2024-10-09 13:38 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Johan Myréen, emacs-devel [-- Attachment #1: Type: text/plain, Size: 764 bytes --] On Wed, Oct 09, 2024 at 04:13:58PM +0300, Eli Zaretskii wrote: [...] > I'm guessing VSCode comes with pre-configured LSP servers, a single > Rust mode, and a single Git interface. Am I mistaken? If so, is that > how we want to treat our users? will they agree to be treated like > that? This is what vscode installs on some remote devel container: # du -sh ~/.vscode-server 1.8G /home/user/.vscode-server Needless to say, you will meet people around here who would characterise this as "bloat" and would prefer tramp. So you'll have to multiply the "number of task types" by the number of devel styles to get at a more realistic assessment of the matrix :-) I for one will avoid LSPs wherever I possibly can. Cheers -- t [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 13:13 ` Eli Zaretskii 2024-10-09 13:38 ` tomas @ 2024-10-09 16:02 ` Dr. Arne Babenhauserheide 2024-10-09 16:22 ` Eli Zaretskii ` (2 more replies) 2024-10-09 16:06 ` Johan Myréen 2024-10-09 21:25 ` Dmitry Gutov 3 siblings, 3 replies; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-09 16:02 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Johan Myréen, emacs-devel [-- Attachment #1: Type: text/plain, Size: 1078 bytes --] Eli Zaretskii <eliz@gnu.org> writes: >> From: Johan Myréen <johan.myreen@gmail.com> >> Date: Wed, 9 Oct 2024 14:09:13 +0300 >> >> I see this more as a documentation problem. Emacs lacks "official" documentation on how to configure an >> environment to do certain things, which includes installing certain Elisp packages, and configuring them. > > My analysis is different. Emacs lacks volunteers who'd sit down and > write documentation on how to configure Emacs for this or that job. I think the problem is different: there are already people who write documentation on how to configure Emacs for tasks. There are also many .emacs.d reppositories. There are awesome Emacs setups out there, much better than what I have. What’s missing is a way to integrate these efforts into Emacs so new users can benefit from them. I don’t know the best way to do that integration, but I think integrating these in some way for new users could help a lot. Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 16:02 ` Dr. Arne Babenhauserheide @ 2024-10-09 16:22 ` Eli Zaretskii 2024-10-09 21:55 ` Emanuel Berg 2024-10-10 6:07 ` Emanuel Berg 2 siblings, 0 replies; 138+ messages in thread From: Eli Zaretskii @ 2024-10-09 16:22 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: johan.myreen, emacs-devel > From: "Dr. Arne Babenhauserheide" <arne_bab@web.de> > Cc: Johan Myréen <johan.myreen@gmail.com>, emacs-devel@gnu.org > Date: Wed, 09 Oct 2024 18:02:14 +0200 > > > My analysis is different. Emacs lacks volunteers who'd sit down and > > write documentation on how to configure Emacs for this or that job. > > I think the problem is different: there are already people who write > documentation on how to configure Emacs for tasks. There are also many > .emacs.d reppositories. > > There are awesome Emacs setups out there, much better than what I have. Those people need to come here and work with us on integrating their work into the Emacs documentation set. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 16:02 ` Dr. Arne Babenhauserheide 2024-10-09 16:22 ` Eli Zaretskii @ 2024-10-09 21:55 ` Emanuel Berg 2024-10-10 7:25 ` Eli Zaretskii 2024-10-10 6:07 ` Emanuel Berg 2 siblings, 1 reply; 138+ messages in thread From: Emanuel Berg @ 2024-10-09 21:55 UTC (permalink / raw) To: emacs-devel Hello, I was asked to send this to this list; it is from our anonymous IRC fried. ------------------------------------------------------------- Hi, Thank you all for your interest in my message, and for taking time to read it and time to reply. I will try to reply to all your messages in this single message. I first thought the implementation I proposed was obvious, so I kept some space for your suggestions as you know emacs better than me, but it seems that this brought a lot of confusions, so this new message will bring all the details about the implementation so you do not have to guess what I meant. I prefer that you keep in mind the main goal (and not the implementation itself), which is: To make emacs up and running with a useful configuration (not only as text editor, even here many customizations can enhance emacs) in a reasonable time, for almost every situation/scenario for everybody. What I meant by "everybody" is any potential user, that emacs can offer him to do what he needs to do (if emacs can do something, and a user needs to do this thing, then he is a potential emacs user). He can be dev/non-dev or beginner/non-beginner, no difference between users. Users who wants to read the manual first to use emacs, are already taken care of, and the manual is great. But what about all the other users ? I stated in my previous message, that I immediately discarded to propose the idea of a pre-configured init file (pre-configured emacs), and this was for many reasons: 1. There are a lot of "elementary" use cases/customizations, which new users usually want to start with (only one task they need at the very moment). But what if they, just after that, want to mix between these to make more "complex" use cases/customizations? or even to change a single customization which does not suites them in a given pre-configuration? This quickly becomes unmanageable. 2. This also has a big problem which is to make everyone agree on what are those use cases to provide a pre-configuration for. 3. Another big problem is to make everyone agree on what are the "defaults" to put in each pre-configuration. I think, in general, any idea which is very opinionated, will start a long debate before it eventually fails (wasting lot of efforts). 4. This will also need extra work to publish and maintain all these pre-configurations with their documentations. Some suggested that this is a documentation problem, and emacs needs to provide official documentations to customize emacs for certain tasks. Even though this is a very useful enhancement to emacs, it is very similar to the idea of a pre-configured emacs, thus having the same drawbacks listed above, in addition to leaving the user to do the pre-configuration himself which brings all discussion to the beginning (and also adding more documentations for the user to read). That is why I suggested the Q&A customization: 1. User can freely customize emacs for any use case (simple or complex/combination or even small tweaks). 2. User will customize emacs from the ground up (self cooking, with no magic). Hiding details he does not really need to know to start using emacs (he will, but this will happens later). 3. User will also be able to re-customize emacs (in the same way he did at the beginning). 4. emacs defaults are unchanged (avoiding any agreements problems). 5. no use cases (pre-configurations) to agree on. 6. no new defaults to be introduced or to agree on. 7. no extra effort to document, publish and maintain any pre-configuration (I think this implementation will help and encourage users to generate their own pre-configurations, for some specific tasks, in a very easy way, and start sharing them). I wrote the implementation in HTML, which you can find at the end of this message (all the links inside are empty and does not link to any resources). Please do not consider the design, fonts, colors and text content, etc. I am not a designer and I may also have wrote something wrong about emacs, so feel free to change or correct anything. If this implementation does not suites you, you can also change it, this implementation is provided to have better view of the main idea. If this implementation suites you, I think it will need 3 things to be completed: 1. Fill the dots (...) and change/adapt the text,colors,links,... that I suggested. 2. List all the questions/customizations to be asked for user, and organize them in a hierarchy. 3. Write the code that will collect user input, and configure emacs accordingly. It is not necessary to add all the possible questions/customizations before making this feature available in emacs. A useful subset is just fine, and more questions/customizations can be added gradually later. The implementation is mainly about 2 parts: 1. part1: "Getting started" (or introduction to emacs). 2. part2: "What is next" (or emacs customization). For part1’s implementation, I had to modify the actual *GNU Emacs* startup buffer, so I: - moved some links to a new *Get Started* buffer (I have added). - kept only what I guess should really be kept. - modified/added some texts. - added a "Get Started" link which should open the new *Get Started* buffer. (feel free to change the names or anything, as stated previously, the names I chose everywhere are only for demonstration). Part1 can be added to emacs as of now, if everybody agree on of course (with some work to fully complete it), because it is totally independent from part2, and it enhances user first experience with emacs. If you want, you can move part1 (part1 HTML) to a separate thread to collect everybody input on it separately. I added part2 also inside the same new *Get Started* buffer, it can be easily moved to a separate *What Is Next* buffer if needed (in this case a "What is Next" link should be added in *Get Started* buffer to open the *What Is Next* buffer). 1. part1: Getting Started: This part is to introduce user to emacs vocabulary/environment in a very quick way, because emacs vocabulary is very special, and the ui also like for example the modeline (which is useful to start using emacs). Only things that user need to know to start using emacs are to be shown, when the user is satisfied he will be motivated to read further, and even read the manual later. Anything which is not really necessary to start using emacs like keybindings, packages,..., better be avoided. Even the minibuffer, that is why I only mentioned the "echo area", new users does not need to know the difference between the "echo area" and the minibuffer (if I am not wrong), and previous emacs users will understand this as well (because the minibuffer is displayed in the "echo area" anyway). New users should also not know that they can open multiple frames, to start using emacs, etc. The introduction should not only be as short as possible, but as easy, attractive, entertaining as possible, in other word non-boring or difficult to understand. For example when user start clicking on the links and see the immediate result of his actions, he will continue clicking and clicking, etc. From the first time user open emacs, he will be guided, and start clicking and clicking, and in about 20 to 25 entertaining clicks and 5 to 10min reading, he will be familiar with emacs, and feels he can do something useful, without even noticing the time he spent there. This part is not fully completed (almost completed), but is enough to give you a very clear idea. This part is also needed for the part2 ("customizations" part), as the user cannot be asked if he wants to remember the windows positions, without him knowing what a window is in the first place. etc (even if user is familiar with similar softwares, emacs has a special vocabulary, as stated above, that user needs to know before using/customizing emacs). 2. part2: What is next (the "customization" part): This part can be moved to a separate dedicated *What Is Next* buffer, if it is better, as stated above. This part is also already described in my previous message (If you landed here directly, I encourage you to read the first message https://lists.gnu.org/archive/html/emacs-devel/2024-10/msg00018.html). This part give a user a fast way to customize emacs to his needs, by asking him questions. This is somehow similar to the idea of the actual "Customize Startup" link located in the actual *GNU Emacs* startup buffer, but this actual link contains only a very limited subset and are also not beginner friendly (lot of advanced vocabulary that needs user to read the manual first). This is also similar to https://emacs.amodernist.com/ I mentioned in my previous message. I also prefer this "customization" part to be questions asked in the minibuffer if possible, and not a a sequence of buffers with long texts, checkboxes, buttons, fields,..., like the "customization interface". This is just a personal preference, if you think this is not possible or not user friendly or any other reason, it is ok. If this will cause agreement issues, then maybe both can be added, and let the user choose which one he wants to use (if the ui interface is chosen/implemented, it will be very easy to implement the Q&A in the minibuffer anyway). It is basically a hierarchy of questions with the top level questions being let say around 10, so when the user click the "Start customizing Emacs" link (I added), he needs to press the "Enter" key 10 times to know what he can do with emacs (ui/themes, basic editing, communication suite, development, org, ...), and only when the user chose to customize something, he will be asked the corresponding next level questions, also the next level questions should be as few as possible, and the next level questions too, etc... Similar to the "customization interface" hierarchy but using more generic and beginner friendly terms, and proposing features which can be found in GNU ELPA archive packages (without the user having to know about packages, and use the actual "package interface" to discover new packages and install them manually, etc.) When the user is satisfied, he will be motivated to read the manual later and know more about emacs. Imagine a developer who needs a code editor with a LSP client, and he does not know anything at all about emacs and also about some other editor. Compare the time he needs to use emacs as a LSP client with auto-complete, and the time he needs to use the other editor as LSP client with auto-complete. He needs to spend at least days, if not weeks to understand many things about emacs and have something useful to work with. This is just one and a very simple example among many. This is not to mention all the compile errors when installing a package sometimes, ..., and if he wants to customize emacs by editing the init file directly, how many times emacs will start with a blank page with an error, because he forgets a single parentheses somewhere, and he finds himself totally blocked, ... , this is not to mention too the packages that are really useful to first use emacs specially for beginners, like undo-tree, vertico+orderless if they want to read about and use the minibuffer directly, ...). All these times spent by previous emacs users, and that will be spent by new emacs users, can be easily avoided, and maybe converted into contributing to emacs. The thing is that you need to encourage users to start using emacs in the first place, by lowering the entry barrier, and many of them will sooner or later go and read the manual, and know more about emacs, and contribute to add some functionalities they need and/or correct a bug they are facing, but if users are discarded from the beginning, this is not good. Some users may instead be interested in (or prefer) reading the manual first, and using the customization interface or manually editing the init file, why not, but even here, many do not have enough time to do that, so they let it go. That is why I think this feature is very useful. I may be wrong, or I may have missed something. I am not saying that users should not use the "customization interface" or edit the init file directly. I only think that the entry barrier to emacs is too high (to discourage most users), and can be easily lowered. This will not only be for beginners, even people who are already using emacs can use it. There will be 3 ways to configure emacs: - customization interface. - editing the init file directly. - this new feature. This feature can contains advanced customizations of course (for example that needs user to read emacs manual or any other documentation before using them), but they will be hidden behind questions like "Do you want to customize IRC client (yes/no) ?": - users who does not know anything about IRC and not interested will choose "no". - interested users will go to read about IRC to know more about it and come back later. They can even choose "yes" to see what are the next questions (without affecting emacs). - and users who already know about IRC, will choose "yes", and will know how to answer the next questions and how to use IRC afterwards. Thank you all for you time, <!DOCTYPE html> <html> <head> <style> .ui { background-color: lightskyblue; color: #fff; display: inline-block; padding: 0px 3px; border-radius: 3px; } .action { background-color: lightgrey; color: #fff; display: inline-block; padding: 0px 3px; border-radius: 3px; } </style> </head> <body> <span>[*GNU Emacs* buffer START]</span> <div id="GNU Emacs"> <hr></hr> <h1 style="text-align:center;">[EMACS LOGO]</h1> <h2 style="text-align:center;">Welcome to GNU Emacs</a></h2> <p style="color: #ff0000;">Welcome to <a href="">GNU Emacs</a>, one component of the <a href="">GNU/Linux</a> operating system.</p> <h3>Before getting started, you may want to check:</h3> <ol style="list-style: none; font-size: 14px; line-height: 32px; font-weight: bold;"> <li> <a href="">Absence of Warranty </a> GNU Emacs comes with ABSOLUTELY NO WARRANTY</li> <li> <a href="">Copying Conditions</a> Conditions for redistributing and changing Emacs</li> </ol> <h2 style="text-align:center;"><a href="">Get Started</a></h2> <p>This is GNU Emacs version ... build ...<br/> Copyright (C) ... Free Software Foundation, Inc.<p> <hr></hr> </div> <span>[*GNU Emacs* buffer END]</span> <br></br> <br></br> <br></br> <span>[*Get Started* buffer START]</span> <div id="Get Started"> <hr></hr> <h2 style="text-align:center;">Getting Started</h2> <p>You can click on the words highlighted in <span class="ui">blue</span> to locate the corresponding item on the screen.<br/> You can click on the words highlighted in <span class="action">grey</span> to execute the corresponding action.</p> <p>The text you are actually reading, is displayed in a <a href="" class="ui">window</a></p> <p>This window is inside a <a href="" class="ui">frame</a>.</p> <p>You can open multiple windows inside a frame. For example, to open a new window to the right, you can click on the menu item <a href="" class="action">New Window on Right</a> inside the "File" menu in the <a href="" class="ui">menu bar</a> located at the top of the frame. Each menu item will execute a specific emacs "command" to accomplish a specific task. To close a window you can ... . If you accidently closed this window you can .... or you can close and open emacs again.</p> <p>The menu bar contains all the commands you need to accomplish all kind of tasks in emacs.</p> <p>In case you changed your mind and want to cancel a command you have already initiated, you need to press the "g" key while pressing and holding the "Control" key on your keyboard (C-g). You can also press this key combination if you think that a command is taking too much time to complete or is making emacs unresponsive to other commands you are trying to initiate.</p> <p>You may have noticed that when you opened the new window, a message was displayed in the bar at the bottom of the frame. This bar is called the <a href="" class="ui">echo area</a>. Every action in emacs results in a brief message so you can ... . This message will disappear after a short time or when ... </p> <p>Some commands you execute may need further input from your side, for example if you execute the search command to search for a specific word or phrase in a specific buffer, you need to provide the word or phrase you are are searching for. When you execute such commands, a brief and persistent message is displayed in the echo area which ends with a colon ":", showing what the command is expecting as input from your side. In this case it is the "Search for string:" message which is inviting you to enter the word or phrase you are searching for. You need to enter these directly after the colon ":". If you want to cancel the search command you need to press (C-g) as describe earlier. If you need to use the search command, you may want to read the documentation about it first in ... .</p> <p>Each command is documented and you can find its documentation by clicking on ... <<<span style="background-color:yellow">user needs a simple way to access this. Same as clicking on [Help->Describe->Describe Key or Mouse Operation] then selecting the command (he wants) in the menubar (Without using keybindings or using the minibuffer)</span>>></p> <p> You can work inside a single window at a time, the one having the focus, this is usually indicated by a blinking <a href="" class="ui">cursor.</a> The cursor is also known as "point" and indicates where the text you are going to type will be inserted.</p> <p> Each window display a single file content which is called <a href="" class="ui">buffer</a>. To open a new file in the right window, you need to click inside the right window first, to get the focus, and then click on the <a href="" class="ui">"New File" icon</a> in the <a href="" class="ui">toolbar</a>.</p> <p>The toolbar contains some of the menubar commands for a quick and convenient access.</p> <p>To close the file displayed in the right window, you need to ... but this will not close the window itself, to close the window you need to repeat the same step described earlier. Closing a window will not close the buffer displayed inside, the buffer will remain opened in emacs and you can display it again in any other window you want.</p> <p>You can also open some special emacs buffers in a window, like the <a href="" class="action">*Messages*</a> buffer which displays ... and the <a href="" class="action">*Errors*</a> buffer which displays ... . If you encounter any error you may want to search ... first, or send an email to ... or join the IRC channel ... , or ...</p> <p> Emacs special buffers names are always surrounded by **. The buffer you are actually reading is named *Get Started* as you can see in the <a href="" class="ui">modeline</a>. This buffer replaced the previous buffer that was opened in this window when you first started emacs and which was called <a href="" class="action">*GNU Emacs*</a> (also known as the startup buffer).</p> <p>Each window has its own modeline. The modeline is used to display ... <a href="" class="ui">flag1</a> ... <a href="" class="ui">flag2</a> ... <a href="" class="ui">buffer name</a> ... <a href="" class="ui">buffer modes ...</a></p> <p>This is all you need to get started using emacs.</p> <p>If you want to learn more, you can read the manual:</p> <ol style="list-style: none; font-size: 15px; line-height: 32px; font-weight: bold;"> <li> <a href="">View Emacs Manual</a> View the Emacs manual using Info</li> <li> <a href="">Ordering Manuals</a> Purchasing printed copies of manuals</li> </ol> <p>You may also want to check:</p> <ol style="list-style: none; font-size: 15px; line-height: 32px; font-weight: bold;"> <li> <a href="">Emacs Tutorial</a> Learn basic keystroke commands</li> </ol> <h2 style="text-align:center;">What is next</h2> <p>Now that you are familiar with emacs environment, and ready to start using emacs, you may want to customize emacs first to suites your specific needs.</p> <p>You can customize everything in emacs. For example you can hide the toolbar, the menu bar, the modeline, you can change the items displayed in the modeline, you can change the startup buffer, you can choose to automatically save the files you are editing, and choose when they got saved, you may want to automatically keep a backup of these files too, ...</p> <p>The following link will help you do that, and in the same time you will be discovering the mostly used features in emacs, you can also have an overview of some of these features in the <a href="">Emacs Guided Tour</a> at gnu.org.</p> <p>Clicking on this link will execute a command like the ones you initiate from the menubar or the toolbar. This command needs further input from your side for each customization, which you will have to enter in the echo area as usual.</p> <p>All the customizations have a pre-selected value, you can hit the "Enter" key to keep this value, or you can chose another value ....</p> <p>You can repeat this step as much as you need, to re-customize emacs, or even to check what are the values for certain customizations. The values in green are the values you have never changed (emacs defaults), the values in red are the ones you have already changed, in a previous run, to a non-default value.</p> <p>All the customizations will be stored under .... in case you want to backup your customizations, or you want to use the same customizations for another emacs instance running on a different device, without having to repeat this step again.</p> <h3 style="text-align:center;"><a href="">Start Customizing emacs</a></h3> <p>If you need a more advanced customizations, or you want to know what other features emacs can offer, you may want to read the emacs manual first, and then use the more advanced <a href="">customization interface.</a></p> <hr></hr> </div> <span>[*Get Started* buffer END]</span> </body> </html> -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 21:55 ` Emanuel Berg @ 2024-10-10 7:25 ` Eli Zaretskii 2024-10-10 9:35 ` Dr. Arne Babenhauserheide 2024-10-13 3:29 ` Richard Stallman 0 siblings, 2 replies; 138+ messages in thread From: Eli Zaretskii @ 2024-10-10 7:25 UTC (permalink / raw) To: emacs-devel > From: Emanuel Berg <incal@dataswamp.org> > Date: Wed, 09 Oct 2024 23:55:16 +0200 > > Hello, I was asked to send this to this list; it is from our > anonymous IRC fried. Thanks. > The implementation is mainly about 2 parts: > > 1. part1: "Getting started" (or introduction to emacs). This is basically an alternative to TUTORIAL. It describes the Emacs basics in a different order than the tutorial, and I'm not sure which one is better. The advantage of this method is that it's shorter and introduces the basic concepts right away; the disadvantage is that the description is necessarily much more abstract, and almost nothing in it requires the reader to _do_ anything, which IME tends to bore and lose the reader's attention. > 2. part2: "What is next" (or emacs customization). > > For part1’s implementation, I had to modify the actual *GNU > Emacs* startup buffer, so I: > > - moved some links to a new *Get Started* buffer (I have > added). > > - kept only what I guess should really be kept. > > - modified/added some texts. > > - added a "Get Started" link which should open the new *Get > Started* buffer. (feel free to change the names or anything, > as stated previously, the names I chose everywhere are only > for demonstration). I'm probably missing something because in the HTML you posted this part is basically empty. It mentions Customize in general terms, but that's _how_ to customize Emacs, not _what_ to customize. How is the user supposed to know which variables/features to customize? What did I miss? > 1. part1: Getting Started: > > This part is to introduce user to emacs vocabulary/environment > in a very quick way, because emacs vocabulary is very special, > and the ui also like for example the modeline (which is useful > to start using emacs). Only things that user need to know to > start using emacs are to be shown, when the user is satisfied > he will be motivated to read further, and even read the > manual later. > > Anything which is not really necessary to start using emacs > like keybindings, packages,..., better be avoided. > > Even the minibuffer, that is why I only mentioned the "echo > area", new users does not need to know the difference between > the "echo area" and the minibuffer (if I am not wrong), and > previous emacs users will understand this as well (because the > minibuffer is displayed in the "echo area" anyway). New users > should also not know that they can open multiple frames, to > start using emacs, etc. > > The introduction should not only be as short as possible, but > as easy, attractive, entertaining as possible, in other word > non-boring or difficult to understand. That's a tough ticket. There's so much in the Emacs display that is or might be important that explaining it in a short text is hard, if not impossible. For example, the description you posted doesn't mention the scroll bars, and the description of the mode line is only hinted upon; filling that with actual information will likely make it much longer. I think we'd most welcome attempts to do what you are trying to do, but it isn't easy. > 2. part2: What is next (the "customization" part): > > This part can be moved to a separate dedicated *What Is Next* > buffer, if it is better, as stated above. > > This part is also already described in my previous message (If > you landed here directly, I encourage you to read the first > message > https://lists.gnu.org/archive/html/emacs-devel/2024-10/msg00018.html). > > This part give a user a fast way to customize emacs to his > needs, by asking him questions. This is an idea that has come up before, more than once. I think everyone agrees that it's a good idea. The hard part in this is to come up with a good sequence of questions, which would address different usage patterns that Emacs can support. I don't think I've seen any attempts to do this which are close to completion, I only saw this idea being described and discussed, and a few attempts to produce a starting point. If you can post the more-or-less full list of questions (which will probably be a tree or a DAG, not a linear list, since the user should be asked quite early what are his/her needs that they want to accomplish with Emacs, and perhaps also what are their UI preferences.), please do: I think this could be a very good step in the right direction. > This is somehow similar to the idea of the actual "Customize > Startup" link located in the actual *GNU Emacs* startup > buffer, but this actual link contains only a very limited > subset and are also not beginner friendly (lot of advanced > vocabulary that needs user to read the manual first). > > This is also similar to https://emacs.amodernist.com/ > I mentioned in my previous message. I think https://emacs.amodernist.com/ is a good starting point, but IMO it is nowhere near being complete. I see the following ways to improve it: . More background information on the features it asks about, so the readers could make up their minds about using them. For example, it asks about Org without actually telling much about it: how is the reader supposed to know ehether he/she wants it? It generally assumes that the readers already know what they want and need just to be pointed to the Emacs feature which implements some functionality. A good example is "Version Control" -- are we sure everyone knows what this is about? . It leaves out many popular and important features in Emacs. One notable example is email; another is access to remote files; yet another is debugging and the built-in GDB front-end; etc. etc. . The "Miscellaneous" section at the end is a very small subset of convenience features Emacs offers, and should be greatly expanded and classified into groups (otherwise it will be a very large unsorted list of unrelated settings, which will be hard to read and understand). It also needs to describe each feature in more than just a single sentence. > I also prefer this "customization" part to be questions asked > in the minibuffer if possible, and not a a sequence of buffers > with long texts, checkboxes, buttons, fields,..., like the > "customization interface". If you want to code a customization interface that is based on asking questions, then doing that for complex values might be difficult or cumbersome. As a simple example, how do you propose to let users to customize a face by asking questions instead of having checkboxes and fields? The basic disadvantage of asking one question at a time is that the user doesn't see the whole picture, and also that there's no easy way of going back to a previous question and answering it in a different way. > Imagine a developer who needs a code editor with a LSP client, > and he does not know anything at all about emacs and also > about some other editor. Compare the time he needs to use > emacs as a LSP client with auto-complete, and the time he > needs to use the other editor as LSP client with > auto-complete. He needs to spend at least days, if not weeks > to understand many things about emacs and have something > useful to work with. If a developer already knows about LSP, and already decided LSP server is the best solution for what the developer has in mind, then yes. But what if the developer doesn't know about the alternatives Emacs provides that don't require an LSP client? Setting up an LSP server is not a trivial task, so if Emacs provides an alternative, the customization helper you describe should give enough information for the developer to consider these alternatives and make up his/her mind about the one best for him/her. E.g., many people don't know about etags and the many languages it supports, or about ElDoc and its backends other than LSP-driven Eglot. IMO, the customization wizard should mention those. > Some users may instead be interested in (or prefer) reading > the manual first, and using the customization interface or > manually editing the init file, why not, but even here, many > do not have enough time to do that, so they let it go. We don't recommend reading the manual in its entirety anywhere. Instead, we recommend reading those chapters and sections in the manual that are relevant to the job in hand. The manuals are well indexed and organized to allow this method and to make it time-efficient for our users. Thanks again for working on these important aspects of Emacs. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-10 7:25 ` Eli Zaretskii @ 2024-10-10 9:35 ` Dr. Arne Babenhauserheide 2024-10-10 10:42 ` Eli Zaretskii 2024-10-13 3:29 ` Richard Stallman 1 sibling, 1 reply; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-10 9:35 UTC (permalink / raw) To: Eli Zaretskii; +Cc: emacs-devel [-- Attachment #1: Type: text/plain, Size: 1902 bytes --] Eli Zaretskii <eliz@gnu.org> writes: >> This is also similar to https://emacs.amodernist.com/ >> I mentioned in my previous message. > > I think https://emacs.amodernist.com/ is a good starting point, but > IMO it is nowhere near being complete. I see the following ways to > improve it: > > . More background information on the features it asks about, so the This is an indication that asking is the wrong approach. We can only ask questions that users can give an informed answer to. If we need more than a few words to give that information, then asking the users puts an undue strain on them. If questions require lots of reading to understand the answers (or their implications), we should provide a default and enable already informed users to deviate from the default. And maybe provide links for further reading for those who want to dig. To avoid causing problems to those who want to tinker, an option like "minimalistic" could help. That would disable all potentially conflicting customizations. > Setting up an LSP server is not a trivial task, so if Emacs provides > an alternative, the customization helper you describe should give > enough information for the developer to consider these alternatives > and make up his/her mind about the one best for him/her. Also my experience with the difference between js2-mode and the typescript (ts) lsp is that js2-mode is much, much more enjoyable to use, because it feels instantaneous while the lsp always causes delays. But js2-mode only works for Javascript (maybe with jsdoc), but not for Typescript. That’s why I know the difference. I don’t know whether it is the same for other lsp servers and their provided alternatives, but if it is, then suggesting an lsp may not be the best. Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-10 9:35 ` Dr. Arne Babenhauserheide @ 2024-10-10 10:42 ` Eli Zaretskii 0 siblings, 0 replies; 138+ messages in thread From: Eli Zaretskii @ 2024-10-10 10:42 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: emacs-devel > From: "Dr. Arne Babenhauserheide" <arne_bab@web.de> > Cc: emacs-devel@gnu.org > Date: Thu, 10 Oct 2024 11:35:12 +0200 > > If questions require lots of reading to understand the answers (or their > implications), we should provide a default and enable already informed > users to deviate from the default. And maybe provide links for further > reading for those who want to dig. That's basically what we already do: our defaults are set up like that, except that we are very conservative with changing them, and so might decide to adapt to some changes quite some time after the changes happened. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-10 7:25 ` Eli Zaretskii 2024-10-10 9:35 ` Dr. Arne Babenhauserheide @ 2024-10-13 3:29 ` Richard Stallman 1 sibling, 0 replies; 138+ messages in thread From: Richard Stallman @ 2024-10-13 3:29 UTC (permalink / raw) To: Eli Zaretskii; +Cc: emacs-devel [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > I think https://emacs.amodernist.com/ is a good starting point, but > IMO it is nowhere near being complete. That site looks like a good approach to me, but we should beware of trying to make it "complete", because that would make it so many questions thta it would overload beginners, and even not-quite-beginners. It needs to selectively show only fairly important options. It should limit itself to things that are part of Emacs: core and GNU ELPA. Things that we recommend in Emacs should not depend on packages in NonGNU ELPA. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 16:02 ` Dr. Arne Babenhauserheide 2024-10-09 16:22 ` Eli Zaretskii 2024-10-09 21:55 ` Emanuel Berg @ 2024-10-10 6:07 ` Emanuel Berg 2 siblings, 0 replies; 138+ messages in thread From: Emanuel Berg @ 2024-10-10 6:07 UTC (permalink / raw) To: emacs-devel Dr. Arne Babenhauserheide wrote: >> My analysis is different. Emacs lacks volunteers who'd sit >> down and write documentation on how to configure Emacs for >> this or that job. > > I think the problem is different: there are already people > who write documentation on how to configure Emacs for tasks. > There are also many .emacs.d reppositories. > > There are awesome Emacs setups out there, much better than > what I have. > > What's missing is a way to integrate these efforts into > Emacs so new users can benefit from them. 100%! Before I write a `defun', I always think, did someone else already write this exact defun - in Emacs, in GNU ELPA, on some -hub or some homepage, anywhere? And the answer is always, "I don't know". And then I ask: "Okay, but how do I find out then?" "I don't know." -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 13:13 ` Eli Zaretskii 2024-10-09 13:38 ` tomas 2024-10-09 16:02 ` Dr. Arne Babenhauserheide @ 2024-10-09 16:06 ` Johan Myréen 2024-10-09 16:12 ` Ship Mints 2024-10-09 16:25 ` Eli Zaretskii 2024-10-09 21:25 ` Dmitry Gutov 3 siblings, 2 replies; 138+ messages in thread From: Johan Myréen @ 2024-10-09 16:06 UTC (permalink / raw) To: emacs-devel [-- Attachment #1: Type: text/plain, Size: 6434 bytes --] I understand Emacs is a volunteer project and finding good documentation writers is difficult. I was just suggesting what direction I would like to see Emacs documentation going. Emacs has a good and extensive manual that provides mostly a great reference to how to use Emacs as an editor. What I am proposing is a higher level view, a kind of cookbook on how to do different things with Emacs. I just started my Emacs (from the main branch) with -q and opened a Rust source file. Emacs out of the box does not even recognize the .rs file extension: the file is opened in Fundamental mode. A novice Emacs user might guess that he or she needs to install a Rust mode for Emacs to recognize we are editing Rust source code. But by only doing this the user is missing out on so much useful functionality Emacs has to offer. How is the user supposed to know that ¨Eglot" is the way to connect to a language server, or that a package named ¨Company" provides completion? The only way right now is to search for this on the internet, which is associated with the quality problems I described in my previous message. Software has grown more complex during the years Emacs has been in existence, and so have the expectations of the public using it. Emacs has fantastic collections of packages, each focusing on different things. This is a good modular design. Some of these packages can be used to form, for example, a working Rust development environment. The problem is finding these packages. How does a new Emacs user know what to look for? So I am proposing a "task-oriented" category in the Emacs documentation. I don´t think there is such a category. Eglot is part of Emacs, but it cannot be started automatically because the > LSP server, which is a > separate piece of software, needs to be installed and configured first; > are we supposed to be held > responsible for that as well No, all I am talking about is documentation. In fact I really dislike some things that happen by magic, but are undocumented. They typically break over time, which is a bigger headache to fix than configuring things by hand using good documentation. I'm guessing VSCode comes with pre-configured LSP servers, a single > Rust mode, and a single Git interface. Am I mistaken? > No, VSCode does not come pre-configured for Rust development. But, there is a good, task-oriented web page that describes in simple terms what needs to be installed and configured to start writing Rust code using VSCode. Similar pages exist for Java, Javascript, C++, C#, Python, Go, etc. More importantly, this documentation can be found on code.visualstudio.com ( https://code.visualstudio.com/docs/languages/rust), not on YouTube.com or robert.kra.hn or some other random website. Johan Myréen On Wed, 9 Oct 2024 at 16:14, Eli Zaretskii <eliz@gnu.org> wrote: > > From: Johan Myréen <johan.myreen@gmail.com> > > Date: Wed, 9 Oct 2024 14:09:13 +0300 > > > > I see this more as a documentation problem. Emacs lacks "official" > documentation on how to configure an > > environment to do certain things, which includes installing certain > Elisp packages, and configuring them. > > My analysis is different. Emacs lacks volunteers who'd sit down and > write documentation on how to configure Emacs for this or that job. > Once that is written, and written well, admitting it into Emacs is > usually a no-brainer. > > Mind you: the above is an extremely non-trivial job, because the sheer > number of possible "jobs" which Emacs can support is mind-boggling. > Even if someone describes in excruciating detail how to configure > Emacs for Rust development, that only helps people who need to develop > programs in Rust, but doesn't help at all to, say, someone who needs to > write a thesis about some academic subject, or read email from Gmail > or even develop C++ programs, or... > > > In the good old days software development meant editing a few C files in > Emacs and then running make. > > This no longer meets the expectations people have of a software > development environment. For example, > > creating a contemporary environment to write and build software using > the Rust programming language and > > Emacs, you need Rust mode, rust-ts-mode for Treesitter integration, > Eglot to communicate with > > rust-analyzer (a Language Server implementation for Rust) for completion > and goto definition, Company > > mode for code completion, Magit for version control, DAP mode for > debugging, and so on. Many of these > > packages have alternative implementations, for example rustic-mode > instead of rust-mode. > > This is an exaggeration to some degree. rust-ts-mode is part of > Emacs, and could be turned on automatically when a Rust file is > visited; we didn't do that because we are unsure whether users of an > unbundled Rust mode will protest. Eglot is part of Emacs, but it > cannot be started automatically because the LSP server, which is a > separate piece of software, needs to be installed and configured > first; are we supposed to be held responsible for that as well? We do > have TAGS support for Rust (goto definition etc., so alternative to > LSP), and the new etags-regen-mode might just make the job of using > TAGS much easier and seamless. Magit is nice, but not really > necessary, since we have VC built in, which doesn't need to be > configured. DAP is not necessary, since Emacs has a GDB front-end > (which doesn't need to be configured, just invoked with a single > command), and GDB supports debugging Rust programs. > > So things are not that bad, are they? > > I do agree that good tutorials which would mention all this stuff > would make things better, at least for those who read documentation > (how many do?), but that needs volunteers to sit down and write that > up. Would you please consider doing something like that for some jobs > with which you are familiar? > > > I'm not saying you can't edit Rust code without all these packages, but > these packages combined provide > > the minimum that the competition (e.g. Visual Studio Code) offers. > > I'm guessing VSCode comes with pre-configured LSP servers, a single > Rust mode, and a single Git interface. Am I mistaken? If so, is that > how we want to treat our users? will they agree to be treated like > that? > [-- Attachment #2: Type: text/html, Size: 7491 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 16:06 ` Johan Myréen @ 2024-10-09 16:12 ` Ship Mints 2024-10-09 16:25 ` Eli Zaretskii 1 sibling, 0 replies; 138+ messages in thread From: Ship Mints @ 2024-10-09 16:12 UTC (permalink / raw) To: Johan Myréen; +Cc: emacs-devel [-- Attachment #1: Type: text/plain, Size: 7255 bytes --] Speaking of cookbooks, some people prefer packaged food, some prefer cooking. I see Emacs as a platform for those who prefer cooking. Public support via reddit or stackoverflow or the Emacs mailing lists, tends to be friendly and helpful but can't substitute users' own desires to cook for themselves. When VSCode goes wrong, they have to figure stuff out for themselves anyway (it's a fairly buggy ecosystem, in my experience). If they can handle the complexity of the Rust compiler, they can handle the complexity of Emacs. They just have to cook a little. On Wed, Oct 9, 2024 at 12:07 PM Johan Myréen <johan.myreen@gmail.com> wrote: > I understand Emacs is a volunteer project and finding good documentation > writers is difficult. I was just suggesting what direction I would like to > see Emacs documentation going. Emacs has a good and extensive manual that > provides mostly a great reference to how to use Emacs as an editor. What I > am proposing is a higher level view, a kind of cookbook on how to do > different things with Emacs. > > I just started my Emacs (from the main branch) with -q and opened a Rust > source file. Emacs out of the box does not even recognize the .rs file > extension: the file is opened in Fundamental mode. A novice Emacs user > might guess that he or she needs to install a Rust mode for Emacs to > recognize we are editing Rust source code. But by only doing this the user > is missing out on so much useful functionality Emacs has to offer. How is > the user supposed to know that ¨Eglot" is the way to connect to a language > server, or that a package named ¨Company" provides completion? The only way > right now is to search for this on the internet, which is associated with > the quality problems I described in my previous message. > > Software has grown more complex during the years Emacs has been in > existence, and so have the expectations of the public using it. Emacs has > fantastic collections of packages, each focusing on different things. This > is a good modular design. Some of these packages can be used to form, for > example, a working Rust development environment. The problem is finding > these packages. How does a new Emacs user know what to look for? > > So I am proposing a "task-oriented" category in the Emacs documentation. I > don´t think there is such a category. > > Eglot is part of Emacs, but it cannot be started automatically because the >> LSP server, which is a >> separate piece of software, needs to be installed and configured first; >> are we supposed to be held >> responsible for that as well > > > No, all I am talking about is documentation. In fact I really dislike some > things that happen by magic, but are undocumented. They typically break > over time, which is a bigger headache to fix than configuring things by > hand using good documentation. > > I'm guessing VSCode comes with pre-configured LSP servers, a single >> Rust mode, and a single Git interface. Am I mistaken? >> > > No, VSCode does not come pre-configured for Rust development. But, there > is a good, task-oriented web page that describes in simple terms what needs > to be installed and configured to start writing Rust code using VSCode. > Similar pages exist for Java, Javascript, C++, C#, Python, Go, etc. More > importantly, this documentation can be found on code.visualstudio.com ( > https://code.visualstudio.com/docs/languages/rust), not on YouTube.com or > robert.kra.hn or some other random website. > > Johan Myréen > > > > > On Wed, 9 Oct 2024 at 16:14, Eli Zaretskii <eliz@gnu.org> wrote: > >> > From: Johan Myréen <johan.myreen@gmail.com> >> > Date: Wed, 9 Oct 2024 14:09:13 +0300 >> > >> > I see this more as a documentation problem. Emacs lacks "official" >> documentation on how to configure an >> > environment to do certain things, which includes installing certain >> Elisp packages, and configuring them. >> >> My analysis is different. Emacs lacks volunteers who'd sit down and >> write documentation on how to configure Emacs for this or that job. >> Once that is written, and written well, admitting it into Emacs is >> usually a no-brainer. >> >> Mind you: the above is an extremely non-trivial job, because the sheer >> number of possible "jobs" which Emacs can support is mind-boggling. >> Even if someone describes in excruciating detail how to configure >> Emacs for Rust development, that only helps people who need to develop >> programs in Rust, but doesn't help at all to, say, someone who needs to >> write a thesis about some academic subject, or read email from Gmail >> or even develop C++ programs, or... >> >> > In the good old days software development meant editing a few C files >> in Emacs and then running make. >> > This no longer meets the expectations people have of a software >> development environment. For example, >> > creating a contemporary environment to write and build software using >> the Rust programming language and >> > Emacs, you need Rust mode, rust-ts-mode for Treesitter integration, >> Eglot to communicate with >> > rust-analyzer (a Language Server implementation for Rust) for >> completion and goto definition, Company >> > mode for code completion, Magit for version control, DAP mode for >> debugging, and so on. Many of these >> > packages have alternative implementations, for example rustic-mode >> instead of rust-mode. >> >> This is an exaggeration to some degree. rust-ts-mode is part of >> Emacs, and could be turned on automatically when a Rust file is >> visited; we didn't do that because we are unsure whether users of an >> unbundled Rust mode will protest. Eglot is part of Emacs, but it >> cannot be started automatically because the LSP server, which is a >> separate piece of software, needs to be installed and configured >> first; are we supposed to be held responsible for that as well? We do >> have TAGS support for Rust (goto definition etc., so alternative to >> LSP), and the new etags-regen-mode might just make the job of using >> TAGS much easier and seamless. Magit is nice, but not really >> necessary, since we have VC built in, which doesn't need to be >> configured. DAP is not necessary, since Emacs has a GDB front-end >> (which doesn't need to be configured, just invoked with a single >> command), and GDB supports debugging Rust programs. >> >> So things are not that bad, are they? >> >> I do agree that good tutorials which would mention all this stuff >> would make things better, at least for those who read documentation >> (how many do?), but that needs volunteers to sit down and write that >> up. Would you please consider doing something like that for some jobs >> with which you are familiar? >> >> > I'm not saying you can't edit Rust code without all these packages, but >> these packages combined provide >> > the minimum that the competition (e.g. Visual Studio Code) offers. >> >> I'm guessing VSCode comes with pre-configured LSP servers, a single >> Rust mode, and a single Git interface. Am I mistaken? If so, is that >> how we want to treat our users? will they agree to be treated like >> that? >> > [-- Attachment #2: Type: text/html, Size: 8554 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 16:06 ` Johan Myréen 2024-10-09 16:12 ` Ship Mints @ 2024-10-09 16:25 ` Eli Zaretskii 1 sibling, 0 replies; 138+ messages in thread From: Eli Zaretskii @ 2024-10-09 16:25 UTC (permalink / raw) To: Johan Myréen; +Cc: emacs-devel > From: Johan Myréen <johan.myreen@gmail.com> > Date: Wed, 9 Oct 2024 19:06:12 +0300 > > I just started my Emacs (from the main branch) with -q and opened a Rust source file. Emacs out of the box > does not even recognize the .rs file extension: the file is opened in Fundamental mode. I explained why we did it like that. To have the .rs extension recognized, you need to load rust-ts-mode first. Emacs tries very hard not to break any user's configuration, and sometimes that means newcomers have to work harder. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 13:13 ` Eli Zaretskii ` (2 preceding siblings ...) 2024-10-09 16:06 ` Johan Myréen @ 2024-10-09 21:25 ` Dmitry Gutov 2024-10-10 4:56 ` Eli Zaretskii 3 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-10-09 21:25 UTC (permalink / raw) To: Eli Zaretskii, Johan Myréen; +Cc: emacs-devel On 09/10/2024 16:13, Eli Zaretskii wrote: > rust-ts-mode is part of > Emacs, and could be turned on automatically when a Rust file is > visited; we didn't do that because we are unsure whether users of an > unbundled Rust mode will protest That seems unlikely: as long as the auto-mode-alist configuration for rust-ts-mode is done early on in Emacs's startup, any installed 3rd party package such as rust-mode would add its config later, and thus have priority. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 21:25 ` Dmitry Gutov @ 2024-10-10 4:56 ` Eli Zaretskii 2024-10-10 5:14 ` Xiyue Deng 2024-10-11 20:30 ` Dmitry Gutov 0 siblings, 2 replies; 138+ messages in thread From: Eli Zaretskii @ 2024-10-10 4:56 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Thu, 10 Oct 2024 00:25:40 +0300 > Cc: emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > On 09/10/2024 16:13, Eli Zaretskii wrote: > > rust-ts-mode is part of > > Emacs, and could be turned on automatically when a Rust file is > > visited; we didn't do that because we are unsure whether users of an > > unbundled Rust mode will protest > > That seems unlikely: as long as the auto-mode-alist configuration for > rust-ts-mode is done early on in Emacs's startup, any installed 3rd > party package such as rust-mode would add its config later, and thus > have priority. I don't have objections to making Rust recognized automatically and activating rust-ts-mode, if people think this danger is low or non-existent, and if *.rs files are not commonly used for something completely unrelated (e.g., I see on my Windows system quite a few *.rs files that seem to be some kind of Windows data files). ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-10 4:56 ` Eli Zaretskii @ 2024-10-10 5:14 ` Xiyue Deng 2024-10-10 6:36 ` Eli Zaretskii 2024-10-11 20:30 ` Dmitry Gutov 1 sibling, 1 reply; 138+ messages in thread From: Xiyue Deng @ 2024-10-10 5:14 UTC (permalink / raw) To: Eli Zaretskii, Dmitry Gutov; +Cc: johan.myreen, emacs-devel Eli Zaretskii <eliz@gnu.org> writes: >> Date: Thu, 10 Oct 2024 00:25:40 +0300 >> Cc: emacs-devel@gnu.org >> From: Dmitry Gutov <dmitry@gutov.dev> >> >> On 09/10/2024 16:13, Eli Zaretskii wrote: >> > rust-ts-mode is part of >> > Emacs, and could be turned on automatically when a Rust file is >> > visited; we didn't do that because we are unsure whether users of an >> > unbundled Rust mode will protest >> >> That seems unlikely: as long as the auto-mode-alist configuration for >> rust-ts-mode is done early on in Emacs's startup, any installed 3rd >> party package such as rust-mode would add its config later, and thus >> have priority. > > I don't have objections to making Rust recognized automatically and > activating rust-ts-mode, if people think this danger is low or > non-existent, and if *.rs files are not commonly used for something > completely unrelated (e.g., I see on my Windows system quite a few > *.rs files that seem to be some kind of Windows data files). > One thing to be cautious is that all *-ts-modes require tree-sitter syntax libraries to be available to use, which are not shipped with Emacs. One can follow the instructions on masteringemacs[1], or install treesit-auto[2] to install tree-sitter syntax libraries, which are not a lot of trouble but may still be more work than a new comer would expect. [1] https://www.masteringemacs.org/article/how-to-get-started-tree-sitter [2] https://github.com/renzmann/treesit-auto -- Regards, Xiyue Deng ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-10 5:14 ` Xiyue Deng @ 2024-10-10 6:36 ` Eli Zaretskii 2024-10-10 6:59 ` Xiyue Deng 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-10-10 6:36 UTC (permalink / raw) To: Xiyue Deng; +Cc: dmitry, johan.myreen, emacs-devel > From: Xiyue Deng <manphiz@gmail.com> > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > Date: Wed, 09 Oct 2024 22:14:32 -0700 > > Eli Zaretskii <eliz@gnu.org> writes: > > >> Date: Thu, 10 Oct 2024 00:25:40 +0300 > >> Cc: emacs-devel@gnu.org > >> From: Dmitry Gutov <dmitry@gutov.dev> > >> > >> On 09/10/2024 16:13, Eli Zaretskii wrote: > >> > rust-ts-mode is part of > >> > Emacs, and could be turned on automatically when a Rust file is > >> > visited; we didn't do that because we are unsure whether users of an > >> > unbundled Rust mode will protest > >> > >> That seems unlikely: as long as the auto-mode-alist configuration for > >> rust-ts-mode is done early on in Emacs's startup, any installed 3rd > >> party package such as rust-mode would add its config later, and thus > >> have priority. > > > > I don't have objections to making Rust recognized automatically and > > activating rust-ts-mode, if people think this danger is low or > > non-existent, and if *.rs files are not commonly used for something > > completely unrelated (e.g., I see on my Windows system quite a few > > *.rs files that seem to be some kind of Windows data files). > > > > One thing to be cautious is that all *-ts-modes require tree-sitter > syntax libraries to be available to use, which are not shipped with > Emacs. If a required grammar library is not available, the user gets a warning. So what is the problem here? ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-10 6:36 ` Eli Zaretskii @ 2024-10-10 6:59 ` Xiyue Deng 0 siblings, 0 replies; 138+ messages in thread From: Xiyue Deng @ 2024-10-10 6:59 UTC (permalink / raw) To: Eli Zaretskii; +Cc: dmitry, johan.myreen, emacs-devel Eli Zaretskii <eliz@gnu.org> writes: >> From: Xiyue Deng <manphiz@gmail.com> >> Cc: johan.myreen@gmail.com, emacs-devel@gnu.org >> Date: Wed, 09 Oct 2024 22:14:32 -0700 >> >> Eli Zaretskii <eliz@gnu.org> writes: >> >> >> Date: Thu, 10 Oct 2024 00:25:40 +0300 >> >> Cc: emacs-devel@gnu.org >> >> From: Dmitry Gutov <dmitry@gutov.dev> >> >> >> >> On 09/10/2024 16:13, Eli Zaretskii wrote: >> >> > rust-ts-mode is part of >> >> > Emacs, and could be turned on automatically when a Rust file is >> >> > visited; we didn't do that because we are unsure whether users of an >> >> > unbundled Rust mode will protest >> >> >> >> That seems unlikely: as long as the auto-mode-alist configuration for >> >> rust-ts-mode is done early on in Emacs's startup, any installed 3rd >> >> party package such as rust-mode would add its config later, and thus >> >> have priority. >> > >> > I don't have objections to making Rust recognized automatically and >> > activating rust-ts-mode, if people think this danger is low or >> > non-existent, and if *.rs files are not commonly used for something >> > completely unrelated (e.g., I see on my Windows system quite a few >> > *.rs files that seem to be some kind of Windows data files). >> > >> >> One thing to be cautious is that all *-ts-modes require tree-sitter >> syntax libraries to be available to use, which are not shipped with >> Emacs. > > If a required grammar library is not available, the user gets a > warning. So what is the problem here? Then a user doesn't really getting a useful major mode for editing Rust files or other programming files when using their *-ts-mode (without their grammar installed, that is). Other non-ts based modes, though less accurate, are readily usable after `M-x package-install', which IMHO is slightly more new user friendly. Of course, if Emacs provide a built-in way to install the grammar libraries automatically that would be better. -- Regards, Xiyue Deng ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-10 4:56 ` Eli Zaretskii 2024-10-10 5:14 ` Xiyue Deng @ 2024-10-11 20:30 ` Dmitry Gutov 2024-10-12 7:34 ` Eli Zaretskii 1 sibling, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-10-11 20:30 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 10/10/2024 07:56, Eli Zaretskii wrote: >> That seems unlikely: as long as the auto-mode-alist configuration for >> rust-ts-mode is done early on in Emacs's startup, any installed 3rd >> party package such as rust-mode would add its config later, and thus >> have priority. > I don't have objections to making Rust recognized automatically and > activating rust-ts-mode, if people think this danger is low or > non-existent, and if *.rs files are not commonly used for something > completely unrelated (e.g., I see on my Windows system quite a few > *.rs files that seem to be some kind of Windows data files). Actually, thinking back the last time we made such a move, we got a report from a user who preferred to have files in question (*.toml) in fundamental-mode, because they didn't want the hassle of installing the toml tree-sitter grammar (bug#60559). The said user didn't have Emacs compiled with tree-sitter, so if we wanted to revisit that issue, we could enable ts mode globally when Emacs is compiled with that support, and when it isn't, keep them out of auto-mode-alist. That could still lead to inconveniences sometimes, but at the very least it would follow the reporter's request from down the thread: > If emacs was configured with tree-sitter, it seems productive to warn the user when tree-sitter grammars are missing. It seems likely that user intended to have tree-sitter. > When emacs is NOT configured with tree-sitter, it seems counter-productive to warn about missing tree-sitter. > I even pass --without-tree-sitter to configure now. It seems particularly surprising to me that I explicitly tell emacs "don't use tree-sitter" and then it immediately starts complaining to me that it doesn't have tree-sitter. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-11 20:30 ` Dmitry Gutov @ 2024-10-12 7:34 ` Eli Zaretskii 2024-10-12 20:27 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-10-12 7:34 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Fri, 11 Oct 2024 23:30:12 +0300 > From: Dmitry Gutov <dmitry@gutov.dev> > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > > On 10/10/2024 07:56, Eli Zaretskii wrote: > >> That seems unlikely: as long as the auto-mode-alist configuration for > >> rust-ts-mode is done early on in Emacs's startup, any installed 3rd > >> party package such as rust-mode would add its config later, and thus > >> have priority. > > I don't have objections to making Rust recognized automatically and > > activating rust-ts-mode, if people think this danger is low or > > non-existent, and if *.rs files are not commonly used for something > > completely unrelated (e.g., I see on my Windows system quite a few > > *.rs files that seem to be some kind of Windows data files). > > Actually, thinking back the last time we made such a move, we got a > report from a user who preferred to have files in question (*.toml) in > fundamental-mode, because they didn't want the hassle of installing the > toml tree-sitter grammar (bug#60559). > > The said user didn't have Emacs compiled with tree-sitter, so if we > wanted to revisit that issue, we could enable ts mode globally when > Emacs is compiled with that support, and when it isn't, keep them out of > auto-mode-alist. If we want to be selective, we should also check if the grammar library is installed. Or we could tell the user, when a Rust file is first visited and the grammar is not available, that we recommend to install the grammar. Either way, this is not very trivial, and someone should do the work of designing the best UI and coding it. > > I even pass --without-tree-sitter to configure now. It seems > particularly surprising to me that I explicitly tell emacs "don't > use tree-sitter" and then it immediately starts complaining to me > that it doesn't have tree-sitter. Feel free to improve what we have. My point is that it is not very trivial; what we have is basically a compromise, which could be improved, at least for some languages, if we want to be smarter. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-12 7:34 ` Eli Zaretskii @ 2024-10-12 20:27 ` Dmitry Gutov 2024-10-12 21:00 ` Dr. Arne Babenhauserheide 2024-10-13 4:41 ` Eli Zaretskii 0 siblings, 2 replies; 138+ messages in thread From: Dmitry Gutov @ 2024-10-12 20:27 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 12/10/2024 10:34, Eli Zaretskii wrote: >> Actually, thinking back the last time we made such a move, we got a >> report from a user who preferred to have files in question (*.toml) in >> fundamental-mode, because they didn't want the hassle of installing the >> toml tree-sitter grammar (bug#60559). >> >> The said user didn't have Emacs compiled with tree-sitter, so if we >> wanted to revisit that issue, we could enable ts mode globally when >> Emacs is compiled with that support, and when it isn't, keep them out of >> auto-mode-alist. > > If we want to be selective, we should also check if the grammar > library is installed. > > Or we could tell the user, when a Rust file is first visited and the > grammar is not available, that we recommend to install the grammar. Telling that the grammar is not installed is still useful. Even if we say "grammar xyz not available" only once per session, we still have to decide whether the major mode switch happens (with perhaps reduced features - such as non-working indentation/font-lock/etc, but with for example Eglot recognizing the file type now). > Either way, this is not very trivial, and someone should do the work > of designing the best UI and coding it. > >>> I even pass --without-tree-sitter to configure now. It seems >> particularly surprising to me that I explicitly tell emacs "don't >> use tree-sitter" and then it immediately starts complaining to me >> that it doesn't have tree-sitter. > > Feel free to improve what we have. My point is that it is not very > trivial; what we have is basically a compromise, which could be > improved, at least for some languages, if we want to be smarter. The proposal I'm quoting is straightforward: if Emacs is compiled with tree-sitter support, enable the modes and warn when the grammars are not available. If Emacs is not compiled with tree-sitter, do neither. That kind of rule has predictability: for example if the grammar was not installed originally but the user did that while Emacs was running, the corresponding major mode will start working the next time the user tries to enable it. That wouldn't be the case if we conditionally alter auto-mode-alist based on grammar availability. The above approach should be quite easy to implement, if there's agreement to it. Otherwise, the issue is about choosing the details of the UI first. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-12 20:27 ` Dmitry Gutov @ 2024-10-12 21:00 ` Dr. Arne Babenhauserheide 2024-10-13 4:53 ` Eli Zaretskii 2024-10-13 4:41 ` Eli Zaretskii 1 sibling, 1 reply; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-12 21:00 UTC (permalink / raw) To: Dmitry Gutov; +Cc: Eli Zaretskii, johan.myreen, emacs-devel [-- Attachment #1: Type: text/plain, Size: 474 bytes --] Dmitry Gutov <dmitry@gutov.dev> writes: > The proposal I'm quoting is straightforward: if Emacs is compiled with > tree-sitter support, enable the modes and warn when the grammars are > not available. If Emacs is not compiled with tree-sitter, do neither. This sounds like having external grammars is a UX problem. Are they so big that they cannot be included? Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-12 21:00 ` Dr. Arne Babenhauserheide @ 2024-10-13 4:53 ` Eli Zaretskii 2024-10-13 6:28 ` Dr. Arne Babenhauserheide 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-10-13 4:53 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: dmitry, johan.myreen, emacs-devel > From: "Dr. Arne Babenhauserheide" <arne_bab@web.de> > Cc: Eli Zaretskii <eliz@gnu.org>, johan.myreen@gmail.com, emacs-devel@gnu.org > Date: Sat, 12 Oct 2024 23:00:16 +0200 > > Dmitry Gutov <dmitry@gutov.dev> writes: > > > The proposal I'm quoting is straightforward: if Emacs is compiled with > > tree-sitter support, enable the modes and warn when the grammars are > > not available. If Emacs is not compiled with tree-sitter, do neither. > > This sounds like having external grammars is a UX problem. It is a UI problem because users could have a TS-enabled Emacs, but not grammar libraries for the language(s) he/she wants to edit. The problem in that case is how to present this situation to the user. > Are they so big that they cannot be included? They are not large, but they are written in C or C++ and are developed by their own teams in their own repositories. They are also a lot when taken together (e.g., my personal collection includes more than 70 grammar libraries, and even what we have in core needs almost 20 different libraries). So we cannot distribute them as part of Emacs source tarballs. If you are talking about what downstream Emacs distros do for packaging, that's a separate issue on which we have no control. But if a distro packages grammar libraries, it could also enable the corresponding modes in their customizations of Emacs. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-13 4:53 ` Eli Zaretskii @ 2024-10-13 6:28 ` Dr. Arne Babenhauserheide 0 siblings, 0 replies; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-13 6:28 UTC (permalink / raw) To: Eli Zaretskii; +Cc: dmitry, johan.myreen, emacs-devel [-- Attachment #1: Type: text/plain, Size: 735 bytes --] Eli Zaretskii <eliz@gnu.org> writes: >> Are they so big that they cannot be included? > > They are not large, but they are written in C or C++ and are developed > by their own teams in their own repositories. They are also a lot > when taken together (e.g., my personal collection includes more than > 70 grammar libraries, and even what we have in core needs almost 20 > different libraries). So we cannot distribute them as part of Emacs > source tarballs. Then that’s technical and organisatorial; sounds like we have to live with that for now. I wasn’t aware that it’s so much. Thank you for explaining! Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-12 20:27 ` Dmitry Gutov 2024-10-12 21:00 ` Dr. Arne Babenhauserheide @ 2024-10-13 4:41 ` Eli Zaretskii 2024-10-13 9:37 ` Dmitry Gutov 1 sibling, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-10-13 4:41 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Sat, 12 Oct 2024 23:27:01 +0300 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > > Feel free to improve what we have. My point is that it is not very > > trivial; what we have is basically a compromise, which could be > > improved, at least for some languages, if we want to be smarter. > > The proposal I'm quoting is straightforward: if Emacs is compiled with > tree-sitter support, enable the modes and warn when the grammars are not > available. If Emacs is not compiled with tree-sitter, do neither. > > That kind of rule has predictability: for example if the grammar was not > installed originally but the user did that while Emacs was running, the > corresponding major mode will start working the next time the user tries > to enable it. That wouldn't be the case if we conditionally alter > auto-mode-alist based on grammar availability. > > The above approach should be quite easy to implement, if there's > agreement to it. Otherwise, the issue is about choosing the details of > the UI first. It is not clear which modes you suggest that should behave like that. Surely, not all of them, i.e. including those for which non-TS modes are part of Emacs? And yes, I would like to hear from more people what they think about the possible behaviors in these cases, including how to handle missing grammar libraries. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-13 4:41 ` Eli Zaretskii @ 2024-10-13 9:37 ` Dmitry Gutov 2024-10-13 10:39 ` Eli Zaretskii 2024-10-13 10:52 ` An anonymous IRC user's opinion Dr. Arne Babenhauserheide 0 siblings, 2 replies; 138+ messages in thread From: Dmitry Gutov @ 2024-10-13 9:37 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 13/10/2024 07:41, Eli Zaretskii wrote: >> The proposal I'm quoting is straightforward: if Emacs is compiled with >> tree-sitter support, enable the modes and warn when the grammars are not >> available. If Emacs is not compiled with tree-sitter, do neither. >> >> That kind of rule has predictability: for example if the grammar was not >> installed originally but the user did that while Emacs was running, the >> corresponding major mode will start working the next time the user tries >> to enable it. That wouldn't be the case if we conditionally alter >> auto-mode-alist based on grammar availability. >> >> The above approach should be quite easy to implement, if there's >> agreement to it. Otherwise, the issue is about choosing the details of >> the UI first. > > It is not clear which modes you suggest that should behave like that. > Surely, not all of them, i.e. including those for which non-TS modes > are part of Emacs? I don't have a strong opinion on which set should be enabled - maybe just all TS modes which we don't have built-in counterparts. Maybe not even toml-ts-mode, since there is conf-toml-mode. Maybe make some exceptions for TS modes that provide significantly better functionality than the classic ones. Not sure which ones. What I think is important, though, is avoiding major mode functions modiying auto-mode-alist at runtime. > And yes, I would like to hear from more people what they think about > the possible behaviors in these cases, including how to handle missing > grammar libraries. Everybody's welcome to chime in. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-13 9:37 ` Dmitry Gutov @ 2024-10-13 10:39 ` Eli Zaretskii 2024-10-13 15:31 ` Dmitry Gutov 2024-10-13 10:52 ` An anonymous IRC user's opinion Dr. Arne Babenhauserheide 1 sibling, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-10-13 10:39 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Sun, 13 Oct 2024 12:37:38 +0300 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > > It is not clear which modes you suggest that should behave like that. > > Surely, not all of them, i.e. including those for which non-TS modes > > are part of Emacs? > > I don't have a strong opinion on which set should be enabled - maybe > just all TS modes which we don't have built-in counterparts. Maybe not > even toml-ts-mode, since there is conf-toml-mode. > > Maybe make some exceptions for TS modes that provide significantly > better functionality than the classic ones. I tend to agree. > What I think is important, though, is avoiding major mode functions > modiying auto-mode-alist at runtime. But CC Mode already does, and always did? > > And yes, I would like to hear from more people what they think about > > the possible behaviors in these cases, including how to handle missing > > grammar libraries. > > Everybody's welcome to chime in. Right. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-13 10:39 ` Eli Zaretskii @ 2024-10-13 15:31 ` Dmitry Gutov 2024-10-13 15:53 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-10-13 15:31 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel [-- Attachment #1: Type: text/plain, Size: 1093 bytes --] On Sun, Oct 13, 2024, at 12:39 PM, Eli Zaretskii wrote: > > Date: Sun, 13 Oct 2024 12:37:38 +0300 > > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > > From: Dmitry Gutov <dmitry@gutov.dev> > > > > > It is not clear which modes you suggest that should behave like that. > > > Surely, not all of them, i.e. including those for which non-TS modes > > > are part of Emacs? > > > > I don't have a strong opinion on which set should be enabled - maybe > > just all TS modes which we don't have built-in counterparts. Maybe not > > even toml-ts-mode, since there is conf-toml-mode. > > > > Maybe make some exceptions for TS modes that provide significantly > > better functionality than the classic ones. > > I tend to agree. > > > What I think is important, though, is avoiding major mode functions > > modiying auto-mode-alist at runtime. > > But CC Mode already does, and always did? I don't think so: those alterations happen in 'autoload' blocks, which means that it happens either during Emacs' startup, or during package initialization, if cc-mode is installed as an ELPA package. [-- Attachment #2: Type: text/html, Size: 1791 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-13 15:31 ` Dmitry Gutov @ 2024-10-13 15:53 ` Eli Zaretskii 2024-10-14 9:32 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-10-13 15:53 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Sun, 13 Oct 2024 17:31:33 +0200 > From: "Dmitry Gutov" <dmitry@gutov.dev> > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > > On Sun, Oct 13, 2024, at 12:39 PM, Eli Zaretskii wrote: > > > What I think is important, though, is avoiding major mode functions > > modiying auto-mode-alist at runtime. > > But CC Mode already does, and always did? > > I don't think so: those alterations happen in 'autoload' blocks, which means that it happens either during > Emacs' startup, or during package initialization, if cc-mode is installed as an ELPA package. In any case, I don't understand what is so sacred about auto-mode-alist that it should not be modified at run time. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-13 15:53 ` Eli Zaretskii @ 2024-10-14 9:32 ` Dmitry Gutov 2024-10-14 11:09 ` Alan Mackenzie 2024-10-14 14:16 ` Eli Zaretskii 0 siblings, 2 replies; 138+ messages in thread From: Dmitry Gutov @ 2024-10-14 9:32 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 13/10/2024 18:53, Eli Zaretskii wrote: > In any case, I don't understand what is so sacred about > auto-mode-alist that it should not be modified at run time. The ad-hoc behaviors the creates and offers the users, or the bugs like 'C-h f' altering auto-mode-alist, or 'M-x js-ts-mode' (for example) doing the same because it loads cc-mode. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-14 9:32 ` Dmitry Gutov @ 2024-10-14 11:09 ` Alan Mackenzie 2024-10-15 1:41 ` Dmitry Gutov 2024-10-14 14:16 ` Eli Zaretskii 1 sibling, 1 reply; 138+ messages in thread From: Alan Mackenzie @ 2024-10-14 11:09 UTC (permalink / raw) To: Dmitry Gutov; +Cc: Eli Zaretskii, johan.myreen, emacs-devel Hello, Dmitry. On Mon, Oct 14, 2024 at 12:32:31 +0300, Dmitry Gutov wrote: > On 13/10/2024 18:53, Eli Zaretskii wrote: > > In any case, I don't understand what is so sacred about > > auto-mode-alist that it should not be modified at run time. > The ad-hoc behaviors the creates and offers the users, or the bugs like > 'C-h f' altering auto-mode-alist, or 'M-x js-ts-mode' (for example) > doing the same because it loads cc-mode. Not sure exactly what you mean there. With emacs -Q, the CC Mode entries are already on auto-mode-alist. Does anything more happen with M-x js-ts-mode? -- Alan Mackenzie (Nuremberg, Germany). ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-14 11:09 ` Alan Mackenzie @ 2024-10-15 1:41 ` Dmitry Gutov 0 siblings, 0 replies; 138+ messages in thread From: Dmitry Gutov @ 2024-10-15 1:41 UTC (permalink / raw) To: Alan Mackenzie; +Cc: Eli Zaretskii, johan.myreen, emacs-devel Hi Alan, On 14/10/2024 14:09, Alan Mackenzie wrote: >> The ad-hoc behaviors the creates and offers the users, or the bugs like >> 'C-h f' altering auto-mode-alist, or 'M-x js-ts-mode' (for example) >> doing the same because it loads cc-mode. > Not sure exactly what you mean there. With emacs -Q, the CC Mode > entries are already on auto-mode-alist. Does anything more happen with > M-x js-ts-mode? I'd rather not get into full detail right now (not filing a bug report), we can treat it as an outline of a scenario which could happen with different modes anyway if they are allowed to alter a-m-a during package loading. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-14 9:32 ` Dmitry Gutov 2024-10-14 11:09 ` Alan Mackenzie @ 2024-10-14 14:16 ` Eli Zaretskii 2024-10-15 1:36 ` Dmitry Gutov 1 sibling, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-10-14 14:16 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Mon, 14 Oct 2024 12:32:31 +0300 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > On 13/10/2024 18:53, Eli Zaretskii wrote: > > In any case, I don't understand what is so sacred about > > auto-mode-alist that it should not be modified at run time. > > The ad-hoc behaviors the creates and offers the users, or the bugs like > 'C-h f' altering auto-mode-alist, or 'M-x js-ts-mode' (for example) > doing the same because it loads cc-mode. We have such issues all over the place in Emacs: "C-h" commands that load packages modify the global state. There's nothing new here, nor anything outlandish. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-14 14:16 ` Eli Zaretskii @ 2024-10-15 1:36 ` Dmitry Gutov 2024-10-15 12:03 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-10-15 1:36 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 14/10/2024 17:16, Eli Zaretskii wrote: >> The ad-hoc behaviors the creates and offers the users, or the bugs like >> 'C-h f' altering auto-mode-alist, or 'M-x js-ts-mode' (for example) >> doing the same because it loads cc-mode. > We have such issues all over the place in Emacs: "C-h" commands that > load packages modify the global state. There's nothing new here, nor > anything outlandish. It might not be a huge deal, but packages being loaded at various times, sometimes unexpected, is why we try to avoid doing too many things during that time. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-15 1:36 ` Dmitry Gutov @ 2024-10-15 12:03 ` Eli Zaretskii 2024-11-03 3:10 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-10-15 12:03 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Tue, 15 Oct 2024 04:36:55 +0300 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > On 14/10/2024 17:16, Eli Zaretskii wrote: > >> The ad-hoc behaviors the creates and offers the users, or the bugs like > >> 'C-h f' altering auto-mode-alist, or 'M-x js-ts-mode' (for example) > >> doing the same because it loads cc-mode. > > We have such issues all over the place in Emacs: "C-h" commands that > > load packages modify the global state. There's nothing new here, nor > > anything outlandish. > > It might not be a huge deal, but packages being loaded at various times, > sometimes unexpected, is why we try to avoid doing too many things > during that time. I agree that we should try to avoid that if possible, but you originally made a stronger argument, or so I interpreted it. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-15 12:03 ` Eli Zaretskii @ 2024-11-03 3:10 ` Dmitry Gutov 2024-11-03 6:37 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-11-03 3:10 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel [-- Attachment #1: Type: text/plain, Size: 1184 bytes --] On 15/10/2024 15:03, Eli Zaretskii wrote: >> Date: Tue, 15 Oct 2024 04:36:55 +0300 >> Cc:johan.myreen@gmail.com,emacs-devel@gnu.org >> From: Dmitry Gutov<dmitry@gutov.dev> >> >> On 14/10/2024 17:16, Eli Zaretskii wrote: >>>> The ad-hoc behaviors the creates and offers the users, or the bugs like >>>> 'C-h f' altering auto-mode-alist, or 'M-x js-ts-mode' (for example) >>>> doing the same because it loads cc-mode. >>> We have such issues all over the place in Emacs: "C-h" commands that >>> load packages modify the global state. There's nothing new here, nor >>> anything outlandish. >> It might not be a huge deal, but packages being loaded at various times, >> sometimes unexpected, is why we try to avoid doing too many things >> during that time. > I agree that we should try to avoid that if possible, but you > originally made a stronger argument, or so I interpreted it. I could mention the problems (most of them known), but perhaps we should discuss a possible fix instead. Here's a patch along the lines described in this thread. Additionally, as mentioned, we could drop some modes from the default set (removing toml-ts-mode and maybe dockerfile-ts-mode as well). [-- Attachment #2: treesit-auto-mode-autoloads.diff --] [-- Type: text/x-patch, Size: 14019 bytes --] diff --git a/lisp/files.el b/lisp/files.el index 9c105dbe1a5..9f256695011 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3059,9 +3059,13 @@ auto-mode-alist ("\\.dbk\\'" . xml-mode) ("\\.dtd\\'" . sgml-mode) ("\\.ds\\(ss\\)?l\\'" . dsssl-mode) - ("\\.js[mx]?\\'" . javascript-mode) + ("\\.js[mx]?\\'" . ,(if (treesit-available-p) + 'js-ts-mode + 'javascript-mode)) ;; https://en.wikipedia.org/wiki/.har - ("\\.har\\'" . javascript-mode) + ("\\.har\\'" . ,(if (treesit-available-p) + 'js-ts-mode + 'javascript-mode)) ("\\.json\\'" . js-json-mode) ("\\.[ds]?va?h?\\'" . verilog-mode) ("\\.by\\'" . bovine-grammar-mode) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 3823c553fda..5b89fe917c2 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -35,12 +35,6 @@ ;; To use these modes by default, assuming you have the respective ;; tree-sitter grammars available, do one of the following: ;; -;; - If you have both C and C++ grammars installed, add -;; -;; (require 'c-ts-mode) -;; -;; to your init file. -;; ;; - Add one or mode of the following to your init file: ;; ;; (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode)) @@ -1539,21 +1533,6 @@ c-or-c++-ts-mode 'c-ts-mode))) (funcall (major-mode-remap mode)))) -;; The entries for C++ must come first to prevent *.c files be taken -;; as C++ on case-insensitive filesystems, since *.C files are C++, -;; not C. -(if (treesit-ready-p 'cpp) - (add-to-list 'major-mode-remap-defaults - '(c++-mode . c++-ts-mode))) - -(when (treesit-ready-p 'c) - (add-to-list 'major-mode-remap-defaults '(c++-mode . c++-ts-mode)) - (add-to-list 'major-mode-remap-defaults '(c-mode . c-ts-mode))) - -(when (and (treesit-ready-p 'cpp) - (treesit-ready-p 'c)) - (add-to-list 'major-mode-remap-defaults '(c-or-c++-mode . c-or-c++-ts-mode))) - (when (and c-ts-mode-enable-doxygen (not (treesit-ready-p 'doxygen t))) (message "Doxygen syntax highlighting can't be enabled, please install the language grammar.")) diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index c5bb075c7f6..867d47ee0a2 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -3377,22 +3377,6 @@ c-submit-bug-report (insert (format "Buffer Style: %s\nc-emacs-features: %s\n" style c-features))))))) -\f -;; Make entries in `major-mode-remap-defaults' to ensure that when CC -;; Mode has been loaded, the symbols `c-mode' etc., will call CC Mode's -;; modes rather than c-ts-mode etc.. -(when (boundp 'major-mode-remap-defaults) - (add-to-list 'major-mode-remap-defaults '(c++-mode . c++-ts-mode)) - (add-to-list 'major-mode-remap-defaults '(c-mode . c-ts-mode)) - (add-to-list 'major-mode-remap-defaults '(c-or-c++-mode . c-or-c++-ts-mode)) - (let (entry) - (dolist (mode '(c-mode c++-mode c-or-c++-mode)) - (if (and (setq entry (assq mode major-mode-remap-defaults)) - (null (cdr entry))) - (setq major-mode-remap-defaults - (delq entry major-mode-remap-defaults))) - (push (cons mode nil) major-mode-remap-defaults)))) - \f (cc-provide 'cc-mode) diff --git a/lisp/progmodes/cmake-ts-mode.el b/lisp/progmodes/cmake-ts-mode.el index 597ef69d9b8..f40147a94b0 100644 --- a/lisp/progmodes/cmake-ts-mode.el +++ b/lisp/progmodes/cmake-ts-mode.el @@ -244,7 +244,8 @@ cmake-ts-mode (derived-mode-add-parents 'cmake-ts-mode '(cmake-mode)) -(if (treesit-ready-p 'cmake) +;;;###autoload +(if (treesit-available-p) (add-to-list 'auto-mode-alist '("\\(?:CMakeLists\\.txt\\|\\.cmake\\)\\'" . cmake-ts-mode))) diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index b86555b1d87..dbf169a048c 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -1089,9 +1089,11 @@ csharp-ts-mode ("Struct" "\\`struct_declaration\\'" nil nil) ("Method" "\\`method_declaration\\'" nil nil))) - (treesit-major-mode-setup) + (treesit-major-mode-setup)) - (add-to-list 'auto-mode-alist '("\\.cs\\'" . csharp-ts-mode))) +;;;###autoload +(if (treesit-available-p) + (add-to-list 'auto-mode-alist '("\\.cs\\'" . csharp-ts-mode))) (derived-mode-add-parents 'csharp-ts-mode '(csharp-mode)) diff --git a/lisp/progmodes/dockerfile-ts-mode.el b/lisp/progmodes/dockerfile-ts-mode.el index 42fa7482a87..2d33c6c2c65 100644 --- a/lisp/progmodes/dockerfile-ts-mode.el +++ b/lisp/progmodes/dockerfile-ts-mode.el @@ -167,7 +167,8 @@ dockerfile-ts-mode (derived-mode-add-parents 'dockerfile-ts-mode '(dockerfile-mode)) -(if (treesit-ready-p 'dockerfile) +;;;###autoload +(if (treesit-available-p) (add-to-list 'auto-mode-alist ;; NOTE: We can't use `rx' here, as it breaks bootstrap. '("\\(?:Dockerfile\\(?:\\..*\\)?\\|\\.[Dd]ockerfile\\)\\'" diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index cacdb266298..a3b9f7d5611 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -755,7 +755,8 @@ elixir-ts-mode (derived-mode-add-parents 'elixir-ts-mode '(elixir-mode)) -(if (treesit-ready-p 'elixir) +;;;###autoload +(if (treesit-available-p) (progn (add-to-list 'auto-mode-alist '("\\.elixir\\'" . elixir-ts-mode)) (add-to-list 'auto-mode-alist '("\\.ex\\'" . elixir-ts-mode)) diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index 86e74ad58a8..3e1bc4bea40 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -305,7 +305,8 @@ go-ts-mode (derived-mode-add-parents 'go-ts-mode '(go-mode)) -(if (treesit-ready-p 'go) +;;;###autoload +(if (treesit-available-p) ;; FIXME: Should we instead put `go-mode' in `auto-mode-alist' ;; and then use `major-mode-remap-defaults' to map it to `go-ts-mode'? (add-to-list 'auto-mode-alist '("\\.go\\'" . go-ts-mode))) @@ -562,7 +563,8 @@ go-mod-ts-mode (derived-mode-add-parents 'go-mod-ts-mode '(go-mod-mode)) -(if (treesit-ready-p 'gomod) +;;;###autoload +(if (treesit-available-p) (add-to-list 'auto-mode-alist '("/go\\.mod\\'" . go-mod-ts-mode))) (provide 'go-ts-mode) diff --git a/lisp/progmodes/heex-ts-mode.el b/lisp/progmodes/heex-ts-mode.el index 84fd513525c..3f26f0a9b14 100644 --- a/lisp/progmodes/heex-ts-mode.el +++ b/lisp/progmodes/heex-ts-mode.el @@ -191,7 +191,8 @@ heex-ts-mode (derived-mode-add-parents 'heex-ts-mode '(heex-mode)) -(if (treesit-ready-p 'heex) +;;;###autoload +(if (treesit-available-p) ;; Both .heex and the deprecated .leex files should work ;; with the tree-sitter-heex grammar. (add-to-list 'auto-mode-alist '("\\.[hl]?eex\\'" . heex-ts-mode))) diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index 177f914160c..860cb433f71 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -436,7 +436,8 @@ java-ts-mode (derived-mode-add-parents 'java-ts-mode '(java-mode)) -(if (treesit-ready-p 'java) +;;;###autoload +(if (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.java\\'" . java-ts-mode))) (when (and java-ts-mode-enable-doxygen (not (treesit-ready-p 'doxygen t))) diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index f74b8ab1c46..a4d4399012c 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3961,10 +3961,7 @@ js-ts-mode "method_definition") eos) nil nil))) - (treesit-major-mode-setup) - - (add-to-list 'auto-mode-alist - '("\\(\\.js[mx]\\|\\.har\\)\\'" . js-ts-mode)))) + (treesit-major-mode-setup))) (derived-mode-add-parents 'js-ts-mode '(js-mode)) diff --git a/lisp/progmodes/json-ts-mode.el b/lisp/progmodes/json-ts-mode.el index 7409c6be833..e0d8cf72841 100644 --- a/lisp/progmodes/json-ts-mode.el +++ b/lisp/progmodes/json-ts-mode.el @@ -166,7 +166,8 @@ json-ts-mode (derived-mode-add-parents 'json-ts-mode '(json-mode)) -(if (treesit-ready-p 'json) +;;;###autoload +(if (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.json\\'" . json-ts-mode))) diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el index 20bc1f3e158..58328332e68 100644 --- a/lisp/progmodes/lua-ts-mode.el +++ b/lisp/progmodes/lua-ts-mode.el @@ -837,7 +837,8 @@ lua-ts-mode (derived-mode-add-parents 'lua-ts-mode '(lua-mode)) -(when (treesit-ready-p 'lua) +;;;###autoload +(if (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.lua\\'" . lua-ts-mode))) (provide 'lua-ts-mode) diff --git a/lisp/progmodes/php-ts-mode.el b/lisp/progmodes/php-ts-mode.el index 07a0c266d78..b090da01ce8 100644 --- a/lisp/progmodes/php-ts-mode.el +++ b/lisp/progmodes/php-ts-mode.el @@ -1824,7 +1824,8 @@ php-ts-mode-kill-process (with-current-buffer php-ts-mode-inferior-php-buffer (kill-buffer-and-window))) -(when (treesit-ready-p 'php) +;;;###autoload +(when (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.\\(?:php[s345]?\\|phtml\\)\\'" . php-ts-mode)) (add-to-list diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 283a545bfb4..f8903771aa2 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -287,9 +287,13 @@ python--auto-mode-alist-regexp eos)) ;;;###autoload -(add-to-list 'auto-mode-alist (cons python--auto-mode-alist-regexp 'python-mode)) +(add-to-list 'auto-mode-alist + (cons python--auto-mode-alist-regexp + (if (treesit-available-p) 'python-ts-mode 'python-mode))) ;;;###autoload -(add-to-list 'interpreter-mode-alist (cons (purecopy "python[0-9.]*") 'python-mode)) +(add-to-list 'interpreter-mode-alist + (cons (purecopy "python[0-9.]*") + (if (treesit-available-p) 'python-ts-mode 'python-mode))) (defgroup python nil "Python Language's flying circus support for Emacs." diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index aff0b8911b9..646de8a4ec3 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -1237,7 +1237,8 @@ ruby-ts-mode (derived-mode-add-parents 'ruby-ts-mode '(ruby-mode)) -(if (treesit-ready-p 'ruby) +;;;###autoload +(if (treesit-available-p) (add-to-list 'major-mode-remap-defaults '(ruby-mode . ruby-ts-mode))) diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index e52ea3b125a..4ee671e16e4 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el @@ -566,7 +566,8 @@ rust-ts-mode (derived-mode-add-parents 'rust-ts-mode '(rust-mode)) -(if (treesit-ready-p 'rust) +;;;###autoload +(if (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-ts-mode))) (provide 'rust-ts-mode) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index ef5dbe51ada..bfb7f1afc84 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -535,7 +535,8 @@ typescript-ts-mode (derived-mode-add-parents 'typescript-ts-mode '(typescript-mode)) -(if (treesit-ready-p 'typescript) +;;;###autoload +(if (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-ts-mode))) ;;;###autoload @@ -631,7 +632,8 @@ tsx-ts--syntax-propertize-captures (put-text-property ns (1+ ns) 'syntax-table syntax) (put-text-property (1- ne) ne 'syntax-table syntax)))) -(if (treesit-ready-p 'tsx) +;;;###autoload +(if (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode))) (provide 'typescript-ts-mode) diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index c8da28187ee..04e1cce807e 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -1826,12 +1826,14 @@ css-ts-mode (setq-local treesit-simple-imenu-settings `(( nil ,(rx bos (or "rule_set" "media_statement") eos) nil nil))) - (treesit-major-mode-setup) - - (add-to-list 'auto-mode-alist '("\\.css\\'" . css-ts-mode)))) + (treesit-major-mode-setup))) (derived-mode-add-parents 'css-ts-mode '(css-mode)) +;;;###autoload +(if (treesit-available-p) + (add-to-list 'auto-mode-alist '("\\.css\\'" . css-ts-mode))) + ;;;###autoload (define-derived-mode css-mode css-base-mode "CSS" "Major mode to edit Cascading Style Sheets (CSS). diff --git a/lisp/textmodes/html-ts-mode.el b/lisp/textmodes/html-ts-mode.el index f78fbdde1da..c21d187be28 100644 --- a/lisp/textmodes/html-ts-mode.el +++ b/lisp/textmodes/html-ts-mode.el @@ -136,7 +136,8 @@ html-ts-mode (derived-mode-add-parents 'html-ts-mode '(html-mode)) -(if (treesit-ready-p 'html) +;;;###autoload +(if (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.html\\'" . html-ts-mode))) (provide 'html-ts-mode) diff --git a/lisp/textmodes/toml-ts-mode.el b/lisp/textmodes/toml-ts-mode.el index 806f045c23b..fcb9a056353 100644 --- a/lisp/textmodes/toml-ts-mode.el +++ b/lisp/textmodes/toml-ts-mode.el @@ -155,7 +155,8 @@ toml-ts-mode (derived-mode-add-parents 'toml-ts-mode '(toml-mode)) -(if (treesit-ready-p 'toml) +;;;###autoload +(if (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.toml\\'" . toml-ts-mode))) (provide 'toml-ts-mode) diff --git a/lisp/textmodes/yaml-ts-mode.el b/lisp/textmodes/yaml-ts-mode.el index 42d7c2e1798..b39d32148c0 100644 --- a/lisp/textmodes/yaml-ts-mode.el +++ b/lisp/textmodes/yaml-ts-mode.el @@ -171,7 +171,8 @@ yaml-ts-mode (derived-mode-add-parents 'yaml-ts-mode '(yaml-mode)) -(if (treesit-ready-p 'yaml) +;;;###autoload +(if (treesit-available-p) (add-to-list 'auto-mode-alist '("\\.ya?ml\\'" . yaml-ts-mode))) (provide 'yaml-ts-mode) ^ permalink raw reply related [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-03 3:10 ` Dmitry Gutov @ 2024-11-03 6:37 ` Eli Zaretskii 2024-11-03 19:24 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-03 6:37 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Sun, 3 Nov 2024 05:10:26 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > I could mention the problems (most of them known), but perhaps we should > discuss a possible fix instead. > > Here's a patch along the lines described in this thread. > > Additionally, as mentioned, we could drop some modes from the default > set (removing toml-ts-mode and maybe dockerfile-ts-mode as well). Can we please talk in English, at least in addition to posting the code and hoping that it explains your ideas clearly enough? Because I really don't understand the idea. Apologies if the idea is lost in this discussion that spans many moons. Is the idea to expect the users to have all the grammar libraries installed when they use an Emacs which was built with Tree-Sitter? Because your code seems to only test the latter, or so it seems. If so, I don't think it's an idea to which I'd agree. E.g., imagine a user who installed Emacs from some distro which decided to build with Tree-Sitter, but doesn't provide all the grammar libraries we require, for whatever reasons. A minor nit: I don't see how c-ts-mode will be invoked under your proposal. What did I miss? ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-03 6:37 ` Eli Zaretskii @ 2024-11-03 19:24 ` Dmitry Gutov 2024-11-04 12:04 ` Eli Zaretskii 2024-11-04 12:11 ` Eli Zaretskii 0 siblings, 2 replies; 138+ messages in thread From: Dmitry Gutov @ 2024-11-03 19:24 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 03/11/2024 08:37, Eli Zaretskii wrote: >> Date: Sun, 3 Nov 2024 05:10:26 +0200 >> Cc: johan.myreen@gmail.com, emacs-devel@gnu.org >> From: Dmitry Gutov <dmitry@gutov.dev> >> >> I could mention the problems (most of them known), but perhaps we should >> discuss a possible fix instead. >> >> Here's a patch along the lines described in this thread. >> >> Additionally, as mentioned, we could drop some modes from the default >> set (removing toml-ts-mode and maybe dockerfile-ts-mode as well). > > Can we please talk in English, at least in addition to posting the > code and hoping that it explains your ideas clearly enough? Because I > really don't understand the idea. Apologies if the idea is lost in > this discussion that spans many moons. Sure. The general idea is this: As long as Emacs is configured with support for tree-sitter, we enable file associations (using auto-mode-alist) for a certain set of tree-sitter based modes. Chefly those that don't have existing "traditional" modes, but that's debatable. For others (modes that are not enabled by default), we document the way to enable them somewhere - in packages' Commentary, for example. The traditional way to do that has been with us for decades (people need to add an auto-mode-alist entry in their config script) - and now we also have a way to do that using major-mode-remap-alist. Either way, adding a line or two to their .emacs. The overall effect is that the file associations become stable again: set during Emacs's startup and not changing when a package gets loaded, or a major mode function is called. > Is the idea to expect the users to have all the grammar libraries > installed when they use an Emacs which was built with Tree-Sitter? In a way yes, but also no, because they are only needed when the corresponding file is visited. And only for modes that we decide to enable by default. > Because your code seems to only test the latter, or so it seems. If > so, I don't think it's an idea to which I'd agree. E.g., imagine a > user who installed Emacs from some distro which decided to build with > Tree-Sitter, but doesn't provide all the grammar libraries we require, > for whatever reasons. Then, when visiting let's say a Go file (or Rust, or TypeScript) they will right away be greeted by a warning that the grammar is not available, search the docs how to deal with that, and hopefully install it somehow (maybe using M-x treesit-install-language-grammar). If they don't, perhaps they'll disable the file association manually - or live with the warning when visiting such files. Is that better or worse than what we have now? For users that hoped to use tree-sitter modes, seems strictly better. For others, might add an inconvenience - but the amount depends on the set of ts modes that we ultimately decide to enable. To remind, the bug report that made us change our plan previously was about a scenario where the user a) configured their Emacs to build without tree-sitter explicitly, b) visited a .toml file (a config file - where the annoyance of installing the grammar is likely not paid off with the features it provides). > A minor nit: I don't see how c-ts-mode will be invoked under your > proposal. What did I miss? You mean how it will be enabled globally, right? Not just invoked. c-ts-mode has instructions in its Commentary, which currently has 3 options. The patch removes one of them, leaving these two: ;; - Add one or mode of the following to your init file: ;; ;; (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode)) ... and ;; - Customize 'auto-mode-alist' to turn one or more of the modes ;; automatically. For example: ;; ;; (add-to-list 'auto-mode-alist ;; '("\\(\\.ii\\|\\.\\(CC?\\|HH?\\)\\|\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\|\\.\\(cc\\|hh\\)\\)\\'" ;; . c++-ts-mode)) BTW, I missed this paragraph after, it will need to be removed too I guess (or limited to just the first sentence): ;; You can also turn on these modes manually in a buffer. Doing so ;; will set up Emacs to use the C/C++ modes defined here for other ;; files, provided that you have the corresponding parser grammar ;; libraries installed. (Because 'M-x c-ts-mode' won't alter file associations for the remainder of the session.) I recommend the major-mode-remap-alist way, personally. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-03 19:24 ` Dmitry Gutov @ 2024-11-04 12:04 ` Eli Zaretskii 2024-11-04 12:11 ` Eli Zaretskii 1 sibling, 0 replies; 138+ messages in thread From: Eli Zaretskii @ 2024-11-04 12:04 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-03 19:24 ` Dmitry Gutov 2024-11-04 12:04 ` Eli Zaretskii @ 2024-11-04 12:11 ` Eli Zaretskii 2024-11-04 17:41 ` Dmitry Gutov 1 sibling, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-04 12:11 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Sun, 3 Nov 2024 21:24:27 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > As long as Emacs is configured with support for tree-sitter, we enable > file associations (using auto-mode-alist) for a certain set of > tree-sitter based modes. Chefly those that don't have existing > "traditional" modes, but that's debatable. > > For others (modes that are not enabled by default), we document the way > to enable them somewhere - in packages' Commentary, for example. The > traditional way to do that has been with us for decades (people need to > add an auto-mode-alist entry in their config script) - and now we also > have a way to do that using major-mode-remap-alist. Either way, adding a > line or two to their .emacs. > > The overall effect is that the file associations become stable again: > set during Emacs's startup and not changing when a package gets loaded, > or a major mode function is called. > > > Is the idea to expect the users to have all the grammar libraries > > installed when they use an Emacs which was built with Tree-Sitter? > > In a way yes, but also no, because they are only needed when the > corresponding file is visited. And only for modes that we decide to > enable by default. I'd prefer not to assume that the mere presence of libtree-sitter means the user wants to use modes. At the very least we should perhaps have a special user option to tell that. In the simplest case it should be a simple boolean, but it could also be a list of languages/grammars for which to enable these modes. Then the relevant parts of auto-mode-alist should test that variable, in addition to whether tree-sitter is supported and available in general. > > Because your code seems to only test the latter, or so it seems. If > > so, I don't think it's an idea to which I'd agree. E.g., imagine a > > user who installed Emacs from some distro which decided to build with > > Tree-Sitter, but doesn't provide all the grammar libraries we require, > > for whatever reasons. > > Then, when visiting let's say a Go file (or Rust, or TypeScript) they > will right away be greeted by a warning that the grammar is not > available, search the docs how to deal with that, and hopefully install > it somehow (maybe using M-x treesit-install-language-grammar). If they > don't, perhaps they'll disable the file association manually - or live > with the warning when visiting such files. Without the user's say-so, this could be considered a nuisance. Why should Emacs annoy a user with some potential feature when the user didn't say she wants to use it? This is not a marketing stance, is it? > > A minor nit: I don't see how c-ts-mode will be invoked under your > > proposal. What did I miss? > > You mean how it will be enabled globally, right? Not just invoked. > > c-ts-mode has instructions in its Commentary, which currently has 3 > options. The patch removes one of them, leaving these two: I don't understand why you decided to treat c-ts-mode differently from, say, js-ts-mode. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-04 12:11 ` Eli Zaretskii @ 2024-11-04 17:41 ` Dmitry Gutov 2024-11-04 19:18 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-11-04 17:41 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 04/11/2024 14:11, Eli Zaretskii wrote: > I'd prefer not to assume that the mere presence of libtree-sitter > means the user wants to use modes. If we don't override existing traditional modes, what's the harm? If we also exclude "small" modes like toml-ts-mode and dockerfile-ts-mode from being enabled by default, we can be reasonably sure that when the user visits a matching file, they will want to have the grammar installed. >>> Because your code seems to only test the latter, or so it seems. If >>> so, I don't think it's an idea to which I'd agree. E.g., imagine a >>> user who installed Emacs from some distro which decided to build with >>> Tree-Sitter, but doesn't provide all the grammar libraries we require, >>> for whatever reasons. >> >> Then, when visiting let's say a Go file (or Rust, or TypeScript) they >> will right away be greeted by a warning that the grammar is not >> available, search the docs how to deal with that, and hopefully install >> it somehow (maybe using M-x treesit-install-language-grammar). If they >> don't, perhaps they'll disable the file association manually - or live >> with the warning when visiting such files. > > Without the user's say-so, this could be considered a nuisance. Why > should Emacs annoy a user with some potential feature when the user > didn't say she wants to use it? Could be considered a nuisance, or a boon. Somebody tries to open a Go file, and sees *no* syntax highlighting, indentation support, etc. When the grammar is not installed, our options here are either: - Silently provide no features, nor explanations why they are not working. Whether the major mode is enabled or not, it offers no explanation on how to fix things. - Or issue a warning that the grammar is not installed. This would make it easier to find the next steps. > This is not a marketing stance, is > it? If making a feature easier to set up and use is a marketing stance, then okay, it is. Note that I don't have a goal of forcing tree-sitter on everybody: previously I suggested to have all ts mode off by default. But if we're going to set them up, the above seems to make the most sense. >>> A minor nit: I don't see how c-ts-mode will be invoked under your >>> proposal. What did I miss? >> >> You mean how it will be enabled globally, right? Not just invoked. >> >> c-ts-mode has instructions in its Commentary, which currently has 3 >> options. The patch removes one of them, leaving these two: > > I don't understand why you decided to treat c-ts-mode differently > from, say, js-ts-mode. I really don't mind removing js-ts-mode, ruby-ts-mode (some other examples?) from being enabled by default. Let's tell the users how to set those up too, it's not hard. We can turn them on later in some future release when we can ensure grammars' availability. And to return to the beginning of your message: > At the very least we should > perhaps have a special user option to tell that. In the simplest case > it should be a simple boolean, but it could also be a list of > languages/grammars for which to enable these modes. Then the relevant > parts of auto-mode-alist should test that variable, in addition to > whether tree-sitter is supported and available in general. This is also a valid approach, albeit a more complex one. This variable would only be tested during Emacs' startup, though, and during 'package-initialize', making its use not very transparent. E.g. we wouldn't react to having it changed in Customize. So it's not my preferred approach to this problem. If we did have such a variable, though, we could enable more modes by default. And it seems like it would be most consistent to enable all tree-sitter modes that we have - including c-ts-mode and so on. I expect some resistance to such a change. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-04 17:41 ` Dmitry Gutov @ 2024-11-04 19:18 ` Eli Zaretskii 2024-11-04 20:59 ` Dmitry Gutov 2024-11-05 13:21 ` Dr. Arne Babenhauserheide 0 siblings, 2 replies; 138+ messages in thread From: Eli Zaretskii @ 2024-11-04 19:18 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Mon, 4 Nov 2024 19:41:13 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > On 04/11/2024 14:11, Eli Zaretskii wrote: > > > I'd prefer not to assume that the mere presence of libtree-sitter > > means the user wants to use modes. > > If we don't override existing traditional modes, what's the harm? Oh, but we do. Even if there's no mode defined for a file, people might expect to have Fundamental mode. We had this discussion before, and we even had someone who complained that some file suddenly turned on a TS mode where previously there was Fundamental mode. That was one of the reasons we made these modes optional in Emacs 29, so let's not repeat past mistakes. > If we > also exclude "small" modes like toml-ts-mode and dockerfile-ts-mode from > being enabled by default, we can be reasonably sure that when the user > visits a matching file, they will want to have the grammar installed. I don't think we can be reasonably sure, no. > > Without the user's say-so, this could be considered a nuisance. Why > > should Emacs annoy a user with some potential feature when the user > > didn't say she wants to use it? > > Could be considered a nuisance, or a boon. See above: we've been there already, and we know it isn't a boon. > Somebody tries to open a Go file, and sees *no* syntax highlighting, > indentation support, etc. When the grammar is not installed, our options > here are either: > > - Silently provide no features, nor explanations why they are not > working. Whether the major mode is enabled or not, it offers no > explanation on how to fix things. > > - Or issue a warning that the grammar is not installed. This would make > it easier to find the next steps. Silently providing no features (and relying on people to read the docs and set up their Emacs) is perhaps not the ideal situation, but annoying users with warning messages they didn't ask for is worse. Again, we've been there, and I'm not going to agree to go back. > Note that I don't have a goal of forcing tree-sitter on everybody: > previously I suggested to have all ts mode off by default. But if we're > going to set them up, the above seems to make the most sense. Not to me, it doesn't. Why is it a problem to ask users to whitelist some of these modes? > > At the very least we should > > perhaps have a special user option to tell that. In the simplest case > > it should be a simple boolean, but it could also be a list of > > languages/grammars for which to enable these modes. Then the relevant > > parts of auto-mode-alist should test that variable, in addition to > > whether tree-sitter is supported and available in general. > > This is also a valid approach, albeit a more complex one. This variable > would only be tested during Emacs' startup, though, and during > 'package-initialize', making its use not very transparent. It will be tested right there in auto-mode-alist, like the change you proposed, just with another test. > E.g. we > wouldn't react to having it changed in Customize. So it's not my > preferred approach to this problem. I don't see why this couldn't be a defcustom. > If we did have such a variable, though, we could enable more modes by > default. Subject to users whitelisting those modes? yes, that's the idea. > And it seems like it would be most consistent to enable all > tree-sitter modes that we have - including c-ts-mode and so on. I expect > some resistance to such a change. Again, if the user sets this variable to t, meaning enable all of TS modes, why would there be a resistance? ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-04 19:18 ` Eli Zaretskii @ 2024-11-04 20:59 ` Dmitry Gutov 2024-11-05 12:11 ` Eli Zaretskii 2024-11-05 13:21 ` Dr. Arne Babenhauserheide 1 sibling, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-11-04 20:59 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 04/11/2024 21:18, Eli Zaretskii wrote: >> If we don't override existing traditional modes, what's the harm? > > Oh, but we do. Even if there's no mode defined for a file, people > might expect to have Fundamental mode. We had this discussion before, > and we even had someone who complained that some file suddenly turned > on a TS mode where previously there was Fundamental mode. That was > one of the reasons we made these modes optional in Emacs 29, so let's > not repeat past mistakes. That was with toml-ts-mode. So you think we should prioritize the scenario where people prefer fundamental-mode over go-ts-mode or typescript-ts-mode as well? >> If we >> also exclude "small" modes like toml-ts-mode and dockerfile-ts-mode from >> being enabled by default, we can be reasonably sure that when the user >> visits a matching file, they will want to have the grammar installed. > > I don't think we can be reasonably sure, no. > >>> Without the user's say-so, this could be considered a nuisance. Why >>> should Emacs annoy a user with some potential feature when the user >>> didn't say she wants to use it? >> >> Could be considered a nuisance, or a boon. > > See above: we've been there already, and we know it isn't a boon. We've been there in a particular configuration (one that included Emacs being configured --without-tree-sitter). > Silently providing no features (and relying on people to read the docs > and set up their Emacs) is perhaps not the ideal situation, but > annoying users with warning messages they didn't ask for is worse. > > Again, we've been there, and I'm not going to agree to go back. Ok. >> Note that I don't have a goal of forcing tree-sitter on everybody: >> previously I suggested to have all ts mode off by default. But if we're >> going to set them up, the above seems to make the most sense. > > Not to me, it doesn't. > > Why is it a problem to ask users to whitelist some of these modes? Not a problem, no. They can do this already by customizing major-mode-remap-alist, for example. >> This is also a valid approach, albeit a more complex one. This variable >> would only be tested during Emacs' startup, though, and during >> 'package-initialize', making its use not very transparent. > > It will be tested right there in auto-mode-alist, like the change you > proposed, just with another test. I'm concerned about the ergonomics of this option. >> E.g. we >> wouldn't react to having it changed in Customize. So it's not my >> preferred approach to this problem. > > I don't see why this couldn't be a defcustom. Would it have a non-default setter? ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-04 20:59 ` Dmitry Gutov @ 2024-11-05 12:11 ` Eli Zaretskii 2024-11-05 17:05 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-05 12:11 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Mon, 4 Nov 2024 22:59:06 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > On 04/11/2024 21:18, Eli Zaretskii wrote: > > >> If we don't override existing traditional modes, what's the harm? > > > > Oh, but we do. Even if there's no mode defined for a file, people > > might expect to have Fundamental mode. We had this discussion before, > > and we even had someone who complained that some file suddenly turned > > on a TS mode where previously there was Fundamental mode. That was > > one of the reasons we made these modes optional in Emacs 29, so let's > > not repeat past mistakes. > > That was with toml-ts-mode. > > So you think we should prioritize the scenario where people prefer > fundamental-mode over go-ts-mode or typescript-ts-mode as well? No, we should de-prioritize the scenario where what used to work without any warnings suddenly triggers warnings when visiting files, asking the user to install something she never asked for in the first place. (Are we really going to reiterate that old discussion? Nothing's changed since then, so the opinions and conclusions will be exactly the same.) > > See above: we've been there already, and we know it isn't a boon. > > We've been there in a particular configuration (one that included Emacs > being configured --without-tree-sitter). Since the person who uses Emacs is many times different from the one who configured it, I don't think that how Emacs was configured is relevant. > > Why is it a problem to ask users to whitelist some of these modes? > > Not a problem, no. They can do this already by customizing > major-mode-remap-alist, for example. That's true, but customizing a single variable might be easier and more easily discoverable, I'd think? If not, then we should leave things as they are. > >> This is also a valid approach, albeit a more complex one. This variable > >> would only be tested during Emacs' startup, though, and during > >> 'package-initialize', making its use not very transparent. > > > > It will be tested right there in auto-mode-alist, like the change you > > proposed, just with another test. > > I'm concerned about the ergonomics of this option. What ergonomics? > >> E.g. we > >> wouldn't react to having it changed in Customize. So it's not my > >> preferred approach to this problem. > > > > I don't see why this couldn't be a defcustom. > > Would it have a non-default setter? Probably. Why is that a problem? ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-05 12:11 ` Eli Zaretskii @ 2024-11-05 17:05 ` Dmitry Gutov 2024-11-05 17:28 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-11-05 17:05 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 05/11/2024 14:11, Eli Zaretskii wrote: > (Are we really going to reiterate that old discussion? Nothing's > changed since then, so the opinions and conclusions will be exactly > the same.) No need. I thought we were in agreement earlier in this thread (https://lists.gnu.org/archive/html/emacs-devel/2024-10/msg00319.html), but apparently not. >>> Why is it a problem to ask users to whitelist some of these modes? >> >> Not a problem, no. They can do this already by customizing >> major-mode-remap-alist, for example. > > That's true, but customizing a single variable might be easier and > more easily discoverable, I'd think? If not, then we should leave > things as they are. The key improvement is to make modes stop altering auto-mode-alist or major-mode-remap-defaults during package loading or in major mode functions. >>>> This is also a valid approach, albeit a more complex one. This variable >>>> would only be tested during Emacs' startup, though, and during >>>> 'package-initialize', making its use not very transparent. >>> >>> It will be tested right there in auto-mode-alist, like the change you >>> proposed, just with another test. >> >> I'm concerned about the ergonomics of this option. > > What ergonomics? User expectations, see below. >>>> E.g. we >>>> wouldn't react to having it changed in Customize. So it's not my >>>> preferred approach to this problem. >>> >>> I don't see why this couldn't be a defcustom. >> >> Would it have a non-default setter? > > Probably. Why is that a problem? Suppose the user customizes treesit-modes-enabled (the new option) to t. Would that have to enable the file associations for all treesit major modes right away, in the same Emacs session? That would require having more data stored somewhere, which currently isn't. Some other registration hook for all ts modes to use. If that's not necessary - not a problem then, easy to implement. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-05 17:05 ` Dmitry Gutov @ 2024-11-05 17:28 ` Eli Zaretskii 2024-11-05 19:40 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-05 17:28 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Tue, 5 Nov 2024 19:05:42 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > On 05/11/2024 14:11, Eli Zaretskii wrote: > > > (Are we really going to reiterate that old discussion? Nothing's > > changed since then, so the opinions and conclusions will be exactly > > the same.) > > No need. I thought we were in agreement earlier in this thread > (https://lists.gnu.org/archive/html/emacs-devel/2024-10/msg00319.html), > but apparently not. It was a misunderstanding. Blame me. > The key improvement is to make modes stop altering auto-mode-alist or > major-mode-remap-defaults during package loading or in major mode functions. That might be an improvement from the POV of us the developers, but it is of a very minor significance, if at all, from the users' POV. > Suppose the user customizes treesit-modes-enabled (the new option) to t. > > Would that have to enable the file associations for all treesit major > modes right away, in the same Emacs session? Yes, I think so. > That would require having more data stored somewhere, which > currently isn't. Some other registration hook for all ts modes to > use. I don't think I understand what data are you talking about. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-05 17:28 ` Eli Zaretskii @ 2024-11-05 19:40 ` Dmitry Gutov 2024-11-05 19:53 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-11-05 19:40 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 05/11/2024 19:28, Eli Zaretskii wrote: >> Suppose the user customizes treesit-modes-enabled (the new option) to t. >> >> Would that have to enable the file associations for all treesit major >> modes right away, in the same Emacs session? > > Yes, I think so. > >> That would require having more data stored somewhere, which >> currently isn't. Some other registration hook for all ts modes to >> use. > > I don't think I understand what data are you talking about. Suppose we have this in css-mode.el: ;;;###autoload (if (and (treesit-available-p) treesit-modes-enabled) (add-to-list 'auto-mode-alist '("\\.css\\'" . css-ts-mode))) And treesit-mode-enabled is originally nil. Then the user customizes it to t. What does its setter do? For css-ts-mode and other modes. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-05 19:40 ` Dmitry Gutov @ 2024-11-05 19:53 ` Eli Zaretskii 2024-11-05 20:59 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-05 19:53 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Tue, 5 Nov 2024 21:40:42 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > On 05/11/2024 19:28, Eli Zaretskii wrote: > > >> Suppose the user customizes treesit-modes-enabled (the new option) to t. > >> > >> Would that have to enable the file associations for all treesit major > >> modes right away, in the same Emacs session? > > > > Yes, I think so. > > > >> That would require having more data stored somewhere, which > >> currently isn't. Some other registration hook for all ts modes to > >> use. > > > > I don't think I understand what data are you talking about. > > Suppose we have this in css-mode.el: > > ;;;###autoload > (if (and (treesit-available-p) > treesit-modes-enabled) > (add-to-list 'auto-mode-alist '("\\.css\\'" . css-ts-mode))) > > And treesit-mode-enabled is originally nil. > > Then the user customizes it to t. > > What does its setter do? For css-ts-mode and other modes. It could turn the mode on in every buffer that visits a .css file. Or not. Why do you ask? ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-05 19:53 ` Eli Zaretskii @ 2024-11-05 20:59 ` Dmitry Gutov 2024-11-06 12:15 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-11-05 20:59 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 05/11/2024 21:53, Eli Zaretskii wrote: >> Date: Tue, 5 Nov 2024 21:40:42 +0200 >> Cc: johan.myreen@gmail.com, emacs-devel@gnu.org >> From: Dmitry Gutov <dmitry@gutov.dev> >> >> On 05/11/2024 19:28, Eli Zaretskii wrote: >> >>>> Suppose the user customizes treesit-modes-enabled (the new option) to t. >>>> >>>> Would that have to enable the file associations for all treesit major >>>> modes right away, in the same Emacs session? >>> >>> Yes, I think so. >>> >>>> That would require having more data stored somewhere, which >>>> currently isn't. Some other registration hook for all ts modes to >>>> use. >>> >>> I don't think I understand what data are you talking about. >> >> Suppose we have this in css-mode.el: >> >> ;;;###autoload >> (if (and (treesit-available-p) >> treesit-modes-enabled) >> (add-to-list 'auto-mode-alist '("\\.css\\'" . css-ts-mode))) >> >> And treesit-mode-enabled is originally nil. >> >> Then the user customizes it to t. >> >> What does its setter do? For css-ts-mode and other modes. > > It could turn the mode on in every buffer that visits a .css file. Or > not. Based on which information? We'd only have (define-derived-mode css-ts-mode css-base-mode "CSS" "Major mode to edit Cascading Style Sheets (CSS). \\<css-ts-mode-map> ...) which has the name of the mode but not file extensions it applies to (or buffer names etc) and (defcustom treesit-enable-modes t "If non-nil, enable file associations for tree-sitter major modes." :version "31.1" :type 'boolean) which does not reference the modes or the file names. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-05 20:59 ` Dmitry Gutov @ 2024-11-06 12:15 ` Eli Zaretskii 2024-11-06 12:46 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-06 12:15 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Tue, 5 Nov 2024 22:59:09 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > On 05/11/2024 21:53, Eli Zaretskii wrote: > >> Suppose we have this in css-mode.el: > >> > >> ;;;###autoload > >> (if (and (treesit-available-p) > >> treesit-modes-enabled) > >> (add-to-list 'auto-mode-alist '("\\.css\\'" . css-ts-mode))) > >> > >> And treesit-mode-enabled is originally nil. > >> > >> Then the user customizes it to t. > >> > >> What does its setter do? For css-ts-mode and other modes. > > > > It could turn the mode on in every buffer that visits a .css file. Or > > not. > > Based on which information? buffer-file-name and auto-mode-alist, I guess? ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-06 12:15 ` Eli Zaretskii @ 2024-11-06 12:46 ` Dmitry Gutov 2024-11-06 13:25 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-11-06 12:46 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel [-- Attachment #1: Type: text/plain, Size: 967 bytes --] On Wed, Nov 6, 2024, at 2:15 PM, Eli Zaretskii wrote: > > Date: Tue, 5 Nov 2024 22:59:09 +0200 > > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > > From: Dmitry Gutov <dmitry@gutov.dev> > > > > On 05/11/2024 21:53, Eli Zaretskii wrote: > > >> Suppose we have this in css-mode.el: > > >> > > >> ;;;###autoload > > >> (if (and (treesit-available-p) > > >> treesit-modes-enabled) > > >> (add-to-list 'auto-mode-alist '("\\.css\\'" . css-ts-mode))) > > >> > > >> And treesit-mode-enabled is originally nil. > > >> > > >> Then the user customizes it to t. > > >> > > >> What does its setter do? For css-ts-mode and other modes. > > > > > > It could turn the mode on in every buffer that visits a .css file. Or > > > not. > > > > Based on which information? > > buffer-file-name and auto-mode-alist, I guess? But auto-mode-alist won't have any relevant entries because when its form (above) was evaluated, treesit-modes-enabled was nil. [-- Attachment #2: Type: text/html, Size: 1921 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-06 12:46 ` Dmitry Gutov @ 2024-11-06 13:25 ` Eli Zaretskii 2024-11-06 16:07 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-06 13:25 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Wed, 06 Nov 2024 14:46:48 +0200 > From: "Dmitry Gutov" <dmitry@gutov.dev> > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > > > On Wed, Nov 6, 2024, at 2:15 PM, Eli Zaretskii wrote: > > > Date: Tue, 5 Nov 2024 22:59:09 +0200 > > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > > From: Dmitry Gutov <dmitry@gutov.dev> > > > > On 05/11/2024 21:53, Eli Zaretskii wrote: > > >> Suppose we have this in css-mode.el: > > >> > > >> ;;;###autoload > > >> (if (and (treesit-available-p) > > >> treesit-modes-enabled) > > >> (add-to-list 'auto-mode-alist '("\\.css\\'" . css-ts-mode))) > > >> > > >> And treesit-mode-enabled is originally nil. > > >> > > >> Then the user customizes it to t. > > >> > > >> What does its setter do? For css-ts-mode and other modes. > > > > > > It could turn the mode on in every buffer that visits a .css file. Or > > > not. > > > > Based on which information? > > buffer-file-name and auto-mode-alist, I guess? > > But auto-mode-alist won't have any relevant entries because when its form (above) was evaluated, > treesit-modes-enabled was nil. Are you saying that it is impossible to turn on the mode in relevant buffers? I find that hard to believe, but if you are right, then we could refrain from doing this retroactively. (And I still don't understand where this discussion is going. What point are you trying to make?) ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-06 13:25 ` Eli Zaretskii @ 2024-11-06 16:07 ` Dmitry Gutov 2024-11-06 17:14 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-11-06 16:07 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 06/11/2024 15:25, Eli Zaretskii wrote: >> Date: Wed, 06 Nov 2024 14:46:48 +0200 >> From: "Dmitry Gutov" <dmitry@gutov.dev> >> Cc: johan.myreen@gmail.com, emacs-devel@gnu.org >> >> >> On Wed, Nov 6, 2024, at 2:15 PM, Eli Zaretskii wrote: >> >> > Date: Tue, 5 Nov 2024 22:59:09 +0200 >> > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org >> > From: Dmitry Gutov <dmitry@gutov.dev> >> > >> > On 05/11/2024 21:53, Eli Zaretskii wrote: >> > >> Suppose we have this in css-mode.el: >> > >> >> > >> ;;;###autoload >> > >> (if (and (treesit-available-p) >> > >> treesit-modes-enabled) >> > >> (add-to-list 'auto-mode-alist '("\\.css\\'" . css-ts-mode))) >> > >> >> > >> And treesit-mode-enabled is originally nil. >> > >> >> > >> Then the user customizes it to t. >> > >> >> > >> What does its setter do? For css-ts-mode and other modes. >> > > >> > > It could turn the mode on in every buffer that visits a .css file. Or >> > > not. >> > >> > Based on which information? >> >> buffer-file-name and auto-mode-alist, I guess? >> >> But auto-mode-alist won't have any relevant entries because when its form (above) was evaluated, >> treesit-modes-enabled was nil. > > Are you saying that it is impossible to turn on the mode in relevant > buffers? I find that hard to believe, but if you are right, then we > could refrain from doing this retroactively. > > (And I still don't understand where this discussion is going. What > point are you trying to make?) I'm not trying to make a point, but to find the right tradeoffs. You wanted a user option - sure, no problem. But if taken the most straightforward approach, the option would only have effect after restart, and not on the current session. Otherwise it would need more information available somehow. You asked which data - the description was in the previous messages. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-06 16:07 ` Dmitry Gutov @ 2024-11-06 17:14 ` Eli Zaretskii 2024-11-19 2:44 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-06 17:14 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Wed, 6 Nov 2024 18:07:46 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > On 06/11/2024 15:25, Eli Zaretskii wrote: > >> > >> But auto-mode-alist won't have any relevant entries because when its form (above) was evaluated, > >> treesit-modes-enabled was nil. > > > > Are you saying that it is impossible to turn on the mode in relevant > > buffers? I find that hard to believe, but if you are right, then we > > could refrain from doing this retroactively. > > > > (And I still don't understand where this discussion is going. What > > point are you trying to make?) > > I'm not trying to make a point, but to find the right tradeoffs. > > You wanted a user option - sure, no problem. But if taken the most > straightforward approach, the option would only have effect after > restart, and not on the current session. Otherwise it would need more > information available somehow. You asked which data - the description > was in the previous messages. First, I still believe we can find a way of turning the enabled modes on in the existing buffers. Your arguments and questions seem to imply that the simplest solutions might have difficulties, but they didn't convince me that this is impossible or impractical in principle. But even if the customization will affect only files visited after it, that's not a catastrophe, IMO, as we already have other customizations with similar behaviors. And since we now have restart-emacs, restarting is not a big problem, either. So I think a tradeoff of asking users to explicitly express their preferences for these modes before we enable them is an okay tradeoff. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-06 17:14 ` Eli Zaretskii @ 2024-11-19 2:44 ` Dmitry Gutov 2024-11-19 15:41 ` Eli Zaretskii 2024-11-19 17:59 ` Juri Linkov 0 siblings, 2 replies; 138+ messages in thread From: Dmitry Gutov @ 2024-11-19 2:44 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel [-- Attachment #1: Type: text/plain, Size: 1401 bytes --] On 06/11/2024 19:14, Eli Zaretskii wrote: >> You wanted a user option - sure, no problem. But if taken the most >> straightforward approach, the option would only have effect after >> restart, and not on the current session. Otherwise it would need more >> information available somehow. You asked which data - the description >> was in the previous messages. > > First, I still believe we can find a way of turning the enabled modes > on in the existing buffers. Existing buffers vs new buffers is not the main issue. Getting the auto-mode-alist or major-mode-alias-alist entries for modes that were previously "off" is something we'd need a registry for. Meaning, for example, new variables like treesit-auto-mode-alist and treesit-major-mode-alist-alist which would keep the associations "in store" until we decide to enable the modes. On balance, it seems like overkill. Unless... we move all association settings from the built-in modes into treesit.el - then this stuff would only live in one place, at least. No access to the data from the "outside" => no new public vars necessary. The way to use the attached change (the main part is in treesit.el): (require 'treesit) (setopt treesit-enable-modes t) We could also autoload the new defcustom to make the first line unnecessary (though that's generally discouraged), or move its definition to an existing preloaded file. [-- Attachment #2: treesit-enable-modes.diff --] [-- Type: text/x-patch, Size: 5094 bytes --] diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 3823c553fda..5b89fe917c2 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -35,12 +35,6 @@ ;; To use these modes by default, assuming you have the respective ;; tree-sitter grammars available, do one of the following: ;; -;; - If you have both C and C++ grammars installed, add -;; -;; (require 'c-ts-mode) -;; -;; to your init file. -;; ;; - Add one or mode of the following to your init file: ;; ;; (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode)) @@ -1539,21 +1533,6 @@ c-or-c++-ts-mode 'c-ts-mode))) (funcall (major-mode-remap mode)))) -;; The entries for C++ must come first to prevent *.c files be taken -;; as C++ on case-insensitive filesystems, since *.C files are C++, -;; not C. -(if (treesit-ready-p 'cpp) - (add-to-list 'major-mode-remap-defaults - '(c++-mode . c++-ts-mode))) - -(when (treesit-ready-p 'c) - (add-to-list 'major-mode-remap-defaults '(c++-mode . c++-ts-mode)) - (add-to-list 'major-mode-remap-defaults '(c-mode . c-ts-mode))) - -(when (and (treesit-ready-p 'cpp) - (treesit-ready-p 'c)) - (add-to-list 'major-mode-remap-defaults '(c-or-c++-mode . c-or-c++-ts-mode))) - (when (and c-ts-mode-enable-doxygen (not (treesit-ready-p 'doxygen t))) (message "Doxygen syntax highlighting can't be enabled, please install the language grammar.")) diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index cacdb266298..0adfbff1115 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -755,13 +755,6 @@ elixir-ts-mode (derived-mode-add-parents 'elixir-ts-mode '(elixir-mode)) -(if (treesit-ready-p 'elixir) - (progn - (add-to-list 'auto-mode-alist '("\\.elixir\\'" . elixir-ts-mode)) - (add-to-list 'auto-mode-alist '("\\.ex\\'" . elixir-ts-mode)) - (add-to-list 'auto-mode-alist '("\\.exs\\'" . elixir-ts-mode)) - (add-to-list 'auto-mode-alist '("mix\\.lock" . elixir-ts-mode)))) - (provide 'elixir-ts-mode) ;;; elixir-ts-mode.el ends here diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index 86e74ad58a8..f306b6c3c37 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -305,11 +305,6 @@ go-ts-mode (derived-mode-add-parents 'go-ts-mode '(go-mode)) -(if (treesit-ready-p 'go) - ;; FIXME: Should we instead put `go-mode' in `auto-mode-alist' - ;; and then use `major-mode-remap-defaults' to map it to `go-ts-mode'? - (add-to-list 'auto-mode-alist '("\\.go\\'" . go-ts-mode))) - (defun go-ts-mode--defun-name (node &optional skip-prefix) "Return the defun name of NODE. Return nil if there is no name or if NODE is not a defun node. @@ -562,9 +557,6 @@ go-mod-ts-mode (derived-mode-add-parents 'go-mod-ts-mode '(go-mod-mode)) -(if (treesit-ready-p 'gomod) - (add-to-list 'auto-mode-alist '("/go\\.mod\\'" . go-mod-ts-mode))) - (provide 'go-ts-mode) ;;; go-ts-mode.el ends here diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index f74b8ab1c46..a4d4399012c 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3961,10 +3961,7 @@ js-ts-mode "method_definition") eos) nil nil))) - (treesit-major-mode-setup) - - (add-to-list 'auto-mode-alist - '("\\(\\.js[mx]\\|\\.har\\)\\'" . js-ts-mode)))) + (treesit-major-mode-setup))) (derived-mode-add-parents 'js-ts-mode '(js-mode)) diff --git a/lisp/treesit.el b/lisp/treesit.el index 6f5d065cc24..94b8278b2b6 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -950,6 +950,38 @@ treesit-font-lock-level :set #'treesit--font-lock-level-setter :version "29.1") +(defvar treesit--mode-associations + '((javascript-mode . js-ts-mode ) + (c-or-c++-mode . c-or-c++-ts-mode) + (c-mode . c-ts-mode) + (c++-mode . c++-ts-mode) + ("\\.elixir\\'" . elixir-ts-mode) + ("\\.ex\\'" . elixir-ts-mode) + ("\\.go\\'" . go-ts-mode) + ;; And so on. + ;; Some info needed for interpreter-mode-alist as well. + )) + +(defun treesit-enable-modes--set (sym value) + (set-default sym value) + + (dolist (elem treesit--mode-associations) + (let* ((use-ama (stringp (car elem)))) + (if value + (if (stringp (car elem)) + (add-to-list 'auto-mode-alist elem) + (add-to-list 'major-mode-remap-alist elem)) + (if use-ama + (setq auto-mode-alist (delete elem auto-mode-alist)) + (setq major-mode-remap-alist + (delete elem major-mode-remap-alist))))))) + +(defcustom treesit-enable-modes nil + "Non-nil to enable tree-sitter modes during Emacs's startup." + :type 'boolean + :version "31.1" + :set #'treesit-enable-modes--set) + (defvar-local treesit--font-lock-query-expand-range (cons 0 0) "The amount to expand the start and end of the region when fontifying. This should be a cons cell (START . END). When fontifying a ^ permalink raw reply related [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-19 2:44 ` Dmitry Gutov @ 2024-11-19 15:41 ` Eli Zaretskii 2024-11-19 16:13 ` Dmitry Gutov 2024-11-19 17:59 ` Juri Linkov 1 sibling, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-19 15:41 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Tue, 19 Nov 2024 04:44:06 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > >> You wanted a user option - sure, no problem. But if taken the most > >> straightforward approach, the option would only have effect after > >> restart, and not on the current session. Otherwise it would need more > >> information available somehow. You asked which data - the description > >> was in the previous messages. > > > > First, I still believe we can find a way of turning the enabled modes > > on in the existing buffers. > > Existing buffers vs new buffers is not the main issue. Getting the > auto-mode-alist or major-mode-alias-alist entries for modes that were > previously "off" is something we'd need a registry for. I don't think I follow: what are the problems with simply adding associations to auto-mode-alist? ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-19 15:41 ` Eli Zaretskii @ 2024-11-19 16:13 ` Dmitry Gutov 2024-11-19 17:10 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-11-19 16:13 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 19/11/2024 17:41, Eli Zaretskii wrote: >> Date: Tue, 19 Nov 2024 04:44:06 +0200 >> Cc:johan.myreen@gmail.com,emacs-devel@gnu.org >> From: Dmitry Gutov<dmitry@gutov.dev> >> >>>> You wanted a user option - sure, no problem. But if taken the most >>>> straightforward approach, the option would only have effect after >>>> restart, and not on the current session. Otherwise it would need more >>>> information available somehow. You asked which data - the description >>>> was in the previous messages. >>> First, I still believe we can find a way of turning the enabled modes >>> on in the existing buffers. >> Existing buffers vs new buffers is not the main issue. Getting the >> auto-mode-alist or major-mode-alias-alist entries for modes that were >> previously "off" is something we'd need a registry for. > I don't think I follow: what are the problems with simply adding > associations to auto-mode-alist? When treesit-enable-modes is nil? Which it apparently will be by default. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-19 16:13 ` Dmitry Gutov @ 2024-11-19 17:10 ` Eli Zaretskii 2024-11-19 17:40 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-19 17:10 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Tue, 19 Nov 2024 18:13:31 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > On 19/11/2024 17:41, Eli Zaretskii wrote: > >> Date: Tue, 19 Nov 2024 04:44:06 +0200 > >> Cc:johan.myreen@gmail.com,emacs-devel@gnu.org > >> From: Dmitry Gutov<dmitry@gutov.dev> > >> > >>>> You wanted a user option - sure, no problem. But if taken the most > >>>> straightforward approach, the option would only have effect after > >>>> restart, and not on the current session. Otherwise it would need more > >>>> information available somehow. You asked which data - the description > >>>> was in the previous messages. > >>> First, I still believe we can find a way of turning the enabled modes > >>> on in the existing buffers. > >> Existing buffers vs new buffers is not the main issue. Getting the > >> auto-mode-alist or major-mode-alias-alist entries for modes that were > >> previously "off" is something we'd need a registry for. > > I don't think I follow: what are the problems with simply adding > > associations to auto-mode-alist? > > When treesit-enable-modes is nil? No, when the user customizes it to specify some TS modes as preferred. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-19 17:10 ` Eli Zaretskii @ 2024-11-19 17:40 ` Dmitry Gutov 2024-11-19 17:47 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-11-19 17:40 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 19/11/2024 19:10, Eli Zaretskii wrote: >>> I don't think I follow: what are the problems with simply adding >>> associations to auto-mode-alist? >> When treesit-enable-modes is nil? > No, when the user customizes it to specify some TS modes as preferred. Using which data? We seem to be going in circles. Anyway, see the patch from my message 15 hours ago, lmk what you think. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-19 17:40 ` Dmitry Gutov @ 2024-11-19 17:47 ` Eli Zaretskii 2024-11-19 17:56 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-19 17:47 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Tue, 19 Nov 2024 19:40:18 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > On 19/11/2024 19:10, Eli Zaretskii wrote: > >>> I don't think I follow: what are the problems with simply adding > >>> associations to auto-mode-alist? > >> When treesit-enable-modes is nil? > > No, when the user customizes it to specify some TS modes as preferred. > > Using which data? What data is needed? > We seem to be going in circles. That's probably due to long gaps between messages. > Anyway, see the patch from my message 15 hours ago, lmk what you think. Wasn't the idea that the user will tell us which files she wants to visit in each mode? ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-19 17:47 ` Eli Zaretskii @ 2024-11-19 17:56 ` Dmitry Gutov 2024-11-19 19:01 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-11-19 17:56 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 19/11/2024 19:47, Eli Zaretskii wrote: >> Date: Tue, 19 Nov 2024 19:40:18 +0200 >> Cc: johan.myreen@gmail.com, emacs-devel@gnu.org >> From: Dmitry Gutov <dmitry@gutov.dev> >> >> On 19/11/2024 19:10, Eli Zaretskii wrote: >>>>> I don't think I follow: what are the problems with simply adding >>>>> associations to auto-mode-alist? >>>> When treesit-enable-modes is nil? >>> No, when the user customizes it to specify some TS modes as preferred. >> >> Using which data? > > What data is needed? The values to put into auto-mode-alist, e.g. the regexp(s). Normally, such an entry is added to auto-mode-alist during Emacs's startup (whether from that option's init form, or using package autoloads). If we want to do it later from the newly added option's setter, the setter needs to get the values from somewhere. >> Anyway, see the patch from my message 15 hours ago, lmk what you think. > > Wasn't the idea that the user will tell us which files she wants to > visit in each mode? I think we talked about making the option more granular (allowing to set it not just to t, but to a list of modes). That will be easy to add. But specifying the files as well is news to me. Wouldn't users who want that level of detail just go and customize auto-mode-alist instead? ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-19 17:56 ` Dmitry Gutov @ 2024-11-19 19:01 ` Eli Zaretskii 2024-11-19 20:12 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-19 19:01 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Tue, 19 Nov 2024 19:56:05 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > > Wasn't the idea that the user will tell us which files she wants to > > visit in each mode? > > I think we talked about making the option more granular (allowing to set > it not just to t, but to a list of modes). That will be easy to add. > > But specifying the files as well is news to me. Wouldn't users who want > that level of detail just go and customize auto-mode-alist instead? Maybe so, but that is not always easy nor user-friendly: getting the regexps right is not trivial, many people make mistakes. And I thought this discussion at some point mentioned that Emacs should suggest a mode for the file being visited? in which case specifying the file is trivial. I'm also not opposed to having the data ready somewhere in advance. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-19 19:01 ` Eli Zaretskii @ 2024-11-19 20:12 ` Dmitry Gutov 2024-11-20 12:59 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-11-19 20:12 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 19/11/2024 21:01, Eli Zaretskii wrote: >> Date: Tue, 19 Nov 2024 19:56:05 +0200 >> Cc: johan.myreen@gmail.com, emacs-devel@gnu.org >> From: Dmitry Gutov <dmitry@gutov.dev> >> >>> Wasn't the idea that the user will tell us which files she wants to >>> visit in each mode? >> >> I think we talked about making the option more granular (allowing to set >> it not just to t, but to a list of modes). That will be easy to add. >> >> But specifying the files as well is news to me. Wouldn't users who want >> that level of detail just go and customize auto-mode-alist instead? > > Maybe so, but that is not always easy nor user-friendly: getting the > regexps right is not trivial, many people make mistakes. Even if that's true, I'm not sure what workflow you have in mind. My goal here is to fix the problem of ts modes installing themselves into auto-mode-alist (and major-mode-remap-defaults) haphazardly, with associated problems like https://debbugs.gnu.org/74339#38, for example. If editing regexp directly is a difficulty, we could either add some helpers in the Customize interface, or a command which would prompt for mode, for file extension(s), and then customize auto-mode-alist based on that. But that's not specific to tree-sitter modes, and not a replacement for the current setup. > And I > thought this discussion at some point mentioned that Emacs should > suggest a mode for the file being visited? in which case specifying > the file is trivial. Philip K. has proposed a package package-autosuggest - which is something that approaches similar needs from an opposite direction (providing automatic suggestions when the user visit a file which is currently not supported but could be after installing a package or doing some extra customization). A totally valid approach - and well-tested by the likes of VS Code. I haven't tested that branch myself yet, and it seems to come with a bunch of UI decisions, so it's a bigger endeavor. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-19 20:12 ` Dmitry Gutov @ 2024-11-20 12:59 ` Eli Zaretskii 2024-11-20 18:38 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-20 12:59 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Tue, 19 Nov 2024 22:12:09 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > On 19/11/2024 21:01, Eli Zaretskii wrote: > >> Date: Tue, 19 Nov 2024 19:56:05 +0200 > >> Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > >> From: Dmitry Gutov <dmitry@gutov.dev> > >> > >>> Wasn't the idea that the user will tell us which files she wants to > >>> visit in each mode? > >> > >> I think we talked about making the option more granular (allowing to set > >> it not just to t, but to a list of modes). That will be easy to add. > >> > >> But specifying the files as well is news to me. Wouldn't users who want > >> that level of detail just go and customize auto-mode-alist instead? > > > > Maybe so, but that is not always easy nor user-friendly: getting the > > regexps right is not trivial, many people make mistakes. > > Even if that's true, I'm not sure what workflow you have in mind. Someone mentioned the possibility that Emacs could propose using some mode when user visits a file, AFAIR. So the workflow would be to ask the user whether she wants to turn on mode FOO in files like this one, and if the answer is YES, modify auto-mode-alist accordingly. > My > goal here is to fix the problem of ts modes installing themselves into > auto-mode-alist (and major-mode-remap-defaults) haphazardly, with > associated problems like https://debbugs.gnu.org/74339#38, for example. We all want to find a better solution, the challenge is to find one. > If editing regexp directly is a difficulty, we could either add some > helpers in the Customize interface, or a command which would prompt for > mode, for file extension(s), and then customize auto-mode-alist based on > that. The latter is the idea I had in mind. > But that's not specific to tree-sitter modes No, but that shouldn't prevent us from implementing something specific to tree-sitter modes for starters. > and not a replacement for the current setup. What current setup? > > And I > > thought this discussion at some point mentioned that Emacs should > > suggest a mode for the file being visited? in which case specifying > > the file is trivial. > > Philip K. has proposed a package package-autosuggest - which is > something that approaches similar needs from an opposite direction > (providing automatic suggestions when the user visit a file which is > currently not supported but could be after installing a package or doing > some extra customization). A totally valid approach - and well-tested by > the likes of VS Code. > > I haven't tested that branch myself yet, and it seems to come with a > bunch of UI decisions, so it's a bigger endeavor. We could start from something specific to tree-sitter modes, and merge these two features later. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-20 12:59 ` Eli Zaretskii @ 2024-11-20 18:38 ` Dmitry Gutov 2024-11-20 19:01 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-11-20 18:38 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 20/11/2024 14:59, Eli Zaretskii wrote: >>> Maybe so, but that is not always easy nor user-friendly: getting the >>> regexps right is not trivial, many people make mistakes. >> >> Even if that's true, I'm not sure what workflow you have in mind. > > Someone mentioned the possibility that Emacs could propose using some > mode when user visits a file, AFAIR. So the workflow would be to ask > the user whether she wants to turn on mode FOO in files like this one, > and if the answer is YES, modify auto-mode-alist accordingly. And the init script. Or .custom.el. Keeping in mind that that value might be modified somewhere else during startup, I guess. Philip's branch is the closest to that idea. Would you be comfortable to replace the current setup with it? The result can be that all ts modes are disabled by default, but when visiting a file extension that is currently associated with fundamental-mode, but we have a alternative mode available, we'd offer to the user to "install" that. For built-in modes, it would mean a corresponding major-mode-remap-alist or auto-mode-alist customization. I'm fine with that idea, but it'd seem like a change in paradigm. >> My >> goal here is to fix the problem of ts modes installing themselves into >> auto-mode-alist (and major-mode-remap-defaults) haphazardly, with >> associated problems like https://debbugs.gnu.org/74339#38, for example. > > We all want to find a better solution, the challenge is to find one. If a solution is presented that solves the scenarios that the current one does, while avoiding some existing problems, it should be considered a win. Even if it doesn't include some additional nice-to-haves. >> and not a replacement for the current setup. > > What current setup? Please look at the patch in https://lists.gnu.org/archive/html/emacs-devel/2024-11/msg00515.html, the current setup is on the lines being removed, and the proposed one is on the lines being added. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-20 18:38 ` Dmitry Gutov @ 2024-11-20 19:01 ` Eli Zaretskii 2024-11-20 19:23 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-20 19:01 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Wed, 20 Nov 2024 20:38:05 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > On 20/11/2024 14:59, Eli Zaretskii wrote: > >>> Maybe so, but that is not always easy nor user-friendly: getting the > >>> regexps right is not trivial, many people make mistakes. > >> > >> Even if that's true, I'm not sure what workflow you have in mind. > > > > Someone mentioned the possibility that Emacs could propose using some > > mode when user visits a file, AFAIR. So the workflow would be to ask > > the user whether she wants to turn on mode FOO in files like this one, > > and if the answer is YES, modify auto-mode-alist accordingly. > > And the init script. Or .custom.el. Keeping in mind that that value > might be modified somewhere else during startup, I guess. That's basic customization for you, yes. > Philip's branch is the closest to that idea. Would you be comfortable to > replace the current setup with it? > > The result can be that all ts modes are disabled by default, but when > visiting a file extension that is currently associated with > fundamental-mode, but we have a alternative mode available, we'd offer > to the user to "install" that. For built-in modes, it would mean a > corresponding major-mode-remap-alist or auto-mode-alist customization. This is okay as an opt-in feature, but it cannot be the only way for users to tell Emacs they prefer one or more TS-based modes. For starters, some people might be annoyed by these suggestions, and might prefer more proactive ways of enabling those modes. > I'm fine with that idea, but it'd seem like a change in paradigm. Yes, indeed. So I think it has to be an optional feature, and we should offer more "direct" ways for expressing such preferences. > >> My > >> goal here is to fix the problem of ts modes installing themselves into > >> auto-mode-alist (and major-mode-remap-defaults) haphazardly, with > >> associated problems like https://debbugs.gnu.org/74339#38, for example. > > > > We all want to find a better solution, the challenge is to find one. > > If a solution is presented that solves the scenarios that the current > one does, while avoiding some existing problems, it should be considered > a win. Even if it doesn't include some additional nice-to-haves. I'm more worried by the UI and the UX of such solutions. Other than that, I agree that avoiding at least some of the current problems is progress. > >> and not a replacement for the current setup. > > > > What current setup? > > Please look at the patch in > https://lists.gnu.org/archive/html/emacs-devel/2024-11/msg00515.html, > the current setup is on the lines being removed, and the proposed one is > on the lines being added. Then I don't understand why you say modifying auto-mode-alist is not a replacement. That's what we did in Emacs 29, just less cleanly. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-20 19:01 ` Eli Zaretskii @ 2024-11-20 19:23 ` Dmitry Gutov 2024-11-20 19:55 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-11-20 19:23 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 20/11/2024 21:01, Eli Zaretskii wrote: >> Philip's branch is the closest to that idea. Would you be comfortable to >> replace the current setup with it? >> >> The result can be that all ts modes are disabled by default, but when >> visiting a file extension that is currently associated with >> fundamental-mode, but we have a alternative mode available, we'd offer >> to the user to "install" that. For built-in modes, it would mean a >> corresponding major-mode-remap-alist or auto-mode-alist customization. > > This is okay as an opt-in feature, but it cannot be the only way for > users to tell Emacs they prefer one or more TS-based modes. For > starters, some people might be annoyed by these suggestions, and might > prefer more proactive ways of enabling those modes. In that case, I suggest we leave that feature request for later, and discuss my proposal first. >> I'm fine with that idea, but it'd seem like a change in paradigm. > > Yes, indeed. So I think it has to be an optional feature, and we > should offer more "direct" ways for expressing such preferences. Such as a user option called treesit-enable-modes? >>>> and not a replacement for the current setup. >>> >>> What current setup? >> >> Please look at the patch in >> https://lists.gnu.org/archive/html/emacs-devel/2024-11/msg00515.html, >> the current setup is on the lines being removed, and the proposed one is >> on the lines being added. > > Then I don't understand why you say modifying auto-mode-alist is not a > replacement. That's what we did in Emacs 29, just less cleanly. I said that "helpers in the Customize interface, or a command which would prompt for mode, for file extension(s), and then customize auto-mode-alist based on that" would not be ... "a replacement for the current setup", which you seem to confirm in the latest messages. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-20 19:23 ` Dmitry Gutov @ 2024-11-20 19:55 ` Eli Zaretskii 2024-11-20 19:57 ` Dmitry Gutov 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-20 19:55 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Wed, 20 Nov 2024 21:23:56 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > >> I'm fine with that idea, but it'd seem like a change in paradigm. > > > > Yes, indeed. So I think it has to be an optional feature, and we > > should offer more "direct" ways for expressing such preferences. > > Such as a user option called treesit-enable-modes? Something like that, yes. Because no better idea was presented. > >>>> and not a replacement for the current setup. > >>> > >>> What current setup? > >> > >> Please look at the patch in > >> https://lists.gnu.org/archive/html/emacs-devel/2024-11/msg00515.html, > >> the current setup is on the lines being removed, and the proposed one is > >> on the lines being added. > > > > Then I don't understand why you say modifying auto-mode-alist is not a > > replacement. That's what we did in Emacs 29, just less cleanly. > > I said that "helpers in the Customize interface, or a command which > would prompt for mode, for file extension(s), and then customize > auto-mode-alist based on that" would not be ... "a replacement for the > current setup", which you seem to confirm in the latest messages. I do? ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-20 19:55 ` Eli Zaretskii @ 2024-11-20 19:57 ` Dmitry Gutov 2024-11-21 5:46 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dmitry Gutov @ 2024-11-20 19:57 UTC (permalink / raw) To: Eli Zaretskii; +Cc: johan.myreen, emacs-devel On 20/11/2024 21:55, Eli Zaretskii wrote: >> Date: Wed, 20 Nov 2024 21:23:56 +0200 >> Cc: johan.myreen@gmail.com, emacs-devel@gnu.org >> From: Dmitry Gutov <dmitry@gutov.dev> >> >>>> I'm fine with that idea, but it'd seem like a change in paradigm. >>> >>> Yes, indeed. So I think it has to be an optional feature, and we >>> should offer more "direct" ways for expressing such preferences. >> >> Such as a user option called treesit-enable-modes? > > Something like that, yes. Because no better idea was presented. Take a look at the patch, then? >>>>>> and not a replacement for the current setup. >>>>> >>>>> What current setup? >>>> >>>> Please look at the patch in >>>> https://lists.gnu.org/archive/html/emacs-devel/2024-11/msg00515.html, >>>> the current setup is on the lines being removed, and the proposed one is >>>> on the lines being added. >>> >>> Then I don't understand why you say modifying auto-mode-alist is not a >>> replacement. That's what we did in Emacs 29, just less cleanly. >> >> I said that "helpers in the Customize interface, or a command which >> would prompt for mode, for file extension(s), and then customize >> auto-mode-alist based on that" would not be ... "a replacement for the >> current setup", which you seem to confirm in the latest messages. > > I do? As far as I was able to understand, yes. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-20 19:57 ` Dmitry Gutov @ 2024-11-21 5:46 ` Eli Zaretskii 0 siblings, 0 replies; 138+ messages in thread From: Eli Zaretskii @ 2024-11-21 5:46 UTC (permalink / raw) To: Dmitry Gutov; +Cc: johan.myreen, emacs-devel > Date: Wed, 20 Nov 2024 21:57:14 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov <dmitry@gutov.dev> > > On 20/11/2024 21:55, Eli Zaretskii wrote: > >> Date: Wed, 20 Nov 2024 21:23:56 +0200 > >> Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > >> From: Dmitry Gutov <dmitry@gutov.dev> > >> > >>>> I'm fine with that idea, but it'd seem like a change in paradigm. > >>> > >>> Yes, indeed. So I think it has to be an optional feature, and we > >>> should offer more "direct" ways for expressing such preferences. > >> > >> Such as a user option called treesit-enable-modes? > > > > Something like that, yes. Because no better idea was presented. > > Take a look at the patch, then? I did. What's the next step? > > >>>>>> and not a replacement for the current setup. > >>>>> > >>>>> What current setup? > >>>> > >>>> Please look at the patch in > >>>> https://lists.gnu.org/archive/html/emacs-devel/2024-11/msg00515.html, > >>>> the current setup is on the lines being removed, and the proposed one is > >>>> on the lines being added. > >>> > >>> Then I don't understand why you say modifying auto-mode-alist is not a > >>> replacement. That's what we did in Emacs 29, just less cleanly. > >> > >> I said that "helpers in the Customize interface, or a command which > >> would prompt for mode, for file extension(s), and then customize > >> auto-mode-alist based on that" would not be ... "a replacement for the > >> current setup", which you seem to confirm in the latest messages. > > > > I do? > > As far as I was able to understand, yes. Then you should understand that I think it _is_ a replacement for the current setup, which AFAIK we all consider as sub-optimal. IOW, we do want to avoid the situation where loading a mode changes auto-mode-alist or major-mode-remap-defaults or any other global data, right? If so, why wouldn't those alternatives be the replacement for that? ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-19 2:44 ` Dmitry Gutov 2024-11-19 15:41 ` Eli Zaretskii @ 2024-11-19 17:59 ` Juri Linkov 2024-11-19 19:52 ` Dmitry Gutov 2024-11-20 16:47 ` Philip Kaludercic 1 sibling, 2 replies; 138+ messages in thread From: Juri Linkov @ 2024-11-19 17:59 UTC (permalink / raw) To: Dmitry Gutov; +Cc: Eli Zaretskii, johan.myreen, emacs-devel > +(defvar treesit--mode-associations > + '((javascript-mode . js-ts-mode ) > + (c-or-c++-mode . c-or-c++-ts-mode) > + (c-mode . c-ts-mode) > + (c++-mode . c++-ts-mode) > + ("\\.elixir\\'" . elixir-ts-mode) > + ("\\.ex\\'" . elixir-ts-mode) > + ("\\.go\\'" . go-ts-mode) > + ;; And so on. > + ;; Some info needed for interpreter-mode-alist as well. > + )) > + > +(defcustom treesit-enable-modes nil > + "Non-nil to enable tree-sitter modes during Emacs's startup." > + :type 'boolean > + :version "31.1" > + :set #'treesit-enable-modes--set) This could support a list to enable ts-modes selectively, e.g. (setq treesit-enable-modes '(elixir-ts-mode js-ts-mode)) to not enable 'c-ts-mode', etc. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-19 17:59 ` Juri Linkov @ 2024-11-19 19:52 ` Dmitry Gutov 2024-11-20 16:47 ` Philip Kaludercic 1 sibling, 0 replies; 138+ messages in thread From: Dmitry Gutov @ 2024-11-19 19:52 UTC (permalink / raw) To: Juri Linkov; +Cc: Eli Zaretskii, johan.myreen, emacs-devel On 19/11/2024 19:59, Juri Linkov wrote: >> +(defcustom treesit-enable-modes nil >> + "Non-nil to enable tree-sitter modes during Emacs's startup." >> + :type 'boolean >> + :version "31.1" >> + :set #'treesit-enable-modes--set) > This could support a list to enable ts-modes selectively, > e.g. (setq treesit-enable-modes '(elixir-ts-mode js-ts-mode)) > to not enable 'c-ts-mode', etc. Right, that's easy enough - a few extra lines of Lisp. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-19 17:59 ` Juri Linkov 2024-11-19 19:52 ` Dmitry Gutov @ 2024-11-20 16:47 ` Philip Kaludercic 2024-11-20 17:36 ` Juri Linkov 2024-11-20 18:07 ` Dmitry Gutov 1 sibling, 2 replies; 138+ messages in thread From: Philip Kaludercic @ 2024-11-20 16:47 UTC (permalink / raw) To: Juri Linkov; +Cc: Dmitry Gutov, Eli Zaretskii, johan.myreen, emacs-devel Juri Linkov <juri@linkov.net> writes: >> +(defvar treesit--mode-associations >> + '((javascript-mode . js-ts-mode ) >> + (c-or-c++-mode . c-or-c++-ts-mode) >> + (c-mode . c-ts-mode) >> + (c++-mode . c++-ts-mode) >> + ("\\.elixir\\'" . elixir-ts-mode) >> + ("\\.ex\\'" . elixir-ts-mode) >> + ("\\.go\\'" . go-ts-mode) >> + ;; And so on. >> + ;; Some info needed for interpreter-mode-alist as well. >> + )) >> + >> +(defcustom treesit-enable-modes nil >> + "Non-nil to enable tree-sitter modes during Emacs's startup." >> + :type 'boolean >> + :version "31.1" >> + :set #'treesit-enable-modes--set) > > This could support a list to enable ts-modes selectively, > e.g. (setq treesit-enable-modes '(elixir-ts-mode js-ts-mode)) > to not enable 'c-ts-mode', etc. I might have missed something, but how would that then differ from configuring `major-mode-remap-alist' appropriately? -- Philip Kaludercic on siskin ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-20 16:47 ` Philip Kaludercic @ 2024-11-20 17:36 ` Juri Linkov 2024-11-20 18:07 ` Dmitry Gutov 1 sibling, 0 replies; 138+ messages in thread From: Juri Linkov @ 2024-11-20 17:36 UTC (permalink / raw) To: Philip Kaludercic; +Cc: Dmitry Gutov, Eli Zaretskii, johan.myreen, emacs-devel >>> +(defvar treesit--mode-associations >>> + '((javascript-mode . js-ts-mode ) >>> + (c-or-c++-mode . c-or-c++-ts-mode) >>> + (c-mode . c-ts-mode) >>> + (c++-mode . c++-ts-mode) >>> + ("\\.elixir\\'" . elixir-ts-mode) >>> + ("\\.ex\\'" . elixir-ts-mode) >>> + ("\\.go\\'" . go-ts-mode) >>> + ;; And so on. >>> + ;; Some info needed for interpreter-mode-alist as well. >>> + )) >>> + >>> +(defcustom treesit-enable-modes nil >>> + "Non-nil to enable tree-sitter modes during Emacs's startup." >>> + :type 'boolean >>> + :version "31.1" >>> + :set #'treesit-enable-modes--set) >> >> This could support a list to enable ts-modes selectively, >> e.g. (setq treesit-enable-modes '(elixir-ts-mode js-ts-mode)) >> to not enable 'c-ts-mode', etc. > > I might have missed something, but how would that then differ from > configuring `major-mode-remap-alist' appropriately? Maybe because it would be a little easier to customize? But you are right, `major-mode-remap-alist' is already easy to use. And customizing it has much more predictable result than enabling ts-modes by loading .el files. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-20 16:47 ` Philip Kaludercic 2024-11-20 17:36 ` Juri Linkov @ 2024-11-20 18:07 ` Dmitry Gutov 1 sibling, 0 replies; 138+ messages in thread From: Dmitry Gutov @ 2024-11-20 18:07 UTC (permalink / raw) To: Philip Kaludercic, Juri Linkov; +Cc: Eli Zaretskii, johan.myreen, emacs-devel On 20/11/2024 18:47, Philip Kaludercic wrote: >>> +(defcustom treesit-enable-modes nil >>> + "Non-nil to enable tree-sitter modes during Emacs's startup." >>> + :type 'boolean >>> + :version "31.1" >>> + :set #'treesit-enable-modes--set) >> This could support a list to enable ts-modes selectively, >> e.g. (setq treesit-enable-modes '(elixir-ts-mode js-ts-mode)) >> to not enable 'c-ts-mode', etc. > I might have missed something, but how would that then differ from > configuring `major-mode-remap-alist' appropriately? Perhaps the potential to customize it like this would make it worth it: (setopt treesit-enable-nodes '(not c-ts-mode)) Similar to the syntax in font-lock-global-modes. I'm certainly happy to keep the feature set minimum, though. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-04 19:18 ` Eli Zaretskii 2024-11-04 20:59 ` Dmitry Gutov @ 2024-11-05 13:21 ` Dr. Arne Babenhauserheide 2024-11-05 13:47 ` Eli Zaretskii 1 sibling, 1 reply; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-11-05 13:21 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Dmitry Gutov, johan.myreen, emacs-devel [-- Attachment #1: Type: text/plain, Size: 1179 bytes --] Eli Zaretskii <eliz@gnu.org> writes: >> > Without the user's say-so, this could be considered a nuisance. Why >> > should Emacs annoy a user with some potential feature when the user >> > didn't say she wants to use it? >> >> Could be considered a nuisance, or a boon. > > See above: we've been there already, and we know it isn't a boon. Thank you for making sure that Emacs doesn’t suddenly cause problems! Though I think the disagreement hints that there’s something more general that’s not as good as it could be: discoverability. For keybindings, which-key-mode mostly solves that for me. But I don’t know a way to finding that there’s a feature that could help me isn’t better. Tools like IntelliJ show (annoying) information toast messages. I don’t know a good way for Emacs yet. But Emacs might benefit from getting an unobtrusive way to inform users about more advanced options to solve their tasks. Maybe that could also be a thirdparty package: recommendations where different people can show their different opinions. Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-05 13:21 ` Dr. Arne Babenhauserheide @ 2024-11-05 13:47 ` Eli Zaretskii 2024-11-05 16:52 ` Dr. Arne Babenhauserheide 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-05 13:47 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: dmitry, johan.myreen, emacs-devel > From: "Dr. Arne Babenhauserheide" <arne_bab@web.de> > Cc: Dmitry Gutov <dmitry@gutov.dev>, johan.myreen@gmail.com, > emacs-devel@gnu.org > Date: Tue, 05 Nov 2024 14:21:36 +0100 > > Though I think the disagreement hints that there’s something more > general that’s not as good as it could be: discoverability. Discoverability doesn't mean the things need to be in my face. It means they are easy to discover _when_I_need_them_. Nothing else will work well in a package such as Emacs with thousands of features. In order to be able to discover stuff in Emacs, I need at least to know what I'm looking for. I need to know to ask the questions. If I know to ask the right questions and use the right words, then the built-in documentation has several commands which will make discoverability easy. (If they don't, please report specific bugs.) But if I don't even know to ask the questions, I need to try, or to guess, or to use some clever search engine, or just wait for that TIL day to come. > For keybindings, which-key-mode mostly solves that for me. which-key-mode will not help you discover key bindings of packages you haven't loaded into your session. So various optional features that define useful key bindings will not be discoverable that way. For example, if you type "C-c", which-key-mode will not tell you about key bindings of, say, Outline mode, unless that mode is already activated. > But I don’t know a way to finding that there’s a feature that could > help me isn’t better. Emacs has several Help commands specifically designed to ease discoverability. Take a look at the beginning of the Help chapter in the Emacs user manual, where these facilities are described. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-05 13:47 ` Eli Zaretskii @ 2024-11-05 16:52 ` Dr. Arne Babenhauserheide 2024-11-05 17:22 ` Eli Zaretskii 0 siblings, 1 reply; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-11-05 16:52 UTC (permalink / raw) To: Eli Zaretskii; +Cc: dmitry, johan.myreen, emacs-devel [-- Attachment #1: Type: text/plain, Size: 1611 bytes --] Eli Zaretskii <eliz@gnu.org> writes: >> Though I think the disagreement hints that there’s something more >> general that’s not as good as it could be: discoverability. > > Discoverability doesn't mean the things need to be in my face. It > means they are easy to discover _when_I_need_them_. That’s what I also wish for, yes. >> For keybindings, which-key-mode mostly solves that for me. > > which-key-mode will not help you discover key bindings of packages you > haven't loaded into your session. Fully agreed. It’s a hint for possible solutions, not a solution to discoverability of packages. >> But I don’t know a way to finding that there’s a feature that could >> help me isn’t better. > > Emacs has several Help commands specifically designed to ease > discoverability. Take a look at the beginning of the Help chapter in > the Emacs user manual, where these facilities are described. C-h p is neat! (I didn’t know about it — thank you!) Most packages it shows me are built-in. Do I guess it right that the reason is that most elpa and melpa packages don’t use package keywords? If yes, that would give a clear way forward to improve discoverability that does not depend on the core development team: file pull-requests with packages to include the matching keywords. That would be a nice task for a collaborative Emacs user hackathon. Is there something similar for file-extensions? I did not find that in the help page of the manual. Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-05 16:52 ` Dr. Arne Babenhauserheide @ 2024-11-05 17:22 ` Eli Zaretskii 2024-11-05 17:49 ` Philip Kaludercic 0 siblings, 1 reply; 138+ messages in thread From: Eli Zaretskii @ 2024-11-05 17:22 UTC (permalink / raw) To: Dr. Arne Babenhauserheide, Philip Kaludercic Cc: dmitry, johan.myreen, emacs-devel > From: "Dr. Arne Babenhauserheide" <arne_bab@web.de> > Cc: dmitry@gutov.dev, johan.myreen@gmail.com, emacs-devel@gnu.org > Date: Tue, 05 Nov 2024 17:52:24 +0100 > > C-h p is neat! (I didn’t know about it — thank you!) > > Most packages it shows me are built-in. Do I guess it right that the > reason is that most elpa and melpa packages don’t use package keywords? I don't know. Maybe Philip (CC'ed) does. > Is there something similar for file-extensions? You mean, find a mode that handles files of certain extensions? No, I don't think so. But I also don't really understand why you'd need that, since the appropriate mode will be turned on automatically when you visit such a file. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-05 17:22 ` Eli Zaretskii @ 2024-11-05 17:49 ` Philip Kaludercic 2024-11-05 19:23 ` Dr. Arne Babenhauserheide 0 siblings, 1 reply; 138+ messages in thread From: Philip Kaludercic @ 2024-11-05 17:49 UTC (permalink / raw) To: Eli Zaretskii Cc: Dr. Arne Babenhauserheide, dmitry, johan.myreen, emacs-devel Eli Zaretskii <eliz@gnu.org> writes: >> From: "Dr. Arne Babenhauserheide" <arne_bab@web.de> >> Cc: dmitry@gutov.dev, johan.myreen@gmail.com, emacs-devel@gnu.org >> Date: Tue, 05 Nov 2024 17:52:24 +0100 >> >> C-h p is neat! (I didn’t know about it — thank you!) >> >> Most packages it shows me are built-in. Do I guess it right that the >> reason is that most elpa and melpa packages don’t use package keywords? > > I don't know. Maybe Philip (CC'ed) does. I wouldn't say most, according (let ((count 0)) (dolist (desc package-archive-contents) (unless (package-desc--keywords (cadr desc)) (message "Keyword for %s" (car desc)) (cl-incf count))) (/ (float count) (length package-archive-contents))) it is about 20%, which is more than I assumed, but certainly not a rule. What I think is the issue here is that finder only lists installed packages, which would explain why most are built-in. A different issue is that not all packages use keywords that are listed under `finder-known-keywords'. >> Is there something similar for file-extensions? Do you mean suggestions for packages based on file extension? I wrote up a draft for something like that a while back but never got around to finishing it. If you want to, I can try to create a scratch/ branch in emacs.git to make it easier to try it out? > You mean, find a mode that handles files of certain extensions? No, I > don't think so. But I also don't really understand why you'd need > that, since the appropriate mode will be turned on automatically when > you visit such a file. -- Philip Kaludercic on siskin ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-05 17:49 ` Philip Kaludercic @ 2024-11-05 19:23 ` Dr. Arne Babenhauserheide 2024-11-06 0:09 ` Philip Kaludercic 0 siblings, 1 reply; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-11-05 19:23 UTC (permalink / raw) To: Philip Kaludercic; +Cc: Eli Zaretskii, dmitry, johan.myreen, emacs-devel [-- Attachment #1: Type: text/plain, Size: 573 bytes --] Philip Kaludercic <philipk@posteo.net> writes: > Eli Zaretskii <eliz@gnu.org> writes: >>> Is there something similar for file-extensions? > > Do you mean suggestions for packages based on file extension? That’ss what I mean, yes. > I wrote up a draft for something like that a while back but never got > around to finishing it. If you want to, I can try to create a scratch/ > branch in emacs.git to make it easier to try it out? That would be nice! Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-05 19:23 ` Dr. Arne Babenhauserheide @ 2024-11-06 0:09 ` Philip Kaludercic 2024-11-06 9:35 ` Dr. Arne Babenhauserheide 0 siblings, 1 reply; 138+ messages in thread From: Philip Kaludercic @ 2024-11-06 0:09 UTC (permalink / raw) To: Dr. Arne Babenhauserheide Cc: Eli Zaretskii, dmitry, johan.myreen, emacs-devel "Dr. Arne Babenhauserheide" <arne_bab@web.de> writes: > Philip Kaludercic <philipk@posteo.net> writes: > >> Eli Zaretskii <eliz@gnu.org> writes: >>>> Is there something similar for file-extensions? >> >> Do you mean suggestions for packages based on file extension? > > That’ss what I mean, yes. > >> I wrote up a draft for something like that a while back but never got >> around to finishing it. If you want to, I can try to create a scratch/ >> branch in emacs.git to make it easier to try it out? > > That would be nice! I have pushed some code to feature/package-autosuggest after cleaning it up a bit. The main issues right now are 1. that when clicking on the suggestion to install a new package via the button in the major mode, the UI wants to confirm this by pressing enter in the minibuffer which is not automatically suggested 2. that the database of suggestions isn't populated properly. I'll probably write a script to scrape ELPA for suggestions and generate them in the right format. > > Best wishes, > Arne -- Philip Kaludercic on siskin ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-06 0:09 ` Philip Kaludercic @ 2024-11-06 9:35 ` Dr. Arne Babenhauserheide 2024-11-06 9:59 ` Philip Kaludercic 2024-11-07 14:16 ` Automatic Suggestion of Packages Philip Kaludercic 0 siblings, 2 replies; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-11-06 9:35 UTC (permalink / raw) To: Philip Kaludercic; +Cc: Eli Zaretskii, dmitry, johan.myreen, emacs-devel [-- Attachment #1: Type: text/plain, Size: 711 bytes --] Philip Kaludercic <philipk@posteo.net> writes: > I have pushed some code to feature/package-autosuggest after cleaning it > up a bit. The main issues right now are 1. that when clicking on the > suggestion to install a new package via the button in the major mode, > the UI wants to confirm this by pressing enter in the minibuffer which > is not automatically suggested 2. that the database of suggestions isn't > populated properly. I'll probably write a script to scrape ELPA for > suggestions and generate them in the right format. Thank you! Is the modeline indicating option clickable? Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-11-06 9:35 ` Dr. Arne Babenhauserheide @ 2024-11-06 9:59 ` Philip Kaludercic 2024-11-07 14:16 ` Automatic Suggestion of Packages Philip Kaludercic 1 sibling, 0 replies; 138+ messages in thread From: Philip Kaludercic @ 2024-11-06 9:59 UTC (permalink / raw) To: Dr. Arne Babenhauserheide Cc: Eli Zaretskii, dmitry, johan.myreen, emacs-devel Yes. But I have to adjust it so that if you click on it, a GUI confirmation can be displayed. On 6 November 2024 10:35:33 CET, "Dr. Arne Babenhauserheide" <arne_bab@web.de> wrote: >Philip Kaludercic <philipk@posteo.net> writes: > >> I have pushed some code to feature/package-autosuggest after cleaning it >> up a bit. The main issues right now are 1. that when clicking on the >> suggestion to install a new package via the button in the major mode, >> the UI wants to confirm this by pressing enter in the minibuffer which >> is not automatically suggested 2. that the database of suggestions isn't >> populated properly. I'll probably write a script to scrape ELPA for >> suggestions and generate them in the right format. > >Thank you! > >Is the modeline indicating option clickable? > >Best wishes, >Arne -- Sent from my phone. Please excuse my brevity and bad formatting. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Automatic Suggestion of Packages 2024-11-06 9:35 ` Dr. Arne Babenhauserheide 2024-11-06 9:59 ` Philip Kaludercic @ 2024-11-07 14:16 ` Philip Kaludercic 2024-11-07 16:07 ` Visuwesh 2024-11-11 20:07 ` Mekeor Melire 1 sibling, 2 replies; 138+ messages in thread From: Philip Kaludercic @ 2024-11-07 14:16 UTC (permalink / raw) To: Dr. Arne Babenhauserheide Cc: Eli Zaretskii, dmitry, johan.myreen, emacs-devel "Dr. Arne Babenhauserheide" <arne_bab@web.de> writes: > Philip Kaludercic <philipk@posteo.net> writes: > >> I have pushed some code to feature/package-autosuggest after cleaning it >> up a bit. The main issues right now are 1. that when clicking on the >> suggestion to install a new package via the button in the major mode, >> the UI wants to confirm this by pressing enter in the minibuffer which >> is not automatically suggested 2. that the database of suggestions isn't >> populated properly. I'll probably write a script to scrape ELPA for >> suggestions and generate them in the right format. > > Thank you! > > Is the modeline indicating option clickable? If it is useful, I have made a little screen-recording of how the feature looks like as of current state on feature/package-autosuggest: https://spectra.video/w/e93b3XqNzN6yXucZbNnu7c I have copied the approach used by `gnu-elpa' to scrape the autoload files of ELPA packages to gather suggestions. You can find the database here: https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/package-autosuggest.eld?h=feature/package-autosuggest > Best wishes, > Arne -- Philip Kaludercic on siskin ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: Automatic Suggestion of Packages 2024-11-07 14:16 ` Automatic Suggestion of Packages Philip Kaludercic @ 2024-11-07 16:07 ` Visuwesh 2024-11-07 21:50 ` Philip Kaludercic 2024-11-11 20:07 ` Mekeor Melire 1 sibling, 1 reply; 138+ messages in thread From: Visuwesh @ 2024-11-07 16:07 UTC (permalink / raw) To: Philip Kaludercic Cc: Dr. Arne Babenhauserheide, Eli Zaretskii, dmitry, johan.myreen, emacs-devel [வியாழன் நவம்பர் 07, 2024] Philip Kaludercic wrote: > "Dr. Arne Babenhauserheide" <arne_bab@web.de> writes: > >> Philip Kaludercic <philipk@posteo.net> writes: >> >>> I have pushed some code to feature/package-autosuggest after cleaning it >>> up a bit. The main issues right now are 1. that when clicking on the >>> suggestion to install a new package via the button in the major mode, >>> the UI wants to confirm this by pressing enter in the minibuffer which >>> is not automatically suggested 2. that the database of suggestions isn't >>> populated properly. I'll probably write a script to scrape ELPA for >>> suggestions and generate them in the right format. >> >> Thank you! >> >> Is the modeline indicating option clickable? > > If it is useful, I have made a little screen-recording of how the > feature looks like as of current state on feature/package-autosuggest: > > https://spectra.video/w/e93b3XqNzN6yXucZbNnu7c Can we have an user option to both `message' the user and have a button in the mode-line? I usually don't notice changes in the mode-line often, but notice messages in the echo-area. Just having `message' would lose the convenient mode-line button to auto-install the suggested package. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: Automatic Suggestion of Packages 2024-11-07 16:07 ` Visuwesh @ 2024-11-07 21:50 ` Philip Kaludercic 2024-11-08 4:15 ` Visuwesh 0 siblings, 1 reply; 138+ messages in thread From: Philip Kaludercic @ 2024-11-07 21:50 UTC (permalink / raw) To: Visuwesh Cc: Dr. Arne Babenhauserheide, Eli Zaretskii, dmitry, johan.myreen, emacs-devel Visuwesh <visuweshm@gmail.com> writes: > [வியாழன் நவம்பர் 07, 2024] Philip Kaludercic wrote: > >> "Dr. Arne Babenhauserheide" <arne_bab@web.de> writes: >> >>> Philip Kaludercic <philipk@posteo.net> writes: >>> >>>> I have pushed some code to feature/package-autosuggest after cleaning it >>>> up a bit. The main issues right now are 1. that when clicking on the >>>> suggestion to install a new package via the button in the major mode, >>>> the UI wants to confirm this by pressing enter in the minibuffer which >>>> is not automatically suggested 2. that the database of suggestions isn't >>>> populated properly. I'll probably write a script to scrape ELPA for >>>> suggestions and generate them in the right format. >>> >>> Thank you! >>> >>> Is the modeline indicating option clickable? >> >> If it is useful, I have made a little screen-recording of how the >> feature looks like as of current state on feature/package-autosuggest: >> >> https://spectra.video/w/e93b3XqNzN6yXucZbNnu7c > > Can we have an user option to both `message' the user and have a button > in the mode-line? I usually don't notice changes in the mode-line > often, but notice messages in the echo-area. Just having `message' > would lose the convenient mode-line button to auto-install the suggested > package. We can do that, it might be worth discussing if the user option should be re-designed. The current styles of presenting suggestions are: 1. A button in the mode-line (default) 2. A message with a hint to use `package-autosuggest' (which I think is convenient enough) 3. A `yes-or-no-p'-prompt to install a package (either every time a suggestion is available or only once per package) I don't know if the last one makes sense to have, as it is pretty aggressive. Perhaps it makes sense to always present a message if the minor mode is enabled, and add a separate option to enable the mode-line button? -- Philip Kaludercic on siskin ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: Automatic Suggestion of Packages 2024-11-07 21:50 ` Philip Kaludercic @ 2024-11-08 4:15 ` Visuwesh 2024-11-08 4:29 ` Visuwesh 2024-11-08 14:02 ` Philip Kaludercic 0 siblings, 2 replies; 138+ messages in thread From: Visuwesh @ 2024-11-08 4:15 UTC (permalink / raw) To: Philip Kaludercic Cc: Dr. Arne Babenhauserheide, Eli Zaretskii, dmitry, johan.myreen, emacs-devel [வியாழன் நவம்பர் 07, 2024] Philip Kaludercic wrote: >> Can we have an user option to both `message' the user and have a button >> in the mode-line? I usually don't notice changes in the mode-line >> often, but notice messages in the echo-area. Just having `message' >> would lose the convenient mode-line button to auto-install the suggested >> package. > > We can do that, it might be worth discussing if the user option should > be re-designed. The current styles of presenting suggestions are: > > 1. A button in the mode-line (default) > 2. A message with a hint to use `package-autosuggest' (which I think is > convenient enough) > 3. A `yes-or-no-p'-prompt to install a package (either every time a > suggestion is available or only once per package) > > I don't know if the last one makes sense to have, as it is pretty > aggressive. Indeed, I agree that it feels very un-Emacsy to be up in the face like that. > Perhaps it makes sense to always present a message if the minor mode > is enabled, and add a separate option to enable the mode-line button? I would be happy with this (though I would turn the mode-line button on by default). ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: Automatic Suggestion of Packages 2024-11-08 4:15 ` Visuwesh @ 2024-11-08 4:29 ` Visuwesh 2024-11-08 14:02 ` Philip Kaludercic 1 sibling, 0 replies; 138+ messages in thread From: Visuwesh @ 2024-11-08 4:29 UTC (permalink / raw) To: Philip Kaludercic Cc: Dr. Arne Babenhauserheide, Eli Zaretskii, dmitry, johan.myreen, emacs-devel [வெள்ளி நவம்பர் 08, 2024] Visuwesh wrote: > [வியாழன் நவம்பர் 07, 2024] Philip Kaludercic wrote: > >>> Can we have an user option to both `message' the user and have a button >>> in the mode-line? I usually don't notice changes in the mode-line >>> often, but notice messages in the echo-area. Just having `message' >>> would lose the convenient mode-line button to auto-install the suggested >>> package. >> >> We can do that, it might be worth discussing if the user option should >> be re-designed. The current styles of presenting suggestions are: >> >> 1. A button in the mode-line (default) >> 2. A message with a hint to use `package-autosuggest' (which I think is >> convenient enough) >> 3. A `yes-or-no-p'-prompt to install a package (either every time a >> suggestion is available or only once per package) >> >> I don't know if the last one makes sense to have, as it is pretty >> aggressive. > > Indeed, I agree that it feels very un-Emacsy to be up in the face like > that. > >> Perhaps it makes sense to always present a message if the minor mode >> is enabled, and add a separate option to enable the mode-line button? > > I would be happy with this (though I would turn the mode-line button on > by default). BTW, I looked at the code to see what it does when there's multiple packages suggested for a single (e.g., racket: racket-mode and geiser-racket). It seems to install and enable only the first suggestion: should we instead prompt the user about it? But asking the user would defeat the purpose of the feature, which helps in assisting her in setting up her environment for her work. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: Automatic Suggestion of Packages 2024-11-08 4:15 ` Visuwesh 2024-11-08 4:29 ` Visuwesh @ 2024-11-08 14:02 ` Philip Kaludercic 2024-11-08 15:44 ` Visuwesh 1 sibling, 1 reply; 138+ messages in thread From: Philip Kaludercic @ 2024-11-08 14:02 UTC (permalink / raw) To: Visuwesh; +Cc: emacs-devel Visuwesh <visuweshm@gmail.com> writes: > [வியாழன் நவம்பர் 07, 2024] Philip Kaludercic wrote: > >>> Can we have an user option to both `message' the user and have a button >>> in the mode-line? I usually don't notice changes in the mode-line >>> often, but notice messages in the echo-area. Just having `message' >>> would lose the convenient mode-line button to auto-install the suggested >>> package. >> >> We can do that, it might be worth discussing if the user option should >> be re-designed. The current styles of presenting suggestions are: >> >> 1. A button in the mode-line (default) >> 2. A message with a hint to use `package-autosuggest' (which I think is >> convenient enough) >> 3. A `yes-or-no-p'-prompt to install a package (either every time a >> suggestion is available or only once per package) >> >> I don't know if the last one makes sense to have, as it is pretty >> aggressive. > > Indeed, I agree that it feels very un-Emacsy to be up in the face like > that. > >> Perhaps it makes sense to always present a message if the minor mode >> is enabled, and add a separate option to enable the mode-line button? > > I would be happy with this (though I would turn the mode-line button on > by default). The issue with enable-by-default in the current implementation is that we would have to load package.el by default, which is currently avoided to reduce the startup time (see `package-enable-at-startup'). We could extract the autosuggest logic into a separate file and suggest loading that by default. We could also consider not using the mode line, but the menu bar to hint at package suggestions, but that might be easy to miss especially if a lot of people advise disabling the menu bar. Visuwesh <visuweshm@gmail.com> writes: > [வெள்ளி நவம்பர் 08, 2024] Visuwesh wrote: > >> [வியாழன் நவம்பர் 07, 2024] Philip Kaludercic wrote: >> >>>> Can we have an user option to both `message' the user and have a button >>>> in the mode-line? I usually don't notice changes in the mode-line >>>> often, but notice messages in the echo-area. Just having `message' >>>> would lose the convenient mode-line button to auto-install the suggested >>>> package. >>> >>> We can do that, it might be worth discussing if the user option should >>> be re-designed. The current styles of presenting suggestions are: >>> >>> 1. A button in the mode-line (default) >>> 2. A message with a hint to use `package-autosuggest' (which I think is >>> convenient enough) >>> 3. A `yes-or-no-p'-prompt to install a package (either every time a >>> suggestion is available or only once per package) >>> >>> I don't know if the last one makes sense to have, as it is pretty >>> aggressive. >> >> Indeed, I agree that it feels very un-Emacsy to be up in the face like >> that. >> >>> Perhaps it makes sense to always present a message if the minor mode >>> is enabled, and add a separate option to enable the mode-line button? >> >> I would be happy with this (though I would turn the mode-line button on >> by default). > > BTW, I looked at the code to see what it does when there's multiple > packages suggested for a single (e.g., racket: racket-mode and > geiser-racket). It seems to install and enable only the first > suggestion: should we instead prompt the user about it? But asking the > user would defeat the purpose of the feature, which helps in assisting > her in setting up her environment for her work. No the current implementation would just install everything. Neither of the two solutions are really ideal. Perhaps we need to pop up a buffer with clickable elements to present the package suggestions and propose installing one of them? -- Philip Kaludercic on siskin ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: Automatic Suggestion of Packages 2024-11-08 14:02 ` Philip Kaludercic @ 2024-11-08 15:44 ` Visuwesh 2024-11-08 16:23 ` Philip Kaludercic 0 siblings, 1 reply; 138+ messages in thread From: Visuwesh @ 2024-11-08 15:44 UTC (permalink / raw) To: Philip Kaludercic; +Cc: emacs-devel [வெள்ளி நவம்பர் 08, 2024] Philip Kaludercic wrote: >>> [...] >>> Perhaps it makes sense to always present a message if the minor mode >>> is enabled, and add a separate option to enable the mode-line button? >> >> I would be happy with this (though I would turn the mode-line button on >> by default). > > The issue with enable-by-default in the current implementation is that > we would have to load package.el by default, which is currently avoided > to reduce the startup time (see `package-enable-at-startup'). I see. > > We could extract the autosuggest logic into a separate file and suggest > loading that by default. > > We could also consider not using the mode line, but the menu bar to hint > at package suggestions, but that might be easy to miss especially if a > lot of people advise disabling the menu bar. That is a good idea too. >> BTW, I looked at the code to see what it does when there's multiple >> packages suggested for a single (e.g., racket: racket-mode and >> geiser-racket). It seems to install and enable only the first >> suggestion: should we instead prompt the user about it? But asking the >> user would defeat the purpose of the feature, which helps in assisting >> her in setting up her environment for her work. > > No the current implementation would just install everything. Neither of > the two solutions are really ideal. Perhaps we need to pop up a buffer > with clickable elements to present the package suggestions and propose > installing one of them? It would help the user decide between the packages if some kind of popularity metric is shown. If they cannot decide between the options, they could at least pick the most popular one and go with that. I think the current one shown in the GNU ELPA website should be sufficient for most cases. Although I dislike the idea myself personally, "last updated time" might be a good indication too. [ I dislike it because stable packages don't need to get updated. After all, they just work. ] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: Automatic Suggestion of Packages 2024-11-08 15:44 ` Visuwesh @ 2024-11-08 16:23 ` Philip Kaludercic 0 siblings, 0 replies; 138+ messages in thread From: Philip Kaludercic @ 2024-11-08 16:23 UTC (permalink / raw) To: Visuwesh; +Cc: emacs-devel Visuwesh <visuweshm@gmail.com> writes: > [வெள்ளி நவம்பர் 08, 2024] Philip Kaludercic wrote: > >>>> [...] >>>> Perhaps it makes sense to always present a message if the minor mode >>>> is enabled, and add a separate option to enable the mode-line button? >>> >>> I would be happy with this (though I would turn the mode-line button on >>> by default). >> >> The issue with enable-by-default in the current implementation is that >> we would have to load package.el by default, which is currently avoided >> to reduce the startup time (see `package-enable-at-startup'). > > I see. > >> >> We could extract the autosuggest logic into a separate file and suggest >> loading that by default. >> >> We could also consider not using the mode line, but the menu bar to hint >> at package suggestions, but that might be easy to miss especially if a >> lot of people advise disabling the menu bar. > > That is a good idea too. > >>> BTW, I looked at the code to see what it does when there's multiple >>> packages suggested for a single (e.g., racket: racket-mode and >>> geiser-racket). It seems to install and enable only the first >>> suggestion: should we instead prompt the user about it? But asking the >>> user would defeat the purpose of the feature, which helps in assisting >>> her in setting up her environment for her work. >> >> No the current implementation would just install everything. Neither of >> the two solutions are really ideal. Perhaps we need to pop up a buffer >> with clickable elements to present the package suggestions and propose >> installing one of them? > > It would help the user decide between the packages if some kind of > popularity metric is shown. If they cannot decide between the options, > they could at least pick the most popular one and go with that. I think > the current one shown in the GNU ELPA website should be sufficient for > most cases. > Although I dislike the idea myself personally, "last updated time" might > be a good indication too. [ I dislike it because stable packages don't > need to get updated. After all, they just work. ] AFAIK we don't currently expose the ranking information via some API, but that might change in the future. Last updated has advantages and disadvantages that one should be weary of (a stable package might be seldom updated and a newer package more frequently as it is trying to become more mature). The core of the problem to me seems that we have situations where a file extensions might be used by multiple languages (as is currently the situation with Perl and Prolog, both commonly using ".p"). Assuming these were ELPA packages and not-built-in, we could try to combine the data, e.g. if the interpreter and the file name agree, only the propose Perl and not Prolog. Yet it is probably the safest option to engage human judgement and present the options, in a simple menu listing package names, their summaries and a button to install the package. Based on what I am imagining, the complementary issue that you mention, "racket-mode" vs "geiser-racket" would pop up a buffer that would look something this: --8<---------------cut here---------------start------------->8--- There are multiple package suggestions based on the available information: - "racket-mode" [install] Racket editing, REPL, and more Suggested due to: file name matching \.rkt\', the interpreter matching "racket". - "geiser-racket" [install] Support for Racket in Geiser Suggested due to: file name matching \.rkt\' --8<---------------cut here---------------end--------------->8--- -- Philip Kaludercic on siskin ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: Automatic Suggestion of Packages 2024-11-07 14:16 ` Automatic Suggestion of Packages Philip Kaludercic 2024-11-07 16:07 ` Visuwesh @ 2024-11-11 20:07 ` Mekeor Melire 2024-11-12 3:00 ` Philip Kaludercic 1 sibling, 1 reply; 138+ messages in thread From: Mekeor Melire @ 2024-11-11 20:07 UTC (permalink / raw) To: emacs-devel Thanks, Philip, for working on this feature. As far as I can tell, your code is based on this workflow: Emacs maintainers regularly locally build GNU Elpa as well as NonGNU Elpa. They run the admin/scrape-elpa.el script which updates the package-autosuggest.eld file that is part of the Emacs Git repository. They review the changes and commit them. This has some disadvantages: It is quiet some work for the core Emacs maintainers: They need to judge if a package is a valid package for a certain file. Only GNU and NonGNU Elpa packages are respected; other package archives are not. Changes to the package-autosuggest.eld file would not reach end-users until another Emacs release. More generally, I have the impression that this is not the right place to implement this feature. I think every package should be able to suggest itself for certain file extensions (or even file beginnings or endings like magic-mode-alist). I suggest to introduce a new package header similar to these: ;; Covered-File-Extensions: ("\\.c$" "\\.h$") ;; Covered-Magic-Beginnings: ("^#!/bin/sh") These headers would become part of the package structure and would be distributed by package archives and would end on the end-users' local device. In particular, if you have Melpa set up locally, you would be able to find out which Melpa-packages cover .c extensions by filtering your local package list accordingly. This, of course, is much more work; but it seems to be the right thing to do, to me. What do you think? ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: Automatic Suggestion of Packages 2024-11-11 20:07 ` Mekeor Melire @ 2024-11-12 3:00 ` Philip Kaludercic 0 siblings, 0 replies; 138+ messages in thread From: Philip Kaludercic @ 2024-11-12 3:00 UTC (permalink / raw) To: Mekeor Melire; +Cc: emacs-devel Mekeor Melire <mekeor@posteo.de> writes: > Thanks, Philip, for working on this feature. > > As far as I can tell, your code is based on this workflow: Emacs > maintainers regularly locally build GNU Elpa as well as NonGNU > Elpa. They run the admin/scrape-elpa.el script which updates the > package-autosuggest.eld file that is part of the Emacs Git > repository. They review the changes and commit them. Right. > This has some disadvantages: It is quiet some work for the core Emacs > maintainers: They need to judge if a package is a valid package for a > certain file. This is true, but it would usually be the ELPA maintainers that update package-autosuggest.eld anyway, and I hope it should be manageable to just review the diff. > Only GNU and NonGNU Elpa packages are respected; other > package archives are not. Changes to the package-autosuggest.eld file > would not reach end-users until another Emacs release. These are valid points, though not unsubstantiated. Restricting the packages to {,Non}GNU ELPA is intentional, as all users should have these archives configured (unless they intentionally disabled them, which is unusual AFAIK). These packages should also align with Emacs free-software policy, to ensure that a upfront suggestion to install a package respects user-freedom. That being said, there have been discussions to update the package.el-API (the "archive-contents" file), in which case we could consider providing package suggestions. In that case I would like to add an option to filter what archives are allowed to make suggestions (following the above logic, this would be set to the ELPAs by default, but the user could add personal or third-party if they wish to the list). > More generally, I have the impression that this is not the right place > to implement this feature. I think every package should be able to > suggest itself for certain file extensions (or even file beginnings or > endings like magic-mode-alist). I suggest to introduce a new package > header similar to these: > > ;; Covered-File-Extensions: ("\\.c$" "\\.h$") > ;; Covered-Magic-Beginnings: ("^#!/bin/sh") > > These headers would become part of the package structure and would be > distributed by package archives and would end on the end-users' local > device. In particular, if you have Melpa set up locally, you would be > able to find out which Melpa-packages cover .c extensions by filtering > your local package list accordingly. > > This, of course, is much more work; but it seems to be the right thing > to do, to me. What do you think? The main issue is that we wouldn't have anything to work with right away. We could consider this in the future (along with the updated API idea, where archives could decide on how to implement this on their own), but my question is wouldn't these archives coincide with autoloaded `add-to-list' expressions? When would a package hint that it could be useful for .foo-files, but not update `auto-mode-alist'? The headers might be interesting to hint different priorities, so as to differentiate between something as foundational as a major mode and something nice-to-have like a minor-mode or a set of commands. -- Philip Kaludercic on siskin ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-13 9:37 ` Dmitry Gutov 2024-10-13 10:39 ` Eli Zaretskii @ 2024-10-13 10:52 ` Dr. Arne Babenhauserheide 1 sibling, 0 replies; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-13 10:52 UTC (permalink / raw) To: Dmitry Gutov; +Cc: Eli Zaretskii, johan.myreen, emacs-devel [-- Attachment #1: Type: text/plain, Size: 524 bytes --] Dmitry Gutov <dmitry@gutov.dev> writes: > On 13/10/2024 07:41, Eli Zaretskii wrote: >> And yes, I would like to hear from more people what they think about >> the possible behaviors in these cases, including how to handle missing >> grammar libraries. > > Everybody's welcome to chime in. Since the grammar libraries are compiled code: is automatically downloading them a risk of remote code execution errors? Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 3:30 ` Richard Stallman 2024-10-09 6:48 ` Dr. Arne Babenhauserheide 2024-10-09 11:09 ` Johan Myréen @ 2024-10-10 13:58 ` Richard Stallman 2024-10-10 14:45 ` Dr. Arne Babenhauserheide 2 siblings, 1 reply; 138+ messages in thread From: Richard Stallman @ 2024-10-10 13:58 UTC (permalink / raw) To: emacs-devel [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > We generally try to make all sorts of packages for various uses of > Emacs coexist in a single Emacs job. I get the impression people are > assuming that these different configurations are mutually incompatible, > so that it is necessary to choose which one to install. > Is that what people assume? If people do, why so? Why can't > users select one at run time? In general we make it possible for a single Emacs job to contain various different configurations at the same time, and the user can switch between them, Usually it is controlled by which buffer is current. Am I right in thinking that Spacemacs and Doom require the user to choose at an earlier stage? Or did the descriptions posted here give me the wrong impression? If I understood that point correctly, is there any inherent reason why we could not in Emacs offer the sorts of configurations that Spacemacs and Doom do, but designed such that they can coexist in a single Emacs job, perhaps with the current buffer controlling which one is active? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-10 13:58 ` Richard Stallman @ 2024-10-10 14:45 ` Dr. Arne Babenhauserheide 2024-10-12 3:19 ` Richard Stallman 0 siblings, 1 reply; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-10 14:45 UTC (permalink / raw) To: Richard Stallman; +Cc: emacs-devel [-- Attachment #1: Type: text/plain, Size: 707 bytes --] Richard Stallman <rms@gnu.org> writes: > Am I right in thinking that Spacemacs and Doom require the > user to choose at an earlier stage? Or did the descriptions > posted here give me the wrong impression? At least Doom provides collections of packages for specific tasks. That way it’s a bit more abstract — but maintenance of parts of the configuration is shifted from the user to Doom. The downside of that is that a friend who used it regularly complained that after updating Doom, the configuration was broken, so I do not think that just copying that model would be a good idea. Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-10 14:45 ` Dr. Arne Babenhauserheide @ 2024-10-12 3:19 ` Richard Stallman 0 siblings, 0 replies; 138+ messages in thread From: Richard Stallman @ 2024-10-12 3:19 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: emacs-devel [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > The downside of that is that a friend who used it regularly complained > that after updating Doom, the configuration was broken, so I do not > think that just copying that model would be a good idea. I'm simply trying to clarify what sort of feature we are aiming for. How to implement it would ne the next question, and since I don't know anything about how Doom implements it, I am not arguing for or against using the same approach. Once we have it clear what features we want, we can come up with a good implementation. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: Re: An anonymous IRC user's opinion @ 2024-10-06 5:31 Pedro Andres Aranda Gutierrez 2024-10-06 6:04 ` Emanuel Berg 2024-10-06 9:06 ` Dr. Arne Babenhauserheide 0 siblings, 2 replies; 138+ messages in thread From: Pedro Andres Aranda Gutierrez @ 2024-10-06 5:31 UTC (permalink / raw) To: emacs-devel [-- Attachment #1: Type: text/plain, Size: 1361 bytes --] > Message: 2 > Date: Fri, 04 Oct 2024 20:10:44 +0200 > From: "Dr. Arne Babenhauserheide" <arne_bab@web.de> > To: Eduardo Ochs <eduardoochs@gmail.com> > Cc: Jordi Gutiérrez Hermoso <jordigh@octave.org>, Emacs development > discussions <emacs-devel@gnu.org> > Message-ID: <87y133u4bf.fsf@web.de> > Content-Type: text/plain; charset="utf-8" > Arne writes: > Eduardo Ochs <eduardoochs@gmail.com> writes: >> is that I don't know how it would be developed and what its prototypes >> would look like... >... > On distributions that may mean providing meta-packages which install > required elpa-packages and are started from a script that prepares a > $HOME/.emacs.d/ for the specific flavor of Emacs if it does not exist > already. > > Best wishes, > Arne > -- > Unpolitisch sein > heißt politisch sein, > ohne es zu merken. > draketo.de Greetings Isn't that what some Emacs "impersonations" are doing. You clone a git repo as your $HOME/.emacs.d and there you are. Look, for example at https://github.com/doomemacs/doomemacs#install My .02 €cents, /PA -- Fragen sind nicht da, um beantwortet zu werden, Fragen sind da um gestellt zu werden Georg Kreisler Headaches with a Juju log: unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run a leader-deposed hook here, but we can't yet [-- Attachment #2: Type: text/html, Size: 2270 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 5:31 Pedro Andres Aranda Gutierrez @ 2024-10-06 6:04 ` Emanuel Berg 2024-10-06 9:06 ` Dr. Arne Babenhauserheide 1 sibling, 0 replies; 138+ messages in thread From: Emanuel Berg @ 2024-10-06 6:04 UTC (permalink / raw) To: emacs-devel Pedro Andres Aranda Gutierrez wrote: > Isn't that what some Emacs "impersonations" are doing. > You clone a git repo as your $HOME/.emacs.d and there > you are. What do you mean, they are actually us? -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 5:31 Pedro Andres Aranda Gutierrez 2024-10-06 6:04 ` Emanuel Berg @ 2024-10-06 9:06 ` Dr. Arne Babenhauserheide 2024-10-06 9:10 ` Emanuel Berg ` (2 more replies) 1 sibling, 3 replies; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-06 9:06 UTC (permalink / raw) To: Pedro Andres Aranda Gutierrez; +Cc: emacs-devel [-- Attachment #1: Type: text/plain, Size: 831 bytes --] Pedro Andres Aranda Gutierrez <paaguti@gmail.com> writes: >> On distributions that may mean providing meta-packages which install >> required elpa-packages and are started from a script that prepares a >> $HOME/.emacs.d/ for the specific flavor of Emacs if it does not exist >> already. > Isn't that what some Emacs "impersonations" are doing. You clone a git repo as your $HOME/.emacs.d and there you are. > Look, for example at https://github.com/doomemacs/doomemacs#install Yes, those are pre-configured settings. Many already exist, but they are not organized, so most users don’t find them at the start of their journey, and they don’t necessarily coordinate to specialize for the task they do themselves. Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 9:06 ` Dr. Arne Babenhauserheide @ 2024-10-06 9:10 ` Emanuel Berg 2024-10-06 10:31 ` Pedro Andres Aranda Gutierrez 2024-10-13 3:29 ` Richard Stallman 2 siblings, 0 replies; 138+ messages in thread From: Emanuel Berg @ 2024-10-06 9:10 UTC (permalink / raw) To: emacs-devel Dr. Arne Babenhauserheide wrote: >>> On distributions that may mean providing meta-packages >>> which install required elpa-packages and are started from >>> a script that prepares a $HOME/.emacs.d/ for the specific >>> flavor of Emacs if it does not exist already. >> >> Isn't that what some Emacs "impersonations" are doing. >> You clone a git repo as your $HOME/.emacs.d and there you >> are. Look, for example at >> https://github.com/doomemacs/doomemacs#install > > Yes, those are pre-configured settings. > > Many already exist, but they are not organized, so most > users don't find them at the start of their journey, and > they don't necessarily coordinate to specialize for the task > they do themselves. We must formulate a theory regarding this and then adopt a policy which uses the same terminology :) -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 9:06 ` Dr. Arne Babenhauserheide 2024-10-06 9:10 ` Emanuel Berg @ 2024-10-06 10:31 ` Pedro Andres Aranda Gutierrez 2024-10-07 21:17 ` John ff 2024-10-13 3:29 ` Richard Stallman 2 siblings, 1 reply; 138+ messages in thread From: Pedro Andres Aranda Gutierrez @ 2024-10-06 10:31 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: emacs-devel Good point. A bit of organizing would help ;-) Enviado desde mi iPhone > El 6 oct 2024, a las 11:06, Dr. Arne Babenhauserheide <arne_bab@web.de> escribió: > > Pedro Andres Aranda Gutierrez <paaguti@gmail.com> writes: >>> On distributions that may mean providing meta-packages which install >>> required elpa-packages and are started from a script that prepares a >>> $HOME/.emacs.d/ for the specific flavor of Emacs if it does not exist >>> already. >> Isn't that what some Emacs "impersonations" are doing. You clone a git repo as your $HOME/.emacs.d and there you are. >> Look, for example at https://github.com/doomemacs/doomemacs#install > > Yes, those are pre-configured settings. > > Many already exist, but they are not organized, so most users don’t find > them at the start of their journey, and they don’t necessarily > coordinate to specialize for the task they do themselves. > > Best wishes, > Arne > -- > Unpolitisch sein > heißt politisch sein, > ohne es zu merken. > draketo.de > <signature.asc> ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 10:31 ` Pedro Andres Aranda Gutierrez @ 2024-10-07 21:17 ` John ff 0 siblings, 0 replies; 138+ messages in thread From: John ff @ 2024-10-07 21:17 UTC (permalink / raw) To: Pedro Andres Aranda Gutierrez Cc: Dr. Arne Babenhauserheide, Barra Ó Catháin via Emacs development discussions. On 6 Oct 2024, 11:34, at 11:34, Pedro Andres Aranda Gutierrez <paaguti@gmail.com> wrote: >Good point. A bit of organizing would help ;-) > >Enviado desde mi iPhone > >> El 6 oct 2024, a las 11:06, Dr. Arne Babenhauserheide ><arne_bab@web.de> escribió: >> >> Pedro Andres Aranda Gutierrez <paaguti@gmail.com> writes: >>>> On distributions that may mean providing meta-packages which >install >>>> required elpa-packages and are started from a script that prepares >a >>>> $HOME/.emacs.d/ for the specific flavor of Emacs if it does not >exist >>>> already. >>> Isn't that what some Emacs "impersonations" are doing. You clone a >git repo as your $HOME/.emacs.d and there you are. >>> Look, for example at https://github.com/doomemacs/doomemacs#install >> >> Yes, those are pre-configured settings. >> >> Many already exist, but they are not organized, so most users don’t >find >> them at the start of their journey, and they don’t necessarily >> coordinate to specialize for the task they do themselves. >> >> Best wishes, >> Arne >> -- >> Unpolitisch sein >> heißt politisch sein, >> ohne es zu merken. >> draketo.de >> <signature.asc> ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-06 9:06 ` Dr. Arne Babenhauserheide 2024-10-06 9:10 ` Emanuel Berg 2024-10-06 10:31 ` Pedro Andres Aranda Gutierrez @ 2024-10-13 3:29 ` Richard Stallman 2 siblings, 0 replies; 138+ messages in thread From: Richard Stallman @ 2024-10-13 3:29 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: emacs-devel [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] Does each of the variant Emacs vesions, such as Spacemavcs and Doom, customize a set of options ab initio, regardless of what sort of of text you are editing? If so, I have an idea for how Emacs could help a user try each of those ccllections of customizations. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) ^ permalink raw reply [flat|nested] 138+ messages in thread
* An anonymous IRC user's opinion @ 2024-10-01 20:09 Jordi Gutiérrez Hermoso 2024-10-04 16:25 ` Eduardo Ochs 2024-10-10 0:22 ` chad 0 siblings, 2 replies; 138+ messages in thread From: Jordi Gutiérrez Hermoso @ 2024-10-01 20:09 UTC (permalink / raw) To: Emacs development discussions I was asked to relay this from an anonymous IRC user. The words below are not mine. I, Jordi, did not write this. Someone wanted to post this anonymously to emacs-devel, and I'm doing it on their behalf. Thanks, Jordi ------------------------------------------------------------------------------ I discovered emacs recently through david wilson videos, I configured emacs from scratch, and I wish I knew what emacs is or what it can do long time ago, I want to share with you my experience as a new user as I hope this will help you in some way or another, and to propose something. I always had on my mind that emacs is yet another editor/IDE, and on top of that is very complicated and very special to use, and on top of that it does many things at the same time. All these things, plus the ease of use of other choices, plus the lack of time to dig into emacs, made me always chose quick alternatives, and I ended up using many editors/IDEs but never tried emacs. Until I saw david videos, then I understood what emacs really is. The complexity of emacs first configuration did not discouraged me at all knowing that I will have a working setup at the end that I needed, and if needed too I can add more setups later, and I can even hack emacs if also needed. I can tell you about the endless debugging of the init file for even the smallest error (without any clear diagnostic about the error), and I can tell you all the times I lost many works when doing "undo" because I did not know that emacs is not like any other editor out there, until I searched on the internet for this "new" behavior which I thought it was a bug, and then tried to stick with it for some time, until I discovered undo-tree, and this list goes on and on and on...I think you all know that and all went through the same very long path. So I was wondering why emacs is like this and why it is difficult to configure and make it run quickly, at least to test it if it suites someone needs, before diving deeper inside. it is the oldest out there, yet it is still the most difficult to start with. For example, some years ago I had to work on a small typescript project, I quickly found vscode. I downloaded it in 5min, and it took me 5 clicks to install a plugin. and then I had a working typescript setup. And then I used vscode like I if I had been using it for a long time, whereas it was my first time. Other than this example I can give a lot of the same experiences, so I can easily imagine how many people out there are easily diverged from emacs. Another point is that I wanted to share my discovery with my surrounding, and setup emacs for them so they can start using it. If I want to encourage them to use it and read the manual, and live the same experience I had to configure emacs, they would have cursed me forever, and this is not even possible for non-dev people, and if I want to make the configurations myself for each scenario, It will take me forever, and even for some scenarios I need to know if this is possible or not and discover new customizations/packages/etc. The first thing I thought about is a pre-configured init file for each scenario, that people can easily shared/distribute, but I quickly thought it was a very bad idea. so I asked my question on #systemcrafters IRC channel, and someone pointed me to this link https://emacs.amodernist.com/ which I think is a very good start and the nearest answer to what I was going to propose, thought it has many drawbacks, for example user will not understand what is going on and why he needs to go to a different site to config a software that he installed locally on his machine, and what he needs to do next to relate the config to emacs, what an init file is, and even user may not trust a foreign website to generate code for him to run on his machine, user also tends to escape any long "boring" reading material, etc. What I am proposing is to make this possible in emacs or at least in a trustworthy environment in an easy, quick and attractive way. I am not proposing to change anything in emacs, but to add a new separate feature which I think is very useful. To Make emacs up and running with a useful configuration in a reasonable time, for almost every situation/scenario for everybody. I am also not asking to change emacs defaults, every user will have the configuration he wants/needs. For example: I am a prof and I want to edit org markup only. (I dont need anything else) I am a writer or I write a lot: articles, books, blogs, mails, I need dictionary auto-complete + spellchecking only (nothing else) I am a c++ dev and I need to quickly work on a small c++ project. (nothing else) I am a school teacher, and I need to organize some stuff with org agenda only. (nothing else) I am a scientist, and I need to write some formal documents and share them in different formats. (nothing else) I am a student and I need to take notes in a zettelkasten style (nothing else) I need an IRC client (nothing else) I am an emacs user, I already configured emacs for myself using this feature, and now I also need to configure emacs with one of the above scenarios for my sister, my brother, my parent, my friend, my neighbor, my college, my coworker, my teacher, my student, etc. I think many of you one day found themselves in a similar situation. There are countless use cases out there, and emacs can cover almost anything for anybody. Many of emacs hackers may end up using it for many things, but new users would discover/start using emacs for one thing (which they actually need at the moment) and later they will use it for another thing, yet another thing, yet another thing... if needed. I am not necessary asking this feature to be added to emacs itself, it can be a separate GNU ELPA package project (to start with before maybe adding it to emacs later), but as you will see below, I think it is better to be part of emacs. I have an idea of the implementation, but I hope it will not distract you from the main idea above. I am giving you the implementation so you can better understand what I am talking about (no more). It is then up to you to decide if this is feasible or not, and if this implementation is pointing in the right direction or not. So this is just an implementation detail, and only the main idea above should be retained. This can be implemented by for example having as first page an attractive org file, which introduces user to emacs vocabulary/environment in a very short words and time (5 to 10min), by for example clicking on some org links like: [[elisp:(call a function to color the modeline)][Click here to see the modeline]] [[elisp:(call a function to color the echo area)][Click here to see the echo area]] [[elisp:(call a function to color the minibuffer)][Click here to see the minibuffer]] [[elisp:(call a function to color the minibuffer)][Click here to open a window on the right]] etc... and the same goes for the toolbar, menubar, buffer, window, frame, message buffer, error buffer, and only things the user need to know to start using emacs, nothing else, only vital things, not to overwhelm or discourage user. For example users should not be introduced to keybindings at this stage, they are not vital to use emacs, they complicate things for user and may discourage him, he only need to use copy/paste and undo/redo which are universal, and the menubar is fair enough for everyone just like any other software (the menubar already contains keybindings to be discovered, yes emacs is very well done). Then there is a link that say for example "Start configuring emacs", which is basicaly a Q&A config style: Do you want to try emacs undo style or use undo/redo style ? Do you want to use emacs undo keys or use ctrl-z/ctrl-shift-z undo/redo keys(cua) ? Do you want to auto-save modified file in emacs ? yes/no Do you to backup files edited in emacs ? yes/no Do you want to save/remember the windows positions ? yes/no Do you want to save/remember the cursor position in visited files ? yes/no Do you want to save/remember recently opened files ? yes/no Do you want to highlight the current line ? yes/no Do you want to configured org mode ? yes/no Do you want configured IRC ? yes/no Do you want to have auto-complete from dictionary ? yes/no Do you want to save/remember frequently used words ? yes/no Do you want spell checking ? yes/no Do you want to auto-complete from words in the opened buffers/files ? yes/no Do you want to have auto-complete for a programming language ? yes/no What programming languages (C++. python, ...) ? etc... For the last question for example, better not ask user if he wants to install eglot even if he is a developer (better always suppose that he is a new user first, so he may not know anything about eglot. So better use general terms whenever possible). All the questions should have a default answer (which are basically the current emacs defaults) so if the user hit enter all the way down, nothing should happens (this will also be a way for users to discover and have an idea of what emacs can do) User can come back later and repeat this step as much as he wants (the new default answers will be the user previous answers, so hitting enter all the way down should also do nothing, and with this user can have an idea of what he had already answered/configured for certain things) If this results in a ton of questions, then maybe a selection of what should be asked or not is to be done, or maybe a second org link can be added for example: "Detailed/Advanced Configuration". Of course there should be "leveled" questions (questions should be grouped and not presented as flat list like in my example list above), for example if user chose not to configure org by hitting "no", no further questions should be asked about org. The top level questions should be as few as possible and as generic as possible. Everything should be configured in a reasonable time or so. Running this later will be much more quicker for user (only the first time will be somehow a discovery). Without the user having to know about init file, packages, archives, functions, variables, hooks, and endless init file debugging, or even to write a single line of elisp. Users can be from different backgrounds not necessary hackers or developers. But this feature is not only focused on non-hackers and non-developers, hackers and developers will benefit from this as well at least as a starting point, before digging into emacs later, or for example to configure emacs for a friend,etc in a quick way, as stated at the beginning. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-01 20:09 Jordi Gutiérrez Hermoso @ 2024-10-04 16:25 ` Eduardo Ochs 2024-10-04 18:10 ` Dr. Arne Babenhauserheide 2024-10-10 0:22 ` chad 1 sibling, 1 reply; 138+ messages in thread From: Eduardo Ochs @ 2024-10-04 16:25 UTC (permalink / raw) To: Jordi Gutiérrez Hermoso; +Cc: Emacs development discussions On Wed, 2 Oct 2024 at 02:41, Jordi Gutiérrez Hermoso <jordigh@octave.org> wrote: > > I was asked to relay this from an anonymous IRC user. The words below are not > mine. I, Jordi, did not write this. Someone wanted to post this anonymously to > emacs-devel, and I'm doing it on their behalf. > (...) Hi Jordi, Anynomous, and all, my problem with Anonymous's proposal - here: https://lists.gnu.org/archive/html/emacs-devel/2024-10/msg00018.html is that I don't know how it would be developed and what its prototypes would look like... Suppose that we develop a small script that would change startup.el to add a button that would open a beginner's page in Org that would initially have, say, only two lines of text and Org links with "elisp:" actions. Would Anonymous be willing to a) run that script on his/her/their machine? And b) then run that script on some friend's machines to see if they find that button too hard to find and too hard to click on? Let me write "A+Fs" for "Anonymous plus friends", "Chiyaab button" for the button in the startup page that says "Click here if you are a beginner", and "Beginners page" for the page that that button points to. I am especially interested in the "degree of pollution(*)" of elisp code. I know that for some people having something like this in a tutorial, To understand what is the init file click on _this button_, or, equivalently, execute the elisp code below by moving the point to its line and typing C-e C-x C-e: (info "(emacs)Init file") ...makes that tutorial completely unsuitable for beginners - and I would like to know how numerous these people are, and learn more about how they think. Cheers, Eduardo Ochs http://anggtwu.net/eepitch.html http://anggtwu.net/#eev (*): I was rereading Judith Butler's "Gender Trouble" some time ago, and it has this quote, taken from Mary Douglas's "Purity and Danger": ...pollution powers which inhere in the structure of ideas itself and which punish a symbolic breaking of that which should be joined or joining of that which should be separate. It follows from this that pollution is a type of danger which is not likely to occur except where the lines of structure, cosmic or social, are clearly defined. A polluting person is always in the wrong. He [sic] has developed some wrong condition or simply crossed over some line which should not have been crossed and this displacement unleashes danger for someone. ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-04 16:25 ` Eduardo Ochs @ 2024-10-04 18:10 ` Dr. Arne Babenhauserheide 2024-10-04 18:30 ` Eduardo Ochs 2024-10-07 3:54 ` Richard Stallman 0 siblings, 2 replies; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-04 18:10 UTC (permalink / raw) To: Eduardo Ochs; +Cc: Jordi Gutiérrez Hermoso, Emacs development discussions [-- Attachment #1: Type: text/plain, Size: 802 bytes --] Eduardo Ochs <eduardoochs@gmail.com> writes: > is that I don't know how it would be developed and what its prototypes > would look like... While I’m not the anonymous, I see something similar when I look at the marketing of IntelliJ: they have PyCharmm, WebStorm, and so forth, which are mainly different flavors of IntelliJ. From that I could imagine a similar approach to provide different installers that install a pre-configured Emacs for the specific task. On distributions that may mean providing meta-packages which install required elpa-packages and are started from a script that prepares a $HOME/.emacs.d/ for the specific flavor of Emacs if it does not exist already. Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-04 18:10 ` Dr. Arne Babenhauserheide @ 2024-10-04 18:30 ` Eduardo Ochs 2024-10-04 19:24 ` Dr. Arne Babenhauserheide 2024-10-07 3:54 ` Richard Stallman 1 sibling, 1 reply; 138+ messages in thread From: Eduardo Ochs @ 2024-10-04 18:30 UTC (permalink / raw) To: Dr. Arne Babenhauserheide Cc: Jordi Gutiérrez Hermoso, Emacs development discussions On Fri, 4 Oct 2024 at 15:10, Dr. Arne Babenhauserheide <arne_bab@web.de> wrote: > > Eduardo Ochs <eduardoochs@gmail.com> writes: > > > is that I don't know how it would be developed and what its prototypes > > would look like... > > While I’m not the anonymous, I see something similar when I look at the > marketing of IntelliJ: they have PyCharmm, WebStorm, and so forth, which > are mainly different flavors of IntelliJ. > > From that I could imagine a similar approach to provide different > installers that install a pre-configured Emacs for the specific task. > > On distributions that may mean providing meta-packages which install > required elpa-packages and are started from a script that prepares a > $HOME/.emacs.d/ for the specific flavor of Emacs if it does not exist > already. Hi Arne, I think that Anyonynous is saying that we need a variant of one of these specific flavors... a variant that has an extra button - "Click here if you are a beginner" - in the startup page. Cheers, Eduardo Ochs ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-04 18:30 ` Eduardo Ochs @ 2024-10-04 19:24 ` Dr. Arne Babenhauserheide 2024-10-04 20:37 ` Eduardo Ochs 0 siblings, 1 reply; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-04 19:24 UTC (permalink / raw) To: Eduardo Ochs; +Cc: Jordi Gutiérrez Hermoso, Emacs development discussions [-- Attachment #1: Type: text/plain, Size: 493 bytes --] Eduardo Ochs <eduardoochs@gmail.com> writes: > I think that Anyonynous is saying that we need a variant of one of > these specific flavors... a variant that has an extra button - "Click > here if you are a beginner" - in the startup page. Do you mean something like an improved first time tutorial? We have something there, but maybe it does not match user expectations anymore? Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-04 19:24 ` Dr. Arne Babenhauserheide @ 2024-10-04 20:37 ` Eduardo Ochs 2024-10-05 8:41 ` Dr. Arne Babenhauserheide 0 siblings, 1 reply; 138+ messages in thread From: Eduardo Ochs @ 2024-10-04 20:37 UTC (permalink / raw) To: Dr. Arne Babenhauserheide Cc: Jordi Gutiérrez Hermoso, Emacs development discussions On Fri, 4 Oct 2024 at 16:25, Dr. Arne Babenhauserheide <arne_bab@web.de> wrote: > > Do you mean something like an improved first time tutorial? > > We have something there, but maybe it does not match user expectations > anymore? Hi Arne, Yes! To be honest Anonymous's proposal doesn't make much sense to me... for example, this, > Without the user having to know about init file, packages, archives, > functions, variables, hooks, and endless init file debugging, or even > to write a single line of elisp. > > Users can be from different backgrounds not necessary hackers or > developers. that gives me the impression that Anynymous thinks that people should configure their Emacs first and learn "the rest" later, and that that would work very well. I was able to squeeze out some practical ideas from A's proposal - like: 1. let's create a hack that adds a button saying "If you are a beginner click here" to the splash screen, and make it well known; 2. let's create a way to make it open a certain Org file; 3. let's discuss how to make that Org file adjust the user's init file according to the settings in its checkboxes; 4. let's create a way to make that easy to install, 5. let's ask Anonymous to install that on some friends's machines. They are probably going to say that our _prototypes_ are crap, that they needed something much more polished, that did exactly what they wanted and that didn't contain a single sentence that they didn't understand... and at that point we can plonk them, but we will have the code for (1), (2), (3), and (4), and that can be useful in the future... (Slightly bitter) cheers, Eduardo ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-04 20:37 ` Eduardo Ochs @ 2024-10-05 8:41 ` Dr. Arne Babenhauserheide 2024-10-05 12:57 ` Eduardo Ochs 0 siblings, 1 reply; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-05 8:41 UTC (permalink / raw) To: Eduardo Ochs; +Cc: Jordi Gutiérrez Hermoso, Emacs development discussions [-- Attachment #1: Type: text/plain, Size: 2679 bytes --] Hi Eduardo, Eduardo Ochs <eduardoochs@gmail.com> writes: > Yes! To be honest Anonymous's proposal doesn't make much sense to > me... for example, this, > >> Without the user having to know about init file, packages, archives, >> functions, variables, hooks, and endless init file debugging, or even >> to write a single line of elisp. >> >> Users can be from different backgrounds not necessary hackers or >> developers. > > that gives me the impression that Anynymous thinks that people should > configure their Emacs first and learn "the rest" later, and that that > would work very well. I think they have a point with that. The success of Doom¹ and Spacemacs² (to my impression many of the new Emacs users in the past decade came from these) suggests that many users need something that just solves their current requirements. Besides having pretty readable online-documentation (with Doom simply using what github provides), they mostly provide “what is your task? I will make it work well and look good.”³ ¹ https://github.com/doomemacs/doomemacs ² https://www.spacemacs.org/ ³ https://www.spacemacs.org/layers/LAYERS.html#programming-and-markup-languages But even these are still far too much for casual users — even casual programmers. Configuring anything before being able to start is often too much. The JetBrains (IntelliJ) page shows what And most current tools are available as curl-bash (curl script from maybe trusted source and execute it without inspection). A writer friend of mine (also build system engineer) spent months collecting neat adjustments to create the perfect writing environment. That worked, because org already provides much out of the box. So some way of making custom emacs setups provide the UX of installing a regular application might actually bring more users. I’m not sure whether that’s actually the best approach for Emacs, but something to reduce the friction of getting an emacs setup optimized to a given task to almost zero would likely be a valuable improvement. > understand... and at that point we can plonk them, but we will have > the code for (1), (2), (3), and (4), and that can be useful in the > future... > > (Slightly bitter) cheers, > Eduardo Please try to keep bitterness off list. I understand the sentiment, but the times I gave in to bittereness or cynicism myself, it always hit the wrong people, scaring active new contributors away from the project (whom I later saw contributing constructively to other projects). Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-05 8:41 ` Dr. Arne Babenhauserheide @ 2024-10-05 12:57 ` Eduardo Ochs 2024-10-05 13:21 ` Emanuel Berg ` (2 more replies) 0 siblings, 3 replies; 138+ messages in thread From: Eduardo Ochs @ 2024-10-05 12:57 UTC (permalink / raw) To: Dr. Arne Babenhauserheide Cc: Jordi Gutiérrez Hermoso, Emacs development discussions On Sat, 5 Oct 2024 at 05:41, Dr. Arne Babenhauserheide <arne_bab@web.de> wrote: > > Hi Eduardo, > > Eduardo Ochs <eduardoochs@gmail.com> writes: > > > Yes! To be honest Anonymous's proposal doesn't make much sense to > > me... for example, this, > > > >> Without the user having to know about init file, packages, archives, > >> functions, variables, hooks, and endless init file debugging, or even > >> to write a single line of elisp. > >> > >> Users can be from different backgrounds not necessary hackers or > >> developers. > > > > that gives me the impression that Anynymous thinks that people should > > configure their Emacs first and learn "the rest" later, and that that > > would work very well. > > I think they have a point with that. The success of Doom¹ and Spacemacs² > (to my impression many of the new Emacs users in the past decade came > from these) suggests that many users need something that just solves > their current requirements. > > Besides having pretty readable online-documentation (with Doom simply > using what github provides), they mostly provide “what is your task? I > will make it work well and look good.”³ > > ¹ https://github.com/doomemacs/doomemacs > ² https://www.spacemacs.org/ > ³ https://www.spacemacs.org/layers/LAYERS.html#programming-and-markup-languages > > But even these are still far too much for casual users — even casual > programmers. Configuring anything before being able to start is often > too much. The JetBrains (IntelliJ) page shows what > > And most current tools are available as curl-bash (curl script from > maybe trusted source and execute it without inspection). > > A writer friend of mine (also build system engineer) spent months > collecting neat adjustments to create the perfect writing environment. > That worked, because org already provides much out of the box. > > So some way of making custom emacs setups provide the UX of installing a > regular application might actually bring more users. > > I’m not sure whether that’s actually the best approach for Emacs, but > something to reduce the friction of getting an emacs setup optimized to > a given task to almost zero would likely be a valuable improvement. > > > understand... and at that point we can plonk them, but we will have > > the code for (1), (2), (3), and (4), and that can be useful in the > > future... > > > > (Slightly bitter) cheers, > > Eduardo > > Please try to keep bitterness off list. I understand the sentiment, but > the times I gave in to bittereness or cynicism myself, it always hit the > wrong people, scaring active new contributors away from the project > (whom I later saw contributing constructively to other projects). Hi Arne, you are right - I've tried to learn Doom Emacs to help a friend who used it and my experience with it was so bad that I tend to forget that lots of people love it... To make a long story too short, my friend was trying to use Doom Emacs, and he was learning a kind of Lisp that was only a configuration language - only after several months I discovered that he had plans to learn things like defun and setq someday, but "next year". The idea of adding a button for beginners at the startup page and making it go to an Org page looks like a much better approach to me in comparison with Doom - and I imagine that it would let people configure Emacs in a wide spectrum of configurations that would go from Vanilla to some maximalist configurations with almost as many packages as Doom, and the Lisp code for that could be much easier to understand that the Lisp of the Doom configs... but we would need to start small, and in the process we (or rather: I) would have the opportunity to understand why lots of people find it exciting to spend six months playing with configurations, but think that understanding what defuns and setqs do is something incredibly painful, to be postponed as most as possible... Btw, I am the author of this, http://anggtwu.net/eev-intros/find-eev-quick-intro.html#2 http://anggtwu.net/eev-intros/find-windows-beginner-intro.html that is for beginners and that starts by Lisp. But I need to leave now - more later. Cheers, Eduardo ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-05 12:57 ` Eduardo Ochs @ 2024-10-05 13:21 ` Emanuel Berg 2024-10-05 15:57 ` Dr. Arne Babenhauserheide 2024-10-09 3:30 ` Richard Stallman 2 siblings, 0 replies; 138+ messages in thread From: Emanuel Berg @ 2024-10-05 13:21 UTC (permalink / raw) To: emacs-devel Eduardo Ochs wrote: > The idea of adding a button for beginners [...] > http://anggtwu.net/eev-intros/find-windows-beginner-intro.html > > that is for beginners [...] What is a "beginner", even? Why is that concept so central? We should be our best to all users, it doesn't matter if they used the software for 10 days or 10 years. -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-05 12:57 ` Eduardo Ochs 2024-10-05 13:21 ` Emanuel Berg @ 2024-10-05 15:57 ` Dr. Arne Babenhauserheide 2024-10-09 3:30 ` Richard Stallman 2 siblings, 0 replies; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-05 15:57 UTC (permalink / raw) To: Eduardo Ochs; +Cc: Jordi Gutiérrez Hermoso, Emacs development discussions [-- Attachment #1: Type: text/plain, Size: 1173 bytes --] Eduardo Ochs <eduardoochs@gmail.com> writes: > The idea of adding a button for beginners at the startup page and > making it go to an Org page looks like a much better approach to me in > comparison with Doom - and I imagine that it would let people > configure Emacs in a wide spectrum of configurations I think this is actually the second step. The first step is figuring out how to foster configuration communities from core Emacs. How to find out which configurations are there and how they organize to decide > http://anggtwu.net/eev-intros/find-eev-quick-intro.html#2 This looks like a start, but already deeper in than I’d think. About the first part (#1, not #2): I think the first command to learn with Emacs is CTRL-g. You’re stuck in something and want to Get Back to whatever you did before. Regardless of the strange things happening right now, stop them. If something worries you, just hit C-g repeatedly. Even if that didn’t change the current situation, it gave you time to think, because it didn’t do anything ☺ Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-05 12:57 ` Eduardo Ochs 2024-10-05 13:21 ` Emanuel Berg 2024-10-05 15:57 ` Dr. Arne Babenhauserheide @ 2024-10-09 3:30 ` Richard Stallman 2024-10-09 7:04 ` Eduardo Ochs 2 siblings, 1 reply; 138+ messages in thread From: Richard Stallman @ 2024-10-09 3:30 UTC (permalink / raw) To: Eduardo Ochs; +Cc: emacs-devel [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > The idea of adding a button for beginners at the startup page and > making it go to an Org page Could you explain the connection between "a button for beginners" and "go to an Org page"? Is this an assumption that beginners all want the same thing? Aside from being in Org mode, what would that page contain? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-09 3:30 ` Richard Stallman @ 2024-10-09 7:04 ` Eduardo Ochs 0 siblings, 0 replies; 138+ messages in thread From: Eduardo Ochs @ 2024-10-09 7:04 UTC (permalink / raw) To: rms; +Cc: emacs-devel On Wed, 9 Oct 2024 at 00:30, Richard Stallman <rms@gnu.org> wrote: > > > The idea of adding a button for beginners at the startup page and > > making it go to an Org page > > Could you explain the connection between "a button for beginners" > and "go to an Org page"? Is this an assumption that beginners > all want the same thing? > > Aside from being in Org mode, what would that page contain? Hi Richard, I don't know Org well, and when I wrote that I had the impression that we could create an Org page with: 1. checkboxes that looked like these, [ ] rainbow delimiters: (explanation) [ ] blink cursor: (explanation) and that would be associated to the variables `bopt-rainbow' and `bopt-blink', where "bopt-" is a prefix that means "beginner options", 2. a code block that would read the variables `bopt-rainbow' and `bopt-blink', and do something that would depend on them... for example, in a prototype that code block would just display a string like "rainbow:yes blink:no". ...but now I have the impression that to do something like that in a simple way we would need something that has a part in Org and a part that uses customize - but I don't know how to do that either. I was expecting that some people would suggest techniques for writing that prototype, but that did not happen (yet). Nowadays lots of people suggest that beginners should start learning Emacs by interacting with pages in Org mode, because Org mode is similar enough to things that the beginners-from-nowadays already know. That is not my experience, but that may be because I live in Brazil, and the beginners that we have here know VERY little - and also I've been using GNU/Linux since the mid-90s, and I don't know the things that "all the beginners-from-nowadays know". Also, when I teach Emacs to beginners I always start by teaching them how to execute sexps like (+ 1 2) and (info "(emacs)User Input") with C-e C-x C-e - and in the second case they also need to learn how to go back. I've been having a lot of success with that approach - but, again, that may be because the beginners here are different from the beginners from most other places. Anyway, I was expecting that people would send prototypes... Cheers, Eduardo Ochs ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-04 18:10 ` Dr. Arne Babenhauserheide 2024-10-04 18:30 ` Eduardo Ochs @ 2024-10-07 3:54 ` Richard Stallman 2024-10-07 4:14 ` Emanuel Berg 2024-10-07 10:31 ` Dr. Arne Babenhauserheide 1 sibling, 2 replies; 138+ messages in thread From: Richard Stallman @ 2024-10-07 3:54 UTC (permalink / raw) To: Dr. Arne Babenhauserheide; +Cc: eduardoochs, jordigh, emacs-devel [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > From that I could imagine a similar approach to provide different > installers that install a pre-configured Emacs for the specific task. I am trying to figure out concretely what that means, but I can't be sure -- there are many possibilities. Who would select and install one "pre-configured Emacs"? A user, for perself? An admin, for a user? Who would the chosen pre-configured Emacs be installed for? For a site (affecting all users)? For one particular user? In any case, I don't think we would different versions _of Emacs_. Wouldn't it suffice just to generate a .emacs file with a few user options set? -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org) ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-07 3:54 ` Richard Stallman @ 2024-10-07 4:14 ` Emanuel Berg 2024-10-07 14:27 ` Ship Mints 2024-10-07 10:31 ` Dr. Arne Babenhauserheide 1 sibling, 1 reply; 138+ messages in thread From: Emanuel Berg @ 2024-10-07 4:14 UTC (permalink / raw) To: emacs-devel Richard Stallman wrote: >> From that I could imagine a similar approach to provide >> different installers that install a pre-configured Emacs >> for the specific task. > > I am trying to figure out concretely what that means, but > I can't be sure -- there are many possibilities. > > Who would select and install one "pre-configured Emacs"? > A user, for perself? An admin, for a user? I think he means for example if the user wants to do mail or IRC, say. Then we have an installer for Gnus (or rmail that you wrote) and for ERC. The installer probably facilitates setting the necessary settings for those programs to work. And maybe set the theme as well. I must say the whole thing, if I am interpreting it correctly, doesn't appeal to me that much but maybe it is actually a great idea, hard to tell. -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-07 4:14 ` Emanuel Berg @ 2024-10-07 14:27 ` Ship Mints 2024-10-07 14:46 ` Emanuel Berg 0 siblings, 1 reply; 138+ messages in thread From: Ship Mints @ 2024-10-07 14:27 UTC (permalink / raw) To: emacs-devel [-- Attachment #1: Type: text/plain, Size: 1379 bytes --] Probably already mentioned...Philip Kaludercic made the following Emacs init file generator which might be a good basis for helping people get started with specialized packages and configurations they might want to try. It's written in common lisp but could be an elisp package as part of Emacs, perhaps. https://emacs.amodernist.com/ On Mon, Oct 7, 2024 at 7:15 AM Emanuel Berg <incal@dataswamp.org> wrote: > Richard Stallman wrote: > > >> From that I could imagine a similar approach to provide > >> different installers that install a pre-configured Emacs > >> for the specific task. > > > > I am trying to figure out concretely what that means, but > > I can't be sure -- there are many possibilities. > > > > Who would select and install one "pre-configured Emacs"? > > A user, for perself? An admin, for a user? > > I think he means for example if the user wants to do mail or > IRC, say. Then we have an installer for Gnus (or rmail that > you wrote) and for ERC. > > The installer probably facilitates setting the necessary > settings for those programs to work. And maybe set the theme > as well. > > I must say the whole thing, if I am interpreting it correctly, > doesn't appeal to me that much but maybe it is actually a great > idea, hard to tell. > > -- > underground experts united > https://dataswamp.org/~incal > > > [-- Attachment #2: Type: text/html, Size: 2084 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-07 14:27 ` Ship Mints @ 2024-10-07 14:46 ` Emanuel Berg 0 siblings, 0 replies; 138+ messages in thread From: Emanuel Berg @ 2024-10-07 14:46 UTC (permalink / raw) To: emacs-devel Ship Mints wrote: > Probably already mentioned...Philip Kaludercic made the > following Emacs init file generator which might be a good > basis for helping people get started with specialized > packages and configurations they might want to try. That is probably what he set out to do, and he did it, and not in a bad way, so good, the only objection would be this has to be executed at the discretion of the user, yes, give me guided configuration. When I started to program I didn't know half of that stuff, but I just might have had enough cognitive plusplus to grasp the concept of a text editor and that Emacs was one. So the first time anyone starts Emacs, blank .emacs or not, what should happen is a very quick startup with as little visual noise and technobabble as possible, and then just an all-white, empty buffer: hello there, you came to the right place, I am ALL YOURS to edit! Because, when the expected happens, this is actually a good feeling even to adventurous people. -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-07 3:54 ` Richard Stallman 2024-10-07 4:14 ` Emanuel Berg @ 2024-10-07 10:31 ` Dr. Arne Babenhauserheide 1 sibling, 0 replies; 138+ messages in thread From: Dr. Arne Babenhauserheide @ 2024-10-07 10:31 UTC (permalink / raw) To: Richard Stallman; +Cc: eduardoochs, jordigh, emacs-devel [-- Attachment #1: Type: text/plain, Size: 1326 bytes --] Richard Stallman <rms@gnu.org> writes: > > From that I could imagine a similar approach to provide different > > installers that install a pre-configured Emacs for the specific task. > > Who would the chosen pre-configured Emacs be installed for? > For a site (affecting all users)? > For one particular user? The pre-configuration should only affect the user who chooses it. So it might be installed systemwide, but only actually setup the $HOME/.emacs.d/init.el when it is started the first time. > In any case, I don't think we would different versions _of Emacs_. > Wouldn't it suffice just to generate a .emacs file with a few > user options set? Yes — the difference is not the implementation, but the workflow to get that version. Reducing friction in that. If users on GNU Linux can just `apt-get install emacs-for-cpp`, then that emacs-for-cpp feels real. Even if the result is just a pre-configured .emacs.d/init.el If users on Windows can just get an installer of emacs-for-cpp, then that emacs-for-cpp feels real. Even if ... In both cases this could be an optimized configuration that enables people to have an instantly running, well-optimized system for that task. Best wishes, Arne -- Unpolitisch sein heißt politisch sein, ohne es zu merken. draketo.de [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 1125 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
* Re: An anonymous IRC user's opinion 2024-10-01 20:09 Jordi Gutiérrez Hermoso 2024-10-04 16:25 ` Eduardo Ochs @ 2024-10-10 0:22 ` chad 1 sibling, 0 replies; 138+ messages in thread From: chad @ 2024-10-10 0:22 UTC (permalink / raw) To: Jordi Gutiérrez Hermoso; +Cc: Emacs development discussions [-- Attachment #1: Type: text/plain, Size: 380 bytes --] On Wed, Oct 2, 2024 at 1:41 AM Jordi Gutiérrez Hermoso <jordigh@octave.org> wrote: > I was asked to relay this from an anonymous IRC user. The words below are > not > mine. I, Jordi, did not write this. Someone wanted to post this > anonymously to > emacs-devel, and I'm doing it on their behalf. [...] Send them this link: https://emacs.amodernist.com/ ~Chad [-- Attachment #2: Type: text/html, Size: 810 bytes --] ^ permalink raw reply [flat|nested] 138+ messages in thread
end of thread, other threads:[~2024-11-21 5:46 UTC | newest] Thread overview: 138+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-10-06 7:32 An anonymous IRC user's opinion Abraham S.A.H. via Emacs development discussions. 2024-10-06 8:10 ` Emanuel Berg 2024-10-06 8:44 ` Dr. Arne Babenhauserheide 2024-10-06 9:01 ` Emanuel Berg 2024-10-06 9:09 ` Emanuel Berg 2024-10-06 9:32 ` Abraham S.A.H. via Emacs development discussions. 2024-10-06 11:28 ` Dr. Arne Babenhauserheide 2024-10-06 13:10 ` Emanuel Berg 2024-10-06 12:55 ` Emanuel Berg 2024-10-09 3:29 ` Richard Stallman 2024-10-09 20:20 ` Emanuel Berg 2024-10-10 8:57 ` Dr. Arne Babenhauserheide 2024-10-09 3:30 ` Richard Stallman 2024-10-09 6:48 ` Dr. Arne Babenhauserheide 2024-10-09 20:22 ` Emanuel Berg 2024-10-09 11:09 ` Johan Myréen 2024-10-09 13:13 ` Eli Zaretskii 2024-10-09 13:38 ` tomas 2024-10-09 16:02 ` Dr. Arne Babenhauserheide 2024-10-09 16:22 ` Eli Zaretskii 2024-10-09 21:55 ` Emanuel Berg 2024-10-10 7:25 ` Eli Zaretskii 2024-10-10 9:35 ` Dr. Arne Babenhauserheide 2024-10-10 10:42 ` Eli Zaretskii 2024-10-13 3:29 ` Richard Stallman 2024-10-10 6:07 ` Emanuel Berg 2024-10-09 16:06 ` Johan Myréen 2024-10-09 16:12 ` Ship Mints 2024-10-09 16:25 ` Eli Zaretskii 2024-10-09 21:25 ` Dmitry Gutov 2024-10-10 4:56 ` Eli Zaretskii 2024-10-10 5:14 ` Xiyue Deng 2024-10-10 6:36 ` Eli Zaretskii 2024-10-10 6:59 ` Xiyue Deng 2024-10-11 20:30 ` Dmitry Gutov 2024-10-12 7:34 ` Eli Zaretskii 2024-10-12 20:27 ` Dmitry Gutov 2024-10-12 21:00 ` Dr. Arne Babenhauserheide 2024-10-13 4:53 ` Eli Zaretskii 2024-10-13 6:28 ` Dr. Arne Babenhauserheide 2024-10-13 4:41 ` Eli Zaretskii 2024-10-13 9:37 ` Dmitry Gutov 2024-10-13 10:39 ` Eli Zaretskii 2024-10-13 15:31 ` Dmitry Gutov 2024-10-13 15:53 ` Eli Zaretskii 2024-10-14 9:32 ` Dmitry Gutov 2024-10-14 11:09 ` Alan Mackenzie 2024-10-15 1:41 ` Dmitry Gutov 2024-10-14 14:16 ` Eli Zaretskii 2024-10-15 1:36 ` Dmitry Gutov 2024-10-15 12:03 ` Eli Zaretskii 2024-11-03 3:10 ` Dmitry Gutov 2024-11-03 6:37 ` Eli Zaretskii 2024-11-03 19:24 ` Dmitry Gutov 2024-11-04 12:04 ` Eli Zaretskii 2024-11-04 12:11 ` Eli Zaretskii 2024-11-04 17:41 ` Dmitry Gutov 2024-11-04 19:18 ` Eli Zaretskii 2024-11-04 20:59 ` Dmitry Gutov 2024-11-05 12:11 ` Eli Zaretskii 2024-11-05 17:05 ` Dmitry Gutov 2024-11-05 17:28 ` Eli Zaretskii 2024-11-05 19:40 ` Dmitry Gutov 2024-11-05 19:53 ` Eli Zaretskii 2024-11-05 20:59 ` Dmitry Gutov 2024-11-06 12:15 ` Eli Zaretskii 2024-11-06 12:46 ` Dmitry Gutov 2024-11-06 13:25 ` Eli Zaretskii 2024-11-06 16:07 ` Dmitry Gutov 2024-11-06 17:14 ` Eli Zaretskii 2024-11-19 2:44 ` Dmitry Gutov 2024-11-19 15:41 ` Eli Zaretskii 2024-11-19 16:13 ` Dmitry Gutov 2024-11-19 17:10 ` Eli Zaretskii 2024-11-19 17:40 ` Dmitry Gutov 2024-11-19 17:47 ` Eli Zaretskii 2024-11-19 17:56 ` Dmitry Gutov 2024-11-19 19:01 ` Eli Zaretskii 2024-11-19 20:12 ` Dmitry Gutov 2024-11-20 12:59 ` Eli Zaretskii 2024-11-20 18:38 ` Dmitry Gutov 2024-11-20 19:01 ` Eli Zaretskii 2024-11-20 19:23 ` Dmitry Gutov 2024-11-20 19:55 ` Eli Zaretskii 2024-11-20 19:57 ` Dmitry Gutov 2024-11-21 5:46 ` Eli Zaretskii 2024-11-19 17:59 ` Juri Linkov 2024-11-19 19:52 ` Dmitry Gutov 2024-11-20 16:47 ` Philip Kaludercic 2024-11-20 17:36 ` Juri Linkov 2024-11-20 18:07 ` Dmitry Gutov 2024-11-05 13:21 ` Dr. Arne Babenhauserheide 2024-11-05 13:47 ` Eli Zaretskii 2024-11-05 16:52 ` Dr. Arne Babenhauserheide 2024-11-05 17:22 ` Eli Zaretskii 2024-11-05 17:49 ` Philip Kaludercic 2024-11-05 19:23 ` Dr. Arne Babenhauserheide 2024-11-06 0:09 ` Philip Kaludercic 2024-11-06 9:35 ` Dr. Arne Babenhauserheide 2024-11-06 9:59 ` Philip Kaludercic 2024-11-07 14:16 ` Automatic Suggestion of Packages Philip Kaludercic 2024-11-07 16:07 ` Visuwesh 2024-11-07 21:50 ` Philip Kaludercic 2024-11-08 4:15 ` Visuwesh 2024-11-08 4:29 ` Visuwesh 2024-11-08 14:02 ` Philip Kaludercic 2024-11-08 15:44 ` Visuwesh 2024-11-08 16:23 ` Philip Kaludercic 2024-11-11 20:07 ` Mekeor Melire 2024-11-12 3:00 ` Philip Kaludercic 2024-10-13 10:52 ` An anonymous IRC user's opinion Dr. Arne Babenhauserheide 2024-10-10 13:58 ` Richard Stallman 2024-10-10 14:45 ` Dr. Arne Babenhauserheide 2024-10-12 3:19 ` Richard Stallman -- strict thread matches above, loose matches on Subject: below -- 2024-10-06 5:31 Pedro Andres Aranda Gutierrez 2024-10-06 6:04 ` Emanuel Berg 2024-10-06 9:06 ` Dr. Arne Babenhauserheide 2024-10-06 9:10 ` Emanuel Berg 2024-10-06 10:31 ` Pedro Andres Aranda Gutierrez 2024-10-07 21:17 ` John ff 2024-10-13 3:29 ` Richard Stallman 2024-10-01 20:09 Jordi Gutiérrez Hermoso 2024-10-04 16:25 ` Eduardo Ochs 2024-10-04 18:10 ` Dr. Arne Babenhauserheide 2024-10-04 18:30 ` Eduardo Ochs 2024-10-04 19:24 ` Dr. Arne Babenhauserheide 2024-10-04 20:37 ` Eduardo Ochs 2024-10-05 8:41 ` Dr. Arne Babenhauserheide 2024-10-05 12:57 ` Eduardo Ochs 2024-10-05 13:21 ` Emanuel Berg 2024-10-05 15:57 ` Dr. Arne Babenhauserheide 2024-10-09 3:30 ` Richard Stallman 2024-10-09 7:04 ` Eduardo Ochs 2024-10-07 3:54 ` Richard Stallman 2024-10-07 4:14 ` Emanuel Berg 2024-10-07 14:27 ` Ship Mints 2024-10-07 14:46 ` Emanuel Berg 2024-10-07 10:31 ` Dr. Arne Babenhauserheide 2024-10-10 0:22 ` chad
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).