Live data from Hacker News

Two Years of Emacs Solo

rahuljuliato.com

61–70 of 147 posts

Re: Two Years of Emacs Solo

#61
post #53
post #47

Earlier quoted context omitted.

Just use tramp mode instead. The fact it can do multi-hop edits is far too much power for us mere mortals.

It's a very different experience: - I already have tmux launched, if ssh drops – I can continue - I don't have to match windows to ssh sessions -- just have them in my tmux

Yes, tmux vastly inferior to tramp.

Tramp runs in your local Emacs and edits files remotely. It can also launch processes remotely and keep track of them.

Re: Two Years of Emacs Solo

#62
post #59
post #31

> — Sensible file handling: backups and auto-saves in a cache/ directory, recentf for recent files, clean buffer naming with uniquify It's crazy to me how out of the box when you edit nginx file at /etc/nginx/sites-enabled/foo it creates another file foo~ there and nginx tries to load that too When I tried to ask emacs reddit community they started attacking me for changing the default that only I need and fits every…

emacs users who are hostile to you configuring things, aren't really getting the point IMO :)

The list of things emacs users don't get seems to get longer per day so I'm not surprised at the reaction OP got, just disappointed

(but I still think this is on nginx more than emacs - unless they really mean foo~ and not .foo~ )

Re: Two Years of Emacs Solo

#63

