• XEmacs: Sorting Key-Value Lines by Value

    From Johann 'Myrkraverk' Oskarsson@21:1/5 to All on Fri Dec 15 19:40:36 2017
    Hi, This is a short edition of my blog at


    To cut to the chase, to sort key: value lines in numerical order by
    value, drop this into your ~/.xemacs/init.el

    (defun my-sort-key-value-lines (beg end)
    (interactive "r")
    (narrow-to-region beg end)
    (goto-char (point-min))
    (sort-subr nil 'forward-line 'end-of-line
    (lambda ()
    (search-forward ":" nil nil 1)
    (buffer-substring (point)

    The code can be considered WTFPL 2.0, because there's only so much you
    can do with boilerplate.

    Johann | email: invalid -> com | www.myrkraverk.com/blog/
    I'm not from the Internet, I just work there. | twitter: @myrkraverk

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)