From: Michael Heerdegen <michael_heerdegen@web.de>
To: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: sort-lines including non ASCII
Date: Fri, 08 Jul 2016 16:36:54 +0200 [thread overview]
Message-ID: <87mvlstcvt.fsf@web.de> (raw)
In-Reply-To: <E1bLW1b-0006DP-2K@fencepost.gnu.org> (Richard Stallman's message of "Fri, 08 Jul 2016 09:40:59 -0400")
Richard Stallman <rms@gnu.org> writes:
> Could you please show a concrete example of the code you propose ought
> to be accepted? The only way that occurs to me, to transform an
> arbitrary predicate, is to write a lambda expression around it which
> will handle the arguments as they are actually passed. That doesn't
> require any change in Emacs.
So far I only fixed a quoted lambda causing a bug, and made `sort-lines'
accept a PREDICATE argument. This is useful because until now, the user
had to duplicate the function's code if he wanted to specify a
predicate for sorting lines.
The first step (implemented by the patch so far) allows to call
`sort-lines' like
(sort-lines nil beg end #'string<)
I think it is more useful to make the predicate accept something
reasonable (strings) than some data structure used in the implementation
of `sort-subr'. That's why the predicate passed to `sort-subr' needs to
be wrapped in a lambda.
The second step will be to implement a command named
`sort-lines-collate' or so that prompts for arguments (like the locale
to use) and calls `sort-lines' with the corresponding arguments.
Does that answer your question?
Michael.
next prev parent reply other threads:[~2016-07-08 14:36 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-05 20:58 sort-lines including non ASCII Uwe Brauer
2016-07-05 21:57 ` Óscar Fuentes
2016-07-07 7:35 ` Uwe Brauer
2016-07-06 14:34 ` Eli Zaretskii
2016-07-06 14:52 ` Michael Heerdegen
2016-07-07 7:34 ` Uwe Brauer
2016-07-07 15:17 ` Eli Zaretskii
2016-07-07 16:30 ` Michael Heerdegen
2016-07-07 16:56 ` Eli Zaretskii
2016-07-07 17:32 ` Michael Heerdegen
2016-07-07 19:53 ` Eli Zaretskii
2016-07-07 22:55 ` Michael Heerdegen
2016-07-08 10:01 ` Eli Zaretskii
2016-07-14 21:10 ` Michael Heerdegen
2016-07-14 21:14 ` Clément Pit--Claudel
2016-07-14 21:19 ` Noam Postavsky
2016-07-14 21:26 ` Michael Heerdegen
2016-07-14 21:57 ` Noam Postavsky
2016-07-08 13:40 ` Richard Stallman
2016-07-08 14:36 ` Michael Heerdegen [this message]
2016-07-09 16:58 ` Richard Stallman
2016-07-12 23:06 ` John Wiegley
2016-07-07 7:41 ` Uwe Brauer
2016-07-07 15:20 ` Eli Zaretskii
2016-07-07 16:13 ` Uwe Brauer
2016-07-07 16:35 ` Eli Zaretskii
2016-07-07 8:23 ` Teemu Likonen
2016-07-07 15:23 ` Eli Zaretskii
2016-07-08 4:17 ` Teemu Likonen
2016-07-08 6:32 ` Eli Zaretskii
2016-07-08 6:36 ` Eli Zaretskii
2016-07-08 6:50 ` Teemu Likonen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mvlstcvt.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=emacs-devel@gnu.org \
--cc=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).