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

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

Re: Why function gives this error?.. "Wrong type argument: stringp, #<bu


From: Matthias Pfeifer
Subject: Re: Why function gives this error?.. "Wrong type argument: stringp, #<buffer *Messages*>"
Date: Wed, 15 Oct 2014 18:55:30 +0200

Hi Chris,

(buffer-list) does not evaluate into a list of strings like you expect it
evaluates into a list of buffer objects and these can not be compred with
your comparison function string<. I expect that if you debug your code you
find that the string< function emits the error message.

matthias

On Wed, 15 Oct 2014 09:00:07 -0700 (PDT)
Chris Seberino <cseberino@gmail.com> wrote:

> 
> I tried to write a function that goes to next buffer **in alphabetical 
> order**.
> (I set f8 to call it.)
> 
> It makes a sorted version of buffer list and goes to next buffer in the 
> list...
> 
> 
> (global-set-key [f8]           (lambda () (interactive)
>                                 (let ((sorted-list
>                                        (sort (buffer-list) 'string<)))
>                                      (switch-to-buffer
>                                       (nth 2
>                                            (member
>                                             (current-buffer) sorted-list))))))
> 
> Any help greatly appreciated.
> 
> cs


-- 
Matthias Pfeifer <mpfeifer77@gmail.com>



reply via email to

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