From d08c5d368337ee49bb72d9915c409edcbc73b4e0 Mon Sep 17 00:00:00 2001 From: SeungKi Kim Date: Sat, 13 Jul 2019 17:12:46 +0900 Subject: [PATCH] Improve `sort-numeric-fields' * lisp/sort.el (sort-numeric-fields) : Allow including empty lines. --- lisp/sort.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/sort.el b/lisp/sort.el index 6ea1c44060..3e9413e4af 100644 --- a/lisp/sort.el +++ b/lisp/sort.el @@ -281,7 +281,8 @@ FIELD, BEG and END. BEG and END specify region to sort." ((inhibit-field-text-motion t)) (sort-fields-1 field beg end (lambda () - (sort-skip-fields field) + (unless (string-match-p "^\\s-*$" (thing-at-point 'line)) + (sort-skip-fields field)) (let* ((case-fold-search t) (base (if (looking-at "\\(0x\\)[0-9a-f]\\|\\(0\\)[0-7]") -- 2.22.0