diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 120 | ||||
-rw-r--r-- | src/alloc.c | 75 | ||||
-rw-r--r-- | src/callproc.c | 2 | ||||
-rw-r--r-- | src/data.c | 6 | ||||
-rw-r--r-- | src/dispnew.c | 6 | ||||
-rw-r--r-- | src/doc.c | 24 | ||||
-rw-r--r-- | src/emacs.c | 11 | ||||
-rw-r--r-- | src/eval.c | 9 | ||||
-rw-r--r-- | src/fileio.c | 10 | ||||
-rw-r--r-- | src/frame.c | 53 | ||||
-rw-r--r-- | src/frame.h | 94 | ||||
-rw-r--r-- | src/keyboard.c | 11 | ||||
-rw-r--r-- | src/keyboard.h | 6 | ||||
-rw-r--r-- | src/lisp.h | 6 | ||||
-rw-r--r-- | src/m/windowsnt.h | 125 | ||||
-rw-r--r-- | src/macfns.c | 2 | ||||
-rw-r--r-- | src/macterm.c | 20 | ||||
-rw-r--r-- | src/macterm.h | 2 | ||||
-rw-r--r-- | src/minibuf.c | 28 | ||||
-rw-r--r-- | src/msdos.h | 1 | ||||
-rw-r--r-- | src/print.c | 39 | ||||
-rw-r--r-- | src/process.c | 2 | ||||
-rw-r--r-- | src/s/ms-w32.h | 5 | ||||
-rw-r--r-- | src/term.c | 1 | ||||
-rw-r--r-- | src/w32.c | 2 | ||||
-rw-r--r-- | src/w32fns.c | 7 | ||||
-rw-r--r-- | src/w32term.c | 1 | ||||
-rw-r--r-- | src/window.c | 12 | ||||
-rw-r--r-- | src/xfns.c | 4 | ||||
-rw-r--r-- | src/xterm.c | 1 | ||||
-rw-r--r-- | src/xterm.h | 1 |
31 files changed, 361 insertions, 325 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index dda5d8e396d..36e6ca3b00d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,121 @@ +2007-10-26 Martin Rudalics <rudalics@gmx.at> + + * window.c (window_min_size_2): Don't count header-line. + +2007-10-26 Dan Nicolaescu <dann@ics.uci.edu> + + * frame.h (struct frame): Move all bit fields after the first bit + field to take advantage of the available space. Group all the + chars together to reduce wasted space due to padding. + +2007-10-26 Juanma Barranquero <lekktu@gmail.com> + + * minibuf.c (Fread_minibuffer, Feval_minibuffer): Reflow docstrings. + + * alloc.c (spare_memory, stack_copy, stack_copy_size, ignore_warnings) + (Vdead, dont_register_blocks, staticvec, staticidx, interval_block) + (n_interval_blocks, init_strings, check_string_bytes, check_sblock) + (init_float, free_float, n_cons_blocks, init_cons, all_vectors) + (n_vectors, symbol_block, symbol_block_index, symbol_free_list) + (n_symbol_blocks, init_symbol, marker_block, marker_free_list) + (n_marker_blocks, init_marker, valid_pointer_p, make_pure_float) + (last_marked, mark_object_loop_halt): Make static. + + * frame.c (syms_of_frame) <delete-frame-functions>: + Fix typo in docstring. + +2007-10-25 Juanma Barranquero <lekktu@gmail.com> + + * w32.c (init_environment): Fix tiny memory leak. + (w32_get_resource): Remove unused variable `ok'. + +2007-10-25 Stefan Monnier <monnier@iro.umontreal.ca> + + Make `window-system' into a keyboard-local variable (rather than + frame-local as done originally by multi-tty). + + * keyboard.h (struct kboard): Add Vwindow_system. + * keyboard.c (init_kboard): Set a default for Vwindow_system. + (mark_kboards): Mark Vwindow_system. + + * dispnew.c (syms_of_display) <window-system>: Declare terminal-local. + (init_display): Don't set the obsolete `window-system' frame-param. + + * xterm.c (x_term_init): + * w32term.c (w32_create_terminal): + * term.c (init_tty): Set Vwindow_system. + * macterm.c (mac_create_terminal): Set a keyboard (missing piece of the + multi-tty merge maybe?), copied from w32term.c. Set Vwindow_system. + + * xfns.c (Fx_create_frame, x_create_tip_frame): + * w32fns.c (Fx_create_frame, x_create_tip_frame): + * macfns.c (Fx_create_frame): + Don't set the obsolete `window-system' frame-param. + + * frame.h (Qwindow_system): Remove. + * frame.c (Qwindow_system): Remove. In `syms_of_frame' as well. + (Fmake_terminal_frame): Don't set obsolete `window-system' frame-param. + +2007-10-24 Richard Stallman <rms@gnu.org> + + * frame.c (x_figure_window_size): For fullscreen case, + set USPosition | PPosition without clobbering rest of window_prompting. + + * keyboard.c (Fcurrent_idle_time): Doc fix. + + * print.c (Fwith_output_to_temp_buffer): Doc fix. + +2007-10-23 Stefan Monnier <monnier@iro.umontreal.ca> + + * process.c (unwind_request_sigio): Only define if __ultrix__. + + * callproc.c (child_setup): Remove spurious *. + + * lisp.h (Fget_text_property): Declare. + (have_menus_p): Declare it here rather than in sys-dep header files. + * macterm.h (have_menus_p): + * msdos.h (have_menus_p): + * xterm.h (have_menus_p): Remove. + + * data.c (Fmake_variable_buffer_local, Fmake_local_variable) + (Fmake_variable_frame_local): Just check the variable's const-ness + rather than checking nil or t. + +2007-10-22 Jason Rumney <jasonr@gnu.org> + + * w32fns.c: Include math.h. + (w32_abort): Declaration moved to nt/config.nt. + + * s/ms-w32.h (HAVE_STDLIB_H): Define. + (abort): Redefinition moved to nt/config.nt. + + * m/windowsnt.h: Remove. + +2007-10-22 Juanma Barranquero <lekktu@gmail.com> + + * emacs.c (Fdump_emacs): Fix typo in message. + (syms_of_emacs) <kill-emacs-hook>: Fix typo in docstring. + <installation-directory>: Reflow docstring. + +2007-10-22 Juri Linkov <juri@jurta.org> + + * minibuf.c: Allow minibuffer default to be a list of default values. + With empty input use the first element of this list as returned default. + (string_to_object) + (read_minibuf_noninteractive): If defalt is cons, set val to its car. + (read_minibuf): If defalt is cons, set histstring to its car. + (Fread_string): If default_value is cons, set val to its car. + (Fread_buffer): If def is cons, use its car. + (Fcompleting_read): If defalt is cons, set val to its car. + +2007-10-21 Michael Albinus <michael.albinus@gmx.de> + + * fileio.c (Fcopy_file): Call file name handler with preserve_uid_gid. + +2007-10-20 Juanma Barranquero <lekktu@gmail.com> + + * doc.c (Fdocumentation): Check for advice in all cases. + 2007-10-19 Chong Yidong <cyd@stupidchicken.com> * Makefile.in [HAVE_LIBRESOLV]: Add -lresolv to linker flags. @@ -1011,7 +1129,7 @@ * term.c (tty_insert_glyphs): Add missing first parameter. -2007-08-29 Karoly Lorentey <karoly@lorentey.hu> +2007-08-29 K,Aa(Broly L$,1 q(Brentey <karoly@lorentey.hu> * buffer.c (Fbuffer_list, Fbury_buffer): Take frame->buried_buffer_list into account. diff --git a/src/alloc.c b/src/alloc.c index 295da59d026..80abe170748 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -241,7 +241,7 @@ static int total_free_floats, total_floats; out of memory. We keep one large block, four cons-blocks, and two string blocks. */ -char *spare_memory[7]; +static char *spare_memory[7]; /* Amount of spare memory to keep in large reserve block. */ @@ -324,13 +324,13 @@ Lisp_Object Vmemory_signal_data; /* Buffer in which we save a copy of the C stack at each GC. */ -char *stack_copy; -int stack_copy_size; +static char *stack_copy; +static int stack_copy_size; /* Non-zero means ignore malloc warnings. Set during initialization. Currently not used. */ -int ignore_warnings; +static int ignore_warnings; Lisp_Object Qgc_cons_threshold, Qchar_table_extra_slots; @@ -397,12 +397,12 @@ void refill_memory_reserve (); /* A unique object in pure space used to make some Lisp objects on free lists recognizable in O(1). */ -Lisp_Object Vdead; +static Lisp_Object Vdead; #ifdef GC_MALLOC_CHECK enum mem_type allocated_mem_type; -int dont_register_blocks; +static int dont_register_blocks; #endif /* GC_MALLOC_CHECK */ @@ -502,12 +502,12 @@ struct gcpro *gcprolist; /* Addresses of staticpro'd variables. Initialize it to a nonzero value; otherwise some compilers put it into BSS. */ -#define NSTATICS 0x600 -Lisp_Object *staticvec[NSTATICS] = {&Vpurify_flag}; +#define NSTATICS 1280 +static Lisp_Object *staticvec[NSTATICS] = {&Vpurify_flag}; /* Index of next unused slot in staticvec. */ -int staticidx = 0; +static int staticidx = 0; static POINTER_TYPE *pure_alloc P_ ((size_t, int)); @@ -1417,7 +1417,7 @@ struct interval_block /* Current interval block. Its `next' pointer points to older blocks. */ -struct interval_block *interval_block; +static struct interval_block *interval_block; /* Index in interval_block above of the next unused interval structure. */ @@ -1434,7 +1434,7 @@ INTERVAL interval_free_list; /* Total number of interval blocks now in use. */ -int n_interval_blocks; +static int n_interval_blocks; /* Initialize interval allocation. */ @@ -1756,7 +1756,7 @@ static char string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] = /* Initialize string allocation. Called from init_alloc_once. */ -void +static void init_strings () { total_strings = total_free_strings = total_string_size = 0; @@ -1773,8 +1773,8 @@ init_strings () static int check_string_bytes_count; -void check_string_bytes P_ ((int)); -void check_sblock P_ ((struct sblock *)); +static void check_string_bytes P_ ((int)); +static void check_sblock P_ ((struct sblock *)); #define CHECK_STRING_BYTES(S) STRING_BYTES (S) @@ -1795,7 +1795,7 @@ string_bytes (s) /* Check validity of Lisp strings' string_bytes member in B. */ -void +static void check_sblock (b) struct sblock *b; { @@ -1829,7 +1829,7 @@ check_sblock (b) non-zero means check all strings, otherwise check only most recently allocated strings. Used for hunting a bug. */ -void +static void check_string_bytes (all_p) int all_p; { @@ -2582,7 +2582,7 @@ struct Lisp_Float *float_free_list; /* Initialize float allocation. */ -void +static void init_float () { float_block = NULL; @@ -2594,7 +2594,7 @@ init_float () /* Explicitly free a float cell by putting it on the free-list. */ -void +static void free_float (ptr) struct Lisp_Float *ptr; { @@ -2701,12 +2701,12 @@ struct Lisp_Cons *cons_free_list; /* Total number of cons blocks now in use. */ -int n_cons_blocks; +static int n_cons_blocks; /* Initialize cons allocation. */ -void +static void init_cons () { cons_block = NULL; @@ -2903,11 +2903,11 @@ DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0, /* Singly-linked list of all vectors. */ -struct Lisp_Vector *all_vectors; +static struct Lisp_Vector *all_vectors; /* Total number of vector-like objects now in use. */ -int n_vectors; +static int n_vectors; /* Value is a pointer to a newly allocated Lisp_Vector structure @@ -3157,21 +3157,21 @@ struct symbol_block /* Current symbol block and index of first unused Lisp_Symbol structure in it. */ -struct symbol_block *symbol_block; -int symbol_block_index; +static struct symbol_block *symbol_block; +static int symbol_block_index; /* List of free symbols. */ -struct Lisp_Symbol *symbol_free_list; +static struct Lisp_Symbol *symbol_free_list; /* Total number of symbol blocks now in use. */ -int n_symbol_blocks; +static int n_symbol_blocks; /* Initialize symbol allocation. */ -void +static void init_symbol () { symbol_block = NULL; @@ -3253,16 +3253,16 @@ struct marker_block struct marker_block *next; }; -struct marker_block *marker_block; -int marker_block_index; +static struct marker_block *marker_block; +static int marker_block_index; -union Lisp_Misc *marker_free_list; +static union Lisp_Misc *marker_free_list; /* Total number of marker blocks now in use. */ -int n_marker_blocks; +static int n_marker_blocks; -void +static void init_marker () { marker_block = NULL; @@ -4559,7 +4559,7 @@ mark_stack () /* Determine whether it is safe to access memory at address P. */ -int +static int valid_pointer_p (p) void *p; { @@ -4855,7 +4855,7 @@ pure_cons (car, cdr) /* Value is a float object with value NUM allocated from pure space. */ -Lisp_Object +static Lisp_Object make_pure_float (num) double num; { @@ -5381,14 +5381,14 @@ mark_image_cache (f) all the references contained in it. */ #define LAST_MARKED_SIZE 500 -Lisp_Object last_marked[LAST_MARKED_SIZE]; +static Lisp_Object last_marked[LAST_MARKED_SIZE]; int last_marked_index; /* For debugging--call abort when we cdr down this many links of a list, in mark_object. In debugging, the call to abort will hit a breakpoint. Normally this is zero and the check never goes off. */ -int mark_object_loop_halt; +static int mark_object_loop_halt; /* Return non-zero if the object was not yet marked. */ static int @@ -5403,7 +5403,7 @@ mark_vectorlike (ptr) VECTOR_MARK (ptr); /* Else mark it */ if (size & PSEUDOVECTOR_FLAG) size &= PSEUDOVECTOR_SIZE_MASK; - + /* Note that this size is not the memory-footprint size, but only the number of Lisp_Object fields that we should trace. The distinction is used e.g. by Lisp_Process which places extra @@ -6251,6 +6251,7 @@ Frames, windows, buffers, and subprocesses count as vectors } int suppress_checking; + void die (msg, file, line) const char *msg; diff --git a/src/callproc.c b/src/callproc.c index 8a8052c0019..567fe3a284d 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -1276,7 +1276,7 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir) while (*p != 0) { while (*q != 0 && strchr (*q, '=') == NULL) - *q++; + q++; *p = *q++; if (*p != 0) p++; diff --git a/src/data.c b/src/data.c index 3139af1e001..e02e22aa0e3 100644 --- a/src/data.c +++ b/src/data.c @@ -1521,7 +1521,7 @@ The function `default-value' gets the default value and `set-default' sets it. variable = indirect_variable (variable); valcontents = SYMBOL_VALUE (variable); - if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) + if (XSYMBOL (variable)->constant || KBOARD_OBJFWDP (valcontents)) error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); if (BUFFER_OBJFWDP (valcontents)) @@ -1578,7 +1578,7 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) variable = indirect_variable (variable); valcontents = SYMBOL_VALUE (variable); - if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) + if (XSYMBOL (variable)->constant || KBOARD_OBJFWDP (valcontents)) error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); if ((BUFFER_LOCAL_VALUEP (valcontents) @@ -1733,7 +1733,7 @@ Buffer-local bindings take precedence over frame-local bindings. */) variable = indirect_variable (variable); valcontents = SYMBOL_VALUE (variable); - if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents) + if (XSYMBOL (variable)->constant || KBOARD_OBJFWDP (valcontents) || BUFFER_OBJFWDP (valcontents)) error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable))); diff --git a/src/dispnew.c b/src/dispnew.c index 79bb81abfeb..fcf54652115 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -6956,7 +6956,6 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\ (*initial_terminal->delete_terminal_hook) (initial_terminal); /* Update frame parameters to reflect the new type. */ - Fmodify_frame_parameters (selected_frame, Fcons (Fcons (Qwindow_system, Qnil), Qnil)); Fmodify_frame_parameters (selected_frame, Fcons (Fcons (Qtty_type, Ftty_type (selected_frame)), Qnil)); @@ -7106,6 +7105,11 @@ It is up to you to set this variable if your terminal can do that. */); The value is a symbol--for instance, `x' for X windows. The value is nil if Emacs is using a text-only terminal. */); + DEFVAR_KBOARD ("window-system", Vwindow_system, + doc: /* Name of window system through which the selected frame is displayed. +The value is a symbol--for instance, `x' for X windows. +The value is nil if the selected frame is on a text-only-terminal. */); + DEFVAR_LISP ("window-system-version", &Vwindow_system_version, doc: /* The version number of the window system in use. For X windows, this is 10 or 11. */); diff --git a/src/doc.c b/src/doc.c index dd7f4ae0eb9..5dc30a01053 100644 --- a/src/doc.c +++ b/src/doc.c @@ -434,18 +434,6 @@ string is passed through `substitute-command-keys'. */) doc = tem; else return Qnil; - - /* Check for an advised function. Its doc string - has an `ad-advice-info' text property. */ - if (STRINGP (doc)) - { - Lisp_Object innerfunc; - innerfunc = Fget_text_property (make_number (0), - intern ("ad-advice-info"), - doc); - if (! NILP (innerfunc)) - doc = call1 (intern ("ad-make-advised-docstring"), innerfunc); - } } else if (EQ (funcar, Qmacro)) return Fdocumentation (Fcdr (fun), raw); @@ -458,6 +446,18 @@ string is passed through `substitute-command-keys'. */) xsignal1 (Qinvalid_function, fun); } + /* Check for an advised function. Its doc string + has an `ad-advice-info' text property. */ + if (STRINGP (doc)) + { + Lisp_Object innerfunc; + innerfunc = Fget_text_property (make_number (0), + intern ("ad-advice-info"), + doc); + if (! NILP (innerfunc)) + doc = call1 (intern ("ad-make-advised-docstring"), innerfunc); + } + /* If DOC is 0, it's typically because of a dumped file missing from the DOC file (bug in src/Makefile.in). */ if (EQ (doc, make_number (0))) diff --git a/src/emacs.c b/src/emacs.c index 94357bb69ce..db442c219a4 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2260,10 +2260,10 @@ You must run Emacs in batch mode in order to dump it. */) { fprintf (stderr, "**************************************************\n"); fprintf (stderr, "Warning: Your system has a gap between BSS and the\n"); - fprintf (stderr, "heap (%lu byte). This usually means that exec-shield\n", + fprintf (stderr, "heap (%lu bytes). This usually means that exec-shield\n", heap_bss_diff); fprintf (stderr, "or something similar is in effect. The dump may\n"); - fprintf (stderr, "fail because of this. See the section about \n"); + fprintf (stderr, "fail because of this. See the section about\n"); fprintf (stderr, "exec-shield in etc/PROBLEMS for more information.\n"); fprintf (stderr, "**************************************************\n"); } @@ -2506,7 +2506,7 @@ Emacs is running. */); doc: /* Non-nil means Emacs is running without interactive terminal. */); DEFVAR_LISP ("kill-emacs-hook", &Vkill_emacs_hook, - doc: /* Hook to be run when kill-emacs is called. + doc: /* Hook to be run when `kill-emacs' is called. Since `kill-emacs' may be invoked when the terminal is disconnected (or in other similar situations), functions placed on this hook should not expect to be able to interact with the user. To ask for confirmation, @@ -2542,9 +2542,8 @@ The value is nil if that directory's name is not known. */); DEFVAR_LISP ("installation-directory", &Vinstallation_directory, doc: /* A directory within which to look for the `lib-src' and `etc' directories. -This is non-nil when we can't find those directories in their standard -installed locations, but we can find them -near where the Emacs executable was found. */); +This is non-nil when we can't find those directories in their standard installed +locations, but we can find them near where the Emacs executable was found. */); Vinstallation_directory = Qnil; DEFVAR_LISP ("system-messages-locale", &Vsystem_messages_locale, diff --git a/src/eval.c b/src/eval.c index eaa1a6855f6..7f5f58a2e81 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2194,7 +2194,14 @@ do_autoload (fundef, funname) /* Preserve the match data. */ record_unwind_save_match_data (); - /* Value saved here is to be restored into Vautoload_queue. */ + /* If autoloading gets an error (which includes the error of failing + to define the function being called), we use Vautoload_queue + to undo function definitions and `provide' calls made by + the function. We do this in the specific case of autoloading + because autoloading is not an explicit request "load this file", + but rather a request to "call this function". + + The value saved here is to be restored into Vautoload_queue. */ record_unwind_protect (un_autoload, Vautoload_queue); Vautoload_queue = Qt; Fload (Fcar (Fcdr (fundef)), Qnil, Qt, Qnil, Qt); diff --git a/src/fileio.c b/src/fileio.c index 8b6f5ef1a84..8155a6e981f 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2470,8 +2470,8 @@ uid and gid of FILE to NEWNAME. */) if (NILP (handler)) handler = Ffind_file_name_handler (newname, Qcopy_file); if (!NILP (handler)) - RETURN_UNGCPRO (call5 (handler, Qcopy_file, file, newname, - ok_if_already_exists, keep_time)); + RETURN_UNGCPRO (call6 (handler, Qcopy_file, file, newname, + ok_if_already_exists, keep_time, preserve_uid_gid)); encoded_file = ENCODE_FILE (file); encoded_newname = ENCODE_FILE (newname); @@ -4715,8 +4715,8 @@ variable `last-coding-system-used' to the coding system actually used. */) int opoint_byte = PT_BYTE; int oinserted = ZV - BEGV; int ochars_modiff = CHARS_MODIFF; - - TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); + + TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); insval = call3 (Qformat_decode, Qnil, make_number (oinserted), visit); CHECK_NUMBER (insval); @@ -4752,7 +4752,7 @@ variable `last-coding-system-used' to the coding system actually used. */) int opoint_byte = PT_BYTE; int oinserted = ZV - BEGV; int ochars_modiff = CHARS_MODIFF; - + TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); insval = call1 (XCAR (p), make_number (oinserted)); if (!NILP (insval)) diff --git a/src/frame.c b/src/frame.c index 5c89c96a239..eecc6878c55 100644 --- a/src/frame.c +++ b/src/frame.c @@ -114,7 +114,6 @@ Lisp_Object Qleft_fringe, Qright_fringe; Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list; Lisp_Object Qtty_color_mode; Lisp_Object Qtty, Qtty_type; -Lisp_Object Qwindow_system; Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth; #ifdef USE_FONT_BACKEND @@ -268,7 +267,7 @@ FRAME defaults to the currently selected frame. */) return Qnil; else return type; -} +} struct frame * make_frame (mini_p) @@ -530,6 +529,7 @@ make_initial_frame (void) { initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); init_kboard (initial_kboard); + /* Leave Vwindow_system at its `t' default for now. */ initial_kboard->next_kboard = all_kboards; all_kboards = initial_kboard; } @@ -556,10 +556,10 @@ make_initial_frame (void) f->terminal = terminal; f->terminal->reference_count++; f->output_data.nothing = 0; - + FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR; FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR; - + FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; @@ -621,10 +621,10 @@ make_terminal_frame (struct terminal *terminal) f->terminal = terminal; f->terminal->reference_count++; create_tty_output (f); - + FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR; FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR; - + FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; @@ -632,10 +632,10 @@ make_terminal_frame (struct terminal *terminal) if (FRAMEP (FRAME_TTY (f)->top_frame) && FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame))) XFRAME (FRAME_TTY (f)->top_frame)->async_visible = 2; /* obscured */ - + FRAME_TTY (f)->top_frame = frame; } - + #ifdef CANNOT_DUMP FRAME_FOREGROUND_PIXEL(f) = FACE_TTY_DEFAULT_FG_COLOR; FRAME_BACKGROUND_PIXEL(f) = FACE_TTY_DEFAULT_BG_COLOR; @@ -719,7 +719,7 @@ affects all frames on the same terminal device. */) #endif #endif #endif /* not MSDOS */ - + { Lisp_Object terminal; @@ -730,9 +730,9 @@ affects all frames on the same terminal device. */) t = get_terminal (terminal, 1); } } - + if (!t) - { + { char *name = 0, *type = 0; Lisp_Object tty, tty_type; @@ -746,7 +746,7 @@ affects all frames on the same terminal device. */) strncpy (name, SDATA (tty), SBYTES (tty)); name[SBYTES (tty)] = 0; } - + tty_type = get_future_frame_param (Qtty_type, parms, (FRAME_TERMCAP_P (XFRAME (selected_frame)) ? FRAME_TTY (XFRAME (selected_frame))->type @@ -768,13 +768,12 @@ affects all frames on the same terminal device. */) get_tty_size (fileno (FRAME_TTY (f)->input), &width, &height); change_frame_size (f, height, width, 0, 0, 0); } - + adjust_glyphs (f); calculate_costs (f); XSETFRAME (frame, f); Fmodify_frame_parameters (frame, Vdefault_frame_alist); Fmodify_frame_parameters (frame, parms); - Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qnil), Qnil)); Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty_type, build_string (t->display_info.tty->type)), Qnil)); @@ -784,7 +783,7 @@ affects all frames on the same terminal device. */) Qnil)); else Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty, Qnil), Qnil)); - + /* Make the frame face alist be frame-specific, so that each frame could change its face definitions independently. */ f->face_alist = Fcopy_alist (sf->face_alist); @@ -1530,7 +1529,7 @@ The functions are run with one arg, the frame to be deleted. */) { struct terminal *terminal = FRAME_TERMINAL (f); - f->output_data.nothing = 0; + f->output_data.nothing = 0; f->terminal = 0; /* Now the frame is dead. */ /* If needed, delete the terminal that this frame was on. @@ -2037,7 +2036,7 @@ doesn't support multiple overlapping frames, this function does nothing. */) CHECK_LIVE_FRAME (frame); f = XFRAME (frame); - + /* Do like the documentation says. */ Fmake_frame_visible (frame); @@ -2057,14 +2056,14 @@ doesn't support multiple overlapping frames, this function does nothing. */) Lisp_Object frame; { struct frame *f; - + if (NILP (frame)) frame = selected_frame; CHECK_LIVE_FRAME (frame); f = XFRAME (frame); - + if (FRAME_TERMINAL (f)->frame_raise_lower_hook) (*FRAME_TERMINAL (f)->frame_raise_lower_hook) (f, 0); @@ -2101,7 +2100,7 @@ The redirection lasts until `redirect-frame-focus' is called to change it. */) Lisp_Object frame, focus_frame; { struct frame *f; - + /* Note that we don't check for a live frame here. It's reasonable to redirect the focus of a frame you're about to delete, if you know what other frame should receive those keystrokes. */ @@ -2111,7 +2110,7 @@ The redirection lasts until `redirect-frame-focus' is called to change it. */) CHECK_LIVE_FRAME (focus_frame); f = XFRAME (frame); - + f->focus_frame = focus_frame; if (FRAME_TERMINAL (f)->frame_rehighlight_hook) @@ -3303,7 +3302,7 @@ x_set_fullscreen (f, new_value, old_value) else if (EQ (new_value, Qfullheight)) f->want_fullscreen = FULLSCREEN_HEIGHT; - if (FRAME_TERMINAL (f)->fullscreen_hook != NULL) + if (FRAME_TERMINAL (f)->fullscreen_hook != NULL) FRAME_TERMINAL (f)->fullscreen_hook (f); } @@ -4291,7 +4290,7 @@ x_figure_window_size (f, parms, toolbar_p) int width, height; /* It takes both for some WM:s to place it where we want */ - window_prompting = USPosition | PPosition; + window_prompting |= USPosition | PPosition; x_fullscreen_adjust (f, &width, &height, &top, &left); FRAME_COLS (f) = width; FRAME_LINES (f) = height; @@ -4400,8 +4399,6 @@ syms_of_frame () staticpro (&Qtty); Qtty_type = intern ("tty-type"); staticpro (&Qtty_type); - Qwindow_system = intern ("window-system"); - staticpro (&Qwindow_system); Qface_set_after_frame_default = intern ("face-set-after-frame-default"); staticpro (&Qface_set_after_frame_default); @@ -4426,7 +4423,7 @@ syms_of_frame () staticpro (&Qterminal); Qterminal_live_p = intern ("terminal-live-p"); staticpro (&Qterminal_live_p); - + { int i; @@ -4528,7 +4525,7 @@ Note that functions in this list may be called twice on the same frame. In the second invocation, the frame is already deleted, and the function should do nothing. (You can use `frame-live-p' to check for this.) This wrinkle happens when an earlier function in -`delete-frame-functions' (indirectly) calls delete-frame +`delete-frame-functions' (indirectly) calls `delete-frame' recursively. */); Vdelete_frame_functions = Qnil; @@ -4561,7 +4558,7 @@ automatically. */); #else focus_follows_mouse = 0; #endif - + staticpro (&Vframe_list); defsubr (&Sactive_minibuffer_window); diff --git a/src/frame.h b/src/frame.h index e9be84d8558..7761b7520a3 100644 --- a/src/frame.h +++ b/src/frame.h @@ -206,6 +206,30 @@ struct frame be used for output. */ unsigned glyphs_initialized_p : 1; + /* Set to non-zero in change_frame_size when size of frame changed + Clear the frame in clear_garbaged_frames if set. */ + unsigned resized_p : 1; + + /* Set to non-zero in when we want for force a flush_display in + update_frame, usually after resizing the frame. */ + unsigned force_flush_display_p : 1; + + /* Set to non-zero if the default face for the frame has been + realized. Reset to zero whenever the default face changes. + Used to see the difference between a font change and face change. */ + unsigned default_face_done_p : 1; + + /* Set to non-zero if this frame has already been hscrolled during + current redisplay. */ + unsigned already_hscrolled_p : 1; + + /* Set to non-zero when current redisplay has updated frame. */ + unsigned updated_p : 1; + + /* Set to non-zero to minimize tool-bar height even when + auto-resize-tool-bar is set to grow-only. */ + unsigned minimize_tool_bar_window_p : 1; + #if defined (USE_GTK) || defined (MAC_OS) /* Nonzero means using a tool bar that comes from the toolkit. */ int external_tool_bar; @@ -380,24 +404,6 @@ struct frame support scroll bars. */ char can_have_scroll_bars; - /* If can_have_scroll_bars is non-zero, this is non-zero if we should - actually display them on this frame. */ - enum vertical_scroll_bar_type vertical_scroll_bar_type; - - /* What kind of text cursor should we draw in the future? - This should always be filled_box_cursor or bar_cursor. */ - enum text_cursor_kinds desired_cursor; - - /* Width of bar cursor (if we are using that). */ - int cursor_width; - - /* What kind of text cursor should we draw when the cursor blinks off? - This can be filled_box_cursor or bar_cursor or no_cursor. */ - enum text_cursor_kinds blink_off_cursor; - - /* Width of bar cursor (if we are using that) for blink-off state. */ - int blink_off_cursor_width; - /* Non-0 means raise this frame to the top of the heap when selected. */ char auto_raise; @@ -416,6 +422,28 @@ struct frame /* Nonzero if size of some window on this frame has changed. */ char window_sizes_changed; + /* Nonzero if the mouse has moved on this display device + since the last time we checked. */ + char mouse_moved; + + /* If can_have_scroll_bars is non-zero, this is non-zero if we should + actually display them on this frame. */ + enum vertical_scroll_bar_type vertical_scroll_bar_type; + + /* What kind of text cursor should we draw in the future? + This should always be filled_box_cursor or bar_cursor. */ + enum text_cursor_kinds desired_cursor; + + /* Width of bar cursor (if we are using that). */ + int cursor_width; + + /* What kind of text cursor should we draw when the cursor blinks off? + This can be filled_box_cursor or bar_cursor or no_cursor. */ + enum text_cursor_kinds blink_off_cursor; + + /* Width of bar cursor (if we are using that) for blink-off state. */ + int blink_off_cursor_width; + /* Storage for messages to this frame. */ char *message_buf; @@ -438,10 +466,6 @@ struct frame /* The baud rate that was used to calculate costs for this frame. */ int cost_calculation_baud_rate; - /* Nonzero if the mouse has moved on this display device - since the last time we checked. */ - char mouse_moved; - /* Exponent for gamma correction of colors. 1/(VIEWING_GAMMA * SCREEN_GAMMA) where viewing_gamma is 0.4545 and SCREEN_GAMMA is a frame parameter. 0 means don't do gamma correction. */ @@ -450,33 +474,9 @@ struct frame /* Additional space to put between text lines on this frame. */ int extra_line_spacing; - /* Set to non-zero in change_frame_size when size of frame changed - Clear the frame in clear_garbaged_frames if set. */ - unsigned resized_p : 1; - - /* Set to non-zero in when we want for force a flush_display in - update_frame, usually after resizing the frame. */ - unsigned force_flush_display_p : 1; - /* All display backends seem to need these two pixel values. */ unsigned long background_pixel; unsigned long foreground_pixel; - - /* Set to non-zero if the default face for the frame has been - realized. Reset to zero whenever the default face changes. - Used to see the difference between a font change and face change. */ - unsigned default_face_done_p : 1; - - /* Set to non-zero if this frame has already been hscrolled during - current redisplay. */ - unsigned already_hscrolled_p : 1; - - /* Set to non-zero when current redisplay has updated frame. */ - unsigned updated_p : 1; - - /* Set to non-zero to minimize tool-bar height even when - auto-resize-tool-bar is set to grow-only. */ - unsigned minimize_tool_bar_window_p : 1; }; #ifdef MULTI_KBOARD @@ -1033,8 +1033,6 @@ extern Lisp_Object Qx_resource_name; extern Lisp_Object Qleft, Qright, Qtop, Qbox; extern Lisp_Object Qdisplay; -extern Lisp_Object Qwindow_system; - #ifdef HAVE_WINDOW_SYSTEM /* The class of this X application. */ diff --git a/src/keyboard.c b/src/keyboard.c index 2002aded95d..426ea34e3a4 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4716,12 +4716,14 @@ timer_check (do_it_now) } DEFUN ("current-idle-time", Fcurrent_idle_time, Scurrent_idle_time, 0, 0, 0, - doc: /* Return the current length of Emacs idleness. -The value is returned as a list of three integers. The first has the + doc: /* Return the current length of Emacs idleness, or nil. +The value when Emacs is idle is a list of three integers. The first has the most significant 16 bits of the seconds, while the second has the least significant 16 bits. The third integer gives the microsecond count. +The value when Emacs is not idle is nil. + The microsecond count is zero on systems that do not provide resolution finer than a second. */) () @@ -9186,7 +9188,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, from_string = Qnil; /* The multi-tty merge moved the code below to right after - `replay_sequence' which caused alll these translation maps to be applied + `replay_sequence' which caused all these translation maps to be applied repeatedly, even tho their doc says very clearly they are not applied to their own output. The reason for this move was: "We may switch keyboards between rescans, @@ -11488,6 +11490,7 @@ init_kboard (kb) kb->reference_count = 0; kb->Vsystem_key_alist = Qnil; kb->system_key_syms = Qnil; + kb->Vwindow_system = Qt; /* Unset. */ kb->Vinput_decode_map = Fmake_sparse_keymap (Qnil); kb->Vlocal_function_key_map = Fmake_sparse_keymap (Qnil); Fset_keymap_parent (kb->Vlocal_function_key_map, Vfunction_key_map); @@ -11570,6 +11573,7 @@ init_keyboard () #endif wipe_kboard (current_kboard); init_kboard (current_kboard); + /* Leave Vwindow_system at its `t' default for now. */ if (!noninteractive) { @@ -12465,6 +12469,7 @@ mark_kboards () mark_object (kb->Vlast_kbd_macro); mark_object (kb->Vsystem_key_alist); mark_object (kb->system_key_syms); + mark_object (kb->Vwindow_system); mark_object (kb->Vinput_decode_map); mark_object (kb->Vlocal_function_key_map); mark_object (kb->Vdefault_minibuffer_frame); diff --git a/src/keyboard.h b/src/keyboard.h index ae135b30b77..6d046bc98e7 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -80,8 +80,7 @@ struct kboard commands that set the prefix argument. */ Lisp_Object Vlast_command; - /* Normally same as last-command, but never modified by - other commands. */ + /* Normally same as last-command, but never modified by other commands. */ Lisp_Object Vreal_last_command; /* User-supplied table to translate input characters through. */ @@ -130,6 +129,9 @@ struct kboard /* Cache for modify_event_symbol. */ Lisp_Object system_key_syms; + /* The kind of display: x, w32, ... */ + Lisp_Object Vwindow_system; + /* Keymap mapping keys to alternative preferred forms. See the DEFVAR for more documentation. */ Lisp_Object Vlocal_function_key_map; diff --git a/src/lisp.h b/src/lisp.h index 8a0b13a72a1..62c629bd4a8 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3159,6 +3159,7 @@ EXFUN (Fnext_single_char_property_change, 4); EXFUN (Fprevious_single_property_change, 4); EXFUN (Fget_text_property, 3); EXFUN (Fput_text_property, 5); +EXFUN (Fget_text_property, 3); EXFUN (Fprevious_char_property_change, 2); EXFUN (Fnext_char_property_change, 2); extern void report_interval_modification P_ ((Lisp_Object, Lisp_Object)); @@ -3294,6 +3295,11 @@ extern void syms_of_mac P_ ((void)); extern void init_mac_osx_environment P_ ((void)); #endif /* MAC_OSX */ #endif /* MAC_OS */ + +#ifdef HAVE_MENUS +/* Defined in (x|mac|w32)fns.c... */ +extern int have_menus_p P_ ((void)); +#endif /* Nonzero means Emacs has already been initialized. Used during startup to detect startup of dumped Emacs. */ diff --git a/src/m/windowsnt.h b/src/m/windowsnt.h deleted file mode 100644 index ddad551c772..00000000000 --- a/src/m/windowsnt.h +++ /dev/null @@ -1,125 +0,0 @@ -/* Machine description file for Windows NT. - - Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, - 2005, 2006, 2007 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3, or (at your option) -any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ - -/* The following line tells the configuration script what sort of - operating system this machine is likely to run. - USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */ - -/* Define BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ - -/* #define BIG_ENDIAN */ - -/* Define NO_ARG_ARRAY if you cannot take the address of the first of a - * group of arguments and treat it as an array of the arguments. */ - -#define NO_ARG_ARRAY - -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -#define WORD_MACHINE - -/* Now define a symbol for the cpu type, if your compiler - does not define it automatically: - Ones defined so far include vax, m68000, ns16000, pyramid, - orion, tahoe, APOLLO and many others */ - -/* Use type int rather than a union, to represent Lisp_Object */ -/* This is desirable for most machines. */ - -#define NO_UNION_TYPE - -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the 24-bit bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - -/* Data type of load average, as read out of kmem. */ - -#define LOAD_AVE_TYPE long - -/* Convert that into an integer that is 100 for a load average of 1.0 */ - -#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) - -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* -#define CANNOT_DUMP 1 -#define CANNOT_UNEXEC 1 - */ - -/* Start and end of text and data. */ -#define DATA_END get_data_end () -#define DATA_START get_data_start () - -/* Define VIRT_ADDR_VARIES if the virtual addresses of - pure and impure space as loaded can vary, and even their - relative order cannot be relied on. - - Otherwise Emacs assumes that text space precedes data space, - numerically. */ - -/* Text does precede data space, but this is never a safe assumption. */ -#define VIRT_ADDR_VARIES - -/* For alloca. */ -#include <malloc.h> - -/* Define NO_REMAP if memory segmentation makes it not work well - to change the boundary between the text section and data section - when Emacs is dumped. If you define this, the preloaded Lisp - code will not be sharable; but that's better than failing completely. */ - -/* #define NO_REMAP */ - -/* Some really obscure 4.2-based systems (like Sequent DYNIX) - * do not support asynchronous I/O (using SIGIO) on sockets, - * even though it works fine on tty's. If you have one of - * these systems, define the following, and then use it in - * config.h (or elsewhere) to decide when (not) to use SIGIO. - * - * You'd think this would go in an operating-system description file, - * but since it only occurs on some, but not all, BSD systems, the - * reasonable place to select for it is in the machine description - * file. - */ - -/* #define NO_SOCK_SIGIO */ - -/* After adding support for a new system, modify the large case - statement in the `configure' script to recognize reasonable - configuration names, and add a description of the system to - `etc/MACHINES'. - - If you've just fixed a problem in an existing configuration file, - you should also check `etc/MACHINES' to make sure its descriptions - of known problems in that configuration should be updated. */ - -/* arch-tag: ed6dc0c1-5c01-49df-befd-c25dfadfb8cf - (do not change this comment) */ diff --git a/src/macfns.c b/src/macfns.c index 708fe576f17..0f40127637a 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -2830,8 +2830,6 @@ This function is an internal primitive--use `make-frame' instead. */) if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) f->param_alist = Fcons (XCAR (tem), f->param_alist); - store_frame_param (f, Qwindow_system, Qmac); - UNGCPRO; /* Make sure windows on this frame appear in calls to next-window diff --git a/src/macterm.c b/src/macterm.c index 3c01a6618a2..7f837d2a20d 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -12842,6 +12842,26 @@ mac_create_terminal (struct mac_display_info *dpyinfo) #endif + /* FIXME: This keyboard setup is 100% untested, just copied from + w32_create_terminal in order to set window-system now that it's + a keyboard object. */ +#ifdef MULTI_KBOARD + /* We don't yet support separate terminals on Mac, so don't try to share + keyboards between virtual terminals that are on the same physical + terminal like X does. */ + terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); + init_kboard (terminal->kboard); + terminal->kboard->Vwindow_system = intern ("mac"); + terminal->kboard->next_kboard = all_kboards; + all_kboards = terminal->kboard; + /* Don't let the initial kboard remain current longer than necessary. + That would cause problems if a file loaded on startup tries to + prompt in the mini-buffer. */ + if (current_kboard == initial_kboard) + current_kboard = terminal->kboard; + terminal->kboard->reference_count++; +#endif + return terminal; } diff --git a/src/macterm.h b/src/macterm.h index f319adeb659..9fbbbc5a2f5 100644 --- a/src/macterm.h +++ b/src/macterm.h @@ -680,8 +680,6 @@ extern void x_clear_frame_selections P_ ((struct frame *)); /* Defined in macfns.c */ -extern int have_menus_p P_ ((void)); - extern void x_real_positions P_ ((struct frame *, int *, int *)); extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); extern int x_pixel_width P_ ((struct frame *)); diff --git a/src/minibuf.c b/src/minibuf.c index 340f6dae319..812956a13ca 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -257,9 +257,13 @@ string_to_object (val, defalt) GCPRO2 (val, defalt); - if (STRINGP (val) && SCHARS (val) == 0 - && STRINGP (defalt)) - val = defalt; + if (STRINGP (val) && SCHARS (val) == 0) + { + if (STRINGP (defalt)) + val = defalt; + else if (CONSP (defalt) && STRINGP (XCAR (defalt))) + val = XCAR (defalt); + } expr_and_pos = Fread_from_string (val, Qnil, Qnil); pos = XINT (Fcdr (expr_and_pos)); @@ -337,7 +341,7 @@ read_minibuf_noninteractive (map, initial, prompt, backup_n, expflag, /* If Lisp form desired instead of string, parse it. */ if (expflag) - val = string_to_object (val, defalt); + val = string_to_object (val, CONSP (defalt) ? XCAR (defalt) : defalt); return val; } @@ -785,6 +789,8 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histstring = val; else if (STRINGP (defalt)) histstring = defalt; + else if (CONSP (defalt) && STRINGP (XCAR (defalt))) + histstring = XCAR (defalt); else histstring = Qnil; @@ -1052,8 +1058,8 @@ DEFUN ("read-minibuffer", Fread_minibuffer, Sread_minibuffer, 1, 2, 0, doc: /* Return a Lisp object read using the minibuffer, unevaluated. Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS is a string to insert in the minibuffer before reading. -\(INITIAL-CONTENTS can also be a cons of a string and an integer. Such -arguments are used as in `read-from-minibuffer'.) */) +\(INITIAL-CONTENTS can also be a cons of a string and an integer. +Such arguments are used as in `read-from-minibuffer'.) */) (prompt, initial_contents) Lisp_Object prompt, initial_contents; { @@ -1067,8 +1073,8 @@ DEFUN ("eval-minibuffer", Feval_minibuffer, Seval_minibuffer, 1, 2, 0, doc: /* Return value of Lisp expression read using the minibuffer. Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS is a string to insert in the minibuffer before reading. -\(INITIAL-CONTENTS can also be a cons of a string and an integer. Such -arguments are used as in `read-from-minibuffer'.) */) +\(INITIAL-CONTENTS can also be a cons of a string and an integer. +Such arguments are used as in `read-from-minibuffer'.) */) (prompt, initial_contents) Lisp_Object prompt, initial_contents; { @@ -1102,7 +1108,7 @@ Fifth arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits Qnil, history, default_value, inherit_input_method); if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (default_value)) - val = default_value; + val = CONSP (default_value) ? XCAR (default_value) : default_value; return val; } @@ -1225,7 +1231,7 @@ The argument PROMPT should be a string ending with a colon and a space. */) args[0] = build_string ("%s (default %s): "); args[1] = prompt; - args[2] = def; + args[2] = CONSP (def) ? XCAR (def) : def; prompt = Fformat (3, args); } @@ -1835,7 +1841,7 @@ Completion ignores case if the ambient value of !NILP (inherit_input_method)); if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (def)) - val = def; + val = CONSP (def) ? XCAR (def) : def; RETURN_UNGCPRO (unbind_to (count, val)); } diff --git a/src/msdos.h b/src/msdos.h index c45a5853a6c..a9379efb75d 100644 --- a/src/msdos.h +++ b/src/msdos.h @@ -115,7 +115,6 @@ struct window; /* Defined in xfns.c; emulated on msdos.c */ -extern int have_menus_p P_ ((void)); extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); extern int x_pixel_width P_ ((struct frame *)); extern int x_pixel_height P_ ((struct frame *)); diff --git a/src/print.c b/src/print.c index c23e020eb8d..c6304bbd24e 100644 --- a/src/print.c +++ b/src/print.c @@ -675,21 +675,30 @@ DEFUN ("with-output-to-temp-buffer", Fwith_output_to_temp_buffer, Swith_output_to_temp_buffer, 1, UNEVALLED, 0, doc: /* Bind `standard-output' to buffer BUFNAME, eval BODY, then show that buffer. -The buffer is cleared out initially, and marked as unmodified when done. -All output done by BODY is inserted in that buffer by default. -The buffer is displayed in another window, but not selected. -The value of the last form in BODY is returned. -If BODY does not finish normally, the buffer BUFNAME is not displayed. - -The hook `temp-buffer-setup-hook' is run before BODY, -with the buffer BUFNAME temporarily current. -The hook `temp-buffer-show-hook' is run after the buffer is displayed, -with the buffer temporarily current, and the window that was used -to display it temporarily selected. - -If variable `temp-buffer-show-function' is non-nil, call it at the end -to get the buffer displayed instead of just displaying the non-selected -buffer and calling the hook. It gets one argument, the buffer to display. + +This construct makes buffer BUFNAME empty before running BODY. +It does not make the buffer current for BODY. +Instead it binds `standard-output' to that buffer, so that output +generated with `prin1' and similar functions in BODY goes into +the buffer. + +At the end of BODY, this marks buffer BUFNAME unmodifed and displays +it in a window, but does not select it. The normal way to do this is +by calling `display-buffer', then running `temp-buffer-show-hook'. +However, if `temp-buffer-show-function' is non-nil, it calls that +function instead (and does not run `temp-buffer-show-hook'). The +function gets one argument, the buffer to display. + +The return value of `with-output-to-temp-buffer' is the value of the +last form in BODY. If BODY does not finish normally, the buffer +BUFNAME is not displayed. + +This runs the hook `temp-buffer-setup-hook' before BODY, +with the buffer BUFNAME temporarily current. It runs the hook +`temp-buffer-show-hook' after displaying buffer BUFNAME, with that +buffer temporarily current, and the window that was used to display it +temporarily selected. But it doesn't run `temp-buffer-show-hook' +if it uses `temp-buffer-show-function'. usage: (with-output-to-temp-buffer BUFNAME BODY...) */) (args) diff --git a/src/process.c b/src/process.c index fb10bf2cc8b..d80d7db2554 100644 --- a/src/process.c +++ b/src/process.c @@ -2682,6 +2682,7 @@ OPTION is not a supported option, return nil instead; otherwise return t. */) /* A version of request_sigio suitable for a record_unwind_protect. */ +#ifdef __ultrix__ static Lisp_Object unwind_request_sigio (dummy) Lisp_Object dummy; @@ -2690,6 +2691,7 @@ unwind_request_sigio (dummy) request_sigio (); return Qnil; } +#endif /* Create a network stream/datagram client/server process. Treated exactly like a normal process when reading and writing. Primary diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index 5a297a4ee80..56a09f9b315 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h @@ -241,6 +241,7 @@ Boston, MA 02110-1301, USA. */ #undef HAVE_TERMIOS_H #define HAVE_LIMITS_H 1 #define HAVE_STRING_H 1 +#define HAVE_STDLIB_H 1 #define HAVE_PWD_H 1 #define STDC_HEADERS 1 #define TIME_WITH_SYS_TIME 1 @@ -401,10 +402,6 @@ typedef int pid_t; #define utime _utime #endif -#ifdef HAVE_NTGUI -#define abort w32_abort -#endif - /* this is hacky, but is necessary to avoid warnings about macro redefinitions using the SDK compilers */ #ifndef __STDC__ diff --git a/src/term.c b/src/term.c index fca99bc6c75..bb7c139eafd 100644 --- a/src/term.c +++ b/src/term.c @@ -3599,6 +3599,7 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", #ifdef MULTI_KBOARD terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); init_kboard (terminal->kboard); + terminal->kboard->Vwindow_system = Qnil; terminal->kboard->next_kboard = all_kboards; all_kboards = terminal->kboard; terminal->kboard->reference_count++; diff --git a/src/w32.c b/src/w32.c index 500e85733b2..d9d11c3094a 100644 --- a/src/w32.c +++ b/src/w32.c @@ -914,7 +914,6 @@ w32_get_resource (key, lpdwtype) LPBYTE lpvalue; HKEY hrootkey = NULL; DWORD cbData; - BOOL ok = FALSE; /* Check both the current user and the local machine to see if we have any resources. */ @@ -1149,6 +1148,7 @@ init_environment (char ** argv) /* Also ignore empty environment variables. */ || *lpval == 0) { + if (lpval) xfree (lpval); lpval = env_vars[i].def_value; dwType = REG_EXPAND_SZ; dont_free = 1; diff --git a/src/w32fns.c b/src/w32fns.c index de5b6db3d77..288b1f96665 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -27,6 +27,7 @@ Boston, MA 02110-1301, USA. */ #include <stdio.h> #include <limits.h> #include <errno.h> +#include <math.h> #include "lisp.h" #include "w32term.h" @@ -4510,8 +4511,6 @@ This function is an internal primitive--use `make-frame' instead. */) if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) f->param_alist = Fcons (XCAR (tem), f->param_alist); - store_frame_param (f, Qwindow_system, Qw32); - UNGCPRO; /* Make sure windows on this frame appear in calls to next-window @@ -7578,8 +7577,6 @@ x_create_tip_frame (dpyinfo, parms, text) Qnil)); } - Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qw32), Qnil)); - f->no_split = 1; UNGCPRO; @@ -9211,8 +9208,6 @@ void globals_of_w32fns () #undef abort -void w32_abort (void) NO_RETURN; - void w32_abort() { diff --git a/src/w32term.c b/src/w32term.c index f174d25720a..aae84473532 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -6874,6 +6874,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo) terminal like X does. */ terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); init_kboard (terminal->kboard); + terminal->kboard->Vwindow_system = intern ("w32"); terminal->kboard->next_kboard = all_kboards; all_kboards = terminal->kboard; /* Don't let the initial kboard remain current longer than necessary. diff --git a/src/window.c b/src/window.c index 766c291820f..a377ff76718 100644 --- a/src/window.c +++ b/src/window.c @@ -2690,9 +2690,8 @@ window_fixed_size_p (w, width_p, check_siblings_p) } /* Return the minimum size for leaf window W. WIDTH_P non-zero means - take into account fringes and the scrollbar of W. WIDTH_P zero - means take into account mode-line and header-line of W. Return 1 - for the minibuffer. */ + take into account fringes and the scrollbar of W. WIDTH_P zero means + take into account mode-line of W. Return 1 for the minibuffer. */ static int window_min_size_2 (w, width_p) @@ -2711,8 +2710,11 @@ window_min_size_2 (w, width_p) else size = max (window_min_height, (MIN_SAFE_WINDOW_HEIGHT - + (WINDOW_WANTS_MODELINE_P (w) ? 1 : 0) - + (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0 ))); + /* Don't count the header-line here. It would break + splitting a window with a header-line when the new + window shall have a height of two (calculator does + that). */ + + (WINDOW_WANTS_MODELINE_P (w) ? 1 : 0))); return size; } diff --git a/src/xfns.c b/src/xfns.c index fce3316b235..b176b3ffda5 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3679,8 +3679,6 @@ else if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) f->param_alist = Fcons (XCAR (tem), f->param_alist); - store_frame_param (f, Qwindow_system, Qx); - UNGCPRO; /* Make sure windows on this frame appear in calls to next-window @@ -5212,8 +5210,6 @@ else Qnil)); } - Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qx), Qnil)); - f->no_split = 1; UNGCPRO; diff --git a/src/xterm.c b/src/xterm.c index 68670795fa3..9af6060d167 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11242,6 +11242,7 @@ x_term_init (display_name, xrm_option, resource_name) { terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); init_kboard (terminal->kboard); + terminal->kboard->Vwindow_system = intern ("x"); if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound)) { char *vendor = ServerVendor (dpy); diff --git a/src/xterm.h b/src/xterm.h index ad522c1dd75..ec583e39f4d 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1062,7 +1062,6 @@ extern Lisp_Object x_property_data_to_lisp P_ ((struct frame *, /* Defined in xfns.c */ extern struct x_display_info * check_x_display_info P_ ((Lisp_Object frame)); -extern int have_menus_p P_ ((void)); #ifdef USE_GTK extern int xg_set_icon P_ ((struct frame *, Lisp_Object)); |