Hacker News new | past | comments | ask | show | jobs | submit login

I achieve the same by running two consecutive regex search and replace and a single backspace click

    s/^/"/
    s/\n/“, /
(Change all beginning of line to double pling. Change all new lines to double pling, comma, space)

I don’t even store this as a procedure, I just ctr-f and do it from whatever text editor I’m in (I’m not an Emacs user)

The nice thing about search and replacing your way out of problems is that it works on coworkers machines.

I’m not saying it’s better than a stored procedure or a macro but once you’re into it, it’s easy to regex your way out of all sorts of adhoc problems :)




arrayify will also work on co-workers machines. You can open files on remote machines with tramp mode, and screenshare via zoom or something


I also prefer a more universal method. Arrayify is the equivalent of those useless specialized vegetable cutters and carvers in the kitchen that Alton Brown so hates. Search/Replace with Regex is universal.

Arrayify breaks down with the slightest change in requirements.


That's the whole point of a system like emacs: it enables the users to easily write solutions to their specific problems. It doesn't have to be general, it has to be easy to solve the problem at hand. It's the same with bash and unix tools. Writing general bash scripts is a nightmare, but datamunging particular problems works really well.


And then you write some more elisp




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

Search: