help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Find the longest word in the word list file.


From: Kevin Vigouroux
Subject: Re: Find the longest word in the word list file.
Date: Thu, 12 Aug 2021 17:53:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Emanuel Berg via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

> Kevin Vigouroux via Users list for the GNU Emacs text editor wrote:
>
>>> Here you go,
>>>
>>> (defun sort-lines-length (beg end)
>>>   (interactive (if (use-region-p)
>>>                    (list (region-beginning) (region-end))
>>>                  (list (point-min) (point-max)) ))
>>>   (save-excursion
>>>     (save-restriction
>>>       (narrow-to-region beg end)
>>>       (goto-char (point-min))
>>>       (sort-subr nil
>>>                  #'forward-line
>>>                  #'end-of-line
>>>                  nil nil
>>>                  (lambda (a b) (> (- (cdr a) (car a))
>>>                                   (- (cdr b) (car b)) ))))))
>>> (defalias 'sll #'sort-lines-length)
>>>
>>> https://dataswamp.org/~incal/emacs-init/sort-incal.el lines 18-32
>>
>> How do we know that the “sort key” is a cons cell?
>
> I suppose #'forward-line (NEXTRECFUN) and #'end-of-line
> (ENDRECFUN) collectively define what is a record...

No, the manual only states that these functions move the point.
-- 
Best regards,
Kevin Vigouroux



reply via email to

[Prev in Thread] Current Thread [Next in Thread]