A bit of a silly question here, but you know emacs is a lot of library. Is anyone familiar with extracting buffers by number from the buffers list?
In javascript or php this kind of thing is easy, just put an index next to the array. In emacs however, the lists have sometimes objects and sometimes strings, and getting the strings out of the objects seems sometimes a bit esoteric, given the sprawling and somewhat fragmented nature of the knowledge base.
Of course, this is really easy and I'm missing something obvious, but nonetheless, help me out if you know the answer!
To reiterate, I'd like to dolist the buffers list and extract a matching name if there or return the second, third, or fourth buffer from the list, as the case may be.
C-h i g (elisp) RET
. If you don't know how Lisp works, you might want to start with the Introdcution to Emacs Lisp: doC-h i g (eintr) RET
. What you want to do can be done with the functionsnth
,buffer-list
andbuffer-file-name
. Check the manuals for details.