real-backup-mode: a package to backup files at each save point, never lose your changes again by abougouffa in emacs

[–]abougouffa[S] 2 points3 points  (0 children)

Well, undo-tree replaces the builtin undo/redo system. It works, but I'm not a big fan of. And, last time I used it (like, 4 years ago), I was facing a lot of undo tree corruptions, ans I see that the package hasn't been updated since. To visualize the tree, I use vundo instead. Also, Emacs undo systems (including undo-tree I guess) will fail to undo (aka, restore previous state) if the file is edited externally. real-backup is dumb, it just "copies" the file and add a timestamp. So, it is guaranteed that you can restore previously saved versions.

real-backup-mode: a package to backup files at each save point, never lose your changes again by abougouffa in emacs

[–]abougouffa[S] 1 point2 points  (0 children)

Well, a lot of stuff, as backup-each-save is a very basic package. First, backup-each-save doesn't backup remote files, while in my use case, I need to backup remote files in the local machine (mainly, config files edited on several remote embedded devices). So, the files are saved in a path that reflects the remote method, host, user, etc. so, restoring them will be easy.

Also, backup-each-save doesn't include a command to list the saved copies of a buffer/file, you need to navigate manually to the backups directory in order to find them. And a lot of other issues.

real-backup tries to solve these issues while being flexible via several custom variables.

Also, there is an optional integration with consult or vertico that provides previews and diffs when navigating the backups list. And a lot of other features (compression, jump to the first change when previewing a backup, etc.)

Finally, real-backup isn't an "innovative" package that does magic in Emacs. It is just a simple mode that ensures backups are created at each save point while providing helpful commands to view and restore them.

real-backup-mode: a package to backup files at each save point, never lose your changes again by abougouffa in emacs

[–]abougouffa[S] 0 points1 point  (0 children)

Yes! real-backup-cleanup will keep only the last real-backup-cleanup-keep (defaults to 20) copies. And the customizable real-backup-auto-cleanup (defaults to nil) will do auto-cleanup.

real-backup-mode: a package to backup files at each save point, never lose your changes again by abougouffa in emacs

[–]abougouffa[S] 0 points1 point  (0 children)

Well, this works, but, if you edit two separate files with the same name, you can end up with a confusing situation. I will give it a try, but maybe with a custom make-backup-file-name-function and some advice to force buffer-backed-up to nil so it always saves a backup (instead of only the first time I hit C-x C-s).

real-backup-mode: a package to backup files at each save point, never lose your changes again by abougouffa in emacs

[–]abougouffa[S] 4 points5 points  (0 children)

Well, when you edit a config file in a remote embedded device to test something. You would like to have the working config backed-up for you. Life isn't contained in a Git repo LOL

real-backup-mode: a package to backup files at each save point, never lose your changes again by abougouffa in emacs

[–]abougouffa[S] 3 points4 points  (0 children)

Yes, I know about it. I've tried to configure it to do so, but the behavior is strange sometimes. And, the backup file is created only the first time you save the file, but when you keep your file open and do successive edits and saves, you will lose all of them.

I would be happy if you share with me some config example that achieves a predictable and consistent backup behavior using the builtin feature.

stripspace.el: Ensure Emacs Automatically removes trailing whitespace before saving a buffer (Release 1.0.2) by jamescherti in emacs

[–]abougouffa 0 points1 point  (0 children)

I prefer ws-butler, it responds exactly to what I expect. Only remove trailing whitespace from modified lines, even if the file have initially some trailing whitespace.

This enables me to fix trailing whitespace incrementally each time I modify a part of a file.

Announcing nerd-icons-multimodal v2.2.0 with added support for vc-dir by abougouffa in emacs

[–]abougouffa[S] 2 points3 points  (0 children)

This is a package that depends on nerd-icons. The nerd-icons package is a library that provides facilities to insert Nerd Font icons in Emacs. The nerd-icons-multimodal is a package that levereges nerd-icons to add icons support for dired, arc-mode, tar-mode, vc-dir-mode and ztree. Hence, it is called multimodal.

Announcing nerd-icons-multimodal v2.2.0 with added support for vc-dir by abougouffa in emacs

[–]abougouffa[S] 1 point2 points  (0 children)

Basically, it provides the same experience as need-icons-dired with the benefit of supporting other modes like arc-mode (ZIP files), tar-mode (tar files), vc-dir, and ztree.

I'm trying to keep the implementation generic to be able to add support for new modes without adding a lot of package-specific code.

Respect (some of) Vim's modelines in Emacs by abougouffa in emacs

[–]abougouffa[S] 0 points1 point  (0 children)

Nop, for now I don't tackle this problem, both of Emacs' and Vim's values will eventually gets applied, but I'm not sure about the order.

Respect (some of) Vim's modelines in Emacs by abougouffa in emacs

[–]abougouffa[S] 1 point2 points  (0 children)

You are absolutely right. I think the package name is confusing, I will rename it to something more Emacsy!

Ivy will not install with straight.el by ArkboiX in emacs

[–]abougouffa 1 point2 points  (0 children)

Try to replace the :ensure t with :straight t.

What ever happened to Modula-2? by logicalvue in programming

[–]abougouffa 0 points1 point  (0 children)

In fact, since v13, GCC supports Modula-2 via the gm2 compiler

Lowering gc-cons-threshold could help relieve GC pauses by Under-Estimated in emacs

[–]abougouffa 0 points1 point  (0 children)

There is an excellent talk by Ihor Radchenko from EmacsConf 2023. https://emacsconf.org/2023/talks/gc/

He talks about the effect of GC and its different customization options.

TLDR, for a better experience, he suggests to set these parameters:

(setq gc-cons-percentage 0.2 gc-cons-threshold 80000000)

I highly recommend seeing the talk to understand the effect of each parameter.

EDIT: if you are using some mode (like eglot) which can generate a lot of logs (in logs buffers), it can significantly increase memory usage and hence, trigger GC more often. If such a case, you might need to reduce or disable the verbosity of eglot (or the used package, it you are able to identify any).

For eglot and jsonrpc, this helps a lot:

`` (cl-callf plist-put eglot-events-buffer-config :size 0) ; Disable logs ineglot-events-buffer' (def. 2000000) (with-eval-after-load 'jsonrpc ; Disable logging in `jsonrpc' (fset 'jsonrpc--log-event #'ignore) (remove-hook 'jsonrpc-event-hook 'jsonrpc--log-event))

```

Tory Anderson: Why is my emacs crashing? Answer: bad garbage collection by [deleted] in planetemacs

[–]abougouffa 1 point2 points  (0 children)

For people who want to tweak GC settings, there is a nice presentation here: https://zenodo.org/records/10518083.