all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13056: 24.2.50; sort-subr doc-string and manual
@ 2012-12-02 17:45 martin rudalics
  2012-12-21  3:18 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: martin rudalics @ 2012-12-02 17:45 UTC (permalink / raw)
  To: 13056

The doc-string of `sort-subr' says that

   PREDICATE is the function to use to compare keys.  If keys are numbers,
   it defaults to `<', otherwise it defaults to `string<'.

and the Elisp manual says something similar.  This is slightly
misleading ever since this change

1993-02-07  Richard Stallman  (rms@mole.gnu.ai.mit.edu)

	* sort.el (sort-build-lists): Record the key as pair of positions;
	don't copy string from buffer.
	(sort-subr): Use compare-buffer-substrings.

If keys are not numbers, the two arguments passed to PREDICATE are
usually pairs of buffer positions and PREDICATE has to extract the keys
from these positions first.  Only if STARTKEYFUN was set to explicitly
return a string, the description above is valid and the keys passed to
PREDICATE can be used directly by `string<'.  In any case, it seems more
correct to say that PREDICATE defaults to `compare-buffer-substrings'.

martin, in GNU Emacs 24.2.50.1 (i386-mingw-nt5.1.2600)
  of 2012-11-24 on MACHNO





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

* bug#13056: 24.2.50; sort-subr doc-string and manual
  2012-12-02 17:45 bug#13056: 24.2.50; sort-subr doc-string and manual martin rudalics
@ 2012-12-21  3:18 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2012-12-21  3:18 UTC (permalink / raw)
  To: martin rudalics; +Cc: 13056-done

martin rudalics <rudalics@gmx.at> writes:

> The doc-string of `sort-subr' says that
>
>   PREDICATE is the function to use to compare keys.  If keys are numbers,
>   it defaults to `<', otherwise it defaults to `string<'.
>
> and the Elisp manual says something similar.  This is slightly
> misleading ever since this change
>
> 1993-02-07  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
>
> 	* sort.el (sort-build-lists): Record the key as pair of positions;
> 	don't copy string from buffer.
> 	(sort-subr): Use compare-buffer-substrings.

Fixed, thanks.





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

end of thread, other threads:[~2012-12-21  3:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-02 17:45 bug#13056: 24.2.50; sort-subr doc-string and manual martin rudalics
2012-12-21  3:18 ` Chong Yidong

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.