diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2013-08-05 08:14:43 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2013-08-05 08:14:43 +0400 |
commit | 8f3a2c2659ddee1ae84b4b8bb28f6c388f87fd0f (patch) | |
tree | 36980f65ace0a9492e3a28473a89428d6f45c44f /src/minibuf.c | |
parent | 3e2cd454fdc04a1afefa23cdfe241c11862eaa8d (diff) | |
download | emacs-8f3a2c2659ddee1ae84b4b8bb28f6c388f87fd0f.tar.gz |
New macro to iterate over live buffers similar to frames.
* buffer.h (FOR_EACH_LIVE_BUFFER): New macro.
(Vbuffer_alist, Qpriority, Qbefore_string, Qafter_string):
Declare buffer-related variables here to offload lisp.h.
* buffer.c (Vbuffer_alist): Adjust comment.
(Fget_file_buffer, get_truename_buffer, Fother_buffer)
(other_buffer_safely):
* data.c (store_symval_forwarding):
* dispnew.c (Fframe_or_buffer_changed_p):
* fileio.c (Fdo_auto_save):
* filelock.c (unlock_all_files):
* minibuf.c (read_minibuf): Use FOR_EACH_LIVE_BUFFER.
Diffstat (limited to 'src/minibuf.c')
-rw-r--r-- | src/minibuf.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/minibuf.c b/src/minibuf.c index 2c33b83c11b..b3648b8c1ae 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -568,22 +568,15 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, bset_directory (current_buffer, ambient_dir); else { - Lisp_Object buf_list; + Lisp_Object tail, buf; - for (buf_list = Vbuffer_alist; - CONSP (buf_list); - buf_list = XCDR (buf_list)) - { - Lisp_Object other_buf; - - other_buf = XCDR (XCAR (buf_list)); - if (STRINGP (BVAR (XBUFFER (other_buf), directory))) - { - bset_directory (current_buffer, - BVAR (XBUFFER (other_buf), directory)); - break; - } - } + FOR_EACH_LIVE_BUFFER (tail, buf) + if (STRINGP (BVAR (XBUFFER (buf), directory))) + { + bset_directory (current_buffer, + BVAR (XBUFFER (buf), directory)); + break; + } } if (!EQ (mini_frame, selected_frame)) |