Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was an Emacs user back in my software writing days, but I thought I had left it behind when I became a lawyer. Over the past month or two however I’ve moved more and more of my workflow over to Emacs.

I started with using Org Mode and PDF tools for note taking and reviewing PDFs and task management: https://news.ycombinator.com/item?id=30492373. More recently I switched my email over to mu4e: https://www.emacswiki.org/emacs/mu4e. Unfortunately I can’t get it to interface properly with Office 365, which has heavily locked down POP/SMTP. So I used a couple of Power Automate flows to store incoming emails into a maildir format directory in OneDrive, which I then read from mu4e: https://en.wikipedia.org/wiki/Maildir. I also use Power Automate flows to grab my calendar and store it to Org files, and watch for queued emails and send send them. Power Automate is just about the worst programming environment ever devised, but because UNIX systems like RFC 2822 (email) and maildir are so simple it didn’t take much fiddling at all!

Ironically, writing a bit of glue to get everything into Emacs offers better integration between email, calendar, todos, and notes, than just using Office 365’s own tools. After trying a ton of web/electron based tools for these purposes, going back to Emacs makes me think of this scene from Star Wars: https://m.youtube.com/watch?v=7hb8AYnRb-4

I’m using the Emacs 28.1 test release on Windows and the Emacs-Mac Port on Mac: https://bitbucket.org/mituharu/emacs-mac/src/master/. The latter has nice features like double buffering that make Emacs, while not modern feeling, quite presentable.

For such a huge change, the elisp native compilation works extremely nicely with every package I’ve thrown at it. Totally stable and ready for prime time.



Funny, just dealt with the whole O365 authentication just this week. With moving to 2 factor authentication you need to use OAuth 2 to do anything with it. I have my (work) O365 email forwarded, so I do have normal IMAP access. I use isync/mbsync [1] to receive email, goimapnotify [2] to get pushed new email, read/reply/etc with mu4e [3] and org-msg [4] and org-mode, and until recently just plain SMTP to send mail. This last part will break with 2 factor, but found oauth2ms [5] to set up the OAuth to work with O365 SMTP. The trick was to find the "tenet ID" from the Azure page of your organization and to use Thunderbird's credentials [6] (or another mail program, since I can't make new app registrations on Azure to have my own "application"). That should also allow you to use IMAP with OAuth 2 as well, but haven't done that since I still have the forwarding. (As usual, I think the Arch Wiki [7] covers most of this too.)

[1] http://isync.sourceforge.net/

[2] https://gitlab.com/shackra/goimapnotify

[3] https://www.djcbsoftware.nl/code/mu/mu4e.html

[4] https://github.com/jeremy-compostella/org-msg

[5] https://github.com/harishkrupo/oauth2ms

[6] https://hg.mozilla.org/comm-central/file/tip/mailnews/base/s...

[7] https://wiki.archlinux.org/title/Isync#Using_XOAUTH2


You may want to try using DavMail [1] for interfacing with Outlook. It is a reverse-proxy for email, so it talks to Outlook, and then mu4e can talk to DavMail directly.

[1] http://davmail.sourceforge.net/


How the hell did they break email? You need a browser with JS to log into your email server?


Isn't 2022 wonderful?


For instance, the Microsoft SMTP server in the cloud is picky about SSL/TLS protocols and ciphers.


Alas, in some orgs you will need permission to authenticate davmail to Outlook. My IT department has not approved davmail.


How can they tell?

Honest question because I fear my uni will start doing this out of “security “.


Office 365 requires SMTP/POP/IMAP to use an "xoauth" authentication scheme which relies on getting an authentication token from a web browser. The process of getting that token involves sending a request that includes an application ID.


Are you using viper or evil-mode often (or some other thing which gives emacs vi bindings, I think there are a couple)? Because navigating text with emacs gives me the emacs pinky, I'm wondering how folks deal with that. Transposed cpslck with ctrl?


