Shared posts

08 May 22:10

Irreal: Grove

by Irreal
Tom Roche

pullquote:
> Chu says that [his new note-taking-with-Org package] [Grove](https://github.com/jonathanchu/grove) was informed by his experience with [Obsidian](https://obsidian.md/).

Jonathan Chu is a software engineer and Emacs enthusiast who’s been looking for a note taking app that he can actually use. He’s tried all the usual suspects but found them too opinionated for his liking. He wanted to work in Emacs and write his notes in Org mode but none of the existing packages were quite right. So he did what Emacs users always do when things don’t work exactly as they like: he wrote an Emacs package do things the way he wanted. The result was grove.

Chu says that Grove was informed by his experience with Obsidian. I’ve never used Obsidian so I can’t comment on that aspect but Chu says that Grove is Obsidian-like. The only external dependencies are ripgrep, Graphviz if you want the graph view, and Consult if you want the enhanced search capability. One of his goals was to have an easily installable and configurable package.

It looks like a pretty nice package if you’re looking for a note taking method with a bit of but not too much structure. I use Org mode for all my note taking across many dimensions and have never felt the need for a more organized approach. Sure, sometimes I think about using Denote or Org Roam but—for me—they never seemed worth the effort. Many others disagree, of course, but Emacs has a home for us all,

Take a look at his post or the Github repository for the details and a bit more on how things work.

06 May 17:28

1033 - Lassie’s Nude Adventure feat. Alex Nichols (5/4/26)

Tom Roche

just bant, but amusing

Will, Felix, and Alex take a break from the news this week to answer some Dear Prudies! We answer questions about nude dogsitter, several bad parents, an old swinger couple with a bedroom dilemma, and a man who is cartoonishly afraid of eating pussy. Really gross episode honestly, girlfriends beware. Follow Alex on Twitter: x.com/@Lowenaffchen Check out his show Fortune Kit: https://www.patreon.com/fortunekit And watch ChapoFYM: https://www.twitch.tv/chapotraphouse
05 May 01:48

Trump boasts USA acts 'like pirates', as China challenges US sanctions on Iran

Tom Roche

BN excellent as usual

Donald Trump boasted that the US government acts "like pirates", seizing Iran's ships and oil. "It's a very profitable business", he said. Meanwhile, Beijing is openly resisting Washington's sanctions against Chinese companies for trading with Iran. China has ordered all domestic firms to ignore US sanctions. Ben Norton explains these geopolitical developments. VIDEO: https://www.youtube.com/watch?v=vfB8xQEZolk Topics 0:00 (CLIP) Trump: "We're like pirates" 0:14 US blockade of Iran 1:11 (CLIP) Trump on US piracy 1:57 US seizure of Iranian ships 2:43 AI memes of Trump as pirate 3:01 Multiple acts of US piracy 4:09 Venezuela 5:06 (CLIP) Trump on stealing oil 5:30 Pirates of the Persian Gulf 6:31 US sanctions on China 8:42 Hengli plant in Dalian 9:23 China challenges US sanctions 10:49 Secondary sanctions threat 11:38 USA crossed China's red line 14:17 US sanctions 1/3rd of world 14:47 Map of US sanctions 15:00 Sanctions are very deadly 16:21 Blockade of Cuba 17:19 US empire's goal 17:59 New sanctions on Cuba 19:02 Chinese solar panels help Cuba 19:47 Blowback: US sanctions backfire 20:45 Outro
03 May 18:26

Radio War Nerd EP 603 — Operation Barbarossa, pt. 9: Battle of Moscow (II), feat. Annibale + Assassination Tension

by mail@yashalevine.com (Gary Brecher)
Tom Roche

another EXCELLENT Annibale exposition on the (actual) history of WW2 vs (NATOstan's) [/Myth of the Eastern Front/](https://en.wikipedia.org/wiki/The_Myth_of_the_Eastern_Front)

Co-hosts John Dolan & Mark Ames
03 May 04:31

How the US uses oil as a geopolitical weapon

Tom Roche

excellent, informative esp regarding how US remains net importer of /crude/ oil

Oil has been at the center of the war on Iran. Ben Norton explains how the United States became the biggest oil producer on Earth, and how the US empire uses petroleum as a geopolitical and economic weapon, pushing for monopolistic Big Oil corporations to dominate the global market. Ben also discusses why Trump pressured the UAE to withdraw from OPEC, and he debunks the myth that the USA is "energy independent". VIDEO: https://www.youtube.com/watch?v=gh-E3q6tGEw Check out our related video on the biggest oil crisis in history: https://www.youtube.com/watch?v=bUdyPJM_rOw Topics 0:00 Iran war and oil 0:36 Petrodollar 1:52 USA is biggest oil producer 3:39 US oil exports increase 4:32 Oil price skyrockets 5:03 Corporate profits rise 5:37 Strait of Hormuz 6:30 UAE withdraws from OPEC 7:31 Abraham Accords 8:37 OPEC history 9:14 Seven Sisters: Big Oil 11:01 OPEC members 12:13 OPEC+ participants 13:18 Goal of OPEC 14:25 State-owned oil companies 15:12 Why USA dislikes OPEC 16:56 Oil is political 17:18 Venezuela economic war 19:06 Big Oil execs in US govt 20:55 Cuba oil blockade 22:29 Energy and food crisis 23:36 US "energy independence" 25:06 US oil imports 26:12 Types of crude oil 27:26 US oil refineries 28:47 US imports by country 30:36 Oil benchmarks 32:47 Oil futures market 33:53 Price predictions 36:04 Economic crisis fears 37:02 Outro
02 May 17:06

The News Quiz: Ep2. The art of vetting

Tom Roche

moderately amusing, surprisingly tame--Chaponda subpar, OK but fails to carry the load

Some hot topics of conversation this week include the ever evolving Peter Mandelson vetting saga, phones being banned in schools and robots who can take over the world... sorry robots who can take over sports. Helping Andy make sense of it all are Daliso Chaponda, Catherine Bohart, Hugo Rifkind and Ria Lina.

Written by Andy Zaltzman.

With additional material by: Jade Gebbie, Christina Riggs, Henry Whaley and Angela Channell Producer: Georgia Keating Executive Producer: Richard Morris Production Coordinators: Asha Osborne-Grinter & Caroline Barlow Sound Editor: Marc Willcox

A BBC Studios Production for Radio 4.

01 May 20:38

Exposing Canary Mission, and Israel’s 50-Year War on Lebanon

by Drop Site News
Tom Roche

EXCELLENT, informative

The United Arab Emirates announced on Tuesday it will leave OPEC effective May 1, ending its membership in the oil cartel that dates to 1967 and removing the group’s third-largest energy producer.

Drop Site’s Ryan Grim, Sharif Abdel Kouddous, and Maysa Mustafa discuss the implications of the move.

They are also joined by Jacquline Sweet to discuss her latest investigation revealing the highest paid employees of the Israeli group running the infamous doxxing site Canary Mission.

And as Israeli attacks on Lebanon continue with daily airstrikes, shelling and demolition in the south, NYU journalism professor Mohamad Bazzi joins to discuss Israel’s 50-year war on Lebanon, Hezbollah’s increasing use of fiber optic FPV drones as a tactic of asymmetric warfare, Israel’s campaign of destruction and erasure in southern Lebanon, and more.



Get full access to Drop Site News at www.dropsitenews.com/subscribe
01 May 19:49

BONUS: The Untouched Power That Could Stop The Iran War

Tom Roche

VERY EXCELLENT legal/political history of one front in the war to create the US imperial presidency, esp
* 20th century emergence of the US [legislative veto](https://en.wikipedia.org/wiki/Legislative_veto_in_the_United_States)
* 1973 [War Powers Resolution](https://en.wikipedia.org/wiki/War_Powers_Resolution) (/WPR/)
* US Congress vs [administrative state](https://en.wikipedia.org/wiki/Administrative_state), esp used-car dealers lobbying to overturn FTC proto-[lemon-law](https://en.wikipedia.org/wiki/Lemon_law) regulations
* 1983 [INS v. Chadha](https://en.wikipedia.org/wiki/INS_v._Chadha) SCOTUS ruling
* uncertain-but-untested legality of WPR today

This week, the Iran War will reach its official 60-day mark. That’s a critical deadline under the War Powers Resolution, a Nixon-era law created to limit presidential war-making.

Under that law, President Donald Trump can claim a one-time, 30-day extension, so the Iran War will likely continue. But the War Powers Resolution also gives Congress a secret weapon to end this unpopular war — or any war — whenever it wants. So why has Congress never used it? 

In this special episode, David Sirota tells the wild story of how a Kenyan-born immigrant and a Ralph Nader-aligned lawyer unwittingly expanded the powers of the president — and left Congress believing that it’s powerless to stop unauthorized wars. 

Note: This bonus episode marks the start of our midseason intermission for Master Plan: The Kingmakers. We’ll be back this summer with the remaining four episodes. Until then, please become a paid subscriber to keep receiving bonus episodes, updates, and more.

Visit levernews.com/upgrade

Learn more about your ad choices. Visit megaphone.fm/adchoices

01 May 16:47

Jiewawa: Overriding keybindings with Meow

by Jiewawa
Tom Roche

illustrates usecase for modal editing with [meow](https://github.com/meow-edit/meow)

I previously wrote about useful Emacs commands for reading. This allowed me to use j and k to scroll the window up and down instead of going forward or backward a line.

I am now using meow for my modal editing needs and have been really happy with it. Meow allows for custom states to be defined, but I have been using a different method recently that takes advantage of the built-in normal and motion states.

Meow has a very clever design choice in that when a key is pressed it can translate it to the default emacs binding and call it via a macro. Below is an example of the function meow-next, which I have bound to j. It essentially just executes the key-binding that is stored as the value of meow--kbd-forward-line which happens to be C-n.

(defun meow-next (arg)
  "Move to the next line.

Will cancel all other selection, except char selection.

Use with universal argument to move to the last line of buffer.
Use with numeric argument to move multiple lines at once."
  (interactive "P")
  (unless (equal (meow--selection-type) '(expand . char))
    (meow--cancel-selection))
  (cond
   ((meow--with-universal-argument-p arg)
    (goto-char (point-max)))
   (t
    (setq this-command #'next-line)
    (meow--execute-kbd-macro meow--kbd-forward-line))))

(defvar meow--kbd-forward-line "C-n"
"KBD macro for command `forward-line'.")

Because meow’s keyboard macro commands are all stored as variables, it is easy for us to overwrite them locally. In the following example I will show how I made a minor mode that lets me have a more enjoyable reading experience.

Firstly, we need to bind the new functions to some obscure key combination. I chose to add these to the global keymap in this case as I want them available across a variety of major-modes.

Then I wrote functions to toggle between the original values of the meow–kbd variables and their overrides.

Finally, I defined a minor mode that can be added to a major-mode’s hook.

(keymap-global-set "M-s-j" 'scroll-up-line)
(keymap-global-set "M-s-k" 'scroll-down-line)

(defvar meow-reading-originals
  '((meow--kbd-backward-line . "C-p")
    (meow--kbd-forward-line . "C-n")))

(defvar meow-reading-overwrites
  '((meow--kbd-backward-line . "M-s-k")
    (meow--kbd-forward-line . "M-s-j")))

(defun meow-reading-restore-directions ()
  "Restore Meow's direction variables locally."
  (dolist (binding meow-reading-originals)
    (set (make-local-variable (car binding)) (cdr binding))))

(defun meow-reading-overwrite-directions ()
  "Overwrite Meow's direction variables locally."
  (dolist (binding meow-reading-overwrites)
    (set (make-local-variable (car binding)) (cdr binding))))

(define-minor-mode meow-reading-mode
  "Adjust some bindings to make `meow-normal-mode' a better experience for reading modes."
  :lighter " reading"
  (if meow-reading-mode
      (progn
        (meow-reading-overwrite-directions)
        (setq-local meow-cursor-type-motion nil)
        (meow--update-cursor-motion))
    (progn (meow-reading-restore-directions)
           (kill-local-variable meow-cursor-type-motion)
           (meow--update-cursor-motion))))

Here is an example of how you can have the minor mode be loaded for all buffers of a given major mode.

(use-package elfeed
  :hook
  (elfeed-show-mode . meow-reading-mode))

The reason that I prefer this to making a whole new “reading-state” is that this is still using meow’s default motion-state. I get to take advantage of all of the default key-bindings. One of the reasons that I moved from evil to meow was that I was getting tired of having to bind so many functions myself. With this method, I can essentially say “I want this mode to behave the same as all of the others, just with one or two changes”.

I am also working on a minor mode for lisp modes that takes advantage of smartparens to hopefully create a lispy like environment, but that is still a work in progress.

30 Apr 16:35

Radio War Nerd EP 602 — Understanding Iran, feat. Hamidreza Azizi

by mail@yashalevine.com (Gary Brecher)
Tom Roche

excellent, detailed

Co-hosts John Dolan & Mark Ames
29 Apr 19:11

1031 - Holding Out for a Hero feat. Hasan Piker (4/27/26)

Tom Roche

VERY EXCELLENT: HP @ 3rd mic helps deliver some GOAT Chapo (analysis /and/ humor)

Streamer and international man of controversy Hasan Piker joins us to recap and analyze Saturday’s assassination attempt at the White House Correspondents’ Dinner. We talk about the radical-centrist shooter, the diverse cast of assassins we’ve met since that fateful day in Butler, and the cast of Chapo all-stars at the dinner itself. Plus: more talk about the media blitz against Hasan, and reading series from the Wall Street Journal and Dylan Byers. Our 10 year anniversary merch is ready for pre-order through April 30! Order at https://chapotraphouse.store/
29 Apr 15:45

Interwar 9 America pt1: Autos, Cinema, Airplanes, Finance, Prohibition, Gangsters

Tom Roche

Excellent (necessarily thin but broad) survey of 1920s US. Note however that Dave and Justin do /not/ in this episode (as advertised above) get to Garvey and the KKK revival--Prohibition is the last major topic in this audio

A little bit of everything as we take two hours to start to paint a picture of Interwar America.
29 Apr 02:28

Radio War Nerd EP 601 — Sudan Civil War Enters 4th Year, feat. Joshua Craze

by mail@yashalevine.com (Gary Brecher)
Tom Roche

EXCELLENT: detailed, could have been more informative with more explanation--but, hey, that's what websearch is for, amIright?

Co-hosts John Dolan & Mark Ames
29 Apr 02:20

#709 - Symbols of the Sacred Feminine

Tom Roche

enjoyable dragging of /Da Vinci Code/ writing, acting, directing, and the franchise generally

We once again travel back to the dark heart of the Bush era by discussing one of the biggest cultural events of the 2000s. Ron Howard's THE DA VINCI CODE (2006) adapted Dan Brown's turgid bestseller into an even more turgid blockbuster. Join us on Patreon for an extra episode every week - https://www.patreon.com/michaelandus
25 Apr 17:03

News Brief: How the Right Invented — and Exploited — the "Liberal Media" Trope

Tom Roche

EXCELLENT, detailed history c1932-2026

In this News Brief, we talk with A. J. Bauer, assistant professor at the University of Alabama, about his new book," Making the Liberal Media: How Conservatives Built a Movement Against the Press". In our discussion we break down the corporate and ideological forces that shaped the popular idea mainstream media was crawling with fifth columnist agitators hostile to the values of Real America.

23 Apr 18:16

James Cherti: The Definitive Guide to Code Folding in Emacs

by James Cherti
Tom Roche

EXCELLENT review of some text-folding (/not/ just code-folding) issues and means (including cut'n'paste-able config code for your init.el. Pullquote (heavily edited):

> The primary drawback of [text] folding modes is inconsistency. For example, hs-minor-mode and outline-minor-mode use entirely different functions and keybindings to perform the exact same logical action. The solution is [author's] package [kirigami](https://github.com/jamescherti/kirigami.el), which acts as a universal frontend for text folding. You define your keybindings once, and kirigami automatically detects the active folding and routes your commands to the appropriate engine.

> A [text] folding backend is the underlying engine that handles the logic of identifying and hiding specific blocks of text. NOTE: When configuring folding backends, ensure that only one folding minor mode is active concurrently in a single buffer, as conflicts and unexpected behavior may occur. For this reason, adding folding hooks to broad categories like prog-mode-hook or text-mode-hook is discouraged. Instead, hooks should be applied specifically to individual language modes, such as emacs-lisp-mode-hook.

Navigating large source files containing thousands of lines of code with Emacs makes it difficult to perceive the underlying structure. For a software engineer spending the majority of the day reading and writing code, reliable folding is a requirement for maintaining focus and managing complexity.

Before we dive in, please consider sharing this article on your website/blog, Mastodon, Reddit, X, or your preferred social media platforms. Sharing it will help fellow Emacs users discover better ways to manage code folding.

In this article, we explore:

  • A folding Frontend: Consolidating folding commands into a single, predictable keymap that operates consistently across all code folding modes.
  • Folding Backends: Ready-to-use hooks to activate the most effective folding backend for the following major modes: C, C++, Java, Rust, Go, Python, JavaScript, TypeScript, Emacs Lisp, shell scripts, Lua, Haskell, YAML, Org-mode, Markdown…
  • Editor Integration: Using indirect buffers to maintain independent folding states, configuring search operations to strictly ignore folded text, and setting up display-line-numbers-mode…
  • Discouraged Folding Engines: A review of legacy or poorly performing packages to avoid.

Why code folding?

Code folding is about managing cognitive load, preserving spatial memory, and controlling screen real estate:

  • Navigating through code (e.g., with LSP) can create a vacuum of context. Folding an entire file to its top-level headings allows the manipulation of the file skeleton directly in the main buffer. Revealing only a specific entry and its parents provides an immediate understanding of the hierarchy without losing position.
  • When tasked with debugging a 20,000 line legacy file, immediate refactoring is rarely an option. Folding enables the visual modularization of massive files on the fly, making hostile codebases readable.
  • Every visible line of code on the screen requires a fraction of subconscious attention to ignore. During debugging sessions, folding adjacent functions or complex implementations acts as a visual garbage collector.
  • Moving or deleting a massive function or block is prone to selection errors. When a block is folded, it behaves as a single logical unit that can be cut, copied, or moved safely and cleanly.
  • Folding is effective for tracking progress during extensive pull requests. Collapsing previously examined functions or blocks actively filters out visual noise.

Code Folding Frontend

The primary drawback of code folding modes is inconsistency. For example, hs-minor-mode and outline-minor-mode use entirely different functions and keybindings to perform the exact same logical action.

The solution is a package called kirigami, which acts as a universal frontend for text folding. You define your keybindings once, and kirigami automatically detects the active folding and routes your commands to the appropriate engine, whether that is outline-minor-mode, outline-indent-minor-mode, org-mode, markdown-mode, gfm-mode, treesit-fold-mode, hs-minor-mode (hideshow), and many others…

To install and configure kirigami, add the following code to your Emacs init file:

(use-package kirigami
  :commands (kirigami-open-fold
             kirigami-open-fold-rec
             kirigami-close-fold
             kirigami-toggle-fold
             kirigami-open-folds
             kirigami-close-folds-except-current
             kirigami-close-folds)

  :bind
  ;; Vanilla Emacs keybindings
  (("C-c z o" . kirigami-open-fold)          ; Open fold at point
   ("C-c z O" . kirigami-open-fold-rec)      ; Open fold recursively
   ("C-c z r" . kirigami-open-folds)         ; Open all folds
   ("C-c z c" . kirigami-close-fold)         ; Close fold at point
   ("C-c z m" . kirigami-close-folds)        ; Close all folds
   ("C-c z a" . kirigami-toggle-fold)))      ; Toggle fold at point

If you are an evil-mode user, add the following keybindings to your init file:

;; Uncomment the following if you are an `evil-mode' user:
(with-eval-after-load 'evil
  (define-key evil-normal-state-map "zo" #'kirigami-open-fold)
  (define-key evil-normal-state-map "zO" #'kirigami-open-fold-rec)
  (define-key evil-normal-state-map "zc" #'kirigami-close-fold)
  (define-key evil-normal-state-map "za" #'kirigami-toggle-fold)
  (define-key evil-normal-state-map "zr" #'kirigami-open-folds)
  (define-key evil-normal-state-map "zm" #'kirigami-close-folds))

In addition to providing a unified interface, the kirigami package enhances folding behavior in outline, markdown-mode, and org-mode packages. It ensures that deep folds and sibling folds open and close reliably.

Code Folding Backends

A code folding backend is the underlying engine that handles the logic of identifying and hiding specific blocks of text. While the kirigami package provides the user interface and keybindings, it requires a backend, such as outline-minor-mode or hs-minor-mode, to perform the folding.

NOTE: When configuring folding backends, ensure that only one folding minor mode is active concurrently in a single buffer, as conflicts and unexpected behavior may occur. For this reason, adding folding hooks to broad categories like prog-mode-hook or text-mode-hook is discouraged. Instead, hooks should be applied specifically to individual language modes, such as emacs-lisp-mode-hook.

Below are ready-to-use hooks to activate the optimal folding backend for each major mode:

Outline (built-in)

outline-minor-mode relies on hierarchical headings to determine collapsible sections. It is effective for structured text and is my default choice for Elisp, Lisp, Markdown, Diff, and configuration files.

(add-hook 'emacs-lisp-mode-hook #'outline-minor-mode)
(add-hook 'lisp-interaction-mode-hook #'hs-minor-mode) ; scratch
(add-hook 'lisp-mode-hook #'outline-minor-mode)
(add-hook 'conf-mode-hook #'outline-minor-mode)
(add-hook 'markdown-mode-hook #'outline-minor-mode)
(add-hook 'diff-mode-hook #'outline-minor-mode)

Hideshow (built-in)

hs-minor-mode parses buffer syntax to accurately detect the start and end of blocks. It is the best tool for C-style languages, or anything using braces {} and explicit block structures like sh/Bash shell scripts.

;; Systems and General Purpose
(add-hook 'c-mode-hook #'hs-minor-mode)
(add-hook 'c++-mode-hook #'hs-minor-mode)
(add-hook 'java-mode-hook #'hs-minor-mode)
(add-hook 'rust-mode-hook #'hs-minor-mode)
(add-hook 'go-mode-hook #'hs-minor-mode)
(add-hook 'ruby-mode-hook #'hs-minor-mode)

;; Web and Frontend
(add-hook 'js-mode-hook #'hs-minor-mode)
(add-hook 'typescript-mode-hook #'hs-minor-mode)
(add-hook 'css-mode-hook #'hs-minor-mode)

;; Scripting, Data, and Infrastructure
(add-hook 'sh-mode-hook #'hs-minor-mode) ; for bash/shell scripts
(add-hook 'json-mode-hook #'hs-minor-mode)
(add-hook 'lua-mode-hook #'hs-minor-mode)
(add-hook 'nxml-mode-hook #'hs-minor-mode)
(add-hook 'html-mode-hook #'hs-minor-mode)  ;; mhtml and html

hs-minor-mode folds a single level at a time, such as entire functions, without providing convenient access to nested blocks. This makes it less practical for languages that require deep folding, such as YAML, where multiple nested levels are common. Even in languages like Python, Hideshow can be impractical, because it allows folding classes but does not provide convenient folding for the functions within those classes for example.

Outline-indent

The outline-indent package provides code folding based on indentation levels. It is recommended for Python, Haskell, and YAML because it supports an unlimited number of folding levels. For instance, it allows folding an entire function or specific nested blocks within that function, such as if statements inside while loops.

(use-package outline-indent
  :commands outline-indent-minor-mode
  :custom
  (outline-indent-ellipsis " ▼"))

;; Python
(add-hook 'python-mode-hook #'outline-indent-minor-mode)
(add-hook 'python-ts-mode-hook #'outline-indent-minor-mode)

;; Yaml
(add-hook 'yaml-mode-hook #'outline-indent-minor-mode)
(add-hook 'yaml-ts-mode-hook #'outline-indent-minor-mode)

;; Haskell
(add-hook 'haskell-mode-hook #'outline-indent-minor-mode)

In addition to code folding, outline-indent allows moving indented blocks up and down, indenting/unindenting to adjust indentation levels, inserting a new line with the same indentation level as the current line, and moving backward/forward to the indentation level of the current line.

Treesit-fold

The treesit-fold package provides Intelligent code folding by using the structural understanding of the built-in tree-sitter parser. Unlike traditional folding methods that rely on regular expressions or indentation, treesit-fold uses the actual syntax tree of the code to accurately identify foldable regions such as functions, classes, comments, and documentation strings.

(use-package treesit-fold
  :commands (treesit-fold-close
             treesit-fold-close-all
             treesit-fold-open
             treesit-fold-toggle
             treesit-fold-open-all
             treesit-fold-mode
             global-treesit-fold-mode
             treesit-fold-open-recursively
             treesit-fold-line-comment-mode)

  :custom
  (treesit-fold-line-count-show t)
  (treesit-fold-line-count-format " ▼")

  :config
  (set-face-attribute 'treesit-fold-replacement-face nil
                      :foreground "#808080"
                      :box nil
                      :weight 'bold))

;; Systems and General Purpose
(add-hook 'c-ts-mode-hook #'treesit-fold-mode)
(add-hook 'c++-ts-mode-hook #'treesit-fold-mode)
(add-hook 'java-ts-mode-hook #'treesit-fold-mode)
(add-hook 'rust-ts-mode-hook #'treesit-fold-mode)
(add-hook 'go-ts-mode-hook #'treesit-fold-mode)
(add-hook 'ruby-ts-mode-hook #'treesit-fold-mode)

;; Web and Frontend
(add-hook 'js-ts-mode-hook #'treesit-fold-mode)
(add-hook 'typescript-ts-mode-hook #'treesit-fold-mode)
(add-hook 'tsx-ts-mode-hook #'treesit-fold-mode)
(add-hook 'css-ts-mode-hook #'treesit-fold-mode)
(add-hook 'html-ts-mode-hook #'treesit-fold-mode)

;; Scripting and Infrastructure
(add-hook 'bash-ts-mode-hook #'treesit-fold-mode)
(add-hook 'cmake-ts-mode-hook #'treesit-fold-mode)
(add-hook 'dockerfile-ts-mode-hook #'treesit-fold-mode)

;; Data and Configuration
(add-hook 'json-ts-mode-hook #'treesit-fold-mode)
(add-hook 'toml-ts-mode-hook #'treesit-fold-mode)
 
;; Third-party packages
;; (add-hook 'kotlin-ts-mode-hook #'treesit-fold-mode)
;; (add-hook 'swift-ts-mode-hook #'treesit-fold-mode)
;; (add-hook 'elixir-ts-mode-hook #'treesit-fold-mode)
;; (add-hook 'zig-ts-mode-hook #'treesit-fold-mode)

For the treesit-fold block to function, you must be using Emacs 29.1 or newer, and you must have the actual Tree-sitter grammars installed on your machine for those specific languages.

Markdown-mode

The markdown-mode package provides a major mode for syntax highlighting, editing commands, and preview support for Markdown documents. It supports core Markdown syntax as well as extensions like GitHub Flavored Markdown (GFM). Markdown-mode and gfm-mode support outline-minor-mode folding.

(use-package markdown-mode
  :commands (gfm-mode
             gfm-view-mode
             markdown-mode
             markdown-view-mode)
  :mode (("\\.markdown\\'" . markdown-mode)
         ("\\.md\\'" . markdown-mode)
         ("README\\.md\\'" . gfm-mode))
  :bind
  (:map markdown-mode-map
        ("C-c C-e" . markdown-do)))

;; Hooks
(add-hook 'markdown-mode-hook #'outline-minor-mode)

Maintaining independent folding states in separate windows via indirect buffers (clones)

Opening the same buffer in multiple windows results in synchronized folding states; any folding or unfolding action performed in one window is immediately reflected in all others.

This occurs because folding engines use buffer-local overlays, which are shared across all windows associated with that specific buffer.

Indirect buffers provide a robust solution to this limitation. An indirect buffer shares the underlying text of its parent buffer but maintains an independent set of overlays. This distinction allows for the maintenance of different folding configurations for the same file simultaneously.

To create an indirect buffer (clone) of the current buffer in a separate window, execute:

M-x clone-indirect-buffer-other-window

Creating an indirect buffer provides a separate buffer object that references the same text while maintaining its own isolated set of opened/closed folds.

Preventing Emacs search from matching text within folded blocks

Note: This setting is for users who want search operations to ignore folded blocks instead of expanding them. This behavior is subjective and may not suit every workflow.

By default, search operations can match text within folded blocks, which often causes Emacs to automatically expand the hidden content.

To instruct Emacs to strictly ignore invisible text during search operations, add the following configuration to your init file:

(setq-default search-invisible nil)

Alternatively, to restrict this behavior to specific modes, apply a buffer-local configuration via a mode hook:

(add-hook 'prog-mode-hook (lambda ()
                            (setq-local search-invisible nil)))

Integrating display-line-numbers-mode with code folding

The built-in display-line-numbers-mode renders line numbers in the side margin of the window. By default, it uses absolute line numbering, which tracks the absolute line count in the buffer. Consequently, when a block is folded, the line numbers skip the hidden range (e.g., jumping from 15 to 120).

For users who prefer visual line numbering, display-line-numbers-mode can be configured to ignore collapsed content and assign numbers sequentially based only on what is currently rendered on the screen.

To implement visual line numbering as your global default, set the following variable in your configuration:

(setq-default display-line-numbers-type 'visual)

(Note that you must still enable the mode itself using M-x global-display-line-numbers-mode for the line numbers to appear.)

Discouraged Emacs Folding Engines

Choosing an appropriate folding engine is important for maintaining performance and stability within Emacs. While several third-party and legacy options exist, the following packages and methods are generally discouraged in favor of more modern or integrated alternatives:

  • Origami: This package is slow and largely unmaintained. Origami uses a non-standard API and a complex implementation that frequently conflicts with other overlay-based minor modes. Its overhead can lead to performance degradation, especially when handling large buffers or deeply nested code. (Modern alternatives to origami: outline-indent, treesit-fold, outline-minor-mode, hs-minor-mode)
  • Yafolding: This package is also unmaintained and suffers from performance issues. (Modern alternative to yafolding: outline-indent)
  • Semantic (CEDET): Part of the legacy CEDET suite, Semantic folding is widely regarded as heavyweight. The parsing overhead required for its operation often introduces noticeable latency, making it vastly less efficient than modern built-in alternatives like Tree-sitter. (Modern alternatives to CEDET code folding: treesit-fold, outline-minor-mode, hs-minor-mode, outline-indent)
  • Selective Display (set-selective-display): This is Emacs’ oldest built-in folding method (often bound to C-x $). It causes unpredictable cursor jumping, and lacks any contextual awareness.
  • Folding-mode: This ancient package relies on explicit structural markers placed manually inside code comments (e.g., {{{ and }}}). While robust for the user, markers pollute the source code with editor-specific metadata. This is heavily frowned upon in modern collaborative environments where team members use varying IDEs.
  • Vimish-fold: Although useful for manual, ad-hoc text folding, vimish-fold is not recommended as a primary automated folding engine. Unlike Vim’s set foldmethod=marker, the vimish-fold implementation does not support recursive markers, such as {{{ inside of {{{. Additionally, like folding-mode, vimish-fold also uses markers that pollute the source code with editor-specific markers, a practice discouraged in collaborative environments where team members use a variety of editors and IDEs.

Conclusion

Establishing a unified folding interface in Emacs converts a buffer into a structured environment. Whether you are refactoring complex Python classes or navigating extensive Org documents, relying on a standardized command set simplifies the experience. Integrating the hooks outlined in this article ensures you enable the optimal backend for each major mode, allowing you to focus on logic rather than editor mechanics.

22 Apr 15:59

Irreal: Orgy

by Irreal
Tom Roche

surprising it took so long for someone to claim this name :-) pullquote (somewhat edited):

> Bastien Guerry, one of the Org mode heroes, introduced his own static site generator, [Orgy](https://codeberg.org/bzg/orgy). He has a nice [post that steps you through setting up an Orgy site from scratch](https://bzg.fr/en/notes/orgy-tutorial/). Orgy seems extremely easy to use. You write your blog posts in Org mode, call Orgy, and everything but moving it to your hosting provider is taken care of. You get an index, RSS, tag support, search and more. [Best:] there’s no database. All your post sources stay safely on your own machine and you can back them up with whatever method(s) you prefer. Even if you have to regenerate your entire site, it’s only an Orgy call away. If you don’t need a bunch of fancy plugins, Orgy may be just what you’re looking for.

Irreal, in both its incarnations, has always used a dynamic Web site: first on Blogger and now on WordPress. I like them both. They’re easy to use and, really, perfect for non-technical people who want to blog. At this point, Irreal will probably stay on WordPress throughout its lifetime.

Still, I occasionally think that it would be nice to change to a static web site. The problem with dynamic Websites is that they’re a black box driven by a database and it’s hard to understand how things work, how to customize them, and how to do fundamental things like backing up your site.

Of course, static sites come with their own problems and difficulties. Recently, Bastien Guerry, one of the Org mode heroes, introduced his own static site generator, Orgy. He has a nice post that steps you through setting up an Orgy site from scratch. Orgy seems extremely easy to use. You write your blog posts in Org mode, call Orgy, and everything but moving it to your hosting provider is taken care of. You get an index, RSS, tag support, search and more. Take a look at Guerry’s post for the details.

The thing I really like about it is that there’s no database. All your post sources stay safely on your own machine and you can back them up with whatever method(s) you prefer. Even if you have to regenerate your entire site, it’s only an Orgy call away. There’s no PHP to wade through to. The output of Orgy is simply your HTML and supporting files. It’s simplicity itself. If you don’t need a bunch of fancy plugins, Orgy may be just what you’re looking for.

22 Apr 01:22

1029 - The F-Files feat. Derek Davison & Ben McKenzie (4/20/26)

Tom Roche

excellent analysis and amusing

We have a Chapo Double Feature for you this week! First, Derek Davison returns for more coverage of the wars in Lebanon and Iran, including a Wall Street Journal article showing just how checked out Trump is from the apocalyptic destruction he’s bringing about on the world. Plus: more Ka$h Chronicles, as the FBI tries to take him down for the crimes of having too much fun and sleeping through an alarm. We’re then joined by actor Ben McKenzie (The O.C., Junebug) about his new crypto documentary Everyone Is Lying to You For Money. Our 10 year anniversary merch is ready for pre-order through April 30! Order at https://chapotraphouse.store/ Find all of Derek’s foreign policy coverage at: www.foreignexchanges.news www.americanprestigepod.com And go see Everyone Is Lying to You For Money when it’s near you!
21 Apr 02:29

Pedro l'Hongarès

Tom Roche

excellent analysis, not just about Hungary but global esp EU politics generally (and ... Eric Adams going out in style)

Uma, Nick and Ciarán talk through the Hungarian elections, Peter Magyar's win and the reactions from international liberal press.

GYROVISION No. 6

We're back again for another Gyrovision and tickets are on sale at the following links

https://buytickets.at/cornerspti/2174077

https://www.patreon.com/posts/tickets-to-6-155676140

17 Apr 19:57

The Naked Week: Ep6. Swearing, Steeplechase, and Strikes.

Tom Roche

EXCELLENT: NW series#=4 goes out in style

Following Trump's tirade, The Naked Week team bleep the hell out of the bleeping news, swear at a steeplechase, and stage a walk out.

From The Skewer’s Jon Holmes and host Andrew Hunter Murray comes The Naked Week; a fresh way of dressing the week’s news in the altogether and parading it around for everyone to laugh at.

With award-winning writers and a crack team of contemporary satirists - and recorded in front of a live audience - The Naked Week delivers a topical news-nude straight to your ears.

Written by: Jon Holmes Katie Sayer Gareth Ceredig James Kettle Jason Hazeley

Additional Material: Karl Minns Jane Fae Molly Punshon Darren Phillips Kevin Smith

Investigation team: Cat Neilan Becky Pinnington

Guest Correspondent: Katie Norris

Production Team: Tony Churnside, Jerry Peal, David Riffkin.

Production Coordinator: Molly Punshon Assistant Producer: Katie Sayer Executive Producer: Philip Abrams

Produced and Directed by Jon Holmes

An unusual production for BBC Radio 4

15 Apr 19:33

What’s the deal with Alzheimer’s disease and amyloid?

by Jonathan M. Gitlin
Tom Roche

interesting discussion of the 'Amyloid Mafia'

At the end of last month, a scientific journal pulled a research paper on Alzheimer's disease.

The retraction came from Neurobiology of Aging, which removed a 2011 paper claiming to show that a version of a protein called amyloid-β was responsible for memory loss in Alzheimer's disease. On its own, that might not seem notable; bad papers can make it through peer review and are only caught after publication.

But this wasn't an isolated case. Over the past few years, multiple studies arguing that amyloid-β is the central driver of Alzheimer's disease have been retracted. Some scientists have even been indicted for fraud over the issue. All the while, none of the drugs targeting this protein and its pathway have had any real clinical effect.

Read full article

Comments

15 Apr 19:25

Radio War Nerd EP 598 — Pope Leo vs. Trump, feat. Annibale

by mail@yashalevine.com (Gary Brecher)
Tom Roche

excellent tho mostly just bant

Co-hosts John Dolan & Mark Ames
15 Apr 00:24

Jiang Xueqin: The Iran War & the Battle for the Petrodollar

by Glenn Diesen
Tom Roche

EXCELLENT: my only objection off-the-top is that Jiang fails to take into account the dynamics induced by 2 important partnerships: PRC-Russia and US-Israel.

Jiang Xueqin discusses how the Iran War represent a war over the petrodollar. Jiang is the host of the popular educational channel Predictive History: https://www.youtube.com/@PredictiveHistoryFollow Prof. Glenn Diesen: Substack: https://glenndiesen.substack.com/ X/Twitter: https://x.com/Glenn_DiesenPatreon: https://www.patreon.com/glenndiesen Support the research by Prof. Glenn Diesen: PayPal: https://www.paypal.com/paypalme/glenndiesenBuy me a Coffee: buymeacoffee.com/gdiesengGo Fund Me: https://gofund.me/09ea012fBooks by Prof. Glenn Diesen: https://www.amazon.com/stores/author/B09FPQ4MDL

14 Apr 18:26

1027 - Komm Susser Rod feat. Andrew Hudson (4/13/26)

Tom Roche

excellent, amusing

Andrew Hudson of E1 returns to cover the downfall of two great men: Viktor Orbán in Hungary and Eric Swalwell in California. Also in the news: JD Vance goes on an international losing tour from Pakistan to Hungary, Trump threatens military action against the Pope, and another dispatch from Punished Rod. Our 10 year anniversary merch is ready for pre-order through April 30! Order at https://chapotraphouse.store/ Listen to Episode 1 here: https://soundcloud.com/episode-one-868768631 And subscribe here: https://www.patreon.com/e1podcast/posts
13 Apr 21:11

Never Janša-ers

Tom Roche

excellent Euro-political-economy analysis, and funny too

Nick and Ciarán celebrate last gas/oil shipment to Europe day, talk about some news before discussing the Slovenian and Danish elections.

11 Apr 20:30

Radio War Nerd EP 597 — Pakistan in War & Peace, feat. Sabrina

by mail@yashalevine.com (Gary Brecher)
Tom Roche

EXCELLENT, informative interview with yet-another mononymous guest ("Sabrina," making her RWN debut) on many-matters Pakistani up to the currently-ongoing (as of 11 Apr 2026, though this episode#=597 was recorded 9 Apr 2026) "Islamabad Talks" vs the 2nd Zionist-Iran War (/2ZIW/). Those many matters include:

* Balochistan, esp Pakistan and Iran vs Zionist-backed separatists (not much about PRC or India in this regard)
* Pak-PRC relations, esp re Gwadar
* Karachi as great world city esp for crime
* Pakistan's regional military not-quite-alliances, esp with KSA
* Pakistan's 2ZIW mediation efforts
* Pakistan deepstate: discussion unfortunately derailed by
- a very-anti Imran Khan diatribe: I agree with The Nerds that IK definitely has his faults, and definitely started as a military tool, but Sabrina's position seems to be that IK is a kinda Paki-Trump (evil and incompetent and irredeemable) and not a guy who evolved as a politician
* Islam in Pakistan, esp Shia-Sunni relations (including "Sushi" mixed families)
* Pak-US relations from Partition, inc 1972 Nixon-Kissinger-PRC and the ...
* long Afghan wars: not much about US (or India), mostly IRI pro-and-con various Pashtun factions (IIRC Sabrina says 'Pakhtun' in the Pakistyle) from c1973 (Daoud coup, not mentioned) tp 2026
* 2024 India war, mostly just about shitposting and memes
* Pak-Israel relations and lack thereof

Co-hosts John Dolan & Mark Ames
07 Apr 21:39

1025 - The Ten Year Anniversary Spectacular (4/6/26)

Tom Roche

excellent: just bant but amusing. don't miss last 10 min to catch unannounced (at least, not in episode notes) guests Amber Frost and Matt Christman.

Our sold out Ten Year Anniversary live show at the Palace Theater, Los Angeles, April 3rd 2026. Featuring Episode 1 (Charles Austin, Alex Branson, Andrew Hudson), Seeking Derangements (Ben Mora, Hesse Deni, Jacques Gonsoulin), Brace Belden & Hasan Piker. Thanks to all our guests and the fantastic audience!
07 Apr 15:45

Marx Prestige, Episode 1: The Civil War and American Capitalism

Tom Roche

EXCELLENT (minus the inter-audio ads)

In lieu of a standard episode today, we are premiering the first episode of Marx Prestige, a series where Danny, Derek, and historian Andrew Hartman discuss Karl Marx and how the philosophy and politics he created shaped and reshaped the United States. 

Subscribe now at the annual tier for free access to series like this one!

In this first episode of Marx Prestige, Danny, Derek, and Andrew Hartman talk about how Karl Marx understood the United States as a testing ground for capitalism and democratic development in the nineteenth century. They delve into the reception history approach to Marx in America, Marx’s early views on American democracy and capitalism, his writings on the Civil War and slavery, the transition in Marx’s thought from philosophy to political economy, Reconstruction and its limits, early American interpretations of Marx, and the emergence of Marxism in the late nineteenth century.

Be sure to check out Andrew's Book ⁠⁠Karl Marx in America⁠⁠.

Learn more about your ad choices. Visit megaphone.fm/adchoices

07 Apr 02:15

IRAN WAR: Desperate Trump And Dangerous Quagmire w/ John Mearsheimer

by The Duran
Tom Roche

VERY EXCELLENT: Duran's analyses are generally (not always) sound, Duran+Mearsheimer is almost-completely reliable, and this episode is marred only by its failure to /directly/ address (though they come close) the need to denuclearize and denazify global Zionism

IRAN WAR: Desperate Trump And Dangerous Quagmire w/ John Mearsheimer



06 Apr 23:11

UNLOCKED: Pedro Sanchez is not your hot friend

Tom Roche

excellent and amusing analysis of US and Euro politics

Uma and Nick talk about your hot friend