comparison lispref/internals.texi @ 25751:467b88fab665

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Fri, 17 Sep 1999 06:59:04 +0000
parents d4ac295a98b3
children cdd1c350aae9
comparison
equal deleted inserted replaced
25750:f1968a807f56 25751:467b88fab665
95 Load the files with @file{site-init.el}, then copy the files into the 95 Load the files with @file{site-init.el}, then copy the files into the
96 installation directory for Lisp files when you install Emacs. 96 installation directory for Lisp files when you install Emacs.
97 97
98 @item 98 @item
99 Specify a non-@code{nil} value for 99 Specify a non-@code{nil} value for
100 @code{byte-compile-dynamic-docstrings} as a local variable in each these 100 @code{byte-compile-dynamic-docstrings} as a local variable in each of these
101 files, and load them with either @file{site-load.el} or 101 files, and load them with either @file{site-load.el} or
102 @file{site-init.el}. (This method has the drawback that the 102 @file{site-init.el}. (This method has the drawback that the
103 documentation strings take up space in Emacs all the time.) 103 documentation strings take up space in Emacs all the time.)
104 @end itemize 104 @end itemize
105 105
106 It is not advisable to put anything in @file{site-load.el} or 106 It is not advisable to put anything in @file{site-load.el} or
107 @file{site-init.el} that would alter any of the features that users 107 @file{site-init.el} that would alter any of the features that users
108 expect in an ordinary unmodified Emacs. If you feel you must override 108 expect in an ordinary unmodified Emacs. If you feel you must override
109 normal features for your site, do it with @file{default.el}, so that 109 normal features for your site, do it with @file{default.el}, so that
110 users can override your changes if they wish. @xref{Start-up Summary}. 110 users can override your changes if they wish. @xref{Startup Summary}.
111 111
112 @defun dump-emacs to-file from-file 112 @defun dump-emacs to-file from-file
113 @cindex unexec 113 @cindex unexec
114 This function dumps the current state of Emacs into an executable file 114 This function dumps the current state of Emacs into an executable file
115 @var{to-file}. It takes symbols from @var{from-file} (this is normally 115 @var{to-file}. It takes symbols from @var{from-file} (this is normally
123 @appendixsec Pure Storage 123 @appendixsec Pure Storage
124 @cindex pure storage 124 @cindex pure storage
125 125
126 Emacs Lisp uses two kinds of storage for user-created Lisp objects: 126 Emacs Lisp uses two kinds of storage for user-created Lisp objects:
127 @dfn{normal storage} and @dfn{pure storage}. Normal storage is where 127 @dfn{normal storage} and @dfn{pure storage}. Normal storage is where
128 all the new data created during an Emacs session is kept; see the 128 all the new data created during an Emacs session are kept; see the
129 following section for information on normal storage. Pure storage is 129 following section for information on normal storage. Pure storage is
130 used for certain data in the preloaded standard Lisp files---data that 130 used for certain data in the preloaded standard Lisp files---data that
131 should never change during actual use of Emacs. 131 should never change during actual use of Emacs.
132 132
133 Pure storage is allocated only while @file{temacs} is loading the 133 Pure storage is allocated only while @file{temacs} is loading the
140 increase the compilation parameter @code{PURESIZE} in the file 140 increase the compilation parameter @code{PURESIZE} in the file
141 @file{src/puresize.h}. This normally won't happen unless you try to 141 @file{src/puresize.h}. This normally won't happen unless you try to
142 preload additional libraries or add features to the standard ones. 142 preload additional libraries or add features to the standard ones.
143 143
144 @defun purecopy object 144 @defun purecopy object
145 This function makes a copy of @var{object} in pure storage and returns 145 This function makes a copy in pure storage of @var{object}, and returns
146 it. It copies strings by simply making a new string with the same 146 it. It copies a string by simply making a new string with the same
147 characters in pure storage. It recursively copies the contents of 147 characters in pure storage. It recursively copies the contents of
148 vectors and cons cells. It does not make copies of other objects such 148 vectors and cons cells. It does not make copies of other objects such
149 as symbols, but just returns them unchanged. It signals an error if 149 as symbols, but just returns them unchanged. It signals an error if
150 asked to copy markers. 150 asked to copy markers.
151 151
551 must declare these explicitly, with type @code{struct gcpro}. Thus, if 551 must declare these explicitly, with type @code{struct gcpro}. Thus, if
552 you use @code{GCPRO2}, you must declare @code{gcpro1} and @code{gcpro2}. 552 you use @code{GCPRO2}, you must declare @code{gcpro1} and @code{gcpro2}.
553 Alas, we can't explain all the tricky details here. 553 Alas, we can't explain all the tricky details here.
554 554
555 You must not use C initializers for static or global variables unless 555 You must not use C initializers for static or global variables unless
556 they are never written once Emacs is dumped. These variables with 556 the variables are never stored in once Emacs is dumped. These variables
557 initializers are allocated in an area of memory that becomes read-only 557 with initializers are allocated in an area of memory that becomes
558 (on certain operating systems) as a result of dumping Emacs. @xref{Pure 558 read-only (on certain operating systems) as a result of dumping Emacs.
559 Storage}. 559 @xref{Pure Storage}.
560 560
561 Do not use static variables within functions---place all static 561 Do not use static variables within functions---place all static
562 variables at top level in the file. This is necessary because Emacs on 562 variables at top level in the file. This is necessary because Emacs on
563 some operating systems defines the keyword @code{static} as a null 563 some operating systems defines the keyword @code{static} as a null
564 macro. (This definition is used because those systems put all variables 564 macro. (This definition is used because those systems put all variables
585 file, add to it a @code{syms_of_@var{filename}} (e.g., 585 file, add to it a @code{syms_of_@var{filename}} (e.g.,
586 @code{syms_of_myfile}). Then find the spot in @file{emacs.c} where all 586 @code{syms_of_myfile}). Then find the spot in @file{emacs.c} where all
587 of these functions are called, and add a call to 587 of these functions are called, and add a call to
588 @code{syms_of_@var{filename}} there. 588 @code{syms_of_@var{filename}} there.
589 589
590 @vindex byte-boolean-vars
590 The function @code{syms_of_@var{filename}} is also the place to define 591 The function @code{syms_of_@var{filename}} is also the place to define
591 any C variables that are to be visible as Lisp variables. 592 any C variables that are to be visible as Lisp variables.
592 @code{DEFVAR_LISP} makes a C variable of type @code{Lisp_Object} visible 593 @code{DEFVAR_LISP} makes a C variable of type @code{Lisp_Object} visible
593 in Lisp. @code{DEFVAR_INT} makes a C variable of type @code{int} 594 in Lisp. @code{DEFVAR_INT} makes a C variable of type @code{int}
594 visible in Lisp with a value that is always an integer. 595 visible in Lisp with a value that is always an integer.
595 @code{DEFVAR_BOOL} makes a C variable of type @code{int} visible in Lisp 596 @code{DEFVAR_BOOL} makes a C variable of type @code{int} visible in Lisp
596 with a value that is either @code{t} or @code{nil}. 597 with a value that is either @code{t} or @code{nil}. Note that variables
598 defined with @code{DEFVAR_BOOL} are automatically added to the list
599 @code{byte-boolean-vars} used by the byte compiler.
597 600
598 If you define a file-scope C variable of type @code{Lisp_Object}, 601 If you define a file-scope C variable of type @code{Lisp_Object},
599 you must protect it for garbage-collection by calling @code{staticpro} 602 you must protect it from garbage-collection by calling @code{staticpro}
600 in @code{syms_of_@var{filename}}, like this: 603 in @code{syms_of_@var{filename}}, like this:
601 604
602 @example 605 @example
603 staticpro (&@var{variable}); 606 staticpro (&@var{variable});
604 @end example 607 @end example
679 682
680 @file{eval.c} is a very good file to look through for examples; 683 @file{eval.c} is a very good file to look through for examples;
681 @file{lisp.h} contains the definitions for some important macros and 684 @file{lisp.h} contains the definitions for some important macros and
682 functions. 685 functions.
683 686
687 If you define a function which is side-effect free, update the code in
688 @file{byte-opt.el} which binds @code{side-effect-free-fns} and
689 @code{side-effect-and-error-free-fns} to include it. This will help the
690 optimizer.
691
684 @node Object Internals 692 @node Object Internals
685 @appendixsec Object Internals 693 @appendixsec Object Internals
686 @cindex object internals 694 @cindex object internals
687 695
688 GNU Emacs Lisp manipulates many different types of data. The actual 696 GNU Emacs Lisp manipulates many different types of data. The actual
727 This field contains the time when the buffer was last saved, as an integer. 735 This field contains the time when the buffer was last saved, as an integer.
728 @xref{Buffer Modification}. 736 @xref{Buffer Modification}.
729 737
730 @item modtime 738 @item modtime
731 This field contains the modification time of the visited file. It is 739 This field contains the modification time of the visited file. It is
732 set when the file is written or read. Every time the buffer is written 740 set when the file is written or read. Before writing the buffer into a
733 to the file, this field is compared to the modification time of the 741 file, this field is compared to the modification time of the file to see
734 file. @xref{Buffer Modification}. 742 if the file has changed on disk. @xref{Buffer Modification}.
735 743
736 @item auto_save_modified 744 @item auto_save_modified
737 This field contains the time when the buffer was last auto-saved. 745 This field contains the time when the buffer was last auto-saved.
738 746
739 @item last_window_start 747 @item last_window_start
870 878
871 @item height 879 @item height
872 The height of the window, measured in lines. 880 The height of the window, measured in lines.
873 881
874 @item width 882 @item width
875 The width of the window, measured in columns. 883 The width of the window, measured in columns. This width includes the
884 scroll bar and fringes, and/or the separator line on the right of the
885 window (if any).
876 886
877 @item next 887 @item next
878 This is the window that is the next in the chain of siblings. It is 888 This is the window that is the next in the chain of siblings. It is
879 @code{nil} in a window that is the rightmost or bottommost of a group of 889 @code{nil} in a window that is the rightmost or bottommost of a group of
880 siblings. 890 siblings.