Irreal: Next Error Follow Mode

Marcin Borkowski (mbork) has a nifty post that discusses a handy Emacs facility that I didn’t know about. A few weeks ago he wrote about follow mode. It was a good post that opened my eyes about the real utility of follow mode and I wrote about it here. This post is about a similar facility called next-error-follow-minor-mode.

The idea is that if you’re in a buffer that references places in another file—think occur buffers, for example—you can turn on next-error-follow-minor-mode and as you move around in the buffer the other buffer will automatically jump to the matching place.

My workflow has a couple of places where I regularly use occur buffers and next-error-follow-minor-mode seems like a real win because my workflow involves jumping from an occur buffer item to the corresponding place in the other buffer.

If you’re in a buffer that supports next-error-follow-minor-mode, you can enable it with the shortcut Ctrl+c Ctrl+f.

It’s another one of those obscure Emacs facilities that are hard to discover but once you do you wonder how you ever lived without them.

-1:-- Next Error Follow Mode (Post jcs)--L0--C0--April 24, 2024 03:00 PM

Anand Tamariya: Alternatives in GNU Emacs

 

Exploring some alternative ideas in GNU Emacs.

Stock Heatmap

 

The circle radius is proportional to the weight of the stock in the index. The color is a range between green, white and red based on the price movement. This uses circle packing.

;; For drawing tooltip, additional point attributes are required. Properties old-x and old-y are used internally.
;; fill    - Circle color
;; title  - Circle label (Use \n for new line)
;; href - Link
;; text  - Tooltip text (Use \n for new line)
(defstruct point x y r old-x old-y fill title href text)
 
;; Image is an SVG image.
(graph-pack-tree root image)
 


 

-1:-- Alternatives in GNU Emacs (Post Anand Tamariya (noreply@blogger.com))--L0--C0--April 24, 2024 06:54 AM

Protesilaos Stavrou: Re: what keeps you coming back to Emacs?

The following is part of a private exchange. I am publishing it with permission, without disclosing the identity of my correspondent.


I hope you don’t mind me asking but what keeps you coming back to Emacs? I am currently wondering whether to look at Neovim again - it does seem to be faster and with a strong community around it. I love Emacs and its community but from time to time wonder whether I am on the wrong side of Lisp vs Lua for example in the case of Neovim for performance, simplicity, modernity, etc.

What is your driver to work so hard in Emacs, Prot?

I come from a background of using the command line, all sorts of terminal-based programs like Mutt and Newsboat, Tmux, Vim, and a tiling window manager. None of those tools speak the same language. To make them work in concert, you have to know many programming and/or configuration paradigms. Just to get the same theme everywhere is a pain: try to configure Taskwarrior, Newsboat, Mutt, MPC, Vim, Tmux, i3, and friends to get an idea. Then try to set a high contrast light theme in the terminal to notice how hard-coded assumptions will break your workflow (e.g. the ‘apt’ program’s progress bar, or the tabs and borders of ‘htop’). Plus, you are confined to a terminal emulator, whose typographic capabilities are limited, such that you cannot have fonts of varying widths and heights (maybe there are terminals that do this nowadays, though XTerm, ST, and those based on VTE did not cover all my needs pre-2019).

Emacs provides the missing layer of interactivity on top of Unix. We have a highly capable programming language (Emacs Lisp) to configure all parts of our computing environment in a uniform fashion. If you know how to write a function or set a variable for task management, you know how to do it for email, and for writing or coding, et cetera. The skills you acquire as you gain more experience with Emacs have a compounding effect. You eventually get more out of the time you invest in them, which practically means that you are empowered to design the workflow you want and be as opinionated as you like with your tool.

I am not a programmer by training and did not have any formal education in this or related fields: I studied politics for the most part. I also was not a tech kid: I got my first computer in my mid-20s. Emacs’ introspectability has helped me learn how to program by playing around with Elisp. It is so easy to find some code that is of immediate interest to you, tweak it, evaluate it, and check its new behaviour live. Take, for example, the command that shows you which command a key is bound to: describe-key. It produces a Help buffer that includes a link to the source code. Follow the link and you are reading the actual code. From there it is only a matter of time and practice until you get the hang of it and start tweaking things to work the way you want.

Emacs is a tool with high pedagogical potential because it is a sandbox that enables experimentation. The feedback loop between test and results is short and intuitive. If I, as a humanities person and philosopher, am able to learn Elisp and write lots of Emacs packages, I can only imagine what a skilled programmer or engineer will be capable of.

To the point of how didactic Emacs is, consider that once you learn to define a function with defun and make it interactive with the (interactive) spec, it is trivial to write your first “extension” in Elisp. For example:

  • Use describe-key to find which command is bound to the down arrow key.

  • Read the documentation that pops up.

  • Now write an interactive function that goes down 15 lines.

  • Write another that goes up 15 lines.

[ These are actually the first functions I remember writing. ]

There you have it: you are programming in Emacs Lisp!

This introspectability—and the immediacy of the experience—is helpful to beginners and veterans alike. Whenever an expert wants to extend or intercept a function or parts thereof, they rely on what they had learnt while they were still a newcomer, adding to it as they go.

Not to imply that only coders benefit from Emacs though (most of what I do is prose, anyway). One can be productive without ever writing their own custom snippets of Elisp. For instance, I handle my email in Emacs. I can just call org-store-link to capture a link to the message I am reading and then insert that link in some task that shows up on my agenda (or use org-capture to streamline this process). When I follow the link, it opens my actual email client and I can review what the exchange was about. These linkages are possible because of the unified computing environment I mentioned earlier. This same pattern applies in other contexts as well. And it is all plain text, which is consistent with Emacs’ spirit of hackability/introspectability.

The technical merits of Emacs are numerous, though I must also stress its moral quality as free software. To my mind, Emacs is the embodiment of the four essential software freedoms: https://www.gnu.org/philosophy/free-sw.en.html. It does not give us freedom in some vague sense, but in the practical way of introspectability and extensibility. We not only study the program, but also modify it in real time. Emacs is thus an example to follow for how to empower users to be free and how to teach them to seek freedom wherever possible. Even the intangibles, such as how you are incentivised to make Emacs your own, underpin the ethos of freedom and the fact of diversity.

Is Emacs perfect? Of course not. There are lots of changes that can be made. Though we must remember that this is a community of volunteers. To have what we want at the technical level, we must do the requisite work at the interpersonal level: to ensure that there is a thriving and welcoming milieu from where innovation will come.

In conclusion then, I use Emacs as it is technically superior to what I was using before. The more I learn, the better my Emacs becomes. This is the gift that keeps giving. I also use Emacs because I care about software freedom and want to do my part in inspiring others to be more free.

-1:-- Re: what keeps you coming back to Emacs? (Post)--L0--C0--April 24, 2024 12:00 AM

Evan Moses: Emacs Tidbit: rectangle-number-lines

Emacs has so many little features that do exactly what you need in very specific circumstances. Here’s one that I justfound out about: rectangle-number-lines. I had some lines and I wanted to insert line-numbers for reference. Iwanted this

arguments list: [team8721038424565681034userfdff6f87-d876-4558-8d12-19e039e5a880afoosecretalsothisbe46e2d16-b3ba-4f84-826f-5e3031465e21]

To be this

arguments list: [ 1 team8721038424565681034 2 user 3 fdff6f87-d876-4558-8d12-19e039e5a880 4 a 5 foo 6 secret 7 alsothis 8 b 9 e46e2d16-b3ba-4f84-826f-5e3031465e21]

I started thinking about kmacros, which I rarely use but have an incrementing counter you can use for this, but I startedgoogling and lo and behold I found a Stack Overflow post with the answer. Just highlight a rectangle on the firstcolumn1 and type C-x r N which runs rectangle-number-lines, which does exactly what Iwanted.


  1. Since I use evil, I just type C-v to enter visual block mode, but I looked itup for vanilla Emacs and C-x SPC to set the rectangle mark. ↩︎

-1:-- Emacs Tidbit: rectangle-number-lines (Post Evan Moses (webmaster@emoses.org))--L0--C0--April 24, 2024 12:00 AM

Irreal: Alphabetical Lists In Org Mode

The other day, I wrote that you never stop learning Emacs. There’s always something new to learn. I just saw a post that reminded me that—at least for me—you never stop relearning Emacs either.

The post asked about why indentation was not working properly for alphabetical lists. I didn’t understand the question. I didn’t have any problems with Alphabetical lists and I was sure I hadn’t done anything special to enable them. One of the commenters explained that what the poster was experiencing was the expected behavior because by default Org Mode doesn’t recognize alphabetical lists and that he needed to set org-list-allow-alphabetical to t, to enable them.

I called describe-variable on org-list-allow-alphabetical and it told me that the default value was nil but that it had been reset to t. Where did that come from? I searched my Git logs and discovered that I had made the change 11 years ago. I have no memory of why I did it or what problem I was trying to solve.

In a sense, it doesn’t matter because I now have things set correctly for my workflow but what if someone had asked me the same question the poster asked? I wouldn’t have been able to help them because the issue had disappeared from my consciousness.

In any event, if you want to use alphabetical lists, be sure to enable org-list-allow-alphabetical.

-1:-- Alphabetical Lists In Org Mode (Post jcs)--L0--C0--April 23, 2024 03:54 PM

İsmail Efe: Hobbies

Hobbies

İsmail Efe Top

2024-04-23

I recently found myself juggling a lot of hobbies. They take up almost all of my free time and I want to talk about them. I will mention the interesting ones as I don't want to talk about “How I like to take walks” or “How I like to discover new restaurants”.

Graphic Design

