aboutsummaryrefslogtreecommitdiffstats
path: root/src/filelock.c
diff options
context:
space:
mode:
authorDmitry Antipov2013-08-05 08:14:43 +0400
committerDmitry Antipov2013-08-05 08:14:43 +0400
commit8f3a2c2659ddee1ae84b4b8bb28f6c388f87fd0f (patch)
tree36980f65ace0a9492e3a28473a89428d6f45c44f /src/filelock.c
parent3e2cd454fdc04a1afefa23cdfe241c11862eaa8d (diff)
downloademacs-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/filelock.c')
-rw-r--r--src/filelock.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/filelock.c b/src/filelock.c
index 0f31b7d4deb..cb0bd5c7b96 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -745,16 +745,15 @@ unlock_file (Lisp_Object fn)
745void 745void
746unlock_all_files (void) 746unlock_all_files (void)
747{ 747{
748 register Lisp_Object tail; 748 register Lisp_Object tail, buf;
749 register struct buffer *b; 749 register struct buffer *b;
750 750
751 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) 751 FOR_EACH_LIVE_BUFFER (tail, buf)
752 { 752 {
753 b = XBUFFER (XCDR (XCAR (tail))); 753 b = XBUFFER (buf);
754 if (STRINGP (BVAR (b, file_truename)) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) 754 if (STRINGP (BVAR (b, file_truename))
755 { 755 && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b))
756 unlock_file (BVAR (b, file_truename)); 756 unlock_file (BVAR (b, file_truename));
757 }
758 } 757 }
759} 758}
760 759