all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Sorting buffer with string-collate-lessp
@ 2015-05-26 11:53 Rasmus
  2015-05-26 14:49 ` Tassilo Horn
  0 siblings, 1 reply; 15+ messages in thread
From: Rasmus @ 2015-05-26 11:53 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

How can I easily sort a buffer using string-collate-lessp?

Info: I would like to sort a buffer using string-collate-lessp (line by
line).  Sort-lines is the obvious candidate but it uses string<.  I tried
to write my own sort-lines using sort-subr, as it has a predicate
argument.  However, for buffers, it needs something like
compare-buffer-substrings, which takes no predicate and is in the C-level
and pretty long.

I could write a wrapper that convert each buffer-chunk into its
buffer-substring first, and then compares it with string-collate-lessp, I
guess, but that seems like a lot of boiler plate.  So maybe a better
solution exists?

Bonus point if one can specify something simple and intuitive as
string-collate-lessp in a defcustom.

Thanks,
Rasmus

-- 
History is what should never happen again




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-05-27 11:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.3682.1432641217.904.help-gnu-emacs@gnu.org>
2015-05-26 15:37 ` Sorting buffer with string-collate-lessp Emanuel Berg
2015-05-26 15:43   ` Rasmus
2015-05-26 15:52     ` Rasmus
     [not found]     ` <mailman.3702.1432655548.904.help-gnu-emacs@gnu.org>
2015-05-26 16:06       ` Emanuel Berg
2015-05-26 16:36         ` Rasmus
2015-05-26 16:40           ` Rasmus
2015-05-26 18:01         ` Tassilo Horn
     [not found]         ` <mailman.3706.1432658186.904.help-gnu-emacs@gnu.org>
2015-05-26 22:44           ` Emanuel Berg
2015-05-27  0:12             ` Rasmus
     [not found]             ` <mailman.3732.1432685593.904.help-gnu-emacs@gnu.org>
2015-05-27  0:25               ` Emanuel Berg
2015-05-26 11:53 Rasmus
2015-05-26 14:49 ` Tassilo Horn
2015-05-26 14:53   ` Rasmus
2015-05-26 17:57     ` Tassilo Horn
2015-05-27 11:23       ` Michael Heerdegen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.