Mercurial > emacs
comparison src/xdisp.c @ 31610:29c6825c59a8
(handle_fontified_prop): While running fontification
functions, bind `fontification-functions' and
`after-change-functions' to nil.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Thu, 14 Sep 2000 19:17:22 +0000 |
parents | a1d733428491 |
children | 8b3846ae64fe |
comparison
equal
deleted
inserted
replaced
31609:f5c313af6821 | 31610:29c6825c59a8 |
---|---|
1870 meaning in strings.) If the value is nil, call functions from | 1870 meaning in strings.) If the value is nil, call functions from |
1871 Qfontification_functions. */ | 1871 Qfontification_functions. */ |
1872 if (!STRINGP (it->string) | 1872 if (!STRINGP (it->string) |
1873 && it->s == NULL | 1873 && it->s == NULL |
1874 && !NILP (Vfontification_functions) | 1874 && !NILP (Vfontification_functions) |
1875 && !NILP (Vrun_hooks) | |
1875 && (pos = make_number (IT_CHARPOS (*it)), | 1876 && (pos = make_number (IT_CHARPOS (*it)), |
1876 prop = Fget_char_property (pos, Qfontified, Qnil), | 1877 prop = Fget_char_property (pos, Qfontified, Qnil), |
1877 NILP (prop))) | 1878 NILP (prop))) |
1878 { | 1879 { |
1879 Lisp_Object args[2]; | 1880 int count = specpdl_ptr - specpdl; |
1880 | 1881 Lisp_Object val; |
1881 /* Run the hook functions. */ | 1882 |
1882 args[0] = Qfontification_functions; | 1883 val = Vfontification_functions; |
1883 args[1] = pos; | 1884 specbind (Qfontification_functions, Qnil); |
1884 Frun_hook_with_args (2, args); | 1885 specbind (Qafter_change_functions, Qnil); |
1886 | |
1887 if (!CONSP (val) || EQ (XCAR (val), Qlambda)) | |
1888 call1 (val, pos); | |
1889 else | |
1890 { | |
1891 Lisp_Object globals, fn; | |
1892 struct gcpro gcpro1, gcpro2; | |
1893 | |
1894 globals = Qnil; | |
1895 GCPRO2 (val, globals); | |
1896 | |
1897 for (; CONSP (val); val = XCDR (val)) | |
1898 { | |
1899 fn = XCAR (val); | |
1900 | |
1901 if (EQ (fn, Qt)) | |
1902 { | |
1903 /* A value of t indicates this hook has a local | |
1904 binding; it means to run the global binding too. | |
1905 In a global value, t should not occur. If it | |
1906 does, we must ignore it to avoid an endless | |
1907 loop. */ | |
1908 for (globals = Fdefault_value (Qfontification_functions); | |
1909 CONSP (globals); | |
1910 globals = XCDR (globals)) | |
1911 { | |
1912 fn = XCAR (globals); | |
1913 if (!EQ (fn, Qt)) | |
1914 call1 (fn, pos); | |
1915 } | |
1916 } | |
1917 else | |
1918 call1 (fn, pos); | |
1919 } | |
1920 | |
1921 UNGCPRO; | |
1922 } | |
1923 | |
1924 unbind_to (count, Qnil); | |
1885 | 1925 |
1886 /* Return HANDLED_RECOMPUTE_PROPS only if function fontified | 1926 /* Return HANDLED_RECOMPUTE_PROPS only if function fontified |
1887 something. This avoids an endless loop if they failed to | 1927 something. This avoids an endless loop if they failed to |
1888 fontify the text for which reason ever. */ | 1928 fontify the text for which reason ever. */ |
1889 if (!NILP (Fget_char_property (pos, Qfontified, Qnil))) | 1929 if (!NILP (Fget_char_property (pos, Qfontified, Qnil))) |
12512 int eol_str_len; | 12552 int eol_str_len; |
12513 /* The EOL conversion we are using. */ | 12553 /* The EOL conversion we are using. */ |
12514 Lisp_Object eoltype; | 12554 Lisp_Object eoltype; |
12515 | 12555 |
12516 val = Fget (coding_system, Qcoding_system); | 12556 val = Fget (coding_system, Qcoding_system); |
12557 eoltype = Qnil; | |
12517 | 12558 |
12518 if (!VECTORP (val)) /* Not yet decided. */ | 12559 if (!VECTORP (val)) /* Not yet decided. */ |
12519 { | 12560 { |
12520 if (multibyte) | 12561 if (multibyte) |
12521 *buf++ = '-'; | 12562 *buf++ = '-'; |