> Because navigating text with emacs gives me the emacs pinky,

I had RSI issues early in my career (not Emacs related), and learned some tricks that come handy with Emacs.

Your keyboard has two control keys. Use both of them. In particular, use the "opposite" one. If you want to press C-c, use the right Control key with your right hand. If you want to press C-l, use the left control key with your left hand. This way you're distributing the work with both hands and are not twisting your hands into weird shapes trying to get both buttons with one hand.

And also: Once you do this, no reason to insist on using your pinky to hit Control. I often use my thumb as well.

I never got the Emacs pinky.


I curl my little finger and press Ctrl with the first knuckle. No hand movement required in my case.

(There’s a picture of my hand doing this on Xah’s site somewhere, to which he’s added a warning about potential long term effects; but I’ve been doing this for over ten years now, with no ill effects noted.)


> If you want to press C-c, use the right Control key with your right hand

First thought: but C is on the right.

Second thought: ah, I use Dvorak


map capslock to be a control key.


Although it's the canonical solution, that would be a degradation for me. It's more ergonomic to use two hands to enter any modifier sequence. Mapping Capslock to Control doesn't provide extra benefits to my solution.

The other problem people have with the pinky is that they're twisting their wrist while typing, which is also against more ergonomic guidelines. The recommendation is to move the whole arm. Once you get used to that, there's no good reason to use the pinky to hit Ctrl (even when rebound to Caps lock). I would guess over half the times, I'm using some finger other than the pinky to hit Ctrl.


No it's not a degradation. It puts Ctrl in a sane place much easier to reach with your pinky. And if you really were going to use your thumb on the left control, then it's about the same distance to the Caps Lock key. I'm replying to the original asker with my advice, if you want to read more about what I think :)


> It puts Ctrl in a sane place much easier to reach with your pinky.

That it does, but there's no good reason I should use my pinky to hit Ctrl to begin with.


Your reasoning is most bizarre.

By that rationale, there's no good reason I should use my (left) forefinger to press "g" to begin with.

(qwerty layout assumed...)


...or perhaps get a smaller keyboard. I have the Lenovo KU-1255 which is just the right size for me. as always, YMMV.


The emacs keybindings evolved on keyboard with two control keys on both sides, later augmented to have replicated (starting from space bar) control meta super Hyper keys. A PC104 keyboard's main sin for emacs akt where control should be - but not requiring pinky for bucky bits


