commit 831945a1cb675444fb819d8b820cd65402930545 (HEAD, refs/remotes/origin/master) Author: Glenn Morris Date: Wed Sep 9 23:23:27 2015 -0700 * lisp/cedet/ede/auto.el (ede-project-autoload): Doc fix. diff --git a/lisp/cedet/ede/auto.el b/lisp/cedet/ede/auto.el index b4fea42..7c2a6b8 100644 --- a/lisp/cedet/ede/auto.el +++ b/lisp/cedet/ede/auto.el @@ -155,9 +155,9 @@ into memory.") Specifying this matcher object will allow EDE to perform a complex check without loading the project. -NOTE: If you use dirmatch, you may need to set :root-only to `nil'. +NOTE: If you use dirmatch, you may need to set :root-only to nil. While it may be a root based project, all subdirs will happen to return -true for the dirmatch, so for scanning purposes, set it to `nil'.") +true for the dirmatch, so for scanning purposes, set it to nil.") (proj-root :initarg :proj-root :type function :documentation "A function symbol to call for the project root. commit 0a9d4fd2afb6fad59617f5ca8db556f4b3e01c8f Author: Glenn Morris Date: Wed Sep 9 21:18:36 2015 -0400 * test/automated/file-notify-tests.el (file-notify-test02-events): Fix recent change. diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el index 4fe7955..2c6f916 100644 --- a/test/automated/file-notify-tests.el +++ b/test/automated/file-notify-tests.el @@ -242,7 +242,7 @@ TIMEOUT is the maximum time to wait for, in seconds." ;; Wait for events, and exit. (file-notify--wait-for-events 5 file-notify--test-results) - (should (equal (mapcar #'second file-notify--test-events) + (should (equal (mapcar #'cadr file-notify--test-events) '(created changed deleted created changed deleted created changed renamed))) commit 54ea37308a5f6d7dc803dafaef0030ab5630f68c Author: Paul Eggert Date: Wed Sep 9 15:40:49 2015 -0700 Refix movemail GCC pacification Problem reported by Ken Brown in: http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00406.html * lib-src/movemail.c (main): Fix previous change. diff --git a/lib-src/movemail.c b/lib-src/movemail.c index c25db62..84c8ce2 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -244,17 +244,14 @@ main (int argc, char **argv) #ifndef DISABLE_DIRECT_ACCESS char *lockname = 0; - -#ifdef MAIL_USE_MAILLOCK char *spool_name = 0; -#endif -#ifndef MAIL_USE_SYSTEM_LOCK #ifdef MAIL_USE_MAILLOCK spool_name = mail_spool_name (inname); #endif if (! spool_name) { +#ifndef MAIL_USE_SYSTEM_LOCK /* Use a lock file named after our first argument with .lock appended: If it exists, the mail file is locked. */ /* Note: this locking mechanism is *required* by the mailer @@ -325,8 +322,8 @@ main (int argc, char **argv) } delete_lockname = lockname; - } #endif /* not MAIL_USE_SYSTEM_LOCK */ + } #ifdef SIGCHLD signal (SIGCHLD, SIG_DFL); commit bf86385345e37e69d03d65ac3e7ce3fc30d9269d Author: Stefan Monnier Date: Wed Sep 9 16:31:58 2015 -0400 (time-to-seconds, time-less-p): Mark unused vars with underscore * lisp/calendar/time-date.el (time-to-seconds, time-less-p): Mark unused vars with underscore. diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index f30bea8..2c64645 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -179,7 +179,7 @@ If DATE lacks timezone information, GMT is assumed." (defun time-to-seconds (&optional time) "Convert optional value TIME to a floating point number. TIME defaults to the current time." - (with-decoded-time-value ((high low micro pico type + (with-decoded-time-value ((high low micro pico _type (or time (current-time)))) (+ (* high 65536.0) low @@ -262,8 +262,8 @@ Return the difference in the format of a time value." (defun time-less-p (t1 t2) "Return non-nil if time value T1 is earlier than time value T2." - (with-decoded-time-value ((high1 low1 micro1 pico1 type1 t1) - (high2 low2 micro2 pico2 type2 t2)) + (with-decoded-time-value ((high1 low1 micro1 pico1 _type1 t1) + (high2 low2 micro2 pico2 _type2 t2)) (or (< high1 high2) (and (= high1 high2) (or (< low1 low2) commit 0b78dd60277129af9f520e4d5dc8c7e528c63eee Author: Stefan Monnier Date: Wed Sep 9 16:22:29 2015 -0400 * src/syntax.c (SETUP_SYNTAX_TABLE): Move truncation... (parse_sexp_propertize): ...from here. diff --git a/src/syntax.c b/src/syntax.c index 776ff98..fcd6d01 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -246,8 +246,15 @@ SETUP_SYNTAX_TABLE (ptrdiff_t from, ptrdiff_t count) gl_state.object = Qnil; gl_state.offset = 0; if (parse_sexp_lookup_properties) - if (count > 0 || from > BEGV) - update_syntax_table (count > 0 ? from : from - 1, count, true, Qnil); + { + if (count > 0 || from > BEGV) + update_syntax_table (count > 0 ? from : from - 1, count, true, Qnil); + if (gl_state.e_property > parse_sexp_propertize_done) + { + gl_state.e_property = parse_sexp_propertize_done; + gl_state.e_property_truncated = true; + } + } } /* Same as above, but in OBJECT. If OBJECT is nil, use current buffer. @@ -480,11 +487,6 @@ parse_sexp_propertize (ptrdiff_t charpos) error ("parse-sexp-propertize-function did not move" " parse-sexp-propertize-done"); SETUP_SYNTAX_TABLE (charpos, 1); - if (gl_state.e_property > parse_sexp_propertize_done) - { - gl_state.e_property = parse_sexp_propertize_done; - gl_state.e_property_truncated = true; - } } void commit 75a351bc6fee0dcba72bce96706ba0c18b2df111 Author: Stefan Monnier Date: Wed Sep 9 16:21:59 2015 -0400 * lisp/filenotify.el: Use lexical-binding (file-notify-add-watch): Avoid add-to-list. diff --git a/lisp/filenotify.el b/lisp/filenotify.el index 4af9e90..89fc373 100644 --- a/lisp/filenotify.el +++ b/lisp/filenotify.el @@ -1,4 +1,4 @@ -;;; filenotify.el --- watch files for changes on disk +;;; filenotify.el --- watch files for changes on disk -*- lexical-binding:t -*- ;; Copyright (C) 2013-2015 Free Software Foundation, Inc. @@ -300,11 +300,10 @@ FILE is the name of the file whose event is being reported." ((eq file-notify--library 'w32notify) '(file-name directory-name size last-write-time))))) (when (memq 'attribute-change flags) - (add-to-list - 'l-flags - (cond - ((eq file-notify--library 'inotify) 'attrib) - ((eq file-notify--library 'w32notify) 'attributes))))) + (push (cond + ((eq file-notify--library 'inotify) 'attrib) + ((eq file-notify--library 'w32notify) 'attributes)) + l-flags))) ;; Call low-level function. (setq desc (funcall func dir l-flags 'file-notify-callback))) commit 1c5b7ba8761af7aa2f476d98abcd653cdb966301 Author: Tassilo Horn Date: Wed Sep 9 21:46:40 2015 +0200 Start checking event types in file-notify tests * test/automated/file-notify-tests.el (file-notify--test-events): New variable. (file-notify--test-event-handler): Append received event to file-notify--test-events for later analysis. (file-notify-test02-events): Assert that the expected notifications have arrived in the expected order. diff --git a/test/automated/file-notify-tests.el b/test/automated/file-notify-tests.el index 11589b9..4fe7955 100644 --- a/test/automated/file-notify-tests.el +++ b/test/automated/file-notify-tests.el @@ -60,6 +60,7 @@ (defvar file-notify--test-desc nil) (defvar file-notify--test-results nil) (defvar file-notify--test-event nil) +(defvar file-notify--test-events nil) (setq password-cache-expiry nil tramp-verbose 0 @@ -166,7 +167,7 @@ being the result.") "Ert test function to be called by `file-notify--test-event-handler'. We cannot pass arguments, so we assume that `file-notify--test-event' is bound somewhere." - ;(message "Event %S" file-notify--test-event) + ;;(message "Event %S" file-notify--test-event) ;; Check the descriptor. (should (equal (car file-notify--test-event) file-notify--test-desc)) ;; Check the file name. @@ -182,9 +183,13 @@ is bound somewhere." (defun file-notify--test-event-handler (file-notify--test-event) "Run a test over FILE-NOTIFY--TEST-EVENT. -Save the result in `file-notify--test-results', for later analysis." +For later analysis, append the test result to +`file-notify--test-results' and the event to +`file-notify--test-events'." (let ((result (ert-run-test (make-ert-test :body 'file-notify--test-event-test)))) + (setq file-notify--test-events + (append file-notify--test-events `(,file-notify--test-event))) (setq file-notify--test-results (append file-notify--test-results `(,result))))) @@ -194,7 +199,7 @@ Save the result in `file-notify--test-results', for later analysis." (make-temp-name "file-notify-test") temporary-file-directory)) (defmacro file-notify--wait-for-events (timeout until) - "Wait for file notification events until form UNTIL is true. + "Wait for and return file notification events until form UNTIL is true. TIMEOUT is the maximum time to wait for, in seconds." `(with-timeout (,timeout (ignore)) (while (null ,until) @@ -206,6 +211,7 @@ TIMEOUT is the maximum time to wait for, in seconds." (unwind-protect (progn (setq file-notify--test-results nil + file-notify--test-events nil file-notify--test-tmpfile (file-notify--test-make-temp-name) file-notify--test-tmpfile1 (file-notify--test-make-temp-name) file-notify--test-desc @@ -214,7 +220,7 @@ TIMEOUT is the maximum time to wait for, in seconds." '(change) 'file-notify--test-event-handler)) (should file-notify--test-desc) - ;; Check creation and removal. + ;; Check creation, change, and deletion. (write-region "any text" nil file-notify--test-tmpfile nil 'no-message) (delete-file file-notify--test-tmpfile) @@ -236,13 +242,17 @@ TIMEOUT is the maximum time to wait for, in seconds." ;; Wait for events, and exit. (file-notify--wait-for-events 5 file-notify--test-results) + (should (equal (mapcar #'second file-notify--test-events) + '(created changed deleted + created changed deleted + created changed renamed))) (file-notify-rm-watch file-notify--test-desc) (ignore-errors (delete-file file-notify--test-tmpfile)) (ignore-errors (delete-file file-notify--test-tmpfile1))) (should file-notify--test-results) (dolist (result file-notify--test-results) - ;(message "%s" (ert-test-result-messages result)) + ;;(message "%s" (ert-test-result-messages result)) (when (ert-test-failed-p result) (ert-fail (cadr (ert-test-result-with-condition-condition result)))))) commit 5a3122e1679575a8b4e24d3d965f6d6684ae118e Author: Paul Eggert Date: Wed Sep 9 12:36:18 2015 -0700 Merge from gnulib and texinfo This incorporates: 2015-08-03 Improve port of stdalign to C++11 * lib/stdalign.in.h: Copy from gnulib. * doc/misc/texinfo.tex: Copy from texinfo. diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index f773c90..aaabbc9 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2015-07-01.07} +\def\texinfoversion{2015-09-05.20} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -310,7 +310,9 @@ \def\prevsectiondefs{} \def\lastcolordefs{} + % Main output routine. +% \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} @@ -344,10 +346,10 @@ \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. % We don't want .vr (or whatever) entries like this: - % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} + % \entry{{\indexbackslash }acronym}{32}{\code {\acronym}} % "\acronym" won't work when it's read back in; % it needs to be - % {\code {{\tt \backslashcurfont }acronym} + % {\code {{\backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi @@ -427,9 +429,13 @@ \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} + +% Argument parsing + % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. +% For example, \def\foo{\parsearg\fooxxx}. % \def\parsearg{\parseargusing{}} \def\parseargusing#1#2{% @@ -448,9 +454,11 @@ }% } -% First remove any @comment, then any @c comment. +% First remove any @comment, then any @c comment. Also remove a @texinfoc +% comment (see \scanmacro for details). Pass the result on to \argcheckspaces. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} -\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm} +\def\argremovetexinfoc#1\texinfoc#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} % Each occurrence of `\^^M' or `\^^M' is replaced by a single space. % @@ -939,12 +947,20 @@ where each line of input produces a line of output.} % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment % -\def\comment{\begingroup \catcode`\^^M=\other% +\def\comment{\begingroup \catcode`\^^M=\active% +\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other\commentxxx}% + +{\catcode`\^^M=\active% +\gdef\commentxxx#1^^M{\endgroup% +\futurelet\nexttoken\commentxxxx}% +\gdef\commentxxxx{\ifx\nexttoken\aftermacro\expandafter\comment\fi}% +} + +\def\c{\begingroup \catcode`\^^M=\active% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% -\commentxxx} -{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} -% -\let\c=\comment +\cxxx} +{\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}} +% See comment in \scanmacro about why the definitions of @c and @comment differ % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. @@ -1037,17 +1053,15 @@ where each line of input produces a line of output.} \newif\iflinks \linkstrue % by default we want the aux files. \let\novalidate = \linksfalse -% @setfilename is done at the beginning of every texinfo file. -% So open here the files we need to have open while reading the input. +% @setfilename is done at the beginning of every texinfo file. So open +% here some of the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% - \fixbackslash % Turn off hack to swallow `\input texinfo'. \iflinks \tryauxfile % Open the new aux file. TeX will close it automatically at exit. \immediate\openout\auxfile=\jobname.aux \fi % \openindices needs to do some work in any case. - \openindices \let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. @@ -1059,17 +1073,6 @@ where each line of input produces a line of output.} \comment % Ignore the actual filename. } -% Called from \setfilename. -% -\def\openindices{% - \newindex{cp}% - \newcodeindex{fn}% - \newcodeindex{vr}% - \newcodeindex{tp}% - \newcodeindex{ky}% - \newcodeindex{pg}% -} - % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} @@ -1884,6 +1887,7 @@ end % Section fonts (14.4pt). \def\secnominalsize{14pt} \setfont\secrm\rmbshape{12}{\magstep1}{OT1} +\setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1} \setfont\secit\itbshape{10}{\magstep2}{OT1IT} \setfont\secsl\slbshape{10}{\magstep2}{OT1} \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} @@ -2881,9 +2885,6 @@ end \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} \def\finishsup#1{$\ptexsp{\hbox{\selectfonts\lllsize #1}}$}% -% ctrl is no longer a Texinfo command, but leave this definition for fun. -\def\ctrl #1{{\tt \rawbackslash \hat}#1} - % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, % except specified as a normal braced arg, so no newlines to worry about. @@ -4358,19 +4359,16 @@ end % except not \outer, so it can be used within macros and \if's. \edef\newwrite{\makecsname{ptexnewwrite}} -% \newindex {foo} defines an index named foo. -% It automatically defines \fooindex such that -% \fooindex ...rest of line... puts an entry in the index foo. -% It also defines \fooindfile to be the number of the output channel for -% the file that accumulates this index. The file's extension is foo. +% \newindex {foo} defines an index named IX. +% It automatically defines \IXindex such that +% \IXindex ...rest of line... puts an entry in the index IX. +% It also defines \IXindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is IX. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% - \iflinks - \expandafter\newwrite \csname#1indfile\endcsname - \openout \csname#1indfile\endcsname \jobname.#1 % Open the file - \fi + \expandafter\chardef\csname#1indfile\endcsname=0 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } @@ -4384,14 +4382,19 @@ end \def\defcodeindex{\parsearg\newcodeindex} % \def\newcodeindex#1{% - \iflinks - \expandafter\newwrite \csname#1indfile\endcsname - \openout \csname#1indfile\endcsname \jobname.#1 - \fi + \expandafter\chardef\csname#1indfile\endcsname=0 \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}}% } +% The default indices: +\newindex{cp}% concepts, +\newcodeindex{fn}% functions, +\newcodeindex{vr}% variables, +\newcodeindex{tp}% types, +\newcodeindex{ky}% keys +\newcodeindex{pg}% and programs. + % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. @@ -4420,24 +4423,19 @@ end \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } -% Define \doindex, the driver for all \fooindex macros. +% Define \doindex, the driver for all index macros. % Argument #1 is generated by the calling \fooindex macro, -% and it is "foo", the name of the index. - -% \doindex just uses \parsearg; it calls \doind for the actual work. -% This is because \doind is more useful to call from other macros. - -% There is also \dosubind {index}{topic}{subtopic} -% which makes an entry in a two-level index such as the operation index. +% and it the two-letter name of the index. -\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} -\def\singleindexer #1{\doind{\indexname}{#1}} +\def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx} +\def\doindexxxx #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. -\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} -\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} +\def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx} +\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}} -% Take care of Texinfo commands that can appear in an index entry. +% Used when writing an index entry out to an index file, to prevent +% expansion of Texinfo commands that can appear in an index entry. % Since there are some commands we want to expand, and others we don't, % we have to laboriously prevent expansion for those that we don't. % @@ -4455,31 +4453,6 @@ end \def\{{{\tt\char123}}% \def\}{{\tt\char125}}% % - % I don't entirely understand this, but when an index entry is - % generated from a macro call, the \endinput which \scanmacro inserts - % causes processing to be prematurely terminated. This is, - % apparently, because \indexsorttmp is fully expanded, and \endinput - % is an expandable command. The redefinition below makes \endinput - % disappear altogether for that purpose -- although logging shows that - % processing continues to some further point. On the other hand, it - % seems \endinput does not hurt in the printed index arg, since that - % is still getting written without apparent harm. - % - % Sample source (mac-idx3.tex, reported by Graham Percival to - % help-texinfo, 22may06): - % @macro funindex {WORD} - % @findex xyz - % @end macro - % ... - % @funindex commtest - % This is not enough to reproduce the bug, but it gives the flavor. - % - % Sample whatsit resulting: - % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} - % - % So: - \let\endinput = \empty - % % Do the redefinitions. \commondummies } @@ -4691,6 +4664,31 @@ end % For testing: output @{ and @} in index sort strings as \{ and \}. \newif\ifusebracesinindexes +\let\indexlbrace\relax +\let\indexrbrace\relax + +{\catcode`\@=0 +\catcode`\\=13 + @gdef@backslashdisappear{@def\{}} +} + +{ +\catcode`\<=13 +\catcode`\-=13 + \gdef\indexnonalnumdisappear{% + \backslashdisappear + \def-{}% + \def<{}% + } + + \gdef\indexnonalnumreappear{% + \useindexbackslash + \let-\normaldash + \let<\normalless + } +} + + % \indexnofonts is used when outputting the strings to sort the index % by, and when constructing control sequence names. It eliminates all % control sequences and just writes whatever the best ASCII sort string @@ -4716,16 +4714,10 @@ end \def\_{\normalunderscore}% \def\-{}% @- shouldn't affect sorting % - % Unfortunately, texindex is not prepared to handle braces in the - % content at all. So for index sorting, we map @{ and @} to strings - % starting with |, since that ASCII character is between ASCII { and }. - \ifusebracesinindexes - \def\lbracechar{\lbracecmd}% - \def\rbracechar{\rbracecmd}% - \else - \def\lbracechar{|a}% - \def\rbracechar{|b}% - \fi + % Unfortunately, texindex < 6.0 is not prepared to handle braces in the + % content at all, so these won't be sorted in ASCII order. + \def\lbracechar{{\indexlbrace}}% + \def\rbracechar{{\indexrbrace}}% \let\{=\lbracechar \let\}=\rbracechar % @@ -4737,7 +4729,7 @@ end \def\L{L}% \def\OE{OE}% \def\O{O}% - \def\TH{ZZZ}% + \def\TH{TH}% \def\aa{aa}% \def\ae{ae}% \def\dh{dzz}% @@ -4749,7 +4741,7 @@ end \def\o{o}% \def\questiondown{?}% \def\ss{ss}% - \def\th{zzz}% + \def\th{th}% % \def\LaTeX{LaTeX}% \def\TeX{TeX}% @@ -4807,14 +4799,17 @@ end {\catcode`\`=\active \gdef\indexlquoteignore{\let`=\empty}} -\let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % Most index entries go through here, but \dosubind is the general case. % #1 is the index name, #2 is the entry text. \def\doind#1#2{\dosubind{#1}{#2}{}} -% Workhorse for all \fooindexes. +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. +% TODO: Two-level index? Operation index? + +% Workhorse for all indexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % empty if called from \doind, as we usually are (the main exception % is with most defuns, which call us directly). @@ -4822,6 +4817,7 @@ end \def\dosubind#1#2#3{% \iflinks {% + \requireopenindexfile{#1}% % Store the main index entry text (including the third arg). \toks0 = {#2}% % If third arg is present, precede it with a space. @@ -4837,7 +4833,40 @@ end \fi } -% Write the entry in \toks0 to the index file: +% Check if an index file has been opened, and if not, open it. +\def\requireopenindexfile#1{% +\ifnum\csname #1indfile\endcsname=0 + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 % Open the file +\fi} + +% Output \ as {\indexbackslash}, because \ is an escape character in +% the index files. +\let\indexbackslash=\relax +{\catcode`\@=0 \catcode`\\=\active + @gdef@useindexbackslash{@def\{{@indexbackslash}}} +} + +% Definition for writing index entry text. +\def\sortas#1{\ignorespaces}% + +% Definition for writing index entry sort key. Should occur at the at +% the beginning of the index entry, like +% @cindex @sortas{september} \september +% The \ignorespaces takes care of following space, but there's no way +% to remove space before it. +{ +\catcode`\-=13 +\gdef\indexwritesortas{% + \begingroup + \indexnonalnumreappear + \indexwritesortasxxx} +\gdef\indexwritesortasxxx#1{% + \xdef\indexsortkey{#1}\endgroup} +} + + +% Write the entry in \toks0 to the index file. % \def\dosubindwrite{% % Put the index entry in the margin if desired. @@ -4847,14 +4876,20 @@ end % % Remember, we are within a group. \indexdummies % Must do this here, since \bf, etc expand at this stage - \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now - % so it will be output as is; and it will print as backslash. - % - % Process the index entry with all font commands turned off, to - % get the string to sort by. + \useindexbackslash % \indexbackslash isn't defined now so it will be output + % as is; and it will print as backslash. + % Get the string to sort by, by processing the index entry with all + % font commands turned off. {\indexnofonts - \edef\temp{\the\toks0}% need full expansion - \xdef\indexsorttmp{\temp}% + \xdef\indexsortkey{}% + \let\sortas=\indexwritesortas + \indexnonalnumdisappear + \edef\temp{\the\toks0}% + \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas + \ifx\indexsortkey\empty + \xdef\indexsortkey{\temp}% + \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi + \fi }% % % Set up the complete index entry, with both the sort key and @@ -4864,10 +4899,11 @@ end % sorted result. \edef\temp{% \write\writeto{% - \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% + \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}% }% \temp } +\newbox\dummybox % used above % Take care of unwanted page breaks/skips around a whatsit: % @@ -5012,7 +5048,9 @@ end % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. - \def\indexbackslash{\backslashcurfont}% + \def\indexbackslash{\ttbackslash}% + \let\indexlbrace\{ % Likewise, set these sequences for braces + \let\indexrbrace\} % used in the sort key. \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns @@ -5026,18 +5064,47 @@ end % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. -\def\initial#1{{% - % Some minor font changes for the special characters. - \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt - % +{\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13 +\catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13 +\catcode`\$=3 +\gdef\initialglyphs{% + % Some changes for non-alphabetic characters. Using the glyphs from the + % math fonts looks more consistent than the typewriter font used elsewhere + % for these characters. + \def\indexbackslash{\math{\backslash}}% + \let\\=\indexbackslash + % + % Can't get bold backslash so don't use bold forward slash + \catcode`\/=13 + \def/{{\secrmnotbold \normalslash}}% + \def-{{\normaldash\normaldash}}% en dash `--' + \def^{{\chapbf \normalcaret}} + \let~=\normaltilde + \def\_{% + \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }% + \def|{$\vert$}% + \def<{$\less$}% + \def>{$\gtr$}% + \def+{$\normalplus$}% +}} + +\def\initial{% + \bgroup + \initialglyphs + \initialx +} + +\def\initialx#1{% % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. + % The glue before the bonus allows a little bit of space at the + % bottom of a column to reduce an increase in inter-line spacing. \nobreak - \vskip 0pt plus 3\baselineskip - \penalty 0 - \vskip 0pt plus -3\baselineskip + \vskip 0pt plus 6\baselineskip + \penalty -300 + \vskip 0pt plus -6\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column @@ -5046,23 +5113,20 @@ end % % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip - \leftline{\secbf #1}% + \leftline{\secfonts \secbf #1}% + % \secfonts is inside the argument of \leftline so that the change of + % \baselineskip will not affect any glue inserted before the vbox that + % \leftline creates. % Do our best not to break after the initial. \nobreak \vskip .33\baselineskip plus .1\baselineskip -}} + \egroup % \initialglyphs +} % \entry typesets a paragraph consisting of the text (#1), dot leaders, and % then page number (#2) flushed to the right margin. It is used for index % and table of contents entries. The paragraph is indented by \leftskip. % -% A straightforward implementation would start like this: -% \def\entry#1#2{... -% But this freezes the catcodes in the argument, and can cause problems to -% @code, which sets - active. This problem was fixed by a kludge--- -% ``-'' was active throughout whole index, but this isn't really right. -% The right solution is to prevent \entry from swallowing the whole text. -% --kasal, 21nov03 \def\entry{% \begingroup % @@ -5095,7 +5159,7 @@ end % % A bit of stretch before each entry for the benefit of balancing % columns. - \vskip 0pt plus1pt + \vskip 0pt plus0.5pt % % When reading the text of entry, convert explicit line breaks % from @* into spaces. The user might give these in long section @@ -5227,7 +5291,7 @@ end } % The double-column output routine for all double-column pages except -% the last. +% the last, which is done by \balancecolumns. % \def\doublecolumnout{% \splittopskip=\topskip \splitmaxdepth=\maxdepth @@ -5309,28 +5373,45 @@ end \pagegoal = \vsize } % -% Called at the end of the double column material. +% Only called for the last of the double column material. \doublecolumnout +% does the others. \def\balancecolumns{% \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip - \divide\dimen@ by 2 % target to split to - %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% - \splittopskip = \topskip - % Loop until we get a decent breakpoint. - {% - \vbadness = 10000 - \loop - \global\setbox3 = \copy0 - \global\setbox1 = \vsplit3 to \dimen@ - \ifdim\ht3>\dimen@ - \global\advance\dimen@ by 1pt - \repeat - }% - %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% - \setbox0=\vbox to\dimen@{\unvbox1}% - \setbox2=\vbox to\dimen@{\unvbox3}% + \ifdim\dimen@<14\baselineskip + % Don't split a short final column in two. + \setbox2=\vbox{}% + \else + \divide\dimen@ by 2 % target to split to + \dimen@ii = \dimen@ + \splittopskip = \topskip + % Loop until the second column is no higher than the first + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + % Remove glue from bottom of first column to + % make sure it is higher than the second. + \global\setbox1 = \vbox{\unvbox1\unpenalty\unskip}% + \ifdim\ht3>\ht1 + \global\advance\dimen@ by 1pt + \repeat + }% + \multiply\dimen@ii by 4 + \divide\dimen@ii by 5 + \ifdim\ht3<\dimen@ii + % Column heights are too different, so don't make their bottoms + % flush with each other + \setbox0=\vbox to\dimen@{\unvbox1\vfill}% + \setbox2=\vbox to\dimen@{\unvbox3\vfill}% + \else + \setbox0=\vbox to\dimen@{\unvbox1}% + \setbox2=\vbox to\dimen@{\unvbox3}% + \fi + \fi % \pagesofar } @@ -7315,34 +7396,42 @@ end } \fi -\def\scanmacro#1{\begingroup +\let\aftermacroxxx\relax +\def\aftermacro{\aftermacroxxx} + +% alias because \c means cedilla in @tex or @math +\let\texinfoc=\c + +% Used at the time of macro expansion. +% Argument is macro body with arguments substituted +\def\scanmacro#1{% \newlinechar`\^^M \let\xeatspaces\eatspaces % - % Undo catcode changes of \startcontents and \doprintindex - % When called from @insertcopying or (short)caption, we need active - % backslash to get it printed correctly. Previously, we had - % \catcode`\\=\other instead. We'll see whether a problem appears - % with macro expansion. --kasal, 19aug04 - \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ - % - % ... and for \example: - \spaceisspace + % Process the macro body under the current catcode regime. + \scantokens{#1\texinfoc}\aftermacro% % - % The \empty here causes a following catcode 5 newline to be eaten as - % part of reading whitespace after a control sequence. It does not - % eat a catcode 13 newline. There's no good way to handle the two - % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX - % would then have different behavior). See the Macro Details node in - % the manual for the workaround we recommend for macros and - % line-oriented commands. - % - \scantokens{#1\empty}% -\endgroup} + % The \c is to remove the \newlinechar added by \scantokens, and + % can be noticed by \parsearg. + % The \aftermacro allows a \comment at the end of the macro definition + % to duplicate itself past the final \newlinechar added by \scantokens: + % this is used in the definition of \group to comment out a newline. We + % don't do the same for \c to support Texinfo files with macros that ended + % with a @c, which should no longer be necessary. + % We avoid surrounding the call to \scantokens with \bgroup and \egroup + % to allow macros to open or close groups themselves. +} \def\scanexp#1{% + \bgroup + % Undo catcode changes of \startcontents and \printindex + % When called from @insertcopying or (short)caption, we need active + % backslash to get it printed correctly. + % FIXME: This may not be needed. + %\catcode`\@=0 \catcode`\\=\active \escapechar=`\@ \edef\temp{\noexpand\scanmacro{#1}}% \temp + \egroup } \newcount\paramno % Count of parameters @@ -7408,7 +7497,6 @@ end \catcode`\+=\other \catcode`\<=\other \catcode`\>=\other - \catcode`\@=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other @@ -7418,37 +7506,28 @@ end \def\scanargctxt{% used for copying and captions, not macros. \scanctxt + \catcode`\@=\other \catcode`\\=\other \catcode`\^^M=\other } \def\macrobodyctxt{% used for @macro definitions \scanctxt + \catcode`\ =\other + \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other \catcode`\^^M=\other \usembodybackslash } -\def\macroargctxt{% used when scanning invocations +% Used when scanning braced macro arguments. Note, however, that catcode +% changes here are ineffectual if the macro invocation was nested inside +% an argument to another Texinfo command. +\def\macroargctxt{% \scanctxt - \catcode`\\=0 + \catcode`\\=\active } -% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" -% for the single characters \ { }. Thus, we end up with the "commands" -% that would be written @\ @{ @} in a Texinfo document. -% -% We already have @{ and @}. For @\, we define it here, and only for -% this purpose, to produce a typewriter backslash (so, the @\ that we -% define for @math can't be used with @macro calls): -% -\def\\{\normalbackslash}% -% -% We would like to do this for \, too, since that is what makeinfo does. -% But it is not possible, because Texinfo already has a command @, for a -% cedilla accent. Documents must use @comma{} instead. -% -% \anythingelse will almost certainly be an error of some kind. \def\macrolineargctxt{% used for whole-line arguments without braces \scanctxt @@ -7610,12 +7689,12 @@ end % These two commands read recursive and nonrecursive macro bodies. % (They're different since rec and nonrec macros end differently.) -% +% Set \temp to the body of the macro, and call \defmacro. \catcode `\@\texiatcatcode -\long\def\parsemacbody#1@end macro% -{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% -\long\def\parsermacbody#1@end rmacro% -{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +{\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{% +\xdef\temp{\eatcr{#1}}\endgroup\defmacro}}% +{\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{% +\xdef\temp{\eatcr{#1}}\endgroup\defmacro}}% \catcode `\@=11\relax \let\endargs@\relax @@ -7795,15 +7874,16 @@ end \long\def#2{#4}% } -% This defines a Texinfo @macro. There are eight cases: recursive and -% nonrecursive macros of zero, one, up to nine, and many arguments. +% This defines a Texinfo @macro. \temp has the body of the macro in it. +% There are eight cases: recursive and nonrecursive macros of zero, one, +% up to nine, and many arguments. % Much magic with \expandafter here. % \xdef is used so that macro definitions will survive the file % they're defined in; @include reads the file inside a group. % \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars - \ifrecursive + \ifrecursive %%%%%%%%%%%%%% Recursive %%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% @@ -7835,12 +7915,11 @@ end \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble \fi \fi - \else + \else %%%%%%%%%%%%%%%%%%%%%% Non-recursive %%%%%%%%%%%%%%%%%%%%%%%%%% \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% + \noexpand\scanmacro{\temp}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup @@ -7848,8 +7927,8 @@ end \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% + \noexpand\scanmacro{\temp}% + }% \else % at most 9 \ifnum\paramno<10\relax \expandafter\xdef\csname\the\macname\endcsname{% @@ -7863,8 +7942,8 @@ end \csname\the\macname xxx\endcsname \paramlist{% \egroup - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% + \noexpand\scanmacro{\temp}% + }% \else % 10 or more: \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% @@ -7879,16 +7958,86 @@ end \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} + +{\catcode`\@=0 \catcode`\\=13 +@catcode`@_=11 + +% Call #1 with a list of tokens #2, with any doubled backslashes in #2 +% compressed to one. +@gdef@passargtomacro#1#2{% + @def@the_macro{#1}% + @def@pending_backslash{}% + @def@finish{@finish}% + @def@arg_result{}% + @let@next_token=@relax + @add_segment#2\@finish\% +} + +% Input stream is just after a backslash. If the next token is not a +% backslash, process the rest of the argument; otherwise, remove the next +% token. +@gdef@look_ahead{% + @futurelet@next_token@look_aheadzzz} +@gdef@look_aheadzzz{% + @ifx@next_token\% + @let@next=@gobble_and_check_finish + @else + @let@next=@add_segment + @fi@next +} + +% Double backslash found. Add a single backslash here. +@gdef@gobble_and_check_finish#1{% + @add_the_backslash + @def@pending_backslash{}% + @futurelet@next_token@add_segment +} + +% append a backslash to \arg_result +@gdef@add_the_backslash{% + @expandafter@gdef@expandafter@arg_result@expandafter{@arg_result\}% +} + +% Input stream is either at the start of the argument, or just after a +% backslash sequence, either a lone backslash, or a doubled backslash. +% \next_token contains the first token in the input stream: if it is \finish, +% finish; otherwise, append to \arg_result the segment of the argument up until +% the next backslash. \pending_backslash contains a backslash to represent +% a backslash just before the start of the input stream that has not been +% added to \arg_result. +@gdef@add_segment#1\{% +@ifx@next_token@finish + @let@next=@call_the_macro% +@else + @let@next=@look_ahead + % + % append to @arg_result + % token list registers might be better + @expandafter@expandafter@expandafter@gdef + @expandafter@expandafter@expandafter@arg_result + @expandafter@expandafter@expandafter{% + @expandafter@arg_result + @pending_backslash#1}% + @def@pending_backslash{\}% +@fi@next} + +@gdef@call_the_macro{@expandafter@the_macro@expandafter{@arg_result}} + +} + % \braceorline MAC is used for a one-argument macro MAC. It checks % whether the next non-whitespace character is a {. It sets the context % for reading the argument (slightly different in the two cases). Then, -% to read the argument, in the whole-line case, it then calls the -% regular \parsearg MAC; in the lbrace case, it just calls MAC itself. +% to read the argument, in the whole-line case, it then calls the regular +% \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC. % \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% - \ifx\nchar\bgroup\macroargctxt - \else\macrolineargctxt\expandafter\parsearg + \ifx\nchar\bgroup + \macroargctxt + \expandafter\passargtomacro + \else + \macrolineargctxt\expandafter\parsearg \fi \macnamexxx} @@ -8009,9 +8158,12 @@ end % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % -\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} -\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} -\def\ref#1{\xrefX[#1,,,,,,,]} +\def\pxref{\putwordsee{} \xrefXX} +\def\xref{\putwordSee{} \xrefXX} +\def\ref{\xrefXX} + +\def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX} +\def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]} % \newbox\toprefbox \newbox\printedrefnamebox @@ -8155,6 +8307,12 @@ end % % output the `page 3'. \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + \ifx,\tokenafterxref + \else\ifx.\tokenafterxref + \else\ifx;\tokenafterxref + \else\ifx)\tokenafterxref + \else,% add a , if xref not followed by punctuation + \fi\fi\fi\fi \fi\fi \fi \endlink @@ -10186,8 +10344,8 @@ directory should work if nowhere else does.} \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde -\chardef\hat=`\^ -\catcode`\^=\active \def\activehat{{\tt \hat}} \let^ = \activehat +\chardef\hatchar=`\^ +\catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} @@ -10204,6 +10362,8 @@ directory should work if nowhere else does.} \catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix +\catcode`\-=\active \let-=\normaldash + % used for headline/footline in the output routine, in case the page % breaks in the middle of an @tex block. @@ -10218,12 +10378,6 @@ directory should work if nowhere else does.} % in principle, all other definitions in \tex have to be undone too. } -% If a .fmt file is being used, characters that might appear in a file -% name cannot be active until we have parsed the command line. -% So turn them off again, and have \everyjob (or @setfilename) turn them on. -% \otherifyactive is called near the end of this file. -\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} - % Used sometimes to turn off (effectively) the active characters even after % parsing them. \def\turnoffactive{% @@ -10242,23 +10396,22 @@ directory should work if nowhere else does.} % \doublebackslash is two of them (for the pdf outlines). {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} -% In texinfo, backslash is an active character; it prints the backslash +% In Texinfo, backslash is an active character; it prints the backslash % in fixed width font. \catcode`\\=\active % @ for escape char from now on. -% The story here is that in math mode, the \char of \backslashcurfont -% ends up printing the roman \ from the math symbol font (because \char -% in math mode uses the \mathcode, and plain.tex sets -% \mathcode`\\="026E). It seems better for @backslashchar{} to always -% print a typewriter backslash, hence we use an explicit \mathchar, +% Print a typewriter backslash. For math mode, we can't simply use +% \backslashcurfont: the story here is that in math mode, the \char +% of \backslashcurfont ends up printing the roman \ from the math symbol +% font (because \char in math mode uses the \mathcode, and plain.tex +% sets \mathcode`\\="026E). Hence we use an explicit \mathchar, % which is the decimal equivalent of "715c (class 7, e.g., use \fam; % ignored family value; char position "5C). We can't use " for the % usual hex value because it has already been made active. -@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} -@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. -% On startup, @fixbackslash assigns: -% @let \ = @normalbackslash +@def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} +@let@backslashchar = @ttbackslash % @backslashchar{} is for user documents. + % \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with % catcode other. We switch back and forth between these. @@ -10266,8 +10419,7 @@ directory should work if nowhere else does.} @gdef@otherbackslash{@let\=@realbackslash} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of -% the literal character `\'. Also revert - to its normal character, in -% case the active - from code has slipped in. +% the literal character `\'. % {@catcode`- = @active @gdef@normalturnoffactive{% @@ -10278,40 +10430,56 @@ directory should work if nowhere else does.} @let+=@normalplus @let<=@normalless @let>=@normalgreater - @let\=@normalbackslash @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let~=@normaltilde + @let\=@ttbackslash @markupsetuplqdefault @markupsetuprqdefault @unsepspaces } } -% Make _ and + \other characters, temporarily. -% This is canceled by @fixbackslash. -@otherifyactive +% If a .fmt file is being used, characters that might appear in a file +% name cannot be active until we have parsed the command line. +% So turn them off again, and have @fixbackslash turn them back on. +@catcode`+=@other @catcode`@_=@other +% \enablebackslashhack - allow file to begin `\input texinfo' +% % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. -% -@gdef@eatinput input texinfo{@fixbackslash} -@global@let\ = @eatinput +% If the file did not have a `\input texinfo', then it is turned off after +% the first line; otherwise the first `\' in the file would cause an error. +% This is used on the very last line of this file, texinfo.tex. +% We also use @c to call @fixbackslash, in case ends of lines are hidden. +{ +@catcode`@^=7 +@catcode`@^^M=13@gdef@enablebackslashhack{% + @global@let\ = @eatinput% + @catcode`@^^M=13% + @def@c{@fixbackslash@c}% + @def ^^M{@let^^M@secondlinenl}% + @gdef @secondlinenl{@let^^M@thirdlinenl}% + @gdef @thirdlinenl{@fixbackslash}% +}} + +{@catcode`@^=7 @catcode`@^^M=13% +@gdef@eatinput input texinfo#1^^M{@fixbackslash}} -% On the other hand, perhaps the file did not have a `\input texinfo'. Then -% the first `\' in the file would cause an error. This macro tries to fix -% that, assuming it is called before the first `\' could plausibly occur. -% Also turn back on active characters that might appear in the input -% file name, in case not using a pre-dumped format. -% @gdef@fixbackslash{% - @ifx\@eatinput @let\ = @normalbackslash @fi + @ifx\@eatinput @let\ = @ttbackslash @fi + @catcode13=5 % regular end of line + @let@c=@texinfoc + % Also turn back on active characters that might appear in the input + % file name, in case not using a pre-dumped format. @catcode`+=@active @catcode`@_=@active } + % Say @foo, not \foo, in error messages. @escapechar = `@@ @@ -10351,3 +10519,4 @@ directory should work if nowhere else does.} @ignore arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 @end ignore +@enablebackslashhack diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h index a990050..c6115b6 100644 --- a/lib/stdalign.in.h +++ b/lib/stdalign.in.h @@ -64,7 +64,9 @@ # define _Alignof(type) offsetof (struct { char __a; type __b; }, __b) # endif #endif -#define alignof _Alignof +#if ! (defined __cplusplus && 201103 <= __cplusplus) +# define alignof _Alignof +#endif #define __alignof_is_defined 1 /* alignas (A), also known as _Alignas (A), aligns a variable or type @@ -105,8 +107,11 @@ # define _Alignas(a) __declspec (align (a)) # endif #endif -#if defined _Alignas || (defined __STDC_VERSION && 201112 <= __STDC_VERSION__) +#if ((defined _Alignas && ! (defined __cplusplus && 201103 <= __cplusplus)) \ + || (defined __STDC_VERSION && 201112 <= __STDC_VERSION__)) # define alignas _Alignas +#endif +#if defined alignas || (defined __cplusplus && 201103 <= __cplusplus) # define __alignas_is_defined 1 #endif commit ab21f61a552f038485d40218dfd94a16b843eb52 Author: Stefan Monnier Date: Wed Sep 9 15:14:52 2015 -0400 Make syntax.c call syntax-propertize on demand * lisp/emacs-lisp/syntax.el (syntax--jit-propertize): New function. (parse-sexp-propertize-function): Use it. (syntax-propertize): Disable parse-sexp-propertize-function. * src/syntax.c (parse_sexp_propertize, update_syntax_table_forward): New functions. (syms_of_syntax): New vars `parse-sexp-propertize-done' and `parse-sexp-propertize-function'. * src/syntax.h (struct gl_state_s): Add `e_property_truncated' field. (UPDATE_SYNTAX_TABLE_FORWARD): Use update_syntax_table_forward. (SETUP_BUFFER_SYNTAX_TABLE): Set e_property_truncated. * lisp/progmodes/elisp-mode.el (elisp-byte-code-syntax-propertize): Don't assume `point' is set. diff --git a/etc/NEWS b/etc/NEWS index 2f2bd15..49ce9b7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -977,6 +977,9 @@ be updated accordingly. * Lisp Changes in Emacs 25.1 +** syntax-propertize is now automatically called on-demand during forward +parsing functions like `forward-sexp'. + ** New hooks prefix-command-echo-keystrokes-functions and prefix-command-preserve-state-hook, to allow the definition of prefix commands other than the predefined C-u. diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index 05dd7d5..6c9cba3 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el @@ -297,7 +297,10 @@ The return value is a function suitable for `syntax-propertize-function'." (set (make-local-variable 'parse-sexp-lookup-properties) t) (save-excursion (with-silent-modifications + (make-local-variable 'parse-sexp-propertize-done) ;Just in case! (let* ((start (max syntax-propertize--done (point-min))) + ;; Avoid recursion! + (parse-sexp-propertize-done most-positive-fixnum) (end (max pos (min (point-max) (+ start syntax-propertize-chunk-size)))) @@ -324,6 +327,18 @@ The return value is a function suitable for `syntax-propertize-function'." '(syntax-table nil syntax-multiline nil)) (funcall syntax-propertize-function start end)))))) +;;; Link syntax-propertize with the new parse-sexp-propertize. + +(setq-default parse-sexp-propertize-function #'syntax--jit-propertize) +(defun syntax--jit-propertize (charpos) + (if (not syntax-propertize-function) + (setq parse-sexp-propertize-done (1+ (point-max))) + (syntax-propertize charpos) + (setq parse-sexp-propertize-done + (if (= (point-max) syntax-propertize--done) + (1+ (point-max)) + syntax-propertize--done)))) + ;;; Incrementally compute and memoize parser state. (defsubst syntax-ppss-depth (ppss) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 1ea9f17..1cf52c0 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -641,7 +641,7 @@ non-nil result supercedes the xrefs produced by ;; FIXME: name should be singular; match xref-find-definition (defun elisp--xref-find-definitions (symbol) ;; The file name is not known when `symbol' is defined via interactive eval. - (let (xrefs temp) + (let (xrefs) (let ((temp elisp-xref-find-def-functions)) (while (and (null xrefs) @@ -928,6 +928,7 @@ Semicolons start comments. (goto-char end))))))) (defun elisp-byte-code-syntax-propertize (start end) + (goto-char start) (elisp--byte-code-comment end (point)) (funcall (syntax-propertize-rules diff --git a/src/syntax.c b/src/syntax.c index dc82210..776ff98 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -247,7 +247,7 @@ SETUP_SYNTAX_TABLE (ptrdiff_t from, ptrdiff_t count) gl_state.offset = 0; if (parse_sexp_lookup_properties) if (count > 0 || from > BEGV) - update_syntax_table (count > 0 ? from : from - 1, count, 1, Qnil); + update_syntax_table (count > 0 ? from : from - 1, count, true, Qnil); } /* Same as above, but in OBJECT. If OBJECT is nil, use current buffer. @@ -313,7 +313,7 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, bool init, { Lisp_Object tmp_table; int cnt = 0; - bool invalidate = 1; + bool invalidate = true; INTERVAL i; if (init) @@ -323,7 +323,7 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, bool init, gl_state.stop = gl_state.e_property; i = interval_of (charpos, object); gl_state.backward_i = gl_state.forward_i = i; - invalidate = 0; + invalidate = false; if (!i) return; /* interval_of updates only ->position of the return value, so @@ -359,7 +359,7 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, bool init, i = update_interval (i, charpos); if (INTERVAL_LAST_POS (i) != gl_state.b_property) { - invalidate = 0; + invalidate = false; gl_state.forward_i = i; gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset; } @@ -372,7 +372,7 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, bool init, i = update_interval (i, charpos); if (i->position != gl_state.e_property) { - invalidate = 0; + invalidate = false; gl_state.backward_i = i; gl_state.b_property = i->position - gl_state.offset; } @@ -460,14 +460,56 @@ update_syntax_table (ptrdiff_t charpos, EMACS_INT count, bool init, } eassert (i == NULL); /* This property goes to the end. */ if (count > 0) - gl_state.e_property = gl_state.stop; + { + gl_state.e_property = gl_state.stop; + gl_state.forward_i = i; + } else gl_state.b_property = gl_state.start; } + +static void +parse_sexp_propertize (ptrdiff_t charpos) +{ + EMACS_INT modiffs = CHARS_MODIFF; + safe_call1 (Vparse_sexp_propertize_function, + make_number (1 + charpos)); + if (modiffs != CHARS_MODIFF) + error ("parse-sexp-propertize-function modified the buffer!"); + if (parse_sexp_propertize_done <= charpos) + error ("parse-sexp-propertize-function did not move" + " parse-sexp-propertize-done"); + SETUP_SYNTAX_TABLE (charpos, 1); + if (gl_state.e_property > parse_sexp_propertize_done) + { + gl_state.e_property = parse_sexp_propertize_done; + gl_state.e_property_truncated = true; + } +} + +void +update_syntax_table_forward (ptrdiff_t charpos, bool init, + Lisp_Object object) +{ + if (!(gl_state.e_property_truncated)) + update_syntax_table (charpos, 1, init, object); + if ((gl_state.e_property > parse_sexp_propertize_done + || gl_state.e_property_truncated) + && NILP (object)) + { + if (parse_sexp_propertize_done > charpos) + { + gl_state.e_property = parse_sexp_propertize_done; + gl_state.e_property_truncated = true; + } + else + parse_sexp_propertize (charpos); + } +} /* Returns true if char at CHARPOS is quoted. Global syntax-table data should be set up already to be good at CHARPOS - or after. On return global syntax data is good for lookup at CHARPOS. */ + or after. On return global syntax data is good for lookup at CHARPOS. */ static bool char_quoted (ptrdiff_t charpos, ptrdiff_t bytepos) @@ -628,7 +670,7 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, OFROM[I] is position of the earliest comment-starter seen which is I+2X quotes from the comment-end. PARITY is current parity of quotes from the comment end. */ - int string_style = -1; /* Presumed outside of any string. */ + int string_style = -1; /* Presumed outside of any string. */ bool string_lossage = 0; /* Not a real lossage: indicates that we have passed a matching comment starter plus a non-matching comment-ender, meaning that any matching @@ -645,7 +687,7 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, ptrdiff_t defun_start = 0; ptrdiff_t defun_start_byte = 0; enum syntaxcode code; - ptrdiff_t nesting = 1; /* current comment nesting */ + ptrdiff_t nesting = 1; /* Current comment nesting. */ int c; int syntax = 0; @@ -876,7 +918,7 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, is nested, so we need to try again from within the surrounding comment. Example: { a (* " *) */ { - /* FIXME: We should advance by one or two chars. */ + /* FIXME: We should advance by one or two chars. */ defun_start = state.comstr_start + 2; defun_start_byte = CHAR_TO_BYTE (defun_start); } @@ -3588,7 +3630,7 @@ syms_of_syntax (void) staticpro (&gl_state.current_syntax_table); staticpro (&gl_state.old_prop); - /* Defined in regex.c */ + /* Defined in regex.c. */ staticpro (&re_match_object); DEFSYM (Qscan_error, "scan-error"); @@ -3606,6 +3648,20 @@ Otherwise, that text property is simply ignored. See the info node `(elisp)Syntax Properties' for a description of the `syntax-table' property. */); + DEFVAR_INT ("parse-sexp-propertize-done", parse_sexp_propertize_done, + doc: /* Position up to which syntax-table properties have been set. */); + parse_sexp_propertize_done = -1; + + DEFVAR_LISP ("parse-sexp-propertize-function", + Vparse_sexp_propertize_function, + doc: /* Function to set the `syntax-table' text property. +Called with one argument, the position at which the property is needed. +After running it, `parse-sexp-propertize-done' should be strictly greater +than the argument passed. */); + /* Note: Qnil is a temporary (and invalid) value; it will be properly set in + syntax.el. */ + Vparse_sexp_propertize_function = Qnil; + words_include_escapes = 0; DEFVAR_BOOL ("words-include-escapes", words_include_escapes, doc: /* Non-nil means `forward-word', etc., should treat escape chars part of words. */); diff --git a/src/syntax.h b/src/syntax.h index bfcb871..9c44181 100644 --- a/src/syntax.h +++ b/src/syntax.h @@ -21,6 +21,7 @@ along with GNU Emacs. If not, see . */ INLINE_HEADER_BEGIN extern void update_syntax_table (ptrdiff_t, EMACS_INT, bool, Lisp_Object); +extern void update_syntax_table_forward (ptrdiff_t, bool, Lisp_Object); /* The standard syntax table is stored where it will automatically be used in all new buffers. */ @@ -52,30 +53,32 @@ enum syntaxcode other side by any char with the same syntaxcode. */ Sstring_fence, /* Starts/ends string which is delimited on the other side by any char with the same syntaxcode. */ - Smax /* Upper bound on codes that are meaningful */ + Smax /* Upper bound on codes that are meaningful. */ }; struct gl_state_s { - Lisp_Object object; /* The object we are scanning. */ - ptrdiff_t start; /* Where to stop. */ - ptrdiff_t stop; /* Where to stop. */ + Lisp_Object object; /* The object we are scanning. */ + ptrdiff_t start; /* Where to stop. */ + ptrdiff_t stop; /* Where to stop. */ bool use_global; /* Whether to use global_code - or c_s_t. */ - Lisp_Object global_code; /* Syntax code of current char. */ - Lisp_Object current_syntax_table; /* Syntax table for current pos. */ - Lisp_Object old_prop; /* Syntax-table prop at prev pos. */ - ptrdiff_t b_property; /* First index where c_s_t is valid. */ + or c_s_t. */ + Lisp_Object global_code; /* Syntax code of current char. */ + Lisp_Object current_syntax_table; /* Syntax table for current pos. */ + Lisp_Object old_prop; /* Syntax-table prop at prev pos. */ + ptrdiff_t b_property; /* First index where c_s_t is valid. */ ptrdiff_t e_property; /* First index where c_s_t is - not valid. */ - INTERVAL forward_i; /* Where to start lookup on forward */ + not valid. */ + bool e_property_truncated; /* true if e_property if was truncated + by parse_sexp_propertize_done. */ + INTERVAL forward_i; /* Where to start lookup on forward. */ INTERVAL backward_i; /* or backward movement. The data in c_s_t is valid between these intervals, and possibly at the intervals too, depending - on: */ + on: */ /* Offset for positions specified to UPDATE_SYNTAX_TABLE. */ ptrdiff_t offset; }; @@ -173,7 +176,7 @@ INLINE void UPDATE_SYNTAX_TABLE_FORWARD (ptrdiff_t charpos) { if (parse_sexp_lookup_properties && charpos >= gl_state.e_property) - update_syntax_table (charpos + gl_state.offset, 1, false, gl_state.object); + update_syntax_table_forward (charpos + gl_state.offset, false, gl_state.object); } /* Make syntax table state (gl_state) good for CHARPOS, assuming it is @@ -201,6 +204,7 @@ INLINE void SETUP_BUFFER_SYNTAX_TABLE (void) { gl_state.use_global = false; + gl_state.e_property_truncated = false; gl_state.current_syntax_table = BVAR (current_buffer, syntax_table); } commit 74baea086d1ea606bae99bfc8c9195c21d5530fc Author: Eli Zaretskii Date: Wed Sep 9 22:06:28 2015 +0300 Fix indentation of an @example in ELisp manual * doc/lispref/syntax.texi (Categories): Untabify the example. (Bug#21448) diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index 90daf34..3ab1e9d 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi @@ -1089,13 +1089,13 @@ and using it in a special category table: @example (defvar special-category-table-for-bidi (let ((category-table (make-category-table)) - (uniprop-table (unicode-property-table-internal 'bidi-class))) + (uniprop-table (unicode-property-table-internal 'bidi-class))) (define-category ?R "Characters of bidi-class R, AL, or RLO" category-table) (map-char-table #'(lambda (key val) - (if (memq val '(R AL RLO)) - (modify-category-entry key ?R category-table))) + (if (memq val '(R AL RLO)) + (modify-category-entry key ?R category-table))) uniprop-table) category-table)) @end example commit 1267e12ba716734195a3bb6667f7ef5807ea0567 Author: Paul Eggert Date: Wed Sep 9 10:47:53 2015 -0700 Define internal-char-font even if --without-x The function is used now even in non-graphical environments. Problem reported by Glenn Morris in: http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00401.html * src/font.c (Finternal_char_font): Move here ... * src/fontset.c (Finternal_char_font): ... from here. diff --git a/src/font.c b/src/font.c index 50b966e..8e06532 100644 --- a/src/font.c +++ b/src/font.c @@ -4472,6 +4472,106 @@ where return val; } +/* Return a description of the font at POSITION in the current buffer. + If the 2nd optional arg CH is non-nil, it is a character to check + the font instead of the character at POSITION. + + For a graphical display, return a cons (FONT-OBJECT . GLYPH-CODE). + FONT-OBJECT is the font for the character at POSITION in the current + buffer. This is computed from all the text properties and overlays + that apply to POSITION. POSITION may be nil, in which case, + FONT-SPEC is the font for displaying the character CH with the + default face. GLYPH-CODE is the glyph code in the font to use for + the character. + + For a text terminal, return a nonnegative integer glyph code for + the character, or a negative integer if the character is not + displayable. Terminal glyph codes are system-dependent integers + that represent displayable characters: for example, on a Linux x86 + console they represent VGA code points. + + It returns nil in the following cases: + + (1) The window system doesn't have a font for the character (thus + it is displayed by an empty box). + + (2) The character code is invalid. + + (3) If POSITION is not nil, and the current buffer is not displayed + in any window. + + (4) For a text terminal, the terminal does not report glyph codes. + + In addition, the returned font name may not take into account of + such redisplay engine hooks as what used in jit-lock-mode if + POSITION is currently not visible. */ + + +DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0, + doc: /* For internal use only. */) + (Lisp_Object position, Lisp_Object ch) +{ + ptrdiff_t pos, pos_byte, dummy; + int face_id; + int c; + struct frame *f; + + if (NILP (position)) + { + CHECK_CHARACTER (ch); + c = XINT (ch); + f = XFRAME (selected_frame); + face_id = lookup_basic_face (f, DEFAULT_FACE_ID); + pos = -1; + } + else + { + Lisp_Object window; + struct window *w; + + CHECK_NUMBER_COERCE_MARKER (position); + if (! (BEGV <= XINT (position) && XINT (position) < ZV)) + args_out_of_range_3 (position, make_number (BEGV), make_number (ZV)); + pos = XINT (position); + pos_byte = CHAR_TO_BYTE (pos); + if (NILP (ch)) + c = FETCH_CHAR (pos_byte); + else + { + CHECK_NATNUM (ch); + c = XINT (ch); + } + window = Fget_buffer_window (Fcurrent_buffer (), Qnil); + if (NILP (window)) + return Qnil; + w = XWINDOW (window); + f = XFRAME (w->frame); + face_id = face_at_buffer_position (w, pos, &dummy, + pos + 100, false, -1); + } + if (! CHAR_VALID_P (c)) + return Qnil; + + if (! FRAME_WINDOW_P (f)) + return terminal_glyph_code (FRAME_TERMINAL (f), c); + + /* We need the basic faces to be valid below, so recompute them if + some code just happened to clear the face cache. */ + if (FRAME_FACE_CACHE (f)->used == 0) + recompute_basic_faces (f); + + face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil); + struct face *face = FACE_FROM_ID (f, face_id); + if (! face->font) + return Qnil; + unsigned code = face->font->driver->encode_char (face->font, c); + if (code == FONT_INVALID_CODE) + return Qnil; + Lisp_Object font_object; + XSETFONT (font_object, face->font); + return Fcons (font_object, INTEGER_TO_CONS (code)); +} + #if 0 DEFUN ("font-drive-otf", Ffont_drive_otf, Sfont_drive_otf, 6, 6, 0, @@ -5229,6 +5329,7 @@ syms_of_font (void) defsubr (&Sclear_font_cache); defsubr (&Sfont_shape_gstring); defsubr (&Sfont_variation_glyphs); + defsubr (&Sinternal_char_font); #if 0 defsubr (&Sfont_drive_otf); defsubr (&Sfont_otf_alternates); diff --git a/src/fontset.c b/src/fontset.c index f8334f1..e735989 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -1786,107 +1786,6 @@ update_auto_fontset_alist (Lisp_Object font_object, Lisp_Object fontset) } } -/* Return a description of the font at POSITION in the current buffer. - If the 2nd optional arg CH is non-nil, it is a character to check - the font instead of the character at POSITION. - - For a graphical display, return a cons (FONT-OBJECT . GLYPH-CODE). - FONT-OBJECT is the font for the character at POSITION in the current - buffer. This is computed from all the text properties and overlays - that apply to POSITION. POSITION may be nil, in which case, - FONT-SPEC is the font for displaying the character CH with the - default face. GLYPH-CODE is the glyph code in the font to use for - the character. - - For a text terminal, return a nonnegative integer glyph code for - the character, or a negative integer if the character is not - displayable. Terminal glyph codes are system-dependent integers - that represent displayable characters: for example, on a Linux x86 - console they represent VGA code points. - - It returns nil in the following cases: - - (1) The window system doesn't have a font for the character (thus - it is displayed by an empty box). - - (2) The character code is invalid. - - (3) If POSITION is not nil, and the current buffer is not displayed - in any window. - - (4) For a text terminal, the terminal does not report glyph codes. - - In addition, the returned font name may not take into account of - such redisplay engine hooks as what used in jit-lock-mode if - POSITION is currently not visible. */ - - -DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0, - doc: /* For internal use only. */) - (Lisp_Object position, Lisp_Object ch) -{ - ptrdiff_t pos, pos_byte, dummy; - int face_id; - int c; - struct frame *f; - struct face *face; - - if (NILP (position)) - { - CHECK_CHARACTER (ch); - c = XINT (ch); - f = XFRAME (selected_frame); - face_id = lookup_basic_face (f, DEFAULT_FACE_ID); - pos = -1; - } - else - { - Lisp_Object window; - struct window *w; - - CHECK_NUMBER_COERCE_MARKER (position); - if (! (BEGV <= XINT (position) && XINT (position) < ZV)) - args_out_of_range_3 (position, make_number (BEGV), make_number (ZV)); - pos = XINT (position); - pos_byte = CHAR_TO_BYTE (pos); - if (NILP (ch)) - c = FETCH_CHAR (pos_byte); - else - { - CHECK_NATNUM (ch); - c = XINT (ch); - } - window = Fget_buffer_window (Fcurrent_buffer (), Qnil); - if (NILP (window)) - return Qnil; - w = XWINDOW (window); - f = XFRAME (w->frame); - face_id = face_at_buffer_position (w, pos, &dummy, - pos + 100, false, -1); - } - if (! CHAR_VALID_P (c)) - return Qnil; - if (!FRAME_WINDOW_P (f)) - return terminal_glyph_code (FRAME_TERMINAL (f), c); - /* We need the basic faces to be valid below, so recompute them if - some code just happened to clear the face cache. */ - if (FRAME_FACE_CACHE (f)->used == 0) - recompute_basic_faces (f); - face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil); - face = FACE_FROM_ID (f, face_id); - if (face->font) - { - unsigned code = face->font->driver->encode_char (face->font, c); - Lisp_Object font_object; - - if (code == FONT_INVALID_CODE) - return Qnil; - XSETFONT (font_object, face->font); - return Fcons (font_object, INTEGER_TO_CONS (code)); - } - return Qnil; -} - DEFUN ("fontset-info", Ffontset_info, Sfontset_info, 1, 2, 0, doc: /* Return information about a fontset FONTSET on frame FRAME. @@ -2254,7 +2153,6 @@ at the vertical center of lines. */); defsubr (&Squery_fontset); defsubr (&Snew_fontset); defsubr (&Sset_fontset_font); - defsubr (&Sinternal_char_font); defsubr (&Sfontset_info); defsubr (&Sfontset_font); defsubr (&Sfontset_list); commit 88694fb65887ebc2fde9dea18c817e08be26b564 Author: Stefan Monnier Date: Wed Sep 9 13:18:11 2015 -0400 * lisp/emacs-lisp/cl-generic.el (cl-generic-generalizers): Remove warning diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index c012a30..dd01ebe 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el @@ -1069,8 +1069,11 @@ The value returned is a list of elements of the form (or (and (assq type cl--generic-typeof-types) (progn - (if (memq type '(vector array sequence)) - (message "`%S' also matches CL structs and EIEIO classes" type)) + ;; FIXME: While this wrinkle in the semantics can be occasionally + ;; problematic, this warning is more often annoying than helpful. + ;;(if (memq type '(vector array sequence)) + ;; (message "`%S' also matches CL structs and EIEIO classes" + ;; type)) (list cl--generic-typeof-generalizer))) (cl-call-next-method))) commit 17fff76fea2b15a52d03f74d2dedbaec58330a4f Author: Eli Zaretskii Date: Wed Sep 9 18:56:06 2015 +0300 Fix display of complex local data types in GDB-MI * lisp/progmodes/gdb-mi.el (gdb-locals-handler-custom): If a variable has no value, display "" as a placeholder, instead of a confusing "nil". (Bug#21438) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 1eff62c..3860c81 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -4038,6 +4038,8 @@ member." (let ((name (bindat-get-field local 'name)) (value (bindat-get-field local 'value)) (type (bindat-get-field local 'type))) + (when (not value) + (setq value "")) (if (or (not value) (string-match "\\0x" value)) (add-text-properties 0 (length name) commit 765dcc709c6bbb0ae246e5f680daa585f3f53573 Author: Oleh Krehel Date: Wed Sep 9 15:09:31 2015 +0200 Remove redundant redefinition of seq-drop-while from seq.el * lisp/emacs-lisp/seq.el (seq-drop-while): Define only once. diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 8dc9147..751c18f 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -417,13 +417,7 @@ If no element is found, return nil." (nreverse result))) (cl-defmethod seq-drop-while (pred (list list)) - "Optimized implementation of `seq-drop-while' for lists" - (while (and list (funcall pred (car list))) - (setq list (cdr list))) - list) - -(cl-defmethod seq-drop-while (pred (list list)) - "Optimized implementation of `seq-drop-while' for lists" + "Optimized implementation of `seq-drop-while' for lists." (while (and list (funcall pred (car list))) (setq list (cdr list))) list) commit b074436925a0fe8329ef86d0a36238f5c593888c Author: Phil Sainty Date: Tue Sep 8 02:15:53 2015 +1200 * lisp/emacs-lisp/package.el (package--ensure-init-file) More robust check for `package-initialize' calls in init file. This function accepts an optional argument, but calls passing an argument would not have been detected. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index b0d2ff9..eb66e8f 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1852,12 +1852,12 @@ add a call to it along with some explanatory comments." (save-restriction (widen) (goto-char (point-min)) - (search-forward "(package-initialize)" nil 'noerror)))) + (re-search-forward "(package-initialize\\_>" nil 'noerror)))) ;; Don't visit the file if we don't have to. (with-temp-buffer (insert-file-contents user-init-file) (goto-char (point-min)) - (search-forward "(package-initialize)" nil 'noerror))))) + (re-search-forward "(package-initialize\\_>" nil 'noerror))))) (unless contains-init (with-current-buffer (or buffer (let ((delay-mode-hooks t)) commit b6c8cb57fc23f46d431ffc372abff9d8b2ed486c Author: Paul Eggert Date: Wed Sep 9 03:36:08 2015 -0700 Port movemail to RHEL 6 with --enable-gcc-warnings * lib-src/movemail.c (main): Declare local only if needed. diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 231bc22..c25db62 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -174,8 +174,6 @@ main (int argc, char **argv) int desc; #endif /* not MAIL_USE_SYSTEM_LOCK */ - char *spool_name = 0; - #ifdef MAIL_USE_POP bool pop_reverse_order = false; # define ARGSTR "pr" @@ -247,6 +245,10 @@ main (int argc, char **argv) char *lockname = 0; +#ifdef MAIL_USE_MAILLOCK + char *spool_name = 0; +#endif + #ifndef MAIL_USE_SYSTEM_LOCK #ifdef MAIL_USE_MAILLOCK spool_name = mail_spool_name (inname); commit c28542c29fde8c6862429a6b7180e2434f2e4ea4 Author: Paul Eggert Date: Wed Sep 9 03:23:46 2015 -0700 Port recent Linux console changes to RHEL 6 * src/terminal.c [HAVE_LINUX_KD_H]: Include . diff --git a/src/terminal.c b/src/terminal.c index 817da75..d7c16d9 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -31,6 +31,7 @@ along with GNU Emacs. If not, see . */ #ifdef HAVE_LINUX_KD_H # include # include +# include #endif /* Chain of all terminals currently in use. */ commit 881b4f4bbf6f6ef0c90a5a5561941dfc3da7bd39 Author: Paul Eggert Date: Wed Sep 9 02:47:53 2015 -0700 ; Fix stray quote inserted in comment diff --git a/src/terminal.c b/src/terminal.c index 15d74f4..817da75 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -198,7 +198,7 @@ ins_del_lines (struct frame *f, int vpos, int n) } /* Return the terminal object specified by TERMINAL. TERMINAL may -” be a terminal object, a frame, or nil for the terminal device of + be a terminal object, a frame, or nil for the terminal device of the current frame. If TERMINAL is neither from the above or the resulting terminal object is deleted, return NULL. */ commit 6e5d81ff4536ed117dfac269357c46dbdc1890c9 Author: Paul Eggert Date: Wed Sep 9 02:21:16 2015 -0700 Improvements for curved quotes on Linux consule This should help Emacs work better out-of-the-box on Linux consoles, which have only limited support for displaying Unicode characters. Also, undo the recent change that caused text-quoting-style to affect quote display on terminals, so that the two features are independent. See Alan Mackenzie in: http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00244.html Finally, add a style parameter to startup--setup-quote-display, so that this function can also be invoked after startup, with different styles depending on user preference at the time. * configure.ac: Check for linux/kd.h header. * doc/emacs/display.texi (Text Display): Document quote display. * doc/lispref/display.texi (Active Display Table): * etc/NEWS: * lisp/startup.el (startup--setup-quote-display, command-line): text-quoting-style no longer affects quote display. * doc/lispref/frames.texi (Terminal Parameters): Fix typo. * lisp/international/mule-util.el (char-displayable-p): * lisp/startup.el (startup--setup-quote-display): On a text terminal supporting glyph codes, use the reported glyph codes instead of the terminal coding system, as this is more accurate on the Linux console. * lisp/startup.el (startup--setup-quote-display): New optional arg STYLE. * src/fontset.c (Finternal_char_font): Report glyph codes for a text terminal, if they are available. Currently this is supported only for the Linux console. * src/termhooks.h (struct terminal): New member glyph-code-table. * src/terminal.c [HAVE_LINUX_KD_H]: Include , . (calculate_glyph_code_table) [HAVE_LINUX_KD_H]: New function. (terminal_glyph_code): New function. diff --git a/configure.ac b/configure.ac index 9f8089f..cd828de 100644 --- a/configure.ac +++ b/configure.ac @@ -1582,6 +1582,7 @@ fi dnl checks for header files AC_CHECK_HEADERS_ONCE( + linux/kd.h sys/systeminfo.h sys/sysinfo.h coff.h pty.h diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 601a40b..92b0002 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -1480,6 +1480,15 @@ customizing the variable @code{glyphless-char-display-control}. @xref{Glyphless Chars,, Glyphless Character Display, elisp, The Emacs Lisp Reference Manual}, for details. +@cindex curly quotes +@cindex curved quotes +@cindex escape-glyph face + If the curved quotes @samp{‘}, @samp{’}, @samp{“}, and @samp{”} are +known to look just like @acronym{ASCII} characters, they are shown +with the @code{escape-glyph} face. Curved quotes that cannot be +displayed are shown as their @acronym{ASCII} approximations @samp{`}, +@samp{'}, and @samp{"} with the @code{escape-glyph} face. + @node Cursor Display @section Displaying the Cursor @cindex text cursor diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 14e2cd3..b5ff9cb 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -6533,10 +6533,8 @@ used when Emacs is displaying a buffer in a window with neither a window display table nor a buffer display table defined, or when Emacs is outputting text to the standard output or error streams. Although its default is typically @code{nil}, in an interactive session if the -locale cannot display curved quotes, or if the initial value of -@code{text-quoting-style} specifies a preference for ASCII, its -default maps curved quotes to ASCII approximations. @xref{Keys in -Documentation}. +terminal cannot display curved quotes, its default maps curved quotes +to ASCII approximations. @xref{Keys in Documentation}. @end defvar The @file{disp-table} library defines several functions for changing diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 16fc495..23590af 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -1781,7 +1781,7 @@ symbol) of @var{terminal}. If @var{terminal} has no setting for @end defun @defun set-terminal-parameter terminal parameter value -This function sets the parameter @var{parm} of @var{terminal} to the +This function sets the parameter @var{parameter} of @var{terminal} to the specified @var{value}, and returns the previous value of that parameter. @end defun diff --git a/etc/NEWS b/etc/NEWS index 8a08a06..2f2bd15 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1125,8 +1125,7 @@ integers. of the Emacs process to binary I/O mode. ** ASCII approximations to curved quotes are put in standard-display-table -if the locale cannot display curved quotes, or if text-quoting-style -initially specifies a preference for ASCII. +if the terminal cannot display curved quotes. ** Standard output and error streams now transliterate characters via standard-display-table, and encode output using locale-coding-system. diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el index f3aa70f..9025863 100644 --- a/lisp/international/mule-util.el +++ b/lisp/international/mule-util.el @@ -273,43 +273,48 @@ per-character basis, this may not be accurate." ((not enable-multibyte-characters) ;; Maybe there's a font for it, but we can't put it in the buffer. nil) - ((display-multi-font-p) - ;; On a window system, a character is displayable if we have - ;; a font for that character in the default face of the - ;; currently selected frame. - (car (internal-char-font nil char))) (t - ;; On a terminal, a character is displayable if the coding - ;; system for the terminal can encode it. - (let ((coding (terminal-coding-system))) - (when coding - (let ((cs-list (coding-system-get coding :charset-list))) - (cond - ((listp cs-list) - (catch 'tag - (mapc #'(lambda (charset) - (if (encode-char char charset) - (throw 'tag charset))) - cs-list) - nil)) - ((eq cs-list 'iso-2022) - (catch 'tag2 - (mapc #'(lambda (charset) - (if (and (plist-get (charset-plist charset) - :iso-final-char) - (encode-char char charset)) - (throw 'tag2 charset))) - charset-list) - nil)) - ((eq cs-list 'emacs-mule) - (catch 'tag3 - (mapc #'(lambda (charset) - (if (and (plist-get (charset-plist charset) - :emacs-mule-id) - (encode-char char charset)) - (throw 'tag3 charset))) - charset-list) - nil))))))))) + (let ((font-glyph (internal-char-font nil char))) + (if font-glyph + (if (consp font-glyph) + ;; On a window system, a character is displayable + ;; if a font for that character is in the default + ;; face of the currently selected frame. + (car font-glyph) + ;; On a text terminal supporting glyph codes, CHAR is + ;; displayable if its glyph code is nonnegative. + (<= 0 font-glyph)) + ;; On a teext terminal without glyph codes, CHAR is displayable + ;; if the coding system for the terminal can encode it. + (let ((coding (terminal-coding-system))) + (when coding + (let ((cs-list (coding-system-get coding :charset-list))) + (cond + ((listp cs-list) + (catch 'tag + (mapc #'(lambda (charset) + (if (encode-char char charset) + (throw 'tag charset))) + cs-list) + nil)) + ((eq cs-list 'iso-2022) + (catch 'tag2 + (mapc #'(lambda (charset) + (if (and (plist-get (charset-plist charset) + :iso-final-char) + (encode-char char charset)) + (throw 'tag2 charset))) + charset-list) + nil)) + ((eq cs-list 'emacs-mule) + (catch 'tag3 + (mapc #'(lambda (charset) + (if (and (plist-get (charset-plist charset) + :emacs-mule-id) + (encode-char char charset)) + (throw 'tag3 charset))) + charset-list) + nil))))))))))) (defun filepos-to-bufferpos--dos (byte f) (let ((eol-offset 0) diff --git a/lisp/startup.el b/lisp/startup.el index 9caf485..971841f 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -803,19 +803,61 @@ to prepare for opening the first frame (e.g. open a connection to an X server)." (defvar server-name) (defvar server-process) -(defun startup--setup-quote-display () - "Display ASCII approximations on user request or if curved quotes don't work." - (when (memq text-quoting-style '(nil grave straight)) - (dolist (char-repl '((?‘ . ?\`) (?’ . ?\') (?“ . ?\") (?” . ?\"))) - (let ((char (car char-repl)) - (repl (cdr char-repl))) - (when (or text-quoting-style (not (char-displayable-p char))) - (when (and (eq repl ?\`) (eq text-quoting-style 'straight)) - (setq repl ?\')) - (unless standard-display-table - (setq standard-display-table (make-display-table))) - (aset standard-display-table char - (vector (make-glyph-code repl 'shadow)))))))) +(defun startup--setup-quote-display (&optional style) + "If needed, display ASCII approximations to curved quotes. +Do this by modifying `standard-display-table'. Optional STYLE +specifies the desired quoting style, as in `text-quoting-style'. +If STYLE is nil, display appropriately for the terminal." + (let ((repls (let ((style-repls (assq style '((grave . "`'\"\"") + (straight . "''\"\""))))) + (if style-repls (cdr style-repls) (make-vector 4 nil)))) + glyph-count) + ;; REPLS is a sequence of the four replacements for "‘’“”", respectively. + ;; If STYLE is nil, infer REPLS from terminal characteristics. + (unless style + ;; On a terminal that supports glyph codes, + ;; GLYPH-COUNT[i] is the number of times that glyph code I + ;; represents either an ASCII character or one of the 4 + ;; quote characters. This assumes glyph codes are valid + ;; Elisp characters, which is a safe assumption in practice. + (when (integerp (internal-char-font nil (max-char))) + (setq glyph-count (make-char-table nil 0)) + (dotimes (i 132) + (let ((glyph (internal-char-font + nil (if (< i 128) i (aref "‘’“”" (- i 128)))))) + (when (<= 0 glyph) + (aset glyph-count glyph (1+ (aref glyph-count glyph))))))) + (dotimes (i 2) + (let ((lq (aref "‘“" i)) (rq (aref "’”" i)) + (lr (aref "`\"" i)) (rr (aref "'\"" i)) + (i2 (* i 2))) + (unless (if glyph-count + ;; On a terminal that supports glyph codes, use + ;; ASCII replacements unless both quotes are displayable. + ;; If not using ASCII replacements, highlight + ;; quotes unless they are both unique among the + ;; 128 + 4 characters of concern. + (let ((lglyph (internal-char-font nil lq)) + (rglyph (internal-char-font nil rq))) + (when (and (<= 0 lglyph) (<= 0 rglyph)) + (setq lr lq rr rq) + (and (= 1 (aref glyph-count lglyph)) + (= 1 (aref glyph-count rglyph))))) + ;; On a terminal that does not support glyph codes, use + ;; ASCII replacements unless both quotes are displayable. + (and (char-displayable-p lq) + (char-displayable-p rq))) + (aset repls i2 lr) + (aset repls (1+ i2) rr))))) + (dotimes (i 4) + (let ((char (aref "‘’“”" i)) + (repl (aref repls i))) + (if repl + (aset (or standard-display-table + (setq standard-display-table (make-display-table))) + char (vector (make-glyph-code repl 'escape-glyph))) + (when standard-display-table + (aset standard-display-table char nil))))))) (defun command-line () "A subroutine of `normal-top-level'. @@ -1239,11 +1281,6 @@ the `--debug-init' option to view a complete error backtrace." ;; unibyte (display table, terminal coding system &c). (set-language-environment current-language-environment))) - ;; Setup quote display again, if the init file sets - ;; text-quoting-style to a non-nil value. - (when (and (not noninteractive) text-quoting-style) - (startup--setup-quote-display)) - ;; Do this here in case the init file sets mail-host-address. (if (equal user-mail-address "") (setq user-mail-address (or (getenv "EMAIL") diff --git a/src/fontset.c b/src/fontset.c index 50fcc64..f8334f1 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -1786,18 +1786,23 @@ update_auto_fontset_alist (Lisp_Object font_object, Lisp_Object fontset) } } +/* Return a description of the font at POSITION in the current buffer. + If the 2nd optional arg CH is non-nil, it is a character to check + the font instead of the character at POSITION. -/* Return a cons (FONT-OBJECT . GLYPH-CODE). + For a graphical display, return a cons (FONT-OBJECT . GLYPH-CODE). FONT-OBJECT is the font for the character at POSITION in the current buffer. This is computed from all the text properties and overlays that apply to POSITION. POSITION may be nil, in which case, FONT-SPEC is the font for displaying the character CH with the - default face. + default face. GLYPH-CODE is the glyph code in the font to use for + the character. - GLYPH-CODE is the glyph code in the font to use for the character. - - If the 2nd optional arg CH is non-nil, it is a character to check - the font instead of the character at POSITION. + For a text terminal, return a nonnegative integer glyph code for + the character, or a negative integer if the character is not + displayable. Terminal glyph codes are system-dependent integers + that represent displayable characters: for example, on a Linux x86 + console they represent VGA code points. It returns nil in the following cases: @@ -1809,6 +1814,8 @@ update_auto_fontset_alist (Lisp_Object font_object, Lisp_Object fontset) (3) If POSITION is not nil, and the current buffer is not displayed in any window. + (4) For a text terminal, the terminal does not report glyph codes. + In addition, the returned font name may not take into account of such redisplay engine hooks as what used in jit-lock-mode if POSITION is currently not visible. */ @@ -1860,7 +1867,7 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0, if (! CHAR_VALID_P (c)) return Qnil; if (!FRAME_WINDOW_P (f)) - return Qnil; + return terminal_glyph_code (FRAME_TERMINAL (f), c); /* We need the basic faces to be valid below, so recompute them if some code just happened to clear the face cache. */ if (FRAME_FACE_CACHE (f)->used == 0) diff --git a/src/termhooks.h b/src/termhooks.h index 168bc35..88c62df 100644 --- a/src/termhooks.h +++ b/src/termhooks.h @@ -383,6 +383,11 @@ struct terminal the selection-values. */ Lisp_Object Vselection_alist; + /* If a char-table, this maps characters to terminal glyph codes. + If t, the mapping is not available. If nil, it is not known + whether the mapping is available. */ + Lisp_Object glyph_code_table; + /* All fields before `next_terminal' should be Lisp_Object and are traced by the GC. All fields afterwards are ignored by the GC. */ @@ -690,6 +695,7 @@ extern struct terminal *get_named_terminal (const char *); extern struct terminal *create_terminal (enum output_method, struct redisplay_interface *); extern void delete_terminal (struct terminal *); +extern Lisp_Object terminal_glyph_code (struct terminal *, int); /* The initial terminal device, created by initial_term_init. */ extern struct terminal *initial_terminal; diff --git a/src/terminal.c b/src/terminal.c index b48d062..15d74f4 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -28,6 +28,11 @@ along with GNU Emacs. If not, see . */ #include "coding.h" #include "keyboard.h" +#ifdef HAVE_LINUX_KD_H +# include +# include +#endif + /* Chain of all terminals currently in use. */ struct terminal *terminal_list; @@ -193,7 +198,7 @@ ins_del_lines (struct frame *f, int vpos, int n) } /* Return the terminal object specified by TERMINAL. TERMINAL may - be a terminal object, a frame, or nil for the terminal device of +” be a terminal object, a frame, or nil for the terminal device of the current frame. If TERMINAL is neither from the above or the resulting terminal object is deleted, return NULL. */ @@ -526,6 +531,65 @@ selected frame's terminal). */) return store_terminal_param (decode_live_terminal (terminal), parameter, value); } +#if HAVE_LINUX_KD_H + +/* Compute the glyph code table for T. */ + +static void +calculate_glyph_code_table (struct terminal *t) +{ + Lisp_Object glyphtab = Qt; + enum { initial_unipairs = 1000 }; + int entry_ct = initial_unipairs; + struct unipair unipair_buffer[initial_unipairs]; + struct unipair *entries = unipair_buffer; + struct unipair *alloced = 0; + + while (true) + { + int fd = fileno (t->display_info.tty->output); + struct unimapdesc unimapdesc = { entry_ct, entries }; + if (ioctl (fd, GIO_UNIMAP, &unimapdesc) == 0) + { + glyphtab = Fmake_char_table (Qnil, make_number (-1)); + for (int i = 0; i < unimapdesc.entry_ct; i++) + char_table_set (glyphtab, entries[i].unicode, + make_number (entries[i].fontpos)); + break; + } + if (errno != ENOMEM) + break; + entry_ct = unimapdesc.entry_ct; + entries = alloced = xrealloc (alloced, entry_ct * sizeof *alloced); + } + + xfree (alloced); + t->glyph_code_table = glyphtab; +} +#endif + +/* Return the glyph code in T of character CH, or -1 if CH does not + have a font position in T, or nil if T does not report glyph codes. */ + +Lisp_Object +terminal_glyph_code (struct terminal *t, int ch) +{ +#if HAVE_LINUX_KD_H + if (t->type == output_termcap) + { + /* As a hack, recompute the table when CH is the maximum + character. */ + if (NILP (t->glyph_code_table) || ch == MAX_CHAR) + calculate_glyph_code_table (t); + + if (! EQ (t->glyph_code_table, Qt)) + return char_table_ref (t->glyph_code_table, ch); + } +#endif + + return Qnil; +} + /* Initial frame has no device-dependent output data, but has face cache which should be freed when the frame is deleted. */