Live data from Hacker News

Surprisingly, Emacs on Android is pretty good

kristofferbalintona.me

51–60 of 127 posts

Re: Surprisingly, Emacs on Android is pretty good

#51

Earlier quoted context omitted.

Don't be embarrassed by a setup that works. In the spirit of hopefully constrictive feedback: A/B: Any reason not to do emacs or neovim everywhere? You can copy your dotfiles to the server if needed? C: I wouldn't/don't use Dropbox either. If bash+scp works then great, but have you considered keeping your files in git? Still easy to sync over ssh from one machine to another, but natively handles things like sync conf…

I just haven't found Emacs to be particularly productive over SSH. IMO it works best on a local machine, there's just too much in the GUI which isn't as workable over terminal. Font rendering, images, clickable text links all take a hit. None are really deal breakers, but Emacs TUI just kind of feels like an afterthought. X11 over SSH doesn't feel responsive to me. Its almost more of an aesthetic choice really, its j…

> I just haven't found Emacs to be particularly productive over SSH. IMO it works best on a local machine, there's just too much in the GUI which isn't as workable over terminal. Font rendering, images, clickable text links all take a hit. None are really deal breakers, but Emacs TUI just kind of feels like an afterthought. X11 over SSH doesn't feel responsive to me.

But that's what tramp is for, it works nicely and is surprisingly well integrated into the rest of Emacs. The only obvious downside is initial performance, but that can be worked around by tweaking SSH settings to keep connections open.

Another hack I use is to initiate a connection from remote to my local Emacs instance. The use case is ssh'ing into a remote shell, typing "remote-emacs " and having that open the file on my local machine.

I did that by creating a script that gets my local IP from $SSH_CONNECTION, uses that to ssh into my local machine and executes "emacsclient -n /ssh:$HOSTNAME:$FILEPATH" which then in turn opens the remote file using tramp. Pretty useful.

Re: Surprisingly, Emacs on Android is pretty good

#52
post #35

Earlier quoted context omitted.

> don't listen to ~any emacs user's opinion I sort of came here to say the same thing. The intersection between (the set of people who care about good UX) and (the set of people who would try to use emacs on android) is the empty set. Emacs users' self-flagellation is pretty legendary, and I say this as an emacs user (though I've mostly given up on how janky and slow it is compared to modern editors and only use it f…

I agree with you on UX but disagree with everything else. If you use native elisp compilation, I find its speed to rival an average editor. Completions can be slow in lsp-mode but still faster than VSCode (and emacs itself ships with eglot, a less full featured alternative to lsp-mode, but may be faster. I haven't used it enough to judge.) This is due to shelling out to LSPs and the fact that not all LSPs are particu…

I've been using emacs for 15 years as my daily editor. One thing that never fails is that when I share the fact that I've switched away, emacs users fall over themselves to tell me I'm wrong.

I assure you that my emacs setup is as optimized as it can be. Native compilation, all that jazz. I've compiled my own. But emacs is ultimately a lost cause unless something drastic changes. The single threaded nature of it means that you need to just live with your editor regularly freezing for a whole second while working in bigger projects using modern tooling. The only way to remedy this is to turn off as many features as possible and accept a worse tooling experience. Shifting the blame for emacs poor internal architecture over on the poor LSPs is silly. Every other editor handles this better than emacs.

For now, I'm using zed and it was really an eye-opener to how fast an editor can be and feel. I replicated a large part of my workflow, basically all the keybindings, and while there are things I miss (projectile and some other things), I can live without them in exchange for not having my editor choke constantly when working on big projects while emacs chugs through json from lsp or something like that.

Re: Surprisingly, Emacs on Android is pretty good

#53
I tried installing Emacs on Android and then realized: How on earth am I even gonna input all the special key combos that I use for things in Emacs?

I figure it is impossible, without a special keyboard installed and even then it gets cumbersome to quickly input something like C-x C-s for saving a file. I am not motivated enough, to come up with a whole different shortcut system, just for rare if ever Emacs on phone use.

Re: Surprisingly, Emacs on Android is pretty good

#54
post #31

Caveat: all this is on iOS: The only reason I want emacs on my phone is the one thing I don’t have: I want my org notes to be on both desktop and mobile. But syncing files across both has been dreadful, even in paid apps: duplicates everywhere and I constantly have to rechoose the files in a file finder UI. So my reminders are not just ever present for the time when they’re relevant, they’re just “not there” unless I…

I've been thinking about this a lot recently, although I'm a vim user (please don't hate me), visiting this thread to see if the emacs community has solved this.

My use case is I want the vim analog to some emacs tooling like org-mode, everywhere. I want open formats, I want vimwiki-style linking, I want taskwarrior integration, and I also want it to synch on all my devices.

There are some proprietary tools like NotePlan that use iCloud as backhaul (very well, actually), and it's open format, but it has an opinionated UX that isn't quite me, and I think I just want to stay in vim as much as possible that I can do what I want with. I suspect most people here interested in emacs would have a similar take on it.

If you're on iOS, and your laptop/desktop is macOS, you have a cloud drive that is (IMHO), better than Dropbox right there, baked in, so what would it look like to use that file system? Not awful actually. I've found device synch across that file system to be transparent and high quality, as long as I remember to save things regularly.

The problem for me when it comes to the mobile experience is that I think - no matter whether you're an emacs or vim user - you probably don't want that mode-based editing on your phone.

The best notes app on iOS is Apple Notes because it does a lot of things incredibly well for the context of writing notes one-handed while stood on a bus, or while sat in a coffee shop with a small touch-screen keyboard.

Where I'm at right now is I want to build something that can read and interact with my files on my phone, but is not mode-based - it just uses Apple text editing like Apple Notes, and saves everything in iCloud files (or Dropbox as a backup to get out of the apple ecosystem), and on my local machine I just get that live synched experience with the editor that makes sense.

So the format I'm mostly interested in (vimwiki), has formatting that would be understandable as styles in Apple Notes, so I'm trying to work out whether to a) write something to import/export to notes from vimwiki, or b) provide a vimwiki-aware editing tool with the ergonomics of Apple Notes for my phone. I suspect doing the same but for emacs and org-mode would do the job well for those who want that experience too.

