comparison src/buffer.c @ 406:b8cc9ab3f761 r21-2-33

Import from CVS: tag r21-2-33
author cvs
date Mon, 13 Aug 2007 11:17:09 +0200
parents 2f8bb876ab1d
children 501cfd01ee6d
comparison
equal deleted inserted replaced
405:0e08f63c74d2 406:b8cc9ab3f761
193 Lisp_Object QSFundamental; /* A string "Fundamental" */ 193 Lisp_Object QSFundamental; /* A string "Fundamental" */
194 Lisp_Object QSscratch; /* "*scratch*" */ 194 Lisp_Object QSscratch; /* "*scratch*" */
195 Lisp_Object Qdefault_directory; 195 Lisp_Object Qdefault_directory;
196 196
197 Lisp_Object Qkill_buffer_hook; 197 Lisp_Object Qkill_buffer_hook;
198 Lisp_Object Qrecord_buffer_hook;
199 198
200 Lisp_Object Qrename_auto_save_file; 199 Lisp_Object Qrename_auto_save_file;
201 200
202 Lisp_Object Qget_file_buffer; 201 Lisp_Object Qget_file_buffer;
203 Lisp_Object Qchange_major_mode_hook, Vchange_major_mode_hook; 202 Lisp_Object Qchange_major_mode_hook, Vchange_major_mode_hook;
1025 buf = Fcurrent_buffer (); 1024 buf = Fcurrent_buffer ();
1026 1025
1027 /* The aconses in the Vbuffer_alist are shared with frame->buffer_alist, 1026 /* The aconses in the Vbuffer_alist are shared with frame->buffer_alist,
1028 so this will change it in the per-frame ordering as well. */ 1027 so this will change it in the per-frame ordering as well. */
1029 Fsetcar (Frassq (buf, Vbuffer_alist), newname); 1028 Fsetcar (Frassq (buf, Vbuffer_alist), newname);
1030 /* If the buffer is the selected one then this is equivalent to
1031 recording the buffer. */
1032 if (EQ (Fwindow_buffer (Fselected_window (Qnil)), buf))
1033 {
1034 va_run_hook_with_args (Qrecord_buffer_hook, 1, buf);
1035 }
1036 1029
1037 if (NILP (current_buffer->filename) 1030 if (NILP (current_buffer->filename)
1038 && !NILP (current_buffer->auto_save_file_name)) 1031 && !NILP (current_buffer->auto_save_file_name))
1039 call0 (Qrename_auto_save_file); 1032 call0 (Qrename_auto_save_file);
1040 /* refetch since that last call may have done GC */ 1033 /* refetch since that last call may have done GC */
1418 else 1411 else
1419 XCDR (prev) = XCDR (XCDR (prev)); 1412 XCDR (prev) = XCDR (XCDR (prev));
1420 XCDR (lynk) = f->buffer_alist; 1413 XCDR (lynk) = f->buffer_alist;
1421 f->buffer_alist = lynk; 1414 f->buffer_alist = lynk;
1422 1415
1423 va_run_hook_with_args (Qrecord_buffer_hook, 1, buffer);
1424
1425 return Qnil; 1416 return Qnil;
1426 } 1417 }
1427 1418
1428 DEFUN ("set-buffer-major-mode", Fset_buffer_major_mode, 1, 1, 0, /* 1419 DEFUN ("set-buffer-major-mode", Fset_buffer_major_mode, 1, 1, 0, /*
1429 Set an appropriate major mode for BUFFER, according to `default-major-mode'. 1420 Set an appropriate major mode for BUFFER, according to `default-major-mode'.
2160 defsymbol (&Qbuffer_live_p, "buffer-live-p"); 2151 defsymbol (&Qbuffer_live_p, "buffer-live-p");
2161 defsymbol (&Qbuffer_or_string_p, "buffer-or-string-p"); 2152 defsymbol (&Qbuffer_or_string_p, "buffer-or-string-p");
2162 defsymbol (&Qmode_class, "mode-class"); 2153 defsymbol (&Qmode_class, "mode-class");
2163 defsymbol (&Qrename_auto_save_file, "rename-auto-save-file"); 2154 defsymbol (&Qrename_auto_save_file, "rename-auto-save-file");
2164 defsymbol (&Qkill_buffer_hook, "kill-buffer-hook"); 2155 defsymbol (&Qkill_buffer_hook, "kill-buffer-hook");
2165 defsymbol (&Qrecord_buffer_hook, "record-buffer-hook");
2166 defsymbol (&Qpermanent_local, "permanent-local"); 2156 defsymbol (&Qpermanent_local, "permanent-local");
2167 2157
2168 defsymbol (&Qfirst_change_hook, "first-change-hook"); 2158 defsymbol (&Qfirst_change_hook, "first-change-hook");
2169 defsymbol (&Qbefore_change_functions, "before-change-functions"); 2159 defsymbol (&Qbefore_change_functions, "before-change-functions");
2170 defsymbol (&Qafter_change_functions, "after-change-functions"); 2160 defsymbol (&Qafter_change_functions, "after-change-functions");