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: Emanuel Berg
Subject: Re: Find the longest word in the word list file.
Date: Thu, 12 Aug 2021 17:45:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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...

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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