While I am not a professional, I did my fair share of design work. I designed and wrote my high school newspaper, I did Instagram posts for my department, and I did a lot of restoration work for my personal enjoyment.

I love minimalist design, there is something in it that speaks to me. Those neutral colors, big popping fonts and an inviting aura. When I approach a task I try to take away as much as I can. Only the needed should remain. In my opinion, the quote that best describes minimalist design is “Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” by Antoine de Saint-Exupéry.

Maintaining a Website

Whenever I look at a personal website that I've never seen before, I try to look for different approaches the site owner took. Like is there a navbar, is there a table of contents, what color did they used, is there javascript, etc. That is something that I never done before I had my own site. This results in a constant cycle of inspiration and evolution.

Because I don't use a generator in general sense, I have to do a lot of things by hand. Like generating RSS, generating a sitemap, optimizing pictures, SEO optimizations, fixing errors made by the org to html converter, etc. While this takes manual labor, I love it. Some people enjoy writing blog posts and some enjoy making websites, I enjoy both!

Also, if I used a blog generator, I wouldn't have learned how RSS, sitemaps, and SEO worked. I recommend everyone to learn the basics of html and css, and then host their own blog with a free service like GitHub pages!

Visiting Flea Markets

I love wandering around flea markets, there are tons of great stuff that are dirt cheap. Old technologies that still work great, old clothes that can be made new with a quick trip to a dry cleaner, cool desk accessories, 35mm films, camera gears, and many many more.

Seeing things that were revolutionary when they first came out and talking with the people that sell them is a joy I get to experience every month. While there is a lot of good flea markets that I visit, the one I like the most is Çayyolu Antika Pazarı. I like Çayyolu because it is not as crowded as others and the things they sell are more high quality. Also most of the sellers are there to make friends and get to know new people, I like those kinds of sellers the most. Because their main goal is not to profit the most they can, their main goal is to have a good time!

While I do buy a lot of unnecessary stuff, the joy I get from talking with these people and seeing literal history makes visiting flea markets an irreplaceable hobby.

Configuring Emacs

I spent so much time configuring this program that I could even say Emacs is my part-time job. I definitely spend more time sharpening than cutting.

But Emacs has become such an efficient tool that I think it cuts the time I spent on homework in half. It formats, converts, spellchecks, gives synonyms, translates, it manages and inserts citations, prints references, and much more. And like maintaining a site, I enjoy working on my config. Even if I didn't, I would think of it as an investment because it is a tool that I will surely be using for a really long time.

Shooting Analog

I got into the analog world thanks to my girlfriend more than a year ago. While I did make some mistakes that resulted in burned films, I think I learned my lesson.

I like shooting in color. My favorite film is Kodak Gold 200, the way that it captures the sunlight mesmerizes me. You can see some of the pictures I took at my photos page.

Other than that I use a Agfa Optima as my main film camera. I like compact analog cameras. For me, having a big lens that you have to adjust every time defeats the purpose.

-1:-- Hobbies (Post İsmail Efe Top (ismailefetop@gmail.com))--L0--C0--April 22, 2024 09:00 PM

Irreal: Emacs: Saving You From Yourself

Another quickie today. Evan Moses has a short post that shows how he solved a problem particular to his workflow. He’s an Evil user, which means that when he wants to save a buffer he types :w. Unfortunately, he’s prone to fat fingering that command and types :w2 instead. That writes the buffer to a file named “2” instead of the file that the buffer is visiting.

We can all relate. Most of us have some sort of similar mistyping that we’re prone to make. But this is Emacs and it’s infinitely configurable so Moses decided to save himself further grief by writing a bit of Elisp.

He simply wrote a function to check whether or not the argument to evil-write is 2. If it is, the function asks if he really wants to save to a file named 2. The function returns the result of that question.

Then he advised evil-write to run his function before writing and to abort the write if the function returns nil. You can check out the code in his post. It’s simple and exactly what you’d expect.

I’m writing about this not because I think many people are fat fingering w as w2 but because it’s another example of how Emacs’ unsurpassed configurability lets you fix small but annoying problems. Notice how simple the solution is. You don’t have to rewrite the evil-write function. You just tell Emacs to run your function first so that it can ask if saving to the file 2 is what you really want.

-1:-- Emacs: Saving You From Yourself (Post jcs)--L0--C0--April 22, 2024 03:56 PM

Sacha Chua: 2024-04-22 Emacs news

Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, lobste.rs, kbin, programming.dev, lemmy, communick.news, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, and emacs-devel. Thanks to Andrés Ramírez for emacs-devel links. Do you have an Emacs-related link or announcement? Please e-mail me at sacha@sachachua.com. Thank you!

-1:-- 2024-04-22 Emacs news (Post Sacha Chua)--L0--C0--April 22, 2024 12:36 PM

Marcin Borkowski: Next-Error-Follow mode

A few weeks ago I wrote about Emacs’ Follow mode. It turns out that searching for follow-mode on my blog reveals an old post about Ibuffer which is very short and unfortunately a bit misleading. It seems that the mention of Follow mode there was really meant to mean Next-Error-Follow mode. It is a completely unrelated, but also useful concept.
-1:-- Next-Error-Follow mode (Post)--L0--C0--April 22, 2024 05:53 AM

Irreal: Working With Docstrings

Charles Choi has been writing a lot of Elisp lately and being a scrupulous developer, is careful to write informative and useful docstrings. Being conscientious, he’s careful to check the formatting of his docstrings by calling describe-function. That sounds simple enough but, as Choi, says, it’s actually a pain involving several steps and moving around in the text of the function.

Of course, being a programmer, Choi decided to automate the process. That’s a win because it makes it easier to (repeatedly) check the docstring resulting in better documentation for the end user.

Another issue that Choi addresses is the number spaces at the end of a sentence. That, of course, is a minefield and whatever you do is sure to offend someone. But a good case can be made that since docstrings are almost always displayed in a monospaced font, there should be two spaces at the end of a sentence.

There are some problems though. Fill-paragraph won’t enforce the value of sentence-end-double-space if sentences end with a single space. As usual, Emacs has us covered. Instead of just calling fill-paragraph you can first call repunctuate-sentences. That will add two spaces after each sentence, which is just what you want in these circumstances. Take a look at Choi’s post for the details.

Docstrings seem like a small thing but done right, they can be very useful. Choi’s post demonstrates some ways to make writing them a bit easier.

-1:-- Working With Docstrings (Post jcs)--L0--C0--April 21, 2024 03:37 PM

Protesilaos Stavrou: Emacs: Denote backlinks for Org headings

The current stable version of Denote include optional means to link directly to an Org heading, using its CUSTOM_ID property (creating it, if necessary). I have already demonstrated this in video form: https://protesilaos.com/codelog/2024-01-20-emacs-denote-link-org-headings/.

As part of the development work towards version 3.0.0, we now define a new command that displays a buffer with backlinks to the current Org heading: denote-org-extras-backlinks-for-heading. It is part of the denote-org-extras.el file, which contains optional extensions that only work with Org mode files.

The name of the backlinks buffer includes the text of the heading it is about.

Denote Org file+heading link sample

Note that links to headings are also pointing to the underlying file, using its identifier. They are a composite of FILE-ID::#HEADING-ID, which still leverages the robust Denote file-naming scheme.

Part of the current development version

Things are in a state of flux as we are fleshing out Denote 3.0.0. If you do try this feature, please let me know how it works for you and if you would like to see something done differently.

Denote is highly flexible and designed to be easy to extend: you do not have to be an expert. We do everything using small functions and code that has no obscure macros and/or deeply nested expressions. This will continue to be the case. So feel welcome to take a look and send your feedback.

Version 3.0.0 will hopefully be released in June or July 2024.

Denote sources

Denote is a simple note-taking tool for Emacs. It is based on the idea that notes should follow a predictable and descriptive file-naming scheme. The file name must offer a clear indication of what the note is about, without reference to any other metadata. Denote basically streamlines the creation of such files while providing facilities to link between them.

Denote’s file-naming scheme is not limited to “notes”. It can be used for all types of file, including those that are not editable in Emacs, such as videos. Naming files in a consistent way makes their filtering and retrieval considerably easier. Denote provides relevant facilities to rename files, regardless of file type.

-1:-- Emacs: Denote backlinks for Org headings (Post)--L0--C0--April 21, 2024 12:00 AM

Irreal: Defining Eshell Commands

It’s a commonplace in the Emacs community that you never stop learning Emacs. No matter how long you’ve been using it, there’s always something new to discover. The truth of that maxim was brought home to me today when I came across an Emacs subreddit post from rvc09 asking how he could run a predetermined set of commands in Eshell as with a script in other shells.

I’ve never needed to do that so I hadn’t thought about how I would go about it. It turns out that the answer is simple but not at all obvious. Scroot had the answer. It turns out that you can define an Elisp function eshell/some-command and run it in Eshell by calling some-command.

But wait, there’s more. Within such a function you can use eshell-command1 to call any Eshell command. Those two facts allow you to essentially define a script that you can run from within Eshell.

As I said, I had no idea about this. It’s just another point on the never ending arc of my Emacs journey of discovery.

Footnotes:

1

Scroot says it’s eshell-run-command but that function doesn’t exist in my Emacs 29.3 installation, so I’m pretty sure he meant eshell-command.

-1:-- Defining Eshell Commands (Post jcs)--L0--C0--April 20, 2024 03:34 PM

James Dyer: Transitioning RAlt to Ctrl - Enhancing Emacs Keybindings

In the midst of adjusting my Emacs keybindings for a more ergonomic workflow, I’ve experimented with various configurations. For example, I duplicated the right Alt key (RAlt) to function as an additional Alt key allowing for versatile key presses across the keyboard based on command keybinding locations.

