diff options
| author | Dave Love | 2002-12-03 10:27:00 +0000 |
|---|---|---|
| committer | Dave Love | 2002-12-03 10:27:00 +0000 |
| commit | 48265e61f0392317f8efbf1f5725d7a9bc4e92a8 (patch) | |
| tree | 2ad667cab112abb83408897daf9554f85469ee12 /src/buffer.c | |
| parent | 5a1a5f58075f495f4f617977bb28cec4c0486bed (diff) | |
| download | emacs-48265e61f0392317f8efbf1f5725d7a9bc4e92a8.tar.gz emacs-48265e61f0392317f8efbf1f5725d7a9bc4e92a8.zip | |
(Qucs_set_table_for_input): New.
(Fget_buffer_create): Use it.
(Qset_buffer_major_mode_hook): Deleted.
(Fset_buffer_major_mode): Revert previous change.
(init_buffer_once): Intern ucs-set-table-for-input.
(syms_of_buffer): Delete Qset_buffer_major_mode_hook. Add
&Qucs_set_table_for_input.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/buffer.c b/src/buffer.c index cd765a6cdc1..fb776ae77ee 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -157,6 +157,7 @@ Lisp_Object Vfirst_change_hook; | |||
| 157 | Lisp_Object Qfirst_change_hook; | 157 | Lisp_Object Qfirst_change_hook; |
| 158 | Lisp_Object Qbefore_change_functions; | 158 | Lisp_Object Qbefore_change_functions; |
| 159 | Lisp_Object Qafter_change_functions; | 159 | Lisp_Object Qafter_change_functions; |
| 160 | Lisp_Object Qucs_set_table_for_input; | ||
| 160 | 161 | ||
| 161 | /* If nonzero, all modification hooks are suppressed. */ | 162 | /* If nonzero, all modification hooks are suppressed. */ |
| 162 | int inhibit_modification_hooks; | 163 | int inhibit_modification_hooks; |
| @@ -178,7 +179,6 @@ Lisp_Object Qpriority, Qwindow, Qevaporate, Qbefore_string, Qafter_string; | |||
| 178 | Lisp_Object Qmodification_hooks; | 179 | Lisp_Object Qmodification_hooks; |
| 179 | Lisp_Object Qinsert_in_front_hooks; | 180 | Lisp_Object Qinsert_in_front_hooks; |
| 180 | Lisp_Object Qinsert_behind_hooks; | 181 | Lisp_Object Qinsert_behind_hooks; |
| 181 | Lisp_Object Qset_buffer_major_mode_hook; | ||
| 182 | 182 | ||
| 183 | static void alloc_buffer_text P_ ((struct buffer *, size_t)); | 183 | static void alloc_buffer_text P_ ((struct buffer *, size_t)); |
| 184 | static void free_buffer_text P_ ((struct buffer *b)); | 184 | static void free_buffer_text P_ ((struct buffer *b)); |
| @@ -415,6 +415,12 @@ The value is never nil. */) | |||
| 415 | XSETBUFFER (buf, b); | 415 | XSETBUFFER (buf, b); |
| 416 | Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil)); | 416 | Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil)); |
| 417 | 417 | ||
| 418 | /* Fixme: Protect against errors, which would trigger infinite | ||
| 419 | regress? */ | ||
| 420 | if (!NILP (Ffboundp (Qucs_set_table_for_input))) | ||
| 421 | /* buff is on buffer-alist, so no gcpro */ | ||
| 422 | call1 (Qucs_set_table_for_input, buf); | ||
| 423 | |||
| 418 | b->mark = Fmake_marker (); | 424 | b->mark = Fmake_marker (); |
| 419 | BUF_MARKERS (b) = Qnil; | 425 | BUF_MARKERS (b) = Qnil; |
| 420 | b->name = name; | 426 | b->name = name; |
| @@ -1543,17 +1549,18 @@ the current buffer's major mode. */) | |||
| 1543 | function = current_buffer->major_mode; | 1549 | function = current_buffer->major_mode; |
| 1544 | } | 1550 | } |
| 1545 | 1551 | ||
| 1552 | if (NILP (function) || EQ (function, Qfundamental_mode)) | ||
| 1553 | return Qnil; | ||
| 1554 | |||
| 1546 | count = SPECPDL_INDEX (); | 1555 | count = SPECPDL_INDEX (); |
| 1547 | 1556 | ||
| 1548 | /* To select a nonfundamental mode, select the buffer temporarily | 1557 | /* To select a nonfundamental mode, |
| 1549 | and then call the mode function. Run the hook anyhow. */ | 1558 | select the buffer temporarily and then call the mode function. */ |
| 1550 | 1559 | ||
| 1551 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); | 1560 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); |
| 1552 | 1561 | ||
| 1553 | Fset_buffer (buffer); | 1562 | Fset_buffer (buffer); |
| 1554 | if (!(NILP (function) || EQ (function, Qfundamental_mode))) | 1563 | call0 (function); |
| 1555 | call0 (function); | ||
| 1556 | Frun_hooks (1, &Qset_buffer_major_mode_hook); | ||
| 1557 | 1564 | ||
| 1558 | return unbind_to (count, Qnil); | 1565 | return unbind_to (count, Qnil); |
| 1559 | } | 1566 | } |
| @@ -5001,6 +5008,8 @@ init_buffer_once () | |||
| 5001 | 5008 | ||
| 5002 | Qkill_buffer_hook = intern ("kill-buffer-hook"); | 5009 | Qkill_buffer_hook = intern ("kill-buffer-hook"); |
| 5003 | 5010 | ||
| 5011 | Qucs_set_table_for_input = intern ("ucs-set-table-for-input"); | ||
| 5012 | |||
| 5004 | Vprin1_to_string_buffer = Fget_buffer_create (build_string (" prin1")); | 5013 | Vprin1_to_string_buffer = Fget_buffer_create (build_string (" prin1")); |
| 5005 | 5014 | ||
| 5006 | /* super-magic invisible buffer */ | 5015 | /* super-magic invisible buffer */ |
| @@ -5128,8 +5137,7 @@ syms_of_buffer () | |||
| 5128 | staticpro (&Qbefore_change_functions); | 5137 | staticpro (&Qbefore_change_functions); |
| 5129 | Qafter_change_functions = intern ("after-change-functions"); | 5138 | Qafter_change_functions = intern ("after-change-functions"); |
| 5130 | staticpro (&Qafter_change_functions); | 5139 | staticpro (&Qafter_change_functions); |
| 5131 | Qset_buffer_major_mode_hook = intern ("set-buffer-major-mode-hook"); | 5140 | staticpro (&Qucs_set_table_for_input); |
| 5132 | staticpro (&Qset_buffer_major_mode_hook); | ||
| 5133 | 5141 | ||
| 5134 | Fput (Qprotected_field, Qerror_conditions, | 5142 | Fput (Qprotected_field, Qerror_conditions, |
| 5135 | Fcons (Qprotected_field, Fcons (Qerror, Qnil))); | 5143 | Fcons (Qprotected_field, Fcons (Qerror, Qnil))); |