I set the key left to the spacebar (usually Alt or Cmd) to act as Ctrl in Emacs, so I can press it with my left thumb. This can be done in the Emacs config like this

  (setq mac-control-modifier 'command)
  (setq mac-command-modifier 'control)
  (setq mac-option-modifier 'meta)
  (setq mac-control-modifier 'super)


Note that these variables are specific to the Mac Port (https://bitbucket.org/mituharu/emacs-mac/src/master/). They use an `ns` prefix instead of `mac` in a build based on the GNU mainline. And presumably something else entirely on another OS.


It's mac-specific, but not Yamamoto port specific. You can also find them in the vanilla EmacsForMacOSX port https://www.emacswiki.org/emacs/EmacsForMacOS#toc24


Huh, I see. I stand corrected.


ns -> NeXTStep

from ancient times...


The trick is to hit ctrl with the part of your hand where your pinky attaches to it. Now all you do is rotate your wrist slightly, and you hit ctrl. Doesn't work very well on flat/low-profile keyboards, doable with thinkpads, not at all possible on macbooks.


This trick gave me some pretty bad pain in my left hand after a month or so. Remapping control to CAPS LOCK worked for me for years, but what really helped was when I switched to a keyboard that had six keys on each thumb cluster, which allowed me to map control and meta to the thumbs.


Which keyboard, if you don't mind my asking?


Kinesis Advantage 2. In my opinion it’s still the best ergonomic keyboard on the market, I just wish it had better firmware.


You can update it to QMK, mods exist: https://hackaday.com/2021/08/05/kinesis-teensy-qmk-advantage...

There is also a successor available.


Mapping control to its original keyboard placement, caps lock, is the first thing I do on any new computer/keyboard.


I mapped Control to a key under my thumb instead of Caps Lock. That's where it was originally when they chose the binding anyway. It's very comfortable now.


Yeah the caps lock switch is critical I think, since then you can press that key without curling or twisting the finger. Look at technique for musical instruments that require applying pressure with that finger, eg cello, they go through a lot of trouble sometimes to avoid that particular contortion bc of its lack of control and the long-term stress it puts on the hand.

If that doesn't work I know people who have used a usb foot pedal and it seems to work well for them.

Or, if vi bindings work for you, just use vi bindings. There's no nobility in the emacs bindings. I like them but if something else works better just use it.


No. In my youth I just played through the pain, but I recently just ordered this: http://xahlee.info/kbd/xbows_keyboard_review.html


Fair (though I recommend you give kinesis a try: https://kinesis-ergo.com/keyboards/advantage360/ ).

Separately, I just want to throw it out there, you guys should try sublimity: https://github.com/zk-phi/sublimity

Particularly, the minimap is awesome because it provides an intuition about where one is and that just feels nice.


How did you learn that keyboard exists? It is not on their keyboard page. Kinesis needs a better organized site.

I got the Freestyle2 a few weeks ago, enjoying it, still have some issues finding the navigation keys, home, end etc. I really like having my arms pointed straight rather than angled in like with a normal keyboard. Keys are a bit mushy, went from cherry blues.


This model is not yet in full production, and while they claim it will be shipping this summer, it's possible we won't see it this year.


my .02$: get an ergonomic keyboard (I use the MS Sculpt keyboard nowadays), and learn to type like a pianist (use both hands, don't be afraid to move them to minimise strain).


Sculpt is an amazing keyboard for programmers who need to press a lot of hotkeys. It has short spacebars and huge modifiers, very comfortable for your thumb. Not to mention it is split, negative tilted, tented and has a built-in wrist rest.


Agreed, the Sculpt coupled with an vertical mouse has been a game changer for me


I remapped control to the bottom row, whichever key my thumb naturally rests on. Usually alt. Also moved \, [, ], enter, and backspace to avoid reaching for them with my right pinky. I think if your fingers start feeling even a little bit weird, you should keep remapping keys until they feel good all the time. Doesn't make sense to wait for it to get worse before taking action.


There is an extensive guide on moving Ctrl on different OSes/Window managers, which can be found in the EmacsWiki https://www.emacswiki.org/emacs/MovingTheCtrlKey


I gave up the fight to get Emacs to read Outlook emails. Instead, I figured out how to set up Org mode links to Outlook emails, as well as a VBA macro to create an Org mode TODO item based off of an email.


For mu4e and Exchange, I use:

-offlineimap

both linux and macos.

and in my home laptop, davmail because it allows me to use 2FA, which has been implemented at my Uni for external use.


Davmail is great.

I've found mbsync/isync more performant than offlineimap.


yes everyone says so but I am not keen to change now, just out of laziness: there are too many tender points…


>[...] I started with using Org Mode and Org PDF for note taking and reviewing PDFs[...]

I wonder, what is "Org PDF"?


Sorry, I meant pdftools and org-pdftools: https://github.com/fuxialexander/org-pdftools


Ah, cool, thanks! I'll give that a try...


Thanks for the tips on PDF tools.

I also save org files on shared folders to sync among different machines. I use GnuPG via the epg package to encrypt all files before saving to the shared folders. GnuPG has relatively good cross platform support that I can move the encrypted files between different platforms.


Did Emacs solve their freezing issues on background I/O?


I wish we could have double buffering on Windows as well...


Relevant xkcd: https://xkcd.com/297/


As usual https://xkcd.com/297 on point




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: