diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/.gdbinit | 4 | ||||
-rw-r--r-- | src/.gitignore | 1 | ||||
-rw-r--r-- | src/ChangeLog | 160 | ||||
-rw-r--r-- | src/buffer.c | 37 | ||||
-rw-r--r-- | src/callint.c | 6 | ||||
-rw-r--r-- | src/callproc.c | 3 | ||||
-rw-r--r-- | src/config.in | 9 | ||||
-rw-r--r-- | src/data.c | 2 | ||||
-rw-r--r-- | src/dired.c | 83 | ||||
-rw-r--r-- | src/emacs.c | 4 | ||||
-rw-r--r-- | src/fileio.c | 2 | ||||
-rw-r--r-- | src/frame.h | 4 | ||||
-rw-r--r-- | src/gtkutil.c | 229 | ||||
-rw-r--r-- | src/keyboard.c | 34 | ||||
-rw-r--r-- | src/keymap.c | 3 | ||||
-rw-r--r-- | src/m/amdx86-64.h | 6 | ||||
-rw-r--r-- | src/m/hp800.h | 8 | ||||
-rw-r--r-- | src/m/sh3el.h | 109 | ||||
-rw-r--r-- | src/mac.c | 4 | ||||
-rw-r--r-- | src/macfns.c | 27 | ||||
-rw-r--r-- | src/makefile.w32-in | 12 | ||||
-rw-r--r-- | src/minibuf.c | 3 | ||||
-rw-r--r-- | src/prefix-args.c | 8 | ||||
-rw-r--r-- | src/process.c | 7 | ||||
-rw-r--r-- | src/regex.c | 21 | ||||
-rw-r--r-- | src/s/ms-w32.h | 15 | ||||
-rw-r--r-- | src/search.c | 4 | ||||
-rw-r--r-- | src/sound.c | 6 | ||||
-rw-r--r-- | src/w32.c | 19 | ||||
-rw-r--r-- | src/w32fns.c | 26 | ||||
-rw-r--r-- | src/window.c | 12 | ||||
-rw-r--r-- | src/xdisp.c | 75 |
32 files changed, 705 insertions, 238 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index e1ad68e9eb3..aa6ec1bfe59 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -34,6 +34,10 @@ handle 2 noprint pass # Make it work like SIGINT normally does. handle SIGTSTP nopass +# Pass on user signals +handle SIGUSR1 noprint pass +handle SIGUSR2 noprint pass + # Don't pass SIGALRM to Emacs. This makes problems when # debugging. handle SIGALRM ignore diff --git a/src/.gitignore b/src/.gitignore index 8dbbc9f86b6..9bb6e8932b6 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -19,3 +19,4 @@ prefix-args stamp-oldxmenu temacs buildobj.lst +stamp_BLD diff --git a/src/ChangeLog b/src/ChangeLog index 27411da33cb..717e4cdf963 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,11 +1,165 @@ +2006-12-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (update_frame_tool_bar): Connect create-menu-proxy with + xg_tool_bar_menu_proxy. + (xg_tool_bar_menu_proxy): New function. + (xg_tool_bar_proxy_callback): New function. + +2006-12-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_tool_bar_button_cb): Save last modifier on widget. + (xg_tool_bar_callback): Remove check for button. + (update_frame_tool_bar): Put an event box in the tool bar and a button + in the event box. Attach enter/leave-notify-event to the event box. + +2006-12-30 Richard Stallman <rms@gnu.org> + + * keymap.c (Fdefine_key): Doc fix. + +2006-12-29 Kim F. Storm <storm@cua.dk> + + * frame.h (struct frame): New member minimize_tool_bar_window_p. + + * xdisp.c (auto_resize_tool_bars_p): Replace with ... + (Vauto_resize_tool_bars): ... this. + (syms_of_xdisp): DEFVAR_LISP and initialize it. Update doc string + to describe new value `grow-only', and use of C-l. + (display_tool_bar_line): Only use default face for border below + toolbar if not grow-only (to get acceptable visual appearence). + Explicitly set visible_height for empty toolbar lines. + (redisplay_tool_bar): Handle `grow-only' setting. Check and clear + minimize_tool_bar_window_p flag. + + * window.c (Frecenter): Set minimize_tool_bar_window_p flag + when called without arg to redraw with minimum toolbar height. + Update doc string. + +2006-12-29 Jason Rumney <jasonr@gnu.org> + + * s/ms-w32.h (tzname): Do not define in msvc8. + (utime): Do not define in msvc8. + + * regex.c (regerror): Change parameter name err_code. + +2006-12-26 Richard Stallman <rms@gnu.org> + + * search.c (Fsearch_forward): Doc fix. + + * callint.c (Finteractive): Doc fix. + +2006-12-25 Kim F. Storm <storm@cua.dk> + + * s/ms-w32.h (BROKEN_DATAGRAM_SOCKETS): Define it. + +2006-12-23 Eli Zaretskii <eliz@gnu.org> + + * keyboard.c (some_mouse_moved): Fix last change. + +2006-12-22 Eli Zaretskii <eliz@gnu.org> + + * callproc.c (syms_of_callproc) <shell-file-name>: Doc fix. + +2006-12-22 Mark Davies <mark@mcs.vuw.ac.nz> + + * m/amdx86-64.h, m/hp800.h: Add support for NetBSD. + * m/sh3el.h: New file. + +2006-12-22 Eli Zaretskii <eliz@gnu.org> + + * makefile.w32-in (emacs, temacs): Depend on stamp_BLD instead of + $(BLD). + ($(OBJ0) $(OBJ1) $(WIN32OBJ)): New dependency on stamp_BLD. + (bootstrap-temacs): Pass $(XMFLAGS) to sub-make. + ($(OBJ0) $(OBJ1) $(WIN32OBJ)): Add lastfile.$(O) and firstfile.$(O). + (clean): Delete stamp_BLD. + +2006-12-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c (mac_update_title_bar) [TARGET_API_MAC_CARBON]: Call + mac_update_proxy_icon also when buffer modification flag changed. + [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): Don't update alias, + but compare FSRef/FSSpec of resolved alias. + +2006-12-21 Kim F. Storm <storm@cua.dk> + + * w32.c (_sys_wait_accept): Fix handle leak. + +2006-12-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * sound.c: Include <alsa/asoundlib.h> if ALSA_SUBDIR_INCLUDE is + defined. + +2006-12-20 Kim F. Storm <storm@cua.dk> + + * s/ms-w32.h (BROKEN_NON_BLOCKING_CONNECT): Define it. + +2006-12-19 Juanma Barranquero <lekktu@gmail.com> + + * keyboard.c (syms_of_keyboard) <double-click-time>: + * mac.c (Fmac_code_convert_string): + * search.c (Fsearch_forward): Doc fixes. + +2006-12-19 Kim F. Storm <storm@cua.dk> + + Rework 2006-12-04 change. A SIGUSR1 (SIGUSR2) signal now generates + a sigusr1 event instead of [signal usr1] sequence, and signal events + are now supposed to be handled via special-event-map. + + * keyboard.c (kbd_buffer_store_event_hold): Undo 2006-12-04 change. + (make_lispy_event): Don't generate Qsignal prefix for code 0. + Abort if signal code is unknown. + (store_user_signal_events): Don't make Qsignal prefix (code 0). + (Qsignal): Move declaration back to process.c. + (syms_of_keyboard): Don't intern or staticpro it here. + + * process.c (Qsignal): Declare here. + (syms_of_process): Intern or staticpro it. + + * emacs.c (main): Rename user signals to sigusr1 and sigusr2. + + * .gdbinit: Pass on SIGUSR1 and SIGUSR2 to Emacs. + +2006-12-19 Juanma Barranquero <lekktu@gmail.com> + + * buffer.c (syms_of_buffer) <buffer-display-table> + <scroll-up-aggressively, scroll-down-aggressively>: Doc fixes. + +2006-12-17 Richard Stallman <rms@gnu.org> + + * fileio.c (Fread_file_name_internal): Pass Vread_file_name_predicate + to Ffile_name_completion. + + * dired.c (file_name_completion): New arg PREDICATE. Some cleanup. + (Ffile_name_completion): New arg PREDICATE. + +2006-12-17 Juanma Barranquero <lekktu@gmail.com> + + * buffer.c (Fkill_buffer): Doc fix. + (syms_of_buffer) <kill-buffer-query-functions>: Doc fix. + +2006-12-16 Juanma Barranquero <lekktu@gmail.com> + + * minibuf.c (Ftry_completion): Check that obarray buckets are symbols. + +2006-12-16 Eli Zaretskii <eliz@gnu.org> + + * w32fns.c (w32-window-exists-p): New function. + (syms_of_w32fns): Defsubr it. + + * prefix-args.c [STDC_HEADERS]: Include stdlib.h. + +2006-12-16 Juanma Barranquero <lekktu@gmail.com> + + * minibuf.c (Ftry_completion): Use `check_obarray' if ALIST is a vector. + 2006-12-15 Eli Zaretskii <eliz@gnu.org> * emacs.c (USAGE3): Clarify documentation of --color. 2006-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> - * mac.c (wakeup_from_rne_enabled_p) [TARGET_API_MAC_CARBON]: New - variable. + * mac.c (wakeup_from_rne_enabled_p) [TARGET_API_MAC_CARBON]: + New variable. (ENABLE_WAKEUP_FROM_RNE, DISABLE_WAKEUP_FROM_RNE): New macros. [!MAC_OSX] (select): Use them. [MAC_OSX] (select_and_poll_event, sys_select): Likewise. @@ -20,7 +174,7 @@ * macterm.c (mac_query_char_extents) [USE_ATSUI]: Don't call ATSUGetGlyphBounds if not necessary. - (Vmac_atsu_font_table) [USE_ATSUI]: Remove Variable. + (Vmac_atsu_font_table) [USE_ATSUI]: Remove variable. (syms_of_macterm) [USE_ATSUI]: Don't defvar it. (fm_get_style_from_font, atsu_find_font_from_family_name) (atsu_find_font_family_name, mac_atsu_font_face_attributes) diff --git a/src/buffer.c b/src/buffer.c index e9c3c47a959..6e3b39ad2bb 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1332,15 +1332,16 @@ See `kill-buffer'." */ DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 1, 1, "bKill buffer: ", doc: /* Kill the buffer BUFFER. -The argument may be a buffer or may be the name of a buffer. -An argument of nil means kill the current buffer. +The argument may be a buffer or the name of a buffer. +With a nil argument, kill the current buffer. -Value is t if the buffer is actually killed, nil if user says no. +Value is t if the buffer is actually killed, nil otherwise. -The value of `kill-buffer-hook' (which may be local to that buffer), -if not void, is a list of functions to be called, with no arguments, -before the buffer is actually killed. The buffer to be killed is current -when the hook functions are called. +The functions in `kill-buffer-query-functions' are called with BUFFER as +the current buffer. If any of them returns nil, the buffer is not killed. + +The hook `kill-buffer-hook' is run before the buffer is actually killed. +The buffer being killed will be current while the hook is running. Any processes that have this buffer as the `process-buffer' are killed with SIGHUP. */) @@ -5371,8 +5372,8 @@ This is the same as (default-value 'fill-column). */); This is the same as (default-value 'left-margin). */); DEFVAR_LISP_NOPRO ("default-tab-width", - &buffer_defaults.tab_width, - doc: /* Default value of `tab-width' for buffers that do not override it. + &buffer_defaults.tab_width, + doc: /* Default value of `tab-width' for buffers that do not override it. This is the same as (default-value 'tab-width). */); DEFVAR_LISP_NOPRO ("default-case-fold-search", @@ -5694,9 +5695,9 @@ primitives `aref' and `aset' can be used to access elements of a char-table. Each of the char-table elements control how to display the corresponding text character: the element at index C in the table says how to display the character whose code is C. Each element should be a vector of -characters or nil. nil means display the character in the default fashion; -otherwise, the characters from the vector are delivered to the screen -instead of the original character. +characters or nil. The value nil means display the character in the +default fashion; otherwise, the characters from the vector are delivered +to the screen instead of the original character. For example, (aset buffer-display-table ?X ?Y) will cause Emacs to display a capital Y instead of each X character. @@ -5827,7 +5828,7 @@ cursor type. */); ¤t_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. nil, the default, +This variable controls how far it scrolls. The value nil, the default, means scroll to center point. A fraction means scroll to put point that fraction of the window's height from the bottom of the window. When the value is 0.0, point goes at the bottom line, which in the simple @@ -5840,7 +5841,7 @@ between 0.0 and 1.0, inclusive. */); ¤t_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. nil, the default, +This variable controls how far it scrolls. The value nil, the default, means scroll to center point. A fraction means scroll to put point that fraction of the window's height from the top of the window. When the value is 0.0, point goes at the top line, which in the simple @@ -6031,7 +6032,7 @@ is a member of the list. */); Vinhibit_read_only = Qnil; DEFVAR_PER_BUFFER ("cursor-type", ¤t_buffer->cursor_type, Qnil, - doc: /* Cursor to use when this buffer is in the selected window. + doc: /* Cursor to use when this buffer is in the selected window. Values are interpreted as follows: t use the cursor specified for the frame @@ -6056,11 +6057,13 @@ 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, - doc: /* *Cursor type to display in non-selected windows. + doc: /* *Cursor type to display in non-selected windows. The value t means to use hollow box cursor. See `cursor-type' for other values. */); DEFVAR_LISP ("kill-buffer-query-functions", &Vkill_buffer_query_functions, - doc: /* List of functions called with no args to query before killing a buffer. */); + doc: /* List of functions called with no args to query before killing a buffer. +The buffer being killed will be current while the functions are running. +If any of them returns nil, the buffer is not killed. */); Vkill_buffer_query_functions = Qnil; DEFVAR_LISP ("change-major-mode-hook", &Vchange_major_mode_hook, diff --git a/src/callint.c b/src/callint.c index b65ef144d5d..68cfdfc7aa6 100644 --- a/src/callint.c +++ b/src/callint.c @@ -60,7 +60,7 @@ static Lisp_Object point_marker; /* String for the prompt text used in Fcall_interactively. */ static Lisp_Object callint_message; - + /* ARGSUSED */ DEFUN ("interactive", Finteractive, Sinteractive, 0, UNEVALLED, 0, doc: /* Specify a way of parsing arguments for interactive use of a function. @@ -102,7 +102,7 @@ K -- Key sequence to be redefined (do not downcase the last event). m -- Value of mark as number. Does not do I/O. M -- Any string. Inherits the current input method. n -- Number read using minibuffer. -N -- Raw prefix arg, or if none, do like code `n'. +N -- Numeric prefix arg, or if none, do like code `n'. p -- Prefix arg converted to number. Does not do I/O. P -- Prefix arg in raw form. Does not do I/O. r -- Region: point and mark as 2 numeric args, smallest first. Does no I/O. @@ -688,7 +688,7 @@ invoke it. If KEYS is omitted or nil, the return value of Qnil, Qnil, Qnil, Qt); break; - case 'N': /* Prefix arg, else number from minibuffer */ + case 'N': /* Prefix arg as number, else number from minibuffer */ if (!NILP (prefix_arg)) goto have_prefix_arg; case 'n': /* Read number from minibuffer. */ diff --git a/src/callproc.c b/src/callproc.c index d8eebac08a6..819e7ff4a32 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -1553,7 +1553,8 @@ syms_of_callproc () DEFVAR_LISP ("shell-file-name", &Vshell_file_name, doc: /* *File name to load inferior shells from. -Initialized from the SHELL environment variable. */); +Initialized from the SHELL environment variable, or to a system-dependent +default if SHELL is not set. */); DEFVAR_LISP ("exec-path", &Vexec_path, doc: /* *List of directories to search programs to run in subprocesses. diff --git a/src/config.in b/src/config.in index 7903c749513..8ee525a611b 100644 --- a/src/config.in +++ b/src/config.in @@ -121,6 +121,10 @@ Boston, MA 02110-1301, USA. */ don't. */ #undef HAVE_DECL_SYS_SIGLIST +/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. + */ +#undef HAVE_DECL_TZNAME + /* Define to 1 if you have the declaration of `__sys_siglist', and to 0 if you don't. */ #undef HAVE_DECL___SYS_SIGLIST @@ -248,6 +252,9 @@ Boston, MA 02110-1301, USA. */ /* Define to 1 if you have the `gtk_file_selection_new' function. */ #undef HAVE_GTK_FILE_SELECTION_NEW +/* Define to 1 if you have the `gtk_main' function. */ +#undef HAVE_GTK_MAIN + /* Define to 1 if GTK can handle more than one display. */ #undef HAVE_GTK_MULTIDISPLAY @@ -808,7 +815,7 @@ Boston, MA 02110-1301, USA. */ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. + automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ diff --git a/src/data.c b/src/data.c index 00ef0b1c822..120a92d66d7 100644 --- a/src/data.c +++ b/src/data.c @@ -1264,7 +1264,7 @@ set_internal (symbol, newval, buf, bindflag) XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, tem1); - /* Set `buffer' and `frame' slots for thebinding now loaded. */ + /* Set `buffer' and `frame' slots for the binding now loaded. */ XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, buf); XBUFFER_LOCAL_VALUE (valcontents)->frame = selected_frame; } diff --git a/src/dired.c b/src/dired.c index 5d187a32b8e..3283d38eb4b 100644 --- a/src/dired.c +++ b/src/dired.c @@ -396,17 +396,20 @@ ID-FORMAT specifies the preferred format of attributes uid and gid, see Lisp_Object file_name_completion (); DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion, - 2, 2, 0, + 2, 3, 0, doc: /* Complete file name FILE in directory DIRECTORY. Returns the longest string common to all file names in DIRECTORY that start with FILE. If there is only one and FILE matches it exactly, returns t. Returns nil if DIRECTORY contains no name starting with FILE. +If PREDICATE is non-nil, call PREDICATE with each possible +completion (in absolute form) and ignore it if PREDICATE returns nil. + This function ignores some of the possible completions as determined by the variable `completion-ignored-extensions', which see. */) - (file, directory) - Lisp_Object file, directory; + (file, directory, predicate) + Lisp_Object file, directory, predicate; { Lisp_Object handler; @@ -414,15 +417,15 @@ determined by the variable `completion-ignored-extensions', which see. */) call the corresponding file handler. */ handler = Ffind_file_name_handler (directory, Qfile_name_completion); if (!NILP (handler)) - return call3 (handler, Qfile_name_completion, file, directory); + return call4 (handler, Qfile_name_completion, file, directory, predicate); /* If the file name has special constructs in it, call the corresponding file handler. */ handler = Ffind_file_name_handler (file, Qfile_name_completion); if (!NILP (handler)) - return call3 (handler, Qfile_name_completion, file, directory); + return call4 (handler, Qfile_name_completion, file, directory, predicate); - return file_name_completion (file, directory, 0, 0); + return file_name_completion (file, directory, 0, 0, predicate); } DEFUN ("file-name-all-completions", Ffile_name_all_completions, @@ -446,21 +449,25 @@ These are all file names in directory DIRECTORY which begin with FILE. */) if (!NILP (handler)) return call3 (handler, Qfile_name_all_completions, file, directory); - return file_name_completion (file, directory, 1, 0); + return file_name_completion (file, directory, 1, 0, Qnil); } static int file_name_completion_stat (); Lisp_Object -file_name_completion (file, dirname, all_flag, ver_flag) +file_name_completion (file, dirname, all_flag, ver_flag, predicate) Lisp_Object file, dirname; int all_flag, ver_flag; + Lisp_Object predicate; { DIR *d; int bestmatchsize = 0, skip; register int compare, matchsize; unsigned char *p1, *p2; int matchcount = 0; + /* If ALL_FLAG is 1, BESTMATCH is the list of all matches, decoded. + If ALL_FLAG is 0, BESTMATCH is either nil + or the best match so far, not decoded. */ Lisp_Object bestmatch, tem, elt, name; Lisp_Object encoded_file; Lisp_Object encoded_dir; @@ -568,8 +575,8 @@ file_name_completion (file, dirname, all_flag, ver_flag) #ifndef TRIVIAL_DIRECTORY_ENTRY #define TRIVIAL_DIRECTORY_ENTRY(n) (!strcmp (n, ".") || !strcmp (n, "..")) #endif - /* "." and ".." are never interesting as completions, but are - actually in the way in a directory contains only one file. */ + /* "." and ".." are never interesting as completions, and are + actually in the way in a directory with only one file. */ if (!passcount && TRIVIAL_DIRECTORY_ENTRY (dp->d_name)) continue; if (!passcount && len > SCHARS (encoded_file)) @@ -650,30 +657,38 @@ file_name_completion (file, dirname, all_flag, ver_flag) continue; } - /* Update computation of how much all possible completions match */ + /* This is a possible completion */ + if (directoryp) + { + /* This completion is a directory; make it end with '/' */ + name = Ffile_name_as_directory (make_string (dp->d_name, len)); + } + else + name = make_string (dp->d_name, len); + + /* Test the predicate, if any. */ + + if (!NILP (predicate)) + { + Lisp_Object decoded; + decoded = Fexpand_file_name (DECODE_FILE (name), dirname); + if (NILP (call1 (predicate, decoded))) + continue; + } + + /* Suitably record this match. */ matchcount++; - if (all_flag || NILP (bestmatch)) + if (all_flag) { - /* This is a possible completion */ - if (directoryp) - { - /* This completion is a directory; make it end with '/' */ - name = Ffile_name_as_directory (make_string (dp->d_name, len)); - } - else - name = make_string (dp->d_name, len); - if (all_flag) - { - name = DECODE_FILE (name); - bestmatch = Fcons (name, bestmatch); - } - else - { - bestmatch = name; - bestmatchsize = SCHARS (name); - } + name = DECODE_FILE (name); + bestmatch = Fcons (name, bestmatch); + } + else if (NILP (bestmatch)) + { + bestmatch = name; + bestmatchsize = SCHARS (name); } else { @@ -709,11 +724,7 @@ file_name_completion (file, dirname, all_flag, ver_flag) == SCHARS (bestmatch))) && !bcmp (p2, SDATA (encoded_file), SCHARS (encoded_file)) && bcmp (p1, SDATA (encoded_file), SCHARS (encoded_file)))) - { - bestmatch = make_string (dp->d_name, len); - if (directoryp) - bestmatch = Ffile_name_as_directory (bestmatch); - } + bestmatch = name; } /* If this dirname all matches, see if implicit following @@ -836,7 +847,7 @@ DEFUN ("file-name-all-versions", Ffile_name_all_versions, (file, directory) Lisp_Object file, directory; { - return file_name_completion (file, directory, 1, 1); + return file_name_completion (file, directory, 1, 1, Qnil); } DEFUN ("file-version-limit", Ffile_version_limit, Sfile_version_limit, 1, 1, 0, diff --git a/src/emacs.c b/src/emacs.c index 6601336edd5..1db552c33e5 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1196,10 +1196,10 @@ main (argc, argv signal (SIGILL, fatal_error_signal); signal (SIGTRAP, fatal_error_signal); #ifdef SIGUSR1 - add_user_signal (SIGUSR1, "usr1"); + add_user_signal (SIGUSR1, "sigusr1"); #endif #ifdef SIGUSR2 - add_user_signal (SIGUSR2, "usr2"); + add_user_signal (SIGUSR2, "sigusr2"); #endif #ifdef SIGABRT signal (SIGABRT, fatal_error_signal); diff --git a/src/fileio.c b/src/fileio.c index 1cd1188cb63..e276426487e 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -6075,7 +6075,7 @@ DEFUN ("read-file-name-internal", Fread_file_name_internal, Sread_file_name_inte if (NILP (action)) { specdir = Ffile_name_directory (string); - val = Ffile_name_completion (name, realdir); + val = Ffile_name_completion (name, realdir, Vread_file_name_predicate); UNGCPRO; if (!STRINGP (val)) { diff --git a/src/frame.h b/src/frame.h index 3148e583e89..9c74a2d777c 100644 --- a/src/frame.h +++ b/src/frame.h @@ -484,6 +484,10 @@ struct frame /* 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 diff --git a/src/gtkutil.c b/src/gtkutil.c index 6fd18882a74..3dcdef2b0ae 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -3350,11 +3350,8 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) get them. */ #define XG_TOOL_BAR_LAST_MODIFIER "emacs-tool-bar-modifier" - -/* Callback function invoked when a tool bar item is pressed. - W is the button widget in the tool bar that got pressed, - CLIENT_DATA is an integer that is the index of the button in the - tool bar. 0 is the first button. */ +/* The key for storing the button widget in its proxy menu item. */ +#define XG_TOOL_BAR_PROXY_BUTTON "emacs-tool-bar-proxy-button" static gboolean xg_tool_bar_button_cb (widget, event, user_data) @@ -3364,11 +3361,16 @@ xg_tool_bar_button_cb (widget, event, user_data) { /* Casts to avoid warnings when gpointer is 64 bits and int is 32 bits */ gpointer ptr = (gpointer) (EMACS_INT) event->state; - g_object_set_data (G_OBJECT (user_data), XG_TOOL_BAR_LAST_MODIFIER, ptr); + g_object_set_data (G_OBJECT (widget), XG_TOOL_BAR_LAST_MODIFIER, ptr); return FALSE; } +/* Callback function invoked when a tool bar item is pressed. + W is the button widget in the tool bar that got pressed, + CLIENT_DATA is an integer that is the index of the button in the + tool bar. 0 is the first button. */ + static void xg_tool_bar_callback (w, client_data) GtkWidget *w; @@ -3406,6 +3408,92 @@ xg_tool_bar_callback (w, client_data) kbd_buffer_store_event (&event); } +/* Callback function invoked when a tool bar item is pressed in a detached + tool bar or the overflow drop down menu. + We just call xg_tool_bar_callback. + W is the menu item widget that got pressed, + CLIENT_DATA is an integer that is the index of the button in the + tool bar. 0 is the first button. */ + +static void +xg_tool_bar_proxy_callback (w, client_data) + GtkWidget *w; + gpointer client_data; +{ + GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w), + XG_TOOL_BAR_PROXY_BUTTON)); + xg_tool_bar_callback (wbutton, client_data); +} + +/* This callback is called when a tool item should create a proxy item, + such as for the overflow menu. Also called when the tool bar is detached. + If we don't create a proxy menu item, the detached tool bar will be + blank. */ + +static gboolean +xg_tool_bar_menu_proxy (toolitem, user_data) + GtkToolItem *toolitem; + gpointer user_data; +{ + GtkWidget *weventbox = gtk_bin_get_child (GTK_BIN (toolitem)); + GtkButton *wbutton = GTK_BUTTON (gtk_bin_get_child (GTK_BIN (weventbox))); + GtkWidget *wmenuitem = gtk_image_menu_item_new (); + GtkWidget *wmenuimage; + + if (gtk_button_get_use_stock (wbutton)) + wmenuimage = gtk_image_new_from_stock (gtk_button_get_label (wbutton), + GTK_ICON_SIZE_MENU); + else + { + GtkImage *wimage = GTK_IMAGE (gtk_bin_get_child (GTK_BIN (wbutton))); + GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (wbutton)); + GtkImageType store_type = gtk_image_get_storage_type (wimage); + if (store_type == GTK_IMAGE_STOCK) + { + gchar *stock_id; + gtk_image_get_stock (wimage, &stock_id, NULL); + wmenuimage = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU); + } + else if (store_type == GTK_IMAGE_ICON_SET) + { + GtkIconSet *icon_set; + gtk_image_get_icon_set (wimage, &icon_set, NULL); + wmenuimage = gtk_image_new_from_icon_set (icon_set, + GTK_ICON_SIZE_MENU); + } + else if (store_type == GTK_IMAGE_PIXBUF) + { + gint width, height; + + if (settings && + gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU, + &width, &height)) + { + GdkPixbuf *src_pixbuf, *dest_pixbuf; + + src_pixbuf = gtk_image_get_pixbuf (wimage); + dest_pixbuf = gdk_pixbuf_scale_simple (src_pixbuf, width, height, + GDK_INTERP_BILINEAR); + + wmenuimage = gtk_image_new_from_pixbuf (dest_pixbuf); + } + } + } + if (wmenuimage) + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (wmenuitem), wmenuimage); + + g_signal_connect (G_OBJECT (wmenuitem), + "activate", + GTK_SIGNAL_FUNC (xg_tool_bar_proxy_callback), + user_data); + + g_object_set_data (G_OBJECT (wmenuitem), XG_TOOL_BAR_PROXY_BUTTON, + (gpointer) wbutton); + gtk_tool_item_set_proxy_menu_item (toolitem, "Emacs toolbar item", wmenuitem); + + return TRUE; +} + /* This callback is called when a tool bar is detached. We must set the height of the tool bar to zero when this happens so frame sizes are correctly calculated. @@ -3491,9 +3579,6 @@ xg_tool_bar_help_callback (w, event, client_data) FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); Lisp_Object help, frame; - if (! GTK_IS_BUTTON (w)) - return FALSE; - if (! f || ! f->n_tool_bar_items || NILP (f->tool_bar_items)) return FALSE; @@ -3631,10 +3716,9 @@ update_frame_tool_bar (f) { int i; GtkRequisition old_req, new_req; - GList *icon_list; - GList *iter; struct x_output *x = f->output_data.x; int hmargin, vmargin; + GtkToolItem *ti; if (! FRAME_GTK_WIDGET (f)) return; @@ -3670,9 +3754,6 @@ update_frame_tool_bar (f) gtk_widget_size_request (x->toolbar_widget, &old_req); - icon_list = gtk_container_get_children (GTK_CONTAINER (x->toolbar_widget)); - iter = icon_list; - for (i = 0; i < f->n_tool_bar_items; ++i) { #define PROP(IDX) AREF (f->tool_bar_items, i * TOOL_BAR_ITEM_NSLOTS + (IDX)) @@ -3683,12 +3764,16 @@ update_frame_tool_bar (f) int img_id; struct image *img; Lisp_Object image; - GtkWidget *wicon = iter ? GTK_WIDGET (iter->data) : 0; - GtkToolItem *ti = NULL; - GtkWidget *wvbox; - GList *chlist; + GtkWidget *wbutton; + GtkWidget *weventbox; - if (iter) iter = g_list_next (iter); + ti = gtk_toolbar_get_nth_item (GTK_TOOLBAR (x->toolbar_widget), i); + + if (ti) + { + weventbox = gtk_bin_get_child (GTK_BIN (ti)); + wbutton = gtk_bin_get_child (GTK_BIN (weventbox)); + } /* If image is a vector, choose the image according to the button state. */ @@ -3713,7 +3798,7 @@ update_frame_tool_bar (f) /* Ignore invalid image specifications. */ if (!valid_image_p (image)) { - if (wicon) gtk_widget_hide (wicon); + if (ti) gtk_widget_hide_all (GTK_WIDGET (ti)); continue; } @@ -3723,57 +3808,55 @@ update_frame_tool_bar (f) if (img->load_failed_p || img->pixmap == None) { - if (wicon) - gtk_widget_hide (wicon); + if (ti) + gtk_widget_hide_all (GTK_WIDGET (ti)); else - /* Insert an empty (non-image) button */ - gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), - gtk_tool_button_new (NULL, ""), - i); + { + /* Insert an empty (non-image) button */ + weventbox = gtk_event_box_new (); + wbutton = gtk_button_new (); + gtk_button_set_focus_on_click (GTK_BUTTON (wbutton), FALSE); + gtk_button_set_relief (GTK_BUTTON (wbutton), GTK_RELIEF_NONE); + gtk_container_add (GTK_CONTAINER (weventbox), wbutton); + ti = gtk_tool_item_new (); + gtk_container_add (GTK_CONTAINER (ti), weventbox); + gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, i); + } continue; } - if (wicon) - { - /* The child of the tool bar is a button. Inside that button - is a vbox. Inside that vbox is the GtkImage. */ - wvbox = gtk_bin_get_child (GTK_BIN (wicon)); - chlist = gtk_container_get_children (GTK_CONTAINER (wvbox)); - if (chlist == NULL) - /* In this case, we inserted an empty button (above) with no image */ - ti = GTK_TOOL_ITEM (wicon); - } - - if (! wicon || ti != NULL) + if (ti == NULL) { GtkWidget *w = xg_get_image_for_pixmap (f, img, x->widget, NULL); gtk_misc_set_padding (GTK_MISC (w), hmargin, vmargin); - - - if (ti == NULL) - { - ti = gtk_tool_button_new (w, ""); - - gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, i); - } - else - gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (ti), w); + wbutton = gtk_button_new (); + gtk_button_set_focus_on_click (GTK_BUTTON (wbutton), FALSE); + gtk_button_set_relief (GTK_BUTTON (wbutton), GTK_RELIEF_NONE); + gtk_container_add (GTK_CONTAINER (wbutton), w); + weventbox = gtk_event_box_new (); + gtk_container_add (GTK_CONTAINER (weventbox), wbutton); + ti = gtk_tool_item_new (); + gtk_container_add (GTK_CONTAINER (ti), weventbox); + gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, i); /* The EMACS_INT cast avoids a warning. */ - g_signal_connect (GTK_WIDGET (ti), "clicked", + g_signal_connect (G_OBJECT (ti), "create-menu-proxy", + GTK_SIGNAL_FUNC (xg_tool_bar_menu_proxy), + (gpointer) (EMACS_INT) i); + + g_signal_connect (G_OBJECT (wbutton), "clicked", GTK_SIGNAL_FUNC (xg_tool_bar_callback), (gpointer) (EMACS_INT) i); - gtk_widget_show (GTK_WIDGET (ti)); - gtk_widget_show (GTK_WIDGET (w)); + gtk_widget_show_all (GTK_WIDGET (ti)); /* Save the image so we can see if an update is needed when this function is called again. */ g_object_set_data (G_OBJECT (w), XG_TOOL_BAR_IMAGE_DATA, (gpointer)img->pixmap); - g_object_set_data (G_OBJECT (ti), XG_FRAME_DATA, (gpointer)f); + g_object_set_data (G_OBJECT (weventbox), XG_FRAME_DATA, (gpointer)f); /* Catch expose events to overcome an annoying redraw bug, see comment for xg_tool_bar_item_expose_callback. */ @@ -3782,46 +3865,37 @@ update_frame_tool_bar (f) G_CALLBACK (xg_tool_bar_item_expose_callback), 0); - gtk_widget_set_sensitive (GTK_WIDGET (ti), enabled_p); - gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (ti), FALSE); + gtk_widget_set_sensitive (wbutton, enabled_p); + gtk_tool_item_set_homogeneous (ti, FALSE); - while (! GTK_IS_BUTTON (w)) - w = gtk_widget_get_parent (w); - /* Callback to save modifyer mask (Shift/Control, etc). GTK makes no distinction based on modifiers in the activate callback, so we have to do it ourselves. */ - g_signal_connect (w, "button-release-event", + g_signal_connect (wbutton, "button-release-event", GTK_SIGNAL_FUNC (xg_tool_bar_button_cb), - ti); + NULL); - g_object_set_data (G_OBJECT (w), XG_FRAME_DATA, (gpointer)f); + g_object_set_data (G_OBJECT (wbutton), XG_FRAME_DATA, (gpointer)f); /* Use enter/leave notify to show help. We use the events rather than the GtkButton specific signals "enter" and "leave", so we can have only one callback. The event will tell us what kind of event it is. */ /* The EMACS_INT cast avoids a warning. */ - g_signal_connect (G_OBJECT (w), + g_signal_connect (G_OBJECT (weventbox), "enter-notify-event", G_CALLBACK (xg_tool_bar_help_callback), (gpointer) (EMACS_INT) i); - g_signal_connect (G_OBJECT (w), + g_signal_connect (G_OBJECT (weventbox), "leave-notify-event", G_CALLBACK (xg_tool_bar_help_callback), (gpointer) (EMACS_INT) i); } else { - /* The child of the tool bar is a button. Inside that button - is a vbox. Inside that vbox is the GtkImage. */ - GtkWidget *wvbox = gtk_bin_get_child (GTK_BIN (wicon)); - GList *chlist = gtk_container_get_children (GTK_CONTAINER (wvbox)); - GtkImage *wimage = GTK_IMAGE (chlist->data); + GtkWidget *wimage = gtk_bin_get_child (GTK_BIN (wbutton)); Pixmap old_img = (Pixmap)g_object_get_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA); - g_list_free (chlist); - gtk_misc_set_padding (GTK_MISC (wimage), hmargin, vmargin); if (old_img != img->pixmap) @@ -3830,21 +3904,20 @@ update_frame_tool_bar (f) g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA, (gpointer)img->pixmap); - gtk_widget_set_sensitive (wicon, enabled_p); - gtk_widget_show (wicon); - } + gtk_widget_set_sensitive (wbutton, enabled_p); + gtk_widget_show_all (GTK_WIDGET (ti)); + } #undef PROP } /* Remove buttons not longer needed. We just hide them so they can be reused later on. */ - while (iter) + do { - GtkWidget *w = GTK_WIDGET (iter->data); - gtk_widget_hide (w); - iter = g_list_next (iter); - } + ti = gtk_toolbar_get_nth_item (GTK_TOOLBAR (x->toolbar_widget), i++); + if (ti) gtk_widget_hide_all (GTK_WIDGET (ti)); + } while (ti != NULL); gtk_widget_size_request (x->toolbar_widget, &new_req); if (old_req.height != new_req.height @@ -3854,8 +3927,6 @@ update_frame_tool_bar (f) xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f)); } - if (icon_list) g_list_free (icon_list); - UNBLOCK_INPUT; } diff --git a/src/keyboard.c b/src/keyboard.c index ef8107b2ce3..75b78d63d19 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1453,7 +1453,7 @@ some_mouse_moved () if (ignore_mouse_drag_p) { - //ignore_mouse_drag_p = 0; + /* ignore_mouse_drag_p = 0; */ return 0; } @@ -3799,8 +3799,7 @@ kbd_buffer_store_event_hold (event, hold_quit) if (!NILP (Vthrow_on_input) && event->kind != FOCUS_IN_EVENT && event->kind != HELP_EVENT - && event->kind != DEICONIFY_EVENT - && !(event->kind == USER_SIGNAL_EVENT && event->code == 0)) + && event->kind != DEICONIFY_EVENT) { Vquit_flag = Vthrow_on_input; /* If we're inside a function that wants immediate quits, @@ -5088,9 +5087,6 @@ Lisp_Object *scroll_bar_parts[] = { &Qup, &Qdown, &Qtop, &Qbottom, &Qend_scroll, &Qratio }; -/* User signal events. */ -Lisp_Object Qsignal; - /* A vector, indexed by button number, giving the down-going location of currently depressed buttons, both scroll bar and non-scroll bar. @@ -5969,17 +5965,12 @@ make_lispy_event (event) case USER_SIGNAL_EVENT: /* A user signal. */ - if (event->code == 0) - return Qsignal; - else - { - char *name = find_user_signal_name (event->code); - - if (name) - return intern (name); - else - return make_number (event->code); - } + { + char *name = find_user_signal_name (event->code); + if (!name) + abort (); + return intern (name); + } case SAVE_SESSION_EVENT: return Qsave_session; @@ -7156,8 +7147,6 @@ store_user_signal_events () mask = sigblock (sigmask (p->sig)); do { - buf.code = 0; - kbd_buffer_store_event (&buf); buf.code = p->sig; kbd_buffer_store_event (&buf); p->npending--; @@ -11182,9 +11171,6 @@ syms_of_keyboard () staticpro (&Qmac_apple_event); #endif - Qsignal = intern ("signal"); - staticpro (&Qsignal); - Qmenu_enable = intern ("menu-enable"); staticpro (&Qmenu_enable); Qmenu_alias = intern ("menu-alias"); @@ -11475,8 +11461,8 @@ Polling is automatically disabled in all other cases. */); DEFVAR_LISP ("double-click-time", &Vdouble_click_time, doc: /* *Maximum time between mouse clicks to make a double-click. -Measured in milliseconds. nil means disable double-click recognition; -t means double-clicks have no time limit and are detected +Measured in milliseconds. The value nil means disable double-click +recognition; t means double-clicks have no time limit and are detected by position only. */); Vdouble_click_time = make_number (500); diff --git a/src/keymap.c b/src/keymap.c index 176b6760e36..3fd81effb04 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1147,7 +1147,8 @@ DEF is anything that can be a key's definition: or another symbol whose function definition is used, etc.), a cons (STRING . DEFN), meaning that DEFN is the definition (DEFN should be a valid definition in its own right), - or a cons (MAP . CHAR), meaning use definition of CHAR in keymap MAP. + or a cons (MAP . CHAR), meaning use definition of CHAR in keymap MAP, + or an extended menu item definition. (See info node `Extended Menu Items'.) If KEYMAP is a sparse keymap with a binding for KEY, the existing binding is altered. If there is no binding for KEY, the new pair diff --git a/src/m/amdx86-64.h b/src/m/amdx86-64.h index 670360336a8..36e62ef6166 100644 --- a/src/m/amdx86-64.h +++ b/src/m/amdx86-64.h @@ -125,12 +125,16 @@ Boston, MA 02110-1301, USA. */ #undef LIB_STANDARD #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o +#elif defined(__NetBSD__) + +/* LIB_STANDARD and START_FILES set correctly in s/netbsd.h */ + #elif defined(sun) #undef START_FILES #undef LIB_STANDARD -#else /* !__OpenBSD__ && !__FreeBSD__ && !sun */ +#else /* !__OpenBSD__ && !__FreeBSD__ && !__NetBSD__ && !sun */ #undef START_FILES #ifdef HAVE_X86_64_LIB64_DIR diff --git a/src/m/hp800.h b/src/m/hp800.h index 01146e52359..1630a0bc883 100644 --- a/src/m/hp800.h +++ b/src/m/hp800.h @@ -174,6 +174,14 @@ Boston, MA 02110-1301, USA. */ #define rindex strrchr #endif /* __hpux */ + +/* Systems with GCC don't need to lose. */ +#ifdef __NetBSD__ +# ifdef __GNUC__ +# define alloca __builtin_alloca +# define HAVE_ALLOCA +# endif /* __GNUC__ */ +#endif /* __NetBSD__ */ /* arch-tag: 809436e6-1645-4b92-b40d-2de5d6e7227c (do not change this comment) */ diff --git a/src/m/sh3el.h b/src/m/sh3el.h new file mode 100644 index 00000000000..0854ecd1b25 --- /dev/null +++ b/src/m/sh3el.h @@ -0,0 +1,109 @@ +/* machine description file for sh3el + Copyright (C) 1985, 1986 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 2, 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., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, 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 WORDS_BIG_ENDIAN iff lowest-numbered byte in a word + is the most significant byte. */ + +#undef WORDS_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. */ + +#undef 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. */ + +#undef CANNOT_DUMP + +/* 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. */ + +#define VIRT_ADDR_VARIES + +/* Define C_ALLOCA if this machine does not support a true alloca + and the one written in C should be used instead. + Define HAVE_ALLOCA to say that the system provides a properly + working alloca function and it should be used. + Define neither one if an assembler-language alloca + in the file alloca.s should be used. */ + +/* #define C_ALLOCA */ +#define HAVE_ALLOCA + +/* 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 + +/* 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: ee325990-6f40-47a2-b9df-60ecf3599899 + (do not change this comment) */ diff --git a/src/mac.c b/src/mac.c index e79bd775fda..7a08d828725 100644 --- a/src/mac.c +++ b/src/mac.c @@ -4852,8 +4852,8 @@ DEFUN ("mac-code-convert-string", Fmac_code_convert_string, Smac_code_convert_st doc: /* Convert STRING from SOURCE encoding to TARGET encoding. The conversion is performed using the converter provided by the system. Each encoding is specified by either a coding system symbol, a mime -charset string, or an integer as a CFStringEncoding value. Nil for -encoding means UTF-16 in native byte order, no byte order mark. +charset string, or an integer as a CFStringEncoding value. An encoding +of nil means UTF-16 in native byte order, no byte order mark. On Mac OS X 10.2 and later, you can do Unicode Normalization by specifying the optional argument NORMALIZATION-FORM with a symbol NFD, NFKD, NFC, NFKC, HFS+D, or HFS+C. diff --git a/src/macfns.c b/src/macfns.c index a5de3edeec6..962f837c152 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -1969,9 +1969,9 @@ mac_update_proxy_icon (f) { AEDesc desc; #ifdef MAC_OSX - FSRef fref; + FSRef fref, fref_proxy; #else - FSSpec fss; + FSSpec fss, fss_proxy; #endif Boolean changed; Lisp_Object encoded_file_name = ENCODE_FILE (file_name); @@ -1997,10 +1997,19 @@ mac_update_proxy_icon (f) { if (alias) { + /* (FS)ResolveAlias never sets `changed' to true if + `alias' is minimal. */ #ifdef MAC_OSX - err = FSUpdateAlias (NULL, &fref, alias, &changed); + err = FSResolveAlias (NULL, alias, &fref_proxy, &changed); + if (err == noErr) + err = FSCompareFSRefs (&fref, &fref_proxy); #else - err = UpdateAlias (NULL, &fss, alias, &changed); + err = ResolveAlias (NULL, alias, &fss_proxy, &changed); + if (err == noErr) + err = !(fss.vRefNum == fss_proxy.vRefNum + && fss.parID == fss_proxy.parID + && EqualString (fss.name, fss_proxy.name, + false, true)); #endif } if (err != noErr || alias == NULL) @@ -2051,11 +2060,11 @@ mac_update_title_bar (f, save_match_data) confusing. */ || (!MINI_WINDOW_P (w) && (modified_p != !NILP (w->last_had_star)))) - SetWindowModified (FRAME_MAC_WINDOW (f), - !MINI_WINDOW_P (w) && modified_p); - - if (windows_or_buffers_changed) - mac_update_proxy_icon (f); + { + SetWindowModified (FRAME_MAC_WINDOW (f), + !MINI_WINDOW_P (w) && modified_p); + mac_update_proxy_icon (f); + } #endif } diff --git a/src/makefile.w32-in b/src/makefile.w32-in index 98ecc759034..e9aac2fb5a6 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -159,7 +159,7 @@ all: $(ALL) # # The dumped executable # -emacs: $(BLD) $(EMACS) +emacs: stamp_BLD $(EMACS) $(EMACS): $(DOC) $(TEMACS) "$(THISDIR)/$(BLD)/temacs.exe" -batch -l loadup dump -"$(THISDIR)/$(BLD)/emacs.exe" -q -batch -f list-load-path-shadows @@ -170,7 +170,7 @@ $(EMACS): $(DOC) $(TEMACS) # If preload runs out of memory, increase the last argument to addsection # (it is the preload heap size in MB). # -temacs: $(BLD) $(TEMACS) +temacs: stamp_BLD $(TEMACS) $(TEMACS): $(TLIB0) $(TLIB1) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES) \ ../nt/$(BLD)/addsection.exe $(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS) @@ -188,7 +188,7 @@ bootstrap: bootstrap-emacs # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as # this can break with GNU Make 3.81 and later if sh.exe is used. bootstrap-temacs: - $(MAKE) $(MFLAGS) temacs CFLAGS=$(ARGQUOTE)$(CFLAGS) -DPURESIZE=5000000$(ARGQUOTE) + $(MAKE) $(MFLAGS) $(XMFLAGS) temacs CFLAGS=$(ARGQUOTE)$(CFLAGS) -DPURESIZE=5000000$(ARGQUOTE) # # Dump an Emacs executable named bootstrap-emacs containing the @@ -253,6 +253,7 @@ clean: - $(DEL) *~ "s/*~" "m/*~" - $(DEL) $(COMPILER_TEMP_FILES) - $(DEL_TREE) $(OBJDIR) + - $(DEL) stamp_BLD distclean: clean - $(DEL) config.h epaths.h @@ -1552,3 +1553,8 @@ $(BLD)/w32bdf.$(O): \ $(SRC)/w32bdf.h \ $(SRC)/w32gui.h \ $(SRC)/w32term.h + +# Each object file depends on stamp_BLD, because in parallel builds we must +# make sure $(BLD) exists before starting compilations. +# +$(OBJ0) $(OBJ1) $(WIN32OBJ) $(BLD)/lastfile.$(O) $(BLD)/firstfile.$(O): stamp_BLD diff --git a/src/minibuf.c b/src/minibuf.c index 2397ea4b085..85a0169e10a 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1287,6 +1287,7 @@ is used to further constrain the set of candidates. */) tail = alist; if (type == 2) { + alist = check_obarray (alist); obsize = XVECTOR (alist)->size; bucket = XVECTOR (alist)->contents[index]; } @@ -1310,6 +1311,8 @@ is used to further constrain the set of candidates. */) { if (!EQ (bucket, zero)) { + if (!SYMBOLP (bucket)) + error ("Bad data in guts of obarray"); elt = bucket; eltstring = elt; if (XSYMBOL (bucket)->next) diff --git a/src/prefix-args.c b/src/prefix-args.c index 1a855e0e34b..5580d176bcf 100644 --- a/src/prefix-args.c +++ b/src/prefix-args.c @@ -44,6 +44,14 @@ Boston, MA 02110-1301, USA. */ If I can't write a completely portable program to do this in C, I'm quitting and taking up gardening. */ +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#if STDC_HEADERS +# include <stdlib.h> /* for proper declaration of `exit' */ +#endif + #include <stdio.h> int diff --git a/src/process.c b/src/process.c index 663170e685e..6dc5a88944c 100644 --- a/src/process.c +++ b/src/process.c @@ -149,8 +149,7 @@ Boston, MA 02110-1301, USA. */ #include "atimer.h" Lisp_Object Qprocessp; -Lisp_Object Qrun, Qstop; -extern Lisp_Object Qsignal; +Lisp_Object Qrun, Qstop, Qsignal; Lisp_Object Qopen, Qclosed, Qconnect, Qfailed, Qlisten; Lisp_Object Qlocal, Qipv4, Qdatagram; #ifdef AF_INET6 @@ -2900,7 +2899,7 @@ usage: (make-network-process &rest ARGS) */) /* Make QCaddress an alias for :local (server) or :remote (client). */ QCaddress = is_server ? QClocal : QCremote; - /* :wait BOOL */ + /* :nowait BOOL */ if (!is_server && socktype == SOCK_STREAM && (tem = Fplist_get (contact, QCnowait), !NILP (tem))) { @@ -6986,6 +6985,8 @@ syms_of_process () staticpro (&Qrun); Qstop = intern ("stop"); staticpro (&Qstop); + Qsignal = intern ("signal"); + staticpro (&Qsignal); /* Qexit is already staticpro'd by syms_of_eval; don't staticpro it here again. diff --git a/src/regex.c b/src/regex.c index 4b011634ae1..396e55c6404 100644 --- a/src/regex.c +++ b/src/regex.c @@ -67,8 +67,8 @@ # define regfree(preg) __regfree (preg) # define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef) # define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags) -# define regerror(errcode, preg, errbuf, errbuf_size) \ - __regerror(errcode, preg, errbuf, errbuf_size) +# define regerror(err_code, preg, errbuf, errbuf_size) \ + __regerror(err_code, preg, errbuf, errbuf_size) # define re_set_registers(bu, re, nu, st, en) \ __re_set_registers (bu, re, nu, st, en) # define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \ @@ -6625,12 +6625,15 @@ regexec (preg, string, nmatch, pmatch, eflags) WEAK_ALIAS (__regexec, regexec) -/* Returns a message corresponding to an error code, ERRCODE, returned - from either regcomp or regexec. We don't use PREG here. */ +/* Returns a message corresponding to an error code, ERR_CODE, returned + from either regcomp or regexec. We don't use PREG here. + + ERR_CODE was previously called ERRCODE, but that name causes an + error with msvc8 compiler. */ size_t -regerror (errcode, preg, errbuf, errbuf_size) - int errcode; +regerror (err_code, preg, errbuf, errbuf_size) + int err_code; const regex_t *preg; char *errbuf; size_t errbuf_size; @@ -6638,15 +6641,15 @@ regerror (errcode, preg, errbuf, errbuf_size) const char *msg; size_t msg_size; - if (errcode < 0 - || errcode >= (sizeof (re_error_msgid) / sizeof (re_error_msgid[0]))) + if (err_code < 0 + || err_code >= (sizeof (re_error_msgid) / sizeof (re_error_msgid[0]))) /* Only error codes returned by the rest of the code should be passed to this routine. If we are given anything else, or if other regex code generates an invalid error code, then the program has a bug. Dump core so we can fix it. */ abort (); - msg = gettext (re_error_msgid[errcode]); + msg = gettext (re_error_msgid[err_code]); msg_size = strlen (msg) + 1; /* Includes the null. */ diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index 461df7acfba..06b1f8960f0 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h @@ -137,6 +137,16 @@ Boston, MA 02110-1301, USA. */ #define HAVE_SOCKETS 1 +/* But our select implementation doesn't allow us to make non-blocking + connects. So until that is fixed, this is necessary: */ + +#define BROKEN_NON_BLOCKING_CONNECT 1 + +/* And the select implementation does 1-byte read-ahead waiting + for received packets, so datagrams are broken too. */ + +#define BROKEN_DATAGRAM_SOCKETS 1 + /* Define this symbol if your system has the functions bcopy, etc. */ #define BSTRING @@ -376,7 +386,6 @@ typedef int pid_t; #define pclose _pclose #define putw _putw #define umask _umask -#define utime _utime #define utimbuf _utimbuf #define index strchr #define rindex strrchr @@ -385,7 +394,11 @@ typedef int pid_t; #define strnicmp _strnicmp #define stricmp _stricmp #define tzset _tzset + +#if !defined (_MSC_VER) || (_MSC_VER < 1400) #define tzname _tzname +#define utime _utime +#endif #ifdef HAVE_NTGUI #define abort w32_abort diff --git a/src/search.c b/src/search.c index 9aa49af665f..4c4fa7931a1 100644 --- a/src/search.c +++ b/src/search.c @@ -2144,8 +2144,8 @@ DEFUN ("search-forward", Fsearch_forward, Ssearch_forward, 1, 4, "MSearch: ", doc: /* Search forward from point for STRING. Set point to the end of the occurrence found, and return point. An optional second argument bounds the search; it is a buffer position. -The match found must not extend after that position. nil is equivalent - to (point-max). +The match found must not extend after that position. A value of nil is + equivalent to (point-max). Optional third argument, if t, means if fail just return nil (no error). If not nil and not t, move to limit of search and return nil. Optional fourth argument is repeat count--search for successive occurrences. diff --git a/src/sound.c b/src/sound.c index 6f8e3ecb308..b6f5ff513ee 100644 --- a/src/sound.c +++ b/src/sound.c @@ -74,8 +74,12 @@ Boston, MA 02110-1301, USA. */ #include <soundcard.h> #endif #ifdef HAVE_ALSA +#ifdef ALSA_SUBDIR_INCLUDE +#include <alsa/asoundlib.h> +#else #include <asoundlib.h> -#endif +#endif /* ALSA_SUBDIR_INCLUDE */ +#endif /* HAVE_ALSA */ /* END: Non Windows Includes */ diff --git a/src/w32.c b/src/w32.c index cbc78f8a5d5..9fe88833b4f 100644 --- a/src/w32.c +++ b/src/w32.c @@ -153,7 +153,8 @@ typedef PSID_IDENTIFIER_AUTHORITY (WINAPI * GetSidIdentifierAuthority_Proc) ( PSID pSid); /* ** A utility function ** */ -static BOOL is_windows_9x () +static BOOL +is_windows_9x () { static BOOL s_b_ret=0; OSVERSIONINFO os_ver; @@ -2871,7 +2872,8 @@ int h_errno = 0; /* function to set h_errno for compatability; map winsock error codes to normal system codes where they overlap (non-overlapping definitions are already in <sys/socket.h> */ -static void set_errno () +static void +set_errno () { if (winsock_lib == NULL) h_errno = EINVAL; @@ -2892,7 +2894,8 @@ static void set_errno () errno = h_errno; } -static void check_errno () +static void +check_errno () { if (h_errno == 0 && winsock_lib != NULL) pfn_WSASetLastError (0); @@ -3676,7 +3679,8 @@ _sys_read_ahead (int fd) return cp->status; } -int _sys_wait_accept (int fd) +int +_sys_wait_accept (int fd) { HANDLE hEv; child_process * cp; @@ -3698,10 +3702,10 @@ int _sys_wait_accept (int fd) { rc = WaitForSingleObject (hEv, INFINITE); pfn_WSAEventSelect (SOCK_HANDLE (fd), NULL, 0); - pfn_WSACloseEvent (hEv); if (rc == WAIT_OBJECT_0) cp->status = STATUS_READ_SUCCEEDED; } + pfn_WSACloseEvent (hEv); return cp->status; } @@ -4127,7 +4131,7 @@ BOOL WINAPI shutdown_handler(DWORD type) shut_down_emacs (0, 0, Qnil); } - /* Allow other handlers to handle this signal. */ + /* Allow other handlers to handle this signal. */ return FALSE; } @@ -4136,7 +4140,8 @@ BOOL WINAPI shutdown_handler(DWORD type) must always be initialized on startup even when the global variable initialized is non zero (see the function main in emacs.c). */ -void globals_of_w32 () +void +globals_of_w32 () { g_b_init_is_windows_9x = 0; g_b_init_open_process_token = 0; diff --git a/src/w32fns.c b/src/w32fns.c index 65362099bf9..29157dc356f 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -8411,6 +8411,30 @@ is set to off if the low bit of NEW-STATE is zero, otherwise on. */) } return Qnil; } + +DEFUN ("w32-window-exists-p", Fw32_window_exists_p, Sw32_window_exists_p, + 2, 2, 0, + doc: /* Return non-nil if a window exists with the specified CLASS and NAME. + +This is a direct interface to the Windows API FindWindow function. */) + (class, name) +Lisp_Object class, name; +{ + HWND hnd; + + if (!NILP (class)) + CHECK_STRING (class); + if (!NILP (name)) + CHECK_STRING (name); + + hnd = FindWindow (STRINGP (class) ? ((LPCTSTR) SDATA (class)) : NULL, + STRINGP (name) ? ((LPCTSTR) SDATA (name)) : NULL); + if (!hnd) + return Qnil; + return Qt; +} + + DEFUN ("file-system-info", Ffile_system_info, Sfile_system_info, 1, 1, 0, doc: /* Return storage information about the file system FILENAME is on. @@ -8977,6 +9001,7 @@ versions of Windows) characters. */); staticpro (&Qw32_charset_unicode); Qw32_charset_unicode = intern ("w32-charset-unicode"); + } #endif #if 0 /* TODO: Port to W32 */ @@ -9021,6 +9046,7 @@ versions of Windows) characters. */); defsubr (&Sw32_registered_hot_keys); defsubr (&Sw32_reconstruct_hot_key); defsubr (&Sw32_toggle_lock_key); + defsubr (&Sw32_window_exists_p); defsubr (&Sw32_find_bdf_fonts); defsubr (&Sfile_system_info); diff --git a/src/window.c b/src/window.c index d687c831ef6..5bd57496180 100644 --- a/src/window.c +++ b/src/window.c @@ -5727,8 +5727,10 @@ With prefix argument ARG, recenter putting point on screen line ARG relative to the current window. If ARG is negative, it counts up from the bottom of the window. (ARG should be less than the height of the window.) -If ARG is omitted or nil, erase the entire frame and then -redraw with point in the center of the current window. +If ARG is omitted or nil, erase the entire frame and then redraw with point +in the center of the current window. If `auto-resize-tool-bars' is set to +`grow-only', this resets the tool-bar's height to the minimum height needed. + Just C-u as prefix means put point in the center of the window and redisplay normally--don't erase and redraw the frame. */) (arg) @@ -5753,8 +5755,10 @@ and redisplay normally--don't erase and redraw the frame. */) for (i = 0; i < n_compositions; i++) composition_table[i]->font = NULL; - Fredraw_frame (w->frame); - SET_FRAME_GARBAGED (XFRAME (WINDOW_FRAME (w))); + WINDOW_XFRAME (w)->minimize_tool_bar_window_p = 1; + + Fredraw_frame (WINDOW_FRAME (w)); + SET_FRAME_GARBAGED (WINDOW_XFRAME (w)); center_p = 1; } else if (CONSP (arg)) /* Just C-u. */ diff --git a/src/xdisp.c b/src/xdisp.c index 63998ddf8f7..07df06785ad 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -290,10 +290,12 @@ Lisp_Object Vtool_bar_button_margin; EMACS_INT tool_bar_button_relief; -/* Non-zero means automatically resize tool-bars so that all tool-bar - items are visible, and no blank lines remain. */ +/* Non-nil means automatically resize tool-bars so that all tool-bar + items are visible, and no blank lines remain. -int auto_resize_tool_bars_p; + If value is `grow-only', only make tool-bar bigger. */ + +Lisp_Object Vauto_resize_tool_bars; /* Non-zero means draw block and hollow cursor as wide as the glyph under it. For example, if a block cursor is over a tab, it will be @@ -9854,9 +9856,16 @@ display_tool_bar_line (it, height) out:; row->displays_text_p = row->used[TEXT_AREA] != 0; - /* Use default face for the border below the tool bar. */ - if (!row->displays_text_p) + + /* Use default face for the border below the tool bar. + + FIXME: When auto-resize-tool-bars is grow-only, there is + no additional border below the possibly empty tool-bar lines. + So to make the extra empty lines look "normal", we have to + use the tool-bar face for the border too. */ + if (!row->displays_text_p && !EQ (Vauto_resize_tool_bars, Qgrow_only)) it->face_id = DEFAULT_FACE_ID; + extend_face_to_end_of_line (it); last = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA] - 1; last->right_box_line_p = 1; @@ -9878,6 +9887,7 @@ display_tool_bar_line (it, height) if (!row->displays_text_p) { row->height = row->phys_height = it->last_visible_y - row->y; + row->visible_height = row->height; row->ascent = row->phys_ascent = 0; row->extra_line_spacing = 0; } @@ -9980,7 +9990,6 @@ redisplay_tool_bar (f) struct window *w; struct it it; struct glyph_row *row; - int change_height_p = 0; #ifdef USE_GTK if (FRAME_EXTERNAL_TOOL_BAR (f)) @@ -10075,10 +10084,10 @@ redisplay_tool_bar (f) w->desired_matrix->no_scrolling_p = 1; w->must_be_updated_p = 1; - if (auto_resize_tool_bars_p) + if (!NILP (Vauto_resize_tool_bars)) { - int nlines, nrows; int max_tool_bar_height = MAX_FRAME_TOOL_BAR_HEIGHT (f); + int change_height_p = 0; /* If we couldn't display everything, change the tool-bar's height if there is room for more. */ @@ -10104,29 +10113,40 @@ redisplay_tool_bar (f) /* Resize windows as needed by changing the `tool-bar-lines' frame parameter. */ - if (change_height_p - && (nlines = tool_bar_lines_needed (f, &nrows), - nlines != WINDOW_TOTAL_LINES (w))) + if (change_height_p) { extern Lisp_Object Qtool_bar_lines; Lisp_Object frame; int old_height = WINDOW_TOTAL_LINES (w); + int nrows; + int nlines = tool_bar_lines_needed (f, &nrows); - XSETFRAME (frame, f); - Fmodify_frame_parameters (frame, - Fcons (Fcons (Qtool_bar_lines, - make_number (nlines)), - Qnil)); - if (WINDOW_TOTAL_LINES (w) != old_height) + change_height_p = ((EQ (Vauto_resize_tool_bars, Qgrow_only) + && !f->minimize_tool_bar_window_p) + ? (nlines > old_height) + : (nlines != old_height)); + f->minimize_tool_bar_window_p = 0; + + if (change_height_p) { - clear_glyph_matrix (w->desired_matrix); - f->n_tool_bar_rows = nrows; - fonts_changed_p = 1; + XSETFRAME (frame, f); + Fmodify_frame_parameters (frame, + Fcons (Fcons (Qtool_bar_lines, + make_number (nlines)), + Qnil)); + if (WINDOW_TOTAL_LINES (w) != old_height) + { + clear_glyph_matrix (w->desired_matrix); + f->n_tool_bar_rows = nrows; + fonts_changed_p = 1; + return 1; + } } } } - return change_height_p; + f->minimize_tool_bar_window_p = 0; + return 0; } @@ -13596,7 +13616,7 @@ redisplay_window (window, just_this_one_p) #else redisplay_tool_bar_p = WINDOWP (f->tool_bar_window) && (FRAME_TOOL_BAR_LINES (f) > 0 - || auto_resize_tool_bars_p); + || !NILP (Vauto_resize_tool_bars)); #endif @@ -24376,12 +24396,13 @@ Autoselection selects the minibuffer only if it is active, and never unselects the minibuffer if it is active. */); Vmouse_autoselect_window = Qnil; - DEFVAR_BOOL ("auto-resize-tool-bars", &auto_resize_tool_bars_p, + DEFVAR_LISP ("auto-resize-tool-bars", &Vauto_resize_tool_bars, doc: /* *Non-nil means automatically resize tool-bars. -This increases a tool-bar's height if not all tool-bar items are visible. -It decreases a tool-bar's height when it would display blank lines -otherwise. */); - auto_resize_tool_bars_p = 1; +This dynamically changes the tool-bar's height to the minimum height +that is needed to make all tool-bar items visible. +If value is `grow-only', the tool-bar's height is only increased +automatically; to decreace the tool-bar height, use \\[recenter]. */); + Vauto_resize_tool_bars = Qt; DEFVAR_BOOL ("auto-raise-tool-bar-buttons", &auto_raise_tool_bar_buttons_p, doc: /* *Non-nil means raise tool-bar buttons when the mouse moves over them. */); |