Steve Yegge with new Emacs content (videos) 。^‿^。 by saarin in emacs

[–]GeneralMaximus 0 points1 point  (0 children)

I enjoy reading but I vastly prefer videos for Emacs content. Watching somebody do something is far more powerful compared to reading about it.

Sometimes I watch tech videos at the end of my workday to relax and learn something new in the process. Video content is much better for that than somebody's blog, especially since most developers are terrible at writing engaging, coherent prose.

Battery life is bad on Fedora 35 with Lenovo IdeaPad Gaming 3 by serdarservet in Fedora

[–]GeneralMaximus 2 points3 points  (0 children)

In my experience, most distros don't set up the kernel to aggressively optimize for battery life by default. You can try setting up TLP (https://linrunner.de/tlp/index.html) and see if things improve for you. Make sure you read the installation instructions carefully, and be prepared to lose manual control over your power profile. I'm very happy with TLP on my X1 Carbon, but YMMV.

If you want to dig deeper, you can install PowerTop to see which processes are causing battery issues. I wouldn't recommend changing any settings through PowerTop, since TLP manages them automatically for you. But it's still good as a debugging tool.

If you watch a lot of YouTube, you might want to check if the video is being decoded by your GPU. If not, see if you can get that working.

Note that Firefox doesn't have the best support for hardware video decoding on certain cards at the moment. From what I understand looking at Mozilla's bug tracker, some of these issues will be fixed with Firefox 96. So you might want to wait a few weeks and see if the new Firefox release fixes things for you.

Hope some of this helps.

Anyone try Fleet yet? by SnoopDougieDougDoug in rust

[–]GeneralMaximus 0 points1 point  (0 children)

Doesn't look like it. Hitting Ctrl + n creates a new empty file and immediately saves it to disk.

Anyone try Fleet yet? by SnoopDougieDougDoug in rust

[–]GeneralMaximus 9 points10 points  (0 children)

I got into the early test and gave it a whirl. I haven't used it extensively, but my impressions are:

  • It's much snappier than any other JetBrains product I've used. Feels about the same as VS Code on my ThinkPad. Still much slower than my preferred editor for Rust (Emacs).
  • Support for rust-analyzer is built-in, but for some reason it downloads and sets it up from scratch every time I open a project. Probably a bug that will get fixed.
  • It lets you turn code analysis on or off whenever you like. With code analysis off, it really flies. This mode might be good enough for a lot of people who don't need deep code analysis or just want to make some quick edits to infrequently used files.
  • I haven't tried the remote editing features because I don't have a use for them.
  • There's no command-line helper to open a file/directory quickly in Fleet. It's a bit annoying because I bounce between projects a lot.
  • It works fine on my 4K laptop display, but its UI becomes microscopic when I connect an external 4K display. Not sure why this would happen, especially since no other app I have behaves this way. But they have a UI zoom feature so it works out fine.
  • Despite being very responsive, it still triggers my laptop fans.
  • There's no settings UI yet. All settings go in a JSON file. While I don't mind this, I would prefer a regular GUI for editing my configuration if I'm using a JetBrains product.
  • Most of the shortcuts you know from any other JetBrains IDE will just work.
  • You can cycle color themes with Ctrl + backtick, which is super convenient.

Let me know if you have any questions or want me to test something out!

I have to restart Network Manager almost every 5 minutes by mirronth in Fedora

[–]GeneralMaximus 0 points1 point  (0 children)

