emacs

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

sunoc, in How to make undo work in the scratch buffer

Hi, That’s a surprising issue, especially if the scratch buffer is the only text buffer in which the undo doesn’t work. Here is what I’m thinking right now:

  • Just to be sure, isn’t your scratch buffer in read-only ? You can toggle that with C-x C-q.
  • Is the keybinding you are using to undo set properly ? You can check it with C-h k C-/ (for example, for checking C-/).
  • If it’s none of these, I’d try to run the undo function directly with M-x undo to see if you can get some meaningful error messages.

I confirmed with both my personal config that uses undo-tree (great tool btw) and also in a default configuration of Emacs; both cases work fine to undo in scratch.

Hope any of that can help!

Cheers

edumerco,

Hello Sunoc.

  • the buffer is not in read-only, but it always start as so.
  • the keybinding is ok since it works in all the rest of the buffers.
  • Upon calling undo, emacs says “no undo information in this buffer” (searching for this didn’t seem to give relevant information except something from 2006 and then something about specific of a table-spreadsheet that I don’t use).

From this and @ouigol (I will relpy after this one) it looks that it may be my configuration, since I’m using vanilla emacs with my own configuration.

Anyway, thanks a lot for your time! :)

sunoc,

After checking the source, it looks like this error is triggered when the buffer-undo-list variable is equal to t, which means the buffer is unmodified, or at least that this variable is not modified from the scratch buffer.

There is something else in the documentation of this variable: <If the value of the variable is t, undo information is not recorded.> Maybe you can try to fix your issue by forcing the buffer-undo-list variable to nil for the elisp mode, as follow:

(add-hook 'elisp-mode (lambda () (setq-local buffer-undo-list nil)))

edumerco,

Maybe you can try to fix your issue by forcing the buffer-undo-list variable to nil for the elisp mode, as follow: (add-hook 'elisp-mode (lambda () (setq-local buffer-undo-list nil)))

I tried it but still no joy…

Looking at this issue I noticed 3 things that may help to pinpoint the origin…:

  • I have 2 variables set that affect the scratch buffer in my config (without yours, that it’s the 3rd):
<pre style="background-color:#ffffff;">
<span style="color:#323232;">                  (setq initial-major-mode 'org-mode)
</span><span style="color:#323232;">                  (setq-default major-mode 'org-mode)
</span>
  • Before this reply, (setq-default major-mode 'org-mode) was (setq default-major-mode 'org-mode). Both expressions seems indistinguishable in the resulted behavior.
  • The scratch buffer starts in org-roam mode (and read-only mode), which is very strange, but can obviously be related and/or part of the problem. The org-roam section (my config is literate in org-mode) comes before this variables being set.

What does this info may imply?

sunoc,

Okay, I could reproduce your situation by evaluating

<pre style="background-color:#ffffff;">
<span style="color:#323232;">(setq initial-major-mode 'org-mode)
</span><span style="color:#323232;">(setq-default major-mode 'org-mode)
</span>

This setup forces the scratch buffer to be in org-mode, apparently breaking most of the available keybindings for it, including the undo.

The value for the initial-major-mode should be kept as lisp-interaction-mode, if your configuration requires to set it.

Otherwise I would remove both of these lines all together and see if the default behavior brings back the scratch buffer to be in the expected lisp-interaction-mode again. The additional hook I provided in my previous post shouldn’t be needed either.

plugd, in Does anyone use emacs as their main terminal emulator?

Yes, I have been using eshell exclusively for the last 7 years. It does have a few drawbacks, but for me it’s definitely a win overall due to a) everything being in a buffer, b) being able to run both elisp functions and executables from the command line, and c) tramp.

P.s. I chuckled a bit when you mentioned sixel graphics support as modern. :) Jokes aside, I have my own toy implementation of sixel graphics in elisp, so decent emacs support is probably out there already.

christopher, in Wrote minimal minibuffer-centric MPD client

To install it on emacs 29 paste this into a scratch buffer and evaluate it:


<span style="color:#323232;">(package-vc-install
</span><span style="color:#323232;">  '(minimpc :url "https://codeberg.org/nmtake/minimpc.el.git"))
</span>

And put this in your init.el: (require 'minimpc)

You don’t need Vertico or Orderless. I’m using emacs’ built-in completion–it works fine.

nmtake,

Thank you for trying the package! I completely forgot to mention require in README, and didn’t know package-vc-install. I’ll add it to README later.

I’m using emacs’ built-in completion–it works fine.

I hope it works on other packages like helm or ivy too.

AusatKeyboardPremi, in Does anyone use emacs as their main terminal emulator?

This is a problem that I face too. I have not yet figured out how to smoothly move over my terminal workflows to vterm (running ZSH in vi mode).

I even made a post here asking for suggestions but I have not found a graceful solution to it yet.

achy1les,
@achy1les@mastodon.social avatar

@AusatKeyboardPremi @kelvie If you use doom-Emacs, you just hit C-z to go to Emacs-state and hit it back again to go back to Evil-mode after working in a mode you think Emacs-state is more productive...

Byter, in Does anyone use emacs as their main terminal emulator?

I haven’t fully moved my terminal needs to Emacs (though I’d like to) for the same little niggles you mentioned. Just wanted to recommend another option amongst the good ones already suggested here.

codeberg.org/akib/emacs-eat/

Makussu,

How do u toggle eat? Just a keybind to open it and close it with q?

Byter,

I’m not sure I understand your question.

Eat has its own major mode which is used when you open a standalone buffer via the eat function.

When it’s embedded in Eshell it mostly just does the right thing whenever you invoke a command that uses terminal control codes (e.g. htop) – and many of those can be closed with q, yes.

I assume Eat is activated for any program listed in the eshell-visual-commands variable (but I’ll admit I don’t really understand how that works). The notable new minor modes present when I run htop in eshell are Eat–Eshell-Local and Eat–Eshell-Process-Running.

Makussu,

Yeah i was just asking if you close your eat buffer with q. I really like having one button to open and close my terminal so thats why i asked. Thanks for the extensive awnser tho

kebabslob,

Same little what

kyoji, in The Emacs Window Management Almanac

This is an incredible piece of work, thanks for creating and sharing with us!

aport, in Does anyone use emacs as their main terminal emulator?

I more or less live in emacs on my development machine, so vterm is my main terminal

nmtake, in Wrote minimal minibuffer-centric MPD client

Fixed wrong link - now the post title correctly link to the repository ;)

hajovonta, in Does anyone use emacs as their main terminal emulator?
@hajovonta@mastodon.online avatar

@kelvie hm... I rarely use terminal emulators anymore, I mostly use Eshell nowadays.

hajovonta,
@hajovonta@mastodon.online avatar

@kelvie many people use vterm which is in many aspects better than ansi-term.

kelvie,

Thanks for the rec, my first impression is that it doesn’t really work well with evil-mode, but that may be my configuration error (as it is with emacs).

aport,

Vterm not working well with evil was actually my motivation to drop evil completely and embrace emacs key bindings.

It was the best decision I made. I don’t perceive a any measurable impact on my ability to efficiently write code or edit text, but I’ve seen a significant improvement on my ability to use emacs in general

kelvie,

I went the other way, I’ve used emacs key bindings for over a decade and switched to evil because it appears most things in doom emacs worked better.

Magit is still a bit of a mess with evil, though, but is manageable.

Maybe one day I’ll switch back again, but my fingers know both.

Makussu,

If you like modal but find evil a little bit weird, try github.com/meow-edit/meow. Its a bit of work to set up, but once you made it yours its great!

Shareni,

It’s probably a configuration error.

As far as I remember it was working fine like a year ago when I was trying to make my own config (just vterm and evil packages were required). At the time the Doom people were saying it was impossible due to how terminal emulation works. Now it’s mostly working in Doom unless you go over 1 line. If you do, you’re not in a good place since you can’t use ESC to jump between words.

sping, in The Emacs Window Management Almanac

Interesting post given auto placement is something I still haven’t got to grips with after 30 years. Definitely some good techniques to follow up on, along with motivation to up my embark and ace-window/avy game.

StrangeAstronomer, in The Emacs Window Management Almanac

OK, more than wow! Probably the most helpful, in-depth and up to date coverage of this topic I’ve seen in 40 years of barely scratching the surface of emacs. Thank you!

StrangeAstronomer, in The Emacs Window Management Almanac

Wow! Just wow!

hajovonta, in Writing Lisp Code with ChatGPT
@hajovonta@mastodon.online avatar

@DrOps This gives a simple "Server Error" message.

DrOps,

For plaindrops.de or feddit.de?

hajovonta,
@hajovonta@mastodon.online avatar

@DrOps
I clicked the link in the post.

DrOps,

This is the fediverse. Depending on which service you are, and what software you use, you see either my blog article on plaindrops.de/blog/2024/CodingLispWithChatGPT/

or the Feddit server I posted this Link on. You got the latter, and it’s web interface is throwing that error. I informed the admin.

NanoooK, in A Hydra for Denote, and what I learned from it.

Thank you for documenting this, and sharing it.

I’ve never took the time to setup Hydra even though it seems nice.

wargreymon2023, in [QUESTION] Book recommendation for Emacs

c-h r

  • All
  • Subscribed
  • Moderated
  • Favorites
  • emacs@lemmy.ml
  • Durango
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • tacticalgear
  • khanakhh
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • everett
  • ngwrru68w68
  • kavyap
  • InstantRegret
  • JUstTest
  • cubers
  • GTA5RPClips
  • cisconetworking
  • ethstaker
  • osvaldo12
  • modclub
  • normalnudes
  • provamag3
  • tester
  • anitta
  • Leos
  • megavids
  • lostlight
  • All magazines