I’m always impressed by people who are hardcore EMacs or Vim devs, their setups are impressive af. I’m a GUI guy though. As soon as I try delving in, I abort when I see things like “just type c-C dingle bob to do x thing.” I’m happy these people found something that works with their brains. I just want a GUI that works like what they use. I recently saw a Zed fork stripped of AI stuff but there’s no binaries yet (you…

A nice way to get quickly familiar with how to use emacs/(neo)vi(m), understand how keybindings work and how to uncover new ones, is to go through reading/practicing the built-in tutorial. It almost plays like games.

When opening a freshly installed emacs, there should be a "Emacs Tutorial" link that can be clicked; also the keyboard shortcut `C-h t` (which is «Control + `h`, then `t`»).

There is a similar feature in `neovim`, when opened type `:Tutor` (which is «`:` to open the command prompt, with command `Tutor`»).

Re: Two Years of Emacs Solo

#64
post #31

> — Sensible file handling: backups and auto-saves in a cache/ directory, recentf for recent files, clean buffer naming with uniquify It's crazy to me how out of the box when you edit nginx file at /etc/nginx/sites-enabled/foo it creates another file foo~ there and nginx tries to load that too When I tried to ask emacs reddit community they started attacking me for changing the default that only I need and fits every…

I also set create-lockfiles to nil. I think you can theoretically keep the lockfiles and the clean directory by using lock-file-name-transforms to place the lockfiles somewhere sensible but I didn't bother.

Without this I had to be careful not to acciddentally commit stuff like ".#filename.txt".

Re: Two Years of Emacs Solo

#65
post #31

> — Sensible file handling: backups and auto-saves in a cache/ directory, recentf for recent files, clean buffer naming with uniquify It's crazy to me how out of the box when you edit nginx file at /etc/nginx/sites-enabled/foo it creates another file foo~ there and nginx tries to load that too When I tried to ask emacs reddit community they started attacking me for changing the default that only I need and fits every…

[deleted]

Re: Two Years of Emacs Solo

#66

This article shows how Emacs remains a beautiful, relevant project several decades after it was first created. The core design and implementation’s ability to evolve into something still useful today and competitive with modern tools is an amazing achievement. Also, with LLMs driving so much of current development it potentially makes Emacs even more competitive relative to modern IDEs. Development can be driven prim…

> I imagine an LLM would be very good at writing Elisp to leverage EMacs’ strong core functionality

Yes, they are pretty good. I have set up GPTel (an excellent Emacs package for interacting with LLMs) with some tools allowing it to run Elisp, inspect files (Elisp functions know what file they were defined in, so it's easy to find stuff) and read Emacs documentation. LLMs use this to good effect, and iterate on my config very nicely.

Re: Two Years of Emacs Solo

#67

If I was going to reimplement Emacs it wouldn't be with Lisp. Is there some reason Lisp is superior to any other general-purpose programming language for text editing? I'm skeptical because to my knowledge, Emacs is the only major text editor written in Lisp.

Lisp calls c in emacs. What would be a better language? The code-as-data, data-as-code paradigm fits nicely imo with everything-is-a-buffer. Things like global namespace, hooks, defadvice, would all feel very wrong in other interpreter, and yet seem to make sense in elisp.

Emacs is like a minecraft of lisp expressions.

Re: Two Years of Emacs Solo

#68
post #31

> — Sensible file handling: backups and auto-saves in a cache/ directory, recentf for recent files, clean buffer naming with uniquify It's crazy to me how out of the box when you edit nginx file at /etc/nginx/sites-enabled/foo it creates another file foo~ there and nginx tries to load that too When I tried to ask emacs reddit community they started attacking me for changing the default that only I need and fits every…

Surprised to hear people told you not to change that - one of the earliest bits of advice I got on using emacs is to set the location of those files to a hidden directory in your home folder.

Re: Two Years of Emacs Solo

#69
post #60
post #31

> — Sensible file handling: backups and auto-saves in a cache/ directory, recentf for recent files, clean buffer naming with uniquify It's crazy to me how out of the box when you edit nginx file at /etc/nginx/sites-enabled/foo it creates another file foo~ there and nginx tries to load that too When I tried to ask emacs reddit community they started attacking me for changing the default that only I need and fits every…

I would fault nginx here instead. Tilde-suffixed backups is an old convention used by vim and emacs among others. Definitely older than nginx.

The ~foo as backup convention is not part of any standard.

Using hidden files is a stronger convention, e.g. .foo.swp or .foo~.

But nginx's sites-enabled also doesn't filter those.

It's a very simple mechanism that assumes what you put in that directory is a website configuration.

Adding backup files here and there is considered spam, no matter how old it is.

It's the second thing I fix in either Vim or Emacs: Put backup files in a central location. (The first is proper indentation/spacing rules.)

Re: Two Years of Emacs Solo

#70

The new Emacs features sound great! (We have native window management finally) I wish we would someday be able to edit in xref too, wgrep having landed in Emacs 30 (especially since project.el grep goes to xref by default). By the way, anyone more informed know about any work on getting a graphical browser to work on latest Emacs, now that webkit xwidgets is dead for Emacs 30+? (Have tried EAF; extremely buggy on Mac…

Emacs solo actually contains functionality for just that, the below snippet which allows exporting xref buffers to grep format by pressing 'E'. You can then use wgrep etc.

  ;; Makes any xref buffer "exportable" to a grep buffer with "E" so you can edit it with "e".
    (defun emacs-solo/xref-to-grep-compilation ()
      "Export the current Xref results to a grep-like buffer (Emacs 30+)."
      (interactive)
      (unless (derived-mode-p 'xref--xref-buffer-mode)
        (user-error "Not in an Xref buffer"))

      (let* ((items (and (boundp 'xref--fetcher)
                         (funcall xref--fetcher)))
             (buf-name "*xref→grep*")
             (grep-buf (get-buffer-create buf-name)))
        (unless items
          (user-error "No xref items found"))

        (with-current-buffer grep-buf
          (let ((inhibit-read-only t))
            (erase-buffer)
            (insert (format "-*- mode: grep; default-directory: %S -*-\n\n"
                            default-directory))
            (dolist (item items)
              (let* ((loc (xref-item-location item))
                     (file (xref-file-location-file loc))
                     (line (xref-file-location-line loc))
                     (summary (xref-item-summary item)))
                (insert (format "%s:%d:%s\n" file line summary)))))
          (grep-mode))
        (pop-to-buffer grep-buf)))
    (with-eval-after-load 'xref
      (define-key xref--xref-buffer-mode-map (kbd "E")
                  #'emacs-solo/xref-to-grep-compilation))
Post reply on HN