diff options
| author | Dmitry Antipov | 2013-08-05 08:14:43 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-08-05 08:14:43 +0400 |
| commit | 8f3a2c2659ddee1ae84b4b8bb28f6c388f87fd0f (patch) | |
| tree | 36980f65ace0a9492e3a28473a89428d6f45c44f /src/buffer.h | |
| parent | 3e2cd454fdc04a1afefa23cdfe241c11862eaa8d (diff) | |
| download | emacs-8f3a2c2659ddee1ae84b4b8bb28f6c388f87fd0f.tar.gz emacs-8f3a2c2659ddee1ae84b4b8bb28f6c388f87fd0f.zip | |
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/buffer.h')
| -rw-r--r-- | src/buffer.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h index 641a561cafc..646f8f72232 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -1120,9 +1120,19 @@ record_unwind_current_buffer (void) | |||
| 1120 | } \ | 1120 | } \ |
| 1121 | } while (0) | 1121 | } while (0) |
| 1122 | 1122 | ||
| 1123 | extern Lisp_Object Vbuffer_alist; | ||
| 1123 | extern Lisp_Object Qbefore_change_functions; | 1124 | extern Lisp_Object Qbefore_change_functions; |
| 1124 | extern Lisp_Object Qafter_change_functions; | 1125 | extern Lisp_Object Qafter_change_functions; |
| 1125 | extern Lisp_Object Qfirst_change_hook; | 1126 | extern Lisp_Object Qfirst_change_hook; |
| 1127 | extern Lisp_Object Qpriority, Qbefore_string, Qafter_string; | ||
| 1128 | |||
| 1129 | /* FOR_EACH_LIVE_BUFFER (LIST_VAR, BUF_VAR) followed by a statement is | ||
| 1130 | a `for' loop which iterates over the buffers from Vbuffer_alist. */ | ||
| 1131 | |||
| 1132 | #define FOR_EACH_LIVE_BUFFER(list_var, buf_var) \ | ||
| 1133 | for (list_var = Vbuffer_alist; \ | ||
| 1134 | (CONSP (list_var) && (buf_var = XCDR (XCAR (list_var)), 1)); \ | ||
| 1135 | list_var = XCDR (list_var)) | ||
| 1126 | 1136 | ||
| 1127 | /* Get text properties of B. */ | 1137 | /* Get text properties of B. */ |
| 1128 | 1138 | ||