Mercurial > emacs
comparison src/buffer.c @ 91367:c70e45a7acfd
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-324
| author | Miles Bader <miles@gnu.org> |
|---|---|
| date | Wed, 30 Jan 2008 07:57:28 +0000 |
| parents | 606f2d163a64 0f04103be3bf |
| children | d1e53221c4aa |
comparison
equal
deleted
inserted
replaced
| 91366:86f3a8f0a3a6 | 91367:c70e45a7acfd |
|---|---|
| 151 | 151 |
| 152 /* If nonzero, all modification hooks are suppressed. */ | 152 /* If nonzero, all modification hooks are suppressed. */ |
| 153 int inhibit_modification_hooks; | 153 int inhibit_modification_hooks; |
| 154 | 154 |
| 155 Lisp_Object Qfundamental_mode, Qmode_class, Qpermanent_local; | 155 Lisp_Object Qfundamental_mode, Qmode_class, Qpermanent_local; |
| 156 Lisp_Object Qpermanent_local_hook; | |
| 156 | 157 |
| 157 Lisp_Object Qprotected_field; | 158 Lisp_Object Qprotected_field; |
| 158 | 159 |
| 159 Lisp_Object QSFundamental; /* A string "Fundamental" */ | 160 Lisp_Object QSFundamental; /* A string "Fundamental" */ |
| 160 | 161 |
| 760 /* Reset all (or most) per-buffer variables to their defaults. */ | 761 /* Reset all (or most) per-buffer variables to their defaults. */ |
| 761 if (permanent_too) | 762 if (permanent_too) |
| 762 b->local_var_alist = Qnil; | 763 b->local_var_alist = Qnil; |
| 763 else | 764 else |
| 764 { | 765 { |
| 765 Lisp_Object tmp, last = Qnil; | 766 Lisp_Object tmp, prop, last = Qnil; |
| 766 for (tmp = b->local_var_alist; CONSP (tmp); tmp = XCDR (tmp)) | 767 for (tmp = b->local_var_alist; CONSP (tmp); tmp = XCDR (tmp)) |
| 767 if (CONSP (XCAR (tmp)) | 768 if (CONSP (XCAR (tmp)) |
| 768 && SYMBOLP (XCAR (XCAR (tmp))) | 769 && SYMBOLP (XCAR (XCAR (tmp))) |
| 769 && !NILP (Fget (XCAR (XCAR (tmp)), Qpermanent_local))) | 770 && !NILP (prop = Fget (XCAR (XCAR (tmp)), Qpermanent_local))) |
| 770 /* If permanent-local, keep it. */ | 771 { |
| 771 last = tmp; | 772 /* If permanent-local, keep it. */ |
| 773 last = tmp; | |
| 774 if (EQ (prop, Qpermanent_local_hook)) | |
| 775 { | |
| 776 /* This is a partially permanent hook variable. | |
| 777 Preserve only the elements that want to be preserved. */ | |
| 778 Lisp_Object list, newlist; | |
| 779 list = XCDR (XCAR (tmp)); | |
| 780 if (!CONSP (list)) | |
| 781 newlist = list; | |
| 782 else | |
| 783 for (newlist = Qnil; CONSP (list); list = XCDR (list)) | |
| 784 { | |
| 785 Lisp_Object elt = XCAR (list); | |
| 786 /* Preserve element ELT if it's t, | |
| 787 if it is a function with a `permanent-local-hook' property, | |
| 788 or if it's not a symbol. */ | |
| 789 if (! SYMBOLP (elt) | |
| 790 || EQ (elt, Qt) | |
| 791 || !NILP (Fget (elt, Qpermanent_local_hook))) | |
| 792 newlist = Fcons (elt, newlist); | |
| 793 } | |
| 794 XSETCDR (XCAR (tmp), Fnreverse (newlist)); | |
| 795 } | |
| 796 } | |
| 797 /* Delete this local variable. */ | |
| 772 else if (NILP (last)) | 798 else if (NILP (last)) |
| 773 b->local_var_alist = XCDR (tmp); | 799 b->local_var_alist = XCDR (tmp); |
| 774 else | 800 else |
| 775 XSETCDR (last, XCDR (tmp)); | 801 XSETCDR (last, XCDR (tmp)); |
| 776 } | 802 } |
| 5306 staticpro (&Qmode_class); | 5332 staticpro (&Qmode_class); |
| 5307 staticpro (&QSFundamental); | 5333 staticpro (&QSFundamental); |
| 5308 staticpro (&Vbuffer_alist); | 5334 staticpro (&Vbuffer_alist); |
| 5309 staticpro (&Qprotected_field); | 5335 staticpro (&Qprotected_field); |
| 5310 staticpro (&Qpermanent_local); | 5336 staticpro (&Qpermanent_local); |
| 5337 Qpermanent_local_hook = intern ("permanent-local-hook"); | |
| 5338 staticpro (&Qpermanent_local_hook); | |
| 5311 staticpro (&Qkill_buffer_hook); | 5339 staticpro (&Qkill_buffer_hook); |
| 5312 Qoverlayp = intern ("overlayp"); | 5340 Qoverlayp = intern ("overlayp"); |
| 5313 staticpro (&Qoverlayp); | 5341 staticpro (&Qoverlayp); |
| 5314 Qevaporate = intern ("evaporate"); | 5342 Qevaporate = intern ("evaporate"); |
| 5315 staticpro (&Qevaporate); | 5343 staticpro (&Qevaporate); |
| 5333 staticpro (&Qfirst_change_hook); | 5361 staticpro (&Qfirst_change_hook); |
| 5334 Qbefore_change_functions = intern ("before-change-functions"); | 5362 Qbefore_change_functions = intern ("before-change-functions"); |
| 5335 staticpro (&Qbefore_change_functions); | 5363 staticpro (&Qbefore_change_functions); |
| 5336 Qafter_change_functions = intern ("after-change-functions"); | 5364 Qafter_change_functions = intern ("after-change-functions"); |
| 5337 staticpro (&Qafter_change_functions); | 5365 staticpro (&Qafter_change_functions); |
| 5366 /* The next one is initialized in init_buffer_once. */ | |
| 5338 staticpro (&Qucs_set_table_for_input); | 5367 staticpro (&Qucs_set_table_for_input); |
| 5339 | 5368 |
| 5340 Qkill_buffer_query_functions = intern ("kill-buffer-query-functions"); | 5369 Qkill_buffer_query_functions = intern ("kill-buffer-query-functions"); |
| 5341 staticpro (&Qkill_buffer_query_functions); | 5370 staticpro (&Qkill_buffer_query_functions); |
| 5342 | 5371 |
| 5573 make_number (Lisp_Symbol), | 5602 make_number (Lisp_Symbol), |
| 5574 doc: /* Symbol for current buffer's major mode. */); | 5603 doc: /* Symbol for current buffer's major mode. */); |
| 5575 | 5604 |
| 5576 DEFVAR_PER_BUFFER ("mode-name", ¤t_buffer->mode_name, | 5605 DEFVAR_PER_BUFFER ("mode-name", ¤t_buffer->mode_name, |
| 5577 Qnil, | 5606 Qnil, |
| 5578 doc: /* Pretty name of current buffer's major mode (a string). */); | 5607 doc: /* Pretty name of current buffer's major mode. |
| 5608 Usually a string. See `mode-line-format' for other possible forms. */); | |
| 5579 | 5609 |
| 5580 DEFVAR_PER_BUFFER ("local-abbrev-table", ¤t_buffer->abbrev_table, Qnil, | 5610 DEFVAR_PER_BUFFER ("local-abbrev-table", ¤t_buffer->abbrev_table, Qnil, |
| 5581 doc: /* Local (mode-specific) abbrev table of current buffer. */); | 5611 doc: /* Local (mode-specific) abbrev table of current buffer. */); |
| 5582 | 5612 |
| 5583 DEFVAR_PER_BUFFER ("abbrev-mode", ¤t_buffer->abbrev_mode, Qnil, | 5613 DEFVAR_PER_BUFFER ("abbrev-mode", ¤t_buffer->abbrev_mode, Qnil, |
