mastodon.online is one of the many independent Mastodon servers you can use to participate in the fediverse.
A newer server operated by the Mastodon gGmbH non-profit

Server stats:

11K
active users

@arialdo yeah, it feels like something that should be in the standard library.

@slackline @jeeger @arialdo That is just a custom for packages on ELPA, since they are licensed under the same terms of Emacs. The chance of undo-tree as such being merged is pretty low, since it re-invents a number of things and is known to be brittle. @mekeor mentioned vundo, which i would consider a more likely candidate.

@mekeor @arialdo Oh, thanks for recommending that. vundo has a nicely compact view. I'll try getting used to it. =)

@sacha @mekeor After having used vundo a while, I am personally sold: I switched from undo-tree to vundo. I found no major drawbacks.

@arialdo: i use this customization:

(setopt vundo-glyph-alist vundo-unicode-symbols)

(setq instead of setopt would probably work too)

@mekeor Beautiful. I found that option in the documentation. I did not know about setopt, and now I feel the urge to understand the difference between setopt and setq.

@arialdo @mekeor User options are a higher abstraction than variables. They can have custom setters and getters that execute actions when modified, which setq would ignore. Examples of user options with side effects are minor modes, which when enabled using setopt

(setopt electric-pair-mode t)

will call the function initialising the minor mode.

It is also possible to have a user option that doesn't have any associated variable, where setting a user option just runs code (e.g. it could modify some more complex state). In these cases, it would be wrong to use setq.

Also neat: setopt does (weak) type checking to warn you if the value you are assigning doesn't match the type of the user option.

@pkal @mekeor

Amazing. So, they are very similar to C#'s properties. Very powerful.

Thank you for the excellent explanation.

@arialdo when you define a variable in emacs-lisp, you can associate a setter function with it. the setter function is intended to run whenever a new value is assigned to the variable. in the customize interface, this happens automatically. in elisp code, setq won't trigger the setter function. you need to use setopt instead.

personally, i use setopt for all user options because i don't want to lookup if the option has a setter function in order to find out if i could use the more simple setq instead; and because i don't wanna risk that an existant setter function would not be triggered.

@arialdo sorry, didn't see @pkal's response beforehand :)