Function: hyrolo-sort-lines

hyrolo-sort-lines is an interactive and byte-compiled function defined in hyrolo.el.

Signature

(hyrolo-sort-lines REVERSE BEG END)

Documentation

Sort lines in region alphabetically; REVERSE non-nil means descending order.

Interactively, REVERSE is the prefix argument, and BEG and END are the region. Called from a program, there are three arguments: REVERSE (non-nil means reverse order), BEG and END (region to sort). The variable sort-fold-case determines whether alphabetic case affects the sort order.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hyrolo.el
;; Derived from `sort-lines' in "sort.el" since through at least Emacs 25.0
;; invisible lines are not grouped with the prior visible line, making
;; rolo entry (or any record) sorts fail.  This next function fixes that.
;; Only the last line changes from the original `sort-lines' function.
(defun hyrolo-sort-lines (reverse beg end)
  "Sort lines in region alphabetically; REVERSE non-nil means descending order.
Interactively, REVERSE is the prefix argument, and BEG and END are the region.
Called from a program, there are three arguments:
REVERSE (non-nil means reverse order), BEG and END (region to sort).
The variable `sort-fold-case' determines whether alphabetic case affects
the sort order."
  (interactive "P\nr")
  (save-excursion
    (save-restriction
      (narrow-to-region beg end)
      (goto-char (point-min))
      ;; To make `end-of-line', etc. ignore fields
      (let ((inhibit-field-text-motion t))
	(sort-subr reverse #'hyrolo-forward-visible-line #'end-of-visible-line)))))