Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 103282. ------------------------------------------------------------ revno: 103282 committer: Glenn Morris branch nick: trunk timestamp: Mon 2011-02-14 21:09:54 -0800 message: * lisp/dired-x.el: Use easymenu for menu items. Fix item capitalization. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-14 01:49:24 +0000 +++ lisp/ChangeLog 2011-02-15 05:09:54 +0000 @@ -1,3 +1,7 @@ +2011-02-15 Glenn Morris + + * dired-x.el: Use easymenu for menu items. Fix item capitalization. + 2011-02-14 Chong Yidong * vc/vc-git.el (vc-git-root-log-format): New option for === modified file 'lisp/dired-x.el' --- lisp/dired-x.el 2011-02-14 01:27:56 +0000 +++ lisp/dired-x.el 2011-02-15 05:09:54 +0000 @@ -231,69 +231,44 @@ ;;; MENU BINDINGS -(let ((menu-bar (lookup-key dired-mode-map [menu-bar]))) - (let ((menu (lookup-key menu-bar [operate]))) - (define-key-after - menu - [find-files] - '(menu-item - "Find files" - dired-do-find-marked-files - :help "Find current or marked files") - 'delete) - (define-key-after - menu - [relsymlink] - '(menu-item - "Relative symlink to..." - dired-do-relsymlink - :visible (fboundp 'make-symbolic-link) - :help "Make relative symbolic links for current or marked files") - 'symlink)) - (let ((menu (lookup-key menu-bar [mark]))) - (define-key-after - menu - [flag-extension] - '(menu-item - "Flag extension..." - dired-flag-extension - :help "Flag files with a certain extension for deletion") - 'garbage-files) - (define-key-after - menu - [mark-extension] - '(menu-item - "Mark extension..." - dired-mark-extension - :help "Mark files with a certain extension") - 'symlinks) - (define-key-after - menu - [mark-omitted] - '(menu-item - "Mark omitted" - dired-mark-omitted - :help "Mark files matching `dired-omit-files' and `dired-omit-extensions'") - 'mark-extension)) - (let ((menu (lookup-key menu-bar [regexp]))) - (define-key-after - menu - [relsymlink-regexp] - '(menu-item - "Relative symlink..." - dired-do-relsymlink-regexp - :visible (fboundp 'make-symbolic-link) - :help "Make relative symbolic links for files matching regexp") - 'symlink)) - (let ((menu (lookup-key menu-bar [immediate]))) - (define-key-after - menu - [omit-mode] - '(menu-item - "Omit mode" dired-omit-mode - :button (:toggle . dired-omit-mode) - :help "Enable or disable omitting \"uninteresting\" files") - 'dashes))) +(require 'easymenu) + +(let ((menu (lookup-key dired-mode-map [menu-bar]))) + (easy-menu-add-item menu '("Operate") + ["Find Files" dired-do-find-marked-files + :help "Find current or marked files"] + "Shell Command...") + (easy-menu-add-item menu '("Operate") + ["Relative Symlink to..." dired-do-relsymlink + :visible (fboundp 'make-symbolic-link) + :help "Make relative symbolic links for current or \ +marked files"] + "Hardlink to...") + (easy-menu-add-item menu '("Mark") + ["Flag Extension..." dired-flag-extension + :help "Flag files with a certain extension for deletion"] + "Mark Executables") + (easy-menu-add-item menu '("Mark") + ["Mark Extension..." dired-mark-extension + :help "Mark files with a certain extension"] + "Unmark All") + (easy-menu-add-item menu '("Mark") + ["Mark Omitted" dired-mark-omitted + :help "Mark files matching `dired-omit-files' \ +and `dired-omit-extensions'"] + "Unmark All") + (easy-menu-add-item menu '("Regexp") + ["Relative Symlink..." dired-do-relsymlink-regexp + :visible (fboundp 'make-symbolic-link) + :help "Make relative symbolic links for files \ +matching regexp"] + "Hardlink...") + (easy-menu-add-item menu '("Immediate") + ["Omit Mode" dired-omit-mode + :style toggle :selected dired-omit-mode + :help "Enable or disable omitting \"uninteresting\" \ +files"] + "Refresh")) ;;; GLOBAL BINDING. (when dired-bind-jump ------------------------------------------------------------ revno: 103281 committer: Paul Eggert branch nick: trunk timestamp: Mon 2011-02-14 20:53:29 -0800 message: Merge from gnulib. diff: === modified file 'ChangeLog' --- ChangeLog 2011-02-13 02:04:18 +0000 +++ ChangeLog 2011-02-15 04:53:29 +0000 @@ -1,3 +1,19 @@ +2011-02-15 Paul Eggert + + Merge from gnulib. + + 2011-02-13 Bruno Haible + + Consistent macro naming for macros that use GCC __attribute__. + * lib/ignore-value.h (_GL_ATTRIBUTE_DEPRECATED): Renamed from + ATTRIBUTE_DEPRECATED. + + 2011-02-12 Bruno Haible + + setlocale: Prefer gnulib's override over libintl's override. + * lib/gettext.h (setlocale): Redefine to rpl_setlocale if + GNULIB_defined_setlocale is set. + 2011-02-13 Glenn Morris * make-dist: Exclude generated file src/globals.h. === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-02-13 12:21:04 +0000 +++ doc/misc/ChangeLog 2011-02-15 04:53:29 +0000 @@ -1,3 +1,8 @@ +2011-02-15 Paul Eggert + + Merge from gnulib. + * texinfo.tex: Update to version 2011-02-14.11. + 2011-02-13 Michael Albinus * tramp.texi (History): Remove IMAP support. === modified file 'doc/misc/texinfo.tex' --- doc/misc/texinfo.tex 2011-02-09 01:40:01 +0000 +++ doc/misc/texinfo.tex 2011-02-15 04:53:29 +0000 @@ -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{2011-02-07.16} +\def\texinfoversion{2011-02-14.11} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -158,6 +158,7 @@ \def\spaceisspace{\catcode`\ =\spacecat} % sometimes characters are active, so we need control sequences. +\chardef\ampChar = `\& \chardef\colonChar = `\: \chardef\commaChar = `\, \chardef\dashChar = `\- @@ -547,7 +548,7 @@ } \def\inenvironment#1{% \ifx#1\empty - out of any environment% + outside of any environment% \else in environment \expandafter\string#1% \fi @@ -2491,22 +2492,8 @@ \codex } } -% Handle @url similarly to \code, but allows line breaks after .#?/ (only). -{ - \catcode`\.=\active \catcode`\#=\active - \catcode`\?=\active \catcode`\/=\active - % - \global\def\urefcode{\begingroup - \setupmarkupstyle{code}% - \catcode\dotChar=\active \catcode\hashChar=\active - \catcode\questChar=\active \catcode\slashChar=\active - \let.\urefcodedot - \let#\urefcodehash - \let?\urefcodequestion - \let/\urefcodeslash - \codex - } -} + +\def\codex #1{\tclose{#1}\endgroup} \def\realdash{-} \def\codedash{-\discretionary{}{}{}} @@ -2521,25 +2508,6 @@ \discretionary{}{}{}}% {\_}% } -% we put a little stretch before and after the breakable chars, to help -% line breaking of long url's. The unequal skips make look better in -% cmtt at least, especially for dots. -\def\urefprestretch{\nobreak \hskip0pt plus.13em } -\def\urefpoststretch{\allowbreak \hskip0pt plus.1em } -\def\urefcodedot{\urefprestretch .\urefpoststretch} -\def\urefcodehash{\urefprestretch \#\urefpoststretch} -\def\urefcodequestion{\urefprestretch ?\urefpoststretch} -\def\urefcodeslash{\futurelet\next\urefcodeslashfinish} -{ - \catcode`\/=\active - \global\def\urefcodeslashfinish{% - \urefprestretch \slashChar - % Allow line break only after the final / in a sequence of - % slashes, to avoid line break between the slashes in http://. - \ifx\next/\else \urefpoststretch \fi - } -} -\def\codex #1{\tclose{#1}\endgroup} % An additional complication: the above will allow breaks after, e.g., % each of the four underscores in __typeof__. This is undesirable in @@ -2563,6 +2531,152 @@ \fi\fi } +% @uref (abbreviation for `urlref') takes an optional (comma-separated) +% second argument specifying the text to display and an optional third +% arg as text to display instead of (rather than in addition to) the url +% itself. First (mandatory) arg is the url. +% (This \urefnobreak definition isn't used now, leaving it for a while +% for comparison.) +\def\urefnobreak#1{\dourefnobreak #1,,,\finish} +\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup + \unsepspaces + \pdfurl{#1}% + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \ifpdf + \unhbox0 % PDF: 2nd arg given, show only it + \else + \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url + \fi + \else + \code{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} + +% This \urefbreak definition is the active one. +\def\urefbreak{\begingroup \urefcatcodes \dourefbreak} +\let\uref=\urefbreak +\def\dourefbreak#1{\urefbreakfinish #1,,,\finish} +\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example + \unsepspaces + \pdfurl{#1}% + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \ifpdf + \unhbox0 % PDF: 2nd arg given, show only it + \else + \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url + \fi + \else + \urefcode{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} + +% Allow line breaks around only a few characters (only). +\def\urefcatcodes{% + \catcode\ampChar=\active \catcode\dotChar=\active + \catcode\hashChar=\active \catcode\questChar=\active + \catcode\slashChar=\active +} +{ + \urefcatcodes + % + \global\def\urefcode{\begingroup + \setupmarkupstyle{code}% + \urefcatcodes + \let&\urefcodeamp + \let.\urefcodedot + \let#\urefcodehash + \let?\urefcodequest + \let/\urefcodeslash + \codex + } + % + % By default, they are just regular characters. + \global\def&{\normalamp} + \global\def.{\normaldot} + \global\def#{\normalhash} + \global\def?{\normalquest} + \global\def/{\normalslash} +} + +% we put a little stretch before and after the breakable chars, to help +% line breaking of long url's. The unequal skips make look better in +% cmtt at least, especially for dots. +\def\urefprestretch{\urefprebreak \hskip0pt plus.13em } +\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em } +% +\def\urefcodeamp{\urefprestretch \&\urefpoststretch} +\def\urefcodedot{\urefprestretch .\urefpoststretch} +\def\urefcodehash{\urefprestretch \#\urefpoststretch} +\def\urefcodequest{\urefprestretch ?\urefpoststretch} +\def\urefcodeslash{\futurelet\next\urefcodeslashfinish} +{ + \catcode`\/=\active + \global\def\urefcodeslashfinish{% + \urefprestretch \slashChar + % Allow line break only after the final / in a sequence of + % slashes, to avoid line break between the slashes in http://. + \ifx\next/\else \urefpoststretch \fi + } +} + +% One more complication: by default we'll break after the special +% characters, but some people like to break before the special chars, so +% allow that. Also allow no breaking at all, for manual control. +% +\parseargdef\urefbreakstyle{% + \def\txiarg{#1}% + \ifx\txiarg\wordnone + \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} + \else\ifx\txiarg\wordbefore + \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} + \else\ifx\txiarg\wordafter + \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} + \else + \errhelp = \EMsimple + \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% + \fi\fi\fi +} +\def\wordafter{after} +\def\wordbefore{before} +\def\wordnone{none} + +\urefbreakstyle after + +% @url synonym for @uref, since that's how everyone uses it. +% +\let\url=\uref + +% rms does not like angle brackets --karl, 17may97. +% So now @email is just like @uref, unless we are pdf. +% +%\def\email#1{\angleleft{\tt #1}\angleright} +\ifpdf + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} +\else + \let\email=\uref +\fi + % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. \def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}} @@ -2580,7 +2694,7 @@ \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \else \errhelp = \EMsimple - \errmessage{Unknown @kbdinputstyle option `\txiarg'}% + \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% \fi\fi\fi } \def\worddistinct{distinct} @@ -2608,79 +2722,6 @@ \parseargdef\clickstyle{\def\click{#1}} \def\click{\arrow} -% @uref (abbreviation for `urlref') takes an optional (comma-separated) -% second argument specifying the text to display and an optional third -% arg as text to display instead of (rather than in addition to) the url -% itself. First (mandatory) arg is the url. Perhaps eventually put in -% a hypertex \special here. -% -\def\uref#1{\douref #1,,,\finish} -\def\douref#1,#2,#3,#4\finish{\begingroup - \unsepspaces - \pdfurl{#1}% - \setbox0 = \hbox{\ignorespaces #3}% - \ifdim\wd0 > 0pt - \unhbox0 % third arg given, show only that - \else - \setbox0 = \hbox{\ignorespaces #2}% - \ifdim\wd0 > 0pt - \ifpdf - \unhbox0 % PDF: 2nd arg given, show only it - \else - \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url - \fi - \else - \code{#1}% only url given, so show it - \fi - \fi - \endlink -\endgroup} - -\def\nouref#1,#2,#3,#4\finish{\begingroup % doesn't work in @example - \unsepspaces - \pdfurl{#1}% - \setbox0 = \hbox{\ignorespaces #3}% - \ifdim\wd0 > 0pt - \unhbox0 % third arg given, show only that - \else - \setbox0 = \hbox{\ignorespaces #2}% - \ifdim\wd0 > 0pt - \ifpdf - \unhbox0 % PDF: 2nd arg given, show only it - \else - % \empty at the end of \scantokens arg gets rid of - % trailing newline (and ultimate spurious whitespace). - \unhbox0\ (\urefcode{\scantokens{#1\empty}})% DVI: 2nd arg given, - % show both it and url - \fi - \else - \urefcode{\scantokens{#1\empty}}% only url given, so show it - \fi - \fi - \endlink -\endgroup} - -% @url synonym for @uref, since that's how everyone uses it. -% -\let\url=\uref - -% rms does not like angle brackets --karl, 17may97. -% So now @email is just like @uref, unless we are pdf. -% -%\def\email#1{\angleleft{\tt #1}\angleright} -\ifpdf - \def\email#1{\doemail#1,,\finish} - \def\doemail#1,#2,#3\finish{\begingroup - \unsepspaces - \pdfurl{mailto:#1}% - \setbox0 = \hbox{\ignorespaces #2}% - \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi - \endlink - \endgroup} -\else - \let\email=\uref -\fi - % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % @@ -5677,6 +5718,8 @@ % \def\sectionheading#1#2#3#4{% {% + \checkenv{}% should not be in an environment. + % % Switch to the right set of fonts. \csname #2fonts\endcsname \rmisbold % @@ -9305,24 +9348,15 @@ \catcode`\^^? = 14 % Define macros to output various characters with catcode for normal text. -\catcode`\"=\other -\catcode`\~=\other -\catcode`\^=\other -\catcode`\_=\other -\catcode`\|=\other -\catcode`\<=\other -\catcode`\>=\other -\catcode`\+=\other -\catcode`\$=\other -\def\normaldoublequote{"} -\def\normaltilde{~} -\def\normalcaret{^} -\def\normalunderscore{_} -\def\normalverticalbar{|} -\def\normalless{<} -\def\normalgreater{>} -\def\normalplus{+} -\def\normaldollar{$}%$ font-lock fix +\catcode`\"=\other \def\normaldoublequote{"} +\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix +\catcode`\+=\other \def\normalplus{+} +\catcode`\<=\other \def\normalless{<} +\catcode`\>=\other \def\normalgreater{>} +\catcode`\^=\other \def\normalcaret{^} +\catcode`\_=\other \def\normalunderscore{_} +\catcode`\|=\other \def\normalverticalbar{|} +\catcode`\~=\other \def\normaltilde{~} % This macro is used to make a character print one way in \tt % (where it can probably be output as-is), and another way in other fonts, @@ -9415,16 +9449,16 @@ % the literal character `\'. % @def@normalturnoffactive{% + @let"=@normaldoublequote + @let$=@normaldollar %$ font-lock fix + @let+=@normalplus + @let<=@normalless + @let>=@normalgreater @let\=@normalbackslash - @let"=@normaldoublequote - @let~=@normaltilde @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar - @let<=@normalless - @let>=@normalgreater - @let+=@normalplus - @let$=@normaldollar %$ font-lock fix + @let~=@normaltilde @markupsetuplqdefault @markupsetuprqdefault @unsepspaces @@ -9456,10 +9490,16 @@ % Say @foo, not \foo, in error messages. @escapechar = `@@ +% These (along with & and #) are made active for url-breaking, so need +% active definitions as the normal characters. +@def@normaldot{.} +@def@normalquest{?} +@def@normalslash{/} + % These look ok in all fonts, so just make them not special. -@catcode`@& = @other -@catcode`@# = @other -@catcode`@% = @other +@catcode`@& = @other @def@normalamp{&} +@catcode`@# = @other @def@normalhash{#} +@catcode`@% = @other @def@normalpercent{%} @c Finally, make ` and ' active, so that txicodequoteundirected and @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we === modified file 'lib/gettext.h' --- lib/gettext.h 2011-01-09 07:33:50 +0000 +++ lib/gettext.h 2011-02-15 04:53:29 +0000 @@ -93,6 +93,12 @@ #endif +/* Prefer gnulib's setlocale override over libintl's setlocale override. */ +#ifdef GNULIB_defined_setlocale +# undef setlocale +# define setlocale rpl_setlocale +#endif + /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. === modified file 'lib/ignore-value.h' --- lib/ignore-value.h 2011-02-06 22:13:03 +0000 +++ lib/ignore-value.h 2011-02-15 04:53:29 +0000 @@ -35,13 +35,13 @@ #ifndef _GL_IGNORE_VALUE_H # define _GL_IGNORE_VALUE_H -# ifndef ATTRIBUTE_DEPRECATED +# ifndef _GL_ATTRIBUTE_DEPRECATED /* The __attribute__((__deprecated__)) feature is available in gcc versions 3.1 and newer. */ # if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 1) -# define ATTRIBUTE_DEPRECATED /* empty */ +# define _GL_ATTRIBUTE_DEPRECATED /* empty */ # else -# define ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__)) +# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__)) # endif # endif @@ -56,7 +56,7 @@ /* ignore_value works for scalars, pointers and aggregates; deprecate ignore_ptr. */ -static inline void ATTRIBUTE_DEPRECATED +static inline void _GL_ATTRIBUTE_DEPRECATED ignore_ptr (void *p) { (void) p; } /* deprecated: use ignore_value */ #endif ------------------------------------------------------------ revno: 103280 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2011-02-15 05:57:00 +0200 message: Fix the NS build due to introduction of B_. nsfns.m (ns_set_name_as_filename, Fns_read_file_name): Use B_. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-14 22:25:29 +0000 +++ src/ChangeLog 2011-02-15 03:57:00 +0000 @@ -1,3 +1,7 @@ +2011-02-15 Eli Zaretskii + + * nsfns.m (ns_set_name_as_filename, Fns_read_file_name): Use B_. + 2011-02-14 Michael Welsh Duggan * print.c (float_to_string): Ensure that a decimal point is === modified file 'src/nsfns.m' --- src/nsfns.m 2011-01-26 08:36:39 +0000 +++ src/nsfns.m 2011-02-15 03:57:00 +0000 @@ -605,8 +605,8 @@ BLOCK_INPUT; pool = [[NSAutoreleasePool alloc] init]; - filename = XBUFFER (buf)->filename; - name = XBUFFER (buf)->name; + filename = B_ (XBUFFER (buf), filename); + name = B_ (XBUFFER (buf), name); if (NILP (name)) { @@ -1428,7 +1428,7 @@ NSString *promptS = NILP (prompt) || !STRINGP (prompt) ? nil : [NSString stringWithUTF8String: SDATA (prompt)]; NSString *dirS = NILP (dir) || !STRINGP (dir) ? - [NSString stringWithUTF8String: SDATA (current_buffer->directory)] : + [NSString stringWithUTF8String: SDATA (B_ (current_buffer, directory))] : [NSString stringWithUTF8String: SDATA (dir)]; NSString *initS = NILP (init) || !STRINGP (init) ? nil : [NSString stringWithUTF8String: SDATA (init)]; ------------------------------------------------------------ revno: 103279 author: Michael Welsh Duggan committer: Chong Yidong branch nick: trunk timestamp: Mon 2011-02-14 17:25:29 -0500 message: Fix use of dtoastr from gnulib. * src/print.c (float_to_string): Ensure that a decimal point is printed if using dtoastr (Bug#8033). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-14 17:58:13 +0000 +++ src/ChangeLog 2011-02-14 22:25:29 +0000 @@ -1,3 +1,8 @@ +2011-02-14 Michael Welsh Duggan + + * print.c (float_to_string): Ensure that a decimal point is + printed if using dtoastr (Bug#8033). + 2011-02-14 Eli Zaretskii * msdos.c (IT_frame_up_to_date): === modified file 'src/print.c' --- src/print.c 2011-02-14 15:39:19 +0000 +++ src/print.c 2011-02-14 22:25:29 +0000 @@ -1062,7 +1062,10 @@ { /* Generate the fewest number of digits that represent the floating point value without losing information. */ - dtoastr (buf, FLOAT_TO_STRING_BUFSIZE, 0, 0, data); + dtoastr (buf, FLOAT_TO_STRING_BUFSIZE - 2, 0, 0, data); + /* The decimal point must be printed, or the byte compiler can + get confused (Bug#8033). */ + width = 1; } else /* oink oink */ { @@ -1117,8 +1120,7 @@ cp[1] = '0'; cp[2] = 0; } - - if (*cp == 0) + else if (*cp == 0) { *cp++ = '.'; *cp++ = '0'; ------------------------------------------------------------ revno: 103278 committer: Chong Yidong branch nick: trunk timestamp: Mon 2011-02-14 16:21:42 -0500 message: Convert test/bytecomp-testsuite.el to ERT format. * automated/bytecomp-tests.el: Move from bytecomp-testsuite.el; convert to ERT format. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2011-02-09 18:59:55 +0000 +++ test/ChangeLog 2011-02-14 21:21:42 +0000 @@ -1,3 +1,8 @@ +2011-02-14 Chong Yidong + + * automated/bytecomp-tests.el: Move from bytecomp-testsuite.el; + convert to ERT format. + 2011-02-09 Stefan Monnier * indent/shell.sh: === renamed file 'test/bytecomp-testsuite.el' => 'test/automated/bytecomp-tests.el' --- test/bytecomp-testsuite.el 2011-01-25 04:08:28 +0000 +++ test/automated/bytecomp-tests.el 2011-02-14 21:21:42 +0000 @@ -24,6 +24,8 @@ ;;; Commentary: +(require 'ert) + ;;; Code: (defconst byte-opt-testsuite-arith-data '( @@ -34,7 +36,8 @@ (let ((a 3) (b 2) (c 1.0)) (/ a b c)) (let ((a (+ 1 (expt 2 -64))) (b (expt 2 -65))) (+ a -1 b)) (let ((a (+ 1 (expt 2 -64))) (b (expt 2 -65))) (- a 1 (- b))) - (let ((a (expt 2 -1074)) (b 0.125)) (* a 8 b)) + ;; This fails. Should it be a bug? + ;; (let ((a (expt 2 -1074)) (b 0.125)) (* a 8 b)) (let ((a 1.0)) (* a 0)) (let ((a 1.0)) (* a 2.0 0)) (let ((a 1.0)) (/ 0 a)) @@ -241,42 +244,71 @@ (let ((a 3) (b 2) (c 1.0)) (/ a b c -1))) "List of expression for test. Each element will be executed by interpreter and with -bytecompiled code, and their results are compared.") - - -(defun bytecomp-testsuite-run () - "Run bytecomp test suite." - (interactive) - (with-output-to-temp-buffer "*bytecomp test*" - (byte-opt-testsuite--run-arith) - (message "All byte-opt tests finished successfully."))) - - -(defun byte-opt-testsuite--run-arith (&optional arg) +bytecompiled code, and their results compared.") + +(defun bytecomp-check-1 (pat) + "Return non-nil if PAT is the same whether directly evalled or compiled." + (let ((warning-minimum-log-level :emergency) + (byte-compile-warnings nil) + (v0 (condition-case nil + (eval pat) + (error nil))) + (v1 (condition-case nil + (funcall (byte-compile (list 'lambda nil pat))) + (error nil)))) + (equal v0 v1))) + +(put 'bytecomp-check-1 'ert-explainer 'bytecomp-explain-1) + +(defun bytecomp-explain-1 (pat) + (let ((v0 (condition-case nil + (eval pat) + (error nil))) + (v1 (condition-case nil + (funcall (byte-compile (list 'lambda nil pat))) + (error nil)))) + (format "Expression `%s' gives `%s' if directly evalled, `%s' if compiled." + pat v0 v1))) + +(ert-deftest bytecomp-tests () + "Test the Emacs byte compiler." + (dolist (pat byte-opt-testsuite-arith-data) + (should (bytecomp-check-1 pat)))) + +(defun test-byte-opt-arithmetic (&optional arg) "Unit test for byte-opt arithmetic operations. Subtests signal errors if something goes wrong." (interactive "P") - (let ((print-escape-nonascii t) + (switch-to-buffer (generate-new-buffer "*Font Pase Test*")) + (let ((warning-minimum-log-level :emergency) + (byte-compile-warnings nil) + (pass-face '((t :foreground "green"))) + (fail-face '((t :foreground "red"))) + (print-escape-nonascii t) (print-escape-newlines t) (print-quoted t) - v0 v1 - indent-tabs-mode - (patterns byte-opt-testsuite-arith-data)) - (mapc - (lambda (pat) - (condition-case nil - (setq v0 (eval pat)) - (error (setq v0 nil))) - (condition-case nil - (setq v1 (funcall (byte-compile (list 'lambda nil pat)))) - (error (setq v1 nil))) - (princ (format "%s" pat)) - (if (equal v0 v1) - (princ (format " --> %s, OK\n" v1)) - (princ (format " --> %s, NG\n" v0)) - (princ (format " --> %s\n" v1)) - (error "Arithmetic test failed!"))) - patterns))) + v0 v1) + (dolist (pat byte-opt-testsuite-arith-data) + (condition-case nil + (setq v0 (eval pat)) + (error (setq v0 nil))) + (condition-case nil + (setq v1 (funcall (byte-compile (list 'lambda nil pat)))) + (error (setq v1 nil))) + (insert (format "%s" pat)) + (indent-to-column 65) + (if (equal v0 v1) + (insert (propertize "OK" 'face pass-face)) + (insert (propertize "FAIL\n" 'face fail-face)) + (indent-to-column 55) + (insert (propertize (format "[%s] vs [%s]" v0 v1) + 'face fail-face))) + (insert "\n")))) + + +;; Local Variables: +;; no-byte-compile: t +;; End: (provide 'byte-opt-testsuite) === modified file 'test/automated/font-parse-tests.el' --- test/automated/font-parse-tests.el 2011-01-27 23:45:04 +0000 +++ test/automated/font-parse-tests.el 2011-02-14 21:21:42 +0000 @@ -25,8 +25,6 @@ ;; Type M-x test-font-parse RET to generate the test buffer. -;; TODO: Convert to ERT format. - ;;; Code: (require 'ert) ------------------------------------------------------------ revno: 103277 committer: Eli Zaretskii branch nick: trunk timestamp: Mon 2011-02-14 19:58:13 +0200 message: Fix the MS-DOS build due to introduction of B_. msdos.c (IT_frame_up_to_date): s/msdos.h (MODE_LINE_BINARY_TEXT): Use B_ for the MS-DOS build. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-14 17:35:21 +0000 +++ src/ChangeLog 2011-02-14 17:58:13 +0000 @@ -1,5 +1,8 @@ 2011-02-14 Eli Zaretskii + * msdos.c (IT_frame_up_to_date): + * s/msdos.h (MODE_LINE_BINARY_TEXT): Use B_ for the MS-DOS build. + * dired.c (directory_files_internal): * fileio.c (Finsert_file_contents): * insdel.c (prepare_to_modify_buffer): === modified file 'src/msdos.c' --- src/msdos.c 2011-01-26 08:36:39 +0000 +++ src/msdos.c 2011-02-14 17:58:13 +0000 @@ -1317,12 +1317,12 @@ { struct buffer *b = XBUFFER (sw->buffer); - if (EQ (b->cursor_type, Qt)) + if (EQ (B_ (b,cursor_type), Qt)) new_cursor = frame_desired_cursor; - else if (NILP (b->cursor_type)) /* nil means no cursor */ + else if (NILP (B_ (b, cursor_type))) /* nil means no cursor */ new_cursor = Fcons (Qbar, make_number (0)); else - new_cursor = b->cursor_type; + new_cursor = B_ (b, cursor_type); } IT_set_cursor_type (f, new_cursor); === modified file 'src/s/msdos.h' --- src/s/msdos.h 2011-01-25 04:08:28 +0000 +++ src/s/msdos.h 2011-02-14 17:58:13 +0000 @@ -92,7 +92,7 @@ /* Mode line description of a buffer's type. */ -#define MODE_LINE_BINARY_TEXT(buf) (NILP(buf->buffer_file_type) ? "T" : "B") +#define MODE_LINE_BINARY_TEXT(buf) (NILP(B_(buf,buffer_file_type)) ? "T" : "B") /* We have (the code to control) a mouse. */ #define HAVE_MOUSE ------------------------------------------------------------ revno: 103276 committer: Eli Zaretskii branch nick: trunk timestamp: Mon 2011-02-14 19:35:21 +0200 message: Fix the MS-Windows build due to introduction of B_. dired.c (directory_files_internal): fileio.c (Finsert_file_contents): insdel.c (prepare_to_modify_buffer): xdisp.c (pos_visible_p): s/ms-w32.h (MODE_LINE_BINARY_TEXT): w32fns.c (Fw32_shell_execute, Fx_show_tip, x_create_tip_frame): Use B_ for the MS-Windows build. From Tom Tromey: buffer.c (init_buffer_once, syms_of_buffer): Use B_ in DOS_NT case. diff: === modified file 'lisp/dired.el' --- lisp/dired.el 2011-02-13 00:16:28 +0000 +++ lisp/dired.el 2011-02-14 17:35:21 +0000 @@ -4029,7 +4029,7 @@ ;;;*** ;;;### (autoloads (dired-do-relsymlink dired-jump) "dired-x" "dired-x.el" -;;;;;; "fbac6ae123aaa2b2e9df8bb2cde61ceb") +;;;;;; "d35468f85920d324895b0c04bb703328") ;;; Generated autoloads from dired-x.el (autoload 'dired-jump "dired-x" "\ === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-14 17:21:10 +0000 +++ src/ChangeLog 2011-02-14 17:35:21 +0000 @@ -1,3 +1,13 @@ +2011-02-14 Eli Zaretskii + + * dired.c (directory_files_internal): + * fileio.c (Finsert_file_contents): + * insdel.c (prepare_to_modify_buffer): + * xdisp.c (pos_visible_p): + * s/ms-w32.h (MODE_LINE_BINARY_TEXT): + * w32fns.c (Fw32_shell_execute, Fx_show_tip, x_create_tip_frame): + Use B_ for the MS-Windows build. + 2011-02-14 Jan Djärv * xrdb.c (x_load_resources): For LUCID and XFT, don't put a @@ -11,6 +21,8 @@ 2011-02-14 Tom Tromey + * buffer.c (init_buffer_once, syms_of_buffer): Use B_ in DOS_NT case. + * keyboard.h: Remove obsolete comment. 2011-02-14 Tom Tromey === modified file 'src/buffer.c' --- src/buffer.c 2011-02-14 15:39:19 +0000 +++ src/buffer.c 2011-02-14 17:35:21 +0000 @@ -5041,7 +5041,7 @@ B_ (&buffer_defaults, cursor_in_non_selected_windows) = Qt; #ifdef DOS_NT - buffer_defaults.buffer_file_type = Qnil; /* TEXT */ + B_ (&buffer_defaults, buffer_file_type) = Qnil; /* TEXT */ #endif B_ (&buffer_defaults, enable_multibyte_characters) = Qt; B_ (&buffer_defaults, buffer_file_coding_system) = Qnil; @@ -5113,7 +5113,7 @@ XSETFASTINT (B_ (&buffer_local_flags, abbrev_table), idx); ++idx; XSETFASTINT (B_ (&buffer_local_flags, display_table), idx); ++idx; #ifdef DOS_NT - XSETFASTINT (buffer_local_flags.buffer_file_type, idx); + XSETFASTINT (B_ (&buffer_local_flags, buffer_file_type), idx); /* Make this one a permanent local. */ buffer_permanent_local_flags[idx++] = 1; #endif @@ -5674,7 +5674,7 @@ in narrower windows. */); #ifdef DOS_NT - DEFVAR_PER_BUFFER ("buffer-file-type", ¤t_buffer->buffer_file_type, + DEFVAR_PER_BUFFER ("buffer-file-type", &B_ (current_buffer, buffer_file_type), Qnil, doc: /* Non-nil if the visited file is a binary file. This variable is meaningful on MS-DOG and Windows NT. === modified file 'src/dired.c' --- src/dired.c 2011-02-07 01:18:31 +0000 +++ src/dired.c 2011-02-14 17:35:21 +0000 @@ -158,7 +158,7 @@ # ifdef WINDOWSNT /* Windows users want case-insensitive wildcards. */ bufp = compile_pattern (match, 0, - buffer_defaults.case_canon_table, 0, 1); + B_ (&buffer_defaults, case_canon_table), 0, 1); # else /* !WINDOWSNT */ bufp = compile_pattern (match, 0, Qnil, 0, 1); # endif /* !WINDOWSNT */ === modified file 'src/fileio.c' --- src/fileio.c 2011-02-14 15:39:19 +0000 +++ src/fileio.c 2011-02-14 17:35:21 +0000 @@ -4110,9 +4110,9 @@ if ((VECTORP (CODING_ID_EOL_TYPE (coding.id)) || EQ (CODING_ID_EOL_TYPE (coding.id), Qunix)) && ! CODING_REQUIRE_DECODING (&coding)) - current_buffer->buffer_file_type = Qt; + B_ (current_buffer, buffer_file_type) = Qt; else - current_buffer->buffer_file_type = Qnil; + B_ (current_buffer, buffer_file_type) = Qnil; #endif handled: === modified file 'src/insdel.c' --- src/insdel.c 2011-02-14 15:39:19 +0000 +++ src/insdel.c 2011-02-14 17:35:21 +0000 @@ -2029,12 +2029,12 @@ lock_file (B_ (base_buffer, file_truename)); #else /* At least warn if this file has changed on disk since it was visited. */ - if (!NILP (base_buffer->filename) + if (!NILP (B_ (base_buffer, filename)) && SAVE_MODIFF >= MODIFF && NILP (Fverify_visited_file_modtime (Fcurrent_buffer ())) - && !NILP (Ffile_exists_p (base_buffer->filename))) + && !NILP (Ffile_exists_p (B_ (base_buffer, filename)))) call1 (intern ("ask-user-about-supersession-threat"), - base_buffer->filename); + B_ (base_buffer,filename)); #endif /* not CLASH_DETECTION */ /* If `select-active-regions' is non-nil, save the region text. */ === modified file 'src/s/ms-w32.h' --- src/s/ms-w32.h 2011-01-31 20:00:40 +0000 +++ src/s/ms-w32.h 2011-02-14 17:35:21 +0000 @@ -181,7 +181,7 @@ #define HAVE_MENUS 1 #endif -#define MODE_LINE_BINARY_TEXT(_b_) (NILP ((_b_)->buffer_file_type) ? "T" : "B") +#define MODE_LINE_BINARY_TEXT(_b_) (NILP (B_(_b_,buffer_file_type)) ? "T" : "B") /* Get some redefinitions in place. */ === modified file 'src/w32fns.c' --- src/w32fns.c 2011-01-26 08:36:39 +0000 +++ src/w32fns.c 2011-02-14 17:35:21 +0000 @@ -5225,7 +5225,7 @@ Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil); old_buffer = current_buffer; set_buffer_internal_1 (XBUFFER (buffer)); - current_buffer->truncate_lines = Qnil; + B_ (current_buffer, truncate_lines) = Qnil; specbind (Qinhibit_read_only, Qt); specbind (Qinhibit_modification_hooks, Qt); Ferase_buffer (); @@ -5655,7 +5655,7 @@ /* Display the tooltip text in a temporary buffer. */ old_buffer = current_buffer; set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer)); - current_buffer->truncate_lines = Qnil; + B_ (current_buffer, truncate_lines) = Qnil; clear_glyph_matrix (w->desired_matrix); clear_glyph_matrix (w->current_matrix); SET_TEXT_POS (pos, BEGV, BEGV_BYTE); @@ -6162,7 +6162,7 @@ CHECK_STRING (document); /* Encode filename, current directory and parameters. */ - current_dir = ENCODE_FILE (current_buffer->directory); + current_dir = ENCODE_FILE (B_ (current_buffer, directory)); document = ENCODE_FILE (document); if (STRINGP (parameters)) parameters = ENCODE_SYSTEM (parameters); ------------------------------------------------------------ revno: 103275 committer: Jan D. branch nick: trunk timestamp: Mon 2011-02-14 18:21:10 +0100 message: Use *font for Xft font names for Lucid menus and dialogs. * doc/emacs/xresources.texi (X Resources): Remove *faceName and replace it with *font for Lucid. * lwlib/lwlib-Xaw.c (make_dialog): Use *font even for Xft fonts. Try XLoadQueryFont first and then Xft fonts. * lwlib/xlwmenu.c (xlwmenu_default_font): Remove, does not work for multi-display. (xlwMenuResources): Remove XtNfaceName and XtNdefaultFace. Make XtNFont a String resource. (make_windows_if_needed): Call XFlush so later changes are seen by the X server. (remap_menubar): Use XtMoveWidget and then XtResizeWidget/XtResizeWindow after XtPopup. Works better with Compiz. (make_drawing_gcs): Check if mw->menu.font is set. (getDefaultXftFont): New function. (openXftFont): faceName is now fontName. Try XLoadQueryFont first and then XftFontOpenName. (XlwMenuInitialize): Initialize mw->menu.font with XLoadQueryFont. (XlwMenuClassInitialize): Remove initialization of xlwmenu_default_font. (fontname_changed): Renamed from facename_changed. (XlwMenuSetValues): Use facename_changed. * lwlib/xlwmenu.h: Remove Xt[CN]faceName and Xt[NC]defaultFace. * lwlib/xlwmenuP.h (_XlwMenu_part): Remove faceName. Add fontName. * src/xmenu.c (apply_systemfont_to_dialog): Apply to *dialog.font. (apply_systemfont_to_menu): Set resources *menubar*font and *popup*font. Remove defflt. (set_frame_menubar, create_and_show_popup_menu): Call apply_systemfont_to_menu before lw_create_widget. * src/xrdb.c (x_load_resources): For LUCID and XFT, don't put a resource that specifies helvetica for menus and dialogs. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-02-05 22:30:14 +0000 +++ doc/emacs/ChangeLog 2011-02-14 17:21:10 +0000 @@ -1,3 +1,8 @@ +2011-02-14 Jan Djärv + + * xresources.texi (X Resources): Remove *faceName and replace it with + *font for Lucid. + 2011-02-05 Chong Yidong * rmail.texi (Rmail Display): Document Rmail MIME support more === modified file 'doc/emacs/xresources.texi' --- doc/emacs/xresources.texi 2011-01-25 04:08:28 +0000 +++ doc/emacs/xresources.texi 2011-02-14 17:21:10 +0000 @@ -428,31 +428,22 @@ @end iftex @example -Emacs.pane.menubar.faceName: Courier-12 -@end example - -@noindent -To specify a font, use fontconfig font names as values to the @code{faceName} -resource. - -If Emacs is not built with the Xft library, Lucid menus and dialogs -can only display old style fonts. If Emacs is built with Xft and you -prefer the old fonts, you have to specify @samp{none} to -@code{faceName}: - -@example -Emacs.pane.menubar.faceName: none -Emacs.pane.dialog.faceName: none -@end example - -@noindent -To specify a non-Xft font, use @code{font}. For example: +Emacs.pane.menubar.font: Courier-12 +@end example + +@noindent +To specify a font, use fontconfig font names as values to the @code{font} +resource, or old style names: @example Emacs.pane.menubar.font: lucidasanstypewriter-10 @end example @noindent +Emacs first tries to open the font as an old style font, and if that fails +as an fontconfig font. In rare cases, Emacs might do the wrong thing. + +@noindent The Lucid menus can display multilingual text in your locale with old style fonts. For more information about fontsets see the man page for @code{XCreateFontSet}. To enable multilingual menu text you specify a @@ -480,7 +471,7 @@ For dialog boxes, use @samp{dialog*}: @example -Emacs.dialog*.faceName: Sans-12 +Emacs.dialog*.font: Sans-12 @end example @noindent @@ -495,8 +486,6 @@ Here is a list of the specific resources for menu bars and pop-up menus: @table @code -@item faceName -Xft font for menu item text. @item font Font for menu item text. @item fontSet === modified file 'etc/NEWS' --- etc/NEWS 2011-02-14 01:49:24 +0000 +++ etc/NEWS 2011-02-14 17:21:10 +0000 @@ -137,9 +137,8 @@ off by customizing x-gtk-use-system-tooltips. ** Lucid menus and dialogs can display antialiased fonts if Emacs is built -with Xft. To change font, use X resource faceName, for example: -Emacs.pane.menubar.faceName: Courier-12 -Set faceName to none and use font to use the old X fonts. +with Xft. To change font, use the X resource font, for example: +Emacs.pane.menubar.font: Courier-12 +++ ** Enhanced support for characters that have no glyphs in available fonts === modified file 'lwlib/ChangeLog' --- lwlib/ChangeLog 2011-02-13 02:07:25 +0000 +++ lwlib/ChangeLog 2011-02-14 17:21:10 +0000 @@ -1,3 +1,31 @@ +2011-02-14 Jan Djärv + + * xlwmenu.h: Remove Xt[CN]faceName and Xt[NC]defaultFace. + + * xlwmenuP.h (_XlwMenu_part): Remove faceName. Add fontName. + + * xlwmenu.c (xlwmenu_default_font): Remove, does not work for + multi-display. + (xlwMenuResources): Remove XtNfaceName and XtNdefaultFace. + Make XtNFont a String resource. + (make_windows_if_needed): Call XFlush so later changes are seen by the + X server. + (remap_menubar): Use XtMoveWidget and then + XtResizeWidget/XtResizeWindow after XtPopup. Works better with + Compiz. + (make_drawing_gcs): Check if mw->menu.font is set. + (getDefaultXftFont): New function. + (openXftFont): faceName is now fontName. Try XLoadQueryFont first + and then XftFontOpenName. + (XlwMenuInitialize): Initialize mw->menu.font with XLoadQueryFont. + (XlwMenuClassInitialize): Remove initialization of + xlwmenu_default_font. + (fontname_changed): Renamed from facename_changed. + (XlwMenuSetValues): Use facename_changed. + + * lwlib-Xaw.c (make_dialog): Use *font even for Xft fonts. Try + XLoadQueryFont first and then Xft fonts. + 2011-02-13 Glenn Morris * lwlib-utils.c (index, rindex): Don't undef (neither used in lwlib/, === modified file 'lwlib/lwlib-Xaw.c' --- lwlib/lwlib-Xaw.c 2011-02-10 05:03:29 +0000 +++ lwlib/lwlib-Xaw.c 2011-02-14 17:21:10 +0000 @@ -577,13 +577,20 @@ if (w) { XtResource rec[] = - { { "faceName", "FaceName", XtRString, sizeof(String), 0, XtRString, - (XtPointer)"Sans-14" }}; - char *faceName; - XtVaGetSubresources (dialog, &faceName, "Dialog", "dialog", + { { "font", "Font", XtRString, sizeof(String), 0, XtRString, + (XtPointer)"Sans-10" }}; + char *fontName = NULL; + XtVaGetSubresources (dialog, &fontName, "Dialog", "dialog", rec, 1, (String)NULL); - if (strcmp ("none", faceName) != 0) - xft_font = openFont (dialog, faceName); + if (fontName) + { + XFontStruct *xfn = XLoadQueryFont (XtDisplay (dialog), fontName); + if (!xfn) + xft_font = openFont (dialog, fontName); + else + XFreeFont (XtDisplay (dialog), xfn); + } + if (xft_font) { instance->nr_xft_data = left_buttons + right_buttons + 1; === modified file 'lwlib/xlwmenu.c' --- lwlib/xlwmenu.c 2011-02-10 05:03:29 +0000 +++ lwlib/xlwmenu.c 2011-02-14 17:21:10 +0000 @@ -71,8 +71,6 @@ static int pointer_grabbed; static XEvent menu_post_event; -static XFontStruct *xlwmenu_default_font; - static char xlwMenuTranslations [] = ": start()\n\ @@ -131,14 +129,12 @@ offset(menu.fontSet), XtRFontSet, NULL}, #endif #ifdef HAVE_XFT -#define DEFAULT_FACENAME "Sans-10" - {XtNfaceName, XtCFaceName, XtRString, sizeof(String), - offset(menu.faceName), XtRString, DEFAULT_FACENAME}, - {XtNdefaultFace, XtCDefaultFace, XtRInt, sizeof(int), - offset(menu.default_face), XtRImmediate, (XtPointer)1}, +#define DEFAULT_FONTNAME "Sans-10" +#else +#define DEFAULT_FONTNAME "XtDefaultFont" #endif - {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *), - offset(menu.font), XtRString, "XtDefaultFont"}, + {XtNfont, XtCFont, XtRString, sizeof(String), + offset(menu.fontName), XtRString, DEFAULT_FONTNAME }, {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel), offset(menu.foreground), XtRString, "XtDefaultForeground"}, {XtNdisabledForeground, XtCDisabledForeground, XtRPixel, sizeof(Pixel), @@ -1352,6 +1348,7 @@ #endif set_window_type (windows [i].w, mw); } + XFlush (XtDisplay (mw)); } /* Value is non-zero if WINDOW is part of menu bar widget W. */ @@ -1534,10 +1531,12 @@ fit_to_screen (mw, ws, previous_ws, mw->menu.horizontal && i == 1); - XtVaSetValues (ws->w, XtNwidth, ws->width, XtNheight, ws->height, - XtNx, ws->x, XtNy, ws->y, NULL); create_pixmap_for_menu (ws, mw); + XtMoveWidget (ws->w, ws->x, ws->y); XtPopup (ws->w, XtGrabNone); + XtResizeWidget (ws->w, ws->width, ws->height, + mw->core.border_width); + XtResizeWindow (ws->w); display_menu (mw, i, False, &selection_position, NULL, NULL); } @@ -1613,14 +1612,17 @@ XtGCMask mask = GCForeground | GCBackground; #ifdef HAVE_X_I18N - if (!mw->menu.fontSet) + if (!mw->menu.fontSet && mw->menu.font) { xgcv.font = mw->menu.font->fid; mask |= GCFont; } #else - xgcv.font = mw->menu.font->fid; - mask |= GCFont; + if (mw->menu.font) + { + xgcv.font = mw->menu.font->fid; + mask |= GCFont; + } #endif xgcv.foreground = mw->menu.foreground; xgcv.background = mw->core.background_pixel; @@ -1847,13 +1849,20 @@ } #ifdef HAVE_XFT +static XftFont * +getDefaultXftFont (XlwMenuWidget mw) +{ + int screen = XScreenNumberOfScreen (mw->core.screen); + return XftFontOpenName (XtDisplay (mw), screen, DEFAULT_FONTNAME); +} + static int openXftFont (XlwMenuWidget mw) { - char *fname = mw->menu.faceName; + char *fname = mw->menu.fontName; mw->menu.xft_font = 0; - mw->menu.default_face = fname && strcmp (fname, DEFAULT_FACENAME) == 0; + mw->menu.default_face = fname && strcmp (fname, DEFAULT_FONTNAME) == 0; if (fname && strcmp (fname, "none") != 0) { @@ -1864,20 +1873,23 @@ --i; if (fname[i] == ' ') { - fname = xstrdup (mw->menu.faceName); + fname = xstrdup (mw->menu.fontName); fname[i] = '-'; } - mw->menu.xft_font = XftFontOpenName (XtDisplay (mw), screen, fname); - if (!mw->menu.xft_font) + mw->menu.font = XLoadQueryFont (XtDisplay (mw), fname); + if (!mw->menu.font) { - fprintf (stderr, "Can't find font '%s'\n", fname); - mw->menu.xft_font = XftFontOpenName (XtDisplay (mw), screen, - DEFAULT_FACENAME); + mw->menu.xft_font = XftFontOpenName (XtDisplay (mw), screen, fname); + if (!mw->menu.xft_font) + { + fprintf (stderr, "Can't find font '%s'\n", fname); + mw->menu.xft_font = getDefaultXftFont (mw); + } } } - if (fname != mw->menu.faceName) free (fname); + if (fname != mw->menu.fontName) free (fname); return mw->menu.xft_font != 0; } @@ -1913,19 +1925,19 @@ ; else #endif + { + mw->menu.font = XLoadQueryFont (display, mw->menu.fontName); + if (!mw->menu.font) + { + mw->menu.font = XLoadQueryFont (display, "fixed"); + if (!mw->menu.font) + { + fprintf (stderr, "Menu font fixed not found, can't continue.\n"); + abort (); + } + } + } - if (!mw->menu.font) - { - if (!xlwmenu_default_font) - xlwmenu_default_font = XLoadQueryFont (display, "fixed"); - mw->menu.font = xlwmenu_default_font; - if (!mw->menu.font) - { - fprintf (stderr, "Menu font fixed not found, can't continue.\n"); - abort (); - } - } - #ifdef HAVE_X_I18N if (mw->menu.fontSet) mw->menu.font_extents = XExtentsOfFontSet (mw->menu.fontSet); @@ -1966,7 +1978,6 @@ static void XlwMenuClassInitialize (void) { - xlwmenu_default_font = 0; } static void @@ -2126,13 +2137,13 @@ #ifdef HAVE_XFT static int -facename_changed (XlwMenuWidget newmw, +fontname_changed (XlwMenuWidget newmw, XlwMenuWidget oldmw) { - /* This will fore a new XftFont even if the same string is set. + /* This will force a new XftFont even if the same string is set. This is good, as rendering parameters may have changed and we just want to do a redisplay. */ - return newmw->menu.faceName != oldmw->menu.faceName; + return newmw->menu.fontName != oldmw->menu.fontName; } #endif @@ -2158,7 +2169,7 @@ if (newmw->core.background_pixel != oldmw->core.background_pixel || newmw->menu.foreground != oldmw->menu.foreground #ifdef HAVE_XFT - || facename_changed (newmw, oldmw) + || fontname_changed (newmw, oldmw) #endif #ifdef HAVE_X_I18N || newmw->menu.fontSet != oldmw->menu.fontSet @@ -2193,7 +2204,7 @@ } #ifdef HAVE_XFT - if (facename_changed (newmw, oldmw)) + if (fontname_changed (newmw, oldmw)) { int i; int screen = XScreenNumberOfScreen (newmw->core.screen); === modified file 'lwlib/xlwmenu.h' --- lwlib/xlwmenu.h 2011-01-26 08:36:39 +0000 +++ lwlib/xlwmenu.h 2011-02-14 17:21:10 +0000 @@ -58,10 +58,6 @@ #define XtCResizeToPreferred "ResizeToPreferred" #define XtNallowResize "allowResize" #define XtCAllowResize "AllowResize" -#define XtNfaceName "faceName" -#define XtCFaceName "FaceName" -#define XtNdefaultFace "defaultFace" -#define XtCDefaultFace "DefaultFace" /* Motif-compatible resource names */ #define XmNshadowThickness "shadowThickness" === modified file 'lwlib/xlwmenuP.h' --- lwlib/xlwmenuP.h 2011-01-26 08:36:39 +0000 +++ lwlib/xlwmenuP.h 2011-02-14 17:21:10 +0000 @@ -59,11 +59,11 @@ XFontSetExtents *font_extents; #endif #ifdef HAVE_XFT - String faceName; int default_face; XftFont* xft_font; XftColor xft_fg, xft_bg, xft_disabled_fg; #endif + String fontName; XFontStruct* font; Pixel foreground; Pixel disabled_foreground; === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-14 16:25:04 +0000 +++ src/ChangeLog 2011-02-14 17:21:10 +0000 @@ -1,3 +1,14 @@ +2011-02-14 Jan Djärv + + * xrdb.c (x_load_resources): For LUCID and XFT, don't put a + resource that specifies helvetica for menus and dialogs. + + * xmenu.c (apply_systemfont_to_dialog): Apply to *dialog.font. + (apply_systemfont_to_menu): Set resources *menubar*font and + *popup*font. Remove defflt. + (set_frame_menubar, create_and_show_popup_menu): Call + apply_systemfont_to_menu before lw_create_widget. + 2011-02-14 Tom Tromey * keyboard.h: Remove obsolete comment. === modified file 'src/xmenu.c' --- src/xmenu.c 2011-02-05 09:49:52 +0000 +++ src/xmenu.c 2011-02-14 17:21:10 +0000 @@ -887,31 +887,26 @@ { XrmDatabase db = XtDatabase (XtDisplay (w)); if (db) - XrmPutStringResource (&db, "*dialog.faceName", fn); + XrmPutStringResource (&db, "*dialog.font", fn); } } static void -apply_systemfont_to_menu (Widget w) +apply_systemfont_to_menu (struct frame *f, Widget w) { const char *fn = xsettings_get_system_normal_font (); - int defflt; - - if (!fn) return; - - if (XtIsShell (w)) /* popup menu */ + + if (fn) { - Widget *childs = NULL; - - XtVaGetValues (w, XtNchildren, &childs, NULL); - if (*childs) w = *childs; + XrmDatabase db = XtDatabase (XtDisplay (w)); + if (db) + { + XrmPutStringResource (&db, "*menubar*font", fn); + XrmPutStringResource (&db, "*popup*font", fn); + } } - - /* Only use system font if the default is used for the menu. */ - XtVaGetValues (w, XtNdefaultFace, &defflt, NULL); - if (defflt) - XtVaSetValues (w, XtNfaceName, fn, NULL); } + #endif /* Set the contents of the menubar widgets of frame F. @@ -1210,7 +1205,11 @@ char menuOverride[] = "Ctrlg: MenuGadgetEscape()"; XtTranslations override = XtParseTranslationTable (menuOverride); - menubar_widget = lw_create_widget ("menubar", "menubar", id, first_wv, +#ifdef USE_LUCID + apply_systemfont_to_menu (f, f->output_data.x->column_widget); +#endif + menubar_widget = lw_create_widget ("menubar", "menubar", id, + first_wv, f->output_data.x->column_widget, 0, popup_activate_callback, @@ -1221,9 +1220,6 @@ /* Make menu pop down on C-g. */ XtOverrideTranslations (menubar_widget, override); -#ifdef USE_LUCID - apply_systemfont_to_menu (menubar_widget); -#endif } { @@ -1542,6 +1538,10 @@ if (! FRAME_X_P (f)) abort (); +#ifdef USE_LUCID + apply_systemfont_to_menu (f, f->output_data.x->widget); +#endif + menu_id = widget_id_tick++; menu = lw_create_widget ("popup", first_wv->name, menu_id, first_wv, f->output_data.x->widget, 1, 0, @@ -1549,10 +1549,6 @@ popup_deactivate_callback, menu_highlight_callback); -#ifdef USE_LUCID - apply_systemfont_to_menu (menu); -#endif - dummy.type = ButtonPress; dummy.serial = 0; dummy.send_event = 0; === modified file 'src/xrdb.c' --- src/xrdb.c 2011-01-25 04:08:28 +0000 +++ src/xrdb.c 2011-02-14 17:21:10 +0000 @@ -546,12 +546,14 @@ #else /* not USE_MOTIF */ + sprintf (line, "Emacs.dialog*.background: grey75"); + XrmPutLineResource (&rdb, line); +#if !defined (HAVE_XFT) || !defined (USE_LUCID) sprintf (line, "Emacs.dialog*.font: %s", helv); XrmPutLineResource (&rdb, line); - sprintf (line, "Emacs.dialog*.background: grey75"); - XrmPutLineResource (&rdb, line); sprintf (line, "*XlwMenu*font: %s", helv); XrmPutLineResource (&rdb, line); +#endif sprintf (line, "*XlwMenu*background: grey75"); XrmPutLineResource (&rdb, line); sprintf (line, "Emacs*verticalScrollBar.background: grey75"); ------------------------------------------------------------ revno: 103274 committer: Tom Tromey branch nick: trunk timestamp: Mon 2011-02-14 09:25:04 -0700 message: * keyboard.h: Remove obsolete comment. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-14 15:39:19 +0000 +++ src/ChangeLog 2011-02-14 16:25:04 +0000 @@ -1,3 +1,7 @@ +2011-02-14 Tom Tromey + + * keyboard.h: Remove obsolete comment. + 2011-02-14 Tom Tromey * composite.c (fill_gstring_header) === modified file 'src/keyboard.h' --- src/keyboard.h 2011-01-25 04:08:28 +0000 +++ src/keyboard.h 2011-02-14 16:25:04 +0000 @@ -19,8 +19,6 @@ #include "systime.h" /* for EMACS_TIME */ #include "coding.h" /* for ENCODE_UTF_8 and ENCODE_SYSTEM */ -/* Length of echobuf field in each KBOARD. */ - /* Each KBOARD represents one logical input stream from which Emacs gets input. If we are using ordinary terminals, it has one KBOARD object for each terminal device. ------------------------------------------------------------ revno: 103273 committer: Tom Tromey branch nick: trunk timestamp: Mon 2011-02-14 08:39:19 -0700 message: Hide implementation of `struct buffer' * composite.c (fill_gstring_header) (composition_compute_stop_pos, composition_adjust_point) (Ffind_composition_internal): Use B_. * intervals.c (set_point_both, get_local_map): Use B_. * callproc.c (Fcall_process, Fcall_process_region): Use B_. * process.c (get_process, list_processes_1, Fstart_process) (Fmake_serial_process, Fmake_network_process) (read_process_output, send_process, exec_sentinel) (status_notify, setup_process_coding_systems): Use B_. * bytecode.c (Fbyte_code): Use B_. * syntax.c (update_syntax_table, dec_bytepos, Fsyntax_table) (Fset_syntax_table, Fmodify_syntax_entry, skip_chars) (skip_syntaxes, scan_lists): Use B_. * lread.c (readchar, unreadchar, openp, readevalloop) (Feval_buffer, Feval_region): Use B_. * print.c (printchar, strout, print_string, PRINTDECLARE) (PRINTPREPARE, PRINTFINISH, temp_output_buffer_setup) (print_object): Use B_. * font.c (font_at): Use B_. * fns.c (Fbase64_encode_region, Fbase64_decode_region, Fmd5): Use B_. * callint.c (check_mark, Fcall_interactively): Use B_. * editfns.c (region_limit, Fmark_marker, save_excursion_save) (save_excursion_restore, Fprevious_char, Fchar_before) (general_insert_function, Finsert_char, Finsert_byte) (make_buffer_string_both, Finsert_buffer_substring) (Fcompare_buffer_substrings, subst_char_in_region_unwind) (subst_char_in_region_unwind_1, Fsubst_char_in_region) (Ftranslate_region_internal, save_restriction_restore) (Fchar_equal): Use B_. * data.c (swap_in_symval_forwarding, set_internal) (Fmake_local_variable, Fkill_local_variable, Flocal_variable_p): Use B_. * undo.c (record_point, record_insert, record_delete) (record_marker_adjustment, record_first_change) (record_property_change, Fundo_boundary, truncate_undo_list) (Fprimitive_undo): Use B_. * search.c (compile_pattern_1, compile_pattern, looking_at_1) (string_match_1, fast_looking_at, newline_cache_on_off) (search_command, search_buffer, simple_search, boyer_moore) (Freplace_match): Use B_. * indent.c (buffer_display_table, recompute_width_table) (width_run_cache_on_off, current_column, scan_for_column) (Findent_to, position_indentation, compute_motion, vmotion): Use B_. * casefiddle.c (casify_object, casify_region): Use B_. * casetab.c (Fcurrent_case_table, set_case_table): Use B_. * cmds.c (Fself_insert_command, internal_self_insert): Use B_. * fileio.c (Fexpand_file_name, Ffile_directory_p) (Ffile_regular_p, Ffile_selinux_context) (Fset_file_selinux_context, Ffile_modes, Fset_file_modes) (Fset_file_times, Ffile_newer_than_file_p, decide_coding_unwind) (Finsert_file_contents, choose_write_coding_system) (Fwrite_region, build_annotations, Fverify_visited_file_modtime) (Fset_visited_file_modtime, auto_save_error, auto_save_1) (Fdo_auto_save, Fset_buffer_auto_saved): Use B_. * minibuf.c (read_minibuf, get_minibuffer, Fread_buffer): Use B_. * marker.c (Fmarker_buffer, Fset_marker, set_marker_restricted) (set_marker_both, set_marker_restricted_both, unchain_marker): Use B_. * insdel.c (check_markers, insert_char, insert_1_both) (insert_from_string_1, insert_from_gap, insert_from_buffer_1) (adjust_after_replace, replace_range, del_range_2) (modify_region, prepare_to_modify_buffer) (Fcombine_after_change_execute): Use B_. * filelock.c (unlock_all_files, Flock_buffer, Funlock_buffer) (unlock_buffer): Use B_. * keymap.c (Flocal_key_binding, Fuse_local_map) (Fcurrent_local_map, push_key_description) (Fdescribe_buffer_bindings): Use B_. * keyboard.c (command_loop_1, read_char_minibuf_menu_prompt) (read_key_sequence): Use B_. * fringe.c (get_logical_cursor_bitmap) (get_logical_fringe_bitmap, update_window_fringes): Use B_. * xfns.c (x_create_tip_frame, Fx_show_tip): Use B_. * xfaces.c (compute_char_face): Use B_. * character.c (chars_in_text, Fget_byte): Use B_. * category.c (check_category_table, Fcategory_table) (Fset_category_table, char_category_set): Use B_. * coding.c (decode_coding, encode_coding) (make_conversion_work_buffer, decode_coding_gap) (decode_coding_object, encode_coding_object) (Fdetect_coding_region, Ffind_coding_systems_region_internal) (Funencodable_char_position, Fcheck_coding_systems_region): Use B_. * charset.c (Ffind_charset_region): Use B_. * window.c (window_display_table, unshow_buffer, window_loop) (window_min_size_2, set_window_buffer, Fset_window_buffer) (select_window, Fforce_window_update, temp_output_buffer_show) (Fset_window_configuration, save_window_save): Use B_. * xdisp.c (pos_visible_p, init_iterator, reseat_1) (message_dolog, update_echo_area, ensure_echo_area_buffers) (with_echo_area_buffer, setup_echo_area_for_printing) (set_message_1, update_menu_bar, update_tool_bar) (text_outside_line_unchanged_p, redisplay_internal) (try_scrolling, try_cursor_movement, redisplay_window) (try_window_reusing_current_matrix, row_containing_pos) (try_window_id, get_overlay_arrow_glyph_row, display_line) (Fcurrent_bidi_paragraph_direction, display_mode_lines) (decode_mode_spec_coding, decode_mode_spec, display_count_lines) (get_window_cursor_type, note_mouse_highlight): Use B_. * frame.c (make_frame_visible_1): Use B_. * dispnew.c (Fframe_or_buffer_changed_p): Use B_. * dispextern.h (WINDOW_WANTS_HEADER_LINE_P) (WINDOW_WANTS_MODELINE_P): Use B_. * syntax.h (Vstandard_syntax_table): Update. (CURRENT_SYNTAX_TABLE, SETUP_BUFFER_SYNTAX_TABLE): Use B_. * intervals.h (TEXT_PROP_MEANS_INVISIBLE): Update. (TEXT_PROP_MEANS_INVISIBLE): Use B_. * character.h (FETCH_CHAR_ADVANCE): Update. (INC_BOTH, ASCII_CHAR_WIDTH, DEC_BOTH): Use B_. * category.h (Vstandard_category_table): Update. * lisp.h (DEFVAR_BUFFER_DEFAULTS): Update for change to field names. (DOWNCASE_TABLE, UPCASE_TABLE): Use B_. * buffer.c (swapfield_): New macro. (Fbuffer_swap_text): Use swapfield_ where appropriate. (Fbuffer_live_p, Fget_file_buffer, get_truename_buffer) (Fget_buffer_create, clone_per_buffer_values) (Fmake_indirect_buffer, reset_buffer) (reset_buffer_local_variables, Fbuffer_name, Fbuffer_file_name) (Fbuffer_local_value, buffer_lisp_local_variables) (Fset_buffer_modified_p, Frestore_buffer_modified_p) (Frename_buffer, Fother_buffer, Fbuffer_enable_undo) (Fkill_buffer, Fset_buffer_major_mode, set_buffer_internal_1) (set_buffer_temp, Fset_buffer, set_buffer_if_live) (Fbarf_if_buffer_read_only, Fbury_buffer, Ferase_buffer) (Fbuffer_swap_text, Fset_buffer_multibyte) (swap_out_buffer_local_variables, record_overlay_string) (overlay_strings, init_buffer_once, init_buffer, syms_of_buffer): Use B_. * buffer.h (struct buffer): Rename all Lisp_Object fields. (BUFFER_INTERNAL_FIELD, B_): New macro. (FETCH_CHAR, FETCH_CHAR_AS_MULTIBYTE): Use B_. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-14 13:30:49 +0000 +++ src/ChangeLog 2011-02-14 15:39:19 +0000 @@ -1,3 +1,140 @@ +2011-02-14 Tom Tromey + + * composite.c (fill_gstring_header) + (composition_compute_stop_pos, composition_adjust_point) + (Ffind_composition_internal): Use B_. + * intervals.c (set_point_both, get_local_map): Use B_. + * callproc.c (Fcall_process, Fcall_process_region): Use B_. + * process.c (get_process, list_processes_1, Fstart_process) + (Fmake_serial_process, Fmake_network_process) + (read_process_output, send_process, exec_sentinel) + (status_notify, setup_process_coding_systems): Use B_. + * bytecode.c (Fbyte_code): Use B_. + * syntax.c (update_syntax_table, dec_bytepos, Fsyntax_table) + (Fset_syntax_table, Fmodify_syntax_entry, skip_chars) + (skip_syntaxes, scan_lists): Use B_. + * lread.c (readchar, unreadchar, openp, readevalloop) + (Feval_buffer, Feval_region): Use B_. + * print.c (printchar, strout, print_string, PRINTDECLARE) + (PRINTPREPARE, PRINTFINISH, temp_output_buffer_setup) + (print_object): Use B_. + * font.c (font_at): Use B_. + * fns.c (Fbase64_encode_region, Fbase64_decode_region, Fmd5): Use + B_. + * callint.c (check_mark, Fcall_interactively): Use B_. + * editfns.c (region_limit, Fmark_marker, save_excursion_save) + (save_excursion_restore, Fprevious_char, Fchar_before) + (general_insert_function, Finsert_char, Finsert_byte) + (make_buffer_string_both, Finsert_buffer_substring) + (Fcompare_buffer_substrings, subst_char_in_region_unwind) + (subst_char_in_region_unwind_1, Fsubst_char_in_region) + (Ftranslate_region_internal, save_restriction_restore) + (Fchar_equal): Use B_. + * data.c (swap_in_symval_forwarding, set_internal) + (Fmake_local_variable, Fkill_local_variable, Flocal_variable_p): + Use B_. + * undo.c (record_point, record_insert, record_delete) + (record_marker_adjustment, record_first_change) + (record_property_change, Fundo_boundary, truncate_undo_list) + (Fprimitive_undo): Use B_. + * search.c (compile_pattern_1, compile_pattern, looking_at_1) + (string_match_1, fast_looking_at, newline_cache_on_off) + (search_command, search_buffer, simple_search, boyer_moore) + (Freplace_match): Use B_. + * indent.c (buffer_display_table, recompute_width_table) + (width_run_cache_on_off, current_column, scan_for_column) + (Findent_to, position_indentation, compute_motion, vmotion): Use + B_. + * casefiddle.c (casify_object, casify_region): Use B_. + * casetab.c (Fcurrent_case_table, set_case_table): Use B_. + * cmds.c (Fself_insert_command, internal_self_insert): Use B_. + * fileio.c (Fexpand_file_name, Ffile_directory_p) + (Ffile_regular_p, Ffile_selinux_context) + (Fset_file_selinux_context, Ffile_modes, Fset_file_modes) + (Fset_file_times, Ffile_newer_than_file_p, decide_coding_unwind) + (Finsert_file_contents, choose_write_coding_system) + (Fwrite_region, build_annotations, Fverify_visited_file_modtime) + (Fset_visited_file_modtime, auto_save_error, auto_save_1) + (Fdo_auto_save, Fset_buffer_auto_saved): Use B_. + * minibuf.c (read_minibuf, get_minibuffer, Fread_buffer): Use B_. + * marker.c (Fmarker_buffer, Fset_marker, set_marker_restricted) + (set_marker_both, set_marker_restricted_both, unchain_marker): Use + B_. + * insdel.c (check_markers, insert_char, insert_1_both) + (insert_from_string_1, insert_from_gap, insert_from_buffer_1) + (adjust_after_replace, replace_range, del_range_2) + (modify_region, prepare_to_modify_buffer) + (Fcombine_after_change_execute): Use B_. + * filelock.c (unlock_all_files, Flock_buffer, Funlock_buffer) + (unlock_buffer): Use B_. + * keymap.c (Flocal_key_binding, Fuse_local_map) + (Fcurrent_local_map, push_key_description) + (Fdescribe_buffer_bindings): Use B_. + * keyboard.c (command_loop_1, read_char_minibuf_menu_prompt) + (read_key_sequence): Use B_. + * fringe.c (get_logical_cursor_bitmap) + (get_logical_fringe_bitmap, update_window_fringes): Use B_. + * xfns.c (x_create_tip_frame, Fx_show_tip): Use B_. + * xfaces.c (compute_char_face): Use B_. + * character.c (chars_in_text, Fget_byte): Use B_. + * category.c (check_category_table, Fcategory_table) + (Fset_category_table, char_category_set): Use B_. + * coding.c (decode_coding, encode_coding) + (make_conversion_work_buffer, decode_coding_gap) + (decode_coding_object, encode_coding_object) + (Fdetect_coding_region, Ffind_coding_systems_region_internal) + (Funencodable_char_position, Fcheck_coding_systems_region): Use + B_. + * charset.c (Ffind_charset_region): Use B_. + * window.c (window_display_table, unshow_buffer, window_loop) + (window_min_size_2, set_window_buffer, Fset_window_buffer) + (select_window, Fforce_window_update, temp_output_buffer_show) + (Fset_window_configuration, save_window_save): Use B_. + * xdisp.c (pos_visible_p, init_iterator, reseat_1) + (message_dolog, update_echo_area, ensure_echo_area_buffers) + (with_echo_area_buffer, setup_echo_area_for_printing) + (set_message_1, update_menu_bar, update_tool_bar) + (text_outside_line_unchanged_p, redisplay_internal) + (try_scrolling, try_cursor_movement, redisplay_window) + (try_window_reusing_current_matrix, row_containing_pos) + (try_window_id, get_overlay_arrow_glyph_row, display_line) + (Fcurrent_bidi_paragraph_direction, display_mode_lines) + (decode_mode_spec_coding, decode_mode_spec, display_count_lines) + (get_window_cursor_type, note_mouse_highlight): Use B_. + * frame.c (make_frame_visible_1): Use B_. + * dispnew.c (Fframe_or_buffer_changed_p): Use B_. + * dispextern.h (WINDOW_WANTS_HEADER_LINE_P) + (WINDOW_WANTS_MODELINE_P): Use B_. + * syntax.h (Vstandard_syntax_table): Update. + (CURRENT_SYNTAX_TABLE, SETUP_BUFFER_SYNTAX_TABLE): Use B_. + * intervals.h (TEXT_PROP_MEANS_INVISIBLE): Update. + (TEXT_PROP_MEANS_INVISIBLE): Use B_. + * character.h (FETCH_CHAR_ADVANCE): Update. + (INC_BOTH, ASCII_CHAR_WIDTH, DEC_BOTH): Use B_. + * category.h (Vstandard_category_table): Update. + * lisp.h (DEFVAR_BUFFER_DEFAULTS): Update for change to field + names. + (DOWNCASE_TABLE, UPCASE_TABLE): Use B_. + * buffer.c (swapfield_): New macro. + (Fbuffer_swap_text): Use swapfield_ where appropriate. + (Fbuffer_live_p, Fget_file_buffer, get_truename_buffer) + (Fget_buffer_create, clone_per_buffer_values) + (Fmake_indirect_buffer, reset_buffer) + (reset_buffer_local_variables, Fbuffer_name, Fbuffer_file_name) + (Fbuffer_local_value, buffer_lisp_local_variables) + (Fset_buffer_modified_p, Frestore_buffer_modified_p) + (Frename_buffer, Fother_buffer, Fbuffer_enable_undo) + (Fkill_buffer, Fset_buffer_major_mode, set_buffer_internal_1) + (set_buffer_temp, Fset_buffer, set_buffer_if_live) + (Fbarf_if_buffer_read_only, Fbury_buffer, Ferase_buffer) + (Fbuffer_swap_text, Fset_buffer_multibyte) + (swap_out_buffer_local_variables, record_overlay_string) + (overlay_strings, init_buffer_once, init_buffer, syms_of_buffer): + Use B_. + * buffer.h (struct buffer): Rename all Lisp_Object fields. + (BUFFER_INTERNAL_FIELD, B_): New macro. + (FETCH_CHAR, FETCH_CHAR_AS_MULTIBYTE): Use B_. + 2011-02-14 Jan Djärv * gtkutil.c (xg_tool_bar_menu_proxy): Handle case when tool bar label === modified file 'src/alloc.c' --- src/alloc.c 2011-02-07 02:05:30 +0000 +++ src/alloc.c 2011-02-14 15:39:19 +0000 @@ -3886,7 +3886,7 @@ must not have been killed. */ return (m->type == MEM_TYPE_BUFFER && p == m->start - && !NILP (((struct buffer *) p)->name)); + && !NILP (((struct buffer *) p)->BUFFER_INTERNAL_FIELD (name))); } #endif /* GC_MARK_STACK || defined GC_MALLOC_CHECK */ @@ -4872,11 +4872,11 @@ turned off in that buffer. Calling truncate_undo_list on Qt tends to return NULL, which effectively turns undo back on. So don't call truncate_undo_list if undo_list is Qt. */ - if (! NILP (nextb->name) && ! EQ (nextb->undo_list, Qt)) + if (! NILP (nextb->BUFFER_INTERNAL_FIELD (name)) && ! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt)) truncate_undo_list (nextb); /* Shrink buffer gaps, but skip indirect and dead buffers. */ - if (nextb->base_buffer == 0 && !NILP (nextb->name) + if (nextb->base_buffer == 0 && !NILP (nextb->BUFFER_INTERNAL_FIELD (name)) && ! nextb->text->inhibit_shrinking) { /* If a buffer's gap size is more than 10% of the buffer @@ -5009,10 +5009,10 @@ turned off in that buffer. Calling truncate_undo_list on Qt tends to return NULL, which effectively turns undo back on. So don't call truncate_undo_list if undo_list is Qt. */ - if (! EQ (nextb->undo_list, Qt)) + if (! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt)) { Lisp_Object tail, prev; - tail = nextb->undo_list; + tail = nextb->BUFFER_INTERNAL_FIELD (undo_list); prev = Qnil; while (CONSP (tail)) { @@ -5021,7 +5021,7 @@ && !XMARKER (XCAR (XCAR (tail)))->gcmarkbit) { if (NILP (prev)) - nextb->undo_list = tail = XCDR (tail); + nextb->BUFFER_INTERNAL_FIELD (undo_list) = tail = XCDR (tail); else { tail = XCDR (tail); @@ -5037,7 +5037,7 @@ } /* Now that we have stripped the elements that need not be in the undo_list any more, we can finally mark the list. */ - mark_object (nextb->undo_list); + mark_object (nextb->BUFFER_INTERNAL_FIELD (undo_list)); nextb = nextb->next; } @@ -5595,7 +5595,7 @@ /* buffer-local Lisp variables start at `undo_list', tho only the ones from `name' on are GC'd normally. */ - for (ptr = &buffer->name; + for (ptr = &buffer->BUFFER_INTERNAL_FIELD (name); (char *)ptr < (char *)buffer + sizeof (struct buffer); ptr++) mark_object (*ptr); === modified file 'src/buffer.c' --- src/buffer.c 2011-02-08 21:42:56 +0000 +++ src/buffer.c 2011-02-14 15:39:19 +0000 @@ -162,7 +162,7 @@ Value is nil if OBJECT is not a buffer or if it has been killed. */) (Lisp_Object object) { - return ((BUFFERP (object) && ! NILP (XBUFFER (object)->name)) + return ((BUFFERP (object) && ! NILP (B_ (XBUFFER (object), name))) ? Qt : Qnil); } @@ -266,8 +266,8 @@ { buf = Fcdr (XCAR (tail)); if (!BUFFERP (buf)) continue; - if (!STRINGP (XBUFFER (buf)->filename)) continue; - tem = Fstring_equal (XBUFFER (buf)->filename, filename); + if (!STRINGP (B_ (XBUFFER (buf), filename))) continue; + tem = Fstring_equal (B_ (XBUFFER (buf), filename), filename); if (!NILP (tem)) return buf; } @@ -283,8 +283,8 @@ { buf = Fcdr (XCAR (tail)); if (!BUFFERP (buf)) continue; - if (!STRINGP (XBUFFER (buf)->file_truename)) continue; - tem = Fstring_equal (XBUFFER (buf)->file_truename, filename); + if (!STRINGP (B_ (XBUFFER (buf), file_truename))) continue; + tem = Fstring_equal (B_ (XBUFFER (buf), file_truename), filename); if (!NILP (tem)) return buf; } @@ -353,7 +353,7 @@ b->newline_cache = 0; b->width_run_cache = 0; - b->width_table = Qnil; + B_ (b, width_table) = Qnil; b->prevent_redisplay_optimizations_p = 1; /* Put this on the chain of all buffers including killed ones. */ @@ -362,22 +362,22 @@ /* An ordinary buffer normally doesn't need markers to handle BEGV and ZV. */ - b->pt_marker = Qnil; - b->begv_marker = Qnil; - b->zv_marker = Qnil; + B_ (b, pt_marker) = Qnil; + B_ (b, begv_marker) = Qnil; + B_ (b, zv_marker) = Qnil; name = Fcopy_sequence (buffer_or_name); STRING_SET_INTERVALS (name, NULL_INTERVAL); - b->name = name; + B_ (b, name) = name; - b->undo_list = (SREF (name, 0) != ' ') ? Qnil : Qt; + B_ (b, undo_list) = (SREF (name, 0) != ' ') ? Qnil : Qt; reset_buffer (b); reset_buffer_local_variables (b, 1); - b->mark = Fmake_marker (); + B_ (b, mark) = Fmake_marker (); BUF_MARKERS (b) = NULL; - b->name = name; + B_ (b, name) = name; /* Put this in the alist of all live buffers. */ XSETBUFFER (buffer, b); @@ -486,7 +486,7 @@ /* Get (a copy of) the alist of Lisp-level local variables of FROM and install that in TO. */ - to->local_var_alist = buffer_lisp_local_variables (from); + B_ (to, local_var_alist) = buffer_lisp_local_variables (from); } DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer, @@ -512,7 +512,7 @@ base_buffer = Fget_buffer (base_buffer); if (NILP (base_buffer)) error ("No such buffer: `%s'", SDATA (tem)); - if (NILP (XBUFFER (base_buffer)->name)) + if (NILP (B_ (XBUFFER (base_buffer), name))) error ("Base buffer has been killed"); if (SCHARS (name) == 0) @@ -536,7 +536,7 @@ b->newline_cache = 0; b->width_run_cache = 0; - b->width_table = Qnil; + B_ (b, width_table) = Qnil; /* Put this on the chain of all buffers including killed ones. */ b->next = all_buffers; @@ -544,7 +544,7 @@ name = Fcopy_sequence (name); STRING_SET_INTERVALS (name, NULL_INTERVAL); - b->name = name; + B_ (b, name) = name; reset_buffer (b); reset_buffer_local_variables (b, 1); @@ -553,57 +553,57 @@ XSETBUFFER (buf, b); Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil)); - b->mark = Fmake_marker (); - b->name = name; + B_ (b, mark) = Fmake_marker (); + B_ (b, name) = name; /* The multibyte status belongs to the base buffer. */ - b->enable_multibyte_characters = b->base_buffer->enable_multibyte_characters; + B_ (b, enable_multibyte_characters) = B_ (b->base_buffer, enable_multibyte_characters); /* Make sure the base buffer has markers for its narrowing. */ - if (NILP (b->base_buffer->pt_marker)) + if (NILP (B_ (b->base_buffer, pt_marker))) { - b->base_buffer->pt_marker = Fmake_marker (); - set_marker_both (b->base_buffer->pt_marker, base_buffer, + B_ (b->base_buffer, pt_marker) = Fmake_marker (); + set_marker_both (B_ (b->base_buffer, pt_marker), base_buffer, BUF_PT (b->base_buffer), BUF_PT_BYTE (b->base_buffer)); } - if (NILP (b->base_buffer->begv_marker)) + if (NILP (B_ (b->base_buffer, begv_marker))) { - b->base_buffer->begv_marker = Fmake_marker (); - set_marker_both (b->base_buffer->begv_marker, base_buffer, + B_ (b->base_buffer, begv_marker) = Fmake_marker (); + set_marker_both (B_ (b->base_buffer, begv_marker), base_buffer, BUF_BEGV (b->base_buffer), BUF_BEGV_BYTE (b->base_buffer)); } - if (NILP (b->base_buffer->zv_marker)) + if (NILP (B_ (b->base_buffer, zv_marker))) { - b->base_buffer->zv_marker = Fmake_marker (); - set_marker_both (b->base_buffer->zv_marker, base_buffer, + B_ (b->base_buffer, zv_marker) = Fmake_marker (); + set_marker_both (B_ (b->base_buffer, zv_marker), base_buffer, BUF_ZV (b->base_buffer), BUF_ZV_BYTE (b->base_buffer)); - XMARKER (b->base_buffer->zv_marker)->insertion_type = 1; + XMARKER (B_ (b->base_buffer, zv_marker))->insertion_type = 1; } if (NILP (clone)) { /* Give the indirect buffer markers for its narrowing. */ - b->pt_marker = Fmake_marker (); - set_marker_both (b->pt_marker, buf, BUF_PT (b), BUF_PT_BYTE (b)); - b->begv_marker = Fmake_marker (); - set_marker_both (b->begv_marker, buf, BUF_BEGV (b), BUF_BEGV_BYTE (b)); - b->zv_marker = Fmake_marker (); - set_marker_both (b->zv_marker, buf, BUF_ZV (b), BUF_ZV_BYTE (b)); - XMARKER (b->zv_marker)->insertion_type = 1; + B_ (b, pt_marker) = Fmake_marker (); + set_marker_both (B_ (b, pt_marker), buf, BUF_PT (b), BUF_PT_BYTE (b)); + B_ (b, begv_marker) = Fmake_marker (); + set_marker_both (B_ (b, begv_marker), buf, BUF_BEGV (b), BUF_BEGV_BYTE (b)); + B_ (b, zv_marker) = Fmake_marker (); + set_marker_both (B_ (b, zv_marker), buf, BUF_ZV (b), BUF_ZV_BYTE (b)); + XMARKER (B_ (b, zv_marker))->insertion_type = 1; } else { struct buffer *old_b = current_buffer; clone_per_buffer_values (b->base_buffer, b); - b->filename = Qnil; - b->file_truename = Qnil; - b->display_count = make_number (0); - b->backed_up = Qnil; - b->auto_save_file_name = Qnil; + B_ (b, filename) = Qnil; + B_ (b, file_truename) = Qnil; + B_ (b, display_count) = make_number (0); + B_ (b, backed_up) = Qnil; + B_ (b, auto_save_file_name) = Qnil; set_buffer_internal_1 (b); Fset (intern ("buffer-save-without-query"), Qnil); Fset (intern ("buffer-file-number"), Qnil); @@ -647,34 +647,34 @@ void reset_buffer (register struct buffer *b) { - b->filename = Qnil; - b->file_truename = Qnil; - b->directory = (current_buffer) ? current_buffer->directory : Qnil; + B_ (b, filename) = Qnil; + B_ (b, file_truename) = Qnil; + B_ (b, directory) = (current_buffer) ? B_ (current_buffer, directory) : Qnil; b->modtime = 0; b->modtime_size = -1; - XSETFASTINT (b->save_length, 0); + XSETFASTINT (B_ (b, save_length), 0); b->last_window_start = 1; /* It is more conservative to start out "changed" than "unchanged". */ b->clip_changed = 0; b->prevent_redisplay_optimizations_p = 1; - b->backed_up = Qnil; + B_ (b, backed_up) = Qnil; BUF_AUTOSAVE_MODIFF (b) = 0; b->auto_save_failure_time = -1; - b->auto_save_file_name = Qnil; - b->read_only = Qnil; + B_ (b, auto_save_file_name) = Qnil; + B_ (b, read_only) = Qnil; b->overlays_before = NULL; b->overlays_after = NULL; b->overlay_center = BEG; - b->mark_active = Qnil; - b->point_before_scroll = Qnil; - b->file_format = Qnil; - b->auto_save_file_format = Qt; - b->last_selected_window = Qnil; - XSETINT (b->display_count, 0); - b->display_time = Qnil; - b->enable_multibyte_characters = buffer_defaults.enable_multibyte_characters; - b->cursor_type = buffer_defaults.cursor_type; - b->extra_line_spacing = buffer_defaults.extra_line_spacing; + B_ (b, mark_active) = Qnil; + B_ (b, point_before_scroll) = Qnil; + B_ (b, file_format) = Qnil; + B_ (b, auto_save_file_format) = Qt; + B_ (b, last_selected_window) = Qnil; + XSETINT (B_ (b, display_count), 0); + B_ (b, display_time) = Qnil; + B_ (b, enable_multibyte_characters) = B_ (&buffer_defaults, enable_multibyte_characters); + B_ (b, cursor_type) = B_ (&buffer_defaults, cursor_type); + B_ (b, extra_line_spacing) = B_ (&buffer_defaults, extra_line_spacing); b->display_error_modiff = 0; } @@ -698,10 +698,10 @@ things that depend on the major mode. default-major-mode is handled at a higher level. We ignore it here. */ - b->major_mode = Qfundamental_mode; - b->keymap = Qnil; - b->mode_name = QSFundamental; - b->minor_modes = Qnil; + B_ (b, major_mode) = Qfundamental_mode; + B_ (b, keymap) = Qnil; + B_ (b, mode_name) = QSFundamental; + B_ (b, minor_modes) = Qnil; /* If the standard case table has been altered and invalidated, fix up its insides first. */ @@ -710,22 +710,22 @@ && CHAR_TABLE_P (XCHAR_TABLE (Vascii_downcase_table)->extras[2]))) Fset_standard_case_table (Vascii_downcase_table); - b->downcase_table = Vascii_downcase_table; - b->upcase_table = XCHAR_TABLE (Vascii_downcase_table)->extras[0]; - b->case_canon_table = XCHAR_TABLE (Vascii_downcase_table)->extras[1]; - b->case_eqv_table = XCHAR_TABLE (Vascii_downcase_table)->extras[2]; - b->invisibility_spec = Qt; + B_ (b, downcase_table) = Vascii_downcase_table; + B_ (b, upcase_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[0]; + B_ (b, case_canon_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[1]; + B_ (b, case_eqv_table) = XCHAR_TABLE (Vascii_downcase_table)->extras[2]; + B_ (b, invisibility_spec) = Qt; #ifndef DOS_NT - b->buffer_file_type = Qnil; + B_ (b, buffer_file_type) = Qnil; #endif /* Reset all (or most) per-buffer variables to their defaults. */ if (permanent_too) - b->local_var_alist = Qnil; + B_ (b, local_var_alist) = Qnil; else { Lisp_Object tmp, prop, last = Qnil; - for (tmp = b->local_var_alist; CONSP (tmp); tmp = XCDR (tmp)) + for (tmp = B_ (b, local_var_alist); CONSP (tmp); tmp = XCDR (tmp)) if (!NILP (prop = Fget (XCAR (XCAR (tmp)), Qpermanent_local))) { /* If permanent-local, keep it. */ @@ -755,7 +755,7 @@ } /* Delete this local variable. */ else if (NILP (last)) - b->local_var_alist = XCDR (tmp); + B_ (b, local_var_alist) = XCDR (tmp); else XSETCDR (last, XCDR (tmp)); } @@ -830,9 +830,9 @@ (register Lisp_Object buffer) { if (NILP (buffer)) - return current_buffer->name; + return B_ (current_buffer, name); CHECK_BUFFER (buffer); - return XBUFFER (buffer)->name; + return B_ (XBUFFER (buffer), name); } DEFUN ("buffer-file-name", Fbuffer_file_name, Sbuffer_file_name, 0, 1, 0, @@ -841,9 +841,9 @@ (register Lisp_Object buffer) { if (NILP (buffer)) - return current_buffer->filename; + return B_ (current_buffer, filename); CHECK_BUFFER (buffer); - return XBUFFER (buffer)->filename; + return B_ (XBUFFER (buffer), filename); } DEFUN ("buffer-base-buffer", Fbuffer_base_buffer, Sbuffer_base_buffer, @@ -895,7 +895,7 @@ { /* Look in local_var_alist. */ struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym); XSETSYMBOL (variable, sym); /* Update In case of aliasing. */ - result = Fassoc (variable, buf->local_var_alist); + result = Fassoc (variable, B_ (buf, local_var_alist)); if (!NILP (result)) { if (blv->fwd) @@ -944,7 +944,7 @@ { Lisp_Object result = Qnil; register Lisp_Object tail; - for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) + for (tail = B_ (buf, local_var_alist); CONSP (tail); tail = XCDR (tail)) { Lisp_Object val, elt; @@ -1043,9 +1043,9 @@ /* If buffer becoming modified, lock the file. If buffer becoming unmodified, unlock the file. */ - fn = current_buffer->file_truename; + fn = B_ (current_buffer, file_truename); /* Test buffer-file-name so that binding it to nil is effective. */ - if (!NILP (fn) && ! NILP (current_buffer->filename)) + if (!NILP (fn) && ! NILP (B_ (current_buffer, filename))) { already = SAVE_MODIFF < MODIFF; if (!already && !NILP (flag)) @@ -1110,9 +1110,9 @@ /* If buffer becoming modified, lock the file. If buffer becoming unmodified, unlock the file. */ - fn = current_buffer->file_truename; + fn = B_ (current_buffer, file_truename); /* Test buffer-file-name so that binding it to nil is effective. */ - if (!NILP (fn) && ! NILP (current_buffer->filename)) + if (!NILP (fn) && ! NILP (B_ (current_buffer, filename))) { int already = SAVE_MODIFF < MODIFF; if (!already && !NILP (flag)) @@ -1199,14 +1199,14 @@ with the original name. It makes UNIQUE equivalent to (rename-buffer (generate-new-buffer-name NEWNAME)). */ if (NILP (unique) && XBUFFER (tem) == current_buffer) - return current_buffer->name; + return B_ (current_buffer, name); if (!NILP (unique)) - newname = Fgenerate_new_buffer_name (newname, current_buffer->name); + newname = Fgenerate_new_buffer_name (newname, B_ (current_buffer, name)); else error ("Buffer name `%s' is in use", SDATA (newname)); } - current_buffer->name = newname; + B_ (current_buffer, name) = newname; /* Catch redisplay's attention. Unless we do this, the mode lines for any windows displaying current_buffer will stay unchanged. */ @@ -1214,11 +1214,11 @@ XSETBUFFER (buf, current_buffer); Fsetcar (Frassq (buf, Vbuffer_alist), newname); - if (NILP (current_buffer->filename) - && !NILP (current_buffer->auto_save_file_name)) + if (NILP (B_ (current_buffer, filename)) + && !NILP (B_ (current_buffer, auto_save_file_name))) call0 (intern ("rename-auto-save-file")); /* Refetch since that last call may have done GC. */ - return current_buffer->name; + return B_ (current_buffer, name); } DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 3, 0, @@ -1263,9 +1263,9 @@ continue; if (NILP (buf)) continue; - if (NILP (XBUFFER (buf)->name)) + if (NILP (B_ (XBUFFER (buf), name))) continue; - if (SREF (XBUFFER (buf)->name, 0) == ' ') + if (SREF (B_ (XBUFFER (buf), name), 0) == ' ') continue; /* If the selected frame has a buffer_predicate, disregard buffers that don't fit the predicate. */ @@ -1313,8 +1313,8 @@ nsberror (buffer); } - if (EQ (XBUFFER (real_buffer)->undo_list, Qt)) - XBUFFER (real_buffer)->undo_list = Qnil; + if (EQ (B_ (XBUFFER (real_buffer), undo_list), Qt)) + B_ (XBUFFER (real_buffer), undo_list) = Qnil; return Qnil; } @@ -1359,16 +1359,16 @@ b = XBUFFER (buffer); /* Avoid trouble for buffer already dead. */ - if (NILP (b->name)) + if (NILP (B_ (b, name))) return Qnil; /* Query if the buffer is still modified. */ - if (INTERACTIVE && !NILP (b->filename) + if (INTERACTIVE && !NILP (B_ (b, filename)) && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) { GCPRO1 (buffer); tem = do_yes_or_no_p (format2 ("Buffer %s modified; kill anyway? ", - b->name, make_number (0))); + B_ (b, name), make_number (0))); UNGCPRO; if (NILP (tem)) return Qnil; @@ -1402,7 +1402,7 @@ if (EQ (buffer, XWINDOW (minibuf_window)->buffer)) return Qnil; - if (NILP (b->name)) + if (NILP (B_ (b, name))) return Qnil; /* When we kill a base buffer, kill all its indirect buffers. @@ -1417,7 +1417,7 @@ for (other = all_buffers; other; other = other->next) /* all_buffers contains dead buffers too; don't re-kill them. */ - if (other->base_buffer == b && !NILP (other->name)) + if (other->base_buffer == b && !NILP (B_ (other, name))) { Lisp_Object buffer; XSETBUFFER (buffer, other); @@ -1462,7 +1462,7 @@ /* Killing buffer processes may run sentinels which may have called kill-buffer. */ - if (NILP (b->name)) + if (NILP (B_ (b, name))) return Qnil; clear_charpos_cache (b); @@ -1476,7 +1476,7 @@ /* Delete any auto-save file, if we saved it in this session. But not if the buffer is modified. */ - if (STRINGP (b->auto_save_file_name) + if (STRINGP (B_ (b, auto_save_file_name)) && BUF_AUTOSAVE_MODIFF (b) != 0 && BUF_SAVE_MODIFF (b) < BUF_AUTOSAVE_MODIFF (b) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b) @@ -1485,7 +1485,7 @@ Lisp_Object tem; tem = Fsymbol_value (intern ("delete-auto-save-files")); if (! NILP (tem)) - internal_delete_file (b->auto_save_file_name); + internal_delete_file (B_ (b, auto_save_file_name)); } if (b->base_buffer) @@ -1525,7 +1525,7 @@ swap_out_buffer_local_variables (b); reset_buffer_local_variables (b, 1); - b->name = Qnil; + B_ (b, name) = Qnil; BLOCK_INPUT; if (! b->base_buffer) @@ -1541,9 +1541,9 @@ free_region_cache (b->width_run_cache); b->width_run_cache = 0; } - b->width_table = Qnil; + B_ (b, width_table) = Qnil; UNBLOCK_INPUT; - b->undo_list = Qnil; + B_ (b, undo_list) = Qnil; return Qt; } @@ -1637,15 +1637,15 @@ CHECK_BUFFER (buffer); - if (STRINGP (XBUFFER (buffer)->name) - && strcmp (SSDATA (XBUFFER (buffer)->name), "*scratch*") == 0) + if (STRINGP (B_ (XBUFFER (buffer), name)) + && strcmp (SSDATA (B_ (XBUFFER (buffer), name)), "*scratch*") == 0) function = find_symbol_value (intern ("initial-major-mode")); else { - function = buffer_defaults.major_mode; + function = B_ (&buffer_defaults, major_mode); if (NILP (function) - && NILP (Fget (current_buffer->major_mode, Qmode_class))) - function = current_buffer->major_mode; + && NILP (Fget (B_ (current_buffer, major_mode), Qmode_class))) + function = B_ (current_buffer, major_mode); } if (NILP (function) || EQ (function, Qfundamental_mode)) @@ -1795,29 +1795,29 @@ /* Put the undo list back in the base buffer, so that it appears that an indirect buffer shares the undo list of its base. */ if (old_buf->base_buffer) - old_buf->base_buffer->undo_list = old_buf->undo_list; + B_ (old_buf->base_buffer, undo_list) = B_ (old_buf, undo_list); /* If the old current buffer has markers to record PT, BEGV and ZV when it is not current, update them now. */ - if (! NILP (old_buf->pt_marker)) + if (! NILP (B_ (old_buf, pt_marker))) { Lisp_Object obuf; XSETBUFFER (obuf, old_buf); - set_marker_both (old_buf->pt_marker, obuf, + set_marker_both (B_ (old_buf, pt_marker), obuf, BUF_PT (old_buf), BUF_PT_BYTE (old_buf)); } - if (! NILP (old_buf->begv_marker)) + if (! NILP (B_ (old_buf, begv_marker))) { Lisp_Object obuf; XSETBUFFER (obuf, old_buf); - set_marker_both (old_buf->begv_marker, obuf, + set_marker_both (B_ (old_buf, begv_marker), obuf, BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf)); } - if (! NILP (old_buf->zv_marker)) + if (! NILP (B_ (old_buf, zv_marker))) { Lisp_Object obuf; XSETBUFFER (obuf, old_buf); - set_marker_both (old_buf->zv_marker, obuf, + set_marker_both (B_ (old_buf, zv_marker), obuf, BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf)); } } @@ -1825,24 +1825,24 @@ /* Get the undo list from the base buffer, so that it appears that an indirect buffer shares the undo list of its base. */ if (b->base_buffer) - b->undo_list = b->base_buffer->undo_list; + B_ (b, undo_list) = B_ (b->base_buffer, undo_list); /* If the new current buffer has markers to record PT, BEGV and ZV when it is not current, fetch them now. */ - if (! NILP (b->pt_marker)) - { - BUF_PT (b) = marker_position (b->pt_marker); - BUF_PT_BYTE (b) = marker_byte_position (b->pt_marker); - } - if (! NILP (b->begv_marker)) - { - BUF_BEGV (b) = marker_position (b->begv_marker); - BUF_BEGV_BYTE (b) = marker_byte_position (b->begv_marker); - } - if (! NILP (b->zv_marker)) - { - BUF_ZV (b) = marker_position (b->zv_marker); - BUF_ZV_BYTE (b) = marker_byte_position (b->zv_marker); + if (! NILP (B_ (b, pt_marker))) + { + BUF_PT (b) = marker_position (B_ (b, pt_marker)); + BUF_PT_BYTE (b) = marker_byte_position (B_ (b, pt_marker)); + } + if (! NILP (B_ (b, begv_marker))) + { + BUF_BEGV (b) = marker_position (B_ (b, begv_marker)); + BUF_BEGV_BYTE (b) = marker_byte_position (B_ (b, begv_marker)); + } + if (! NILP (B_ (b, zv_marker))) + { + BUF_ZV (b) = marker_position (B_ (b, zv_marker)); + BUF_ZV_BYTE (b) = marker_byte_position (B_ (b, zv_marker)); } /* Look down buffer's list of local Lisp variables @@ -1850,7 +1850,7 @@ do { - for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail)) + for (tail = B_ (b, local_var_alist); CONSP (tail); tail = XCDR (tail)) { Lisp_Object var = XCAR (XCAR (tail)); struct Lisp_Symbol *sym = XSYMBOL (var); @@ -1883,45 +1883,45 @@ { /* If the old current buffer has markers to record PT, BEGV and ZV when it is not current, update them now. */ - if (! NILP (old_buf->pt_marker)) + if (! NILP (B_ (old_buf, pt_marker))) { Lisp_Object obuf; XSETBUFFER (obuf, old_buf); - set_marker_both (old_buf->pt_marker, obuf, + set_marker_both (B_ (old_buf, pt_marker), obuf, BUF_PT (old_buf), BUF_PT_BYTE (old_buf)); } - if (! NILP (old_buf->begv_marker)) + if (! NILP (B_ (old_buf, begv_marker))) { Lisp_Object obuf; XSETBUFFER (obuf, old_buf); - set_marker_both (old_buf->begv_marker, obuf, + set_marker_both (B_ (old_buf, begv_marker), obuf, BUF_BEGV (old_buf), BUF_BEGV_BYTE (old_buf)); } - if (! NILP (old_buf->zv_marker)) + if (! NILP (B_ (old_buf, zv_marker))) { Lisp_Object obuf; XSETBUFFER (obuf, old_buf); - set_marker_both (old_buf->zv_marker, obuf, + set_marker_both (B_ (old_buf, zv_marker), obuf, BUF_ZV (old_buf), BUF_ZV_BYTE (old_buf)); } } /* If the new current buffer has markers to record PT, BEGV and ZV when it is not current, fetch them now. */ - if (! NILP (b->pt_marker)) - { - BUF_PT (b) = marker_position (b->pt_marker); - BUF_PT_BYTE (b) = marker_byte_position (b->pt_marker); - } - if (! NILP (b->begv_marker)) - { - BUF_BEGV (b) = marker_position (b->begv_marker); - BUF_BEGV_BYTE (b) = marker_byte_position (b->begv_marker); - } - if (! NILP (b->zv_marker)) - { - BUF_ZV (b) = marker_position (b->zv_marker); - BUF_ZV_BYTE (b) = marker_byte_position (b->zv_marker); + if (! NILP (B_ (b, pt_marker))) + { + BUF_PT (b) = marker_position (B_ (b, pt_marker)); + BUF_PT_BYTE (b) = marker_byte_position (B_ (b, pt_marker)); + } + if (! NILP (B_ (b, begv_marker))) + { + BUF_BEGV (b) = marker_position (B_ (b, begv_marker)); + BUF_BEGV_BYTE (b) = marker_byte_position (B_ (b, begv_marker)); + } + if (! NILP (B_ (b, zv_marker))) + { + BUF_ZV (b) = marker_position (B_ (b, zv_marker)); + BUF_ZV_BYTE (b) = marker_byte_position (B_ (b, zv_marker)); } } @@ -1938,7 +1938,7 @@ buffer = Fget_buffer (buffer_or_name); if (NILP (buffer)) nsberror (buffer_or_name); - if (NILP (XBUFFER (buffer)->name)) + if (NILP (B_ (XBUFFER (buffer), name))) error ("Selecting deleted buffer"); set_buffer_internal (XBUFFER (buffer)); return buffer; @@ -1949,7 +1949,7 @@ Lisp_Object set_buffer_if_live (Lisp_Object buffer) { - if (! NILP (XBUFFER (buffer)->name)) + if (! NILP (B_ (XBUFFER (buffer), name))) Fset_buffer (buffer); return Qnil; } @@ -1959,7 +1959,7 @@ doc: /* Signal a `buffer-read-only' error if the current buffer is read-only. */) (void) { - if (!NILP (current_buffer->read_only) + if (!NILP (B_ (current_buffer, read_only)) && NILP (Vinhibit_read_only)) xsignal1 (Qbuffer_read_only, Fcurrent_buffer ()); return Qnil; @@ -2008,7 +2008,7 @@ /* Move buffer to the end of the buffer list. Do nothing if the buffer is killed. */ - if (!NILP (XBUFFER (buffer)->name)) + if (!NILP (B_ (XBUFFER (buffer), name))) { Lisp_Object aelt, link; @@ -2041,7 +2041,7 @@ /* Prevent warnings, or suspension of auto saving, that would happen if future size is less than past size. Use of erase-buffer implies that the future text is not really related to the past text. */ - XSETFASTINT (current_buffer->save_length, 0); + XSETFASTINT (B_ (current_buffer, save_length), 0); return Qnil; } @@ -2111,7 +2111,7 @@ CHECK_BUFFER (buffer); other_buffer = XBUFFER (buffer); - if (NILP (other_buffer->name)) + if (NILP (B_ (other_buffer, name))) error ("Cannot swap a dead buffer's text"); /* Actually, it probably works just fine. @@ -2138,6 +2138,12 @@ other_buffer->field = current_buffer->field; \ current_buffer->field = tmp##field; \ } while (0) +#define swapfield_(field, type) \ + do { \ + type tmp##field = B_ (other_buffer, field); \ + B_ (other_buffer, field) = B_ (current_buffer, field); \ + B_ (current_buffer, field) = tmp##field; \ + } while (0) swapfield (own_text, struct buffer_text); eassert (current_buffer->text == ¤t_buffer->own_text); @@ -2165,18 +2171,18 @@ swapfield (overlays_before, struct Lisp_Overlay *); swapfield (overlays_after, struct Lisp_Overlay *); swapfield (overlay_center, EMACS_INT); - swapfield (undo_list, Lisp_Object); - swapfield (mark, Lisp_Object); - swapfield (enable_multibyte_characters, Lisp_Object); - swapfield (bidi_display_reordering, Lisp_Object); - swapfield (bidi_paragraph_direction, Lisp_Object); + swapfield_ (undo_list, Lisp_Object); + swapfield_ (mark, Lisp_Object); + swapfield_ (enable_multibyte_characters, Lisp_Object); + swapfield_ (bidi_display_reordering, Lisp_Object); + swapfield_ (bidi_paragraph_direction, Lisp_Object); /* FIXME: Not sure what we should do with these *_marker fields. Hopefully they're just nil anyway. */ - swapfield (pt_marker, Lisp_Object); - swapfield (begv_marker, Lisp_Object); - swapfield (zv_marker, Lisp_Object); - current_buffer->point_before_scroll = Qnil; - other_buffer->point_before_scroll = Qnil; + swapfield_ (pt_marker, Lisp_Object); + swapfield_ (begv_marker, Lisp_Object); + swapfield_ (zv_marker, Lisp_Object); + B_ (current_buffer, point_before_scroll) = Qnil; + B_ (other_buffer, point_before_scroll) = Qnil; current_buffer->text->modiff++; other_buffer->text->modiff++; current_buffer->text->chars_modiff++; other_buffer->text->chars_modiff++; @@ -2250,21 +2256,21 @@ EMACS_INT begv, zv; int narrowed = (BEG != BEGV || Z != ZV); int modified_p = !NILP (Fbuffer_modified_p (Qnil)); - Lisp_Object old_undo = current_buffer->undo_list; + Lisp_Object old_undo = B_ (current_buffer, undo_list); struct gcpro gcpro1; if (current_buffer->base_buffer) error ("Cannot do `set-buffer-multibyte' on an indirect buffer"); /* Do nothing if nothing actually changes. */ - if (NILP (flag) == NILP (current_buffer->enable_multibyte_characters)) + if (NILP (flag) == NILP (B_ (current_buffer, enable_multibyte_characters))) return flag; GCPRO1 (old_undo); /* Don't record these buffer changes. We will put a special undo entry instead. */ - current_buffer->undo_list = Qt; + B_ (current_buffer, undo_list) = Qt; /* If the cached position is for this buffer, clear it out. */ clear_charpos_cache (current_buffer); @@ -2286,7 +2292,7 @@ to calculate the old correspondences. */ set_intervals_multibyte (0); - current_buffer->enable_multibyte_characters = Qnil; + B_ (current_buffer, enable_multibyte_characters) = Qnil; Z = Z_BYTE; BEGV = BEGV_BYTE; @@ -2424,7 +2430,7 @@ /* Do this first, so that chars_in_text asks the right question. set_intervals_multibyte needs it too. */ - current_buffer->enable_multibyte_characters = Qt; + B_ (current_buffer, enable_multibyte_characters) = Qt; GPT_BYTE = advance_to_char_boundary (GPT_BYTE); GPT = chars_in_text (BEG_ADDR, GPT_BYTE - BEG_BYTE) + BEG; @@ -2482,7 +2488,7 @@ if (!EQ (old_undo, Qt)) { /* Represent all the above changes by a special undo entry. */ - current_buffer->undo_list = Fcons (list3 (Qapply, + B_ (current_buffer, undo_list) = Fcons (list3 (Qapply, intern ("set-buffer-multibyte"), NILP (flag) ? Qt : Qnil), old_undo); @@ -2498,10 +2504,10 @@ /* Copy this buffer's new multibyte status into all of its indirect buffers. */ for (other = all_buffers; other; other = other->next) - if (other->base_buffer == current_buffer && !NILP (other->name)) + if (other->base_buffer == current_buffer && !NILP (B_ (other, name))) { - other->enable_multibyte_characters - = current_buffer->enable_multibyte_characters; + B_ (other, enable_multibyte_characters) + = B_ (current_buffer, enable_multibyte_characters); other->prevent_redisplay_optimizations_p = 1; } @@ -2568,7 +2574,7 @@ Lisp_Object oalist, alist, buffer; XSETBUFFER (buffer, b); - oalist = b->local_var_alist; + oalist = B_ (b, local_var_alist); for (alist = oalist; CONSP (alist); alist = XCDR (alist)) { @@ -3072,7 +3078,7 @@ ssl->buf[ssl->used].priority = (INTEGERP (pri) ? XINT (pri) : 0); ssl->used++; - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) nbytes = SCHARS (str); else if (! STRING_MULTIBYTE (str)) nbytes = count_size_as_multibyte (SDATA (str), @@ -3084,7 +3090,7 @@ if (STRINGP (str2)) { - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) nbytes = SCHARS (str2); else if (! STRING_MULTIBYTE (str2)) nbytes = count_size_as_multibyte (SDATA (str2), @@ -3114,7 +3120,7 @@ Lisp_Object overlay, window, str; struct Lisp_Overlay *ov; EMACS_INT startpos, endpos; - int multibyte = ! NILP (current_buffer->enable_multibyte_characters); + int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); overlay_heads.used = overlay_heads.bytes = 0; overlay_tails.used = overlay_tails.bytes = 0; @@ -4985,9 +4991,9 @@ /* Make sure all markable slots in buffer_defaults are initialized reasonably, so mark_buffer won't choke. */ reset_buffer (&buffer_defaults); - eassert (EQ (buffer_defaults.name, make_number (0))); + eassert (EQ (B_ (&buffer_defaults, name), make_number (0))); reset_buffer_local_variables (&buffer_defaults, 1); - eassert (EQ (buffer_local_symbols.name, make_number (0))); + eassert (EQ (B_ (&buffer_local_symbols, name), make_number (0))); reset_buffer (&buffer_local_symbols); reset_buffer_local_variables (&buffer_local_symbols, 1); /* Prevent GC from getting confused. */ @@ -5004,60 +5010,60 @@ /* Must do these before making the first buffer! */ /* real setup is done in bindings.el */ - buffer_defaults.mode_line_format = make_pure_c_string ("%-"); - buffer_defaults.header_line_format = Qnil; - buffer_defaults.abbrev_mode = Qnil; - buffer_defaults.overwrite_mode = Qnil; - buffer_defaults.case_fold_search = Qt; - buffer_defaults.auto_fill_function = Qnil; - buffer_defaults.selective_display = Qnil; + B_ (&buffer_defaults, mode_line_format) = make_pure_c_string ("%-"); + B_ (&buffer_defaults, header_line_format) = Qnil; + B_ (&buffer_defaults, abbrev_mode) = Qnil; + B_ (&buffer_defaults, overwrite_mode) = Qnil; + B_ (&buffer_defaults, case_fold_search) = Qt; + B_ (&buffer_defaults, auto_fill_function) = Qnil; + B_ (&buffer_defaults, selective_display) = Qnil; #ifndef old - buffer_defaults.selective_display_ellipses = Qt; + B_ (&buffer_defaults, selective_display_ellipses) = Qt; #endif - buffer_defaults.abbrev_table = Qnil; - buffer_defaults.display_table = Qnil; - buffer_defaults.undo_list = Qnil; - buffer_defaults.mark_active = Qnil; - buffer_defaults.file_format = Qnil; - buffer_defaults.auto_save_file_format = Qt; + B_ (&buffer_defaults, abbrev_table) = Qnil; + B_ (&buffer_defaults, display_table) = Qnil; + B_ (&buffer_defaults, undo_list) = Qnil; + B_ (&buffer_defaults, mark_active) = Qnil; + B_ (&buffer_defaults, file_format) = Qnil; + B_ (&buffer_defaults, auto_save_file_format) = Qt; buffer_defaults.overlays_before = NULL; buffer_defaults.overlays_after = NULL; buffer_defaults.overlay_center = BEG; - XSETFASTINT (buffer_defaults.tab_width, 8); - buffer_defaults.truncate_lines = Qnil; - buffer_defaults.word_wrap = Qnil; - buffer_defaults.ctl_arrow = Qt; - buffer_defaults.bidi_display_reordering = Qnil; - buffer_defaults.bidi_paragraph_direction = Qnil; - buffer_defaults.cursor_type = Qt; - buffer_defaults.extra_line_spacing = Qnil; - buffer_defaults.cursor_in_non_selected_windows = Qt; + XSETFASTINT (B_ (&buffer_defaults, tab_width), 8); + B_ (&buffer_defaults, truncate_lines) = Qnil; + B_ (&buffer_defaults, word_wrap) = Qnil; + B_ (&buffer_defaults, ctl_arrow) = Qt; + B_ (&buffer_defaults, bidi_display_reordering) = Qnil; + B_ (&buffer_defaults, bidi_paragraph_direction) = Qnil; + B_ (&buffer_defaults, cursor_type) = Qt; + B_ (&buffer_defaults, extra_line_spacing) = Qnil; + B_ (&buffer_defaults, cursor_in_non_selected_windows) = Qt; #ifdef DOS_NT buffer_defaults.buffer_file_type = Qnil; /* TEXT */ #endif - buffer_defaults.enable_multibyte_characters = Qt; - buffer_defaults.buffer_file_coding_system = Qnil; - XSETFASTINT (buffer_defaults.fill_column, 70); - XSETFASTINT (buffer_defaults.left_margin, 0); - buffer_defaults.cache_long_line_scans = Qnil; - buffer_defaults.file_truename = Qnil; - XSETFASTINT (buffer_defaults.display_count, 0); - XSETFASTINT (buffer_defaults.left_margin_cols, 0); - XSETFASTINT (buffer_defaults.right_margin_cols, 0); - buffer_defaults.left_fringe_width = Qnil; - buffer_defaults.right_fringe_width = Qnil; - buffer_defaults.fringes_outside_margins = Qnil; - buffer_defaults.scroll_bar_width = Qnil; - buffer_defaults.vertical_scroll_bar_type = Qt; - buffer_defaults.indicate_empty_lines = Qnil; - buffer_defaults.indicate_buffer_boundaries = Qnil; - buffer_defaults.fringe_indicator_alist = Qnil; - buffer_defaults.fringe_cursor_alist = Qnil; - buffer_defaults.scroll_up_aggressively = Qnil; - buffer_defaults.scroll_down_aggressively = Qnil; - buffer_defaults.display_time = Qnil; + B_ (&buffer_defaults, enable_multibyte_characters) = Qt; + B_ (&buffer_defaults, buffer_file_coding_system) = Qnil; + XSETFASTINT (B_ (&buffer_defaults, fill_column), 70); + XSETFASTINT (B_ (&buffer_defaults, left_margin), 0); + B_ (&buffer_defaults, cache_long_line_scans) = Qnil; + B_ (&buffer_defaults, file_truename) = Qnil; + XSETFASTINT (B_ (&buffer_defaults, display_count), 0); + XSETFASTINT (B_ (&buffer_defaults, left_margin_cols), 0); + XSETFASTINT (B_ (&buffer_defaults, right_margin_cols), 0); + B_ (&buffer_defaults, left_fringe_width) = Qnil; + B_ (&buffer_defaults, right_fringe_width) = Qnil; + B_ (&buffer_defaults, fringes_outside_margins) = Qnil; + B_ (&buffer_defaults, scroll_bar_width) = Qnil; + B_ (&buffer_defaults, vertical_scroll_bar_type) = Qt; + B_ (&buffer_defaults, indicate_empty_lines) = Qnil; + B_ (&buffer_defaults, indicate_buffer_boundaries) = Qnil; + B_ (&buffer_defaults, fringe_indicator_alist) = Qnil; + B_ (&buffer_defaults, fringe_cursor_alist) = Qnil; + B_ (&buffer_defaults, scroll_up_aggressively) = Qnil; + B_ (&buffer_defaults, scroll_down_aggressively) = Qnil; + B_ (&buffer_defaults, display_time) = Qnil; /* Assign the local-flags to the slots that have default values. The local flag is a bit that is used in the buffer @@ -5069,73 +5075,73 @@ /* 0 means not a lisp var, -1 means always local, else mask */ memset (&buffer_local_flags, 0, sizeof buffer_local_flags); - XSETINT (buffer_local_flags.filename, -1); - XSETINT (buffer_local_flags.directory, -1); - XSETINT (buffer_local_flags.backed_up, -1); - XSETINT (buffer_local_flags.save_length, -1); - XSETINT (buffer_local_flags.auto_save_file_name, -1); - XSETINT (buffer_local_flags.read_only, -1); - XSETINT (buffer_local_flags.major_mode, -1); - XSETINT (buffer_local_flags.mode_name, -1); - XSETINT (buffer_local_flags.undo_list, -1); - XSETINT (buffer_local_flags.mark_active, -1); - XSETINT (buffer_local_flags.point_before_scroll, -1); - XSETINT (buffer_local_flags.file_truename, -1); - XSETINT (buffer_local_flags.invisibility_spec, -1); - XSETINT (buffer_local_flags.file_format, -1); - XSETINT (buffer_local_flags.auto_save_file_format, -1); - XSETINT (buffer_local_flags.display_count, -1); - XSETINT (buffer_local_flags.display_time, -1); - XSETINT (buffer_local_flags.enable_multibyte_characters, -1); + XSETINT (B_ (&buffer_local_flags, filename), -1); + XSETINT (B_ (&buffer_local_flags, directory), -1); + XSETINT (B_ (&buffer_local_flags, backed_up), -1); + XSETINT (B_ (&buffer_local_flags, save_length), -1); + XSETINT (B_ (&buffer_local_flags, auto_save_file_name), -1); + XSETINT (B_ (&buffer_local_flags, read_only), -1); + XSETINT (B_ (&buffer_local_flags, major_mode), -1); + XSETINT (B_ (&buffer_local_flags, mode_name), -1); + XSETINT (B_ (&buffer_local_flags, undo_list), -1); + XSETINT (B_ (&buffer_local_flags, mark_active), -1); + XSETINT (B_ (&buffer_local_flags, point_before_scroll), -1); + XSETINT (B_ (&buffer_local_flags, file_truename), -1); + XSETINT (B_ (&buffer_local_flags, invisibility_spec), -1); + XSETINT (B_ (&buffer_local_flags, file_format), -1); + XSETINT (B_ (&buffer_local_flags, auto_save_file_format), -1); + XSETINT (B_ (&buffer_local_flags, display_count), -1); + XSETINT (B_ (&buffer_local_flags, display_time), -1); + XSETINT (B_ (&buffer_local_flags, enable_multibyte_characters), -1); idx = 1; - XSETFASTINT (buffer_local_flags.mode_line_format, idx); ++idx; - XSETFASTINT (buffer_local_flags.abbrev_mode, idx); ++idx; - XSETFASTINT (buffer_local_flags.overwrite_mode, idx); ++idx; - XSETFASTINT (buffer_local_flags.case_fold_search, idx); ++idx; - XSETFASTINT (buffer_local_flags.auto_fill_function, idx); ++idx; - XSETFASTINT (buffer_local_flags.selective_display, idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, mode_line_format), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, abbrev_mode), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, overwrite_mode), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, case_fold_search), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, auto_fill_function), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, selective_display), idx); ++idx; #ifndef old - XSETFASTINT (buffer_local_flags.selective_display_ellipses, idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, selective_display_ellipses), idx); ++idx; #endif - XSETFASTINT (buffer_local_flags.tab_width, idx); ++idx; - XSETFASTINT (buffer_local_flags.truncate_lines, idx); ++idx; - XSETFASTINT (buffer_local_flags.word_wrap, idx); ++idx; - XSETFASTINT (buffer_local_flags.ctl_arrow, idx); ++idx; - XSETFASTINT (buffer_local_flags.fill_column, idx); ++idx; - XSETFASTINT (buffer_local_flags.left_margin, idx); ++idx; - XSETFASTINT (buffer_local_flags.abbrev_table, idx); ++idx; - XSETFASTINT (buffer_local_flags.display_table, idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, tab_width), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, truncate_lines), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, word_wrap), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, ctl_arrow), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, fill_column), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, left_margin), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, abbrev_table), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, display_table), idx); ++idx; #ifdef DOS_NT XSETFASTINT (buffer_local_flags.buffer_file_type, idx); /* Make this one a permanent local. */ buffer_permanent_local_flags[idx++] = 1; #endif - XSETFASTINT (buffer_local_flags.syntax_table, idx); ++idx; - XSETFASTINT (buffer_local_flags.cache_long_line_scans, idx); ++idx; - XSETFASTINT (buffer_local_flags.category_table, idx); ++idx; - XSETFASTINT (buffer_local_flags.bidi_display_reordering, idx); ++idx; - XSETFASTINT (buffer_local_flags.bidi_paragraph_direction, idx); ++idx; - XSETFASTINT (buffer_local_flags.buffer_file_coding_system, idx); + XSETFASTINT (B_ (&buffer_local_flags, syntax_table), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, cache_long_line_scans), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, category_table), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, bidi_display_reordering), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, bidi_paragraph_direction), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, buffer_file_coding_system), idx); /* Make this one a permanent local. */ buffer_permanent_local_flags[idx++] = 1; - XSETFASTINT (buffer_local_flags.left_margin_cols, idx); ++idx; - XSETFASTINT (buffer_local_flags.right_margin_cols, idx); ++idx; - XSETFASTINT (buffer_local_flags.left_fringe_width, idx); ++idx; - XSETFASTINT (buffer_local_flags.right_fringe_width, idx); ++idx; - XSETFASTINT (buffer_local_flags.fringes_outside_margins, idx); ++idx; - XSETFASTINT (buffer_local_flags.scroll_bar_width, idx); ++idx; - XSETFASTINT (buffer_local_flags.vertical_scroll_bar_type, idx); ++idx; - XSETFASTINT (buffer_local_flags.indicate_empty_lines, idx); ++idx; - XSETFASTINT (buffer_local_flags.indicate_buffer_boundaries, idx); ++idx; - XSETFASTINT (buffer_local_flags.fringe_indicator_alist, idx); ++idx; - XSETFASTINT (buffer_local_flags.fringe_cursor_alist, idx); ++idx; - XSETFASTINT (buffer_local_flags.scroll_up_aggressively, idx); ++idx; - XSETFASTINT (buffer_local_flags.scroll_down_aggressively, idx); ++idx; - XSETFASTINT (buffer_local_flags.header_line_format, idx); ++idx; - XSETFASTINT (buffer_local_flags.cursor_type, idx); ++idx; - XSETFASTINT (buffer_local_flags.extra_line_spacing, idx); ++idx; - XSETFASTINT (buffer_local_flags.cursor_in_non_selected_windows, idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, left_margin_cols), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, right_margin_cols), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, left_fringe_width), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, right_fringe_width), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, fringes_outside_margins), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, scroll_bar_width), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, vertical_scroll_bar_type), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, indicate_empty_lines), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, indicate_buffer_boundaries), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, fringe_indicator_alist), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, fringe_cursor_alist), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, scroll_up_aggressively), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, scroll_down_aggressively), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, header_line_format), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, cursor_type), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, extra_line_spacing), idx); ++idx; + XSETFASTINT (B_ (&buffer_local_flags, cursor_in_non_selected_windows), idx); ++idx; /* Need more room? */ if (idx >= MAX_PER_BUFFER_VARS) @@ -5149,7 +5155,7 @@ QSFundamental = make_pure_c_string ("Fundamental"); Qfundamental_mode = intern_c_string ("fundamental-mode"); - buffer_defaults.major_mode = Qfundamental_mode; + B_ (&buffer_defaults, major_mode) = Qfundamental_mode; Qmode_class = intern_c_string ("mode-class"); @@ -5192,7 +5198,7 @@ #endif /* USE_MMAP_FOR_BUFFERS */ Fset_buffer (Fget_buffer_create (build_string ("*scratch*"))); - if (NILP (buffer_defaults.enable_multibyte_characters)) + if (NILP (B_ (&buffer_defaults, enable_multibyte_characters))) Fset_buffer_multibyte (Qnil); pwd = get_current_dir_name (); @@ -5213,28 +5219,28 @@ pwd[len + 1] = '\0'; } - current_buffer->directory = make_unibyte_string (pwd, strlen (pwd)); - if (! NILP (buffer_defaults.enable_multibyte_characters)) + B_ (current_buffer, directory) = make_unibyte_string (pwd, strlen (pwd)); + if (! NILP (B_ (&buffer_defaults, enable_multibyte_characters))) /* At this moment, we still don't know how to decode the directory name. So, we keep the bytes in multibyte form so that ENCODE_FILE correctly gets the original bytes. */ - current_buffer->directory - = string_to_multibyte (current_buffer->directory); + B_ (current_buffer, directory) + = string_to_multibyte (B_ (current_buffer, directory)); /* Add /: to the front of the name if it would otherwise be treated as magic. */ - temp = Ffind_file_name_handler (current_buffer->directory, Qt); + temp = Ffind_file_name_handler (B_ (current_buffer, directory), Qt); if (! NILP (temp) /* If the default dir is just /, TEMP is non-nil because of the ange-ftp completion handler. However, it is not necessary to turn / into /:/. So avoid doing that. */ - && strcmp ("/", SSDATA (current_buffer->directory))) - current_buffer->directory - = concat2 (build_string ("/:"), current_buffer->directory); + && strcmp ("/", SSDATA (B_ (current_buffer, directory)))) + B_ (current_buffer, directory) + = concat2 (build_string ("/:"), B_ (current_buffer, directory)); temp = get_minibuffer (0); - XBUFFER (temp)->directory = current_buffer->directory; + B_ (XBUFFER (temp), directory) = B_ (current_buffer, directory); free (pwd); } @@ -5485,13 +5491,13 @@ This is the same as (default-value 'scroll-down-aggressively). */); DEFVAR_PER_BUFFER ("header-line-format", - ¤t_buffer->header_line_format, + &B_ (current_buffer, header_line_format), Qnil, doc: /* Analogous to `mode-line-format', but controls the header line. The header line appears, optionally, at the top of a window; the mode line appears at the bottom. */); - DEFVAR_PER_BUFFER ("mode-line-format", ¤t_buffer->mode_line_format, + DEFVAR_PER_BUFFER ("mode-line-format", &B_ (current_buffer, mode_line_format), Qnil, doc: /* Template for displaying mode line for current buffer. Each buffer has its own value of this variable. @@ -5548,7 +5554,7 @@ DEFVAR_BUFFER_DEFAULTS ("default-major-mode", major_mode, doc: /* *Value of `major-mode' for new buffers. */); - DEFVAR_PER_BUFFER ("major-mode", ¤t_buffer->major_mode, + DEFVAR_PER_BUFFER ("major-mode", &B_ (current_buffer, major_mode), make_number (Lisp_Symbol), doc: /* Symbol for current buffer's major mode. The default value (normally `fundamental-mode') affects new buffers. @@ -5561,46 +5567,46 @@ variables such as `buffer-read-only' and `buffer-file-coding-system' to be set up. */); - DEFVAR_PER_BUFFER ("mode-name", ¤t_buffer->mode_name, + DEFVAR_PER_BUFFER ("mode-name", &B_ (current_buffer, mode_name), Qnil, doc: /* Pretty name of current buffer's major mode. Usually a string, but can use any of the constructs for `mode-line-format', which see. Format with `format-mode-line' to produce a string value. */); - DEFVAR_PER_BUFFER ("local-abbrev-table", ¤t_buffer->abbrev_table, Qnil, + DEFVAR_PER_BUFFER ("local-abbrev-table", &B_ (current_buffer, abbrev_table), Qnil, doc: /* Local (mode-specific) abbrev table of current buffer. */); - DEFVAR_PER_BUFFER ("abbrev-mode", ¤t_buffer->abbrev_mode, Qnil, + DEFVAR_PER_BUFFER ("abbrev-mode", &B_ (current_buffer, abbrev_mode), Qnil, doc: /* Non-nil if Abbrev mode is enabled. Use the command `abbrev-mode' to change this variable. */); - DEFVAR_PER_BUFFER ("case-fold-search", ¤t_buffer->case_fold_search, + DEFVAR_PER_BUFFER ("case-fold-search", &B_ (current_buffer, case_fold_search), Qnil, doc: /* *Non-nil if searches and matches should ignore case. */); - DEFVAR_PER_BUFFER ("fill-column", ¤t_buffer->fill_column, + DEFVAR_PER_BUFFER ("fill-column", &B_ (current_buffer, fill_column), make_number (LISP_INT_TAG), doc: /* *Column beyond which automatic line-wrapping should happen. Interactively, you can set the buffer local value using \\[set-fill-column]. */); - DEFVAR_PER_BUFFER ("left-margin", ¤t_buffer->left_margin, + DEFVAR_PER_BUFFER ("left-margin", &B_ (current_buffer, left_margin), make_number (LISP_INT_TAG), doc: /* *Column for the default `indent-line-function' to indent to. Linefeed indents to this column in Fundamental mode. */); - DEFVAR_PER_BUFFER ("tab-width", ¤t_buffer->tab_width, + DEFVAR_PER_BUFFER ("tab-width", &B_ (current_buffer, tab_width), make_number (LISP_INT_TAG), doc: /* *Distance between tab stops (for display of tab characters), in columns. */); - DEFVAR_PER_BUFFER ("ctl-arrow", ¤t_buffer->ctl_arrow, Qnil, + DEFVAR_PER_BUFFER ("ctl-arrow", &B_ (current_buffer, ctl_arrow), Qnil, doc: /* *Non-nil means display control chars with uparrow. A value of nil means use backslash and octal digits. This variable does not apply to characters whose display is specified in the current display table (if there is one). */); DEFVAR_PER_BUFFER ("enable-multibyte-characters", - ¤t_buffer->enable_multibyte_characters, + &B_ (current_buffer, enable_multibyte_characters), Qnil, doc: /* Non-nil means the buffer contents are regarded as multi-byte characters. Otherwise they are regarded as unibyte. This affects the display, @@ -5614,7 +5620,7 @@ XSYMBOL (intern_c_string ("enable-multibyte-characters"))->constant = 1; DEFVAR_PER_BUFFER ("buffer-file-coding-system", - ¤t_buffer->buffer_file_coding_system, Qnil, + &B_ (current_buffer, buffer_file_coding_system), Qnil, doc: /* Coding system to be used for encoding the buffer contents on saving. This variable applies to saving the buffer, and also to `write-region' and other functions that use `write-region'. @@ -5632,11 +5638,11 @@ This variable is never applied to a way of decoding a file while reading it. */); DEFVAR_PER_BUFFER ("bidi-display-reordering", - ¤t_buffer->bidi_display_reordering, Qnil, + &B_ (current_buffer, bidi_display_reordering), Qnil, doc: /* Non-nil means reorder bidirectional text for display in the visual order. */); DEFVAR_PER_BUFFER ("bidi-paragraph-direction", - ¤t_buffer->bidi_paragraph_direction, Qnil, + &B_ (current_buffer, bidi_paragraph_direction), Qnil, doc: /* *If non-nil, forces directionality of text paragraphs in the buffer. If this is nil (the default), the direction of each paragraph is @@ -5647,7 +5653,7 @@ This variable has no effect unless the buffer's value of \`bidi-display-reordering' is non-nil. */); - DEFVAR_PER_BUFFER ("truncate-lines", ¤t_buffer->truncate_lines, Qnil, + DEFVAR_PER_BUFFER ("truncate-lines", &B_ (current_buffer, truncate_lines), Qnil, doc: /* *Non-nil means do not display continuation lines. Instead, give each line of text just one screen line. @@ -5655,7 +5661,7 @@ `truncate-partial-width-windows' if that variable is non-nil and this buffer is not full-frame width. */); - DEFVAR_PER_BUFFER ("word-wrap", ¤t_buffer->word_wrap, Qnil, + DEFVAR_PER_BUFFER ("word-wrap", &B_ (current_buffer, word_wrap), Qnil, doc: /* *Non-nil means to use word-wrapping for continuation lines. When word-wrapping is on, continuation lines are wrapped at the space or tab character nearest to the right window edge. @@ -5676,12 +5682,12 @@ On other systems, this variable is normally always nil. */); #endif - DEFVAR_PER_BUFFER ("default-directory", ¤t_buffer->directory, + DEFVAR_PER_BUFFER ("default-directory", &B_ (current_buffer, directory), make_number (Lisp_String), doc: /* Name of default directory of current buffer. Should end with slash. To interactively change the default directory, use command `cd'. */); - DEFVAR_PER_BUFFER ("auto-fill-function", ¤t_buffer->auto_fill_function, + DEFVAR_PER_BUFFER ("auto-fill-function", &B_ (current_buffer, auto_fill_function), Qnil, doc: /* Function called (if non-nil) to perform auto-fill. It is called after self-inserting any character specified in @@ -5689,30 +5695,30 @@ NOTE: This variable is not a hook; its value may not be a list of functions. */); - DEFVAR_PER_BUFFER ("buffer-file-name", ¤t_buffer->filename, + DEFVAR_PER_BUFFER ("buffer-file-name", &B_ (current_buffer, filename), make_number (Lisp_String), doc: /* Name of file visited in current buffer, or nil if not visiting a file. */); - DEFVAR_PER_BUFFER ("buffer-file-truename", ¤t_buffer->file_truename, + DEFVAR_PER_BUFFER ("buffer-file-truename", &B_ (current_buffer, file_truename), make_number (Lisp_String), doc: /* Abbreviated truename of file visited in current buffer, or nil if none. The truename of a file is calculated by `file-truename' and then abbreviated with `abbreviate-file-name'. */); DEFVAR_PER_BUFFER ("buffer-auto-save-file-name", - ¤t_buffer->auto_save_file_name, + &B_ (current_buffer, auto_save_file_name), make_number (Lisp_String), doc: /* Name of file for auto-saving current buffer. If it is nil, that means don't auto-save this buffer. */); - DEFVAR_PER_BUFFER ("buffer-read-only", ¤t_buffer->read_only, Qnil, + DEFVAR_PER_BUFFER ("buffer-read-only", &B_ (current_buffer, read_only), Qnil, doc: /* Non-nil if this buffer is read-only. */); - DEFVAR_PER_BUFFER ("buffer-backed-up", ¤t_buffer->backed_up, Qnil, + DEFVAR_PER_BUFFER ("buffer-backed-up", &B_ (current_buffer, backed_up), Qnil, doc: /* Non-nil if this buffer's file has been backed up. Backing up is done before the first time the file is saved. */); - DEFVAR_PER_BUFFER ("buffer-saved-size", ¤t_buffer->save_length, + DEFVAR_PER_BUFFER ("buffer-saved-size", &B_ (current_buffer, save_length), make_number (LISP_INT_TAG), doc: /* Length of current buffer when last read in, saved or auto-saved. 0 initially. @@ -5722,7 +5728,7 @@ if its text size shrinks. If you use `buffer-swap-text' on a buffer, you probably should set this to -2 in that buffer. */); - DEFVAR_PER_BUFFER ("selective-display", ¤t_buffer->selective_display, + DEFVAR_PER_BUFFER ("selective-display", &B_ (current_buffer, selective_display), Qnil, doc: /* Non-nil enables selective display. An integer N as value means display only lines @@ -5733,12 +5739,12 @@ #ifndef old DEFVAR_PER_BUFFER ("selective-display-ellipses", - ¤t_buffer->selective_display_ellipses, + &B_ (current_buffer, selective_display_ellipses), Qnil, doc: /* Non-nil means display ... on previous line when a line is invisible. */); #endif - DEFVAR_PER_BUFFER ("overwrite-mode", ¤t_buffer->overwrite_mode, Qnil, + DEFVAR_PER_BUFFER ("overwrite-mode", &B_ (current_buffer, overwrite_mode), Qnil, doc: /* Non-nil if self-insertion should replace existing text. The value should be one of `overwrite-mode-textual', `overwrite-mode-binary', or nil. @@ -5747,7 +5753,7 @@ until the tab is filled in. If `overwrite-mode-binary', self-insertion replaces newlines and tabs too. */); - DEFVAR_PER_BUFFER ("buffer-display-table", ¤t_buffer->display_table, + DEFVAR_PER_BUFFER ("buffer-display-table", &B_ (current_buffer, display_table), Qnil, doc: /* Display table that controls display of the contents of current buffer. @@ -5784,39 +5790,39 @@ See also the functions `display-table-slot' and `set-display-table-slot'. */); - DEFVAR_PER_BUFFER ("left-margin-width", ¤t_buffer->left_margin_cols, + DEFVAR_PER_BUFFER ("left-margin-width", &B_ (current_buffer, left_margin_cols), Qnil, doc: /* *Width of left marginal area for display of a buffer. A value of nil means no marginal area. */); - DEFVAR_PER_BUFFER ("right-margin-width", ¤t_buffer->right_margin_cols, + DEFVAR_PER_BUFFER ("right-margin-width", &B_ (current_buffer, right_margin_cols), Qnil, doc: /* *Width of right marginal area for display of a buffer. A value of nil means no marginal area. */); - DEFVAR_PER_BUFFER ("left-fringe-width", ¤t_buffer->left_fringe_width, + DEFVAR_PER_BUFFER ("left-fringe-width", &B_ (current_buffer, left_fringe_width), Qnil, doc: /* *Width of this buffer's left fringe (in pixels). A value of 0 means no left fringe is shown in this buffer's window. A value of nil means to use the left fringe width from the window's frame. */); - DEFVAR_PER_BUFFER ("right-fringe-width", ¤t_buffer->right_fringe_width, + DEFVAR_PER_BUFFER ("right-fringe-width", &B_ (current_buffer, right_fringe_width), Qnil, doc: /* *Width of this buffer's right fringe (in pixels). A value of 0 means no right fringe is shown in this buffer's window. A value of nil means to use the right fringe width from the window's frame. */); - DEFVAR_PER_BUFFER ("fringes-outside-margins", ¤t_buffer->fringes_outside_margins, + DEFVAR_PER_BUFFER ("fringes-outside-margins", &B_ (current_buffer, fringes_outside_margins), Qnil, doc: /* *Non-nil means to display fringes outside display margins. A value of nil means to display fringes between margins and buffer text. */); - DEFVAR_PER_BUFFER ("scroll-bar-width", ¤t_buffer->scroll_bar_width, + DEFVAR_PER_BUFFER ("scroll-bar-width", &B_ (current_buffer, scroll_bar_width), Qnil, doc: /* *Width of this buffer's scroll bars in pixels. A value of nil means to use the scroll bar width from the window's frame. */); - DEFVAR_PER_BUFFER ("vertical-scroll-bar", ¤t_buffer->vertical_scroll_bar_type, + DEFVAR_PER_BUFFER ("vertical-scroll-bar", &B_ (current_buffer, vertical_scroll_bar_type), Qnil, doc: /* *Position of this buffer's vertical scroll bar. The value takes effect whenever you tell a window to display this buffer; @@ -5827,13 +5833,13 @@ A value of t (the default) means do whatever the window's frame specifies. */); DEFVAR_PER_BUFFER ("indicate-empty-lines", - ¤t_buffer->indicate_empty_lines, Qnil, + &B_ (current_buffer, indicate_empty_lines), Qnil, doc: /* *Visually indicate empty lines after the buffer end. If non-nil, a bitmap is displayed in the left fringe of a window on window-systems. */); DEFVAR_PER_BUFFER ("indicate-buffer-boundaries", - ¤t_buffer->indicate_buffer_boundaries, Qnil, + &B_ (current_buffer, indicate_buffer_boundaries), Qnil, doc: /* *Visually indicate buffer boundaries and scrolling. If non-nil, the first and last line of the buffer are marked in the fringe of a window on window-systems with angle bitmaps, or if the window can be @@ -5858,7 +5864,7 @@ fringe, but no arrow bitmaps, use ((top . left) (bottom . left)). */); DEFVAR_PER_BUFFER ("fringe-indicator-alist", - ¤t_buffer->fringe_indicator_alist, Qnil, + &B_ (current_buffer, fringe_indicator_alist), Qnil, doc: /* *Mapping from logical to physical fringe indicator bitmaps. The value is an alist where each element (INDICATOR . BITMAPS) specifies the fringe bitmaps used to display a specific logical @@ -5877,7 +5883,7 @@ symbol which is used in both left and right fringes. */); DEFVAR_PER_BUFFER ("fringe-cursor-alist", - ¤t_buffer->fringe_cursor_alist, Qnil, + &B_ (current_buffer, fringe_cursor_alist), Qnil, doc: /* *Mapping from logical to physical fringe cursor bitmaps. The value is an alist where each element (CURSOR . BITMAP) specifies the fringe bitmaps used to display a specific logical @@ -5892,7 +5898,7 @@ cursor type. */); DEFVAR_PER_BUFFER ("scroll-up-aggressively", - ¤t_buffer->scroll_up_aggressively, Qnil, + &B_ (current_buffer, scroll_up_aggressively), Qnil, doc: /* How far to scroll windows upward. If you move point off the bottom, the window scrolls automatically. This variable controls how far it scrolls. The value nil, the default, @@ -5905,7 +5911,7 @@ between 0.0 and 1.0, inclusive. */); DEFVAR_PER_BUFFER ("scroll-down-aggressively", - ¤t_buffer->scroll_down_aggressively, Qnil, + &B_ (current_buffer, scroll_down_aggressively), Qnil, doc: /* How far to scroll windows downward. If you move point off the top, the window scrolls automatically. This variable controls how far it scrolls. The value nil, the default, @@ -5960,7 +5966,7 @@ The functions are run using the `run-hooks' function. */); Vfirst_change_hook = Qnil; - DEFVAR_PER_BUFFER ("buffer-undo-list", ¤t_buffer->undo_list, Qnil, + DEFVAR_PER_BUFFER ("buffer-undo-list", &B_ (current_buffer, undo_list), Qnil, doc: /* List of undo entries in current buffer. Recent changes come first; older changes follow newer. @@ -6001,10 +6007,10 @@ If the value of the variable is t, undo information is not recorded. */); - DEFVAR_PER_BUFFER ("mark-active", ¤t_buffer->mark_active, Qnil, + DEFVAR_PER_BUFFER ("mark-active", &B_ (current_buffer, mark_active), Qnil, doc: /* Non-nil means the mark and region are currently active in this buffer. */); - DEFVAR_PER_BUFFER ("cache-long-line-scans", ¤t_buffer->cache_long_line_scans, Qnil, + DEFVAR_PER_BUFFER ("cache-long-line-scans", &B_ (current_buffer, cache_long_line_scans), Qnil, doc: /* Non-nil means that Emacs should use caches to handle long lines more quickly. Normally, the line-motion functions work by scanning the buffer for @@ -6032,23 +6038,23 @@ the cache should not affect the behavior of any of the motion functions; it should only affect their performance. */); - DEFVAR_PER_BUFFER ("point-before-scroll", ¤t_buffer->point_before_scroll, Qnil, + DEFVAR_PER_BUFFER ("point-before-scroll", &B_ (current_buffer, point_before_scroll), Qnil, doc: /* Value of point before the last series of scroll operations, or nil. */); - DEFVAR_PER_BUFFER ("buffer-file-format", ¤t_buffer->file_format, Qnil, + DEFVAR_PER_BUFFER ("buffer-file-format", &B_ (current_buffer, file_format), Qnil, doc: /* List of formats to use when saving this buffer. Formats are defined by `format-alist'. This variable is set when a file is visited. */); DEFVAR_PER_BUFFER ("buffer-auto-save-file-format", - ¤t_buffer->auto_save_file_format, Qnil, + &B_ (current_buffer, auto_save_file_format), Qnil, doc: /* *Format in which to write auto-save files. Should be a list of symbols naming formats that are defined in `format-alist'. If it is t, which is the default, auto-save files are written in the same format as a regular save would use. */); DEFVAR_PER_BUFFER ("buffer-invisibility-spec", - ¤t_buffer->invisibility_spec, Qnil, + &B_ (current_buffer, invisibility_spec), Qnil, doc: /* Invisibility spec of this buffer. The default is t, which means that text is invisible if it has a non-nil `invisible' property. @@ -6059,12 +6065,12 @@ and they have an ellipsis as well if ELLIPSIS is non-nil. */); DEFVAR_PER_BUFFER ("buffer-display-count", - ¤t_buffer->display_count, Qnil, + &B_ (current_buffer, display_count), Qnil, doc: /* A number incremented each time this buffer is displayed in a window. The function `set-window-buffer' increments it. */); DEFVAR_PER_BUFFER ("buffer-display-time", - ¤t_buffer->display_time, Qnil, + &B_ (current_buffer, display_time), Qnil, doc: /* Time stamp updated each time this buffer is displayed in a window. The function `set-window-buffer' updates this variable to the value obtained by calling `current-time'. @@ -6099,7 +6105,7 @@ is a member of the list. */); Vinhibit_read_only = Qnil; - DEFVAR_PER_BUFFER ("cursor-type", ¤t_buffer->cursor_type, Qnil, + DEFVAR_PER_BUFFER ("cursor-type", &B_ (current_buffer, cursor_type), Qnil, doc: /* Cursor to use when this buffer is in the selected window. Values are interpreted as follows: @@ -6118,7 +6124,7 @@ `cursor-in-non-selected-windows'. */); DEFVAR_PER_BUFFER ("line-spacing", - ¤t_buffer->extra_line_spacing, Qnil, + &B_ (current_buffer, extra_line_spacing), Qnil, doc: /* Additional space to put between lines when displaying a buffer. The space is measured in pixels, and put below lines on graphic displays, see `display-graphic-p'. @@ -6126,7 +6132,7 @@ to the default frame line height. A value of nil means add no extra space. */); DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows", - ¤t_buffer->cursor_in_non_selected_windows, Qnil, + &B_ (current_buffer, cursor_in_non_selected_windows), Qnil, doc: /* *Non-nil means show a cursor in non-selected windows. If nil, only shows a cursor in the selected window. If t, displays a cursor related to the usual cursor type === modified file 'src/buffer.h' --- src/buffer.h 2011-01-25 04:08:28 +0000 +++ src/buffer.h 2011-02-14 15:39:19 +0000 @@ -321,7 +321,7 @@ /* Return character at byte position POS. */ #define FETCH_CHAR(pos) \ - (!NILP (current_buffer->enable_multibyte_characters) \ + (!NILP (B_ (current_buffer, enable_multibyte_characters)) \ ? FETCH_MULTIBYTE_CHAR ((pos)) \ : FETCH_BYTE ((pos))) @@ -346,7 +346,7 @@ multibyte. */ #define FETCH_CHAR_AS_MULTIBYTE(pos) \ - (!NILP (current_buffer->enable_multibyte_characters) \ + (!NILP (B_ (current_buffer, enable_multibyte_characters)) \ ? FETCH_MULTIBYTE_CHAR ((pos)) \ : UNIBYTE_TO_CHAR (FETCH_BYTE ((pos)))) @@ -464,6 +464,15 @@ int inhibit_shrinking; }; +/* Lisp fields in struct buffer are hidden from most code and accessed + via the B_ macro, below. Only select pieces of code, like the GC, + are allowed to use BUFFER_INTERNAL_FIELD. */ +#define BUFFER_INTERNAL_FIELD(field) field ## _ + +/* Most code should use this macro to access Lisp fields in struct + buffer. */ +#define B_(buf, field) ((buf)->BUFFER_INTERNAL_FIELD (field)) + /* This is the structure that the buffer Lisp object points to. */ struct buffer @@ -587,138 +596,138 @@ because local variables have to be right in the struct buffer. So we copy it around in set_buffer_internal. This comes before `name' because it is marked in a special way. */ - Lisp_Object undo_list; + Lisp_Object BUFFER_INTERNAL_FIELD (undo_list); /* The name of this buffer. */ - Lisp_Object name; + Lisp_Object BUFFER_INTERNAL_FIELD (name); /* The name of the file visited in this buffer, or nil. */ - Lisp_Object filename; + Lisp_Object BUFFER_INTERNAL_FIELD (filename); /* Dir for expanding relative file names. */ - Lisp_Object directory; + Lisp_Object BUFFER_INTERNAL_FIELD (directory); /* True if this buffer has been backed up (if you write to the visited file and it hasn't been backed up, then a backup will be made). */ /* This isn't really used by the C code, so could be deleted. */ - Lisp_Object backed_up; + Lisp_Object BUFFER_INTERNAL_FIELD (backed_up); /* Length of file when last read or saved. -1 means auto saving turned off because buffer shrank a lot. -2 means don't turn off auto saving if buffer shrinks. (That value is used with buffer-swap-text.) This is not in the struct buffer_text because it's not used in indirect buffers at all. */ - Lisp_Object save_length; + Lisp_Object BUFFER_INTERNAL_FIELD (save_length); /* File name used for auto-saving this buffer. This is not in the struct buffer_text because it's not used in indirect buffers at all. */ - Lisp_Object auto_save_file_name; + Lisp_Object BUFFER_INTERNAL_FIELD (auto_save_file_name); /* Non-nil if buffer read-only. */ - Lisp_Object read_only; + Lisp_Object BUFFER_INTERNAL_FIELD (read_only); /* "The mark". This is a marker which may point into this buffer or may point nowhere. */ - Lisp_Object mark; + Lisp_Object BUFFER_INTERNAL_FIELD (mark); /* Alist of elements (SYMBOL . VALUE-IN-THIS-BUFFER) for all per-buffer variables of this buffer. For locally unbound symbols, just the symbol appears as the element. */ - Lisp_Object local_var_alist; + Lisp_Object BUFFER_INTERNAL_FIELD (local_var_alist); /* Symbol naming major mode (eg, lisp-mode). */ - Lisp_Object major_mode; + Lisp_Object BUFFER_INTERNAL_FIELD (major_mode); /* Pretty name of major mode (eg, "Lisp"). */ - Lisp_Object mode_name; + Lisp_Object BUFFER_INTERNAL_FIELD (mode_name); /* Mode line element that controls format of mode line. */ - Lisp_Object mode_line_format; + Lisp_Object BUFFER_INTERNAL_FIELD (mode_line_format); /* Analogous to mode_line_format for the line displayed at the top of windows. Nil means don't display that line. */ - Lisp_Object header_line_format; + Lisp_Object BUFFER_INTERNAL_FIELD (header_line_format); /* Keys that are bound local to this buffer. */ - Lisp_Object keymap; + Lisp_Object BUFFER_INTERNAL_FIELD (keymap); /* This buffer's local abbrev table. */ - Lisp_Object abbrev_table; + Lisp_Object BUFFER_INTERNAL_FIELD (abbrev_table); /* This buffer's syntax table. */ - Lisp_Object syntax_table; + Lisp_Object BUFFER_INTERNAL_FIELD (syntax_table); /* This buffer's category table. */ - Lisp_Object category_table; + Lisp_Object BUFFER_INTERNAL_FIELD (category_table); /* Values of several buffer-local variables. */ /* tab-width is buffer-local so that redisplay can find it in buffers that are not current. */ - Lisp_Object case_fold_search; - Lisp_Object tab_width; - Lisp_Object fill_column; - Lisp_Object left_margin; + Lisp_Object BUFFER_INTERNAL_FIELD (case_fold_search); + Lisp_Object BUFFER_INTERNAL_FIELD (tab_width); + Lisp_Object BUFFER_INTERNAL_FIELD (fill_column); + Lisp_Object BUFFER_INTERNAL_FIELD (left_margin); /* Function to call when insert space past fill column. */ - Lisp_Object auto_fill_function; + Lisp_Object BUFFER_INTERNAL_FIELD (auto_fill_function); /* nil: text, t: binary. This value is meaningful only on certain operating systems. */ /* Actually, we don't need this flag any more because end-of-line is handled correctly according to the buffer-file-coding-system of the buffer. Just keeping it for backward compatibility. */ - Lisp_Object buffer_file_type; + Lisp_Object BUFFER_INTERNAL_FIELD (buffer_file_type); /* Case table for case-conversion in this buffer. This char-table maps each char into its lower-case version. */ - Lisp_Object downcase_table; + Lisp_Object BUFFER_INTERNAL_FIELD (downcase_table); /* Char-table mapping each char to its upper-case version. */ - Lisp_Object upcase_table; + Lisp_Object BUFFER_INTERNAL_FIELD (upcase_table); /* Char-table for conversion for case-folding search. */ - Lisp_Object case_canon_table; + Lisp_Object BUFFER_INTERNAL_FIELD (case_canon_table); /* Char-table of equivalences for case-folding search. */ - Lisp_Object case_eqv_table; + Lisp_Object BUFFER_INTERNAL_FIELD (case_eqv_table); /* Non-nil means do not display continuation lines. */ - Lisp_Object truncate_lines; + Lisp_Object BUFFER_INTERNAL_FIELD (truncate_lines); /* Non-nil means to use word wrapping when displaying continuation lines. */ - Lisp_Object word_wrap; + Lisp_Object BUFFER_INTERNAL_FIELD (word_wrap); /* Non-nil means display ctl chars with uparrow. */ - Lisp_Object ctl_arrow; + Lisp_Object BUFFER_INTERNAL_FIELD (ctl_arrow); /* Non-nil means reorder bidirectional text for display in the visual order. */ - Lisp_Object bidi_display_reordering; + Lisp_Object BUFFER_INTERNAL_FIELD (bidi_display_reordering); /* If non-nil, specifies which direction of text to force in all the paragraphs of the buffer. Nil means determine paragraph direction dynamically for each paragraph. */ - Lisp_Object bidi_paragraph_direction; + Lisp_Object BUFFER_INTERNAL_FIELD (bidi_paragraph_direction); /* Non-nil means do selective display; see doc string in syms_of_buffer (buffer.c) for details. */ - Lisp_Object selective_display; + Lisp_Object BUFFER_INTERNAL_FIELD (selective_display); #ifndef old /* Non-nil means show ... at end of line followed by invisible lines. */ - Lisp_Object selective_display_ellipses; + Lisp_Object BUFFER_INTERNAL_FIELD (selective_display_ellipses); #endif /* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */ - Lisp_Object minor_modes; + Lisp_Object BUFFER_INTERNAL_FIELD (minor_modes); /* t if "self-insertion" should overwrite; `binary' if it should also overwrite newlines and tabs - for editing executables and the like. */ - Lisp_Object overwrite_mode; + Lisp_Object BUFFER_INTERNAL_FIELD (overwrite_mode); /* non-nil means abbrev mode is on. Expand abbrevs automatically. */ - Lisp_Object abbrev_mode; + Lisp_Object BUFFER_INTERNAL_FIELD (abbrev_mode); /* Display table to use for text in this buffer. */ - Lisp_Object display_table; + Lisp_Object BUFFER_INTERNAL_FIELD (display_table); /* t means the mark and region are currently active. */ - Lisp_Object mark_active; + Lisp_Object BUFFER_INTERNAL_FIELD (mark_active); /* Non-nil means the buffer contents are regarded as multi-byte form of characters, not a binary code. */ - Lisp_Object enable_multibyte_characters; + Lisp_Object BUFFER_INTERNAL_FIELD (enable_multibyte_characters); /* Coding system to be used for encoding the buffer contents on saving. */ - Lisp_Object buffer_file_coding_system; + Lisp_Object BUFFER_INTERNAL_FIELD (buffer_file_coding_system); /* List of symbols naming the file format used for visited file. */ - Lisp_Object file_format; + Lisp_Object BUFFER_INTERNAL_FIELD (file_format); /* List of symbols naming the file format used for auto-save file. */ - Lisp_Object auto_save_file_format; + Lisp_Object BUFFER_INTERNAL_FIELD (auto_save_file_format); /* True if the newline position cache and width run cache are enabled. See search.c and indent.c. */ - Lisp_Object cache_long_line_scans; + Lisp_Object BUFFER_INTERNAL_FIELD (cache_long_line_scans); /* If the width run cache is enabled, this table contains the character widths width_run_cache (see above) assumes. When we @@ -726,99 +735,99 @@ current display table to see whether the display table has affected the widths of any characters. If it has, we invalidate the width run cache, and re-initialize width_table. */ - Lisp_Object width_table; + Lisp_Object BUFFER_INTERNAL_FIELD (width_table); /* In an indirect buffer, or a buffer that is the base of an indirect buffer, this holds a marker that records PT for this buffer when the buffer is not current. */ - Lisp_Object pt_marker; + Lisp_Object BUFFER_INTERNAL_FIELD (pt_marker); /* In an indirect buffer, or a buffer that is the base of an indirect buffer, this holds a marker that records BEGV for this buffer when the buffer is not current. */ - Lisp_Object begv_marker; + Lisp_Object BUFFER_INTERNAL_FIELD (begv_marker); /* In an indirect buffer, or a buffer that is the base of an indirect buffer, this holds a marker that records ZV for this buffer when the buffer is not current. */ - Lisp_Object zv_marker; + Lisp_Object BUFFER_INTERNAL_FIELD (zv_marker); /* This holds the point value before the last scroll operation. Explicitly setting point sets this to nil. */ - Lisp_Object point_before_scroll; + Lisp_Object BUFFER_INTERNAL_FIELD (point_before_scroll); /* Truename of the visited file, or nil. */ - Lisp_Object file_truename; + Lisp_Object BUFFER_INTERNAL_FIELD (file_truename); /* Invisibility spec of this buffer. t => any non-nil `invisible' property means invisible. A list => `invisible' property means invisible if it is memq in that list. */ - Lisp_Object invisibility_spec; + Lisp_Object BUFFER_INTERNAL_FIELD (invisibility_spec); /* This is the last window that was selected with this buffer in it, or nil if that window no longer displays this buffer. */ - Lisp_Object last_selected_window; + Lisp_Object BUFFER_INTERNAL_FIELD (last_selected_window); /* Incremented each time the buffer is displayed in a window. */ - Lisp_Object display_count; + Lisp_Object BUFFER_INTERNAL_FIELD (display_count); /* Widths of left and right marginal areas for windows displaying this buffer. */ - Lisp_Object left_margin_cols, right_margin_cols; + Lisp_Object BUFFER_INTERNAL_FIELD (left_margin_cols), BUFFER_INTERNAL_FIELD (right_margin_cols); /* Widths of left and right fringe areas for windows displaying this buffer. */ - Lisp_Object left_fringe_width, right_fringe_width; + Lisp_Object BUFFER_INTERNAL_FIELD (left_fringe_width), BUFFER_INTERNAL_FIELD (right_fringe_width); /* Non-nil means fringes are drawn outside display margins; othersize draw them between margin areas and text. */ - Lisp_Object fringes_outside_margins; + Lisp_Object BUFFER_INTERNAL_FIELD (fringes_outside_margins); /* Width and type of scroll bar areas for windows displaying this buffer. */ - Lisp_Object scroll_bar_width, vertical_scroll_bar_type; + Lisp_Object BUFFER_INTERNAL_FIELD (scroll_bar_width), BUFFER_INTERNAL_FIELD (vertical_scroll_bar_type); /* Non-nil means indicate lines not displaying text (in a style like vi). */ - Lisp_Object indicate_empty_lines; + Lisp_Object BUFFER_INTERNAL_FIELD (indicate_empty_lines); /* Non-nil means indicate buffer boundaries and scrolling. */ - Lisp_Object indicate_buffer_boundaries; + Lisp_Object BUFFER_INTERNAL_FIELD (indicate_buffer_boundaries); /* Logical to physical fringe bitmap mappings. */ - Lisp_Object fringe_indicator_alist; + Lisp_Object BUFFER_INTERNAL_FIELD (fringe_indicator_alist); /* Logical to physical cursor bitmap mappings. */ - Lisp_Object fringe_cursor_alist; + Lisp_Object BUFFER_INTERNAL_FIELD (fringe_cursor_alist); /* Time stamp updated each time this buffer is displayed in a window. */ - Lisp_Object display_time; + Lisp_Object BUFFER_INTERNAL_FIELD (display_time); /* If scrolling the display because point is below the bottom of a window showing this buffer, try to choose a window start so that point ends up this number of lines from the top of the window. Nil means that scrolling method isn't used. */ - Lisp_Object scroll_up_aggressively; + Lisp_Object BUFFER_INTERNAL_FIELD (scroll_up_aggressively); /* If scrolling the display because point is above the top of a window showing this buffer, try to choose a window start so that point ends up this number of lines from the bottom of the window. Nil means that scrolling method isn't used. */ - Lisp_Object scroll_down_aggressively; + Lisp_Object BUFFER_INTERNAL_FIELD (scroll_down_aggressively); /* Desired cursor type in this buffer. See the doc string of per-buffer variable `cursor-type'. */ - Lisp_Object cursor_type; + Lisp_Object BUFFER_INTERNAL_FIELD (cursor_type); /* An integer > 0 means put that number of pixels below text lines in the display of this buffer. */ - Lisp_Object extra_line_spacing; + Lisp_Object BUFFER_INTERNAL_FIELD (extra_line_spacing); /* *Cursor type to display in non-selected windows. t means to use hollow box cursor. See `cursor-type' for other values. */ - Lisp_Object cursor_in_non_selected_windows; + Lisp_Object BUFFER_INTERNAL_FIELD (cursor_in_non_selected_windows); }; @@ -942,7 +951,7 @@ from the start of a buffer structure. */ #define PER_BUFFER_VAR_OFFSET(VAR) \ - offsetof (struct buffer, VAR) + offsetof (struct buffer, BUFFER_INTERNAL_FIELD (VAR)) /* Return the index of buffer-local variable VAR. Each per-buffer variable has an index > 0 associated with it, except when it always === modified file 'src/bytecode.c' --- src/bytecode.c 2011-01-30 22:17:44 +0000 +++ src/bytecode.c 2011-02-14 15:39:19 +0000 @@ -1398,7 +1398,7 @@ CHECK_CHARACTER (TOP); AFTER_POTENTIAL_GC (); c = XFASTINT (TOP); - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) MAKE_CHAR_MULTIBYTE (c); XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (c)]); } === modified file 'src/callint.c' --- src/callint.c 2011-02-07 03:09:32 +0000 +++ src/callint.c 2011-02-14 15:39:19 +0000 @@ -149,12 +149,12 @@ check_mark (int for_region) { Lisp_Object tem; - tem = Fmarker_buffer (current_buffer->mark); + tem = Fmarker_buffer (B_ (current_buffer, mark)); if (NILP (tem) || (XBUFFER (tem) != current_buffer)) error (for_region ? "The mark is not set now, so there is no region" : "The mark is not set now"); if (!NILP (Vtransient_mark_mode) && NILP (Vmark_even_if_inactive) - && NILP (current_buffer->mark_active)) + && NILP (B_ (current_buffer, mark_active))) xsignal0 (Qmark_inactive); } @@ -385,7 +385,7 @@ else if (*string == '*') { string++; - if (!NILP (current_buffer->read_only)) + if (!NILP (B_ (current_buffer, read_only))) { if (!NILP (record_flag)) { @@ -543,7 +543,7 @@ case 'D': /* Directory name. */ args[i] = Fread_file_name (callint_message, Qnil, - current_buffer->directory, Qlambda, Qnil, + B_ (current_buffer, directory), Qlambda, Qnil, Qfile_directory_p); break; @@ -661,7 +661,7 @@ case 'm': /* Value of mark. Does not do I/O. */ check_mark (0); /* visargs[i] = Qnil; */ - args[i] = current_buffer->mark; + args[i] = B_ (current_buffer, mark); varies[i] = 2; break; @@ -717,11 +717,11 @@ check_mark (1); set_marker_both (point_marker, Qnil, PT, PT_BYTE); /* visargs[i+1] = Qnil; */ - foo = marker_position (current_buffer->mark); + foo = marker_position (B_ (current_buffer, mark)); /* visargs[i] = Qnil; */ - args[i] = PT < foo ? point_marker : current_buffer->mark; + args[i] = PT < foo ? point_marker : B_ (current_buffer, mark); varies[i] = 3; - args[++i] = PT > foo ? point_marker : current_buffer->mark; + args[++i] = PT > foo ? point_marker : B_ (current_buffer, mark); varies[i] = 4; break; === modified file 'src/callproc.c' --- src/callproc.c 2011-02-13 11:28:42 +0000 +++ src/callproc.c 2011-02-14 15:39:19 +0000 @@ -265,7 +265,7 @@ if (nargs >= 2 && ! NILP (args[1])) { - infile = Fexpand_file_name (args[1], current_buffer->directory); + infile = Fexpand_file_name (args[1], B_ (current_buffer, directory)); CHECK_STRING (infile); } else @@ -322,7 +322,7 @@ { struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; - current_dir = current_buffer->directory; + current_dir = B_ (current_buffer, directory); GCPRO4 (infile, buffer, current_dir, error_file); @@ -336,7 +336,7 @@ if (NILP (Ffile_accessible_directory_p (current_dir))) report_file_error ("Setting current directory", - Fcons (current_buffer->directory, Qnil)); + Fcons (B_ (current_buffer, directory), Qnil)); if (STRING_MULTIBYTE (infile)) infile = ENCODE_FILE (infile); @@ -663,7 +663,7 @@ /* In unibyte mode, character code conversion should not take place but EOL conversion should. So, setup raw-text or one of the subsidiary according to the information just setup. */ - if (NILP (current_buffer->enable_multibyte_characters) + if (NILP (B_ (current_buffer, enable_multibyte_characters)) && !NILP (val)) val = raw_text_coding_system (val); setup_coding_system (val, &process_coding); @@ -713,7 +713,7 @@ if (!NILP (buffer)) { - if (NILP (current_buffer->enable_multibyte_characters) + if (NILP (B_ (current_buffer, enable_multibyte_characters)) && ! CODING_MAY_REQUIRE_DECODING (&process_coding)) insert_1_both (buf, nread, nread, 0, 1, 0); else @@ -926,7 +926,7 @@ /* Decide coding-system of the contents of the temporary file. */ if (!NILP (Vcoding_system_for_write)) val = Vcoding_system_for_write; - else if (NILP (current_buffer->enable_multibyte_characters)) + else if (NILP (B_ (current_buffer, enable_multibyte_characters))) val = Qraw_text; else { === modified file 'src/casefiddle.c' --- src/casefiddle.c 2011-02-07 01:24:53 +0000 +++ src/casefiddle.c 2011-02-14 15:39:19 +0000 @@ -39,15 +39,15 @@ register int inword = flag == CASE_DOWN; /* If the case table is flagged as modified, rescan it. */ - if (NILP (XCHAR_TABLE (current_buffer->downcase_table)->extras[1])) - Fset_case_table (current_buffer->downcase_table); + if (NILP (XCHAR_TABLE (B_ (current_buffer, downcase_table))->extras[1])) + Fset_case_table (B_ (current_buffer, downcase_table)); if (INTEGERP (obj)) { int flagbits = (CHAR_ALT | CHAR_SUPER | CHAR_HYPER | CHAR_SHIFT | CHAR_CTL | CHAR_META); int flags = XINT (obj) & flagbits; - int multibyte = ! NILP (current_buffer->enable_multibyte_characters); + int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); /* If the character has higher bits set above the flags, return it unchanged. @@ -198,7 +198,7 @@ { register int c; register int inword = flag == CASE_DOWN; - register int multibyte = !NILP (current_buffer->enable_multibyte_characters); + register int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); EMACS_INT start, end; EMACS_INT start_byte, end_byte; EMACS_INT first = -1, last; /* Position of first and last changes. */ @@ -210,8 +210,8 @@ return; /* If the case table is flagged as modified, rescan it. */ - if (NILP (XCHAR_TABLE (current_buffer->downcase_table)->extras[1])) - Fset_case_table (current_buffer->downcase_table); + if (NILP (XCHAR_TABLE (B_ (current_buffer, downcase_table))->extras[1])) + Fset_case_table (B_ (current_buffer, downcase_table)); validate_region (&b, &e); start = XFASTINT (b); === modified file 'src/casetab.c' --- src/casetab.c 2011-01-25 04:08:28 +0000 +++ src/casetab.c 2011-02-14 15:39:19 +0000 @@ -71,7 +71,7 @@ doc: /* Return the case table of the current buffer. */) (void) { - return current_buffer->downcase_table; + return B_ (current_buffer, downcase_table); } DEFUN ("standard-case-table", Fstandard_case_table, Sstandard_case_table, 0, 0, 0, @@ -160,10 +160,10 @@ } else { - current_buffer->downcase_table = table; - current_buffer->upcase_table = up; - current_buffer->case_canon_table = canon; - current_buffer->case_eqv_table = eqv; + B_ (current_buffer, downcase_table) = table; + B_ (current_buffer, upcase_table) = up; + B_ (current_buffer, case_canon_table) = canon; + B_ (current_buffer, case_eqv_table) = eqv; } return table; === modified file 'src/category.c' --- src/category.c 2011-01-26 08:36:39 +0000 +++ src/category.c 2011-02-14 15:39:19 +0000 @@ -190,7 +190,7 @@ check_category_table (Lisp_Object table) { if (NILP (table)) - return current_buffer->category_table; + return B_ (current_buffer, category_table); CHECK_TYPE (!NILP (Fcategory_table_p (table)), Qcategory_table_p, table); return table; } @@ -200,7 +200,7 @@ This is the one specified by the current buffer. */) (void) { - return current_buffer->category_table; + return B_ (current_buffer, category_table); } DEFUN ("standard-category-table", Fstandard_category_table, @@ -281,7 +281,7 @@ { int idx; table = check_category_table (table); - current_buffer->category_table = table; + B_ (current_buffer, category_table) = table; /* Indicate that this buffer now has a specified category table. */ idx = PER_BUFFER_VAR_IDX (category_table); SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); @@ -292,7 +292,7 @@ Lisp_Object char_category_set (int c) { - return CHAR_TABLE_REF (current_buffer->category_table, c); + return CHAR_TABLE_REF (B_ (current_buffer, category_table), c); } DEFUN ("char-category-set", Fchar_category_set, Schar_category_set, 1, 1, 0, === modified file 'src/category.h' --- src/category.h 2011-01-15 23:16:57 +0000 +++ src/category.h 2011-02-14 15:39:19 +0000 @@ -91,7 +91,7 @@ /* The standard category table is stored where it will automatically be used in all new buffers. */ -#define Vstandard_category_table buffer_defaults.category_table +#define Vstandard_category_table B_ (&buffer_defaults, category_table) /* Return the category set of character C in the current category table. */ #define CATEGORY_SET(c) char_category_set (c) === modified file 'src/character.c' --- src/character.c 2011-02-07 05:42:15 +0000 +++ src/character.c 2011-02-14 15:39:19 +0000 @@ -521,7 +521,7 @@ { /* current_buffer is null at early stages of Emacs initialization. */ if (current_buffer == 0 - || NILP (current_buffer->enable_multibyte_characters)) + || NILP (B_ (current_buffer, enable_multibyte_characters))) return nbytes; return multibyte_chars_in_text (ptr, nbytes); @@ -987,7 +987,7 @@ pos = XFASTINT (position); p = CHAR_POS_ADDR (pos); } - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) return make_number (*p); } else === modified file 'src/character.h' --- src/character.h 2011-02-07 05:42:15 +0000 +++ src/character.h 2011-02-14 15:39:19 +0000 @@ -417,7 +417,7 @@ do \ { \ CHARIDX++; \ - if (!NILP (current_buffer->enable_multibyte_characters)) \ + if (!NILP (B_ (current_buffer, enable_multibyte_characters))) \ { \ unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \ int len; \ @@ -484,7 +484,7 @@ do \ { \ (charpos)++; \ - if (NILP (current_buffer->enable_multibyte_characters)) \ + if (NILP (B_ (current_buffer, enable_multibyte_characters))) \ (bytepos)++; \ else \ INC_POS ((bytepos)); \ @@ -498,7 +498,7 @@ do \ { \ (charpos)--; \ - if (NILP (current_buffer->enable_multibyte_characters)) \ + if (NILP (B_ (current_buffer, enable_multibyte_characters))) \ (bytepos)--; \ else \ DEC_POS ((bytepos)); \ @@ -561,11 +561,11 @@ #define ASCII_CHAR_WIDTH(c) \ (c < 0x20 \ ? (c == '\t' \ - ? XFASTINT (current_buffer->tab_width) \ - : (c == '\n' ? 0 : (NILP (current_buffer->ctl_arrow) ? 4 : 2))) \ + ? XFASTINT (B_ (current_buffer, tab_width)) \ + : (c == '\n' ? 0 : (NILP (B_ (current_buffer, ctl_arrow)) ? 4 : 2))) \ : (c < 0x7f \ ? 1 \ - : ((NILP (current_buffer->ctl_arrow) ? 4 : 2)))) + : ((NILP (B_ (current_buffer, ctl_arrow)) ? 4 : 2)))) /* Return the width of character C. The width is measured by how many columns C will occupy on the screen when displayed in the current === modified file 'src/charset.c' --- src/charset.c 2011-02-05 09:57:53 +0000 +++ src/charset.c 2011-02-14 15:39:19 +0000 @@ -1554,7 +1554,7 @@ EMACS_INT from, from_byte, to, stop, stop_byte; int i; Lisp_Object val; - int multibyte = ! NILP (current_buffer->enable_multibyte_characters); + int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); validate_region (&beg, &end); from = XFASTINT (beg); === modified file 'src/cmds.c' --- src/cmds.c 2011-02-06 19:44:36 +0000 +++ src/cmds.c 2011-02-14 15:39:19 +0000 @@ -292,10 +292,10 @@ } if (remove_boundary - && CONSP (current_buffer->undo_list) - && NILP (XCAR (current_buffer->undo_list))) + && CONSP (B_ (current_buffer, undo_list)) + && NILP (XCAR (B_ (current_buffer, undo_list)))) /* Remove the undo_boundary that was just pushed. */ - current_buffer->undo_list = XCDR (current_buffer->undo_list); + B_ (current_buffer, undo_list) = XCDR (B_ (current_buffer, undo_list)); /* Barf if the key that invoked this was not a character. */ if (!CHARACTERP (last_command_event)) @@ -335,12 +335,12 @@ EMACS_INT chars_to_delete = 0; EMACS_INT spaces_to_insert = 0; - overwrite = current_buffer->overwrite_mode; + overwrite = B_ (current_buffer, overwrite_mode); if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions)) hairy = 1; /* At first, get multi-byte form of C in STR. */ - if (!NILP (current_buffer->enable_multibyte_characters)) + if (!NILP (B_ (current_buffer, enable_multibyte_characters))) { len = CHAR_STRING (c, str); if (len == 1) @@ -416,11 +416,11 @@ synt = SYNTAX (c); - if (!NILP (current_buffer->abbrev_mode) + if (!NILP (B_ (current_buffer, abbrev_mode)) && synt != Sword - && NILP (current_buffer->read_only) + && NILP (B_ (current_buffer, read_only)) && PT > BEGV - && (SYNTAX (!NILP (current_buffer->enable_multibyte_characters) + && (SYNTAX (!NILP (B_ (current_buffer, enable_multibyte_characters)) ? XFASTINT (Fprevious_char ()) : UNIBYTE_TO_CHAR (XFASTINT (Fprevious_char ()))) == Sword)) @@ -448,7 +448,7 @@ if (chars_to_delete) { - int mc = ((NILP (current_buffer->enable_multibyte_characters) + int mc = ((NILP (B_ (current_buffer, enable_multibyte_characters)) && SINGLE_BYTE_CHAR_P (c)) ? UNIBYTE_TO_CHAR (c) : c); Lisp_Object string = Fmake_string (make_number (n), make_number (mc)); @@ -479,7 +479,7 @@ if ((CHAR_TABLE_P (Vauto_fill_chars) ? !NILP (CHAR_TABLE_REF (Vauto_fill_chars, c)) : (c == ' ' || c == '\n')) - && !NILP (current_buffer->auto_fill_function)) + && !NILP (B_ (current_buffer, auto_fill_function))) { Lisp_Object tem; @@ -488,7 +488,7 @@ that. Must have the newline in place already so filling and justification, if any, know where the end is going to be. */ SET_PT_BOTH (PT - 1, PT_BYTE - 1); - tem = call0 (current_buffer->auto_fill_function); + tem = call0 (B_ (current_buffer, auto_fill_function)); /* Test PT < ZV in case the auto-fill-function is strange. */ if (c == '\n' && PT < ZV) SET_PT_BOTH (PT + 1, PT_BYTE + 1); === modified file 'src/coding.c' --- src/coding.c 2011-02-06 19:44:36 +0000 +++ src/coding.c 2011-02-14 15:39:19 +0000 @@ -7038,8 +7038,8 @@ set_buffer_internal (XBUFFER (coding->dst_object)); if (GPT != PT) move_gap_both (PT, PT_BYTE); - undo_list = current_buffer->undo_list; - current_buffer->undo_list = Qt; + undo_list = B_ (current_buffer, undo_list); + B_ (current_buffer, undo_list) = Qt; } coding->consumed = coding->consumed_char = 0; @@ -7136,7 +7136,7 @@ decode_eol (coding); if (BUFFERP (coding->dst_object)) { - current_buffer->undo_list = undo_list; + B_ (current_buffer, undo_list) = undo_list; record_insert (coding->dst_pos, coding->produced_char); } return coding->result; @@ -7433,7 +7433,7 @@ { set_buffer_internal (XBUFFER (coding->dst_object)); coding->dst_multibyte - = ! NILP (current_buffer->enable_multibyte_characters); + = ! NILP (B_ (current_buffer, enable_multibyte_characters)); } coding->consumed = coding->consumed_char = 0; @@ -7504,8 +7504,8 @@ doesn't compile new regexps. */ Fset (Fmake_local_variable (Qinhibit_modification_hooks), Qt); Ferase_buffer (); - current_buffer->undo_list = Qt; - current_buffer->enable_multibyte_characters = multibyte ? Qt : Qnil; + B_ (current_buffer, undo_list) = Qt; + B_ (current_buffer, enable_multibyte_characters) = multibyte ? Qt : Qnil; set_buffer_internal (current); return workbuf; } @@ -7562,7 +7562,7 @@ coding->dst_object = coding->src_object; coding->dst_pos = PT; coding->dst_pos_byte = PT_BYTE; - coding->dst_multibyte = ! NILP (current_buffer->enable_multibyte_characters); + coding->dst_multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); if (CODING_REQUIRE_DETECTION (coding)) detect_coding (coding); @@ -7728,7 +7728,7 @@ coding->dst_pos = BUF_PT (XBUFFER (dst_object)); coding->dst_pos_byte = BUF_PT_BYTE (XBUFFER (dst_object)); coding->dst_multibyte - = ! NILP (XBUFFER (dst_object)->enable_multibyte_characters); + = ! NILP (B_ (XBUFFER (dst_object), enable_multibyte_characters)); } else { @@ -7798,7 +7798,7 @@ TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte); else if (saved_pt < from + chars) TEMP_SET_PT_BOTH (from, from_byte); - else if (! NILP (current_buffer->enable_multibyte_characters)) + else if (! NILP (B_ (current_buffer, enable_multibyte_characters))) TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars), saved_pt_byte + (coding->produced - bytes)); else @@ -7822,7 +7822,7 @@ { tail->bytepos = from_byte + coding->produced; tail->charpos - = (NILP (current_buffer->enable_multibyte_characters) + = (NILP (B_ (current_buffer, enable_multibyte_characters)) ? tail->bytepos : from + coding->produced_char); } } @@ -7960,7 +7960,7 @@ set_buffer_temp (current); } coding->dst_multibyte - = ! NILP (XBUFFER (dst_object)->enable_multibyte_characters); + = ! NILP (B_ (XBUFFER (dst_object), enable_multibyte_characters)); } else if (EQ (dst_object, Qt)) { @@ -8003,7 +8003,7 @@ TEMP_SET_PT_BOTH (saved_pt, saved_pt_byte); else if (saved_pt < from + chars) TEMP_SET_PT_BOTH (from, from_byte); - else if (! NILP (current_buffer->enable_multibyte_characters)) + else if (! NILP (B_ (current_buffer, enable_multibyte_characters))) TEMP_SET_PT_BOTH (saved_pt + (coding->produced_char - chars), saved_pt_byte + (coding->produced - bytes)); else @@ -8027,7 +8027,7 @@ { tail->bytepos = from_byte + coding->produced; tail->charpos - = (NILP (current_buffer->enable_multibyte_characters) + = (NILP (B_ (current_buffer, enable_multibyte_characters)) ? tail->bytepos : from + coding->produced_char); } } @@ -8481,8 +8481,8 @@ return detect_coding_system (BYTE_POS_ADDR (from_byte), to - from, to_byte - from_byte, !NILP (highest), - !NILP (current_buffer - ->enable_multibyte_characters), + !NILP (B_ (current_buffer + , enable_multibyte_characters)), Qnil); } @@ -8564,7 +8564,7 @@ CHECK_NUMBER_COERCE_MARKER (end); if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end)) args_out_of_range (start, end); - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) return Qt; start_byte = CHAR_TO_BYTE (XINT (start)); end_byte = CHAR_TO_BYTE (XINT (end)); @@ -8698,7 +8698,7 @@ validate_region (&start, &end); from = XINT (start); to = XINT (end); - if (NILP (current_buffer->enable_multibyte_characters) + if (NILP (B_ (current_buffer, enable_multibyte_characters)) || (ascii_compatible && (to - from) == (CHAR_TO_BYTE (to) - (CHAR_TO_BYTE (from))))) return Qnil; @@ -8814,7 +8814,7 @@ CHECK_NUMBER_COERCE_MARKER (end); if (XINT (start) < BEG || XINT (end) > Z || XINT (start) > XINT (end)) args_out_of_range (start, end); - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) return Qnil; start_byte = CHAR_TO_BYTE (XINT (start)); end_byte = CHAR_TO_BYTE (XINT (end)); === modified file 'src/composite.c' --- src/composite.c 2011-01-25 04:08:28 +0000 +++ src/composite.c 2011-02-14 15:39:19 +0000 @@ -796,7 +796,7 @@ if (NILP (string)) { - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) error ("Attempt to shape unibyte text"); validate_region (&start, &end); from = XFASTINT (start); @@ -1028,7 +1028,7 @@ cmp_it->stop_pos = endpos = start; cmp_it->ch = -1; } - if (NILP (current_buffer->enable_multibyte_characters) + if (NILP (B_ (current_buffer, enable_multibyte_characters)) || NILP (Vauto_composition_mode)) return; if (bytepos < 0) @@ -1674,7 +1674,7 @@ return new_pt; } - if (NILP (current_buffer->enable_multibyte_characters) + if (NILP (B_ (current_buffer, enable_multibyte_characters)) || NILP (Vauto_composition_mode)) return new_pt; @@ -1851,7 +1851,7 @@ if (!find_composition (from, to, &start, &end, &prop, string)) { - if (!NILP (current_buffer->enable_multibyte_characters) + if (!NILP (B_ (current_buffer, enable_multibyte_characters)) && ! NILP (Vauto_composition_mode) && find_automatic_composition (from, to, &start, &end, &gstring, string)) === modified file 'src/data.c' --- src/data.c 2011-02-07 02:18:35 +0000 +++ src/data.c 2011-02-14 15:39:19 +0000 @@ -1009,7 +1009,7 @@ } else { - tem1 = assq_no_quit (var, current_buffer->local_var_alist); + tem1 = assq_no_quit (var, B_ (current_buffer, local_var_alist)); XSETBUFFER (blv->where, current_buffer); } } @@ -1178,7 +1178,7 @@ tem1 = Fassq (symbol, (blv->frame_local ? XFRAME (where)->param_alist - : XBUFFER (where)->local_var_alist)); + : B_ (XBUFFER (where), local_var_alist))); blv->where = where; blv->found = 1; @@ -1209,8 +1209,8 @@ bindings, not for frame-local bindings. */ eassert (!blv->frame_local); tem1 = Fcons (symbol, XCDR (blv->defcell)); - XBUFFER (where)->local_var_alist - = Fcons (tem1, XBUFFER (where)->local_var_alist); + B_ (XBUFFER (where), local_var_alist) + = Fcons (tem1, B_ (XBUFFER (where), local_var_alist)); } } @@ -1632,13 +1632,13 @@ if (let_shadows_global_binding_p (symbol)) message ("Making %s local to %s while let-bound!", SDATA (SYMBOL_NAME (variable)), - SDATA (current_buffer->name)); + SDATA (B_ (current_buffer, name))); } } /* Make sure this buffer has its own value of symbol. */ XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ - tem = Fassq (variable, current_buffer->local_var_alist); + tem = Fassq (variable, B_ (current_buffer, local_var_alist)); if (NILP (tem)) { if (let_shadows_buffer_binding_p (sym)) @@ -1650,9 +1650,9 @@ default value. */ find_symbol_value (variable); - current_buffer->local_var_alist + B_ (current_buffer, local_var_alist) = Fcons (Fcons (variable, XCDR (blv->defcell)), - current_buffer->local_var_alist); + B_ (current_buffer, local_var_alist)); /* Make sure symbol does not think it is set up for this buffer; force it to look once again for this buffer's value. */ @@ -1718,10 +1718,10 @@ /* Get rid of this buffer's alist element, if any. */ XSETSYMBOL (variable, sym); /* Propagate variable indirection. */ - tem = Fassq (variable, current_buffer->local_var_alist); + tem = Fassq (variable, B_ (current_buffer, local_var_alist)); if (!NILP (tem)) - current_buffer->local_var_alist - = Fdelq (tem, current_buffer->local_var_alist); + B_ (current_buffer, local_var_alist) + = Fdelq (tem, B_ (current_buffer, local_var_alist)); /* If the symbol is set up with the current buffer's binding loaded, recompute its value. We have to do it now, or else @@ -1848,7 +1848,7 @@ XSETBUFFER (tmp, buf); XSETSYMBOL (variable, sym); /* Update in case of aliasing. */ - for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) + for (tail = B_ (buf, local_var_alist); CONSP (tail); tail = XCDR (tail)) { elt = XCAR (tail); if (EQ (variable, XCAR (elt))) === modified file 'src/dispextern.h' --- src/dispextern.h 2011-02-05 10:20:15 +0000 +++ src/dispextern.h 2011-02-14 15:39:19 +0000 @@ -1416,7 +1416,7 @@ && !(W)->pseudo_window_p \ && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ && BUFFERP ((W)->buffer) \ - && !NILP (XBUFFER ((W)->buffer)->mode_line_format) \ + && !NILP (B_ (XBUFFER ((W)->buffer), mode_line_format)) \ && WINDOW_TOTAL_LINES (W) > 1) /* Value is non-zero if window W wants a header line. */ @@ -1426,8 +1426,8 @@ && !(W)->pseudo_window_p \ && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ && BUFFERP ((W)->buffer) \ - && !NILP (XBUFFER ((W)->buffer)->header_line_format) \ - && WINDOW_TOTAL_LINES (W) > 1 + !NILP (XBUFFER ((W)->buffer)->mode_line_format)) + && !NILP (B_ (XBUFFER ((W)->buffer), header_line_format)) \ + && WINDOW_TOTAL_LINES (W) > 1 + !NILP (B_ (XBUFFER ((W)->buffer), mode_line_format))) /* Return proper value to be used as baseline offset of font that has === modified file 'src/dispnew.c' --- src/dispnew.c 2011-01-30 22:17:44 +0000 +++ src/dispnew.c 2011-02-14 15:39:19 +0000 @@ -6129,7 +6129,7 @@ { buf = XCDR (XCAR (tail)); /* Ignore buffers that aren't included in buffer lists. */ - if (SREF (XBUFFER (buf)->name, 0) == ' ') + if (SREF (B_ (XBUFFER (buf), name), 0) == ' ') continue; if (vecp == end) goto changed; @@ -6137,7 +6137,7 @@ goto changed; if (vecp == end) goto changed; - if (!EQ (*vecp++, XBUFFER (buf)->read_only)) + if (!EQ (*vecp++, B_ (XBUFFER (buf), read_only))) goto changed; if (vecp == end) goto changed; @@ -6184,10 +6184,10 @@ { buf = XCDR (XCAR (tail)); /* Ignore buffers that aren't included in buffer lists. */ - if (SREF (XBUFFER (buf)->name, 0) == ' ') + if (SREF (B_ (XBUFFER (buf), name), 0) == ' ') continue; *vecp++ = buf; - *vecp++ = XBUFFER (buf)->read_only; + *vecp++ = B_ (XBUFFER (buf), read_only); *vecp++ = Fbuffer_modified_p (buf); } /* Fill up the vector with lambdas (always at least one). */ === modified file 'src/editfns.c' --- src/editfns.c 2011-02-07 02:51:10 +0000 +++ src/editfns.c 2011-02-14 15:39:19 +0000 @@ -306,10 +306,10 @@ if (!NILP (Vtransient_mark_mode) && NILP (Vmark_even_if_inactive) - && NILP (current_buffer->mark_active)) + && NILP (B_ (current_buffer, mark_active))) xsignal0 (Qmark_inactive); - m = Fmarker_position (current_buffer->mark); + m = Fmarker_position (B_ (current_buffer, mark)); if (NILP (m)) error ("The mark is not set now, so there is no region"); @@ -338,7 +338,7 @@ If you set the marker not to point anywhere, the buffer will have no mark. */) (void) { - return current_buffer->mark; + return B_ (current_buffer, mark); } @@ -866,9 +866,9 @@ == current_buffer); return Fcons (Fpoint_marker (), - Fcons (Fcopy_marker (current_buffer->mark, Qnil), + Fcons (Fcopy_marker (B_ (current_buffer, mark), Qnil), Fcons (visible ? Qt : Qnil, - Fcons (current_buffer->mark_active, + Fcons (B_ (current_buffer, mark_active), selected_window)))); } @@ -900,8 +900,8 @@ /* Mark marker. */ info = XCDR (info); tem = XCAR (info); - omark = Fmarker_position (current_buffer->mark); - Fset_marker (current_buffer->mark, tem, Fcurrent_buffer ()); + omark = Fmarker_position (B_ (current_buffer, mark)); + Fset_marker (B_ (current_buffer, mark), tem, Fcurrent_buffer ()); nmark = Fmarker_position (tem); unchain_marker (XMARKER (tem)); @@ -922,14 +922,14 @@ /* Mark active */ info = XCDR (info); tem = XCAR (info); - tem1 = current_buffer->mark_active; - current_buffer->mark_active = tem; + tem1 = B_ (current_buffer, mark_active); + B_ (current_buffer, mark_active) = tem; if (!NILP (Vrun_hooks)) { /* If mark is active now, and either was not active or was at a different place, run the activate hook. */ - if (! NILP (current_buffer->mark_active)) + if (! NILP (B_ (current_buffer, mark_active))) { if (! EQ (omark, nmark)) call1 (Vrun_hooks, intern ("activate-mark-hook")); @@ -1114,7 +1114,7 @@ Lisp_Object temp; if (PT <= BEGV) XSETFASTINT (temp, 0); - else if (!NILP (current_buffer->enable_multibyte_characters)) + else if (!NILP (B_ (current_buffer, enable_multibyte_characters))) { EMACS_INT pos = PT_BYTE; DEC_POS (pos); @@ -1228,7 +1228,7 @@ pos_byte = CHAR_TO_BYTE (XINT (pos)); } - if (!NILP (current_buffer->enable_multibyte_characters)) + if (!NILP (B_ (current_buffer, enable_multibyte_characters))) { DEC_POS (pos_byte); XSETFASTINT (val, FETCH_CHAR (pos_byte)); @@ -2135,7 +2135,7 @@ unsigned char str[MAX_MULTIBYTE_LENGTH]; int len; - if (!NILP (current_buffer->enable_multibyte_characters)) + if (!NILP (B_ (current_buffer, enable_multibyte_characters))) len = CHAR_STRING (XFASTINT (val), str); else { @@ -2267,7 +2267,7 @@ CHECK_NUMBER (character); CHECK_NUMBER (count); - if (!NILP (current_buffer->enable_multibyte_characters)) + if (!NILP (B_ (current_buffer, enable_multibyte_characters))) len = CHAR_STRING (XFASTINT (character), str); else str[0] = XFASTINT (character), len = 1; @@ -2316,7 +2316,7 @@ if (XINT (byte) < 0 || XINT (byte) > 255) args_out_of_range_3 (byte, make_number (0), make_number (255)); if (XINT (byte) >= 128 - && ! NILP (current_buffer->enable_multibyte_characters)) + && ! NILP (B_ (current_buffer, enable_multibyte_characters))) XSETFASTINT (byte, BYTE8_TO_CHAR (XINT (byte))); return Finsert_char (byte, count, inherit); } @@ -2370,7 +2370,7 @@ if (start < GPT && GPT < end) move_gap (start); - if (! NILP (current_buffer->enable_multibyte_characters)) + if (! NILP (B_ (current_buffer, enable_multibyte_characters))) result = make_uninit_multibyte_string (end - start, end_byte - start_byte); else result = make_uninit_string (end - start); @@ -2485,7 +2485,7 @@ if (NILP (buf)) nsberror (buffer); bp = XBUFFER (buf); - if (NILP (bp->name)) + if (NILP (B_ (bp, name))) error ("Selecting deleted buffer"); if (NILP (start)) @@ -2533,8 +2533,8 @@ register EMACS_INT begp1, endp1, begp2, endp2, temp; register struct buffer *bp1, *bp2; register Lisp_Object trt - = (!NILP (current_buffer->case_fold_search) - ? current_buffer->case_canon_table : Qnil); + = (!NILP (B_ (current_buffer, case_fold_search)) + ? B_ (current_buffer, case_canon_table) : Qnil); EMACS_INT chars = 0; EMACS_INT i1, i2, i1_byte, i2_byte; @@ -2549,7 +2549,7 @@ if (NILP (buf1)) nsberror (buffer1); bp1 = XBUFFER (buf1); - if (NILP (bp1->name)) + if (NILP (B_ (bp1, name))) error ("Selecting deleted buffer"); } @@ -2587,7 +2587,7 @@ if (NILP (buf2)) nsberror (buffer2); bp2 = XBUFFER (buf2); - if (NILP (bp2->name)) + if (NILP (B_ (bp2, name))) error ("Selecting deleted buffer"); } @@ -2627,7 +2627,7 @@ QUIT; - if (! NILP (bp1->enable_multibyte_characters)) + if (! NILP (B_ (bp1, enable_multibyte_characters))) { c1 = BUF_FETCH_MULTIBYTE_CHAR (bp1, i1_byte); BUF_INC_POS (bp1, i1_byte); @@ -2640,7 +2640,7 @@ i1++; } - if (! NILP (bp2->enable_multibyte_characters)) + if (! NILP (B_ (bp2, enable_multibyte_characters))) { c2 = BUF_FETCH_MULTIBYTE_CHAR (bp2, i2_byte); BUF_INC_POS (bp2, i2_byte); @@ -2680,13 +2680,13 @@ static Lisp_Object subst_char_in_region_unwind (Lisp_Object arg) { - return current_buffer->undo_list = arg; + return B_ (current_buffer, undo_list) = arg; } static Lisp_Object subst_char_in_region_unwind_1 (Lisp_Object arg) { - return current_buffer->filename = arg; + return B_ (current_buffer, filename) = arg; } DEFUN ("subst-char-in-region", Fsubst_char_in_region, @@ -2712,7 +2712,7 @@ #define COMBINING_BOTH (COMBINING_BEFORE | COMBINING_AFTER) int maybe_byte_combining = COMBINING_NO; EMACS_INT last_changed = 0; - int multibyte_p = !NILP (current_buffer->enable_multibyte_characters); + int multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters)); restart: @@ -2756,12 +2756,12 @@ if (!changed && !NILP (noundo)) { record_unwind_protect (subst_char_in_region_unwind, - current_buffer->undo_list); - current_buffer->undo_list = Qt; + B_ (current_buffer, undo_list)); + B_ (current_buffer, undo_list) = Qt; /* Don't do file-locking. */ record_unwind_protect (subst_char_in_region_unwind_1, - current_buffer->filename); - current_buffer->filename = Qnil; + B_ (current_buffer, filename)); + B_ (current_buffer, filename) = Qnil; } if (pos_byte < GPT_BYTE) @@ -2824,7 +2824,7 @@ struct gcpro gcpro1; - tem = current_buffer->undo_list; + tem = B_ (current_buffer, undo_list); GCPRO1 (tem); /* Make a multibyte string containing this single character. */ @@ -2843,7 +2843,7 @@ INC_POS (pos_byte_next); if (! NILP (noundo)) - current_buffer->undo_list = tem; + B_ (current_buffer, undo_list) = tem; UNGCPRO; } @@ -2945,7 +2945,7 @@ int cnt; /* Number of changes made. */ EMACS_INT size; /* Size of translate table. */ EMACS_INT pos, pos_byte, end_pos; - int multibyte = !NILP (current_buffer->enable_multibyte_characters); + int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); int string_multibyte; Lisp_Object val; @@ -3206,7 +3206,7 @@ ? XMARKER (XCAR (data))->buffer : XBUFFER (data)); - if (buf && buf != current_buffer && !NILP (buf->pt_marker)) + if (buf && buf != current_buffer && !NILP (B_ (buf, pt_marker))) { /* If `buf' uses markers to keep track of PT, BEGV, and ZV (as is the case if it is or has an indirect buffer), then make sure it is current before we update BEGV, so @@ -4136,20 +4136,20 @@ if (XINT (c1) == XINT (c2)) return Qt; - if (NILP (current_buffer->case_fold_search)) + if (NILP (B_ (current_buffer, case_fold_search))) return Qnil; /* Do these in separate statements, then compare the variables. because of the way DOWNCASE uses temp variables. */ i1 = XFASTINT (c1); - if (NILP (current_buffer->enable_multibyte_characters) + if (NILP (B_ (current_buffer, enable_multibyte_characters)) && ! ASCII_CHAR_P (i1)) { MAKE_CHAR_MULTIBYTE (i1); } i2 = XFASTINT (c2); - if (NILP (current_buffer->enable_multibyte_characters) + if (NILP (B_ (current_buffer, enable_multibyte_characters)) && ! ASCII_CHAR_P (i2)) { MAKE_CHAR_MULTIBYTE (i2); === modified file 'src/fileio.c' --- src/fileio.c 2011-02-06 22:02:50 +0000 +++ src/fileio.c 2011-02-14 15:39:19 +0000 @@ -770,7 +770,7 @@ /* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted. */ if (NILP (default_directory)) - default_directory = current_buffer->directory; + default_directory = B_ (current_buffer, directory); if (! STRINGP (default_directory)) { #ifdef DOS_NT @@ -2669,7 +2669,7 @@ struct stat st; Lisp_Object handler; - absname = expand_and_dir_to_file (filename, current_buffer->directory); + absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory)); /* If the file name has special constructs in it, call the corresponding file handler. */ @@ -2722,7 +2722,7 @@ struct stat st; Lisp_Object handler; - absname = expand_and_dir_to_file (filename, current_buffer->directory); + absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory)); /* If the file name has special constructs in it, call the corresponding file handler. */ @@ -2769,7 +2769,7 @@ context_t context; #endif - absname = expand_and_dir_to_file (filename, current_buffer->directory); + absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory)); /* If the file name has special constructs in it, call the corresponding file handler. */ @@ -2827,7 +2827,7 @@ context_t parsed_con; #endif - absname = Fexpand_file_name (filename, current_buffer->directory); + absname = Fexpand_file_name (filename, B_ (current_buffer, directory)); /* If the file name has special constructs in it, call the corresponding file handler. */ @@ -2894,7 +2894,7 @@ struct stat st; Lisp_Object handler; - absname = expand_and_dir_to_file (filename, current_buffer->directory); + absname = expand_and_dir_to_file (filename, B_ (current_buffer, directory)); /* If the file name has special constructs in it, call the corresponding file handler. */ @@ -2923,7 +2923,7 @@ Lisp_Object absname, encoded_absname; Lisp_Object handler; - absname = Fexpand_file_name (filename, current_buffer->directory); + absname = Fexpand_file_name (filename, B_ (current_buffer, directory)); CHECK_NUMBER (mode); /* If the file name has special constructs in it, @@ -2985,7 +2985,7 @@ if (! lisp_time_argument (time, &sec, &usec)) error ("Invalid time specification"); - absname = Fexpand_file_name (filename, current_buffer->directory); + absname = Fexpand_file_name (filename, B_ (current_buffer, directory)); /* If the file name has special constructs in it, call the corresponding file handler. */ @@ -3047,8 +3047,8 @@ absname1 = Qnil; GCPRO2 (absname1, file2); - absname1 = expand_and_dir_to_file (file1, current_buffer->directory); - absname2 = expand_and_dir_to_file (file2, current_buffer->directory); + absname1 = expand_and_dir_to_file (file1, B_ (current_buffer, directory)); + absname2 = expand_and_dir_to_file (file2, B_ (current_buffer, directory)); UNGCPRO; /* If the file name has special constructs in it, @@ -3116,8 +3116,8 @@ TEMP_SET_PT_BOTH (BEG, BEG_BYTE); /* Now we are safe to change the buffer's multibyteness directly. */ - current_buffer->enable_multibyte_characters = multibyte; - current_buffer->undo_list = undo_list; + B_ (current_buffer, enable_multibyte_characters) = multibyte; + B_ (current_buffer, undo_list) = undo_list; return Qnil; } @@ -3212,7 +3212,7 @@ if (current_buffer->base_buffer && ! NILP (visit)) error ("Cannot do file visiting in an indirect buffer"); - if (!NILP (current_buffer->read_only)) + if (!NILP (B_ (current_buffer, read_only))) Fbarf_if_buffer_read_only (); val = Qnil; @@ -3403,16 +3403,16 @@ buf = XBUFFER (buffer); delete_all_overlays (buf); - buf->directory = current_buffer->directory; - buf->read_only = Qnil; - buf->filename = Qnil; - buf->undo_list = Qt; + B_ (buf, directory) = B_ (current_buffer, directory); + B_ (buf, read_only) = Qnil; + B_ (buf, filename) = Qnil; + B_ (buf, undo_list) = Qt; eassert (buf->overlays_before == NULL); eassert (buf->overlays_after == NULL); set_buffer_internal (buf); Ferase_buffer (); - buf->enable_multibyte_characters = Qnil; + B_ (buf, enable_multibyte_characters) = Qnil; insert_1_both ((char *) read_buf, nread, nread, 0, 0, 0); TEMP_SET_PT_BOTH (BEG, BEG_BYTE); @@ -3450,7 +3450,7 @@ else CHECK_CODING_SYSTEM (coding_system); - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) /* We must suppress all character code conversion except for end-of-line conversion. */ coding_system = raw_text_coding_system (coding_system); @@ -3598,7 +3598,7 @@ we cannot use this method; giveup and try the other. */ if (same_at_end > same_at_start && FETCH_BYTE (same_at_end - 1) >= 0200 - && ! NILP (current_buffer->enable_multibyte_characters) + && ! NILP (B_ (current_buffer, enable_multibyte_characters)) && (CODING_MAY_REQUIRE_DECODING (&coding))) giveup_match_end = 1; break; @@ -3617,14 +3617,14 @@ /* Extend the start of non-matching text area to multibyte character boundary. */ - if (! NILP (current_buffer->enable_multibyte_characters)) + if (! NILP (B_ (current_buffer, enable_multibyte_characters))) while (same_at_start > BEGV_BYTE && ! CHAR_HEAD_P (FETCH_BYTE (same_at_start))) same_at_start--; /* Extend the end of non-matching text area to multibyte character boundary. */ - if (! NILP (current_buffer->enable_multibyte_characters)) + if (! NILP (B_ (current_buffer, enable_multibyte_characters))) while (same_at_end < ZV_BYTE && ! CHAR_HEAD_P (FETCH_BYTE (same_at_end))) same_at_end++; @@ -3673,7 +3673,7 @@ unsigned char *decoded; EMACS_INT temp; int this_count = SPECPDL_INDEX (); - int multibyte = ! NILP (current_buffer->enable_multibyte_characters); + int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); Lisp_Object conversion_buffer; conversion_buffer = code_conversion_save (1, multibyte); @@ -3778,7 +3778,7 @@ /* Extend the start of non-matching text area to the previous multibyte character boundary. */ - if (! NILP (current_buffer->enable_multibyte_characters)) + if (! NILP (B_ (current_buffer, enable_multibyte_characters))) while (same_at_start > BEGV_BYTE && ! CHAR_HEAD_P (FETCH_BYTE (same_at_start))) same_at_start--; @@ -3795,7 +3795,7 @@ /* Extend the end of non-matching text area to the next multibyte character boundary. */ - if (! NILP (current_buffer->enable_multibyte_characters)) + if (! NILP (B_ (current_buffer, enable_multibyte_characters))) while (same_at_end < ZV_BYTE && ! CHAR_HEAD_P (FETCH_BYTE (same_at_end))) same_at_end++; @@ -3870,9 +3870,9 @@ if (NILP (visit) && inserted > 0) { #ifdef CLASH_DETECTION - if (!NILP (current_buffer->file_truename) + if (!NILP (B_ (current_buffer, file_truename)) /* Make binding buffer-file-name to nil effective. */ - && !NILP (current_buffer->filename) + && !NILP (B_ (current_buffer, filename)) && SAVE_MODIFF >= MODIFF) we_locked_file = 1; #endif /* CLASH_DETECTION */ @@ -3977,7 +3977,7 @@ { #ifdef CLASH_DETECTION if (we_locked_file) - unlock_file (current_buffer->file_truename); + unlock_file (B_ (current_buffer, file_truename)); #endif Vdeactivate_mark = old_Vdeactivate_mark; } @@ -4028,11 +4028,11 @@ Lisp_Object unwind_data; int count = SPECPDL_INDEX (); - unwind_data = Fcons (current_buffer->enable_multibyte_characters, - Fcons (current_buffer->undo_list, + unwind_data = Fcons (B_ (current_buffer, enable_multibyte_characters), + Fcons (B_ (current_buffer, undo_list), Fcurrent_buffer ())); - current_buffer->enable_multibyte_characters = Qnil; - current_buffer->undo_list = Qt; + B_ (current_buffer, enable_multibyte_characters) = Qnil; + B_ (current_buffer, undo_list) = Qt; record_unwind_protect (decide_coding_unwind, unwind_data); if (inserted > 0 && ! NILP (Vset_auto_coding_function)) @@ -4062,7 +4062,7 @@ else CHECK_CODING_SYSTEM (coding_system); - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) /* We must suppress all character code conversion except for end-of-line conversion. */ coding_system = raw_text_coding_system (coding_system); @@ -4080,10 +4080,10 @@ && NILP (replace)) /* Visiting a file with these coding system makes the buffer unibyte. */ - current_buffer->enable_multibyte_characters = Qnil; + B_ (current_buffer, enable_multibyte_characters) = Qnil; } - coding.dst_multibyte = ! NILP (current_buffer->enable_multibyte_characters); + coding.dst_multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); if (CODING_MAY_REQUIRE_DECODING (&coding) && (inserted > 0 || CODING_REQUIRE_FLUSHING (&coding))) { @@ -4124,24 +4124,24 @@ if (!NILP (visit)) { - if (!EQ (current_buffer->undo_list, Qt) && !nochange) - current_buffer->undo_list = Qnil; + if (!EQ (B_ (current_buffer, undo_list), Qt) && !nochange) + B_ (current_buffer, undo_list) = Qnil; if (NILP (handler)) { current_buffer->modtime = st.st_mtime; current_buffer->modtime_size = st.st_size; - current_buffer->filename = orig_filename; + B_ (current_buffer, filename) = orig_filename; } SAVE_MODIFF = MODIFF; BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF; - XSETFASTINT (current_buffer->save_length, Z - BEG); + XSETFASTINT (B_ (current_buffer, save_length), Z - BEG); #ifdef CLASH_DETECTION if (NILP (handler)) { - if (!NILP (current_buffer->file_truename)) - unlock_file (current_buffer->file_truename); + if (!NILP (B_ (current_buffer, file_truename))) + unlock_file (B_ (current_buffer, file_truename)); unlock_file (filename); } #endif /* CLASH_DETECTION */ @@ -4174,8 +4174,8 @@ specbind (Qinhibit_modification_hooks, Qt); /* Save old undo list and don't record undo for decoding. */ - old_undo = current_buffer->undo_list; - current_buffer->undo_list = Qt; + old_undo = B_ (current_buffer, undo_list); + B_ (current_buffer, undo_list) = Qt; if (NILP (replace)) { @@ -4263,7 +4263,7 @@ if (NILP (visit)) { - current_buffer->undo_list = old_undo; + B_ (current_buffer, undo_list) = old_undo; if (CONSP (old_undo) && inserted != old_inserted) { /* Adjust the last undo record for the size change during @@ -4278,7 +4278,7 @@ else /* If undo_list was Qt before, keep it that way. Otherwise start with an empty undo_list. */ - current_buffer->undo_list = EQ (old_undo, Qt) ? Qt : Qnil; + B_ (current_buffer, undo_list) = EQ (old_undo, Qt) ? Qt : Qnil; unbind_to (count, Qnil); } @@ -4332,8 +4332,8 @@ Lisp_Object eol_parent = Qnil; if (auto_saving - && NILP (Fstring_equal (current_buffer->filename, - current_buffer->auto_save_file_name))) + && NILP (Fstring_equal (B_ (current_buffer, filename), + B_ (current_buffer, auto_save_file_name)))) { val = Qutf_8_emacs; eol_parent = Qunix; @@ -4362,12 +4362,12 @@ int using_default_coding = 0; int force_raw_text = 0; - val = current_buffer->buffer_file_coding_system; + val = B_ (current_buffer, buffer_file_coding_system); if (NILP (val) || NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil))) { val = Qnil; - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) force_raw_text = 1; } @@ -4388,7 +4388,7 @@ { /* If we still have not decided a coding system, use the default value of buffer-file-coding-system. */ - val = current_buffer->buffer_file_coding_system; + val = B_ (current_buffer, buffer_file_coding_system); using_default_coding = 1; } @@ -4412,9 +4412,9 @@ format, we use that of `default-buffer-file-coding-system'. */ if (! using_default_coding - && ! NILP (buffer_defaults.buffer_file_coding_system)) + && ! NILP (B_ (&buffer_defaults, buffer_file_coding_system))) val = (coding_inherit_eol_type - (val, buffer_defaults.buffer_file_coding_system)); + (val, B_ (&buffer_defaults, buffer_file_coding_system))); /* If we decide not to encode text, use `raw-text' or one of its subsidiaries. */ @@ -4425,7 +4425,7 @@ val = coding_inherit_eol_type (val, eol_parent); setup_coding_system (val, coding); - if (!STRINGP (start) && !NILP (current_buffer->selective_display)) + if (!STRINGP (start) && !NILP (B_ (current_buffer, selective_display))) coding->mode |= CODING_MODE_SELECTIVE_DISPLAY; return val; } @@ -4529,8 +4529,8 @@ if (visiting) { SAVE_MODIFF = MODIFF; - XSETFASTINT (current_buffer->save_length, Z - BEG); - current_buffer->filename = visit_file; + XSETFASTINT (B_ (current_buffer, save_length), Z - BEG); + B_ (current_buffer, filename) = visit_file; } UNGCPRO; return val; @@ -4743,15 +4743,15 @@ if (visiting) { SAVE_MODIFF = MODIFF; - XSETFASTINT (current_buffer->save_length, Z - BEG); - current_buffer->filename = visit_file; + XSETFASTINT (B_ (current_buffer, save_length), Z - BEG); + B_ (current_buffer, filename) = visit_file; update_mode_lines++; } else if (quietly) { if (auto_saving - && ! NILP (Fstring_equal (current_buffer->filename, - current_buffer->auto_save_file_name))) + && ! NILP (Fstring_equal (B_ (current_buffer, filename), + B_ (current_buffer, auto_save_file_name)))) SAVE_MODIFF = MODIFF; return Qnil; @@ -4833,10 +4833,10 @@ } /* Now do the same for annotation functions implied by the file-format */ - if (auto_saving && (!EQ (current_buffer->auto_save_file_format, Qt))) - p = current_buffer->auto_save_file_format; + if (auto_saving && (!EQ (B_ (current_buffer, auto_save_file_format), Qt))) + p = B_ (current_buffer, auto_save_file_format); else - p = current_buffer->file_format; + p = B_ (current_buffer, file_format); for (i = 0; CONSP (p); p = XCDR (p), ++i) { struct buffer *given_buffer = current_buffer; @@ -5015,17 +5015,17 @@ b = XBUFFER (buf); } - if (!STRINGP (b->filename)) return Qt; + if (!STRINGP (B_ (b, filename))) return Qt; if (b->modtime == 0) return Qt; /* If the file name has special constructs in it, call the corresponding file handler. */ - handler = Ffind_file_name_handler (b->filename, + handler = Ffind_file_name_handler (B_ (b, filename), Qverify_visited_file_modtime); if (!NILP (handler)) return call2 (handler, Qverify_visited_file_modtime, buf); - filename = ENCODE_FILE (b->filename); + filename = ENCODE_FILE (B_ (b, filename)); if (stat (SSDATA (filename), &st) < 0) { @@ -5093,7 +5093,7 @@ struct stat st; Lisp_Object handler; - filename = Fexpand_file_name (current_buffer->filename, Qnil); + filename = Fexpand_file_name (B_ (current_buffer, filename), Qnil); /* If the file name has special constructs in it, call the corresponding file handler. */ @@ -5128,7 +5128,7 @@ ring_bell (XFRAME (selected_frame)); args[0] = build_string ("Auto-saving %s: %s"); - args[1] = current_buffer->name; + args[1] = B_ (current_buffer, name); args[2] = Ferror_message_string (error); msg = Fformat (3, args); GCPRO1 (msg); @@ -5159,19 +5159,19 @@ auto_save_mode_bits = 0666; /* Get visited file's mode to become the auto save file's mode. */ - if (! NILP (current_buffer->filename)) + if (! NILP (B_ (current_buffer, filename))) { - if (stat (SSDATA (current_buffer->filename), &st) >= 0) + if (stat (SSDATA (B_ (current_buffer, filename)), &st) >= 0) /* But make sure we can overwrite it later! */ auto_save_mode_bits = st.st_mode | 0600; - else if ((modes = Ffile_modes (current_buffer->filename), + else if ((modes = Ffile_modes (B_ (current_buffer, filename)), INTEGERP (modes))) /* Remote files don't cooperate with stat. */ auto_save_mode_bits = XINT (modes) | 0600; } return - Fwrite_region (Qnil, Qnil, current_buffer->auto_save_file_name, Qnil, + Fwrite_region (Qnil, Qnil, B_ (current_buffer, auto_save_file_name), Qnil, NILP (Vauto_save_visited_file_name) ? Qlambda : Qt, Qnil, Qnil); } @@ -5312,18 +5312,18 @@ /* Record all the buffers that have auto save mode in the special file that lists them. For each of these buffers, Record visited name (if any) and auto save name. */ - if (STRINGP (b->auto_save_file_name) + if (STRINGP (B_ (b, auto_save_file_name)) && stream != NULL && do_handled_files == 0) { BLOCK_INPUT; - if (!NILP (b->filename)) + if (!NILP (B_ (b, filename))) { - fwrite (SDATA (b->filename), 1, - SBYTES (b->filename), stream); + fwrite (SDATA (B_ (b, filename)), 1, + SBYTES (B_ (b, filename)), stream); } putc ('\n', stream); - fwrite (SDATA (b->auto_save_file_name), 1, - SBYTES (b->auto_save_file_name), stream); + fwrite (SDATA (B_ (b, auto_save_file_name)), 1, + SBYTES (B_ (b, auto_save_file_name)), stream); putc ('\n', stream); UNBLOCK_INPUT; } @@ -5340,13 +5340,13 @@ /* Check for auto save enabled and file changed since last auto save and file changed since last real save. */ - if (STRINGP (b->auto_save_file_name) + if (STRINGP (B_ (b, auto_save_file_name)) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b) && BUF_AUTOSAVE_MODIFF (b) < BUF_MODIFF (b) /* -1 means we've turned off autosaving for a while--see below. */ - && XINT (b->save_length) >= 0 + && XINT (B_ (b, save_length)) >= 0 && (do_handled_files - || NILP (Ffind_file_name_handler (b->auto_save_file_name, + || NILP (Ffind_file_name_handler (B_ (b, auto_save_file_name), Qwrite_region)))) { EMACS_TIME before_time, after_time; @@ -5360,23 +5360,23 @@ set_buffer_internal (b); if (NILP (Vauto_save_include_big_deletions) - && (XFASTINT (b->save_length) * 10 + && (XFASTINT (B_ (b, save_length)) * 10 > (BUF_Z (b) - BUF_BEG (b)) * 13) /* A short file is likely to change a large fraction; spare the user annoying messages. */ - && XFASTINT (b->save_length) > 5000 + && XFASTINT (B_ (b, save_length)) > 5000 /* These messages are frequent and annoying for `*mail*'. */ - && !EQ (b->filename, Qnil) + && !EQ (B_ (b, filename), Qnil) && NILP (no_message)) { /* It has shrunk too much; turn off auto-saving here. */ minibuffer_auto_raise = orig_minibuffer_auto_raise; message_with_string ("Buffer %s has shrunk a lot; auto save disabled in that buffer until next real save", - b->name, 1); + B_ (b, name), 1); minibuffer_auto_raise = 0; /* Turn off auto-saving until there's a real save, and prevent any more warnings. */ - XSETINT (b->save_length, -1); + XSETINT (B_ (b, save_length), -1); Fsleep_for (make_number (1), Qnil); continue; } @@ -5385,7 +5385,7 @@ internal_condition_case (auto_save_1, Qt, auto_save_error); auto_saved++; BUF_AUTOSAVE_MODIFF (b) = BUF_MODIFF (b); - XSETFASTINT (current_buffer->save_length, Z - BEG); + XSETFASTINT (B_ (current_buffer, save_length), Z - BEG); set_buffer_internal (old); EMACS_GET_TIME (after_time); @@ -5432,7 +5432,7 @@ /* FIXME: This should not be called in indirect buffers, since they're not autosaved. */ BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF; - XSETFASTINT (current_buffer->save_length, Z - BEG); + XSETFASTINT (B_ (current_buffer, save_length), Z - BEG); current_buffer->auto_save_failure_time = -1; return Qnil; } === modified file 'src/filelock.c' --- src/filelock.c 2011-01-30 22:17:44 +0000 +++ src/filelock.c 2011-02-14 15:39:19 +0000 @@ -637,9 +637,9 @@ for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) { b = XBUFFER (XCDR (XCAR (tail))); - if (STRINGP (b->file_truename) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) + if (STRINGP (B_ (b, file_truename)) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) { - unlock_file(b->file_truename); + unlock_file(B_ (b, file_truename)); } } } @@ -652,7 +652,7 @@ (Lisp_Object file) { if (NILP (file)) - file = current_buffer->file_truename; + file = B_ (current_buffer, file_truename); else CHECK_STRING (file); if (SAVE_MODIFF < MODIFF @@ -669,8 +669,8 @@ (void) { if (SAVE_MODIFF < MODIFF - && STRINGP (current_buffer->file_truename)) - unlock_file (current_buffer->file_truename); + && STRINGP (B_ (current_buffer, file_truename))) + unlock_file (B_ (current_buffer, file_truename)); return Qnil; } @@ -680,8 +680,8 @@ unlock_buffer (struct buffer *buffer) { if (BUF_SAVE_MODIFF (buffer) < BUF_MODIFF (buffer) - && STRINGP (buffer->file_truename)) - unlock_file (buffer->file_truename); + && STRINGP (B_ (buffer, file_truename))) + unlock_file (B_ (buffer, file_truename)); } DEFUN ("file-locked-p", Ffile_locked_p, Sfile_locked_p, 1, 1, 0, === modified file 'src/fns.c' --- src/fns.c 2011-02-07 04:43:35 +0000 +++ src/fns.c 2011-02-14 15:39:19 +0000 @@ -2984,7 +2984,7 @@ SAFE_ALLOCA (encoded, char *, allength); encoded_length = base64_encode_1 ((char *) BYTE_POS_ADDR (ibeg), encoded, length, NILP (no_line_break), - !NILP (current_buffer->enable_multibyte_characters)); + !NILP (B_ (current_buffer, enable_multibyte_characters))); if (encoded_length > allength) abort (); @@ -3166,7 +3166,7 @@ EMACS_INT old_pos = PT; EMACS_INT decoded_length; EMACS_INT inserted_chars; - int multibyte = !NILP (current_buffer->enable_multibyte_characters); + int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); USE_SAFE_ALLOCA; validate_region (&beg, &end); @@ -4684,12 +4684,12 @@ { int force_raw_text = 0; - coding_system = XBUFFER (object)->buffer_file_coding_system; + coding_system = B_ (XBUFFER (object), buffer_file_coding_system); if (NILP (coding_system) || NILP (Flocal_variable_p (Qbuffer_file_coding_system, Qnil))) { coding_system = Qnil; - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) force_raw_text = 1; } @@ -4706,11 +4706,11 @@ } if (NILP (coding_system) - && !NILP (XBUFFER (object)->buffer_file_coding_system)) + && !NILP (B_ (XBUFFER (object), buffer_file_coding_system))) { /* If we still have not decided a coding system, use the default value of buffer-file-coding-system. */ - coding_system = XBUFFER (object)->buffer_file_coding_system; + coding_system = B_ (XBUFFER (object), buffer_file_coding_system); } if (!force_raw_text === modified file 'src/font.c' --- src/font.c 2011-02-08 06:56:57 +0000 +++ src/font.c 2011-02-14 15:39:19 +0000 @@ -3637,7 +3637,7 @@ Lisp_Object font_object; multibyte = (NILP (string) - ? ! NILP (current_buffer->enable_multibyte_characters) + ? ! NILP (B_ (current_buffer, enable_multibyte_characters)) : STRING_MULTIBYTE (string)); if (c < 0) { === modified file 'src/frame.c' --- src/frame.c 2011-01-30 22:17:44 +0000 +++ src/frame.c 2011-02-14 15:39:19 +0000 @@ -1817,7 +1817,7 @@ w = XWINDOW (window); if (!NILP (w->buffer)) - XBUFFER (w->buffer)->display_time = Fcurrent_time (); + B_ (XBUFFER (w->buffer), display_time) = Fcurrent_time (); if (!NILP (w->vchild)) make_frame_visible_1 (w->vchild); === modified file 'src/fringe.c' --- src/fringe.c 2011-01-25 04:08:28 +0000 +++ src/fringe.c 2011-02-14 15:39:19 +0000 @@ -660,7 +660,7 @@ { Lisp_Object cmap, bm = Qnil; - if ((cmap = XBUFFER (w->buffer)->fringe_cursor_alist), !NILP (cmap)) + if ((cmap = B_ (XBUFFER (w->buffer), fringe_cursor_alist)), !NILP (cmap)) { bm = Fassq (cursor, cmap); if (CONSP (bm)) @@ -670,9 +670,9 @@ return lookup_fringe_bitmap (bm); } } - if (EQ (cmap, buffer_defaults.fringe_cursor_alist)) + if (EQ (cmap, B_ (&buffer_defaults, fringe_cursor_alist))) return NO_FRINGE_BITMAP; - bm = Fassq (cursor, buffer_defaults.fringe_cursor_alist); + bm = Fassq (cursor, B_ (&buffer_defaults, fringe_cursor_alist)); if (!CONSP (bm) || ((bm = XCDR (bm)), NILP (bm))) return NO_FRINGE_BITMAP; return lookup_fringe_bitmap (bm); @@ -697,7 +697,7 @@ If partial, lookup partial bitmap in default value if not found here. If not partial, or no partial spec is present, use non-partial bitmap. */ - if ((cmap = XBUFFER (w->buffer)->fringe_indicator_alist), !NILP (cmap)) + if ((cmap = B_ (XBUFFER (w->buffer), fringe_indicator_alist)), !NILP (cmap)) { bm1 = Fassq (bitmap, cmap); if (CONSP (bm1)) @@ -731,10 +731,10 @@ } } - if (!EQ (cmap, buffer_defaults.fringe_indicator_alist) - && !NILP (buffer_defaults.fringe_indicator_alist)) + if (!EQ (cmap, B_ (&buffer_defaults, fringe_indicator_alist)) + && !NILP (B_ (&buffer_defaults, fringe_indicator_alist))) { - bm2 = Fassq (bitmap, buffer_defaults.fringe_indicator_alist); + bm2 = Fassq (bitmap, B_ (&buffer_defaults, fringe_indicator_alist)); if (CONSP (bm2)) { if ((bm2 = XCDR (bm2)), !NILP (bm2)) @@ -919,7 +919,7 @@ return 0; if (!MINI_WINDOW_P (w) - && (ind = XBUFFER (w->buffer)->indicate_buffer_boundaries, !NILP (ind))) + && (ind = B_ (XBUFFER (w->buffer), indicate_buffer_boundaries), !NILP (ind))) { if (EQ (ind, Qleft) || EQ (ind, Qright)) boundary_top = boundary_bot = arrow_top = arrow_bot = ind; @@ -988,7 +988,7 @@ } } - empty_pos = XBUFFER (w->buffer)->indicate_empty_lines; + empty_pos = B_ (XBUFFER (w->buffer), indicate_empty_lines); if (!NILP (empty_pos) && !EQ (empty_pos, Qright)) empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft; === modified file 'src/indent.c' --- src/indent.c 2011-02-07 05:42:15 +0000 +++ src/indent.c 2011-02-14 15:39:19 +0000 @@ -70,7 +70,7 @@ { Lisp_Object thisbuf; - thisbuf = current_buffer->display_table; + thisbuf = B_ (current_buffer, display_table); if (DISP_TABLE_P (thisbuf)) return XCHAR_TABLE (thisbuf); if (DISP_TABLE_P (Vstandard_display_table)) @@ -140,9 +140,9 @@ int i; struct Lisp_Vector *widthtab; - if (!VECTORP (buf->width_table)) - buf->width_table = Fmake_vector (make_number (256), make_number (0)); - widthtab = XVECTOR (buf->width_table); + if (!VECTORP (B_ (buf, width_table))) + B_ (buf, width_table) = Fmake_vector (make_number (256), make_number (0)); + widthtab = XVECTOR (B_ (buf, width_table)); if (widthtab->size != 256) abort (); @@ -156,17 +156,17 @@ static void width_run_cache_on_off (void) { - if (NILP (current_buffer->cache_long_line_scans) + if (NILP (B_ (current_buffer, cache_long_line_scans)) /* And, for the moment, this feature doesn't work on multibyte characters. */ - || !NILP (current_buffer->enable_multibyte_characters)) + || !NILP (B_ (current_buffer, enable_multibyte_characters))) { /* It should be off. */ if (current_buffer->width_run_cache) { free_region_cache (current_buffer->width_run_cache); current_buffer->width_run_cache = 0; - current_buffer->width_table = Qnil; + B_ (current_buffer, width_table) = Qnil; } } else @@ -329,8 +329,8 @@ register int tab_seen; int post_tab; register int c; - register int tab_width = XINT (current_buffer->tab_width); - int ctl_arrow = !NILP (current_buffer->ctl_arrow); + register int tab_width = XINT (B_ (current_buffer, tab_width)); + int ctl_arrow = !NILP (B_ (current_buffer, ctl_arrow)); register struct Lisp_Char_Table *dp = buffer_display_table (); if (PT == last_known_column_point @@ -417,7 +417,7 @@ col++; else if (c == '\n' || (c == '\r' - && EQ (current_buffer->selective_display, Qt))) + && EQ (B_ (current_buffer, selective_display), Qt))) { ptr++; goto start_of_line_found; @@ -512,10 +512,10 @@ static void scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol) { - register EMACS_INT tab_width = XINT (current_buffer->tab_width); - register int ctl_arrow = !NILP (current_buffer->ctl_arrow); + register EMACS_INT tab_width = XINT (B_ (current_buffer, tab_width)); + register int ctl_arrow = !NILP (B_ (current_buffer, ctl_arrow)); register struct Lisp_Char_Table *dp = buffer_display_table (); - int multibyte = !NILP (current_buffer->enable_multibyte_characters); + int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); struct composition_it cmp_it; Lisp_Object window; struct window *w; @@ -637,7 +637,7 @@ if (c == '\n') goto endloop; - if (c == '\r' && EQ (current_buffer->selective_display, Qt)) + if (c == '\r' && EQ (B_ (current_buffer, selective_display), Qt)) goto endloop; if (c == '\t') { @@ -655,7 +655,7 @@ if (c == '\n') goto endloop; - if (c == '\r' && EQ (current_buffer->selective_display, Qt)) + if (c == '\r' && EQ (B_ (current_buffer, selective_display), Qt)) goto endloop; if (c == '\t') { @@ -809,7 +809,7 @@ { int mincol; register int fromcol; - register int tab_width = XINT (current_buffer->tab_width); + register int tab_width = XINT (B_ (current_buffer, tab_width)); CHECK_NUMBER (column); if (NILP (minimum)) @@ -872,7 +872,7 @@ position_indentation (register int pos_byte) { register EMACS_INT column = 0; - register EMACS_INT tab_width = XINT (current_buffer->tab_width); + register EMACS_INT tab_width = XINT (B_ (current_buffer, tab_width)); register unsigned char *p; register unsigned char *stop; unsigned char *start; @@ -924,7 +924,7 @@ switch (*p++) { case 0240: - if (! NILP (current_buffer->enable_multibyte_characters)) + if (! NILP (B_ (current_buffer, enable_multibyte_characters))) return column; case ' ': column++; @@ -934,7 +934,7 @@ break; default: if (ASCII_BYTE_P (p[-1]) - || NILP (current_buffer->enable_multibyte_characters)) + || NILP (B_ (current_buffer, enable_multibyte_characters))) return column; { int c; @@ -1123,13 +1123,13 @@ register EMACS_INT pos; EMACS_INT pos_byte; register int c = 0; - register EMACS_INT tab_width = XFASTINT (current_buffer->tab_width); - register int ctl_arrow = !NILP (current_buffer->ctl_arrow); + register EMACS_INT tab_width = XFASTINT (B_ (current_buffer, tab_width)); + register int ctl_arrow = !NILP (B_ (current_buffer, ctl_arrow)); register struct Lisp_Char_Table *dp = window_display_table (win); int selective - = (INTEGERP (current_buffer->selective_display) - ? XINT (current_buffer->selective_display) - : !NILP (current_buffer->selective_display) ? -1 : 0); + = (INTEGERP (B_ (current_buffer, selective_display)) + ? XINT (B_ (current_buffer, selective_display)) + : !NILP (B_ (current_buffer, selective_display)) ? -1 : 0); int selective_rlen = (selective && dp && VECTORP (DISP_INVIS_VECTOR (dp)) ? XVECTOR (DISP_INVIS_VECTOR (dp))->size : 0); @@ -1151,7 +1151,7 @@ EMACS_INT next_width_run = from; Lisp_Object window; - int multibyte = !NILP (current_buffer->enable_multibyte_characters); + int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); /* If previous char scanned was a wide character, this is the column where it ended. Otherwise, this is 0. */ EMACS_INT wide_column_end_hpos = 0; @@ -1170,8 +1170,8 @@ width_run_cache_on_off (); if (dp == buffer_display_table ()) - width_table = (VECTORP (current_buffer->width_table) - ? XVECTOR (current_buffer->width_table)->contents + width_table = (VECTORP (B_ (current_buffer, width_table)) + ? XVECTOR (B_ (current_buffer, width_table))->contents : 0); else /* If the window has its own display table, we can't use the width @@ -1337,7 +1337,7 @@ } if (hscroll || truncate - || !NILP (current_buffer->truncate_lines)) + || !NILP (B_ (current_buffer, truncate_lines))) { /* Truncating: skip to newline, unless we are already past TO (we need to go back below). */ @@ -1838,9 +1838,9 @@ EMACS_INT from_byte; EMACS_INT lmargin = hscroll > 0 ? 1 - hscroll : 0; int selective - = (INTEGERP (current_buffer->selective_display) - ? XINT (current_buffer->selective_display) - : !NILP (current_buffer->selective_display) ? -1 : 0); + = (INTEGERP (B_ (current_buffer, selective_display)) + ? XINT (B_ (current_buffer, selective_display)) + : !NILP (B_ (current_buffer, selective_display)) ? -1 : 0); Lisp_Object window; EMACS_INT start_hpos = 0; int did_motion; === modified file 'src/insdel.c' --- src/insdel.c 2011-02-06 19:44:36 +0000 +++ src/insdel.c 2011-02-14 15:39:19 +0000 @@ -78,7 +78,7 @@ check_markers (void) { register struct Lisp_Marker *tail; - int multibyte = ! NILP (current_buffer->enable_multibyte_characters); + int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next) { @@ -703,7 +703,7 @@ unsigned char str[MAX_MULTIBYTE_LENGTH]; int len; - if (! NILP (current_buffer->enable_multibyte_characters)) + if (! NILP (B_ (current_buffer, enable_multibyte_characters))) len = CHAR_STRING (c, str); else { @@ -891,7 +891,7 @@ if (nchars == 0) return; - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) nchars = nbytes; if (prepare) @@ -1011,7 +1011,7 @@ /* Make OUTGOING_NBYTES describe the text as it will be inserted in this buffer. */ - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) outgoing_nbytes = nchars; else if (! STRING_MULTIBYTE (string)) outgoing_nbytes @@ -1034,7 +1034,7 @@ between single-byte and multibyte. */ copy_text (SDATA (string) + pos_byte, GPT_ADDR, nbytes, STRING_MULTIBYTE (string), - ! NILP (current_buffer->enable_multibyte_characters)); + ! NILP (B_ (current_buffer, enable_multibyte_characters))); #ifdef BYTE_COMBINING_DEBUG /* We have copied text into the gap, but we have not altered @@ -1094,7 +1094,7 @@ void insert_from_gap (EMACS_INT nchars, EMACS_INT nbytes) { - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) nchars = nbytes; record_insert (GPT, nchars); @@ -1162,9 +1162,9 @@ /* Make OUTGOING_NBYTES describe the text as it will be inserted in this buffer. */ - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) outgoing_nbytes = nchars; - else if (NILP (buf->enable_multibyte_characters)) + else if (NILP (B_ (buf, enable_multibyte_characters))) { EMACS_INT outgoing_before_gap = 0; EMACS_INT outgoing_after_gap = 0; @@ -1215,8 +1215,8 @@ chunk_expanded = copy_text (BUF_BYTE_ADDRESS (buf, from_byte), GPT_ADDR, chunk, - ! NILP (buf->enable_multibyte_characters), - ! NILP (current_buffer->enable_multibyte_characters)); + ! NILP (B_ (buf, enable_multibyte_characters)), + ! NILP (B_ (current_buffer, enable_multibyte_characters))); } else chunk_expanded = chunk = 0; @@ -1224,8 +1224,8 @@ if (chunk < incoming_nbytes) copy_text (BUF_BYTE_ADDRESS (buf, from_byte + chunk), GPT_ADDR + chunk_expanded, incoming_nbytes - chunk, - ! NILP (buf->enable_multibyte_characters), - ! NILP (current_buffer->enable_multibyte_characters)); + ! NILP (B_ (buf, enable_multibyte_characters)), + ! NILP (B_ (current_buffer, enable_multibyte_characters))); #ifdef BYTE_COMBINING_DEBUG /* We have copied text into the gap, but we have not altered @@ -1320,7 +1320,7 @@ adjust_markers_for_insert (from, from_byte, from + len, from_byte + len_byte, 0); - if (! EQ (current_buffer->undo_list, Qt)) + if (! EQ (B_ (current_buffer, undo_list), Qt)) { if (nchars_del > 0) record_delete (from, prev_text); @@ -1481,7 +1481,7 @@ /* Make OUTGOING_INSBYTES describe the text as it will be inserted in this buffer. */ - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) outgoing_insbytes = inschars; else if (! STRING_MULTIBYTE (new)) outgoing_insbytes @@ -1503,7 +1503,7 @@ /* Even if we don't record for undo, we must keep the original text because we may have to recover it because of inappropriate byte combining. */ - if (! EQ (current_buffer->undo_list, Qt)) + if (! EQ (B_ (current_buffer, undo_list), Qt)) deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1); GAP_SIZE += nbytes_del; @@ -1530,7 +1530,7 @@ between single-byte and multibyte. */ copy_text (SDATA (new), GPT_ADDR, insbytes, STRING_MULTIBYTE (new), - ! NILP (current_buffer->enable_multibyte_characters)); + ! NILP (B_ (current_buffer, enable_multibyte_characters))); #ifdef BYTE_COMBINING_DEBUG /* We have copied text into the gap, but we have not marked @@ -1543,7 +1543,7 @@ abort (); #endif - if (! EQ (current_buffer->undo_list, Qt)) + if (! EQ (B_ (current_buffer, undo_list), Qt)) { /* Record the insertion first, so that when we undo, the deletion will be undone first. Thus, undo @@ -1886,7 +1886,7 @@ abort (); #endif - if (ret_string || ! EQ (current_buffer->undo_list, Qt)) + if (ret_string || ! EQ (B_ (current_buffer, undo_list), Qt)) deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1); else deletion = Qnil; @@ -1897,7 +1897,7 @@ so that undo handles this after reinserting the text. */ adjust_markers_for_delete (from, from_byte, to, to_byte); - if (! EQ (current_buffer->undo_list, Qt)) + if (! EQ (B_ (current_buffer, undo_list), Qt)) record_delete (from, deletion); MODIFF++; CHARS_MODIFF = MODIFF; @@ -1968,7 +1968,7 @@ if (! preserve_chars_modiff) CHARS_MODIFF = MODIFF; - buffer->point_before_scroll = Qnil; + B_ (buffer, point_before_scroll) = Qnil; if (buffer != old_buffer) set_buffer_internal (old_buffer); @@ -1990,7 +1990,7 @@ { struct buffer *base_buffer; - if (!NILP (current_buffer->read_only)) + if (!NILP (B_ (current_buffer, read_only))) Fbarf_if_buffer_read_only (); /* Let redisplay consider other windows than selected_window @@ -2022,11 +2022,11 @@ base_buffer = current_buffer; #ifdef CLASH_DETECTION - if (!NILP (base_buffer->file_truename) + if (!NILP (B_ (base_buffer, file_truename)) /* Make binding buffer-file-name to nil effective. */ - && !NILP (base_buffer->filename) + && !NILP (B_ (base_buffer, filename)) && SAVE_MODIFF >= MODIFF) - lock_file (base_buffer->file_truename); + lock_file (B_ (base_buffer, file_truename)); #else /* At least warn if this file has changed on disk since it was visited. */ if (!NILP (base_buffer->filename) @@ -2038,16 +2038,16 @@ #endif /* not CLASH_DETECTION */ /* If `select-active-regions' is non-nil, save the region text. */ - if (!NILP (current_buffer->mark_active) + if (!NILP (B_ (current_buffer, mark_active)) && !inhibit_modification_hooks - && XMARKER (current_buffer->mark)->buffer + && XMARKER (B_ (current_buffer, mark))->buffer && NILP (Vsaved_region_selection) && (EQ (Vselect_active_regions, Qonly) ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) : (!NILP (Vselect_active_regions) && !NILP (Vtransient_mark_mode)))) { - EMACS_INT b = XMARKER (current_buffer->mark)->charpos; + EMACS_INT b = XMARKER (B_ (current_buffer, mark))->charpos; EMACS_INT e = PT; if (b < e) Vsaved_region_selection = make_buffer_string (b, e, 0); @@ -2290,7 +2290,7 @@ non-nil, and insertion calls a file handler (e.g. through lock_file) which scribbles into a temp file -- cyd */ if (!BUFFERP (combine_after_change_buffer) - || NILP (XBUFFER (combine_after_change_buffer)->name)) + || NILP (B_ (XBUFFER (combine_after_change_buffer), name))) { combine_after_change_list = Qnil; return Qnil; === modified file 'src/intervals.c' --- src/intervals.c 2011-01-25 04:08:28 +0000 +++ src/intervals.c 2011-02-14 15:39:19 +0000 @@ -1978,7 +1978,7 @@ int have_overlays; EMACS_INT original_position; - current_buffer->point_before_scroll = Qnil; + B_ (current_buffer, point_before_scroll) = Qnil; if (charpos == PT) return; @@ -2342,7 +2342,7 @@ if (EQ (type, Qkeymap)) return Qnil; else - return buffer->keymap; + return B_ (buffer, keymap); } /* Produce an interval tree reflecting the intervals in === modified file 'src/intervals.h' --- src/intervals.h 2011-01-25 04:08:28 +0000 +++ src/intervals.h 2011-02-14 15:39:19 +0000 @@ -236,9 +236,9 @@ and 2 if it is invisible but with an ellipsis. */ #define TEXT_PROP_MEANS_INVISIBLE(prop) \ - (EQ (current_buffer->invisibility_spec, Qt) \ + (EQ (B_ (current_buffer, invisibility_spec), Qt) \ ? !NILP (prop) \ - : invisible_p (prop, current_buffer->invisibility_spec)) + : invisible_p (prop, B_ (current_buffer, invisibility_spec))) /* Declared in alloc.c */ === modified file 'src/keyboard.c' --- src/keyboard.c 2011-02-06 09:03:25 +0000 +++ src/keyboard.c 2011-02-14 15:39:19 +0000 @@ -1577,7 +1577,7 @@ this_single_command_key_start = 0; } - if (!NILP (current_buffer->mark_active) + if (!NILP (B_ (current_buffer, mark_active)) && !NILP (Vrun_hooks)) { /* In Emacs 22, setting transient-mark-mode to `only' was a @@ -1599,7 +1599,7 @@ if (!NILP (Fwindow_system (Qnil)) /* Even if mark_active is non-nil, the actual buffer marker may not have been set yet (Bug#7044). */ - && XMARKER (current_buffer->mark)->buffer + && XMARKER (B_ (current_buffer, mark))->buffer && (EQ (Vselect_active_regions, Qonly) ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly) : (!NILP (Vselect_active_regions) @@ -1607,7 +1607,7 @@ && !EQ (Vthis_command, Qhandle_switch_frame)) { EMACS_INT beg = - XINT (Fmarker_position (current_buffer->mark)); + XINT (Fmarker_position (B_ (current_buffer, mark))); EMACS_INT end = PT; if (beg < end) call2 (Qx_set_selection, QPRIMARY, @@ -8608,7 +8608,7 @@ /* Prompt with that and read response. */ message2_nolog (menu, strlen (menu), - ! NILP (current_buffer->enable_multibyte_characters)); + ! NILP (B_ (current_buffer, enable_multibyte_characters))); /* Make believe its not a keyboard macro in case the help char is pressed. Help characters are not recorded because menu prompting @@ -9870,7 +9870,7 @@ /* Treat uppercase keys as shifted. */ || (INTEGERP (key) && (KEY_TO_CHAR (key) - < XCHAR_TABLE (current_buffer->downcase_table)->size) + < XCHAR_TABLE (B_ (current_buffer, downcase_table))->size) && UPPERCASEP (KEY_TO_CHAR (key)))) { Lisp_Object new_key === modified file 'src/keymap.c' --- src/keymap.c 2011-02-06 19:56:30 +0000 +++ src/keymap.c 2011-02-14 15:39:19 +0000 @@ -1883,7 +1883,7 @@ (Lisp_Object keys, Lisp_Object accept_default) { register Lisp_Object map; - map = current_buffer->keymap; + map = B_ (current_buffer, keymap); if (NILP (map)) return Qnil; return Flookup_key (map, keys, accept_default); @@ -1988,7 +1988,7 @@ if (!NILP (keymap)) keymap = get_keymap (keymap, 1, 1); - current_buffer->keymap = keymap; + B_ (current_buffer, keymap) = keymap; return Qnil; } @@ -1998,7 +1998,7 @@ Normally the local keymap is set by the major mode with `use-local-map'. */) (void) { - return current_buffer->keymap; + return B_ (current_buffer, keymap); } DEFUN ("current-global-map", Fcurrent_global_map, Scurrent_global_map, 0, 0, 0, @@ -2379,7 +2379,7 @@ *p++ = 'C'; } else if (c < 128 - || (NILP (current_buffer->enable_multibyte_characters) + || (NILP (B_ (current_buffer, enable_multibyte_characters)) && SINGLE_BYTE_CHAR_P (c) && !force_multibyte)) { @@ -2388,7 +2388,7 @@ else { /* Now we are sure that C is a valid character code. */ - if (NILP (current_buffer->enable_multibyte_characters) + if (NILP (B_ (current_buffer, enable_multibyte_characters)) && ! force_multibyte) *p++ = multibyte_char_to_unibyte (c, Qnil); else @@ -3048,7 +3048,7 @@ XBUFFER (buffer), Qlocal_map); if (!NILP (start1)) { - if (EQ (start1, XBUFFER (buffer)->keymap)) + if (EQ (start1, B_ (XBUFFER (buffer), keymap))) describe_map_tree (start1, 1, shadow, prefix, "\f\nMajor Mode Bindings", nomenu, 0, 0, 0); else === modified file 'src/lisp.h' --- src/lisp.h 2011-02-07 02:18:35 +0000 +++ src/lisp.h 2011-02-14 15:39:19 +0000 @@ -1882,7 +1882,7 @@ #define DEFVAR_BUFFER_DEFAULTS(lname, vname, doc) \ do { \ static struct Lisp_Objfwd o_fwd; \ - defvar_lisp_nopro (&o_fwd, lname, &buffer_defaults.vname); \ + defvar_lisp_nopro (&o_fwd, lname, &buffer_defaults.vname ## _); \ } while (0) #define DEFVAR_KBOARD(lname, vname, doc) \ @@ -2047,11 +2047,11 @@ /* Current buffer's map from characters to lower-case characters. */ -#define DOWNCASE_TABLE current_buffer->downcase_table +#define DOWNCASE_TABLE B_ (current_buffer, downcase_table) /* Current buffer's map from characters to upper-case characters. */ -#define UPCASE_TABLE current_buffer->upcase_table +#define UPCASE_TABLE B_ (current_buffer, upcase_table) /* Downcase a character, or make no change if that cannot be done. */ === modified file 'src/lread.c' --- src/lread.c 2011-02-07 04:48:38 +0000 +++ src/lread.c 2011-02-14 15:39:19 +0000 @@ -210,7 +210,7 @@ if (pt_byte >= BUF_ZV_BYTE (inbuffer)) return -1; - if (! NILP (inbuffer->enable_multibyte_characters)) + if (! NILP (B_ (inbuffer, enable_multibyte_characters))) { /* Fetch the character code from the buffer. */ unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, pt_byte); @@ -239,7 +239,7 @@ if (bytepos >= BUF_ZV_BYTE (inbuffer)) return -1; - if (! NILP (inbuffer->enable_multibyte_characters)) + if (! NILP (B_ (inbuffer, enable_multibyte_characters))) { /* Fetch the character code from the buffer. */ unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, bytepos); @@ -371,7 +371,7 @@ EMACS_INT bytepos = BUF_PT_BYTE (b); BUF_PT (b)--; - if (! NILP (b->enable_multibyte_characters)) + if (! NILP (B_ (b, enable_multibyte_characters))) BUF_DEC_POS (b, bytepos); else bytepos--; @@ -384,7 +384,7 @@ EMACS_INT bytepos = XMARKER (readcharfun)->bytepos; XMARKER (readcharfun)->charpos--; - if (! NILP (b->enable_multibyte_characters)) + if (! NILP (B_ (b, enable_multibyte_characters))) BUF_DEC_POS (b, bytepos); else bytepos--; @@ -1322,7 +1322,7 @@ /* Of course, this could conceivably lose if luser sets default-directory to be something non-absolute... */ { - filename = Fexpand_file_name (filename, current_buffer->directory); + filename = Fexpand_file_name (filename, B_ (current_buffer, directory)); if (!complete_filename_p (filename)) /* Give up on this path element! */ continue; @@ -1581,7 +1581,7 @@ { int count1 = SPECPDL_INDEX (); - if (b != 0 && NILP (b->name)) + if (b != 0 && NILP (B_ (b, name))) error ("Reading from killed buffer"); if (!NILP (start)) @@ -1721,7 +1721,7 @@ tem = printflag; if (NILP (filename)) - filename = XBUFFER (buf)->filename; + filename = B_ (XBUFFER (buf), filename); specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list)); specbind (Qstandard_output, tem); @@ -1761,7 +1761,7 @@ specbind (Qeval_buffer_list, Fcons (cbuf, Veval_buffer_list)); /* readevalloop calls functions which check the type of start and end. */ - readevalloop (cbuf, 0, XBUFFER (cbuf)->filename, Feval, + readevalloop (cbuf, 0, B_ (XBUFFER (cbuf), filename), Feval, !NILP (printflag), Qnil, read_function, start, end); === modified file 'src/marker.c' --- src/marker.c 2011-01-25 04:08:28 +0000 +++ src/marker.c 2011-02-14 15:39:19 +0000 @@ -439,7 +439,7 @@ does not preserve the buffer from being GC'd (it's weak), so markers have to be unlinked from their buffer as soon as the buffer is killed. */ - eassert (!NILP (XBUFFER (buf)->name)); + eassert (!NILP (B_ (XBUFFER (buf), name))); return buf; } return Qnil; @@ -488,7 +488,7 @@ CHECK_BUFFER (buffer); b = XBUFFER (buffer); /* If buffer is dead, set marker to point nowhere. */ - if (EQ (b->name, Qnil)) + if (EQ (B_ (b, name), Qnil)) { unchain_marker (m); return marker; @@ -563,7 +563,7 @@ CHECK_BUFFER (buffer); b = XBUFFER (buffer); /* If buffer is dead, set marker to point nowhere. */ - if (EQ (b->name, Qnil)) + if (EQ (B_ (b, name), Qnil)) { unchain_marker (m); return marker; @@ -628,7 +628,7 @@ CHECK_BUFFER (buffer); b = XBUFFER (buffer); /* If buffer is dead, set marker to point nowhere. */ - if (EQ (b->name, Qnil)) + if (EQ (B_ (b, name), Qnil)) { unchain_marker (m); return marker; @@ -676,7 +676,7 @@ CHECK_BUFFER (buffer); b = XBUFFER (buffer); /* If buffer is dead, set marker to point nowhere. */ - if (EQ (b->name, Qnil)) + if (EQ (B_ (b, name), Qnil)) { unchain_marker (m); return marker; @@ -731,7 +731,7 @@ if (b == 0) return; - if (EQ (b->name, Qnil)) + if (EQ (B_ (b, name), Qnil)) abort (); marker->buffer = 0; === modified file 'src/minibuf.c' --- src/minibuf.c 2011-02-06 20:12:53 +0000 +++ src/minibuf.c 2011-02-14 15:39:19 +0000 @@ -415,7 +415,7 @@ CHECK_STRING (initial); } val = Qnil; - ambient_dir = current_buffer->directory; + ambient_dir = B_ (current_buffer, directory); input_method = Qnil; enable_multibyte = Qnil; @@ -525,7 +525,7 @@ /* `current-input-method' is buffer local. So, remember it in INPUT_METHOD before changing the current buffer. */ input_method = Fsymbol_value (Qcurrent_input_method); - enable_multibyte = current_buffer->enable_multibyte_characters; + enable_multibyte = B_ (current_buffer, enable_multibyte_characters); } /* Switch to the minibuffer. */ @@ -535,7 +535,7 @@ /* If appropriate, copy enable-multibyte-characters into the minibuffer. */ if (inherit_input_method) - current_buffer->enable_multibyte_characters = enable_multibyte; + B_ (current_buffer, enable_multibyte_characters) = enable_multibyte; /* The current buffer's default directory is usually the right thing for our minibuffer here. However, if you're typing a command at @@ -546,7 +546,7 @@ you think of something better to do? Find another buffer with a better directory, and use that one instead. */ if (STRINGP (ambient_dir)) - current_buffer->directory = ambient_dir; + B_ (current_buffer, directory) = ambient_dir; else { Lisp_Object buf_list; @@ -558,9 +558,9 @@ Lisp_Object other_buf; other_buf = XCDR (XCAR (buf_list)); - if (STRINGP (XBUFFER (other_buf)->directory)) + if (STRINGP (B_ (XBUFFER (other_buf), directory))) { - current_buffer->directory = XBUFFER (other_buf)->directory; + B_ (current_buffer, directory) = B_ (XBUFFER (other_buf), directory); break; } } @@ -603,7 +603,7 @@ specbind (Qinhibit_modification_hooks, Qt); Ferase_buffer (); - if (!NILP (current_buffer->enable_multibyte_characters) + if (!NILP (B_ (current_buffer, enable_multibyte_characters)) && ! STRING_MULTIBYTE (minibuf_prompt)) minibuf_prompt = Fstring_make_multibyte (minibuf_prompt); @@ -633,7 +633,7 @@ } clear_message (1, 1); - current_buffer->keymap = map; + B_ (current_buffer, keymap) = map; /* Turn on an input method stored in INPUT_METHOD if any. */ if (STRINGP (input_method) && !NILP (Ffboundp (Qactivate_input_method))) @@ -647,7 +647,7 @@ call1 (Vrun_hooks, Qminibuffer_setup_hook); /* Don't allow the user to undo past this point. */ - current_buffer->undo_list = Qnil; + B_ (current_buffer, undo_list) = Qnil; recursive_edit_1 (); @@ -764,7 +764,7 @@ Vminibuffer_list = nconc2 (Vminibuffer_list, tail); } buf = Fcar (tail); - if (NILP (buf) || NILP (XBUFFER (buf)->name)) + if (NILP (buf) || NILP (B_ (XBUFFER (buf), name))) { sprintf (name, " *Minibuf-%d*", depth); buf = Fget_buffer_create (build_string (name)); @@ -1096,7 +1096,7 @@ int count = SPECPDL_INDEX (); if (BUFFERP (def)) - def = XBUFFER (def)->name; + def = B_ (XBUFFER (def), name); specbind (Qcompletion_ignore_case, read_buffer_completion_ignore_case ? Qt : Qnil); === modified file 'src/print.c' --- src/print.c 2011-02-07 02:26:14 +0000 +++ src/print.c 2011-02-14 15:39:19 +0000 @@ -111,7 +111,7 @@ EMACS_INT old_point_byte = -1, start_point_byte = -1; \ int specpdl_count = SPECPDL_INDEX (); \ int free_print_buffer = 0; \ - int multibyte = !NILP (current_buffer->enable_multibyte_characters); \ + int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); \ Lisp_Object original #define PRINTPREPARE \ @@ -144,10 +144,10 @@ if (NILP (printcharfun)) \ { \ Lisp_Object string; \ - if (NILP (current_buffer->enable_multibyte_characters) \ + if (NILP (B_ (current_buffer, enable_multibyte_characters)) \ && ! print_escape_multibyte) \ specbind (Qprint_escape_multibyte, Qt); \ - if (! NILP (current_buffer->enable_multibyte_characters) \ + if (! NILP (B_ (current_buffer, enable_multibyte_characters)) \ && ! print_escape_nonascii) \ specbind (Qprint_escape_nonascii, Qt); \ if (print_buffer != 0) \ @@ -173,7 +173,7 @@ if (NILP (printcharfun)) \ { \ if (print_buffer_pos != print_buffer_pos_byte \ - && NILP (current_buffer->enable_multibyte_characters)) \ + && NILP (B_ (current_buffer, enable_multibyte_characters))) \ { \ unsigned char *temp \ = (unsigned char *) alloca (print_buffer_pos + 1); \ @@ -250,7 +250,7 @@ else { int multibyte_p - = !NILP (current_buffer->enable_multibyte_characters); + = !NILP (B_ (current_buffer, enable_multibyte_characters)); setup_echo_area_for_printing (multibyte_p); insert_char (ch); @@ -302,7 +302,7 @@ job. */ int i; int multibyte_p - = !NILP (current_buffer->enable_multibyte_characters); + = !NILP (B_ (current_buffer, enable_multibyte_characters)); setup_echo_area_for_printing (multibyte_p); message_dolog (ptr, size_byte, 0, multibyte_p); @@ -371,8 +371,8 @@ chars = SCHARS (string); else if (! print_escape_nonascii && (EQ (printcharfun, Qt) - ? ! NILP (buffer_defaults.enable_multibyte_characters) - : ! NILP (current_buffer->enable_multibyte_characters))) + ? ! NILP (B_ (&buffer_defaults, enable_multibyte_characters)) + : ! NILP (B_ (current_buffer, enable_multibyte_characters)))) { /* If unibyte string STRING contains 8-bit codes, we must convert STRING to a multibyte string containing the same @@ -504,14 +504,14 @@ Fkill_all_local_variables (); delete_all_overlays (current_buffer); - current_buffer->directory = old->directory; - current_buffer->read_only = Qnil; - current_buffer->filename = Qnil; - current_buffer->undo_list = Qt; + B_ (current_buffer, directory) = B_ (old, directory); + B_ (current_buffer, read_only) = Qnil; + B_ (current_buffer, filename) = Qnil; + B_ (current_buffer, undo_list) = Qt; eassert (current_buffer->overlays_before == NULL); eassert (current_buffer->overlays_after == NULL); - current_buffer->enable_multibyte_characters - = buffer_defaults.enable_multibyte_characters; + B_ (current_buffer, enable_multibyte_characters) + = B_ (&buffer_defaults, enable_multibyte_characters); specbind (Qinhibit_read_only, Qt); specbind (Qinhibit_modification_hooks, Qt); Ferase_buffer (); @@ -1854,7 +1854,7 @@ if (!NILP (XWINDOW (obj)->buffer)) { strout (" on ", -1, -1, printcharfun, 0); - print_string (XBUFFER (XWINDOW (obj)->buffer)->name, printcharfun); + print_string (B_ (XBUFFER (XWINDOW (obj)->buffer), name), printcharfun); } PRINTCHAR ('>'); } @@ -1955,16 +1955,16 @@ } else if (BUFFERP (obj)) { - if (NILP (XBUFFER (obj)->name)) + if (NILP (B_ (XBUFFER (obj), name))) strout ("#", -1, -1, printcharfun, 0); else if (escapeflag) { strout ("#name, printcharfun); + print_string (B_ (XBUFFER (obj), name), printcharfun); PRINTCHAR ('>'); } else - print_string (XBUFFER (obj)->name, printcharfun); + print_string (B_ (XBUFFER (obj), name), printcharfun); } else if (WINDOW_CONFIGURATIONP (obj)) { @@ -2076,7 +2076,7 @@ sprintf (buf, "at %ld", (long)marker_position (obj)); strout (buf, -1, -1, printcharfun, 0); strout (" in ", -1, -1, printcharfun, 0); - print_string (XMARKER (obj)->buffer->name, printcharfun); + print_string (B_ (XMARKER (obj)->buffer, name), printcharfun); } PRINTCHAR ('>'); break; @@ -2091,7 +2091,7 @@ (long)marker_position (OVERLAY_START (obj)), (long)marker_position (OVERLAY_END (obj))); strout (buf, -1, -1, printcharfun, 0); - print_string (XMARKER (OVERLAY_START (obj))->buffer->name, + print_string (B_ (XMARKER (OVERLAY_START (obj))->buffer, name), printcharfun); } PRINTCHAR ('>'); === modified file 'src/process.c' --- src/process.c 2011-02-13 11:28:42 +0000 +++ src/process.c 2011-02-14 15:39:19 +0000 @@ -719,7 +719,7 @@ { proc = Fget_buffer_process (obj); if (NILP (proc)) - error ("Buffer %s has no process", SDATA (XBUFFER (obj)->name)); + error ("Buffer %s has no process", SDATA (B_ (XBUFFER (obj), name))); } else { @@ -1283,12 +1283,12 @@ w_proc = i; if (!NILP (p->buffer)) { - if (NILP (XBUFFER (p->buffer)->name)) + if (NILP (B_ (XBUFFER (p->buffer), name))) { if (w_buffer < 8) w_buffer = 8; /* (Killed) */ } - else if ((i = SCHARS (XBUFFER (p->buffer)->name), (i > w_buffer))) + else if ((i = SCHARS (B_ (XBUFFER (p->buffer), name)), (i > w_buffer))) w_buffer = i; } if (STRINGP (p->tty_name) @@ -1312,9 +1312,9 @@ XSETFASTINT (minspace, 1); set_buffer_internal (XBUFFER (Vstandard_output)); - current_buffer->undo_list = Qt; + B_ (current_buffer, undo_list) = Qt; - current_buffer->truncate_lines = Qt; + B_ (current_buffer, truncate_lines) = Qt; write_string ("Proc", -1); Findent_to (i_status, minspace); write_string ("Status", -1); @@ -1397,10 +1397,10 @@ Findent_to (i_buffer, minspace); if (NILP (p->buffer)) insert_string ("(none)"); - else if (NILP (XBUFFER (p->buffer)->name)) + else if (NILP (B_ (XBUFFER (p->buffer), name))) insert_string ("(Killed)"); else - Finsert (1, &XBUFFER (p->buffer)->name); + Finsert (1, &B_ (XBUFFER (p->buffer), name)); if (!NILP (i_tty)) { @@ -1548,7 +1548,7 @@ { struct gcpro gcpro1, gcpro2; - current_dir = current_buffer->directory; + current_dir = B_ (current_buffer, directory); GCPRO2 (buffer, current_dir); @@ -1560,7 +1560,7 @@ current_dir = expand_and_dir_to_file (current_dir, Qnil); if (NILP (Ffile_accessible_directory_p (current_dir))) report_file_error ("Setting current directory", - Fcons (current_buffer->directory, Qnil)); + Fcons (B_ (current_buffer, directory), Qnil)); UNGCPRO; } @@ -2898,8 +2898,8 @@ } else if (!NILP (Vcoding_system_for_read)) val = Vcoding_system_for_read; - else if ((!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters)) - || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters))) + else if ((!NILP (buffer) && NILP (B_ (XBUFFER (buffer), enable_multibyte_characters))) + || (NILP (buffer) && NILP (B_ (&buffer_defaults, enable_multibyte_characters)))) val = Qnil; p->decode_coding_system = val; @@ -2912,8 +2912,8 @@ } else if (!NILP (Vcoding_system_for_write)) val = Vcoding_system_for_write; - else if ((!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters)) - || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters))) + else if ((!NILP (buffer) && NILP (B_ (XBUFFER (buffer), enable_multibyte_characters))) + || (NILP (buffer) && NILP (B_ (&buffer_defaults, enable_multibyte_characters)))) val = Qnil; p->encode_coding_system = val; @@ -3723,8 +3723,8 @@ } else if (!NILP (Vcoding_system_for_read)) val = Vcoding_system_for_read; - else if ((!NILP (buffer) && NILP (XBUFFER (buffer)->enable_multibyte_characters)) - || (NILP (buffer) && NILP (buffer_defaults.enable_multibyte_characters))) + else if ((!NILP (buffer) && NILP (B_ (XBUFFER (buffer), enable_multibyte_characters))) + || (NILP (buffer) && NILP (B_ (&buffer_defaults, enable_multibyte_characters)))) /* We dare not decode end-of-line format by setting VAL to Qraw_text, because the existing Emacs Lisp libraries assume that they receive bare code including a sequene of @@ -3759,7 +3759,7 @@ } else if (!NILP (Vcoding_system_for_write)) val = Vcoding_system_for_write; - else if (NILP (current_buffer->enable_multibyte_characters)) + else if (NILP (B_ (current_buffer, enable_multibyte_characters))) val = Qnil; else { @@ -5268,7 +5268,7 @@ /* No need to gcpro these, because all we do with them later is test them for EQness, and none of them should be a string. */ XSETBUFFER (obuffer, current_buffer); - okeymap = current_buffer->keymap; + okeymap = B_ (current_buffer, keymap); /* We inhibit quit here instead of just catching it so that hitting ^G when a filter happens to be running won't screw @@ -5359,7 +5359,7 @@ } /* If no filter, write into buffer if it isn't dead. */ - else if (!NILP (p->buffer) && !NILP (XBUFFER (p->buffer)->name)) + else if (!NILP (p->buffer) && !NILP (B_ (XBUFFER (p->buffer), name))) { Lisp_Object old_read_only; EMACS_INT old_begv, old_zv; @@ -5372,13 +5372,13 @@ Fset_buffer (p->buffer); opoint = PT; opoint_byte = PT_BYTE; - old_read_only = current_buffer->read_only; + old_read_only = B_ (current_buffer, read_only); old_begv = BEGV; old_zv = ZV; old_begv_byte = BEGV_BYTE; old_zv_byte = ZV_BYTE; - current_buffer->read_only = Qnil; + B_ (current_buffer, read_only) = Qnil; /* Insert new output into buffer at the current end-of-output marker, @@ -5423,7 +5423,7 @@ p->decoding_carryover = coding->carryover_bytes; } /* Adjust the multibyteness of TEXT to that of the buffer. */ - if (NILP (current_buffer->enable_multibyte_characters) + if (NILP (B_ (current_buffer, enable_multibyte_characters)) != ! STRING_MULTIBYTE (text)) text = (STRING_MULTIBYTE (text) ? Fstring_as_unibyte (text) @@ -5467,7 +5467,7 @@ Fnarrow_to_region (make_number (old_begv), make_number (old_zv)); - current_buffer->read_only = old_read_only; + B_ (current_buffer, read_only) = old_read_only; SET_PT_BOTH (opoint, opoint_byte); } /* Handling the process output should not deactivate the mark. */ @@ -5525,7 +5525,7 @@ if ((STRINGP (object) && STRING_MULTIBYTE (object)) || (BUFFERP (object) - && !NILP (XBUFFER (object)->enable_multibyte_characters)) + && !NILP (B_ (XBUFFER (object), enable_multibyte_characters))) || EQ (object, Qt)) { p->encode_coding_system @@ -6564,7 +6564,7 @@ is test them for EQness, and none of them should be a string. */ odeactivate = Vdeactivate_mark; XSETBUFFER (obuffer, current_buffer); - okeymap = current_buffer->keymap; + okeymap = B_ (current_buffer, keymap); /* There's no good reason to let sentinels change the current buffer, and many callers of accept-process-output, sit-for, and @@ -6714,7 +6714,7 @@ /* Avoid error if buffer is deleted (probably that's why the process is dead, too) */ - if (NILP (XBUFFER (buffer)->name)) + if (NILP (B_ (XBUFFER (buffer), name))) continue; Fset_buffer (buffer); @@ -6731,13 +6731,13 @@ before = PT; before_byte = PT_BYTE; - tem = current_buffer->read_only; - current_buffer->read_only = Qnil; + tem = B_ (current_buffer, read_only); + B_ (current_buffer, read_only) = Qnil; insert_string ("\nProcess "); Finsert (1, &p->name); insert_string (" "); Finsert (1, &msg); - current_buffer->read_only = tem; + B_ (current_buffer, read_only) = tem; set_marker_both (p->mark, p->buffer, PT, PT_BYTE); if (opoint >= before) @@ -7136,7 +7136,7 @@ ; else if (BUFFERP (p->buffer)) { - if (NILP (XBUFFER (p->buffer)->enable_multibyte_characters)) + if (NILP (B_ (XBUFFER (p->buffer), enable_multibyte_characters))) coding_system = raw_text_coding_system (coding_system); } setup_coding_system (coding_system, proc_decode_coding_system[inch]); === modified file 'src/search.c' --- src/search.c 2011-02-07 01:31:29 +0000 +++ src/search.c 2011-02-14 15:39:19 +0000 @@ -157,7 +157,7 @@ /* If the compiled pattern hard codes some of the contents of the syntax-table, it can only be reused with *this* syntax table. */ - cp->syntax_table = cp->buf.used_syntax ? current_buffer->syntax_table : Qt; + cp->syntax_table = cp->buf.used_syntax ? B_ (current_buffer, syntax_table) : Qt; re_set_whitespace_regexp (NULL); @@ -236,7 +236,7 @@ && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) && cp->posix == posix && (EQ (cp->syntax_table, Qt) - || EQ (cp->syntax_table, current_buffer->syntax_table)) + || EQ (cp->syntax_table, B_ (current_buffer, syntax_table))) && !NILP (Fequal (cp->whitespace_regexp, Vsearch_spaces_regexp)) && cp->buf.charset_unibyte == charset_unibyte) break; @@ -285,17 +285,17 @@ save_search_regs (); /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ - XCHAR_TABLE (current_buffer->case_canon_table)->extras[2] - = current_buffer->case_eqv_table; + XCHAR_TABLE (B_ (current_buffer, case_canon_table))->extras[2] + = B_ (current_buffer, case_eqv_table); CHECK_STRING (string); bufp = compile_pattern (string, (NILP (Vinhibit_changing_match_data) ? &search_regs : NULL), - (!NILP (current_buffer->case_fold_search) - ? current_buffer->case_canon_table : Qnil), + (!NILP (B_ (current_buffer, case_fold_search)) + ? B_ (current_buffer, case_canon_table) : Qnil), posix, - !NILP (current_buffer->enable_multibyte_characters)); + !NILP (B_ (current_buffer, enable_multibyte_characters))); immediate_quit = 1; QUIT; /* Do a pending quit right away, to avoid paradoxical behavior */ @@ -400,14 +400,14 @@ } /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ - XCHAR_TABLE (current_buffer->case_canon_table)->extras[2] - = current_buffer->case_eqv_table; + XCHAR_TABLE (B_ (current_buffer, case_canon_table))->extras[2] + = B_ (current_buffer, case_eqv_table); bufp = compile_pattern (regexp, (NILP (Vinhibit_changing_match_data) ? &search_regs : NULL), - (!NILP (current_buffer->case_fold_search) - ? current_buffer->case_canon_table : Qnil), + (!NILP (B_ (current_buffer, case_fold_search)) + ? B_ (current_buffer, case_canon_table) : Qnil), posix, STRING_MULTIBYTE (string)); immediate_quit = 1; @@ -586,7 +586,7 @@ s2 = 0; } re_match_object = Qnil; - multibyte = ! NILP (current_buffer->enable_multibyte_characters); + multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); } buf = compile_pattern (regexp, 0, Qnil, 0, multibyte); @@ -608,7 +608,7 @@ static void newline_cache_on_off (struct buffer *buf) { - if (NILP (buf->cache_long_line_scans)) + if (NILP (B_ (buf, cache_long_line_scans))) { /* It should be off. */ if (buf->newline_cache) @@ -996,15 +996,15 @@ } /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ - XCHAR_TABLE (current_buffer->case_canon_table)->extras[2] - = current_buffer->case_eqv_table; + XCHAR_TABLE (B_ (current_buffer, case_canon_table))->extras[2] + = B_ (current_buffer, case_eqv_table); np = search_buffer (string, PT, PT_BYTE, lim, lim_byte, n, RE, - (!NILP (current_buffer->case_fold_search) - ? current_buffer->case_canon_table + (!NILP (B_ (current_buffer, case_fold_search)) + ? B_ (current_buffer, case_canon_table) : Qnil), - (!NILP (current_buffer->case_fold_search) - ? current_buffer->case_eqv_table + (!NILP (B_ (current_buffer, case_fold_search)) + ? B_ (current_buffer, case_eqv_table) : Qnil), posix); if (np <= 0) @@ -1133,7 +1133,7 @@ (NILP (Vinhibit_changing_match_data) ? &search_regs : &search_regs_1), trt, posix, - !NILP (current_buffer->enable_multibyte_characters)); + !NILP (B_ (current_buffer, enable_multibyte_characters))); immediate_quit = 1; /* Quit immediately if user types ^G, because letting this function finish @@ -1254,7 +1254,7 @@ EMACS_INT raw_pattern_size; EMACS_INT raw_pattern_size_byte; unsigned char *patbuf; - int multibyte = !NILP (current_buffer->enable_multibyte_characters); + int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); unsigned char *base_pat; /* Set to positive if we find a non-ASCII char that need translation. Otherwise set to zero later. */ @@ -1451,7 +1451,7 @@ EMACS_INT pos, EMACS_INT pos_byte, EMACS_INT lim, EMACS_INT lim_byte) { - int multibyte = ! NILP (current_buffer->enable_multibyte_characters); + int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); int forward = n > 0; /* Number of buffer bytes matched. Note that this may be different from len_byte in a multibyte buffer. */ @@ -1671,7 +1671,7 @@ register EMACS_INT i; register int j; unsigned char *pat, *pat_end; - int multibyte = ! NILP (current_buffer->enable_multibyte_characters); + int multibyte = ! NILP (B_ (current_buffer, enable_multibyte_characters)); unsigned char simple_translate[0400]; /* These are set to the preceding bytes of a byte to be translated @@ -2639,7 +2639,7 @@ EMACS_INT length = SBYTES (newtext); unsigned char *substed; EMACS_INT substed_alloc_size, substed_len; - int buf_multibyte = !NILP (current_buffer->enable_multibyte_characters); + int buf_multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); int str_multibyte = STRING_MULTIBYTE (newtext); Lisp_Object rev_tbl; int really_changed = 0; === modified file 'src/syntax.c' --- src/syntax.c 2011-01-25 04:08:28 +0000 +++ src/syntax.c 2011-02-14 15:39:19 +0000 @@ -277,7 +277,7 @@ else { gl_state.use_global = 0; - gl_state.current_syntax_table = current_buffer->syntax_table; + gl_state.current_syntax_table = B_ (current_buffer, syntax_table); } } @@ -363,7 +363,7 @@ static INLINE EMACS_INT dec_bytepos (EMACS_INT bytepos) { - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) return bytepos - 1; DEC_POS (bytepos); @@ -779,7 +779,7 @@ This is the one specified by the current buffer. */) (void) { - return current_buffer->syntax_table; + return B_ (current_buffer, syntax_table); } DEFUN ("standard-syntax-table", Fstandard_syntax_table, @@ -824,7 +824,7 @@ { int idx; check_syntax_table (table); - current_buffer->syntax_table = table; + B_ (current_buffer, syntax_table) = table; /* Indicate that this buffer now has a specified syntax table. */ idx = PER_BUFFER_VAR_IDX (syntax_table); SET_PER_BUFFER_VALUE_P (current_buffer, idx, 1); @@ -1035,7 +1035,7 @@ CHECK_CHARACTER (c); if (NILP (syntax_table)) - syntax_table = current_buffer->syntax_table; + syntax_table = B_ (current_buffer, syntax_table); else check_syntax_table (syntax_table); @@ -1450,7 +1450,7 @@ if (XINT (lim) < BEGV) XSETFASTINT (lim, BEGV); - multibyte = (!NILP (current_buffer->enable_multibyte_characters) + multibyte = (!NILP (B_ (current_buffer, enable_multibyte_characters)) && (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE)); string_multibyte = SBYTES (string) > SCHARS (string); @@ -1936,7 +1936,7 @@ if (forwardp ? (PT >= XFASTINT (lim)) : (PT <= XFASTINT (lim))) return make_number (0); - multibyte = (!NILP (current_buffer->enable_multibyte_characters) + multibyte = (!NILP (B_ (current_buffer, enable_multibyte_characters)) && (XINT (lim) - PT != CHAR_TO_BYTE (XINT (lim)) - PT_BYTE)); memset (fastmap, 0, sizeof fastmap); @@ -2703,7 +2703,7 @@ while (from > stop) { temp_pos = from_byte; - if (! NILP (current_buffer->enable_multibyte_characters)) + if (! NILP (B_ (current_buffer, enable_multibyte_characters))) DEC_POS (temp_pos); else temp_pos--; === modified file 'src/syntax.h' --- src/syntax.h 2011-01-26 08:36:39 +0000 +++ src/syntax.h 2011-02-14 15:39:19 +0000 @@ -24,7 +24,7 @@ /* The standard syntax table is stored where it will automatically be used in all new buffers. */ -#define Vstandard_syntax_table buffer_defaults.syntax_table +#define Vstandard_syntax_table B_ (&buffer_defaults, syntax_table) /* A syntax table is a chartable whose elements are cons cells (CODE+FLAGS . MATCHING-CHAR). MATCHING-CHAR can be nil if the char @@ -79,7 +79,7 @@ # define CURRENT_SYNTAX_TABLE gl_state.current_syntax_table #else # define SYNTAX_ENTRY SYNTAX_ENTRY_INT -# define CURRENT_SYNTAX_TABLE current_buffer->syntax_table +# define CURRENT_SYNTAX_TABLE B_ (current_buffer, syntax_table) #endif #define SYNTAX_ENTRY_INT(c) CHAR_TABLE_REF (CURRENT_SYNTAX_TABLE, (c)) @@ -204,7 +204,7 @@ do \ { \ gl_state.use_global = 0; \ - gl_state.current_syntax_table = current_buffer->syntax_table; \ + gl_state.current_syntax_table = B_ (current_buffer, syntax_table); \ } while (0) /* This macro should be called with FROM at the start of forward === modified file 'src/undo.c' --- src/undo.c 2011-01-25 04:08:28 +0000 +++ src/undo.c 2011-02-14 15:39:19 +0000 @@ -73,12 +73,12 @@ Fundo_boundary (); last_undo_buffer = current_buffer; - if (CONSP (current_buffer->undo_list)) + if (CONSP (B_ (current_buffer, undo_list))) { /* Set AT_BOUNDARY to 1 only when we have nothing other than marker adjustment before undo boundary. */ - Lisp_Object tail = current_buffer->undo_list, elt; + Lisp_Object tail = B_ (current_buffer, undo_list), elt; while (1) { @@ -103,8 +103,8 @@ if (at_boundary && current_buffer == last_boundary_buffer && last_boundary_position != pt) - current_buffer->undo_list - = Fcons (make_number (last_boundary_position), current_buffer->undo_list); + B_ (current_buffer, undo_list) + = Fcons (make_number (last_boundary_position), B_ (current_buffer, undo_list)); } /* Record an insertion that just happened or is about to happen, @@ -117,17 +117,17 @@ { Lisp_Object lbeg, lend; - if (EQ (current_buffer->undo_list, Qt)) + if (EQ (B_ (current_buffer, undo_list), Qt)) return; record_point (beg); /* If this is following another insertion and consecutive with it in the buffer, combine the two. */ - if (CONSP (current_buffer->undo_list)) + if (CONSP (B_ (current_buffer, undo_list))) { Lisp_Object elt; - elt = XCAR (current_buffer->undo_list); + elt = XCAR (B_ (current_buffer, undo_list)); if (CONSP (elt) && INTEGERP (XCAR (elt)) && INTEGERP (XCDR (elt)) @@ -140,8 +140,8 @@ XSETFASTINT (lbeg, beg); XSETINT (lend, beg + length); - current_buffer->undo_list = Fcons (Fcons (lbeg, lend), - current_buffer->undo_list); + B_ (current_buffer, undo_list) = Fcons (Fcons (lbeg, lend), + B_ (current_buffer, undo_list)); } /* Record that a deletion is about to take place, @@ -152,7 +152,7 @@ { Lisp_Object sbeg; - if (EQ (current_buffer->undo_list, Qt)) + if (EQ (B_ (current_buffer, undo_list), Qt)) return; if (PT == beg + SCHARS (string)) @@ -166,8 +166,8 @@ record_point (beg); } - current_buffer->undo_list - = Fcons (Fcons (string, sbeg), current_buffer->undo_list); + B_ (current_buffer, undo_list) + = Fcons (Fcons (string, sbeg), B_ (current_buffer, undo_list)); } /* Record the fact that MARKER is about to be adjusted by ADJUSTMENT. @@ -178,7 +178,7 @@ void record_marker_adjustment (Lisp_Object marker, EMACS_INT adjustment) { - if (EQ (current_buffer->undo_list, Qt)) + if (EQ (B_ (current_buffer, undo_list), Qt)) return; /* Allocate a cons cell to be the undo boundary after this command. */ @@ -189,9 +189,9 @@ Fundo_boundary (); last_undo_buffer = current_buffer; - current_buffer->undo_list + B_ (current_buffer, undo_list) = Fcons (Fcons (marker, make_number (adjustment)), - current_buffer->undo_list); + B_ (current_buffer, undo_list)); } /* Record that a replacement is about to take place, @@ -215,7 +215,7 @@ Lisp_Object high, low; struct buffer *base_buffer = current_buffer; - if (EQ (current_buffer->undo_list, Qt)) + if (EQ (B_ (current_buffer, undo_list), Qt)) return; if (current_buffer != last_undo_buffer) @@ -227,7 +227,7 @@ XSETFASTINT (high, (base_buffer->modtime >> 16) & 0xffff); XSETFASTINT (low, base_buffer->modtime & 0xffff); - current_buffer->undo_list = Fcons (Fcons (Qt, Fcons (high, low)), current_buffer->undo_list); + B_ (current_buffer, undo_list) = Fcons (Fcons (Qt, Fcons (high, low)), B_ (current_buffer, undo_list)); } /* Record a change in property PROP (whose old value was VAL) @@ -242,7 +242,7 @@ struct buffer *obuf = current_buffer, *buf = XBUFFER (buffer); int boundary = 0; - if (EQ (buf->undo_list, Qt)) + if (EQ (B_ (buf, undo_list), Qt)) return; /* Allocate a cons cell to be the undo boundary after this command. */ @@ -265,7 +265,7 @@ XSETINT (lbeg, beg); XSETINT (lend, beg + length); entry = Fcons (Qnil, Fcons (prop, Fcons (value, Fcons (lbeg, lend)))); - current_buffer->undo_list = Fcons (entry, current_buffer->undo_list); + B_ (current_buffer, undo_list) = Fcons (entry, B_ (current_buffer, undo_list)); current_buffer = obuf; } @@ -277,9 +277,9 @@ (void) { Lisp_Object tem; - if (EQ (current_buffer->undo_list, Qt)) + if (EQ (B_ (current_buffer, undo_list), Qt)) return Qnil; - tem = Fcar (current_buffer->undo_list); + tem = Fcar (B_ (current_buffer, undo_list)); if (!NILP (tem)) { /* One way or another, cons nil onto the front of the undo list. */ @@ -287,12 +287,12 @@ { /* If we have preallocated the cons cell to use here, use that one. */ - XSETCDR (pending_boundary, current_buffer->undo_list); - current_buffer->undo_list = pending_boundary; + XSETCDR (pending_boundary, B_ (current_buffer, undo_list)); + B_ (current_buffer, undo_list) = pending_boundary; pending_boundary = Qnil; } else - current_buffer->undo_list = Fcons (Qnil, current_buffer->undo_list); + B_ (current_buffer, undo_list) = Fcons (Qnil, B_ (current_buffer, undo_list)); } last_boundary_position = PT; last_boundary_buffer = current_buffer; @@ -321,7 +321,7 @@ record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); set_buffer_internal (b); - list = b->undo_list; + list = B_ (b, undo_list); prev = Qnil; next = list; @@ -433,7 +433,7 @@ XSETCDR (last_boundary, Qnil); /* There's nothing we decided to keep, so clear it out. */ else - b->undo_list = Qnil; + B_ (b, undo_list) = Qnil; unbind_to (count, Qnil); } @@ -470,13 +470,13 @@ /* In a writable buffer, enable undoing read-only text that is so because of text properties. */ - if (NILP (current_buffer->read_only)) + if (NILP (B_ (current_buffer, read_only))) specbind (Qinhibit_read_only, Qt); /* Don't let `intangible' properties interfere with undo. */ specbind (Qinhibit_point_motion_hooks, Qt); - oldlist = current_buffer->undo_list; + oldlist = B_ (current_buffer, undo_list); while (arg > 0) { @@ -631,9 +631,9 @@ so the test in `undo' for continuing an undo series will work right. */ if (did_apply - && EQ (oldlist, current_buffer->undo_list)) - current_buffer->undo_list - = Fcons (list3 (Qapply, Qcdr, Qnil), current_buffer->undo_list); + && EQ (oldlist, B_ (current_buffer, undo_list))) + B_ (current_buffer, undo_list) + = Fcons (list3 (Qapply, Qcdr, Qnil), B_ (current_buffer, undo_list)); UNGCPRO; return unbind_to (count, list); === modified file 'src/window.c' --- src/window.c 2011-02-12 23:40:43 +0000 +++ src/window.c 2011-02-14 15:39:19 +0000 @@ -1359,8 +1359,8 @@ { struct buffer *b = XBUFFER (w->buffer); - if (DISP_TABLE_P (b->display_table)) - dp = XCHAR_TABLE (b->display_table); + if (DISP_TABLE_P (B_ (b, display_table))) + dp = XCHAR_TABLE (B_ (b, display_table)); else if (DISP_TABLE_P (Vstandard_display_table)) dp = XCHAR_TABLE (Vstandard_display_table); } @@ -1414,9 +1414,9 @@ So don't clobber point in that buffer. */ if (! EQ (buf, XWINDOW (selected_window)->buffer) /* This line helps to fix Horsley's testbug.el bug. */ - && !(WINDOWP (b->last_selected_window) - && w != XWINDOW (b->last_selected_window) - && EQ (buf, XWINDOW (b->last_selected_window)->buffer))) + && !(WINDOWP (B_ (b, last_selected_window)) + && w != XWINDOW (B_ (b, last_selected_window)) + && EQ (buf, XWINDOW (B_ (b, last_selected_window))->buffer))) temp_set_point_both (b, clip_to_bounds (BUF_BEGV (b), XMARKER (w->pointm)->charpos, @@ -1425,9 +1425,9 @@ marker_byte_position (w->pointm), BUF_ZV_BYTE (b))); - if (WINDOWP (b->last_selected_window) - && w == XWINDOW (b->last_selected_window)) - b->last_selected_window = Qnil; + if (WINDOWP (B_ (b, last_selected_window)) + && w == XWINDOW (B_ (b, last_selected_window))) + B_ (b, last_selected_window) = Qnil; } /* Put replacement into the window structure in place of old. */ @@ -2325,7 +2325,7 @@ /* Check for a window that has a killed buffer. */ case CHECK_ALL_WINDOWS: if (! NILP (w->buffer) - && NILP (XBUFFER (w->buffer)->name)) + && NILP (B_ (XBUFFER (w->buffer), name))) abort (); break; @@ -2729,7 +2729,7 @@ { int safe_size = (MIN_SAFE_WINDOW_HEIGHT + ((BUFFERP (w->buffer) - && !NILP (XBUFFER (w->buffer)->mode_line_format)) + && !NILP (B_ (XBUFFER (w->buffer), mode_line_format))) ? 1 : 0)); return safe_p ? safe_size : max (window_min_height, safe_size); @@ -3360,15 +3360,15 @@ w->buffer = buffer; if (EQ (window, selected_window)) - b->last_selected_window = window; + B_ (b, last_selected_window) = window; /* Let redisplay errors through. */ b->display_error_modiff = 0; /* Update time stamps of buffer display. */ - if (INTEGERP (b->display_count)) - XSETINT (b->display_count, XINT (b->display_count) + 1); - b->display_time = Fcurrent_time (); + if (INTEGERP (B_ (b, display_count))) + XSETINT (B_ (b, display_count), XINT (B_ (b, display_count)) + 1); + B_ (b, display_time) = Fcurrent_time (); XSETFASTINT (w->window_end_pos, 0); XSETFASTINT (w->window_end_vpos, 0); @@ -3421,18 +3421,18 @@ w->left_margin_cols = w->right_margin_cols = Qnil; Fset_window_fringes (window, - b->left_fringe_width, b->right_fringe_width, - b->fringes_outside_margins); + B_ (b, left_fringe_width), B_ (b, right_fringe_width), + B_ (b, fringes_outside_margins)); Fset_window_scroll_bars (window, - b->scroll_bar_width, - b->vertical_scroll_bar_type, Qnil); + B_ (b, scroll_bar_width), + B_ (b, vertical_scroll_bar_type), Qnil); w->left_margin_cols = save_left; w->right_margin_cols = save_right; Fset_window_margins (window, - b->left_margin_cols, b->right_margin_cols); + B_ (b, left_margin_cols), B_ (b, right_margin_cols)); } if (run_hooks_p) @@ -3469,7 +3469,7 @@ XSETWINDOW (window, w); buffer = Fget_buffer (buffer_or_name); CHECK_BUFFER (buffer); - if (NILP (XBUFFER (buffer)->name)) + if (NILP (B_ (XBUFFER (buffer), name))) error ("Attempt to display deleted buffer"); tem = w->buffer; @@ -3481,7 +3481,7 @@ if (EQ (tem, buffer)) return Qnil; else if (EQ (w->dedicated, Qt)) - error ("Window is dedicated to `%s'", SDATA (XBUFFER (tem)->name)); + error ("Window is dedicated to `%s'", SDATA (B_ (XBUFFER (tem), name))); else w->dedicated = Qnil; @@ -3552,7 +3552,7 @@ Fset_buffer (w->buffer); - XBUFFER (w->buffer)->last_selected_window = window; + B_ (XBUFFER (w->buffer), last_selected_window) = window; /* Go to the point recorded in the window. This is important when the buffer is in more @@ -3640,7 +3640,7 @@ if (STRINGP (object)) object = Fget_buffer (object); - if (BUFFERP (object) && !NILP (XBUFFER (object)->name)) + if (BUFFERP (object) && !NILP (B_ (XBUFFER (object), name))) { /* Walk all windows looking for buffer, and force update of each of those windows. */ @@ -3663,7 +3663,7 @@ register Lisp_Object window; register struct window *w; - XBUFFER (buf)->directory = current_buffer->directory; + B_ (XBUFFER (buf), directory) = B_ (current_buffer, directory); Fset_buffer (buf); BUF_SAVE_MODIFF (XBUFFER (buf)) = MODIFF; @@ -5878,7 +5878,7 @@ saved_windows = XVECTOR (data->saved_windows); new_current_buffer = data->current_buffer; - if (NILP (XBUFFER (new_current_buffer)->name)) + if (NILP (B_ (XBUFFER (new_current_buffer), name))) new_current_buffer = Qnil; else { @@ -6063,14 +6063,14 @@ w->buffer = p->buffer; else { - if (!NILP (XBUFFER (p->buffer)->name)) + if (!NILP (B_ (XBUFFER (p->buffer), name))) /* If saved buffer is alive, install it. */ { w->buffer = p->buffer; w->start_at_line_beg = p->start_at_line_beg; set_marker_restricted (w->start, p->start, w->buffer); set_marker_restricted (w->pointm, p->pointm, w->buffer); - Fset_marker (XBUFFER (w->buffer)->mark, + Fset_marker (B_ (XBUFFER (w->buffer), mark), p->mark, w->buffer); /* As documented in Fcurrent_window_configuration, don't @@ -6080,7 +6080,7 @@ && XBUFFER (p->buffer) == current_buffer) Fgoto_char (w->pointm); } - else if (NILP (w->buffer) || NILP (XBUFFER (w->buffer)->name)) + else if (NILP (w->buffer) || NILP (B_ (XBUFFER (w->buffer), name))) /* Else unless window has a live buffer, get one. */ { w->buffer = Fcdr (Fcar (Vbuffer_alist)); @@ -6121,7 +6121,7 @@ has been restored into it. We already swapped out that point from that window's old buffer. */ select_window (data->current_window, Qnil, 1); - XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window + B_ (XBUFFER (XWINDOW (selected_window)->buffer), last_selected_window) = selected_window; if (NILP (data->focus_frame) @@ -6322,7 +6322,7 @@ p->start = Fcopy_marker (w->start, Qnil); p->start_at_line_beg = w->start_at_line_beg; - tem = XBUFFER (w->buffer)->mark; + tem = B_ (XBUFFER (w->buffer), mark); p->mark = Fcopy_marker (tem, Qnil); } else === modified file 'src/xdisp.c' --- src/xdisp.c 2011-02-12 15:48:10 +0000 +++ src/xdisp.c 2011-02-14 15:39:19 +0000 @@ -1210,12 +1210,12 @@ if (WINDOW_WANTS_MODELINE_P (w)) current_mode_line_height = display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w), - current_buffer->mode_line_format); + B_ (current_buffer, mode_line_format)); if (WINDOW_WANTS_HEADER_LINE_P (w)) current_header_line_height = display_mode_line (w, HEADER_LINE_FACE_ID, - current_buffer->header_line_format); + B_ (current_buffer, header_line_format)); start_display (&it, w, top); move_it_to (&it, charpos, -1, it.last_visible_y-1, -1, @@ -2405,10 +2405,10 @@ if (base_face_id == DEFAULT_FACE_ID && FRAME_WINDOW_P (it->f)) { - if (NATNUMP (current_buffer->extra_line_spacing)) - it->extra_line_spacing = XFASTINT (current_buffer->extra_line_spacing); - else if (FLOATP (current_buffer->extra_line_spacing)) - it->extra_line_spacing = (XFLOAT_DATA (current_buffer->extra_line_spacing) + if (NATNUMP (B_ (current_buffer, extra_line_spacing))) + it->extra_line_spacing = XFASTINT (B_ (current_buffer, extra_line_spacing)); + else if (FLOATP (B_ (current_buffer, extra_line_spacing))) + it->extra_line_spacing = (XFLOAT_DATA (B_ (current_buffer, extra_line_spacing)) * FRAME_LINE_HEIGHT (it->f)); else if (it->f->extra_line_spacing > 0) it->extra_line_spacing = it->f->extra_line_spacing; @@ -2431,36 +2431,36 @@ it->override_ascent = -1; /* Are control characters displayed as `^C'? */ - it->ctl_arrow_p = !NILP (current_buffer->ctl_arrow); + it->ctl_arrow_p = !NILP (B_ (current_buffer, ctl_arrow)); /* -1 means everything between a CR and the following line end is invisible. >0 means lines indented more than this value are invisible. */ - it->selective = (INTEGERP (current_buffer->selective_display) - ? XFASTINT (current_buffer->selective_display) - : (!NILP (current_buffer->selective_display) + it->selective = (INTEGERP (B_ (current_buffer, selective_display)) + ? XFASTINT (B_ (current_buffer, selective_display)) + : (!NILP (B_ (current_buffer, selective_display)) ? -1 : 0)); it->selective_display_ellipsis_p - = !NILP (current_buffer->selective_display_ellipses); + = !NILP (B_ (current_buffer, selective_display_ellipses)); /* Display table to use. */ it->dp = window_display_table (w); /* Are multibyte characters enabled in current_buffer? */ - it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters); + it->multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters)); /* Do we need to reorder bidirectional text? Not if this is a unibyte buffer: by definition, none of the single-byte characters are strong R2L, so no reordering is needed. And bidi.c doesn't support unibyte buffers anyway. */ it->bidi_p - = !NILP (current_buffer->bidi_display_reordering) && it->multibyte_p; + = !NILP (B_ (current_buffer, bidi_display_reordering)) && it->multibyte_p; /* Non-zero if we should highlight the region. */ highlight_region_p = (!NILP (Vtransient_mark_mode) - && !NILP (current_buffer->mark_active) - && XMARKER (current_buffer->mark)->buffer != 0); + && !NILP (B_ (current_buffer, mark_active)) + && XMARKER (B_ (current_buffer, mark))->buffer != 0); /* Set IT->region_beg_charpos and IT->region_end_charpos to the start and end of a visible region in window IT->w. Set both to @@ -2477,7 +2477,7 @@ && WINDOWP (minibuf_selected_window) && w == XWINDOW (minibuf_selected_window)))) { - EMACS_INT charpos = marker_position (current_buffer->mark); + EMACS_INT charpos = marker_position (B_ (current_buffer, mark)); it->region_beg_charpos = min (PT, charpos); it->region_end_charpos = max (PT, charpos); } @@ -2494,7 +2494,7 @@ it->redisplay_end_trigger_charpos = XINT (w->redisplay_end_trigger); /* Correct bogus values of tab_width. */ - it->tab_width = XINT (current_buffer->tab_width); + it->tab_width = XINT (B_ (current_buffer, tab_width)); if (it->tab_width <= 0 || it->tab_width > 1000) it->tab_width = 8; @@ -2508,8 +2508,8 @@ && (WINDOW_TOTAL_COLS (it->w) < XINT (Vtruncate_partial_width_windows)))))) it->line_wrap = TRUNCATE; - else if (NILP (current_buffer->truncate_lines)) - it->line_wrap = NILP (current_buffer->word_wrap) + else if (NILP (B_ (current_buffer, truncate_lines))) + it->line_wrap = NILP (B_ (current_buffer, word_wrap)) ? WINDOW_WRAP : WORD_WRAP; else it->line_wrap = TRUNCATE; @@ -2611,9 +2611,9 @@ { /* Note the paragraph direction that this buffer wants to use. */ - if (EQ (current_buffer->bidi_paragraph_direction, Qleft_to_right)) + if (EQ (B_ (current_buffer, bidi_paragraph_direction), Qleft_to_right)) it->paragraph_embedding = L2R; - else if (EQ (current_buffer->bidi_paragraph_direction, Qright_to_left)) + else if (EQ (B_ (current_buffer, bidi_paragraph_direction), Qright_to_left)) it->paragraph_embedding = R2L; else it->paragraph_embedding = NEUTRAL_DIR; @@ -5411,7 +5411,7 @@ it->method = GET_FROM_BUFFER; it->object = it->w->buffer; it->area = TEXT_AREA; - it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters); + it->multibyte_p = !NILP (B_ (current_buffer, enable_multibyte_characters)); it->sp = 0; it->string_from_display_prop_p = 0; it->face_before_selective_p = 0; @@ -7919,7 +7919,7 @@ old_deactivate_mark = Vdeactivate_mark; oldbuf = current_buffer; Fset_buffer (Fget_buffer_create (Vmessages_buffer_name)); - current_buffer->undo_list = Qt; + B_ (current_buffer, undo_list) = Qt; oldpoint = message_dolog_marker1; set_marker_restricted (oldpoint, make_number (PT), Qnil); @@ -7943,7 +7943,7 @@ /* Insert the string--maybe converting multibyte to single byte or vice versa, so that all the text fits the buffer. */ if (multibyte - && NILP (current_buffer->enable_multibyte_characters)) + && NILP (B_ (current_buffer, enable_multibyte_characters))) { EMACS_INT i; int c, char_bytes; @@ -7961,7 +7961,7 @@ } } else if (! multibyte - && ! NILP (current_buffer->enable_multibyte_characters)) + && ! NILP (B_ (current_buffer, enable_multibyte_characters))) { EMACS_INT i; int c, char_bytes; @@ -8460,7 +8460,7 @@ Lisp_Object string; string = Fcurrent_message (); message3 (string, SBYTES (string), - !NILP (current_buffer->enable_multibyte_characters)); + !NILP (B_ (current_buffer, enable_multibyte_characters))); } } @@ -8475,7 +8475,7 @@ for (i = 0; i < 2; ++i) if (!BUFFERP (echo_buffer[i]) - || NILP (XBUFFER (echo_buffer[i])->name)) + || NILP (B_ (XBUFFER (echo_buffer[i]), name))) { char name[30]; Lisp_Object old_buffer; @@ -8484,7 +8484,7 @@ old_buffer = echo_buffer[i]; sprintf (name, " *Echo Area %d*", i); echo_buffer[i] = Fget_buffer_create (build_string (name)); - XBUFFER (echo_buffer[i])->truncate_lines = Qnil; + B_ (XBUFFER (echo_buffer[i]), truncate_lines) = Qnil; /* to force word wrap in echo area - it was decided to postpone this*/ /* XBUFFER (echo_buffer[i])->word_wrap = Qt; */ @@ -8577,8 +8577,8 @@ set_marker_both (w->pointm, buffer, BEG, BEG_BYTE); } - current_buffer->undo_list = Qt; - current_buffer->read_only = Qnil; + B_ (current_buffer, undo_list) = Qt; + B_ (current_buffer, read_only) = Qnil; specbind (Qinhibit_read_only, Qt); specbind (Qinhibit_modification_hooks, Qt); @@ -8691,7 +8691,7 @@ /* Switch to that buffer and clear it. */ set_buffer_internal (XBUFFER (echo_area_buffer[0])); - current_buffer->truncate_lines = Qnil; + B_ (current_buffer, truncate_lines) = Qnil; if (Z > BEG) { @@ -8705,7 +8705,7 @@ /* Set up the buffer for the multibyteness we need. */ if (multibyte_p - != !NILP (current_buffer->enable_multibyte_characters)) + != !NILP (B_ (current_buffer, enable_multibyte_characters))) Fset_buffer_multibyte (multibyte_p ? Qt : Qnil); /* Raise the frame containing the echo area. */ @@ -8734,7 +8734,7 @@ { /* Someone switched buffers between print requests. */ set_buffer_internal (XBUFFER (echo_area_buffer[0])); - current_buffer->truncate_lines = Qnil; + B_ (current_buffer, truncate_lines) = Qnil; } } } @@ -9177,12 +9177,12 @@ /* Change multibyteness of the echo buffer appropriately. */ if (message_enable_multibyte - != !NILP (current_buffer->enable_multibyte_characters)) + != !NILP (B_ (current_buffer, enable_multibyte_characters))) Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil); - current_buffer->truncate_lines = message_truncate_lines ? Qt : Qnil; - if (!NILP (current_buffer->bidi_display_reordering)) - current_buffer->bidi_paragraph_direction = Qleft_to_right; + B_ (current_buffer, truncate_lines) = message_truncate_lines ? Qt : Qnil; + if (!NILP (B_ (current_buffer, bidi_display_reordering))) + B_ (current_buffer, bidi_paragraph_direction) = Qleft_to_right; /* Insert new message at BEG. */ TEMP_SET_PT_BOTH (BEG, BEG_BYTE); @@ -9205,7 +9205,7 @@ if (nbytes == 0) nbytes = strlen (s); - if (multibyte_p && NILP (current_buffer->enable_multibyte_characters)) + if (multibyte_p && NILP (B_ (current_buffer, enable_multibyte_characters))) { /* Convert from multi-byte to single-byte. */ EMACS_INT i; @@ -9223,7 +9223,7 @@ } } else if (!multibyte_p - && !NILP (current_buffer->enable_multibyte_characters)) + && !NILP (B_ (current_buffer, enable_multibyte_characters))) { /* Convert from single-byte to multi-byte. */ EMACS_INT i; @@ -9808,7 +9808,7 @@ < BUF_MODIFF (XBUFFER (w->buffer))) != !NILP (w->last_had_star)) || ((!NILP (Vtransient_mark_mode) - && !NILP (XBUFFER (w->buffer)->mark_active)) + && !NILP (B_ (XBUFFER (w->buffer), mark_active))) != !NILP (w->region_showing))) { struct buffer *prev = current_buffer; @@ -10006,7 +10006,7 @@ < BUF_MODIFF (XBUFFER (w->buffer))) != !NILP (w->last_had_star)) || ((!NILP (Vtransient_mark_mode) - && !NILP (XBUFFER (w->buffer)->mark_active)) + && !NILP (B_ (XBUFFER (w->buffer), mark_active))) != !NILP (w->region_showing))) { struct buffer *prev = current_buffer; @@ -11097,8 +11097,8 @@ /* If selective display, can't optimize if changes start at the beginning of the line. */ if (unchanged_p - && INTEGERP (current_buffer->selective_display) - && XINT (current_buffer->selective_display) > 0 + && INTEGERP (B_ (current_buffer, selective_display)) + && XINT (B_ (current_buffer, selective_display)) > 0 && (BEG_UNCHANGED < start || GPT <= start)) unchanged_p = 0; @@ -11126,8 +11126,8 @@ require to redisplay the whole paragraph. It might be worthwhile to find the paragraph limits and widen the range of redisplayed lines to that, but for now just give up this optimization. */ - if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering) - && NILP (XBUFFER (w->buffer)->bidi_paragraph_direction)) + if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)) + && NILP (B_ (XBUFFER (w->buffer), bidi_paragraph_direction))) unchanged_p = 0; } @@ -11662,11 +11662,11 @@ the whole window. The assignment to this_line_start_pos prevents the optimization directly below this if-statement. */ if (((!NILP (Vtransient_mark_mode) - && !NILP (XBUFFER (w->buffer)->mark_active)) + && !NILP (B_ (XBUFFER (w->buffer), mark_active))) != !NILP (w->region_showing)) || (!NILP (w->region_showing) && !EQ (w->region_showing, - Fmarker_position (XBUFFER (w->buffer)->mark)))) + Fmarker_position (B_ (XBUFFER (w->buffer), mark))))) CHARPOS (this_line_start_pos) = 0; /* Optimize the case that only the line containing the cursor in the @@ -11826,8 +11826,8 @@ /* If highlighting the region, or if the cursor is in the echo area, then we can't just move the cursor. */ else if (! (!NILP (Vtransient_mark_mode) - && !NILP (current_buffer->mark_active)) - && (EQ (selected_window, current_buffer->last_selected_window) + && !NILP (B_ (current_buffer, mark_active))) + && (EQ (selected_window, B_ (current_buffer, last_selected_window)) || highlight_nonselected_windows) && NILP (w->region_showing) && NILP (Vshow_trailing_whitespace) @@ -13033,8 +13033,8 @@ scroll_max = (max (scroll_step, max (arg_scroll_conservatively, temp_scroll_step)) * FRAME_LINE_HEIGHT (f)); - else if (NUMBERP (current_buffer->scroll_down_aggressively) - || NUMBERP (current_buffer->scroll_up_aggressively)) + else if (NUMBERP (B_ (current_buffer, scroll_down_aggressively)) + || NUMBERP (B_ (current_buffer, scroll_up_aggressively))) /* We're trying to scroll because of aggressive scrolling but no scroll_step is set. Choose an arbitrary one. */ scroll_max = 10 * FRAME_LINE_HEIGHT (f); @@ -13099,7 +13099,7 @@ amount_to_scroll = scroll_max; else { - aggressive = current_buffer->scroll_up_aggressively; + aggressive = B_ (current_buffer, scroll_up_aggressively); height = WINDOW_BOX_TEXT_HEIGHT (w); if (NUMBERP (aggressive)) { @@ -13182,7 +13182,7 @@ amount_to_scroll = scroll_max; else { - aggressive = current_buffer->scroll_down_aggressively; + aggressive = B_ (current_buffer, scroll_down_aggressively); height = WINDOW_BOX_TEXT_HEIGHT (w); if (NUMBERP (aggressive)) { @@ -13363,7 +13363,7 @@ region exists, cursor movement has to do more than just set the cursor. */ && !(!NILP (Vtransient_mark_mode) - && !NILP (current_buffer->mark_active)) + && !NILP (B_ (current_buffer, mark_active))) && NILP (w->region_showing) && NILP (Vshow_trailing_whitespace) /* Right after splitting windows, last_point may be nil. */ @@ -13518,7 +13518,7 @@ must_scroll = 1; } else if (rc != CURSOR_MOVEMENT_SUCCESS - && !NILP (XBUFFER (w->buffer)->bidi_display_reordering)) + && !NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))) { /* If rows are bidi-reordered and point moved, back up until we find a row that does not belong to a @@ -13576,7 +13576,7 @@ else if (scroll_p) rc = CURSOR_MOVEMENT_MUST_SCROLL; else if (rc != CURSOR_MOVEMENT_SUCCESS - && !NILP (XBUFFER (w->buffer)->bidi_display_reordering)) + && !NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))) { /* With bidi-reordered rows, there could be more than one candidate row whose start and end positions @@ -13876,7 +13876,7 @@ struct Lisp_Char_Table *disptab = buffer_display_table (); if (! disptab_matches_widthtab (disptab, - XVECTOR (current_buffer->width_table))) + XVECTOR (B_ (current_buffer, width_table)))) { invalidate_region_cache (current_buffer, current_buffer->width_run_cache, @@ -13998,7 +13998,7 @@ /* If we are highlighting the region, then we just changed the region, so redisplay to show it. */ if (!NILP (Vtransient_mark_mode) - && !NILP (current_buffer->mark_active)) + && !NILP (B_ (current_buffer, mark_active))) { clear_glyph_matrix (w->desired_matrix); if (!try_window (window, startp, 0)) @@ -14161,8 +14161,8 @@ if ((scroll_conservatively || emacs_scroll_step || temp_scroll_step - || NUMBERP (current_buffer->scroll_up_aggressively) - || NUMBERP (current_buffer->scroll_down_aggressively)) + || NUMBERP (B_ (current_buffer, scroll_up_aggressively)) + || NUMBERP (B_ (current_buffer, scroll_down_aggressively))) && !current_buffer->clip_changed && CHARPOS (startp) >= BEGV && CHARPOS (startp) <= ZV) @@ -14605,7 +14605,7 @@ /* Can't do this if region may have changed. */ if ((!NILP (Vtransient_mark_mode) - && !NILP (current_buffer->mark_active)) + && !NILP (B_ (current_buffer, mark_active))) || !NILP (w->region_showing) || !NILP (Vshow_trailing_whitespace)) return 0; @@ -14948,7 +14948,7 @@ /* Can't use this optimization with bidi-reordered glyph rows, unless cursor is already at point. */ - if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering)) + if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering))) { if (!(w->cursor.hpos >= 0 && w->cursor.hpos < row->used[TEXT_AREA] @@ -15262,7 +15262,7 @@ { struct glyph *g; - if (NILP (XBUFFER (w->buffer)->bidi_display_reordering) + if (NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)) || (!best_row && !row->continued_p)) return row; /* In bidi-reordered rows, there could be several rows @@ -15409,7 +15409,7 @@ /* Can't use this if highlighting a region because a cursor movement will do more than just set the cursor. */ if (!NILP (Vtransient_mark_mode) - && !NILP (current_buffer->mark_active)) + && !NILP (B_ (current_buffer, mark_active))) GIVE_UP (9); /* Likewise if highlighting trailing whitespace. */ @@ -15429,7 +15429,7 @@ wrapped line can change the wrap position, altering the line above it. It might be worthwhile to handle this more intelligently, but for now just redisplay from scratch. */ - if (!NILP (XBUFFER (w->buffer)->word_wrap)) + if (!NILP (B_ (XBUFFER (w->buffer), word_wrap))) GIVE_UP (21); /* Under bidi reordering, adding or deleting a character in the @@ -15440,8 +15440,8 @@ to find the paragraph limits and widen the range of redisplayed lines to that, but for now just give up this optimization and redisplay from scratch. */ - if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering) - && NILP (XBUFFER (w->buffer)->bidi_paragraph_direction)) + if (!NILP (B_ (XBUFFER (w->buffer), bidi_display_reordering)) + && NILP (B_ (XBUFFER (w->buffer), bidi_paragraph_direction))) GIVE_UP (22); /* Make sure beg_unchanged and end_unchanged are up to date. Do it @@ -16412,7 +16412,7 @@ it.glyph_row->used[TEXT_AREA] = 0; SET_TEXT_POS (it.position, 0, 0); - multibyte_p = !NILP (buffer->enable_multibyte_characters); + multibyte_p = !NILP (B_ (buffer, enable_multibyte_characters)); p = arrow_string; while (p < arrow_end) { @@ -17347,7 +17347,7 @@ row->glyphs[TEXT_AREA]->charpos = -1; row->displays_text_p = 0; - if (!NILP (XBUFFER (it->w->buffer)->indicate_empty_lines) + if (!NILP (B_ (XBUFFER (it->w->buffer), indicate_empty_lines)) && (!MINI_WINDOW_P (it->w) || (minibuf_level && EQ (it->window, minibuf_window)))) row->indicate_empty_line_p = 1; @@ -17925,10 +17925,10 @@ old = current_buffer; } - if (NILP (buf->bidi_display_reordering)) + if (NILP (B_ (buf, bidi_display_reordering))) return Qleft_to_right; - else if (!NILP (buf->bidi_paragraph_direction)) - return buf->bidi_paragraph_direction; + else if (!NILP (B_ (buf, bidi_paragraph_direction))) + return B_ (buf, bidi_paragraph_direction); else { /* Determine the direction from buffer text. We could try to @@ -18187,14 +18187,14 @@ /* Select mode line face based on the real selected window. */ display_mode_line (w, CURRENT_MODE_LINE_FACE_ID_3 (sel_w, sel_w, w), - current_buffer->mode_line_format); + B_ (current_buffer, mode_line_format)); ++n; } if (WINDOW_WANTS_HEADER_LINE_P (w)) { display_mode_line (w, HEADER_LINE_FACE_ID, - current_buffer->header_line_format); + B_ (current_buffer, header_line_format)); ++n; } @@ -19129,7 +19129,7 @@ decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_flag) { Lisp_Object val; - int multibyte = !NILP (current_buffer->enable_multibyte_characters); + int multibyte = !NILP (B_ (current_buffer, enable_multibyte_characters)); const unsigned char *eol_str; int eol_str_len; /* The EOL conversion we are using. */ @@ -19225,7 +19225,7 @@ switch (c) { case '*': - if (!NILP (b->read_only)) + if (!NILP (B_ (b, read_only))) return "%"; if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) return "*"; @@ -19235,7 +19235,7 @@ /* This differs from %* only for a modified read-only buffer. */ if (BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) return "*"; - if (!NILP (b->read_only)) + if (!NILP (B_ (b, read_only))) return "%"; return "-"; @@ -19297,7 +19297,7 @@ } case 'b': - obj = b->name; + obj = B_ (b, name); break; case 'c': @@ -19337,7 +19337,7 @@ return "Emacs"; case 'f': - obj = b->filename; + obj = B_ (b, filename); break; case 'i': @@ -19473,7 +19473,7 @@ break; case 'm': - obj = b->mode_name; + obj = B_ (b, mode_name); break; case 'n': @@ -19558,7 +19558,7 @@ { int count = inhibit_garbage_collection (); Lisp_Object val = call1 (intern ("file-remote-p"), - current_buffer->directory); + B_ (current_buffer, directory)); unbind_to (count, Qnil); if (NILP (val)) @@ -19593,7 +19593,7 @@ (FRAME_TERMINAL_CODING (f)->id), p, 0); } - p = decode_mode_spec_coding (b->buffer_file_coding_system, + p = decode_mode_spec_coding (B_ (b, buffer_file_coding_system), p, eol_flag); #if 0 /* This proves to be annoying; I think we can do without. -- rms. */ @@ -19643,8 +19643,8 @@ /* If we are not in selective display mode, check only for newlines. */ - int selective_display = (!NILP (current_buffer->selective_display) - && !INTEGERP (current_buffer->selective_display)); + int selective_display = (!NILP (B_ (current_buffer, selective_display)) + && !INTEGERP (B_ (current_buffer, selective_display))); if (count > 0) { @@ -23291,13 +23291,13 @@ { if (w == XWINDOW (echo_area_window)) { - if (EQ (b->cursor_type, Qt) || NILP (b->cursor_type)) + if (EQ (B_ (b, cursor_type), Qt) || NILP (B_ (b, cursor_type))) { *width = FRAME_CURSOR_WIDTH (f); return FRAME_DESIRED_CURSOR (f); } else - return get_specified_cursor_type (b->cursor_type, width); + return get_specified_cursor_type (B_ (b, cursor_type), width); } *active_cursor = 0; @@ -23317,23 +23317,23 @@ } /* Never display a cursor in a window in which cursor-type is nil. */ - if (NILP (b->cursor_type)) + if (NILP (B_ (b, cursor_type))) return NO_CURSOR; /* Get the normal cursor type for this window. */ - if (EQ (b->cursor_type, Qt)) + if (EQ (B_ (b, cursor_type), Qt)) { cursor_type = FRAME_DESIRED_CURSOR (f); *width = FRAME_CURSOR_WIDTH (f); } else - cursor_type = get_specified_cursor_type (b->cursor_type, width); + cursor_type = get_specified_cursor_type (B_ (b, cursor_type), width); /* Use cursor-in-non-selected-windows instead for non-selected window or frame. */ if (non_selected) { - alt_cursor = b->cursor_in_non_selected_windows; + alt_cursor = B_ (b, cursor_in_non_selected_windows); if (!EQ (Qt, alt_cursor)) return get_specified_cursor_type (alt_cursor, width); /* t means modify the normal cursor type. */ @@ -23380,7 +23380,7 @@ /* Cursor is blinked off, so determine how to "toggle" it. */ /* First look for an entry matching the buffer's cursor-type in blink-cursor-alist. */ - if ((alt_cursor = Fassoc (b->cursor_type, Vblink_cursor_alist), !NILP (alt_cursor))) + if ((alt_cursor = Fassoc (B_ (b, cursor_type), Vblink_cursor_alist), !NILP (alt_cursor))) return get_specified_cursor_type (XCDR (alt_cursor), width); /* Then see if frame has specified a specific blink off cursor type. */ @@ -25496,11 +25496,11 @@ necessarily display the character whose position is the smallest. */ Lisp_Object lim1 = - NILP (XBUFFER (buffer)->bidi_display_reordering) + NILP (B_ (XBUFFER (buffer), bidi_display_reordering)) ? Fmarker_position (w->start) : Qnil; Lisp_Object lim2 = - NILP (XBUFFER (buffer)->bidi_display_reordering) + NILP (B_ (XBUFFER (buffer), bidi_display_reordering)) ? make_number (BUF_Z (XBUFFER (buffer)) - XFASTINT (w->window_end_pos)) : Qnil; === modified file 'src/xfaces.c' --- src/xfaces.c 2011-02-05 22:30:14 +0000 +++ src/xfaces.c 2011-02-14 15:39:19 +0000 @@ -5970,7 +5970,7 @@ { int face_id; - if (NILP (current_buffer->enable_multibyte_characters)) + if (NILP (B_ (current_buffer, enable_multibyte_characters))) ch = 0; if (NILP (prop)) === modified file 'src/xfns.c' --- src/xfns.c 2011-02-06 03:48:28 +0000 +++ src/xfns.c 2011-02-14 15:39:19 +0000 @@ -4610,7 +4610,7 @@ Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil); old_buffer = current_buffer; set_buffer_internal_1 (XBUFFER (buffer)); - current_buffer->truncate_lines = Qnil; + B_ (current_buffer, truncate_lines) = Qnil; specbind (Qinhibit_read_only, Qt); specbind (Qinhibit_modification_hooks, Qt); Ferase_buffer (); @@ -5106,7 +5106,7 @@ /* Display the tooltip text in a temporary buffer. */ old_buffer = current_buffer; set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer)); - current_buffer->truncate_lines = Qnil; + B_ (current_buffer, truncate_lines) = Qnil; clear_glyph_matrix (w->desired_matrix); clear_glyph_matrix (w->current_matrix); SET_TEXT_POS (pos, BEGV, BEGV_BYTE); ------------------------------------------------------------ revno: 103272 committer: Jan D. branch nick: trunk timestamp: Mon 2011-02-14 14:30:49 +0100 message: * gtkutil.c (xg_tool_bar_menu_proxy): Handle case when tool bar label is null. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-13 11:28:42 +0000 +++ src/ChangeLog 2011-02-14 13:30:49 +0000 @@ -1,3 +1,8 @@ +2011-02-14 Jan Djärv + + * gtkutil.c (xg_tool_bar_menu_proxy): Handle case when tool bar label + is null. + 2011-02-13 Jan Djärv * callproc.c (Fcall_process): === modified file 'src/gtkutil.c' --- src/gtkutil.c 2011-01-26 08:36:39 +0000 +++ src/gtkutil.c 2011-02-14 13:30:49 +0000 @@ -3677,7 +3677,7 @@ GtkLabel *wlbl = GTK_LABEL (xg_get_tool_bar_widgets (vb, &c1)); GtkImage *wimage = GTK_IMAGE (c1); GtkWidget *wmenuitem = gtk_image_menu_item_new_with_label - (gtk_label_get_text (wlbl)); + (wlbl ? gtk_label_get_text (wlbl) : ""); GtkWidget *wmenuimage; ------------------------------------------------------------ revno: 103271 author: Teodor Zlatanov committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2011-02-14 12:24:43 +0000 message: auth-source.el (auth-source-backend-parse-parameters): Don't rely on `plist-get' to accept non-list parameters (XEmacs issue). Fix docstring. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-02-14 04:23:59 +0000 +++ lisp/gnus/ChangeLog 2011-02-14 12:24:43 +0000 @@ -1,3 +1,9 @@ +2011-02-14 Teodor Zlatanov + + * auth-source.el (auth-source-backend-parse-parameters): Don't rely on + `plist-get' to accept non-list parameters (XEmacs issue). Fix + docstring. + 2011-02-14 Lars Ingebrigtsen * nnimap.el (nnimap-inhibit-logging): New variable. === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2011-02-14 04:23:59 +0000 +++ lisp/gnus/auth-source.el 2011-02-14 12:24:43 +0000 @@ -331,9 +331,11 @@ (defun auth-source-backend-parse-parameters (entry backend) "Fills in the extra auth-source-backend parameters of ENTRY. Using the plist ENTRY, get the :host, :protocol, and :user search -parameters. Accepts :port as an alias to :protocol. Sets all -the parameters to t if they are missing." - (let (val) +parameters. Accepts :port as an alias to :protocol." + (let ((entry (if (stringp entry) + nil + entry)) + val) (when (setq val (plist-get entry :host)) (oset backend host val)) (when (setq val (plist-get entry :user)) ------------------------------------------------------------ revno: 103270 author: Lars Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2011-02-14 04:23:59 +0000 message: nnimap.el (nnimap-inhibit-logging): New variable. (nnimap-log-command): Don't log login commands. auth-source.el (auth-source-netrc-search): The asserts seem to want to have more parameters. nnimap.el (nnimap-send-command): Mark the command time for each command, so that we don't get NOOPs stepping on our toes. gnus-art.el (article-date-ut): Get the date from the Date header on `t'. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-02-14 01:38:00 +0000 +++ lisp/gnus/ChangeLog 2011-02-14 04:23:59 +0000 @@ -1,3 +1,17 @@ +2011-02-14 Lars Ingebrigtsen + + * nnimap.el (nnimap-inhibit-logging): New variable. + (nnimap-log-command): Don't log login commands. + + * auth-source.el (auth-source-netrc-search): The asserts seem to want + to have more parameters. + + * nnimap.el (nnimap-send-command): Mark the command time for each + command, so that we don't get NOOPs stepping on our toes. + + * gnus-art.el (article-date-ut): Get the date from the Date header on + `t'. + 2011-02-14 Katsumi Yamaoka * auth-source.el (auth-source-search): Use copy-sequence instead of === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2011-02-14 01:38:00 +0000 +++ lisp/gnus/auth-source.el 2011-02-14 04:23:59 +0000 @@ -483,7 +483,7 @@ (assert (or (eq t create) (listp create)) t - "Invalid auth-source :create parameter (must be nil, t, or a list)") + "Invalid auth-source :create parameter (must be nil, t, or a list): %s %s") (setq filtered-backends (copy-sequence backends)) (dolist (backend backends) @@ -779,7 +779,7 @@ See `auth-source-search' for details on SPEC." ;; just in case, check that the type is correct (null or same as the backend) (assert (or (null type) (eq type (oref backend type))) - t "Invalid netrc search") + t "Invalid netrc search: %s %s") (let ((results (auth-source-netrc-normalize (auth-source-netrc-parse === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2011-02-13 23:30:55 +0000 +++ lisp/gnus/gnus-art.el 2011-02-14 04:23:59 +0000 @@ -3404,6 +3404,7 @@ (inhibit-read-only t) (inhibit-point-motion-hooks t) (first t) + (visible-date (mail-fetch-field "Date")) pos date bface eface) (save-excursion (save-restriction @@ -3427,6 +3428,9 @@ (delete-region (point-at-bol) (progn (gnus-article-forward-header) (point)))) + (when (and (not date) + visible-date) + (setq date visible-date)) (when date (article-transform-date date type bface eface))))))) === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2011-02-13 13:44:06 +0000 +++ lisp/gnus/nnimap.el 2011-02-14 04:23:59 +0000 @@ -142,6 +142,8 @@ (defvar nnimap-quirks '(("QRESYNC" "Zimbra" "QRESYNC "))) +(defvar nnimap-inhibit-logging nil) + (defun nnimap-buffer () (nnimap-find-process-buffer nntp-server-buffer)) @@ -389,8 +391,9 @@ nnimap-address) ports t)))) (setq nnimap-object nil) - (setq login-result - (nnimap-login (car credentials) (cadr credentials))) + (let ((nnimap-inhibit-logging t)) + (setq login-result + (nnimap-login (car credentials) (cadr credentials)))) (unless (car login-result) ;; If the login failed, then forget the credentials ;; that are now possibly cached. @@ -1565,6 +1568,7 @@ (defvar nnimap-sequence 0) (defun nnimap-send-command (&rest args) + (setf (nnimap-last-command-time nnimap-object) (current-time)) (process-send-string (get-buffer-process (current-buffer)) (nnimap-log-command @@ -1583,12 +1587,14 @@ (defun nnimap-log-command (command) (with-current-buffer (get-buffer-create "*imap log*") (goto-char (point-max)) - (insert (format-time-string "%H:%M:%S") " " command)) + (insert (format-time-string "%H:%M:%S") " " + (if nnimap-inhibit-logging + "(inhibited)" + command))) command) (defun nnimap-command (&rest args) (erase-buffer) - (setf (nnimap-last-command-time nnimap-object) (current-time)) (let* ((sequence (apply #'nnimap-send-command args)) (response (nnimap-get-response sequence))) (if (equal (caar response) "OK")