summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2007-01-01 17:38:32 +0000
committerKaroly Lorentey <lorentey@elte.hu>2007-01-01 17:38:32 +0000
commit65e86587ab836aaa86b12ce30b219bcb4fcbaa06 (patch)
tree7e13feee7387635f52df3613cf1bba4414781aab /src
parent8c778e28bcf16b4baef6400a124ec2403941e940 (diff)
parent1fc8c92b50100da709c94a0faa47deed5603634f (diff)
downloademacs-65e86587ab836aaa86b12ce30b219bcb4fcbaa06.tar.gz
emacs-65e86587ab836aaa86b12ce30b219bcb4fcbaa06.tar.bz2
emacs-65e86587ab836aaa86b12ce30b219bcb4fcbaa06.zip
Merged from emacs@sv.gnu.org.
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-536 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-537 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-538 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-539 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-540 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-541 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-542 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-543 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-544 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-545 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-546 Update from erc--emacs--22 * emacs@sv.gnu.org/emacs--devo--0--patch-547 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-548 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-549 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-550 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-551 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-552 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-553 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-554 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-555 erc-iswitchb: Temporarily enable iswitchb mode * emacs@sv.gnu.org/emacs--devo--0--patch-556 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-557 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-558 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-559 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-560 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-561 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-562 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-563 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-564 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-565 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-566 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-567 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-568 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-569 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-570 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-571 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-572 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-573 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-574 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-575 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-576 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-577 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-578 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-579 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-580 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-581 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-582 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-583 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-584 Fix admin/quick-install-emacs to work with recent versions of autoconf * emacs@sv.gnu.org/gnus--rel--5.10--patch-171 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-172 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-173 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-174 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-175 Update from CVS: lisp/legacy-gnus-agent.el: Add Copyright notice. * emacs@sv.gnu.org/gnus--rel--5.10--patch-176 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-177 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-178 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-179 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-180 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-181 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-182 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-183 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-184 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-185 Merge from emacs--devo--0 git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-590
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit4
-rw-r--r--src/.gitignore1
-rw-r--r--src/ChangeLog400
-rw-r--r--src/Makefile.in5
-rw-r--r--src/abbrev.c23
-rw-r--r--src/buffer.c51
-rw-r--r--src/callint.c6
-rw-r--r--src/callproc.c3
-rw-r--r--src/category.c3
-rw-r--r--src/category.h3
-rw-r--r--src/ccl.c3
-rw-r--r--src/ccl.h3
-rw-r--r--src/charset.c3
-rw-r--r--src/charset.h3
-rw-r--r--src/coding.c3
-rw-r--r--src/coding.h3
-rw-r--r--src/composite.c2
-rw-r--r--src/composite.h2
-rw-r--r--src/config.in14
-rw-r--r--src/data.c2
-rw-r--r--src/dired.c83
-rw-r--r--src/emacs.c44
-rw-r--r--src/fileio.c12
-rw-r--r--src/fontset.c3
-rw-r--r--src/fontset.h3
-rw-r--r--src/frame.h4
-rw-r--r--src/gtkutil.c210
-rw-r--r--src/keyboard.c181
-rw-r--r--src/keyboard.h1
-rw-r--r--src/keymap.c32
-rw-r--r--src/lread.c4
-rw-r--r--src/m/amdx86-64.h11
-rw-r--r--src/m/hp800.h8
-rw-r--r--src/m/sh3el.h109
-rw-r--r--src/mac.c29
-rw-r--r--src/macfns.c54
-rw-r--r--src/macselect.c3
-rw-r--r--src/macterm.c226
-rw-r--r--src/macterm.h1
-rw-r--r--src/makefile.w32-in12
-rw-r--r--src/marker.c2
-rw-r--r--src/minibuf.c11
-rw-r--r--src/msdos.c2
-rw-r--r--src/msdos.h2
-rw-r--r--src/prefix-args.c8
-rw-r--r--src/process.c93
-rw-r--r--src/regex.c21
-rw-r--r--src/s/ms-w32.h15
-rw-r--r--src/search.c4
-rw-r--r--src/sound.c6
-rw-r--r--src/syntax.c4
-rw-r--r--src/systime.h8
-rw-r--r--src/w32.c19
-rw-r--r--src/w32fns.c36
-rw-r--r--src/w32term.c8
-rw-r--r--src/window.c12
-rw-r--r--src/xdisp.c90
-rw-r--r--src/xterm.c48
58 files changed, 1470 insertions, 486 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index 5dc126f8d36..0561d53a937 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -34,6 +34,10 @@ handle 2 noprint pass
# Make it work like SIGINT normally does.
handle SIGTSTP nopass
+# Pass on user signals
+handle SIGUSR1 noprint pass
+handle SIGUSR2 noprint pass
+
# Don't pass SIGALRM to Emacs. This makes problems when
# debugging.
handle SIGALRM ignore
diff --git a/src/.gitignore b/src/.gitignore
index 8dbbc9f86b6..9bb6e8932b6 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -19,3 +19,4 @@ prefix-args
stamp-oldxmenu
temacs
buildobj.lst
+stamp_BLD
diff --git a/src/ChangeLog b/src/ChangeLog
index 506ee83c8cb..3dc5a094d4a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,348 @@
+2006-12-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (update_frame_tool_bar): Connect create-menu-proxy with
+ xg_tool_bar_menu_proxy.
+ (xg_tool_bar_menu_proxy): New function.
+ (xg_tool_bar_proxy_callback): New function.
+
+2006-12-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (xg_tool_bar_button_cb): Save last modifier on widget.
+ (xg_tool_bar_callback): Remove check for button.
+ (update_frame_tool_bar): Put an event box in the tool bar and a button
+ in the event box. Attach enter/leave-notify-event to the event box.
+
+2006-12-30 Richard Stallman <rms@gnu.org>
+
+ * keymap.c (Fdefine_key): Doc fix.
+
+2006-12-29 Kim F. Storm <storm@cua.dk>
+
+ * frame.h (struct frame): New member minimize_tool_bar_window_p.
+
+ * xdisp.c (auto_resize_tool_bars_p): Replace with ...
+ (Vauto_resize_tool_bars): ... this.
+ (syms_of_xdisp): DEFVAR_LISP and initialize it. Update doc string
+ to describe new value `grow-only', and use of C-l.
+ (display_tool_bar_line): Only use default face for border below
+ toolbar if not grow-only (to get acceptable visual appearence).
+ Explicitly set visible_height for empty toolbar lines.
+ (redisplay_tool_bar): Handle `grow-only' setting. Check and clear
+ minimize_tool_bar_window_p flag.
+
+ * window.c (Frecenter): Set minimize_tool_bar_window_p flag
+ when called without arg to redraw with minimum toolbar height.
+ Update doc string.
+
+2006-12-29 Jason Rumney <jasonr@gnu.org>
+
+ * s/ms-w32.h (tzname): Do not define in msvc8.
+ (utime): Do not define in msvc8.
+
+ * regex.c (regerror): Change parameter name err_code.
+
+2006-12-26 Richard Stallman <rms@gnu.org>
+
+ * search.c (Fsearch_forward): Doc fix.
+
+ * callint.c (Finteractive): Doc fix.
+
+2006-12-25 Kim F. Storm <storm@cua.dk>
+
+ * s/ms-w32.h (BROKEN_DATAGRAM_SOCKETS): Define it.
+
+2006-12-23 Eli Zaretskii <eliz@gnu.org>
+
+ * keyboard.c (some_mouse_moved): Fix last change.
+
+2006-12-22 Eli Zaretskii <eliz@gnu.org>
+
+ * callproc.c (syms_of_callproc) <shell-file-name>: Doc fix.
+
+2006-12-22 Mark Davies <mark@mcs.vuw.ac.nz>
+
+ * m/amdx86-64.h, m/hp800.h: Add support for NetBSD.
+ * m/sh3el.h: New file.
+
+2006-12-22 Eli Zaretskii <eliz@gnu.org>
+
+ * makefile.w32-in (emacs, temacs): Depend on stamp_BLD instead of
+ $(BLD).
+ ($(OBJ0) $(OBJ1) $(WIN32OBJ)): New dependency on stamp_BLD.
+ (bootstrap-temacs): Pass $(XMFLAGS) to sub-make.
+ ($(OBJ0) $(OBJ1) $(WIN32OBJ)): Add lastfile.$(O) and firstfile.$(O).
+ (clean): Delete stamp_BLD.
+
+2006-12-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * macfns.c (mac_update_title_bar) [TARGET_API_MAC_CARBON]: Call
+ mac_update_proxy_icon also when buffer modification flag changed.
+ [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): Don't update alias,
+ but compare FSRef/FSSpec of resolved alias.
+
+2006-12-21 Kim F. Storm <storm@cua.dk>
+
+ * w32.c (_sys_wait_accept): Fix handle leak.
+
+2006-12-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
+
+ * sound.c: Include <alsa/asoundlib.h> if ALSA_SUBDIR_INCLUDE is
+ defined.
+
+2006-12-20 Kim F. Storm <storm@cua.dk>
+
+ * s/ms-w32.h (BROKEN_NON_BLOCKING_CONNECT): Define it.
+
+2006-12-19 Juanma Barranquero <lekktu@gmail.com>
+
+ * keyboard.c (syms_of_keyboard) <double-click-time>:
+ * mac.c (Fmac_code_convert_string):
+ * search.c (Fsearch_forward): Doc fixes.
+
+2006-12-19 Kim F. Storm <storm@cua.dk>
+
+ Rework 2006-12-04 change. A SIGUSR1 (SIGUSR2) signal now generates
+ a sigusr1 event instead of [signal usr1] sequence, and signal events
+ are now supposed to be handled via special-event-map.
+
+ * keyboard.c (kbd_buffer_store_event_hold): Undo 2006-12-04 change.
+ (make_lispy_event): Don't generate Qsignal prefix for code 0.
+ Abort if signal code is unknown.
+ (store_user_signal_events): Don't make Qsignal prefix (code 0).
+ (Qsignal): Move declaration back to process.c.
+ (syms_of_keyboard): Don't intern or staticpro it here.
+
+ * process.c (Qsignal): Declare here.
+ (syms_of_process): Intern or staticpro it.
+
+ * emacs.c (main): Rename user signals to sigusr1 and sigusr2.
+
+ * .gdbinit: Pass on SIGUSR1 and SIGUSR2 to Emacs.
+
+2006-12-19 Juanma Barranquero <lekktu@gmail.com>
+
+ * buffer.c (syms_of_buffer) <buffer-display-table>
+ <scroll-up-aggressively, scroll-down-aggressively>: Doc fixes.
+
+2006-12-17 Richard Stallman <rms@gnu.org>
+
+ * fileio.c (Fread_file_name_internal): Pass Vread_file_name_predicate
+ to Ffile_name_completion.
+
+ * dired.c (file_name_completion): New arg PREDICATE. Some cleanup.
+ (Ffile_name_completion): New arg PREDICATE.
+
+2006-12-17 Juanma Barranquero <lekktu@gmail.com>
+
+ * buffer.c (Fkill_buffer): Doc fix.
+ (syms_of_buffer) <kill-buffer-query-functions>: Doc fix.
+
+2006-12-16 Juanma Barranquero <lekktu@gmail.com>
+
+ * minibuf.c (Ftry_completion): Check that obarray buckets are symbols.
+
+2006-12-16 Eli Zaretskii <eliz@gnu.org>
+
+ * w32fns.c (w32-window-exists-p): New function.
+ (syms_of_w32fns): Defsubr it.
+
+ * prefix-args.c [STDC_HEADERS]: Include stdlib.h.
+
+2006-12-16 Juanma Barranquero <lekktu@gmail.com>
+
+ * minibuf.c (Ftry_completion): Use `check_obarray' if ALIST is a vector.
+
+2006-12-15 Eli Zaretskii <eliz@gnu.org>
+
+ * emacs.c (USAGE3): Clarify documentation of --color.
+
+2006-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * mac.c (wakeup_from_rne_enabled_p) [TARGET_API_MAC_CARBON]:
+ New variable.
+ (ENABLE_WAKEUP_FROM_RNE, DISABLE_WAKEUP_FROM_RNE): New macros.
+ [!MAC_OSX] (select): Use them.
+ [MAC_OSX] (select_and_poll_event, sys_select): Likewise.
+ (mac_wakeup_from_rne) [TARGET_API_MAC_CARBON]: New function.
+
+ * macfns.c (mac_atsu_font_face_attributes) [USE_ATSUI]: Add extern.
+ (Fmac_atsu_font_face_attributes) [USE_ATSUI]: New function.
+ (syms_of_macfns) [USE_ATSUI]: Defsubr it.
+
+ * macselect.c [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Use
+ mac_wakeup_from_rne instead of mac_post_mouse_moved_event.
+
+ * macterm.c (mac_query_char_extents) [USE_ATSUI]: Don't call
+ ATSUGetGlyphBounds if not necessary.
+ (Vmac_atsu_font_table) [USE_ATSUI]: Remove variable.
+ (syms_of_macterm) [USE_ATSUI]: Don't defvar it.
+ (fm_get_style_from_font, atsu_find_font_from_family_name)
+ (atsu_find_font_family_name, mac_atsu_font_face_attributes)
+ [USE_ATSUI]: New functions.
+ (init_font_name_table) [USE_ATSUI]: Use atsu_find_font_family_name.
+ (mac_load_query_font) [USE_ATSUI]: Use atsu_find_font_from_family_name.
+ Don't get metrics for Latin-1 right half characters.
+ (mac_load_query_font): Don't load font if space width is not positive.
+ [TARGET_API_MAC_CARBON] (mac_store_event_ref_as_apple_event): Use
+ mac_wakeup_from_rne instead of mac_post_mouse_moved_event.
+ (XTread_socket): Call SelectWindow when unfocused frame is clicked.
+
+ * macterm.h (mac_wakeup_from_rne) [TARGET_API_MAC_CARBON]: Add extern.
+
+2006-12-15 Kim F. Storm <storm@cua.dk>
+
+ * keyboard.c (ignore_mouse_drag_p): New global var.
+ (some_mouse_moved): Return 0 if it is non-zero.
+ (make_lispy_event): Generate click event on mouse up if
+ ignore_mouse_drag_p is non-zero, even if mouse moved.
+ Clear ignore_mouse_drag_p on mouse down/up.
+
+ * xdisp.c (redisplay_window): Set ignore_mouse_drag_p if tool-bar
+ is resized to avoid generating a mouse drag event.
+
+2006-12-14 Juanma Barranquero <lekktu@gmail.com>
+
+ * w32fns.c (w32_wnd_proc): Force non-tooltip frames to respect the
+ minimum tracking size. Remove non-working old hack to do the same.
+
+2006-12-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * emacs.c (handle_user_signal): Move function to keyboard.c.
+ (main): Use add_user_signal for SIGUSR1 and SIGUSR2.
+
+ * keyboard.c (make_lispy_event): Use find_user_signal_name.
+ (read_avail_input): Store pending user signal events.
+ (struct user_signal_info): New struct.
+ (user_signals): New variable.
+ (add_user_signal, store_user_signal_events)
+ (find_user_signal_name): New functions.
+ (handle_user_signal): Move function from emacs.c. Don't store
+ USER_SIGNAL_EVENT here, but increment number of pending signals.
+
+ * keyboard.h (add_user_signals): Add extern.
+
+2006-12-11 Juanma Barranquero <lekktu@gmail.com>
+
+ * buffer.c (syms_of_buffer) <cursor-in-non-selected-windows>:
+ <default-scroll-up-aggressively, default-scroll-down-aggressively>:
+ <line-spacing, left-margin>: Doc fixes.
+
+ * xdisp.c (syms_of_xdisp) <mode-line-inverse-video>: Doc fix.
+
+2006-12-10 Kim F. Storm <storm@cua.dk>
+
+ * xdisp.c (show_mouse_face): Never use text cursor in tool-bar.
+
+2006-12-10 Juanma Barranquero <lekktu@gmail.com>
+
+ * abbrev.c (syms_of_abbrev) <last-abbrev-text>:
+ * buffer.c (syms_of_buffer) <default-major-mode>:
+ * keymap.c (Flookup_key):
+ * lread.c (Feval_buffer, Feval_region):
+ * macterm.c (syms_of_macterm) <x-use-underline-position-properties>:
+ <x-underline-at-descent-line, mac-emulate-three-button-mouse>:
+ * marker.c (Fmarker_insertion_type):
+ * minibuf.c (syms_of_minibuf) <minibuffer-completion-table>:
+ * msdos.c (syms_of_msdos) <delete-exited-processes>:
+ * w32term.c (syms_of_w32term) <x-use-underline-position-properties>:
+ <x-underline-at-descent-line>:
+ * xdisp.c (format-mode-line):
+ * xterm.c (syms_of_xterm) <x-use-underline-position-properties>:
+ <x-underline-at-descent-line>: Doc fixes.
+
+2006-12-10 Andreas Schwab <schwab@suse.de>
+
+ * systime.h (EMACS_GET_TIME): Remove check for
+ HAVE_STRUCT_TIMEZONE which is never defined.
+
+2006-12-10 Alan Mackenzie <acm@muc.de>
+
+ * syntax.c (Fpartial_parse_sexp): Correct Docco: Elt 8 of the
+ result is now neither the last elt nor optional for OLDSTATE.
+
+2006-12-09 Eli Zaretskii <eliz@gnu.org>
+
+ * process.c (Fsignal_process): Doc fix. Use XFLOAT_DATA to
+ extract the process ID from a Lisp float.
+
+2006-12-09 Chong Yidong <cyd@stupidchicken.com>
+
+ * xterm.c (XTframe_raise_lower): Comment out _NET_ACTIVE_WINDOW code.
+
+2006-12-08 Eli Zaretskii <eliz@gnu.org>
+
+ * frame.h (PIX_TYPE): Redefine as `unsigned long', for 64-bit
+ platforms where long is 64-bit.
+
+ * msdos.h (PIX_TYPE): Redefine as `unsigned long'.
+
+2006-12-08 NAKAJI Hiroyuki <nakaji@jp.freebsd.org> (tiny change)
+
+ * m/amdx86-64.h: Add support for Solaris 10 on x86-64.
+
+2006-12-08 Kenichi Handa <handa@m17n.org>
+
+ * xterm.c (x_query_font): Use xstricmp instead off strcasecmp.
+
+2006-12-08 Juanma Barranquero <lekktu@gmail.com>
+
+ * emacs.c (syms_of_emacs) <system-type>: Doc fix.
+
+2006-12-07 Kim F. Storm <storm@cua.dk>
+
+ * process.c (parse_signal): Use xstricmp instead of strcasecmp.
+ (Fsignal_process): Don't use strncasecmp.
+
+2006-12-05 Glenn Morris <rgm@gnu.org>
+
+ * abbrev.c (Qforce): New Lisp_Object.
+ (Fdefine_abbrev): Do not overwrite non-system abbrevs with system
+ abbrevs, unless 'force is applied.
+ (syms_of_abbrev): Add Qforce.
+
+2006-12-04 Kim F. Storm <storm@cua.dk>
+
+ * process.c (parse_signal): Rename macro from handle_signal.
+ (Fsignal_process): Also accept lower-case variants of signal
+ names (to align with signal names generated by Emacs itself).
+
+ * emacs.c (handle_USR1_signal, handle_USR2_signal): Replace by...
+ (handle_user_signal): ... this, which generates two USER_SIGNAL_EVENTs
+ first with code == 0 [signal] and one with code == sig number.
+ (main): Use it as handler for SIGUR1 and SIGUSR2.
+
+ * keyboard.c (kbd_buffer_store_event_hold): Don't throw-on-input
+ if first event in [signal xxx] sequence.
+ (lispy_user_signals, Qusr1_signal, Qusr2_signal): Remove.
+ (syms_of_keyboard): Don't intern and staticpro them.
+ (Qsignal): Declare here.
+ (syms_of_keyboard): Intern and staticpro it.
+ (make_lispy_event): Use it. Intern symbols on the fly for other
+ USER_SIGNAL_EVENTs events.
+
+ * process.c (Qsignal): Declare extern.
+ (syms_of_process): Don't intern/staticpro it here.
+
+ * process.c (read_process_output): Abort if carryover < 0.
+
+2006-12-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * config.in: Regenerate.
+
+ * fileio.c [__NetBSD__]: Don't define `unix'.
+ (Funix_sync, syms_of_fileio): Use `#ifdef HAVE_SYNC' instead of
+ `#ifdef unix'.
+
+2006-12-04 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (version): New variable, set by configure.
+ (bootstrapclean, mostlyclean): Also remove emacs-${version}.
+
+2006-12-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
+
+ * gtkutil.c (update_frame_tool_bar): Handle modifying a toolbar item
+ without an image.
+
2006-12-01 Eli Zaretskii <eliz@gnu.org>
* w32fns.c (Fw32_shell_execute): Doc fix.
@@ -466,7 +811,7 @@
2006-10-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* xselect.c (x_handle_selection_request): If the converted_selection
- is NIL or XCDR (converted_selection) is NIL, decline the request.
+ is nil or XCDR (converted_selection) is nil, decline the request.
2006-10-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
@@ -2571,8 +2916,8 @@
(struct sound_device): Add period_size.
(wav_play, au_play): Use period_size if set.
- * Makefile.in (CFLAGS_SOUND): New flags for ALSA
- (ALL_CFLAGS): Add CFLAGS_SOUND
+ * Makefile.in (CFLAGS_SOUND): New flags for ALSA.
+ (ALL_CFLAGS): Add CFLAGS_SOUND.
2006-05-18 Kenichi Handa <handa@m17n.org>
@@ -4196,8 +4541,8 @@
2006-01-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
- * gtkutil.c (update_frame_tool_bar): Use new tool bar functions
- (gtk_toolbar_insert) so we can have tool bars of different sizes.
+ * gtkutil.c (update_frame_tool_bar): Use new tool bar function
+ gtk_toolbar_insert() so we can have tool bars of different sizes.
2006-01-30 Luc Teirlinck <teirllm@auburn.edu>
@@ -4525,7 +4870,7 @@
2005-12-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
- * xfns.c: x_show_hidden_files, new variable.
+ * xfns.c (x_show_hidden_files): New variable.
(syms_of_xfns): Defvar it.
* gtkutil.c (xg_toggle_visibility_cb): New function.
@@ -6810,7 +7155,7 @@
* w32console.c (initialize_w32_display): Detect when the console
dimensions are insane, and default to 80x25 instead.
- (w32_use_full_screen_buffer): Default to NIL.
+ (w32_use_full_screen_buffer): Default to nil.
2005-07-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
@@ -10019,7 +10364,7 @@
* xterm.c (x_calc_absolute_position): Don't subtract outer_pixel_diff
for left and top calculations. Remove call to x_real_positions.
- [Bug report by Drew Adams in November]
+ [Bug report by Drew Adams in November.]
(x_check_expected_move): Do not set change_gravity to 1 when calling
x_set_offset.
@@ -10069,8 +10414,8 @@
new variables main_thread and alloc_mutex,
define (UN)BLOCK_INPUT_ALLOC to use alloc_mutex to protect
emacs_blocked_* calls and only do (UN)BLOCK_INPUT in the main thread.
- If not HAVE_GTK_AND_PTHREAD, (UN)BLOCK_INPUT_ALLOC is the same as
- (UN)BLOCK_INPUT.
+ If not HAVE_GTK_AND_PTHREAD, (UN)BLOCK_INPUT_ALLOC is the same
+ as (UN)BLOCK_INPUT.
(emacs_blocked_free, emacs_blocked_malloc)
(emacs_blocked_realloc): Use (UN)BLOCK_INPUT_ALLOC.
(uninterrupt_malloc): Initialize main_thread and alloc_mutex.
@@ -10080,7 +10425,7 @@
* emacs.c (Fdump_emacs): Call reset_malloc_hooks.
- * keyboard.c: Conditionally include pthread.h
+ * keyboard.c: Conditionally include pthread.h.
(handle_async_input, input_available_signalt): If not in the main
thread, block signal, send signal to main thread and return.
@@ -10890,7 +11235,7 @@
2004-11-02 Kim F. Storm <storm@cua.dk>
- * Makefile.in (callproc.o): Depend on blockinput.h atimer.h systime.h.
+ * Makefile.in (callproc.o): Depend on blockinput.h, atimer.h, systime.h.
2004-11-02 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
@@ -10951,10 +11296,9 @@
* w32fns.c (Fx_file_dialog): Add parameter only_dir_p.
Check only_dir_p instead of comparing prompt to "Dired".
- * gtkutil.c (xg_get_file_with_chooser)
- (xg_get_file_with_selection): New functions, only defined ifdef
- HAVE_GTK_FILE_CHOOSER_DIALOG_NEW and HAVE_GTK_FILE_SELECTION_NEW
- respectively.
+ * gtkutil.c (xg_get_file_with_chooser, xg_get_file_with_selection):
+ New functions, only defined ifdef HAVE_GTK_FILE_CHOOSER_DIALOG_NEW
+ and HAVE_GTK_FILE_SELECTION_NEW respectively.
(xg_get_file_name): Add parameter only_dir_p.
Call xg_get_file_with_chooser or xg_get_file_with_selection
depending on HAVE_GTK_FILE* and the value of use_old_gtk_file_dialog.
@@ -10991,7 +11335,7 @@
tool_bar_items to assignment of result.
* atimer.c (alarm_signal_handler): Do not call set_alarm if
- pending_atmers is non-zero.
+ pending_atimers is non-zero.
2004-10-31 Kim F. Storm <storm@cua.dk>
@@ -14611,14 +14955,14 @@
* xterm.c (handle_one_xevent): Call x_handle_dnd_message for
ClientMessages.
- * xselect.c: Include termhooks.h and X11/Xproto.h
+ * xselect.c: Include termhooks.h and X11/Xproto.h.
(x_check_property_data, x_fill_property_data)
(x_property_data_to_lisp, mouse_position_for_drop)
(Fx_get_atom_name, x_handle_dnd_message): New functions for DND support.
(Fx_send_client_event): Move here from xfns.c.
(syms_of_xselect): Add Sx_get_atom_name and Sx_send_client_message.
- * xfns.c (x-send-client-message): Move to xselect.c
+ * xfns.c (x-send-client-message): Move to xselect.c.
(Fx_change_window_property): Add optional arguments TYPE, FORMAT and
OUTER_P.
(Fx_window_property): Add optional arguments TYPE, SOURCE, DELETE_P,
@@ -18179,7 +18523,7 @@
2003-03-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
- * xdisp.c (get_glyph_string_clip_rect): Remove ; at end of #endif
+ * xdisp.c (get_glyph_string_clip_rect): Remove ; at end of #endif.
* gtkutil.h: Take two more arguments to xg_update_scrollbar_pos.
(XG_SB_RANGE): New define.
@@ -18416,7 +18760,7 @@
* gtkutil.c: Removed handle_fixed_child, struct xg_last_sb_pos.
(xg_resize_widgets): Don't call foreach(handle_fixed_child).
(xg_gtk_scroll_destroy): Remove free of struct xg_last_sb_pos.
- (scroll_bar_button_cb): Set bar->dragging to NIL on button release.
+ (scroll_bar_button_cb): Set bar->dragging to nil on button release.
(xg_create_scroll_bar): Pass bar to button event callback.
(xg_find_top_left_in_fixed): New function.
(xg_update_scrollbar_pos): Don't call gdk_window_clear on
@@ -18717,7 +19061,7 @@
2003-02-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* keyboard.c (cancel_hourglass_unwind): Surround with
- #ifdef HAVE_X_WINDOWS
+ #ifdef HAVE_X_WINDOWS.
2003-02-25 Kenichi Handa <handa@m17n.org>
@@ -19278,7 +19622,7 @@
2003-01-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
- * gtkutil.c: Must include stdio.h before termhooks.h
+ * gtkutil.c: Must include stdio.h before termhooks.h.
2003-01-21 Dave Love <fx@gnu.org>
@@ -19324,7 +19668,7 @@
* xterm.c (handle_one_xevent): Surround popup_activated
with #ifdef:s for non-toolkit version.
- * Makefile.in (XOBJ): Add gtkutil.o if USE_GTK
+ * Makefile.in (XOBJ): Add gtkutil.o if USE_GTK.
(gtkutil.o): New file.
(TOOLKIT_DEFINES): Set to -DUSE_GTK if HAVE_GTK.
(LIBW): Set to @GTK_LIBS@ if USE_GTK.
@@ -19370,7 +19714,7 @@
(syms_of_xterm): Set Vx_toolkit_scroll_bars for USE_GTK.
* xmenu.c: Include gtkutil.h for USE_GTK.
- (Fx_popup_menu): Use current position if x and y is NIL.
+ (Fx_popup_menu): Use current position if x and y are nil.
(single_menu_item, single_menu_item, Fx_popup_dialog):
Check for USE_GTK.
(popup_widget_loop): New function for USE_GTK.
@@ -19400,7 +19744,7 @@
(x_set_tool_bar_lines): Call update_frame_tool_bar for USE_GTK.
(x_set_name, x_set_title): Call gtk_window_set_title for USE_GTK.
(x_window): Call xg_create_frame_widgets for USE_GTK.
- (Fx_create_frame): Check for USE_GTK
+ (Fx_create_frame): Check for USE_GTK.
(Fx_file_dialog): New implementation for USE_GTK.
* xdisp.c: Add check for USE_GTK for extern void set_frame_menubar.
@@ -19427,7 +19771,7 @@
* dispnew.c (adjust_frame_glyphs_for_window_redisplay):
Add check for USE_GTK.
- * config.in: Added HAVE_GTK
+ * config.in: Added HAVE_GTK.
* alloc.c (Fgarbage_collect): Call xg_mark_data for GTK.
@@ -20653,7 +20997,7 @@
Only when it is non-nil, handle composition sequence.
(setup_coding_system) <0>: Don't force composition handling.
- * Makefile.in (lisp, shortlisp): Add utf-16.elc
+ * Makefile.in (lisp, shortlisp): Add utf-16.elc.
2002-09-29 Richard M. Stallman <rms@gnu.org>
diff --git a/src/Makefile.in b/src/Makefile.in
index 71eaeadb6ba..94fe5dee41f 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -38,6 +38,7 @@ CPPFLAGS=@CPPFLAGS@
LDFLAGS=@LDFLAGS@
LN_S=@LN_S@
EXEEXT=@EXEEXT@
+version=@version@
# Substitute an assignment for the MAKE variable, because
# BSD doesn't have it as a default.
@SET_MAKE@
@@ -1320,11 +1321,11 @@ ${emacsapp}Contents/Resources/Emacs.rsrc: ../mac/src/Emacs.r
${libsrc}emacstool${EXEEXT}: ${libsrc}emacstool.c
cd ${libsrc}; ${MAKE} ${MFLAGS} emacstool${EXEEXT}
bootstrapclean:
- rm -f bootstrap-emacs${EXEEXT}
+ rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT}
mostlyclean:
rm -f temacs${EXEEXT} prefix-args${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a
rm -f ../etc/DOC
- rm -f bootstrap-emacs${EXEEXT}
+ rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT}
rm -f buildobj.lst
clean: mostlyclean
rm -f emacs-*${EXEEXT} emacs${EXEEXT}
diff --git a/src/abbrev.c b/src/abbrev.c
index e371797f139..45d00728242 100644
--- a/src/abbrev.c
+++ b/src/abbrev.c
@@ -83,7 +83,7 @@ EMACS_INT last_abbrev_point;
Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook;
-Lisp_Object Qsystem_type, Qcount;
+Lisp_Object Qsystem_type, Qcount, Qforce;
DEFUN ("make-abbrev-table", Fmake_abbrev_table, Smake_abbrev_table, 0, 0, 0,
doc: /* Create a new, empty abbrev table object. */)
@@ -107,7 +107,7 @@ DEFUN ("clear-abbrev-table", Fclear_abbrev_table, Sclear_abbrev_table, 1, 1, 0,
XVECTOR (table)->contents[i] = make_number (0);
return Qnil;
}
-
+
DEFUN ("define-abbrev", Fdefine_abbrev, Sdefine_abbrev, 3, 6, 0,
doc: /* Define an abbrev in TABLE named NAME, to expand to EXPANSION and call HOOK.
NAME must be a string.
@@ -123,7 +123,9 @@ usage-count, which is incremented each time the abbrev is used.
\(The default is zero.)
SYSTEM-FLAG, if non-nil, says that this is a "system" abbreviation
-which should not be saved in the user's abbreviation file. */)
+which should not be saved in the user's abbreviation file.
+Unless SYSTEM-FLAG is `force', a system abbreviation will not
+overwrite a non-system abbreviation of the same name. */)
(table, name, expansion, hook, count, system_flag)
Lisp_Object table, name, expansion, hook, count, system_flag;
{
@@ -131,6 +133,16 @@ which should not be saved in the user's abbreviation file. */)
CHECK_VECTOR (table);
CHECK_STRING (name);
+ /* If defining a system abbrev, do not overwrite a non-system abbrev
+ of the same name, unless 'force is used. */
+ if (!NILP (system_flag) && !EQ (system_flag, Qforce))
+ {
+ sym = Fintern_soft (name, table);
+
+ if (!NILP (SYMBOL_VALUE (sym)) &&
+ NILP (Fplist_get (XSYMBOL (sym)->plist, Qsystem_type))) return Qnil;
+ }
+
if (NILP (count))
count = make_number (0);
else
@@ -640,6 +652,9 @@ syms_of_abbrev ()
Qcount = intern ("count");
staticpro (&Qcount);
+ Qforce = intern ("force");
+ staticpro (&Qforce);
+
DEFVAR_LISP ("abbrev-table-name-list", &Vabbrev_table_name_list,
doc: /* List of symbols whose values are abbrev tables. */);
Vabbrev_table_name_list = Fcons (intern ("fundamental-mode-abbrev-table"),
@@ -664,7 +679,7 @@ for any particular abbrev defined in both. */);
DEFVAR_LISP ("last-abbrev-text", &Vlast_abbrev_text,
doc: /* The exact text of the last abbrev expanded.
-nil if the abbrev has already been unexpanded. */);
+A value of nil means the abbrev has already been unexpanded. */);
DEFVAR_INT ("last-abbrev-location", &last_abbrev_point,
doc: /* The location of the start of the last abbrev expanded. */);
diff --git a/src/buffer.c b/src/buffer.c
index 05555913c59..50203f1d25d 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1344,15 +1344,16 @@ See `kill-buffer'."
*/
DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 1, 1, "bKill buffer: ",
doc: /* Kill the buffer BUFFER.
-The argument may be a buffer or may be the name of a buffer.
-An argument of nil means kill the current buffer.
+The argument may be a buffer or the name of a buffer.
+With a nil argument, kill the current buffer.
-Value is t if the buffer is actually killed, nil if user says no.
+Value is t if the buffer is actually killed, nil otherwise.
-The value of `kill-buffer-hook' (which may be local to that buffer),
-if not void, is a list of functions to be called, with no arguments,
-before the buffer is actually killed. The buffer to be killed is current
-when the hook functions are called.
+The functions in `kill-buffer-query-functions' are called with BUFFER as
+the current buffer. If any of them returns nil, the buffer is not killed.
+
+The hook `kill-buffer-hook' is run before the buffer is actually killed.
+The buffer being killed will be current while the hook is running.
Any processes that have this buffer as the `process-buffer' are killed
with SIGHUP. */)
@@ -5385,8 +5386,8 @@ This is the same as (default-value 'fill-column). */);
This is the same as (default-value 'left-margin). */);
DEFVAR_LISP_NOPRO ("default-tab-width",
- &buffer_defaults.tab_width,
- doc: /* Default value of `tab-width' for buffers that do not override it.
+ &buffer_defaults.tab_width,
+ doc: /* Default value of `tab-width' for buffers that do not override it.
This is the same as (default-value 'tab-width). */);
DEFVAR_LISP_NOPRO ("default-case-fold-search",
@@ -5461,13 +5462,13 @@ This is the same as (default-value 'fringe-cursor-alist'). */);
&buffer_defaults.scroll_up_aggressively,
doc: /* Default value of `scroll-up-aggressively'.
This value applies in buffers that don't have their own local values.
-This variable is an alias for (default-value 'scroll-up-aggressively). */);
+This is the same as (default-value 'scroll-up-aggressively). */);
DEFVAR_LISP_NOPRO ("default-scroll-down-aggressively",
&buffer_defaults.scroll_down_aggressively,
doc: /* Default value of `scroll-down-aggressively'.
This value applies in buffers that don't have their own local values.
-This variable is an alias for (default-value 'scroll-down-aggressively). */);
+This is the same as (default-value 'scroll-down-aggressively). */);
DEFVAR_PER_BUFFER ("header-line-format",
&current_buffer->header_line_format,
@@ -5530,8 +5531,8 @@ Decimal digits after the % specify field width to which to pad. */);
DEFVAR_LISP_NOPRO ("default-major-mode", &buffer_defaults.major_mode,
doc: /* *Major mode for new buffers. Defaults to `fundamental-mode'.
-nil here means use current buffer's major mode, provided it is not
-marked as "special".
+A value of nil means use current buffer's major mode,
+provided it is not marked as "special".
When a mode is used by default, `find-file' switches to it
before it reads the contents into the buffer and before
@@ -5561,7 +5562,7 @@ Interactively, you can set the buffer local value using \\[set-fill-column]. */
DEFVAR_PER_BUFFER ("left-margin", &current_buffer->left_margin,
make_number (Lisp_Int),
- doc: /* *Column for the default indent-line-function to indent to.
+ doc: /* *Column for the default `indent-line-function' to indent to.
Linefeed indents to this column in Fundamental mode. */);
DEFVAR_PER_BUFFER ("tab-width", &current_buffer->tab_width,
@@ -5708,9 +5709,9 @@ primitives `aref' and `aset' can be used to access elements of a char-table.
Each of the char-table elements control how to display the corresponding
text character: the element at index C in the table says how to display
the character whose code is C. Each element should be a vector of
-characters or nil. nil means display the character in the default fashion;
-otherwise, the characters from the vector are delivered to the screen
-instead of the original character.
+characters or nil. The value nil means display the character in the
+default fashion; otherwise, the characters from the vector are delivered
+to the screen instead of the original character.
For example, (aset buffer-display-table ?X ?Y) will cause Emacs to display
a capital Y instead of each X character.
@@ -5841,7 +5842,7 @@ cursor type. */);
&current_buffer->scroll_up_aggressively, Qnil,
doc: /* How far to scroll windows upward.
If you move point off the bottom, the window scrolls automatically.
-This variable controls how far it scrolls. nil, the default,
+This variable controls how far it scrolls. The value nil, the default,
means scroll to center point. A fraction means scroll to put point
that fraction of the window's height from the bottom of the window.
When the value is 0.0, point goes at the bottom line, which in the simple
@@ -5854,7 +5855,7 @@ between 0.0 and 1.0, inclusive. */);
&current_buffer->scroll_down_aggressively, Qnil,
doc: /* How far to scroll windows downward.
If you move point off the top, the window scrolls automatically.
-This variable controls how far it scrolls. nil, the default,
+This variable controls how far it scrolls. The value nil, the default,
means scroll to center point. A fraction means scroll to put point
that fraction of the window's height from the top of the window.
When the value is 0.0, point goes at the top line, which in the simple
@@ -6045,7 +6046,7 @@ is a member of the list. */);
Vinhibit_read_only = Qnil;
DEFVAR_PER_BUFFER ("cursor-type", &current_buffer->cursor_type, Qnil,
- doc: /* Cursor to use when this buffer is in the selected window.
+ doc: /* Cursor to use when this buffer is in the selected window.
Values are interpreted as follows:
t use the cursor specified for the frame
@@ -6066,15 +6067,17 @@ this variable has no effect; the cursor appears as a hollow box. */);
doc: /* Additional space to put between lines when displaying a buffer.
The space is measured in pixels, and put below lines on window systems.
If value is a floating point number, it specifies the spacing relative
-to the default frame line height. nil means add no extra space. */);
+to the default frame line height. A value of nil means add no extra space. */);
DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows",
&current_buffer->cursor_in_non_selected_windows, Qnil,
- doc: /* *Cursor type to display in non-selected windows.
-t means to use hollow box cursor. See `cursor-type' for other values. */);
+ doc: /* *Cursor type to display in non-selected windows.
+The value t means to use hollow box cursor. See `cursor-type' for other values. */);
DEFVAR_LISP ("kill-buffer-query-functions", &Vkill_buffer_query_functions,
- doc: /* List of functions called with no args to query before killing a buffer. */);
+ doc: /* List of functions called with no args to query before killing a buffer.
+The buffer being killed will be current while the functions are running.
+If any of them returns nil, the buffer is not killed. */);
Vkill_buffer_query_functions = Qnil;
DEFVAR_LISP ("change-major-mode-hook", &Vchange_major_mode_hook,
diff --git a/src/callint.c b/src/callint.c
index 0bd2ed66383..8f118de5a59 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -60,7 +60,7 @@ static Lisp_Object point_marker;
/* String for the prompt text used in Fcall_interactively. */
static Lisp_Object callint_message;
-
+
/* ARGSUSED */
DEFUN ("interactive", Finteractive, Sinteractive, 0, UNEVALLED, 0,
doc: /* Specify a way of parsing arguments for interactive use of a function.
@@ -102,7 +102,7 @@ K -- Key sequence to be redefined (do not downcase the last event).
m -- Value of mark as number. Does not do I/O.
M -- Any string. Inherits the current input method.
n -- Number read using minibuffer.
-N -- Raw prefix arg, or if none, do like code `n'.
+N -- Numeric prefix arg, or if none, do like code `n'.
p -- Prefix arg converted to number. Does not do I/O.
P -- Prefix arg in raw form. Does not do I/O.
r -- Region: point and mark as 2 numeric args, smallest first. Does no I/O.
@@ -688,7 +688,7 @@ invoke it. If KEYS is omitted or nil, the return value of
Qnil, Qnil, Qnil, Qt);
break;
- case 'N': /* Prefix arg, else number from minibuffer */
+ case 'N': /* Prefix arg as number, else number from minibuffer */
if (!NILP (prefix_arg))
goto have_prefix_arg;
case 'n': /* Read number from minibuffer. */
diff --git a/src/callproc.c b/src/callproc.c
index 2f0e569d0c8..bc9c8d67d11 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -1754,7 +1754,8 @@ syms_of_callproc ()
DEFVAR_LISP ("shell-file-name", &Vshell_file_name,
doc: /* *File name to load inferior shells from.
-Initialized from the SHELL environment variable. */);
+Initialized from the SHELL environment variable, or to a system-dependent
+default if SHELL is not set. */);
DEFVAR_LISP ("exec-path", &Vexec_path,
doc: /* *List of directories to search programs to run in subprocesses.
diff --git a/src/category.c b/src/category.c
index d7178055b27..ce238f4d399 100644
--- a/src/category.c
+++ b/src/category.c
@@ -1,6 +1,7 @@
/* GNU Emacs routines to deal with category tables.
Copyright (C) 1998, 2001, 2004, 2005, 2006 Free Software Foundation, Inc.
- Copyright (C) 1995, 1997, 1998, 1999
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
diff --git a/src/category.h b/src/category.h
index 413505ece61..e27f86f9a91 100644
--- a/src/category.h
+++ b/src/category.h
@@ -1,5 +1,6 @@
/* Declarations having to do with Emacs category tables.
- Copyright (C) 1995, 1998, 1999
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
diff --git a/src/ccl.c b/src/ccl.c
index 779755cf39e..49cef07650b 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1,7 +1,8 @@
/* CCL (Code Conversion Language) interpreter.
Copyright (C) 2001, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
- Copyright (C) 1995, 1997, 1998, 2003, 2004, 2005
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
diff --git a/src/ccl.h b/src/ccl.h
index 21a72df1d0b..1cfc8201e54 100644
--- a/src/ccl.h
+++ b/src/ccl.h
@@ -1,5 +1,6 @@
/* Header for CCL (Code Conversion Language) interpreter.
- Copyright (C) 1995, 1998, 2000
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
diff --git a/src/charset.c b/src/charset.c
index 211de24ef89..535022c6797 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1,7 +1,8 @@
/* Basic multilingual character support.
Copyright (C) 2001, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
- Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
diff --git a/src/charset.h b/src/charset.h
index b25a2ffa85a..645bdafe4b2 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -1,7 +1,8 @@
/* Header for multibyte character handler.
Copyright (C) 2001, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
- Copyright (C) 1995, 1997, 1998, 2003
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
diff --git a/src/coding.c b/src/coding.c
index 53661fc33cc..f3008af526f 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1,7 +1,8 @@
/* Coding system handler (conversion, detection, and etc).
Copyright (C) 2001, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
- Copyright (C) 1995, 1997, 1998, 2002, 2003, 2004, 2005
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
diff --git a/src/coding.h b/src/coding.h
index 81dcb7f08ad..c56cd04a226 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -1,7 +1,8 @@
/* Header for coding system handler.
Copyright (C) 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
- Copyright (C) 1995, 1997, 1998, 2000
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
diff --git a/src/composite.c b/src/composite.c
index d3be3554c55..8e5fce2da96 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1,7 +1,7 @@
/* Composite sequence support.
Copyright (C) 2001, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
- Copyright (C) 1999
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
diff --git a/src/composite.h b/src/composite.h
index 5c19f8aa56e..e19fcd99e73 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -1,7 +1,7 @@
/* Header for composite sequence handler.
Copyright (C) 2001, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
- Copyright (C) 1997
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
diff --git a/src/config.in b/src/config.in
index 21052474ec6..f0ebbc76218 100644
--- a/src/config.in
+++ b/src/config.in
@@ -1,7 +1,7 @@
/* src/config.in. Generated from configure.in by autoheader. */
/* GNU Emacs site configuration template file.
- Copyright (C) 1988, 1993, 1994, 1999, 2000, 2002, 2004, 2005, 2006
+ Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -121,6 +121,10 @@ Boston, MA 02110-1301, USA. */
don't. */
#undef HAVE_DECL_SYS_SIGLIST
+/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
+ */
+#undef HAVE_DECL_TZNAME
+
/* Define to 1 if you have the declaration of `__sys_siglist', and to 0 if you
don't. */
#undef HAVE_DECL___SYS_SIGLIST
@@ -245,6 +249,9 @@ Boston, MA 02110-1301, USA. */
/* Define to 1 if you have the `gtk_file_selection_new' function. */
#undef HAVE_GTK_FILE_SELECTION_NEW
+/* Define to 1 if you have the `gtk_main' function. */
+#undef HAVE_GTK_MAIN
+
/* Define to 1 if GTK can handle more than one display. */
#undef HAVE_GTK_MULTIDISPLAY
@@ -571,6 +578,9 @@ Boston, MA 02110-1301, USA. */
/* Define to 1 if `struct utimbuf' is declared by <utime.h>. */
#undef HAVE_STRUCT_UTIMBUF
+/* Define to 1 if you have the `sync' function. */
+#undef HAVE_SYNC
+
/* Define to 1 if you have the `sysinfo' function. */
#undef HAVE_SYSINFO
@@ -796,7 +806,7 @@ Boston, MA 02110-1301, USA. */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
+ automatically deduced at runtime.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
diff --git a/src/data.c b/src/data.c
index cc0f96793ca..dc9095c033c 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1276,7 +1276,7 @@ set_internal (symbol, newval, buf, bindflag)
XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr,
tem1);
- /* Set `buffer' and `frame' slots for thebinding now loaded. */
+ /* Set `buffer' and `frame' slots for the binding now loaded. */
XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, buf);
XBUFFER_LOCAL_VALUE (valcontents)->frame = selected_frame;
}
diff --git a/src/dired.c b/src/dired.c
index b469d682c41..ffaeb5adee4 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -395,17 +395,20 @@ ID-FORMAT specifies the preferred format of attributes uid and gid, see
Lisp_Object file_name_completion ();
DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion,
- 2, 2, 0,
+ 2, 3, 0,
doc: /* Complete file name FILE in directory DIRECTORY.
Returns the longest string
common to all file names in DIRECTORY that start with FILE.
If there is only one and FILE matches it exactly, returns t.
Returns nil if DIRECTORY contains no name starting with FILE.
+If PREDICATE is non-nil, call PREDICATE with each possible
+completion (in absolute form) and ignore it if PREDICATE returns nil.
+
This function ignores some of the possible completions as
determined by the variable `completion-ignored-extensions', which see. */)
- (file, directory)
- Lisp_Object file, directory;
+ (file, directory, predicate)
+ Lisp_Object file, directory, predicate;
{
Lisp_Object handler;
@@ -413,15 +416,15 @@ determined by the variable `completion-ignored-extensions', which see. */)
call the corresponding file handler. */
handler = Ffind_file_name_handler (directory, Qfile_name_completion);
if (!NILP (handler))
- return call3 (handler, Qfile_name_completion, file, directory);
+ return call4 (handler, Qfile_name_completion, file, directory, predicate);
/* If the file name has special constructs in it,
call the corresponding file handler. */
handler = Ffind_file_name_handler (file, Qfile_name_completion);
if (!NILP (handler))
- return call3 (handler, Qfile_name_completion, file, directory);
+ return call4 (handler, Qfile_name_completion, file, directory, predicate);
- return file_name_completion (file, directory, 0, 0);
+ return file_name_completion (file, directory, 0, 0, predicate);
}
DEFUN ("file-name-all-completions", Ffile_name_all_completions,
@@ -445,21 +448,25 @@ These are all file names in directory DIRECTORY which begin with FILE. */)
if (!NILP (handler))
return call3 (handler, Qfile_name_all_completions, file, directory);
- return file_name_completion (file, directory, 1, 0);
+ return file_name_completion (file, directory, 1, 0, Qnil);
}
static int file_name_completion_stat ();
Lisp_Object
-file_name_completion (file, dirname, all_flag, ver_flag)
+file_name_completion (file, dirname, all_flag, ver_flag, predicate)
Lisp_Object file, dirname;
int all_flag, ver_flag;
+ Lisp_Object predicate;
{
DIR *d;
int bestmatchsize = 0, skip;
register int compare, matchsize;
unsigned char *p1, *p2;
int matchcount = 0;
+ /* If ALL_FLAG is 1, BESTMATCH is the list of all matches, decoded.
+ If ALL_FLAG is 0, BESTMATCH is either nil
+ or the best match so far, not decoded. */
Lisp_Object bestmatch, tem, elt, name;
Lisp_Object encoded_file;
Lisp_Object encoded_dir;
@@ -567,8 +574,8 @@ file_name_completion (file, dirname, all_flag, ver_flag)
#ifndef TRIVIAL_DIRECTORY_ENTRY
#define TRIVIAL_DIRECTORY_ENTRY(n) (!strcmp (n, ".") || !strcmp (n, ".."))
#endif
- /* "." and ".." are never interesting as completions, but are
- actually in the way in a directory contains only one file. */
+ /* "." and ".." are never interesting as completions, and are
+ actually in the way in a directory with only one file. */
if (!passcount && TRIVIAL_DIRECTORY_ENTRY (dp->d_name))
continue;
if (!passcount && len > SCHARS (encoded_file))
@@ -649,30 +656,38 @@ file_name_completion (file, dirname, all_flag, ver_flag)
continue;
}
- /* Update computation of how much all possible completions match */
+ /* This is a possible completion */
+ if (directoryp)
+ {
+ /* This completion is a directory; make it end with '/' */
+ name = Ffile_name_as_directory (make_string (dp->d_name, len));
+ }
+ else
+ name = make_string (dp->d_name, len);
+
+ /* Test the predicate, if any. */
+
+ if (!NILP (predicate))
+ {
+ Lisp_Object decoded;
+ decoded = Fexpand_file_name (DECODE_FILE (name), dirname);
+ if (NILP (call1 (predicate, decoded)))
+ continue;
+ }
+
+ /* Suitably record this match. */
matchcount++;
- if (all_flag || NILP (bestmatch))
+ if (all_flag)
{
- /* This is a possible completion */
- if (directoryp)
- {
- /* This completion is a directory; make it end with '/' */
- name = Ffile_name_as_directory (make_string (dp->d_name, len));
- }
- else
- name = make_string (dp->d_name, len);
- if (all_flag)
- {
- name = DECODE_FILE (name);
- bestmatch = Fcons (name, bestmatch);
- }
- else
- {
- bestmatch = name;
- bestmatchsize = SCHARS (name);
- }
+ name = DECODE_FILE (name);
+ bestmatch = Fcons (name, bestmatch);
+ }
+ else if (NILP (bestmatch))
+ {
+ bestmatch = name;
+ bestmatchsize = SCHARS (name);
}
else
{
@@ -708,11 +723,7 @@ file_name_completion (file, dirname, all_flag, ver_flag)
== SCHARS (bestmatch)))
&& !bcmp (p2, SDATA (encoded_file), SCHARS (encoded_file))
&& bcmp (p1, SDATA (encoded_file), SCHARS (encoded_file))))
- {
- bestmatch = make_string (dp->d_name, len);
- if (directoryp)
- bestmatch = Ffile_name_as_directory (bestmatch);
- }
+ bestmatch = name;
}
/* If this dirname all matches, see if implicit following
@@ -835,7 +846,7 @@ DEFUN ("file-name-all-versions", Ffile_name_all_versions,
(file, directory)
Lisp_Object file, directory;
{
- return file_name_completion (file, directory, 1, 1);
+ return file_name_completion (file, directory, 1, 1, Qnil);
}
DEFUN ("file-version-limit", Ffile_version_limit, Sfile_version_limit, 1, 1, 0,
diff --git a/src/emacs.c b/src/emacs.c
index 76ad59c78d1..8ffab8f0d3d 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -304,7 +304,7 @@ Display options:\n\
used for debugging Emacs\n\
--border-color, -bd COLOR main border color\n\
--border-width, -bw WIDTH width of main border\n\
---color, --color=MODE color mode for character terminals;\n\
+--color, --color=MODE override color mode for character terminals;\n\
MODE defaults to `auto', and can also\n\
be `never', `auto', `always',\n\
or a mode name like `ansi8'\n\
@@ -362,39 +362,6 @@ pthread_t main_thread;
#endif
-#ifdef SIGUSR1
-SIGTYPE
-handle_USR1_signal (sig)
- int sig;
-{
- struct input_event buf;
-
- SIGNAL_THREAD_CHECK (sig);
- bzero (&buf, sizeof buf);
- buf.kind = USER_SIGNAL_EVENT;
- buf.frame_or_window = selected_frame;
-
- kbd_buffer_store_event (&buf);
-}
-#endif /* SIGUSR1 */
-
-#ifdef SIGUSR2
-SIGTYPE
-handle_USR2_signal (sig)
- int sig;
-{
- struct input_event buf;
-
- SIGNAL_THREAD_CHECK (sig);
- bzero (&buf, sizeof buf);
- buf.kind = USER_SIGNAL_EVENT;
- buf.code = 1;
- buf.frame_or_window = selected_frame;
-
- kbd_buffer_store_event (&buf);
-}
-#endif /* SIGUSR2 */
-
/* Handle bus errors, invalid instruction, etc. */
SIGTYPE
fatal_error_signal (sig)
@@ -1227,10 +1194,10 @@ main (argc, argv
signal (SIGILL, fatal_error_signal);
signal (SIGTRAP, fatal_error_signal);
#ifdef SIGUSR1
- signal (SIGUSR1, handle_USR1_signal);
-#ifdef SIGUSR2
- signal (SIGUSR2, handle_USR2_signal);
+ add_user_signal (SIGUSR1, "sigusr1");
#endif
+#ifdef SIGUSR2
+ add_user_signal (SIGUSR2, "sigusr2");
#endif
#ifdef SIGABRT
signal (SIGABRT, fatal_error_signal);
@@ -2475,7 +2442,8 @@ Special values:
`ms-dos' compiled as an MS-DOS application.
`windows-nt' compiled as a native W32 application.
`cygwin' compiled using the Cygwin library.
- `vax-vms' or `axp-vms': compiled for a (Open)VMS system.
+ `vax-vms' or
+ `axp-vms' compiled for a (Open)VMS system.
Anything else indicates some sort of Unix system. */);
Vsystem_type = intern (SYSTEM_TYPE);
diff --git a/src/fileio.c b/src/fileio.c
index e6a4314e543..f41699bcc46 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3543,11 +3543,7 @@ Use the current time if TIME is nil. TIME is in the format of
return Qt;
}
-#ifdef __NetBSD__
-#define unix 42
-#endif
-
-#ifdef unix
+#ifdef HAVE_SYNC
DEFUN ("unix-sync", Funix_sync, Sunix_sync, 0, 0, "",
doc: /* Tell Unix to finish all pending disk updates. */)
()
@@ -3556,7 +3552,7 @@ DEFUN ("unix-sync", Funix_sync, Sunix_sync, 0, 0, "",
return Qnil;
}
-#endif /* unix */
+#endif /* HAVE_SYNC */
DEFUN ("file-newer-than-file-p", Ffile_newer_than_file_p, Sfile_newer_than_file_p, 2, 2, 0,
doc: /* Return t if file FILE1 is newer than file FILE2.
@@ -6165,7 +6161,7 @@ DEFUN ("read-file-name-internal", Fread_file_name_internal, Sread_file_name_inte
if (NILP (action))
{
specdir = Ffile_name_directory (string);
- val = Ffile_name_completion (name, realdir);
+ val = Ffile_name_completion (name, realdir, Vread_file_name_predicate);
UNGCPRO;
if (!STRINGP (val))
{
@@ -6795,7 +6791,7 @@ A non-nil value may result in data loss! */);
defsubr (&Sread_file_name);
defsubr (&Snext_read_file_uses_dialog_p);
-#ifdef unix
+#ifdef HAVE_SYNC
defsubr (&Sunix_sync);
#endif
}
diff --git a/src/fontset.c b/src/fontset.c
index 47cda7f8601..66a31e9acf0 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1,6 +1,7 @@
/* Fontset handler.
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
- Copyright (C) 1995, 1997, 1998, 2000, 2003, 2004, 2005
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
diff --git a/src/fontset.h b/src/fontset.h
index a4360280911..a08f7b74bd0 100644
--- a/src/fontset.h
+++ b/src/fontset.h
@@ -1,7 +1,8 @@
/* Header for fontset handler.
Copyright (C) 1998, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
- Copyright (C) 1995, 1997, 2000
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H14PRO021
diff --git a/src/frame.h b/src/frame.h
index 9e3813c844a..9f22d1c08ab 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -456,6 +456,10 @@ struct frame
/* Set to non-zero when current redisplay has updated frame. */
unsigned updated_p : 1;
+
+ /* Set to non-zero to minimize tool-bar height even when
+ auto-resize-tool-bar is set to grow-only. */
+ unsigned minimize_tool_bar_window_p : 1;
};
#ifdef MULTI_KBOARD
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 17bf2d20a4c..d136dbe0fce 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3350,11 +3350,8 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
get them. */
#define XG_TOOL_BAR_LAST_MODIFIER "emacs-tool-bar-modifier"
-
-/* Callback function invoked when a tool bar item is pressed.
- W is the button widget in the tool bar that got pressed,
- CLIENT_DATA is an integer that is the index of the button in the
- tool bar. 0 is the first button. */
+/* The key for storing the button widget in its proxy menu item. */
+#define XG_TOOL_BAR_PROXY_BUTTON "emacs-tool-bar-proxy-button"
static gboolean
xg_tool_bar_button_cb (widget, event, user_data)
@@ -3364,11 +3361,16 @@ xg_tool_bar_button_cb (widget, event, user_data)
{
/* Casts to avoid warnings when gpointer is 64 bits and int is 32 bits */
gpointer ptr = (gpointer) (EMACS_INT) event->state;
- g_object_set_data (G_OBJECT (user_data), XG_TOOL_BAR_LAST_MODIFIER, ptr);
+ g_object_set_data (G_OBJECT (widget), XG_TOOL_BAR_LAST_MODIFIER, ptr);
return FALSE;
}
+/* Callback function invoked when a tool bar item is pressed.
+ W is the button widget in the tool bar that got pressed,
+ CLIENT_DATA is an integer that is the index of the button in the
+ tool bar. 0 is the first button. */
+
static void
xg_tool_bar_callback (w, client_data)
GtkWidget *w;
@@ -3406,6 +3408,92 @@ xg_tool_bar_callback (w, client_data)
kbd_buffer_store_event (&event);
}
+/* Callback function invoked when a tool bar item is pressed in a detached
+ tool bar or the overflow drop down menu.
+ We just call xg_tool_bar_callback.
+ W is the menu item widget that got pressed,
+ CLIENT_DATA is an integer that is the index of the button in the
+ tool bar. 0 is the first button. */
+
+static void
+xg_tool_bar_proxy_callback (w, client_data)
+ GtkWidget *w;
+ gpointer client_data;
+{
+ GtkWidget *wbutton = GTK_WIDGET (g_object_get_data (G_OBJECT (w),
+ XG_TOOL_BAR_PROXY_BUTTON));
+ xg_tool_bar_callback (wbutton, client_data);
+}
+
+/* This callback is called when a tool item should create a proxy item,
+ such as for the overflow menu. Also called when the tool bar is detached.
+ If we don't create a proxy menu item, the detached tool bar will be
+ blank. */
+
+static gboolean
+xg_tool_bar_menu_proxy (toolitem, user_data)
+ GtkToolItem *toolitem;
+ gpointer user_data;
+{
+ GtkWidget *weventbox = gtk_bin_get_child (GTK_BIN (toolitem));
+ GtkButton *wbutton = GTK_BUTTON (gtk_bin_get_child (GTK_BIN (weventbox)));
+ GtkWidget *wmenuitem = gtk_image_menu_item_new ();
+ GtkWidget *wmenuimage;
+
+ if (gtk_button_get_use_stock (wbutton))
+ wmenuimage = gtk_image_new_from_stock (gtk_button_get_label (wbutton),
+ GTK_ICON_SIZE_MENU);
+ else
+ {
+ GtkImage *wimage = GTK_IMAGE (gtk_bin_get_child (GTK_BIN (wbutton)));
+ GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (wbutton));
+ GtkImageType store_type = gtk_image_get_storage_type (wimage);
+ if (store_type == GTK_IMAGE_STOCK)
+ {
+ gchar *stock_id;
+ gtk_image_get_stock (wimage, &stock_id, NULL);
+ wmenuimage = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU);
+ }
+ else if (store_type == GTK_IMAGE_ICON_SET)
+ {
+ GtkIconSet *icon_set;
+ gtk_image_get_icon_set (wimage, &icon_set, NULL);
+ wmenuimage = gtk_image_new_from_icon_set (icon_set,
+ GTK_ICON_SIZE_MENU);
+ }
+ else if (store_type == GTK_IMAGE_PIXBUF)
+ {
+ gint width, height;
+
+ if (settings &&
+ gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU,
+ &width, &height))
+ {
+ GdkPixbuf *src_pixbuf, *dest_pixbuf;
+
+ src_pixbuf = gtk_image_get_pixbuf (wimage);
+ dest_pixbuf = gdk_pixbuf_scale_simple (src_pixbuf, width, height,
+ GDK_INTERP_BILINEAR);
+
+ wmenuimage = gtk_image_new_from_pixbuf (dest_pixbuf);
+ }
+ }
+ }
+ if (wmenuimage)
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (wmenuitem), wmenuimage);
+
+ g_signal_connect (G_OBJECT (wmenuitem),
+ "activate",
+ GTK_SIGNAL_FUNC (xg_tool_bar_proxy_callback),
+ user_data);
+
+ g_object_set_data (G_OBJECT (wmenuitem), XG_TOOL_BAR_PROXY_BUTTON,
+ (gpointer) wbutton);
+ gtk_tool_item_set_proxy_menu_item (toolitem, "Emacs toolbar item", wmenuitem);
+
+ return TRUE;
+}
+
/* This callback is called when a tool bar is detached. We must set
the height of the tool bar to zero when this happens so frame sizes
are correctly calculated.
@@ -3491,9 +3579,6 @@ xg_tool_bar_help_callback (w, event, client_data)
FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA);
Lisp_Object help, frame;
- if (! GTK_IS_BUTTON (w))
- return FALSE;
-
if (! f || ! f->n_tool_bar_items || NILP (f->tool_bar_items))
return FALSE;
@@ -3631,10 +3716,9 @@ update_frame_tool_bar (f)
{
int i;
GtkRequisition old_req, new_req;
- GList *icon_list;
- GList *iter;
struct x_output *x = f->output_data.x;
int hmargin, vmargin;
+ GtkToolItem *ti;
if (! FRAME_GTK_WIDGET (f))
return;
@@ -3670,9 +3754,6 @@ update_frame_tool_bar (f)
gtk_widget_size_request (x->toolbar_widget, &old_req);
- icon_list = gtk_container_get_children (GTK_CONTAINER (x->toolbar_widget));
- iter = icon_list;
-
for (i = 0; i < f->n_tool_bar_items; ++i)
{
#define PROP(IDX) AREF (f->tool_bar_items, i * TOOL_BAR_ITEM_NSLOTS + (IDX))
@@ -3683,9 +3764,16 @@ update_frame_tool_bar (f)
int img_id;
struct image *img;
Lisp_Object image;
- GtkWidget *wicon = iter ? GTK_WIDGET (iter->data) : 0;
+ GtkWidget *wbutton;
+ GtkWidget *weventbox;
- if (iter) iter = g_list_next (iter);
+ ti = gtk_toolbar_get_nth_item (GTK_TOOLBAR (x->toolbar_widget), i);
+
+ if (ti)
+ {
+ weventbox = gtk_bin_get_child (GTK_BIN (ti));
+ wbutton = gtk_bin_get_child (GTK_BIN (weventbox));
+ }
/* If image is a vector, choose the image according to the
button state. */
@@ -3710,7 +3798,7 @@ update_frame_tool_bar (f)
/* Ignore invalid image specifications. */
if (!valid_image_p (image))
{
- if (wicon) gtk_widget_hide (wicon);
+ if (ti) gtk_widget_hide_all (GTK_WIDGET (ti));
continue;
}
@@ -3720,39 +3808,55 @@ update_frame_tool_bar (f)
if (img->load_failed_p || img->pixmap == None)
{
- if (wicon)
- gtk_widget_hide (wicon);
+ if (ti)
+ gtk_widget_hide_all (GTK_WIDGET (ti));
else
- gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget),
- gtk_tool_button_new (NULL, ""),
- i);
+ {
+ /* Insert an empty (non-image) button */
+ weventbox = gtk_event_box_new ();
+ wbutton = gtk_button_new ();
+ gtk_button_set_focus_on_click (GTK_BUTTON (wbutton), FALSE);
+ gtk_button_set_relief (GTK_BUTTON (wbutton), GTK_RELIEF_NONE);
+ gtk_container_add (GTK_CONTAINER (weventbox), wbutton);
+ ti = gtk_tool_item_new ();
+ gtk_container_add (GTK_CONTAINER (ti), weventbox);
+ gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, i);
+ }
continue;
}
- if (! wicon)
+ if (ti == NULL)
{
GtkWidget *w = xg_get_image_for_pixmap (f, img, x->widget, NULL);
- GtkToolItem *ti = gtk_tool_button_new (w, "");
-
gtk_misc_set_padding (GTK_MISC (w), hmargin, vmargin);
+ wbutton = gtk_button_new ();
+ gtk_button_set_focus_on_click (GTK_BUTTON (wbutton), FALSE);
+ gtk_button_set_relief (GTK_BUTTON (wbutton), GTK_RELIEF_NONE);
+ gtk_container_add (GTK_CONTAINER (wbutton), w);
+ weventbox = gtk_event_box_new ();
+ gtk_container_add (GTK_CONTAINER (weventbox), wbutton);
+ ti = gtk_tool_item_new ();
+ gtk_container_add (GTK_CONTAINER (ti), weventbox);
+ gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget), ti, i);
+
- gtk_toolbar_insert (GTK_TOOLBAR (x->toolbar_widget),
- ti,
- i);
/* The EMACS_INT cast avoids a warning. */
- g_signal_connect (GTK_WIDGET (ti), "clicked",
+ g_signal_connect (G_OBJECT (ti), "create-menu-proxy",
+ GTK_SIGNAL_FUNC (xg_tool_bar_menu_proxy),
+ (gpointer) (EMACS_INT) i);
+
+ g_signal_connect (G_OBJECT (wbutton), "clicked",
GTK_SIGNAL_FUNC (xg_tool_bar_callback),
(gpointer) (EMACS_INT) i);
- gtk_widget_show (GTK_WIDGET (ti));
- gtk_widget_show (GTK_WIDGET (w));
+ gtk_widget_show_all (GTK_WIDGET (ti));
/* Save the image so we can see if an update is needed when
this function is called again. */
g_object_set_data (G_OBJECT (w), XG_TOOL_BAR_IMAGE_DATA,
(gpointer)img->pixmap);
- g_object_set_data (G_OBJECT (ti), XG_FRAME_DATA, (gpointer)f);
+ g_object_set_data (G_OBJECT (weventbox), XG_FRAME_DATA, (gpointer)f);
/* Catch expose events to overcome an annoying redraw bug, see
comment for xg_tool_bar_item_expose_callback. */
@@ -3761,46 +3865,37 @@ update_frame_tool_bar (f)
G_CALLBACK (xg_tool_bar_item_expose_callback),
0);
- gtk_widget_set_sensitive (GTK_WIDGET (ti), enabled_p);
- gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (ti), FALSE);
+ gtk_widget_set_sensitive (wbutton, enabled_p);
+ gtk_tool_item_set_homogeneous (ti, FALSE);
- while (! GTK_IS_BUTTON (w))
- w = gtk_widget_get_parent (w);
-
/* Callback to save modifyer mask (Shift/Control, etc). GTK makes
no distinction based on modifiers in the activate callback,
so we have to do it ourselves. */
- g_signal_connect (w, "button-release-event",
+ g_signal_connect (wbutton, "button-release-event",
GTK_SIGNAL_FUNC (xg_tool_bar_button_cb),
- ti);
+ NULL);
- g_object_set_data (G_OBJECT (w), XG_FRAME_DATA, (gpointer)f);
+ g_object_set_data (G_OBJECT (wbutton), XG_FRAME_DATA, (gpointer)f);
/* Use enter/leave notify to show help. We use the events
rather than the GtkButton specific signals "enter" and
"leave", so we can have only one callback. The event
will tell us what kind of event it is. */
/* The EMACS_INT cast avoids a warning. */
- g_signal_connect (G_OBJECT (w),
+ g_signal_connect (G_OBJECT (weventbox),
"enter-notify-event",
G_CALLBACK (xg_tool_bar_help_callback),
(gpointer) (EMACS_INT) i);
- g_signal_connect (G_OBJECT (w),
+ g_signal_connect (G_OBJECT (weventbox),
"leave-notify-event",
G_CALLBACK (xg_tool_bar_help_callback),
(gpointer) (EMACS_INT) i);
}
else
{
- /* The child of the tool bar is a button. Inside that button
- is a vbox. Inside that vbox is the GtkImage. */
- GtkWidget *wvbox = gtk_bin_get_child (GTK_BIN (wicon));
- GList *chlist = gtk_container_get_children (GTK_CONTAINER (wvbox));
- GtkImage *wimage = GTK_IMAGE (chlist->data);
+ GtkWidget *wimage = gtk_bin_get_child (GTK_BIN (wbutton));
Pixmap old_img = (Pixmap)g_object_get_data (G_OBJECT (wimage),
XG_TOOL_BAR_IMAGE_DATA);
- g_list_free (chlist);
-
gtk_misc_set_padding (GTK_MISC (wimage), hmargin, vmargin);
if (old_img != img->pixmap)
@@ -3809,21 +3904,20 @@ update_frame_tool_bar (f)
g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA,
(gpointer)img->pixmap);
- gtk_widget_set_sensitive (wicon, enabled_p);
- gtk_widget_show (wicon);
- }
+ gtk_widget_set_sensitive (wbutton, enabled_p);
+ gtk_widget_show_all (GTK_WIDGET (ti));
+ }
#undef PROP
}
/* Remove buttons not longer needed. We just hide them so they
can be reused later on. */
- while (iter)
+ do
{
- GtkWidget *w = GTK_WIDGET (iter->data);
- gtk_widget_hide (w);
- iter = g_list_next (iter);
- }
+ ti = gtk_toolbar_get_nth_item (GTK_TOOLBAR (x->toolbar_widget), i++);
+ if (ti) gtk_widget_hide_all (GTK_WIDGET (ti));
+ } while (ti != NULL);
gtk_widget_size_request (x->toolbar_widget, &new_req);
if (old_req.height != new_req.height
@@ -3833,8 +3927,6 @@ update_frame_tool_bar (f)
xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
}
- if (icon_list) g_list_free (icon_list);
-
UNBLOCK_INPUT;
}
diff --git a/src/keyboard.c b/src/keyboard.c
index 2f4879da110..656a642c666 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -684,6 +684,9 @@ static void handle_interrupt P_ ((void));
static void timer_start_idle P_ ((void));
static void timer_stop_idle P_ ((void));
static void timer_resume_idle P_ ((void));
+static SIGTYPE handle_user_signal P_ ((int));
+static char *find_user_signal_name P_ ((int));
+static int store_user_signal_events P_ ((void));
/* Nonzero means don't try to suspend even if the operating system seems
to support it. */
@@ -1506,13 +1509,25 @@ usage: (track-mouse BODY ...) */)
}
/* If mouse has moved on some frame, return one of those frames.
- Return 0 otherwise. */
+
+ Return 0 otherwise.
+
+ If ignore_mouse_drag_p is non-zero, ignore (implicit) mouse movement
+ after resizing the tool-bar window. */
+
+int ignore_mouse_drag_p;
static FRAME_PTR
some_mouse_moved ()
{
Lisp_Object tail, frame;
+ if (ignore_mouse_drag_p)
+ {
+ /* ignore_mouse_drag_p = 0; */
+ return 0;
+ }
+
FOR_EACH_FRAME (tail, frame)
{
if (XFRAME (frame)->mouse_moved)
@@ -5182,15 +5197,6 @@ Lisp_Object *scroll_bar_parts[] = {
&Qup, &Qdown, &Qtop, &Qbottom, &Qend_scroll, &Qratio
};
-/* User signal events. */
-Lisp_Object Qusr1_signal, Qusr2_signal;
-
-Lisp_Object *lispy_user_signals[] =
-{
- &Qusr1_signal, &Qusr2_signal
-};
-
-
/* A vector, indexed by button number, giving the down-going location
of currently depressed buttons, both scroll bar and non-scroll bar.
@@ -5704,6 +5710,7 @@ make_lispy_event (event)
double_click_count = 1;
button_down_time = event->timestamp;
*start_pos_ptr = Fcopy_alist (position);
+ ignore_mouse_drag_p = 0;
}
/* Now we're releasing a button - check the co-ordinates to
@@ -5739,8 +5746,13 @@ make_lispy_event (event)
ydiff = XINT (event->y) - XINT (XCDR (down));
}
- if (xdiff < double_click_fuzz && xdiff > - double_click_fuzz
- && ydiff < double_click_fuzz && ydiff > - double_click_fuzz
+ if (ignore_mouse_drag_p)
+ {
+ event->modifiers |= click_modifier;
+ ignore_mouse_drag_p = 0;
+ }
+ else if (xdiff < double_click_fuzz && xdiff > - double_click_fuzz
+ && ydiff < double_click_fuzz && ydiff > - double_click_fuzz
/* Maybe the mouse has moved a lot, caused scrolling, and
eventually ended up at the same screen position (but
not buffer position) in which case it is a drag, not
@@ -6063,7 +6075,12 @@ make_lispy_event (event)
case USER_SIGNAL_EVENT:
/* A user signal. */
- return *lispy_user_signals[event->code];
+ {
+ char *name = find_user_signal_name (event->code);
+ if (!name)
+ abort ();
+ return intern (name);
+ }
case SAVE_SESSION_EVENT:
return Qsave_session;
@@ -6904,6 +6921,10 @@ read_avail_input (expected)
int err = 0;
struct terminal *t;
+ /* Store pending user signal events, if any. */
+ if (store_user_signal_events ())
+ expected = 0;
+
/* Loop through the available terminals, and call their input hooks. */
t = terminal_list;
while (t)
@@ -7197,6 +7218,131 @@ reinvoke_input_signal ()
+/* User signal events. */
+
+struct user_signal_info
+{
+ /* Signal number. */
+ int sig;
+
+ /* Name of the signal. */
+ char *name;
+
+ /* Number of pending signals. */
+ int npending;
+
+ struct user_signal_info *next;
+};
+
+/* List of user signals. */
+static struct user_signal_info *user_signals = NULL;
+
+void
+add_user_signal (sig, name)
+ int sig;
+ const char *name;
+{
+ struct user_signal_info *p;
+
+ for (p = user_signals; p; p = p->next)
+ if (p->sig == sig)
+ /* Already added. */
+ return;
+
+ p = xmalloc (sizeof (struct user_signal_info));
+ p->sig = sig;
+ p->name = xstrdup (name);
+ p->npending = 0;
+ p->next = user_signals;
+ user_signals = p;
+
+ signal (sig, handle_user_signal);
+}
+
+static SIGTYPE
+handle_user_signal (sig)
+ int sig;
+{
+ int old_errno = errno;
+ struct user_signal_info *p;
+
+#if defined (USG) && !defined (POSIX_SIGNALS)
+ /* USG systems forget handlers when they are used;
+ must reestablish each time */
+ signal (sig, handle_user_signal);
+#endif
+
+ SIGNAL_THREAD_CHECK (sig);
+
+ for (p = user_signals; p; p = p->next)
+ if (p->sig == sig)
+ {
+ p->npending++;
+#ifdef SIGIO
+ if (interrupt_input)
+ kill (getpid (), SIGIO);
+ else
+#endif
+ {
+ /* Tell wait_reading_process_output that it needs to wake
+ up and look around. */
+ if (input_available_clear_time)
+ EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0);
+ }
+ break;
+ }
+
+ errno = old_errno;
+}
+
+static char *
+find_user_signal_name (sig)
+ int sig;
+{
+ struct user_signal_info *p;
+
+ for (p = user_signals; p; p = p->next)
+ if (p->sig == sig)
+ return p->name;
+
+ return NULL;
+}
+
+static int
+store_user_signal_events ()
+{
+ struct user_signal_info *p;
+ struct input_event buf;
+ int nstored = 0;
+
+ for (p = user_signals; p; p = p->next)
+ if (p->npending > 0)
+ {
+ SIGMASKTYPE mask;
+
+ if (nstored == 0)
+ {
+ bzero (&buf, sizeof buf);
+ buf.kind = USER_SIGNAL_EVENT;
+ buf.frame_or_window = selected_frame;
+ }
+ nstored += p->npending;
+
+ mask = sigblock (sigmask (p->sig));
+ do
+ {
+ buf.code = p->sig;
+ kbd_buffer_store_event (&buf);
+ p->npending--;
+ }
+ while (p->npending > 0);
+ sigsetmask (mask);
+ }
+
+ return nstored;
+}
+
+
static void menu_bar_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object, void*));
static Lisp_Object menu_bar_one_keymap_changed_items;
@@ -11422,11 +11568,6 @@ syms_of_keyboard ()
staticpro (&Qmac_apple_event);
#endif
- Qusr1_signal = intern ("usr1-signal");
- staticpro (&Qusr1_signal);
- Qusr2_signal = intern ("usr2-signal");
- staticpro (&Qusr2_signal);
-
Qmenu_enable = intern ("menu-enable");
staticpro (&Qmenu_enable);
Qmenu_alias = intern ("menu-alias");
@@ -11724,8 +11865,8 @@ Polling is automatically disabled in all other cases. */);
DEFVAR_LISP ("double-click-time", &Vdouble_click_time,
doc: /* *Maximum time between mouse clicks to make a double-click.
-Measured in milliseconds. nil means disable double-click recognition;
-t means double-clicks have no time limit and are detected
+Measured in milliseconds. The value nil means disable double-click
+recognition; t means double-clicks have no time limit and are detected
by position only. */);
Vdouble_click_time = make_number (500);
diff --git a/src/keyboard.h b/src/keyboard.h
index 8f1c5dd31a9..749a8aefb28 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -358,6 +358,7 @@ extern void gen_help_event P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
extern void kbd_buffer_store_help_event P_ ((Lisp_Object, Lisp_Object));
extern Lisp_Object menu_item_eval_property P_ ((Lisp_Object));
extern int kbd_buffer_events_waiting P_ ((int));
+extern void add_user_signals P_ ((int, const char *));
extern int tty_read_avail_input P_ ((struct terminal *, int,
struct input_event *));
diff --git a/src/keymap.c b/src/keymap.c
index 065631ccff5..634a52b3834 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1117,7 +1117,8 @@ DEF is anything that can be a key's definition:
or another symbol whose function definition is used, etc.),
a cons (STRING . DEFN), meaning that DEFN is the definition
(DEFN should be a valid definition in its own right),
- or a cons (MAP . CHAR), meaning use definition of CHAR in keymap MAP.
+ or a cons (MAP . CHAR), meaning use definition of CHAR in keymap MAP,
+ or an extended menu item definition. (See info node `Extended Menu Items'.)
If KEYMAP is a sparse keymap with a binding for KEY, the existing
binding is altered. If there is no binding for KEY, the new pair
@@ -1240,7 +1241,8 @@ buffer position instead of point are used. */)
DEFUN ("lookup-key", Flookup_key, Slookup_key, 2, 3, 0,
doc: /* In keymap KEYMAP, look up key sequence KEY. Return the definition.
-nil means undefined. See doc of `define-key' for kinds of definitions.
+A value of nil means undefined. See doc of `define-key'
+for kinds of definitions.
A number as value means KEY is "too long";
that is, characters or symbols in it except for the last one
@@ -1615,13 +1617,13 @@ specified buffer position instead of point are used.
are read using the keymaps of the buffer clicked on, not
the current buffer. So we may have to switch the buffer
here. */
-
+
if (CONSP (position))
{
Lisp_Object window;
-
+
window = POSN_WINDOW (position);
-
+
if (WINDOWP (window)
&& BUFFERP (XWINDOW (window)->buffer)
&& XBUFFER (XWINDOW (window)->buffer) != current_buffer)
@@ -1633,13 +1635,13 @@ specified buffer position instead of point are used.
would not be a problem here, but it is easier to keep
things the same.
*/
-
+
record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
-
+
set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
}
}
-
+
if (! NILP (current_kboard->Voverriding_terminal_local_map))
{
value = Flookup_key (current_kboard->Voverriding_terminal_local_map,
@@ -1662,8 +1664,8 @@ specified buffer position instead of point are used.
: MARKERP (position) ? marker_position (position)
: PT;
- local_map = get_local_map (pt, current_buffer, Qlocal_map);
- keymap = get_local_map (pt, current_buffer, Qkeymap);
+ local_map = get_local_map (pt, current_buffer, Qlocal_map);
+ keymap = get_local_map (pt, current_buffer, Qkeymap);
if (CONSP (position))
{
@@ -1671,7 +1673,7 @@ specified buffer position instead of point are used.
/* For a mouse click, get the local text-property keymap
of the place clicked on, rather than point. */
-
+
if (POSN_INBUFFER_P (position))
{
Lisp_Object pos;
@@ -1682,7 +1684,7 @@ specified buffer position instead of point are used.
{
local_map = get_local_map (XINT (pos),
current_buffer, Qlocal_map);
-
+
keymap = get_local_map (XINT (pos),
current_buffer, Qkeymap);
}
@@ -1693,12 +1695,12 @@ specified buffer position instead of point are used.
string displayed via the `display' property,
consider `local-map' and `keymap' properties of
that string. */
-
+
if (string = POSN_STRING (position),
(CONSP (string) && STRINGP (XCAR (string))))
{
Lisp_Object pos, map;
-
+
pos = XCDR (string);
string = XCAR (string);
if (INTEGERP (pos)
@@ -1714,7 +1716,7 @@ specified buffer position instead of point are used.
keymap = map;
}
}
-
+
}
if (! NILP (keymap))
diff --git a/src/lread.c b/src/lread.c
index 596ba79cb57..9142e0c6dcd 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1554,7 +1554,7 @@ DEFUN ("eval-buffer", Feval_buffer, Seval_buffer, 0, 5, "",
Programs can pass two arguments, BUFFER and PRINTFLAG.
BUFFER is the buffer to evaluate (nil means use current buffer).
PRINTFLAG controls printing of output:
-nil means discard it; anything else is stream for print.
+A value of nil means discard it; anything else is stream for print.
If the optional third argument FILENAME is non-nil,
it specifies the file name to use for `load-history'.
@@ -1603,7 +1603,7 @@ When called from programs, expects two arguments,
giving starting and ending indices in the current buffer
of the text to be executed.
Programs can pass third argument PRINTFLAG which controls output:
-nil means discard it; anything else is stream for printing it.
+A value of nil means discard it; anything else is stream for printing it.
Also the fourth argument READ-FUNCTION, if non-nil, is used
instead of `read' to read each expression. It gets one argument
which is the input stream for reading characters.
diff --git a/src/m/amdx86-64.h b/src/m/amdx86-64.h
index 940ff70dbda..36e62ef6166 100644
--- a/src/m/amdx86-64.h
+++ b/src/m/amdx86-64.h
@@ -125,7 +125,16 @@ Boston, MA 02110-1301, USA. */
#undef LIB_STANDARD
#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o
-#else /* !__OpenBSD__ && !__FreeBSD__ */
+#elif defined(__NetBSD__)
+
+/* LIB_STANDARD and START_FILES set correctly in s/netbsd.h */
+
+#elif defined(sun)
+
+#undef START_FILES
+#undef LIB_STANDARD
+
+#else /* !__OpenBSD__ && !__FreeBSD__ && !__NetBSD__ && !sun */
#undef START_FILES
#ifdef HAVE_X86_64_LIB64_DIR
diff --git a/src/m/hp800.h b/src/m/hp800.h
index 01146e52359..1630a0bc883 100644
--- a/src/m/hp800.h
+++ b/src/m/hp800.h
@@ -174,6 +174,14 @@ Boston, MA 02110-1301, USA. */
#define rindex strrchr
#endif /* __hpux */
+
+/* Systems with GCC don't need to lose. */
+#ifdef __NetBSD__
+# ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA
+# endif /* __GNUC__ */
+#endif /* __NetBSD__ */
/* arch-tag: 809436e6-1645-4b92-b40d-2de5d6e7227c
(do not change this comment) */
diff --git a/src/m/sh3el.h b/src/m/sh3el.h
new file mode 100644
index 00000000000..0854ecd1b25
--- /dev/null
+++ b/src/m/sh3el.h
@@ -0,0 +1,109 @@
+/* machine description file for sh3el
+ Copyright (C) 1985, 1986 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+
+/* The following line tells the configuration script what sort of
+ operating system this machine is likely to run.
+ USUAL-OPSYS="<name of system .h file here, without the s- or .h>" */
+
+/* Define WORDS_BIG_ENDIAN iff lowest-numbered byte in a word
+ is the most significant byte. */
+
+#undef WORDS_BIG_ENDIAN
+
+/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
+ * group of arguments and treat it as an array of the arguments. */
+
+#define NO_ARG_ARRAY
+
+/* Define WORD_MACHINE if addresses and such have
+ * to be corrected before they can be used as byte counts. */
+
+#undef WORD_MACHINE
+
+/* Now define a symbol for the cpu type, if your compiler
+ does not define it automatically:
+ Ones defined so far include vax, m68000, ns16000, pyramid,
+ orion, tahoe, APOLLO and many others */
+
+/* Use type int rather than a union, to represent Lisp_Object */
+/* This is desirable for most machines. */
+
+#define NO_UNION_TYPE
+
+/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
+ the 24-bit bit field into an int. In other words, if bit fields
+ are always unsigned.
+
+ If you use NO_UNION_TYPE, this flag does not matter. */
+
+#define EXPLICIT_SIGN_EXTEND
+
+/* Data type of load average, as read out of kmem. */
+
+#define LOAD_AVE_TYPE long
+
+/* Convert that into an integer that is 100 for a load average of 1.0 */
+
+#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
+
+/* Define CANNOT_DUMP on machines where unexec does not work.
+ Then the function dump-emacs will not be defined
+ and temacs will do (load "loadup") automatically unless told otherwise. */
+
+#undef CANNOT_DUMP
+
+/* Define VIRT_ADDR_VARIES if the virtual addresses of
+ pure and impure space as loaded can vary, and even their
+ relative order cannot be relied on.
+
+ Otherwise Emacs assumes that text space precedes data space,
+ numerically. */
+
+#define VIRT_ADDR_VARIES
+
+/* Define C_ALLOCA if this machine does not support a true alloca
+ and the one written in C should be used instead.
+ Define HAVE_ALLOCA to say that the system provides a properly
+ working alloca function and it should be used.
+ Define neither one if an assembler-language alloca
+ in the file alloca.s should be used. */
+
+/* #define C_ALLOCA */
+#define HAVE_ALLOCA
+
+/* Define NO_REMAP if memory segmentation makes it not work well
+ to change the boundary between the text section and data section
+ when Emacs is dumped. If you define this, the preloaded Lisp
+ code will not be sharable; but that's better than failing completely. */
+
+#define NO_REMAP
+
+/* After adding support for a new system, modify the large case
+ statement in the `configure' script to recognize reasonable
+ configuration names, and add a description of the system to
+ `etc/MACHINES'.
+
+ If you've just fixed a problem in an existing configuration file,
+ you should also check `etc/MACHINES' to make sure its descriptions
+ of known problems in that configuration should be updated. */
+
+/* arch-tag: ee325990-6f40-47a2-b9df-60ecf3599899
+ (do not change this comment) */
diff --git a/src/mac.c b/src/mac.c
index c4275caa741..7a08d828725 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -79,6 +79,15 @@ static ComponentInstance as_scripting_component;
/* The single script context used for all script executions. */
static OSAID as_script_context;
+#if TARGET_API_MAC_CARBON
+static int wakeup_from_rne_enabled_p = 0;
+#define ENABLE_WAKEUP_FROM_RNE (wakeup_from_rne_enabled_p = 1)
+#define DISABLE_WAKEUP_FROM_RNE (wakeup_from_rne_enabled_p = 0)
+#else
+#define ENABLE_WAKEUP_FROM_RNE 0
+#define DISABLE_WAKEUP_FROM_RNE 0
+#endif
+
#ifndef MAC_OSX
static OSErr posix_pathname_to_fsspec P_ ((const char *, FSSpec *));
static OSErr fsspec_to_posix_pathname P_ ((const FSSpec *, char *, int));
@@ -2431,6 +2440,7 @@ select (nfds, rfds, wfds, efds, timeout)
BLOCK_INPUT block, in case that some input has already been read
asynchronously. */
BLOCK_INPUT;
+ ENABLE_WAKEUP_FROM_RNE;
if (!detect_input_pending ())
{
#if TARGET_API_MAC_CARBON
@@ -2461,6 +2471,7 @@ select (nfds, rfds, wfds, efds, timeout)
}
#endif /* not TARGET_API_MAC_CARBON */
}
+ DISABLE_WAKEUP_FROM_RNE;
UNBLOCK_INPUT;
if (err == noErr)
@@ -4841,8 +4852,8 @@ DEFUN ("mac-code-convert-string", Fmac_code_convert_string, Smac_code_convert_st
doc: /* Convert STRING from SOURCE encoding to TARGET encoding.
The conversion is performed using the converter provided by the system.
Each encoding is specified by either a coding system symbol, a mime
-charset string, or an integer as a CFStringEncoding value. Nil for
-encoding means UTF-16 in native byte order, no byte order mark.
+charset string, or an integer as a CFStringEncoding value. An encoding
+of nil means UTF-16 in native byte order, no byte order mark.
On Mac OS X 10.2 and later, you can do Unicode Normalization by
specifying the optional argument NORMALIZATION-FORM with a symbol NFD,
NFKD, NFC, NFKC, HFS+D, or HFS+C.
@@ -5023,6 +5034,7 @@ select_and_poll_event (nfds, rfds, wfds, efds, timeout)
BLOCK_INPUT block, in case that some input has already been read
asynchronously. */
BLOCK_INPUT;
+ ENABLE_WAKEUP_FROM_RNE;
if (!detect_input_pending ())
{
EMACS_TIME select_timeout;
@@ -5045,6 +5057,7 @@ select_and_poll_event (nfds, rfds, wfds, efds, timeout)
kEventLeaveInQueue, NULL);
}
}
+ DISABLE_WAKEUP_FROM_RNE;
UNBLOCK_INPUT;
if (r != 0)
@@ -5124,6 +5137,7 @@ sys_select (nfds, rfds, wfds, efds, timeout)
BLOCK_INPUT block, in case that some input has already been
read asynchronously. */
BLOCK_INPUT;
+ ENABLE_WAKEUP_FROM_RNE;
if (!detect_input_pending ())
{
int minfd, fd;
@@ -5184,6 +5198,7 @@ sys_select (nfds, rfds, wfds, efds, timeout)
CFRunLoopRemoveSource (runloop, source, kCFRunLoopDefaultMode);
}
}
+ DISABLE_WAKEUP_FROM_RNE;
UNBLOCK_INPUT;
if (err == noErr || err == eventLoopQuitErr)
@@ -5385,6 +5400,16 @@ init_mac_osx_environment ()
}
#endif /* MAC_OSX */
+#if TARGET_API_MAC_CARBON
+void
+mac_wakeup_from_rne ()
+{
+ if (wakeup_from_rne_enabled_p)
+ /* Post a harmless event so as to wake up from
+ ReceiveNextEvent. */
+ mac_post_mouse_moved_event ();
+}
+#endif
void
syms_of_mac ()
diff --git a/src/macfns.c b/src/macfns.c
index 14261f67ad6..c74fd1089f0 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -1969,9 +1969,9 @@ mac_update_proxy_icon (f)
{
AEDesc desc;
#ifdef MAC_OSX
- FSRef fref;
+ FSRef fref, fref_proxy;
#else
- FSSpec fss;
+ FSSpec fss, fss_proxy;
#endif
Boolean changed;
Lisp_Object encoded_file_name = ENCODE_FILE (file_name);
@@ -1997,10 +1997,19 @@ mac_update_proxy_icon (f)
{
if (alias)
{
+ /* (FS)ResolveAlias never sets `changed' to true if
+ `alias' is minimal. */
#ifdef MAC_OSX
- err = FSUpdateAlias (NULL, &fref, alias, &changed);
+ err = FSResolveAlias (NULL, alias, &fref_proxy, &changed);
+ if (err == noErr)
+ err = FSCompareFSRefs (&fref, &fref_proxy);
#else
- err = UpdateAlias (NULL, &fss, alias, &changed);
+ err = ResolveAlias (NULL, alias, &fss_proxy, &changed);
+ if (err == noErr)
+ err = !(fss.vRefNum == fss_proxy.vRefNum
+ && fss.parID == fss_proxy.parID
+ && EqualString (fss.name, fss_proxy.name,
+ false, true));
#endif
}
if (err != noErr || alias == NULL)
@@ -2051,11 +2060,11 @@ mac_update_title_bar (f, save_match_data)
confusing. */
|| (!MINI_WINDOW_P (w)
&& (modified_p != !NILP (w->last_had_star))))
- SetWindowModified (FRAME_MAC_WINDOW (f),
- !MINI_WINDOW_P (w) && modified_p);
-
- if (windows_or_buffers_changed)
- mac_update_proxy_icon (f);
+ {
+ SetWindowModified (FRAME_MAC_WINDOW (f),
+ !MINI_WINDOW_P (w) && modified_p);
+ mac_update_proxy_icon (f);
+ }
#endif
}
@@ -4597,6 +4606,30 @@ This is for internal use only. Use `mac-font-panel-mode' instead. */)
return Qnil;
}
#endif
+
+#if USE_ATSUI
+extern Lisp_Object mac_atsu_font_face_attributes P_ ((ATSUFontID));
+
+DEFUN ("mac-atsu-font-face-attributes", Fmac_atsu_font_face_attributes,
+ Smac_atsu_font_face_attributes, 1, 1, 0,
+ doc: /* Return plist of face attributes and values for ATSU font ID.
+ID is specified by either an integer or a float. */)
+ (id)
+ Lisp_Object id;
+{
+ ATSUFontID font_id;
+ Lisp_Object result;
+
+ check_mac ();
+ CHECK_NUMBER_OR_FLOAT(id);
+ font_id = NUMBERP (id) ? XINT (id) : (ATSUFontID) XFLOAT (id);
+ BLOCK_INPUT;
+ result = mac_atsu_font_face_attributes (font_id);
+ UNBLOCK_INPUT;
+ return result;
+}
+#endif
+
/***********************************************************************
Initialization
@@ -4829,6 +4862,9 @@ Chinese, Japanese, and Korean. */);
#if USE_MAC_FONT_PANEL
defsubr (&Smac_set_font_panel_visibility);
#endif
+#if USE_ATSUI
+ defsubr (&Smac_atsu_font_face_attributes);
+#endif
}
/* arch-tag: d7591289-f374-4377-b245-12f5dbbb8edc
diff --git a/src/macselect.c b/src/macselect.c
index 7a952f88367..8d15db24144 100644
--- a/src/macselect.c
+++ b/src/macselect.c
@@ -1567,8 +1567,7 @@ mac_do_receive_drag (window, refcon, drag)
{
mac_store_drag_event (window, mouse_pos, modifiers, &apple_event);
AEDisposeDesc (&apple_event);
- /* Post a harmless event so as to wake up from ReceiveNextEvent. */
- mac_post_mouse_moved_event ();
+ mac_wakeup_from_rne ();
return noErr;
}
else
diff --git a/src/macterm.c b/src/macterm.c
index 4739a52520e..6eaf549ba85 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -1154,7 +1154,8 @@ mac_query_char_extents (style, c,
UniChar ch = c;
err = atsu_get_text_layout_with_text_ptr (&ch, 1, style, &text_layout);
- if (err == noErr)
+ if (err == noErr
+ && (font_ascent_return || font_descent_return || overall_return))
{
ATSTrapezoid glyph_bounds;
@@ -6987,7 +6988,6 @@ static Lisp_Object fm_font_family_alist;
static Lisp_Object atsu_font_id_hash;
/* Alist linking Font Manager style to face attributes. */
static Lisp_Object fm_style_face_attributes_alist;
-static Lisp_Object Vmac_atsu_font_table;
extern Lisp_Object QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic;
#endif
@@ -7224,6 +7224,73 @@ add_mac_font_name (name, size, style, charset)
}
#if USE_ATSUI
+static FMFontStyle
+fm_get_style_from_font (font)
+ FMFont font;
+{
+ OSStatus err;
+ FMFontStyle style = normal;
+ ByteCount len;
+ UInt16 mac_style;
+ FMFontFamily font_family;
+#define FONT_HEADER_MAC_STYLE_OFFSET (4*4 + 2*2 + 8*2 + 2*4)
+
+ /* FMGetFontFamilyInstanceFromFont returns `normal' as the style of
+ some font (e.g., Optima) even if it is `bold'. */
+ err = FMGetFontTable (font, 'head', FONT_HEADER_MAC_STYLE_OFFSET,
+ sizeof (mac_style), &mac_style, &len);
+ if (err == noErr
+ && len >= FONT_HEADER_MAC_STYLE_OFFSET + sizeof (mac_style))
+ style = EndianU16_BtoN (mac_style);
+ else
+ FMGetFontFamilyInstanceFromFont (font, &font_family, &style);
+
+ return style;
+}
+
+static ATSUFontID
+atsu_find_font_from_family_name (family)
+ const char *family;
+{
+ struct Lisp_Hash_Table *h = XHASH_TABLE (atsu_font_id_hash);
+ unsigned hash_code;
+ int i;
+ Lisp_Object rest, best;
+ FMFontStyle min_style, style;
+
+ i = hash_lookup (h, make_unibyte_string (family, strlen (family)),
+ &hash_code);
+ if (i < 0)
+ return kATSUInvalidFontID;
+
+ rest = HASH_VALUE (h, i);
+ if (INTEGERP (rest) || (CONSP (rest) && INTEGERP (XCDR (rest))))
+ return cons_to_long (rest);
+
+ rest = Fnreverse (rest);
+ best = XCAR (rest);
+ rest = XCDR (rest);
+ if (!NILP (rest)
+ && (min_style = fm_get_style_from_font (cons_to_long (best))) != normal)
+ do
+ {
+ style = fm_get_style_from_font (cons_to_long (XCAR (rest)));
+ if (style < min_style)
+ {
+ best = XCAR (rest);
+ if (style == normal)
+ break;
+ else
+ min_style = style;
+ }
+ rest = XCDR (rest);
+ }
+ while (!NILP (rest));
+
+ HASH_VALUE (h, i) = best;
+ return cons_to_long (best);
+}
+
static Lisp_Object
fm_style_to_face_attributes (fm_style)
FMFontStyle fm_style;
@@ -7244,6 +7311,44 @@ fm_style_to_face_attributes (fm_style)
return tem;
}
+
+static Lisp_Object
+atsu_find_font_family_name (font_id)
+ ATSUFontID font_id;
+{
+ OSStatus err;
+ ByteCount len;
+ Lisp_Object family = Qnil;
+
+ err = ATSUFindFontName (font_id, kFontFamilyName,
+ kFontMacintoshPlatform, kFontNoScript,
+ kFontNoLanguage, 0, NULL, &len, NULL);
+ if (err == noErr)
+ {
+ family = make_uninit_string (len);
+ err = ATSUFindFontName (font_id, kFontFamilyName,
+ kFontMacintoshPlatform, kFontNoScript,
+ kFontNoLanguage, len, SDATA (family),
+ NULL, NULL);
+ }
+ if (err == noErr)
+ decode_mac_font_name (SDATA (family), len + 1, Qnil);
+
+ return family;
+}
+
+Lisp_Object
+mac_atsu_font_face_attributes (font_id)
+ ATSUFontID font_id;
+{
+ Lisp_Object family, style_attrs;
+
+ family = atsu_find_font_family_name (font_id);
+ if (NILP (family))
+ return Qnil;
+ style_attrs = fm_style_to_face_attributes (fm_get_style_from_font (font_id));
+ return Fcons (QCfamily, Fcons (family, style_attrs));
+}
#endif
/* Sets up the table font_name_table to contain the list of all fonts
@@ -7275,9 +7380,8 @@ init_font_name_table ()
unsigned hash_code;
ItemCount nfonts, i;
ATSUFontID *font_ids = NULL;
- Ptr name;
- ByteCount name_len;
- Lisp_Object family;
+ Lisp_Object prev_family = Qnil;
+ int j;
atsu_font_id_hash =
make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE),
@@ -7295,41 +7399,25 @@ init_font_name_table ()
if (err == noErr)
for (i = 0; i < nfonts; i++)
{
- err = ATSUFindFontName (font_ids[i], kFontFamilyName,
- kFontMacintoshPlatform, kFontNoScript,
- kFontNoLanguage, 0, NULL, &name_len, NULL);
- if (err != noErr)
+ Lisp_Object family;
+
+ family = atsu_find_font_family_name (font_ids[i]);
+ if (NILP (family) || SREF (family, 0) == '.')
continue;
- name = xmalloc (name_len + 1);
- name[name_len] = '\0';
- err = ATSUFindFontName (font_ids[i], kFontFamilyName,
- kFontMacintoshPlatform, kFontNoScript,
- kFontNoLanguage, name_len, name,
- NULL, NULL);
- if (err == noErr)
+ if (!NILP (Fequal (prev_family, family)))
+ family = prev_family;
+ else
+ j = hash_lookup (h, family, &hash_code);
+ if (j < 0)
{
- FMFontFamily ff;
- FMFontStyle style = normal;
-
- decode_mac_font_name (name, name_len + 1, Qnil);
- family = make_unibyte_string (name, name_len);
- FMGetFontFamilyInstanceFromFont (font_ids[i], &ff, &style);
- Fputhash ((font_ids[i] > MOST_POSITIVE_FIXNUM
- ? make_float (font_ids[i])
- : make_number (font_ids[i])),
- Fcons (QCfamily,
- Fcons (family,
- fm_style_to_face_attributes (style))),
- Vmac_atsu_font_table);
- if (*name != '.'
- && hash_lookup (h, family, &hash_code) < 0)
- {
- add_mac_font_name (name, 0, normal, "iso10646-1");
- hash_put (h, family, long_to_cons (font_ids[i]),
- hash_code);
- }
+ add_mac_font_name (SDATA (family), 0, normal, "iso10646-1");
+ j = hash_put (h, family, Fcons (long_to_cons (font_ids[i]),
+ Qnil), hash_code);
}
- xfree (name);
+ else if (EQ (prev_family, family))
+ HASH_VALUE (h, j) = Fcons (long_to_cons (font_ids[i]),
+ HASH_VALUE (h, j));
+ prev_family = family;
}
if (font_ids)
xfree (font_ids);
@@ -7873,14 +7961,11 @@ mac_load_query_font (f, fontname)
{kAllTypographicFeaturesType, kDiacriticsType};
static const ATSUFontFeatureSelector selectors[] =
{kAllTypeFeaturesOffSelector, kDecomposeDiacriticsSelector};
- Lisp_Object font_id_cons;
FMFontStyle style;
- font_id_cons = Fgethash (make_unibyte_string (family, strlen (family)),
- atsu_font_id_hash, Qnil);
- if (NILP (font_id_cons))
- return NULL;
- font_id = cons_to_long (font_id_cons);
+ font_id = atsu_find_font_from_family_name (family);
+ if (font_id == kATSUInvalidFontID)
+ return;
size_fixed = Long2Fix (size);
bold_p = (fontface & bold) != 0;
italic_p = (fontface & italic) != 0;
@@ -8004,11 +8089,19 @@ mac_load_query_font (f, fontname)
continue;
else if (c == 0x7f)
{
- c = 0x9f;
- continue;
+#if USE_CG_TEXT_DRAWING
+ if (font->cg_glyphs)
+ {
+ c = 0x9f;
+ pcm = NULL;
+ continue;
+ }
+#endif
+ break;
}
- mac_query_char_extents (font->mac_style, c, NULL, NULL, pcm + c,
+ mac_query_char_extents (font->mac_style, c, NULL, NULL,
+ pcm ? pcm + c : NULL,
#if USE_CG_TEXT_DRAWING
(font->cg_glyphs ? font->cg_glyphs + c
: NULL)
@@ -8026,6 +8119,8 @@ mac_load_query_font (f, fontname)
font->cg_font = NULL;
xfree (font->cg_glyphs);
font->cg_glyphs = NULL;
+ if (pcm == NULL)
+ break;
}
#endif
}
@@ -8033,6 +8128,7 @@ mac_load_query_font (f, fontname)
else
#endif
{
+ OSStatus err;
FontInfo the_fontinfo;
int is_two_byte_font;
@@ -8115,8 +8211,13 @@ mac_load_query_font (f, fontname)
sizeof (XCharStruct) * (0xff - 0x20 + 1));
space_bounds = font->bounds.per_char;
- mac_query_char_extents (NULL, 0x20, &font->ascent, &font->descent,
- space_bounds, NULL);
+ err = mac_query_char_extents (NULL, 0x20, &font->ascent,
+ &font->descent, space_bounds, NULL);
+ if (err != noErr || space_bounds->width <= 0)
+ {
+ mac_unload_font (&one_mac_display_info, font);
+ return NULL;
+ }
for (c = 0x21, pcm = space_bounds + 1; c <= 0xff; c++, pcm++)
mac_query_char_extents (NULL, c, NULL, NULL, pcm, NULL);
@@ -9365,9 +9466,7 @@ mac_store_event_ref_as_apple_event (class, id, class_key, id_key,
{
mac_store_apple_event (class_key, id_key, &apple_event);
AEDisposeDesc (&apple_event);
- /* Post a harmless event so as to wake up from
- ReceiveNextEvent. */
- mac_post_mouse_moved_event ();
+ mac_wakeup_from_rne ();
}
}
}
@@ -10404,7 +10503,9 @@ XTread_socket (sd, expected, hold_quit)
#else
FrontWindow ()
#endif
- != window_ptr)
+ != window_ptr
+ || (mac_window_to_frame (window_ptr)
+ != dpyinfo->x_focus_frame))
SelectWindow (window_ptr);
else
{
@@ -11677,7 +11778,7 @@ syms_of_macterm ()
DEFVAR_BOOL ("x-use-underline-position-properties",
&x_use_underline_position_properties,
doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties.
-nil means ignore them. If you encounter fonts with bogus
+A value of nil means ignore them. If you encounter fonts with bogus
UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
to 4.1, set this to nil.
@@ -11687,9 +11788,9 @@ NOTE: Not supported on Mac yet. */);
DEFVAR_BOOL ("x-underline-at-descent-line",
&x_underline_at_descent_line,
doc: /* *Non-nil means to draw the underline at the same place as the descent line.
-nil means to draw the underline according to the value of the variable
-`x-use-underline-position-properties', which is usually at the baseline
-level. The default value is nil. */);
+A value of nil means to draw the underline according to the value of the
+variable `x-use-underline-position-properties', which is usually at the
+baseline level. The default value is nil. */);
x_underline_at_descent_line = 0;
DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
@@ -11736,8 +11837,8 @@ unexpected results for some keys on non-US/GB keyboards. */);
&Vmac_emulate_three_button_mouse,
doc: /* *Specify a way of three button mouse emulation.
The value can be nil, t, or the symbol `reverse'.
-nil means that no emulation should be done and the modifiers should be
-placed on the mouse-1 event.
+A value of nil means that no emulation should be done and the modifiers
+should be placed on the mouse-1 event.
t means that when the option-key is held down while pressing the mouse
button, the click will register as mouse-2 and while the command-key
is held down, the click will register as mouse-3.
@@ -11788,15 +11889,6 @@ CODING_SYSTEM is a coding system corresponding to TEXT-ENCODING. */);
Fcons (list3 (build_string ("mac-roman"),
make_number (smRoman), Qnil), Qnil);
-#if USE_ATSUI
- DEFVAR_LISP ("mac-atsu-font-table", &Vmac_atsu_font_table,
- doc: /* Hash table of ATSU font IDs vs plist of attributes and values. */);
- Vmac_atsu_font_table =
- make_hash_table (Qeql, make_number (DEFAULT_HASH_SIZE),
- make_float (DEFAULT_REHASH_SIZE),
- make_float (DEFAULT_REHASH_THRESHOLD),
- Qnil, Qnil, Qnil);
-#endif
#if USE_MAC_TSM
DEFVAR_LISP ("mac-ts-active-input-overlay", &Vmac_ts_active_input_overlay,
doc: /* Overlay used to display Mac TSM active input area. */);
diff --git a/src/macterm.h b/src/macterm.h
index 33692a8b8d2..a7e4ccff775 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -682,6 +682,7 @@ extern Lisp_Object cfdate_to_lisp P_ ((CFDateRef));
extern Lisp_Object cfboolean_to_lisp P_ ((CFBooleanRef));
extern Lisp_Object cfobject_desc_to_lisp P_ ((CFTypeRef));
extern Lisp_Object cfproperty_list_to_lisp P_ ((CFPropertyListRef, int, int));
+extern void mac_wakeup_from_rne P_ ((void));
#endif
extern void xrm_merge_string_database P_ ((XrmDatabase, const char *));
extern Lisp_Object xrm_get_resource P_ ((XrmDatabase, const char *,
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index c2367ba30e4..e8d30a31cc5 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -156,7 +156,7 @@ all: $(ALL)
#
# The dumped executable
#
-emacs: $(BLD) $(EMACS)
+emacs: stamp_BLD $(EMACS)
$(EMACS): $(DOC) $(TEMACS)
"$(THISDIR)/$(BLD)/temacs.exe" -batch -l loadup dump
-"$(THISDIR)/$(BLD)/emacs.exe" -q -batch -f list-load-path-shadows
@@ -167,7 +167,7 @@ $(EMACS): $(DOC) $(TEMACS)
# If preload runs out of memory, increase the last argument to addsection
# (it is the preload heap size in MB).
#
-temacs: $(BLD) $(TEMACS)
+temacs: stamp_BLD $(TEMACS)
$(TEMACS): $(TLIB0) $(TLIB1) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES) \
../nt/$(BLD)/addsection.exe
$(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS)
@@ -185,7 +185,7 @@ bootstrap: bootstrap-emacs
# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
# this can break with GNU Make 3.81 and later if sh.exe is used.
bootstrap-temacs:
- $(MAKE) $(MFLAGS) temacs CFLAGS=$(ARGQUOTE)$(CFLAGS) -DPURESIZE=5000000$(ARGQUOTE)
+ $(MAKE) $(MFLAGS) $(XMFLAGS) temacs CFLAGS=$(ARGQUOTE)$(CFLAGS) -DPURESIZE=5000000$(ARGQUOTE)
#
# Dump an Emacs executable named bootstrap-emacs containing the
@@ -250,6 +250,7 @@ clean:
- $(DEL) *~ "s/*~" "m/*~"
- $(DEL) $(COMPILER_TEMP_FILES)
- $(DEL_TREE) $(OBJDIR)
+ - $(DEL) stamp_BLD
distclean: clean
- $(DEL) config.h epaths.h
@@ -1486,3 +1487,8 @@ $(BLD)/w32bdf.$(O): \
$(SRC)/w32bdf.h \
$(SRC)/w32gui.h \
$(SRC)/w32term.h
+
+# Each object file depends on stamp_BLD, because in parallel builds we must
+# make sure $(BLD) exists before starting compilations.
+#
+$(OBJ0) $(OBJ1) $(WIN32OBJ) $(BLD)/lastfile.$(O) $(BLD)/firstfile.$(O): stamp_BLD
diff --git a/src/marker.c b/src/marker.c
index 48685e7d27c..727e97900c2 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -848,7 +848,7 @@ see `marker-insertion-type'. */)
DEFUN ("marker-insertion-type", Fmarker_insertion_type,
Smarker_insertion_type, 1, 1, 0,
doc: /* Return insertion type of MARKER: t if it stays after inserted text.
-nil means the marker stays before text inserted there. */)
+The value nil means the marker stays before text inserted there. */)
(marker)
register Lisp_Object marker;
{
diff --git a/src/minibuf.c b/src/minibuf.c
index 31c0fd1768e..7b276a2e925 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1293,6 +1293,7 @@ is used to further constrain the set of candidates. */)
tail = alist;
if (type == 2)
{
+ alist = check_obarray (alist);
obsize = XVECTOR (alist)->size;
bucket = XVECTOR (alist)->contents[index];
}
@@ -1316,6 +1317,8 @@ is used to further constrain the set of candidates. */)
{
if (!EQ (bucket, zero))
{
+ if (!SYMBOLP (bucket))
+ error ("Bad data in guts of obarray");
elt = bucket;
eltstring = elt;
if (XSYMBOL (bucket)->next)
@@ -2883,10 +2886,10 @@ The value may alternatively be a function, which is given three arguments:
STRING, the current buffer contents;
PREDICATE, the predicate for filtering possible matches;
CODE, which says what kind of things to do.
-CODE can be nil, t or `lambda'.
-nil means to return the best completion of STRING, or nil if there is none.
-t means to return a list of all possible completions of STRING.
-`lambda' means to return t if STRING is a valid completion as it stands. */);
+CODE can be nil, t or `lambda':
+ nil -- return the best completion of STRING, or nil if there is none.
+ t -- return a list of all possible completions of STRING.
+ lambda -- return t if STRING is a valid completion as it stands. */);
Vminibuffer_completion_table = Qnil;
DEFVAR_LISP ("minibuffer-completion-predicate", &Vminibuffer_completion_predicate,
diff --git a/src/msdos.c b/src/msdos.c
index 834a32db97b..6413fed0014 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -5300,7 +5300,7 @@ This variable is used only by MSDOS terminals. */);
#ifndef subprocesses
DEFVAR_BOOL ("delete-exited-processes", &delete_exited_processes,
doc: /* *Non-nil means delete processes immediately when they exit.
-nil means don't delete them until `list-processes' is run. */);
+A value of nil means don't delete them until `list-processes' is run. */);
delete_exited_processes = 0;
#endif
diff --git a/src/msdos.h b/src/msdos.h
index 8bfbcf2d10c..cbe65818867 100644
--- a/src/msdos.h
+++ b/src/msdos.h
@@ -53,7 +53,7 @@ typedef int Pixmap;
typedef int Display;
typedef int Window;
typedef int XRectangle;
-#define PIX_TYPE int
+#define PIX_TYPE unsigned long
#define XDISPLAY
/* A stripped version of struct x_display_info in xterm.h, which see. */
diff --git a/src/prefix-args.c b/src/prefix-args.c
index 1f2632c6913..ad634585168 100644
--- a/src/prefix-args.c
+++ b/src/prefix-args.c
@@ -44,6 +44,14 @@ Boston, MA 02110-1301, USA. */
If I can't write a completely portable program to do this in C,
I'm quitting and taking up gardening. */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if STDC_HEADERS
+# include <stdlib.h> /* for proper declaration of `exit' */
+#endif
+
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/process.c b/src/process.c
index 7a8ad5c339b..f6dad808ffe 100644
--- a/src/process.c
+++ b/src/process.c
@@ -2900,7 +2900,7 @@ usage: (make-network-process &rest ARGS) */)
/* Make QCaddress an alias for :local (server) or :remote (client). */
QCaddress = is_server ? QClocal : QCremote;
- /* :wait BOOL */
+ /* :nowait BOOL */
if (!is_server && socktype == SOCK_STREAM
&& (tem = Fplist_get (contact, QCnowait), !NILP (tem)))
{
@@ -5144,6 +5144,9 @@ read_process_output (proc, channel)
}
carryover = nbytes - coding->consumed;
+ if (carryover < 0)
+ abort ();
+
if (SCHARS (p->decoding_buf) < carryover)
p->decoding_buf = make_uninit_string (carryover);
bcopy (chars + coding->consumed, SDATA (p->decoding_buf),
@@ -5254,11 +5257,15 @@ read_process_output (proc, channel)
}
}
carryover = nbytes - coding->consumed;
+ if (carryover < 0)
+ abort ();
+
if (SCHARS (p->decoding_buf) < carryover)
p->decoding_buf = make_uninit_string (carryover);
bcopy (chars + coding->consumed, SDATA (p->decoding_buf),
carryover);
XSETINT (p->decoding_carryover, carryover);
+
/* Adjust the multibyteness of TEXT to that of the buffer. */
if (NILP (current_buffer->enable_multibyte_characters)
!= ! STRING_MULTIBYTE (text))
@@ -6099,7 +6106,7 @@ If PROCESS is a network process, resume handling of incoming traffic. */)
DEFUN ("signal-process", Fsignal_process, Ssignal_process,
2, 2, "sProcess (name or number): \nnSignal code: ",
doc: /* Send PROCESS the signal with code SIGCODE.
-PROCESS may also be an integer specifying the process id of the
+PROCESS may also be a number specifying the process id of the
process to signal; in this case, the process need not be a child of
this Emacs.
SIGCODE may be an integer, or a symbol whose name is a signal name. */)
@@ -6116,7 +6123,7 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
if (FLOATP (process))
{
- pid = (pid_t) XFLOAT (process);
+ pid = (pid_t) XFLOAT_DATA (process);
goto got_it;
}
@@ -6144,8 +6151,8 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
got_it:
-#define handle_signal(NAME, VALUE) \
- else if (!strcmp (name, NAME)) \
+#define parse_signal(NAME, VALUE) \
+ else if (!xstricmp (name, NAME)) \
XSETINT (sigcode, VALUE)
if (INTEGERP (sigcode))
@@ -6157,106 +6164,106 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
CHECK_SYMBOL (sigcode);
name = SDATA (SYMBOL_NAME (sigcode));
- if (!strncmp(name, "SIG", 3))
+ if (!strncmp(name, "SIG", 3) || !strncmp(name, "sig", 3))
name += 3;
if (0)
;
+#ifdef SIGUSR1
+ parse_signal ("usr1", SIGUSR1);
+#endif
+#ifdef SIGUSR2
+ parse_signal ("usr2", SIGUSR2);
+#endif
+#ifdef SIGTERM
+ parse_signal ("term", SIGTERM);
+#endif
#ifdef SIGHUP
- handle_signal ("HUP", SIGHUP);
+ parse_signal ("hup", SIGHUP);
#endif
#ifdef SIGINT
- handle_signal ("INT", SIGINT);
+ parse_signal ("int", SIGINT);
#endif
#ifdef SIGQUIT
- handle_signal ("QUIT", SIGQUIT);
+ parse_signal ("quit", SIGQUIT);
#endif
#ifdef SIGILL
- handle_signal ("ILL", SIGILL);
+ parse_signal ("ill", SIGILL);
#endif
#ifdef SIGABRT
- handle_signal ("ABRT", SIGABRT);
+ parse_signal ("abrt", SIGABRT);
#endif
#ifdef SIGEMT
- handle_signal ("EMT", SIGEMT);
+ parse_signal ("emt", SIGEMT);
#endif
#ifdef SIGKILL
- handle_signal ("KILL", SIGKILL);
+ parse_signal ("kill", SIGKILL);
#endif
#ifdef SIGFPE
- handle_signal ("FPE", SIGFPE);
+ parse_signal ("fpe", SIGFPE);
#endif
#ifdef SIGBUS
- handle_signal ("BUS", SIGBUS);
+ parse_signal ("bus", SIGBUS);
#endif
#ifdef SIGSEGV
- handle_signal ("SEGV", SIGSEGV);
+ parse_signal ("segv", SIGSEGV);
#endif
#ifdef SIGSYS
- handle_signal ("SYS", SIGSYS);
+ parse_signal ("sys", SIGSYS);
#endif
#ifdef SIGPIPE
- handle_signal ("PIPE", SIGPIPE);
+ parse_signal ("pipe", SIGPIPE);
#endif
#ifdef SIGALRM
- handle_signal ("ALRM", SIGALRM);
-#endif
-#ifdef SIGTERM
- handle_signal ("TERM", SIGTERM);
+ parse_signal ("alrm", SIGALRM);
#endif
#ifdef SIGURG
- handle_signal ("URG", SIGURG);
+ parse_signal ("urg", SIGURG);
#endif
#ifdef SIGSTOP
- handle_signal ("STOP", SIGSTOP);
+ parse_signal ("stop", SIGSTOP);
#endif
#ifdef SIGTSTP
- handle_signal ("TSTP", SIGTSTP);
+ parse_signal ("tstp", SIGTSTP);
#endif
#ifdef SIGCONT
- handle_signal ("CONT", SIGCONT);
+ parse_signal ("cont", SIGCONT);
#endif
#ifdef SIGCHLD
- handle_signal ("CHLD", SIGCHLD);
+ parse_signal ("chld", SIGCHLD);
#endif
#ifdef SIGTTIN
- handle_signal ("TTIN", SIGTTIN);
+ parse_signal ("ttin", SIGTTIN);
#endif
#ifdef SIGTTOU
- handle_signal ("TTOU", SIGTTOU);
+ parse_signal ("ttou", SIGTTOU);
#endif
#ifdef SIGIO
- handle_signal ("IO", SIGIO);
+ parse_signal ("io", SIGIO);
#endif
#ifdef SIGXCPU
- handle_signal ("XCPU", SIGXCPU);
+ parse_signal ("xcpu", SIGXCPU);
#endif
#ifdef SIGXFSZ
- handle_signal ("XFSZ", SIGXFSZ);
+ parse_signal ("xfsz", SIGXFSZ);
#endif
#ifdef SIGVTALRM
- handle_signal ("VTALRM", SIGVTALRM);
+ parse_signal ("vtalrm", SIGVTALRM);
#endif
#ifdef SIGPROF
- handle_signal ("PROF", SIGPROF);
+ parse_signal ("prof", SIGPROF);
#endif
#ifdef SIGWINCH
- handle_signal ("WINCH", SIGWINCH);
+ parse_signal ("winch", SIGWINCH);
#endif
#ifdef SIGINFO
- handle_signal ("INFO", SIGINFO);
-#endif
-#ifdef SIGUSR1
- handle_signal ("USR1", SIGUSR1);
-#endif
-#ifdef SIGUSR2
- handle_signal ("USR2", SIGUSR2);
+ parse_signal ("info", SIGINFO);
#endif
else
error ("Undefined signal name %s", name);
}
-#undef handle_signal
+#undef parse_signal
return make_number (kill (pid, XINT (sigcode)));
}
diff --git a/src/regex.c b/src/regex.c
index c0dd6e00ffc..b1307743f0f 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -67,8 +67,8 @@
# define regfree(preg) __regfree (preg)
# define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
# define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
-# define regerror(errcode, preg, errbuf, errbuf_size) \
- __regerror(errcode, preg, errbuf, errbuf_size)
+# define regerror(err_code, preg, errbuf, errbuf_size) \
+ __regerror(err_code, preg, errbuf, errbuf_size)
# define re_set_registers(bu, re, nu, st, en) \
__re_set_registers (bu, re, nu, st, en)
# define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
@@ -6531,12 +6531,15 @@ regexec (preg, string, nmatch, pmatch, eflags)
WEAK_ALIAS (__regexec, regexec)
-/* Returns a message corresponding to an error code, ERRCODE, returned
- from either regcomp or regexec. We don't use PREG here. */
+/* Returns a message corresponding to an error code, ERR_CODE, returned
+ from either regcomp or regexec. We don't use PREG here.
+
+ ERR_CODE was previously called ERRCODE, but that name causes an
+ error with msvc8 compiler. */
size_t
-regerror (errcode, preg, errbuf, errbuf_size)
- int errcode;
+regerror (err_code, preg, errbuf, errbuf_size)
+ int err_code;
const regex_t *preg;
char *errbuf;
size_t errbuf_size;
@@ -6544,15 +6547,15 @@ regerror (errcode, preg, errbuf, errbuf_size)
const char *msg;
size_t msg_size;
- if (errcode < 0
- || errcode >= (sizeof (re_error_msgid) / sizeof (re_error_msgid[0])))
+ if (err_code < 0
+ || err_code >= (sizeof (re_error_msgid) / sizeof (re_error_msgid[0])))
/* Only error codes returned by the rest of the code should be passed
to this routine. If we are given anything else, or if other regex
code generates an invalid error code, then the program has a bug.
Dump core so we can fix it. */
abort ();
- msg = gettext (re_error_msgid[errcode]);
+ msg = gettext (re_error_msgid[err_code]);
msg_size = strlen (msg) + 1; /* Includes the null. */
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index 461df7acfba..06b1f8960f0 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -137,6 +137,16 @@ Boston, MA 02110-1301, USA. */
#define HAVE_SOCKETS 1
+/* But our select implementation doesn't allow us to make non-blocking
+ connects. So until that is fixed, this is necessary: */
+
+#define BROKEN_NON_BLOCKING_CONNECT 1
+
+/* And the select implementation does 1-byte read-ahead waiting
+ for received packets, so datagrams are broken too. */
+
+#define BROKEN_DATAGRAM_SOCKETS 1
+
/* Define this symbol if your system has the functions bcopy, etc. */
#define BSTRING
@@ -376,7 +386,6 @@ typedef int pid_t;
#define pclose _pclose
#define putw _putw
#define umask _umask
-#define utime _utime
#define utimbuf _utimbuf
#define index strchr
#define rindex strrchr
@@ -385,7 +394,11 @@ typedef int pid_t;
#define strnicmp _strnicmp
#define stricmp _stricmp
#define tzset _tzset
+
+#if !defined (_MSC_VER) || (_MSC_VER < 1400)
#define tzname _tzname
+#define utime _utime
+#endif
#ifdef HAVE_NTGUI
#define abort w32_abort
diff --git a/src/search.c b/src/search.c
index d6572c5397a..3fc3faeda98 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2165,8 +2165,8 @@ DEFUN ("search-forward", Fsearch_forward, Ssearch_forward, 1, 4, "MSearch: ",
doc: /* Search forward from point for STRING.
Set point to the end of the occurrence found, and return point.
An optional second argument bounds the search; it is a buffer position.
-The match found must not extend after that position. nil is equivalent
- to (point-max).
+The match found must not extend after that position. A value of nil is
+ equivalent to (point-max).
Optional third argument, if t, means if fail just return nil (no error).
If not nil and not t, move to limit of search and return nil.
Optional fourth argument is repeat count--search for successive occurrences.
diff --git a/src/sound.c b/src/sound.c
index 6f8e3ecb308..b6f5ff513ee 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -74,8 +74,12 @@ Boston, MA 02110-1301, USA. */
#include <soundcard.h>
#endif
#ifdef HAVE_ALSA
+#ifdef ALSA_SUBDIR_INCLUDE
+#include <alsa/asoundlib.h>
+#else
#include <asoundlib.h>
-#endif
+#endif /* ALSA_SUBDIR_INCLUDE */
+#endif /* HAVE_ALSA */
/* END: Non Windows Includes */
diff --git a/src/syntax.c b/src/syntax.c
index 55f73d6d106..52527a0516d 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -915,7 +915,7 @@ DEFUN ("string-to-syntax", Fstring_to_syntax, Sstring_to_syntax, 1, 1, 0,
doc: /* Convert a syntax specification STRING into syntax cell form.
STRING should be a string as it is allowed as argument of
`modify-syntax-entry'. Value is the equivalent cons cell
-(CODE . MATCHING-CHAR) that can be used as value of a `syntax-table'
+\(CODE . MATCHING-CHAR) that can be used as value of a `syntax-table'
text property. */)
(string)
Lisp_Object string;
@@ -3046,7 +3046,7 @@ Fourth arg STOPBEFORE non-nil means stop when come to
any character that starts a sexp.
Fifth arg OLDSTATE is a list like what this function returns.
It is used to initialize the state of the parse. Elements number 1, 2, 6
- and 8 are ignored; you can leave off element 8 (the last) entirely.
+ and 8 are ignored.
Sixth arg COMMENTSTOP non-nil means stop at the start of a comment.
If it is symbol `syntax-table', stop after the start of a comment or a
string, or after end of a comment or a string. */)
diff --git a/src/systime.h b/src/systime.h
index 00373b257b3..e7ff2b2a3b7 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -101,16 +101,8 @@ extern time_t timezone;
#ifdef GETTIMEOFDAY_ONE_ARGUMENT
#define EMACS_GET_TIME(time) gettimeofday (&(time))
#else /* not GETTIMEOFDAY_ONE_ARGUMENT */
-#ifdef HAVE_STRUCT_TIMEZONE
-#define EMACS_GET_TIME(time) \
- do { \
- struct timezone dummy; \
- gettimeofday (&(time), &dummy); \
- } while (0)
-#else
/* Presumably the second arg is ignored. */
#define EMACS_GET_TIME(time) gettimeofday (&(time), NULL)
-#endif /* HAVE_STRUCT_TIMEZONE */
#endif /* not GETTIMEOFDAY_ONE_ARGUMENT */
#define EMACS_ADD_TIME(dest, src1, src2) \
diff --git a/src/w32.c b/src/w32.c
index cbc78f8a5d5..9fe88833b4f 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -153,7 +153,8 @@ typedef PSID_IDENTIFIER_AUTHORITY (WINAPI * GetSidIdentifierAuthority_Proc) (
PSID pSid);
/* ** A utility function ** */
-static BOOL is_windows_9x ()
+static BOOL
+is_windows_9x ()
{
static BOOL s_b_ret=0;
OSVERSIONINFO os_ver;
@@ -2871,7 +2872,8 @@ int h_errno = 0;
/* function to set h_errno for compatability; map winsock error codes to
normal system codes where they overlap (non-overlapping definitions
are already in <sys/socket.h> */
-static void set_errno ()
+static void
+set_errno ()
{
if (winsock_lib == NULL)
h_errno = EINVAL;
@@ -2892,7 +2894,8 @@ static void set_errno ()
errno = h_errno;
}
-static void check_errno ()
+static void
+check_errno ()
{
if (h_errno == 0 && winsock_lib != NULL)
pfn_WSASetLastError (0);
@@ -3676,7 +3679,8 @@ _sys_read_ahead (int fd)
return cp->status;
}
-int _sys_wait_accept (int fd)
+int
+_sys_wait_accept (int fd)
{
HANDLE hEv;
child_process * cp;
@@ -3698,10 +3702,10 @@ int _sys_wait_accept (int fd)
{
rc = WaitForSingleObject (hEv, INFINITE);
pfn_WSAEventSelect (SOCK_HANDLE (fd), NULL, 0);
- pfn_WSACloseEvent (hEv);
if (rc == WAIT_OBJECT_0)
cp->status = STATUS_READ_SUCCEEDED;
}
+ pfn_WSACloseEvent (hEv);
return cp->status;
}
@@ -4127,7 +4131,7 @@ BOOL WINAPI shutdown_handler(DWORD type)
shut_down_emacs (0, 0, Qnil);
}
- /* Allow other handlers to handle this signal. */
+ /* Allow other handlers to handle this signal. */
return FALSE;
}
@@ -4136,7 +4140,8 @@ BOOL WINAPI shutdown_handler(DWORD type)
must always be initialized on startup even when the global variable
initialized is non zero (see the function main in emacs.c).
*/
-void globals_of_w32 ()
+void
+globals_of_w32 ()
{
g_b_init_is_windows_9x = 0;
g_b_init_open_process_token = 0;
diff --git a/src/w32fns.c b/src/w32fns.c
index 6313afe7867..34cfb0a2882 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -3706,8 +3706,11 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
However for top/left sizing we will need to fix the X
and Y positions as well. */
- lppos->cx -= wdiff;
- lppos->cy -= hdiff;
+ int cx_mintrack = GetSystemMetrics (SM_CXMINTRACK);
+ int cy_mintrack = GetSystemMetrics (SM_CYMINTRACK);
+
+ lppos->cx = max (lppos->cx - wdiff, cx_mintrack);
+ lppos->cy = max (lppos->cy - hdiff, cy_mintrack);
if (wp.showCmd != SW_SHOWMAXIMIZED
&& (lppos->flags & SWP_NOMOVE) == 0)
@@ -3731,9 +3734,6 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
goto dflt;
case WM_GETMINMAXINFO:
- /* Hack to correct bug that allows Emacs frames to be resized
- below the Minimum Tracking Size. */
- ((LPMINMAXINFO) lParam)->ptMinTrackSize.y++;
/* Hack to allow resizing the Emacs frame above the screen size.
Note that Windows 9x limits coordinates to 16-bits. */
((LPMINMAXINFO) lParam)->ptMaxTrackSize.x = 32767;
@@ -8349,6 +8349,30 @@ is set to off if the low bit of NEW-STATE is zero, otherwise on. */)
}
return Qnil;
}
+
+DEFUN ("w32-window-exists-p", Fw32_window_exists_p, Sw32_window_exists_p,
+ 2, 2, 0,
+ doc: /* Return non-nil if a window exists with the specified CLASS and NAME.
+
+This is a direct interface to the Windows API FindWindow function. */)
+ (class, name)
+Lisp_Object class, name;
+{
+ HWND hnd;
+
+ if (!NILP (class))
+ CHECK_STRING (class);
+ if (!NILP (name))
+ CHECK_STRING (name);
+
+ hnd = FindWindow (STRINGP (class) ? ((LPCTSTR) SDATA (class)) : NULL,
+ STRINGP (name) ? ((LPCTSTR) SDATA (name)) : NULL);
+ if (!hnd)
+ return Qnil;
+ return Qt;
+}
+
+
DEFUN ("file-system-info", Ffile_system_info, Sfile_system_info, 1, 1, 0,
doc: /* Return storage information about the file system FILENAME is on.
@@ -8915,6 +8939,7 @@ versions of Windows) characters. */);
staticpro (&Qw32_charset_unicode);
Qw32_charset_unicode = intern ("w32-charset-unicode");
+ }
#endif
#if 0 /* TODO: Port to W32 */
@@ -8959,6 +8984,7 @@ versions of Windows) characters. */);
defsubr (&Sw32_registered_hot_keys);
defsubr (&Sw32_reconstruct_hot_key);
defsubr (&Sw32_toggle_lock_key);
+ defsubr (&Sw32_window_exists_p);
defsubr (&Sw32_find_bdf_fonts);
defsubr (&Sfile_system_info);
diff --git a/src/w32term.c b/src/w32term.c
index bd3db15e11a..007f9d83afb 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -6517,7 +6517,7 @@ the cursor have no effect. */);
DEFVAR_BOOL ("x-use-underline-position-properties",
&x_use_underline_position_properties,
doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties.
-nil means ignore them. If you encounter fonts with bogus
+A value of nil means ignore them. If you encounter fonts with bogus
UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
to 4.1, set this to nil.
@@ -6527,9 +6527,9 @@ NOTE: Not supported on MS-Windows yet. */);
DEFVAR_BOOL ("x-underline-at-descent-line",
&x_underline_at_descent_line,
doc: /* *Non-nil means to draw the underline at the same place as the descent line.
-nil means to draw the underline according to the value of the variable
-`x-use-underline-position-properties', which is usually at the baseline
-level. The default value is nil. */);
+A value of nil means to draw the underline according to the value of the
+variable `x-use-underline-position-properties', which is usually at the
+baseline level. The default value is nil. */);
x_underline_at_descent_line = 0;
DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
diff --git a/src/window.c b/src/window.c
index 1576ed16c8f..b34cc3659c1 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5729,8 +5729,10 @@ With prefix argument ARG, recenter putting point on screen line ARG
relative to the current window. If ARG is negative, it counts up from the
bottom of the window. (ARG should be less than the height of the window.)
-If ARG is omitted or nil, erase the entire frame and then
-redraw with point in the center of the current window.
+If ARG is omitted or nil, erase the entire frame and then redraw with point
+in the center of the current window. If `auto-resize-tool-bars' is set to
+`grow-only', this resets the tool-bar's height to the minimum height needed.
+
Just C-u as prefix means put point in the center of the window
and redisplay normally--don't erase and redraw the frame. */)
(arg)
@@ -5755,8 +5757,10 @@ and redisplay normally--don't erase and redraw the frame. */)
for (i = 0; i < n_compositions; i++)
composition_table[i]->font = NULL;
- Fredraw_frame (w->frame);
- SET_FRAME_GARBAGED (XFRAME (WINDOW_FRAME (w)));
+ WINDOW_XFRAME (w)->minimize_tool_bar_window_p = 1;
+
+ Fredraw_frame (WINDOW_FRAME (w));
+ SET_FRAME_GARBAGED (WINDOW_XFRAME (w));
center_p = 1;
}
else if (CONSP (arg)) /* Just C-u. */
diff --git a/src/xdisp.c b/src/xdisp.c
index 0928d011a61..a007cd52236 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -283,10 +283,12 @@ Lisp_Object Vtool_bar_button_margin;
EMACS_INT tool_bar_button_relief;
-/* Non-zero means automatically resize tool-bars so that all tool-bar
- items are visible, and no blank lines remain. */
+/* Non-nil means automatically resize tool-bars so that all tool-bar
+ items are visible, and no blank lines remain.
-int auto_resize_tool_bars_p;
+ If value is `grow-only', only make tool-bar bigger. */
+
+Lisp_Object Vauto_resize_tool_bars;
/* Non-zero means draw block and hollow cursor as wide as the glyph
under it. For example, if a block cursor is over a tab, it will be
@@ -9696,9 +9698,16 @@ display_tool_bar_line (it, height)
out:;
row->displays_text_p = row->used[TEXT_AREA] != 0;
- /* Use default face for the border below the tool bar. */
- if (!row->displays_text_p)
+
+ /* Use default face for the border below the tool bar.
+
+ FIXME: When auto-resize-tool-bars is grow-only, there is
+ no additional border below the possibly empty tool-bar lines.
+ So to make the extra empty lines look "normal", we have to
+ use the tool-bar face for the border too. */
+ if (!row->displays_text_p && !EQ (Vauto_resize_tool_bars, Qgrow_only))
it->face_id = DEFAULT_FACE_ID;
+
extend_face_to_end_of_line (it);
last = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA] - 1;
last->right_box_line_p = 1;
@@ -9720,6 +9729,7 @@ display_tool_bar_line (it, height)
if (!row->displays_text_p)
{
row->height = row->phys_height = it->last_visible_y - row->y;
+ row->visible_height = row->height;
row->ascent = row->phys_ascent = 0;
row->extra_line_spacing = 0;
}
@@ -9822,7 +9832,6 @@ redisplay_tool_bar (f)
struct window *w;
struct it it;
struct glyph_row *row;
- int change_height_p = 0;
#ifdef USE_GTK
if (FRAME_EXTERNAL_TOOL_BAR (f))
@@ -9917,10 +9926,10 @@ redisplay_tool_bar (f)
w->desired_matrix->no_scrolling_p = 1;
w->must_be_updated_p = 1;
- if (auto_resize_tool_bars_p)
+ if (!NILP (Vauto_resize_tool_bars))
{
- int nlines, nrows;
int max_tool_bar_height = MAX_FRAME_TOOL_BAR_HEIGHT (f);
+ int change_height_p = 0;
/* If we couldn't display everything, change the tool-bar's
height if there is room for more. */
@@ -9946,29 +9955,40 @@ redisplay_tool_bar (f)
/* Resize windows as needed by changing the `tool-bar-lines'
frame parameter. */
- if (change_height_p
- && (nlines = tool_bar_lines_needed (f, &nrows),
- nlines != WINDOW_TOTAL_LINES (w)))
+ if (change_height_p)
{
extern Lisp_Object Qtool_bar_lines;
Lisp_Object frame;
int old_height = WINDOW_TOTAL_LINES (w);
+ int nrows;
+ int nlines = tool_bar_lines_needed (f, &nrows);
- XSETFRAME (frame, f);
- Fmodify_frame_parameters (frame,
- Fcons (Fcons (Qtool_bar_lines,
- make_number (nlines)),
- Qnil));
- if (WINDOW_TOTAL_LINES (w) != old_height)
+ change_height_p = ((EQ (Vauto_resize_tool_bars, Qgrow_only)
+ && !f->minimize_tool_bar_window_p)
+ ? (nlines > old_height)
+ : (nlines != old_height));
+ f->minimize_tool_bar_window_p = 0;
+
+ if (change_height_p)
{
- clear_glyph_matrix (w->desired_matrix);
- f->n_tool_bar_rows = nrows;
- fonts_changed_p = 1;
+ XSETFRAME (frame, f);
+ Fmodify_frame_parameters (frame,
+ Fcons (Fcons (Qtool_bar_lines,
+ make_number (nlines)),
+ Qnil));
+ if (WINDOW_TOTAL_LINES (w) != old_height)
+ {
+ clear_glyph_matrix (w->desired_matrix);
+ f->n_tool_bar_rows = nrows;
+ fonts_changed_p = 1;
+ return 1;
+ }
}
}
}
- return change_height_p;
+ f->minimize_tool_bar_window_p = 0;
+ return 0;
}
@@ -13458,11 +13478,14 @@ redisplay_window (window, just_this_one_p)
#else
redisplay_tool_bar_p = WINDOWP (f->tool_bar_window)
&& (FRAME_TOOL_BAR_LINES (f) > 0
- || auto_resize_tool_bars_p);
+ || !NILP (Vauto_resize_tool_bars));
#endif
- if (redisplay_tool_bar_p)
- redisplay_tool_bar (f);
+ if (redisplay_tool_bar_p && redisplay_tool_bar (f))
+ {
+ extern int ignore_mouse_drag_p;
+ ignore_mouse_drag_p = 1;
+ }
}
#endif
}
@@ -17270,9 +17293,9 @@ for details) to use.
Optional second arg FACE specifies the face property to put
on all characters for which no face is specified.
-t means whatever face the window's mode line currently uses
+The value t means whatever face the window's mode line currently uses
\(either `mode-line' or `mode-line-inactive', depending).
-nil means the default is no face property.
+A value of nil means the default is no face property.
If FACE is an integer, the value string has no text properties.
Optional third and fourth args WINDOW and BUFFER specify the window
@@ -21871,7 +21894,7 @@ show_mouse_face (dpyinfo, draw)
}
/* Change the mouse cursor. */
- if (draw == DRAW_NORMAL_TEXT)
+ if (draw == DRAW_NORMAL_TEXT && !EQ (dpyinfo->mouse_face_window, f->tool_bar_window))
FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor);
else if (draw == DRAW_MOUSE_FACE)
FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor);
@@ -23993,7 +24016,7 @@ Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */);
truncate_partial_width_windows = 1;
DEFVAR_BOOL ("mode-line-inverse-video", &mode_line_inverse_video,
- doc: /* nil means display the mode-line/header-line/menu-bar in the default face.
+ doc: /* When nil, display the mode-line/header-line/menu-bar in the default face.
Any other value means to use the appropriate face, `mode-line',
`header-line', or `menu' respectively. */);
mode_line_inverse_video = 1;
@@ -24090,12 +24113,13 @@ Autoselection selects the minibuffer only if it is active, and never
unselects the minibuffer if it is active. */);
Vmouse_autoselect_window = Qnil;
- DEFVAR_BOOL ("auto-resize-tool-bars", &auto_resize_tool_bars_p,
+ DEFVAR_LISP ("auto-resize-tool-bars", &Vauto_resize_tool_bars,
doc: /* *Non-nil means automatically resize tool-bars.
-This increases a tool-bar's height if not all tool-bar items are visible.
-It decreases a tool-bar's height when it would display blank lines
-otherwise. */);
- auto_resize_tool_bars_p = 1;
+This dynamically changes the tool-bar's height to the minimum height
+that is needed to make all tool-bar items visible.
+If value is `grow-only', the tool-bar's height is only increased
+automatically; to decreace the tool-bar height, use \\[recenter]. */);
+ Vauto_resize_tool_bars = Qt;
DEFVAR_BOOL ("auto-raise-tool-bar-buttons", &auto_raise_tool_bar_buttons_p,
doc: /* *Non-nil means raise tool-bar buttons when the mouse moves over them. */);
diff --git a/src/xterm.c b/src/xterm.c
index 7bbd2736307..e16fb852873 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8349,15 +8349,15 @@ do_ewmh_fullscreen (f)
Atom *atoms = XListProperties (FRAME_X_DISPLAY (f),
FRAME_X_DISPLAY_INFO (f)->root_window,
&num);
- if (atoms && num > 0)
+ if (atoms && num > 0)
{
char **names = (char **) xmalloc (num * sizeof(*names));
- if (XGetAtomNames (FRAME_X_DISPLAY (f), atoms, num, names))
+ if (XGetAtomNames (FRAME_X_DISPLAY (f), atoms, num, names))
{
int i;
- for (i = 0; i < num; ++i)
+ for (i = 0; i < num; ++i)
{
- if (!have_net_atom)
+ if (!have_net_atom)
have_net_atom = strncmp (names[i], "_NET_", 5) == 0;
XFree (names[i]);
}
@@ -8370,7 +8370,7 @@ do_ewmh_fullscreen (f)
FRAME_X_DISPLAY_INFO (f)->have_net_atoms = have_net_atom;
}
- if (have_net_atom)
+ if (have_net_atom)
{
Lisp_Object frame;
const char *atom = "_NET_WM_STATE";
@@ -8383,7 +8383,7 @@ do_ewmh_fullscreen (f)
/* If there are _NET_ atoms we assume we have extended window manager
hints. */
- switch (f->want_fullscreen)
+ switch (f->want_fullscreen)
{
case FULLSCREEN_BOTH:
what = fs;
@@ -8439,7 +8439,7 @@ static void
XTfullscreen_hook (f)
FRAME_PTR f;
{
- if (f->async_visible)
+ if (f->async_visible)
{
BLOCK_INPUT;
do_ewmh_fullscreen (f);
@@ -8459,7 +8459,7 @@ x_check_fullscreen (f)
{
int width, height, ign;
- if (do_ewmh_fullscreen (f))
+ if (do_ewmh_fullscreen (f))
return;
x_real_positions (f, &f->left_pos, &f->top_pos);
@@ -8793,20 +8793,26 @@ XTframe_raise_lower (f, raise_flag)
{
if (raise_flag)
{
- Lisp_Object frame;
- const char *atom = "_NET_ACTIVE_WINDOW";
+ /* The following code is needed for `raise-frame' to work on
+ some versions of metacity; see Window Manager
+ Specification/Extended Window Manager Hints at
+ http://freedesktop.org/wiki/Standards_2fwm_2dspec
+
+ However, on other versions (metacity 2.17.2-1.fc7), it
+ reportedly causes hangs when resizing frames. */
+
+ /* Lisp_Object frame;
+ const char *atom = "_NET_ACTIVE_WINDOW"; */
x_raise_frame (f);
- /* See Window Manager Specification/Extended Window Manager Hints at
- http://freedesktop.org/wiki/Standards_2fwm_2dspec */
- XSETFRAME (frame, f);
- Fx_send_client_event (frame, make_number (0), frame,
+ /* XSETFRAME (frame, f);
+ Fx_send_client_event (frame, make_number (0), frame,
make_unibyte_string (atom, strlen (atom)),
make_number (32),
Fcons (make_number (1),
Fcons (make_number (time (NULL) * 1000),
- Qnil)));
+ Qnil))); */
}
else
x_lower_frame (f);
@@ -10243,8 +10249,8 @@ x_query_font (f, fontname)
for (i = 0; i < dpyinfo->n_fonts; i++)
if (dpyinfo->font_table[i].name
- && (!strcasecmp (dpyinfo->font_table[i].name, fontname)
- || !strcasecmp (dpyinfo->font_table[i].full_name, fontname)))
+ && (!xstricmp (dpyinfo->font_table[i].name, fontname)
+ || !xstricmp (dpyinfo->font_table[i].full_name, fontname)))
return (dpyinfo->font_table + i);
return NULL;
}
@@ -11272,7 +11278,7 @@ syms_of_xterm ()
DEFVAR_BOOL ("x-use-underline-position-properties",
&x_use_underline_position_properties,
doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties.
-nil means ignore them. If you encounter fonts with bogus
+A value of nil means ignore them. If you encounter fonts with bogus
UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
to 4.1, set this to nil. */);
x_use_underline_position_properties = 1;
@@ -11280,9 +11286,9 @@ to 4.1, set this to nil. */);
DEFVAR_BOOL ("x-underline-at-descent-line",
&x_underline_at_descent_line,
doc: /* *Non-nil means to draw the underline at the same place as the descent line.
-nil means to draw the underline according to the value of the variable
-`x-use-underline-position-properties', which is usually at the baseline
-level. The default value is nil. */);
+A value of nil means to draw the underline according to the value of the
+variable `x-use-underline-position-properties', which is usually at the
+baseline level. The default value is nil. */);
x_underline_at_descent_line = 0;
DEFVAR_BOOL ("x-mouse-click-focus-ignore-position",