* sort-block
@ 2022-08-01 4:42 Emanuel Berg
2022-08-01 14:21 ` [External] : sort-block Drew Adams
0 siblings, 1 reply; 3+ messages in thread
From: Emanuel Berg @ 2022-08-01 4:42 UTC (permalink / raw)
To: help-gnu-emacs
Useful?
Maybe something like this already ... somewhere!
(defun sort-block ()
(interactive)
(let ((beg (progn (backward-paragraph) (point)))
(end (progn (forward-paragraph) (point))) )
(sort-lines nil beg end) ))
https://dataswamp.org/~incal/emacs-init/sort-incal.el
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [External] : sort-block
2022-08-01 4:42 sort-block Emanuel Berg
@ 2022-08-01 14:21 ` Drew Adams
2022-08-01 14:39 ` Emanuel Berg
0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2022-08-01 14:21 UTC (permalink / raw)
To: Emanuel Berg, help-gnu-emacs@gnu.org
> Useful?
It's up to you.
> Maybe something like this already ... somewhere!
> (defun sort-block ()
> (interactive)
> (let ((beg (progn (backward-paragraph) (point)))
> (end (progn (forward-paragraph) (point))) )
> (sort-lines nil beg end) ))
`M-h M-x sort-lines'
Or if you're going to add a key binding, it might
be more useful to add one for `sort-lines' than
for `sort-block' (aka `sort-paragraph').
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [External] : sort-block
2022-08-01 14:21 ` [External] : sort-block Drew Adams
@ 2022-08-01 14:39 ` Emanuel Berg
0 siblings, 0 replies; 3+ messages in thread
From: Emanuel Berg @ 2022-08-01 14:39 UTC (permalink / raw)
To: help-gnu-emacs
Drew Adams wrote:
> Or if you're going to add a key binding, it might be more
> useful to add one for `sort-lines' than for `sort-block'
> (aka `sort-paragraph').
I'll change the name ... thanks.
(defun sort-paragraph ()
(interactive)
(let ((beg (progn (backward-paragraph) (point)))
(end (progn (forward-paragraph) (point))) )
(sort-lines nil beg end) ))
(defalias 'sort-block #'sort-paragraph)
--
underground experts united
https://dataswamp.org/~incal
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-08-01 14:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-01 4:42 sort-block Emanuel Berg
2022-08-01 14:21 ` [External] : sort-block Drew Adams
2022-08-01 14:39 ` Emanuel Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).