Re: Surprisingly, Emacs on Android is pretty good

#55

Earlier quoted context omitted.

Not to criticize you - I also use eglot and it's great - but let me mention that people have been doing pretty meaningful software development for several decades now, and LSPs are, I don't know, 5 years old? There's a saying in my language, "the appetite grows while you eat"...

I think it's a fair complaint. You're on a setup with bad ergonomics as it is (tablet + Bluetooth keyboard.) Dealing with that and no LSP is rough. I'd be happy writing code on a desktop without an LSP, though I'd be happiest with both.

I did my share of coding on a Commodore 64 (have you seen that keyboard?) with a cassette tape as the only external storage, no debugger (just a very poor BASIC variant) and (of course) a mono CRT tv set as a monitor. No internet, of course, just a few books/magazines.

Kids these days... ;-)

Re: Surprisingly, Emacs on Android is pretty good

#56
post #52

Earlier quoted context omitted.

I agree with you on UX but disagree with everything else. If you use native elisp compilation, I find its speed to rival an average editor. Completions can be slow in lsp-mode but still faster than VSCode (and emacs itself ships with eglot, a less full featured alternative to lsp-mode, but may be faster. I haven't used it enough to judge.) This is due to shelling out to LSPs and the fact that not all LSPs are particu…

I've been using emacs for 15 years as my daily editor. One thing that never fails is that when I share the fact that I've switched away, emacs users fall over themselves to tell me I'm wrong. I assure you that my emacs setup is as optimized as it can be. Native compilation, all that jazz. I've compiled my own. But emacs is ultimately a lost cause unless something drastic changes. The single threaded nature of it mean…

You may have a very justified reason to switch, including nnot liking one aspect of emacs. But you are presenting it as a general flaw. Which people cannot obviously accept as it’s fine for them and they are not experiencing your issue (and as you know, everyone’s setup and workflow are different)

As for the single threaded nature of it, it doesn’t bother me. Because what should be async already is. The only thing left that is synchronous follows closely the repl model of the terminal. I issue a command and I wait for the result. If the result doesn’t matter or I want part of it as soon as possible, then it can be async and there’s plenty of way you can make it so.

Re: Surprisingly, Emacs on Android is pretty good

#57
post #35

Earlier quoted context omitted.

> don't listen to ~any emacs user's opinion I sort of came here to say the same thing. The intersection between (the set of people who care about good UX) and (the set of people who would try to use emacs on android) is the empty set. Emacs users' self-flagellation is pretty legendary, and I say this as an emacs user (though I've mostly given up on how janky and slow it is compared to modern editors and only use it f…

I’m an Emacs enthusiast and also build iOS apps powered by org markup. The more I used my apps, the more I wanted their UX optimised for mobile. This often means completely rethinking the Emacs experience when bringing to mobile. This is most obvious in my latest app [1]. Org markup fully fades as implementation details. Of all my apps, this is the one I personally use the most. Proudly, I also started getting non-Em…

Emacs is ultimately an REPL environment, but ones where you can bind commands to bindings. And there’s a lot of bindings possible in a keyboard.

A mobile experience can be fine if you want a restricted subset of commands. You can then map them to buttons. But the core emacs experience is the ability to create your own commands and have different bindings.

The closest implementation, IMO, would be a streamdeck like UI, but with a transient or hydra like UX.

Re: Surprisingly, Emacs on Android is pretty good

#58
post #4

Earlier quoted context omitted.

You can connect a bluetooth keyboard and mouse to an Android device -- somehow everybody thinks you have to buy some special $300 keyboard to attach one to a tablet but the basic keyboard from Amazon Basics does just ifne.

Good point, though I don't always have my Bluetooth keyboard available so I'm still interested in hearing people's experiences with those virtual keyboard apps.

Yeah when I think of “emacs on android” I kinda imagine a touchscreen. If you’re using a real keyboard, why not just use a real computer?

Re: Surprisingly, Emacs on Android is pretty good

#59
My computer died a few months ago and Emacs on Android has carried me through well. Still able to do development on the go. Amazing, amazing work by the Emacs dev!

The Unexpected Keyboard is a great addition, but even with the stock Android keyboard, it's totally usable. Of course, it helps to add things to menus and remap the volume keys.

You can add buttons to the toolbar with something like:

  (tool-bar-add-item "spell"
                   'eval-last-sexp
                   'eval-last-sexp
                   :help "Eval last sexp")

  (tool-bar-add-item "back-arrow"
                   'xref-pop-marker-stack
                   'xref-pop-marker-stack
                   :help "Previous Definition")

  (tool-bar-add-item "fwd-arrow"
                   'xref-find-definitions
                   'xref-find-definitions
                   :help "Find Definitions")
There are many icons bundled with Emacs that you can reuse: https://cgit.git.savannah.gnu.org/cgit/emacs.git/tree/etc/im...

You can remove toolbar buttons:

  (tool-bar-add-item-from-menu 'find-file "")
Otherwise, you can add to menus:

  (define-key global-map
            [menu-bar edit expand]
            '("Expand word" . dabbrev-expand))
Remapping the volume keys is super handy, especially when you change the behavior by mode or buffer:

  (global-set-key (kbd "") 'fill-paragraph)

  (global-set-key (kbd "") 'my-runner)

  (defun my-runner ()
  (interactive)
  (cond ((equal major-mode 'org-mode)
         (call-interactively (local-key-binding (kbd "C-c C-c"))))
        ((equal major-mode 'emacs-lisp-mode)
         (save-buffer)
         (call-interactively 'eval-defun))
        ((string= (my-get-file-name)
                  "/data/data/org.gnu.emacs/files/.emacs.d/my_python_file.py")
         (save-buffer)
         (with-current-buffer (shell "*shell*")
           (my-send-string
            "python /data/data/org.gnu.emacs/files/.emacs.d/my_python_file.py"
            t
            "*shell*")
         ))
        (t
         (message "Undefined action"))
        ))
Redefining the fill column is handy to set appropriate text wrapping:

C-x f runs the command set-fill-column

Otherwise, the menu for Lime Wrapping in this buffer is super helpful.

I set my init to load up Dired so that I'm met with my project directory and am ready to go.

It's hard for me to think of another editor having my back like Emacs has. Again, amazing work by the community!

Re: Surprisingly, Emacs on Android is pretty good

#60
post #35
post #17

Specifically for org, and specifically for org-roam, it's pretty good, but not good enough. It's not as good as desktop emacs, and it's also somehow not as good as a 1st class android app. the fdroid build of emacs doesn't really work very well with my org-roam, so i use a termux build,,, well nix-on-droid+emacs-overlay... and it's fine, for capture and recall. but i'm not authoring a lot of text with it. a custom ex…

> don't listen to ~any emacs user's opinion I sort of came here to say the same thing. The intersection between (the set of people who care about good UX) and (the set of people who would try to use emacs on android) is the empty set. Emacs users' self-flagellation is pretty legendary, and I say this as an emacs user (though I've mostly given up on how janky and slow it is compared to modern editors and only use it f…

Are Emacs users really known for "self-flagellation"? I would have thought that was more vi users. Even if modern vis like vim try to make it slightly less painful, the fact is modal editing is really nonintutive. Certainly the reason why I became an Emacs user nearly 40 years ago when I was using UNIX for the first time, was that the only two real options were vi and Emacs and after playing with vi for a bit I was pretty much "nope, not doing that". Emacs may have a reputation as being arcane, but ultimately it is a modeless editor (yes, you can make it emulate vi and its modes if you really want it to) which means it basically works like any other editor or word processor you'd find on mainstream OSes.
Post reply on HN