all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Matthias Pfeifer <mpfeifer77@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Why function gives this error?.. "Wrong type argument: stringp, #<buffer *Messages*>"
Date: Wed, 15 Oct 2014 18:55:30 +0200	[thread overview]
Message-ID: <20141015185530.79439bd87413d4118e0b59a8@gmail.com> (raw)
In-Reply-To: <da029a7b-908d-4e04-9298-10a630bca567@googlegroups.com>

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	other threads:[~2014-10-15 16:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15 16:00 Why function gives this error?.. "Wrong type argument: stringp, #<buffer *Messages*>" Chris Seberino
2014-10-15 16:55 ` Matthias Pfeifer [this message]
2014-10-15 17:47 ` Barry Margolin

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141015185530.79439bd87413d4118e0b59a8@gmail.com \
    --to=mpfeifer77@gmail.com \
    --cc=help-gnu-emacs@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 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.