diff options
| author | Miles Bader | 2007-01-01 03:21:06 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-01-01 03:21:06 +0000 |
| commit | 4c34eeeee5886d14f3e60b77fb563cb549c8896f (patch) | |
| tree | af17010f0864173dd6416585f08d686377791412 /src | |
| parent | 76acf92ebe73e35528c5966a21328305ba7b5aef (diff) | |
| parent | db6292445840e2795f35ebad62a14314fc3c7c21 (diff) | |
| download | emacs-4c34eeeee5886d14f3e60b77fb563cb549c8896f.tar.gz emacs-4c34eeeee5886d14f3e60b77fb563cb549c8896f.zip | |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 563-582)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 177-185)
- Merge from emacs--devo--0
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-158
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 | |||
| 34 | # Make it work like SIGINT normally does. | 34 | # Make it work like SIGINT normally does. |
| 35 | handle SIGTSTP nopass | 35 | handle SIGTSTP nopass |
| 36 | 36 | ||
| 37 | # Pass on user signals | ||
| 38 | handle SIGUSR1 noprint pass | ||
| 39 | handle SIGUSR2 noprint pass | ||
| 40 | |||
| 37 | # Don't pass SIGALRM to Emacs. This makes problems when | 41 | # Don't pass SIGALRM to Emacs. This makes problems when |
| 38 | # debugging. | 42 | # debugging. |
| 39 | handle SIGALRM ignore | 43 | 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 | |||
| 19 | stamp-oldxmenu | 19 | stamp-oldxmenu |
| 20 | temacs | 20 | temacs |
| 21 | buildobj.lst | 21 | buildobj.lst |
| 22 | stamp_BLD | ||
diff --git a/src/ChangeLog b/src/ChangeLog index 27411da33cb..717e4cdf963 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,11 +1,165 @@ | |||
| 1 | 2006-12-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * gtkutil.c (update_frame_tool_bar): Connect create-menu-proxy with | ||
| 4 | xg_tool_bar_menu_proxy. | ||
| 5 | (xg_tool_bar_menu_proxy): New function. | ||
| 6 | (xg_tool_bar_proxy_callback): New function. | ||
| 7 | |||
| 8 | 2006-12-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 9 | |||
| 10 | * gtkutil.c (xg_tool_bar_button_cb): Save last modifier on widget. | ||
| 11 | (xg_tool_bar_callback): Remove check for button. | ||
| 12 | (update_frame_tool_bar): Put an event box in the tool bar and a button | ||
| 13 | in the event box. Attach enter/leave-notify-event to the event box. | ||
| 14 | |||
| 15 | 2006-12-30 Richard Stallman <rms@gnu.org> | ||
| 16 | |||
| 17 | * keymap.c (Fdefine_key): Doc fix. | ||
| 18 | |||
| 19 | 2006-12-29 Kim F. Storm <storm@cua.dk> | ||
| 20 | |||
| 21 | * frame.h (struct frame): New member minimize_tool_bar_window_p. | ||
| 22 | |||
| 23 | * xdisp.c (auto_resize_tool_bars_p): Replace with ... | ||
| 24 | (Vauto_resize_tool_bars): ... this. | ||
| 25 | (syms_of_xdisp): DEFVAR_LISP and initialize it. Update doc string | ||
| 26 | to describe new value `grow-only', and use of C-l. | ||
| 27 | (display_tool_bar_line): Only use default face for border below | ||
| 28 | toolbar if not grow-only (to get acceptable visual appearence). | ||
| 29 | Explicitly set visible_height for empty toolbar lines. | ||
| 30 | (redisplay_tool_bar): Handle `grow-only' setting. Check and clear | ||
| 31 | minimize_tool_bar_window_p flag. | ||
| 32 | |||
| 33 | * window.c (Frecenter): Set minimize_tool_bar_window_p flag | ||
| 34 | when called without arg to redraw with minimum toolbar height. | ||
| 35 | Update doc string. | ||
| 36 | |||
| 37 | 2006-12-29 Jason Rumney <jasonr@gnu.org> | ||
| 38 | |||
| 39 | * s/ms-w32.h (tzname): Do not define in msvc8. | ||
| 40 | (utime): Do not define in msvc8. | ||
| 41 | |||
| 42 | * regex.c (regerror): Change parameter name err_code. | ||
| 43 | |||
| 44 | 2006-12-26 Richard Stallman <rms@gnu.org> | ||
| 45 | |||
| 46 | * search.c (Fsearch_forward): Doc fix. | ||
| 47 | |||
| 48 | * callint.c (Finteractive): Doc fix. | ||
| 49 | |||
| 50 | 2006-12-25 Kim F. Storm <storm@cua.dk> | ||
| 51 | |||
| 52 | * s/ms-w32.h (BROKEN_DATAGRAM_SOCKETS): Define it. | ||
| 53 | |||
| 54 | 2006-12-23 Eli Zaretskii <eliz@gnu.org> | ||
| 55 | |||
| 56 | * keyboard.c (some_mouse_moved): Fix last change. | ||
| 57 | |||
| 58 | 2006-12-22 Eli Zaretskii <eliz@gnu.org> | ||
| 59 | |||
| 60 | * callproc.c (syms_of_callproc) <shell-file-name>: Doc fix. | ||
| 61 | |||
| 62 | 2006-12-22 Mark Davies <mark@mcs.vuw.ac.nz> | ||
| 63 | |||
| 64 | * m/amdx86-64.h, m/hp800.h: Add support for NetBSD. | ||
| 65 | * m/sh3el.h: New file. | ||
| 66 | |||
| 67 | 2006-12-22 Eli Zaretskii <eliz@gnu.org> | ||
| 68 | |||
| 69 | * makefile.w32-in (emacs, temacs): Depend on stamp_BLD instead of | ||
| 70 | $(BLD). | ||
| 71 | ($(OBJ0) $(OBJ1) $(WIN32OBJ)): New dependency on stamp_BLD. | ||
| 72 | (bootstrap-temacs): Pass $(XMFLAGS) to sub-make. | ||
| 73 | ($(OBJ0) $(OBJ1) $(WIN32OBJ)): Add lastfile.$(O) and firstfile.$(O). | ||
| 74 | (clean): Delete stamp_BLD. | ||
| 75 | |||
| 76 | 2006-12-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 77 | |||
| 78 | * macfns.c (mac_update_title_bar) [TARGET_API_MAC_CARBON]: Call | ||
| 79 | mac_update_proxy_icon also when buffer modification flag changed. | ||
| 80 | [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): Don't update alias, | ||
| 81 | but compare FSRef/FSSpec of resolved alias. | ||
| 82 | |||
| 83 | 2006-12-21 Kim F. Storm <storm@cua.dk> | ||
| 84 | |||
| 85 | * w32.c (_sys_wait_accept): Fix handle leak. | ||
| 86 | |||
| 87 | 2006-12-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 88 | |||
| 89 | * sound.c: Include <alsa/asoundlib.h> if ALSA_SUBDIR_INCLUDE is | ||
| 90 | defined. | ||
| 91 | |||
| 92 | 2006-12-20 Kim F. Storm <storm@cua.dk> | ||
| 93 | |||
| 94 | * s/ms-w32.h (BROKEN_NON_BLOCKING_CONNECT): Define it. | ||
| 95 | |||
| 96 | 2006-12-19 Juanma Barranquero <lekktu@gmail.com> | ||
| 97 | |||
| 98 | * keyboard.c (syms_of_keyboard) <double-click-time>: | ||
| 99 | * mac.c (Fmac_code_convert_string): | ||
| 100 | * search.c (Fsearch_forward): Doc fixes. | ||
| 101 | |||
| 102 | 2006-12-19 Kim F. Storm <storm@cua.dk> | ||
| 103 | |||
| 104 | Rework 2006-12-04 change. A SIGUSR1 (SIGUSR2) signal now generates | ||
| 105 | a sigusr1 event instead of [signal usr1] sequence, and signal events | ||
| 106 | are now supposed to be handled via special-event-map. | ||
| 107 | |||
| 108 | * keyboard.c (kbd_buffer_store_event_hold): Undo 2006-12-04 change. | ||
| 109 | (make_lispy_event): Don't generate Qsignal prefix for code 0. | ||
| 110 | Abort if signal code is unknown. | ||
| 111 | (store_user_signal_events): Don't make Qsignal prefix (code 0). | ||
| 112 | (Qsignal): Move declaration back to process.c. | ||
| 113 | (syms_of_keyboard): Don't intern or staticpro it here. | ||
| 114 | |||
| 115 | * process.c (Qsignal): Declare here. | ||
| 116 | (syms_of_process): Intern or staticpro it. | ||
| 117 | |||
| 118 | * emacs.c (main): Rename user signals to sigusr1 and sigusr2. | ||
| 119 | |||
| 120 | * .gdbinit: Pass on SIGUSR1 and SIGUSR2 to Emacs. | ||
| 121 | |||
| 122 | 2006-12-19 Juanma Barranquero <lekktu@gmail.com> | ||
| 123 | |||
| 124 | * buffer.c (syms_of_buffer) <buffer-display-table> | ||
| 125 | <scroll-up-aggressively, scroll-down-aggressively>: Doc fixes. | ||
| 126 | |||
| 127 | 2006-12-17 Richard Stallman <rms@gnu.org> | ||
| 128 | |||
| 129 | * fileio.c (Fread_file_name_internal): Pass Vread_file_name_predicate | ||
| 130 | to Ffile_name_completion. | ||
| 131 | |||
| 132 | * dired.c (file_name_completion): New arg PREDICATE. Some cleanup. | ||
| 133 | (Ffile_name_completion): New arg PREDICATE. | ||
| 134 | |||
| 135 | 2006-12-17 Juanma Barranquero <lekktu@gmail.com> | ||
| 136 | |||
| 137 | * buffer.c (Fkill_buffer): Doc fix. | ||
| 138 | (syms_of_buffer) <kill-buffer-query-functions>: Doc fix. | ||
| 139 | |||
| 140 | 2006-12-16 Juanma Barranquero <lekktu@gmail.com> | ||
| 141 | |||
| 142 | * minibuf.c (Ftry_completion): Check that obarray buckets are symbols. | ||
| 143 | |||
| 144 | 2006-12-16 Eli Zaretskii <eliz@gnu.org> | ||
| 145 | |||
| 146 | * w32fns.c (w32-window-exists-p): New function. | ||
| 147 | (syms_of_w32fns): Defsubr it. | ||
| 148 | |||
| 149 | * prefix-args.c [STDC_HEADERS]: Include stdlib.h. | ||
| 150 | |||
| 151 | 2006-12-16 Juanma Barranquero <lekktu@gmail.com> | ||
| 152 | |||
| 153 | * minibuf.c (Ftry_completion): Use `check_obarray' if ALIST is a vector. | ||
| 154 | |||
| 1 | 2006-12-15 Eli Zaretskii <eliz@gnu.org> | 155 | 2006-12-15 Eli Zaretskii <eliz@gnu.org> |
| 2 | 156 | ||
| 3 | * emacs.c (USAGE3): Clarify documentation of --color. | 157 | * emacs.c (USAGE3): Clarify documentation of --color. |
| 4 | 158 | ||
| 5 | 2006-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 159 | 2006-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 6 | 160 | ||
| 7 | * mac.c (wakeup_from_rne_enabled_p) [TARGET_API_MAC_CARBON]: New | 161 | * mac.c (wakeup_from_rne_enabled_p) [TARGET_API_MAC_CARBON]: |
| 8 | variable. | 162 | New variable. |
| 9 | (ENABLE_WAKEUP_FROM_RNE, DISABLE_WAKEUP_FROM_RNE): New macros. | 163 | (ENABLE_WAKEUP_FROM_RNE, DISABLE_WAKEUP_FROM_RNE): New macros. |
| 10 | [!MAC_OSX] (select): Use them. | 164 | [!MAC_OSX] (select): Use them. |
| 11 | [MAC_OSX] (select_and_poll_event, sys_select): Likewise. | 165 | [MAC_OSX] (select_and_poll_event, sys_select): Likewise. |
| @@ -20,7 +174,7 @@ | |||
| 20 | 174 | ||
| 21 | * macterm.c (mac_query_char_extents) [USE_ATSUI]: Don't call | 175 | * macterm.c (mac_query_char_extents) [USE_ATSUI]: Don't call |
| 22 | ATSUGetGlyphBounds if not necessary. | 176 | ATSUGetGlyphBounds if not necessary. |
| 23 | (Vmac_atsu_font_table) [USE_ATSUI]: Remove Variable. | 177 | (Vmac_atsu_font_table) [USE_ATSUI]: Remove variable. |
| 24 | (syms_of_macterm) [USE_ATSUI]: Don't defvar it. | 178 | (syms_of_macterm) [USE_ATSUI]: Don't defvar it. |
| 25 | (fm_get_style_from_font, atsu_find_font_from_family_name) | 179 | (fm_get_style_from_font, atsu_find_font_from_family_name) |
| 26 | (atsu_find_font_family_name, mac_atsu_font_face_attributes) | 180 | (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'." | |||
| 1332 | */ | 1332 | */ |
| 1333 | DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 1, 1, "bKill buffer: ", | 1333 | DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 1, 1, "bKill buffer: ", |
| 1334 | doc: /* Kill the buffer BUFFER. | 1334 | doc: /* Kill the buffer BUFFER. |
| 1335 | The argument may be a buffer or may be the name of a buffer. | 1335 | The argument may be a buffer or the name of a buffer. |
| 1336 | An argument of nil means kill the current buffer. | 1336 | With a nil argument, kill the current buffer. |
| 1337 | 1337 | ||
| 1338 | Value is t if the buffer is actually killed, nil if user says no. | 1338 | Value is t if the buffer is actually killed, nil otherwise. |
| 1339 | 1339 | ||
| 1340 | The value of `kill-buffer-hook' (which may be local to that buffer), | 1340 | The functions in `kill-buffer-query-functions' are called with BUFFER as |
| 1341 | if not void, is a list of functions to be called, with no arguments, | 1341 | the current buffer. If any of them returns nil, the buffer is not killed. |
| 1342 | before the buffer is actually killed. The buffer to be killed is current | 1342 | |
| 1343 | when the hook functions are called. | 1343 | The hook `kill-buffer-hook' is run before the buffer is actually killed. |
| 1344 | The buffer being killed will be current while the hook is running. | ||
| 1344 | 1345 | ||
| 1345 | Any processes that have this buffer as the `process-buffer' are killed | 1346 | Any processes that have this buffer as the `process-buffer' are killed |
| 1346 | with SIGHUP. */) | 1347 | with SIGHUP. */) |
| @@ -5371,8 +5372,8 @@ This is the same as (default-value 'fill-column). */); | |||
| 5371 | This is the same as (default-value 'left-margin). */); | 5372 | This is the same as (default-value 'left-margin). */); |
| 5372 | 5373 | ||
| 5373 | DEFVAR_LISP_NOPRO ("default-tab-width", | 5374 | DEFVAR_LISP_NOPRO ("default-tab-width", |
| 5374 | &buffer_defaults.tab_width, | 5375 | &buffer_defaults.tab_width, |
| 5375 | doc: /* Default value of `tab-width' for buffers that do not override it. | 5376 | doc: /* Default value of `tab-width' for buffers that do not override it. |
| 5376 | This is the same as (default-value 'tab-width). */); | 5377 | This is the same as (default-value 'tab-width). */); |
| 5377 | 5378 | ||
| 5378 | DEFVAR_LISP_NOPRO ("default-case-fold-search", | 5379 | 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. | |||
| 5694 | Each of the char-table elements control how to display the corresponding | 5695 | Each of the char-table elements control how to display the corresponding |
| 5695 | text character: the element at index C in the table says how to display | 5696 | text character: the element at index C in the table says how to display |
| 5696 | the character whose code is C. Each element should be a vector of | 5697 | the character whose code is C. Each element should be a vector of |
| 5697 | characters or nil. nil means display the character in the default fashion; | 5698 | characters or nil. The value nil means display the character in the |
| 5698 | otherwise, the characters from the vector are delivered to the screen | 5699 | default fashion; otherwise, the characters from the vector are delivered |
| 5699 | instead of the original character. | 5700 | to the screen instead of the original character. |
| 5700 | 5701 | ||
| 5701 | For example, (aset buffer-display-table ?X ?Y) will cause Emacs to display | 5702 | For example, (aset buffer-display-table ?X ?Y) will cause Emacs to display |
| 5702 | a capital Y instead of each X character. | 5703 | a capital Y instead of each X character. |
| @@ -5827,7 +5828,7 @@ cursor type. */); | |||
| 5827 | ¤t_buffer->scroll_up_aggressively, Qnil, | 5828 | ¤t_buffer->scroll_up_aggressively, Qnil, |
| 5828 | doc: /* How far to scroll windows upward. | 5829 | doc: /* How far to scroll windows upward. |
| 5829 | If you move point off the bottom, the window scrolls automatically. | 5830 | If you move point off the bottom, the window scrolls automatically. |
| 5830 | This variable controls how far it scrolls. nil, the default, | 5831 | This variable controls how far it scrolls. The value nil, the default, |
| 5831 | means scroll to center point. A fraction means scroll to put point | 5832 | means scroll to center point. A fraction means scroll to put point |
| 5832 | that fraction of the window's height from the bottom of the window. | 5833 | that fraction of the window's height from the bottom of the window. |
| 5833 | When the value is 0.0, point goes at the bottom line, which in the simple | 5834 | 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. */); | |||
| 5840 | ¤t_buffer->scroll_down_aggressively, Qnil, | 5841 | ¤t_buffer->scroll_down_aggressively, Qnil, |
| 5841 | doc: /* How far to scroll windows downward. | 5842 | doc: /* How far to scroll windows downward. |
| 5842 | If you move point off the top, the window scrolls automatically. | 5843 | If you move point off the top, the window scrolls automatically. |
| 5843 | This variable controls how far it scrolls. nil, the default, | 5844 | This variable controls how far it scrolls. The value nil, the default, |
| 5844 | means scroll to center point. A fraction means scroll to put point | 5845 | means scroll to center point. A fraction means scroll to put point |
| 5845 | that fraction of the window's height from the top of the window. | 5846 | that fraction of the window's height from the top of the window. |
| 5846 | When the value is 0.0, point goes at the top line, which in the simple | 5847 | 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. */); | |||
| 6031 | Vinhibit_read_only = Qnil; | 6032 | Vinhibit_read_only = Qnil; |
| 6032 | 6033 | ||
| 6033 | DEFVAR_PER_BUFFER ("cursor-type", ¤t_buffer->cursor_type, Qnil, | 6034 | DEFVAR_PER_BUFFER ("cursor-type", ¤t_buffer->cursor_type, Qnil, |
| 6034 | doc: /* Cursor to use when this buffer is in the selected window. | 6035 | doc: /* Cursor to use when this buffer is in the selected window. |
| 6035 | Values are interpreted as follows: | 6036 | Values are interpreted as follows: |
| 6036 | 6037 | ||
| 6037 | t use the cursor specified for the frame | 6038 | 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. */) | |||
| 6056 | 6057 | ||
| 6057 | DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows", | 6058 | DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows", |
| 6058 | ¤t_buffer->cursor_in_non_selected_windows, Qnil, | 6059 | ¤t_buffer->cursor_in_non_selected_windows, Qnil, |
| 6059 | doc: /* *Cursor type to display in non-selected windows. | 6060 | doc: /* *Cursor type to display in non-selected windows. |
| 6060 | The value t means to use hollow box cursor. See `cursor-type' for other values. */); | 6061 | The value t means to use hollow box cursor. See `cursor-type' for other values. */); |
| 6061 | 6062 | ||
| 6062 | DEFVAR_LISP ("kill-buffer-query-functions", &Vkill_buffer_query_functions, | 6063 | DEFVAR_LISP ("kill-buffer-query-functions", &Vkill_buffer_query_functions, |
| 6063 | doc: /* List of functions called with no args to query before killing a buffer. */); | 6064 | doc: /* List of functions called with no args to query before killing a buffer. |
| 6065 | The buffer being killed will be current while the functions are running. | ||
| 6066 | If any of them returns nil, the buffer is not killed. */); | ||
| 6064 | Vkill_buffer_query_functions = Qnil; | 6067 | Vkill_buffer_query_functions = Qnil; |
| 6065 | 6068 | ||
| 6066 | DEFVAR_LISP ("change-major-mode-hook", &Vchange_major_mode_hook, | 6069 | 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; | |||
| 60 | 60 | ||
| 61 | /* String for the prompt text used in Fcall_interactively. */ | 61 | /* String for the prompt text used in Fcall_interactively. */ |
| 62 | static Lisp_Object callint_message; | 62 | static Lisp_Object callint_message; |
| 63 | 63 | ||
| 64 | /* ARGSUSED */ | 64 | /* ARGSUSED */ |
| 65 | DEFUN ("interactive", Finteractive, Sinteractive, 0, UNEVALLED, 0, | 65 | DEFUN ("interactive", Finteractive, Sinteractive, 0, UNEVALLED, 0, |
| 66 | doc: /* Specify a way of parsing arguments for interactive use of a function. | 66 | 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). | |||
| 102 | m -- Value of mark as number. Does not do I/O. | 102 | m -- Value of mark as number. Does not do I/O. |
| 103 | M -- Any string. Inherits the current input method. | 103 | M -- Any string. Inherits the current input method. |
| 104 | n -- Number read using minibuffer. | 104 | n -- Number read using minibuffer. |
| 105 | N -- Raw prefix arg, or if none, do like code `n'. | 105 | N -- Numeric prefix arg, or if none, do like code `n'. |
| 106 | p -- Prefix arg converted to number. Does not do I/O. | 106 | p -- Prefix arg converted to number. Does not do I/O. |
| 107 | P -- Prefix arg in raw form. Does not do I/O. | 107 | P -- Prefix arg in raw form. Does not do I/O. |
| 108 | r -- Region: point and mark as 2 numeric args, smallest first. Does no I/O. | 108 | 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 | |||
| 688 | Qnil, Qnil, Qnil, Qt); | 688 | Qnil, Qnil, Qnil, Qt); |
| 689 | break; | 689 | break; |
| 690 | 690 | ||
| 691 | case 'N': /* Prefix arg, else number from minibuffer */ | 691 | case 'N': /* Prefix arg as number, else number from minibuffer */ |
| 692 | if (!NILP (prefix_arg)) | 692 | if (!NILP (prefix_arg)) |
| 693 | goto have_prefix_arg; | 693 | goto have_prefix_arg; |
| 694 | case 'n': /* Read number from minibuffer. */ | 694 | 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 () | |||
| 1553 | 1553 | ||
| 1554 | DEFVAR_LISP ("shell-file-name", &Vshell_file_name, | 1554 | DEFVAR_LISP ("shell-file-name", &Vshell_file_name, |
| 1555 | doc: /* *File name to load inferior shells from. | 1555 | doc: /* *File name to load inferior shells from. |
| 1556 | Initialized from the SHELL environment variable. */); | 1556 | Initialized from the SHELL environment variable, or to a system-dependent |
| 1557 | default if SHELL is not set. */); | ||
| 1557 | 1558 | ||
| 1558 | DEFVAR_LISP ("exec-path", &Vexec_path, | 1559 | DEFVAR_LISP ("exec-path", &Vexec_path, |
| 1559 | doc: /* *List of directories to search programs to run in subprocesses. | 1560 | 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. */ | |||
| 121 | don't. */ | 121 | don't. */ |
| 122 | #undef HAVE_DECL_SYS_SIGLIST | 122 | #undef HAVE_DECL_SYS_SIGLIST |
| 123 | 123 | ||
| 124 | /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. | ||
| 125 | */ | ||
| 126 | #undef HAVE_DECL_TZNAME | ||
| 127 | |||
| 124 | /* Define to 1 if you have the declaration of `__sys_siglist', and to 0 if you | 128 | /* Define to 1 if you have the declaration of `__sys_siglist', and to 0 if you |
| 125 | don't. */ | 129 | don't. */ |
| 126 | #undef HAVE_DECL___SYS_SIGLIST | 130 | #undef HAVE_DECL___SYS_SIGLIST |
| @@ -248,6 +252,9 @@ Boston, MA 02110-1301, USA. */ | |||
| 248 | /* Define to 1 if you have the `gtk_file_selection_new' function. */ | 252 | /* Define to 1 if you have the `gtk_file_selection_new' function. */ |
| 249 | #undef HAVE_GTK_FILE_SELECTION_NEW | 253 | #undef HAVE_GTK_FILE_SELECTION_NEW |
| 250 | 254 | ||
| 255 | /* Define to 1 if you have the `gtk_main' function. */ | ||
| 256 | #undef HAVE_GTK_MAIN | ||
| 257 | |||
| 251 | /* Define to 1 if GTK can handle more than one display. */ | 258 | /* Define to 1 if GTK can handle more than one display. */ |
| 252 | #undef HAVE_GTK_MULTIDISPLAY | 259 | #undef HAVE_GTK_MULTIDISPLAY |
| 253 | 260 | ||
| @@ -808,7 +815,7 @@ Boston, MA 02110-1301, USA. */ | |||
| 808 | 815 | ||
| 809 | /* If using the C implementation of alloca, define if you know the | 816 | /* If using the C implementation of alloca, define if you know the |
| 810 | direction of stack growth for your system; otherwise it will be | 817 | direction of stack growth for your system; otherwise it will be |
| 811 | automatically deduced at run-time. | 818 | automatically deduced at runtime. |
| 812 | STACK_DIRECTION > 0 => grows toward higher addresses | 819 | STACK_DIRECTION > 0 => grows toward higher addresses |
| 813 | STACK_DIRECTION < 0 => grows toward lower addresses | 820 | STACK_DIRECTION < 0 => grows toward lower addresses |
| 814 | STACK_DIRECTION = 0 => direction of growth unknown */ | 821 | 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) | |||
| 1264 | XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, | 1264 | XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, |
| 1265 | tem1); | 1265 | tem1); |
| 1266 | 1266 | ||
| 1267 | /* Set `buffer' and `frame' slots for thebinding now loaded. */ | 1267 | /* Set `buffer' and `frame' slots for the binding now loaded. */ |
| 1268 | XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, buf); | 1268 | XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, buf); |
| 1269 | XBUFFER_LOCAL_VALUE (valcontents)->frame = selected_frame; | 1269 | XBUFFER_LOCAL_VALUE (valcontents)->frame = selected_frame; |
| 1270 | } | 1270 | } |
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 | |||
| 396 | Lisp_Object file_name_completion (); | 396 | Lisp_Object file_name_completion (); |
| 397 | 397 | ||
| 398 | DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion, | 398 | DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion, |
| 399 | 2, 2, 0, | 399 | 2, 3, 0, |
| 400 | doc: /* Complete file name FILE in directory DIRECTORY. | 400 | doc: /* Complete file name FILE in directory DIRECTORY. |
| 401 | Returns the longest string | 401 | Returns the longest string |
| 402 | common to all file names in DIRECTORY that start with FILE. | 402 | common to all file names in DIRECTORY that start with FILE. |
| 403 | If there is only one and FILE matches it exactly, returns t. | 403 | If there is only one and FILE matches it exactly, returns t. |
| 404 | Returns nil if DIRECTORY contains no name starting with FILE. | 404 | Returns nil if DIRECTORY contains no name starting with FILE. |
| 405 | 405 | ||
| 406 | If PREDICATE is non-nil, call PREDICATE with each possible | ||
| 407 | completion (in absolute form) and ignore it if PREDICATE returns nil. | ||
| 408 | |||
| 406 | This function ignores some of the possible completions as | 409 | This function ignores some of the possible completions as |
| 407 | determined by the variable `completion-ignored-extensions', which see. */) | 410 | determined by the variable `completion-ignored-extensions', which see. */) |
| 408 | (file, directory) | 411 | (file, directory, predicate) |
| 409 | Lisp_Object file, directory; | 412 | Lisp_Object file, directory, predicate; |
| 410 | { | 413 | { |
| 411 | Lisp_Object handler; | 414 | Lisp_Object handler; |
| 412 | 415 | ||
| @@ -414,15 +417,15 @@ determined by the variable `completion-ignored-extensions', which see. */) | |||
| 414 | call the corresponding file handler. */ | 417 | call the corresponding file handler. */ |
| 415 | handler = Ffind_file_name_handler (directory, Qfile_name_completion); | 418 | handler = Ffind_file_name_handler (directory, Qfile_name_completion); |
| 416 | if (!NILP (handler)) | 419 | if (!NILP (handler)) |
| 417 | return call3 (handler, Qfile_name_completion, file, directory); | 420 | return call4 (handler, Qfile_name_completion, file, directory, predicate); |
| 418 | 421 | ||
| 419 | /* If the file name has special constructs in it, | 422 | /* If the file name has special constructs in it, |
| 420 | call the corresponding file handler. */ | 423 | call the corresponding file handler. */ |
| 421 | handler = Ffind_file_name_handler (file, Qfile_name_completion); | 424 | handler = Ffind_file_name_handler (file, Qfile_name_completion); |
| 422 | if (!NILP (handler)) | 425 | if (!NILP (handler)) |
| 423 | return call3 (handler, Qfile_name_completion, file, directory); | 426 | return call4 (handler, Qfile_name_completion, file, directory, predicate); |
| 424 | 427 | ||
| 425 | return file_name_completion (file, directory, 0, 0); | 428 | return file_name_completion (file, directory, 0, 0, predicate); |
| 426 | } | 429 | } |
| 427 | 430 | ||
| 428 | DEFUN ("file-name-all-completions", Ffile_name_all_completions, | 431 | 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. */) | |||
| 446 | if (!NILP (handler)) | 449 | if (!NILP (handler)) |
| 447 | return call3 (handler, Qfile_name_all_completions, file, directory); | 450 | return call3 (handler, Qfile_name_all_completions, file, directory); |
| 448 | 451 | ||
| 449 | return file_name_completion (file, directory, 1, 0); | 452 | return file_name_completion (file, directory, 1, 0, Qnil); |
| 450 | } | 453 | } |
| 451 | 454 | ||
| 452 | static int file_name_completion_stat (); | 455 | static int file_name_completion_stat (); |
| 453 | 456 | ||
| 454 | Lisp_Object | 457 | Lisp_Object |
| 455 | file_name_completion (file, dirname, all_flag, ver_flag) | 458 | file_name_completion (file, dirname, all_flag, ver_flag, predicate) |
| 456 | Lisp_Object file, dirname; | 459 | Lisp_Object file, dirname; |
| 457 | int all_flag, ver_flag; | 460 | int all_flag, ver_flag; |
| 461 | Lisp_Object predicate; | ||
| 458 | { | 462 | { |
| 459 | DIR *d; | 463 | DIR *d; |
| 460 | int bestmatchsize = 0, skip; | 464 | int bestmatchsize = 0, skip; |
| 461 | register int compare, matchsize; | 465 | register int compare, matchsize; |
| 462 | unsigned char *p1, *p2; | 466 | unsigned char *p1, *p2; |
| 463 | int matchcount = 0; | 467 | int matchcount = 0; |
| 468 | /* If ALL_FLAG is 1, BESTMATCH is the list of all matches, decoded. | ||
| 469 | If ALL_FLAG is 0, BESTMATCH is either nil | ||
| 470 | or the best match so far, not decoded. */ | ||
| 464 | Lisp_Object bestmatch, tem, elt, name; | 471 | Lisp_Object bestmatch, tem, elt, name; |
| 465 | Lisp_Object encoded_file; | 472 | Lisp_Object encoded_file; |
| 466 | Lisp_Object encoded_dir; | 473 | Lisp_Object encoded_dir; |
| @@ -568,8 +575,8 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 568 | #ifndef TRIVIAL_DIRECTORY_ENTRY | 575 | #ifndef TRIVIAL_DIRECTORY_ENTRY |
| 569 | #define TRIVIAL_DIRECTORY_ENTRY(n) (!strcmp (n, ".") || !strcmp (n, "..")) | 576 | #define TRIVIAL_DIRECTORY_ENTRY(n) (!strcmp (n, ".") || !strcmp (n, "..")) |
| 570 | #endif | 577 | #endif |
| 571 | /* "." and ".." are never interesting as completions, but are | 578 | /* "." and ".." are never interesting as completions, and are |
| 572 | actually in the way in a directory contains only one file. */ | 579 | actually in the way in a directory with only one file. */ |
| 573 | if (!passcount && TRIVIAL_DIRECTORY_ENTRY (dp->d_name)) | 580 | if (!passcount && TRIVIAL_DIRECTORY_ENTRY (dp->d_name)) |
| 574 | continue; | 581 | continue; |
| 575 | if (!passcount && len > SCHARS (encoded_file)) | 582 | if (!passcount && len > SCHARS (encoded_file)) |
| @@ -650,30 +657,38 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 650 | continue; | 657 | continue; |
| 651 | } | 658 | } |
| 652 | 659 | ||
| 653 | /* Update computation of how much all possible completions match */ | 660 | /* This is a possible completion */ |
| 661 | if (directoryp) | ||
| 662 | { | ||
| 663 | /* This completion is a directory; make it end with '/' */ | ||
| 664 | name = Ffile_name_as_directory (make_string (dp->d_name, len)); | ||
| 665 | } | ||
| 666 | else | ||
| 667 | name = make_string (dp->d_name, len); | ||
| 668 | |||
| 669 | /* Test the predicate, if any. */ | ||
| 670 | |||
| 671 | if (!NILP (predicate)) | ||
| 672 | { | ||
| 673 | Lisp_Object decoded; | ||
| 674 | decoded = Fexpand_file_name (DECODE_FILE (name), dirname); | ||
| 675 | if (NILP (call1 (predicate, decoded))) | ||
| 676 | continue; | ||
| 677 | } | ||
| 678 | |||
| 679 | /* Suitably record this match. */ | ||
| 654 | 680 | ||
| 655 | matchcount++; | 681 | matchcount++; |
| 656 | 682 | ||
| 657 | if (all_flag || NILP (bestmatch)) | 683 | if (all_flag) |
| 658 | { | 684 | { |
| 659 | /* This is a possible completion */ | 685 | name = DECODE_FILE (name); |
| 660 | if (directoryp) | 686 | bestmatch = Fcons (name, bestmatch); |
| 661 | { | 687 | } |
| 662 | /* This completion is a directory; make it end with '/' */ | 688 | else if (NILP (bestmatch)) |
| 663 | name = Ffile_name_as_directory (make_string (dp->d_name, len)); | 689 | { |
| 664 | } | 690 | bestmatch = name; |
| 665 | else | 691 | bestmatchsize = SCHARS (name); |
| 666 | name = make_string (dp->d_name, len); | ||
| 667 | if (all_flag) | ||
| 668 | { | ||
| 669 | name = DECODE_FILE (name); | ||
| 670 | bestmatch = Fcons (name, bestmatch); | ||
| 671 | } | ||
| 672 | else | ||
| 673 | { | ||
| 674 | bestmatch = name; | ||
| 675 | bestmatchsize = SCHARS (name); | ||
| 676 | } | ||
| 677 | } | 692 | } |
| 678 | else | 693 | else |
| 679 | { | 694 | { |
| @@ -709,11 +724,7 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 709 | == SCHARS (bestmatch))) | 724 | == SCHARS (bestmatch))) |
| 710 | && !bcmp (p2, SDATA (encoded_file), SCHARS (encoded_file)) | 725 | && !bcmp (p2, SDATA (encoded_file), SCHARS (encoded_file)) |
| 711 | && bcmp (p1, SDATA (encoded_file), SCHARS (encoded_file)))) | 726 | && bcmp (p1, SDATA (encoded_file), SCHARS (encoded_file)))) |
| 712 | { | 727 | bestmatch = name; |
| 713 | bestmatch = make_string (dp->d_name, len); | ||
| 714 | if (directoryp) | ||
| 715 | bestmatch = Ffile_name_as_directory (bestmatch); | ||
| 716 | } | ||
| 717 | } | 728 | } |
| 718 | 729 | ||
| 719 | /* If this dirname all matches, see if implicit following | 730 | /* If this dirname all matches, see if implicit following |
| @@ -836,7 +847,7 @@ DEFUN ("file-name-all-versions", Ffile_name_all_versions, | |||
| 836 | (file, directory) | 847 | (file, directory) |
| 837 | Lisp_Object file, directory; | 848 | Lisp_Object file, directory; |
| 838 | { | 849 | { |
| 839 | return file_name_completion (file, directory, 1, 1); | 850 | return file_name_completion (file, directory, 1, 1, Qnil); |
| 840 | } | 851 | } |
| 841 | 852 | ||
| 842 | DEFUN ("file-version-limit", Ffile_version_limit, Sfile_version_limit, 1, 1, 0, | 853 | 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 | |||
| 1196 | signal (SIGILL, fatal_error_signal); | 1196 | signal (SIGILL, fatal_error_signal); |
| 1197 | signal (SIGTRAP, fatal_error_signal); | 1197 | signal (SIGTRAP, fatal_error_signal); |
| 1198 | #ifdef SIGUSR1 | 1198 | #ifdef SIGUSR1 |
| 1199 | add_user_signal (SIGUSR1, "usr1"); | 1199 | add_user_signal (SIGUSR1, "sigusr1"); |
| 1200 | #endif | 1200 | #endif |
| 1201 | #ifdef SIGUSR2 | 1201 | #ifdef SIGUSR2 |
| 1202 | add_user_signal (SIGUSR2, "usr2"); | 1202 | add_user_signal (SIGUSR2, "sigusr2"); |
| 1203 | #endif | 1203 | #endif |
| 1204 | #ifdef SIGABRT | 1204 | #ifdef SIGABRT |
| 1205 | signal (SIGABRT, fatal_error_signal); | 1205 | 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 | |||
| 6075 | if (NILP (action)) | 6075 | if (NILP (action)) |
| 6076 | { | 6076 | { |
| 6077 | specdir = Ffile_name_directory (string); | 6077 | specdir = Ffile_name_directory (string); |
| 6078 | val = Ffile_name_completion (name, realdir); | 6078 | val = Ffile_name_completion (name, realdir, Vread_file_name_predicate); |
| 6079 | UNGCPRO; | 6079 | UNGCPRO; |
| 6080 | if (!STRINGP (val)) | 6080 | if (!STRINGP (val)) |
| 6081 | { | 6081 | { |
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 | |||
| 484 | 484 | ||
| 485 | /* Set to non-zero when current redisplay has updated frame. */ | 485 | /* Set to non-zero when current redisplay has updated frame. */ |
| 486 | unsigned updated_p : 1; | 486 | unsigned updated_p : 1; |
| 487 | |||
| 488 | /* Set to non-zero to minimize tool-bar height even when | ||
| 489 | auto-resize-tool-bar is set to grow-only. */ | ||
| 490 | unsigned minimize_tool_bar_window_p : 1; | ||
| 487 | }; | 491 | }; |
| 488 | 492 | ||
| 489 | #ifdef MULTI_KBOARD | 493 | #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) | |||
| 3350 | get them. */ | 3350 | get them. */ |
| 3351 | #define XG_TOOL_BAR_LAST_MODIFIER "emacs-tool-bar-modifier" | 3351 | #define XG_TOOL_BAR_LAST_MODIFIER "emacs-tool-bar-modifier" |
| 3352 | 3352 | ||
| 3353 | 3353 | /* The key for storing the button widget in its proxy menu item. */ | |
| 3354 | /* Callback function invoked when a tool bar item is pressed. | 3354 | #define XG_TOOL_BAR_PROXY_BUTTON "emacs-tool-bar-proxy-button" |
| 3355 | W is the button widget in the tool bar that got pressed, | ||
| 3356 | CLIENT_DATA is an integer that is the index of the button in the | ||
| 3357 | tool bar. 0 is the first button. */ | ||
| 3358 | 3355 | ||
| 3359 | static gboolean | 3356 | static gboolean |
| 3360 | xg_tool_bar_button_cb (widget, event, user_data) | 3357 | xg_tool_bar_button_cb (widget, event, user_data) |
| @@ -3364,11 +3361,16 @@ xg_tool_bar_button_cb (widget, event, user_data) | |||
| 3364 | { | 3361 | { |
| 3365 | /* Casts to avoid warnings when gpointer is 64 bits and int is 32 bits */ | 3362 | /* Casts to avoid warnings when gpointer is 64 bits and int is 32 bits */ |
| 3366 | gpointer ptr = (gpointer) (EMACS_INT) event->state; | 3363 | gpointer ptr = (gpointer) (EMACS_INT) event->state; |
| 3367 | g_object_set_data (G_OBJECT (user_data), XG_TOOL_BAR_LAST_MODIFIER, ptr); | 3364 | g_object_set_data (G_OBJECT (widget), XG_TOOL_BAR_LAST_MODIFIER, ptr); |
| 3368 | return FALSE; | 3365 | return FALSE; |
| 3369 | } | 3366 | } |
| 3370 | 3367 | ||
| 3371 | 3368 | ||
| 3369 | /* Callback function invoked when a tool bar item is pressed. | ||
| 3370 | W is the button widget in the tool bar that got pressed, | ||
| 3371 | CLIENT_DATA is an integer that is the index of the button in the | ||
| 3372 | tool bar. 0 is the first button. */ | ||
| 3373 | |||
| 3372 | static void | 3374 | static void |
| 3373 | xg_tool_bar_callback (w, client_data) | 3375 | xg_tool_bar_callback (w, client_data) |
| 3374 | GtkWidget *w; | 3376 | GtkWidget *w; |
| @@ -3406,6 +3408,92 @@ xg_tool_bar_callback (w, client_data) | |||
| 3406 | kbd_buffer_store_event (&event); | 3408 | kbd_buffer_store_event (&event); |
| 3407 | } | 3409 | } |
| 3408 | 3410 | ||
| 3411 | /* Callback function invoked when a tool bar item is pressed in a detached | ||
| 3412 | tool bar or the overflow drop down menu. | ||
| 3413 | We just call xg_tool_bar_callback. | ||
| 3414 | W is the menu item widget that got pressed, | ||
| 3415 | CLIENT_DATA is an integer that is the index of the button in the | ||
| 3416 | tool bar. 0 is the first button. */ | ||
| 3417 | |||
| 3418 | static void | ||
| 3419 | xg_tool_bar_proxy_callback (w, client_data) | ||
| 3420 | GtkWidget *w; | ||
| 3421 | gpointer client_data; | ||
| 3422 | { | ||
| 3423 | GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w), | ||
| 3424 | XG_TOOL_BAR_PROXY_BUTTON)); | ||
| 3425 | xg_tool_bar_callback (wbutton, client_data); | ||
| 3426 | } | ||
| 3427 | |||
| 3428 | /* This callback is called when a tool item should create a proxy item, | ||
| 3429 | such as for the overflow menu. Also called when the tool bar is detached. | ||
| 3430 | If we don't create a proxy menu item, the detached tool bar will be | ||
| 3431 | blank. */ | ||
| 3432 | |||
| 3433 | static gboolean | ||
| 3434 | xg_tool_bar_menu_proxy (toolitem, user_data) | ||
| 3435 | GtkToolItem *toolitem; | ||
| 3436 | gpointer user_data; | ||
| 3437 | { | ||
| 3438 | GtkWidget *weventbox = gtk_bin_get_child (GTK_BIN (toolitem)); | ||
| 3439 | GtkButton *wbutton = GTK_BUTTON (gtk_bin_get_child (GTK_BIN (weventbox))); | ||
| 3440 | GtkWidget *wmenuitem = gtk_image_menu_item_new (); | ||
| 3441 | GtkWidget *wmenuimage; | ||
| 3442 | |||
| 3443 | if (gtk_button_get_use_stock (wbutton)) | ||
| 3444 | wmenuimage = gtk_image_new_from_stock (gtk_button_get_label (wbutton), | ||
| 3445 | GTK_ICON_SIZE_MENU); | ||
| 3446 | else | ||
| 3447 | { | ||
| 3448 | GtkImage *wimage = GTK_IMAGE (gtk_bin_get_child (GTK_BIN (wbutton))); | ||
| 3449 | GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (wbutton)); | ||
| 3450 | GtkImageType store_type = gtk_image_get_storage_type (wimage); | ||
| 3451 | if (store_type == GTK_IMAGE_STOCK) | ||
| 3452 | { | ||
| 3453 | gchar *stock_id; | ||
| 3454 | gtk_image_get_stock (wimage, &stock_id, NULL); | ||
| 3455 | wmenuimage = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU); | ||
| 3456 | } | ||
| 3457 | else if (store_type == GTK_IMAGE_ICON_SET) | ||
| 3458 | { | ||
| 3459 | GtkIconSet *icon_set; | ||
| 3460 | gtk_image_get_icon_set (wimage, &icon_set, NULL); | ||
| 3461 | wmenuimage = gtk_image_new_from_icon_set (icon_set, | ||
| 3462 | GTK_ICON_SIZE_MENU); | ||
| 3463 | } | ||
| 3464 | else if (store_type == GTK_IMAGE_PIXBUF) | ||
| 3465 | { | ||
| 3466 | gint width, height; | ||
| 3467 | |||
| 3468 | if (settings && | ||
| 3469 | gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU, | ||
| 3470 | &width, &height)) | ||
| 3471 | { | ||
| 3472 | GdkPixbuf *src_pixbuf, *dest_pixbuf; | ||
| 3473 | |||
| 3474 | src_pixbuf = gtk_image_get_pixbuf (wimage); | ||
| 3475 | dest_pixbuf = gdk_pixbuf_scale_simple (src_pixbuf, width, height, | ||
| 3476 | GDK_INTERP_BILINEAR); | ||
| 3477 | |||
| 3478 | wmenuimage = gtk_image_new_from_pixbuf (dest_pixbuf); | ||
| 3479 | } | ||
| 3480 | } | ||
| 3481 | } | ||
| 3482 | if (wmenuimage) | ||
| 3483 | gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (wmenuitem), wmenuimage); | ||
| 3484 | |||
| 3485 | g_signal_connect (G_OBJECT (wmenuitem), | ||
| 3486 | "activate", | ||
| 3487 | GTK_SIGNAL_FUNC (xg_tool_bar_proxy_callback), | ||
| 3488 | user_data); | ||
| 3489 | |||
| 3490 | g_object_set_data (G_OBJECT (wmenuitem), XG_TOOL_BAR_PROXY_BUTTON, | ||
| 3491 | (gpointer) wbutton); | ||
| 3492 | gtk_tool_item_set_proxy_menu_item (toolitem, "Emacs toolbar item", wmenuitem); | ||
| 3493 | |||
| 3494 | return TRUE; | ||
| 3495 | } | ||
| 3496 | |||
| 3409 | /* This callback is called when a tool bar is detached. We must set | 3497 | /* This callback is called when a tool bar is detached. We must set |
| 3410 | the height of the tool bar to zero when this happens so frame sizes | 3498 | the height of the tool bar to zero when this happens so frame sizes |
| 3411 | are correctly calculated. | 3499 | are correctly calculated. |
| @@ -3491,9 +3579,6 @@ xg_tool_bar_help_callback (w, event, client_data) | |||
| 3491 | FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); | 3579 | FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); |
| 3492 | Lisp_Object help, frame; | 3580 | Lisp_Object help, frame; |
| 3493 | 3581 | ||
| 3494 | if (! GTK_IS_BUTTON (w)) | ||
| 3495 | return FALSE; | ||
| 3496 | |||
| 3497 | if (! f || ! f->n_tool_bar_items || NILP (f->tool_bar_items)) | 3582 | if (! f || ! f->n_tool_bar_items || NILP (f->tool_bar_items)) |
| 3498 | return FALSE; | 3583 | return FALSE; |
| 3499 | 3584 | ||
| @@ -3631,10 +3716,9 @@ update_frame_tool_bar (f) | |||
| 3631 | { | 3716 | { |
| 3632 | int i; | 3717 | int i; |
| 3633 | GtkRequisition old_req, new_req; | 3718 | GtkRequisition old_req, new_req; |
| 3634 | GList *icon_list; | ||
| 3635 | GList *iter; | ||
| 3636 | struct x_output *x = f->output_data.x; | 3719 | struct x_output *x = f->output_data.x; |
| 3637 | int hmargin, vmargin; | 3720 | int hmargin, vmargin; |
| 3721 | GtkToolItem *ti; | ||
| 3638 | 3722 | ||
| 3639 | if (! FRAME_GTK_WIDGET (f)) | 3723 | if (! FRAME_GTK_WIDGET (f)) |
| 3640 | return; | 3724 | return; |
| @@ -3670,9 +3754,6 @@ update_frame_tool_bar (f) | |||
| 3670 | 3754 | ||
| 3671 | gtk_widget_size_request (x->toolbar_widget, &old_req); | 3755 | gtk_widget_size_request (x->toolbar_widget, &old_req); |
| 3672 | 3756 | ||
| 3673 | icon_list = gtk_container_get_children (GTK_CONTAINER (x->toolbar_widget)); | ||
| 3674 | iter = icon_list; | ||
| 3675 | |||
| 3676 | for (i = 0; i < f->n_tool_bar_items; ++i) | 3757 | for (i = 0; i < f->n_tool_bar_items; ++i) |
| 3677 | { | 3758 | { |
| 3678 | #define PROP(IDX) AREF (f->tool_bar_items, i * TOOL_BAR_ITEM_NSLOTS + (IDX)) | 3759 | #define PROP(IDX) AREF (f->tool_bar_items, i * TOOL_BAR_ITEM_NSLOTS + (IDX)) |
| @@ -3683,12 +3764,16 @@ update_frame_tool_bar (f) | |||
| 3683 | int img_id; | 3764 | int img_id; |
| 3684 | struct image *img; | 3765 | struct image *img; |
| 3685 | Lisp_Object image; | 3766 | Lisp_Object image; |
| 3686 | GtkWidget *wicon = iter ? GTK_WIDGET (iter->data) : 0; | 3767 | GtkWidget *wbutton; |
| 3687 | GtkToolItem *ti = NULL; | 3768 | GtkWidget *weventbox; |
| 3688 | GtkWidget *wvbox; | ||
| 3689 | GList *chlist; | ||
| 3690 | 3769 | ||
| 3691 | if (iter) iter = g_list_next (iter); | 3770 | ti = gtk_toolbar_get_nth_item (GTK_TOOLBAR (x->toolbar_widget), i); |
| 3771 | |||
| 3772 | if (ti) | ||
| 3773 | { | ||
| 3774 | weventbox = gtk_bin_get_child (GTK_BIN (ti)); | ||
| 3775 | wbutton = gtk_bin_get_child (GTK_BIN (weventbox)); | ||
| 3776 | } | ||
| 3692 | 3777 | ||
| 3693 | /* If image is a vector, choose the image according to the | 3778 | /* If image is a vector, choose the image according to the |
| 3694 | button state. */ | 3779 | button state. */ |
| @@ -3713,7 +3798,7 @@ update_frame_tool_bar (f) | |||
| 3713 | /* Ignore invalid image specifications. */ | 3798 | /* Ignore invalid image specifications. */ |
| 3714 | if (!valid_image_p (image)) | 3799 | if (!valid_image_p (image)) |
| 3715 | { | 3800 | { |
| 3716 | if (wicon) gtk_widget_hide (wicon); | 3801 | if (ti) gtk_widget_hide_all (GTK_WIDGET (ti)); |
| 3717 | continue; | 3802 | continue; |
| 3718 | } | 3803 | } |
| 3719 | 3804 | ||
| @@ -3723,57 +3808,55 @@ update_frame_tool_bar (f) | |||
| 3723 | 3808 | ||
| 3724 | if (img->load_failed_p || img->pixmap == None) | 3809 | if (img->load_failed_p || img->pixmap == None) |
| 3725 | { | 3810 | { |
| 3726 | if (wicon) | 3811 | if (ti) |
| 3727 | gtk_widget_hide (wicon); | 3812 | gtk_widget_hide_all (GTK_WIDGET (ti)); |
| 3728 | else | 3813 | else |
| 3729 | /* Insert an empty (non-image) button */ | 3814 | { |
| 3730 | gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), | 3815 | /* Insert an empty (non-image) button */ |
| 3731 | gtk_tool_button_new (NULL, ""), | 3816 | weventbox = gtk_event_box_new (); |
| 3732 | i); | 3817 | wbutton = gtk_button_new (); |
| 3818 | gtk_button_set_focus_on_click (GTK_BUTTON (wbutton), FALSE); | ||
| 3819 | gtk_button_set_relief (GTK_BUTTON (wbutton), GTK_RELIEF_NONE); | ||
| 3820 | gtk_container_add (GTK_CONTAINER (weventbox), wbutton); | ||
| 3821 | ti = gtk_tool_item_new (); | ||
| 3822 | gtk_container_add (GTK_CONTAINER (ti), weventbox); | ||
| 3823 | gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, i); | ||
| 3824 | } | ||
| 3733 | continue; | 3825 | continue; |
| 3734 | } | 3826 | } |
| 3735 | 3827 | ||
| 3736 | if (wicon) | 3828 | if (ti == NULL) |
| 3737 | { | ||
| 3738 | /* The child of the tool bar is a button. Inside that button | ||
| 3739 | is a vbox. Inside that vbox is the GtkImage. */ | ||
| 3740 | wvbox = gtk_bin_get_child (GTK_BIN (wicon)); | ||
| 3741 | chlist = gtk_container_get_children (GTK_CONTAINER (wvbox)); | ||
| 3742 | if (chlist == NULL) | ||
| 3743 | /* In this case, we inserted an empty button (above) with no image */ | ||
| 3744 | ti = GTK_TOOL_ITEM (wicon); | ||
| 3745 | } | ||
| 3746 | |||
| 3747 | if (! wicon || ti != NULL) | ||
| 3748 | { | 3829 | { |
| 3749 | GtkWidget *w = xg_get_image_for_pixmap (f, img, x->widget, NULL); | 3830 | GtkWidget *w = xg_get_image_for_pixmap (f, img, x->widget, NULL); |
| 3750 | gtk_misc_set_padding (GTK_MISC (w), hmargin, vmargin); | 3831 | gtk_misc_set_padding (GTK_MISC (w), hmargin, vmargin); |
| 3751 | 3832 | wbutton = gtk_button_new (); | |
| 3752 | 3833 | gtk_button_set_focus_on_click (GTK_BUTTON (wbutton), FALSE); | |
| 3753 | if (ti == NULL) | 3834 | gtk_button_set_relief (GTK_BUTTON (wbutton), GTK_RELIEF_NONE); |
| 3754 | { | 3835 | gtk_container_add (GTK_CONTAINER (wbutton), w); |
| 3755 | ti = gtk_tool_button_new (w, ""); | 3836 | weventbox = gtk_event_box_new (); |
| 3756 | 3837 | gtk_container_add (GTK_CONTAINER (weventbox), wbutton); | |
| 3757 | gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, i); | 3838 | ti = gtk_tool_item_new (); |
| 3758 | } | 3839 | gtk_container_add (GTK_CONTAINER (ti), weventbox); |
| 3759 | else | 3840 | gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, i); |
| 3760 | gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (ti), w); | ||
| 3761 | 3841 | ||
| 3762 | 3842 | ||
| 3763 | /* The EMACS_INT cast avoids a warning. */ | 3843 | /* The EMACS_INT cast avoids a warning. */ |
| 3764 | g_signal_connect (GTK_WIDGET (ti), "clicked", | 3844 | g_signal_connect (G_OBJECT (ti), "create-menu-proxy", |
| 3845 | GTK_SIGNAL_FUNC (xg_tool_bar_menu_proxy), | ||
| 3846 | (gpointer) (EMACS_INT) i); | ||
| 3847 | |||
| 3848 | g_signal_connect (G_OBJECT (wbutton), "clicked", | ||
| 3765 | GTK_SIGNAL_FUNC (xg_tool_bar_callback), | 3849 | GTK_SIGNAL_FUNC (xg_tool_bar_callback), |
| 3766 | (gpointer) (EMACS_INT) i); | 3850 | (gpointer) (EMACS_INT) i); |
| 3767 | 3851 | ||
| 3768 | gtk_widget_show (GTK_WIDGET (ti)); | 3852 | gtk_widget_show_all (GTK_WIDGET (ti)); |
| 3769 | gtk_widget_show (GTK_WIDGET (w)); | ||
| 3770 | 3853 | ||
| 3771 | /* Save the image so we can see if an update is needed when | 3854 | /* Save the image so we can see if an update is needed when |
| 3772 | this function is called again. */ | 3855 | this function is called again. */ |
| 3773 | g_object_set_data (G_OBJECT (w), XG_TOOL_BAR_IMAGE_DATA, | 3856 | g_object_set_data (G_OBJECT (w), XG_TOOL_BAR_IMAGE_DATA, |
| 3774 | (gpointer)img->pixmap); | 3857 | (gpointer)img->pixmap); |
| 3775 | 3858 | ||
| 3776 | g_object_set_data (G_OBJECT (ti), XG_FRAME_DATA, (gpointer)f); | 3859 | g_object_set_data (G_OBJECT (weventbox), XG_FRAME_DATA, (gpointer)f); |
| 3777 | 3860 | ||
| 3778 | /* Catch expose events to overcome an annoying redraw bug, see | 3861 | /* Catch expose events to overcome an annoying redraw bug, see |
| 3779 | comment for xg_tool_bar_item_expose_callback. */ | 3862 | comment for xg_tool_bar_item_expose_callback. */ |
| @@ -3782,46 +3865,37 @@ update_frame_tool_bar (f) | |||
| 3782 | G_CALLBACK (xg_tool_bar_item_expose_callback), | 3865 | G_CALLBACK (xg_tool_bar_item_expose_callback), |
| 3783 | 0); | 3866 | 0); |
| 3784 | 3867 | ||
| 3785 | gtk_widget_set_sensitive (GTK_WIDGET (ti), enabled_p); | 3868 | gtk_widget_set_sensitive (wbutton, enabled_p); |
| 3786 | gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (ti), FALSE); | 3869 | gtk_tool_item_set_homogeneous (ti, FALSE); |
| 3787 | 3870 | ||
| 3788 | while (! GTK_IS_BUTTON (w)) | ||
| 3789 | w = gtk_widget_get_parent (w); | ||
| 3790 | |||
| 3791 | /* Callback to save modifyer mask (Shift/Control, etc). GTK makes | 3871 | /* Callback to save modifyer mask (Shift/Control, etc). GTK makes |
| 3792 | no distinction based on modifiers in the activate callback, | 3872 | no distinction based on modifiers in the activate callback, |
| 3793 | so we have to do it ourselves. */ | 3873 | so we have to do it ourselves. */ |
| 3794 | g_signal_connect (w, "button-release-event", | 3874 | g_signal_connect (wbutton, "button-release-event", |
| 3795 | GTK_SIGNAL_FUNC (xg_tool_bar_button_cb), | 3875 | GTK_SIGNAL_FUNC (xg_tool_bar_button_cb), |
| 3796 | ti); | 3876 | NULL); |
| 3797 | 3877 | ||
| 3798 | g_object_set_data (G_OBJECT (w), XG_FRAME_DATA, (gpointer)f); | 3878 | g_object_set_data (G_OBJECT (wbutton), XG_FRAME_DATA, (gpointer)f); |
| 3799 | 3879 | ||
| 3800 | /* Use enter/leave notify to show help. We use the events | 3880 | /* Use enter/leave notify to show help. We use the events |
| 3801 | rather than the GtkButton specific signals "enter" and | 3881 | rather than the GtkButton specific signals "enter" and |
| 3802 | "leave", so we can have only one callback. The event | 3882 | "leave", so we can have only one callback. The event |
| 3803 | will tell us what kind of event it is. */ | 3883 | will tell us what kind of event it is. */ |
| 3804 | /* The EMACS_INT cast avoids a warning. */ | 3884 | /* The EMACS_INT cast avoids a warning. */ |
| 3805 | g_signal_connect (G_OBJECT (w), | 3885 | g_signal_connect (G_OBJECT (weventbox), |
| 3806 | "enter-notify-event", | 3886 | "enter-notify-event", |
| 3807 | G_CALLBACK (xg_tool_bar_help_callback), | 3887 | G_CALLBACK (xg_tool_bar_help_callback), |
| 3808 | (gpointer) (EMACS_INT) i); | 3888 | (gpointer) (EMACS_INT) i); |
| 3809 | g_signal_connect (G_OBJECT (w), | 3889 | g_signal_connect (G_OBJECT (weventbox), |
| 3810 | "leave-notify-event", | 3890 | "leave-notify-event", |
| 3811 | G_CALLBACK (xg_tool_bar_help_callback), | 3891 | G_CALLBACK (xg_tool_bar_help_callback), |
| 3812 | (gpointer) (EMACS_INT) i); | 3892 | (gpointer) (EMACS_INT) i); |
| 3813 | } | 3893 | } |
| 3814 | else | 3894 | else |
| 3815 | { | 3895 | { |
| 3816 | /* The child of the tool bar is a button. Inside that button | 3896 | GtkWidget *wimage = gtk_bin_get_child (GTK_BIN (wbutton)); |
| 3817 | is a vbox. Inside that vbox is the GtkImage. */ | ||
| 3818 | GtkWidget *wvbox = gtk_bin_get_child (GTK_BIN (wicon)); | ||
| 3819 | GList *chlist = gtk_container_get_children (GTK_CONTAINER (wvbox)); | ||
| 3820 | GtkImage *wimage = GTK_IMAGE (chlist->data); | ||
| 3821 | Pixmap old_img = (Pixmap)g_object_get_data (G_OBJECT (wimage), | 3897 | Pixmap old_img = (Pixmap)g_object_get_data (G_OBJECT (wimage), |
| 3822 | XG_TOOL_BAR_IMAGE_DATA); | 3898 | XG_TOOL_BAR_IMAGE_DATA); |
| 3823 | g_list_free (chlist); | ||
| 3824 | |||
| 3825 | gtk_misc_set_padding (GTK_MISC (wimage), hmargin, vmargin); | 3899 | gtk_misc_set_padding (GTK_MISC (wimage), hmargin, vmargin); |
| 3826 | 3900 | ||
| 3827 | if (old_img != img->pixmap) | 3901 | if (old_img != img->pixmap) |
| @@ -3830,21 +3904,20 @@ update_frame_tool_bar (f) | |||
| 3830 | g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA, | 3904 | g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA, |
| 3831 | (gpointer)img->pixmap); | 3905 | (gpointer)img->pixmap); |
| 3832 | 3906 | ||
| 3833 | gtk_widget_set_sensitive (wicon, enabled_p); | 3907 | gtk_widget_set_sensitive (wbutton, enabled_p); |
| 3834 | gtk_widget_show (wicon); | 3908 | gtk_widget_show_all (GTK_WIDGET (ti)); |
| 3835 | } | 3909 | } |
| 3836 | 3910 | ||
| 3837 | #undef PROP | 3911 | #undef PROP |
| 3838 | } | 3912 | } |
| 3839 | 3913 | ||
| 3840 | /* Remove buttons not longer needed. We just hide them so they | 3914 | /* Remove buttons not longer needed. We just hide them so they |
| 3841 | can be reused later on. */ | 3915 | can be reused later on. */ |
| 3842 | while (iter) | 3916 | do |
| 3843 | { | 3917 | { |
| 3844 | GtkWidget *w = GTK_WIDGET (iter->data); | 3918 | ti = gtk_toolbar_get_nth_item (GTK_TOOLBAR (x->toolbar_widget), i++); |
| 3845 | gtk_widget_hide (w); | 3919 | if (ti) gtk_widget_hide_all (GTK_WIDGET (ti)); |
| 3846 | iter = g_list_next (iter); | 3920 | } while (ti != NULL); |
| 3847 | } | ||
| 3848 | 3921 | ||
| 3849 | gtk_widget_size_request (x->toolbar_widget, &new_req); | 3922 | gtk_widget_size_request (x->toolbar_widget, &new_req); |
| 3850 | if (old_req.height != new_req.height | 3923 | if (old_req.height != new_req.height |
| @@ -3854,8 +3927,6 @@ update_frame_tool_bar (f) | |||
| 3854 | xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f)); | 3927 | xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f)); |
| 3855 | } | 3928 | } |
| 3856 | 3929 | ||
| 3857 | if (icon_list) g_list_free (icon_list); | ||
| 3858 | |||
| 3859 | UNBLOCK_INPUT; | 3930 | UNBLOCK_INPUT; |
| 3860 | } | 3931 | } |
| 3861 | 3932 | ||
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 () | |||
| 1453 | 1453 | ||
| 1454 | if (ignore_mouse_drag_p) | 1454 | if (ignore_mouse_drag_p) |
| 1455 | { | 1455 | { |
| 1456 | //ignore_mouse_drag_p = 0; | 1456 | /* ignore_mouse_drag_p = 0; */ |
| 1457 | return 0; | 1457 | return 0; |
| 1458 | } | 1458 | } |
| 1459 | 1459 | ||
| @@ -3799,8 +3799,7 @@ kbd_buffer_store_event_hold (event, hold_quit) | |||
| 3799 | if (!NILP (Vthrow_on_input) | 3799 | if (!NILP (Vthrow_on_input) |
| 3800 | && event->kind != FOCUS_IN_EVENT | 3800 | && event->kind != FOCUS_IN_EVENT |
| 3801 | && event->kind != HELP_EVENT | 3801 | && event->kind != HELP_EVENT |
| 3802 | && event->kind != DEICONIFY_EVENT | 3802 | && event->kind != DEICONIFY_EVENT) |
| 3803 | && !(event->kind == USER_SIGNAL_EVENT && event->code == 0)) | ||
| 3804 | { | 3803 | { |
| 3805 | Vquit_flag = Vthrow_on_input; | 3804 | Vquit_flag = Vthrow_on_input; |
| 3806 | /* If we're inside a function that wants immediate quits, | 3805 | /* If we're inside a function that wants immediate quits, |
| @@ -5088,9 +5087,6 @@ Lisp_Object *scroll_bar_parts[] = { | |||
| 5088 | &Qup, &Qdown, &Qtop, &Qbottom, &Qend_scroll, &Qratio | 5087 | &Qup, &Qdown, &Qtop, &Qbottom, &Qend_scroll, &Qratio |
| 5089 | }; | 5088 | }; |
| 5090 | 5089 | ||
| 5091 | /* User signal events. */ | ||
| 5092 | Lisp_Object Qsignal; | ||
| 5093 | |||
| 5094 | /* A vector, indexed by button number, giving the down-going location | 5090 | /* A vector, indexed by button number, giving the down-going location |
| 5095 | of currently depressed buttons, both scroll bar and non-scroll bar. | 5091 | of currently depressed buttons, both scroll bar and non-scroll bar. |
| 5096 | 5092 | ||
| @@ -5969,17 +5965,12 @@ make_lispy_event (event) | |||
| 5969 | 5965 | ||
| 5970 | case USER_SIGNAL_EVENT: | 5966 | case USER_SIGNAL_EVENT: |
| 5971 | /* A user signal. */ | 5967 | /* A user signal. */ |
| 5972 | if (event->code == 0) | 5968 | { |
| 5973 | return Qsignal; | 5969 | char *name = find_user_signal_name (event->code); |
| 5974 | else | 5970 | if (!name) |
| 5975 | { | 5971 | abort (); |
| 5976 | char *name = find_user_signal_name (event->code); | 5972 | return intern (name); |
| 5977 | 5973 | } | |
| 5978 | if (name) | ||
| 5979 | return intern (name); | ||
| 5980 | else | ||
| 5981 | return make_number (event->code); | ||
| 5982 | } | ||
| 5983 | 5974 | ||
| 5984 | case SAVE_SESSION_EVENT: | 5975 | case SAVE_SESSION_EVENT: |
| 5985 | return Qsave_session; | 5976 | return Qsave_session; |
| @@ -7156,8 +7147,6 @@ store_user_signal_events () | |||
| 7156 | mask = sigblock (sigmask (p->sig)); | 7147 | mask = sigblock (sigmask (p->sig)); |
| 7157 | do | 7148 | do |
| 7158 | { | 7149 | { |
| 7159 | buf.code = 0; | ||
| 7160 | kbd_buffer_store_event (&buf); | ||
| 7161 | buf.code = p->sig; | 7150 | buf.code = p->sig; |
| 7162 | kbd_buffer_store_event (&buf); | 7151 | kbd_buffer_store_event (&buf); |
| 7163 | p->npending--; | 7152 | p->npending--; |
| @@ -11182,9 +11171,6 @@ syms_of_keyboard () | |||
| 11182 | staticpro (&Qmac_apple_event); | 11171 | staticpro (&Qmac_apple_event); |
| 11183 | #endif | 11172 | #endif |
| 11184 | 11173 | ||
| 11185 | Qsignal = intern ("signal"); | ||
| 11186 | staticpro (&Qsignal); | ||
| 11187 | |||
| 11188 | Qmenu_enable = intern ("menu-enable"); | 11174 | Qmenu_enable = intern ("menu-enable"); |
| 11189 | staticpro (&Qmenu_enable); | 11175 | staticpro (&Qmenu_enable); |
| 11190 | Qmenu_alias = intern ("menu-alias"); | 11176 | Qmenu_alias = intern ("menu-alias"); |
| @@ -11475,8 +11461,8 @@ Polling is automatically disabled in all other cases. */); | |||
| 11475 | 11461 | ||
| 11476 | DEFVAR_LISP ("double-click-time", &Vdouble_click_time, | 11462 | DEFVAR_LISP ("double-click-time", &Vdouble_click_time, |
| 11477 | doc: /* *Maximum time between mouse clicks to make a double-click. | 11463 | doc: /* *Maximum time between mouse clicks to make a double-click. |
| 11478 | Measured in milliseconds. nil means disable double-click recognition; | 11464 | Measured in milliseconds. The value nil means disable double-click |
| 11479 | t means double-clicks have no time limit and are detected | 11465 | recognition; t means double-clicks have no time limit and are detected |
| 11480 | by position only. */); | 11466 | by position only. */); |
| 11481 | Vdouble_click_time = make_number (500); | 11467 | Vdouble_click_time = make_number (500); |
| 11482 | 11468 | ||
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: | |||
| 1147 | or another symbol whose function definition is used, etc.), | 1147 | or another symbol whose function definition is used, etc.), |
| 1148 | a cons (STRING . DEFN), meaning that DEFN is the definition | 1148 | a cons (STRING . DEFN), meaning that DEFN is the definition |
| 1149 | (DEFN should be a valid definition in its own right), | 1149 | (DEFN should be a valid definition in its own right), |
| 1150 | or a cons (MAP . CHAR), meaning use definition of CHAR in keymap MAP. | 1150 | or a cons (MAP . CHAR), meaning use definition of CHAR in keymap MAP, |
| 1151 | or an extended menu item definition. (See info node `Extended Menu Items'.) | ||
| 1151 | 1152 | ||
| 1152 | If KEYMAP is a sparse keymap with a binding for KEY, the existing | 1153 | If KEYMAP is a sparse keymap with a binding for KEY, the existing |
| 1153 | binding is altered. If there is no binding for KEY, the new pair | 1154 | 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. */ | |||
| 125 | #undef LIB_STANDARD | 125 | #undef LIB_STANDARD |
| 126 | #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o | 126 | #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o |
| 127 | 127 | ||
| 128 | #elif defined(__NetBSD__) | ||
| 129 | |||
| 130 | /* LIB_STANDARD and START_FILES set correctly in s/netbsd.h */ | ||
| 131 | |||
| 128 | #elif defined(sun) | 132 | #elif defined(sun) |
| 129 | 133 | ||
| 130 | #undef START_FILES | 134 | #undef START_FILES |
| 131 | #undef LIB_STANDARD | 135 | #undef LIB_STANDARD |
| 132 | 136 | ||
| 133 | #else /* !__OpenBSD__ && !__FreeBSD__ && !sun */ | 137 | #else /* !__OpenBSD__ && !__FreeBSD__ && !__NetBSD__ && !sun */ |
| 134 | 138 | ||
| 135 | #undef START_FILES | 139 | #undef START_FILES |
| 136 | #ifdef HAVE_X86_64_LIB64_DIR | 140 | #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. */ | |||
| 174 | #define rindex strrchr | 174 | #define rindex strrchr |
| 175 | 175 | ||
| 176 | #endif /* __hpux */ | 176 | #endif /* __hpux */ |
| 177 | |||
| 178 | /* Systems with GCC don't need to lose. */ | ||
| 179 | #ifdef __NetBSD__ | ||
| 180 | # ifdef __GNUC__ | ||
| 181 | # define alloca __builtin_alloca | ||
| 182 | # define HAVE_ALLOCA | ||
| 183 | # endif /* __GNUC__ */ | ||
| 184 | #endif /* __NetBSD__ */ | ||
| 177 | 185 | ||
| 178 | /* arch-tag: 809436e6-1645-4b92-b40d-2de5d6e7227c | 186 | /* arch-tag: 809436e6-1645-4b92-b40d-2de5d6e7227c |
| 179 | (do not change this comment) */ | 187 | (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 @@ | |||
| 1 | /* machine description file for sh3el | ||
| 2 | Copyright (C) 1985, 1986 Free Software Foundation, Inc. | ||
| 3 | |||
| 4 | This file is part of GNU Emacs. | ||
| 5 | |||
| 6 | GNU Emacs is free software; you can redistribute it and/or modify | ||
| 7 | it under the terms of the GNU General Public License as published by | ||
| 8 | the Free Software Foundation; either version 2, or (at your option) | ||
| 9 | any later version. | ||
| 10 | |||
| 11 | GNU Emacs is distributed in the hope that it will be useful, | ||
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | GNU General Public License for more details. | ||
| 15 | |||
| 16 | You should have received a copy of the GNU General Public License | ||
| 17 | along with GNU Emacs; see the file COPYING. If not, write to | ||
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
| 19 | Boston, MA 02111-1307, USA. */ | ||
| 20 | |||
| 21 | |||
| 22 | /* The following line tells the configuration script what sort of | ||
| 23 | operating system this machine is likely to run. | ||
| 24 | USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */ | ||
| 25 | |||
| 26 | /* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word | ||
| 27 | is the most significant byte. */ | ||
| 28 | |||
| 29 | #undef WORDS_BIG_ENDIAN | ||
| 30 | |||
| 31 | /* Define NO_ARG_ARRAY if you cannot take the address of the first of a | ||
| 32 | * group of arguments and treat it as an array of the arguments. */ | ||
| 33 | |||
| 34 | #define NO_ARG_ARRAY | ||
| 35 | |||
| 36 | /* Define WORD_MACHINE if addresses and such have | ||
| 37 | * to be corrected before they can be used as byte counts. */ | ||
| 38 | |||
| 39 | #undef WORD_MACHINE | ||
| 40 | |||
| 41 | /* Now define a symbol for the cpu type, if your compiler | ||
| 42 | does not define it automatically: | ||
| 43 | Ones defined so far include vax, m68000, ns16000, pyramid, | ||
| 44 | orion, tahoe, APOLLO and many others */ | ||
| 45 | |||
| 46 | /* Use type int rather than a union, to represent Lisp_Object */ | ||
| 47 | /* This is desirable for most machines. */ | ||
| 48 | |||
| 49 | #define NO_UNION_TYPE | ||
| 50 | |||
| 51 | /* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend | ||
| 52 | the 24-bit bit field into an int. In other words, if bit fields | ||
| 53 | are always unsigned. | ||
| 54 | |||
| 55 | If you use NO_UNION_TYPE, this flag does not matter. */ | ||
| 56 | |||
| 57 | #define EXPLICIT_SIGN_EXTEND | ||
| 58 | |||
| 59 | /* Data type of load average, as read out of kmem. */ | ||
| 60 | |||
| 61 | #define LOAD_AVE_TYPE long | ||
| 62 | |||
| 63 | /* Convert that into an integer that is 100 for a load average of 1.0 */ | ||
| 64 | |||
| 65 | #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) | ||
| 66 | |||
| 67 | /* Define CANNOT_DUMP on machines where unexec does not work. | ||
| 68 | Then the function dump-emacs will not be defined | ||
| 69 | and temacs will do (load "loadup") automatically unless told otherwise. */ | ||
| 70 | |||
| 71 | #undef CANNOT_DUMP | ||
| 72 | |||
| 73 | /* Define VIRT_ADDR_VARIES if the virtual addresses of | ||
| 74 | pure and impure space as loaded can vary, and even their | ||
| 75 | relative order cannot be relied on. | ||
| 76 | |||
| 77 | Otherwise Emacs assumes that text space precedes data space, | ||
| 78 | numerically. */ | ||
| 79 | |||
| 80 | #define VIRT_ADDR_VARIES | ||
| 81 | |||
| 82 | /* Define C_ALLOCA if this machine does not support a true alloca | ||
| 83 | and the one written in C should be used instead. | ||
| 84 | Define HAVE_ALLOCA to say that the system provides a properly | ||
| 85 | working alloca function and it should be used. | ||
| 86 | Define neither one if an assembler-language alloca | ||
| 87 | in the file alloca.s should be used. */ | ||
| 88 | |||
| 89 | /* #define C_ALLOCA */ | ||
| 90 | #define HAVE_ALLOCA | ||
| 91 | |||
| 92 | /* Define NO_REMAP if memory segmentation makes it not work well | ||
| 93 | to change the boundary between the text section and data section | ||
| 94 | when Emacs is dumped. If you define this, the preloaded Lisp | ||
| 95 | code will not be sharable; but that's better than failing completely. */ | ||
| 96 | |||
| 97 | #define NO_REMAP | ||
| 98 | |||
| 99 | /* After adding support for a new system, modify the large case | ||
| 100 | statement in the `configure' script to recognize reasonable | ||
| 101 | configuration names, and add a description of the system to | ||
| 102 | `etc/MACHINES'. | ||
| 103 | |||
| 104 | If you've just fixed a problem in an existing configuration file, | ||
| 105 | you should also check `etc/MACHINES' to make sure its descriptions | ||
| 106 | of known problems in that configuration should be updated. */ | ||
| 107 | |||
| 108 | /* arch-tag: ee325990-6f40-47a2-b9df-60ecf3599899 | ||
| 109 | (do not change this comment) */ | ||
| @@ -4852,8 +4852,8 @@ DEFUN ("mac-code-convert-string", Fmac_code_convert_string, Smac_code_convert_st | |||
| 4852 | doc: /* Convert STRING from SOURCE encoding to TARGET encoding. | 4852 | doc: /* Convert STRING from SOURCE encoding to TARGET encoding. |
| 4853 | The conversion is performed using the converter provided by the system. | 4853 | The conversion is performed using the converter provided by the system. |
| 4854 | Each encoding is specified by either a coding system symbol, a mime | 4854 | Each encoding is specified by either a coding system symbol, a mime |
| 4855 | charset string, or an integer as a CFStringEncoding value. Nil for | 4855 | charset string, or an integer as a CFStringEncoding value. An encoding |
| 4856 | encoding means UTF-16 in native byte order, no byte order mark. | 4856 | of nil means UTF-16 in native byte order, no byte order mark. |
| 4857 | On Mac OS X 10.2 and later, you can do Unicode Normalization by | 4857 | On Mac OS X 10.2 and later, you can do Unicode Normalization by |
| 4858 | specifying the optional argument NORMALIZATION-FORM with a symbol NFD, | 4858 | specifying the optional argument NORMALIZATION-FORM with a symbol NFD, |
| 4859 | NFKD, NFC, NFKC, HFS+D, or HFS+C. | 4859 | 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) | |||
| 1969 | { | 1969 | { |
| 1970 | AEDesc desc; | 1970 | AEDesc desc; |
| 1971 | #ifdef MAC_OSX | 1971 | #ifdef MAC_OSX |
| 1972 | FSRef fref; | 1972 | FSRef fref, fref_proxy; |
| 1973 | #else | 1973 | #else |
| 1974 | FSSpec fss; | 1974 | FSSpec fss, fss_proxy; |
| 1975 | #endif | 1975 | #endif |
| 1976 | Boolean changed; | 1976 | Boolean changed; |
| 1977 | Lisp_Object encoded_file_name = ENCODE_FILE (file_name); | 1977 | Lisp_Object encoded_file_name = ENCODE_FILE (file_name); |
| @@ -1997,10 +1997,19 @@ mac_update_proxy_icon (f) | |||
| 1997 | { | 1997 | { |
| 1998 | if (alias) | 1998 | if (alias) |
| 1999 | { | 1999 | { |
| 2000 | /* (FS)ResolveAlias never sets `changed' to true if | ||
| 2001 | `alias' is minimal. */ | ||
| 2000 | #ifdef MAC_OSX | 2002 | #ifdef MAC_OSX |
| 2001 | err = FSUpdateAlias (NULL, &fref, alias, &changed); | 2003 | err = FSResolveAlias (NULL, alias, &fref_proxy, &changed); |
| 2004 | if (err == noErr) | ||
| 2005 | err = FSCompareFSRefs (&fref, &fref_proxy); | ||
| 2002 | #else | 2006 | #else |
| 2003 | err = UpdateAlias (NULL, &fss, alias, &changed); | 2007 | err = ResolveAlias (NULL, alias, &fss_proxy, &changed); |
| 2008 | if (err == noErr) | ||
| 2009 | err = !(fss.vRefNum == fss_proxy.vRefNum | ||
| 2010 | && fss.parID == fss_proxy.parID | ||
| 2011 | && EqualString (fss.name, fss_proxy.name, | ||
| 2012 | false, true)); | ||
| 2004 | #endif | 2013 | #endif |
| 2005 | } | 2014 | } |
| 2006 | if (err != noErr || alias == NULL) | 2015 | if (err != noErr || alias == NULL) |
| @@ -2051,11 +2060,11 @@ mac_update_title_bar (f, save_match_data) | |||
| 2051 | confusing. */ | 2060 | confusing. */ |
| 2052 | || (!MINI_WINDOW_P (w) | 2061 | || (!MINI_WINDOW_P (w) |
| 2053 | && (modified_p != !NILP (w->last_had_star)))) | 2062 | && (modified_p != !NILP (w->last_had_star)))) |
| 2054 | SetWindowModified (FRAME_MAC_WINDOW (f), | 2063 | { |
| 2055 | !MINI_WINDOW_P (w) && modified_p); | 2064 | SetWindowModified (FRAME_MAC_WINDOW (f), |
| 2056 | 2065 | !MINI_WINDOW_P (w) && modified_p); | |
| 2057 | if (windows_or_buffers_changed) | 2066 | mac_update_proxy_icon (f); |
| 2058 | mac_update_proxy_icon (f); | 2067 | } |
| 2059 | #endif | 2068 | #endif |
| 2060 | } | 2069 | } |
| 2061 | 2070 | ||
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) | |||
| 159 | # | 159 | # |
| 160 | # The dumped executable | 160 | # The dumped executable |
| 161 | # | 161 | # |
| 162 | emacs: $(BLD) $(EMACS) | 162 | emacs: stamp_BLD $(EMACS) |
| 163 | $(EMACS): $(DOC) $(TEMACS) | 163 | $(EMACS): $(DOC) $(TEMACS) |
| 164 | "$(THISDIR)/$(BLD)/temacs.exe" -batch -l loadup dump | 164 | "$(THISDIR)/$(BLD)/temacs.exe" -batch -l loadup dump |
| 165 | -"$(THISDIR)/$(BLD)/emacs.exe" -q -batch -f list-load-path-shadows | 165 | -"$(THISDIR)/$(BLD)/emacs.exe" -q -batch -f list-load-path-shadows |
| @@ -170,7 +170,7 @@ $(EMACS): $(DOC) $(TEMACS) | |||
| 170 | # If preload runs out of memory, increase the last argument to addsection | 170 | # If preload runs out of memory, increase the last argument to addsection |
| 171 | # (it is the preload heap size in MB). | 171 | # (it is the preload heap size in MB). |
| 172 | # | 172 | # |
| 173 | temacs: $(BLD) $(TEMACS) | 173 | temacs: stamp_BLD $(TEMACS) |
| 174 | $(TEMACS): $(TLIB0) $(TLIB1) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES) \ | 174 | $(TEMACS): $(TLIB0) $(TLIB1) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES) \ |
| 175 | ../nt/$(BLD)/addsection.exe | 175 | ../nt/$(BLD)/addsection.exe |
| 176 | $(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS) | 176 | $(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS) |
| @@ -188,7 +188,7 @@ bootstrap: bootstrap-emacs | |||
| 188 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as | 188 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as |
| 189 | # this can break with GNU Make 3.81 and later if sh.exe is used. | 189 | # this can break with GNU Make 3.81 and later if sh.exe is used. |
| 190 | bootstrap-temacs: | 190 | bootstrap-temacs: |
| 191 | $(MAKE) $(MFLAGS) temacs CFLAGS=$(ARGQUOTE)$(CFLAGS) -DPURESIZE=5000000$(ARGQUOTE) | 191 | $(MAKE) $(MFLAGS) $(XMFLAGS) temacs CFLAGS=$(ARGQUOTE)$(CFLAGS) -DPURESIZE=5000000$(ARGQUOTE) |
| 192 | 192 | ||
| 193 | # | 193 | # |
| 194 | # Dump an Emacs executable named bootstrap-emacs containing the | 194 | # Dump an Emacs executable named bootstrap-emacs containing the |
| @@ -253,6 +253,7 @@ clean: | |||
| 253 | - $(DEL) *~ "s/*~" "m/*~" | 253 | - $(DEL) *~ "s/*~" "m/*~" |
| 254 | - $(DEL) $(COMPILER_TEMP_FILES) | 254 | - $(DEL) $(COMPILER_TEMP_FILES) |
| 255 | - $(DEL_TREE) $(OBJDIR) | 255 | - $(DEL_TREE) $(OBJDIR) |
| 256 | - $(DEL) stamp_BLD | ||
| 256 | 257 | ||
| 257 | distclean: clean | 258 | distclean: clean |
| 258 | - $(DEL) config.h epaths.h | 259 | - $(DEL) config.h epaths.h |
| @@ -1552,3 +1553,8 @@ $(BLD)/w32bdf.$(O): \ | |||
| 1552 | $(SRC)/w32bdf.h \ | 1553 | $(SRC)/w32bdf.h \ |
| 1553 | $(SRC)/w32gui.h \ | 1554 | $(SRC)/w32gui.h \ |
| 1554 | $(SRC)/w32term.h | 1555 | $(SRC)/w32term.h |
| 1556 | |||
| 1557 | # Each object file depends on stamp_BLD, because in parallel builds we must | ||
| 1558 | # make sure $(BLD) exists before starting compilations. | ||
| 1559 | # | ||
| 1560 | $(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. */) | |||
| 1287 | tail = alist; | 1287 | tail = alist; |
| 1288 | if (type == 2) | 1288 | if (type == 2) |
| 1289 | { | 1289 | { |
| 1290 | alist = check_obarray (alist); | ||
| 1290 | obsize = XVECTOR (alist)->size; | 1291 | obsize = XVECTOR (alist)->size; |
| 1291 | bucket = XVECTOR (alist)->contents[index]; | 1292 | bucket = XVECTOR (alist)->contents[index]; |
| 1292 | } | 1293 | } |
| @@ -1310,6 +1311,8 @@ is used to further constrain the set of candidates. */) | |||
| 1310 | { | 1311 | { |
| 1311 | if (!EQ (bucket, zero)) | 1312 | if (!EQ (bucket, zero)) |
| 1312 | { | 1313 | { |
| 1314 | if (!SYMBOLP (bucket)) | ||
| 1315 | error ("Bad data in guts of obarray"); | ||
| 1313 | elt = bucket; | 1316 | elt = bucket; |
| 1314 | eltstring = elt; | 1317 | eltstring = elt; |
| 1315 | if (XSYMBOL (bucket)->next) | 1318 | 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. */ | |||
| 44 | If I can't write a completely portable program to do this in C, | 44 | If I can't write a completely portable program to do this in C, |
| 45 | I'm quitting and taking up gardening. */ | 45 | I'm quitting and taking up gardening. */ |
| 46 | 46 | ||
| 47 | #ifdef HAVE_CONFIG_H | ||
| 48 | # include <config.h> | ||
| 49 | #endif | ||
| 50 | |||
| 51 | #if STDC_HEADERS | ||
| 52 | # include <stdlib.h> /* for proper declaration of `exit' */ | ||
| 53 | #endif | ||
| 54 | |||
| 47 | #include <stdio.h> | 55 | #include <stdio.h> |
| 48 | 56 | ||
| 49 | int | 57 | 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. */ | |||
| 149 | #include "atimer.h" | 149 | #include "atimer.h" |
| 150 | 150 | ||
| 151 | Lisp_Object Qprocessp; | 151 | Lisp_Object Qprocessp; |
| 152 | Lisp_Object Qrun, Qstop; | 152 | Lisp_Object Qrun, Qstop, Qsignal; |
| 153 | extern Lisp_Object Qsignal; | ||
| 154 | Lisp_Object Qopen, Qclosed, Qconnect, Qfailed, Qlisten; | 153 | Lisp_Object Qopen, Qclosed, Qconnect, Qfailed, Qlisten; |
| 155 | Lisp_Object Qlocal, Qipv4, Qdatagram; | 154 | Lisp_Object Qlocal, Qipv4, Qdatagram; |
| 156 | #ifdef AF_INET6 | 155 | #ifdef AF_INET6 |
| @@ -2900,7 +2899,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2900 | /* Make QCaddress an alias for :local (server) or :remote (client). */ | 2899 | /* Make QCaddress an alias for :local (server) or :remote (client). */ |
| 2901 | QCaddress = is_server ? QClocal : QCremote; | 2900 | QCaddress = is_server ? QClocal : QCremote; |
| 2902 | 2901 | ||
| 2903 | /* :wait BOOL */ | 2902 | /* :nowait BOOL */ |
| 2904 | if (!is_server && socktype == SOCK_STREAM | 2903 | if (!is_server && socktype == SOCK_STREAM |
| 2905 | && (tem = Fplist_get (contact, QCnowait), !NILP (tem))) | 2904 | && (tem = Fplist_get (contact, QCnowait), !NILP (tem))) |
| 2906 | { | 2905 | { |
| @@ -6986,6 +6985,8 @@ syms_of_process () | |||
| 6986 | staticpro (&Qrun); | 6985 | staticpro (&Qrun); |
| 6987 | Qstop = intern ("stop"); | 6986 | Qstop = intern ("stop"); |
| 6988 | staticpro (&Qstop); | 6987 | staticpro (&Qstop); |
| 6988 | Qsignal = intern ("signal"); | ||
| 6989 | staticpro (&Qsignal); | ||
| 6989 | 6990 | ||
| 6990 | /* Qexit is already staticpro'd by syms_of_eval; don't staticpro it | 6991 | /* Qexit is already staticpro'd by syms_of_eval; don't staticpro it |
| 6991 | here again. | 6992 | 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 @@ | |||
| 67 | # define regfree(preg) __regfree (preg) | 67 | # define regfree(preg) __regfree (preg) |
| 68 | # define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef) | 68 | # define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef) |
| 69 | # define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags) | 69 | # define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags) |
| 70 | # define regerror(errcode, preg, errbuf, errbuf_size) \ | 70 | # define regerror(err_code, preg, errbuf, errbuf_size) \ |
| 71 | __regerror(errcode, preg, errbuf, errbuf_size) | 71 | __regerror(err_code, preg, errbuf, errbuf_size) |
| 72 | # define re_set_registers(bu, re, nu, st, en) \ | 72 | # define re_set_registers(bu, re, nu, st, en) \ |
| 73 | __re_set_registers (bu, re, nu, st, en) | 73 | __re_set_registers (bu, re, nu, st, en) |
| 74 | # define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \ | 74 | # define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \ |
| @@ -6625,12 +6625,15 @@ regexec (preg, string, nmatch, pmatch, eflags) | |||
| 6625 | WEAK_ALIAS (__regexec, regexec) | 6625 | WEAK_ALIAS (__regexec, regexec) |
| 6626 | 6626 | ||
| 6627 | 6627 | ||
| 6628 | /* Returns a message corresponding to an error code, ERRCODE, returned | 6628 | /* Returns a message corresponding to an error code, ERR_CODE, returned |
| 6629 | from either regcomp or regexec. We don't use PREG here. */ | 6629 | from either regcomp or regexec. We don't use PREG here. |
| 6630 | |||
| 6631 | ERR_CODE was previously called ERRCODE, but that name causes an | ||
| 6632 | error with msvc8 compiler. */ | ||
| 6630 | 6633 | ||
| 6631 | size_t | 6634 | size_t |
| 6632 | regerror (errcode, preg, errbuf, errbuf_size) | 6635 | regerror (err_code, preg, errbuf, errbuf_size) |
| 6633 | int errcode; | 6636 | int err_code; |
| 6634 | const regex_t *preg; | 6637 | const regex_t *preg; |
| 6635 | char *errbuf; | 6638 | char *errbuf; |
| 6636 | size_t errbuf_size; | 6639 | size_t errbuf_size; |
| @@ -6638,15 +6641,15 @@ regerror (errcode, preg, errbuf, errbuf_size) | |||
| 6638 | const char *msg; | 6641 | const char *msg; |
| 6639 | size_t msg_size; | 6642 | size_t msg_size; |
| 6640 | 6643 | ||
| 6641 | if (errcode < 0 | 6644 | if (err_code < 0 |
| 6642 | || errcode >= (sizeof (re_error_msgid) / sizeof (re_error_msgid[0]))) | 6645 | || err_code >= (sizeof (re_error_msgid) / sizeof (re_error_msgid[0]))) |
| 6643 | /* Only error codes returned by the rest of the code should be passed | 6646 | /* Only error codes returned by the rest of the code should be passed |
| 6644 | to this routine. If we are given anything else, or if other regex | 6647 | to this routine. If we are given anything else, or if other regex |
| 6645 | code generates an invalid error code, then the program has a bug. | 6648 | code generates an invalid error code, then the program has a bug. |
| 6646 | Dump core so we can fix it. */ | 6649 | Dump core so we can fix it. */ |
| 6647 | abort (); | 6650 | abort (); |
| 6648 | 6651 | ||
| 6649 | msg = gettext (re_error_msgid[errcode]); | 6652 | msg = gettext (re_error_msgid[err_code]); |
| 6650 | 6653 | ||
| 6651 | msg_size = strlen (msg) + 1; /* Includes the null. */ | 6654 | msg_size = strlen (msg) + 1; /* Includes the null. */ |
| 6652 | 6655 | ||
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. */ | |||
| 137 | 137 | ||
| 138 | #define HAVE_SOCKETS 1 | 138 | #define HAVE_SOCKETS 1 |
| 139 | 139 | ||
| 140 | /* But our select implementation doesn't allow us to make non-blocking | ||
| 141 | connects. So until that is fixed, this is necessary: */ | ||
| 142 | |||
| 143 | #define BROKEN_NON_BLOCKING_CONNECT 1 | ||
| 144 | |||
| 145 | /* And the select implementation does 1-byte read-ahead waiting | ||
| 146 | for received packets, so datagrams are broken too. */ | ||
| 147 | |||
| 148 | #define BROKEN_DATAGRAM_SOCKETS 1 | ||
| 149 | |||
| 140 | /* Define this symbol if your system has the functions bcopy, etc. */ | 150 | /* Define this symbol if your system has the functions bcopy, etc. */ |
| 141 | 151 | ||
| 142 | #define BSTRING | 152 | #define BSTRING |
| @@ -376,7 +386,6 @@ typedef int pid_t; | |||
| 376 | #define pclose _pclose | 386 | #define pclose _pclose |
| 377 | #define putw _putw | 387 | #define putw _putw |
| 378 | #define umask _umask | 388 | #define umask _umask |
| 379 | #define utime _utime | ||
| 380 | #define utimbuf _utimbuf | 389 | #define utimbuf _utimbuf |
| 381 | #define index strchr | 390 | #define index strchr |
| 382 | #define rindex strrchr | 391 | #define rindex strrchr |
| @@ -385,7 +394,11 @@ typedef int pid_t; | |||
| 385 | #define strnicmp _strnicmp | 394 | #define strnicmp _strnicmp |
| 386 | #define stricmp _stricmp | 395 | #define stricmp _stricmp |
| 387 | #define tzset _tzset | 396 | #define tzset _tzset |
| 397 | |||
| 398 | #if !defined (_MSC_VER) || (_MSC_VER < 1400) | ||
| 388 | #define tzname _tzname | 399 | #define tzname _tzname |
| 400 | #define utime _utime | ||
| 401 | #endif | ||
| 389 | 402 | ||
| 390 | #ifdef HAVE_NTGUI | 403 | #ifdef HAVE_NTGUI |
| 391 | #define abort w32_abort | 404 | #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: ", | |||
| 2144 | doc: /* Search forward from point for STRING. | 2144 | doc: /* Search forward from point for STRING. |
| 2145 | Set point to the end of the occurrence found, and return point. | 2145 | Set point to the end of the occurrence found, and return point. |
| 2146 | An optional second argument bounds the search; it is a buffer position. | 2146 | An optional second argument bounds the search; it is a buffer position. |
| 2147 | The match found must not extend after that position. nil is equivalent | 2147 | The match found must not extend after that position. A value of nil is |
| 2148 | to (point-max). | 2148 | equivalent to (point-max). |
| 2149 | Optional third argument, if t, means if fail just return nil (no error). | 2149 | Optional third argument, if t, means if fail just return nil (no error). |
| 2150 | If not nil and not t, move to limit of search and return nil. | 2150 | If not nil and not t, move to limit of search and return nil. |
| 2151 | Optional fourth argument is repeat count--search for successive occurrences. | 2151 | 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. */ | |||
| 74 | #include <soundcard.h> | 74 | #include <soundcard.h> |
| 75 | #endif | 75 | #endif |
| 76 | #ifdef HAVE_ALSA | 76 | #ifdef HAVE_ALSA |
| 77 | #ifdef ALSA_SUBDIR_INCLUDE | ||
| 78 | #include <alsa/asoundlib.h> | ||
| 79 | #else | ||
| 77 | #include <asoundlib.h> | 80 | #include <asoundlib.h> |
| 78 | #endif | 81 | #endif /* ALSA_SUBDIR_INCLUDE */ |
| 82 | #endif /* HAVE_ALSA */ | ||
| 79 | 83 | ||
| 80 | /* END: Non Windows Includes */ | 84 | /* END: Non Windows Includes */ |
| 81 | 85 | ||
| @@ -153,7 +153,8 @@ typedef PSID_IDENTIFIER_AUTHORITY (WINAPI * GetSidIdentifierAuthority_Proc) ( | |||
| 153 | PSID pSid); | 153 | PSID pSid); |
| 154 | 154 | ||
| 155 | /* ** A utility function ** */ | 155 | /* ** A utility function ** */ |
| 156 | static BOOL is_windows_9x () | 156 | static BOOL |
| 157 | is_windows_9x () | ||
| 157 | { | 158 | { |
| 158 | static BOOL s_b_ret=0; | 159 | static BOOL s_b_ret=0; |
| 159 | OSVERSIONINFO os_ver; | 160 | OSVERSIONINFO os_ver; |
| @@ -2871,7 +2872,8 @@ int h_errno = 0; | |||
| 2871 | /* function to set h_errno for compatability; map winsock error codes to | 2872 | /* function to set h_errno for compatability; map winsock error codes to |
| 2872 | normal system codes where they overlap (non-overlapping definitions | 2873 | normal system codes where they overlap (non-overlapping definitions |
| 2873 | are already in <sys/socket.h> */ | 2874 | are already in <sys/socket.h> */ |
| 2874 | static void set_errno () | 2875 | static void |
| 2876 | set_errno () | ||
| 2875 | { | 2877 | { |
| 2876 | if (winsock_lib == NULL) | 2878 | if (winsock_lib == NULL) |
| 2877 | h_errno = EINVAL; | 2879 | h_errno = EINVAL; |
| @@ -2892,7 +2894,8 @@ static void set_errno () | |||
| 2892 | errno = h_errno; | 2894 | errno = h_errno; |
| 2893 | } | 2895 | } |
| 2894 | 2896 | ||
| 2895 | static void check_errno () | 2897 | static void |
| 2898 | check_errno () | ||
| 2896 | { | 2899 | { |
| 2897 | if (h_errno == 0 && winsock_lib != NULL) | 2900 | if (h_errno == 0 && winsock_lib != NULL) |
| 2898 | pfn_WSASetLastError (0); | 2901 | pfn_WSASetLastError (0); |
| @@ -3676,7 +3679,8 @@ _sys_read_ahead (int fd) | |||
| 3676 | return cp->status; | 3679 | return cp->status; |
| 3677 | } | 3680 | } |
| 3678 | 3681 | ||
| 3679 | int _sys_wait_accept (int fd) | 3682 | int |
| 3683 | _sys_wait_accept (int fd) | ||
| 3680 | { | 3684 | { |
| 3681 | HANDLE hEv; | 3685 | HANDLE hEv; |
| 3682 | child_process * cp; | 3686 | child_process * cp; |
| @@ -3698,10 +3702,10 @@ int _sys_wait_accept (int fd) | |||
| 3698 | { | 3702 | { |
| 3699 | rc = WaitForSingleObject (hEv, INFINITE); | 3703 | rc = WaitForSingleObject (hEv, INFINITE); |
| 3700 | pfn_WSAEventSelect (SOCK_HANDLE (fd), NULL, 0); | 3704 | pfn_WSAEventSelect (SOCK_HANDLE (fd), NULL, 0); |
| 3701 | pfn_WSACloseEvent (hEv); | ||
| 3702 | if (rc == WAIT_OBJECT_0) | 3705 | if (rc == WAIT_OBJECT_0) |
| 3703 | cp->status = STATUS_READ_SUCCEEDED; | 3706 | cp->status = STATUS_READ_SUCCEEDED; |
| 3704 | } | 3707 | } |
| 3708 | pfn_WSACloseEvent (hEv); | ||
| 3705 | 3709 | ||
| 3706 | return cp->status; | 3710 | return cp->status; |
| 3707 | } | 3711 | } |
| @@ -4127,7 +4131,7 @@ BOOL WINAPI shutdown_handler(DWORD type) | |||
| 4127 | shut_down_emacs (0, 0, Qnil); | 4131 | shut_down_emacs (0, 0, Qnil); |
| 4128 | } | 4132 | } |
| 4129 | 4133 | ||
| 4130 | /* Allow other handlers to handle this signal. */ | 4134 | /* Allow other handlers to handle this signal. */ |
| 4131 | return FALSE; | 4135 | return FALSE; |
| 4132 | } | 4136 | } |
| 4133 | 4137 | ||
| @@ -4136,7 +4140,8 @@ BOOL WINAPI shutdown_handler(DWORD type) | |||
| 4136 | must always be initialized on startup even when the global variable | 4140 | must always be initialized on startup even when the global variable |
| 4137 | initialized is non zero (see the function main in emacs.c). | 4141 | initialized is non zero (see the function main in emacs.c). |
| 4138 | */ | 4142 | */ |
| 4139 | void globals_of_w32 () | 4143 | void |
| 4144 | globals_of_w32 () | ||
| 4140 | { | 4145 | { |
| 4141 | g_b_init_is_windows_9x = 0; | 4146 | g_b_init_is_windows_9x = 0; |
| 4142 | g_b_init_open_process_token = 0; | 4147 | 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. */) | |||
| 8411 | } | 8411 | } |
| 8412 | return Qnil; | 8412 | return Qnil; |
| 8413 | } | 8413 | } |
| 8414 | |||
| 8415 | DEFUN ("w32-window-exists-p", Fw32_window_exists_p, Sw32_window_exists_p, | ||
| 8416 | 2, 2, 0, | ||
| 8417 | doc: /* Return non-nil if a window exists with the specified CLASS and NAME. | ||
| 8418 | |||
| 8419 | This is a direct interface to the Windows API FindWindow function. */) | ||
| 8420 | (class, name) | ||
| 8421 | Lisp_Object class, name; | ||
| 8422 | { | ||
| 8423 | HWND hnd; | ||
| 8424 | |||
| 8425 | if (!NILP (class)) | ||
| 8426 | CHECK_STRING (class); | ||
| 8427 | if (!NILP (name)) | ||
| 8428 | CHECK_STRING (name); | ||
| 8429 | |||
| 8430 | hnd = FindWindow (STRINGP (class) ? ((LPCTSTR) SDATA (class)) : NULL, | ||
| 8431 | STRINGP (name) ? ((LPCTSTR) SDATA (name)) : NULL); | ||
| 8432 | if (!hnd) | ||
| 8433 | return Qnil; | ||
| 8434 | return Qt; | ||
| 8435 | } | ||
| 8436 | |||
| 8437 | |||
| 8414 | 8438 | ||
| 8415 | DEFUN ("file-system-info", Ffile_system_info, Sfile_system_info, 1, 1, 0, | 8439 | DEFUN ("file-system-info", Ffile_system_info, Sfile_system_info, 1, 1, 0, |
| 8416 | doc: /* Return storage information about the file system FILENAME is on. | 8440 | doc: /* Return storage information about the file system FILENAME is on. |
| @@ -8977,6 +9001,7 @@ versions of Windows) characters. */); | |||
| 8977 | 9001 | ||
| 8978 | staticpro (&Qw32_charset_unicode); | 9002 | staticpro (&Qw32_charset_unicode); |
| 8979 | Qw32_charset_unicode = intern ("w32-charset-unicode"); | 9003 | Qw32_charset_unicode = intern ("w32-charset-unicode"); |
| 9004 | } | ||
| 8980 | #endif | 9005 | #endif |
| 8981 | 9006 | ||
| 8982 | #if 0 /* TODO: Port to W32 */ | 9007 | #if 0 /* TODO: Port to W32 */ |
| @@ -9021,6 +9046,7 @@ versions of Windows) characters. */); | |||
| 9021 | defsubr (&Sw32_registered_hot_keys); | 9046 | defsubr (&Sw32_registered_hot_keys); |
| 9022 | defsubr (&Sw32_reconstruct_hot_key); | 9047 | defsubr (&Sw32_reconstruct_hot_key); |
| 9023 | defsubr (&Sw32_toggle_lock_key); | 9048 | defsubr (&Sw32_toggle_lock_key); |
| 9049 | defsubr (&Sw32_window_exists_p); | ||
| 9024 | defsubr (&Sw32_find_bdf_fonts); | 9050 | defsubr (&Sw32_find_bdf_fonts); |
| 9025 | 9051 | ||
| 9026 | defsubr (&Sfile_system_info); | 9052 | 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 | |||
| 5727 | relative to the current window. If ARG is negative, it counts up from the | 5727 | relative to the current window. If ARG is negative, it counts up from the |
| 5728 | bottom of the window. (ARG should be less than the height of the window.) | 5728 | bottom of the window. (ARG should be less than the height of the window.) |
| 5729 | 5729 | ||
| 5730 | If ARG is omitted or nil, erase the entire frame and then | 5730 | If ARG is omitted or nil, erase the entire frame and then redraw with point |
| 5731 | redraw with point in the center of the current window. | 5731 | in the center of the current window. If `auto-resize-tool-bars' is set to |
| 5732 | `grow-only', this resets the tool-bar's height to the minimum height needed. | ||
| 5733 | |||
| 5732 | Just C-u as prefix means put point in the center of the window | 5734 | Just C-u as prefix means put point in the center of the window |
| 5733 | and redisplay normally--don't erase and redraw the frame. */) | 5735 | and redisplay normally--don't erase and redraw the frame. */) |
| 5734 | (arg) | 5736 | (arg) |
| @@ -5753,8 +5755,10 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 5753 | for (i = 0; i < n_compositions; i++) | 5755 | for (i = 0; i < n_compositions; i++) |
| 5754 | composition_table[i]->font = NULL; | 5756 | composition_table[i]->font = NULL; |
| 5755 | 5757 | ||
| 5756 | Fredraw_frame (w->frame); | 5758 | WINDOW_XFRAME (w)->minimize_tool_bar_window_p = 1; |
| 5757 | SET_FRAME_GARBAGED (XFRAME (WINDOW_FRAME (w))); | 5759 | |
| 5760 | Fredraw_frame (WINDOW_FRAME (w)); | ||
| 5761 | SET_FRAME_GARBAGED (WINDOW_XFRAME (w)); | ||
| 5758 | center_p = 1; | 5762 | center_p = 1; |
| 5759 | } | 5763 | } |
| 5760 | else if (CONSP (arg)) /* Just C-u. */ | 5764 | 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; | |||
| 290 | 290 | ||
| 291 | EMACS_INT tool_bar_button_relief; | 291 | EMACS_INT tool_bar_button_relief; |
| 292 | 292 | ||
| 293 | /* Non-zero means automatically resize tool-bars so that all tool-bar | 293 | /* Non-nil means automatically resize tool-bars so that all tool-bar |
| 294 | items are visible, and no blank lines remain. */ | 294 | items are visible, and no blank lines remain. |
| 295 | 295 | ||
| 296 | int auto_resize_tool_bars_p; | 296 | If value is `grow-only', only make tool-bar bigger. */ |
| 297 | |||
| 298 | Lisp_Object Vauto_resize_tool_bars; | ||
| 297 | 299 | ||
| 298 | /* Non-zero means draw block and hollow cursor as wide as the glyph | 300 | /* Non-zero means draw block and hollow cursor as wide as the glyph |
| 299 | under it. For example, if a block cursor is over a tab, it will be | 301 | 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) | |||
| 9854 | out:; | 9856 | out:; |
| 9855 | 9857 | ||
| 9856 | row->displays_text_p = row->used[TEXT_AREA] != 0; | 9858 | row->displays_text_p = row->used[TEXT_AREA] != 0; |
| 9857 | /* Use default face for the border below the tool bar. */ | 9859 | |
| 9858 | if (!row->displays_text_p) | 9860 | /* Use default face for the border below the tool bar. |
| 9861 | |||
| 9862 | FIXME: When auto-resize-tool-bars is grow-only, there is | ||
| 9863 | no additional border below the possibly empty tool-bar lines. | ||
| 9864 | So to make the extra empty lines look "normal", we have to | ||
| 9865 | use the tool-bar face for the border too. */ | ||
| 9866 | if (!row->displays_text_p && !EQ (Vauto_resize_tool_bars, Qgrow_only)) | ||
| 9859 | it->face_id = DEFAULT_FACE_ID; | 9867 | it->face_id = DEFAULT_FACE_ID; |
| 9868 | |||
| 9860 | extend_face_to_end_of_line (it); | 9869 | extend_face_to_end_of_line (it); |
| 9861 | last = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA] - 1; | 9870 | last = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA] - 1; |
| 9862 | last->right_box_line_p = 1; | 9871 | last->right_box_line_p = 1; |
| @@ -9878,6 +9887,7 @@ display_tool_bar_line (it, height) | |||
| 9878 | if (!row->displays_text_p) | 9887 | if (!row->displays_text_p) |
| 9879 | { | 9888 | { |
| 9880 | row->height = row->phys_height = it->last_visible_y - row->y; | 9889 | row->height = row->phys_height = it->last_visible_y - row->y; |
| 9890 | row->visible_height = row->height; | ||
| 9881 | row->ascent = row->phys_ascent = 0; | 9891 | row->ascent = row->phys_ascent = 0; |
| 9882 | row->extra_line_spacing = 0; | 9892 | row->extra_line_spacing = 0; |
| 9883 | } | 9893 | } |
| @@ -9980,7 +9990,6 @@ redisplay_tool_bar (f) | |||
| 9980 | struct window *w; | 9990 | struct window *w; |
| 9981 | struct it it; | 9991 | struct it it; |
| 9982 | struct glyph_row *row; | 9992 | struct glyph_row *row; |
| 9983 | int change_height_p = 0; | ||
| 9984 | 9993 | ||
| 9985 | #ifdef USE_GTK | 9994 | #ifdef USE_GTK |
| 9986 | if (FRAME_EXTERNAL_TOOL_BAR (f)) | 9995 | if (FRAME_EXTERNAL_TOOL_BAR (f)) |
| @@ -10075,10 +10084,10 @@ redisplay_tool_bar (f) | |||
| 10075 | w->desired_matrix->no_scrolling_p = 1; | 10084 | w->desired_matrix->no_scrolling_p = 1; |
| 10076 | w->must_be_updated_p = 1; | 10085 | w->must_be_updated_p = 1; |
| 10077 | 10086 | ||
| 10078 | if (auto_resize_tool_bars_p) | 10087 | if (!NILP (Vauto_resize_tool_bars)) |
| 10079 | { | 10088 | { |
| 10080 | int nlines, nrows; | ||
| 10081 | int max_tool_bar_height = MAX_FRAME_TOOL_BAR_HEIGHT (f); | 10089 | int max_tool_bar_height = MAX_FRAME_TOOL_BAR_HEIGHT (f); |
| 10090 | int change_height_p = 0; | ||
| 10082 | 10091 | ||
| 10083 | /* If we couldn't display everything, change the tool-bar's | 10092 | /* If we couldn't display everything, change the tool-bar's |
| 10084 | height if there is room for more. */ | 10093 | height if there is room for more. */ |
| @@ -10104,29 +10113,40 @@ redisplay_tool_bar (f) | |||
| 10104 | 10113 | ||
| 10105 | /* Resize windows as needed by changing the `tool-bar-lines' | 10114 | /* Resize windows as needed by changing the `tool-bar-lines' |
| 10106 | frame parameter. */ | 10115 | frame parameter. */ |
| 10107 | if (change_height_p | 10116 | if (change_height_p) |
| 10108 | && (nlines = tool_bar_lines_needed (f, &nrows), | ||
| 10109 | nlines != WINDOW_TOTAL_LINES (w))) | ||
| 10110 | { | 10117 | { |
| 10111 | extern Lisp_Object Qtool_bar_lines; | 10118 | extern Lisp_Object Qtool_bar_lines; |
| 10112 | Lisp_Object frame; | 10119 | Lisp_Object frame; |
| 10113 | int old_height = WINDOW_TOTAL_LINES (w); | 10120 | int old_height = WINDOW_TOTAL_LINES (w); |
| 10121 | int nrows; | ||
| 10122 | int nlines = tool_bar_lines_needed (f, &nrows); | ||
| 10114 | 10123 | ||
| 10115 | XSETFRAME (frame, f); | 10124 | change_height_p = ((EQ (Vauto_resize_tool_bars, Qgrow_only) |
| 10116 | Fmodify_frame_parameters (frame, | 10125 | && !f->minimize_tool_bar_window_p) |
| 10117 | Fcons (Fcons (Qtool_bar_lines, | 10126 | ? (nlines > old_height) |
| 10118 | make_number (nlines)), | 10127 | : (nlines != old_height)); |
| 10119 | Qnil)); | 10128 | f->minimize_tool_bar_window_p = 0; |
| 10120 | if (WINDOW_TOTAL_LINES (w) != old_height) | 10129 | |
| 10130 | if (change_height_p) | ||
| 10121 | { | 10131 | { |
| 10122 | clear_glyph_matrix (w->desired_matrix); | 10132 | XSETFRAME (frame, f); |
| 10123 | f->n_tool_bar_rows = nrows; | 10133 | Fmodify_frame_parameters (frame, |
| 10124 | fonts_changed_p = 1; | 10134 | Fcons (Fcons (Qtool_bar_lines, |
| 10135 | make_number (nlines)), | ||
| 10136 | Qnil)); | ||
| 10137 | if (WINDOW_TOTAL_LINES (w) != old_height) | ||
| 10138 | { | ||
| 10139 | clear_glyph_matrix (w->desired_matrix); | ||
| 10140 | f->n_tool_bar_rows = nrows; | ||
| 10141 | fonts_changed_p = 1; | ||
| 10142 | return 1; | ||
| 10143 | } | ||
| 10125 | } | 10144 | } |
| 10126 | } | 10145 | } |
| 10127 | } | 10146 | } |
| 10128 | 10147 | ||
| 10129 | return change_height_p; | 10148 | f->minimize_tool_bar_window_p = 0; |
| 10149 | return 0; | ||
| 10130 | } | 10150 | } |
| 10131 | 10151 | ||
| 10132 | 10152 | ||
| @@ -13596,7 +13616,7 @@ redisplay_window (window, just_this_one_p) | |||
| 13596 | #else | 13616 | #else |
| 13597 | redisplay_tool_bar_p = WINDOWP (f->tool_bar_window) | 13617 | redisplay_tool_bar_p = WINDOWP (f->tool_bar_window) |
| 13598 | && (FRAME_TOOL_BAR_LINES (f) > 0 | 13618 | && (FRAME_TOOL_BAR_LINES (f) > 0 |
| 13599 | || auto_resize_tool_bars_p); | 13619 | || !NILP (Vauto_resize_tool_bars)); |
| 13600 | 13620 | ||
| 13601 | #endif | 13621 | #endif |
| 13602 | 13622 | ||
| @@ -24376,12 +24396,13 @@ Autoselection selects the minibuffer only if it is active, and never | |||
| 24376 | unselects the minibuffer if it is active. */); | 24396 | unselects the minibuffer if it is active. */); |
| 24377 | Vmouse_autoselect_window = Qnil; | 24397 | Vmouse_autoselect_window = Qnil; |
| 24378 | 24398 | ||
| 24379 | DEFVAR_BOOL ("auto-resize-tool-bars", &auto_resize_tool_bars_p, | 24399 | DEFVAR_LISP ("auto-resize-tool-bars", &Vauto_resize_tool_bars, |
| 24380 | doc: /* *Non-nil means automatically resize tool-bars. | 24400 | doc: /* *Non-nil means automatically resize tool-bars. |
| 24381 | This increases a tool-bar's height if not all tool-bar items are visible. | 24401 | This dynamically changes the tool-bar's height to the minimum height |
| 24382 | It decreases a tool-bar's height when it would display blank lines | 24402 | that is needed to make all tool-bar items visible. |
| 24383 | otherwise. */); | 24403 | If value is `grow-only', the tool-bar's height is only increased |
| 24384 | auto_resize_tool_bars_p = 1; | 24404 | automatically; to decreace the tool-bar height, use \\[recenter]. */); |
| 24405 | Vauto_resize_tool_bars = Qt; | ||
| 24385 | 24406 | ||
| 24386 | DEFVAR_BOOL ("auto-raise-tool-bar-buttons", &auto_raise_tool_bar_buttons_p, | 24407 | DEFVAR_BOOL ("auto-raise-tool-bar-buttons", &auto_raise_tool_bar_buttons_p, |
| 24387 | doc: /* *Non-nil means raise tool-bar buttons when the mouse moves over them. */); | 24408 | doc: /* *Non-nil means raise tool-bar buttons when the mouse moves over them. */); |