The RAlt key is certainly accessible with a little curl under of the right thumb and a modifier key activator I hadn’t even considered before.

For instance, I found combinations like M-n and M-p already comfortable with a left hand / right hand split, but with RAlt for activating Meta/Alt a right hand / left hand split became possible for certain commands, notably M-f and M-w which I often use. This theoretically already felt a more comfortable setup.

However, after a few months, I realized I couldn’t quite find a way to transition to the RAlt remapping; I simply wasn’t using it. Yet, the initial experiment hinted at the potential of shifting modifier load to the right hand, especially leveraging the strong thumb for ergonomic advantages.

Then it struck me: what if I map RAlt to Ctrl?, I immediately questioned why I hadn’t tried it earlier!

The transition so far has unveiled the following (note: I may have got carried away with the detail here, but in a way its fun to weigh up the pros and cons!):

Benefits

  • Splitting common prefixes like C-x and C-c between hands.
  • Enhanced comfort in isearch with split hand C-r and C-s.
  • Improved buffer window navigation, with RLR (Right Left Right) pattern for C-x o.
  • Simplified buffer window splits with C-x <num>. Although there are typically two consecutive left hand key activations, sticky keys allows just two individual key taps of x then <num>.
  • Streamlined actions like the common C-c C-c, with the option of holding RAlt allowing easy left-hand tapping of c, c
  • Reassigned C-o (never used) to the (other-window) so I can replace my ever fluctuating window keybinding navigation to something more simple using just one hand, plus I can hold down the Ralt and tap through the windows.
  • C-g was always a bit of stretch - especially before sticky keys, but now I have a RL combination.
  • Simplified Emacs exit with C-x C-c (although why would I ever need this?!) holding RAlt for x,c tap tap.
  • A locked sticky key Ctrl double tap now doesn’t activate a double whammy of left hand pinky lateral movement.
  • Saving can be easier, C-x C-s again is a right hand modifier hold with an x,s tap
  • Another common command (which in fact I had to rebind as it was too taxing on my left hand) is now much more comfortable, namely C-x C-e (eval-last-sexp) in the same way as saving mentioned above.
  • I am finding myself instinctively using C-j a lot more as naturally my right thumb is now very close to RAlt and my right index finger is always on j
  • Reverting buffers is much easier, It is bound to C-x x g (revert-buffer-quick)
  • I am finding myself starting to revert back to the vanilla Emacs keybindings rather than my adapted ones mainly I suspect that C-x and C-c is much easier now to access.

Negatives

  • I will have to adjust to the new position of the keybindings, and some like the undo with C-/ feed a bit strange due to the close proximity between Ralt and /
  • Keyboard configuration is required to map Ralt to Control.

I’ll evaluate this setup’s efficacy over the next few months and I may contemplate not just the possibility of minimizing Ctrl key usage on the left hand but potentially eliminating it altogether! My left hand pinky would then never have to attempt lateral movement again!

-1:-- Transitioning RAlt to Ctrl - Enhancing Emacs Keybindings (Post James Dyer)--L0--C0--April 20, 2024 09:12 AM

Magnus: Update to Hackage revisions in Nix

A few days after I published Hackage revisions in Nix I got a comment from Wolfgang W that the next release of Nix will have a callHackageDirect with support for specifying revisions.

The code in PR #284490 makes callHackageDirect accept a rev argument. Like this:

haskellPackages.callHackageDirect {
  pkg = "openapi3";
  ver = "3.2.3";
  sha256 = "sha256-0F16o3oqOB5ri6KBdPFEFHB4dv1z+Pw6E5f1rwkqwi8=";
  rev = {
    revision = "4";
    sha256 = "sha256-a5C58iYrL7eAEHCzinICiJpbNTGwiOFFAYik28et7fI=";
  };
} { }

That's a lot better than using overrideCabal!

-1:-- Update to Hackage revisions in Nix (Post)--L0--C0--April 20, 2024 09:04 AM

Charles Choi: Writing Better Elisp Docstrings

Emacs has a lot of tools to help you write better documentation strings (docstrings). And if a tool you want doesn’t exist, Emacs can let you make your own. As of late I’ve been writing a lot of Elisp docstrings, so this post covers what's still fresh in my mind. While Elisp-centric, much of this post can apply to other languages as well (I see you Python and Swift).

Previewing Docstrings

A common task in writing an Elisp docstring is to preview it in Emacs Help. When you are still composing the docstring, this process is cumbersome as the point (cursor) is still in the docstring section. To preview the docstring in Emacs Help, one must:

  1. Run eval-defun (C-M-x) to evaluate the function the point is in.
  2. Move the point to the name of the function.
  3. Run M-x describe-function which will default populate with the function name because of where the point is currently.
  4. Move the point back to previous position (optional).

Repeating all these steps gets old fast. A more ideal workflow is to have an Elisp function that automates the above steps. This function can then be assigned a keybinding for convenient access.