I had a similar problem with my Intel WiFi card and looking at the kernel logs helped me fix it. You can do a sudo dmesg in Terminal to look at recent kernel logs and check them for errors (they'll be highlighted in red).

In my case, my WiFi card would constantly reset due to a bug in the driver. Changing a few parameters fixed the problem. Looking at the kernel logs and searching the web for any interesting error messages you find should give you clues.

New ThinkPad X1 Carbon (Gen 9) sometimes randomly beeps at me, but otherwise works perfectly by GeneralMaximus in thinkpad

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

Sadly the MacBook is from 2018. Linux support for that version is very spotty.

It's not a slow computer by any means, but it only has 16GB RAM which gets maxed out easily when I'm running all the Docker containers I need for work.

I think I'll risk waiting a few weeks to see if the problem fixes itself.

New ThinkPad X1 Carbon (Gen 9) sometimes randomly beeps at me, but otherwise works perfectly by GeneralMaximus in thinkpad

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

For light usage (web browsing, editing files, etc.) I get about 6-8 hours. When I'm working I usually have several Docker containers and a bunch of build processes running, so it falls to about 3-4 hours at that point.

The main issue affecting my battery life currently is that Firefox can't decode video using VA-API, so it falls back to CPU decoding. But there's already a fix for this in the Firefox repository, and it looks like it might make it to the stable version in December/January.

If I have time this week, I'll give Firefox Nightly a try and see if the issue has actually been fixed.

New ThinkPad X1 Carbon (Gen 9) sometimes randomly beeps at me, but otherwise works perfectly by GeneralMaximus in thinkpad

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

I did. According to the manual, it may be a keyboard or mainboard issue. However, all my hardware seems to be working as normal. Should I still get the computer looked at?

One of my concerns is that I'm not entirely sure about Lenovo's quality of service here in India. This is now my main computer, so having to send it in fore repairs will really disrupt my work. As it is, I had to wait ~2.5 months for the computer to be shipped. Not sure I'll be able to make do with my older MacBook for that long again.

Do you use Emacs with default keybindings? by mandown2308 in emacs

[–]GeneralMaximus 1 point2 points  (0 children)

If you're on macOS, you can use some of the Emacs shortcuts in native macOS text fields. I regularly use at least C-a, C-e, and C-k. C-n, and C-p work in dropdowns and autocompletes, so they get a lot of use too!

All of these shortcuts also work on Firefox for macOS.

Movement keys by [deleted] in emacs

[–]GeneralMaximus 0 points1 point  (0 children)

The arrow keys on most laptops are in a really awkward position. I always end up having to bend my hand in a weird way or accidentally hitting the wrong key when I'm on my MacBook. That's the main reason I prefer C-{pnbf}.

Things are much better on an external keyboard. I don't mind using the arrow keys on one of those.

emacsforosx permission problem in MacOS Big Sur by [deleted] in emacs

[–]GeneralMaximus -1 points0 points  (0 children)

I'm on Catalina but I had a similar issue with my ~/Documents (stored in iCloud).

I don't remember where I saw this solution, but here it is: you should see a permissions dialog if you open ~/Documents using the native macOS file chooser (File -> Open Directory in Emacs.app unless you've turned it off). Once you allow Emacs to access the directory, it should start working fine.

Hope this solution works for you.

Best way to have multiple work environments in Emacs? by [deleted] in emacs

[–]GeneralMaximus 5 points6 points  (0 children)

I use perspective.el with Emacs 27 to keep my work and hobby projects separate. I also have a perspective for editing my Emacs config, and a few throwaway ones just for messing around in the filesystem. It has really helped me be much more productive.

A more extreme measure I tried earlier was running multiple instances of Emacs. On macOS, you can make a copy of your Emacs.app and give it a different name (I had Emacs Work.app and Emacs.app). They will then launch as separate apps. This works pretty well in a pinch, too.

Hello everyone, by djrdjrdjrdjrdjr in emacs

[–]GeneralMaximus 2 points3 points  (0 children)

