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

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

Re: Execute In Multiple Shells?


From: Pascal J. Bourguignon
Subject: Re: Execute In Multiple Shells?
Date: Tue, 24 Nov 2009 20:56:46 +0100
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin)

Dmitry Dzhus <address@hidden> writes:

> Pascal J. Bourguignon wrote:
>
>> (defun buffer-named (name)
>>   "
>> RETURN: the buffer which has as name `name'.
>> "
>>   (let ((bl (buffer-list)))
>>     (unless (and buffer-list-cache buffer-name-map
>>                  (equal buffer-list-cache bl))
>>       (setf buffer-list-cache (copy-seq bl))
>>       (setf buffer-name-map (make-hash-table :test (function equal)))
>>       (dolist (buffer buffer-list-cache)
>>         (let ((name (buffer-name buffer)))
>>           (when name (setf (gethash name buffer-name-map) buffer)))
>>         (let ((name (buffer-file-name buffer)))
>>           (when name (setf (gethash name buffer-name-map) buffer))))))
>>   (or (gethash name buffer-name-map)
>>       (gethash (truename name) buffer-name-map)))
>
> How is this different from `get-buffer`?

It uses truename, which I forgot to adjoin:


(defun truename (filespec)
  "
RETURN:  The absolute path name corresponding to fielspec.
"
  (car (file-expand-wildcards (shell-quote-argument filespec) t)))



-- 
__Pascal Bourguignon__


reply via email to

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