The function cc/describe-function-point-is-in below does just that. For separation of concerns, evaluating the function (eval-defun) is kept separate from the steps that show the docstring (steps 2-4).

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
(defun cc/describe-function-point-is-in ()
  "Describe enclosing Elisp function at point.
\nInvoke `describe-function' on the enclosing Elisp function the
point is in.

Thanks to mwnaylor, PropagandaOfTheDude, and deaddyfreddy for
helping write this function. "
  (interactive)
  (when-let ((interned (intern-soft (which-function))))
    (describe-function interned)))

Amendment 2024-04-19: On Reddit, PropagandaOfTheDude remarked that which-function can get the name of the enclosing function, simplifying my prior implementation. I've amended cc/describe-function-point-is-in to use it.

Amendment 2024-04-21: On Reddit, deaddyfreddy shares that when-let offers an even cleaner implementation of cc/describe-function-point-is-in which has been amended to reflect this.

I leave it to the reader to assign their preferred keybinding to cc/describe-function-point-is-in. For yours truly, I’ve bound it to <f6> in emacs-lisp-mode-map.

1
(define-key emacs-lisp-mode-map (kbd "<f6>") #'cc/describe-function-point-is-in)

Filling Paragraphs and Sentence Spacing

Writing descriptive docstrings typically entails writing paragraphs. The function fill-paragraph will ensure that the paragraph you write is formatted with respect to the column length (fill-column). For single-spaced sentences, fill-paragraph works swimmingly. More problematic is when the desire is to enforce double-spaced sentences. If the variable sentence-end-double-space is non-nil, fill-paragraph will not adjust single-spaced sentences to double-spaced ones. To enforce double-spaced sentences, a different command is needed: repunctuate-sentences. This command honors sentence-end-double-space, so if you want single-spaced sentences, it will do the right thing.

In a docstring the workflow for refilling a paragraph while ensuring double-spaced sentences is:

  1. Mark paragraph as region.
  2. Run M-x repunctuate-sentences.
  3. Run M-x fill-paragraph.

Note that the design of repunctuate-sentences presumes that the buffer is all prose text if no mark is active. As docstrings are in code, this necessitates the step (1) to mark a region/paragraph. It’s left as an exercise to a more sophisticated Elisp developer to write a function that combines the above steps that is robust enough to know when it is in a docstring.

Documentation Tips

In the GNU Elisp Reference there is a section on documentation tips. I highly recommend a deep reading of it. Among the guidance it provides is linking to different document types such as commands/functions, variables, Info docs, man pages, and URLs.

Writing Tools

Emacs is rich with tools for writing. Among them to consider:

Closing Thoughts

Count me as one who finds great value to a well-written docstring. It is an opportunity to communicate intent from the writer/developer to the reader/user, and frequently for the developer it goes hand-in-hand with writing better code. Emacs provides a robust set of tools to help you write good docstrings with the added capability to make your own if what you need is lacking.

References

-1:-- Writing Better Elisp Docstrings (Post Charles Choi)--L0--C0--April 19, 2024 03:20 AM

Tory Anderson: stop freezes: disable global undo-tree

global-undo-tree-mode Dramatic freezes on routine “undo” I was experiencing freezes of sometimes up to 30 seconds about 3/4 of the the time when I used my muscle memory to hit undo (C-/), which I do as part of my regular “kill-line undo” combo (C-k C-/). Something must have changed recently because I started to have show-stopping freezes of my emacs thread when I tried a routine “undo.” I finally managed to squeeze a toggle-debug-on-quit and, with a bit of patience, got a C-g in during the freeze.
-1:-- stop freezes: disable global undo-tree (Post)--L0--C0--April 19, 2024 12:00 AM

Irreal: Beautifying Org Mode

As you all know, I’m not much for editor bling even though I care immensely what my finished text looks like. Still, I did take to heart Charles Choi’s recommendation to use proportional fonts for prose. The idea is that it’s easier to read and edit prose when it’s in a proportional font. That aside, the only other “beautification” I make to my Org buffers is to use the previous default of a larger font and different color for the title. Org did away with that some time ago but I resurrected it with

(set-face-attribute 'org-document-title nil :foreground "midnight blue"
                      :weight 'bold :height 1.44))

If you adhere to a less austere style in your Emacs buffers, you should take a look at Diego Zamboni’s recent post on Beautifying Org Mode in Emacs. He’s got a lot of nice ideas for customizing the look of your org buffers without resorting to a wholesale theme change.

His changes mainly consist of changing the font faces and sizes for the various headline levels and for ensuring that code fragments were still rendered in a monospace font. He also sets visual-line-mode on to make things look better in proportional fonts. I do that too but to solve formatting problems when exporting to HTML.

He hides the emphasis markup, which I definitely don’t like but he also made a simple change to make list bullets appear as actual bullets (•) rather than the default -. He makes some other suggestions, as well, so it’s well worth taking a look at his post if you’re interested in gussying up your Org buffers.

-1:-- Beautifying Org Mode (Post jcs)--L0--C0--April 18, 2024 03:41 PM

Irreal: An Interview With Daniel Semyonov

Those of you who have been around for a while will remember Sacha Chua’s video interviews with various Emacs luminaries. Those were before the birth of her daughter and as any parent will tell you, young children can gobble up whatever discretionary time you have so it’s little wonder she hasn’t done any interviews lately.

Sadly, she hasn’t reinstituted her interviews but she does this have this offering from Emanuel Berg with an interview of Daniel Semyonov. It’s not a video and it’s a bit shorter than Sacha’s old interviews but it’s still interesting.

Semyonov is a young programmer from a remote area without a lot of resources yet he was able to bootstrap his knowledge and has contributed to several open source projects. Most recently he has worked on the Gnus backend for Atom feeds.

One of the things I liked most about the interview was Semyonov’s discussion of how Emacs and learning Elisp kickstarted his programming in general and his open source contributions in particular.

It’s a short interview and worth a couple minutes of your time. Perhaps others will share their interviews with Sacha, and she with us.

-1:-- An Interview With Daniel Semyonov (Post jcs)--L0--C0--April 17, 2024 03:00 PM

Do you mean `switch-to-minibuffer'? Alternativly, you can always select it using other-window.

-1:--  (Post)--L0--C0--April 17, 2024 08:52 AM

Anand Tamariya: Circle Packing Animation in GNU Emacs


 

Here's an implementation of circle packing algorithm by Wang et. el. in Elisp. Front chain is the set of circles on the periphery. These are shown as connected by red line in the animation.

(require 'graph-pack)
(defstruct point x y r)
 
;; Define a point
(setq p (make-point :x 17 :y 0 :r 16))
 
;; Define a list of points
(setq points (list p1 p2))
 
;; Image is an SVG image. This is used for drawing the animation (optional). The return value is the front chain. This can be further used to generate a circumscribing circle.
(graph-pack points image) 

;; Get circumscribing circle
(setq p (graph-enclose (graph-pack children)))

 

Bubble Graph

 

You can pass a hierarchical tree of points to generate a bubble graph. Only radii of leaf nodes are mandatory. title and fill parameters are used if provided.

;; For drawing additional point attributes are required. Hence this definition is different from above. Properties old-x and old-y are used internally.
(defstruct point x y r old-x old-y fill title)
 
;; Image is an SVG image.
(graph-pack-tree root image)
 

Background

I don't have access to the research paper. The link to paper in D3js documentation wasn't very helpful either. Hence the code didn't make much sense to me. It only struck me when I saw the following image.

Important: My implementation doesn't use scores at each step. On the surface, that doesn't seem to be a drawback though.

Code

  1. https://github.com/atamariya/tumblesocks/blob/dev/graph-pack.el
  2. https://github.com/atamariya/tumblesocks/blob/dev/graph-enclose.el
  3. https://github.com/atamariya/tumblesocks/blob/dev/graph-draw.el
 

References

  1. Visualization of large hierarchical data by circle packing (Research paper) 
  2. D3.js implementation
  3. Python implementation
  4. Useful circle packing application ideas  

 

https://t.ly/E9Ene

-1:-- Circle Packing Animation in GNU Emacs (Post Anand Tamariya (noreply@blogger.com))--L0--C0--April 17, 2024 04:01 AM

Irreal: Emacs Nerd Porn

For all you Emacs nerds out there here’s a bit of porn. It’s almost like those joke pictures you see of Emacs setups but this one appears to be real.

As much as I like the idea of this environment, I’m not sure that I’d want to use it. As some of the commenters noted, it’s going to make your neck sore but for me the question is why you need to see all that information? Sure, it’s useful to be able to see two or even three files at the same time when you’re working but I’m not sure why you need to see eight or nine at once. It seems like lurking distraction to me.

I get that you might want to have, say, an email buffer and maybe even a text message buffer open but I’m at a loss of what to do with nine visible buffers. Of course, it’s different strokes for different folks so whatever works for you is okay with me.

And I gotta admit it looks really cool and is sure to give you nerd creds from just about everybody.

-1:-- Emacs Nerd Porn (Post jcs)--L0--C0--April 16, 2024 04:12 PM

Protesilaos Stavrou: Emacs: fontaine version 2.0.0

Fontaine allows the user to define detailed font configurations and set them on demand. For example, one can have a regular-editing preset and another for presentation-mode (these are arbitrary, user-defined symbols): the former uses small fonts which are optimised for writing, while the latter applies typefaces that are pleasant to read at comfortable point sizes.


Control the fonts of more faces

This version brings a major expansion to the scope of the user option fontaine-presets. It can now control the font family and concomitant attributes of more Emacs faces. In particular, it covers the following additional faces:

  • mode-line-active and mode-line-inactive.
  • header-line.
  • line-number (from the display-line-numbers-mode or its global variant).
  • tab-bar (from the tab-bar-mode).
  • tab-line (from the tab-line-mode).

All the supported faces are stored as the value of the variable fontaine-faces. This is the complete list:

  • default
  • fixed-pitch
  • fixed-pitch-serif
  • variable-pitch
  • mode-line-active
  • mode-line-inactive
  • line-number
  • tab-bar
  • tab-line
  • bold
  • italic

Existing users do not need to update their configuration, as (i) the old values will still work and (ii) undefined values fall back to reliable known values.

This change empowers users to further configure their setup, such as:

  • Make the mode lines smaller than the main text.
  • Use a proportionately spaced font for the tabs, while retaining a monospaced font for editing.
  • Use a different font family for line numbers to differentiate them from the main body of text.

These are some possibilities. Then consider that different presets can change specify different configurations. For example, a coding preset can be all about small, monospaced fonts, while a reading preset may increase the font sizes and apply proportionately spaced fonts.

The doc string of fontaine-presets covers the technicalities, as does the official manual (shipped with the package or available on my website: https://protesilaos.com/emacs/fontaine).

Thanks to Ashlin Eldridge for suggesting the inclusion of mode line and line number faces. This was done in issue 4: https://github.com/protesilaos/fontaine/issues/4.

Use the fontaine-mode to persist presets

The new fontaine-mode provides a convenience toggle to do the following:

  1. Store the current Fontaine preset before closing Emacs.
  2. Store the latest preset after using the command fontaine-set-preset.
  3. Persist font configurations while changing themes.

The purpose of storing the latest preset is to restore it easily, such as when starting Emacs. In the manual, we mention this in the sample configuration:

;; Set the last preset or fall back to desired style from `fontaine-presets'
;; (the `regular' in this case).
(fontaine-set-preset (or (fontaine-restore-latest-preset) 'regular))

This takes effect while starting up Emacs. So if, say, the user had selected a reading preset with fontaine-set-preset and then closed Emacs while fontaine-mode was enabled, the reading preset will be restored on startup.

Thanks to Adam Porter (alphapapa) for suggesting this in issue 2: https://github.com/protesilaos/fontaine/issues/2.

We used to provide code in the sample configuration which was doing what fontaine-mode does, though this is easier to set up (plus it is a toggle).

Deprecated the command fontaine-set-face-font

This command was used to interactively set the attributes of a face. It was not consistent with the rest of Fontaine’s functionality, plus it was not faster than setting face attributes directly from Lisp (such as to test them, while experimenting in the *scratch* buffer).

The fontaine-set-preset-hook provides more options

The functions added to this hook are called after fontaine-set-preset. For example, users of my pulsar package can highlight the current line to not lose track of the cursor:

(add-hook 'fontaine-set-preset-hook #'pulsar-pulse-line)

I had thought about defining what Emacs terms “abnormal hooks”, which are hooks that pass arguments to their functions. This hook would pass the selected preset, but I ultimately opted for the normal hook that run their functions without arguments. If advanced users have a good reason for such a feature, they are welcome to discuss it with me.

Fontaine now works with Emacs 29+

Emacs 29 is the current stable version and has been out for almost a year now. I do not have the resources to test/support older versions, sorry!

Miscellaneous

  • Updated the manual in light of all the aforementioned.
  • Simplified large parts of the code base.
-1:-- Emacs: fontaine version 2.0.0 (Post)--L0--C0--April 16, 2024 12:00 AM

Marcin Borkowski: Improving recenter-top-bottom and reposition-window

If one can be a fan of an Emacs command, then I am a huge fan of recenter-top-bottom (C-l) and reposition-window (C-M-l). I use them all the time to see the context of what I’m editing at the moment. However, they are not always that useful. They are rather crude – recenter-top-bottom only has three “settings”, as the name suggests, and reposition-window has only two (it either puts the first line of a function, or the first line of a comment preceding the function at the top). As I mentioned a few weeks ago, I sometimes work with rather long functions – and sometimes I am in the second of two shorter ones, but I want to see the first one, too. Also, I don’t only edit code – I edit prose, too, where paragraph play the role of functions, and Org files, where there are even other structural elements – headlines, tables and source blocks in addition to paragraphs, for example. I decided to write a variation on the theme of reposition-window, which – instead of putting the first line of the function I’m in at the top, it tries to put the first line of a “section” I’m in at the top.
-1:-- Improving recenter-top-bottom and reposition-window (Post)--L0--C0--April 15, 2024 05:23 PM

Irreal: A Comparison Of Markdown Editors

Although I find it hard to believe, the Minions assure me that there are still people who prefer writing in Markdown rather than Org-mode. I don’t want to relitigate that issue here. If you’re interested in why no right thinking person would prefer Markdown to Org—even without Emacs—I refer you to Karl Voit’s detailed analysis of Org’s superiority. Objectively, it’s just a better markup language and that’s before we get to Babel.

Regardless, there are those who use Markup either because they have to or because they really do prefer it. That leads to the question of which editor is best for writing in Markdown. (That issue doesn’t come up with Org-mode, of course.) Needless to say, we Emacs partisans dismiss this as a silly question because we think all editing tasks are best done with Emacs. Less biased folks may demur.

Franco Pasut is one such person and he analyzes the four editors

  • Vim
  • Emacs
  • Sublime Text
  • VS Code

all of which have facilities for helping you edit Markdown. He looks at each editor both out-of-the-box and with Markdown specific add-ons.

I’ll let you read his post for the details but as a spoiler, I’ll tell you that Emacs is not his first choice even though he is an Emacs user.

-1:-- A Comparison Of Markdown Editors (Post jcs)--L0--C0--April 15, 2024 04:53 PM

Sacha Chua: 2024-04-15 Emacs news

Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, lobste.rs, kbin, programming.dev, lemmy, communick.news, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, and emacs-devel. Thanks to Andrés Ramírez for emacs-devel links. Do you have an Emacs-related link or announcement? Please e-mail me at sacha@sachachua.com. Thank you!

-1:-- 2024-04-15 Emacs news (Post Sacha Chua)--L0--C0--April 15, 2024 01:07 PM

Evan Moses: No I don't want 2, Emacs

This blog, and the vast majority of the code I write, is written in Emacs withevil (a vim emulation mode). I have a nasty habit of mashing :w2<ret> when I really was trying to save the current buffer with :w<ret>. :w2 writes the current buffer to a new file called 2, which I don’t believe I have ever done on purpose.

So, I added this little gem to my .emacs, and it’s saved me any number of times:

(defun my:evil-write (&rest args)  "I constantly hit :w2<ret> and save a file named 2.  Verify that I want to do that"  (if (equal "2" (nth 3 args))      (y-or-n-p "Did you really mean to save a file named 2?")    t))(advice-add #'evil-write :before-while #'my:evil-write)

The :before-while advice lets you run a function that gets the same arguments as the advised function. If it returnsa truthy value, the advised function is run as usual, but if it returns nil, the original function is never run.

Share and enjoy.

Update Apr 16, 2024

To be clear: I’m not criticizing Emacs or evil here. To the contrary, I’ve got a personal problem, and thanks to theinfinite flexibility of Emacs I was able to craft a personal solution in 6 lines. I wish the rest of my software were soflexible.

-1:-- No I don't want 2, Emacs (Post Evan Moses (webmaster@emoses.org))--L0--C0--April 15, 2024 12:00 AM

Irreal: Sparse Trees

Emacs Elements has a short video on sparse trees. The TL;DR is that sparse trees give you a method of filtering an Org file to show only the information that you’re interested in. The information can be random text, a tag, a property, deadlines, dates, or date ranges.

Unfortunately, the video doesn’t capture the full power of sparse trees. It makes it seem as if all it does is highlight the matches in the visible buffer but sparse trees are actually much more powerful. If you have a large file, it will hide any non-relevant data except for context. The rules for what constitutes “context” are slightly complex so you should take a look at the documentation for the full story.

My only complaint is that I can’t find a way to restore the original buffer after invoking a sparse tree filtering other than reloading or rebuilding the file. You can turn off the highlighting but I can’t figure out how to get the original buffer back. This is Emacs so I’m sure there’s a way but I haven’t found it1.

Another nice feature of sparse trees is that you can “stack them”. That is, after forming a sparse tree representation of the buffer you can refine that representation with further filtering.

The video is only 5 minutes, 12 seconds so it’s easy to find time for it. It will give you a good overview but you really need to check the documentation for the complete story.

UPDATE [2024-04-14 Sun 19:27]:

I just noticed that the fix for restoring the previous buffer state no longer works so we’re back to no solution to this problem.

Footnotes:

1

According to this Stack Overflow entry, there is no good way of doing this. One responder does give some code that appears to do the job.

-1:-- Sparse Trees (Post jcs)--L0--C0--April 14, 2024 04:08 PM

James Dyer: Waybar Toggling Sticky Key Keymaps

For my previous post I was talking about a software visual indicator to discern which key has been locked in a sticky key situation. For example there are typically two modes of stickiness, being latched and locked, by default I had set up the locked variant as I thought it would be more useful for Emacs and in fact I have found this to be the case. For example, double tapping the Control key allows nice easy single key navigation via ’n’ ‘p’ ‘f’ and ‘b’, possible page down with ‘v’ and to delete lines I can use ‘k’ .e.t.c.

I’m sure I will find more bonuses in Emacs with this key locking mechanism and of course I can always tweak my keybindings, for example maybe a page up could be a Ctrl-<key> so I can have even more power navigating with a single <key>.

But how does a locked key setup work in a different program? and especially the software I use for my digital art, namely Krita. I have a USB numpad peripheral in which I map each key to a Krita shortcut, for example common actions such as colour picking, brush resize, canvas flip, undo / redo e.t.c. I have found this to actually be a nice cheaper option than one of the more specialised digital art controllers and more flexible as I will always be able to use it on linux with keymapping software like kmonad or kanata.

It didn’t take long to find out that I was running into difficulties with Krita and the locked sticky setup. For example colour picking is quite a common activity in digital art and it just so happens that for Krita it is bound by default to the Ctrl key! In addition Shift resizes the brush too. I found that quite often I was tapping the Ctrl and or Shift consecutively which was locking the modifier key which would have some unwanted side effects and would start to get frustrating as I fumble around to unlock the relevant modifier thus disrupting my flow. I quickly came to the conclusion that a locked sticky was not viable for my use within Krita.

So how could I craft a solution to this problem?

In my previous post, I might have unintentionally already laid the groundwork as I have created both a latched and a locked sticky key variant in the xkb file format. Perhaps I could develop a toggling mechanism between the locked and latched states, switching to latched state when I use Krita.

Just like before, I think Waybar would be ideal to perform the toggle with a click (which could also be a stylus click from a pen) and to then display the current status.

Initially I created the following bash script to perform the toggling of the keymaps :

#!/bin/bash

# Define the paths to your keymap files
KEYMAP_SWAY=~/.config/keymap_sway.xkb
KEYMAP_LOCKED=~/.config/keymap_with_locked_modifiers.xkb
KEYMAP_STICKY=~/.config/keymap_with_sticky_modifiers.xkb
CURRENT_KEYMAP_PATH=~/.config/keymap_current

# Check if the current keymap is set, if not use the sway keymap
if [[ ! -f "$CURRENT_KEYMAP_PATH" ]]; then
   echo "$KEYMAP_SWAY" > "$CURRENT_KEYMAP_PATH"
fi

CURRENT_KEYMAP=$(cat "$CURRENT_KEYMAP_PATH")

# Swap the keymaps
if [[ "$CURRENT_KEYMAP" = "$KEYMAP_LOCKED" ]]; then
   cp -f "$KEYMAP_STICKY" "$KEYMAP_SWAY"
   echo "$KEYMAP_STICKY" > "$CURRENT_KEYMAP_PATH"
else
   cp -f "$KEYMAP_LOCKED" "$KEYMAP_SWAY"
   echo "$KEYMAP_LOCKED" > "$CURRENT_KEYMAP_PATH"
fi

# Reload Sway configuration
swaymsg reload

Note that at first I tried to use the xkbcomp command but by all accounts only works on X11 so with wayland and in particular Sway I had to find a workaround to reload a toggled keymap - which is where swaymsg reload comes in. The solution is a little hacky but will work and involves swapping around files on disk and then forcing a reload of the sway configuration file.

As always with toggling, the key is usually working out the current toggle state in order to know what to toggle to. I decided to use the old fashioned method of a file on disk containing the path to the current keymap!

In the sway configuration file I can now attach a keybinding to the new toggle script :

bindsym $mod+y exec keymap-toggle.sh

‘y’ for sticky seems appropriate methinks.

Now for updating waybar to reflect the status. In this case as in the modifier LEDs of my last post I will have to create some custom modules and link it to a content producing bash script.

A keymap_monitor.sh script is as follows:

#!/bin/bash

CURRENT_KEYMAP_PATH=~/.config/keymap_current

CURRENT_KEYMAP=$(cat "$CURRENT_KEYMAP_PATH" | grep "sticky")

if [[ $CURRENT_KEYMAP ]]; then
   echo "{\"text\": \"STICKY\", \"class\": \"active\"}"
else
   echo "{\"text\": \"LOCKED\", \"class\": \"inactive\"}"
fi

and the waybar module :

"custom/togglesticky": {
    "exec": "keymap-monitor.sh",
    "interval": 1,
    "return-type": "json",
    "on-click": "keymap-toggle.sh",
}

Note the return-type type is json and the echo statements in the keymap_monitor.sh script have formatted the return data in the json format meaning the waybar module can process the string effectively. Note also a css class is set up which will link to the associated waybar css style sheet and potentially offer a nice flexible look for each mode if desired.

“on-click”: “keymap-toggle.sh” will allow the toggle to be actioned and the monitor script will be called every second as per the interval setting to poll the current toggle state.

Well that should be about it!, when I now open up Krita I can just tap on the LOCKED indicator on waybar which will then display STICKY (I decided to go with STICKY rather than LATCHED) This now indicates that I have changed the keymap, at which point double tapping any modifier keys as part of my arting shenanigans will now not lock the associated modifier and cause annoyance down the line.

I might even eventually find some icons or my preferred method emojis to make things look more graphically pleasing, but with all these things I always initially look to get most of the way there and in a working state before I start polishing it.

-1:-- Waybar Toggling Sticky Key Keymaps (Post James Dyer)--L0--C0--April 14, 2024 10:55 AM

Anand Tamariya: SVG Animation in GNU Emacs

 


Synchronized Multimedia Integration Language (SMIL) is an SVG extension which allows one to create simple animation without Javascript. Here is a basic implementation for <animate> tag.

(require 'svg)
 
(svg-animation-run) 
 
;; Exiting the image-mode will cancel the animation. 
;; Following command will also cancel the animation.
(svg-animation-cancel)
 

Code

https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/svg.el
 

References

 

-1:-- SVG Animation in GNU Emacs (Post Anand Tamariya (noreply@blogger.com))--L0--C0--April 14, 2024 07:42 AM

Irreal: Left Hand Quick Commands

Emacs elements has another interesting video, this time on some commands that he’s rebound for quick invocation. Those commands are (roughly):

  • kill-buffer
  • set-mark-command (Push mark)
  • set-mark-command (Pop mark)
  • exchange-point-and-mark
  • jump-out-of-pair (A custom command)

He begins the video with some praise for the IBM Model M keyboard that he uses. I can relate. As I’ve written before, it’s the greatest keyboard every made. It’s layout is pretty standard so whatever “standard” keyboard you’re using probably has a very similar layout.

Emacs customization, of course, is all about making it as frictionless as possible for your workflow so it makes no sense to criticize someone else’s bindings but it’s interesting how different his choices are from mine.

He uses Ctrl+1, Meta+1, and Meta+2 for some of those commands. He says re realizes that theese are prefix keys but says he never uses them. I, on the other hand, use them all the time. If I want to delete 2 words, I do it with Meta+2 Meta+d. Similarly, if I want to delete 3 characters, it’s Ctrl+3 Ctrl+d. These are all burned into my muscle memory and I’d never give them up.

There’s more to his customization than just rebinding the keys. Most of the above commands also activate the mark and result in highlighting regions. That’s almost never what I want and neither does he. He has a bit of custom code to deactivate the mark so that doesn’t happen. Even if, like me, you don’t care for his rebindings, you may want to grab his code to eliminate the mark activation.

This is a short video and worth a few minutes of your time.

-1:-- Left Hand Quick Commands (Post jcs)--L0--C0--April 13, 2024 04:08 PM

I cut a new release of "setup", my configuration macro package: elpa.gnu.org/packages/setup.ht. You can find a changelog on elpa.gnu.org.

-1:--  (Post)--L0--C0--April 13, 2024 09:07 AM

Emacs APAC: Announcing Emacs Asia-Pacific (APAC) virtual meetup, Saturday, April 27, 2024

This month’s Emacs Asia-Pacific (APAC) virtual meetup is scheduled for Saturday, April 27, 2024 with BigBlueButton and #emacs on Libera Chat IRC. The timing will be 1400 to 1500 IST. The meetup might get extended by 30 minutes if there is any talk, this page will be updated accordingly. Talks Crossplatform Applications Using Emacs and Lambdanative by Benson (~20m) Live demo of using lisp to build an application to calculate income tax that will run on Android and Desktop.
-1:-- Announcing Emacs Asia-Pacific (APAC) virtual meetup, Saturday, April 27, 2024 (Post)--L0--C0--April 13, 2024 12:01 AM

Irreal: 🥩 Red Meat Friday: That’s Not Vim…

Just a quickie today but it’s really, really red meat. If you’re an Emacs partisan, it will give you a reason to chuckle all day. If you worship at the Church of Vim, you’ll be less amused.

As I’ve said before, I never enlisted in the Editor wars and I certainly never took them seriously but it’s indisputable that they can be the source of fun and humor. Sometimes, as with this item, Vim takes the hit. Other times Emacs does. In either case, the trick is to think of them as humor, not tablets from Mt. Sinai.

-1:-- 🥩 Red Meat Friday: That’s Not Vim… (Post jcs)--L0--C0--April 12, 2024 04:13 PM

Eric MacAdie: 2024-04 Austin Emacs Meeting

There was another meeting a week ago of EmacsATX, the Austin Emacs Meetup group. For this month we had no predetermined topics. As always, there were mentions of many modes, packages, technologies and websites, some of which I had never heard of before, and some of this may be of interest to you as well. ... Read more
-1:-- 2024-04 Austin Emacs Meeting (Post Eric MacAdie)--L0--C0--April 12, 2024 08:22 AM

Emacs TIL: The Night Before A Coding Interview

Ah, the night before a coding interview. It’s like the night before Christmas, if instead of presents, Santa was bringing a whiteboard full of algorithms and data structures for you to solve while someone watches over your shoulder. The anticipation is palpable, the anxiety is through the roof, and your brain decides it’s the perfect time to replay every piece of code you’ve ever written, questioning if any of it was ever good.

Let’s set the scene: The clock strikes midnight, and there you are, lying in bed, eyes wide open, staring at the ceiling. Your mind races faster than Usain Bolt, zipping from one programming concept to another. Binary trees, linked lists, recursion… Oh, my! You try counting sheep, but your brain automatically starts sorting them using QuickSort, which, let’s be honest, is not the most relaxing algorithm.

You think to yourself, “Maybe I should get up and study some more.” So, you roll out of bed, fire up your laptop, and the glow of the screen in the dark room feels like the opening scene of a hacker movie—except, instead of hacking into the mainframe, you’re watching “Crash Course in Data Structures” for the hundredth time.

As the night drags on, every tick of the clock feels like a taunt. “Tick, tock, your interview’s a mock,” it seems to say. You try every trick in the book to fall asleep. Warm milk? Check. Counting backwards from 100? Check. Listening to whale sounds? Check. But nothing works. Your brain is like a web browser with 50 tabs open, and you can’t find which one is playing that annoying music.

Finally, after what feels like an eternity, you see the first light of dawn creeping through the curtains. Birds are chirping as if to say, “Good morning! Ready to fail that interview?” Thanks, birds. Really helpful.

You arrive at the interview, running on fumes and caffeine, looking like a character from “The Walking Dead.” The interviewer asks, “How are you today?” And with a caffeine-induced grin, you respond, “Great! I spent the night embracing the complexity of computational problems instead of sleeping. So, I’m ready for anything!” The interviewer, slightly taken aback, proceeds with the questions.

But here’s the twist: Despite the sleepless night, the gallons of coffee, and the nervousness that feels like it’s going to make you implode, you start solving the problems. One by one, your sleep-deprived brain digs deep and finds the answers. It turns out, the night of panic was like a hardcore training session, and you’re now in the zone, unstoppable.

In the end, you walk out of the interview feeling like a gladiator who just won a battle in the arena. You might not remember your own name at this point, but darn it, you solved those problems. And then, as you step outside, you think to yourself, “Maybe next time, I’ll try sleeping. Just to see if it’s any easier.”

So, my friend, if you’re feeling bad about that sleepless night before your coding interview, just remember: you’re not alone. It’s like a rite of passage in the tech world. And who knows? It might just be your brain’s way of saying, “We got this.”

(Edited with ChatGPT)

-1:-- The Night Before A Coding Interview (Post Junji Zhi)--L0--C0--April 12, 2024 03:23 AM

Susam Pal: Emacs Info Expressions

On #emacs IRC or Matrix channels, we often share references to the built-in Emacs documentation as Elisp expressions that look like this:

(info "(emacs) Basic Undo")

Here is another example:

(info "(emacs) Word Search")

This is a common practice in the Emacs channels even though all of the Emacs manual is available on the world wide web too. For example, the section referred to in the above expression is available here: GNU Emacs Manual: Word Search. The reason for sharing Elisp expressions like this is likely partly tradition and partly convenience. Many Emacs users are logged into IRC networks via Emacs itself, so once the recipient sees an Elisp expression like the above one in their chat buffer, visiting the corresponding manual page is a simple matter of placing the cursor right after the closing parenthesis and typing C-x C-e.

But isn't it clumsy for the sender to type Elisp expressions like this merely to share a pointer to a section of a manual with others? Turns out, it is not. This is Emacs! So of course there are key-bindings to do this.

Copy Info Node Name

Say, while helping another Emacs user we type M-x info-apropos RET version control RET and land on the section "Branches" and realise that this is the section that the person we are trying to help should read. Now when we are on this section, we can simply type c and Emacs will copy the name of the current Info node to the kill ring. This name looks like this:

(emacs) Branches

Now we can go to the *scratch* buffer (or any buffer), copy the node name, and complete the info expression manually. For example, we could type the following key sequence on a fresh new line to create the Elisp expression and copy it to the kill ring:

" " C-b C-y C-a C-SPC C-e M-( info C-a C-k C-/

On vanilla Emacs, the above rather long key sequence first types two double-quotes next to each other (" "), then moves the cursor back to go within the double-quotes (C-b), then pastes the text (emacs) Branches from the kill ring (C-y), then selects the pasted text (C-a C-SPC C-e), then surrounds it within parentheses (M-(), then inserts the text info just after the opening parentheses, and finally copies the resulting expression to the kill ring (C-a C-k C-/). The expression copied to the kill ring looks like this:

(info "(emacs) Branches")

Can we avoid constructing the info expression manually and have Emacs do it for us? Turns out we can as we see in the next section.

Copy Info Expression

I recently learnt from Karthink and Mekeor Melire that we can ask Emacs to create the entire info expression automatically for us. All we need to do is use the zero prefix argument with the c key. So when we are on section "Branches", if we type C-0 c, the following expression is copied to the kill ring:

(info "(emacs) Branches")

I should have known this because indeed while we are in the Info documentation browser, if we type C-h k c to describe the key sequence c, we see the following documentation:

c runs the command Info-copy-current-node-name (found in
Info-mode-map), which is an interactive byte-compiled Lisp function in
‘info.el’.

It is bound to c, w, <menu-bar> <info> <Copy Node Name>.

(Info-copy-current-node-name &optional ARG)

Put the name of the current Info node into the kill ring.
The name of the Info file is prepended to the node name in parentheses.
With a zero prefix arg, put the name inside a function call to ‘info’.

  Probably introduced at or before Emacs version 22.1.

[back]

So indeed Emacs has a convenient key sequence to create the complete info expression for the current Info node. The person who receives this info expression can visit the corresponding section of the manual simply by evaluating it. For example, after copying the expression in Emacs, they could simply type C-y C-x C-e to paste the expression into a buffer and evaluate it immediately. Alternatively, they might want to type M-: C-y RET to bring the eval-expression minibuffer, paste the expression, and evaluate it.

Read on website | #emacs | #technology

-1:-- Emacs Info Expressions (Post)--L0--C0--April 12, 2024 12:00 AM

D.V.F.P.: Markdown with Vim, Emacs, Sublime Text 4 and Visual Studio Code

Abstract:

How are four generalist editors, i.e., designed to be used with a wide range of programming languages and text files, performing when writing documents in Markdown language? This is the subject of this article based on my personal experiences in using Vim, Emacs, Sublime Text 4 and Visual Studio Code both directly and with extensions dedicated to the above mentioned markup language.

1. Introduction.

Markdown is a simple markup language that is within anyone’s reach, compatible with HTML, and allows very elegant, well-formatted text to be written for both web and print publication.

This article, however, is not about the language itself, which, moreover, has been described extensively on the Web, but about how various command-line editors allow one to write in Markdown.

A feature of both markdown and programming languages is, in fact, the usability of any plain-text editor to write related code.

The article in based on my personal experience with Vim, Emacs, Sublime Text and Visual Studio Code, on three main points:

  1. Editor behavior without plugins or extensions installed.
  2. Behavior with Markdown language-specific plugins or extensions.
  3. Preview handling.

2. Vim and Markdown.

Vim can be a powerful writing tool for Markdown as well, as for any other language, provided the initial hurdle of the learning phase is passed.

2.1. Vim without plugins.

Without plugin the .md files are handled as simple text documents without any dedicated function.

In practice: the “added value” of Vim is Vim itself, with its own original modal writing.

The Vim user community has, however, developed some very useful extensions for writing in Markdown, including "vim-markdown and "UltiSnips.

2.2. Vim with the plugin vim-markdown.

The plugin vim-markdown is useful for many functions including: folding, concealing, moving between section names, TOC (Table Of Contents).

In the programmer’s page the features made available by the plugin are analytically described.

I report, in this article, only the part related to TOC:

:Toc: create a quickfix vertical window navigable table of contents with the headers.

Hit on a line to jump to the corresponding line of the markdown file.

:Toch: Same as :Toc but in an horizontal window.

:Toct: Same as :Toc but in a new tab.

:Tocv: Same as :Toc for symmetry with :Toch and :Tocv.

:InsertToc: Insert table of contents at the current line.

2.3. Vim with the plugin UltiSnips.

An excellent plugin for Vim is UltiSnips.

Collections of snippets dedicated to that plugin can be found at honza/vim-snippets.

On the subject I refer to my following two articles:

The first article is on handling snippets in Vim with the UnltiSnip while the second contains a custom snippet that I find very useful for creating hyperlinks when descriptive text is already present in documents.

2.4. Vim and Markdown preview.

Regarding preview handling I recall two others of mine:

3. Emacs and Markdown.

Emacs is another highly customizable and extensible editor with a very large base of additional programs.

3.1. Emacs without plugins.

Opening a “.md” file with Emacs without additional packages activates the “Fundamental” mode, that is, the basic mode of the editor.

In this mode there is no dedicated Markdown functionality and you can use the editor with its native features as if for any text document.

3.2. Emacs with markdown-mode.

To add specific functionality to documents written in Markdown, the markdown-mode package must be installed.

I reproduce the screenshot taken from the actual start page of the plugin:

markdown_mode

The installation string with the Melpa library is as follows: M-x package-install RET markdown-mode RET .

For Straight with use-package, which is my current configuration, the following configuration needs to be entered in .emacs:

(use-package markdown-mode
 :straight t
 :mode ("README\.md\" . gfm-mode)
 :init (setq markdown-command "markdown"))

A remark: on the net you can find the use-package configuration associated with the multimarkdown command. I preferred to modify that configuration and associate it with the markdown command for ease of installation.

The multimarkdown command, in fact, must be compiled from source, as indicated on the dedicated page on GitHub.

With the markdown-mode package, a menu indicating the main operations is also installed in the top bar:

Emacs Markdown-Mode Menu

The menu is very useful for having at your hand the main key combinations of the plugin.

By using this package, document structuring management is similar to Org-mode, with Tab key to expand or collapse single headings and Shift-Tab to expand or collapse all headings simultaneously.

Also the basic commands for moving between paragraphs are the same as in Org-mode:

  • C-c C-n to jump to the next header of any level.
  • C-c C-p to jump to the previous header of any level.
  • C-c C-f to jump to the next header of the same level.
  • C-c C-b to jump to the previous header of the same level.
  • C-c C-u to move up a level.

These combinations, like many others, are also given in the menu dedicated to Markdown.

You can also find che analytical description of the commands at package page.

3.3. Emacs and preview in Markdown.

Among the commands added by the plugin there is also, as can be seen in the previous image, the Preview & Export item to launch both the preview on browser (C-c C-c p) and the Live Export (C-c C-c l) on separate Emacs window.

Emacs uses its own configuration for the preview browser, independent of the “default” operating system browser.

In the following examples, the customization allows Opera to be launched instead of Firefox.

To change the configuration with Melpa package system, the following snippet in .emacs is used:

(setq browse-url-browser-function 'browse-url-generic
 browse-url-generic-program "opera")

With the use-package system with straight.el you can add a fragment to the configuration already given above.

The fragment dedicated to the browser starts from the line containing the :config command:

(use-package markdown-mode
 :mode ("README\\.md\\'" . gfm-mode)
 :init (setq markdown-command "markdown")
 :config
 (setq browse-url-browser-function 'browse-url-generic
 browse-url-generic-program "opera"))

4. Sublime Text 4 and Markdown.

One of the main new features introduced by Sublime Text compared to previous editors is the Command Palette.

Thanks to the Command Palette you only need to remember one key combination, typically ctrl + shift + p (Windows, Linux) or ⌘ + ⇧ + p (on Mac), for all commands.

This makes it much easier to memorize specific combinations, which can also be typed directly to avoid the intermediate step of the Command Palette itself.

4.1. Sublime Text 4 without plugins.

In basic mode, Sublime Text 4 has a very interesting behavior: even natively, the editor recognizes the language from the extension of the document name and inserts the label “Markdown” in the lower right corner, with activation the Ctrl-r key combination to jump between paragraphs.

4.2. Sublime Text 4 with the plugin “MarkdownEditing”.

A great plugin is Markdown Editing.

markdown_editing

After the plugin is installed, you can activate its functions via the Palette.

It is enough, therefore, to open the Command Palette with ctrl + shift + p (Windows, Linux) or ⌘ + ⇧ + p (on Mac) and press the required command, e.g. fold or link, and run the command that results next to the name MarkdownEditing.

sublime fold palette

Typing in the Command Palette the string MarkdownEditing: will give you the full list of commands available with the plugin.

4.3. Sublime Text 4 and preview in Markdown.

For previewing you can install the “Markdown Preview” plugin, activate the command list with ctrl + shift + p, run the command Markdown Preview: Preview in browser and select markdown.

sublime preview

5. Visual Studio Code and Markdown.

Finally: Visual Studio Code, hereafter VSCode for short.

It is the most recent editor of those mentioned in this article.

VSCode also has the Command Palette, already described for Sublime Text, which can be activated with the Ctrl + Shift + P command.

5.1. VSCode without plugins

Even without any additions, VSCode allows you to view the preview for documents written in Markdown.

The built-in preview must be activated by the combination Ctr+K V to open a side-by-side window or Ctrl+Shift V to open it a separate tab.

A very useful feature: the preview automatically follows the position of the cursor in the document and automatically responds to mouse scrolling.

Another built-in feature is the lateral Outline based on the paragraph header at the various levels. It is located in the Explorer window on the left side of the screen.

The Outline can also be generated with the Ctrl+Shift O command to quickly jump to any paragraph in the document.

In addition, VSCode has some snippets to quickly insert various language elements. The snippets are activated with the Ctrl+Space command.

Thus, VSCode has a very advanced native set of functions dedicated to the Markdown language.

5.2. VSCode with the pluginMarkdown All in One”.

Of course, there are various plugins that extend of VSCode for Markdown.

My favorite at this time is Markdown All In One which allows, among other features, to create an automatic Table Of Contents (TOC) anywhere in the document and to add paragraph numbering.

For TOC creation, simply start at the Command Palette and type “table” to get commands for both creating and updating the table of contents.

For automatic headers numbering you again start from the Command Palette by typing the word “numbers”, even partially, to get the command to create/update or remove the numbering.

It is also possible to generate an HTML document exported from the Markdown document, by typing the word “html” in the Command Palette.

6. In summary.

What program do I use to write in Markdown?

I try to use all of them.

However, I prefer Vim when I want to do some mental training and Visual Studio Code when I want to write “quietly” by automatically getting a preview view, table of contents and paragraph numbering.

Thank you for your attention.

-1:-- Markdown with Vim, Emacs, Sublime Text 4 and Visual Studio Code (Post)--L0--C0--April 12, 2024 12:00 AM

William Denton: Upgrading my Tor bridges

The Tor Project announced the release of version 0.4.8.11 of the Tor server, which meant it was time for me to upgrade the two relays I run, one of which I set up last week.

In brief

Here’s my Conforguration method:

  • I upgrade the version number to 0.4.8.11
  • I hit C-c C-v t to “tangle” a shell script
  • On a code block for copying scripts, I hit C-c C-c
  • I ssh to the remote machine
  • I run conforg/scripts/tor-install-system.sh
  • I run conforg/scripts/tor-run.sh

Aside from the time to compile the code, this takes under one minute.

The explanation

As I said in my earlier post, I use my own Conforguration tool to handle this sort of thing. It uses Org to edit and manage shell scripts that I can run locally or on remote servers. The list above is a great example of how Org can make things much easier if you’ve set things up just the way you want them, while remaining cryptic to non-Org users. Here’s an explanation of most of what’s going on.

In the Tor section of Conforguration, first I set a variable with the version number I want to install. Today I updated it.

#+NAME: TOR_VERSION
| 0.4.8.11 |

Under Install, I have this code block:

#+begin_src shell :tangle conforg/scripts/tor-install-system.sh :shebang "#!/bin/bash" :var TOR_VERSION=TOR_VERSION
cd /usr/local/src/tor/
curl --location --remote-name https://dist.torproject.org/tor-${TOR_VERSION}.tar.gz
tar --extract --verbose --gunzip --file tor-${TOR_VERSION}.tar.gz
cd tor-${TOR_VERSION}
./configure && make && sudo make install
echo "Now run ~/conforg/scripts/tor-run.sh"
#+end_src

(I say tar --extract --verbose --gunzip --file instead of tar xzvf because I like to use the most readable arguments in scripts. I do use short forms when I’m typing at the command line.)

The :tangle argument to the code block is covered under extracting source code in the manual. When I hit C-c C-v t (which runs org-babel-tangle) then that chunk of code is exported to the file named by the argument. It’s given a shebang and the TOR_VERSION variable is passed into it, resulting in this:

#!/bin/bash
  unset TOR_VERSION
  declare -a TOR_VERSION=( '0.4.8.11' )
  cd /usr/local/src/tor/
  curl --location --remote-name https://dist.torproject.org/tor-${TOR_VERSION}.tar.gz
  tar --extract --verbose --gunzip --file tor-${TOR_VERSION}.tar.gz
  cd tor-${TOR_VERSION}
  ./configure && make && sudo make install
  echo "Now run ~/conforg/scripts/tor-run.sh"

Now I need to get that script to one of the machines where I run a Tor relay. In my ssh configuration it’s aliased to the name tor, so I go down to this section of Conforguration and hit C-c C-c on the code block to execute:

Screenshot from Conforguration
Screenshot from Conforguration

In plain text:

:PROPERTIES:
:header-args: :var hostname="tor"
:END:

#+begin_src shell :results silent :noweb yes
<<install-conforg-remotely>>
#+end_src

The angle bracket thing is noweb syntax, which allows me to use this snippet of code that’s set up earlier in the file, with the hostname variable passed in:

#+NAME: install-conforg-remotely
#+begin_src shell
rsync --archive --compress --delete ~/src/conforguration/conforg/ ${hostname}:conforg/
ssh ${hostname} "conforg/dotfiles/link-dotfiles.sh"
#+end_src

That pushes the scripts and dot files to the other machine and freshens the symlinks for all the dot files. In other words, it refreshes everything on the remote machine—all by hitting C-c C-c.

Now ~/conforg/scripts/tor-install-system.sh is on the other machine. I could execute it remotely from inside Conforguration, but it takes a while to run, so I like to log in to the other machine and do it locally. I ssh over and run:

conforg/scripts/tor-install-system.sh

It downloads the source code and compiles it. When it’s done, it finishes up by installing files on the system, and then ends with:

make[1]: Leaving directory '/usr/local/src/tor/tor-0.4.8.11'
Now run ~/conforg/scripts/tor-run.sh

I run:

conforg/scripts/tor-run.sh

This detects that a Tor tmux session is running, kills it off while waiting for the Tor daemon to die nicely, then sets it up again. When it starts fresh, the new Tor server is running.

Another way

For my bridge running on another machine, I could do the upgrade the same way, but to match how I’d installed it I did it like this (after upgrading the version number and pushing the commit to the repository):

  • cd src/conforguration
  • git pull
  • install/install.sh
  • ~/conforg/scripts/tor-install-system.sh
  • ~/conforg/scripts/tor-run.sh

There are other ways to handle configuration management and upgrading servers, but I’ve built one I really like.

-1:-- Upgrading my Tor bridges (Post William Denton)--L0--C0--April 11, 2024 12:40 PM

Charles Choi: Exporting UTF-8 Smart Quotes from Org Mode

Count me as one who really likes using smart quotes when exporting from Org. To enable this requires that you set the variable org-export-with-smart-quotes to t. So far, so good yes? Not quite. Apparently by default when exporting to HTML or Markdown, Org will use the HTML character entity representation of a smart quote which I see as overly conservative in 2024. As most contemporary software now can handle UTF-8, it seems to me more sensible to use smart quote characters that are likewise UTF-8. For English these are:

  • left and right double quote
  • left and right single quote
  • apostrophe (right single quote)

Apparently Org has an alist variable that captures the different representations of the above for different languages and for different export targets. This variable is called org-export-smart-quotes-alist and sure enough it captures the UTF-8 set of characters for each language. Empowered with this knowledge, here’s some Elisp code to reconfigure org-export-smart-quotes-alist so that exporting to HTML or Markdown uses the UTF-8 representation for English (en).

(defun cc/reconfig-org-smart-quotes-lang (lang)
  "Reconfigure Org smart quotes to use utf-8 per LANG."
  (let* ((db-entry (assoc-string lang org-export-smart-quotes-alist))
         (utf8-primary-opening (plist-get (assoc-default 'primary-opening db-entry) :utf-8))
         (utf8-primary-closing (plist-get (assoc-default 'primary-closing db-entry) :utf-8))
         (utf8-secondary-opening (plist-get (assoc-default 'secondary-opening db-entry) :utf-8))
         (utf8-secondary-closing (plist-get (assoc-default 'secondary-closing db-entry) :utf-8))
         (utf8-apostrophe (plist-get (assoc-default 'apostrophe db-entry) :utf-8))
         )

    (setf (plist-get
           (assoc-default 'primary-opening
                          (assoc-string lang org-export-smart-quotes-alist))
           :html)
          utf8-primary-opening)

    (setf (plist-get
           (assoc-default 'primary-closing
                          (assoc-string lang org-export-smart-quotes-alist))
           :html)
          utf8-primary-closing)

    (setf (plist-get
           (assoc-default 'secondary-opening
                          (assoc-string lang org-export-smart-quotes-alist))
           :html)
          utf8-secondary-opening)

    (setf (plist-get
           (assoc-default 'secondary-closing
                          (assoc-string lang org-export-smart-quotes-alist))
           :html)
          utf8-secondary-closing)

    (setf (plist-get
           (assoc-default 'apostrophe
                          (assoc-string lang org-export-smart-quotes-alist))
           :html)
          utf8-apostrophe)))

(add-hook 'org-mode-hook (lambda ()
                           (cc/reconfig-org-smart-quotes-lang "en")))

The above code is tested on Emacs 29.1, Org 9.6.25.

If you export to different languages, be sure to run cc/reconfig-org-smart-quotes-lang with your language of choice.

I leave it as an exercise to motivated readers more experienced in Elisp to write a cleaner version of this code. As it stands, this works well enough to achieve my desired goal.

-1:-- Exporting UTF-8 Smart Quotes from Org Mode (Post Charles Choi)--L0--C0--April 10, 2024 09:30 PM

Irreal: Neal Stephenson On Emacs

All of us Emacs nerds are familiar with Neal Stephenon’s essay In the Beginning…Was the Command Line, in which he describes Emacs as the thermonuclear word processor. A couple of years ago, he did a podcast with Lex Fridman in which he expands on his remarks and comments on the longevity of Emacs.

Fridman asked him if he thought that Emacs would still be around in, say, a hundred years. Stephenon’s answer invoked the John Henry legend where in the end, Henry was unable to keep up with the steam hammer. Stephenson says that Microsoft and Apple are pouring so much money and effort into VS Code and XCode that eventually Emacs won’t be able to keep up.

I don’t think that XCode is an issue in this discussion. It’s not primarily a text editor and is, in any even, very specific to the Apple universe. VS Code, on the other hand, can certainly be said to be an Emacs competitor. I don’t think it’s as powerful or full featured as Emacs but it does have a lot of money and power behind it. Whether Microsoft itself will survive for a hundred years and if they do whether they’ll find it economically advantageous to continue supporting VS Code are open questions.

I think that technology 100 years from now will look so different from what we have today that virtually no technology we have now will be extant. That will probably include Emacs. On the other hand, Emacs has been defying the odds for a long time and may surprise us all. What do you think?

-1:-- Neal Stephenson On Emacs (Post jcs)--L0--C0--April 10, 2024 03:36 PM

Please note that planet.emacslife.com aggregates blogs, and blog authors might mention or link to nonfree things. To add a feed to this page, please e-mail the RSS or ATOM feed URL to sacha@sachachua.com . Thank you!