emacs org-mode todo list priority (urgency) hack

Might as well brag about this, since I’m inordinately proud (I become an #elisp hacker about once every two or three years). I love #emacs #org-mode, but I don’t love what it does with todo entries (highest-priority, longest-scheduled first). For me, if something’s been at priority A for 280 days, it’s not that high-priority (but still higher than anything at priority B). I want highest-priority, most-recently-scheduled first, in the time-honored tradition of ignoring things in the hope they’ll go away.

Here it is.

(defun my-org-agenda-todo-sort (a b)
  "Function should only sort TODO items; since I can't return ``unsortable'' for things that don't compare, I just
return 0 and hope for the best.  Seems to be working so far.  Higher-priority and more-recently-scheduled items
have higher urgency." 
  (if (string-match "\\(Sched\\.\\s-*\\([0-9]+\\)x\\|Scheduled\\):\\s-+\\S-+ \\[#\\([ABC]\\)\\]" a)
      (let ((a-sched-days (string-to-number (if (null (match-string 2 a)) "0" (match-string 2 a))))
            (a-priority (match-string 3 a)))
        (if (string-match "\\(Sched\\.\\s-*\\([0-9]+\\)x\\|Scheduled\\):\\s-+\\S-+ \\[#\\([ABC]\\)\\]" b)
            (let ((b-sched-days (string-to-number (if (null (match-string 2 b)) "0" (match-string 2 b))))
                  (b-priority (match-string 3 b)))
                                        ;(message "Agenda item a of type %s: %s" (type-of a) a)
                                        ;(message "Agenda item b of type %s: %s" (type-of b) b)
                                        ;(message "a-priority: %s; b-priority: %s; a-sched-days: %s; b-sched-days: %s"
                                        ;         a-priority b-priority a-sched-days b-sched-days)
              (cond ((string< a-priority b-priority) 1)
                    ((string> a-priority b-priority) -1)
                    (t (cond ((< a-sched-days b-sched-days) 1)
                             ((> a-sched-days b-sched-days) -1)
                             (t 0)))))
          0
          )
        )
    0
    )
  )
(setq org-agenda-cmp-user-defined 'my-org-agenda-todo-sort)
(setq org-agenda-sorting-strategy '((agenda habit-down time-up user-defined-down category-keep)
                                    (todo urgency-down category-keep)
                                    (tags urgency-down category-keep)
                                    (search category-keep)))

Update: Ok, that was stupid. Here’s a more readable version:

https://gist.github.com/JohnL4/4ddd2ec185b8a9b948db6d62edb9d32d

‘Baby in a dumpster.’ A spate of abandoned newborns unsettles Texas.

Omg. If I could figure out how to put a content warning on a WordPress post that made its way over to Mastodon, I would.

«Abortion bans don’t just kill women. They kill babies. This is evident in the data, which shows a dramatic rise in the state’s infant mortality after Texas banned abortion. As the Washington Post documented last week, it’s also happening in a viscerally disturbing way, as the number of newborns found abandoned to die has spiked, as well. Babies, mostly dead, are being found in ditches and dumpsters throughout Texas, traumatizing the people who find them and the emergency workers who are called to help. 

Only the biggest liars in the anti-choice movement — and to be fair, there’s stiff competition for that award — would deny that the state’s abortion ban is the main cause of the sharp increase in dead, abandoned babies. The Washington Post also notes that Republicans have repeatedly cut funding for prenatal care and family planning services. In addition, draconian approaches to illegal immigration have led to undocumented women avoiding medical care, for fear of being deported. The result is what one Texas law enforcement official called “a little bit of an epidemic” of infant abandonment. 

Texas Republicans show no interest in educating people about safe haven laws, however.

One would think that the “pro-life” movement would be alarmed by all the dead babies, moving heaven and earth to make sure pregnant girls and women in desperate circumstances have safe alternatives to giving birth in secret and throwing the baby away. But that would only be true if anti-abortion activists were, in fact, “pro-life.”»

https://www.salon.com/2025/01/02/newborns-are-being-left-in-dumpsters-in-texas-but-dont-seem-to-care/

Patrimonialism – Lawyers, Guns & Money

A quote within a quote:

««Social scientists thought that patrimonialism had been relegated to the dustbin of history. And for good reason: Such regimes couldn’t compete militarily or economically with states led by the expert civil services that helped make modern societies rich, powerful and relatively secure.

But a slew of self-aggrandizing leaders has taken advantage of rising inequality, cultural conflicts and changing demography to grab power. The result has been a steep decline in the government’s ability to provide essential services such as health care, education and safety.»»

https://www.lawyersgunsmoneyblog.com/2024/12/patrimonialism

I think it should be more commonly taught that a comfortable democracy gets stupid.

Trump Voters Are in for a Rude Awakening | The New Republic

https://newrepublic.com/article/189523/trump-voters-2025-rude-awakening

Yet another article predicting Trump will be repudiated by the electorate when they wake up.

Right.

Remember the Teflon president (Ronald Reagan)? So many commentators not understanding the capacity of vast numbers of the electorate to deceive themselves.

«Trump has proven, in business and politics, that in fact he can con people for a very long time. But, come 2025, when he’s confronted with the reality of governing—and, one can hope, a reinvigorated opposition—Trump may finally be exposed to his newfound supporters as the huckster we’ve long known him to be.»

Nope. Shoulda stuck with that first sentence.

‘Trump is a little guy, Musk is a big guy’: historian predicts trouble for president-elect | Books | The Guardian

Oof:

«“And also, I wanted Muskovia because I wanted the idea of Russia to be there in the background, because a lot of smart Russia hands are saying this all the time: this is kind of like the 1990s in Russia. You have the doddering, rich-but-not-very-rich president [Boris Yeltsin], surrounded by more youthful, more active, ambitious oligarchs. That’s the kind of scenario [America is] in.”»

https://www.theguardian.com/books/2025/jan/01/elon-musk-donald-trump