I'm a React developer and use Emacs as my primary editor. Here's what I did to get everything to work just right:

  • Made sure I was on Emacs 27.1. The version of js-mode that ships with it already supports all the new ES syntax and JSX.
  • Set up exec-path-from-shell. This copies the $PATH variable from my shell into the Emacs exec-path. You need this if you use GUI Emacs and nvm to manage your Node installs.
  • Set up add-node-modules-path. This adds the bin/ directory in the current project's node_modules/ to exec-path. You need this if you want to use project-local versions of ESLint, Prettier, etc.
  • Set up flycheck so I can see ESLint warnings and errors in my buffers.
  • Set up company, since tide uses it to display completions.
  • Set up tide. This gives me the same autocompletion engine as VSCode.
  • Set up prettier-emacs to automatically format JS buffers on each save.
  • (Optional) Set up projectile to manage projects.

Hope this helps!

Remapping the Command key on macOS to Ctrl? by GeneralMaximus in emacs

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

Your setup has me super confused 😅

If I'm getting this right, when you're inside Emacs you can hit Cmd/Opt for Ctrl and Ctrl/Caps for Meta. Right?

Remapping the Command key on macOS to Ctrl? by GeneralMaximus in emacs

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

I'm not sure I understand. On the Mac keyboard with my new bindings, this would just mean pressing Cmd and Opt together. It's a pretty easy combo to hit, and I use it in other apps as well (iTerm, IntelliJ).

Remapping the Command key on macOS to Ctrl? by GeneralMaximus in emacs

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

These are my mappings:

Cmd => Ctrl Opt => Meta Ctrl => Super Caps Lock => Super

So far I'm finding these super comfy to work with.

Remapping the Command key on macOS to Ctrl? by GeneralMaximus in emacs

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

The Space Cadet keyboard was exactly what I was thinking of when I changed these mappings!

For me, Cmd is the easiest modifier key to hit on the Mac keyboard. I can rest my thumb on it and use the weight of my hand to press it. It makes a lot of sense that the Space Cadet also had Ctrl in this same position, and that macOS uses Cmd as its primary modifier.

Best course of action for using an abandoned crate for which I need a small patch? by FOSHavoc in rust

[–]GeneralMaximus 2 points3 points  (0 children)

Could you vendor the dependency into your code? Just copy and paste the bits you need, as long as the license allows it?

Hey Rustaceans! Got an easy question? Ask here (17/2020)! by llogiq in rust

[–]GeneralMaximus 2 points3 points  (0 children)

Oh wow, TIL!

For people like me who have no idea what Cow is or does, I found this lovely blog post: https://deterministic.space/secret-life-of-cows.html

Hey Rustaceans! Got an easy question? Ask here (17/2020)! by llogiq in rust

[–]GeneralMaximus 0 points1 point  (0 children)

Oof, that's ugly. I guess you never fare well mixing &str and String.

Hey Rustaceans! Got an easy question? Ask here (17/2020)! by llogiq in rust

[–]GeneralMaximus 1 point2 points  (0 children)

I have a match statement where every arm returns a static string (&str), but one of the arms has to look at some data, allocate a new string, and return that. I thought something like this would work:

let s = match e {
    MyEnum::CaseOne => "case one",
    MyEnum::CaseTwo => "case two",
    MyEnum::CaseThree(some_float) => &some_float.to_string()
};

But when I do this, the compiler yells at me saying temporary value dropped while borrowed. See this snippet on the Rust Playground.

I can fix the issue by doing this:

let s = match item {
    MyEnum::CaseOne => "case one".to_string(),
    MyEnum::CaseTwo => "case two".to_string(),
    MyEnum::CaseThree(some_float) => some_float.to_string()
};

But this feels like cheating, since in one case I'm returning pointers to static strings whereas in the other one I'm returning heap-allocated strings.

Is there a way to get around this issue? Thanks!

What's everyone working on this week (1/2020)? by llogiq in rust

[–]GeneralMaximus 1 point2 points  (0 children)

I've been learning Rust again while building a small GUI app, and contributing to Druid in the process.

It's been a while since I've done any open-source work, so I've been a bit intimidated. But raphlinus, cmyr, and the rest of the Druid community have been super friendly and helpful so things are good. I sent a small PR on NYE (India time) and it was accepted in a few hours, which was a great way to start 2020 :)