Mercurial > emacs
view doc/lispref/anti.texi @ 107984:bef5d1738c0b
Make variable forwarding explicit rather the using special values.
Basically, this makes the structure of buffer-local values and object
forwarding explicit in the type of Lisp_Symbols rather than use
special Lisp_Objects for that. This tends to lead to slightly more
verbose code, but is more C-like, simpler, and makes it easier to make
sure we handled all cases, among other things by letting the compiler
help us check it.
* lisp.h (enum Lisp_Misc_Type, union Lisp_Misc):
Removing forwarding objects.
(enum Lisp_Fwd_Type, enum symbol_redirect, union Lisp_Fwd): New types.
(struct Lisp_Symbol): Make the various forms of variable-forwarding
explicit rather than hiding them inside Lisp_Object "values".
(XFWDTYPE): New macro.
(XINTFWD, XBOOLFWD, XOBJFWD, XKBOARD_OBJFWD): Redefine.
(XBUFFER_LOCAL_VALUE): Remove.
(SYMBOL_VAL, SYMBOL_ALIAS, SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL)
(SET_SYMBOL_ALIAS, SET_SYMBOL_BLV, SET_SYMBOL_FWD): New macros.
(SYMBOL_VALUE, SET_SYMBOL_VALUE): Remove.
(struct Lisp_Intfwd, struct Lisp_Boolfwd, struct Lisp_Objfwd)
(struct Lisp_Buffer_Objfwd, struct Lisp_Kboard_Objfwd):
Remove the Lisp_Misc_* header.
(struct Lisp_Buffer_Local_Value): Redefine.
(BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): New macros.
(struct Lisp_Misc_Any): Add filler to get the right size.
(struct Lisp_Free): Use struct Lisp_Misc_Any rather than struct
Lisp_Intfwd.
(DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
(DEFVAR_KBOARD): Allocate a forwarding object.
* data.c (do_blv_forwarding, store_blv_forwarding): New macros.
(let_shadows_global_binding_p): New function.
(union Lisp_Val_Fwd): New type.
(make_blv): New function.
(swap_in_symval_forwarding, indirect_variable, do_symval_forwarding)
(store_symval_forwarding, swap_in_global_binding, Fboundp)
(swap_in_symval_forwarding, find_symbol_value, Fset)
(let_shadows_buffer_binding_p, set_internal, default_value)
(Fset_default, Fmake_variable_buffer_local, Fmake_local_variable)
(Fkill_local_variable, Fmake_variable_frame_local)
(Flocal_variable_p, Flocal_variable_if_set_p)
(Fvariable_binding_locus):
* xdisp.c (select_frame_for_redisplay):
* lread.c (Fintern, Funintern, init_obarray, defvar_int)
(defvar_bool, defvar_lisp_nopro, defvar_lisp, defvar_kboard):
* frame.c (store_frame_param):
* eval.c (Fdefvaralias, Fuser_variable_p, specbind, unbind_to):
* bytecode.c (Fbyte_code) <varref, varset>: Adapt to the new symbol
value structure.
* buffer.c (PER_BUFFER_SYMBOL): Move from buffer.h.
(clone_per_buffer_values): Only adjust markers into the current buffer.
(reset_buffer_local_variables): PER_BUFFER_IDX is never -2.
(Fbuffer_local_value, set_buffer_internal_1)
(swap_out_buffer_local_variables):
Adapt to the new symbol value structure.
(DEFVAR_PER_BUFFER): Allocate a Lisp_Buffer_Objfwd object.
(defvar_per_buffer): Take a new arg for the fwd object.
(buffer_lisp_local_variables): Return a proper alist (different fix
for bug#4138).
* alloc.c (Fmake_symbol): Use SET_SYMBOL_VAL.
(Fgarbage_collect): Don't handle buffer_defaults specially.
(mark_object): Handle new symbol value structure rather than the old
special Lisp_Misc_* objects.
(gc_sweep) <symbols>: Free also the buffer-local-value objects.
* term.c (set_tty_color_mode):
* bidi.c (bidi_initialize): Don't access the ->value field directly.
* buffer.h (PER_BUFFER_VAR_OFFSET): Don't bother with
a buffer_local_flags.
* print.c (print_object): Get rid of impossible forwarding objects.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 19 Apr 2010 21:50:52 -0400 |
parents | 1d1d5d9bd884 |
children | a44dc3503539 376148b31b5e |
line wrap: on
line source
@c -*-texinfo-*- @c This is part of the GNU Emacs Lisp Reference Manual. @c Copyright (C) 1999, 2002, 2003, 2004, 2005, 2006, 2007, 2008, @c 2009, 2010 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. @c This node must have no pointers. @node Antinews, GNU Free Documentation License, System Interface, Top @appendix Emacs 22 Antinews @c Update the elisp.texi, vol1.texi, vol2.texi Antinews menu entries @c with the above version number. For those users who live backwards in time, here is information about downgrading to Emacs version 22.3. We hope you will enjoy the greater simplicity that results from the absence of many Emacs @value{EMACSVER} features. @section Old Lisp Features in Emacs 22 @itemize @bullet @item The internal character representation used by Emacs is not longer based on Unicode. In this representation, called @code{emacs-mule}, each character belongs to one and only one script. Emacs makes no attempt to distinguish between ``similar'' characters occurring in different scripts. @item The @code{^} interactive spec code, the function @code{handle-shift-selection}, and the variable @code{this-command-keys-shift-translated} have all been removed. Shift-translated keys are no longer treated specially, making Emacs' handling of keybindings much more consistent. @item Temporarily-active regions are not created by giving the variable @code{transient-mark-mode} values of the form @code{(only . @var{oldvar})}. We instead use a more complicated scheme: setting @code{transient-mark-mode} to @code{only} enables Transient Mark mode for the following command only, during which the value of @code{transient-mark-mode} is set to @code{identity}; if it is still @code{identity} at the end of the command, Transient Mark mode is disabled. @item Many minibuffer functions, such as @code{read-file-name} and @code{minibuffer-complete}, have been rewritten in C for greater speed. The completion code has been considerably simplified; the completion style can no longer be changed via @code{completion-styles-alist}, and @code{completing-read} no longer recognizes the special values @code{confirm-only} and @code{confirm-after-completion} for its @var{require-match} argument. @item Emacs no longer supports explicitly-numbered groups in regular expressions. @item The @code{permanent-local-hook} function property has no special meaning. @item The @code{functionp} function now returns @code{t} for special forms. @item The @code{interactive-form} symbol property has no special meaning. Once you supply a function with an interactive form, the only way to change it is to redefine the function. @item The @code{ignore-errors} macro has been moved into the @code{cl} package. @item Variables can now be both buffer-local and frame-local; buffer-local bindings take precedence over frame-local bindings. @item Faces can no longer be remapped. @item Lisp programs now specify fonts by their names, which are strings following the XLFD (X logical font descriptor) format. Fonts are no longer represented using a special set of ``font'' data types. The various functions that act on these data types, such as @code{fontp}, @code{font-spec}, and @code{list-fonts}, have all been deleted. @item Emacs does not recognize the @code{FontBackend} X resource and the @code{font-backend} frame parameter. On the X Window System, fonts are always drawn using the X core font driver. @item Display terminals are no longer represented using a ``terminal'' data type; this is not necessary, because we have removed the ability to display on graphical and text-only terminals simultaneously. For the same reason, the @code{window-system} variable is no longer frame-local, and the @code{window-system} function has been removed. @item The functions @code{list-system-processes} and @code{process-attributes} have been removed. To get information about system processes, call an external program, such as @command{ps}. @item The function @code{locate-user-emacs-file} and the variable @code{user-emacs-directory} have been removed. Instead, use hard-coded values pointing to @file{~/.emacs.d}. @item @code{vertical-motion} can no longer be told to move to a specific column; it always puts point on the first column of a line. @item Windows no longer have parameters. @item The @code{display-buffer} function has been rewritten in C. Its window-splitting heuristics are a little less sophisticated, and a little less documented. Window-splitting is handled internally, instead of using @code{split-window-preferred-function} (which has been removed). Windows are never split horizontally; the variable @code{split-width-threshold} has been removed. @item The @code{mode-name} variable now accepts only string values, and cannot take the form of a mode-line construct. @item The behavior of @code{map-char-table} has changed. It calls the mapping function for every single character in the table, instead of using cons cells to represent contiguous character code ranges. @item Several keymaps have been eliminated: @code{input-decode-map}, @code{local-function-key-map}, @code{search-map}, @code{multi-query-replace-map}, and @code{minibuffer-local-shell-command-map}. @item Many functions have been removed, including: @code{buffer-swap-text}, @code{emacs-init-time}, @code{emacs-uptime}, @code{use-region-p}, @code{region-active-p}, @code{start-file-process}, @code{process-lines}, @code{image-refresh}, @code{match-substitute-replacement}, @code{word-search-forward-lax}, and @code{word-search-backward-lax}. @item Many variables have been removed, including @code{read-circle}, @code{after-init-time} and @code{before-init-time}, @code{generate-autoload-cookie}, @code{file-local-variables-alist}, @code{replace-search-function} and @code{replace-re-search-function}, @code{inhibit-changing-match-data}, @code{wrap-prefix}, and @code{line-prefix}, @end itemize @ignore arch-tag: 1d0ef137-2bad-430e-ae8e-d820d569b5a6 @end ignore