aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2005-09-04 03:48:17 +0000
committerKaroly Lorentey2005-09-04 03:48:17 +0000
commitfbf349734468d48b421c3d03074bb66dfcf3115b (patch)
tree0a7d1ee844b6c591a5a499d23e35931945106e5a /src
parentf0caabd962b662cccbea472995d86af718cc8d0b (diff)
parent4b5fa40e1f1ba3cafde672863a0331311d1c2695 (diff)
downloademacs-fbf349734468d48b421c3d03074bb66dfcf3115b.tar.gz
emacs-fbf349734468d48b421c3d03074bb66dfcf3115b.zip
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Patches applied: * lorentey@elte.hu--2004/emacs--cvs-trunk--0--base-0 tag of miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-474 * lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-1 Add CVS metadata files. * lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-2 Update from CVS. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-393
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit10
-rw-r--r--src/ChangeLog589
-rw-r--r--src/Makefile.in4
-rw-r--r--src/abbrev.c4
-rw-r--r--src/alloc.c38
-rw-r--r--src/atimer.c2
-rw-r--r--src/atimer.h2
-rw-r--r--src/blockinput.h3
-rw-r--r--src/buffer.c35
-rw-r--r--src/buffer.h5
-rw-r--r--src/bytecode.c21
-rw-r--r--src/callint.c4
-rw-r--r--src/callproc.c2
-rw-r--r--src/casefiddle.c4
-rw-r--r--src/casetab.c3
-rw-r--r--src/ccl.c11
-rw-r--r--src/charset.c2
-rw-r--r--src/charset.h2
-rw-r--r--src/cm.c3
-rw-r--r--src/cm.h3
-rw-r--r--src/cmds.c4
-rw-r--r--src/coding.c49
-rw-r--r--src/coding.h6
-rw-r--r--src/commands.h3
-rw-r--r--src/composite.c14
-rw-r--r--src/composite.h2
-rw-r--r--src/config.in16
-rw-r--r--src/cxux-crt0.s2
-rw-r--r--src/data.c4
-rw-r--r--src/dired.c50
-rw-r--r--src/dispextern.h4
-rw-r--r--src/dispnew.c109
-rw-r--r--src/disptab.h2
-rw-r--r--src/doc.c4
-rw-r--r--src/doprnt.c2
-rw-r--r--src/dosfns.c4
-rw-r--r--src/dosfns.h4
-rw-r--r--src/ecrt0.c3
-rw-r--r--src/editfns.c5
-rw-r--r--src/emacs.c15
-rw-r--r--src/epaths.in4
-rw-r--r--src/eval.c61
-rw-r--r--src/fileio.c36
-rw-r--r--src/filelock.c4
-rw-r--r--src/filemode.c3
-rw-r--r--src/firstfile.c2
-rw-r--r--src/floatfns.c6
-rw-r--r--src/fns.c19
-rw-r--r--src/fontset.c2
-rw-r--r--src/fontset.h1
-rw-r--r--src/frame.c7
-rw-r--r--src/frame.h11
-rw-r--r--src/fringe.c39
-rw-r--r--src/getloadavg.c4
-rw-r--r--src/getpagesize.h3
-rw-r--r--src/gmalloc.c3
-rw-r--r--src/gtkutil.c132
-rw-r--r--src/gtkutil.h7
-rw-r--r--src/image.c405
-rw-r--r--src/indent.c10
-rw-r--r--src/indent.h3
-rw-r--r--src/insdel.c5
-rw-r--r--src/intervals.c11
-rw-r--r--src/intervals.h3
-rw-r--r--src/keyboard.c16
-rw-r--r--src/keyboard.h3
-rw-r--r--src/keymap.c7
-rw-r--r--src/keymap.h2
-rw-r--r--src/lastfile.c2
-rw-r--r--src/lisp.h13
-rw-r--r--src/lread.c31
-rw-r--r--src/m/7300.h2
-rw-r--r--src/m/acorn.h2
-rw-r--r--src/m/alliant-2800.h2
-rw-r--r--src/m/alliant.h3
-rw-r--r--src/m/alpha.h3
-rw-r--r--src/m/altos.h3
-rw-r--r--src/m/amdahl.h3
-rw-r--r--src/m/amdx86-64.h2
-rw-r--r--src/m/apollo.h3
-rw-r--r--src/m/arm.h2
-rw-r--r--src/m/att3b.h2
-rw-r--r--src/m/aviion.h3
-rw-r--r--src/m/celerity.h3
-rw-r--r--src/m/clipper.h3
-rw-r--r--src/m/cnvrgnt.h2
-rw-r--r--src/m/convex.h3
-rw-r--r--src/m/cydra5.h3
-rw-r--r--src/m/delta88k.h3
-rw-r--r--src/m/dpx2.h3
-rw-r--r--src/m/dual.h3
-rw-r--r--src/m/elxsi.h3
-rw-r--r--src/m/ews4800.h3
-rw-r--r--src/m/gould-np1.h2
-rw-r--r--src/m/hp800.h2
-rw-r--r--src/m/hp9000s300.h2
-rw-r--r--src/m/i860.h3
-rw-r--r--src/m/ia64.h2
-rw-r--r--src/m/ibm370aix.h3
-rw-r--r--src/m/ibmps2-aix.h2
-rw-r--r--src/m/ibmrs6000.h2
-rw-r--r--src/m/ibmrt-aix.h3
-rw-r--r--src/m/ibmrt.h2
-rw-r--r--src/m/ibms390.h3
-rw-r--r--src/m/intel386.h2
-rw-r--r--src/m/iris4d.h2
-rw-r--r--src/m/irist.h3
-rw-r--r--src/m/isi-ov.h3
-rw-r--r--src/m/m68k.h3
-rw-r--r--src/m/macppc.h3
-rw-r--r--src/m/masscomp.h2
-rw-r--r--src/m/mega68.h2
-rw-r--r--src/m/mg1.h2
-rw-r--r--src/m/mips-siemens.h3
-rw-r--r--src/m/mips.h3
-rw-r--r--src/m/news.h3
-rw-r--r--src/m/next.h2
-rw-r--r--src/m/nh3000.h2
-rw-r--r--src/m/nh4000.h2
-rw-r--r--src/m/ns16000.h2
-rw-r--r--src/m/ns32000.h3
-rw-r--r--src/m/nu.h2
-rw-r--r--src/m/orion.h2
-rw-r--r--src/m/orion105.h2
-rw-r--r--src/m/pfa50.h3
-rw-r--r--src/m/plexus.h2
-rw-r--r--src/m/powermac.h2
-rw-r--r--src/m/powerpcle.h2
-rw-r--r--src/m/pyramid.h3
-rw-r--r--src/m/sequent-ptx.h3
-rw-r--r--src/m/sequent.h3
-rw-r--r--src/m/sparc.h2
-rw-r--r--src/m/sps7.h3
-rw-r--r--src/m/sr2k.h2
-rw-r--r--src/m/stride.h3
-rw-r--r--src/m/sun1.h3
-rw-r--r--src/m/sun2.h3
-rw-r--r--src/m/sun386.h2
-rw-r--r--src/m/symmetry.h3
-rw-r--r--src/m/tad68k.h2
-rw-r--r--src/m/tahoe.h2
-rw-r--r--src/m/targon31.h3
-rw-r--r--src/m/tek4300.h2
-rw-r--r--src/m/tekxd88.h2
-rw-r--r--src/m/template.h3
-rw-r--r--src/m/tower32.h2
-rw-r--r--src/m/tower32v3.h2
-rw-r--r--src/m/ustation.h3
-rw-r--r--src/m/vax.h3
-rw-r--r--src/m/wicat.h2
-rw-r--r--src/m/windowsnt.h3
-rw-r--r--src/m/xps100.h3
-rw-r--r--src/mac.c353
-rw-r--r--src/macfns.c327
-rw-r--r--src/macgui.h32
-rw-r--r--src/macmenu.c60
-rw-r--r--src/macros.c3
-rw-r--r--src/macros.h2
-rw-r--r--src/macselect.c16
-rw-r--r--src/macterm.c980
-rw-r--r--src/macterm.h15
-rw-r--r--src/makefile.w32-in3
-rw-r--r--src/marker.c3
-rw-r--r--src/md5.c3
-rw-r--r--src/md5.h3
-rw-r--r--src/mem-limits.h3
-rw-r--r--src/minibuf.c10
-rw-r--r--src/mktime.c3
-rw-r--r--src/msdos.c4
-rw-r--r--src/msdos.h3
-rw-r--r--src/prefix-args.c2
-rw-r--r--src/print.c5
-rw-r--r--src/process.c70
-rw-r--r--src/process.h3
-rw-r--r--src/puresize.h2
-rw-r--r--src/ralloc.c3
-rw-r--r--src/regex.c3
-rw-r--r--src/regex.h3
-rw-r--r--src/region-cache.c4
-rw-r--r--src/region-cache.h3
-rw-r--r--src/s/aix3-1.h3
-rw-r--r--src/s/bsd4-1.h3
-rw-r--r--src/s/bsd4-2.h3
-rw-r--r--src/s/bsd4-3.h3
-rw-r--r--src/s/cxux.h2
-rw-r--r--src/s/cygwin.h5
-rw-r--r--src/s/darwin.h2
-rw-r--r--src/s/dgux.h3
-rw-r--r--src/s/dgux4.h2
-rw-r--r--src/s/dgux5-4-3.h2
-rw-r--r--src/s/dgux5-4r2.h2
-rw-r--r--src/s/freebsd.h4
-rw-r--r--src/s/gnu-linux.h3
-rw-r--r--src/s/gnu.h3
-rw-r--r--src/s/hpux.h3
-rw-r--r--src/s/iris3-5.h3
-rw-r--r--src/s/iris3-6.h3
-rw-r--r--src/s/irix3-3.h3
-rw-r--r--src/s/lynxos.h3
-rw-r--r--src/s/ms-w32.h3
-rw-r--r--src/s/msdos.h3
-rw-r--r--src/s/newsos5.h3
-rw-r--r--src/s/nextstep.h3
-rw-r--r--src/s/ptx.h3
-rw-r--r--src/s/riscix1-1.h2
-rw-r--r--src/s/riscix12.h2
-rw-r--r--src/s/rtu.h3
-rw-r--r--src/s/sco4.h3
-rw-r--r--src/s/sco5.h2
-rw-r--r--src/s/template.h3
-rw-r--r--src/s/umax.h3
-rw-r--r--src/s/unipl5-2.h3
-rw-r--r--src/s/usg5-0.h3
-rw-r--r--src/s/usg5-2-2.h3
-rw-r--r--src/s/usg5-2.h3
-rw-r--r--src/s/usg5-3.h3
-rw-r--r--src/s/usg5-4.h3
-rw-r--r--src/s/vms.h2
-rw-r--r--src/s/xenix.h3
-rw-r--r--src/scroll.c3
-rw-r--r--src/search.c5
-rw-r--r--src/sheap.c3
-rw-r--r--src/sound.c3
-rw-r--r--src/strftime.c4
-rw-r--r--src/sunfns.c3
-rw-r--r--src/syntax.c25
-rw-r--r--src/syntax.h3
-rw-r--r--src/sysdep.c2
-rw-r--r--src/sysselect.h2
-rw-r--r--src/syssignal.h3
-rw-r--r--src/systime.h3
-rw-r--r--src/systty.h3
-rw-r--r--src/syswait.h3
-rw-r--r--src/term.c33
-rw-r--r--src/termcap.c4
-rw-r--r--src/termchar.h3
-rw-r--r--src/termhooks.h5
-rw-r--r--src/terminfo.c3
-rw-r--r--src/termopts.h3
-rw-r--r--src/textprop.c8
-rw-r--r--src/tparam.c3
-rw-r--r--src/uaf.h2
-rw-r--r--src/undo.c4
-rw-r--r--src/unexaix.c3
-rw-r--r--src/unexalpha.c3
-rw-r--r--src/unexapollo.c3
-rw-r--r--src/unexconvex.c3
-rw-r--r--src/unexcw.c3
-rw-r--r--src/unexec.c3
-rw-r--r--src/unexelf.c4
-rw-r--r--src/unexenix.c3
-rw-r--r--src/unexmacosx.c2
-rw-r--r--src/unexmips.c3
-rw-r--r--src/unexnext.c3
-rw-r--r--src/unexsni.c4
-rw-r--r--src/unexsunos4.c3
-rw-r--r--src/unexw32.c2
-rw-r--r--src/vm-limit.c3
-rw-r--r--src/w16select.c3
-rw-r--r--src/w32.c42
-rw-r--r--src/w32.h2
-rw-r--r--src/w32bdf.c2
-rw-r--r--src/w32bdf.h2
-rw-r--r--src/w32console.c3
-rw-r--r--src/w32fns.c16
-rw-r--r--src/w32gui.h2
-rw-r--r--src/w32heap.c2
-rw-r--r--src/w32heap.h2
-rw-r--r--src/w32inevt.c3
-rw-r--r--src/w32inevt.h2
-rw-r--r--src/w32menu.c28
-rw-r--r--src/w32proc.c8
-rw-r--r--src/w32reg.c3
-rw-r--r--src/w32select.c3
-rw-r--r--src/w32term.c20
-rw-r--r--src/w32term.h3
-rw-r--r--src/w32xfns.c3
-rw-r--r--src/widget.c3
-rw-r--r--src/widget.h2
-rw-r--r--src/widgetprv.h2
-rw-r--r--src/window.c54
-rw-r--r--src/window.h4
-rw-r--r--src/xdisp.c154
-rw-r--r--src/xfaces.c36
-rw-r--r--src/xfns.c2
-rw-r--r--src/xmenu.c4
-rw-r--r--src/xrdb.c3
-rw-r--r--src/xselect.c5
-rw-r--r--src/xsmfns.c2
-rw-r--r--src/xterm.c15
-rw-r--r--src/xterm.h4
291 files changed, 3006 insertions, 1751 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index 66b9e64ec7a..462b6a86c5f 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -129,20 +129,24 @@ define pitx
129 end 129 end
130 if ($it->what == IT_CHARACTER) 130 if ($it->what == IT_CHARACTER)
131 if ($it->len == 1 && $it->c >= ' ' && it->c < 255) 131 if ($it->len == 1 && $it->c >= ' ' && it->c < 255)
132 printf "ch='%c'", $it->c 132 printf " ch='%c'", $it->c
133 else 133 else
134 printf "ch=[%d,%d]", $it->c, $it->len 134 printf " ch=[%d,%d]", $it->c, $it->len
135 end 135 end
136 else 136 else
137 if ($it->what == IT_IMAGE) 137 if ($it->what == IT_IMAGE)
138 printf "IMAGE=%d", $it->image_id 138 printf " IMAGE=%d", $it->image_id
139 else 139 else
140 printf " "
140 output $it->what 141 output $it->what
141 end 142 end
142 end 143 end
143 if ($it->method != GET_FROM_BUFFER) 144 if ($it->method != GET_FROM_BUFFER)
144 printf " next=" 145 printf " next="
145 output $it->method 146 output $it->method
147 if ($it->method == GET_FROM_STRING)
148 printf "[%d]", $it->current.string_pos.charpos
149 end
146 end 150 end
147 printf "\n" 151 printf "\n"
148 if ($it->region_beg_charpos >= 0) 152 if ($it->region_beg_charpos >= 0)
diff --git a/src/ChangeLog b/src/ChangeLog
index d70edd2fbf9..09a3ba2d825 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,577 @@
12005-09-01 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * dispnew.c (window_to_frame_hpos, update_window):
4 Avoid gcc warning about unused variable `f'.
5
62005-08-31 Jason Rumney <jasonr@gnu.org>
7
8 * w32menu.c (add_menu_item): If unicode_append_menu returns an
9 error, revert to using AppendMenu.
10
112005-08-31 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12
13 * image.c (PIX_MASK_DRAW, PIX_MASK_RETAIN): Remove argument.
14 All uses changed.
15 [MAC_OS] (XPutPixel, XGetPixel): Add efficient versions for common
16 cases.
17 (x_create_x_image_and_pixmap) [MAC_OS]: Don't call x_destroy_x_image.
18 [MAC_OS] (find_image_fsspec) [!MAC_OSX]: Don't use FSRef.
19 Use posix_pathname_to_fsspec.
20 [MAC_OS] (xpm_load_image): Fill in background_transparent field
21 while we have mask.
22
23 * macgui.h [!TARGET_API_MAC_CARBON] (GetPixDepth): New define.
24
25 * macterm.h (PIX_MASK_DRAW, PIX_MASK_RETAIN): Move defines to image.c.
26
272005-08-29 Stefan Monnier <monnier@iro.umontreal.ca>
28
29 * syntax.c (update_syntax_table): Properly reproduce the special +1
30 setting of e_property at the end of the buffer when bumping into the
31 INTERVALS_AT_ONCE limit.
32
332005-08-27 Eli Zaretskii <eliz@gnu.org>
34
35 * emacs.c (USAGE1): Fix the description of the -Q option.
36
372005-08-26 Stefan Monnier <monnier@iro.umontreal.ca>
38
39 * xdisp.c (pos_visible_p): Yet another int/Lisp_Object mixup (YAILOM).
40
412005-08-26 Kim F. Storm <storm@cua.dk>
42
43 * xdisp.c (resize_mini_window): Fix 2005-08-20 change.
44 Don't move PT to new window start.
45
462005-08-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
47
48 * keyboard.c (kbd_buffer_get_event) [MAC_OS]: Make events for
49 ICONIFY/DEICONIFY_EVENT.
50
51 * macterm.c (mac_copy_area, mac_copy_area_with_mask):
52 Restore background color.
53 (mac_handle_visibility_change): New function.
54 (x_make_frame_invisible, x_iconify_frame)
55 (XTread_socket) [!USE_CARBON_EVENTS]: Use it.
56 [USE_CARBON_EVENTS] (mac_handle_window_event)
57 (install_window_handler): Handle visibility change events.
58 (x_make_frame_visible): Don't reposition window if it is iconified
59 or asked for visible before. Select and uncollapse window when it
60 is made visible.
61 (x_make_frame_invisible): Don't reset x_highlight_frame.
62 (x_iconify_frame): Likewise. Make invisible frame visible before
63 it is iconified.
64 (read_socket_inev): Move variable outside #if USE_CARBON_EVENTS.
65 (do_window_update): Don't change visibility of invisible frame.
66
672005-08-22 Juri Linkov <juri@jurta.org>
68
69 * term.c (turn_on_face): Check for TS_set_foreground and
70 TS_set_background depending on standout_mode. Simplify.
71
722005-08-21 Kim F. Storm <storm@cua.dk>
73
74 * fringe.c (update_window_fringes): Only put TOP and BOTTOM
75 bitmaps on fully visible rows.
76
77 * fringe.c (update_window_fringes): Replace FORCE_P arg with
78 KEEP_CURRENT_P arg; if non-zero, don't update current row fringes,
79 and return 0.
80
81 * xdisp.c (redisplay_window): Call update_window_fringes with
82 KEEP_CURRENT_P non-0 if we are going to refresh fringes later.
83
842005-08-20 Richard M. Stallman <rms@gnu.org>
85
86 * xdisp.c (display_echo_area_1): Get display start pos from w->start.
87 (resize_mini_window): Set w->start, and PT, so as to display the tail
88 end of the buffer, if it doesn't all fit.
89
902005-08-18 Kim F. Storm <storm@cua.dk>
91
92 * xdisp.c (calc_pixel_width_or_height): Use actual display
93 resolution when available instead of Vdisplay_pixels_per_inch.
94
952005-08-17 Kim F. Storm <storm@cua.dk>
96
97 * xdisp.c (pos_visible_p): Adjust X value if window is hscrolled.
98
99 * dispnew.c (buffer_posn_from_coords): Check that target row is
100 within matrix.
101
1022005-08-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
103
104 * xterm.c (x_wm_set_icon_pixmap): Move GTK specific code to
105 xg_set_frame_icon and call it.
106
107 * gtkutil.c (xg_set_frame_icon): New function.
108
109 * gtkutil.h (xg_set_frame_icon): Declare it.
110
1112005-08-16 Kim F. Storm <storm@cua.dk>
112
113 * dispnew.c (increment_row_positions): Skip non-enabled rows.
114
115 * window.c (SAVED_WINDOW_VECTOR_SIZE): Remove dangerous define.
116 (Fcurrent_window_configuration): Use VECSIZE macro instead.
117
1182005-08-15 Richard M. Stallman <rms@gnu.org>
119
120 * xdisp.c (message3_nolog): Clear echo_message_buffer.
121
1222005-08-15 Kim F. Storm <storm@cua.dk>
123
124 * lisp.h (QUIT) [!SYNC_INPUT]: Throw t to Vthrow_on_input.
125
126 * process.c (deactivate_process, status_notify, read_process_output)
127 (update_status, status_convert, decode_status, allocate_pty)
128 (make_process, remove_process, list_processes_1)
129 (create_process_1, unwind_request_sigio, read_process_output)
130 (send_process, keyboard_bit_set): Declare static.
131 (Fdelete_process): Simplify. Pass process to status_notify, so we
132 don't try to read output from it.
133 (status_notify): New arg deleting_process--don't try to read
134 output from that process.
135
136 * lisp.h (deactivate_process, status_notify, read_process_output):
137 Remove prototypes.
138
1392005-08-14 Richard M. Stallman <rms@gnu.org>
140
141 * image.c (syms_of_image): Init Qxbm, Qpbm before calling
142 define_image_type.
143
1442005-08-13 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
145
146 * gtkutil.c (xg_get_pixbuf_from_pix_and_mask): New function.
147 (xg_get_image_for_pixmap): Move some code to
148 xg_get_pixbuf_from_pix_and_mask, and call it.
149
150 * gtkutil.h (xg_get_pixbuf_from_pix_and_mask): Declare.
151
152 * xterm.c (x_wm_set_icon_pixmap): Call xg_get_pixbuf_from_pix_and_mask
153 to get an GTK icon and set it with GTK functions to avoid having GTK
154 override an icon set with just X functions.
155
1562005-08-11 Richard M. Stallman <rms@gnu.org>
157
158 * image.c (syms_of_image): Init image_types here, and call
159 define_image_type.
160 (init_image): Not here.
161
1622005-08-09 Richard M. Stallman <rms@gnu.org>
163
164 * bytecode.c (BYTE_CODE_QUIT): Throw t to Vthrow_on_input.
165
166 * lisp.h (QUIT): Throw t to Vthrow_on_input.
167
1682005-08-09 Thien-Thi Nguyen <ttn@gnu.org>
169
170 * floatfns.c (Fexpt): Use floats for negative exponent.
171
1722005-08-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
173
174 * gtkutil.c (xg_modify_menubar_widgets): Remove semicolon that
175 should not be there, causing menu display errors with GTK 2.6.9.
176
1772005-08-07 Richard M. Stallman <rms@gnu.org>
178
179 * floatfns.c (Fexpt): Undo previous change.
180
181 * dispnew.c (Fframe_or_buffer_changed_p): Take an arg
182 so it can be used with various state vectors.
183
184 * emacs.c (endif): Convert -script into -scriptload.
185 (standard_args): Add -scriptload. Allow -basic-display with one dash.
186
187 * fns.c (syms_of_fns): Add `emacs' to features.
188
189 * term.c (set_terminal_modes): If no TS_termcap_modes string,
190 output newlines to scroll the old screen contents off the screen.
191
1922005-08-06 Thien-Thi Nguyen <ttn@gnu.org>
193
194 * floatfns.c (Fexpt): Use floats for negative exponent.
195 Reported by D Goel.
196
1972005-08-02 Richard M. Stallman <rms@gnu.org>
198
199 * frame.c (Fframe_char_width): Doc fix.
200
2012005-07-30 Juanma Barranquero <lekktu@gmail.com>
202
203 * xdisp.c (syms_of_xdisp) <redisplay-end-trigger-functions>:
204 Defvar it.
205
2062005-07-28 Juanma Barranquero <lekktu@gmail.com>
207
208 * w32fns.c (my_set_window_pos, my_show_window): Don't declare.
209 (my_create_window, my_create_tip_window): Make static.
210
211 * w32term.c (my_show_window, my_set_window_pos, my_set_focus)
212 (my_set_foreground_window, my_destroy_window): Make static.
213
2142005-07-26 Paul Eggert <eggert@cs.ucla.edu>
215
216 Merge gnulib getopt implementation into Emacs.
217
218 * s/cygwin.h (C_SWITCH_SYSTEM): Remove, since gettext.h is
219 now part of lib-src.
220
2212005-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
222
223 * eval.c (Fdefvar): Allow (defvar enable-multibyte-characters).
224
2252005-07-25 Jason Rumney <jasonr@gnu.org>
226
227 * w32menu.c (w32_menu_display_help): Suppress tooltip when
228 navigating menus with the keyboard.
229
2302005-07-23 Richard M. Stallman <rms@gnu.org>
231
232 * insdel.c (syms_of_insdel): staticpro combine_after_change_buffer.
233
234 * bytecode.c (MAYBE_GC): Test gc_cons_threshold and
235 gc_relative_threshold, one by one.
236
237 * keyboard.c (read_char): Test gc_cons_threshold.
238 (syms_of_keyboard): staticpro Qecho_area_clear_hook.
239
240 * eval.c (Feval, Ffuncall): Test gc_cons_threshold and
241 gc_relative_threshold, one by one.
242
243 * alloc.c (gc_cons_threshold): Not static.
244 (gc_cons_combined_threshold): Var deleted.
245 (gc_relative_threshold): New variable.
246 (Fgarbage_collect, init_alloc_once): Compute gc_relative_threshold
247 instead of gc_cons_combined_threshold.
248
249 * lisp.h (gc_cons_threshold, gc_relative_threshold): Declare.
250 (gc_cons_combined_threshold): Declaration deleted.
251
2522005-07-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
253
254 * mac.c: Don't include stdlib.h or string.h.
255 (Fdo_applescript, Fmac_file_name_to_posix)
256 (Fmac_file_name_to_posix): Doc fixes.
257 [TARGET_API_MAC_CARBON] (Fmac_get_preference)
258 (Fmac_code_convert_string): Likewise.
259 [MAC_OSX] (init_mac_osx_environment): Fall back on terminal mode
260 if the executable is not contained in a bundle.
261
262 * macfns.c: Don't include stdlib.h or string.h. Include atimer.h.
263 (gray_width, gray_height): Remove defines.
264 (gray_bits, gray_bitmap_width, gray_bitmap_height)
265 (gray_bitmap_bits): Remove variables.
266 (lispy_function_keys): Remove extern.
267 (free_frame_menubar): Add extern.
268 (x_window_to_frame): Remove function.
269 (unwind_create_tip_frame): Add declaration.
270 (x_set_name_internal): New function.
271 (x_set_name, x_set_title): Use it.
272 (Fx_create_frame, Fx_display_grayscale_p, Fx_display_pixel_width)
273 (Fx_display_pixel_height, Fx_display_planes)
274 (Fx_display_color_cells, Fx_server_max_request_size)
275 (Fx_server_vendor, Fx_server_version, Fx_display_screens)
276 (Fx_display_mm_height, Fx_display_mm_width)
277 (Fx_display_backing_store, Fx_display_visual_class)
278 (Fx_display_save_under, Fx_synchronize, Fx_show_tip): Doc fixes.
279
280 * macmenu.c (Fx_popup_menu, Fx_popup_dialog): Doc fixes.
281
282 * macselect.c (Fx_own_selection_internal): Follow error conventions.
283 (Fx_get_selection_internal, Fx_selection_owner_p)
284 (Fx_selection_exists_p): Doc fixes.
285 (syms_of_macselect) <selection-converter-alist>: Likewise.
286
2872005-07-21 Juanma Barranquero <lekktu@gmail.com>
288
289 * buffer.c (syms_of_buffer) <cursor-type>: Doc fix.
290
291 * ccl.c (Fregister_ccl_program): Fix typos in docstring.
292 (Fccl_execute_on_string): Likewise; add usage info.
293
294 * composite.c (Fcompose_region_internal)
295 (Fcompose_string_internal):
296 Improve argument/docstring consistency.
297
298 * minibuf.c (Fminibuffer_prompt_end, Feval_minibuffer):
299 Fix typos in docstrings.
300
301 * textprop.c (Fnext_char_property_change)
302 (Fprevious_char_property_change): Doc fixes.
303
304 * window.c (Fset_window_margins, Fset_window_fringes):
305 Improve argument/docstring consistency.
306
307 * xfaces.c (Finternal_lisp_face_p): Doc fix.
308
3092005-07-21 Andreas Schwab <schwab@suse.de>
310
311 * eval.c (restore_stack_limits): Return a value.
312
3132005-07-20 Juanma Barranquero <lekktu@gmail.com>
314
315 * eval.c (Fdefvar): Doc fix.
316
3172005-07-20 Kim F. Storm <storm@cua.dk>
318
319 * fileio.c (Fdo_auto_save, do_auto_save_unwind):
320 Use make_save_value to unwind protect stream.
321
322 * lread.c (Fload, load_unwind):
323 Use make_save_value to unwind protect stream.
324
3252005-07-19 Juanma Barranquero <lekktu@gmail.com>
326
327 * eval.c (Fprog2, Fcalled_interactively_p),
328 (syms_of_eval) <debug-on-quit>: Doc fixes.
329 (syms_of_eval) <max-specpdl-size>:
330 (Finteractive_p): Fix typos in docstrings.
331
3322005-07-19 Kim F. Storm <storm@cua.dk>
333
334 * w32fns.c (Vx_hand_shape): Variable removed.
335 (syms_of_w32fns): Intern and staticpro Qw32_charset_default.
336
3372005-07-19 Kenichi Handa <handa@m17n.org>
338
339 * fns.c (Fstring_as_multibyte): Escape backslashes in the docstring.
340
3412005-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
342
343 * buffer.h (Fgenerate_new_buffer_name): Declare (for use in coding.c).
344
3452005-07-18 Kim F. Storm <storm@cua.dk>
346
347 * frame.h (struct frame): New member already_hscrolled_p.
348
349 * xdisp.c (redisplay_internal): Only try to hscroll each frame once
350 to avoid redisplay looping hscrolling back and forth ad infinitum.
351
3522005-07-18 Juri Linkov <juri@jurta.org>
353
354 * buffer.c (scroll-up-aggressively, scroll-down-aggressively):
355 * keymap.c (Fminor_mode_key_binding):
356 * macterm.c (mac-emulate-three-button-mouse):
357 Delete duplicate duplicate words.
358
3592005-07-18 Ken Raeburn <raeburn@gnu.org>
360
361 * minibuf.c (Ftest_completion): Fix odd syntax in test.
362
3632005-07-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
364
365 * macfns.c (x_set_cursor_color): Use XSetBackground and XSetForeground.
366
367 * macgui.h (struct _XGC): New struct.
368 (GC): Use it.
369 (GCForeground, GCBackground, GCFont): Use X11 mask values.
370 (XCreateGC, XParseGeometry): Move externs to macterm.h.
371
372 * macterm.c (x_bitmap_icon, x_make_frame_visible): Remove declarations.
373 (XSetFont): Add declaration.
374 (mac_set_forecolor, mac_set_backcolor, mac_set_colors):
375 Remove functions.
376 (GC_FORE_COLOR, GC_BACK_COLOR, GC_FONT, MAC_WINDOW_NORMAL_GC):
377 New defines.
378 (XDrawLine, mac_draw_line_to_pixmap, XClearWindow)
379 (mac_draw_bitmap, XCreatePixmapFromBitmapData, XFillRectangle)
380 (mac_draw_rectangle, mac_draw_string_common, mac_scroll_area):
381 Use them.
382 (mac_erase_rectangle): New function.
383 (XClearArea, x_draw_fringe_bitmap, x_clear_glyph_string_rect)
384 (x_draw_stretch_glyph_string): Use it.
385 (XChangeGC, XCreateGC, XGetGCValues, XSetForeground)
386 (XSetBackground, XSetFont): Adjust for new GC implementation.
387 (x_draw_fringe_bitmap, x_draw_box_rect): Use GC to set colors.
388 (XTset_vertical_scroll_bar): Clear area under scroll bar.
389
390 * macterm.h (struct mac_display_info): Change types of
391 scratch_cursor_gc black_relief.gc, and white_relief.gc to GC.
392 (XCreateGC, XParseGeometry): Move externs from macgui.h.
393
394 * xfaces.c [MAC_OS] (XCreateGC): Remove extern.
395
3962005-07-16 Richard M. Stallman <rms@gnu.org>
397
398 * buffer.c (Fmake_overlay): Doc fix.
399
4002005-07-16 Eli Zaretskii <eliz@gnu.org>
401
402 * w32proc.c (syms_of_ntproc): staticpro Qhigh, Qlow,
403 Vw32_valid_locale_ids, and Vw32_valid_codepages.
404
4052005-07-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
406
407 * mac.c [TARGET_API_MAC_CARBON] (Fmac_code_convert_string):
408 Use Fstring_as_unibyte instead of string_make_unibyte.
409
4102005-07-15 Richard M. Stallman <rms@gnu.org>
411
412 * xdisp.c (select_frame_for_redisplay): Use find_symbol_value.
413
4142005-07-15 Kim F. Storm <storm@cua.dk>
415
416 * xdisp.c: Fix redisplay loop in last change.
417 (IT_POS_VALID_AFTER_MOVE_P): New macro.
418 (move_it_vertically_backward, move_it_by_lines): Use it.
419
4202005-07-14 Jason Rumney <jasonr@gnu.org>
421
422 * w32.c (init_environment): Default HOME directory to user's
423 appdata directory if possible.
424
4252005-07-14 Kim F. Storm <storm@cua.dk>
426
427 * .gdbinit (pitx): Fix output format. Print string charpos.
428
429 * lread.c (syms_of_lread): Initialize seen_list.
430
431 * search.c (syms_of_search): Staticpro searchbuf.whitespace_regexp.
432
433 * syntax.c (syms_of_syntax): Staticpro lisp objects in gl_state.
434 Staticpro re_match_object.
435
4362005-07-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
437
438 * macselect.c (get_scrap_target_type_list): Avoid NULL pointer
439 dereference.
440
441 * macterm.c (mac_window_to_frame): Remove duplicate define.
442
4432005-07-14 Kenichi Handa <handa@m17n.org>
444
445 * coding.c (code_convert_region_unwind): ARG is changed to a cons.
446 (code_convert_region): Adjust for the above change.
447 (set_conversion_work_buffer): If the work buffer is already in
448 use, generate a new buffer and return it. Otherwise return Qnil.
449 (run_pre_post_conversion_on_str): Adjust for the above change.
450 (run_pre_write_conversin_on_c_str): Likewise.
451
4522005-07-13 Kim F. Storm <storm@cua.dk>
453
454 * xdisp.c (start_display): Don't reseat to next visible line start
455 if current start position is in a string or image.
456 (move_it_vertically_backward): Be sure to move out of strings and
457 images when moving it2 forward.
458 (move_it_by_lines): When moving forward, move to next buffer
459 position if we end up in a string or image. When moving backward,
460 count rows moved over when moving to start of current row in case
461 row starts in middle of a string or image. Also move further
462 backward if we end up in a string or image.
463 (try_cursor_movement): If overlay string spans multiple lines,
464 move backward to set cursor on start of an overlay string.
465 (cursor_row_p): Row is ok if cursor is at newline from string, but
466 string starts on this line (so we always position cursor at start
467 of string).
468
469 * indent.c (Fvertical_motion): If start position is on an image,
470 don't move back if we move too far (that's almost certain to happen).
471
472 * xdisp.c (cursor_row_fully_visible_p): Allow partially visible
473 row in minibuffer windows.
474 (try_window): Don't check margins in minibuffer windows.
475
4762005-07-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
477
478 * macterm.c: Don't include stdlib.h or composite.h.
479 (x_use_underline_position_properties, last_mouse_press_frame)
480 (x_noop_count, Qvendor_specific_keysyms): Remove unused variables.
481 (syms_of_macterm, mac_initialize): Don't initialize them.
482 (waiting_for_input, initial_argv, initial_argc)
483 (Vcommand_line_args, Vx_no_window_manager, errno, window_scroll)
484 (set_frame_menubar, path_from_vol_dir_name): Remove externs.
485 (extra_keyboard_modifiers): Fix type in extern.
486 (x_window_to_frame, x_window_to_scroll_bar): Remove declarations.
487 (x_scroll_bar_report_motion): Add argument types to declaration.
488 (mac_compute_glyph_string_overhangs): Add declaration.
489 (disable_mouse_highlight): Remove unused variable.
490 [USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click)
491 (x_scroll_bar_handle_press, x_scroll_bar_handle_release)
492 (x_scroll_bar_handle_drag): Remove argument `timestamp'.
493 All callers changed.
494 [USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click): Don't set
495 timestamp.
496 [USE_CARBON_EVENTS] (mac_handle_mouse_event): Likewise.
497 (x_scroll_bar_create, XTset_vertical_scroll_bar): Show scroll bar
498 only when its width is less than the height.
499 (XTredeem_scroll_bar): Sync with xterm.c.
500 (font_name_table, font_name_table_size, font_name_count):
501 Make static.
502 (drag_and_drop_file_list): Remove variable. Previous use is now
503 local to function.
504 (do_ae_open_documents): Move DRAG_N_DROP event construction part
505 from XTread_socket.
506 (XTread_socket): Consolidate setting of event timestamp.
507 Move DRAG_N_DROP event construction part to do_ae_open_documents.
508 Support extra_keyboard_modifiers.
509
510 * xfaces.c (try_font_list) [MAC_OS]: Try font family name
511 beginning with that for ASCII.
512
5132005-07-13 Stefan Monnier <monnier@iro.umontreal.ca>
514
515 * alloc.c (gc_cons_combined_threshold, Vgc_cons_percentage): New vars.
516 (Fgarbage_collect, init_alloc_once): Set gc_cons_combined_threshold.
517 (syms_of_alloc): Declare gc-cons-percentage.
518
519 * eval.c (Feval, Ffuncall):
520 * keyboard.c (read_char):
521 * bytecode.c (MAYBE_GC): Use gc_cons_combined_threshold.
522
523 * lisp.h (gc_cons_combined_threshold): Declare.
524
5252005-07-12 Kim F. Storm <storm@cua.dk>
526
527 * coding.c (Qprocess_argument):
528 * coding.h (Qprocess_argument): Remove unused var.
529
530 * xselect.c (intern): Remove dup. intern and staticpro for QTIMESTAMP.
531
5322005-07-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
533
534 * mac.c [!TARGET_API_MAC_CARBON]: Include charset.h, coding.h, and
535 Endian.h.
536 [!MAC_OSX] (fchmod, fchown): New functions.
537 (mac_get_code_from_arg): Don't accept Lisp integer as argument.
538 Use SBYTES and EndianU32_BtoN.
539 (mac_get_object_from_code): Return 4 byte string even if argument
540 is 0. Use make_unibyte_string and EndianU32_NtoB.
541 (Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator)
542 (Fmac_set_file_type): Fix documents and argument declarations.
543 Don't specify kFSCatInfoNodeFlags. Support Mac OS Classic.
544
5452005-07-11 Stefan Monnier <monnier@iro.umontreal.ca>
546
547 * window.c (Frecenter): Yet another int/Lisp_Object mixup (YAILOM).
548
5492005-07-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
550
551 * xfaces.c (x_update_menu_appearance): Use fontSet resource for
552 Lucid if X_I18N, font otherwise.
553
5542005-07-10 Steven Tamm <steventamm@mac.com>
555
556 * mac.c (Fmac_get_file_type, Fmac_get_file_creator): Add.
557 (Fmac_set_file_type, Fmac_set_file_creator): Add.
558 (mac_get_object_from_code, mac_get_code_from_arg): Add.
559
5602005-07-10 Richard M. Stallman <rms@gnu.org>
561
562 * lread.c (Qeval_buffer_list, Veval_buffer_list): New vars.
563 (syms_of_lread): Set up eval-buffer-list.
564 (Feval_buffer, Feval_region): Bind eval-buffer-list.
565
5662005-07-08 Richard M. Stallman <rms@gnu.org>
567
568 * eval.c (Fdefvar): Allow defvaring a constant to itself quoted.
569
5702005-07-08 Kim F. Storm <storm@cua.dk>
571
572 * keyboard.c (menu_bar_items): Don't GCPRO menu_bar_items_vector here.
573 (syms_of_keyboard): Initialize and staticpro menu_bar_items_vector.
574
12005-07-07 Kim F. Storm <storm@cua.dk> 5752005-07-07 Kim F. Storm <storm@cua.dk>
2 576
3 * window.c (Frecenter): Fix last change (set iarg before use). 577 * window.c (Frecenter): Fix last change (set iarg before use).
@@ -11,7 +585,7 @@
11 585
12 * w32console.c (initialize_w32_display): Detect when the console 586 * w32console.c (initialize_w32_display): Detect when the console
13 dimensions are insane, and default to 80x25 instead. 587 dimensions are insane, and default to 80x25 instead.
14 (w32_use_full_screen_buffer): default to NIL. 588 (w32_use_full_screen_buffer): Default to NIL.
15 589
162005-07-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 5902005-07-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17 591
@@ -19,8 +593,8 @@
19 VERTICAL_BORDER_FACE_ID for vertical border line. 593 VERTICAL_BORDER_FACE_ID for vertical border line.
20 (mac_encode_char): Call check_ccl_update in advance. 594 (mac_encode_char): Call check_ccl_update in advance.
21 (mac_to_x_fontname, x_font_name_to_mac_font_name) 595 (mac_to_x_fontname, x_font_name_to_mac_font_name)
22 (init_font_name_table, mac_do_list_fonts, XLoadQueryFont): Don't 596 (init_font_name_table, mac_do_list_fonts, XLoadQueryFont):
23 assume that font family length is less than 32. 597 Don't assume that font family length is less than 32.
24 (x_compute_min_glyph_bounds): Make static. 598 (x_compute_min_glyph_bounds): Make static.
25 (x_load_font): Never set fonts_changed_p to zero. 599 (x_load_font): Never set fonts_changed_p to zero.
26 600
@@ -71,8 +645,7 @@
71 645
722005-07-01 Masatake YAMATO <jet@gyve.org> 6462005-07-01 Masatake YAMATO <jet@gyve.org>
73 647
74 * emacs.c (main): Passing ADD_NO_RANDOMIZE to 648 * emacs.c (main): Passing ADD_NO_RANDOMIZE to `personality'.
75 `personality'.
76 649
772005-06-30 Juri Linkov <juri@jurta.org> 6502005-06-30 Juri Linkov <juri@jurta.org>
78 651
@@ -200,7 +773,7 @@
200 773
2012005-06-22 Miles Bader <miles@gnu.org> 7742005-06-22 Miles Bader <miles@gnu.org>
202 775
203 * xfaces.c (Qvertical_border): Renamed from `Qvertical_divider'. 776 * xfaces.c (Qvertical_border): Rename from `Qvertical_divider'.
204 (realize_basic_faces, syms_of_xfaces): Update references to it. 777 (realize_basic_faces, syms_of_xfaces): Update references to it.
205 * dispextern.h (enum face_id): Rename `VERTICAL_DIVIDER_FACE_ID' 778 * dispextern.h (enum face_id): Rename `VERTICAL_DIVIDER_FACE_ID'
206 to `VERTICAL_BORDER_FACE_ID'. 779 to `VERTICAL_BORDER_FACE_ID'.
@@ -239,8 +812,8 @@
239 812
2402005-06-17 Richard M. Stallman <rms@gnu.org> 8132005-06-17 Richard M. Stallman <rms@gnu.org>
241 814
242 * xdisp.c (get_next_display_element): Reverse 815 * xdisp.c (get_next_display_element):
243 test of Vshow_nonbreak_escape. 816 Reverse test of Vshow_nonbreak_escape.
244 817
245 * term.c (produce_special_glyphs): Use spec_glyph_lookup_face. 818 * term.c (produce_special_glyphs): Use spec_glyph_lookup_face.
246 (Ftty_no_underline): New function. 819 (Ftty_no_underline): New function.
diff --git a/src/Makefile.in b/src/Makefile.in
index d118557db37..2e4b4f6ad76 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for GNU Emacs. 1# Makefile for GNU Emacs.
2# Copyright (C) 1985, 87, 88, 93, 94, 95, 99, 2000, 01, 03, 2004 2# Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
3# Free Software Foundation, Inc. 3# 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5# This file is part of GNU Emacs. 5# This file is part of GNU Emacs.
6 6
diff --git a/src/abbrev.c b/src/abbrev.c
index 8cb87f2c884..84054892910 100644
--- a/src/abbrev.c
+++ b/src/abbrev.c
@@ -1,6 +1,6 @@
1/* Primitives for word-abbrev mode. 1/* Primitives for word-abbrev mode.
2 Copyright (C) 1985, 1986, 1993, 1996, 1998, 2001,02,03,04 2 Copyright (C) 1985, 1986, 1993, 1996, 1998, 2001, 2002, 2003, 2004,
3 Free Software Foundation, Inc. 3 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/alloc.c b/src/alloc.c
index dddfda828e6..3861d87c3d8 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -172,10 +172,16 @@ EMACS_INT misc_objects_consed;
172EMACS_INT intervals_consed; 172EMACS_INT intervals_consed;
173EMACS_INT strings_consed; 173EMACS_INT strings_consed;
174 174
175/* Number of bytes of consing since GC before another GC should be done. */ 175/* Minimum number of bytes of consing since GC before next GC. */
176 176
177EMACS_INT gc_cons_threshold; 177EMACS_INT gc_cons_threshold;
178 178
179/* Similar minimum, computed from Vgc_cons_percentage. */
180
181EMACS_INT gc_relative_threshold;
182
183static Lisp_Object Vgc_cons_percentage;
184
179/* Nonzero during GC. */ 185/* Nonzero during GC. */
180 186
181int gc_in_progress; 187int gc_in_progress;
@@ -4899,6 +4905,24 @@ returns nil, because real GC can't be done. */)
4899 if (gc_cons_threshold < 10000) 4905 if (gc_cons_threshold < 10000)
4900 gc_cons_threshold = 10000; 4906 gc_cons_threshold = 10000;
4901 4907
4908 if (FLOATP (Vgc_cons_percentage))
4909 { /* Set gc_cons_combined_threshold. */
4910 EMACS_INT total = 0;
4911
4912 total += total_conses * sizeof (struct Lisp_Cons);
4913 total += total_symbols * sizeof (struct Lisp_Symbol);
4914 total += total_markers * sizeof (union Lisp_Misc);
4915 total += total_string_size;
4916 total += total_vector_size * sizeof (Lisp_Object);
4917 total += total_floats * sizeof (struct Lisp_Float);
4918 total += total_intervals * sizeof (struct interval);
4919 total += total_strings * sizeof (struct Lisp_String);
4920
4921 gc_relative_threshold = total * XFLOAT_DATA (Vgc_cons_percentage);
4922 }
4923 else
4924 gc_relative_threshold = 0;
4925
4902 if (garbage_collection_messages) 4926 if (garbage_collection_messages)
4903 { 4927 {
4904 if (message_p || minibuf_level > 0) 4928 if (message_p || minibuf_level > 0)
@@ -5988,6 +6012,8 @@ init_alloc_once ()
5988 staticidx = 0; 6012 staticidx = 0;
5989 consing_since_gc = 0; 6013 consing_since_gc = 0;
5990 gc_cons_threshold = 100000 * sizeof (Lisp_Object); 6014 gc_cons_threshold = 100000 * sizeof (Lisp_Object);
6015 gc_relative_threshold = 0;
6016
5991#ifdef VIRT_ADDR_VARIES 6017#ifdef VIRT_ADDR_VARIES
5992 malloc_sbrk_unused = 1<<22; /* A large number */ 6018 malloc_sbrk_unused = 1<<22; /* A large number */
5993 malloc_sbrk_used = 100000; /* as reasonable as any number */ 6019 malloc_sbrk_used = 100000; /* as reasonable as any number */
@@ -6019,7 +6045,15 @@ allocated since the last garbage collection. All data types count.
6019Garbage collection happens automatically only when `eval' is called. 6045Garbage collection happens automatically only when `eval' is called.
6020 6046
6021By binding this temporarily to a large number, you can effectively 6047By binding this temporarily to a large number, you can effectively
6022prevent garbage collection during a part of the program. */); 6048prevent garbage collection during a part of the program.
6049See also `gc-cons-percentage'. */);
6050
6051 DEFVAR_LISP ("gc-cons-percentage", &Vgc_cons_percentage,
6052 doc: /* *Portion of the heap used for allocation.
6053Garbage collection can happen automatically once this portion of the heap
6054has been allocated since the last garbage collection.
6055If this portion is smaller than `gc-cons-threshold', this is ignored. */);
6056 Vgc_cons_percentage = make_float (0.1);
6023 6057
6024 DEFVAR_INT ("pure-bytes-used", &pure_bytes_used, 6058 DEFVAR_INT ("pure-bytes-used", &pure_bytes_used,
6025 doc: /* Number of bytes of sharable Lisp data allocated so far. */); 6059 doc: /* Number of bytes of sharable Lisp data allocated so far. */);
diff --git a/src/atimer.c b/src/atimer.c
index 9ac6d529b99..f8ed1b265ec 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -1,5 +1,5 @@
1/* Asynchronous timers. 1/* Asynchronous timers.
2 Copyright (C) 2000, 2004 Free Software Foundation, Inc. 2 Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/atimer.h b/src/atimer.h
index 5057eb2be24..d5ad9c674d5 100644
--- a/src/atimer.h
+++ b/src/atimer.h
@@ -1,5 +1,5 @@
1/* Asynchronous timers. 1/* Asynchronous timers.
2 Copyright (C) 2000, 2003 Free Software Foundation, Inc. 2 Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/blockinput.h b/src/blockinput.h
index 36559715533..0eaebbe34df 100644
--- a/src/blockinput.h
+++ b/src/blockinput.h
@@ -1,5 +1,6 @@
1/* blockinput.h - interface to blocking complicated interrupt-driven input. 1/* blockinput.h - interface to blocking complicated interrupt-driven input.
2 Copyright (C) 1989, 1993, 2004 Free Software Foundation, Inc. 2 Copyright (C) 1989, 1993, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/buffer.c b/src/buffer.c
index 43727ce7b9d..30626f11a24 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1,6 +1,7 @@
1/* Buffer manipulation primitives for GNU Emacs. 1/* Buffer manipulation primitives for GNU Emacs.
2 Copyright (C) 1985, 86, 87, 88, 89, 93, 94, 95, 97, 98, 99, 2 Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994,
3 2000, 01, 02, 03, 04, 2005 Free Software Foundation, Inc. 3 1995, 1997, 1998, 1999, 2000, 2001, 2002,
4 2003, 2004, 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -3557,10 +3558,12 @@ DEFUN ("make-overlay", Fmake_overlay, Smake_overlay, 2, 5, 0,
3557 doc: /* Create a new overlay with range BEG to END in BUFFER. 3558 doc: /* Create a new overlay with range BEG to END in BUFFER.
3558If omitted, BUFFER defaults to the current buffer. 3559If omitted, BUFFER defaults to the current buffer.
3559BEG and END may be integers or markers. 3560BEG and END may be integers or markers.
3560The fourth arg FRONT-ADVANCE, if non-nil, makes the 3561The fourth arg FRONT-ADVANCE, if non-nil, makes the marker
3561front delimiter advance when text is inserted there. 3562for the front of the overlay advance when text is inserted there
3562The fifth arg REAR-ADVANCE, if non-nil, makes the 3563(which means the text *is not* included in the overlay).
3563rear delimiter advance when text is inserted there. */) 3564The fifth arg REAR-ADVANCE, if non-nil, makes the marker
3565for the rear of the overlay advance when text is inserted there
3566(which means the text *is* included in the overlay). */)
3564 (beg, end, buffer, front_advance, rear_advance) 3567 (beg, end, buffer, front_advance, rear_advance)
3565 Lisp_Object beg, end, buffer; 3568 Lisp_Object beg, end, buffer;
3566 Lisp_Object front_advance, rear_advance; 3569 Lisp_Object front_advance, rear_advance;
@@ -5727,7 +5730,7 @@ that fraction of the window's height from the bottom of the window.
5727When the value is 0.0, point goes at the bottom line, which in the simple 5730When the value is 0.0, point goes at the bottom line, which in the simple
5728case that you moved off with C-f means scrolling just one line. 1.0 means 5731case that you moved off with C-f means scrolling just one line. 1.0 means
5729point goes at the top, so that in that simple case, the window 5732point goes at the top, so that in that simple case, the window
5730window scrolls by a full window height. Meaningful values are 5733scrolls by a full window height. Meaningful values are
5731between 0.0 and 1.0, inclusive. */); 5734between 0.0 and 1.0, inclusive. */);
5732 5735
5733 DEFVAR_PER_BUFFER ("scroll-down-aggressively", 5736 DEFVAR_PER_BUFFER ("scroll-down-aggressively",
@@ -5740,7 +5743,7 @@ that fraction of the window's height from the top of the window.
5740When the value is 0.0, point goes at the top line, which in the simple 5743When the value is 0.0, point goes at the top line, which in the simple
5741case that you moved off with C-b means scrolling just one line. 1.0 means 5744case that you moved off with C-b means scrolling just one line. 1.0 means
5742point goes at the bottom, so that in that simple case, the window 5745point goes at the bottom, so that in that simple case, the window
5743window scrolls by a full window height. Meaningful values are 5746scrolls by a full window height. Meaningful values are
5744between 0.0 and 1.0, inclusive. */); 5747between 0.0 and 1.0, inclusive. */);
5745 5748
5746/*DEFVAR_LISP ("debug-check-symbol", &Vcheck_symbol, 5749/*DEFVAR_LISP ("debug-check-symbol", &Vcheck_symbol,
@@ -5928,15 +5931,15 @@ is a member of the list. */);
5928 doc: /* Cursor to use when this buffer is in the selected window. 5931 doc: /* Cursor to use when this buffer is in the selected window.
5929Values are interpreted as follows: 5932Values are interpreted as follows:
5930 5933
5931 t use the cursor specified for the frame 5934 t use the cursor specified for the frame
5932 nil don't display a cursor 5935 nil don't display a cursor
5933 box display a filled box cursor 5936 box display a filled box cursor
5934 hollow display a hollow box cursor 5937 hollow display a hollow box cursor
5935 bar display a vertical bar cursor with default width 5938 bar display a vertical bar cursor with default width
5936 (bar . WIDTH) display a vertical bar cursor with width WIDTH 5939 (bar . WIDTH) display a vertical bar cursor with width WIDTH
5937 hbar display a horizontal bar cursor with default height 5940 hbar display a horizontal bar cursor with default height
5938 (hbar . HEIGHT) display a horizontal bar cursor with height HEIGHT 5941 (hbar . HEIGHT) display a horizontal bar cursor with height HEIGHT
5939 ANYTHING ELSE display a hollow box cursor. 5942 ANYTHING ELSE display a hollow box cursor
5940 5943
5941When the buffer is displayed in a nonselected window, 5944When the buffer is displayed in a nonselected window,
5942this variable has no effect; the cursor appears as a hollow box. */); 5945this variable has no effect; the cursor appears as a hollow box. */);
diff --git a/src/buffer.h b/src/buffer.h
index 8d170c87567..2387af65a47 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -1,6 +1,6 @@
1/* Header file for the buffer manipulation primitives. 1/* Header file for the buffer manipulation primitives.
2 Copyright (C) 1985,86,93,94,95,97,98,99,2000,01,03,04 2 Copyright (C) 1985, 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
3 Free Software Foundation, Inc. 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -855,6 +855,7 @@ EXFUN (Fget_file_buffer, 1);
855EXFUN (Fnext_overlay_change, 1); 855EXFUN (Fnext_overlay_change, 1);
856EXFUN (Fdelete_overlay, 1); 856EXFUN (Fdelete_overlay, 1);
857EXFUN (Fbuffer_local_value, 2); 857EXFUN (Fbuffer_local_value, 2);
858EXFUN (Fgenerate_new_buffer_name, 2);
858 859
859/* Functions to call before and after each text change. */ 860/* Functions to call before and after each text change. */
860extern Lisp_Object Vbefore_change_functions; 861extern Lisp_Object Vbefore_change_functions;
diff --git a/src/bytecode.c b/src/bytecode.c
index 73b8f60a1a8..e5a3e7b2a7c 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1,6 +1,6 @@
1/* Execution of byte code produced by bytecomp.el. 1/* Execution of byte code produced by bytecomp.el.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 2000, 2001, 2002, 2003, 2004 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 2000, 2001, 2002, 2003, 2004,
3 Free Software Foundation, Inc. 3 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -355,13 +355,14 @@ unmark_byte_stack ()
355/* Garbage collect if we have consed enough since the last time. 355/* Garbage collect if we have consed enough since the last time.
356 We do this at every branch, to avoid loops that never GC. */ 356 We do this at every branch, to avoid loops that never GC. */
357 357
358#define MAYBE_GC() \ 358#define MAYBE_GC() \
359 if (consing_since_gc > gc_cons_threshold) \ 359 if (consing_since_gc > gc_cons_threshold \
360 { \ 360 && consing_since_gc > gc_relative_threshold) \
361 BEFORE_POTENTIAL_GC (); \ 361 { \
362 Fgarbage_collect (); \ 362 BEFORE_POTENTIAL_GC (); \
363 AFTER_POTENTIAL_GC (); \ 363 Fgarbage_collect (); \
364 } \ 364 AFTER_POTENTIAL_GC (); \
365 } \
365 else 366 else
366 367
367/* Check for jumping out of range. */ 368/* Check for jumping out of range. */
@@ -388,7 +389,7 @@ unmark_byte_stack ()
388 Vquit_flag = Qnil; \ 389 Vquit_flag = Qnil; \
389 BEFORE_POTENTIAL_GC (); \ 390 BEFORE_POTENTIAL_GC (); \
390 if (EQ (Vthrow_on_input, flag)) \ 391 if (EQ (Vthrow_on_input, flag)) \
391 Fthrow (Vthrow_on_input, Qnil); \ 392 Fthrow (Vthrow_on_input, Qt); \
392 Fsignal (Qquit, Qnil); \ 393 Fsignal (Qquit, Qnil); \
393 AFTER_POTENTIAL_GC (); \ 394 AFTER_POTENTIAL_GC (); \
394 } \ 395 } \
diff --git a/src/callint.c b/src/callint.c
index 10db39ddce4..5979e495ac3 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -1,6 +1,6 @@
1/* Call a Lisp function interactively. 1/* Call a Lisp function interactively.
2 Copyright (C) 1985, 86, 93, 94, 95, 1997, 2000, 02, 03, 2004 2 Copyright (C) 1985, 1986, 1993, 1994, 1995, 1997, 2000, 2002, 2003,
3 Free Software Foundation, Inc. 3 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/callproc.c b/src/callproc.c
index b78fae1d075..47930819c07 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -1,6 +1,6 @@
1/* Synchronous subprocess invocation for GNU Emacs. 1/* Synchronous subprocess invocation for GNU Emacs.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001,
3 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/casefiddle.c b/src/casefiddle.c
index b063ef7510a..454d184b99b 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -1,6 +1,6 @@
1/* GNU Emacs case conversion functions. 1/* GNU Emacs case conversion functions.
2 Copyright (C) 1985,94,97,98,99, 2001, 2002, 2004, 2005 2 Copyright (C) 1985, 1994, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
3 Free Software Foundation, Inc. 3 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/casetab.c b/src/casetab.c
index 448a236f565..874bb7599f0 100644
--- a/src/casetab.c
+++ b/src/casetab.c
@@ -1,5 +1,6 @@
1/* GNU Emacs routines to deal with case tables. 1/* GNU Emacs routines to deal with case tables.
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1994, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/ccl.c b/src/ccl.c
index b6381f7a0cb..562215218bc 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1,7 +1,7 @@
1/* CCL (Code Conversion Language) interpreter. 1/* CCL (Code Conversion Language) interpreter.
2 Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.
3 Copyright (C) 2001, 2002 Free Software Foundation, Inc.
4 Licensed to the Free Software Foundation. 3 Licensed to the Free Software Foundation.
4 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
@@ -2209,7 +2209,7 @@ DEFUN ("ccl-execute-on-string", Fccl_execute_on_string, Sccl_execute_on_string,
2209 3, 5, 0, 2209 3, 5, 0,
2210 doc: /* Execute CCL-PROGRAM with initial STATUS on STRING. 2210 doc: /* Execute CCL-PROGRAM with initial STATUS on STRING.
2211 2211
2212CCL-PROGRAM is a symbol registered by register-ccl-program, 2212CCL-PROGRAM is a symbol registered by `register-ccl-program',
2213or a compiled code generated by `ccl-compile' (for backward compatibility, 2213or a compiled code generated by `ccl-compile' (for backward compatibility,
2214in this case, the execution is slower). 2214in this case, the execution is slower).
2215 2215
@@ -2230,7 +2230,8 @@ It returns the contents of write buffer as a string,
2230If the optional 5th arg UNIBYTE-P is non-nil, the returned string 2230If the optional 5th arg UNIBYTE-P is non-nil, the returned string
2231is a unibyte string. By default it is a multibyte string. 2231is a unibyte string. By default it is a multibyte string.
2232 2232
2233See the documentation of `define-ccl-program' for the detail of CCL program. */) 2233See the documentation of `define-ccl-program' for the detail of CCL program.
2234usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBYTE-P) */)
2234 (ccl_prog, status, str, contin, unibyte_p) 2235 (ccl_prog, status, str, contin, unibyte_p)
2235 Lisp_Object ccl_prog, status, str, contin, unibyte_p; 2236 Lisp_Object ccl_prog, status, str, contin, unibyte_p;
2236{ 2237{
@@ -2297,8 +2298,8 @@ See the documentation of `define-ccl-program' for the detail of CCL program. */
2297 2298
2298DEFUN ("register-ccl-program", Fregister_ccl_program, Sregister_ccl_program, 2299DEFUN ("register-ccl-program", Fregister_ccl_program, Sregister_ccl_program,
2299 2, 2, 0, 2300 2, 2, 0,
2300 doc: /* Register CCL program CCL_PROG as NAME in `ccl-program-table'. 2301 doc: /* Register CCL program CCL-PROG as NAME in `ccl-program-table'.
2301CCL_PROG should be a compiled CCL program (vector), or nil. 2302CCL-PROG should be a compiled CCL program (vector), or nil.
2302If it is nil, just reserve NAME as a CCL program name. 2303If it is nil, just reserve NAME as a CCL program name.
2303Return index number of the registered CCL program. */) 2304Return index number of the registered CCL program. */)
2304 (name, ccl_prog) 2305 (name, ccl_prog)
diff --git a/src/charset.c b/src/charset.c
index e7b6897ea98..3676c9b8a71 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1,7 +1,7 @@
1/* Basic multilingual character support. 1/* Basic multilingual character support.
2 Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation. 3 Licensed to the Free Software Foundation.
4 Copyright (C) 2001, 2004 Free Software Foundation, Inc. 4 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
diff --git a/src/charset.h b/src/charset.h
index 43791baf0c5..a5cdca21bbb 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -1,7 +1,7 @@
1/* Header for multibyte character handler. 1/* Header for multibyte character handler.
2 Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation. 3 Licensed to the Free Software Foundation.
4 Copyright (C) 2001 Free Software Foundation, Inc. 4 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
diff --git a/src/cm.c b/src/cm.c
index 16df7273149..0044063dabb 100644
--- a/src/cm.c
+++ b/src/cm.c
@@ -1,5 +1,6 @@
1/* Cursor motion subroutines for GNU Emacs. 1/* Cursor motion subroutines for GNU Emacs.
2 Copyright (C) 1985, 1995 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1995, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 based primarily on public domain code written by Chris Torek 4 based primarily on public domain code written by Chris Torek
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/cm.h b/src/cm.h
index 69ddd7f74d1..c2381f3c55e 100644
--- a/src/cm.h
+++ b/src/cm.h
@@ -1,5 +1,6 @@
1/* Cursor motion calculation definitions for GNU Emacs 1/* Cursor motion calculation definitions for GNU Emacs
2 Copyright (C) 1985, 1989 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1989, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/cmds.c b/src/cmds.c
index 7940f3cf216..cc5bd90cca7 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -1,6 +1,6 @@
1/* Simple built-in editing commands. 1/* Simple built-in editing commands.
2 Copyright (C) 1985, 93, 94, 95, 96, 97, 1998, 2001, 02, 03 2 Copyright (C) 1985, 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002,
3 Free Software Foundation, Inc. 3 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/coding.c b/src/coding.c
index 808f1e7d9c2..9d2d04af6cb 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1,7 +1,7 @@
1/* Coding system handler (conversion, detection, and etc). 1/* Coding system handler (conversion, detection, and etc).
2 Copyright (C) 1995,97,1998,2002,2003 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1995,97,1998,2002,2003 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation. 3 Licensed to the Free Software Foundation.
4 Copyright (C) 2001,2002,2003 Free Software Foundation, Inc. 4 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
@@ -365,7 +365,7 @@ Lisp_Object Qsafe_chars;
365Lisp_Object Qvalid_codes; 365Lisp_Object Qvalid_codes;
366 366
367extern Lisp_Object Qinsert_file_contents, Qwrite_region; 367extern Lisp_Object Qinsert_file_contents, Qwrite_region;
368Lisp_Object Qcall_process, Qcall_process_region, Qprocess_argument; 368Lisp_Object Qcall_process, Qcall_process_region;
369Lisp_Object Qstart_process, Qopen_network_stream; 369Lisp_Object Qstart_process, Qopen_network_stream;
370Lisp_Object Qtarget_idx; 370Lisp_Object Qtarget_idx;
371 371
@@ -5349,12 +5349,17 @@ static int shrink_conversion_region_threshhold = 1024;
5349 } \ 5349 } \
5350 } while (0) 5350 } while (0)
5351 5351
5352/* ARG is (CODING . BUFFER) where CODING is what to be set in
5353 Vlast_coding_system_used and BUFFER if non-nil is a buffer to
5354 kill. */
5352static Lisp_Object 5355static Lisp_Object
5353code_convert_region_unwind (arg) 5356code_convert_region_unwind (arg)
5354 Lisp_Object arg; 5357 Lisp_Object arg;
5355{ 5358{
5356 inhibit_pre_post_conversion = 0; 5359 inhibit_pre_post_conversion = 0;
5357 Vlast_coding_system_used = arg; 5360 Vlast_coding_system_used = XCAR (arg);
5361 if (! NILP (XCDR (arg)))
5362 Fkill_buffer (XCDR (arg));
5358 return Qnil; 5363 return Qnil;
5359} 5364}
5360 5365
@@ -5607,7 +5612,7 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace)
5607 Lisp_Object new; 5612 Lisp_Object new;
5608 5613
5609 record_unwind_protect (code_convert_region_unwind, 5614 record_unwind_protect (code_convert_region_unwind,
5610 Vlast_coding_system_used); 5615 Fcons (Vlast_coding_system_used, Qnil));
5611 /* We should not call any more pre-write/post-read-conversion 5616 /* We should not call any more pre-write/post-read-conversion
5612 functions while this pre-write-conversion is running. */ 5617 functions while this pre-write-conversion is running. */
5613 inhibit_pre_post_conversion = 1; 5618 inhibit_pre_post_conversion = 1;
@@ -5975,7 +5980,7 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace)
5975 TEMP_SET_PT_BOTH (from, from_byte); 5980 TEMP_SET_PT_BOTH (from, from_byte);
5976 prev_Z = Z; 5981 prev_Z = Z;
5977 record_unwind_protect (code_convert_region_unwind, 5982 record_unwind_protect (code_convert_region_unwind,
5978 Vlast_coding_system_used); 5983 Fcons (Vlast_coding_system_used, Qnil));
5979 saved_coding_system = Vlast_coding_system_used; 5984 saved_coding_system = Vlast_coding_system_used;
5980 Vlast_coding_system_used = coding->symbol; 5985 Vlast_coding_system_used = coding->symbol;
5981 /* We should not call any more pre-write/post-read-conversion 5986 /* We should not call any more pre-write/post-read-conversion
@@ -6021,17 +6026,31 @@ static Lisp_Object Vcode_conversion_workbuf_name;
6021 6026
6022/* Set the current buffer to the working buffer prepared for 6027/* Set the current buffer to the working buffer prepared for
6023 code-conversion. MULTIBYTE specifies the multibyteness of the 6028 code-conversion. MULTIBYTE specifies the multibyteness of the
6024 buffer. */ 6029 buffer. Return the buffer we set if it must be killed after use.
6030 Otherwise return Qnil. */
6025 6031
6026static struct buffer * 6032static Lisp_Object
6027set_conversion_work_buffer (multibyte) 6033set_conversion_work_buffer (multibyte)
6028 int multibyte; 6034 int multibyte;
6029{ 6035{
6030 Lisp_Object buffer; 6036 Lisp_Object buffer, buffer_to_kill;
6031 struct buffer *buf; 6037 struct buffer *buf;
6032 6038
6033 buffer = Fget_buffer_create (Vcode_conversion_workbuf_name); 6039 buffer = Fget_buffer_create (Vcode_conversion_workbuf_name);
6034 buf = XBUFFER (buffer); 6040 buf = XBUFFER (buffer);
6041 if (buf == current_buffer)
6042 {
6043 /* As we are already in the work buffer, we must generate a new
6044 buffer for the work. */
6045 Lisp_Object name;
6046
6047 name = Fgenerate_new_buffer_name (Vcode_conversion_workbuf_name, Qnil);
6048 buffer = buffer_to_kill = Fget_buffer_create (name);
6049 buf = XBUFFER (buffer);
6050 }
6051 else
6052 buffer_to_kill = Qnil;
6053
6035 delete_all_overlays (buf); 6054 delete_all_overlays (buf);
6036 buf->directory = current_buffer->directory; 6055 buf->directory = current_buffer->directory;
6037 buf->read_only = Qnil; 6056 buf->read_only = Qnil;
@@ -6044,7 +6063,7 @@ set_conversion_work_buffer (multibyte)
6044 Fwiden (); 6063 Fwiden ();
6045 del_range_2 (BEG, BEG_BYTE, Z, Z_BYTE, 0); 6064 del_range_2 (BEG, BEG_BYTE, Z, Z_BYTE, 0);
6046 buf->enable_multibyte_characters = multibyte ? Qt : Qnil; 6065 buf->enable_multibyte_characters = multibyte ? Qt : Qnil;
6047 return buf; 6066 return buffer_to_kill;
6048} 6067}
6049 6068
6050Lisp_Object 6069Lisp_Object
@@ -6057,10 +6076,9 @@ run_pre_post_conversion_on_str (str, coding, encodep)
6057 struct gcpro gcpro1, gcpro2; 6076 struct gcpro gcpro1, gcpro2;
6058 int multibyte = STRING_MULTIBYTE (str); 6077 int multibyte = STRING_MULTIBYTE (str);
6059 Lisp_Object old_deactivate_mark; 6078 Lisp_Object old_deactivate_mark;
6079 Lisp_Object buffer_to_kill;
6060 6080
6061 record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); 6081 record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
6062 record_unwind_protect (code_convert_region_unwind,
6063 Vlast_coding_system_used);
6064 /* It is not crucial to specbind this. */ 6082 /* It is not crucial to specbind this. */
6065 old_deactivate_mark = Vdeactivate_mark; 6083 old_deactivate_mark = Vdeactivate_mark;
6066 GCPRO2 (str, old_deactivate_mark); 6084 GCPRO2 (str, old_deactivate_mark);
@@ -6068,7 +6086,9 @@ run_pre_post_conversion_on_str (str, coding, encodep)
6068 /* We must insert the contents of STR as is without 6086 /* We must insert the contents of STR as is without
6069 unibyte<->multibyte conversion. For that, we adjust the 6087 unibyte<->multibyte conversion. For that, we adjust the
6070 multibyteness of the working buffer to that of STR. */ 6088 multibyteness of the working buffer to that of STR. */
6071 set_conversion_work_buffer (multibyte); 6089 buffer_to_kill = set_conversion_work_buffer (multibyte);
6090 record_unwind_protect (code_convert_region_unwind,
6091 Fcons (Vlast_coding_system_used, buffer_to_kill));
6072 6092
6073 insert_from_string (str, 0, 0, 6093 insert_from_string (str, 0, 0,
6074 SCHARS (str), SBYTES (str), 0); 6094 SCHARS (str), SBYTES (str), 0);
@@ -6111,6 +6131,7 @@ run_pre_write_conversin_on_c_str (str, size, nchars, nbytes, coding)
6111 struct buffer *cur = current_buffer; 6131 struct buffer *cur = current_buffer;
6112 Lisp_Object old_deactivate_mark, old_last_coding_system_used; 6132 Lisp_Object old_deactivate_mark, old_last_coding_system_used;
6113 Lisp_Object args[3]; 6133 Lisp_Object args[3];
6134 Lisp_Object buffer_to_kill;
6114 6135
6115 /* It is not crucial to specbind this. */ 6136 /* It is not crucial to specbind this. */
6116 old_deactivate_mark = Vdeactivate_mark; 6137 old_deactivate_mark = Vdeactivate_mark;
@@ -6120,7 +6141,7 @@ run_pre_write_conversin_on_c_str (str, size, nchars, nbytes, coding)
6120 /* We must insert the contents of STR as is without 6141 /* We must insert the contents of STR as is without
6121 unibyte<->multibyte conversion. For that, we adjust the 6142 unibyte<->multibyte conversion. For that, we adjust the
6122 multibyteness of the working buffer to that of STR. */ 6143 multibyteness of the working buffer to that of STR. */
6123 set_conversion_work_buffer (coding->src_multibyte); 6144 buffer_to_kill = set_conversion_work_buffer (coding->src_multibyte);
6124 insert_1_both (*str, nchars, nbytes, 0, 0, 0); 6145 insert_1_both (*str, nchars, nbytes, 0, 0, 0);
6125 UNGCPRO; 6146 UNGCPRO;
6126 inhibit_pre_post_conversion = 1; 6147 inhibit_pre_post_conversion = 1;
@@ -6144,6 +6165,8 @@ run_pre_write_conversin_on_c_str (str, size, nchars, nbytes, coding)
6144 coding->src_multibyte 6165 coding->src_multibyte
6145 = ! NILP (current_buffer->enable_multibyte_characters); 6166 = ! NILP (current_buffer->enable_multibyte_characters);
6146 set_buffer_internal (cur); 6167 set_buffer_internal (cur);
6168 if (! NILP (buffer_to_kill))
6169 Fkill_buffer (buffer_to_kill);
6147} 6170}
6148 6171
6149 6172
diff --git a/src/coding.h b/src/coding.h
index 4081b7f2028..158ebbf289f 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -1,7 +1,7 @@
1/* Header for coding system handler. 1/* Header for coding system handler.
2 Copyright (C) 2004, 2005 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.
4 Licensed to the Free Software Foundation. 3 Licensed to the Free Software Foundation.
4 Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
@@ -628,7 +628,7 @@ extern int code_convert_region P_ ((int, int, int, int, struct coding_system *,
628extern Lisp_Object run_pre_post_conversion_on_str P_ ((Lisp_Object, 628extern Lisp_Object run_pre_post_conversion_on_str P_ ((Lisp_Object,
629 struct coding_system *, 629 struct coding_system *,
630 int)); 630 int));
631extern void run_pre_write_conversin_on_c_str P_ ((unsigned char **, int *, 631extern void run_pre_write_conversin_on_c_str P_ ((unsigned char **, int *,
632 int, int, 632 int, int,
633 struct coding_system *)); 633 struct coding_system *));
634 634
@@ -666,7 +666,7 @@ extern Lisp_Object eol_mnemonic_undecided;
666 666
667#ifdef emacs 667#ifdef emacs
668extern Lisp_Object Qfile_coding_system; 668extern Lisp_Object Qfile_coding_system;
669extern Lisp_Object Qcall_process, Qcall_process_region, Qprocess_argument; 669extern Lisp_Object Qcall_process, Qcall_process_region;
670extern Lisp_Object Qstart_process, Qopen_network_stream; 670extern Lisp_Object Qstart_process, Qopen_network_stream;
671extern Lisp_Object Qwrite_region; 671extern Lisp_Object Qwrite_region;
672 672
diff --git a/src/commands.h b/src/commands.h
index 9486467e2fe..7ad593577ad 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -1,5 +1,6 @@
1/* Definitions needed by most editing commands. 1/* Definitions needed by most editing commands.
2 Copyright (C) 1985, 1994 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1994, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/composite.c b/src/composite.c
index dffac5c01f9..daa6dceb3c6 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1,7 +1,7 @@
1/* Composite sequence support. 1/* Composite sequence support.
2 Copyright (C) 1999 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1999 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation. 3 Licensed to the Free Software Foundation.
4 Copyright (C) 2001 Free Software Foundation, Inc. 4 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
@@ -716,8 +716,8 @@ DEFUN ("compose-region-internal", Fcompose_region_internal,
716Compose text in the region between START and END. 716Compose text in the region between START and END.
717Optional 3rd and 4th arguments are COMPONENTS and MODIFICATION-FUNC 717Optional 3rd and 4th arguments are COMPONENTS and MODIFICATION-FUNC
718for the composition. See `compose-region' for more detail. */) 718for the composition. See `compose-region' for more detail. */)
719 (start, end, components, mod_func) 719 (start, end, components, modification_func)
720 Lisp_Object start, end, components, mod_func; 720 Lisp_Object start, end, components, modification_func;
721{ 721{
722 validate_region (&start, &end); 722 validate_region (&start, &end);
723 if (!NILP (components) 723 if (!NILP (components)
@@ -726,7 +726,7 @@ for the composition. See `compose-region' for more detail. */)
726 && !STRINGP (components)) 726 && !STRINGP (components))
727 CHECK_VECTOR (components); 727 CHECK_VECTOR (components);
728 728
729 compose_text (XINT (start), XINT (end), components, mod_func, Qnil); 729 compose_text (XINT (start), XINT (end), components, modification_func, Qnil);
730 return Qnil; 730 return Qnil;
731} 731}
732 732
@@ -737,8 +737,8 @@ DEFUN ("compose-string-internal", Fcompose_string_internal,
737Compose text between indices START and END of STRING. 737Compose text between indices START and END of STRING.
738Optional 4th and 5th arguments are COMPONENTS and MODIFICATION-FUNC 738Optional 4th and 5th arguments are COMPONENTS and MODIFICATION-FUNC
739for the composition. See `compose-string' for more detail. */) 739for the composition. See `compose-string' for more detail. */)
740 (string, start, end, components, mod_func) 740 (string, start, end, components, modification_func)
741 Lisp_Object string, start, end, components, mod_func; 741 Lisp_Object string, start, end, components, modification_func;
742{ 742{
743 CHECK_STRING (string); 743 CHECK_STRING (string);
744 CHECK_NUMBER (start); 744 CHECK_NUMBER (start);
@@ -749,7 +749,7 @@ for the composition. See `compose-string' for more detail. */)
749 || XINT (end) > SCHARS (string)) 749 || XINT (end) > SCHARS (string))
750 args_out_of_range (start, end); 750 args_out_of_range (start, end);
751 751
752 compose_text (XINT (start), XINT (end), components, mod_func, string); 752 compose_text (XINT (start), XINT (end), components, modification_func, string);
753 return string; 753 return string;
754} 754}
755 755
diff --git a/src/composite.h b/src/composite.h
index 9dfe597631e..26cf13d27d4 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -1,7 +1,7 @@
1/* Header for composite sequence handler. 1/* Header for composite sequence handler.
2 Copyright (C) 1999 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1999 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation. 3 Licensed to the Free Software Foundation.
4 Copyright (C) 2001 Free Software Foundation, Inc. 4 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
diff --git a/src/config.in b/src/config.in
index f4ab9fbb3dd..dc2c07667fb 100644
--- a/src/config.in
+++ b/src/config.in
@@ -191,6 +191,12 @@ Boston, MA 02110-1301, USA. */
191/* Define to 1 if you have the `getloadavg' function. */ 191/* Define to 1 if you have the `getloadavg' function. */
192#undef HAVE_GETLOADAVG 192#undef HAVE_GETLOADAVG
193 193
194/* Define to 1 if you have the <getopt.h> header file. */
195#undef HAVE_GETOPT_H
196
197/* Define to 1 if you have the `getopt_long_only' function. */
198#undef HAVE_GETOPT_LONG_ONLY
199
194/* Define to 1 if you have the `getpagesize' function. */ 200/* Define to 1 if you have the `getpagesize' function. */
195#undef HAVE_GETPAGESIZE 201#undef HAVE_GETPAGESIZE
196 202
@@ -785,9 +791,9 @@ Boston, MA 02110-1301, USA. */
785/* If using the C implementation of alloca, define if you know the 791/* If using the C implementation of alloca, define if you know the
786 direction of stack growth for your system; otherwise it will be 792 direction of stack growth for your system; otherwise it will be
787 automatically deduced at run-time. 793 automatically deduced at run-time.
788 STACK_DIRECTION > 0 => grows toward higher addresses 794 STACK_DIRECTION > 0 => grows toward higher addresses
789 STACK_DIRECTION < 0 => grows toward lower addresses 795 STACK_DIRECTION < 0 => grows toward lower addresses
790 STACK_DIRECTION = 0 => direction of growth unknown */ 796 STACK_DIRECTION = 0 => direction of growth unknown */
791#undef STACK_DIRECTION 797#undef STACK_DIRECTION
792 798
793/* Define to 1 if you have the ANSI C header files. */ 799/* Define to 1 if you have the ANSI C header files. */
@@ -846,6 +852,10 @@ Boston, MA 02110-1301, USA. */
846/* Define for large files, on AIX-style hosts. */ 852/* Define for large files, on AIX-style hosts. */
847#undef _LARGE_FILES 853#undef _LARGE_FILES
848 854
855/* Define to rpl_ if the getopt replacement functions and variables should be
856 used. */
857#undef __GETOPT_PREFIX
858
849/* Define like PROTOTYPES; this can be used by system headers. */ 859/* Define like PROTOTYPES; this can be used by system headers. */
850#undef __PROTOTYPES 860#undef __PROTOTYPES
851 861
diff --git a/src/cxux-crt0.s b/src/cxux-crt0.s
index 615837eaeb4..71076eb8b5f 100644
--- a/src/cxux-crt0.s
+++ b/src/cxux-crt0.s
@@ -1,6 +1,6 @@
1/* 1/*
2 * External symbol setup file for GNU Emacs on CX/UX 2 * External symbol setup file for GNU Emacs on CX/UX
3 * Copyright (C) 1990 Free Software Foundation, Inc. 3 * Copyright (C) 1990, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of GNU Emacs. 5 * This file is part of GNU Emacs.
6 * 6 *
diff --git a/src/data.c b/src/data.c
index 09cb6c8b40a..b187a3e748a 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1,6 +1,6 @@
1/* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter. 1/* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter.
2 Copyright (C) 1985,86,88,93,94,95,97,98,99, 2000, 2001, 03, 2004 2 Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, 2000,
3 Free Software Foundation, Inc. 3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/dired.c b/src/dired.c
index 55f96d28888..927276e15c0 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -1,6 +1,6 @@
1/* Lisp functions for making directory listings. 1/* Lisp functions for making directory listings.
2 Copyright (C) 1985, 1986, 1993, 1994, 1999, 2000, 2001, 2004, 2005 2 Copyright (C) 1985, 1986, 1993, 1994, 1999, 2000, 2001, 2002, 2003,
3 Free Software Foundation, Inc. 3 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -131,7 +131,7 @@ Lisp_Object
131directory_files_internal_unwind (dh) 131directory_files_internal_unwind (dh)
132 Lisp_Object dh; 132 Lisp_Object dh;
133{ 133{
134 DIR *d = (DIR *) ((XINT (XCAR (dh)) << 16) + XINT (XCDR (dh))); 134 DIR *d = (DIR *) XSAVE_VALUE (dh)->pointer;
135 closedir (d); 135 closedir (d);
136 return Qnil; 136 return Qnil;
137} 137}
@@ -155,7 +155,6 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format)
155 int count = SPECPDL_INDEX (); 155 int count = SPECPDL_INDEX ();
156 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 156 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
157 DIRENTRY *dp; 157 DIRENTRY *dp;
158 int retry_p;
159 158
160 /* Because of file name handlers, these functions might call 159 /* Because of file name handlers, these functions might call
161 Ffuncall, and cause a GC. */ 160 Ffuncall, and cause a GC. */
@@ -189,12 +188,6 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format)
189 /* Now *bufp is the compiled form of MATCH; don't call anything 188 /* Now *bufp is the compiled form of MATCH; don't call anything
190 which might compile a new regexp until we're done with the loop! */ 189 which might compile a new regexp until we're done with the loop! */
191 190
192 /* Do this opendir after anything which might signal an error; if
193 an error is signaled while the directory stream is open, we
194 have to make sure it gets closed, and setting up an
195 unwind_protect to do so would be a pain. */
196 retry:
197
198 d = opendir (SDATA (dirfilename)); 191 d = opendir (SDATA (dirfilename));
199 if (d == NULL) 192 if (d == NULL)
200 report_file_error ("Opening directory", Fcons (directory, Qnil)); 193 report_file_error ("Opening directory", Fcons (directory, Qnil));
@@ -203,8 +196,7 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format)
203 file-attributes on filenames, both of which can throw, so we must 196 file-attributes on filenames, both of which can throw, so we must
204 do a proper unwind-protect. */ 197 do a proper unwind-protect. */
205 record_unwind_protect (directory_files_internal_unwind, 198 record_unwind_protect (directory_files_internal_unwind,
206 Fcons (make_number (((unsigned long) d) >> 16), 199 make_save_value (d, 0));
207 make_number (((unsigned long) d) & 0xffff)));
208 200
209 directory_nbytes = SBYTES (directory); 201 directory_nbytes = SBYTES (directory);
210 re_match_object = Qt; 202 re_match_object = Qt;
@@ -222,10 +214,15 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format)
222 errno = 0; 214 errno = 0;
223 dp = readdir (d); 215 dp = readdir (d);
224 216
217 if (dp == NULL && (0
225#ifdef EAGAIN 218#ifdef EAGAIN
226 if (dp == NULL && errno == EAGAIN) 219 || errno == EAGAIN
227 continue; 220#endif
221#ifdef EINTR
222 || errno == EINTR
228#endif 223#endif
224 ))
225 { QUIT; continue; }
229 226
230 if (dp == NULL) 227 if (dp == NULL)
231 break; 228 break;
@@ -316,22 +313,11 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format)
316 } 313 }
317 } 314 }
318 315
319 retry_p = 0;
320#ifdef EINTR
321 retry_p |= errno == EINTR;
322#endif
323
324 closedir (d); 316 closedir (d);
325 317
326 /* Discard the unwind protect. */ 318 /* Discard the unwind protect. */
327 specpdl_ptr = specpdl + count; 319 specpdl_ptr = specpdl + count;
328 320
329 if (retry_p)
330 {
331 list = Qnil;
332 goto retry;
333 }
334
335 if (NILP (nosort)) 321 if (NILP (nosort))
336 list = Fsort (Fnreverse (list), 322 list = Fsort (Fnreverse (list),
337 attrs ? Qfile_attributes_lessp : Qstring_lessp); 323 attrs ? Qfile_attributes_lessp : Qstring_lessp);
@@ -519,8 +505,7 @@ file_name_completion (file, dirname, all_flag, ver_flag)
519 report_file_error ("Opening directory", Fcons (dirname, Qnil)); 505 report_file_error ("Opening directory", Fcons (dirname, Qnil));
520 506
521 record_unwind_protect (directory_files_internal_unwind, 507 record_unwind_protect (directory_files_internal_unwind,
522 Fcons (make_number (((unsigned long) d) >> 16), 508 make_save_value (d, 0));
523 make_number (((unsigned long) d) & 0xffff)));
524 509
525 /* Loop reading blocks */ 510 /* Loop reading blocks */
526 /* (att3b compiler bug requires do a null comparison this way) */ 511 /* (att3b compiler bug requires do a null comparison this way) */
@@ -532,8 +517,19 @@ file_name_completion (file, dirname, all_flag, ver_flag)
532#ifdef VMS 517#ifdef VMS
533 dp = (*readfunc) (d); 518 dp = (*readfunc) (d);
534#else 519#else
520 errno = 0;
535 dp = readdir (d); 521 dp = readdir (d);
522 if (dp == NULL && (0
523# ifdef EAGAIN
524 || errno == EAGAIN
525# endif
526# ifdef EINTR
527 || errno == EINTR
528# endif
529 ))
530 { QUIT; continue; }
536#endif 531#endif
532
537 if (!dp) break; 533 if (!dp) break;
538 534
539 len = NAMLEN (dp); 535 len = NAMLEN (dp);
diff --git a/src/dispextern.h b/src/dispextern.h
index ac9c007bc4d..1c802e9e332 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1,6 +1,6 @@
1/* Interface definitions for display code. 1/* Interface definitions for display code.
2 Copyright (C) 1985,93,94,97,98,99, 2000,01,02,03, 2004, 2005 2 Copyright (C) 1985, 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002,
3 Free Software Foundation, Inc. 3 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/dispnew.c b/src/dispnew.c
index 4924ce2217b..2cb661c6ba7 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -1,6 +1,7 @@
1/* Updating of data structures for redisplay. 1/* Updating of data structures for redisplay.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1997, 1998, 1999, 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995,
3 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3 1997, 1998, 1999, 2000, 2001, 2002, 2003,
4 2004, 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -1171,6 +1172,9 @@ increment_row_positions (row, delta, delta_bytes)
1171 MATRIX_ROW_END_CHARPOS (row) += delta; 1172 MATRIX_ROW_END_CHARPOS (row) += delta;
1172 MATRIX_ROW_END_BYTEPOS (row) += delta_bytes; 1173 MATRIX_ROW_END_BYTEPOS (row) += delta_bytes;
1173 1174
1175 if (!row->enabled_p)
1176 return;
1177
1174 /* Increment positions in glyphs. */ 1178 /* Increment positions in glyphs. */
1175 for (area = 0; area < LAST_AREA; ++area) 1179 for (area = 0; area < LAST_AREA; ++area)
1176 for (i = 0; i < row->used[area]; ++i) 1180 for (i = 0; i < row->used[area]; ++i)
@@ -3309,9 +3313,7 @@ window_to_frame_hpos (w, hpos)
3309 struct window *w; 3313 struct window *w;
3310 int hpos; 3314 int hpos;
3311{ 3315{
3312 struct frame *f = XFRAME (w->frame); 3316 xassert (!FRAME_WINDOW_P (XFRAME (w->frame)));
3313
3314 xassert (!FRAME_WINDOW_P (f));
3315 hpos += WINDOW_LEFT_EDGE_COL (w); 3317 hpos += WINDOW_LEFT_EDGE_COL (w);
3316 return hpos; 3318 return hpos;
3317} 3319}
@@ -4099,10 +4101,8 @@ update_window (w, force_p)
4099 extern Lisp_Object do_mouse_tracking; 4101 extern Lisp_Object do_mouse_tracking;
4100 struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); 4102 struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
4101#if GLYPH_DEBUG 4103#if GLYPH_DEBUG
4102 struct frame *f = XFRAME (WINDOW_FRAME (w));
4103
4104 /* Check that W's frame doesn't have glyph matrices. */ 4104 /* Check that W's frame doesn't have glyph matrices. */
4105 xassert (FRAME_WINDOW_P (f)); 4105 xassert (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w))));
4106#endif 4106#endif
4107 4107
4108 /* Check pending input the first time so that we can quickly return. */ 4108 /* Check pending input the first time so that we can quickly return. */
@@ -5806,8 +5806,9 @@ buffer_posn_from_coords (w, x, y, pos, object, dx, dy, width, height)
5806 } 5806 }
5807#endif 5807#endif
5808 5808
5809 row = MATRIX_ROW (w->current_matrix, it.vpos); 5809 if (it.vpos < w->current_matrix->nrows
5810 if (row->enabled_p) 5810 && (row = MATRIX_ROW (w->current_matrix, it.vpos),
5811 row->enabled_p))
5811 { 5812 {
5812 if (it.hpos < row->used[TEXT_AREA]) 5813 if (it.hpos < row->used[TEXT_AREA])
5813 { 5814 {
@@ -6488,68 +6489,106 @@ usage: (sit-for SECONDS &optional NODISP OLD-NODISP) */)
6488 6489
6489/* A vector of size >= 2 * NFRAMES + 3 * NBUFFERS + 1, containing the 6490/* A vector of size >= 2 * NFRAMES + 3 * NBUFFERS + 1, containing the
6490 session's frames, frame names, buffers, buffer-read-only flags, and 6491 session's frames, frame names, buffers, buffer-read-only flags, and
6491 buffer-modified-flags, and a trailing sentinel (so we don't need to 6492 buffer-modified-flags. */
6492 add length checks). */
6493 6493
6494static Lisp_Object frame_and_buffer_state; 6494static Lisp_Object frame_and_buffer_state;
6495 6495
6496 6496
6497DEFUN ("frame-or-buffer-changed-p", Fframe_or_buffer_changed_p, 6497DEFUN ("frame-or-buffer-changed-p", Fframe_or_buffer_changed_p,
6498 Sframe_or_buffer_changed_p, 0, 0, 0, 6498 Sframe_or_buffer_changed_p, 0, 1, 0,
6499 doc: /* Return non-nil if the frame and buffer state appears to have changed. 6499 doc: /* Return non-nil if the frame and buffer state appears to have changed.
6500The state variable is an internal vector containing all frames and buffers, 6500VARIABLE is a variable name whose value is either nil or a state vector
6501that will be updated to contain all frames and buffers,
6501aside from buffers whose names start with space, 6502aside from buffers whose names start with space,
6502along with the buffers' read-only and modified flags, which allows a fast 6503along with the buffers' read-only and modified flags. This allows a fast
6503check to see whether the menu bars might need to be recomputed. 6504check to see whether buffer menus might need to be recomputed.
6504If this function returns non-nil, it updates the internal vector to reflect 6505If this function returns non-nil, it updates the internal vector to reflect
6505the current state. */) 6506the current state.
6506 () 6507
6508If VARIABLE is nil, an internal variable is used. Users should not
6509pass nil for VARIABLE. */)
6510 (variable)
6511 Lisp_Object variable;
6507{ 6512{
6508 Lisp_Object tail, frame, buf; 6513 Lisp_Object state, tail, frame, buf;
6509 Lisp_Object *vecp; 6514 Lisp_Object *vecp, *end;
6510 int n; 6515 int n;
6511 6516
6512 vecp = XVECTOR (frame_and_buffer_state)->contents; 6517 if (! NILP (variable))
6518 {
6519 CHECK_SYMBOL (variable);
6520 state = Fsymbol_value (variable);
6521 if (! VECTORP (state))
6522 goto changed;
6523 }
6524 else
6525 state = frame_and_buffer_state;
6526
6527 vecp = XVECTOR (state)->contents;
6528 end = vecp + XVECTOR (state)->size;
6529
6513 FOR_EACH_FRAME (tail, frame) 6530 FOR_EACH_FRAME (tail, frame)
6514 { 6531 {
6532 if (vecp == end)
6533 goto changed;
6515 if (!EQ (*vecp++, frame)) 6534 if (!EQ (*vecp++, frame))
6516 goto changed; 6535 goto changed;
6536 if (vecp == end)
6537 goto changed;
6517 if (!EQ (*vecp++, XFRAME (frame)->name)) 6538 if (!EQ (*vecp++, XFRAME (frame)->name))
6518 goto changed; 6539 goto changed;
6519 } 6540 }
6520 /* Check that the buffer info matches. 6541 /* Check that the buffer info matches. */
6521 No need to test for the end of the vector
6522 because the last element of the vector is lambda
6523 and that will always cause a mismatch. */
6524 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) 6542 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
6525 { 6543 {
6526 buf = XCDR (XCAR (tail)); 6544 buf = XCDR (XCAR (tail));
6527 /* Ignore buffers that aren't included in buffer lists. */ 6545 /* Ignore buffers that aren't included in buffer lists. */
6528 if (SREF (XBUFFER (buf)->name, 0) == ' ') 6546 if (SREF (XBUFFER (buf)->name, 0) == ' ')
6529 continue; 6547 continue;
6548 if (vecp == end)
6549 goto changed;
6530 if (!EQ (*vecp++, buf)) 6550 if (!EQ (*vecp++, buf))
6531 goto changed; 6551 goto changed;
6552 if (vecp == end)
6553 goto changed;
6532 if (!EQ (*vecp++, XBUFFER (buf)->read_only)) 6554 if (!EQ (*vecp++, XBUFFER (buf)->read_only))
6533 goto changed; 6555 goto changed;
6556 if (vecp == end)
6557 goto changed;
6534 if (!EQ (*vecp++, Fbuffer_modified_p (buf))) 6558 if (!EQ (*vecp++, Fbuffer_modified_p (buf)))
6535 goto changed; 6559 goto changed;
6536 } 6560 }
6561 if (vecp == end)
6562 goto changed;
6537 /* Detect deletion of a buffer at the end of the list. */ 6563 /* Detect deletion of a buffer at the end of the list. */
6538 if (EQ (*vecp, Qlambda)) 6564 if (EQ (*vecp, Qlambda))
6539 return Qnil; 6565 return Qnil;
6566
6567 /* Come here if we decide the data has changed. */
6540 changed: 6568 changed:
6541 /* Start with 1 so there is room for at least one lambda at the end. */ 6569 /* Count the size we will need.
6570 Start with 1 so there is room for at least one lambda at the end. */
6542 n = 1; 6571 n = 1;
6543 FOR_EACH_FRAME (tail, frame) 6572 FOR_EACH_FRAME (tail, frame)
6544 n += 2; 6573 n += 2;
6545 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) 6574 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
6546 n += 3; 6575 n += 3;
6547 /* Reallocate the vector if it's grown, or if it's shrunk a lot. */ 6576 /* Reallocate the vector if data has grown to need it,
6548 if (n > XVECTOR (frame_and_buffer_state)->size 6577 or if it has shrunk a lot. */
6549 || n + 20 < XVECTOR (frame_and_buffer_state)->size / 2) 6578 if (! VECTORP (state)
6579 || n > XVECTOR (state)->size
6580 || n + 20 < XVECTOR (state)->size / 2)
6550 /* Add 20 extra so we grow it less often. */ 6581 /* Add 20 extra so we grow it less often. */
6551 frame_and_buffer_state = Fmake_vector (make_number (n + 20), Qlambda); 6582 {
6552 vecp = XVECTOR (frame_and_buffer_state)->contents; 6583 state = Fmake_vector (make_number (n + 20), Qlambda);
6584 if (! NILP (variable))
6585 Fset (variable, state);
6586 else
6587 frame_and_buffer_state = state;
6588 }
6589
6590 /* Record the new data in the (possibly reallocated) vector. */
6591 vecp = XVECTOR (state)->contents;
6553 FOR_EACH_FRAME (tail, frame) 6592 FOR_EACH_FRAME (tail, frame)
6554 { 6593 {
6555 *vecp++ = frame; 6594 *vecp++ = frame;
@@ -6567,12 +6606,12 @@ the current state. */)
6567 } 6606 }
6568 /* Fill up the vector with lambdas (always at least one). */ 6607 /* Fill up the vector with lambdas (always at least one). */
6569 *vecp++ = Qlambda; 6608 *vecp++ = Qlambda;
6570 while (vecp - XVECTOR (frame_and_buffer_state)->contents 6609 while (vecp - XVECTOR (state)->contents
6571 < XVECTOR (frame_and_buffer_state)->size) 6610 < XVECTOR (state)->size)
6572 *vecp++ = Qlambda; 6611 *vecp++ = Qlambda;
6573 /* Make sure we didn't overflow the vector. */ 6612 /* Make sure we didn't overflow the vector. */
6574 if (vecp - XVECTOR (frame_and_buffer_state)->contents 6613 if (vecp - XVECTOR (state)->contents
6575 > XVECTOR (frame_and_buffer_state)->size) 6614 > XVECTOR (state)->size)
6576 abort (); 6615 abort ();
6577 return Qt; 6616 return Qt;
6578} 6617}
diff --git a/src/disptab.h b/src/disptab.h
index 30b2a7a7486..41f4bcbfdbf 100644
--- a/src/disptab.h
+++ b/src/disptab.h
@@ -1,5 +1,5 @@
1/* Things for GLYPHS and glyph tables. 1/* Things for GLYPHS and glyph tables.
2 Copyright (C) 1993 Free Software Foundation, Inc. 2 Copyright (C) 1993, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/doc.c b/src/doc.c
index 6d8b625affe..6d54aeceacd 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -1,6 +1,6 @@
1/* Record indices of function doc strings stored in a file. 1/* Record indices of function doc strings stored in a file.
2 Copyright (C) 1985, 86,93,94,95,97,98,99,2000,04 2 Copyright (C) 1985, 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
3 Free Software Foundation, Inc. 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/doprnt.c b/src/doprnt.c
index 1cfc5aecee6..5d824038faf 100644
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -1,7 +1,7 @@
1/* Output like sprintf to a buffer of specified size. 1/* Output like sprintf to a buffer of specified size.
2 Also takes args differently: pass one pointer to an array of strings 2 Also takes args differently: pass one pointer to an array of strings
3 in addition to the format string which is separate. 3 in addition to the format string which is separate.
4 Copyright (C) 1985 Free Software Foundation, Inc. 4 Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
diff --git a/src/dosfns.c b/src/dosfns.c
index 6192836e970..c256595cc13 100644
--- a/src/dosfns.c
+++ b/src/dosfns.c
@@ -1,7 +1,7 @@
1/* MS-DOS specific Lisp utilities. Coded by Manabu Higashida, 1991. 1/* MS-DOS specific Lisp utilities. Coded by Manabu Higashida, 1991.
2 Major changes May-July 1993 Morten Welinder (only 10% original code left) 2 Major changes May-July 1993 Morten Welinder (only 10% original code left)
3 Copyright (C) 1991, 1993, 1996, 1997, 1998, 2001 3 Copyright (C) 1991, 1993, 1996, 1997, 1998, 2001, 2002, 2003, 2004,
4 Free Software Foundation, Inc. 4 2005 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
diff --git a/src/dosfns.h b/src/dosfns.h
index 594c3d980c6..40aaf524e23 100644
--- a/src/dosfns.h
+++ b/src/dosfns.h
@@ -2,8 +2,8 @@
2 Coded by Manabu Higashida, 1991. 2 Coded by Manabu Higashida, 1991.
3 Modified by Morten Welinder, 1993-1994. 3 Modified by Morten Welinder, 1993-1994.
4 4
5 Copyright (C) 1991, 1994, 1995, 1997, 1999 5 Copyright (C) 1991, 1994, 1995, 1997, 1999, 2002, 2003, 2004,
6 Free Software Foundation, Inc. 6 2005 Free Software Foundation, Inc.
7 7
8This file is part of GNU Emacs. 8This file is part of GNU Emacs.
9 9
diff --git a/src/ecrt0.c b/src/ecrt0.c
index 95b69b11c01..5ee24dfae8c 100644
--- a/src/ecrt0.c
+++ b/src/ecrt0.c
@@ -1,5 +1,6 @@
1/* C code startup routine. 1/* C code startup routine.
2 Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1992, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/editfns.c b/src/editfns.c
index 05888fd4843..da4533d2537 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1,6 +1,7 @@
1/* Lisp functions pertaining to editing. 1/* Lisp functions pertaining to editing.
2 Copyright (C) 1985, 1986, 1987, 1989, 1993, 1994, 1995, 1996, 1997, 1998, 2 Copyright (C) 1985, 1986, 1987, 1989, 1993, 1994, 1995, 1996,
3 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
diff --git a/src/emacs.c b/src/emacs.c
index af23f8b9136..8724cbf2928 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1,6 +1,6 @@
1/* Fully extensible Emacs, running on Unix, intended for GNU. 1/* Fully extensible Emacs, running on Unix, intended for GNU.
2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2001, 2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999,
3 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -267,7 +267,7 @@ Initialization options:\n\
267--no-site-file do not load site-start.el\n\ 267--no-site-file do not load site-start.el\n\
268--no-splash do not display a splash screen on startup\n\ 268--no-splash do not display a splash screen on startup\n\
269--no-window-system, -nw do not communicate with X, ignoring $DISPLAY\n\ 269--no-window-system, -nw do not communicate with X, ignoring $DISPLAY\n\
270--quick, -Q equivalent to -q --no-site-file\n\ 270--quick, -Q equivalent to -q --no-site-file --no-splash\n\
271--script FILE run FILE as an Emacs Lisp script\n\ 271--script FILE run FILE as an Emacs Lisp script\n\
272--terminal, -t DEVICE use DEVICE for terminal I/O\n\ 272--terminal, -t DEVICE use DEVICE for terminal I/O\n\
273--unibyte, --no-multibyte run Emacs in unibyte mode\n\ 273--unibyte, --no-multibyte run Emacs in unibyte mode\n\
@@ -1154,9 +1154,9 @@ main (argc, argv
1154 if (argmatch (argv, argc, "-script", "--script", 3, &junk, &skip_args)) 1154 if (argmatch (argv, argc, "-script", "--script", 3, &junk, &skip_args))
1155 { 1155 {
1156 noninteractive = 1; /* Set batch mode. */ 1156 noninteractive = 1; /* Set batch mode. */
1157 /* Convert --script to -l, un-skip it, and sort again so that -l will be 1157 /* Convert --script to --scriptload, un-skip it, and sort again
1158 handled in proper sequence. */ 1158 so that it will be handled in proper sequence. */
1159 argv[skip_args - 1] = "-l"; 1159 argv[skip_args - 1] = "-scriptload";
1160 skip_args -= 2; 1160 skip_args -= 2;
1161 sort_args (argc, argv); 1161 sort_args (argc, argv);
1162 } 1162 }
@@ -1837,7 +1837,7 @@ struct standard_args standard_args[] =
1837 { "-itype", 0, 15, 0 }, 1837 { "-itype", 0, 15, 0 },
1838 { "-iconic", "--iconic", 15, 0 }, 1838 { "-iconic", "--iconic", 15, 0 },
1839 { "-D", "--basic-display", 12, 0}, 1839 { "-D", "--basic-display", 12, 0},
1840 { "--basic-display", 0, 12, 0}, 1840 { "-basic-display", 0, 12, 0},
1841 { "-bg", "--background-color", 10, 1 }, 1841 { "-bg", "--background-color", 10, 1 },
1842 { "-background", 0, 10, 1 }, 1842 { "-background", 0, 10, 1 },
1843 { "-fg", "--foreground-color", 10, 1 }, 1843 { "-fg", "--foreground-color", 10, 1 },
@@ -1871,6 +1871,7 @@ struct standard_args standard_args[] =
1871 { "-directory", 0, 0, 1 }, 1871 { "-directory", 0, 0, 1 },
1872 { "-l", "--load", 0, 1 }, 1872 { "-l", "--load", 0, 1 },
1873 { "-load", 0, 0, 1 }, 1873 { "-load", 0, 0, 1 },
1874 { "-scriptload", "--scriptload", 0, 1 },
1874 { "-f", "--funcall", 0, 1 }, 1875 { "-f", "--funcall", 0, 1 },
1875 { "-funcall", 0, 0, 1 }, 1876 { "-funcall", 0, 0, 1 },
1876 { "-eval", "--eval", 0, 1 }, 1877 { "-eval", "--eval", 0, 1 },
diff --git a/src/epaths.in b/src/epaths.in
index be91cb485ae..ee965cb7615 100644
--- a/src/epaths.in
+++ b/src/epaths.in
@@ -1,6 +1,6 @@
1/* Hey Emacs, this is -*- C -*- code! */ 1/* Hey Emacs, this is -*- C -*- code! */
2/* Copyright (C) 1993, 1995, 1997, 1999, 2001 2/* Copyright (C) 1993, 1995, 1997, 1999, 2001, 2002, 2003, 2004,
3 Free Software Foundation, Inc. 3 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/eval.c b/src/eval.c
index f625258229e..a867d00150e 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1,6 +1,6 @@
1/* Evaluator for GNU Emacs Lisp interpreter. 1/* Evaluator for GNU Emacs Lisp interpreter.
2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1999, 2000, 2001, 2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1999, 2000, 2001,
3 2002, 2004, 2005 Free Software Foundation, Inc. 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -235,6 +235,7 @@ restore_stack_limits (data)
235{ 235{
236 max_specpdl_size = XINT (XCAR (data)); 236 max_specpdl_size = XINT (XCAR (data));
237 max_lisp_eval_depth = XINT (XCDR (data)); 237 max_lisp_eval_depth = XINT (XCDR (data));
238 return Qnil;
238} 239}
239 240
240/* Call the Lisp debugger, giving it argument ARG. */ 241/* Call the Lisp debugger, giving it argument ARG. */
@@ -471,10 +472,10 @@ usage: (prog1 FIRST BODY...) */)
471} 472}
472 473
473DEFUN ("prog2", Fprog2, Sprog2, 2, UNEVALLED, 0, 474DEFUN ("prog2", Fprog2, Sprog2, 2, UNEVALLED, 0,
474 doc: /* Eval X, Y and BODY sequentially; value from Y. 475 doc: /* Eval FORM1, FORM2 and BODY sequentially; value from FORM2.
475The value of Y is saved during the evaluation of the remaining args, 476The value of FORM2 is saved during the evaluation of the
476whose values are discarded. 477remaining args, whose values are discarded.
477usage: (prog2 X Y BODY...) */) 478usage: (prog2 FORM1 FORM2 BODY...) */)
478 (args) 479 (args)
479 Lisp_Object args; 480 Lisp_Object args;
480{ 481{
@@ -564,8 +565,8 @@ usage: (function ARG) */)
564 565
565DEFUN ("interactive-p", Finteractive_p, Sinteractive_p, 0, 0, 0, 566DEFUN ("interactive-p", Finteractive_p, Sinteractive_p, 0, 0, 0,
566 doc: /* Return t if the function was run directly by user input. 567 doc: /* Return t if the function was run directly by user input.
567This means that the function was called with call-interactively (which 568This means that the function was called with `call-interactively'
568includes being called as the binding of a key) 569\(which includes being called as the binding of a key)
569and input is currently coming from the keyboard (not in keyboard macro), 570and input is currently coming from the keyboard (not in keyboard macro),
570and Emacs is not running in batch mode (`noninteractive' is nil). 571and Emacs is not running in batch mode (`noninteractive' is nil).
571 572
@@ -586,14 +587,14 @@ unconditionally for that argument. (`p' is a good way to do this.) */)
586 587
587 588
588DEFUN ("called-interactively-p", Fcalled_interactively_p, Scalled_interactively_p, 0, 0, 0, 589DEFUN ("called-interactively-p", Fcalled_interactively_p, Scalled_interactively_p, 0, 0, 0,
589 doc: /* Return t if the function using this was called with call-interactively. 590 doc: /* Return t if the function using this was called with `call-interactively'.
590This is used for implementing advice and other function-modifying 591This is used for implementing advice and other function-modifying
591features of Emacs. 592features of Emacs.
592 593
593The cleanest way to test whether your function was called with 594The cleanest way to test whether your function was called with
594`call-interactively', the way to do that is by adding an extra 595`call-interactively' is by adding an extra optional argument,
595optional argument, and making the `interactive' spec specify non-nil 596and making the `interactive' spec specify non-nil unconditionally
596unconditionally for that argument. (`p' is a good way to do this.) */) 597for that argument. (`p' is a good way to do this.) */)
597 () 598 ()
598{ 599{
599 return interactive_p (1) ? Qt : Qnil; 600 return interactive_p (1) ? Qt : Qnil;
@@ -779,7 +780,7 @@ The return value is BASE-VARIABLE. */)
779 780
780 781
781DEFUN ("defvar", Fdefvar, Sdefvar, 1, UNEVALLED, 0, 782DEFUN ("defvar", Fdefvar, Sdefvar, 1, UNEVALLED, 0,
782 doc: /* Define SYMBOL as a variable. 783 doc: /* Define SYMBOL as a variable, and return SYMBOL.
783You are not required to define a variable in order to use it, 784You are not required to define a variable in order to use it,
784but the definition can supply documentation and an initial value 785but the definition can supply documentation and an initial value
785in a way that tags can recognize. 786in a way that tags can recognize.
@@ -806,10 +807,6 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
806 register Lisp_Object sym, tem, tail; 807 register Lisp_Object sym, tem, tail;
807 808
808 sym = Fcar (args); 809 sym = Fcar (args);
809 if (SYMBOL_CONSTANT_P (sym))
810 error ("Constant symbol `%s' specified in defvar",
811 SDATA (SYMBOL_NAME (sym)));
812
813 tail = Fcdr (args); 810 tail = Fcdr (args);
814 if (!NILP (Fcdr (Fcdr (tail)))) 811 if (!NILP (Fcdr (Fcdr (tail))))
815 error ("Too many arguments"); 812 error ("Too many arguments");
@@ -817,6 +814,18 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
817 tem = Fdefault_boundp (sym); 814 tem = Fdefault_boundp (sym);
818 if (!NILP (tail)) 815 if (!NILP (tail))
819 { 816 {
817 if (SYMBOL_CONSTANT_P (sym))
818 {
819 /* For upward compatibility, allow (defvar :foo (quote :foo)). */
820 Lisp_Object tem = Fcar (tail);
821 if (! (CONSP (tem)
822 && EQ (XCAR (tem), Qquote)
823 && CONSP (XCDR (tem))
824 && EQ (XCAR (XCDR (tem)), sym)))
825 error ("Constant symbol `%s' specified in defvar",
826 SDATA (SYMBOL_NAME (sym)));
827 }
828
820 if (NILP (tem)) 829 if (NILP (tem))
821 Fset_default (sym, Feval (Fcar (tail))); 830 Fset_default (sym, Feval (Fcar (tail)));
822 else 831 else
@@ -2085,7 +2094,8 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0,
2085 return form; 2094 return form;
2086 2095
2087 QUIT; 2096 QUIT;
2088 if (consing_since_gc > gc_cons_threshold) 2097 if (consing_since_gc > gc_cons_threshold
2098 && consing_since_gc > gc_relative_threshold)
2089 { 2099 {
2090 GCPRO1 (form); 2100 GCPRO1 (form);
2091 Fgarbage_collect (); 2101 Fgarbage_collect ();
@@ -2785,7 +2795,8 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
2785 register int i; 2795 register int i;
2786 2796
2787 QUIT; 2797 QUIT;
2788 if (consing_since_gc > gc_cons_threshold) 2798 if (consing_since_gc > gc_cons_threshold
2799 && consing_since_gc > gc_relative_threshold)
2789 Fgarbage_collect (); 2800 Fgarbage_collect ();
2790 2801
2791 if (++lisp_eval_depth > max_lisp_eval_depth) 2802 if (++lisp_eval_depth > max_lisp_eval_depth)
@@ -2851,8 +2862,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
2851 val = (*XSUBR (fun)->function) (internal_args[0]); 2862 val = (*XSUBR (fun)->function) (internal_args[0]);
2852 goto done; 2863 goto done;
2853 case 2: 2864 case 2:
2854 val = (*XSUBR (fun)->function) (internal_args[0], 2865 val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1]);
2855 internal_args[1]);
2856 goto done; 2866 goto done;
2857 case 3: 2867 case 3:
2858 val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1], 2868 val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1],
@@ -2860,8 +2870,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
2860 goto done; 2870 goto done;
2861 case 4: 2871 case 4:
2862 val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1], 2872 val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1],
2863 internal_args[2], 2873 internal_args[2], internal_args[3]);
2864 internal_args[3]);
2865 goto done; 2874 goto done;
2866 case 5: 2875 case 5:
2867 val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1], 2876 val = (*XSUBR (fun)->function) (internal_args[0], internal_args[1],
@@ -3387,7 +3396,7 @@ void
3387syms_of_eval () 3396syms_of_eval ()
3388{ 3397{
3389 DEFVAR_INT ("max-specpdl-size", &max_specpdl_size, 3398 DEFVAR_INT ("max-specpdl-size", &max_specpdl_size,
3390 doc: /* *Limit on number of Lisp variable bindings & unwind-protects. 3399 doc: /* *Limit on number of Lisp variable bindings and `unwind-protect's.
3391If Lisp code tries to increase the total number past this amount, 3400If Lisp code tries to increase the total number past this amount,
3392an error is signaled. 3401an error is signaled.
3393You can safely use a value considerably larger than the default value, 3402You can safely use a value considerably larger than the default value,
@@ -3484,10 +3493,8 @@ It does not apply to errors handled by `condition-case'. */);
3484 Vdebug_ignored_errors = Qnil; 3493 Vdebug_ignored_errors = Qnil;
3485 3494
3486 DEFVAR_BOOL ("debug-on-quit", &debug_on_quit, 3495 DEFVAR_BOOL ("debug-on-quit", &debug_on_quit,
3487 doc: /* *Non-nil means enter debugger if quit is signaled (C-g, for example). 3496 doc: /* *Non-nil means enter debugger if quit is signaled (C-g, for example).
3488Does not apply if quit is handled by a `condition-case'. 3497Does not apply if quit is handled by a `condition-case'. */);
3489When you evaluate an expression interactively, this variable
3490is temporarily non-nil if `eval-expression-debug-on-quit' is non-nil. */);
3491 debug_on_quit = 0; 3498 debug_on_quit = 0;
3492 3499
3493 DEFVAR_BOOL ("debug-on-next-call", &debug_on_next_call, 3500 DEFVAR_BOOL ("debug-on-next-call", &debug_on_next_call,
diff --git a/src/fileio.c b/src/fileio.c
index 769dc14e77d..53b989f52e2 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1,6 +1,7 @@
1/* File IO for GNU Emacs. 1/* File IO for GNU Emacs.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996,
3 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. 3 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -5820,13 +5821,13 @@ auto_save_1 ()
5820} 5821}
5821 5822
5822static Lisp_Object 5823static Lisp_Object
5823do_auto_save_unwind (stream) /* used as unwind-protect function */ 5824do_auto_save_unwind (arg) /* used as unwind-protect function */
5824 Lisp_Object stream; 5825 Lisp_Object arg;
5825{ 5826{
5827 FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer;
5826 auto_saving = 0; 5828 auto_saving = 0;
5827 if (!NILP (stream)) 5829 if (stream != NULL)
5828 fclose ((FILE *) (XFASTINT (XCAR (stream)) << 16 5830 fclose (stream);
5829 | XFASTINT (XCDR (stream))));
5830 return Qnil; 5831 return Qnil;
5831} 5832}
5832 5833
@@ -5871,8 +5872,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5871 int auto_saved = 0; 5872 int auto_saved = 0;
5872 int do_handled_files; 5873 int do_handled_files;
5873 Lisp_Object oquit; 5874 Lisp_Object oquit;
5874 FILE *stream; 5875 FILE *stream = NULL;
5875 Lisp_Object lispstream;
5876 int count = SPECPDL_INDEX (); 5876 int count = SPECPDL_INDEX ();
5877 int orig_minibuffer_auto_raise = minibuffer_auto_raise; 5877 int orig_minibuffer_auto_raise = minibuffer_auto_raise;
5878 int old_message_p = 0; 5878 int old_message_p = 0;
@@ -5924,24 +5924,10 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5924 } 5924 }
5925 5925
5926 stream = fopen (SDATA (listfile), "w"); 5926 stream = fopen (SDATA (listfile), "w");
5927 if (stream != NULL)
5928 {
5929 /* Arrange to close that file whether or not we get an error.
5930 Also reset auto_saving to 0. */
5931 lispstream = Fcons (Qnil, Qnil);
5932 XSETCARFASTINT (lispstream, (EMACS_UINT)stream >> 16);
5933 XSETCDRFASTINT (lispstream, (EMACS_UINT)stream & 0xffff);
5934 }
5935 else
5936 lispstream = Qnil;
5937 }
5938 else
5939 {
5940 stream = NULL;
5941 lispstream = Qnil;
5942 } 5927 }
5943 5928
5944 record_unwind_protect (do_auto_save_unwind, lispstream); 5929 record_unwind_protect (do_auto_save_unwind,
5930 make_save_value (stream, 0));
5945 record_unwind_protect (do_auto_save_unwind_1, 5931 record_unwind_protect (do_auto_save_unwind_1,
5946 make_number (minibuffer_auto_raise)); 5932 make_number (minibuffer_auto_raise));
5947 minibuffer_auto_raise = 0; 5933 minibuffer_auto_raise = 0;
diff --git a/src/filelock.c b/src/filelock.c
index de348f61a90..fc6839f5f88 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -1,6 +1,6 @@
1/* Lock files for editing. 1/* Lock files for editing.
2 Copyright (C) 1985, 86, 87, 93, 94, 96, 98, 1999, 2000, 2001 2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1996, 1998, 1999, 2000, 2001,
3 Free Software Foundation, Inc. 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/filemode.c b/src/filemode.c
index 130cbace773..6257c6a7664 100644
--- a/src/filemode.c
+++ b/src/filemode.c
@@ -1,5 +1,6 @@
1/* filemode.c -- make a string describing file modes 1/* filemode.c -- make a string describing file modes
2 Copyright (C) 1985, 1990, 1993 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1990, 1993, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
diff --git a/src/firstfile.c b/src/firstfile.c
index cf6dbf3e888..b16f3a3dc44 100644
--- a/src/firstfile.c
+++ b/src/firstfile.c
@@ -1,5 +1,5 @@
1/* Mark beginning of data space to dump as pure, for GNU Emacs. 1/* Mark beginning of data space to dump as pure, for GNU Emacs.
2 Copyright (C) 1997 Free Software Foundation, Inc. 2 Copyright (C) 1997, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/floatfns.c b/src/floatfns.c
index 529e7b76e39..79574e0a69b 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -1,5 +1,6 @@
1/* Primitive operations on floating point for GNU Emacs Lisp interpreter. 1/* Primitive operations on floating point for GNU Emacs Lisp interpreter.
2 Copyright (C) 1988, 1993, 1994, 1999, 2003, 2005 Free Software Foundation, Inc. 2 Copyright (C) 1988, 1993, 1994, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -460,7 +461,8 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
460 CHECK_NUMBER_OR_FLOAT (arg1); 461 CHECK_NUMBER_OR_FLOAT (arg1);
461 CHECK_NUMBER_OR_FLOAT (arg2); 462 CHECK_NUMBER_OR_FLOAT (arg2);
462 if (INTEGERP (arg1) /* common lisp spec */ 463 if (INTEGERP (arg1) /* common lisp spec */
463 && INTEGERP (arg2)) /* don't promote, if both are ints */ 464 && INTEGERP (arg2) /* don't promote, if both are ints, and */
465 && 0 <= XINT (arg2)) /* we are sure the result is not fractional */
464 { /* this can be improved by pre-calculating */ 466 { /* this can be improved by pre-calculating */
465 EMACS_INT acc, x, y; /* some binary powers of x then accumulating */ 467 EMACS_INT acc, x, y; /* some binary powers of x then accumulating */
466 Lisp_Object val; 468 Lisp_Object val;
diff --git a/src/fns.c b/src/fns.c
index f1e83f727a5..1e26ec9a392 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1,6 +1,7 @@
1/* Random utility Lisp functions. 1/* Random utility Lisp functions.
2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997,
3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -1153,13 +1154,13 @@ Beware, this often doesn't really do what you think it does.
1153It is similar to (decode-coding-string STRING 'emacs-mule-unix). 1154It is similar to (decode-coding-string STRING 'emacs-mule-unix).
1154If you're not sure, whether to use `string-as-multibyte' or 1155If you're not sure, whether to use `string-as-multibyte' or
1155`string-to-multibyte', use `string-to-multibyte'. Beware: 1156`string-to-multibyte', use `string-to-multibyte'. Beware:
1156 (aref (string-as-multibyte "\201") 0) -> 129 (aka ?\201) 1157 (aref (string-as-multibyte "\\201") 0) -> 129 (aka ?\\201)
1157 (aref (string-as-multibyte "\300") 0) -> 192 (aka ?\300) 1158 (aref (string-as-multibyte "\\300") 0) -> 192 (aka ?\\300)
1158 (aref (string-as-multibyte "\300\201") 0) -> 192 (aka ?\300) 1159 (aref (string-as-multibyte "\\300\\201") 0) -> 192 (aka ?\\300)
1159 (aref (string-as-multibyte "\300\201") 1) -> 129 (aka ?\201) 1160 (aref (string-as-multibyte "\\300\\201") 1) -> 129 (aka ?\\201)
1160but 1161but
1161 (aref (string-as-multibyte "\201\300") 0) -> 2240 1162 (aref (string-as-multibyte "\\201\\300") 0) -> 2240
1162 (aref (string-as-multibyte "\201\300") 1) -> <error> */) 1163 (aref (string-as-multibyte "\\201\\300") 1) -> <error> */)
1163 (string) 1164 (string)
1164 Lisp_Object string; 1165 Lisp_Object string;
1165{ 1166{
@@ -5832,7 +5833,7 @@ syms_of_fns ()
5832 DEFVAR_LISP ("features", &Vfeatures, 5833 DEFVAR_LISP ("features", &Vfeatures,
5833 doc: /* A list of symbols which are the features of the executing emacs. 5834 doc: /* A list of symbols which are the features of the executing emacs.
5834Used by `featurep' and `require', and altered by `provide'. */); 5835Used by `featurep' and `require', and altered by `provide'. */);
5835 Vfeatures = Qnil; 5836 Vfeatures = Fcons (intern ("emacs"), Qnil);
5836 Qsubfeatures = intern ("subfeatures"); 5837 Qsubfeatures = intern ("subfeatures");
5837 staticpro (&Qsubfeatures); 5838 staticpro (&Qsubfeatures);
5838 5839
diff --git a/src/fontset.c b/src/fontset.c
index e3bb1ced2f4..4529e6c2134 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1,7 +1,7 @@
1/* Fontset handler. 1/* Fontset handler.
2 Copyright (C) 2004 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1997, 2000 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1995, 1997, 2000 Electrotechnical Laboratory, JAPAN.
4 Licensed to the Free Software Foundation. 3 Licensed to the Free Software Foundation.
4 Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
diff --git a/src/fontset.h b/src/fontset.h
index 7d2def16cfc..3a4932af6c0 100644
--- a/src/fontset.h
+++ b/src/fontset.h
@@ -1,6 +1,7 @@
1/* Header for fontset handler. 1/* Header for fontset handler.
2 Copyright (C) 1995, 1997, 2000 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1995, 1997, 2000 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation. 3 Licensed to the Free Software Foundation.
4 Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
diff --git a/src/frame.c b/src/frame.c
index 864ec625c2c..ecbae7f593f 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1,6 +1,6 @@
1/* Generic frame functions. 1/* Generic frame functions.
2 Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2003, 2004, 2005 2 Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003,
3 Free Software Foundation. 3 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -2582,8 +2582,7 @@ DEFUN ("frame-char-width", Fframe_char_width, Sframe_char_width,
2582 0, 1, 0, 2582 0, 1, 0,
2583 doc: /* Width in pixels of characters in the font in frame FRAME. 2583 doc: /* Width in pixels of characters in the font in frame FRAME.
2584If FRAME is omitted, the selected frame is used. 2584If FRAME is omitted, the selected frame is used.
2585The width is the same for all characters, because 2585On a graphical screen, the width is the standard width of the default font.
2586currently Emacs supports only fixed-width fonts.
2587For a terminal screen, the value is always 1. */) 2586For a terminal screen, the value is always 1. */)
2588 (frame) 2587 (frame)
2589 Lisp_Object frame; 2588 Lisp_Object frame;
diff --git a/src/frame.h b/src/frame.h
index 81d3477121e..838b61bb703 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1,5 +1,6 @@
1/* Define frame-object for GNU Emacs. 1/* Define frame-object for GNU Emacs.
2 Copyright (C) 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1994, 1999, 2000, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -443,6 +444,10 @@ struct frame
443 realized. Reset to zero whenever the default face changes. 444 realized. Reset to zero whenever the default face changes.
444 Used to see the difference between a font change and face change. */ 445 Used to see the difference between a font change and face change. */
445 unsigned default_face_done_p : 1; 446 unsigned default_face_done_p : 1;
447
448 /* Set to non-zero if this frame has already been hscrolled during
449 current redisplay. */
450 unsigned already_hscrolled_p : 1;
446}; 451};
447 452
448#ifdef MULTI_KBOARD 453#ifdef MULTI_KBOARD
@@ -808,13 +813,13 @@ extern Lisp_Object selected_frame;
808 Display-related Macros 813 Display-related Macros
809 ***********************************************************************/ 814 ***********************************************************************/
810 815
811/* Canonical y-unit on frame F. 816/* Canonical y-unit on frame F.
812 This value currently equals the line height of the frame (which is 817 This value currently equals the line height of the frame (which is
813 the height of the default font of F). */ 818 the height of the default font of F). */
814 819
815#define FRAME_LINE_HEIGHT(F) ((F)->line_height) 820#define FRAME_LINE_HEIGHT(F) ((F)->line_height)
816 821
817/* Canonical x-unit on frame F. 822/* Canonical x-unit on frame F.
818 This value currently equals the average width of the default font of F. */ 823 This value currently equals the average width of the default font of F. */
819 824
820#define FRAME_COLUMN_WIDTH(F) ((F)->column_width) 825#define FRAME_COLUMN_WIDTH(F) ((F)->column_width)
diff --git a/src/fringe.c b/src/fringe.c
index 7731c0302e9..25de5aa604e 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -1,6 +1,7 @@
1/* Fringe handling (split from xdisp.c). 1/* Fringe handling (split from xdisp.c).
2 Copyright (C) 1985,86,87,88,93,94,95,97,98,99,2000,01,02,03,04 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1997,
3 Free Software Foundation, Inc. 3 1998, 1999, 2000, 2000, 2001, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -777,13 +778,14 @@ draw_window_fringes (w, no_fringe)
777 778
778 779
779/* Recalculate the bitmaps to show in the fringes of window W. 780/* Recalculate the bitmaps to show in the fringes of window W.
780 If FORCE_P is 0, only mark rows with modified bitmaps for update in 781 Only mark rows with modified bitmaps for update in redraw_fringe_bitmaps_p.
781 redraw_fringe_bitmaps_p; else mark all rows for update. */ 782
783 If KEEP_CURRENT_P is 0, update current_matrix too. */
782 784
783int 785int
784update_window_fringes (w, force_p) 786update_window_fringes (w, keep_current_p)
785 struct window *w; 787 struct window *w;
786 int force_p; 788 int keep_current_p;
787{ 789{
788 struct glyph_row *row, *cur = 0; 790 struct glyph_row *row, *cur = 0;
789 int yb = window_text_bottom_y (w); 791 int yb = window_text_bottom_y (w);
@@ -849,7 +851,8 @@ update_window_fringes (w, force_p)
849 { 851 {
850 if (!done_top) 852 if (!done_top)
851 { 853 {
852 if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer))) 854 if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer))
855 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row))
853 row->indicate_bob_p = !NILP (boundary_top); 856 row->indicate_bob_p = !NILP (boundary_top);
854 else 857 else
855 row->indicate_top_line_p = !NILP (arrow_top); 858 row->indicate_top_line_p = !NILP (arrow_top);
@@ -858,7 +861,8 @@ update_window_fringes (w, force_p)
858 861
859 if (!done_bot) 862 if (!done_bot)
860 { 863 {
861 if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer))) 864 if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer))
865 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row))
862 row->indicate_eob_p = !NILP (boundary_bot), done_bot = 1; 866 row->indicate_eob_p = !NILP (boundary_bot), done_bot = 1;
863 else if (y + row->height >= yb) 867 else if (y + row->height >= yb)
864 row->indicate_bottom_line_p = !NILP (arrow_bot), done_bot = 1; 868 row->indicate_bottom_line_p = !NILP (arrow_bot), done_bot = 1;
@@ -943,8 +947,7 @@ update_window_fringes (w, force_p)
943 else 947 else
944 right = NO_FRINGE_BITMAP; 948 right = NO_FRINGE_BITMAP;
945 949
946 if (force_p 950 if (row->y != cur->y
947 || row->y != cur->y
948 || row->visible_height != cur->visible_height 951 || row->visible_height != cur->visible_height
949 || row->ends_at_zv_p != cur->ends_at_zv_p 952 || row->ends_at_zv_p != cur->ends_at_zv_p
950 || left != cur->left_fringe_bitmap 953 || left != cur->left_fringe_bitmap
@@ -953,11 +956,15 @@ update_window_fringes (w, force_p)
953 || right_face_id != cur->right_fringe_face_id 956 || right_face_id != cur->right_fringe_face_id
954 || cur->redraw_fringe_bitmaps_p) 957 || cur->redraw_fringe_bitmaps_p)
955 { 958 {
956 redraw_p = row->redraw_fringe_bitmaps_p = cur->redraw_fringe_bitmaps_p = 1; 959 redraw_p = row->redraw_fringe_bitmaps_p = 1;
957 cur->left_fringe_bitmap = left; 960 if (!keep_current_p)
958 cur->right_fringe_bitmap = right; 961 {
959 cur->left_fringe_face_id = left_face_id; 962 cur->redraw_fringe_bitmaps_p = 1;
960 cur->right_fringe_face_id = right_face_id; 963 cur->left_fringe_bitmap = left;
964 cur->right_fringe_bitmap = right;
965 cur->left_fringe_face_id = left_face_id;
966 cur->right_fringe_face_id = right_face_id;
967 }
961 } 968 }
962 969
963 if (row->overlay_arrow_bitmap != cur->overlay_arrow_bitmap) 970 if (row->overlay_arrow_bitmap != cur->overlay_arrow_bitmap)
@@ -975,7 +982,7 @@ update_window_fringes (w, force_p)
975 row[-1].redraw_fringe_bitmaps_p = cur[-1].redraw_fringe_bitmaps_p = 1; 982 row[-1].redraw_fringe_bitmaps_p = cur[-1].redraw_fringe_bitmaps_p = 1;
976 } 983 }
977 984
978 return redraw_p; 985 return redraw_p && !keep_current_p;
979} 986}
980 987
981 988
diff --git a/src/getloadavg.c b/src/getloadavg.c
index 191f7d4244f..a2ae9bc310b 100644
--- a/src/getloadavg.c
+++ b/src/getloadavg.c
@@ -1,6 +1,6 @@
1/* Get the system load averages. 1/* Get the system load averages.
2 Copyright (C) 1985, 86, 87, 88, 89, 91, 92, 93, 1994, 1995, 1997, 2003 2 Copyright (C) 1985, 1986, 1987, 1988, 1989, 1991, 1992, 1993, 1994, 1995,
3 Free Software Foundation, Inc. 3 1997, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5 NOTE: The canonical source of this file is maintained with gnulib. 5 NOTE: The canonical source of this file is maintained with gnulib.
6 Bugs can be reported to bug-gnulib@gnu.org. 6 Bugs can be reported to bug-gnulib@gnu.org.
diff --git a/src/getpagesize.h b/src/getpagesize.h
index 20f19279cd0..ed47f80b0e0 100644
--- a/src/getpagesize.h
+++ b/src/getpagesize.h
@@ -1,5 +1,6 @@
1/* Emulate getpagesize on systems that lack it. 1/* Emulate getpagesize on systems that lack it.
2 Copyright (C) 1986, 1992, 1995, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1986, 1992, 1995, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/gmalloc.c b/src/gmalloc.c
index 08de77df0e0..55aedb7801b 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -5,7 +5,8 @@
5/* The malloc headers and source files from the C library follow here. */ 5/* The malloc headers and source files from the C library follow here. */
6 6
7/* Declarations for `malloc' and friends. 7/* Declarations for `malloc' and friends.
8 Copyright 1990, 91, 92, 93, 95, 96, 99 Free Software Foundation, Inc. 8 Copyright (C) 1990, 1991, 1992, 1993, 1995, 1996, 1999, 2002, 2003, 2004,
9 2005 Free Software Foundation, Inc.
9 Written May 1989 by Mike Haertel. 10 Written May 1989 by Mike Haertel.
10 11
11This library is free software; you can redistribute it and/or 12This library is free software; you can redistribute it and/or
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 1cb1004f576..3b590e0faed 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1,6 +1,5 @@
1/* Functions for creating and updating GTK widgets. 1/* Functions for creating and updating GTK widgets.
2 Copyright (C) 2003 2 Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
3 Free Software Foundation, Inc.
4 3
5This file is part of GNU Emacs. 4This file is part of GNU Emacs.
6 5
@@ -240,6 +239,64 @@ xg_create_default_cursor (dpy)
240 return gdk_cursor_new_for_display (gdpy, GDK_LEFT_PTR); 239 return gdk_cursor_new_for_display (gdpy, GDK_LEFT_PTR);
241} 240}
242 241
242/* Apply GMASK to GPIX and return a GdkPixbuf with an alpha channel. */
243
244static GdkPixbuf *
245xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap)
246 GdkPixmap *gpix;
247 GdkPixmap *gmask;
248 GdkColormap *cmap;
249{
250 int x, y, width, height, rowstride, mask_rowstride;
251 GdkPixbuf *icon_buf, *tmp_buf;
252 guchar *pixels;
253 guchar *mask_pixels;
254
255 gdk_drawable_get_size (gpix, &width, &height);
256 tmp_buf = gdk_pixbuf_get_from_drawable (NULL, gpix, cmap,
257 0, 0, 0, 0, width, height);
258 icon_buf = gdk_pixbuf_add_alpha (tmp_buf, FALSE, 0, 0, 0);
259 g_object_unref (G_OBJECT (tmp_buf));
260
261 if (gmask)
262 {
263 GdkPixbuf *mask_buf = gdk_pixbuf_get_from_drawable (NULL,
264 gmask,
265 NULL,
266 0, 0, 0, 0,
267 width, height);
268 guchar *pixels = gdk_pixbuf_get_pixels (icon_buf);
269 guchar *mask_pixels = gdk_pixbuf_get_pixels (mask_buf);
270 int rowstride = gdk_pixbuf_get_rowstride (icon_buf);
271 int mask_rowstride = gdk_pixbuf_get_rowstride (mask_buf);
272 int y;
273
274 for (y = 0; y < height; ++y)
275 {
276 guchar *iconptr, *maskptr;
277 int x;
278
279 iconptr = pixels + y * rowstride;
280 maskptr = mask_pixels + y * mask_rowstride;
281
282 for (x = 0; x < width; ++x)
283 {
284 /* In a bitmap, RGB is either 255/255/255 or 0/0/0. Checking
285 just R is sufficient. */
286 if (maskptr[0] == 0)
287 iconptr[3] = 0; /* 0, 1, 2 is R, G, B. 3 is alpha. */
288
289 iconptr += rowstride/width;
290 maskptr += mask_rowstride/width;
291 }
292 }
293
294 g_object_unref (G_OBJECT (mask_buf));
295 }
296
297 return icon_buf;
298}
299
243/* For the image defined in IMG, make and return a GtkImage. For displays with 300/* For the image defined in IMG, make and return a GtkImage. For displays with
244 8 planes or less we must make a GdkPixbuf and apply the mask manually. 301 8 planes or less we must make a GdkPixbuf and apply the mask manually.
245 Otherwise the highlightning and dimming the tool bar code in GTK does 302 Otherwise the highlightning and dimming the tool bar code in GTK does
@@ -312,60 +369,15 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
312 } 369 }
313 else 370 else
314 { 371 {
372
315 /* This is a workaround to make icons look good on pseudo color 373 /* This is a workaround to make icons look good on pseudo color
316 displays. Apparently GTK expects the images to have an alpha 374 displays. Apparently GTK expects the images to have an alpha
317 channel. If they don't, insensitive and activated icons will 375 channel. If they don't, insensitive and activated icons will
318 look bad. This workaround does not work on monochrome displays, 376 look bad. This workaround does not work on monochrome displays,
319 and is not needed on true color/static color displays (i.e. 377 and is not needed on true color/static color displays (i.e.
320 16 bits and higher). */ 378 16 bits and higher). */
321 int x, y, width, height, rowstride, mask_rowstride; 379 GdkColormap *cmap = gtk_widget_get_colormap (widget);
322 GdkPixbuf *icon_buf, *tmp_buf; 380 GdkPixbuf *icon_buf = xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap);
323 guchar *pixels;
324 guchar *mask_pixels;
325
326 gdk_drawable_get_size (gpix, &width, &height);
327 tmp_buf = gdk_pixbuf_get_from_drawable (NULL,
328 gpix,
329 gtk_widget_get_colormap (widget),
330 0, 0, 0, 0, width, height);
331 icon_buf = gdk_pixbuf_add_alpha (tmp_buf, FALSE, 0, 0, 0);
332 g_object_unref (G_OBJECT (tmp_buf));
333
334 if (gmask)
335 {
336 GdkPixbuf *mask_buf = gdk_pixbuf_get_from_drawable (NULL,
337 gmask,
338 NULL,
339 0, 0, 0, 0,
340 width, height);
341 guchar *pixels = gdk_pixbuf_get_pixels (icon_buf);
342 guchar *mask_pixels = gdk_pixbuf_get_pixels (mask_buf);
343 int rowstride = gdk_pixbuf_get_rowstride (icon_buf);
344 int mask_rowstride = gdk_pixbuf_get_rowstride (mask_buf);
345 int y;
346
347 for (y = 0; y < height; ++y)
348 {
349 guchar *iconptr, *maskptr;
350 int x;
351
352 iconptr = pixels + y * rowstride;
353 maskptr = mask_pixels + y * mask_rowstride;
354
355 for (x = 0; x < width; ++x)
356 {
357 /* In a bitmap, RGB is either 255/255/255 or 0/0/0. Checking
358 just R is sufficient. */
359 if (maskptr[0] == 0)
360 iconptr[3] = 0; /* 0, 1, 2 is R, G, B. 3 is alpha. */
361
362 iconptr += rowstride/width;
363 maskptr += mask_rowstride/width;
364 }
365 }
366
367 g_object_unref (G_OBJECT (mask_buf));
368 }
369 381
370 if (! old_widget) 382 if (! old_widget)
371 old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf)); 383 old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf));
@@ -940,6 +952,24 @@ xg_set_background_color (f, bg)
940} 952}
941 953
942 954
955/* Set the frame icon to ICON_PIXMAP/MASK. This must be done with GTK
956 functions so GTK does not overwrite the icon. */
957
958void
959xg_set_frame_icon (f, icon_pixmap, icon_mask)
960 FRAME_PTR f;
961 Pixmap icon_pixmap;
962 Pixmap icon_mask;
963{
964 GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f));
965 GdkPixmap *gpix = gdk_pixmap_foreign_new_for_display (gdpy, icon_pixmap);
966 GdkPixmap *gmask = gdk_pixmap_foreign_new_for_display (gdpy, icon_mask);
967 GdkPixbuf *gp = xg_get_pixbuf_from_pix_and_mask (gpix, gmask, NULL);
968
969 gtk_window_set_icon (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), gp);
970}
971
972
943 973
944/*********************************************************************** 974/***********************************************************************
945 Dialog functions 975 Dialog functions
@@ -2607,7 +2637,7 @@ xg_modify_menubar_widgets (menubar, f, val, deep_p,
2607 xg_update_menubar (menubar, f, &list, list, 0, val->contents, 2637 xg_update_menubar (menubar, f, &list, list, 0, val->contents,
2608 select_cb, highlight_cb, cl_data); 2638 select_cb, highlight_cb, cl_data);
2609 2639
2610 if (deep_p); 2640 if (deep_p)
2611 { 2641 {
2612 widget_value *cur; 2642 widget_value *cur;
2613 2643
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 08ba9ee1314..aea4ee9e7cf 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -1,6 +1,5 @@
1/* Definitions and headers for GTK widgets. 1/* Definitions and headers for GTK widgets.
2 Copyright (C) 2003 2 Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
3 Free Software Foundation, Inc.
4 3
5This file is part of GNU Emacs. 4This file is part of GNU Emacs.
6 5
@@ -200,6 +199,10 @@ extern void x_wm_set_size_hint P_ ((FRAME_PTR f,
200 int user_position)); 199 int user_position));
201extern void xg_set_background_color P_ ((FRAME_PTR f, unsigned long bg)); 200extern void xg_set_background_color P_ ((FRAME_PTR f, unsigned long bg));
202 201
202extern void xg_set_frame_icon P_ ((FRAME_PTR f,
203 Pixmap icon_pixmap,
204 Pixmap icon_mask));
205
203/* Mark all callback data that are Lisp_object:s during GC. */ 206/* Mark all callback data that are Lisp_object:s during GC. */
204extern void xg_mark_data P_ ((void)); 207extern void xg_mark_data P_ ((void));
205 208
diff --git a/src/image.c b/src/image.c
index 928ec0437aa..6ec0734e785 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1,6 +1,6 @@
1/* Functions for image support on window system. 1/* Functions for image support on window system.
2 Copyright (C) 1989, 92, 93, 94, 95, 96, 97, 98, 99, 2000,01,02,03,04 2 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3 Free Software Foundation. 3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -54,8 +54,8 @@ typedef struct x_bitmap_record Bitmap_Record;
54 54
55#define RGB_PIXEL_COLOR unsigned long 55#define RGB_PIXEL_COLOR unsigned long
56 56
57#define PIX_MASK_RETAIN(f) 0 57#define PIX_MASK_RETAIN 0
58#define PIX_MASK_DRAW(f) 1 58#define PIX_MASK_DRAW 1
59#endif /* HAVE_X_WINDOWS */ 59#endif /* HAVE_X_WINDOWS */
60 60
61 61
@@ -71,8 +71,8 @@ typedef struct w32_bitmap_record Bitmap_Record;
71 71
72#define RGB_PIXEL_COLOR COLORREF 72#define RGB_PIXEL_COLOR COLORREF
73 73
74#define PIX_MASK_RETAIN(f) 0 74#define PIX_MASK_RETAIN 0
75#define PIX_MASK_DRAW(f) 1 75#define PIX_MASK_DRAW 1
76 76
77#define FRAME_X_VISUAL(f) FRAME_X_DISPLAY_INFO (f)->visual 77#define FRAME_X_VISUAL(f) FRAME_X_DISPLAY_INFO (f)->visual
78#define x_defined_color w32_defined_color 78#define x_defined_color w32_defined_color
@@ -112,6 +112,11 @@ typedef struct mac_bitmap_record Bitmap_Record;
112 112
113#define RGB_PIXEL_COLOR unsigned long 113#define RGB_PIXEL_COLOR unsigned long
114 114
115/* A black pixel in a mask bitmap/pixmap means ``draw a source
116 pixel''. A white pixel means ``retain the current pixel''. */
117#define PIX_MASK_DRAW RGB_TO_ULONG(0,0,0)
118#define PIX_MASK_RETAIN RGB_TO_ULONG(255,255,255)
119
115#define FRAME_X_VISUAL(f) FRAME_X_DISPLAY_INFO (f)->visual 120#define FRAME_X_VISUAL(f) FRAME_X_DISPLAY_INFO (f)->visual
116#define x_defined_color mac_defined_color 121#define x_defined_color mac_defined_color
117#define DefaultDepthOfScreen(screen) (one_mac_display_info.n_planes) 122#define DefaultDepthOfScreen(screen) (one_mac_display_info.n_planes)
@@ -181,19 +186,43 @@ XPutPixel (ximage, x, y, pixel)
181 int x, y; 186 int x, y;
182 unsigned long pixel; 187 unsigned long pixel;
183{ 188{
184 CGrafPtr old_port; 189 PixMapHandle pixmap = GetGWorldPixMap (ximage);
185 GDHandle old_gdh; 190 short depth = GetPixDepth (pixmap);
186 RGBColor color;
187 191
188 GetGWorld (&old_port, &old_gdh); 192 if (depth == 32)
189 SetGWorld (ximage, NULL); 193 {
194 char *base_addr = GetPixBaseAddr (pixmap);
195 short row_bytes = GetPixRowBytes (pixmap);
190 196
191 color.red = RED16_FROM_ULONG (pixel); 197 ((unsigned long *) (base_addr + y * row_bytes))[x] = pixel;
192 color.green = GREEN16_FROM_ULONG (pixel); 198 }
193 color.blue = BLUE16_FROM_ULONG (pixel); 199 else if (depth == 1)
194 SetCPixel (x, y, &color); 200 {
201 char *base_addr = GetPixBaseAddr (pixmap);
202 short row_bytes = GetPixRowBytes (pixmap);
195 203
196 SetGWorld (old_port, old_gdh); 204 if (pixel == PIX_MASK_DRAW)
205 base_addr[y * row_bytes + x / 8] |= (1 << 7) >> (x & 7);
206 else
207 base_addr[y * row_bytes + x / 8] &= ~((1 << 7) >> (x & 7));
208 }
209 else
210 {
211 CGrafPtr old_port;
212 GDHandle old_gdh;
213 RGBColor color;
214
215 GetGWorld (&old_port, &old_gdh);
216 SetGWorld (ximage, NULL);
217
218 color.red = RED16_FROM_ULONG (pixel);
219 color.green = GREEN16_FROM_ULONG (pixel);
220 color.blue = BLUE16_FROM_ULONG (pixel);
221
222 SetCPixel (x, y, &color);
223
224 SetGWorld (old_port, old_gdh);
225 }
197} 226}
198 227
199static unsigned long 228static unsigned long
@@ -201,17 +230,40 @@ XGetPixel (ximage, x, y)
201 XImagePtr ximage; 230 XImagePtr ximage;
202 int x, y; 231 int x, y;
203{ 232{
204 CGrafPtr old_port; 233 PixMapHandle pixmap = GetGWorldPixMap (ximage);
205 GDHandle old_gdh; 234 short depth = GetPixDepth (pixmap);
206 RGBColor color;
207 235
208 GetGWorld (&old_port, &old_gdh); 236 if (depth == 32)
209 SetGWorld (ximage, NULL); 237 {
238 char *base_addr = GetPixBaseAddr (pixmap);
239 short row_bytes = GetPixRowBytes (pixmap);
210 240
211 GetCPixel (x, y, &color); 241 return ((unsigned long *) (base_addr + y * row_bytes))[x];
242 }
243 else if (depth == 1)
244 {
245 char *base_addr = GetPixBaseAddr (pixmap);
246 short row_bytes = GetPixRowBytes (pixmap);
212 247
213 SetGWorld (old_port, old_gdh); 248 if (base_addr[y * row_bytes + x / 8] & (1 << (~x & 7)))
214 return RGB_TO_ULONG (color.red >> 8, color.green >> 8, color.blue >> 8); 249 return PIX_MASK_DRAW;
250 else
251 return PIX_MASK_RETAIN;
252 }
253 else
254 {
255 CGrafPtr old_port;
256 GDHandle old_gdh;
257 RGBColor color;
258
259 GetGWorld (&old_port, &old_gdh);
260 SetGWorld (ximage, NULL);
261
262 GetCPixel (x, y, &color);
263
264 SetGWorld (old_port, old_gdh);
265 return RGB_TO_ULONG (color.red >> 8, color.green >> 8, color.blue >> 8);
266 }
215} 267}
216 268
217static void 269static void
@@ -1300,7 +1352,7 @@ image_background_transparent (img, f, mask)
1300 } 1352 }
1301 1353
1302 img->background_transparent 1354 img->background_transparent
1303 = (four_corners_best (mask, img->width, img->height) == PIX_MASK_RETAIN (f)); 1355 = (four_corners_best (mask, img->width, img->height) == PIX_MASK_RETAIN);
1304 1356
1305 if (free_mask) 1357 if (free_mask)
1306 Destroy_Image (mask, prev); 1358 Destroy_Image (mask, prev);
@@ -2003,7 +2055,6 @@ x_create_x_image_and_pixmap (f, width, height, depth, ximg, pixmap)
2003 *pixmap = XCreatePixmap (display, window, width, height, depth); 2055 *pixmap = XCreatePixmap (display, window, width, height, depth);
2004 if (*pixmap == NO_PIXMAP) 2056 if (*pixmap == NO_PIXMAP)
2005 { 2057 {
2006 x_destroy_x_image (*ximg);
2007 *ximg = NULL; 2058 *ximg = NULL;
2008 image_error ("Unable to create X pixmap", Qnil, Qnil); 2059 image_error ("Unable to create X pixmap", Qnil, Qnil);
2009 return 0; 2060 return 0;
@@ -2166,10 +2217,8 @@ find_image_fsspec (specified_file, file, fss)
2166 Lisp_Object specified_file, *file; 2217 Lisp_Object specified_file, *file;
2167 FSSpec *fss; 2218 FSSpec *fss;
2168{ 2219{
2169#if TARGET_API_MAC_CARBON 2220#if MAC_OSX
2170 FSRef fsr; 2221 FSRef fsr;
2171#else
2172 Str255 mac_pathname;
2173#endif 2222#endif
2174 OSErr err; 2223 OSErr err;
2175 2224
@@ -2178,15 +2227,12 @@ find_image_fsspec (specified_file, file, fss)
2178 return fnfErr; /* file or directory not found; 2227 return fnfErr; /* file or directory not found;
2179 incomplete pathname */ 2228 incomplete pathname */
2180 /* Try to open the image file. */ 2229 /* Try to open the image file. */
2181#if TARGET_API_MAC_CARBON 2230#if MAC_OSX
2182 err = FSPathMakeRef (SDATA (*file), &fsr, NULL); 2231 err = FSPathMakeRef (SDATA (*file), &fsr, NULL);
2183 if (err == noErr) 2232 if (err == noErr)
2184 err = FSGetCatalogInfo (&fsr, kFSCatInfoNone, NULL, NULL, fss, NULL); 2233 err = FSGetCatalogInfo (&fsr, kFSCatInfoNone, NULL, NULL, fss, NULL);
2185#else 2234#else
2186 if (posix_to_mac_pathname (SDATA (*file), mac_pathname, MAXPATHLEN+1) == 0) 2235 err = posix_pathname_to_fsspec (SDATA (*file), fss);
2187 return fnfErr;
2188 c2pstr (mac_pathname);
2189 err = FSMakeFSSpec (0, 0, mac_pathname, fss);
2190#endif 2236#endif
2191 return err; 2237 return err;
2192} 2238}
@@ -3850,24 +3896,24 @@ xpm_load (f, img)
3850 Only XPM version 3 (without any extensions) is supported. */ 3896 Only XPM version 3 (without any extensions) is supported. */
3851 3897
3852static int xpm_scan P_ ((unsigned char **, unsigned char *, 3898static int xpm_scan P_ ((unsigned char **, unsigned char *,
3853 unsigned char **, int *)); 3899 unsigned char **, int *));
3854static Lisp_Object xpm_make_color_table_v 3900static Lisp_Object xpm_make_color_table_v
3855 P_ ((void (**) (Lisp_Object, unsigned char *, int, Lisp_Object), 3901 P_ ((void (**) (Lisp_Object, unsigned char *, int, Lisp_Object),
3856 Lisp_Object (**) (Lisp_Object, unsigned char *, int))); 3902 Lisp_Object (**) (Lisp_Object, unsigned char *, int)));
3857static void xpm_put_color_table_v P_ ((Lisp_Object, unsigned char *, 3903static void xpm_put_color_table_v P_ ((Lisp_Object, unsigned char *,
3858 int, Lisp_Object)); 3904 int, Lisp_Object));
3859static Lisp_Object xpm_get_color_table_v P_ ((Lisp_Object, 3905static Lisp_Object xpm_get_color_table_v P_ ((Lisp_Object,
3860 unsigned char *, int)); 3906 unsigned char *, int));
3861static Lisp_Object xpm_make_color_table_h 3907static Lisp_Object xpm_make_color_table_h
3862 P_ ((void (**) (Lisp_Object, unsigned char *, int, Lisp_Object), 3908 P_ ((void (**) (Lisp_Object, unsigned char *, int, Lisp_Object),
3863 Lisp_Object (**) (Lisp_Object, unsigned char *, int))); 3909 Lisp_Object (**) (Lisp_Object, unsigned char *, int)));
3864static void xpm_put_color_table_h P_ ((Lisp_Object, unsigned char *, 3910static void xpm_put_color_table_h P_ ((Lisp_Object, unsigned char *,
3865 int, Lisp_Object)); 3911 int, Lisp_Object));
3866static Lisp_Object xpm_get_color_table_h P_ ((Lisp_Object, 3912static Lisp_Object xpm_get_color_table_h P_ ((Lisp_Object,
3867 unsigned char *, int)); 3913 unsigned char *, int));
3868static int xpm_str_to_color_key P_ ((char *)); 3914static int xpm_str_to_color_key P_ ((char *));
3869static int xpm_load_image P_ ((struct frame *, struct image *, 3915static int xpm_load_image P_ ((struct frame *, struct image *,
3870 unsigned char *, unsigned char *)); 3916 unsigned char *, unsigned char *));
3871 3917
3872/* Tokens returned from xpm_scan. */ 3918/* Tokens returned from xpm_scan. */
3873 3919
@@ -3896,49 +3942,49 @@ xpm_scan (s, end, beg, len)
3896 { 3942 {
3897 /* Skip white-space. */ 3943 /* Skip white-space. */
3898 while (*s < end && (c = *(*s)++, isspace (c))) 3944 while (*s < end && (c = *(*s)++, isspace (c)))
3899 ; 3945 ;
3900 3946
3901 /* gnus-pointer.xpm uses '-' in its identifier. 3947 /* gnus-pointer.xpm uses '-' in its identifier.
3902 sb-dir-plus.xpm uses '+' in its identifier. */ 3948 sb-dir-plus.xpm uses '+' in its identifier. */
3903 if (isalpha (c) || c == '_' || c == '-' || c == '+') 3949 if (isalpha (c) || c == '_' || c == '-' || c == '+')
3904 { 3950 {
3905 *beg = *s - 1; 3951 *beg = *s - 1;
3906 while (*s < end && 3952 while (*s < end &&
3907 (c = **s, isalnum (c) || c == '_' || c == '-' || c == '+')) 3953 (c = **s, isalnum (c) || c == '_' || c == '-' || c == '+'))
3908 ++*s; 3954 ++*s;
3909 *len = *s - *beg; 3955 *len = *s - *beg;
3910 return XPM_TK_IDENT; 3956 return XPM_TK_IDENT;
3911 } 3957 }
3912 else if (c == '"') 3958 else if (c == '"')
3913 { 3959 {
3914 *beg = *s; 3960 *beg = *s;
3915 while (*s < end && **s != '"') 3961 while (*s < end && **s != '"')
3916 ++*s; 3962 ++*s;
3917 *len = *s - *beg; 3963 *len = *s - *beg;
3918 if (*s < end) 3964 if (*s < end)
3919 ++*s; 3965 ++*s;
3920 return XPM_TK_STRING; 3966 return XPM_TK_STRING;
3921 } 3967 }
3922 else if (c == '/') 3968 else if (c == '/')
3923 { 3969 {
3924 if (*s < end && **s == '*') 3970 if (*s < end && **s == '*')
3925 { 3971 {
3926 /* C-style comment. */ 3972 /* C-style comment. */
3927 ++*s; 3973 ++*s;
3928 do 3974 do
3929 { 3975 {
3930 while (*s < end && *(*s)++ != '*') 3976 while (*s < end && *(*s)++ != '*')
3931 ; 3977 ;
3932 } 3978 }
3933 while (*s < end && **s != '/'); 3979 while (*s < end && **s != '/');
3934 if (*s < end) 3980 if (*s < end)
3935 ++*s; 3981 ++*s;
3936 } 3982 }
3937 else 3983 else
3938 return c; 3984 return c;
3939 } 3985 }
3940 else 3986 else
3941 return c; 3987 return c;
3942 } 3988 }
3943 3989
3944 return XPM_TK_EOF; 3990 return XPM_TK_EOF;
@@ -3988,9 +4034,9 @@ xpm_make_color_table_h (put_func, get_func)
3988 *put_func = xpm_put_color_table_h; 4034 *put_func = xpm_put_color_table_h;
3989 *get_func = xpm_get_color_table_h; 4035 *get_func = xpm_get_color_table_h;
3990 return make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE), 4036 return make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE),
3991 make_float (DEFAULT_REHASH_SIZE), 4037 make_float (DEFAULT_REHASH_SIZE),
3992 make_float (DEFAULT_REHASH_THRESHOLD), 4038 make_float (DEFAULT_REHASH_THRESHOLD),
3993 Qnil, Qnil, Qnil); 4039 Qnil, Qnil, Qnil);
3994} 4040}
3995 4041
3996static void 4042static void
@@ -4016,7 +4062,7 @@ xpm_get_color_table_h (color_table, chars_start, chars_len)
4016{ 4062{
4017 struct Lisp_Hash_Table *table = XHASH_TABLE (color_table); 4063 struct Lisp_Hash_Table *table = XHASH_TABLE (color_table);
4018 int i = hash_lookup (table, make_unibyte_string (chars_start, chars_len), 4064 int i = hash_lookup (table, make_unibyte_string (chars_start, chars_len),
4019 NULL); 4065 NULL);
4020 4066
4021 return i >= 0 ? HASH_VALUE (table, i) : Qnil; 4067 return i >= 0 ? HASH_VALUE (table, i) : Qnil;
4022} 4068}
@@ -4065,17 +4111,17 @@ xpm_load_image (f, img, contents, end)
4065#define match() \ 4111#define match() \
4066 LA1 = xpm_scan (&s, end, &beg, &len) 4112 LA1 = xpm_scan (&s, end, &beg, &len)
4067 4113
4068#define expect(TOKEN) \ 4114#define expect(TOKEN) \
4069 if (LA1 != (TOKEN)) \ 4115 if (LA1 != (TOKEN)) \
4070 goto failure; \ 4116 goto failure; \
4071 else \ 4117 else \
4072 match () 4118 match ()
4073 4119
4074#define expect_ident(IDENT) \ 4120#define expect_ident(IDENT) \
4075 if (LA1 == XPM_TK_IDENT \ 4121 if (LA1 == XPM_TK_IDENT \
4076 && strlen ((IDENT)) == len && memcmp ((IDENT), beg, len) == 0) \ 4122 && strlen ((IDENT)) == len && memcmp ((IDENT), beg, len) == 0) \
4077 match (); \ 4123 match (); \
4078 else \ 4124 else \
4079 goto failure 4125 goto failure
4080 4126
4081 if (!(end - s >= 9 && memcmp (s, "/* XPM */", 9) == 0)) 4127 if (!(end - s >= 9 && memcmp (s, "/* XPM */", 9) == 0))
@@ -4096,7 +4142,7 @@ xpm_load_image (f, img, contents, end)
4096 memcpy (buffer, beg, len); 4142 memcpy (buffer, beg, len);
4097 buffer[len] = '\0'; 4143 buffer[len] = '\0';
4098 if (sscanf (buffer, "%d %d %d %d", &width, &height, 4144 if (sscanf (buffer, "%d %d %d %d", &width, &height,
4099 &num_colors, &chars_per_pixel) != 4 4145 &num_colors, &chars_per_pixel) != 4
4100 || width <= 0 || height <= 0 4146 || width <= 0 || height <= 0
4101 || num_colors <= 0 || chars_per_pixel <= 0) 4147 || num_colors <= 0 || chars_per_pixel <= 0)
4102 goto failure; 4148 goto failure;
@@ -4107,17 +4153,17 @@ xpm_load_image (f, img, contents, end)
4107 best_key = XPM_COLOR_KEY_C; 4153 best_key = XPM_COLOR_KEY_C;
4108 else if (!NILP (Fx_display_grayscale_p (frame))) 4154 else if (!NILP (Fx_display_grayscale_p (frame)))
4109 best_key = (XFASTINT (Fx_display_planes (frame)) > 2 4155 best_key = (XFASTINT (Fx_display_planes (frame)) > 2
4110 ? XPM_COLOR_KEY_G : XPM_COLOR_KEY_G4); 4156 ? XPM_COLOR_KEY_G : XPM_COLOR_KEY_G4);
4111 else 4157 else
4112 best_key = XPM_COLOR_KEY_M; 4158 best_key = XPM_COLOR_KEY_M;
4113 4159
4114 color_symbols = image_spec_value (img->spec, QCcolor_symbols, NULL); 4160 color_symbols = image_spec_value (img->spec, QCcolor_symbols, NULL);
4115 if (chars_per_pixel == 1) 4161 if (chars_per_pixel == 1)
4116 color_table = xpm_make_color_table_v (&put_color_table, 4162 color_table = xpm_make_color_table_v (&put_color_table,
4117 &get_color_table); 4163 &get_color_table);
4118 else 4164 else
4119 color_table = xpm_make_color_table_h (&put_color_table, 4165 color_table = xpm_make_color_table_h (&put_color_table,
4120 &get_color_table); 4166 &get_color_table);
4121 4167
4122 while (num_colors-- > 0) 4168 while (num_colors-- > 0)
4123 { 4169 {
@@ -4128,71 +4174,71 @@ xpm_load_image (f, img, contents, end)
4128 4174
4129 expect (XPM_TK_STRING); 4175 expect (XPM_TK_STRING);
4130 if (len <= chars_per_pixel || len >= BUFSIZ + chars_per_pixel) 4176 if (len <= chars_per_pixel || len >= BUFSIZ + chars_per_pixel)
4131 goto failure; 4177 goto failure;
4132 memcpy (buffer, beg + chars_per_pixel, len - chars_per_pixel); 4178 memcpy (buffer, beg + chars_per_pixel, len - chars_per_pixel);
4133 buffer[len - chars_per_pixel] = '\0'; 4179 buffer[len - chars_per_pixel] = '\0';
4134 4180
4135 str = strtok (buffer, " \t"); 4181 str = strtok (buffer, " \t");
4136 if (str == NULL) 4182 if (str == NULL)
4137 goto failure; 4183 goto failure;
4138 key = xpm_str_to_color_key (str); 4184 key = xpm_str_to_color_key (str);
4139 if (key < 0) 4185 if (key < 0)
4140 goto failure; 4186 goto failure;
4141 do 4187 do
4142 { 4188 {
4143 color = strtok (NULL, " \t"); 4189 color = strtok (NULL, " \t");
4144 if (color == NULL) 4190 if (color == NULL)
4145 goto failure; 4191 goto failure;
4146 4192
4147 while (str = strtok (NULL, " \t")) 4193 while (str = strtok (NULL, " \t"))
4148 { 4194 {
4149 next_key = xpm_str_to_color_key (str); 4195 next_key = xpm_str_to_color_key (str);
4150 if (next_key >= 0) 4196 if (next_key >= 0)
4151 break; 4197 break;
4152 color[strlen (color)] = ' '; 4198 color[strlen (color)] = ' ';
4153 } 4199 }
4154 4200
4155 if (key == XPM_COLOR_KEY_S) 4201 if (key == XPM_COLOR_KEY_S)
4156 { 4202 {
4157 if (NILP (symbol_color)) 4203 if (NILP (symbol_color))
4158 symbol_color = build_string (color); 4204 symbol_color = build_string (color);
4159 } 4205 }
4160 else if (max_key < key && key <= best_key) 4206 else if (max_key < key && key <= best_key)
4161 { 4207 {
4162 max_key = key; 4208 max_key = key;
4163 max_color = color; 4209 max_color = color;
4164 } 4210 }
4165 key = next_key; 4211 key = next_key;
4166 } 4212 }
4167 while (str); 4213 while (str);
4168 4214
4169 color_val = Qnil; 4215 color_val = Qnil;
4170 if (!NILP (color_symbols) && !NILP (symbol_color)) 4216 if (!NILP (color_symbols) && !NILP (symbol_color))
4171 { 4217 {
4172 Lisp_Object specified_color = Fassoc (symbol_color, color_symbols); 4218 Lisp_Object specified_color = Fassoc (symbol_color, color_symbols);
4173 4219
4174 if (CONSP (specified_color) && STRINGP (XCDR (specified_color))) 4220 if (CONSP (specified_color) && STRINGP (XCDR (specified_color)))
4175 if (xstricmp (SDATA (XCDR (specified_color)), "None") == 0) 4221 if (xstricmp (SDATA (XCDR (specified_color)), "None") == 0)
4176 color_val = Qt; 4222 color_val = Qt;
4177 else if (x_defined_color (f, SDATA (XCDR (specified_color)), 4223 else if (x_defined_color (f, SDATA (XCDR (specified_color)),
4178 &cdef, 0)) 4224 &cdef, 0))
4179 color_val = make_number (cdef.pixel); 4225 color_val = make_number (cdef.pixel);
4180 } 4226 }
4181 if (NILP (color_val) && max_key > 0) 4227 if (NILP (color_val) && max_key > 0)
4182 if (xstricmp (max_color, "None") == 0) 4228 if (xstricmp (max_color, "None") == 0)
4183 color_val = Qt; 4229 color_val = Qt;
4184 else if (x_defined_color (f, max_color, &cdef, 0)) 4230 else if (x_defined_color (f, max_color, &cdef, 0))
4185 color_val = make_number (cdef.pixel); 4231 color_val = make_number (cdef.pixel);
4186 if (!NILP (color_val)) 4232 if (!NILP (color_val))
4187 (*put_color_table) (color_table, beg, chars_per_pixel, color_val); 4233 (*put_color_table) (color_table, beg, chars_per_pixel, color_val);
4188 4234
4189 expect (','); 4235 expect (',');
4190 } 4236 }
4191 4237
4192 if (!x_create_x_image_and_pixmap (f, width, height, 0, 4238 if (!x_create_x_image_and_pixmap (f, width, height, 0,
4193 &ximg, &img->pixmap) 4239 &ximg, &img->pixmap)
4194 || !x_create_x_image_and_pixmap (f, width, height, 1, 4240 || !x_create_x_image_and_pixmap (f, width, height, 1,
4195 &mask_img, &img->mask)) 4241 &mask_img, &img->mask))
4196 { 4242 {
4197 image_error ("Out of memory (%s)", img->spec, Qnil); 4243 image_error ("Out of memory (%s)", img->spec, Qnil);
4198 goto error; 4244 goto error;
@@ -4203,21 +4249,21 @@ xpm_load_image (f, img, contents, end)
4203 expect (XPM_TK_STRING); 4249 expect (XPM_TK_STRING);
4204 str = beg; 4250 str = beg;
4205 if (len < width * chars_per_pixel) 4251 if (len < width * chars_per_pixel)
4206 goto failure; 4252 goto failure;
4207 for (x = 0; x < width; x++, str += chars_per_pixel) 4253 for (x = 0; x < width; x++, str += chars_per_pixel)
4208 { 4254 {
4209 Lisp_Object color_val = 4255 Lisp_Object color_val =
4210 (*get_color_table) (color_table, str, chars_per_pixel); 4256 (*get_color_table) (color_table, str, chars_per_pixel);
4211 4257
4212 XPutPixel (ximg, x, y, 4258 XPutPixel (ximg, x, y,
4213 (INTEGERP (color_val) ? XINT (color_val) 4259 (INTEGERP (color_val) ? XINT (color_val)
4214 : FRAME_FOREGROUND_PIXEL (f))); 4260 : FRAME_FOREGROUND_PIXEL (f)));
4215 XPutPixel (mask_img, x, y, 4261 XPutPixel (mask_img, x, y,
4216 (!EQ (color_val, Qt) ? PIX_MASK_DRAW (f) 4262 (!EQ (color_val, Qt) ? PIX_MASK_DRAW
4217 : (have_mask = 1, PIX_MASK_RETAIN (f)))); 4263 : (have_mask = 1, PIX_MASK_RETAIN)));
4218 } 4264 }
4219 if (y + 1 < height) 4265 if (y + 1 < height)
4220 expect (','); 4266 expect (',');
4221 } 4267 }
4222 4268
4223 img->width = width; 4269 img->width = width;
@@ -4227,6 +4273,10 @@ xpm_load_image (f, img, contents, end)
4227 x_destroy_x_image (ximg); 4273 x_destroy_x_image (ximg);
4228 if (have_mask) 4274 if (have_mask)
4229 { 4275 {
4276 /* Fill in the background_transparent field while we have the
4277 mask handy. */
4278 image_background_transparent (img, f, mask_img);
4279
4230 x_put_x_image (f, mask_img, img->mask, width, height); 4280 x_put_x_image (f, mask_img, img->mask, width, height);
4231 x_destroy_x_image (mask_img); 4281 x_destroy_x_image (mask_img);
4232 } 4282 }
@@ -4272,19 +4322,19 @@ xpm_load (f, img)
4272 file = x_find_image_file (file_name); 4322 file = x_find_image_file (file_name);
4273 GCPRO1 (file); 4323 GCPRO1 (file);
4274 if (!STRINGP (file)) 4324 if (!STRINGP (file))
4275 { 4325 {
4276 image_error ("Cannot find image file `%s'", file_name, Qnil); 4326 image_error ("Cannot find image file `%s'", file_name, Qnil);
4277 UNGCPRO; 4327 UNGCPRO;
4278 return 0; 4328 return 0;
4279 } 4329 }
4280 4330
4281 contents = slurp_file (SDATA (file), &size); 4331 contents = slurp_file (SDATA (file), &size);
4282 if (contents == NULL) 4332 if (contents == NULL)
4283 { 4333 {
4284 image_error ("Error loading XPM image `%s'", img->spec, Qnil); 4334 image_error ("Error loading XPM image `%s'", img->spec, Qnil);
4285 UNGCPRO; 4335 UNGCPRO;
4286 return 0; 4336 return 0;
4287 } 4337 }
4288 4338
4289 success_p = xpm_load_image (f, img, contents, contents + size); 4339 success_p = xpm_load_image (f, img, contents, contents + size);
4290 xfree (contents); 4340 xfree (contents);
@@ -4296,7 +4346,7 @@ xpm_load (f, img)
4296 4346
4297 data = image_spec_value (img->spec, QCdata, NULL); 4347 data = image_spec_value (img->spec, QCdata, NULL);
4298 success_p = xpm_load_image (f, img, SDATA (data), 4348 success_p = xpm_load_image (f, img, SDATA (data),
4299 SDATA (data) + SBYTES (data)); 4349 SDATA (data) + SBYTES (data));
4300 } 4350 }
4301 4351
4302 return success_p; 4352 return success_p;
@@ -4973,7 +5023,7 @@ x_disable_image (f, img)
4973 5023
4974#ifdef MAC_OS 5024#ifdef MAC_OS
4975#define XCreateGC_pixmap(dpy, pixmap) XCreateGC (dpy, NULL, 0, NULL) 5025#define XCreateGC_pixmap(dpy, pixmap) XCreateGC (dpy, NULL, 0, NULL)
4976#define MaskForeground(f) PIX_MASK_DRAW (f) 5026#define MaskForeground(f) PIX_MASK_DRAW
4977#else 5027#else
4978#define XCreateGC_pixmap(dpy, pixmap) XCreateGC (dpy, pixmap, 0, NULL) 5028#define XCreateGC_pixmap(dpy, pixmap) XCreateGC (dpy, pixmap, 0, NULL)
4979#define MaskForeground(f) WHITE_PIX_DEFAULT (f) 5029#define MaskForeground(f) WHITE_PIX_DEFAULT (f)
@@ -5121,7 +5171,7 @@ x_build_heuristic_mask (f, img, how)
5121 for (y = 0; y < img->height; ++y) 5171 for (y = 0; y < img->height; ++y)
5122 for (x = 0; x < img->width; ++x) 5172 for (x = 0; x < img->width; ++x)
5123 XPutPixel (mask_img, x, y, (XGetPixel (ximg, x, y) != bg 5173 XPutPixel (mask_img, x, y, (XGetPixel (ximg, x, y) != bg
5124 ? PIX_MASK_DRAW (f) : PIX_MASK_RETAIN (f))); 5174 ? PIX_MASK_DRAW : PIX_MASK_RETAIN));
5125 5175
5126 /* Fill in the background_transparent field while we have the mask handy. */ 5176 /* Fill in the background_transparent field while we have the mask handy. */
5127 image_background_transparent (img, f, mask_img); 5177 image_background_transparent (img, f, mask_img);
@@ -6123,7 +6173,7 @@ png_load (f, img)
6123 if (channels == 4) 6173 if (channels == 4)
6124 { 6174 {
6125 if (mask_img) 6175 if (mask_img)
6126 XPutPixel (mask_img, x, y, *p > 0 ? PIX_MASK_DRAW (f) : PIX_MASK_RETAIN (f)); 6176 XPutPixel (mask_img, x, y, *p > 0 ? PIX_MASK_DRAW : PIX_MASK_RETAIN);
6127 ++p; 6177 ++p;
6128 } 6178 }
6129 } 6179 }
@@ -8025,6 +8075,11 @@ syms_of_image ()
8025{ 8075{
8026 extern Lisp_Object Qrisky_local_variable; /* Syms_of_xdisp has already run. */ 8076 extern Lisp_Object Qrisky_local_variable; /* Syms_of_xdisp has already run. */
8027 8077
8078 /* Initialize this only once, since that's what we do with Vimage_types
8079 and they are supposed to be in sync. Initializing here gives correct
8080 operation on GNU/Linux of calling dump-emacs after loading some images. */
8081 image_types = NULL;
8082
8028 /* Must be defined now becase we're going to update it below, while 8083 /* Must be defined now becase we're going to update it below, while
8029 defining the supported image types. */ 8084 defining the supported image types. */
8030 DEFVAR_LISP ("image-types", &Vimage_types, 8085 DEFVAR_LISP ("image-types", &Vimage_types,
@@ -8050,6 +8105,17 @@ listed; they're always supported. */);
8050 Vimage_type_cache = Qnil; 8105 Vimage_type_cache = Qnil;
8051 staticpro (&Vimage_type_cache); 8106 staticpro (&Vimage_type_cache);
8052 8107
8108 Qpbm = intern ("pbm");
8109 staticpro (&Qpbm);
8110 ADD_IMAGE_TYPE(Qpbm);
8111
8112 Qxbm = intern ("xbm");
8113 staticpro (&Qxbm);
8114 ADD_IMAGE_TYPE(Qxbm);
8115
8116 define_image_type (&xbm_type, 1);
8117 define_image_type (&pbm_type, 1);
8118
8053 QCascent = intern (":ascent"); 8119 QCascent = intern (":ascent");
8054 staticpro (&QCascent); 8120 staticpro (&QCascent);
8055 QCmargin = intern (":margin"); 8121 QCmargin = intern (":margin");
@@ -8094,14 +8160,6 @@ listed; they're always supported. */);
8094 staticpro (&QCpt_height); 8160 staticpro (&QCpt_height);
8095#endif /* HAVE_GHOSTSCRIPT */ 8161#endif /* HAVE_GHOSTSCRIPT */
8096 8162
8097 Qpbm = intern ("pbm");
8098 staticpro (&Qpbm);
8099 ADD_IMAGE_TYPE(Qpbm);
8100
8101 Qxbm = intern ("xbm");
8102 staticpro (&Qxbm);
8103 ADD_IMAGE_TYPE(Qxbm);
8104
8105#if defined (HAVE_XPM) || defined (MAC_OS) 8163#if defined (HAVE_XPM) || defined (MAC_OS)
8106 Qxpm = intern ("xpm"); 8164 Qxpm = intern ("xpm");
8107 staticpro (&Qxpm); 8165 staticpro (&Qxpm);
@@ -8163,11 +8221,6 @@ meaning don't clear the cache. */);
8163void 8221void
8164init_image () 8222init_image ()
8165{ 8223{
8166 image_types = NULL;
8167
8168 define_image_type (&xbm_type, 1);
8169 define_image_type (&pbm_type, 1);
8170
8171#ifdef MAC_OS 8224#ifdef MAC_OS
8172 /* Animated gifs use QuickTime Movie Toolbox. So initialize it here. */ 8225 /* Animated gifs use QuickTime Movie Toolbox. So initialize it here. */
8173 EnterMovies (); 8226 EnterMovies ();
diff --git a/src/indent.c b/src/indent.c
index 2dc113a9086..68544e8059d 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1,6 +1,6 @@
1/* Indentation functions. 1/* Indentation functions.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1998, 2000, 2001, 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1998, 2000, 2001,
3 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -2076,6 +2076,7 @@ whether or not it is currently displayed in some window. */)
2076 { 2076 {
2077 int it_start; 2077 int it_start;
2078 int oselective; 2078 int oselective;
2079 int start_on_image_p;
2079 2080
2080 SET_TEXT_POS (pt, PT, PT_BYTE); 2081 SET_TEXT_POS (pt, PT, PT_BYTE);
2081 start_display (&it, w, pt); 2082 start_display (&it, w, pt);
@@ -2087,6 +2088,7 @@ whether or not it is currently displayed in some window. */)
2087 while the end position is really at some X > 0, the same X that 2088 while the end position is really at some X > 0, the same X that
2088 PT had. */ 2089 PT had. */
2089 it_start = IT_CHARPOS (it); 2090 it_start = IT_CHARPOS (it);
2091 start_on_image_p = (it.method == GET_FROM_IMAGE);
2090 reseat_at_previous_visible_line_start (&it); 2092 reseat_at_previous_visible_line_start (&it);
2091 it.current_x = it.hpos = 0; 2093 it.current_x = it.hpos = 0;
2092 /* Temporarily disable selective display so we don't move too far */ 2094 /* Temporarily disable selective display so we don't move too far */
@@ -2096,8 +2098,10 @@ whether or not it is currently displayed in some window. */)
2096 it.selective = oselective; 2098 it.selective = oselective;
2097 2099
2098 /* Move back if we got too far. This may happen if 2100 /* Move back if we got too far. This may happen if
2099 truncate-lines is on and PT is beyond right margin. */ 2101 truncate-lines is on and PT is beyond right margin.
2100 if (IT_CHARPOS (it) > it_start && XINT (lines) > 0) 2102 It may also happen if it_start is on an image --
2103 in that case, don't go back. */
2104 if (IT_CHARPOS (it) > it_start && XINT (lines) > 0 && !start_on_image_p)
2101 move_it_by_lines (&it, -1, 0); 2105 move_it_by_lines (&it, -1, 0);
2102 2106
2103 it.vpos = 0; 2107 it.vpos = 0;
diff --git a/src/indent.h b/src/indent.h
index 39db7b8cf5f..6026be827e8 100644
--- a/src/indent.h
+++ b/src/indent.h
@@ -1,5 +1,6 @@
1/* Definitions for interface to indent.c 1/* Definitions for interface to indent.c
2 Copyright (C) 1985, 1986 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/insdel.c b/src/insdel.c
index 4760342c56b..fd416037241 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1,6 +1,6 @@
1/* Buffer insertion/deletion and gap motion for GNU Emacs. 1/* Buffer insertion/deletion and gap motion for GNU Emacs.
2 Copyright (C) 1985, 86,93,94,95,97,98, 1999, 2000, 01, 2003, 2005 2 Copyright (C) 1985, 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
3 Free Software Foundation, Inc. 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -2393,6 +2393,7 @@ void
2393syms_of_insdel () 2393syms_of_insdel ()
2394{ 2394{
2395 staticpro (&combine_after_change_list); 2395 staticpro (&combine_after_change_list);
2396 staticpro (&combine_after_change_buffer);
2396 combine_after_change_list = Qnil; 2397 combine_after_change_list = Qnil;
2397 combine_after_change_buffer = Qnil; 2398 combine_after_change_buffer = Qnil;
2398 2399
diff --git a/src/intervals.c b/src/intervals.c
index cb60061fdce..07845f95666 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1,5 +1,6 @@
1/* Code for doing intervals. 1/* Code for doing intervals.
2 Copyright (C) 1993, 1994, 1995, 1997, 1998, 2002, 2003 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1994, 1995, 1997, 1998, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -790,14 +791,14 @@ update_interval (i, pos)
790 /* Move right. */ 791 /* Move right. */
791 if (pos < INTERVAL_LAST_POS (i) + TOTAL_LENGTH (i->right)) 792 if (pos < INTERVAL_LAST_POS (i) + TOTAL_LENGTH (i->right))
792 { 793 {
793 i->right->position = INTERVAL_LAST_POS (i) + 794 i->right->position = INTERVAL_LAST_POS (i)
794 LEFT_TOTAL_LENGTH (i->right); 795 + LEFT_TOTAL_LENGTH (i->right);
795 i = i->right; /* Move to the right child */ 796 i = i->right; /* Move to the right child */
796 } 797 }
797 else if (NULL_PARENT (i)) 798 else if (NULL_PARENT (i))
798 error ("Point after end of properties"); 799 error ("Point %d after end of properties", pos);
799 else 800 else
800 i = INTERVAL_PARENT (i); 801 i = INTERVAL_PARENT (i);
801 continue; 802 continue;
802 } 803 }
803 else 804 else
diff --git a/src/intervals.h b/src/intervals.h
index 374f8984167..418520b5c25 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -1,5 +1,6 @@
1/* Definitions and global variables for intervals. 1/* Definitions and global variables for intervals.
2 Copyright (C) 1993, 1994, 2000, 2002, 2003 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1994, 2000, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/keyboard.c b/src/keyboard.c
index d2d5919fc85..74f8d7d51e0 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1,6 +1,7 @@
1/* Keyboard and mouse input; editor command loop. 1/* Keyboard and mouse input; editor command loop.
2 Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995, 1996, 1997, 2 Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995,
3 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -4010,7 +4011,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
4010 kbd_fetch_ptr = event + 1; 4011 kbd_fetch_ptr = event + 1;
4011 } 4012 }
4012#endif 4013#endif
4013#if defined (HAVE_X11) || defined (HAVE_NTGUI) 4014#if defined (HAVE_X11) || defined (HAVE_NTGUI) || defined (MAC_OS)
4014 else if (event->kind == ICONIFY_EVENT) 4015 else if (event->kind == ICONIFY_EVENT)
4015 { 4016 {
4016 /* Make an event (iconify-frame (FRAME)). */ 4017 /* Make an event (iconify-frame (FRAME)). */
@@ -7001,8 +7002,6 @@ menu_bar_items (old)
7001 7002
7002 int i; 7003 int i;
7003 7004
7004 struct gcpro gcpro1;
7005
7006 /* In order to build the menus, we need to call the keymap 7005 /* In order to build the menus, we need to call the keymap
7007 accessors. They all call QUIT. But this function is called 7006 accessors. They all call QUIT. But this function is called
7008 during redisplay, during which a quit is fatal. So inhibit 7007 during redisplay, during which a quit is fatal. So inhibit
@@ -7018,8 +7017,6 @@ menu_bar_items (old)
7018 menu_bar_items_vector = Fmake_vector (make_number (24), Qnil); 7017 menu_bar_items_vector = Fmake_vector (make_number (24), Qnil);
7019 menu_bar_items_index = 0; 7018 menu_bar_items_index = 0;
7020 7019
7021 GCPRO1 (menu_bar_items_vector);
7022
7023 /* Build our list of keymaps. 7020 /* Build our list of keymaps.
7024 If we recognize a function key and replace its escape sequence in 7021 If we recognize a function key and replace its escape sequence in
7025 keybuf with its symbol, or if the sequence starts with a mouse 7022 keybuf with its symbol, or if the sequence starts with a mouse
@@ -7123,7 +7120,6 @@ menu_bar_items (old)
7123 menu_bar_items_index = i; 7120 menu_bar_items_index = i;
7124 7121
7125 Vinhibit_quit = oquit; 7122 Vinhibit_quit = oquit;
7126 UNGCPRO;
7127 return menu_bar_items_vector; 7123 return menu_bar_items_vector;
7128} 7124}
7129 7125
@@ -11167,6 +11163,9 @@ syms_of_keyboard ()
11167 menu_bar_one_keymap_changed_items = Qnil; 11163 menu_bar_one_keymap_changed_items = Qnil;
11168 staticpro (&menu_bar_one_keymap_changed_items); 11164 staticpro (&menu_bar_one_keymap_changed_items);
11169 11165
11166 menu_bar_items_vector = Qnil;
11167 staticpro (&menu_bar_items_vector);
11168
11170 defsubr (&Sevent_convert_list); 11169 defsubr (&Sevent_convert_list);
11171 defsubr (&Sread_key_sequence); 11170 defsubr (&Sread_key_sequence);
11172 defsubr (&Sread_key_sequence_vector); 11171 defsubr (&Sread_key_sequence_vector);
@@ -11443,6 +11442,7 @@ might happen repeatedly and make Emacs nonfunctional. */);
11443 doc: /* Normal hook run when clearing the echo area. */); 11442 doc: /* Normal hook run when clearing the echo area. */);
11444#endif 11443#endif
11445 Qecho_area_clear_hook = intern ("echo-area-clear-hook"); 11444 Qecho_area_clear_hook = intern ("echo-area-clear-hook");
11445 staticpro (&Qecho_area_clear_hook);
11446 SET_SYMBOL_VALUE (Qecho_area_clear_hook, Qnil); 11446 SET_SYMBOL_VALUE (Qecho_area_clear_hook, Qnil);
11447 11447
11448 DEFVAR_LISP ("lucid-menu-bar-dirty-flag", &Vlucid_menu_bar_dirty_flag, 11448 DEFVAR_LISP ("lucid-menu-bar-dirty-flag", &Vlucid_menu_bar_dirty_flag,
diff --git a/src/keyboard.h b/src/keyboard.h
index 10b64dfe488..0063922787f 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -1,5 +1,6 @@
1/* Declarations useful when processing input. 1/* Declarations useful when processing input.
2 Copyright (C) 1985, 1986, 1987, 1993 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1987, 1993, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/keymap.c b/src/keymap.c
index 17c55cfd2d6..9d67f4400c0 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1,6 +1,7 @@
1/* Manipulation of keymaps 1/* Manipulation of keymaps
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1998, 1999, 2000, 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995,
3 2001, 2004, 2005 Free Software Foundation, Inc. 3 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -1654,7 +1655,7 @@ bindings; see the description of `lookup-key' for more details about this. */)
1654 1655
1655DEFUN ("minor-mode-key-binding", Fminor_mode_key_binding, Sminor_mode_key_binding, 1, 2, 0, 1656DEFUN ("minor-mode-key-binding", Fminor_mode_key_binding, Sminor_mode_key_binding, 1, 2, 0,
1656 doc: /* Find the visible minor mode bindings of KEY. 1657 doc: /* Find the visible minor mode bindings of KEY.
1657Return an alist of pairs (MODENAME . BINDING), where MODENAME is the 1658Return an alist of pairs (MODENAME . BINDING), where MODENAME is
1658the symbol which names the minor mode binding KEY, and BINDING is 1659the symbol which names the minor mode binding KEY, and BINDING is
1659KEY's definition in that mode. In particular, if KEY has no 1660KEY's definition in that mode. In particular, if KEY has no
1660minor-mode bindings, return nil. If the first binding is a 1661minor-mode bindings, return nil. If the first binding is a
diff --git a/src/keymap.h b/src/keymap.h
index 4fcbffbed5a..bcf14abcd89 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -1,5 +1,5 @@
1/* Functions to manipulate keymaps. 1/* Functions to manipulate keymaps.
2 Copyright (C) 2001, 2005 Free Software Foundation, Inc. 2 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/lastfile.c b/src/lastfile.c
index d03dc2c8346..a229d94fd6a 100644
--- a/src/lastfile.c
+++ b/src/lastfile.c
@@ -1,5 +1,5 @@
1/* Mark end of data space to dump as pure, for GNU Emacs. 1/* Mark end of data space to dump as pure, for GNU Emacs.
2 Copyright (C) 1985 Free Software Foundation, Inc. 2 Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/lisp.h b/src/lisp.h
index 5c0e9b561ad..8f37c715c29 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1,6 +1,6 @@
1/* Fundamental definitions for GNU Emacs Lisp interpreter. 1/* Fundamental definitions for GNU Emacs Lisp interpreter.
2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2000,
3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -1797,7 +1797,7 @@ extern int interrupt_input_pending;
1797 Lisp_Object flag = Vquit_flag; \ 1797 Lisp_Object flag = Vquit_flag; \
1798 Vquit_flag = Qnil; \ 1798 Vquit_flag = Qnil; \
1799 if (EQ (Vthrow_on_input, flag)) \ 1799 if (EQ (Vthrow_on_input, flag)) \
1800 Fthrow (Vthrow_on_input, Qnil); \ 1800 Fthrow (Vthrow_on_input, Qt); \
1801 Fsignal (Qquit, Qnil); \ 1801 Fsignal (Qquit, Qnil); \
1802 } \ 1802 } \
1803 else if (interrupt_input_pending) \ 1803 else if (interrupt_input_pending) \
@@ -1813,7 +1813,7 @@ extern int interrupt_input_pending;
1813 Lisp_Object flag = Vquit_flag; \ 1813 Lisp_Object flag = Vquit_flag; \
1814 Vquit_flag = Qnil; \ 1814 Vquit_flag = Qnil; \
1815 if (EQ (Vthrow_on_input, flag)) \ 1815 if (EQ (Vthrow_on_input, flag)) \
1816 Fthrow (Vthrow_on_input, Qnil); \ 1816 Fthrow (Vthrow_on_input, Qt); \
1817 Fsignal (Qquit, Qnil); \ 1817 Fsignal (Qquit, Qnil); \
1818 } \ 1818 } \
1819 } while (0) 1819 } while (0)
@@ -1876,10 +1876,12 @@ extern Lisp_Object Vascii_canon_table, Vascii_eqv_table;
1876 1876
1877extern int consing_since_gc; 1877extern int consing_since_gc;
1878 1878
1879/* Threshold for doing another gc. */ 1879/* Thresholds for doing another gc. */
1880 1880
1881extern EMACS_INT gc_cons_threshold; 1881extern EMACS_INT gc_cons_threshold;
1882 1882
1883extern EMACS_INT gc_relative_threshold;
1884
1883/* Structure for recording stack slots that need marking. */ 1885/* Structure for recording stack slots that need marking. */
1884 1886
1885/* This is a chain of structures, each of which points at a Lisp_Object variable 1887/* This is a chain of structures, each of which points at a Lisp_Object variable
@@ -3024,12 +3026,9 @@ extern int wait_reading_process_output P_ ((int, int, int, int,
3024 Lisp_Object, 3026 Lisp_Object,
3025 struct Lisp_Process *, 3027 struct Lisp_Process *,
3026 int)); 3028 int));
3027extern void deactivate_process P_ ((Lisp_Object));
3028extern void add_keyboard_wait_descriptor P_ ((int)); 3029extern void add_keyboard_wait_descriptor P_ ((int));
3029extern void delete_keyboard_wait_descriptor P_ ((int)); 3030extern void delete_keyboard_wait_descriptor P_ ((int));
3030extern void close_process_descs P_ ((void)); 3031extern void close_process_descs P_ ((void));
3031extern void status_notify P_ ((void));
3032extern int read_process_output P_ ((Lisp_Object, int));
3033extern void init_process P_ ((void)); 3032extern void init_process P_ ((void));
3034extern void syms_of_process P_ ((void)); 3033extern void syms_of_process P_ ((void));
3035extern void setup_process_coding_systems P_ ((Lisp_Object)); 3034extern void setup_process_coding_systems P_ ((Lisp_Object));
diff --git a/src/lread.c b/src/lread.c
index f159e98d4e9..94fb5ddb155 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1,6 +1,7 @@
1/* Lisp parsing and input streams. 1/* Lisp parsing and input streams.
2 Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995, 1997, 1998, 2 Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995,
3 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. 3 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -86,6 +87,7 @@ Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist
86Lisp_Object Qascii_character, Qload, Qload_file_name; 87Lisp_Object Qascii_character, Qload, Qload_file_name;
87Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; 88Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction;
88Lisp_Object Qinhibit_file_name_operation; 89Lisp_Object Qinhibit_file_name_operation;
90Lisp_Object Qeval_buffer_list, Veval_buffer_list;
89 91
90extern Lisp_Object Qevent_symbol_element_mask; 92extern Lisp_Object Qevent_symbol_element_mask;
91extern Lisp_Object Qfile_exists_p; 93extern Lisp_Object Qfile_exists_p;
@@ -674,7 +676,6 @@ Return t if file exists. */)
674{ 676{
675 register FILE *stream; 677 register FILE *stream;
676 register int fd = -1; 678 register int fd = -1;
677 register Lisp_Object lispstream;
678 int count = SPECPDL_INDEX (); 679 int count = SPECPDL_INDEX ();
679 Lisp_Object temp; 680 Lisp_Object temp;
680 struct gcpro gcpro1; 681 struct gcpro gcpro1;
@@ -904,10 +905,7 @@ Return t if file exists. */)
904 } 905 }
905 906
906 GCPRO1 (file); 907 GCPRO1 (file);
907 lispstream = Fcons (Qnil, Qnil); 908 record_unwind_protect (load_unwind, make_save_value (stream, 0));
908 XSETCARFASTINT (lispstream, (EMACS_UINT)stream >> 16);
909 XSETCDRFASTINT (lispstream, (EMACS_UINT)stream & 0xffff);
910 record_unwind_protect (load_unwind, lispstream);
911 record_unwind_protect (load_descriptor_unwind, load_descriptor_list); 909 record_unwind_protect (load_descriptor_unwind, load_descriptor_list);
912 specbind (Qload_file_name, found); 910 specbind (Qload_file_name, found);
913 specbind (Qinhibit_file_name_operation, Qnil); 911 specbind (Qinhibit_file_name_operation, Qnil);
@@ -957,11 +955,12 @@ Return t if file exists. */)
957} 955}
958 956
959static Lisp_Object 957static Lisp_Object
960load_unwind (stream) /* used as unwind-protect function in load */ 958load_unwind (arg) /* used as unwind-protect function in load */
961 Lisp_Object stream; 959 Lisp_Object arg;
962{ 960{
963 fclose ((FILE *) (XFASTINT (XCAR (stream)) << 16 961 FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer;
964 | XFASTINT (XCDR (stream)))); 962 if (stream != NULL)
963 fclose (stream);
965 if (--load_in_progress < 0) load_in_progress = 0; 964 if (--load_in_progress < 0) load_in_progress = 0;
966 return Qnil; 965 return Qnil;
967} 966}
@@ -1453,6 +1452,7 @@ This function preserves the position of point. */)
1453 if (NILP (filename)) 1452 if (NILP (filename))
1454 filename = XBUFFER (buf)->filename; 1453 filename = XBUFFER (buf)->filename;
1455 1454
1455 specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list));
1456 specbind (Qstandard_output, tem); 1456 specbind (Qstandard_output, tem);
1457 record_unwind_protect (save_excursion_restore, save_excursion_save ()); 1457 record_unwind_protect (save_excursion_restore, save_excursion_save ());
1458 BUF_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf))); 1458 BUF_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf)));
@@ -1488,6 +1488,7 @@ This function does not move point. */)
1488 else 1488 else
1489 tem = printflag; 1489 tem = printflag;
1490 specbind (Qstandard_output, tem); 1490 specbind (Qstandard_output, tem);
1491 specbind (Qeval_buffer_list, Fcons (cbuf, Veval_buffer_list));
1491 1492
1492 /* readevalloop calls functions which check the type of start and end. */ 1493 /* readevalloop calls functions which check the type of start and end. */
1493 readevalloop (cbuf, 0, XBUFFER (cbuf)->filename, Feval, 1494 readevalloop (cbuf, 0, XBUFFER (cbuf)->filename, Feval,
@@ -3962,6 +3963,10 @@ to load. See also `load-dangerous-libraries'. */);
3962 Vbytecomp_version_regexp 3963 Vbytecomp_version_regexp
3963 = build_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)"); 3964 = build_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)");
3964 3965
3966 DEFVAR_LISP ("eval-buffer-list", &Veval_buffer_list,
3967 doc: /* List of buffers being read from by calls to `eval-buffer' and `eval-region'. */);
3968 Veval_buffer_list = Qnil;
3969
3965 /* Vsource_directory was initialized in init_lread. */ 3970 /* Vsource_directory was initialized in init_lread. */
3966 3971
3967 load_descriptor_list = Qnil; 3972 load_descriptor_list = Qnil;
@@ -4003,11 +4008,15 @@ to load. See also `load-dangerous-libraries'. */);
4003 Qload_file_name = intern ("load-file-name"); 4008 Qload_file_name = intern ("load-file-name");
4004 staticpro (&Qload_file_name); 4009 staticpro (&Qload_file_name);
4005 4010
4011 Qeval_buffer_list = intern ("eval-buffer-list");
4012 staticpro (&Qeval_buffer_list);
4013
4006 staticpro (&dump_path); 4014 staticpro (&dump_path);
4007 4015
4008 staticpro (&read_objects); 4016 staticpro (&read_objects);
4009 read_objects = Qnil; 4017 read_objects = Qnil;
4010 staticpro (&seen_list); 4018 staticpro (&seen_list);
4019 seen_list = Qnil;
4011 4020
4012 Vloads_in_progress = Qnil; 4021 Vloads_in_progress = Qnil;
4013 staticpro (&Vloads_in_progress); 4022 staticpro (&Vloads_in_progress);
diff --git a/src/m/7300.h b/src/m/7300.h
index fa95b3d9c4e..bb261c9188a 100644
--- a/src/m/7300.h
+++ b/src/m/7300.h
@@ -1,5 +1,5 @@
1/* machine description file for AT&T UNIX PC model 7300 1/* machine description file for AT&T UNIX PC model 7300
2 Copyright (C) 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Modified for this machine by mtxinu!rtech!gonzo!daveb 3 Modified for this machine by mtxinu!rtech!gonzo!daveb
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/m/acorn.h b/src/m/acorn.h
index 66978329d75..399fb7c9249 100644
--- a/src/m/acorn.h
+++ b/src/m/acorn.h
@@ -1,5 +1,5 @@
1/* Machine description file for Acorn RISCiX machines. 1/* Machine description file for Acorn RISCiX machines.
2 Copyright (C) 1994, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/alliant-2800.h b/src/m/alliant-2800.h
index cf0afd90bb5..b59322e3d0c 100644
--- a/src/m/alliant-2800.h
+++ b/src/m/alliant-2800.h
@@ -1,5 +1,5 @@
1/* alliant-2800.h - Alliant FX/2800 machine running Concentrix 2800. 1/* alliant-2800.h - Alliant FX/2800 machine running Concentrix 2800.
2 Copyright (C) 1990, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1990, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/alliant.h b/src/m/alliant.h
index a32e514271d..cbc5734ab31 100644
--- a/src/m/alliant.h
+++ b/src/m/alliant.h
@@ -1,5 +1,6 @@
1/* alliant.h Alliant machine running system version 2 or 3. 1/* alliant.h Alliant machine running system version 2 or 3.
2 Copyright (C) 1985, 1986, 1987, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1987, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 Note that for version 1 of the Alliant system 4 Note that for version 1 of the Alliant system
4 you should use alliant1.h instead of this file. 5 you should use alliant1.h instead of this file.
5 Use alliant4.h for version 4. 6 Use alliant4.h for version 4.
diff --git a/src/m/alpha.h b/src/m/alpha.h
index aff6182270f..41fefaf20fd 100644
--- a/src/m/alpha.h
+++ b/src/m/alpha.h
@@ -1,5 +1,6 @@
1/* machine description file For the alpha chip. 1/* machine description file For the alpha chip.
2 Copyright (C) 1994, 1997, 1999, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1994, 1997, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/altos.h b/src/m/altos.h
index e3cf0898773..743752d99ec 100644
--- a/src/m/altos.h
+++ b/src/m/altos.h
@@ -1,5 +1,6 @@
1/* altos machine description file Altos 3068 Unix System V Release 2 1/* altos machine description file Altos 3068 Unix System V Release 2
2 Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/amdahl.h b/src/m/amdahl.h
index 8b32a2e64d1..89d4b6cb6f7 100644
--- a/src/m/amdahl.h
+++ b/src/m/amdahl.h
@@ -1,5 +1,6 @@
1/* amdahl machine description file 1/* amdahl machine description file
2 Copyright (C) 1987, 1999, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1987, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/amdx86-64.h b/src/m/amdx86-64.h
index 61b18dcc319..2d7d86ce7c3 100644
--- a/src/m/amdx86-64.h
+++ b/src/m/amdx86-64.h
@@ -1,5 +1,5 @@
1/* machine description file for AMD x86-64. 1/* machine description file for AMD x86-64.
2 Copyright (C) 2002, 2003 Free Software Foundation, Inc. 2 Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/apollo.h b/src/m/apollo.h
index 8fa91c004c5..4aa62b0b209 100644
--- a/src/m/apollo.h
+++ b/src/m/apollo.h
@@ -1,5 +1,6 @@
1/* machine description file for Apollo machine. 1/* machine description file for Apollo machine.
2 Copyright (C) 1985, 1986, 1994, 2002, Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1994, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/arm.h b/src/m/arm.h
index 1ebcf3be4a4..358445e0649 100644
--- a/src/m/arm.h
+++ b/src/m/arm.h
@@ -1,5 +1,5 @@
1/* Machine description file for ARM-based non-RISCiX machines. 1/* Machine description file for ARM-based non-RISCiX machines.
2 Copyright (C) 1994, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/att3b.h b/src/m/att3b.h
index 949e6b1d01b..757b47d3f37 100644
--- a/src/m/att3b.h
+++ b/src/m/att3b.h
@@ -1,5 +1,5 @@
1/* Machine-dependent configuration for GNU Emacs for AT&T 3b machines. 1/* Machine-dependent configuration for GNU Emacs for AT&T 3b machines.
2 Copyright (C) 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4 Modified by David Robinson (daver@csvax.caltech.edu) 6/6/86 4 Modified by David Robinson (daver@csvax.caltech.edu) 6/6/86
5 5
diff --git a/src/m/aviion.h b/src/m/aviion.h
index 13a262423b0..b9a2932ef07 100644
--- a/src/m/aviion.h
+++ b/src/m/aviion.h
@@ -1,5 +1,6 @@
1/* machine description file for Data General AViiON. 1/* machine description file for Data General AViiON.
2 Copyright (C) 1985, 1986, 1991, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1991, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/celerity.h b/src/m/celerity.h
index 0b0bb020122..639d680afdb 100644
--- a/src/m/celerity.h
+++ b/src/m/celerity.h
@@ -1,5 +1,6 @@
1/* machine description file for Celerity. 1/* machine description file for Celerity.
2 Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/clipper.h b/src/m/clipper.h
index 5da09e02fb8..af9f67d8a37 100644
--- a/src/m/clipper.h
+++ b/src/m/clipper.h
@@ -1,5 +1,6 @@
1/* machine description file for clipper 1/* machine description file for clipper
2 Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/cnvrgnt.h b/src/m/cnvrgnt.h
index cb344f98f7f..48727bedbe3 100644
--- a/src/m/cnvrgnt.h
+++ b/src/m/cnvrgnt.h
@@ -1,5 +1,5 @@
1/* machine description file for convergent S series. 1/* machine description file for convergent S series.
2 Copyright (C) 1989, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1989, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/convex.h b/src/m/convex.h
index 97b291743dc..b7fcc71b1c3 100644
--- a/src/m/convex.h
+++ b/src/m/convex.h
@@ -1,5 +1,6 @@
1/* machine description file for Convex (all models). 1/* machine description file for Convex (all models).
2 Copyright (C) 1987, 1994, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1987, 1994, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/cydra5.h b/src/m/cydra5.h
index e2813dc2a4b..9806fc30a47 100644
--- a/src/m/cydra5.h
+++ b/src/m/cydra5.h
@@ -1,5 +1,6 @@
1/* machine description file for Cydrome's CYDRA 5 mini super computer 1/* machine description file for Cydrome's CYDRA 5 mini super computer
2 Copyright (C) 1988, 1999, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1988, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/delta88k.h b/src/m/delta88k.h
index ab0a48a4e31..517a0f1744b 100644
--- a/src/m/delta88k.h
+++ b/src/m/delta88k.h
@@ -1,5 +1,6 @@
1/* Machine description file for Motorola System V/88 machines 1/* Machine description file for Motorola System V/88 machines
2 Copyright (C) 1985, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/dpx2.h b/src/m/dpx2.h
index 7a24c3940d3..8d1ceb3db06 100644
--- a/src/m/dpx2.h
+++ b/src/m/dpx2.h
@@ -1,5 +1,6 @@
1/* machine description for Bull DPX/2 range 1/* machine description for Bull DPX/2 range
2 Copyright (C) 1985, 1986, 1999, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/dual.h b/src/m/dual.h
index 253c12bec52..134a5e7720e 100644
--- a/src/m/dual.h
+++ b/src/m/dual.h
@@ -1,5 +1,6 @@
1/* machine description file for Dual machines using unisoft port. 1/* machine description file for Dual machines using unisoft port.
2 Copyright (C) 1985 Free Software Foundation, Inc. 2 Copyright (C) 1985, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/elxsi.h b/src/m/elxsi.h
index f8de3609690..f702dcf0de2 100644
--- a/src/m/elxsi.h
+++ b/src/m/elxsi.h
@@ -1,5 +1,6 @@
1/* machine description file for Elxsi machine (running enix). 1/* machine description file for Elxsi machine (running enix).
2 Copyright (C) 1986, 1992, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1986, 1992, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 Adapted by John Salmon 4 Adapted by John Salmon
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/m/ews4800.h b/src/m/ews4800.h
index dcb46bf83d8..b377bdeddaa 100644
--- a/src/m/ews4800.h
+++ b/src/m/ews4800.h
@@ -1,5 +1,6 @@
1/* m- file for NEC EWS4800 RISC series. 1/* m- file for NEC EWS4800 RISC series.
2 Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1998, 2000, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/gould-np1.h b/src/m/gould-np1.h
index 4a267865085..1c784f28f4e 100644
--- a/src/m/gould-np1.h
+++ b/src/m/gould-np1.h
@@ -1,5 +1,5 @@
1/* machine description file for Gould NP1 with UTX/32 3.0 (first release for NP1) 1/* machine description file for Gould NP1 with UTX/32 3.0 (first release for NP1)
2 Copyright (C) 1986 Free Software Foundation, Inc. 2 Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/hp800.h b/src/m/hp800.h
index 64243f4be31..2f661989a15 100644
--- a/src/m/hp800.h
+++ b/src/m/hp800.h
@@ -1,5 +1,5 @@
1/* machine description file for hp9000 series 800 machines. 1/* machine description file for hp9000 series 800 machines.
2 Copyright (C) 1987, 2002, 2003 Free Software Foundation, Inc. 2 Copyright (C) 1987, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/hp9000s300.h b/src/m/hp9000s300.h
index 8886aec204c..e0b3a5ce5c3 100644
--- a/src/m/hp9000s300.h
+++ b/src/m/hp9000s300.h
@@ -1,5 +1,5 @@
1/* machine description file for hp9000 series 200 or 300 on either HPUX or BSD. 1/* machine description file for hp9000 series 200 or 300 on either HPUX or BSD.
2 Copyright (C) 1985, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/i860.h b/src/m/i860.h
index 66ca2b8fa66..0ecf9e62087 100644
--- a/src/m/i860.h
+++ b/src/m/i860.h
@@ -1,5 +1,6 @@
1/* machine description file for i860. 1/* machine description file for i860.
2 Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/ia64.h b/src/m/ia64.h
index 33d843c773f..af790946afa 100644
--- a/src/m/ia64.h
+++ b/src/m/ia64.h
@@ -1,5 +1,5 @@
1/* machine description file for the IA-64 architecture. 1/* machine description file for the IA-64 architecture.
2 Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. 2 Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Contributed by David Mosberger <davidm@hpl.hp.com> 3 Contributed by David Mosberger <davidm@hpl.hp.com>
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/m/ibm370aix.h b/src/m/ibm370aix.h
index b958656c3e4..3d954ae9d19 100644
--- a/src/m/ibm370aix.h
+++ b/src/m/ibm370aix.h
@@ -1,5 +1,6 @@
1/* m/ file for IBM 370 running AIX. 1/* m/ file for IBM 370 running AIX.
2 Copyright (C) 1993, 1994, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/ibmps2-aix.h b/src/m/ibmps2-aix.h
index d2202d65472..539de924d17 100644
--- a/src/m/ibmps2-aix.h
+++ b/src/m/ibmps2-aix.h
@@ -1,5 +1,5 @@
1/* machine description file for ibm ps/2 aix386. 1/* machine description file for ibm ps/2 aix386.
2 Copyright (C) 1989, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1989, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/ibmrs6000.h b/src/m/ibmrs6000.h
index b76d03bc0b7..9559f1ae62a 100644
--- a/src/m/ibmrs6000.h
+++ b/src/m/ibmrs6000.h
@@ -1,5 +1,5 @@
1/* R2 AIX machine/system dependent defines 1/* R2 AIX machine/system dependent defines
2 Copyright (C) 1988, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1988, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/ibmrt-aix.h b/src/m/ibmrt-aix.h
index b9ea0e6208f..44bfd77c1d0 100644
--- a/src/m/ibmrt-aix.h
+++ b/src/m/ibmrt-aix.h
@@ -1,5 +1,6 @@
1/* RTPC AIX machine/system dependent defines 1/* RTPC AIX machine/system dependent defines
2 Copyright (C) 1988, 1999, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1988, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/ibmrt.h b/src/m/ibmrt.h
index 1388a46b001..f6c23d9d919 100644
--- a/src/m/ibmrt.h
+++ b/src/m/ibmrt.h
@@ -1,5 +1,5 @@
1/* RTPC machine dependent defines 1/* RTPC machine dependent defines
2 Copyright (C) 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/ibms390.h b/src/m/ibms390.h
index af7fbb8dfbf..323ef33f633 100644
--- a/src/m/ibms390.h
+++ b/src/m/ibms390.h
@@ -1,5 +1,6 @@
1/* machine description file template. 1/* machine description file template.
2 Copyright (C) 1985, 1986, 2001, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/intel386.h b/src/m/intel386.h
index c63dae7af0b..238015fd345 100644
--- a/src/m/intel386.h
+++ b/src/m/intel386.h
@@ -1,5 +1,5 @@
1/* Machine description file for intel 386. 1/* Machine description file for intel 386.
2 Copyright (C) 1987, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1987, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/iris4d.h b/src/m/iris4d.h
index a13a6f8c2ff..93fe2062674 100644
--- a/src/m/iris4d.h
+++ b/src/m/iris4d.h
@@ -1,5 +1,5 @@
1/* machine description file for Iris-4D machines. Use with s/irix*.h. 1/* machine description file for Iris-4D machines. Use with s/irix*.h.
2 Copyright (C) 1987, 2002, 2003 Free Software Foundation, Inc. 2 Copyright (C) 1987, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/irist.h b/src/m/irist.h
index 71726977b23..b40ffb5dff9 100644
--- a/src/m/irist.h
+++ b/src/m/irist.h
@@ -1,6 +1,7 @@
1/* machine description file for Silicon Graphics Iris 2500 Turbos; 1/* machine description file for Silicon Graphics Iris 2500 Turbos;
2 also possibly for non-turbo Irises with system release 2.5. 2 also possibly for non-turbo Irises with system release 2.5.
3 Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. 3 Copyright (C) 1985, 1986, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
diff --git a/src/m/isi-ov.h b/src/m/isi-ov.h
index 9b35f03ea70..416335d1bff 100644
--- a/src/m/isi-ov.h
+++ b/src/m/isi-ov.h
@@ -1,5 +1,6 @@
1/* machine description file for ISI 68000's 1/* machine description file for ISI 68000's
2 Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/m68k.h b/src/m/m68k.h
index 9fdcf1511b8..7b2ffa81351 100644
--- a/src/m/m68k.h
+++ b/src/m/m68k.h
@@ -1,5 +1,6 @@
1/* Machine description file for generic Motorola 68k. 1/* Machine description file for generic Motorola 68k.
2 Copyright (C) 1985, 1995, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1995, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/macppc.h b/src/m/macppc.h
index 36022af3e52..9e4297df3b7 100644
--- a/src/m/macppc.h
+++ b/src/m/macppc.h
@@ -1,5 +1,6 @@
1/* machine description file For the powerpc Macintosh. 1/* machine description file For the powerpc Macintosh.
2 Copyright (C) 1994, 2001, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1994, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/masscomp.h b/src/m/masscomp.h
index 4582e29b6bd..01fddc751f1 100644
--- a/src/m/masscomp.h
+++ b/src/m/masscomp.h
@@ -1,5 +1,5 @@
1/* machine description file for Masscomp 5000 series running RTU, ucb universe. 1/* machine description file for Masscomp 5000 series running RTU, ucb universe.
2 Copyright (C) 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/mega68.h b/src/m/mega68.h
index ba7ee6b48d4..ef1623ca460 100644
--- a/src/m/mega68.h
+++ b/src/m/mega68.h
@@ -1,5 +1,5 @@
1/* machine description file for Megatest 68000's. 1/* machine description file for Megatest 68000's.
2 Copyright (C) 1985 Free Software Foundation, Inc. 2 Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/mg1.h b/src/m/mg1.h
index 47d34f43768..4e4b3525d6e 100644
--- a/src/m/mg1.h
+++ b/src/m/mg1.h
@@ -1,5 +1,5 @@
1/* machine description file for Whitechapel Computer Works MG1 (ns16000 based). 1/* machine description file for Whitechapel Computer Works MG1 (ns16000 based).
2 Copyright (C) 1985, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 MG-1 version by L.M.McLoughlin 3 MG-1 version by L.M.McLoughlin
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/m/mips-siemens.h b/src/m/mips-siemens.h
index f00790210c9..fc1a8a2e0d6 100644
--- a/src/m/mips-siemens.h
+++ b/src/m/mips-siemens.h
@@ -1,5 +1,6 @@
1/* m- file for Mips machines. 1/* m- file for Mips machines.
2 Copyright (C) 1987,1992,1993,95,2002,03 Free Software Foundation, Inc. 2 Copyright (C) 1987, 1992, 1993, 1995, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4 This file contains some changes for our SVR4 based SINIX-Mips 5.4. 5 This file contains some changes for our SVR4 based SINIX-Mips 5.4.
5 I hope this is helpful to port the emacs to our RM?00 series and 6 I hope this is helpful to port the emacs to our RM?00 series and
diff --git a/src/m/mips.h b/src/m/mips.h
index e868423642c..28a35e02677 100644
--- a/src/m/mips.h
+++ b/src/m/mips.h
@@ -1,5 +1,6 @@
1/* m- file for Mips machines. 1/* m- file for Mips machines.
2 Copyright (C) 1987, 1992, 1999, 2002, 2003 Free Software Foundation, Inc. 2 Copyright (C) 1987, 1992, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/news.h b/src/m/news.h
index 1d2585c09a0..dec413c3f9e 100644
--- a/src/m/news.h
+++ b/src/m/news.h
@@ -1,5 +1,6 @@
1/* machine description file for Sony's NEWS workstations, NEWS-OS 3.0. 1/* machine description file for Sony's NEWS workstations, NEWS-OS 3.0.
2 Copyright (C) 1985, 1986, 1989, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1989, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/next.h b/src/m/next.h
index 2f2952e10f4..dfb3cd11cbf 100644
--- a/src/m/next.h
+++ b/src/m/next.h
@@ -1,5 +1,5 @@
1/* Configuration file for the NeXT machine. 1/* Configuration file for the NeXT machine.
2 Copyright (C) 1990, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1990, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/nh3000.h b/src/m/nh3000.h
index 7be5c5dc7db..42255473020 100644
--- a/src/m/nh3000.h
+++ b/src/m/nh3000.h
@@ -1,7 +1,7 @@
1/* machine description for Harris Night Hawk Series 1200 and Series 3000 1/* machine description for Harris Night Hawk Series 1200 and Series 3000
2 MC68030-based systems (FPP on these is custom). These systems are 2 MC68030-based systems (FPP on these is custom). These systems are
3 also known as "ecx" and "gcx". 3 also known as "ecx" and "gcx".
4 Copyright (C) 1994, 2002 Free Software Foundation, Inc. 4 Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
diff --git a/src/m/nh4000.h b/src/m/nh4000.h
index 3d8794b2802..04068f0c065 100644
--- a/src/m/nh4000.h
+++ b/src/m/nh4000.h
@@ -1,6 +1,6 @@
1/* machine description for Harris NightHawk 88k based machines 1/* machine description for Harris NightHawk 88k based machines
2 (includes nh4000 and nh5000 machines). 2 (includes nh4000 and nh5000 machines).
3 Copyright (C) 1994, 2002 Free Software Foundation, Inc. 3 Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/m/ns16000.h b/src/m/ns16000.h
index 07fff86502b..49f514ced06 100644
--- a/src/m/ns16000.h
+++ b/src/m/ns16000.h
@@ -1,5 +1,5 @@
1/* machine description file for ns16000. 1/* machine description file for ns16000.
2 Copyright (C) 1985 Free Software Foundation, Inc. 2 Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/ns32000.h b/src/m/ns32000.h
index 9a135fe2d9f..858630b74ab 100644
--- a/src/m/ns32000.h
+++ b/src/m/ns32000.h
@@ -1,5 +1,6 @@
1/* machine description file for National Semiconductor 32000, running Genix. 1/* machine description file for National Semiconductor 32000, running Genix.
2 Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/nu.h b/src/m/nu.h
index 8ca03155314..1e5518e451f 100644
--- a/src/m/nu.h
+++ b/src/m/nu.h
@@ -1,5 +1,5 @@
1/* machine description file for TI Nu machines using system V. 1/* machine description file for TI Nu machines using system V.
2 Copyright (C) 1986 Free Software Foundation, Inc. 2 Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/orion.h b/src/m/orion.h
index e4fa8529664..a73b357d50f 100644
--- a/src/m/orion.h
+++ b/src/m/orion.h
@@ -1,5 +1,5 @@
1/* machine description file for HLH Orion. 1/* machine description file for HLH Orion.
2 Copyright (C) 1985, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/orion105.h b/src/m/orion105.h
index d0adaba70ec..e75a8e67a84 100644
--- a/src/m/orion105.h
+++ b/src/m/orion105.h
@@ -1,5 +1,5 @@
1/* machine description file for HLH Orion 1/05 (Clipper). 1/* machine description file for HLH Orion 1/05 (Clipper).
2 Copyright (C) 1985 Free Software Foundation, Inc. 2 Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Lee McLoughlin <lmjm%doc.imperial.ac.uk@nss.cs.ucl.ac.uk> 3 Lee McLoughlin <lmjm%doc.imperial.ac.uk@nss.cs.ucl.ac.uk>
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/m/pfa50.h b/src/m/pfa50.h
index be430d25fdc..50e79b623ca 100644
--- a/src/m/pfa50.h
+++ b/src/m/pfa50.h
@@ -1,5 +1,6 @@
1/* Machine description file for PFU A-series. 1/* Machine description file for PFU A-series.
2 Copyright (C) 1988, 1999, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1988, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/plexus.h b/src/m/plexus.h
index a2f6cc545a0..10826a70bc2 100644
--- a/src/m/plexus.h
+++ b/src/m/plexus.h
@@ -1,5 +1,5 @@
1/* machine description file for the Plexus running System V.2. 1/* machine description file for the Plexus running System V.2.
2 Copyright (C) 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/powermac.h b/src/m/powermac.h
index c41003ae61c..14b2e110734 100644
--- a/src/m/powermac.h
+++ b/src/m/powermac.h
@@ -1,5 +1,5 @@
1/* Machine description file for Apple Power Macintosh 1/* Machine description file for Apple Power Macintosh
2 Copyright (C) 2001 Free Software Foundation, Inc. 2 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/powerpcle.h b/src/m/powerpcle.h
index 34096a37d18..1dfd2df25b4 100644
--- a/src/m/powerpcle.h
+++ b/src/m/powerpcle.h
@@ -1,5 +1,5 @@
1/* machine description file for PowerPC. 1/* machine description file for PowerPC.
2 Copyright (C) 1987, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1987, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/pyramid.h b/src/m/pyramid.h
index 7e0db61ec59..12010087a58 100644
--- a/src/m/pyramid.h
+++ b/src/m/pyramid.h
@@ -1,5 +1,6 @@
1/* machine description file for pyramid. 1/* machine description file for pyramid.
2 Copyright (C) 1985, 1986 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/sequent-ptx.h b/src/m/sequent-ptx.h
index 57d255a861e..3c22639e3b2 100644
--- a/src/m/sequent-ptx.h
+++ b/src/m/sequent-ptx.h
@@ -1,5 +1,6 @@
1/* machine description file for SEQUENT machines running DYNIX/ptx 1/* machine description file for SEQUENT machines running DYNIX/ptx
2 Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/sequent.h b/src/m/sequent.h
index 7c572f54f68..f082880b4fc 100644
--- a/src/m/sequent.h
+++ b/src/m/sequent.h
@@ -1,5 +1,6 @@
1/* machine description file for SEQUENT BALANCE machines 1/* machine description file for SEQUENT BALANCE machines
2 Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/sparc.h b/src/m/sparc.h
index 6926aced07b..20ec53c1344 100644
--- a/src/m/sparc.h
+++ b/src/m/sparc.h
@@ -1,5 +1,5 @@
1/* machine description file for Sun 4 SPARC. 1/* machine description file for Sun 4 SPARC.
2 Copyright (C) 1987, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1987, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/sps7.h b/src/m/sps7.h
index 3bd0c94bccd..422d2470aaa 100644
--- a/src/m/sps7.h
+++ b/src/m/sps7.h
@@ -1,5 +1,6 @@
1/* machine description file for Bull SPS-7. 1/* machine description file for Bull SPS-7.
2 Copyright (C) 1986, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1986, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/sr2k.h b/src/m/sr2k.h
index 83dbf4941ff..875f428dc1f 100644
--- a/src/m/sr2k.h
+++ b/src/m/sr2k.h
@@ -1,5 +1,5 @@
1/* machine description file for Hitachi SR2001/SR2201 machines. 1/* machine description file for Hitachi SR2001/SR2201 machines.
2 Copyright (C) 1996, 2002, 2003 Free Software Foundation, Inc. 2 Copyright (C) 1996, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/stride.h b/src/m/stride.h
index f176a7642a7..ff900d49b38 100644
--- a/src/m/stride.h
+++ b/src/m/stride.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on Stride Micro System-V.2.2 1/* Definitions file for GNU Emacs running on Stride Micro System-V.2.2
2 Copyright (C) 1985, 1986, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/sun1.h b/src/m/sun1.h
index 7ab81218705..810bad7fd58 100644
--- a/src/m/sun1.h
+++ b/src/m/sun1.h
@@ -1,5 +1,6 @@
1/* machine description file for Sun 68000's 1/* machine description file for Sun 68000's
2 Copyright (C) 1985, 1986 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/sun2.h b/src/m/sun2.h
index 452fdfc7c01..9df032049e3 100644
--- a/src/m/sun2.h
+++ b/src/m/sun2.h
@@ -1,7 +1,8 @@
1/* machine description file for Sun 68000's OPERATING SYSTEM version 2. 1/* machine description file for Sun 68000's OPERATING SYSTEM version 2.
2 Note that "sun2.h" refers to the operating system version, not the 2 Note that "sun2.h" refers to the operating system version, not the
3 CPU model number. See the MACHINES file for details. 3 CPU model number. See the MACHINES file for details.
4 Copyright (C) 1985, 1986 Free Software Foundation, Inc. 4 Copyright (C) 1985, 1986, 2002, 2003, 2004,
5 2005 Free Software Foundation, Inc.
5 6
6This file is part of GNU Emacs. 7This file is part of GNU Emacs.
7 8
diff --git a/src/m/sun386.h b/src/m/sun386.h
index 782e10925ef..5970f90b98b 100644
--- a/src/m/sun386.h
+++ b/src/m/sun386.h
@@ -2,7 +2,7 @@
2 "sun2.h", but since that file is heavily cpu-specific, it was easier 2 "sun2.h", but since that file is heavily cpu-specific, it was easier
3 not to include it. 3 not to include it.
4 4
5 Copyright (C) 1988 Free Software Foundation, Inc. 5 Copyright (C) 1988, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
6 6
7This file is part of GNU Emacs. 7This file is part of GNU Emacs.
8 8
diff --git a/src/m/symmetry.h b/src/m/symmetry.h
index 262d6474757..4954f596442 100644
--- a/src/m/symmetry.h
+++ b/src/m/symmetry.h
@@ -1,5 +1,6 @@
1/* machine description file for SEQUENT SYMMETRY machines 1/* machine description file for SEQUENT SYMMETRY machines
2 Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/tad68k.h b/src/m/tad68k.h
index 4c904aaf569..b8b3859f407 100644
--- a/src/m/tad68k.h
+++ b/src/m/tad68k.h
@@ -1,5 +1,5 @@
1/* Machine-dependent configuration for GNU Emacs for Tadpole 68k machines 1/* Machine-dependent configuration for GNU Emacs for Tadpole 68k machines
2 Copyright (C) 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/tahoe.h b/src/m/tahoe.h
index 988624839b4..47db3f93deb 100644
--- a/src/m/tahoe.h
+++ b/src/m/tahoe.h
@@ -1,5 +1,5 @@
1/* machine description file for tahoe. 1/* machine description file for tahoe.
2 Copyright (C) 1985, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/targon31.h b/src/m/targon31.h
index 08ecb681bd9..5ac18648387 100644
--- a/src/m/targon31.h
+++ b/src/m/targon31.h
@@ -1,5 +1,6 @@
1/* targon31 machine description file 1/* targon31 machine description file
2 Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/tek4300.h b/src/m/tek4300.h
index 164df72210a..a84135291cb 100644
--- a/src/m/tek4300.h
+++ b/src/m/tek4300.h
@@ -1,5 +1,5 @@
1/* machine description file for tek4300. 1/* machine description file for tek4300.
2 Copyright (C) 1988, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1988, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/tekxd88.h b/src/m/tekxd88.h
index 7af3dab6a07..4db981a8096 100644
--- a/src/m/tekxd88.h
+++ b/src/m/tekxd88.h
@@ -1,7 +1,7 @@
1/* Configuration file for the Tektronix XD88 running UTekV 3.2e, 1/* Configuration file for the Tektronix XD88 running UTekV 3.2e,
2 contributed by Kaveh Ghazi (ghazi@caip.rutgers.edu) 1/15/93. 2 contributed by Kaveh Ghazi (ghazi@caip.rutgers.edu) 1/15/93.
3 You probably need to use gnu make (version 3.63 or higher.) 3 You probably need to use gnu make (version 3.63 or higher.)
4 Copyright (C) 1993, 2002 Free Software Foundation, Inc. 4 Copyright (C) 1993, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
diff --git a/src/m/template.h b/src/m/template.h
index c088efff81a..c7ce2c2cb1f 100644
--- a/src/m/template.h
+++ b/src/m/template.h
@@ -1,5 +1,6 @@
1/* machine description file template. 1/* machine description file template.
2 Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/tower32.h b/src/m/tower32.h
index c5f34d065ea..cd4ab96de11 100644
--- a/src/m/tower32.h
+++ b/src/m/tower32.h
@@ -1,5 +1,5 @@
1/* machine description file for the NCR Tower 32 running System V.2. 1/* machine description file for the NCR Tower 32 running System V.2.
2 Copyright (C) 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/tower32v3.h b/src/m/tower32v3.h
index 927dfca93d9..2c1e55c0023 100644
--- a/src/m/tower32v3.h
+++ b/src/m/tower32v3.h
@@ -1,5 +1,5 @@
1/* machine description file for the NCR Tower 32 running System V.3. 1/* machine description file for the NCR Tower 32 running System V.3.
2 Copyright (C) 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/ustation.h b/src/m/ustation.h
index e7068f3cd86..c62d37d6429 100644
--- a/src/m/ustation.h
+++ b/src/m/ustation.h
@@ -1,5 +1,6 @@
1/* machine description file for U-station (Nihon Unisys, SS5E; Sumitomo Denkoh, U-Station E30). 1/* machine description file for U-station (Nihon Unisys, SS5E; Sumitomo Denkoh, U-Station E30).
2 Copyright (C) 1986, 1999, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1986, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/vax.h b/src/m/vax.h
index 22fda95abc5..d414d6b57e7 100644
--- a/src/m/vax.h
+++ b/src/m/vax.h
@@ -1,5 +1,6 @@
1/* machine description file for vax. 1/* machine description file for vax.
2 Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/m/wicat.h b/src/m/wicat.h
index bd8fcefe99c..78842f32a43 100644
--- a/src/m/wicat.h
+++ b/src/m/wicat.h
@@ -1,5 +1,5 @@
1/* machine description file for WICAT machines. 1/* machine description file for WICAT machines.
2 Copyright (C) 1986, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/m/windowsnt.h b/src/m/windowsnt.h
index 39c7baa9de6..cf48ca8aa88 100644
--- a/src/m/windowsnt.h
+++ b/src/m/windowsnt.h
@@ -1,6 +1,7 @@
1/* Machine description file for Windows NT. 1/* Machine description file for Windows NT.
2 2
3 Copyright (C) 1993, 1994, 2002 Free Software Foundation, Inc. 3 Copyright (C) 1993, 1994, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
diff --git a/src/m/xps100.h b/src/m/xps100.h
index c6e54710bd6..3a851aa9ebd 100644
--- a/src/m/xps100.h
+++ b/src/m/xps100.h
@@ -1,7 +1,8 @@
1/* xps100.h for the Honeywell XPS100 running UNIX System V.2 1/* xps100.h for the Honeywell XPS100 running UNIX System V.2
2 Mark J. Hewitt (mjh@uk.co.kernel) 2 Mark J. Hewitt (mjh@uk.co.kernel)
3 3
4 Copyright (C) 1985, 1986, 2002 Free Software Foundation, Inc. 4 Copyright (C) 1985, 1986, 2002, 2003, 2004,
5 2005 Free Software Foundation, Inc.
5 6
6This file is part of GNU Emacs. 7This file is part of GNU Emacs.
7 8
diff --git a/src/mac.c b/src/mac.c
index ef136ab6512..0d8c99ffb1e 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -1,5 +1,6 @@
1/* Unix emulation routines for GNU Emacs on the Mac OS. 1/* Unix emulation routines for GNU Emacs on the Mac OS.
2 Copyright (C) 2000, 2001 Free Software Foundation, Inc. 2 Copyright (C) 2000, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -34,10 +35,9 @@ Boston, MA 02110-1301, USA. */
34 35
35#include "macterm.h" 36#include "macterm.h"
36 37
37#if TARGET_API_MAC_CARBON
38#include "charset.h" 38#include "charset.h"
39#include "coding.h" 39#include "coding.h"
40#else /* not TARGET_API_MAC_CARBON */ 40#if !TARGET_API_MAC_CARBON
41#include <Files.h> 41#include <Files.h>
42#include <MacTypes.h> 42#include <MacTypes.h>
43#include <TextUtils.h> 43#include <TextUtils.h>
@@ -53,17 +53,16 @@ Boston, MA 02110-1301, USA. */
53#include <Processes.h> 53#include <Processes.h>
54#include <EPPC.h> 54#include <EPPC.h>
55#include <MacLocales.h> 55#include <MacLocales.h>
56#include <Endian.h>
56#endif /* not TARGET_API_MAC_CARBON */ 57#endif /* not TARGET_API_MAC_CARBON */
57 58
58#include <utime.h> 59#include <utime.h>
59#include <dirent.h> 60#include <dirent.h>
60#include <sys/types.h> 61#include <sys/types.h>
61#include <sys/stat.h> 62#include <sys/stat.h>
62#include <string.h>
63#include <pwd.h> 63#include <pwd.h>
64#include <grp.h> 64#include <grp.h>
65#include <sys/param.h> 65#include <sys/param.h>
66#include <stdlib.h>
67#include <fcntl.h> 66#include <fcntl.h>
68#if __MWERKS__ 67#if __MWERKS__
69#include <unistd.h> 68#include <unistd.h>
@@ -1021,7 +1020,7 @@ xrm_cfproperty_list_to_value (plist)
1021 CFTypeID type_id = CFGetTypeID (plist); 1020 CFTypeID type_id = CFGetTypeID (plist);
1022 1021
1023 if (type_id == CFStringGetTypeID ()) 1022 if (type_id == CFStringGetTypeID ())
1024 return cfstring_to_lisp (plist); 1023 return cfstring_to_lisp (plist);
1025 else if (type_id == CFNumberGetTypeID ()) 1024 else if (type_id == CFNumberGetTypeID ())
1026 { 1025 {
1027 CFStringRef string; 1026 CFStringRef string;
@@ -2490,6 +2489,22 @@ chmod (const char *path, mode_t mode)
2490 2489
2491 2490
2492int 2491int
2492fchmod (int fd, mode_t mode)
2493{
2494 /* say it always succeed for now */
2495 return 0;
2496}
2497
2498
2499int
2500fchown (int fd, uid_t owner, gid_t group)
2501{
2502 /* say it always succeed for now */
2503 return 0;
2504}
2505
2506
2507int
2493dup (int oldd) 2508dup (int oldd)
2494{ 2509{
2495#ifdef __MRC__ 2510#ifdef __MRC__
@@ -3388,12 +3403,278 @@ initialize_applescript ()
3388} 3403}
3389 3404
3390 3405
3391void terminate_applescript() 3406void
3407terminate_applescript()
3392{ 3408{
3393 OSADispose (as_scripting_component, as_script_context); 3409 OSADispose (as_scripting_component, as_script_context);
3394 CloseComponent (as_scripting_component); 3410 CloseComponent (as_scripting_component);
3395} 3411}
3396 3412
3413/* Convert a lisp string to the 4 byte character code. */
3414
3415OSType
3416mac_get_code_from_arg(Lisp_Object arg, OSType defCode)
3417{
3418 OSType result;
3419 if (NILP(arg))
3420 {
3421 result = defCode;
3422 }
3423 else
3424 {
3425 /* check type string */
3426 CHECK_STRING(arg);
3427 if (SBYTES (arg) != 4)
3428 {
3429 error ("Wrong argument: need string of length 4 for code");
3430 }
3431 result = EndianU32_BtoN (*((UInt32 *) SDATA (arg)));
3432 }
3433 return result;
3434}
3435
3436/* Convert the 4 byte character code into a 4 byte string. */
3437
3438Lisp_Object
3439mac_get_object_from_code(OSType defCode)
3440{
3441 UInt32 code = EndianU32_NtoB (defCode);
3442
3443 return make_unibyte_string ((char *)&code, 4);
3444}
3445
3446
3447DEFUN ("mac-get-file-creator", Fmac_get_file_creator, Smac_get_file_creator, 1, 1, 0,
3448 doc: /* Get the creator code of FILENAME as a four character string. */)
3449 (filename)
3450 Lisp_Object filename;
3451{
3452 OSErr status;
3453#ifdef MAC_OSX
3454 FSRef fref;
3455#else
3456 FSSpec fss;
3457#endif
3458 OSType cCode;
3459 Lisp_Object result = Qnil;
3460 CHECK_STRING (filename);
3461
3462 if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) {
3463 return Qnil;
3464 }
3465 filename = Fexpand_file_name (filename, Qnil);
3466
3467 BLOCK_INPUT;
3468#ifdef MAC_OSX
3469 status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL);
3470#else
3471 status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss);
3472#endif
3473
3474 if (status == noErr)
3475 {
3476#ifdef MAC_OSX
3477 FSCatalogInfo catalogInfo;
3478
3479 status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo,
3480 &catalogInfo, NULL, NULL, NULL);
3481#else
3482 FInfo finder_info;
3483
3484 status = FSpGetFInfo (&fss, &finder_info);
3485#endif
3486 if (status == noErr)
3487 {
3488#ifdef MAC_OSX
3489 result = mac_get_object_from_code(((FileInfo*)&catalogInfo.finderInfo)->fileCreator);
3490#else
3491 result = mac_get_object_from_code (finder_info.fdCreator);
3492#endif
3493 }
3494 }
3495 UNBLOCK_INPUT;
3496 if (status != noErr) {
3497 error ("Error while getting file information.");
3498 }
3499 return result;
3500}
3501
3502DEFUN ("mac-get-file-type", Fmac_get_file_type, Smac_get_file_type, 1, 1, 0,
3503 doc: /* Get the type code of FILENAME as a four character string. */)
3504 (filename)
3505 Lisp_Object filename;
3506{
3507 OSErr status;
3508#ifdef MAC_OSX
3509 FSRef fref;
3510#else
3511 FSSpec fss;
3512#endif
3513 OSType cCode;
3514 Lisp_Object result = Qnil;
3515 CHECK_STRING (filename);
3516
3517 if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) {
3518 return Qnil;
3519 }
3520 filename = Fexpand_file_name (filename, Qnil);
3521
3522 BLOCK_INPUT;
3523#ifdef MAC_OSX
3524 status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL);
3525#else
3526 status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss);
3527#endif
3528
3529 if (status == noErr)
3530 {
3531#ifdef MAC_OSX
3532 FSCatalogInfo catalogInfo;
3533
3534 status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo,
3535 &catalogInfo, NULL, NULL, NULL);
3536#else
3537 FInfo finder_info;
3538
3539 status = FSpGetFInfo (&fss, &finder_info);
3540#endif
3541 if (status == noErr)
3542 {
3543#ifdef MAC_OSX
3544 result = mac_get_object_from_code(((FileInfo*)&catalogInfo.finderInfo)->fileType);
3545#else
3546 result = mac_get_object_from_code (finder_info.fdType);
3547#endif
3548 }
3549 }
3550 UNBLOCK_INPUT;
3551 if (status != noErr) {
3552 error ("Error while getting file information.");
3553 }
3554 return result;
3555}
3556
3557DEFUN ("mac-set-file-creator", Fmac_set_file_creator, Smac_set_file_creator, 1, 2, 0,
3558 doc: /* Set creator code of file FILENAME to CODE.
3559If non-nil, CODE must be a 4-character string. Otherwise, 'EMAx' is
3560assumed. Return non-nil if successful. */)
3561 (filename, code)
3562 Lisp_Object filename, code;
3563{
3564 OSErr status;
3565#ifdef MAC_OSX
3566 FSRef fref;
3567#else
3568 FSSpec fss;
3569#endif
3570 OSType cCode;
3571 CHECK_STRING (filename);
3572
3573 cCode = mac_get_code_from_arg(code, 'EMAx');
3574
3575 if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) {
3576 return Qnil;
3577 }
3578 filename = Fexpand_file_name (filename, Qnil);
3579
3580 BLOCK_INPUT;
3581#ifdef MAC_OSX
3582 status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL);
3583#else
3584 status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss);
3585#endif
3586
3587 if (status == noErr)
3588 {
3589#ifdef MAC_OSX
3590 FSCatalogInfo catalogInfo;
3591 FSRef parentDir;
3592 status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo,
3593 &catalogInfo, NULL, NULL, &parentDir);
3594#else
3595 FInfo finder_info;
3596
3597 status = FSpGetFInfo (&fss, &finder_info);
3598#endif
3599 if (status == noErr)
3600 {
3601#ifdef MAC_OSX
3602 ((FileInfo*)&catalogInfo.finderInfo)->fileCreator = cCode;
3603 status = FSSetCatalogInfo(&fref, kFSCatInfoFinderInfo, &catalogInfo);
3604 /* TODO: on Mac OS 10.2, we need to touch the parent dir, FNNotify? */
3605#else
3606 finder_info.fdCreator = cCode;
3607 status = FSpSetFInfo (&fss, &finder_info);
3608#endif
3609 }
3610 }
3611 UNBLOCK_INPUT;
3612 if (status != noErr) {
3613 error ("Error while setting creator information.");
3614 }
3615 return Qt;
3616}
3617
3618DEFUN ("mac-set-file-type", Fmac_set_file_type, Smac_set_file_type, 2, 2, 0,
3619 doc: /* Set file code of file FILENAME to CODE.
3620CODE must be a 4-character string. Return non-nil if successful. */)
3621 (filename, code)
3622 Lisp_Object filename, code;
3623{
3624 OSErr status;
3625#ifdef MAC_OSX
3626 FSRef fref;
3627#else
3628 FSSpec fss;
3629#endif
3630 OSType cCode;
3631 CHECK_STRING (filename);
3632
3633 cCode = mac_get_code_from_arg(code, 0); /* Default to empty code*/
3634
3635 if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) {
3636 return Qnil;
3637 }
3638 filename = Fexpand_file_name (filename, Qnil);
3639
3640 BLOCK_INPUT;
3641#ifdef MAC_OSX
3642 status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL);
3643#else
3644 status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss);
3645#endif
3646
3647 if (status == noErr)
3648 {
3649#ifdef MAC_OSX
3650 FSCatalogInfo catalogInfo;
3651 FSRef parentDir;
3652 status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo,
3653 &catalogInfo, NULL, NULL, &parentDir);
3654#else
3655 FInfo finder_info;
3656
3657 status = FSpGetFInfo (&fss, &finder_info);
3658#endif
3659 if (status == noErr)
3660 {
3661#ifdef MAC_OSX
3662 ((FileInfo*)&catalogInfo.finderInfo)->fileType = cCode;
3663 status = FSSetCatalogInfo(&fref, kFSCatInfoFinderInfo, &catalogInfo);
3664 /* TODO: on Mac OS 10.2, we need to touch the parent dir, FNNotify? */
3665#else
3666 finder_info.fdType = cCode;
3667 status = FSpSetFInfo (&fss, &finder_info);
3668#endif
3669 }
3670 }
3671 UNBLOCK_INPUT;
3672 if (status != noErr) {
3673 error ("Error while setting creator information.");
3674 }
3675 return Qt;
3676}
3677
3397 3678
3398/* Compile and execute the AppleScript SCRIPT and return the error 3679/* Compile and execute the AppleScript SCRIPT and return the error
3399 status as function value. A zero is returned if compilation and 3680 status as function value. A zero is returned if compilation and
@@ -3484,12 +3765,12 @@ do_applescript (char *script, char **result)
3484 3765
3485 3766
3486DEFUN ("do-applescript", Fdo_applescript, Sdo_applescript, 1, 1, 0, 3767DEFUN ("do-applescript", Fdo_applescript, Sdo_applescript, 1, 1, 0,
3487 doc: /* Compile and execute AppleScript SCRIPT and retrieve and return the result. 3768 doc: /* Compile and execute AppleScript SCRIPT and return the result.
3488If compilation and execution are successful, the resulting script 3769If compilation and execution are successful, the resulting script
3489value is returned as a string. Otherwise the function aborts and 3770value is returned as a string. Otherwise the function aborts and
3490displays the error message returned by the AppleScript scripting 3771displays the error message returned by the AppleScript scripting
3491component. */) 3772component. */)
3492 (script) 3773 (script)
3493 Lisp_Object script; 3774 Lisp_Object script;
3494{ 3775{
3495 char *result, *temp; 3776 char *result, *temp;
@@ -3529,16 +3810,15 @@ component. */)
3529 3810
3530DEFUN ("mac-file-name-to-posix", Fmac_file_name_to_posix, 3811DEFUN ("mac-file-name-to-posix", Fmac_file_name_to_posix,
3531 Smac_file_name_to_posix, 1, 1, 0, 3812 Smac_file_name_to_posix, 1, 1, 0,
3532 doc: /* Convert Macintosh filename to Posix form. */) 3813 doc: /* Convert Macintosh FILENAME to Posix form. */)
3533 (mac_filename) 3814 (filename)
3534 Lisp_Object mac_filename; 3815 Lisp_Object filename;
3535{ 3816{
3536 char posix_filename[MAXPATHLEN+1]; 3817 char posix_filename[MAXPATHLEN+1];
3537 3818
3538 CHECK_STRING (mac_filename); 3819 CHECK_STRING (filename);
3539 3820
3540 if (mac_to_posix_pathname (SDATA (mac_filename), posix_filename, 3821 if (mac_to_posix_pathname (SDATA (filename), posix_filename, MAXPATHLEN))
3541 MAXPATHLEN))
3542 return build_string (posix_filename); 3822 return build_string (posix_filename);
3543 else 3823 else
3544 return Qnil; 3824 return Qnil;
@@ -3547,16 +3827,15 @@ DEFUN ("mac-file-name-to-posix", Fmac_file_name_to_posix,
3547 3827
3548DEFUN ("posix-file-name-to-mac", Fposix_file_name_to_mac, 3828DEFUN ("posix-file-name-to-mac", Fposix_file_name_to_mac,
3549 Sposix_file_name_to_mac, 1, 1, 0, 3829 Sposix_file_name_to_mac, 1, 1, 0,
3550 doc: /* Convert Posix filename to Mac form. */) 3830 doc: /* Convert Posix FILENAME to Mac form. */)
3551 (posix_filename) 3831 (filename)
3552 Lisp_Object posix_filename; 3832 Lisp_Object filename;
3553{ 3833{
3554 char mac_filename[MAXPATHLEN+1]; 3834 char mac_filename[MAXPATHLEN+1];
3555 3835
3556 CHECK_STRING (posix_filename); 3836 CHECK_STRING (filename);
3557 3837
3558 if (posix_to_mac_pathname (SDATA (posix_filename), mac_filename, 3838 if (posix_to_mac_pathname (SDATA (filename), mac_filename, MAXPATHLEN))
3559 MAXPATHLEN))
3560 return build_string (mac_filename); 3839 return build_string (mac_filename);
3561 else 3840 else
3562 return Qnil; 3841 return Qnil;
@@ -3571,8 +3850,8 @@ DEFUN ("mac-get-preference", Fmac_get_preference, Smac_get_preference, 1, 4, 0,
3571 doc: /* Return the application preference value for KEY. 3850 doc: /* Return the application preference value for KEY.
3572KEY is either a string specifying a preference key, or a list of key 3851KEY is either a string specifying a preference key, or a list of key
3573strings. If it is a list, the (i+1)-th element is used as a key for 3852strings. If it is a list, the (i+1)-th element is used as a key for
3574the CFDictionary value obtained by the i-th element. If lookup is 3853the CFDictionary value obtained by the i-th element. Return nil if
3575failed at some stage, nil is returned. 3854lookup is failed at some stage.
3576 3855
3577Optional arg APPLICATION is an application ID string. If omitted or 3856Optional arg APPLICATION is an application ID string. If omitted or
3578nil, that stands for the current application. 3857nil, that stands for the current application.
@@ -3603,7 +3882,7 @@ CFDictionary. If HASH-BOUND is a negative integer or nil, always
3603generate alists. If HASH-BOUND >= 0, generate an alist if the number 3882generate alists. If HASH-BOUND >= 0, generate an alist if the number
3604of keys in the dictionary is smaller than HASH-BOUND, and a hash table 3883of keys in the dictionary is smaller than HASH-BOUND, and a hash table
3605otherwise. */) 3884otherwise. */)
3606 (key, application, format, hash_bound) 3885 (key, application, format, hash_bound)
3607 Lisp_Object key, application, format, hash_bound; 3886 Lisp_Object key, application, format, hash_bound;
3608{ 3887{
3609 CFStringRef app_id, key_str; 3888 CFStringRef app_id, key_str;
@@ -3840,9 +4119,8 @@ charset string, or an integer as a CFStringEncoding value.
3840On Mac OS X 10.2 and later, you can do Unicode Normalization by 4119On Mac OS X 10.2 and later, you can do Unicode Normalization by
3841specifying the optional argument NORMALIZATION-FORM with a symbol NFD, 4120specifying the optional argument NORMALIZATION-FORM with a symbol NFD,
3842NFKD, NFC, NFKC, HFS+D, or HFS+C. 4121NFKD, NFC, NFKC, HFS+D, or HFS+C.
3843On successful conversion, returns the result string, else returns 4122On successful conversion, return the result string, else return nil. */)
3844nil. */) 4123 (string, source, target, normalization_form)
3845 (string, source, target, normalization_form)
3846 Lisp_Object string, source, target, normalization_form; 4124 Lisp_Object string, source, target, normalization_form;
3847{ 4125{
3848 Lisp_Object result = Qnil; 4126 Lisp_Object result = Qnil;
@@ -3862,7 +4140,11 @@ nil. */)
3862 src_encoding = get_cfstring_encoding_from_lisp (source); 4140 src_encoding = get_cfstring_encoding_from_lisp (source);
3863 tgt_encoding = get_cfstring_encoding_from_lisp (target); 4141 tgt_encoding = get_cfstring_encoding_from_lisp (target);
3864 4142
3865 string = string_make_unibyte (string); 4143 /* We really want string_to_unibyte, but since it doesn't exist yet, we
4144 use string_as_unibyte which works as well, except for the fact that
4145 it's too permissive (it doesn't check that the multibyte string only
4146 contain single-byte chars). */
4147 string = Fstring_as_unibyte (string);
3866 if (src_encoding != kCFStringEncodingInvalidId 4148 if (src_encoding != kCFStringEncodingInvalidId
3867 && tgt_encoding != kCFStringEncodingInvalidId) 4149 && tgt_encoding != kCFStringEncodingInvalidId)
3868 str = CFStringCreateWithBytes (NULL, SDATA (string), SBYTES (string), 4150 str = CFStringCreateWithBytes (NULL, SDATA (string), SBYTES (string),
@@ -3897,7 +4179,7 @@ nil. */)
3897 4179
3898DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, Smac_clear_font_name_table, 0, 0, 0, 4180DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, Smac_clear_font_name_table, 0, 0, 0,
3899 doc: /* Clear the font name table. */) 4181 doc: /* Clear the font name table. */)
3900 () 4182 ()
3901{ 4183{
3902 check_mac (); 4184 check_mac ();
3903 mac_clear_font_name_table (); 4185 mac_clear_font_name_table ();
@@ -4197,8 +4479,13 @@ init_mac_osx_environment ()
4197 app_bundle_pathname. */ 4479 app_bundle_pathname. */
4198 4480
4199 bundle = CFBundleGetMainBundle (); 4481 bundle = CFBundleGetMainBundle ();
4200 if (!bundle) 4482 if (!bundle || CFBundleGetIdentifier (bundle) == NULL)
4201 return; 4483 {
4484 /* We could not find the bundle identifier. For now, prevent
4485 the fatal error by bringing it up in the terminal. */
4486 inhibit_window_system = 1;
4487 return;
4488 }
4202 4489
4203 bundleURL = CFBundleCopyBundleURL (bundle); 4490 bundleURL = CFBundleCopyBundleURL (bundle);
4204 if (!bundleURL) 4491 if (!bundleURL)
@@ -4361,6 +4648,10 @@ syms_of_mac ()
4361#endif 4648#endif
4362 defsubr (&Smac_clear_font_name_table); 4649 defsubr (&Smac_clear_font_name_table);
4363 4650
4651 defsubr (&Smac_set_file_creator);
4652 defsubr (&Smac_set_file_type);
4653 defsubr (&Smac_get_file_creator);
4654 defsubr (&Smac_get_file_type);
4364 defsubr (&Sdo_applescript); 4655 defsubr (&Sdo_applescript);
4365 defsubr (&Smac_file_name_to_posix); 4656 defsubr (&Smac_file_name_to_posix);
4366 defsubr (&Sposix_file_name_to_mac); 4657 defsubr (&Sposix_file_name_to_mac);
diff --git a/src/macfns.c b/src/macfns.c
index b9f7e2bed5f..160eb1f7774 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -1,5 +1,5 @@
1/* Graphical user interface functions for Mac OS. 1/* Graphical user interface functions for Mac OS.
2 Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. 2 Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -21,58 +21,34 @@ Boston, MA 02110-1301, USA. */
21/* Contributed by Andrew Choi (akochoi@mac.com). */ 21/* Contributed by Andrew Choi (akochoi@mac.com). */
22 22
23#include <config.h> 23#include <config.h>
24
25#include <stdio.h> 24#include <stdio.h>
26#include <math.h> 25#include <math.h>
27#include <limits.h>
28#include <errno.h>
29 26
30#include "lisp.h" 27#include "lisp.h"
31#include "charset.h"
32#include "macterm.h" 28#include "macterm.h"
33#include "frame.h" 29#include "frame.h"
34#include "window.h" 30#include "window.h"
35#include "buffer.h" 31#include "buffer.h"
36#include "dispextern.h"
37#include "fontset.h"
38#include "intervals.h" 32#include "intervals.h"
33#include "dispextern.h"
39#include "keyboard.h" 34#include "keyboard.h"
40#include "blockinput.h" 35#include "blockinput.h"
41#include "epaths.h" 36#include <epaths.h>
42#include "termhooks.h" 37#include "charset.h"
43#include "coding.h" 38#include "coding.h"
39#include "fontset.h"
44#include "systime.h" 40#include "systime.h"
41#include "termhooks.h"
42#include "atimer.h"
45 43
46/* #include "bitmaps/gray.xbm" */
47#define gray_width 2
48#define gray_height 2
49static unsigned char gray_bits[] = {
50 0x01, 0x02};
51
52/*#include <commdlg.h>
53#include <shellapi.h>*/
54#include <ctype.h> 44#include <ctype.h>
55#include <sys/types.h> 45#include <sys/types.h>
56#include <sys/stat.h> 46#include <sys/stat.h>
47#include <limits.h>
48#include <errno.h>
57#include <sys/param.h> 49#include <sys/param.h>
58 50
59#include <stdlib.h> 51extern void free_frame_menubar ();
60#include <string.h>
61
62/*extern void free_frame_menubar ();
63extern double atof ();
64extern int w32_console_toggle_lock_key (int vk_code, Lisp_Object new_state);
65extern int quit_char;*/
66
67extern char *lispy_function_keys[];
68
69/* The gray bitmap `bitmaps/gray'. This is done because macterm.c uses
70 it, and including `bitmaps/gray' more than once is a problem when
71 config.h defines `static' as an empty replacement string. */
72
73int gray_bitmap_width = gray_width;
74int gray_bitmap_height = gray_height;
75unsigned char *gray_bitmap_bits = gray_bits;
76 52
77/* Non-zero means we're allowed to display an hourglass cursor. */ 53/* Non-zero means we're allowed to display an hourglass cursor. */
78 54
@@ -109,46 +85,13 @@ Lisp_Object Vx_no_window_manager;
109 85
110Lisp_Object Vx_pixel_size_width_font_regexp; 86Lisp_Object Vx_pixel_size_width_font_regexp;
111 87
112/* Evaluate this expression to rebuild the section of syms_of_macfns
113 that initializes and staticpros the symbols declared below. Note
114 that Emacs 18 has a bug that keeps C-x C-e from being able to
115 evaluate this expression.
116
117(progn
118 ;; Accumulate a list of the symbols we want to initialize from the
119 ;; declarations at the top of the file.
120 (goto-char (point-min))
121 (search-forward "/\*&&& symbols declared here &&&*\/\n")
122 (let (symbol-list)
123 (while (looking-at "Lisp_Object \\(Q[a-z_]+\\)")
124 (setq symbol-list
125 (cons (buffer-substring (match-beginning 1) (match-end 1))
126 symbol-list))
127 (forward-line 1))
128 (setq symbol-list (nreverse symbol-list))
129 ;; Delete the section of syms_of_... where we initialize the symbols.
130 (search-forward "\n /\*&&& init symbols here &&&*\/\n")
131 (let ((start (point)))
132 (while (looking-at "^ Q")
133 (forward-line 2))
134 (kill-region start (point)))
135 ;; Write a new symbol initialization section.
136 (while symbol-list
137 (insert (format " %s = intern (\"" (car symbol-list)))
138 (let ((start (point)))
139 (insert (substring (car symbol-list) 1))
140 (subst-char-in-region start (point) ?_ ?-))
141 (insert (format "\");\n staticpro (&%s);\n" (car symbol-list)))
142 (setq symbol-list (cdr symbol-list)))))
143
144 */
145
146/*&&& symbols declared here &&&*/
147Lisp_Object Qnone; 88Lisp_Object Qnone;
148Lisp_Object Qsuppress_icon; 89Lisp_Object Qsuppress_icon;
149Lisp_Object Qundefined_color; 90Lisp_Object Qundefined_color;
150Lisp_Object Qcancel_timer; 91Lisp_Object Qcancel_timer;
151 92
93/* In dispnew.c */
94
152extern Lisp_Object Vwindow_system_version; 95extern Lisp_Object Vwindow_system_version;
153 96
154#if 0 /* Use xstricmp instead. */ 97#if 0 /* Use xstricmp instead. */
@@ -243,40 +186,11 @@ check_x_display_info (frame)
243 186
244 return dpyinfo; 187 return dpyinfo;
245} 188}
246
247/* Return the Emacs frame-object corresponding to a mac window.
248 It could be the frame's main window or an icon window. */
249
250/* This function can be called during GC, so use GC_xxx type test macros. */
251
252struct frame *
253x_window_to_frame (dpyinfo, wdesc)
254 struct mac_display_info *dpyinfo;
255 WindowPtr wdesc;
256{
257 Lisp_Object tail, frame;
258 struct frame *f;
259
260 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
261 {
262 frame = XCAR (tail);
263 if (!GC_FRAMEP (frame))
264 continue;
265 f = XFRAME (frame);
266 if (!FRAME_W32_P (f) || FRAME_MAC_DISPLAY_INFO (f) != dpyinfo)
267 continue;
268 /*if (f->output_data.w32->hourglass_window == wdesc)
269 return f;*/
270
271 /* MAC_TODO: Check tooltips when supported. */
272 if (FRAME_MAC_WINDOW (f) == wdesc)
273 return f;
274 }
275 return 0;
276}
277 189
278 190
191
279static Lisp_Object unwind_create_frame P_ ((Lisp_Object)); 192static Lisp_Object unwind_create_frame P_ ((Lisp_Object));
193static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object));
280 194
281void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 195void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
282void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 196void x_set_background_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
@@ -302,6 +216,8 @@ static Lisp_Object x_default_scroll_bar_color_parameter P_ ((struct frame *,
302 216
303extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *)); 217extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *));
304 218
219
220
305/* Store the screen positions of frame F into XPTR and YPTR. 221/* Store the screen positions of frame F into XPTR and YPTR.
306 These are the positions of the containing window manager window, 222 These are the positions of the containing window manager window,
307 not Emacs's own window. */ 223 not Emacs's own window. */
@@ -1570,9 +1486,10 @@ x_set_cursor_color (f, arg, oldval)
1570 { 1486 {
1571 BLOCK_INPUT; 1487 BLOCK_INPUT;
1572 /* Update frame's cursor_gc. */ 1488 /* Update frame's cursor_gc. */
1573 f->output_data.mac->cursor_gc->foreground = fore_pixel; 1489 XSetBackground (FRAME_MAC_DISPLAY (f),
1574 f->output_data.mac->cursor_gc->background = pixel; 1490 f->output_data.mac->cursor_gc, pixel);
1575 1491 XSetForeground (FRAME_MAC_DISPLAY (f),
1492 f->output_data.mac->cursor_gc, fore_pixel);
1576 UNBLOCK_INPUT; 1493 UNBLOCK_INPUT;
1577 1494
1578 if (FRAME_VISIBLE_P (f)) 1495 if (FRAME_VISIBLE_P (f))
@@ -1833,8 +1750,49 @@ x_set_tool_bar_lines (f, value, oldval)
1833} 1750}
1834 1751
1835 1752
1753
1754/* Set the Mac window title to NAME for frame F. */
1755
1756static void
1757x_set_name_internal (f, name)
1758 FRAME_PTR f;
1759 Lisp_Object name;
1760{
1761 if (FRAME_MAC_WINDOW (f))
1762 {
1763 if (STRING_MULTIBYTE (name))
1764#if TARGET_API_MAC_CARBON
1765 name = ENCODE_UTF_8 (name);
1766#else
1767 name = ENCODE_SYSTEM (name);
1768#endif
1769
1770 BLOCK_INPUT;
1771
1772 {
1773#if TARGET_API_MAC_CARBON
1774 CFStringRef windowTitle =
1775 cfstring_create_with_utf8_cstring (SDATA (name));
1776
1777 SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle);
1778 CFRelease (windowTitle);
1779#else
1780 Str255 windowTitle;
1781 if (strlen (SDATA (name)) < 255)
1782 {
1783 strcpy (windowTitle, SDATA (name));
1784 c2pstr (windowTitle);
1785 SetWTitle (FRAME_MAC_WINDOW (f), windowTitle);
1786 }
1787#endif
1788 }
1789
1790 UNBLOCK_INPUT;
1791 }
1792}
1793
1836/* Change the name of frame F to NAME. If NAME is nil, set F's name to 1794/* Change the name of frame F to NAME. If NAME is nil, set F's name to
1837 w32_id_name. 1795 mac_id_name.
1838 1796
1839 If EXPLICIT is non-zero, that indicates that lisp code is setting the 1797 If EXPLICIT is non-zero, that indicates that lisp code is setting the
1840 name; if NAME is a string, set F's name to NAME and set 1798 name; if NAME is a string, set F's name to NAME and set
@@ -1864,7 +1822,7 @@ x_set_name (f, name, explicit)
1864 else if (f->explicit_name) 1822 else if (f->explicit_name)
1865 return; 1823 return;
1866 1824
1867 /* If NAME is nil, set the name to the w32_id_name. */ 1825 /* If NAME is nil, set the name to the mac_id_name. */
1868 if (NILP (name)) 1826 if (NILP (name))
1869 { 1827 {
1870 /* Check for no change needed in this very common case 1828 /* Check for no change needed in this very common case
@@ -1888,37 +1846,7 @@ x_set_name (f, name, explicit)
1888 if (! NILP (f->title)) 1846 if (! NILP (f->title))
1889 name = f->title; 1847 name = f->title;
1890 1848
1891 if (FRAME_MAC_WINDOW (f)) 1849 x_set_name_internal (f, name);
1892 {
1893 if (STRING_MULTIBYTE (name))
1894#if TARGET_API_MAC_CARBON
1895 name = ENCODE_UTF_8 (name);
1896#else
1897 name = ENCODE_SYSTEM (name);
1898#endif
1899
1900 BLOCK_INPUT;
1901
1902 {
1903#if TARGET_API_MAC_CARBON
1904 CFStringRef windowTitle =
1905 cfstring_create_with_utf8_cstring (SDATA (name));
1906
1907 SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle);
1908 CFRelease (windowTitle);
1909#else
1910 Str255 windowTitle;
1911 if (strlen (SDATA (name)) < 255)
1912 {
1913 strcpy (windowTitle, SDATA (name));
1914 c2pstr (windowTitle);
1915 SetWTitle (FRAME_MAC_WINDOW (f), windowTitle);
1916 }
1917#endif
1918 }
1919
1920 UNBLOCK_INPUT;
1921 }
1922} 1850}
1923 1851
1924/* This function should be called when the user's lisp code has 1852/* This function should be called when the user's lisp code has
@@ -1969,38 +1897,10 @@ x_set_title (f, name, old_name)
1969 1897
1970 if (NILP (name)) 1898 if (NILP (name))
1971 name = f->name; 1899 name = f->name;
1900 else
1901 CHECK_STRING (name);
1972 1902
1973 if (FRAME_MAC_WINDOW (f)) 1903 x_set_name_internal (f, name);
1974 {
1975 if (STRING_MULTIBYTE (name))
1976#if TARGET_API_MAC_CARBON
1977 name = ENCODE_UTF_8 (name);
1978#else
1979 name = ENCODE_SYSTEM (name);
1980#endif
1981
1982 BLOCK_INPUT;
1983
1984 {
1985#if TARGET_API_MAC_CARBON
1986 CFStringRef windowTitle =
1987 cfstring_create_with_utf8_cstring (SDATA (name));
1988
1989 SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle);
1990 CFRelease (windowTitle);
1991#else
1992 Str255 windowTitle;
1993 if (strlen (SDATA (name)) < 255)
1994 {
1995 strcpy (windowTitle, SDATA (name));
1996 c2pstr (windowTitle);
1997 SetWTitle (FRAME_MAC_WINDOW (f), windowTitle);
1998 }
1999#endif
2000 }
2001
2002 UNBLOCK_INPUT;
2003 }
2004} 1904}
2005 1905
2006void 1906void
@@ -2469,7 +2369,7 @@ unwind_create_frame (frame)
2469 2369
2470DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, 2370DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
2471 1, 1, 0, 2371 1, 1, 0,
2472 doc: /* Make a new window, which is called a \"frame\" in Emacs terms. 2372 doc: /* Make a new window, which is called a "frame" in Emacs terms.
2473Returns an Emacs frame object. 2373Returns an Emacs frame object.
2474ALIST is an alist of frame parameters. 2374ALIST is an alist of frame parameters.
2475If the parameters specify that the frame should not have a minibuffer, 2375If the parameters specify that the frame should not have a minibuffer,
@@ -2478,7 +2378,7 @@ then `default-minibuffer-frame' must be a frame whose minibuffer can
2478be shared by the new frame. 2378be shared by the new frame.
2479 2379
2480This function is an internal primitive--use `make-frame' instead. */) 2380This function is an internal primitive--use `make-frame' instead. */)
2481 (parms) 2381 (parms)
2482 Lisp_Object parms; 2382 Lisp_Object parms;
2483{ 2383{
2484 struct frame *f; 2384 struct frame *f;
@@ -2803,7 +2703,7 @@ x_get_focus_frame (frame)
2803 2703
2804DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, 2704DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
2805 doc: /* Internal function called by `color-defined-p', which see. */) 2705 doc: /* Internal function called by `color-defined-p', which see. */)
2806 (color, frame) 2706 (color, frame)
2807 Lisp_Object color, frame; 2707 Lisp_Object color, frame;
2808{ 2708{
2809 XColor foo; 2709 XColor foo;
@@ -2819,7 +2719,7 @@ DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
2819 2719
2820DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, 2720DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
2821 doc: /* Internal function called by `color-values', which see. */) 2721 doc: /* Internal function called by `color-values', which see. */)
2822 (color, frame) 2722 (color, frame)
2823 Lisp_Object color, frame; 2723 Lisp_Object color, frame;
2824{ 2724{
2825 XColor foo; 2725 XColor foo;
@@ -2842,7 +2742,7 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
2842 2742
2843DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0, 2743DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0,
2844 doc: /* Internal function called by `display-color-p', which see. */) 2744 doc: /* Internal function called by `display-color-p', which see. */)
2845 (display) 2745 (display)
2846 Lisp_Object display; 2746 Lisp_Object display;
2847{ 2747{
2848 struct mac_display_info *dpyinfo = check_x_display_info (display); 2748 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -2855,12 +2755,12 @@ DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0,
2855 2755
2856DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p, 2756DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p,
2857 0, 1, 0, 2757 0, 1, 0,
2858 doc: /* Return t if the X display supports shades of gray. 2758 doc: /* Return t if DISPLAY supports shades of gray.
2859Note that color displays do support shades of gray. 2759Note that color displays do support shades of gray.
2860The optional argument DISPLAY specifies which display to ask about. 2760The optional argument DISPLAY specifies which display to ask about.
2861DISPLAY should be either a frame or a display name (a string). 2761DISPLAY should be either a frame or a display name (a string).
2862If omitted or nil, that stands for the selected frame's display. */) 2762If omitted or nil, that stands for the selected frame's display. */)
2863 (display) 2763 (display)
2864 Lisp_Object display; 2764 Lisp_Object display;
2865{ 2765{
2866 struct mac_display_info *dpyinfo = check_x_display_info (display); 2766 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -2873,11 +2773,11 @@ If omitted or nil, that stands for the selected frame's display. */)
2873 2773
2874DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width, 2774DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width,
2875 0, 1, 0, 2775 0, 1, 0,
2876 doc: /* Returns the width in pixels of the X display DISPLAY. 2776 doc: /* Returns the width in pixels of DISPLAY.
2877The optional argument DISPLAY specifies which display to ask about. 2777The optional argument DISPLAY specifies which display to ask about.
2878DISPLAY should be either a frame or a display name (a string). 2778DISPLAY should be either a frame or a display name (a string).
2879If omitted or nil, that stands for the selected frame's display. */) 2779If omitted or nil, that stands for the selected frame's display. */)
2880 (display) 2780 (display)
2881 Lisp_Object display; 2781 Lisp_Object display;
2882{ 2782{
2883 struct mac_display_info *dpyinfo = check_x_display_info (display); 2783 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -2887,11 +2787,11 @@ If omitted or nil, that stands for the selected frame's display. */)
2887 2787
2888DEFUN ("x-display-pixel-height", Fx_display_pixel_height, 2788DEFUN ("x-display-pixel-height", Fx_display_pixel_height,
2889 Sx_display_pixel_height, 0, 1, 0, 2789 Sx_display_pixel_height, 0, 1, 0,
2890 doc: /* Returns the height in pixels of the X display DISPLAY. 2790 doc: /* Returns the height in pixels of DISPLAY.
2891The optional argument DISPLAY specifies which display to ask about. 2791The optional argument DISPLAY specifies which display to ask about.
2892DISPLAY should be either a frame or a display name (a string). 2792DISPLAY should be either a frame or a display name (a string).
2893If omitted or nil, that stands for the selected frame's display. */) 2793If omitted or nil, that stands for the selected frame's display. */)
2894 (display) 2794 (display)
2895 Lisp_Object display; 2795 Lisp_Object display;
2896{ 2796{
2897 struct mac_display_info *dpyinfo = check_x_display_info (display); 2797 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -2901,11 +2801,11 @@ If omitted or nil, that stands for the selected frame's display. */)
2901 2801
2902DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes, 2802DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes,
2903 0, 1, 0, 2803 0, 1, 0,
2904 doc: /* Returns the number of bitplanes of the display DISPLAY. 2804 doc: /* Returns the number of bitplanes of DISPLAY.
2905The optional argument DISPLAY specifies which display to ask about. 2805The optional argument DISPLAY specifies which display to ask about.
2906DISPLAY should be either a frame or a display name (a string). 2806DISPLAY should be either a frame or a display name (a string).
2907If omitted or nil, that stands for the selected frame's display. */) 2807If omitted or nil, that stands for the selected frame's display. */)
2908 (display) 2808 (display)
2909 Lisp_Object display; 2809 Lisp_Object display;
2910{ 2810{
2911 struct mac_display_info *dpyinfo = check_x_display_info (display); 2811 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -2915,11 +2815,11 @@ If omitted or nil, that stands for the selected frame's display. */)
2915 2815
2916DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells, 2816DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells,
2917 0, 1, 0, 2817 0, 1, 0,
2918 doc: /* Returns the number of color cells of the display DISPLAY. 2818 doc: /* Returns the number of color cells of DISPLAY.
2919The optional argument DISPLAY specifies which display to ask about. 2819The optional argument DISPLAY specifies which display to ask about.
2920DISPLAY should be either a frame or a display name (a string). 2820DISPLAY should be either a frame or a display name (a string).
2921If omitted or nil, that stands for the selected frame's display. */) 2821If omitted or nil, that stands for the selected frame's display. */)
2922 (display) 2822 (display)
2923 Lisp_Object display; 2823 Lisp_Object display;
2924{ 2824{
2925 struct mac_display_info *dpyinfo = check_x_display_info (display); 2825 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -2931,11 +2831,11 @@ If omitted or nil, that stands for the selected frame's display. */)
2931DEFUN ("x-server-max-request-size", Fx_server_max_request_size, 2831DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
2932 Sx_server_max_request_size, 2832 Sx_server_max_request_size,
2933 0, 1, 0, 2833 0, 1, 0,
2934 doc: /* Returns the maximum request size of the server of display DISPLAY. 2834 doc: /* Returns the maximum request size of the server of DISPLAY.
2935The optional argument DISPLAY specifies which display to ask about. 2835The optional argument DISPLAY specifies which display to ask about.
2936DISPLAY should be either a frame or a display name (a string). 2836DISPLAY should be either a frame or a display name (a string).
2937If omitted or nil, that stands for the selected frame's display. */) 2837If omitted or nil, that stands for the selected frame's display. */)
2938 (display) 2838 (display)
2939 Lisp_Object display; 2839 Lisp_Object display;
2940{ 2840{
2941 struct mac_display_info *dpyinfo = check_x_display_info (display); 2841 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -2944,18 +2844,18 @@ If omitted or nil, that stands for the selected frame's display. */)
2944} 2844}
2945 2845
2946DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, 2846DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
2947 doc: /* Returns the vendor ID string of the Mac OS system (Apple). 2847 doc: /* Returns the "vendor ID" string of the Mac OS system (Apple).
2948The optional argument DISPLAY specifies which display to ask about. 2848The optional argument DISPLAY specifies which display to ask about.
2949DISPLAY should be either a frame or a display name (a string). 2849DISPLAY should be either a frame or a display name (a string).
2950If omitted or nil, that stands for the selected frame's display. */) 2850If omitted or nil, that stands for the selected frame's display. */)
2951 (display) 2851 (display)
2952 Lisp_Object display; 2852 Lisp_Object display;
2953{ 2853{
2954 return build_string ("Apple Computers"); 2854 return build_string ("Apple Computers");
2955} 2855}
2956 2856
2957DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, 2857DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
2958 doc: /* Returns the version numbers of the server of display DISPLAY. 2858 doc: /* Returns the version numbers of the Mac OS system.
2959The value is a list of three integers: the major and minor 2859The value is a list of three integers: the major and minor
2960version numbers, and the vendor-specific release 2860version numbers, and the vendor-specific release
2961number. See also the function `x-server-vendor'. 2861number. See also the function `x-server-vendor'.
@@ -2963,7 +2863,7 @@ number. See also the function `x-server-vendor'.
2963The optional argument DISPLAY specifies which display to ask about. 2863The optional argument DISPLAY specifies which display to ask about.
2964DISPLAY should be either a frame or a display name (a string). 2864DISPLAY should be either a frame or a display name (a string).
2965If omitted or nil, that stands for the selected frame's display. */) 2865If omitted or nil, that stands for the selected frame's display. */)
2966 (display) 2866 (display)
2967 Lisp_Object display; 2867 Lisp_Object display;
2968{ 2868{
2969 int mac_major_version; 2869 int mac_major_version;
@@ -2988,22 +2888,22 @@ If omitted or nil, that stands for the selected frame's display. */)
2988} 2888}
2989 2889
2990DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, 2890DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,
2991 doc: /* Return the number of screens on the server of display DISPLAY. 2891 doc: /* Return the number of screens on the server of DISPLAY.
2992The optional argument DISPLAY specifies which display to ask about. 2892The optional argument DISPLAY specifies which display to ask about.
2993DISPLAY should be either a frame or a display name (a string). 2893DISPLAY should be either a frame or a display name (a string).
2994If omitted or nil, that stands for the selected frame's display. */) 2894If omitted or nil, that stands for the selected frame's display. */)
2995 (display) 2895 (display)
2996 Lisp_Object display; 2896 Lisp_Object display;
2997{ 2897{
2998 return make_number (1); 2898 return make_number (1);
2999} 2899}
3000 2900
3001DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0, 2901DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0,
3002 doc: /* Return the height in millimeters of the X display DISPLAY. 2902 doc: /* Return the height in millimeters of DISPLAY.
3003The optional argument DISPLAY specifies which display to ask about. 2903The optional argument DISPLAY specifies which display to ask about.
3004DISPLAY should be either a frame or a display name (a string). 2904DISPLAY should be either a frame or a display name (a string).
3005If omitted or nil, that stands for the selected frame's display. */) 2905If omitted or nil, that stands for the selected frame's display. */)
3006 (display) 2906 (display)
3007 Lisp_Object display; 2907 Lisp_Object display;
3008{ 2908{
3009 /* MAC_TODO: this is an approximation, and only of the main display */ 2909 /* MAC_TODO: this is an approximation, and only of the main display */
@@ -3014,11 +2914,11 @@ If omitted or nil, that stands for the selected frame's display. */)
3014} 2914}
3015 2915
3016DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0, 2916DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
3017 doc: /* Return the width in millimeters of the X display DISPLAY. 2917 doc: /* Return the width in millimeters of DISPLAY.
3018The optional argument DISPLAY specifies which display to ask about. 2918The optional argument DISPLAY specifies which display to ask about.
3019DISPLAY should be either a frame or a display name (a string). 2919DISPLAY should be either a frame or a display name (a string).
3020If omitted or nil, that stands for the selected frame's display. */) 2920If omitted or nil, that stands for the selected frame's display. */)
3021 (display) 2921 (display)
3022 Lisp_Object display; 2922 Lisp_Object display;
3023{ 2923{
3024 /* MAC_TODO: this is an approximation, and only of the main display */ 2924 /* MAC_TODO: this is an approximation, and only of the main display */
@@ -3030,12 +2930,12 @@ If omitted or nil, that stands for the selected frame's display. */)
3030 2930
3031DEFUN ("x-display-backing-store", Fx_display_backing_store, 2931DEFUN ("x-display-backing-store", Fx_display_backing_store,
3032 Sx_display_backing_store, 0, 1, 0, 2932 Sx_display_backing_store, 0, 1, 0,
3033 doc: /* Returns an indication of whether display DISPLAY does backing store. 2933 doc: /* Returns an indication of whether DISPLAY does backing store.
3034The value may be `always', `when-mapped', or `not-useful'. 2934The value may be `always', `when-mapped', or `not-useful'.
3035The optional argument DISPLAY specifies which display to ask about. 2935The optional argument DISPLAY specifies which display to ask about.
3036DISPLAY should be either a frame or a display name (a string). 2936DISPLAY should be either a frame or a display name (a string).
3037If omitted or nil, that stands for the selected frame's display. */) 2937If omitted or nil, that stands for the selected frame's display. */)
3038 (display) 2938 (display)
3039 Lisp_Object display; 2939 Lisp_Object display;
3040{ 2940{
3041 return intern ("not-useful"); 2941 return intern ("not-useful");
@@ -3043,14 +2943,14 @@ If omitted or nil, that stands for the selected frame's display. */)
3043 2943
3044DEFUN ("x-display-visual-class", Fx_display_visual_class, 2944DEFUN ("x-display-visual-class", Fx_display_visual_class,
3045 Sx_display_visual_class, 0, 1, 0, 2945 Sx_display_visual_class, 0, 1, 0,
3046 doc: /* Returns the visual class of the display DISPLAY. 2946 doc: /* Returns the visual class of DISPLAY.
3047The value is one of the symbols `static-gray', `gray-scale', 2947The value is one of the symbols `static-gray', `gray-scale',
3048`static-color', `pseudo-color', `true-color', or `direct-color'. 2948`static-color', `pseudo-color', `true-color', or `direct-color'.
3049 2949
3050The optional argument DISPLAY specifies which display to ask about. 2950The optional argument DISPLAY specifies which display to ask about.
3051DISPLAY should be either a frame or a display name (a string). 2951DISPLAY should be either a frame or a display name (a string).
3052If omitted or nil, that stands for the selected frame's display. */) 2952If omitted or nil, that stands for the selected frame's display. */)
3053 (display) 2953 (display)
3054 Lisp_Object display; 2954 Lisp_Object display;
3055{ 2955{
3056 struct mac_display_info *dpyinfo = check_x_display_info (display); 2956 struct mac_display_info *dpyinfo = check_x_display_info (display);
@@ -3074,11 +2974,11 @@ If omitted or nil, that stands for the selected frame's display. */)
3074 2974
3075DEFUN ("x-display-save-under", Fx_display_save_under, 2975DEFUN ("x-display-save-under", Fx_display_save_under,
3076 Sx_display_save_under, 0, 1, 0, 2976 Sx_display_save_under, 0, 1, 0,
3077 doc: /* Returns t if the display DISPLAY supports the save-under feature. 2977 doc: /* Returns t if DISPLAY supports the save-under feature.
3078The optional argument DISPLAY specifies which display to ask about. 2978The optional argument DISPLAY specifies which display to ask about.
3079DISPLAY should be either a frame or a display name (a string). 2979DISPLAY should be either a frame or a display name (a string).
3080If omitted or nil, that stands for the selected frame's display. */) 2980If omitted or nil, that stands for the selected frame's display. */)
3081 (display) 2981 (display)
3082 Lisp_Object display; 2982 Lisp_Object display;
3083{ 2983{
3084 return Qnil; 2984 return Qnil;
@@ -3168,7 +3068,7 @@ DISPLAY is the name of the display to connect to.
3168Optional second arg XRM-STRING is a string of resources in xrdb format. 3068Optional second arg XRM-STRING is a string of resources in xrdb format.
3169If the optional third arg MUST-SUCCEED is non-nil, 3069If the optional third arg MUST-SUCCEED is non-nil,
3170terminate Emacs if we can't open the connection. */) 3070terminate Emacs if we can't open the connection. */)
3171 (display, xrm_string, must_succeed) 3071 (display, xrm_string, must_succeed)
3172 Lisp_Object display, xrm_string, must_succeed; 3072 Lisp_Object display, xrm_string, must_succeed;
3173{ 3073{
3174 unsigned char *xrm_option; 3074 unsigned char *xrm_option;
@@ -3213,8 +3113,8 @@ DEFUN ("x-close-connection", Fx_close_connection,
3213 doc: /* Close the connection to DISPLAY's server. 3113 doc: /* Close the connection to DISPLAY's server.
3214For DISPLAY, specify either a frame or a display name (a string). 3114For DISPLAY, specify either a frame or a display name (a string).
3215If DISPLAY is nil, that stands for the selected frame's display. */) 3115If DISPLAY is nil, that stands for the selected frame's display. */)
3216 (display) 3116 (display)
3217 Lisp_Object display; 3117 Lisp_Object display;
3218{ 3118{
3219 struct mac_display_info *dpyinfo = check_x_display_info (display); 3119 struct mac_display_info *dpyinfo = check_x_display_info (display);
3220 int i; 3120 int i;
@@ -3240,7 +3140,7 @@ If DISPLAY is nil, that stands for the selected frame's display. */)
3240 3140
3241DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0, 3141DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
3242 doc: /* Return the list of display names that Emacs has connections to. */) 3142 doc: /* Return the list of display names that Emacs has connections to. */)
3243 () 3143 ()
3244{ 3144{
3245 Lisp_Object tail, result; 3145 Lisp_Object tail, result;
3246 3146
@@ -3252,13 +3152,8 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
3252} 3152}
3253 3153
3254DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0, 3154DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0,
3255 doc: /* If ON is non-nil, report errors as soon as the erring request is made. 3155 doc: /* This is a noop on Mac OS systems. */)
3256If ON is nil, allow buffering of requests. 3156 (on, display)
3257This is a noop on Mac OS systems.
3258The optional second argument DISPLAY specifies which display to act on.
3259DISPLAY should be either a frame or a display name (a string).
3260If DISPLAY is omitted or nil, that stands for the selected frame's display. */)
3261 (on, display)
3262 Lisp_Object display, on; 3157 Lisp_Object display, on;
3263{ 3158{
3264 return Qnil; 3159 return Qnil;
@@ -3317,7 +3212,7 @@ DEFUN ("x-delete-window-property", Fx_delete_window_property,
3317 Sx_delete_window_property, 1, 2, 0, 3212 Sx_delete_window_property, 1, 2, 0,
3318 doc: /* Remove window property PROP from X window of FRAME. 3213 doc: /* Remove window property PROP from X window of FRAME.
3319FRAME nil or omitted means use the selected frame. Value is PROP. */) 3214FRAME nil or omitted means use the selected frame. Value is PROP. */)
3320 (prop, frame) 3215 (prop, frame)
3321 Lisp_Object prop, frame; 3216 Lisp_Object prop, frame;
3322{ 3217{
3323#if 0 /* MAC_TODO : port window properties to Mac */ 3218#if 0 /* MAC_TODO : port window properties to Mac */
@@ -3345,7 +3240,7 @@ DEFUN ("x-window-property", Fx_window_property, Sx_window_property,
3345If FRAME is nil or omitted, use the selected frame. Value is nil 3240If FRAME is nil or omitted, use the selected frame. Value is nil
3346if FRAME hasn't a property with name PROP or if PROP has no string 3241if FRAME hasn't a property with name PROP or if PROP has no string
3347value. */) 3242value. */)
3348 (prop, frame) 3243 (prop, frame)
3349 Lisp_Object prop, frame; 3244 Lisp_Object prop, frame;
3350{ 3245{
3351#if 0 /* MAC_TODO : port window properties to Mac */ 3246#if 0 /* MAC_TODO : port window properties to Mac */
@@ -3947,7 +3842,7 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y)
3947 3842
3948DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, 3843DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
3949 doc: /* Show STRING in a "tooltip" window on frame FRAME. 3844 doc: /* Show STRING in a "tooltip" window on frame FRAME.
3950A tooltip window is a small X window displaying a string. 3845A tooltip window is a small window displaying a string.
3951 3846
3952FRAME nil or omitted means use the selected frame. 3847FRAME nil or omitted means use the selected frame.
3953 3848
@@ -3957,7 +3852,7 @@ change the tooltip's appearance.
3957Automatically hide the tooltip after TIMEOUT seconds. TIMEOUT nil 3852Automatically hide the tooltip after TIMEOUT seconds. TIMEOUT nil
3958means use the default timeout of 5 seconds. 3853means use the default timeout of 5 seconds.
3959 3854
3960If the list of frame parameters PARAMS contains a `left' parameters, 3855If the list of frame parameters PARMS contains a `left' parameter,
3961the tooltip is displayed at that x-position. Otherwise it is 3856the tooltip is displayed at that x-position. Otherwise it is
3962displayed at the mouse position, with offset DX added (default is 5 if 3857displayed at the mouse position, with offset DX added (default is 5 if
3963DX isn't specified). Likewise for the y-position; if a `top' frame 3858DX isn't specified). Likewise for the y-position; if a `top' frame
@@ -4215,7 +4110,7 @@ Use a file selection dialog.
4215Select DEFAULT-FILENAME in the dialog's file selection box, if 4110Select DEFAULT-FILENAME in the dialog's file selection box, if
4216specified. Ensure that file exists if MUSTMATCH is non-nil. 4111specified. Ensure that file exists if MUSTMATCH is non-nil.
4217If ONLY-DIR-P is non-nil, the user can only select directories. */) 4112If ONLY-DIR-P is non-nil, the user can only select directories. */)
4218 (prompt, dir, default_filename, mustmatch, only_dir_p) 4113 (prompt, dir, default_filename, mustmatch, only_dir_p)
4219 Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p; 4114 Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p;
4220{ 4115{
4221 struct frame *f = SELECTED_FRAME (); 4116 struct frame *f = SELECTED_FRAME ();
diff --git a/src/macgui.h b/src/macgui.h
index d9948278d1b..607890317e1 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -1,5 +1,6 @@
1/* Definitions and headers for communication on the Mac OS. 1/* Definitions and headers for communication on the Mac OS.
2 Copyright (C) 2000, 2001 Free Software Foundation, Inc. 2 Copyright (C) 2000, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -86,6 +87,10 @@ typedef GWorldPtr Pixmap;
86 87
87#define FACE_DEFAULT (~0) 88#define FACE_DEFAULT (~0)
88 89
90#if !TARGET_API_MAC_CARBON
91#define GetPixDepth(pmh) ((*(pmh))->pixelSize)
92#endif
93
89 94
90/* Emulate XCharStruct. */ 95/* Emulate XCharStruct. */
91typedef struct _XCharStruct 96typedef struct _XCharStruct
@@ -180,15 +185,24 @@ typedef struct _XGCValues
180 XFontStruct *font; 185 XFontStruct *font;
181} XGCValues; 186} XGCValues;
182 187
183typedef XGCValues *GC; 188typedef struct _XGC
189{
190 /* Original value. */
191 XGCValues xgcv;
192
193 /* Cached data members follow. */
194
195 /* QuickDraw foreground color. */
196 RGBColor fore_color;
184 197
185extern XGCValues * 198 /* QuickDraw background color. */
186XCreateGC (void *, Window, unsigned long, XGCValues *); 199 RGBColor back_color;
200} *GC;
187 201
188#define GCForeground 0x01 202#define GCForeground (1L<<2)
189#define GCBackground 0x02 203#define GCBackground (1L<<3)
190#define GCFont 0x03 204#define GCFont (1L<<14)
191#define GCGraphicsExposures 0 205#define GCGraphicsExposures 0
192 206
193/* Bit Gravity */ 207/* Bit Gravity */
194 208
@@ -248,8 +262,6 @@ typedef struct {
248#define PBaseSize (1L << 8) /* program specified base for incrementing */ 262#define PBaseSize (1L << 8) /* program specified base for incrementing */
249#define PWinGravity (1L << 9) /* program specified window gravity */ 263#define PWinGravity (1L << 9) /* program specified window gravity */
250 264
251extern int XParseGeometry ();
252
253typedef struct { 265typedef struct {
254 int x, y; 266 int x, y;
255 unsigned width, height; 267 unsigned width, height;
diff --git a/src/macmenu.c b/src/macmenu.c
index ab266f6f0b5..a68ff04e405 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -1,5 +1,6 @@
1/* Menu support for GNU Emacs on the for Mac OS. 1/* Menu support for GNU Emacs on the for Mac OS.
2 Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 2 Copyright (C) 2000, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -611,37 +612,48 @@ cleanup_popup_menu (arg)
611 612
612DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, 613DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0,
613 doc: /* Pop up a deck-of-cards menu and return user's selection. 614 doc: /* Pop up a deck-of-cards menu and return user's selection.
614POSITION is a position specification. This is either a mouse button 615POSITION is a position specification. This is either a mouse button event
615event or a list ((XOFFSET YOFFSET) WINDOW) where XOFFSET and YOFFSET 616or a list ((XOFFSET YOFFSET) WINDOW)
616are positions in pixels from the top left corner of WINDOW's frame 617where XOFFSET and YOFFSET are positions in pixels from the top left
617\(WINDOW may be a frame object instead of a window). This controls the 618corner of WINDOW. (WINDOW may be a window or a frame object.)
618position of the center of the first line in the first pane of the 619This controls the position of the top left of the menu as a whole.
619menu, not the top left of the menu as a whole. If POSITION is t, it 620If POSITION is t, it means to use the current mouse position.
620means to use the current mouse position.
621 621
622MENU is a specifier for a menu. For the simplest case, MENU is a keymap. 622MENU is a specifier for a menu. For the simplest case, MENU is a keymap.
623The menu items come from key bindings that have a menu string as well as 623The menu items come from key bindings that have a menu string as well as
624a definition; actually, the \"definition\" in such a key binding looks like 624a definition; actually, the "definition" in such a key binding looks like
625\(STRING . REAL-DEFINITION). To give the menu a title, put a string into 625\(STRING . REAL-DEFINITION). To give the menu a title, put a string into
626the keymap as a top-level element. 626the keymap as a top-level element.
627 627
628If REAL-DEFINITION is nil, that puts a nonselectable string in the menu. 628If REAL-DEFINITION is nil, that puts a nonselectable string in the menu.
629Otherwise, REAL-DEFINITION should be a valid key binding definition. 629Otherwise, REAL-DEFINITION should be a valid key binding definition.
630 630
631You can also use a list of keymaps as MENU. Then each keymap makes a 631You can also use a list of keymaps as MENU.
632separate pane. When MENU is a keymap or a list of keymaps, the return 632 Then each keymap makes a separate pane.
633value is a list of events.
634 633
635Alternatively, you can specify a menu of multiple panes with a list of 634When MENU is a keymap or a list of keymaps, the return value is the
636the form (TITLE PANE1 PANE2...), where each pane is a list of 635list of events corresponding to the user's choice. Note that
637form (TITLE ITEM1 ITEM2...). 636`x-popup-menu' does not actually execute the command bound to that
638Each ITEM is normally a cons cell (STRING . VALUE); but a string can 637sequence of events.
639appear as an item--that makes a nonselectable line in the menu. 638
639Alternatively, you can specify a menu of multiple panes
640 with a list of the form (TITLE PANE1 PANE2...),
641where each pane is a list of form (TITLE ITEM1 ITEM2...).
642Each ITEM is normally a cons cell (STRING . VALUE);
643but a string can appear as an item--that makes a nonselectable line
644in the menu.
640With this form of menu, the return value is VALUE from the chosen item. 645With this form of menu, the return value is VALUE from the chosen item.
641 646
642If POSITION is nil, don't display the menu at all, just precalculate the 647If POSITION is nil, don't display the menu at all, just precalculate the
643cached information about equivalent key sequences. */) 648cached information about equivalent key sequences.
644 (position, menu) 649
650If the user gets rid of the menu without making a valid choice, for
651instance by clicking the mouse away from a valid choice or by typing
652keyboard input, then this normally results in a quit and
653`x-popup-menu' does not return. But if POSITION is a mouse button
654event (indicating that the user invoked the menu with the mouse) then
655no quit occurs and `x-popup-menu' returns nil. */)
656 (position, menu)
645 Lisp_Object position, menu; 657 Lisp_Object position, menu;
646{ 658{
647 Lisp_Object keymap, tem; 659 Lisp_Object keymap, tem;
@@ -840,7 +852,7 @@ If POSITION is t, it means to use the frame the mouse is on.
840The dialog box appears in the middle of the specified frame. 852The dialog box appears in the middle of the specified frame.
841 853
842CONTENTS specifies the alternatives to display in the dialog box. 854CONTENTS specifies the alternatives to display in the dialog box.
843It is a list of the form (TITLE ITEM1 ITEM2...). 855It is a list of the form (DIALOG ITEM1 ITEM2...).
844Each ITEM is a cons cell (STRING . VALUE). 856Each ITEM is a cons cell (STRING . VALUE).
845The return value is VALUE from the chosen item. 857The return value is VALUE from the chosen item.
846 858
@@ -850,8 +862,12 @@ on the left of the dialog box and all following items on the right.
850\(By default, approximately half appear on each side.) 862\(By default, approximately half appear on each side.)
851 863
852If HEADER is non-nil, the frame title for the box is "Information", 864If HEADER is non-nil, the frame title for the box is "Information",
853otherwise it is "Question". */) 865otherwise it is "Question".
854 (position, contents, header) 866
867If the user gets rid of the dialog box without making a valid choice,
868for instance using the window manager, then this produces a quit and
869`x-popup-dialog' does not return. */)
870 (position, contents, header)
855 Lisp_Object position, contents, header; 871 Lisp_Object position, contents, header;
856{ 872{
857 FRAME_PTR f = NULL; 873 FRAME_PTR f = NULL;
diff --git a/src/macros.c b/src/macros.c
index 6f854018d6a..8167e274dab 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -1,5 +1,6 @@
1/* Keyboard macros. 1/* Keyboard macros.
2 Copyright (C) 1985, 1986, 1993, 2000, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1993, 2000, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/macros.h b/src/macros.h
index d9b99b9984e..7acd46dc2ed 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -1,5 +1,5 @@
1/* Definitions for keyboard macro interpretation in GNU Emacs. 1/* Definitions for keyboard macro interpretation in GNU Emacs.
2 Copyright (C) 1985 Free Software Foundation, Inc. 2 Copyright (C) 1985, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/macselect.c b/src/macselect.c
index b519950eb75..63221ba3a90 100644
--- a/src/macselect.c
+++ b/src/macselect.c
@@ -371,7 +371,7 @@ get_scrap_target_type_list (scrap)
371 err = GetScrapFlavorCount (scrap, &count); 371 err = GetScrapFlavorCount (scrap, &count);
372 if (err == noErr) 372 if (err == noErr)
373 flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count); 373 flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count);
374 if (err == noErr && flavor_info) 374 if (flavor_info)
375 { 375 {
376 err = GetScrapFlavorInfoList (scrap, &count, flavor_info); 376 err = GetScrapFlavorInfoList (scrap, &count, flavor_info);
377 if (err != noErr) 377 if (err != noErr)
@@ -380,6 +380,8 @@ get_scrap_target_type_list (scrap)
380 flavor_info = NULL; 380 flavor_info = NULL;
381 } 381 }
382 } 382 }
383 if (flavor_info == NULL)
384 count = 0;
383#endif 385#endif
384 for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest)) 386 for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest))
385 { 387 {
@@ -710,7 +712,7 @@ anything that the functions on `selection-converter-alist' know about. */)
710{ 712{
711 check_mac (); 713 check_mac ();
712 CHECK_SYMBOL (selection_name); 714 CHECK_SYMBOL (selection_name);
713 if (NILP (selection_value)) error ("selection-value may not be nil"); 715 if (NILP (selection_value)) error ("SELECTION-VALUE may not be nil");
714 x_own_selection (selection_name, selection_value); 716 x_own_selection (selection_name, selection_value);
715 return selection_value; 717 return selection_value;
716} 718}
@@ -722,11 +724,11 @@ anything that the functions on `selection-converter-alist' know about. */)
722 724
723DEFUN ("x-get-selection-internal", Fx_get_selection_internal, 725DEFUN ("x-get-selection-internal", Fx_get_selection_internal,
724 Sx_get_selection_internal, 2, 3, 0, 726 Sx_get_selection_internal, 2, 3, 0,
725 doc: /* Return text selected from some Mac window. 727 doc: /* Return text selected from some Mac application.
726SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. 728SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
727TYPE is the type of data desired, typically `STRING'. 729TYPE is the type of data desired, typically `STRING'.
728TIME_STAMP is ignored on Mac. */) 730TIME_STAMP is ignored on Mac. */)
729 (selection_symbol, target_type, time_stamp) 731 (selection_symbol, target_type, time_stamp)
730 Lisp_Object selection_symbol, target_type, time_stamp; 732 Lisp_Object selection_symbol, target_type, time_stamp;
731{ 733{
732 Lisp_Object val = Qnil; 734 Lisp_Object val = Qnil;
@@ -819,7 +821,7 @@ Disowning it means there is no such selection. */)
819 821
820DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p, 822DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p,
821 0, 1, 0, 823 0, 1, 0,
822 doc: /* Whether the current Emacs process owns the given Selection. 824 doc: /* Whether the current Emacs process owns the given SELECTION.
823The arg should be the name of the selection in question, typically one of 825The arg should be the name of the selection in question, typically one of
824the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. 826the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
825For convenience, the symbol nil is the same as `PRIMARY', 827For convenience, the symbol nil is the same as `PRIMARY',
@@ -864,7 +866,7 @@ and t is the same as `SECONDARY'. */)
864 866
865DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p, 867DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p,
866 0, 1, 0, 868 0, 1, 0,
867 doc: /* Whether there is an owner for the given Selection. 869 doc: /* Whether there is an owner for the given SELECTION.
868The arg should be the name of the selection in question, typically one of 870The arg should be the name of the selection in question, typically one of
869the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. 871the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
870For convenience, the symbol nil is the same as `PRIMARY', 872For convenience, the symbol nil is the same as `PRIMARY',
@@ -1075,7 +1077,7 @@ a desired type to which the selection should be converted;
1075and the local selection value (whatever was given to `x-own-selection'). 1077and the local selection value (whatever was given to `x-own-selection').
1076 1078
1077The function should return the value to send to the Scrap Manager 1079The function should return the value to send to the Scrap Manager
1078\(a string). A return value of nil 1080\(must be a string). A return value of nil
1079means that the conversion could not be done. 1081means that the conversion could not be done.
1080A return value which is the symbol `NULL' 1082A return value which is the symbol `NULL'
1081means that a side-effect was executed, 1083means that a side-effect was executed,
diff --git a/src/macterm.c b/src/macterm.c
index 303557daca1..d6dbecfe800 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -1,5 +1,6 @@
1/* Implementation of GUI terminal on the Mac OS. 1/* Implementation of GUI terminal on the Mac OS.
2 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 2 Copyright (C) 2000, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -22,10 +23,10 @@ Boston, MA 02110-1301, USA. */
22 23
23#include <config.h> 24#include <config.h>
24#include <signal.h> 25#include <signal.h>
26
25#include <stdio.h> 27#include <stdio.h>
26#include <stdlib.h> 28
27#include "lisp.h" 29#include "lisp.h"
28#include "charset.h"
29#include "blockinput.h" 30#include "blockinput.h"
30 31
31#include "macterm.h" 32#include "macterm.h"
@@ -62,8 +63,6 @@ Boston, MA 02110-1301, USA. */
62 63
63#include "systty.h" 64#include "systty.h"
64#include "systime.h" 65#include "systime.h"
65#include "atimer.h"
66#include "keymap.h"
67 66
68#include <ctype.h> 67#include <ctype.h>
69#include <errno.h> 68#include <errno.h>
@@ -71,7 +70,8 @@ Boston, MA 02110-1301, USA. */
71#include <sys/stat.h> 70#include <sys/stat.h>
72#include <sys/param.h> 71#include <sys/param.h>
73 72
74#include "keyboard.h" 73#include "charset.h"
74#include "coding.h"
75#include "frame.h" 75#include "frame.h"
76#include "dispextern.h" 76#include "dispextern.h"
77#include "fontset.h" 77#include "fontset.h"
@@ -82,9 +82,10 @@ Boston, MA 02110-1301, USA. */
82#include "disptab.h" 82#include "disptab.h"
83#include "buffer.h" 83#include "buffer.h"
84#include "window.h" 84#include "window.h"
85#include "keyboard.h"
85#include "intervals.h" 86#include "intervals.h"
86#include "composite.h" 87#include "atimer.h"
87#include "coding.h" 88#include "keymap.h"
88 89
89/* Set of macros that handle mapping of Mac modifier keys to emacs. */ 90/* Set of macros that handle mapping of Mac modifier keys to emacs. */
90#define macCtrlKey (NILP (Vmac_reverse_ctrl_meta) ? controlKey : \ 91#define macCtrlKey (NILP (Vmac_reverse_ctrl_meta) ? controlKey : \
@@ -94,8 +95,6 @@ Boston, MA 02110-1301, USA. */
94 (NILP (Vmac_command_key_is_meta) ? optionKey : cmdKey) \ 95 (NILP (Vmac_command_key_is_meta) ? optionKey : cmdKey) \
95 : controlKey) 96 : controlKey)
96#define macAltKey (NILP (Vmac_command_key_is_meta) ? cmdKey : optionKey) 97#define macAltKey (NILP (Vmac_command_key_is_meta) ? cmdKey : optionKey)
97
98#define mac_window_to_frame(wp) (((mac_output *) GetWRefCon (wp))->mFP)
99 98
100 99
101/* Non-nil means Emacs uses toolkit scroll bars. */ 100/* Non-nil means Emacs uses toolkit scroll bars. */
@@ -114,15 +113,6 @@ static int any_help_event_p;
114/* Last window where we saw the mouse. Used by mouse-autoselect-window. */ 113/* Last window where we saw the mouse. Used by mouse-autoselect-window. */
115static Lisp_Object last_window; 114static Lisp_Object last_window;
116 115
117/* Non-zero means make use of UNDERLINE_POSITION font properties. */
118
119int x_use_underline_position_properties;
120
121/* Non-zero means draw block and hollow cursor as wide as the glyph
122 under it. For example, if a block cursor is over a tab, it will be
123 drawn as wide as that tab on the display. */
124
125
126/* This is a chain of structures for all the X displays currently in 116/* This is a chain of structures for all the X displays currently in
127 use. */ 117 use. */
128 118
@@ -148,8 +138,6 @@ struct mac_display_info one_mac_display_info;
148 138
149extern struct frame *updating_frame; 139extern struct frame *updating_frame;
150 140
151extern int waiting_for_input;
152
153/* This is a frame waiting to be auto-raised, within XTread_socket. */ 141/* This is a frame waiting to be auto-raised, within XTread_socket. */
154 142
155struct frame *pending_autoraise_frame; 143struct frame *pending_autoraise_frame;
@@ -177,7 +165,6 @@ struct frame *pending_autoraise_frame;
177/* Where the mouse was last time we reported a mouse event. */ 165/* Where the mouse was last time we reported a mouse event. */
178 166
179static Rect last_mouse_glyph; 167static Rect last_mouse_glyph;
180static Lisp_Object last_mouse_press_frame;
181 168
182/* The scroll bar in which the last X motion event occurred. 169/* The scroll bar in which the last X motion event occurred.
183 170
@@ -211,45 +198,24 @@ static int volatile input_signal_count;
211static int input_signal_count; 198static int input_signal_count;
212#endif 199#endif
213 200
214/* Used locally within XTread_socket. */ 201extern Lisp_Object Vsystem_name;
215
216static int x_noop_count;
217
218/* Initial values of argv and argc. */
219
220extern char **initial_argv;
221extern int initial_argc;
222
223extern Lisp_Object Vcommand_line_args, Vsystem_name;
224
225/* Tells if a window manager is present or not. */
226
227extern Lisp_Object Vx_no_window_manager;
228
229extern int errno;
230 202
231/* A mask of extra modifier bits to put into every keyboard char. */ 203/* A mask of extra modifier bits to put into every keyboard char. */
232 204
233extern int extra_keyboard_modifiers; 205extern EMACS_INT extra_keyboard_modifiers;
234 206
235/* The keysyms to use for the various modifiers. */ 207/* The keysyms to use for the various modifiers. */
236 208
237static Lisp_Object Qalt, Qhyper, Qsuper, Qmodifier_value; 209static Lisp_Object Qalt, Qhyper, Qsuper, Qmodifier_value;
238 210
239static Lisp_Object Qvendor_specific_keysyms;
240
241#if 0
242extern XrmDatabase x_load_resources P_ ((Display *, char *, char *, char *));
243#endif
244
245extern int inhibit_window_system; 211extern int inhibit_window_system;
246 212
247#if __MRC__ && !TARGET_API_MAC_CARBON 213#if __MRC__ && !TARGET_API_MAC_CARBON
248QDGlobals qd; /* QuickDraw global information structure. */ 214QDGlobals qd; /* QuickDraw global information structure. */
249#endif 215#endif
250 216
217#define mac_window_to_frame(wp) (((mac_output *) GetWRefCon (wp))->mFP)
251 218
252struct frame * x_window_to_frame (struct mac_display_info *, WindowPtr);
253struct mac_display_info *mac_display_info_for_display (Display *); 219struct mac_display_info *mac_display_info_for_display (Display *);
254static void x_update_window_end P_ ((struct window *, int, int)); 220static void x_update_window_end P_ ((struct window *, int, int));
255static int x_io_error_quitter P_ ((Display *)); 221static int x_io_error_quitter P_ ((Display *));
@@ -289,17 +255,23 @@ static void x_flush P_ ((struct frame *f));
289static void x_update_begin P_ ((struct frame *)); 255static void x_update_begin P_ ((struct frame *));
290static void x_update_window_begin P_ ((struct window *)); 256static void x_update_window_begin P_ ((struct window *));
291static void x_after_update_window_line P_ ((struct glyph_row *)); 257static void x_after_update_window_line P_ ((struct glyph_row *));
258static void x_scroll_bar_report_motion P_ ((struct frame **, Lisp_Object *,
259 enum scroll_bar_part *,
260 Lisp_Object *, Lisp_Object *,
261 unsigned long *));
292 262
293static int is_emacs_window (WindowPtr); 263static int is_emacs_window P_ ((WindowPtr));
294 264
295int x_bitmap_icon (struct frame *, Lisp_Object); 265static void XSetFont P_ ((Display *, GC, XFontStruct *));
296void x_make_frame_visible (struct frame *);
297
298extern void window_scroll (Lisp_Object, int, int, int);
299 266
300/* Defined in macmenu.h. */ 267/* Defined in macmenu.h. */
301extern void menubar_selection_callback (FRAME_PTR, int); 268extern void menubar_selection_callback (FRAME_PTR, int);
302extern void set_frame_menubar (FRAME_PTR, int, int); 269
270#define GC_FORE_COLOR(gc) (&(gc)->fore_color)
271#define GC_BACK_COLOR(gc) (&(gc)->back_color)
272#define GC_FONT(gc) ((gc)->xgcv.font)
273#define MAC_WINDOW_NORMAL_GC(w) (((mac_output *) GetWRefCon (w))->normal_gc)
274
303 275
304/* X display function emulation */ 276/* X display function emulation */
305 277
@@ -312,51 +284,6 @@ XFreePixmap (display, pixmap)
312} 284}
313 285
314 286
315/* Set foreground color for subsequent QuickDraw commands. Assume
316 graphic port has already been set. */
317
318static void
319mac_set_forecolor (unsigned long color)
320{
321 RGBColor fg_color;
322
323 fg_color.red = RED16_FROM_ULONG (color);
324 fg_color.green = GREEN16_FROM_ULONG (color);
325 fg_color.blue = BLUE16_FROM_ULONG (color);
326
327 RGBForeColor (&fg_color);
328}
329
330
331/* Set background color for subsequent QuickDraw commands. Assume
332 graphic port has already been set. */
333
334static void
335mac_set_backcolor (unsigned long color)
336{
337 RGBColor bg_color;
338
339 bg_color.red = RED16_FROM_ULONG (color);
340 bg_color.green = GREEN16_FROM_ULONG (color);
341 bg_color.blue = BLUE16_FROM_ULONG (color);
342
343 RGBBackColor (&bg_color);
344}
345
346/* Set foreground and background color for subsequent QuickDraw
347 commands. Assume that the graphic port has already been set. */
348
349static void
350mac_set_colors (gc, bg_save)
351 GC gc;
352 RGBColor *bg_save;
353{
354 if (bg_save)
355 GetBackColor (bg_save);
356 mac_set_forecolor (gc->foreground);
357 mac_set_backcolor (gc->background);
358}
359
360/* Mac version of XDrawLine. */ 287/* Mac version of XDrawLine. */
361 288
362static void 289static void
@@ -366,16 +293,12 @@ XDrawLine (display, w, gc, x1, y1, x2, y2)
366 GC gc; 293 GC gc;
367 int x1, y1, x2, y2; 294 int x1, y1, x2, y2;
368{ 295{
369 RGBColor old_bg;
370
371 SetPortWindowPort (w); 296 SetPortWindowPort (w);
372 297
373 mac_set_colors (gc, &old_bg); 298 RGBForeColor (GC_FORE_COLOR (gc));
374 299
375 MoveTo (x1, y1); 300 MoveTo (x1, y1);
376 LineTo (x2, y2); 301 LineTo (x2, y2);
377
378 RGBBackColor (&old_bg);
379} 302}
380 303
381void 304void
@@ -391,7 +314,7 @@ mac_draw_line_to_pixmap (display, p, gc, x1, y1, x2, y2)
391 GetGWorld (&old_port, &old_gdh); 314 GetGWorld (&old_port, &old_gdh);
392 SetGWorld (p, NULL); 315 SetGWorld (p, NULL);
393 316
394 mac_set_colors (gc, NULL); 317 RGBForeColor (GC_FORE_COLOR (gc));
395 318
396 LockPixels (GetGWorldPixMap (p)); 319 LockPixels (GetGWorldPixMap (p));
397 MoveTo (x1, y1); 320 MoveTo (x1, y1);
@@ -401,32 +324,38 @@ mac_draw_line_to_pixmap (display, p, gc, x1, y1, x2, y2)
401 SetGWorld (old_port, old_gdh); 324 SetGWorld (old_port, old_gdh);
402} 325}
403 326
404/* Mac version of XClearArea. */
405 327
406void 328static void
407XClearArea (display, w, x, y, width, height, exposures) 329mac_erase_rectangle (w, gc, x, y, width, height)
408 Display *display;
409 WindowPtr w; 330 WindowPtr w;
331 GC gc;
410 int x, y; 332 int x, y;
411 unsigned int width, height; 333 unsigned int width, height;
412 int exposures;
413{ 334{
414 struct mac_output *mwp = (mac_output *) GetWRefCon (w);
415 Rect r; 335 Rect r;
416 XGCValues xgc;
417 RGBColor old_bg;
418
419 xgc.foreground = mwp->x_compatible.foreground_pixel;
420 xgc.background = mwp->x_compatible.background_pixel;
421 336
422 SetPortWindowPort (w); 337 SetPortWindowPort (w);
423 338
424 mac_set_colors (&xgc, &old_bg); 339 RGBBackColor (GC_BACK_COLOR (gc));
425 SetRect (&r, x, y, x + width, y + height); 340 SetRect (&r, x, y, x + width, y + height);
426 341
427 EraseRect (&r); 342 EraseRect (&r);
428 343
429 RGBBackColor (&old_bg); 344 RGBBackColor (GC_BACK_COLOR (MAC_WINDOW_NORMAL_GC (w)));
345}
346
347
348/* Mac version of XClearArea. */
349
350void
351XClearArea (display, w, x, y, width, height, exposures)
352 Display *display;
353 WindowPtr w;
354 int x, y;
355 unsigned int width, height;
356 int exposures;
357{
358 mac_erase_rectangle (w, MAC_WINDOW_NORMAL_GC (w), x, y, width, height);
430} 359}
431 360
432/* Mac version of XClearWindow. */ 361/* Mac version of XClearWindow. */
@@ -436,15 +365,9 @@ XClearWindow (display, w)
436 Display *display; 365 Display *display;
437 WindowPtr w; 366 WindowPtr w;
438{ 367{
439 struct mac_output *mwp = (mac_output *) GetWRefCon (w);
440 XGCValues xgc;
441
442 xgc.foreground = mwp->x_compatible.foreground_pixel;
443 xgc.background = mwp->x_compatible.background_pixel;
444
445 SetPortWindowPort (w); 368 SetPortWindowPort (w);
446 369
447 mac_set_colors (&xgc, NULL); 370 RGBBackColor (GC_BACK_COLOR (MAC_WINDOW_NORMAL_GC (w)));
448 371
449#if TARGET_API_MAC_CARBON 372#if TARGET_API_MAC_CARBON
450 { 373 {
@@ -472,7 +395,6 @@ mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p)
472{ 395{
473 BitMap bitmap; 396 BitMap bitmap;
474 Rect r; 397 Rect r;
475 RGBColor old_bg;
476 398
477 bitmap.rowBytes = sizeof(unsigned short); 399 bitmap.rowBytes = sizeof(unsigned short);
478 bitmap.baseAddr = (char *)bits; 400 bitmap.baseAddr = (char *)bits;
@@ -480,7 +402,8 @@ mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p)
480 402
481 SetPortWindowPort (w); 403 SetPortWindowPort (w);
482 404
483 mac_set_colors (gc, &old_bg); 405 RGBForeColor (GC_FORE_COLOR (gc));
406 RGBBackColor (GC_BACK_COLOR (gc));
484 SetRect (&r, x, y, x + width, y + height); 407 SetRect (&r, x, y, x + width, y + height);
485 408
486#if TARGET_API_MAC_CARBON 409#if TARGET_API_MAC_CARBON
@@ -493,7 +416,7 @@ mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p)
493 overlay_p ? srcOr : srcCopy, 0); 416 overlay_p ? srcOr : srcCopy, 0);
494#endif /* not TARGET_API_MAC_CARBON */ 417#endif /* not TARGET_API_MAC_CARBON */
495 418
496 RGBBackColor (&old_bg); 419 RGBBackColor (GC_BACK_COLOR (MAC_WINDOW_NORMAL_GC (w)));
497} 420}
498 421
499 422
@@ -599,12 +522,16 @@ XCreatePixmapFromBitmapData (display, w, data, width, height, fg, bg, depth)
599 char *data; 522 char *data;
600 unsigned int width, height; 523 unsigned int width, height;
601 unsigned long fg, bg; 524 unsigned long fg, bg;
602 unsigned int depth; /* not used */ 525 unsigned int depth;
603{ 526{
604 Pixmap pixmap; 527 Pixmap pixmap;
605 BitMap bitmap; 528 BitMap bitmap;
606 CGrafPtr old_port; 529 CGrafPtr old_port;
607 GDHandle old_gdh; 530 GDHandle old_gdh;
531 static GC gc = NULL; /* not reentrant */
532
533 if (gc == NULL)
534 gc = XCreateGC (display, w, 0, NULL);
608 535
609 pixmap = XCreatePixmap (display, w, width, height, depth); 536 pixmap = XCreatePixmap (display, w, width, height, depth);
610 if (pixmap == NULL) 537 if (pixmap == NULL)
@@ -613,8 +540,10 @@ XCreatePixmapFromBitmapData (display, w, data, width, height, fg, bg, depth)
613 GetGWorld (&old_port, &old_gdh); 540 GetGWorld (&old_port, &old_gdh);
614 SetGWorld (pixmap, NULL); 541 SetGWorld (pixmap, NULL);
615 mac_create_bitmap_from_bitmap_data (&bitmap, data, width, height); 542 mac_create_bitmap_from_bitmap_data (&bitmap, data, width, height);
616 mac_set_forecolor (fg); 543 XSetForeground (display, gc, fg);
617 mac_set_backcolor (bg); 544 XSetBackground (display, gc, bg);
545 RGBForeColor (GC_FORE_COLOR (gc));
546 RGBBackColor (GC_BACK_COLOR (gc));
618 LockPixels (GetGWorldPixMap (pixmap)); 547 LockPixels (GetGWorldPixMap (pixmap));
619#if TARGET_API_MAC_CARBON 548#if TARGET_API_MAC_CARBON
620 CopyBits (&bitmap, GetPortBitMapForCopyBits (pixmap), 549 CopyBits (&bitmap, GetPortBitMapForCopyBits (pixmap),
@@ -642,16 +571,13 @@ XFillRectangle (display, w, gc, x, y, width, height)
642 unsigned int width, height; 571 unsigned int width, height;
643{ 572{
644 Rect r; 573 Rect r;
645 RGBColor old_bg;
646 574
647 SetPortWindowPort (w); 575 SetPortWindowPort (w);
648 576
649 mac_set_colors (gc, &old_bg); 577 RGBForeColor (GC_FORE_COLOR (gc));
650 SetRect (&r, x, y, x + width, y + height); 578 SetRect (&r, x, y, x + width, y + height);
651 579
652 PaintRect (&r); /* using foreground color of gc */ 580 PaintRect (&r); /* using foreground color of gc */
653
654 RGBBackColor (&old_bg);
655} 581}
656 582
657 583
@@ -670,7 +596,7 @@ mac_fill_rectangle_to_pixmap (display, p, gc, x, y, width, height)
670 596
671 GetGWorld (&old_port, &old_gdh); 597 GetGWorld (&old_port, &old_gdh);
672 SetGWorld (p, NULL); 598 SetGWorld (p, NULL);
673 mac_set_colors (gc, NULL); 599 RGBForeColor (GC_FORE_COLOR (gc));
674 SetRect (&r, x, y, x + width, y + height); 600 SetRect (&r, x, y, x + width, y + height);
675 601
676 LockPixels (GetGWorldPixMap (p)); 602 LockPixels (GetGWorldPixMap (p));
@@ -693,16 +619,13 @@ mac_draw_rectangle (display, w, gc, x, y, width, height)
693 unsigned int width, height; 619 unsigned int width, height;
694{ 620{
695 Rect r; 621 Rect r;
696 RGBColor old_bg;
697 622
698 SetPortWindowPort (w); 623 SetPortWindowPort (w);
699 624
700 mac_set_colors (gc, &old_bg); 625 RGBForeColor (GC_FORE_COLOR (gc));
701 SetRect (&r, x, y, x + width + 1, y + height + 1); 626 SetRect (&r, x, y, x + width + 1, y + height + 1);
702 627
703 FrameRect (&r); /* using foreground color of gc */ 628 FrameRect (&r); /* using foreground color of gc */
704
705 RGBBackColor (&old_bg);
706} 629}
707 630
708 631
@@ -723,7 +646,7 @@ mac_draw_rectangle_to_pixmap (display, p, gc, x, y, width, height)
723 646
724 GetGWorld (&old_port, &old_gdh); 647 GetGWorld (&old_port, &old_gdh);
725 SetGWorld (p, NULL); 648 SetGWorld (p, NULL);
726 mac_set_colors (gc, NULL); 649 RGBForeColor (GC_FORE_COLOR (gc));
727 SetRect (&r, x, y, x + width + 1, y + height + 1); 650 SetRect (&r, x, y, x + width + 1, y + height + 1);
728 651
729 LockPixels (GetGWorldPixMap (p)); 652 LockPixels (GetGWorldPixMap (p));
@@ -745,9 +668,6 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode,
745 char *buf; 668 char *buf;
746 int nchars, mode, bytes_per_char; 669 int nchars, mode, bytes_per_char;
747{ 670{
748 RGBColor old_bg;
749
750 SetPortWindowPort (w);
751#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 671#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
752 UInt32 textFlags, savedFlags; 672 UInt32 textFlags, savedFlags;
753 if (!NILP(Vmac_use_core_graphics)) { 673 if (!NILP(Vmac_use_core_graphics)) {
@@ -756,17 +676,22 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode,
756 } 676 }
757#endif 677#endif
758 678
759 mac_set_colors (gc, &old_bg); 679 SetPortWindowPort (w);
680
681 RGBForeColor (GC_FORE_COLOR (gc));
682 if (mode != srcOr)
683 RGBBackColor (GC_BACK_COLOR (gc));
760 684
761 TextFont (gc->font->mac_fontnum); 685 TextFont (GC_FONT (gc)->mac_fontnum);
762 TextSize (gc->font->mac_fontsize); 686 TextSize (GC_FONT (gc)->mac_fontsize);
763 TextFace (gc->font->mac_fontface); 687 TextFace (GC_FONT (gc)->mac_fontface);
764 TextMode (mode); 688 TextMode (mode);
765 689
766 MoveTo (x, y); 690 MoveTo (x, y);
767 DrawText (buf, 0, nchars * bytes_per_char); 691 DrawText (buf, 0, nchars * bytes_per_char);
768 692
769 RGBBackColor (&old_bg); 693 if (mode != srcOr)
694 RGBBackColor (GC_BACK_COLOR (MAC_WINDOW_NORMAL_GC (w)));
770#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 695#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
771 if (!NILP(Vmac_use_core_graphics)) 696 if (!NILP(Vmac_use_core_graphics))
772 SwapQDTextFlags(savedFlags); 697 SwapQDTextFlags(savedFlags);
@@ -871,6 +796,8 @@ mac_copy_area (display, src, dest, gc, src_x, src_y, width, height, dest_x,
871 &src_r, &dest_r, srcCopy, 0); 796 &src_r, &dest_r, srcCopy, 0);
872#endif /* not TARGET_API_MAC_CARBON */ 797#endif /* not TARGET_API_MAC_CARBON */
873 UnlockPixels (GetGWorldPixMap (src)); 798 UnlockPixels (GetGWorldPixMap (src));
799
800 RGBBackColor (GC_BACK_COLOR (MAC_WINDOW_NORMAL_GC (dest)));
874} 801}
875 802
876 803
@@ -909,26 +836,10 @@ mac_copy_area_with_mask (display, src, mask, dest, gc, src_x, src_y,
909#endif /* not TARGET_API_MAC_CARBON */ 836#endif /* not TARGET_API_MAC_CARBON */
910 UnlockPixels (GetGWorldPixMap (mask)); 837 UnlockPixels (GetGWorldPixMap (mask));
911 UnlockPixels (GetGWorldPixMap (src)); 838 UnlockPixels (GetGWorldPixMap (src));
912}
913
914
915#if 0
916/* Convert a pair of local coordinates to global (screen) coordinates.
917 Assume graphic port has been properly set. */
918static void
919local_to_global_coord (short *h, short *v)
920{
921 Point p;
922 839
923 p.h = *h; 840 RGBBackColor (GC_BACK_COLOR (MAC_WINDOW_NORMAL_GC (dest)));
924 p.v = *v;
925
926 LocalToGlobal (&p);
927
928 *h = p.h;
929 *v = p.v;
930} 841}
931#endif 842
932 843
933/* Mac replacement for XCopyArea: used only for scrolling. */ 844/* Mac replacement for XCopyArea: used only for scrolling. */
934 845
@@ -953,31 +864,17 @@ mac_scroll_area (display, w, gc, src_x, src_y, width, height, dest_x, dest_y)
953 Rect src_r, dest_r; 864 Rect src_r, dest_r;
954 865
955 SetPort (w); 866 SetPort (w);
956#if 0
957 mac_set_colors (gc, NULL);
958#endif
959 867
960 SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); 868 SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
961 SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height); 869 SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height);
962 870
963#if 0
964 /* Need to use global coordinates and screenBits since src and dest
965 areas overlap in general. */
966 local_to_global_coord (&src_r.left, &src_r.top);
967 local_to_global_coord (&src_r.right, &src_r.bottom);
968 local_to_global_coord (&dest_r.left, &dest_r.top);
969 local_to_global_coord (&dest_r.right, &dest_r.bottom);
970
971 CopyBits (&qd.screenBits, &qd.screenBits, &src_r, &dest_r, srcCopy, 0);
972#else
973 /* In Color QuickDraw, set ForeColor and BackColor as follows to avoid 871 /* In Color QuickDraw, set ForeColor and BackColor as follows to avoid
974 color mapping in CopyBits. Otherwise, it will be slow. */ 872 color mapping in CopyBits. Otherwise, it will be slow. */
975 ForeColor (blackColor); 873 ForeColor (blackColor);
976 BackColor (whiteColor); 874 BackColor (whiteColor);
977 CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0); 875 CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0);
978 876
979 mac_set_colors (gc, NULL); 877 RGBBackColor (GC_BACK_COLOR (MAC_WINDOW_NORMAL_GC (w)));
980#endif
981#endif /* not TARGET_API_MAC_CARBON */ 878#endif /* not TARGET_API_MAC_CARBON */
982} 879}
983 880
@@ -1067,28 +964,37 @@ mac_copy_area_with_mask_to_pixmap (display, src, mask, dest, gc, src_x, src_y,
1067/* Mac replacement for XChangeGC. */ 964/* Mac replacement for XChangeGC. */
1068 965
1069static void 966static void
1070XChangeGC (void * ignore, XGCValues* gc, unsigned long mask, 967XChangeGC (display, gc, mask, xgcv)
1071 XGCValues *xgcv) 968 Display *display;
969 GC gc;
970 unsigned long mask;
971 XGCValues *xgcv;
1072{ 972{
1073 if (mask & GCForeground) 973 if (mask & GCForeground)
1074 gc->foreground = xgcv->foreground; 974 XSetForeground (display, gc, xgcv->foreground);
1075 if (mask & GCBackground) 975 if (mask & GCBackground)
1076 gc->background = xgcv->background; 976 XSetBackground (display, gc, xgcv->background);
1077 if (mask & GCFont) 977 if (mask & GCFont)
1078 gc->font = xgcv->font; 978 XSetFont (display, gc, xgcv->font);
1079} 979}
1080 980
1081 981
1082/* Mac replacement for XCreateGC. */ 982/* Mac replacement for XCreateGC. */
1083 983
1084XGCValues * 984GC
1085XCreateGC (void * ignore, Window window, unsigned long mask, 985XCreateGC (display, window, mask, xgcv)
1086 XGCValues *xgcv) 986 Display *display;
987 Window window;
988 unsigned long mask;
989 XGCValues *xgcv;
1087{ 990{
1088 XGCValues *gc = (XGCValues *) xmalloc (sizeof (XGCValues)); 991 GC gc = xmalloc (sizeof (*gc));
1089 bzero (gc, sizeof (XGCValues));
1090 992
1091 XChangeGC (ignore, gc, mask, xgcv); 993 if (gc)
994 {
995 bzero (gc, sizeof (*gc));
996 XChangeGC (display, gc, mask, xgcv);
997 }
1092 998
1093 return gc; 999 return gc;
1094} 1000}
@@ -1108,10 +1014,18 @@ XFreeGC (display, gc)
1108/* Mac replacement for XGetGCValues. */ 1014/* Mac replacement for XGetGCValues. */
1109 1015
1110static void 1016static void
1111XGetGCValues (void* ignore, XGCValues *gc, 1017XGetGCValues (display, gc, mask, xgcv)
1112 unsigned long mask, XGCValues *xgcv) 1018 Display *display;
1019 GC gc;
1020 unsigned long mask;
1021 XGCValues *xgcv;
1113{ 1022{
1114 XChangeGC (ignore, xgcv, mask, gc); 1023 if (mask & GCForeground)
1024 xgcv->foreground = gc->xgcv.foreground;
1025 if (mask & GCBackground)
1026 xgcv->background = gc->xgcv.background;
1027 if (mask & GCFont)
1028 xgcv->font = gc->xgcv.font;
1115} 1029}
1116 1030
1117 1031
@@ -1123,7 +1037,13 @@ XSetForeground (display, gc, color)
1123 GC gc; 1037 GC gc;
1124 unsigned long color; 1038 unsigned long color;
1125{ 1039{
1126 gc->foreground = color; 1040 if (gc->xgcv.foreground != color)
1041 {
1042 gc->xgcv.foreground = color;
1043 gc->fore_color.red = RED16_FROM_ULONG (color);
1044 gc->fore_color.green = GREEN16_FROM_ULONG (color);
1045 gc->fore_color.blue = BLUE16_FROM_ULONG (color);
1046 }
1127} 1047}
1128 1048
1129 1049
@@ -1135,7 +1055,25 @@ XSetBackground (display, gc, color)
1135 GC gc; 1055 GC gc;
1136 unsigned long color; 1056 unsigned long color;
1137{ 1057{
1138 gc->background = color; 1058 if (gc->xgcv.background != color)
1059 {
1060 gc->xgcv.background = color;
1061 gc->back_color.red = RED16_FROM_ULONG (color);
1062 gc->back_color.green = GREEN16_FROM_ULONG (color);
1063 gc->back_color.blue = BLUE16_FROM_ULONG (color);
1064 }
1065}
1066
1067
1068/* Mac replacement for XSetFont. */
1069
1070static void
1071XSetFont (display, gc, font)
1072 Display *display;
1073 GC gc;
1074 XFontStruct *font;
1075{
1076 gc->xgcv.font = font;
1139} 1077}
1140 1078
1141 1079
@@ -1182,19 +1120,6 @@ XSetWindowBackground (display, w, color)
1182#endif 1120#endif
1183} 1121}
1184 1122
1185
1186/* Mac replacement for XSetFont. */
1187
1188static void
1189XSetFont (display, gc, font)
1190 Display *display;
1191 GC gc;
1192 XFontStruct *font;
1193{
1194 gc->font = font;
1195}
1196
1197
1198/* x_sync is a no-op on Mac. */ 1123/* x_sync is a no-op on Mac. */
1199void 1124void
1200x_sync (f) 1125x_sync (f)
@@ -1345,7 +1270,6 @@ mac_draw_vertical_window_border (w, x, y0, y1)
1345 f->output_data.mac->normal_gc, x, y0, x, y1); 1270 f->output_data.mac->normal_gc, x, y0, x, y1);
1346} 1271}
1347 1272
1348
1349/* End update of window W (which is equal to updated_window). 1273/* End update of window W (which is equal to updated_window).
1350 1274
1351 Draw vertical borders between horizontally adjacent windows, and 1275 Draw vertical borders between horizontally adjacent windows, and
@@ -1357,7 +1281,7 @@ mac_draw_vertical_window_border (w, x, y0, y1)
1357 1281
1358 W may be a menu bar pseudo-window in case we don't have X toolkit 1282 W may be a menu bar pseudo-window in case we don't have X toolkit
1359 support. Such windows don't have a cursor, so don't display it 1283 support. Such windows don't have a cursor, so don't display it
1360 here. */ 1284 here. */
1361 1285
1362static void 1286static void
1363x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p) 1287x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
@@ -1390,14 +1314,6 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
1390 dpyinfo->mouse_face_window = Qnil; 1314 dpyinfo->mouse_face_window = Qnil;
1391 } 1315 }
1392 1316
1393#if 0
1394 /* Unhide the caret. This won't actually show the cursor, unless it
1395 was visible before the corresponding call to HideCaret in
1396 x_update_window_begin. */
1397 if (w32_use_visible_system_caret)
1398 SendMessage (w32_system_caret_hwnd, WM_EMACS_SHOW_CARET, 0, 0);
1399#endif
1400
1401 updated_window = NULL; 1317 updated_window = NULL;
1402} 1318}
1403 1319
@@ -1483,19 +1399,18 @@ x_after_update_window_line (desired_row)
1483 height > 0)) 1399 height > 0))
1484 { 1400 {
1485 int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); 1401 int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y));
1402
1486 /* Internal border is drawn below the tool bar. */ 1403 /* Internal border is drawn below the tool bar. */
1487 if (WINDOWP (f->tool_bar_window) 1404 if (WINDOWP (f->tool_bar_window)
1488 && w == XWINDOW (f->tool_bar_window)) 1405 && w == XWINDOW (f->tool_bar_window))
1489 y -= width; 1406 y -= width;
1490 1407
1491 BLOCK_INPUT; 1408 BLOCK_INPUT;
1492
1493 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), 1409 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
1494 0, y, width, height, 0); 1410 0, y, width, height, 0);
1495 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), 1411 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
1496 FRAME_PIXEL_WIDTH (f) - width, y, 1412 FRAME_PIXEL_WIDTH (f) - width, y,
1497 width, height, 0); 1413 width, height, 0);
1498
1499 UNBLOCK_INPUT; 1414 UNBLOCK_INPUT;
1500 } 1415 }
1501} 1416}
@@ -1515,7 +1430,6 @@ x_draw_fringe_bitmap (w, row, p)
1515 struct frame *f = XFRAME (WINDOW_FRAME (w)); 1430 struct frame *f = XFRAME (WINDOW_FRAME (w));
1516 Display *display = FRAME_MAC_DISPLAY (f); 1431 Display *display = FRAME_MAC_DISPLAY (f);
1517 WindowPtr window = FRAME_MAC_WINDOW (f); 1432 WindowPtr window = FRAME_MAC_WINDOW (f);
1518 XGCValues gcv;
1519 GC gc = f->output_data.mac->normal_gc; 1433 GC gc = f->output_data.mac->normal_gc;
1520 struct face *face = p->face; 1434 struct face *face = p->face;
1521 int rowY; 1435 int rowY;
@@ -1539,9 +1453,6 @@ x_draw_fringe_bitmap (w, row, p)
1539 1453
1540 if (p->bx >= 0 && !p->overlay_p) 1454 if (p->bx >= 0 && !p->overlay_p)
1541 { 1455 {
1542 XGCValues gcv;
1543 gcv.foreground = face->background;
1544
1545#if 0 /* MAC_TODO: stipple */ 1456#if 0 /* MAC_TODO: stipple */
1546 /* In case the same realized face is used for fringes and 1457 /* In case the same realized face is used for fringes and
1547 for something displayed in the text (e.g. face `region' on 1458 for something displayed in the text (e.g. face `region' on
@@ -1553,9 +1464,7 @@ x_draw_fringe_bitmap (w, row, p)
1553 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background); 1464 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background);
1554#endif 1465#endif
1555 1466
1556 XFillRectangle (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), 1467 mac_erase_rectangle (window, face->gc, p->bx, p->by, p->nx, p->ny);
1557 &gcv,
1558 p->bx, p->by, p->nx, p->ny);
1559 1468
1560#if 0 /* MAC_TODO: stipple */ 1469#if 0 /* MAC_TODO: stipple */
1561 if (!face->stipple) 1470 if (!face->stipple)
@@ -1566,21 +1475,24 @@ x_draw_fringe_bitmap (w, row, p)
1566 if (p->which) 1475 if (p->which)
1567 { 1476 {
1568 unsigned short *bits = p->bits + p->dh; 1477 unsigned short *bits = p->bits + p->dh;
1478 XGCValues gcv;
1569 1479
1570 gcv.foreground = (p->cursor_p 1480 XGetGCValues (display, face->gc, GCForeground, &gcv);
1571 ? (p->overlay_p ? face->background 1481 XSetForeground (display, face->gc,
1572 : f->output_data.mac->cursor_pixel) 1482 (p->cursor_p
1573 : face->foreground); 1483 ? (p->overlay_p ? face->background
1574 gcv.background = face->background; 1484 : f->output_data.mac->cursor_pixel)
1575 1485 : face->foreground));
1576 mac_draw_bitmap (display, window, &gcv, p->x, p->y, 1486 mac_draw_bitmap (display, window, face->gc, p->x, p->y,
1577 p->wd, p->h, bits, p->overlay_p); 1487 p->wd, p->h, bits, p->overlay_p);
1488 XSetForeground (display, face->gc, gcv.foreground);
1578 } 1489 }
1579 1490
1580 mac_reset_clipping (display, window); 1491 mac_reset_clipping (display, window);
1581} 1492}
1582 1493
1583 1494
1495
1584/* This is called when starting Emacs and when restarting after 1496/* This is called when starting Emacs and when restarting after
1585 suspend. When starting Emacs, no window is mapped. And nothing 1497 suspend. When starting Emacs, no window is mapped. And nothing
1586 must be done to Emacs's own window if it is suspended (though that 1498 must be done to Emacs's own window if it is suspended (though that
@@ -1599,6 +1511,7 @@ XTreset_terminal_modes ()
1599{ 1511{
1600} 1512}
1601 1513
1514
1602 1515
1603/*********************************************************************** 1516/***********************************************************************
1604 Display Iterator 1517 Display Iterator
@@ -1786,6 +1699,7 @@ mac_encode_char (c, char2b, font_info, two_byte_p)
1786 ***********************************************************************/ 1699 ***********************************************************************/
1787 1700
1788 1701
1702
1789static void x_set_glyph_string_clipping P_ ((struct glyph_string *)); 1703static void x_set_glyph_string_clipping P_ ((struct glyph_string *));
1790static void x_set_glyph_string_gc P_ ((struct glyph_string *)); 1704static void x_set_glyph_string_gc P_ ((struct glyph_string *));
1791static void x_draw_glyph_string_background P_ ((struct glyph_string *, 1705static void x_draw_glyph_string_background P_ ((struct glyph_string *,
@@ -1794,6 +1708,7 @@ static void x_draw_glyph_string_foreground P_ ((struct glyph_string *));
1794static void x_draw_composite_glyph_string_foreground P_ ((struct glyph_string *)); 1708static void x_draw_composite_glyph_string_foreground P_ ((struct glyph_string *));
1795static void x_draw_glyph_string_box P_ ((struct glyph_string *)); 1709static void x_draw_glyph_string_box P_ ((struct glyph_string *));
1796static void x_draw_glyph_string P_ ((struct glyph_string *)); 1710static void x_draw_glyph_string P_ ((struct glyph_string *));
1711static void mac_compute_glyph_string_overhangs P_ ((struct glyph_string *));
1797static void x_set_cursor_gc P_ ((struct glyph_string *)); 1712static void x_set_cursor_gc P_ ((struct glyph_string *));
1798static void x_set_mode_line_face_gc P_ ((struct glyph_string *)); 1713static void x_set_mode_line_face_gc P_ ((struct glyph_string *));
1799static void x_set_mouse_face_gc P_ ((struct glyph_string *)); 1714static void x_set_mouse_face_gc P_ ((struct glyph_string *));
@@ -2045,10 +1960,7 @@ x_clear_glyph_string_rect (s, x, y, w, h)
2045 struct glyph_string *s; 1960 struct glyph_string *s;
2046 int x, y, w, h; 1961 int x, y, w, h;
2047{ 1962{
2048 XGCValues xgcv; 1963 mac_erase_rectangle (s->window, s->gc, x, y, w, h);
2049
2050 xgcv.foreground = s->gc->background;
2051 XFillRectangle (s->display, s->window, &xgcv, x, y, w, h);
2052} 1964}
2053 1965
2054 1966
@@ -2636,27 +2548,29 @@ x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
2636{ 2548{
2637 XGCValues xgcv; 2549 XGCValues xgcv;
2638 2550
2639 xgcv.foreground = s->face->box_color; 2551 XGetGCValues (s->display, s->gc, GCForeground, &xgcv);
2552 XSetForeground (s->display, s->gc, s->face->box_color);
2640 mac_set_clip_rectangle (s->display, s->window, clip_rect); 2553 mac_set_clip_rectangle (s->display, s->window, clip_rect);
2641 2554
2642 /* Top. */ 2555 /* Top. */
2643 XFillRectangle (s->display, s->window, &xgcv, 2556 XFillRectangle (s->display, s->window, s->gc,
2644 left_x, top_y, right_x - left_x + 1, width); 2557 left_x, top_y, right_x - left_x + 1, width);
2645 2558
2646 /* Left. */ 2559 /* Left. */
2647 if (left_p) 2560 if (left_p)
2648 XFillRectangle (s->display, s->window, &xgcv, 2561 XFillRectangle (s->display, s->window, s->gc,
2649 left_x, top_y, width, bottom_y - top_y + 1); 2562 left_x, top_y, width, bottom_y - top_y + 1);
2650 2563
2651 /* Bottom. */ 2564 /* Bottom. */
2652 XFillRectangle (s->display, s->window, &xgcv, 2565 XFillRectangle (s->display, s->window, s->gc,
2653 left_x, bottom_y - width + 1, right_x - left_x + 1, width); 2566 left_x, bottom_y - width + 1, right_x - left_x + 1, width);
2654 2567
2655 /* Right. */ 2568 /* Right. */
2656 if (right_p) 2569 if (right_p)
2657 XFillRectangle (s->display, s->window, &xgcv, 2570 XFillRectangle (s->display, s->window, s->gc,
2658 right_x - width + 1, top_y, width, bottom_y - top_y + 1); 2571 right_x - width + 1, top_y, width, bottom_y - top_y + 1);
2659 2572
2573 XSetForeground (s->display, s->gc, xgcv.foreground);
2660 mac_reset_clipping (s->display, s->window); 2574 mac_reset_clipping (s->display, s->window);
2661} 2575}
2662 2576
@@ -3075,13 +2989,7 @@ x_draw_stretch_glyph_string (s)
3075 } 2989 }
3076 else 2990 else
3077#endif /* MAC_TODO */ 2991#endif /* MAC_TODO */
3078 { 2992 mac_erase_rectangle (s->window, gc, x, y, w, h);
3079 XGCValues xgcv;
3080 XGetGCValues (s->display, gc, GCForeground | GCBackground, &xgcv);
3081 XSetForeground (s->display, gc, xgcv.background);
3082 XFillRectangle (s->display, s->window, gc, x, y, w, h);
3083 XSetForeground (s->display, gc, xgcv.foreground);
3084 }
3085 2993
3086 mac_reset_clipping (s->display, s->window); 2994 mac_reset_clipping (s->display, s->window);
3087 } 2995 }
@@ -3397,7 +3305,6 @@ XTring_bell ()
3397 } 3305 }
3398} 3306}
3399 3307
3400
3401 3308
3402/* Specify how many text lines, from the top of the window, 3309/* Specify how many text lines, from the top of the window,
3403 should be affected by insert-lines and delete-lines operations. 3310 should be affected by insert-lines and delete-lines operations.
@@ -3832,43 +3739,6 @@ x_get_keysym_name (keysym)
3832 3739
3833 3740
3834 3741
3835#if 0
3836/* Mouse clicks and mouse movement. Rah. */
3837
3838/* Prepare a mouse-event in *RESULT for placement in the input queue.
3839
3840 If the event is a button press, then note that we have grabbed
3841 the mouse. */
3842
3843static Lisp_Object
3844construct_mouse_click (result, event, f)
3845 struct input_event *result;
3846 EventRecord *event;
3847 struct frame *f;
3848{
3849 Point mouseLoc;
3850
3851 result->kind = MOUSE_CLICK_EVENT;
3852 result->code = 0; /* only one mouse button */
3853 result->timestamp = event->when;
3854 result->modifiers = event->what == mouseDown ? down_modifier : up_modifier;
3855
3856 mouseLoc = event->where;
3857
3858 SetPortWindowPort (FRAME_MAC_WINDOW (f));
3859
3860 GlobalToLocal (&mouseLoc);
3861 XSETINT (result->x, mouseLoc.h);
3862 XSETINT (result->y, mouseLoc.v);
3863
3864 XSETFRAME (result->frame_or_window, f);
3865
3866 result->arg = Qnil;
3867 return Qnil;
3868}
3869#endif
3870
3871
3872/* Function to report a mouse movement to the mainstream Emacs code. 3742/* Function to report a mouse movement to the mainstream Emacs code.
3873 The input handler calls this. 3743 The input handler calls this.
3874 3744
@@ -3924,18 +3794,11 @@ note_mouse_movement (frame, pos)
3924 } 3794 }
3925} 3795}
3926 3796
3927/* This is used for debugging, to turn off note_mouse_highlight. */
3928
3929int disable_mouse_highlight;
3930
3931
3932 3797
3933/************************************************************************ 3798/************************************************************************
3934 Mouse Face 3799 Mouse Face
3935 ************************************************************************/ 3800 ************************************************************************/
3936 3801
3937static struct scroll_bar *x_window_to_scroll_bar ();
3938static void x_scroll_bar_report_motion ();
3939static int glyph_rect P_ ((struct frame *f, int, int, Rect *)); 3802static int glyph_rect P_ ((struct frame *f, int, int, Rect *));
3940 3803
3941 3804
@@ -4147,20 +4010,16 @@ static OSStatus install_scroll_bar_timer P_ ((void));
4147static OSStatus set_scroll_bar_timer P_ ((EventTimerInterval)); 4010static OSStatus set_scroll_bar_timer P_ ((EventTimerInterval));
4148static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode)); 4011static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode));
4149static void construct_scroll_bar_click P_ ((struct scroll_bar *, int, 4012static void construct_scroll_bar_click P_ ((struct scroll_bar *, int,
4150 unsigned long,
4151 struct input_event *)); 4013 struct input_event *));
4152static OSErr get_control_part_bounds P_ ((ControlHandle, ControlPartCode, 4014static OSErr get_control_part_bounds P_ ((ControlHandle, ControlPartCode,
4153 Rect *)); 4015 Rect *));
4154static void x_scroll_bar_handle_press P_ ((struct scroll_bar *, 4016static void x_scroll_bar_handle_press P_ ((struct scroll_bar *,
4155 ControlPartCode, 4017 ControlPartCode,
4156 unsigned long,
4157 struct input_event *)); 4018 struct input_event *));
4158static void x_scroll_bar_handle_release P_ ((struct scroll_bar *, 4019static void x_scroll_bar_handle_release P_ ((struct scroll_bar *,
4159 unsigned long,
4160 struct input_event *)); 4020 struct input_event *));
4161static void x_scroll_bar_handle_drag P_ ((WindowPtr, struct scroll_bar *, 4021static void x_scroll_bar_handle_drag P_ ((WindowPtr, struct scroll_bar *,
4162 Point, unsigned long, 4022 Point, struct input_event *));
4163 struct input_event *));
4164static void x_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *, 4023static void x_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *,
4165 int, int, int)); 4024 int, int, int));
4166 4025
@@ -4259,10 +4118,9 @@ control_part_code_to_scroll_bar_part (part_code)
4259} 4118}
4260 4119
4261static void 4120static void
4262construct_scroll_bar_click (bar, part, timestamp, bufp) 4121construct_scroll_bar_click (bar, part, bufp)
4263 struct scroll_bar *bar; 4122 struct scroll_bar *bar;
4264 int part; 4123 int part;
4265 unsigned long timestamp;
4266 struct input_event *bufp; 4124 struct input_event *bufp;
4267{ 4125{
4268 bufp->kind = SCROLL_BAR_CLICK_EVENT; 4126 bufp->kind = SCROLL_BAR_CLICK_EVENT;
@@ -4270,7 +4128,6 @@ construct_scroll_bar_click (bar, part, timestamp, bufp)
4270 bufp->arg = Qnil; 4128 bufp->arg = Qnil;
4271 bufp->part = part; 4129 bufp->part = part;
4272 bufp->code = 0; 4130 bufp->code = 0;
4273 bufp->timestamp = timestamp;
4274 XSETINT (bufp->x, 0); 4131 XSETINT (bufp->x, 0);
4275 XSETINT (bufp->y, 0); 4132 XSETINT (bufp->y, 0);
4276 bufp->modifiers = 0; 4133 bufp->modifiers = 0;
@@ -4294,10 +4151,9 @@ get_control_part_bounds (ch, part_code, rect)
4294} 4151}
4295 4152
4296static void 4153static void
4297x_scroll_bar_handle_press (bar, part_code, timestamp, bufp) 4154x_scroll_bar_handle_press (bar, part_code, bufp)
4298 struct scroll_bar *bar; 4155 struct scroll_bar *bar;
4299 ControlPartCode part_code; 4156 ControlPartCode part_code;
4300 unsigned long timestamp;
4301 struct input_event *bufp; 4157 struct input_event *bufp;
4302{ 4158{
4303 int part = control_part_code_to_scroll_bar_part (part_code); 4159 int part = control_part_code_to_scroll_bar_part (part_code);
@@ -4307,7 +4163,7 @@ x_scroll_bar_handle_press (bar, part_code, timestamp, bufp)
4307 4163
4308 if (part != scroll_bar_handle) 4164 if (part != scroll_bar_handle)
4309 { 4165 {
4310 construct_scroll_bar_click (bar, part, timestamp, bufp); 4166 construct_scroll_bar_click (bar, part, bufp);
4311 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code); 4167 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code);
4312 set_scroll_bar_timer (SCROLL_BAR_FIRST_DELAY); 4168 set_scroll_bar_timer (SCROLL_BAR_FIRST_DELAY);
4313 } 4169 }
@@ -4318,14 +4174,13 @@ x_scroll_bar_handle_press (bar, part_code, timestamp, bufp)
4318} 4174}
4319 4175
4320static void 4176static void
4321x_scroll_bar_handle_release (bar, timestamp, bufp) 4177x_scroll_bar_handle_release (bar, bufp)
4322 struct scroll_bar *bar; 4178 struct scroll_bar *bar;
4323 unsigned long timestamp;
4324 struct input_event *bufp; 4179 struct input_event *bufp;
4325{ 4180{
4326 if (last_scroll_bar_part != scroll_bar_handle 4181 if (last_scroll_bar_part != scroll_bar_handle
4327 || !GC_NILP (bar->dragging)) 4182 || !GC_NILP (bar->dragging))
4328 construct_scroll_bar_click (bar, scroll_bar_end_scroll, timestamp, bufp); 4183 construct_scroll_bar_click (bar, scroll_bar_end_scroll, bufp);
4329 4184
4330 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0); 4185 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0);
4331 set_scroll_bar_timer (kEventDurationForever); 4186 set_scroll_bar_timer (kEventDurationForever);
@@ -4336,11 +4191,10 @@ x_scroll_bar_handle_release (bar, timestamp, bufp)
4336} 4191}
4337 4192
4338static void 4193static void
4339x_scroll_bar_handle_drag (win, bar, mouse_pos, timestamp, bufp) 4194x_scroll_bar_handle_drag (win, bar, mouse_pos, bufp)
4340 WindowPtr win; 4195 WindowPtr win;
4341 struct scroll_bar *bar; 4196 struct scroll_bar *bar;
4342 Point mouse_pos; 4197 Point mouse_pos;
4343 unsigned long timestamp;
4344 struct input_event *bufp; 4198 struct input_event *bufp;
4345{ 4199{
4346 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); 4200 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
@@ -4360,13 +4214,13 @@ x_scroll_bar_handle_drag (win, bar, mouse_pos, timestamp, bufp)
4360 top_range = (XINT (bar->track_height) - (r.bottom - r.top)) * 4214 top_range = (XINT (bar->track_height) - (r.bottom - r.top)) *
4361 (1.0 + (float) GetControlViewSize (ch) / GetControl32BitMaximum (ch)) 4215 (1.0 + (float) GetControlViewSize (ch) / GetControl32BitMaximum (ch))
4362 + .5; 4216 + .5;
4363 4217
4364 if (top < 0) 4218 if (top < 0)
4365 top = 0; 4219 top = 0;
4366 if (top > top_range) 4220 if (top > top_range)
4367 top = top_range; 4221 top = top_range;
4368 4222
4369 construct_scroll_bar_click (bar, scroll_bar_handle, timestamp, bufp); 4223 construct_scroll_bar_click (bar, scroll_bar_handle, bufp);
4370 XSETINT (bufp->x, top); 4224 XSETINT (bufp->x, top);
4371 XSETINT (bufp->y, top_range); 4225 XSETINT (bufp->y, top_range);
4372 } 4226 }
@@ -4404,7 +4258,7 @@ x_scroll_bar_handle_drag (win, bar, mouse_pos, timestamp, bufp)
4404 else if (part != last_scroll_bar_part 4258 else if (part != last_scroll_bar_part
4405 || scroll_bar_timer_event_posted_p) 4259 || scroll_bar_timer_event_posted_p)
4406 { 4260 {
4407 construct_scroll_bar_click (bar, part, timestamp, bufp); 4261 construct_scroll_bar_click (bar, part, bufp);
4408 last_scroll_bar_part = part; 4262 last_scroll_bar_part = part;
4409 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code); 4263 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code);
4410 set_scroll_bar_timer (SCROLL_BAR_CONTINUOUS_DELAY); 4264 set_scroll_bar_timer (SCROLL_BAR_CONTINUOUS_DELAY);
@@ -4475,11 +4329,11 @@ x_scroll_bar_create (w, top, left, width, height, disp_top, disp_height)
4475 r.bottom = disp_top + disp_height; 4329 r.bottom = disp_top + disp_height;
4476 4330
4477#if TARGET_API_MAC_CARBON 4331#if TARGET_API_MAC_CARBON
4478 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", 1, 0, 0, 0, 4332 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height,
4479 kControlScrollBarProc, (long) bar); 4333 0, 0, 0, kControlScrollBarProc, (long) bar);
4480#else 4334#else
4481 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", 1, 0, 0, 0, 4335 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height,
4482 scrollBarProc, (long) bar); 4336 0, 0, 0, scrollBarProc, (long) bar);
4483#endif 4337#endif
4484 SET_SCROLL_BAR_CONTROL_HANDLE (bar, ch); 4338 SET_SCROLL_BAR_CONTROL_HANDLE (bar, ch);
4485 4339
@@ -4604,10 +4458,12 @@ x_scroll_bar_remove (bar)
4604 UNBLOCK_INPUT; 4458 UNBLOCK_INPUT;
4605} 4459}
4606 4460
4461
4607/* Set the handle of the vertical scroll bar for WINDOW to indicate 4462/* Set the handle of the vertical scroll bar for WINDOW to indicate
4608 that we are displaying PORTION characters out of a total of WHOLE 4463 that we are displaying PORTION characters out of a total of WHOLE
4609 characters, starting at POSITION. If WINDOW has no scroll bar, 4464 characters, starting at POSITION. If WINDOW has no scroll bar,
4610 create one. */ 4465 create one. */
4466
4611static void 4467static void
4612XTset_vertical_scroll_bar (w, portion, whole, position) 4468XTset_vertical_scroll_bar (w, portion, whole, position)
4613 struct window *w; 4469 struct window *w;
@@ -4684,13 +4540,10 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
4684 && XINT (bar->width) == sb_width 4540 && XINT (bar->width) == sb_width
4685 && XINT (bar->height) == height)) 4541 && XINT (bar->height) == height))
4686 { 4542 {
4687 /* Clear areas not covered by the scroll bar because it's not as 4543 /* Since toolkit scroll bars are smaller than the space reserved
4688 wide as the area reserved for it . This makes sure a 4544 for them on the frame, we have to clear "under" them. */
4689 previous mode line display is cleared after C-x 2 C-x 1, for
4690 example. */
4691 int area_width = WINDOW_SCROLL_BAR_AREA_WIDTH (w);
4692 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), 4545 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
4693 left, top, area_width, height, 0); 4546 left, top, width, height, 0);
4694 4547
4695#if 0 4548#if 0
4696 if (sb_left + sb_width >= FRAME_PIXEL_WIDTH (f)) 4549 if (sb_left + sb_width >= FRAME_PIXEL_WIDTH (f))
@@ -4702,7 +4555,8 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
4702 MoveControl (ch, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, disp_top); 4555 MoveControl (ch, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, disp_top);
4703 SizeControl (ch, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, 4556 SizeControl (ch, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
4704 disp_height); 4557 disp_height);
4705 ShowControl (ch); 4558 if (sb_width < disp_height)
4559 ShowControl (ch);
4706 4560
4707 /* Remember new settings. */ 4561 /* Remember new settings. */
4708 XSETINT (bar->left, sb_left); 4562 XSETINT (bar->left, sb_left);
@@ -4805,6 +4659,7 @@ XTredeem_scroll_bar (window)
4805 struct window *window; 4659 struct window *window;
4806{ 4660{
4807 struct scroll_bar *bar; 4661 struct scroll_bar *bar;
4662 struct frame *f;
4808 4663
4809 /* We can't redeem this window's scroll bar if it doesn't have one. */ 4664 /* We can't redeem this window's scroll bar if it doesn't have one. */
4810 if (NILP (window->vertical_scroll_bar)) 4665 if (NILP (window->vertical_scroll_bar))
@@ -4813,36 +4668,33 @@ XTredeem_scroll_bar (window)
4813 bar = XSCROLL_BAR (window->vertical_scroll_bar); 4668 bar = XSCROLL_BAR (window->vertical_scroll_bar);
4814 4669
4815 /* Unlink it from the condemned list. */ 4670 /* Unlink it from the condemned list. */
4816 { 4671 f = XFRAME (WINDOW_FRAME (window));
4817 FRAME_PTR f = XFRAME (WINDOW_FRAME (window)); 4672 if (NILP (bar->prev))
4818 4673 {
4819 if (NILP (bar->prev)) 4674 /* If the prev pointer is nil, it must be the first in one of
4820 { 4675 the lists. */
4821 /* If the prev pointer is nil, it must be the first in one of 4676 if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar))
4822 the lists. */ 4677 /* It's not condemned. Everything's fine. */
4823 if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar)) 4678 return;
4824 /* It's not condemned. Everything's fine. */ 4679 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
4825 return; 4680 window->vertical_scroll_bar))
4826 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), 4681 FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next;
4827 window->vertical_scroll_bar)) 4682 else
4828 FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next; 4683 /* If its prev pointer is nil, it must be at the front of
4829 else 4684 one or the other! */
4830 /* If its prev pointer is nil, it must be at the front of 4685 abort ();
4831 one or the other! */ 4686 }
4832 abort (); 4687 else
4833 } 4688 XSCROLL_BAR (bar->prev)->next = bar->next;
4834 else
4835 XSCROLL_BAR (bar->prev)->next = bar->next;
4836 4689
4837 if (! NILP (bar->next)) 4690 if (! NILP (bar->next))
4838 XSCROLL_BAR (bar->next)->prev = bar->prev; 4691 XSCROLL_BAR (bar->next)->prev = bar->prev;
4839 4692
4840 bar->next = FRAME_SCROLL_BARS (f); 4693 bar->next = FRAME_SCROLL_BARS (f);
4841 bar->prev = Qnil; 4694 bar->prev = Qnil;
4842 XSETVECTOR (FRAME_SCROLL_BARS (f), bar); 4695 XSETVECTOR (FRAME_SCROLL_BARS (f), bar);
4843 if (! NILP (bar->next)) 4696 if (! NILP (bar->next))
4844 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); 4697 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
4845 }
4846} 4698}
4847 4699
4848/* Remove all scroll bars on FRAME that haven't been saved since the 4700/* Remove all scroll bars on FRAME that haven't been saved since the
@@ -4981,8 +4833,8 @@ x_scroll_bar_note_movement (bar, y_pos, t)
4981 4833
4982#endif /* !USE_TOOLKIT_SCROLL_BARS */ 4834#endif /* !USE_TOOLKIT_SCROLL_BARS */
4983 4835
4984/* Return information to the user about the current position of the 4836/* Return information to the user about the current position of the mouse
4985 mouse on the scroll bar. */ 4837 on the scroll bar. */
4986 4838
4987static void 4839static void
4988x_scroll_bar_report_motion (fp, bar_window, part, x, y, time) 4840x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
@@ -5500,6 +5352,7 @@ mac_get_window_bounds (f, inner, outer)
5500} 5352}
5501 5353
5502 5354
5355
5503/* Calculate the absolute position in frame F 5356/* Calculate the absolute position in frame F
5504 from its current recorded position values and gravity. */ 5357 from its current recorded position values and gravity. */
5505 5358
@@ -5731,7 +5584,6 @@ x_set_mouse_pixel_position (f, pix_x, pix_y)
5731 UNBLOCK_INPUT; 5584 UNBLOCK_INPUT;
5732#endif 5585#endif
5733} 5586}
5734
5735 5587
5736/* focus shifting, raising and lowering. */ 5588/* focus shifting, raising and lowering. */
5737 5589
@@ -5758,6 +5610,7 @@ x_unfocus_frame (f)
5758} 5610}
5759 5611
5760/* Raise frame F. */ 5612/* Raise frame F. */
5613
5761void 5614void
5762x_raise_frame (f) 5615x_raise_frame (f)
5763 struct frame *f; 5616 struct frame *f;
@@ -5771,6 +5624,7 @@ x_raise_frame (f)
5771} 5624}
5772 5625
5773/* Lower frame F. */ 5626/* Lower frame F. */
5627
5774void 5628void
5775x_lower_frame (f) 5629x_lower_frame (f)
5776 struct frame *f; 5630 struct frame *f;
@@ -5796,6 +5650,53 @@ XTframe_raise_lower (f, raise_flag)
5796 5650
5797/* Change of visibility. */ 5651/* Change of visibility. */
5798 5652
5653static void
5654mac_handle_visibility_change (f)
5655 struct frame *f;
5656{
5657 WindowPtr wp = FRAME_MAC_WINDOW (f);
5658 int visible = 0, iconified = 0;
5659 struct input_event buf;
5660
5661 if (IsWindowVisible (wp))
5662 if (IsWindowCollapsed (wp))
5663 iconified = 1;
5664 else
5665 visible = 1;
5666
5667 if (!f->async_visible && visible)
5668 {
5669 if (f->iconified)
5670 {
5671 /* wait_reading_process_output will notice this and update
5672 the frame's display structures. If we were made
5673 invisible, we should not set garbaged, because that stops
5674 redrawing on Update events. */
5675 SET_FRAME_GARBAGED (f);
5676
5677 EVENT_INIT (buf);
5678 buf.kind = DEICONIFY_EVENT;
5679 XSETFRAME (buf.frame_or_window, f);
5680 kbd_buffer_store_event (&buf);
5681 }
5682 else if (! NILP (Vframe_list) && ! NILP (XCDR (Vframe_list)))
5683 /* Force a redisplay sooner or later to update the
5684 frame titles in case this is the second frame. */
5685 record_asynch_buffer_change ();
5686 }
5687 else if (f->async_visible && !visible)
5688 if (iconified)
5689 {
5690 EVENT_INIT (buf);
5691 buf.kind = ICONIFY_EVENT;
5692 XSETFRAME (buf.frame_or_window, f);
5693 kbd_buffer_store_event (&buf);
5694 }
5695
5696 f->async_visible = visible;
5697 f->async_iconified = iconified;
5698}
5699
5799/* This tries to wait until the frame is really visible. 5700/* This tries to wait until the frame is really visible.
5800 However, if the window manager asks the user where to position 5701 However, if the window manager asks the user where to position
5801 the frame, this will return before the user finishes doing that. 5702 the frame, this will return before the user finishes doing that.
@@ -5820,29 +5721,32 @@ x_make_frame_visible (f)
5820 before the window gets really visible. */ 5721 before the window gets really visible. */
5821 if (! FRAME_ICONIFIED_P (f) 5722 if (! FRAME_ICONIFIED_P (f)
5822 && ! f->output_data.mac->asked_for_visible) 5723 && ! f->output_data.mac->asked_for_visible)
5823 x_set_offset (f, f->left_pos, f->top_pos, 0);
5824
5825 f->output_data.mac->asked_for_visible = 1;
5826
5827#if TARGET_API_MAC_CARBON 5724#if TARGET_API_MAC_CARBON
5828 if (!(FRAME_SIZE_HINTS (f)->flags & (USPosition | PPosition))) 5725 if (!(FRAME_SIZE_HINTS (f)->flags & (USPosition | PPosition)))
5829 { 5726 {
5830 struct frame *sf = SELECTED_FRAME (); 5727 struct frame *sf = SELECTED_FRAME ();
5831 if (!FRAME_MAC_P (sf)) 5728 if (!FRAME_MAC_P (sf))
5832 RepositionWindow (FRAME_MAC_WINDOW (f), NULL, 5729 RepositionWindow (FRAME_MAC_WINDOW (f), NULL,
5833 kWindowCenterOnMainScreen); 5730 kWindowCenterOnMainScreen);
5834 else 5731 else
5835 RepositionWindow (FRAME_MAC_WINDOW (f), 5732 RepositionWindow (FRAME_MAC_WINDOW (f),
5836 FRAME_MAC_WINDOW (sf), 5733 FRAME_MAC_WINDOW (sf),
5837#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 5734#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
5838 kWindowCascadeStartAtParentWindowScreen 5735 kWindowCascadeStartAtParentWindowScreen
5839#else 5736#else
5840 kWindowCascadeOnParentWindowScreen 5737 kWindowCascadeOnParentWindowScreen
5841#endif 5738#endif
5842 ); 5739 );
5843 x_real_positions (f, &f->left_pos, &f->top_pos); 5740 x_real_positions (f, &f->left_pos, &f->top_pos);
5844 } 5741 }
5742 else
5845#endif 5743#endif
5744 x_set_offset (f, f->left_pos, f->top_pos, 0);
5745
5746 f->output_data.mac->asked_for_visible = 1;
5747
5748 SelectWindow (FRAME_MAC_WINDOW (f));
5749 CollapseWindow (FRAME_MAC_WINDOW (f), false);
5846 ShowWindow (FRAME_MAC_WINDOW (f)); 5750 ShowWindow (FRAME_MAC_WINDOW (f));
5847 } 5751 }
5848 5752
@@ -5901,9 +5805,14 @@ void
5901x_make_frame_invisible (f) 5805x_make_frame_invisible (f)
5902 struct frame *f; 5806 struct frame *f;
5903{ 5807{
5808 /* A deactivate event does not occur when the last visible frame is
5809 made invisible. So if we clear the highlight here, it will not
5810 be rehighlighted when it is made visible. */
5811#if 0
5904 /* Don't keep the highlight on an invisible frame. */ 5812 /* Don't keep the highlight on an invisible frame. */
5905 if (FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame == f) 5813 if (FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame == f)
5906 FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame = 0; 5814 FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame = 0;
5815#endif
5907 5816
5908 BLOCK_INPUT; 5817 BLOCK_INPUT;
5909 5818
@@ -5916,17 +5825,11 @@ x_make_frame_invisible (f)
5916 5825
5917 HideWindow (FRAME_MAC_WINDOW (f)); 5826 HideWindow (FRAME_MAC_WINDOW (f));
5918 5827
5919 /* We can't distinguish this from iconification
5920 just by the event that we get from the server.
5921 So we can't win using the usual strategy of letting
5922 FRAME_SAMPLE_VISIBILITY set this. So do it by hand,
5923 and synchronize with the server to make sure we agree. */
5924 f->visible = 0;
5925 FRAME_ICONIFIED_P (f) = 0;
5926 f->async_visible = 0;
5927 f->async_iconified = 0;
5928
5929 UNBLOCK_INPUT; 5828 UNBLOCK_INPUT;
5829
5830#if !USE_CARBON_EVENTS
5831 mac_handle_visibility_change (f);
5832#endif
5930} 5833}
5931 5834
5932/* Change window state from mapped to iconified. */ 5835/* Change window state from mapped to iconified. */
@@ -5935,21 +5838,37 @@ void
5935x_iconify_frame (f) 5838x_iconify_frame (f)
5936 struct frame *f; 5839 struct frame *f;
5937{ 5840{
5841 OSErr err;
5842
5843 /* A deactivate event does not occur when the last visible frame is
5844 iconified. So if we clear the highlight here, it will not be
5845 rehighlighted when it is deiconified. */
5846#if 0
5938 /* Don't keep the highlight on an invisible frame. */ 5847 /* Don't keep the highlight on an invisible frame. */
5939 if (FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame == f) 5848 if (FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame == f)
5940 FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame = 0; 5849 FRAME_MAC_DISPLAY_INFO (f)->x_highlight_frame = 0;
5850#endif
5941 5851
5942#if 0
5943 /* Review: Since window is still visible in dock, still allow updates? */
5944 if (f->async_iconified) 5852 if (f->async_iconified)
5945 return; 5853 return;
5946#endif
5947 5854
5948 BLOCK_INPUT; 5855 BLOCK_INPUT;
5949 5856
5950 CollapseWindow (FRAME_MAC_WINDOW (f), true); 5857 FRAME_SAMPLE_VISIBILITY (f);
5858
5859 if (! FRAME_VISIBLE_P (f))
5860 ShowWindow (FRAME_MAC_WINDOW (f));
5861
5862 err = CollapseWindow (FRAME_MAC_WINDOW (f), true);
5951 5863
5952 UNBLOCK_INPUT; 5864 UNBLOCK_INPUT;
5865
5866 if (err != noErr)
5867 error ("Can't notify window manager of iconification");
5868
5869#if !USE_CARBON_EVENTS
5870 mac_handle_visibility_change (f);
5871#endif
5953} 5872}
5954 5873
5955 5874
@@ -6179,9 +6098,9 @@ x_get_font_info (f, font_idx)
6179} 6098}
6180 6099
6181/* the global font name table */ 6100/* the global font name table */
6182char **font_name_table = NULL; 6101static char **font_name_table = NULL;
6183int font_name_table_size = 0; 6102static int font_name_table_size = 0;
6184int font_name_count = 0; 6103static int font_name_count = 0;
6185 6104
6186/* Alist linking character set strings to Mac text encoding and Emacs 6105/* Alist linking character set strings to Mac text encoding and Emacs
6187 coding system. */ 6106 coding system. */
@@ -7338,7 +7257,7 @@ x_load_font (f, fontname, size)
7338 7257
7339 /* Set global flag fonts_changed_p to non-zero if the font loaded 7258 /* Set global flag fonts_changed_p to non-zero if the font loaded
7340 has a character with a smaller width than any other character 7259 has a character with a smaller width than any other character
7341 before, or if the font loaded has a smalle>r height than any 7260 before, or if the font loaded has a smaller height than any
7342 other font loaded before. If this happens, it will make a 7261 other font loaded before. If this happens, it will make a
7343 glyph matrix reallocation necessary. */ 7262 glyph matrix reallocation necessary. */
7344 fonts_changed_p |= x_compute_min_glyph_bounds (f); 7263 fonts_changed_p |= x_compute_min_glyph_bounds (f);
@@ -7435,22 +7354,6 @@ x_find_ccl_program (fontp)
7435#define MIN_DOC_SIZE 64 7354#define MIN_DOC_SIZE 64
7436#define MAX_DOC_SIZE 32767 7355#define MAX_DOC_SIZE 32767
7437 7356
7438#if 0
7439/* sleep time for WaitNextEvent */
7440#define WNE_SLEEP_AT_SUSPEND 10
7441#define WNE_SLEEP_AT_RESUME 1
7442
7443/* the flag appl_is_suspended is used both for determining the sleep
7444 time to be passed to WaitNextEvent and whether the cursor should be
7445 drawn when updating the display. The cursor is turned off when
7446 Emacs is suspended. Redrawing it is unnecessary and what needs to
7447 be done depends on whether the cursor lies inside or outside the
7448 redraw region. So we might as well skip drawing it when Emacs is
7449 suspended. */
7450static Boolean app_is_suspended = false;
7451static long app_sleep_time = WNE_SLEEP_AT_RESUME;
7452#endif
7453
7454#define EXTRA_STACK_ALLOC (256 * 1024) 7357#define EXTRA_STACK_ALLOC (256 * 1024)
7455 7358
7456#define ARGV_STRING_LIST_ID 129 7359#define ARGV_STRING_LIST_ID 129
@@ -7485,19 +7388,17 @@ Lisp_Object Vmac_pass_command_to_system;
7485/* If Non-nil, the Mac "Control" key is passed on to the Mac Toolbox 7388/* If Non-nil, the Mac "Control" key is passed on to the Mac Toolbox
7486 for processing before Emacs sees it. */ 7389 for processing before Emacs sees it. */
7487Lisp_Object Vmac_pass_control_to_system; 7390Lisp_Object Vmac_pass_control_to_system;
7391#endif
7488 7392
7489/* Points to the variable `inev' in the function XTread_socket. It is 7393/* Points to the variable `inev' in the function XTread_socket. It is
7490 used for passing an input event to the function back from a Carbon 7394 used for passing an input event to the function back from
7491 event handler. */ 7395 Carbon/Apple event handlers. */
7492static struct input_event *read_socket_inev = NULL; 7396static struct input_event *read_socket_inev = NULL;
7493#endif
7494 7397
7495/* Set in term/mac-win.el to indicate that event loop can now generate 7398/* Set in term/mac-win.el to indicate that event loop can now generate
7496 drag and drop events. */ 7399 drag and drop events. */
7497Lisp_Object Qmac_ready_for_drag_n_drop; 7400Lisp_Object Qmac_ready_for_drag_n_drop;
7498 7401
7499Lisp_Object drag_and_drop_file_list;
7500
7501Point saved_menu_event_location; 7402Point saved_menu_event_location;
7502 7403
7503/* Apple Events */ 7404/* Apple Events */
@@ -7777,37 +7678,30 @@ do_window_update (WindowPtr win)
7777 { 7678 {
7778 if (f->async_visible == 0) 7679 if (f->async_visible == 0)
7779 { 7680 {
7681 /* Update events may occur when a frame gets iconified. */
7682#if 0
7780 f->async_visible = 1; 7683 f->async_visible = 1;
7781 f->async_iconified = 0; 7684 f->async_iconified = 0;
7782 SET_FRAME_GARBAGED (f); 7685 SET_FRAME_GARBAGED (f);
7783 7686#endif
7784 /* An update event is equivalent to MapNotify on X, so report
7785 visibility changes properly. */
7786 if (! NILP(Vframe_list) && ! NILP (XCDR (Vframe_list)))
7787 /* Force a redisplay sooner or later to update the
7788 frame titles in case this is the second frame. */
7789 record_asynch_buffer_change ();
7790 } 7687 }
7791 else 7688 else
7792 { 7689 {
7793 Rect r; 7690 Rect r;
7794
7795#if TARGET_API_MAC_CARBON 7691#if TARGET_API_MAC_CARBON
7796 { 7692 RgnHandle region = NewRgn ();
7797 RgnHandle region = NewRgn ();
7798 7693
7799 GetPortVisibleRegion (GetWindowPort (win), region); 7694 GetPortVisibleRegion (GetWindowPort (win), region);
7800 GetRegionBounds (region, &r); 7695 GetRegionBounds (region, &r);
7801 expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top); 7696 expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top);
7802 UpdateControls (win, region); 7697 UpdateControls (win, region);
7803 DisposeRgn (region); 7698 DisposeRgn (region);
7804 }
7805#else 7699#else
7806 r = (*win->visRgn)->rgnBBox; 7700 r = (*win->visRgn)->rgnBBox;
7807 expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top); 7701 expose_frame (f, r.left, r.top, r.right - r.left, r.bottom - r.top);
7808 UpdateControls (win, win->visRgn); 7702 UpdateControls (win, win->visRgn);
7809#endif 7703#endif
7810 } 7704 }
7811 } 7705 }
7812 7706
7813 EndUpdate (win); 7707 EndUpdate (win);
@@ -7833,20 +7727,12 @@ static void
7833do_app_resume () 7727do_app_resume ()
7834{ 7728{
7835 /* Window-activate events will do the job. */ 7729 /* Window-activate events will do the job. */
7836#if 0
7837 app_is_suspended = false;
7838 app_sleep_time = WNE_SLEEP_AT_RESUME;
7839#endif
7840} 7730}
7841 7731
7842static void 7732static void
7843do_app_suspend () 7733do_app_suspend ()
7844{ 7734{
7845 /* Window-deactivate events will do the job. */ 7735 /* Window-deactivate events will do the job. */
7846#if 0
7847 app_is_suspended = true;
7848 app_sleep_time = WNE_SLEEP_AT_SUSPEND;
7849#endif
7850} 7736}
7851 7737
7852 7738
@@ -8347,6 +8233,17 @@ mac_handle_window_event (next_handler, event, data)
8347 return noErr; 8233 return noErr;
8348 } 8234 }
8349 break; 8235 break;
8236
8237 case kEventWindowShown:
8238 case kEventWindowHidden:
8239 case kEventWindowExpanded:
8240 case kEventWindowCollapsed:
8241 result = CallNextEventHandler (next_handler, event);
8242
8243 mac_handle_visibility_change (mac_window_to_frame (wp));
8244 return noErr;
8245
8246 break;
8350 } 8247 }
8351 8248
8352 return eventNotHandledErr; 8249 return eventNotHandledErr;
@@ -8400,8 +8297,6 @@ mac_handle_mouse_event (next_handler, event, data)
8400 XSETINT (read_socket_inev->x, point.h); 8297 XSETINT (read_socket_inev->x, point.h);
8401 XSETINT (read_socket_inev->y, point.v); 8298 XSETINT (read_socket_inev->y, point.v);
8402 XSETFRAME (read_socket_inev->frame_or_window, f); 8299 XSETFRAME (read_socket_inev->frame_or_window, f);
8403 read_socket_inev->timestamp =
8404 EventTimeToTicks (GetEventTime (event)) * (1000/60);
8405 8300
8406 return noErr; 8301 return noErr;
8407 } 8302 }
@@ -8424,7 +8319,11 @@ install_window_handler (window)
8424#if USE_CARBON_EVENTS 8319#if USE_CARBON_EVENTS
8425 EventTypeSpec specs_window[] = 8320 EventTypeSpec specs_window[] =
8426 {{kEventClassWindow, kEventWindowUpdate}, 8321 {{kEventClassWindow, kEventWindowUpdate},
8427 {kEventClassWindow, kEventWindowBoundsChanging}}; 8322 {kEventClassWindow, kEventWindowBoundsChanging},
8323 {kEventClassWindow, kEventWindowShown},
8324 {kEventClassWindow, kEventWindowHidden},
8325 {kEventClassWindow, kEventWindowExpanded},
8326 {kEventClassWindow, kEventWindowCollapsed}};
8428 EventTypeSpec specs_mouse[] = {{kEventClassMouse, kEventMouseWheelMoved}}; 8327 EventTypeSpec specs_mouse[] = {{kEventClassMouse, kEventMouseWheelMoved}};
8429 static EventHandlerUPP handle_window_eventUPP = NULL; 8328 static EventHandlerUPP handle_window_eventUPP = NULL;
8430 static EventHandlerUPP handle_mouse_eventUPP = NULL; 8329 static EventHandlerUPP handle_mouse_eventUPP = NULL;
@@ -8475,11 +8374,6 @@ do_ae_open_application(const AppleEvent *pae, AppleEvent *preply, long prefcon)
8475} 8374}
8476 8375
8477 8376
8478/* Defined in mac.c. */
8479extern int
8480path_from_vol_dir_name (char *, int, short, long, char *);
8481
8482
8483/* Called when we receive an AppleEvent with an ID of 8377/* Called when we receive an AppleEvent with an ID of
8484 "kAEOpenDocuments". This routine gets the direct parameter, 8378 "kAEOpenDocuments". This routine gets the direct parameter,
8485 extracts the FSSpecs in it, and puts their names on a list. */ 8379 extracts the FSSpecs in it, and puts their names on a list. */
@@ -8503,6 +8397,9 @@ do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon)
8503 DescType actual_type; 8397 DescType actual_type;
8504 Size actual_size; 8398 Size actual_size;
8505 SelectionRange position; 8399 SelectionRange position;
8400 Lisp_Object file_list = Qnil;
8401
8402 xassert (read_socket_inev);
8506 8403
8507 err = AEGetParamDesc (message, keyDirectObject, typeAEList, &the_desc); 8404 err = AEGetParamDesc (message, keyDirectObject, typeAEList, &the_desc);
8508 if (err != noErr) 8405 if (err != noErr)
@@ -8510,10 +8407,10 @@ do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon)
8510 8407
8511 err = AEGetParamPtr (message, keyAEPosition, typeChar, &actual_type, &position, sizeof(SelectionRange), &actual_size); 8408 err = AEGetParamPtr (message, keyAEPosition, typeChar, &actual_type, &position, sizeof(SelectionRange), &actual_size);
8512 if (err == noErr) 8409 if (err == noErr)
8513 drag_and_drop_file_list = Fcons (list3 (make_number (position.lineNum + 1), 8410 file_list = Fcons (list3 (make_number (position.lineNum + 1),
8514 make_number (position.startRange + 1), 8411 make_number (position.startRange + 1),
8515 make_number (position.endRange + 1)), 8412 make_number (position.endRange + 1)),
8516 drag_and_drop_file_list); 8413 file_list);
8517 8414
8518 /* Check to see that we got all of the required parameters from the 8415 /* Check to see that we got all of the required parameters from the
8519 event descriptor. For an 'odoc' event this should just be the 8416 event descriptor. For an 'odoc' event this should just be the
@@ -8567,12 +8464,49 @@ do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon)
8567 sizeof (unix_path_name) - 1) == noErr) 8464 sizeof (unix_path_name) - 1) == noErr)
8568#endif 8465#endif
8569 /* x-dnd functions expect undecoded filenames. */ 8466 /* x-dnd functions expect undecoded filenames. */
8570 drag_and_drop_file_list = 8467 file_list = Fcons (make_unibyte_string (unix_path_name,
8571 Fcons (make_unibyte_string (unix_path_name, 8468 strlen (unix_path_name)),
8572 strlen (unix_path_name)), 8469 file_list);
8573 drag_and_drop_file_list);
8574 } 8470 }
8575 } 8471 }
8472
8473 /* Build a DRAG_N_DROP_EVENT type event as is done in
8474 constuct_drag_n_drop in w32term.c. */
8475 if (!NILP (file_list))
8476 {
8477 struct frame *f = mac_focus_frame (&one_mac_display_info);
8478 WindowPtr wp;
8479 Lisp_Object frame;
8480
8481 read_socket_inev->kind = DRAG_N_DROP_EVENT;
8482 read_socket_inev->code = 0;
8483 read_socket_inev->modifiers = 0;
8484
8485 XSETINT (read_socket_inev->x, 0);
8486 XSETINT (read_socket_inev->y, 0);
8487
8488 XSETFRAME (frame, f);
8489 read_socket_inev->frame_or_window = Fcons (frame, file_list);
8490
8491#if 0
8492 /* Regardless of whether Emacs was suspended or in the
8493 foreground, ask it to redraw its entire screen. Otherwise
8494 parts of the screen can be left in an inconsistent
8495 state. */
8496 wp = FRAME_MAC_WINDOW (f);
8497 if (wp)
8498#if TARGET_API_MAC_CARBON
8499 {
8500 Rect r;
8501
8502 GetWindowPortBounds (wp, &r);
8503 InvalWindowRect (wp, &r);
8504 }
8505#else /* not TARGET_API_MAC_CARBON */
8506 InvalRect (&(wp->portRect));
8507#endif /* not TARGET_API_MAC_CARBON */
8508#endif
8509 }
8576 } 8510 }
8577 8511
8578error_exit: 8512error_exit:
@@ -8665,11 +8599,12 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
8665 ItemReference theItem; 8599 ItemReference theItem;
8666 HFSFlavor data; 8600 HFSFlavor data;
8667 Size size = sizeof (HFSFlavor); 8601 Size size = sizeof (HFSFlavor);
8602 Lisp_Object file_list;
8668 8603
8669 if (GetFrontWindowOfClass (kMovableModalWindowClass, false)) 8604 if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
8670 return dragNotAcceptedErr; 8605 return dragNotAcceptedErr;
8671 8606
8672 drag_and_drop_file_list = Qnil; 8607 file_list = Qnil;
8673 GetDragMouse (theDrag, &mouse, 0L); 8608 GetDragMouse (theDrag, &mouse, 0L);
8674 CountDragItems (theDrag, &items); 8609 CountDragItems (theDrag, &items);
8675 for (index = 1; index <= items; index++) 8610 for (index = 1; index <= items; index++)
@@ -8695,15 +8630,14 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
8695 sizeof (unix_path_name) - 1) == noErr) 8630 sizeof (unix_path_name) - 1) == noErr)
8696#endif 8631#endif
8697 /* x-dnd functions expect undecoded filenames. */ 8632 /* x-dnd functions expect undecoded filenames. */
8698 drag_and_drop_file_list = 8633 file_list = Fcons (make_unibyte_string (unix_path_name,
8699 Fcons (make_unibyte_string (unix_path_name, 8634 strlen (unix_path_name)),
8700 strlen (unix_path_name)), 8635 file_list);
8701 drag_and_drop_file_list);
8702 } 8636 }
8703 } 8637 }
8704 /* If there are items in the list, construct an event and post it to 8638 /* If there are items in the list, construct an event and post it to
8705 the queue like an interrupt using kbd_buffer_store_event. */ 8639 the queue like an interrupt using kbd_buffer_store_event. */
8706 if (!NILP (drag_and_drop_file_list)) 8640 if (!NILP (file_list))
8707 { 8641 {
8708 struct input_event event; 8642 struct input_event event;
8709 Lisp_Object frame; 8643 Lisp_Object frame;
@@ -8720,7 +8654,7 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
8720 XSETINT (event.x, mouse.h); 8654 XSETINT (event.x, mouse.h);
8721 XSETINT (event.y, mouse.v); 8655 XSETINT (event.y, mouse.v);
8722 XSETFRAME (frame, f); 8656 XSETFRAME (frame, f);
8723 event.frame_or_window = Fcons (frame, drag_and_drop_file_list); 8657 event.frame_or_window = Fcons (frame, file_list);
8724 event.arg = Qnil; 8658 event.arg = Qnil;
8725 /* Post to the interrupt queue */ 8659 /* Post to the interrupt queue */
8726 kbd_buffer_store_event (&event); 8660 kbd_buffer_store_event (&event);
@@ -8979,6 +8913,7 @@ XTread_socket (sd, expected, hold_quit)
8979 { 8913 {
8980 int do_help = 0; 8914 int do_help = 0;
8981 struct frame *f; 8915 struct frame *f;
8916 unsigned long timestamp;
8982 8917
8983 /* It is necessary to set this (additional) argument slot of an 8918 /* It is necessary to set this (additional) argument slot of an
8984 event to nil because keyboard.c protects incompletely 8919 event to nil because keyboard.c protects incompletely
@@ -8989,6 +8924,12 @@ XTread_socket (sd, expected, hold_quit)
8989 inev.arg = Qnil; 8924 inev.arg = Qnil;
8990 8925
8991#if USE_CARBON_EVENTS 8926#if USE_CARBON_EVENTS
8927 timestamp = GetEventTime (eventRef) / kEventDurationMillisecond;
8928#else
8929 timestamp = er.when * (1000 / 60); /* ticks to milliseconds */
8930#endif
8931
8932#if USE_CARBON_EVENTS
8992 /* Handle new events */ 8933 /* Handle new events */
8993 if (!mac_convert_event_ref (eventRef, &er)) 8934 if (!mac_convert_event_ref (eventRef, &er))
8994 { 8935 {
@@ -9089,8 +9030,6 @@ XTread_socket (sd, expected, hold_quit)
9089#endif 9030#endif
9090 XSETINT (inev.x, mouse_loc.h); 9031 XSETINT (inev.x, mouse_loc.h);
9091 XSETINT (inev.y, mouse_loc.v); 9032 XSETINT (inev.y, mouse_loc.v);
9092 inev.timestamp = er.when * (1000 / 60);
9093 /* ticks to milliseconds */
9094 9033
9095 if (dpyinfo->grabbed && tracked_scroll_bar 9034 if (dpyinfo->grabbed && tracked_scroll_bar
9096 || ch != 0 9035 || ch != 0
@@ -9124,10 +9063,9 @@ XTread_socket (sd, expected, hold_quit)
9124 &er, &inev); 9063 &er, &inev);
9125 else if (er.what == mouseDown) 9064 else if (er.what == mouseDown)
9126 x_scroll_bar_handle_press (bar, control_part_code, 9065 x_scroll_bar_handle_press (bar, control_part_code,
9127 inev.timestamp, &inev); 9066 &inev);
9128 else 9067 else
9129 x_scroll_bar_handle_release (bar, inev.timestamp, 9068 x_scroll_bar_handle_release (bar, &inev);
9130 &inev);
9131#else /* not USE_TOOLKIT_SCROLL_BARS */ 9069#else /* not USE_TOOLKIT_SCROLL_BARS */
9132 x_scroll_bar_handle_click (bar, control_part_code, 9070 x_scroll_bar_handle_click (bar, control_part_code,
9133 &er, &inev); 9071 &er, &inev);
@@ -9301,8 +9239,7 @@ XTread_socket (sd, expected, hold_quit)
9301 if (dpyinfo->grabbed && tracked_scroll_bar) 9239 if (dpyinfo->grabbed && tracked_scroll_bar)
9302#ifdef USE_TOOLKIT_SCROLL_BARS 9240#ifdef USE_TOOLKIT_SCROLL_BARS
9303 x_scroll_bar_handle_drag (wp, tracked_scroll_bar, 9241 x_scroll_bar_handle_drag (wp, tracked_scroll_bar,
9304 mouse_pos, er.when * (1000 / 60), 9242 mouse_pos, &inev);
9305 &inev);
9306#else /* not USE_TOOLKIT_SCROLL_BARS */ 9243#else /* not USE_TOOLKIT_SCROLL_BARS */
9307 x_scroll_bar_note_movement (tracked_scroll_bar, 9244 x_scroll_bar_note_movement (tracked_scroll_bar,
9308 mouse_pos.v 9245 mouse_pos.v
@@ -9390,11 +9327,10 @@ XTread_socket (sd, expected, hold_quit)
9390 9327
9391 EVENT_INIT (event); 9328 EVENT_INIT (event);
9392 event.kind = NO_EVENT; 9329 event.kind = NO_EVENT;
9393 x_scroll_bar_handle_release (tracked_scroll_bar, 9330 x_scroll_bar_handle_release (tracked_scroll_bar, &event);
9394 er.when * (1000 / 60),
9395 &event);
9396 if (event.kind != NO_EVENT) 9331 if (event.kind != NO_EVENT)
9397 { 9332 {
9333 event.timestamp = timestamp;
9398 kbd_buffer_store_event_hold (&event, hold_quit); 9334 kbd_buffer_store_event_hold (&event, hold_quit);
9399 count++; 9335 count++;
9400 } 9336 }
@@ -9470,6 +9406,7 @@ XTread_socket (sd, expected, hold_quit)
9470 event.kind = LANGUAGE_CHANGE_EVENT; 9406 event.kind = LANGUAGE_CHANGE_EVENT;
9471 event.arg = Qnil; 9407 event.arg = Qnil;
9472 event.code = current_key_script; 9408 event.code = current_key_script;
9409 event.timestamp = timestamp;
9473 kbd_buffer_store_event (&event); 9410 kbd_buffer_store_event (&event);
9474 count++; 9411 count++;
9475 } 9412 }
@@ -9534,58 +9471,18 @@ XTread_socket (sd, expected, hold_quit)
9534#else 9471#else
9535 inev.modifiers = mac_to_emacs_modifiers (er.modifiers); 9472 inev.modifiers = mac_to_emacs_modifiers (er.modifiers);
9536#endif 9473#endif
9474 inev.modifiers |= (extra_keyboard_modifiers
9475 & (meta_modifier | alt_modifier
9476 | hyper_modifier | super_modifier));
9537 XSETFRAME (inev.frame_or_window, mac_focus_frame (dpyinfo)); 9477 XSETFRAME (inev.frame_or_window, mac_focus_frame (dpyinfo));
9538 inev.timestamp = er.when * (1000 / 60); /* ticks to milliseconds */
9539 break; 9478 break;
9540 9479
9541 case kHighLevelEvent: 9480 case kHighLevelEvent:
9542 drag_and_drop_file_list = Qnil; 9481 read_socket_inev = &inev;
9543 9482 AEProcessAppleEvent (&er);
9544 AEProcessAppleEvent(&er); 9483 read_socket_inev = NULL;
9545 9484 break;
9546 /* Build a DRAG_N_DROP_EVENT type event as is done in
9547 constuct_drag_n_drop in w32term.c. */
9548 if (!NILP (drag_and_drop_file_list))
9549 {
9550 struct frame *f = mac_focus_frame (dpyinfo);
9551 WindowPtr wp;
9552 Lisp_Object frame;
9553
9554 inev.kind = DRAG_N_DROP_EVENT;
9555 inev.code = 0;
9556 inev.timestamp = er.when * (1000 / 60);
9557 /* ticks to milliseconds */
9558#if USE_CARBON_EVENTS
9559 inev.modifiers = mac_event_to_emacs_modifiers (eventRef);
9560#else
9561 inev.modifiers = mac_to_emacs_modifiers (er.modifiers);
9562#endif
9563
9564 XSETINT (inev.x, 0);
9565 XSETINT (inev.y, 0);
9566
9567 XSETFRAME (frame, f);
9568 inev.frame_or_window = Fcons (frame, drag_and_drop_file_list);
9569
9570#if 0
9571 /* Regardless of whether Emacs was suspended or in the
9572 foreground, ask it to redraw its entire screen.
9573 Otherwise parts of the screen can be left in an
9574 inconsistent state. */
9575 wp = FRAME_MAC_WINDOW (f);
9576 if (wp)
9577#if TARGET_API_MAC_CARBON
9578 {
9579 Rect r;
9580 9485
9581 GetWindowPortBounds (wp, &r);
9582 InvalWindowRect (wp, &r);
9583 }
9584#else /* not TARGET_API_MAC_CARBON */
9585 InvalRect (&(wp->portRect));
9586#endif /* not TARGET_API_MAC_CARBON */
9587#endif
9588 }
9589 default: 9486 default:
9590 break; 9487 break;
9591 } 9488 }
@@ -9595,6 +9492,7 @@ XTread_socket (sd, expected, hold_quit)
9595 9492
9596 if (inev.kind != NO_EVENT) 9493 if (inev.kind != NO_EVENT)
9597 { 9494 {
9495 inev.timestamp = timestamp;
9598 kbd_buffer_store_event_hold (&inev, hold_quit); 9496 kbd_buffer_store_event_hold (&inev, hold_quit);
9599 count++; 9497 count++;
9600 } 9498 }
@@ -9634,6 +9532,29 @@ XTread_socket (sd, expected, hold_quit)
9634 pending_autoraise_frame = 0; 9532 pending_autoraise_frame = 0;
9635 } 9533 }
9636 9534
9535#if !USE_CARBON_EVENTS
9536 /* Check which frames are still visible. We do this here because
9537 there doesn't seem to be any direct notification from the Window
9538 Manager that the visibility of a window has changed (at least,
9539 not in all cases). */
9540 {
9541 Lisp_Object tail, frame;
9542
9543 FOR_EACH_FRAME (tail, frame)
9544 {
9545 struct frame *f = XFRAME (frame);
9546
9547 /* The tooltip has been drawn already. Avoid the
9548 SET_FRAME_GARBAGED in mac_handle_visibility_change. */
9549 if (EQ (frame, tip_frame))
9550 continue;
9551
9552 if (FRAME_MAC_P (f))
9553 mac_handle_visibility_change (f);
9554 }
9555 }
9556#endif
9557
9637 UNBLOCK_INPUT; 9558 UNBLOCK_INPUT;
9638 return count; 9559 return count;
9639} 9560}
@@ -10067,7 +9988,7 @@ mac_check_for_quit_char ()
10067 kbd_buffer_store_event (&e); 9988 kbd_buffer_store_event (&e);
10068 } 9989 }
10069} 9990}
10070#endif /* MAC_OSX */ 9991#endif /* MAC_OSX */
10071 9992
10072static void 9993static void
10073init_menu_bar () 9994init_menu_bar ()
@@ -10171,7 +10092,6 @@ mac_initialize ()
10171 bottom */ 10092 bottom */
10172 baud_rate = 19200; 10093 baud_rate = 19200;
10173 10094
10174 x_noop_count = 0;
10175 last_tool_bar_item = -1; 10095 last_tool_bar_item = -1;
10176 any_help_event_p = 0; 10096 any_help_event_p = 0;
10177 10097
@@ -10243,12 +10163,6 @@ syms_of_macterm ()
10243 staticpro (&last_mouse_scroll_bar); 10163 staticpro (&last_mouse_scroll_bar);
10244 last_mouse_scroll_bar = Qnil; 10164 last_mouse_scroll_bar = Qnil;
10245 10165
10246 staticpro (&Qvendor_specific_keysyms);
10247 Qvendor_specific_keysyms = intern ("vendor-specific-keysyms");
10248
10249 staticpro (&last_mouse_press_frame);
10250 last_mouse_press_frame = Qnil;
10251
10252 Qmac_ready_for_drag_n_drop = intern ("mac-ready-for-drag-n-drop"); 10166 Qmac_ready_for_drag_n_drop = intern ("mac-ready-for-drag-n-drop");
10253 staticpro (&Qmac_ready_for_drag_n_drop); 10167 staticpro (&Qmac_ready_for_drag_n_drop);
10254 10168
@@ -10260,14 +10174,6 @@ syms_of_macterm ()
10260 Vx_toolkit_scroll_bars = Qnil; 10174 Vx_toolkit_scroll_bars = Qnil;
10261#endif 10175#endif
10262 10176
10263 DEFVAR_BOOL ("x-use-underline-position-properties",
10264 &x_use_underline_position_properties,
10265 doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties.
10266nil means ignore them. If you encounter fonts with bogus
10267UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
10268to 4.1, set this to nil. */);
10269 x_use_underline_position_properties = 0;
10270
10271 staticpro (&last_mouse_motion_frame); 10177 staticpro (&last_mouse_motion_frame);
10272 last_mouse_motion_frame = Qnil; 10178 last_mouse_motion_frame = Qnil;
10273 10179
@@ -10292,7 +10198,7 @@ useful for non-standard keyboard layouts. */);
10292 doc: /* t means that when the option-key is held down while pressing the 10198 doc: /* t means that when the option-key is held down while pressing the
10293mouse button, the click will register as mouse-2 and while the 10199mouse button, the click will register as mouse-2 and while the
10294command-key is held down, the click will register as mouse-3. 10200command-key is held down, the click will register as mouse-3.
10295'reverse means that the the option-key will register for mouse-3 10201'reverse means that the option-key will register for mouse-3
10296and the command-key will register for mouse-2. nil means that 10202and the command-key will register for mouse-2. nil means that
10297no emulation should be done and the modifiers should be placed 10203no emulation should be done and the modifiers should be placed
10298on the mouse-1 event. */); 10204on the mouse-1 event. */);
diff --git a/src/macterm.h b/src/macterm.h
index ea5f7db6084..948fa486aba 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -1,5 +1,6 @@
1/* Display module for Mac OS. 1/* Display module for Mac OS.
2 Copyright (C) 2000, 2001 Free Software Foundation, Inc. 2 Copyright (C) 2000, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -38,11 +39,6 @@ Boston, MA 02110-1301, USA. */
38#define BLACK_PIX_DEFAULT(f) RGB_TO_ULONG(0,0,0) 39#define BLACK_PIX_DEFAULT(f) RGB_TO_ULONG(0,0,0)
39#define WHITE_PIX_DEFAULT(f) RGB_TO_ULONG(255,255,255) 40#define WHITE_PIX_DEFAULT(f) RGB_TO_ULONG(255,255,255)
40 41
41/* A black pixel in a mask bitmap/pixmap means ``draw a source
42 pixel''. A white pixel means ``retain the current pixel''. */
43#define PIX_MASK_DRAW(f) BLACK_PIX_DEFAULT(f)
44#define PIX_MASK_RETAIN(f) WHITE_PIX_DEFAULT(f)
45
46#define FONT_WIDTH(f) ((f)->max_bounds.width) 42#define FONT_WIDTH(f) ((f)->max_bounds.width)
47#define FONT_HEIGHT(f) ((f)->ascent + (f)->descent) 43#define FONT_HEIGHT(f) ((f)->ascent + (f)->descent)
48#define FONT_BASE(f) ((f)->ascent) 44#define FONT_BASE(f) ((f)->ascent)
@@ -149,7 +145,7 @@ struct mac_display_info
149 int smallest_font_height; 145 int smallest_font_height;
150 146
151 /* Reusable Graphics Context for drawing a cursor in a non-default face. */ 147 /* Reusable Graphics Context for drawing a cursor in a non-default face. */
152 XGCValues *scratch_cursor_gc; 148 GC scratch_cursor_gc;
153 149
154 /* These variables describe the range of text currently shown in its 150 /* These variables describe the range of text currently shown in its
155 mouse-face, together with the window they apply to. As long as 151 mouse-face, together with the window they apply to. As long as
@@ -388,7 +384,7 @@ struct mac_output {
388 /* Relief GCs, colors etc. */ 384 /* Relief GCs, colors etc. */
389 struct relief 385 struct relief
390 { 386 {
391 XGCValues *gc; 387 GC gc;
392 unsigned long pixel; 388 unsigned long pixel;
393 int allocated_p; 389 int allocated_p;
394 } 390 }
@@ -598,6 +594,8 @@ EXFUN (Fx_display_color_p, 1);
598EXFUN (Fx_display_grayscale_p, 1); 594EXFUN (Fx_display_grayscale_p, 1);
599EXFUN (Fx_display_planes, 1); 595EXFUN (Fx_display_planes, 1);
600extern void x_free_gcs P_ ((struct frame *)); 596extern void x_free_gcs P_ ((struct frame *));
597extern int XParseGeometry P_ ((char *, int *, int *, unsigned int *,
598 unsigned int *));
601 599
602/* Defined in macterm.c. */ 600/* Defined in macterm.c. */
603 601
@@ -611,6 +609,7 @@ extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowPtr, char *,
611 unsigned long, unsigned long, 609 unsigned long, unsigned long,
612 unsigned int)); 610 unsigned int));
613extern void XFreePixmap P_ ((Display *, Pixmap)); 611extern void XFreePixmap P_ ((Display *, Pixmap));
612extern GC XCreateGC P_ ((Display *, Window, unsigned long, XGCValues *));
614extern void XSetForeground P_ ((Display *, GC, unsigned long)); 613extern void XSetForeground P_ ((Display *, GC, unsigned long));
615extern void XSetBackground P_ ((Display *, GC, unsigned long)); 614extern void XSetBackground P_ ((Display *, GC, unsigned long));
616extern void XSetWindowBackground P_ ((Display *, WindowPtr, unsigned long)); 615extern void XSetWindowBackground P_ ((Display *, WindowPtr, unsigned long));
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index a4084046fac..1ee232949d9 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -1,5 +1,6 @@
1# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API. 1# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2# Copyright (c) 2000-2001, 2004 Free Software Foundation, Inc. 2# Copyright (C) 2000, 2001, 2002, 2003, 2004,
3# 2005 Free Software Foundation, Inc.
3# 4#
4# This file is part of GNU Emacs. 5# This file is part of GNU Emacs.
5# 6#
diff --git a/src/marker.c b/src/marker.c
index d6029c79c9d..11b077761e5 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -1,5 +1,6 @@
1/* Markers: examining, setting and deleting. 1/* Markers: examining, setting and deleting.
2 Copyright (C) 1985, 1997, 1998, 2003 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1997, 1998, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/md5.c b/src/md5.c
index 039213fd76b..4f055447eac 100644
--- a/src/md5.c
+++ b/src/md5.c
@@ -1,6 +1,7 @@
1/* Functions to compute MD5 message digest of files or memory blocks. 1/* Functions to compute MD5 message digest of files or memory blocks.
2 according to the definition of MD5 in RFC 1321 from April 1992. 2 according to the definition of MD5 in RFC 1321 from April 1992.
3 Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. 3 Copyright (C) 1995, 1996, 1997, 1999, 2000, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 This file is part of the GNU Emacs. 5 This file is part of the GNU Emacs.
5 6
6 The GNU C Library is free software; you can redistribute it and/or 7 The GNU C Library is free software; you can redistribute it and/or
diff --git a/src/md5.h b/src/md5.h
index 229da8daa8d..adcc6bf48f6 100644
--- a/src/md5.h
+++ b/src/md5.h
@@ -1,6 +1,7 @@
1/* Declaration of functions and data types used for MD5 sum computing 1/* Declaration of functions and data types used for MD5 sum computing
2 library functions. 2 library functions.
3 Copyright (C) 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. 3 Copyright (C) 1995, 1996, 1997, 1999, 2000, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 This file is part of GNU Emacs. 5 This file is part of GNU Emacs.
5 6
6 The GNU C Library is free software; you can redistribute it and/or 7 The GNU C Library is free software; you can redistribute it and/or
diff --git a/src/mem-limits.h b/src/mem-limits.h
index aac8a396172..d7ac6a3e366 100644
--- a/src/mem-limits.h
+++ b/src/mem-limits.h
@@ -1,5 +1,6 @@
1/* Includes for memory limit warnings. 1/* Includes for memory limit warnings.
2 Copyright (C) 1990, 93, 94, 95, 1996, 2004 Free Software Foundation, Inc. 2 Copyright (C) 1990, 1993, 1994, 1995, 1996, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/minibuf.c b/src/minibuf.c
index e04be1465ed..8f07a4603c4 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1,6 +1,6 @@
1/* Minibuffer input and completion. 1/* Minibuffer input and completion.
2 Copyright (C) 1985,86,93,94,95,96,97,98,99,2000,01,03,04,05 2 Copyright (C) 1985, 1986, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3 Free Software Foundation, Inc. 3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -350,7 +350,7 @@ BUFFER can be a buffer or a buffer name. */)
350DEFUN ("minibuffer-prompt-end", Fminibuffer_prompt_end, 350DEFUN ("minibuffer-prompt-end", Fminibuffer_prompt_end,
351 Sminibuffer_prompt_end, 0, 0, 0, 351 Sminibuffer_prompt_end, 0, 0, 0,
352 doc: /* Return the buffer position of the end of the minibuffer prompt. 352 doc: /* Return the buffer position of the end of the minibuffer prompt.
353Return (point-min) if current buffer is not a mini-buffer. */) 353Return (point-min) if current buffer is not a minibuffer. */)
354 () 354 ()
355{ 355{
356 /* This function is written to be most efficient when there's a prompt. */ 356 /* This function is written to be most efficient when there's a prompt. */
@@ -1019,7 +1019,7 @@ DEFUN ("eval-minibuffer", Feval_minibuffer, Seval_minibuffer, 1, 2, 0,
1019Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS 1019Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS
1020is a string to insert in the minibuffer before reading. 1020is a string to insert in the minibuffer before reading.
1021\(INITIAL-CONTENTS can also be a cons of a string and an integer. Such 1021\(INITIAL-CONTENTS can also be a cons of a string and an integer. Such
1022arguments are used as in `read-from-minibuffer') */) 1022arguments are used as in `read-from-minibuffer'.) */)
1023 (prompt, initial_contents) 1023 (prompt, initial_contents)
1024 Lisp_Object prompt, initial_contents; 1024 Lisp_Object prompt, initial_contents;
1025{ 1025{
@@ -1763,7 +1763,7 @@ the values STRING, PREDICATE and `lambda'. */)
1763 || NILP (alist)) 1763 || NILP (alist))
1764 { 1764 {
1765 tem = Fassoc_string (string, alist, completion_ignore_case ? Qt : Qnil); 1765 tem = Fassoc_string (string, alist, completion_ignore_case ? Qt : Qnil);
1766 if NILP (tem) 1766 if (NILP (tem))
1767 return Qnil; 1767 return Qnil;
1768 } 1768 }
1769 else if (VECTORP (alist)) 1769 else if (VECTORP (alist))
diff --git a/src/mktime.c b/src/mktime.c
index c61f1463564..025f54d95c2 100644
--- a/src/mktime.c
+++ b/src/mktime.c
@@ -1,5 +1,6 @@
1/* Convert a `struct tm' to a time_t value. 1/* Convert a `struct tm' to a time_t value.
2 Copyright (C) 1993, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 Contributed by Paul Eggert (eggert@twinsun.com). 4 Contributed by Paul Eggert (eggert@twinsun.com).
4 5
5 NOTE: The canonical source of this file is maintained with the GNU C Library. 6 NOTE: The canonical source of this file is maintained with the GNU C Library.
diff --git a/src/msdos.c b/src/msdos.c
index 07ee522f98f..4ea4ab0cf1d 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1,6 +1,6 @@
1/* MS-DOS specific C utilities. -*- coding: raw-text -*- 1/* MS-DOS specific C utilities. -*- coding: raw-text -*-
2 Copyright (C) 1993, 94, 95, 96, 97, 1999, 2000, 01, 2003 2 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
3 Free Software Foundation, Inc. 3 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/msdos.h b/src/msdos.h
index 7f2f013fd13..b6c6aca1493 100644
--- a/src/msdos.h
+++ b/src/msdos.h
@@ -1,5 +1,6 @@
1/* MS-DOS specific C utilities, interface. 1/* MS-DOS specific C utilities, interface.
2 Copyright (C) 1993, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1993, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/prefix-args.c b/src/prefix-args.c
index 8c4043f83cb..c2f6303786f 100644
--- a/src/prefix-args.c
+++ b/src/prefix-args.c
@@ -1,5 +1,5 @@
1/* prefix-args.c - echo each argument, prefixed by a string. 1/* prefix-args.c - echo each argument, prefixed by a string.
2 Copyright (C) 1992 Free Software Foundation, Inc. 2 Copyright (C) 1992, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/print.c b/src/print.c
index 6150ff2efe6..65c48b6d82b 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1,6 +1,7 @@
1/* Lisp object printing and output streams. 1/* Lisp object printing and output streams.
2 Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, 2 Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997,
3 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. 3 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
diff --git a/src/process.c b/src/process.c
index 3879821c2fa..f23b8368f6d 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1,6 +1,7 @@
1/* Asynchronous subprocess control for GNU Emacs. 1/* Asynchronous subprocess control for GNU Emacs.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1998, 1999, 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995,
3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3 1996, 1998, 1999, 2001, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -293,7 +294,10 @@ static Lisp_Object Vprocess_adaptive_read_buffering;
293 294
294#include "sysselect.h" 295#include "sysselect.h"
295 296
296extern int keyboard_bit_set P_ ((SELECT_TYPE *)); 297static int keyboard_bit_set P_ ((SELECT_TYPE *));
298static void deactivate_process P_ ((Lisp_Object));
299static void status_notify P_ ((struct Lisp_Process *));
300static int read_process_output P_ ((Lisp_Object, int));
297 301
298/* If we support a window system, turn on the code to poll periodically 302/* If we support a window system, turn on the code to poll periodically
299 to detect C-g. It isn't actually used when doing interrupt input. */ 303 to detect C-g. It isn't actually used when doing interrupt input. */
@@ -390,9 +394,9 @@ static char pty_name[24];
390/* Compute the Lisp form of the process status, p->status, from 394/* Compute the Lisp form of the process status, p->status, from
391 the numeric status that was returned by `wait'. */ 395 the numeric status that was returned by `wait'. */
392 396
393Lisp_Object status_convert (); 397static Lisp_Object status_convert ();
394 398
395void 399static void
396update_status (p) 400update_status (p)
397 struct Lisp_Process *p; 401 struct Lisp_Process *p;
398{ 402{
@@ -406,7 +410,7 @@ update_status (p)
406/* Convert a process status word in Unix format to 410/* Convert a process status word in Unix format to
407 the list that we use internally. */ 411 the list that we use internally. */
408 412
409Lisp_Object 413static Lisp_Object
410status_convert (w) 414status_convert (w)
411 WAITTYPE w; 415 WAITTYPE w;
412{ 416{
@@ -425,7 +429,7 @@ status_convert (w)
425/* Given a status-list, extract the three pieces of information 429/* Given a status-list, extract the three pieces of information
426 and store them individually through the three pointers. */ 430 and store them individually through the three pointers. */
427 431
428void 432static void
429decode_status (l, symbol, code, coredump) 433decode_status (l, symbol, code, coredump)
430 Lisp_Object l; 434 Lisp_Object l;
431 Lisp_Object *symbol; 435 Lisp_Object *symbol;
@@ -504,7 +508,7 @@ status_message (p)
504 The file name of the terminal corresponding to the pty 508 The file name of the terminal corresponding to the pty
505 is left in the variable pty_name. */ 509 is left in the variable pty_name. */
506 510
507int 511static int
508allocate_pty () 512allocate_pty ()
509{ 513{
510 register int c, i; 514 register int c, i;
@@ -589,7 +593,7 @@ allocate_pty ()
589} 593}
590#endif /* HAVE_PTYS */ 594#endif /* HAVE_PTYS */
591 595
592Lisp_Object 596static Lisp_Object
593make_process (name) 597make_process (name)
594 Lisp_Object name; 598 Lisp_Object name;
595{ 599{
@@ -633,7 +637,7 @@ make_process (name)
633 return val; 637 return val;
634} 638}
635 639
636void 640static void
637remove_process (proc) 641remove_process (proc)
638 register Lisp_Object proc; 642 register Lisp_Object proc;
639{ 643{
@@ -767,23 +771,27 @@ nil, indicating the current buffer's process. */)
767 (process) 771 (process)
768 register Lisp_Object process; 772 register Lisp_Object process;
769{ 773{
774 register struct Lisp_Process *p;
775
770 process = get_process (process); 776 process = get_process (process);
771 XPROCESS (process)->raw_status_low = Qnil; 777 p = XPROCESS (process);
772 XPROCESS (process)->raw_status_high = Qnil; 778
773 if (NETCONN_P (process)) 779 p->raw_status_low = Qnil;
780 p->raw_status_high = Qnil;
781 if (NETCONN1_P (p))
774 { 782 {
775 XPROCESS (process)->status = Fcons (Qexit, Fcons (make_number (0), Qnil)); 783 p->status = Fcons (Qexit, Fcons (make_number (0), Qnil));
776 XSETINT (XPROCESS (process)->tick, ++process_tick); 784 XSETINT (p->tick, ++process_tick);
777 status_notify (); 785 status_notify (p);
778 } 786 }
779 else if (XINT (XPROCESS (process)->infd) >= 0) 787 else if (XINT (p->infd) >= 0)
780 { 788 {
781 Fkill_process (process, Qnil); 789 Fkill_process (process, Qnil);
782 /* Do this now, since remove_process will make sigchld_handler do nothing. */ 790 /* Do this now, since remove_process will make sigchld_handler do nothing. */
783 XPROCESS (process)->status 791 p->status
784 = Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil)); 792 = Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil));
785 XSETINT (XPROCESS (process)->tick, ++process_tick); 793 XSETINT (p->tick, ++process_tick);
786 status_notify (); 794 status_notify (p);
787 } 795 }
788 remove_process (process); 796 remove_process (process);
789 return Qnil; 797 return Qnil;
@@ -1237,7 +1245,7 @@ IP address. Returns nil if format of ADDRESS is invalid. */)
1237} 1245}
1238#endif 1246#endif
1239 1247
1240Lisp_Object 1248static Lisp_Object
1241list_processes_1 (query_only) 1249list_processes_1 (query_only)
1242 Lisp_Object query_only; 1250 Lisp_Object query_only;
1243{ 1251{
@@ -1707,7 +1715,7 @@ start_process_unwind (proc)
1707 return Qnil; 1715 return Qnil;
1708} 1716}
1709 1717
1710void 1718static void
1711create_process_1 (timer) 1719create_process_1 (timer)
1712 struct atimer *timer; 1720 struct atimer *timer;
1713{ 1721{
@@ -2530,7 +2538,7 @@ OPTION is not a supported option, return nil instead; otherwise return t. */)
2530 2538
2531/* A version of request_sigio suitable for a record_unwind_protect. */ 2539/* A version of request_sigio suitable for a record_unwind_protect. */
2532 2540
2533Lisp_Object 2541static Lisp_Object
2534unwind_request_sigio (dummy) 2542unwind_request_sigio (dummy)
2535 Lisp_Object dummy; 2543 Lisp_Object dummy;
2536{ 2544{
@@ -4221,7 +4229,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
4221 /* It's okay for us to do this and then continue with 4229 /* It's okay for us to do this and then continue with
4222 the loop, since timeout has already been zeroed out. */ 4230 the loop, since timeout has already been zeroed out. */
4223 clear_waiting_for_input (); 4231 clear_waiting_for_input ();
4224 status_notify (); 4232 status_notify (NULL);
4225 } 4233 }
4226 } 4234 }
4227 4235
@@ -4739,7 +4747,7 @@ read_process_output_error_handler (error)
4739 The characters read are decoded according to PROC's coding-system 4747 The characters read are decoded according to PROC's coding-system
4740 for decoding. */ 4748 for decoding. */
4741 4749
4742int 4750static int
4743read_process_output (proc, channel) 4751read_process_output (proc, channel)
4744 Lisp_Object proc; 4752 Lisp_Object proc;
4745 register int channel; 4753 register int channel;
@@ -5130,7 +5138,7 @@ send_process_trap ()
5130 5138
5131 This function can evaluate Lisp code and can garbage collect. */ 5139 This function can evaluate Lisp code and can garbage collect. */
5132 5140
5133void 5141static void
5134send_process (proc, buf, len, object) 5142send_process (proc, buf, len, object)
5135 volatile Lisp_Object proc; 5143 volatile Lisp_Object proc;
5136 unsigned char *volatile buf; 5144 unsigned char *volatile buf;
@@ -5724,7 +5732,7 @@ process_send_signal (process, signo, current_group, nomsg)
5724 p->status = Qrun; 5732 p->status = Qrun;
5725 XSETINT (p->tick, ++process_tick); 5733 XSETINT (p->tick, ++process_tick);
5726 if (!nomsg) 5734 if (!nomsg)
5727 status_notify (); 5735 status_notify (NULL);
5728 break; 5736 break;
5729#endif /* ! defined (SIGCONT) */ 5737#endif /* ! defined (SIGCONT) */
5730 case SIGINT: 5738 case SIGINT:
@@ -6392,8 +6400,9 @@ exec_sentinel (proc, reason)
6392 This is usually done while Emacs is waiting for keyboard input 6400 This is usually done while Emacs is waiting for keyboard input
6393 but can be done at other times. */ 6401 but can be done at other times. */
6394 6402
6395void 6403static void
6396status_notify () 6404status_notify (deleting_process)
6405 struct Lisp_Process *deleting_process;
6397{ 6406{
6398 register Lisp_Object proc, buffer; 6407 register Lisp_Object proc, buffer;
6399 Lisp_Object tail, msg; 6408 Lisp_Object tail, msg;
@@ -6429,6 +6438,7 @@ status_notify ()
6429 && ! EQ (p->status, Qlisten) 6438 && ! EQ (p->status, Qlisten)
6430 && ! EQ (p->command, Qt) /* Network process not stopped. */ 6439 && ! EQ (p->command, Qt) /* Network process not stopped. */
6431 && XINT (p->infd) >= 0 6440 && XINT (p->infd) >= 0
6441 && p != deleting_process
6432 && read_process_output (proc, XINT (p->infd)) > 0); 6442 && read_process_output (proc, XINT (p->infd)) > 0);
6433 6443
6434 buffer = p->buffer; 6444 buffer = p->buffer;
@@ -6624,7 +6634,7 @@ delete_keyboard_wait_descriptor (desc)
6624/* Return nonzero if *MASK has a bit set 6634/* Return nonzero if *MASK has a bit set
6625 that corresponds to one of the keyboard input descriptors. */ 6635 that corresponds to one of the keyboard input descriptors. */
6626 6636
6627int 6637static int
6628keyboard_bit_set (mask) 6638keyboard_bit_set (mask)
6629 SELECT_TYPE *mask; 6639 SELECT_TYPE *mask;
6630{ 6640{
diff --git a/src/process.h b/src/process.h
index a58b08a197e..cadc9b7031c 100644
--- a/src/process.h
+++ b/src/process.h
@@ -1,5 +1,6 @@
1/* Definitions for asynchronous process control in GNU Emacs. 1/* Definitions for asynchronous process control in GNU Emacs.
2 Copyright (C) 1985, 1994 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1994, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/puresize.h b/src/puresize.h
index 2e7637c6724..7951f7ecbf2 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -1,5 +1,5 @@
1/* How much read-only Lisp storage a dumped Emacs needs. 1/* How much read-only Lisp storage a dumped Emacs needs.
2 Copyright (C) 1993, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1993, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/ralloc.c b/src/ralloc.c
index 824fb536fc1..35a8cb9c58a 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -1,5 +1,6 @@
1/* Block-relocating memory allocator. 1/* Block-relocating memory allocator.
2 Copyright (C) 1993, 1995, 2000 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1995, 2000, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/regex.c b/src/regex.c
index c82bdb0edd9..fd18864110b 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -2,7 +2,8 @@
2 0.12. (Implements POSIX draft P1003.2/D11.2, except for some of the 2 0.12. (Implements POSIX draft P1003.2/D11.2, except for some of the
3 internationalization features.) 3 internationalization features.)
4 4
5 Copyright (C) 1993,94,95,96,97,98,99,2000,04 Free Software Foundation, Inc. 5 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
6 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
6 7
7 This program is free software; you can redistribute it and/or modify 8 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
diff --git a/src/regex.h b/src/regex.h
index 89532b7ee9f..557700dc93d 100644
--- a/src/regex.h
+++ b/src/regex.h
@@ -1,7 +1,8 @@
1/* Definitions for data structures and routines for the regular 1/* Definitions for data structures and routines for the regular
2 expression library, version 0.12. 2 expression library, version 0.12.
3 3
4 Copyright (C) 1985,89,90,91,92,93,95,2000 Free Software Foundation, Inc. 4 Copyright (C) 1985, 1989, 1990, 1991, 1992, 1993, 1995, 2000, 2002,
5 2003, 2004, 2005 Free Software Foundation, Inc.
5 6
6 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
diff --git a/src/region-cache.c b/src/region-cache.c
index 22eac35ca86..d49278eb886 100644
--- a/src/region-cache.c
+++ b/src/region-cache.c
@@ -1,6 +1,6 @@
1/* Caching facts about regions of the buffer, for optimization. 1/* Caching facts about regions of the buffer, for optimization.
2 Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1995 2 Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1995, 2002, 2003, 2004,
3 Free Software Foundation, Inc. 3 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/region-cache.h b/src/region-cache.h
index 5c27d00740f..51d2ceb1e62 100644
--- a/src/region-cache.h
+++ b/src/region-cache.h
@@ -1,5 +1,6 @@
1/* Header file: Caching facts about regions of the buffer, for optimization. 1/* Header file: Caching facts about regions of the buffer, for optimization.
2 Copyright (C) 1985, 1986, 1993, 1995 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1993, 1995, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/aix3-1.h b/src/s/aix3-1.h
index 8fe7bd8fa24..eedfe3d15be 100644
--- a/src/s/aix3-1.h
+++ b/src/s/aix3-1.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on IBM AIX version 3.1 1/* Definitions file for GNU Emacs running on IBM AIX version 3.1
2 Copyright (C) 1985, 1986, 1990, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1990, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/bsd4-1.h b/src/s/bsd4-1.h
index 7316841e212..f36bc016ca8 100644
--- a/src/s/bsd4-1.h
+++ b/src/s/bsd4-1.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on bsd 4.1. 1/* Definitions file for GNU Emacs running on bsd 4.1.
2 Copyright (C) 1985, 1986, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/bsd4-2.h b/src/s/bsd4-2.h
index 386ab1bbbe5..f4e60b0fdbd 100644
--- a/src/s/bsd4-2.h
+++ b/src/s/bsd4-2.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on bsd 4.2 1/* Definitions file for GNU Emacs running on bsd 4.2
2 Copyright (C) 1985, 1986, 1994 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1994, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/bsd4-3.h b/src/s/bsd4-3.h
index bbb2715bdf7..37d6a63e984 100644
--- a/src/s/bsd4-3.h
+++ b/src/s/bsd4-3.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on bsd 4.3 1/* Definitions file for GNU Emacs running on bsd 4.3
2 Copyright (C) 1985, 1986 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/cxux.h b/src/s/cxux.h
index 2af6d006095..118d93d579c 100644
--- a/src/s/cxux.h
+++ b/src/s/cxux.h
@@ -1,5 +1,5 @@
1/* Header file for Harris CXUX. 1/* Header file for Harris CXUX.
2 Copyright (C) 1994 Free Software Foundation, Inc. 2 Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/s/cygwin.h b/src/s/cygwin.h
index 0094ef793dc..921cff35bc7 100644
--- a/src/s/cygwin.h
+++ b/src/s/cygwin.h
@@ -1,7 +1,8 @@
1/* Template for system description header files. 1/* Template for system description header files.
2 This file describes the parameters that system description files 2 This file describes the parameters that system description files
3 should define or not. 3 should define or not.
4 Copyright (C) 1985, 1986, 1992, 1999 Free Software Foundation, Inc. 4 Copyright (C) 1985, 1986, 1992, 1999, 2002, 2003, 2004,
5 2005 Free Software Foundation, Inc.
5 6
6This file is part of GNU Emacs. 7This file is part of GNU Emacs.
7 8
@@ -123,8 +124,6 @@ Boston, MA 02110-1301, USA. */
123 emacs lisp pointers */ 124 emacs lisp pointers */
124#define DATA_SEG_BITS 0x20000000 125#define DATA_SEG_BITS 0x20000000
125#define LINKER $(CC) -Wl,--image-base,DATA_SEG_BITS 126#define LINKER $(CC) -Wl,--image-base,DATA_SEG_BITS
126/* gettext.h is in a strange place */
127#define C_SWITCH_SYSTEM -I/usr/share/gettext
128 127
129/* Use terminfo instead of termcap. Fewer environment variables to 128/* Use terminfo instead of termcap. Fewer environment variables to
130 go wrong, more terminal types. */ 129 go wrong, more terminal types. */
diff --git a/src/s/darwin.h b/src/s/darwin.h
index fea5b4c282d..fad445d7557 100644
--- a/src/s/darwin.h
+++ b/src/s/darwin.h
@@ -1,5 +1,5 @@
1/* System description header file for Darwin (Mac OS X). 1/* System description header file for Darwin (Mac OS X).
2 Copyright (C) 2001, 02, 2004 Free Software Foundation, Inc. 2 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/s/dgux.h b/src/s/dgux.h
index fb01b539f27..82956a900d9 100644
--- a/src/s/dgux.h
+++ b/src/s/dgux.h
@@ -1,6 +1,7 @@
1/* Definitions file for GNU Emacs running on Data General's DG/UX 1/* Definitions file for GNU Emacs running on Data General's DG/UX
2 version 4.32 upto and including 5.4.1. 2 version 4.32 upto and including 5.4.1.
3 Copyright (C) 1994, 1999 Free Software Foundation, Inc. 3 Copyright (C) 1994, 1999, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
diff --git a/src/s/dgux4.h b/src/s/dgux4.h
index d866d63e6ce..35834ad4da2 100644
--- a/src/s/dgux4.h
+++ b/src/s/dgux4.h
@@ -1,6 +1,6 @@
1/* Definitions file for GNU Emacs running on Data General's DG/UX 1/* Definitions file for GNU Emacs running on Data General's DG/UX
2 Release 4.10 and above. 2 Release 4.10 and above.
3 Copyright (C) 1996 Free Software Foundation, Inc. 3 Copyright (C) 1996, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/s/dgux5-4-3.h b/src/s/dgux5-4-3.h
index a95420595a1..7ec88a435eb 100644
--- a/src/s/dgux5-4-3.h
+++ b/src/s/dgux5-4-3.h
@@ -1,6 +1,6 @@
1/* Definitions file for GNU Emacs running on Data General's DG/UX 1/* Definitions file for GNU Emacs running on Data General's DG/UX
2 version 5.4 Release 3.00 and above. 2 version 5.4 Release 3.00 and above.
3 Copyright (C) 1994 Free Software Foundation, Inc. 3 Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/s/dgux5-4r2.h b/src/s/dgux5-4r2.h
index c2c7461a204..3f059c32c24 100644
--- a/src/s/dgux5-4r2.h
+++ b/src/s/dgux5-4r2.h
@@ -1,6 +1,6 @@
1/* Definitions file for GNU Emacs running on Data General's DG/UX 1/* Definitions file for GNU Emacs running on Data General's DG/UX
2 5.4 Release 2.xx systems. 2 5.4 Release 2.xx systems.
3 Copyright (C) 1994 Free Software Foundation, Inc. 3 Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/s/freebsd.h b/src/s/freebsd.h
index dc26eb9f399..83949fd2819 100644
--- a/src/s/freebsd.h
+++ b/src/s/freebsd.h
@@ -1,8 +1,8 @@
1/* System description header for FreeBSD systems. 1/* System description header for FreeBSD systems.
2 This file describes the parameters that system description files 2 This file describes the parameters that system description files
3 should define or not. 3 should define or not.
4 Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 4 Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5 Free Software Foundation, Inc. 5 2003, 2004, 2005 Free Software Foundation, Inc.
6 6
7This file is part of GNU Emacs. 7This file is part of GNU Emacs.
8 8
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h
index 2563496af5c..f87dcaded1b 100644
--- a/src/s/gnu-linux.h
+++ b/src/s/gnu-linux.h
@@ -1,5 +1,6 @@
1/* This file is the configuration file for Linux-based GNU systems 1/* This file is the configuration file for Linux-based GNU systems
2 Copyright (C) 1985, 86, 92, 94, 96, 1999, 2002, 2004 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/gnu.h b/src/s/gnu.h
index 79e5a88a7b9..0da816c32d3 100644
--- a/src/s/gnu.h
+++ b/src/s/gnu.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on the GNU Hurd. 1/* Definitions file for GNU Emacs running on the GNU Hurd.
2 Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. 2 Copyright (C) 1994, 1995, 1996, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/hpux.h b/src/s/hpux.h
index 665b1f3063d..30ade71bf20 100644
--- a/src/s/hpux.h
+++ b/src/s/hpux.h
@@ -1,6 +1,7 @@
1/* Definitions file for GNU Emacs running on HPUX release 7.0. 1/* Definitions file for GNU Emacs running on HPUX release 7.0.
2 Based on AT&T System V.2. 2 Based on AT&T System V.2.
3 Copyright (C) 1985, 1986, 1999 Free Software Foundation, Inc. 3 Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
diff --git a/src/s/iris3-5.h b/src/s/iris3-5.h
index 8815bb56f39..a3b6c8ad0ad 100644
--- a/src/s/iris3-5.h
+++ b/src/s/iris3-5.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on Silicon Graphics 3.5 1/* Definitions file for GNU Emacs running on Silicon Graphics 3.5
2 Copyright (C) 1987, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1987, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/iris3-6.h b/src/s/iris3-6.h
index 64187428c29..1d8b96cc23f 100644
--- a/src/s/iris3-6.h
+++ b/src/s/iris3-6.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on Silicon Graphics system 3.6. 1/* Definitions file for GNU Emacs running on Silicon Graphics system 3.6.
2 Copyright (C) 1987, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1987, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/irix3-3.h b/src/s/irix3-3.h
index 60dd6d49c79..a613779913a 100644
--- a/src/s/irix3-3.h
+++ b/src/s/irix3-3.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on Silicon Graphics Irix system 3.3. 1/* Definitions file for GNU Emacs running on Silicon Graphics Irix system 3.3.
2 Copyright (C) 1987, 1990, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1987, 1990, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/lynxos.h b/src/s/lynxos.h
index 55de8cba6f9..614735d290d 100644
--- a/src/s/lynxos.h
+++ b/src/s/lynxos.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on LynxOS-3.0.1 1/* Definitions file for GNU Emacs running on LynxOS-3.0.1
2 Copyright (C) 2000, 2001 Free Software Foundation, Inc. 2 Copyright (C) 2000, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index c4697db34db..b1989318fba 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -1,5 +1,6 @@
1/* System description file for Windows NT. 1/* System description file for Windows NT.
2 Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1994, 1995, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/msdos.h b/src/s/msdos.h
index 5a0cbba5959..9469b33227f 100644
--- a/src/s/msdos.h
+++ b/src/s/msdos.h
@@ -1,6 +1,7 @@
1/* System description file for MS-DOS 1/* System description file for MS-DOS
2 2
3 Copyright (C) 1993, 1996, 1997, 2001 Free Software Foundation, Inc. 3 Copyright (C) 1993, 1996, 1997, 2001, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
diff --git a/src/s/newsos5.h b/src/s/newsos5.h
index c674bfc559d..d2bed2189be 100644
--- a/src/s/newsos5.h
+++ b/src/s/newsos5.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on Sony's NEWS-OS 5.0.2 1/* Definitions file for GNU Emacs running on Sony's NEWS-OS 5.0.2
2 Copyright (C) 1992, 1994 Free Software Foundation, Inc. 2 Copyright (C) 1992, 1994, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/nextstep.h b/src/s/nextstep.h
index 9253e6acffc..0c0b01c10bd 100644
--- a/src/s/nextstep.h
+++ b/src/s/nextstep.h
@@ -1,5 +1,6 @@
1/* Configuration file for the NeXTstep system. 1/* Configuration file for the NeXTstep system.
2 Copyright (C) 1990, 1995 Free Software Foundation, Inc. 2 Copyright (C) 1990, 1995, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/ptx.h b/src/s/ptx.h
index e490ba659a2..1411dee70d8 100644
--- a/src/s/ptx.h
+++ b/src/s/ptx.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on Sequent DYNIX/ptx 1.x/2.x 1/* Definitions file for GNU Emacs running on Sequent DYNIX/ptx 1.x/2.x
2 Copyright (C) 1987, 1990, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1987, 1990, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/riscix1-1.h b/src/s/riscix1-1.h
index ccfa5704b85..aee5d6ddc58 100644
--- a/src/s/riscix1-1.h
+++ b/src/s/riscix1-1.h
@@ -1,5 +1,5 @@
1/* Definitions file for GNU Emacs running on RISCiX 1.1 (bsd 4.3) 1/* Definitions file for GNU Emacs running on RISCiX 1.1 (bsd 4.3)
2 Copyright (C) 1994 Free Software Foundation, Inc. 2 Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/s/riscix12.h b/src/s/riscix12.h
index b0e00e780cc..625b667d7b5 100644
--- a/src/s/riscix12.h
+++ b/src/s/riscix12.h
@@ -1,5 +1,5 @@
1/* Definitions file for GNU Emacs running on RISCiX 1.2 (bsd 4.3) 1/* Definitions file for GNU Emacs running on RISCiX 1.2 (bsd 4.3)
2 Copyright (C) 1994 Free Software Foundation, Inc. 2 Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/s/rtu.h b/src/s/rtu.h
index 92afbaf6328..b2d0c16e59a 100644
--- a/src/s/rtu.h
+++ b/src/s/rtu.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on RTU 3.0, ucb universe. 1/* Definitions file for GNU Emacs running on RTU 3.0, ucb universe.
2 Copyright (C) 1986, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1986, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/sco4.h b/src/s/sco4.h
index 757eb0b57b0..627007e9a52 100644
--- a/src/s/sco4.h
+++ b/src/s/sco4.h
@@ -1,5 +1,6 @@
1/* System description file for SCO 3.2v4. 1/* System description file for SCO 3.2v4.
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1994, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/sco5.h b/src/s/sco5.h
index e490a91b608..9fbbf072a12 100644
--- a/src/s/sco5.h
+++ b/src/s/sco5.h
@@ -1,5 +1,5 @@
1/* System description file for SCO 3.2v5. 1/* System description file for SCO 3.2v5.
2 Copyright (C) 1996, 2002 Free Software Foundation, Inc. 2 Copyright (C) 1996, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/s/template.h b/src/s/template.h
index 5ef1049164d..0610e16473a 100644
--- a/src/s/template.h
+++ b/src/s/template.h
@@ -1,7 +1,8 @@
1/* Template for system description header files. 1/* Template for system description header files.
2 This file describes the parameters that system description files 2 This file describes the parameters that system description files
3 should define or not. 3 should define or not.
4 Copyright (C) 1985, 1986, 1992, 1999 Free Software Foundation, Inc. 4 Copyright (C) 1985, 1986, 1992, 1999, 2002, 2003, 2004,
5 2005 Free Software Foundation, Inc.
5 6
6This file is part of GNU Emacs. 7This file is part of GNU Emacs.
7 8
diff --git a/src/s/umax.h b/src/s/umax.h
index 1741b1d04e3..f4923f33053 100644
--- a/src/s/umax.h
+++ b/src/s/umax.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on UMAX 4.2 1/* Definitions file for GNU Emacs running on UMAX 4.2
2 Copyright (C) 1985, 1986 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/unipl5-2.h b/src/s/unipl5-2.h
index 05d162239a8..cca703adb82 100644
--- a/src/s/unipl5-2.h
+++ b/src/s/unipl5-2.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on UniSoft's UniPlus 5.2 1/* Definitions file for GNU Emacs running on UniSoft's UniPlus 5.2
2 Copyright (C) 1985, 1986, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/usg5-0.h b/src/s/usg5-0.h
index 21b469dcd55..5f9943f8477 100644
--- a/src/s/usg5-0.h
+++ b/src/s/usg5-0.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on AT&T's System V.0 1/* Definitions file for GNU Emacs running on AT&T's System V.0
2 Copyright (C) 1985, 1986, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/usg5-2-2.h b/src/s/usg5-2-2.h
index dff90efb225..b090f3c32b6 100644
--- a/src/s/usg5-2-2.h
+++ b/src/s/usg5-2-2.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on AT&T's System V Release 2.2 1/* Definitions file for GNU Emacs running on AT&T's System V Release 2.2
2 Copyright (C) 1985, 1986, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/usg5-2.h b/src/s/usg5-2.h
index 0da477276fd..e63bddfc060 100644
--- a/src/s/usg5-2.h
+++ b/src/s/usg5-2.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on AT&T's System V Release 2.0 1/* Definitions file for GNU Emacs running on AT&T's System V Release 2.0
2 Copyright (C) 1985, 1986, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/usg5-3.h b/src/s/usg5-3.h
index 285bae670df..12259936928 100644
--- a/src/s/usg5-3.h
+++ b/src/s/usg5-3.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on AT&T's System V Release 3 1/* Definitions file for GNU Emacs running on AT&T's System V Release 3
2 Copyright (C) 1987, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1987, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/usg5-4.h b/src/s/usg5-4.h
index 4edda95b39c..b8c2f8d9fa2 100644
--- a/src/s/usg5-4.h
+++ b/src/s/usg5-4.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running on AT&T's System V Release 4 1/* Definitions file for GNU Emacs running on AT&T's System V Release 4
2 Copyright (C) 1987, 1990, 1999, 2000 Free Software Foundation, Inc. 2 Copyright (C) 1987, 1990, 1999, 2000, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/s/vms.h b/src/s/vms.h
index 9afd69b8539..e3c9dc725c0 100644
--- a/src/s/vms.h
+++ b/src/s/vms.h
@@ -1,5 +1,5 @@
1/* system description header for VMS 1/* system description header for VMS
2 Copyright (C) 1986 Free Software Foundation, Inc. 2 Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/s/xenix.h b/src/s/xenix.h
index 763a10956ff..e67b897faff 100644
--- a/src/s/xenix.h
+++ b/src/s/xenix.h
@@ -1,5 +1,6 @@
1/* Definitions file for GNU Emacs running SCO Xenix 386 Release 2.2 1/* Definitions file for GNU Emacs running SCO Xenix 386 Release 2.2
2 Copyright (C) 1988, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1988, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/scroll.c b/src/scroll.c
index f73f6f4fa80..04db528cc64 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -1,5 +1,6 @@
1/* Calculate what line insertion or deletion to do, and do it, 1/* Calculate what line insertion or deletion to do, and do it,
2 Copyright (C) 1985, 1986, 1990, 1993, 1994 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1990, 1993, 1994, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/search.c b/src/search.c
index 6beaa2d4186..aa7f6fda699 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1,6 +1,6 @@
1/* String search routines for GNU Emacs. 1/* String search routines for GNU Emacs.
2 Copyright (C) 1985, 86,87,93,94,97,98, 1999, 2004 2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1997, 1998, 1999, 2002, 2003,
3 Free Software Foundation, Inc. 3 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -3085,6 +3085,7 @@ syms_of_search ()
3085 searchbufs[i].regexp = Qnil; 3085 searchbufs[i].regexp = Qnil;
3086 searchbufs[i].whitespace_regexp = Qnil; 3086 searchbufs[i].whitespace_regexp = Qnil;
3087 staticpro (&searchbufs[i].regexp); 3087 staticpro (&searchbufs[i].regexp);
3088 staticpro (&searchbufs[i].whitespace_regexp);
3088 searchbufs[i].next = (i == REGEXP_CACHE_SIZE-1 ? 0 : &searchbufs[i+1]); 3089 searchbufs[i].next = (i == REGEXP_CACHE_SIZE-1 ? 0 : &searchbufs[i+1]);
3089 } 3090 }
3090 searchbuf_head = &searchbufs[0]; 3091 searchbuf_head = &searchbufs[0];
diff --git a/src/sheap.c b/src/sheap.c
index b7f01d448a8..635c3dc0144 100644
--- a/src/sheap.c
+++ b/src/sheap.c
@@ -1,8 +1,7 @@
1/* simulate sbrk() with an array in .bss, for unexec() support for Cygwin; 1/* simulate sbrk() with an array in .bss, for unexec() support for Cygwin;
2 complete rewrite of xemacs Cygwin unexec() code 2 complete rewrite of xemacs Cygwin unexec() code
3 3
4 Copyright (C) 2004 4 Copyright (C) 2004, 2005 Free Software Foundation, Inc.
5 Free Software Foundation, Inc.
6 5
7This file is part of GNU Emacs. 6This file is part of GNU Emacs.
8 7
diff --git a/src/sound.c b/src/sound.c
index 93e456cbc48..1e6a17d0275 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -1,5 +1,6 @@
1/* sound.c -- sound support. 1/* sound.c -- sound support.
2 Copyright (C) 1998, 1999, 2001 Free Software Foundation. 2 Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/strftime.c b/src/strftime.c
index 41566ec868e..88a54b7bee4 100644
--- a/src/strftime.c
+++ b/src/strftime.c
@@ -1,5 +1,5 @@
1/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,2003 1/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2 Free Software Foundation, Inc. 2 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4 NOTE: The canonical source of this file is maintained with gnulib. 4 NOTE: The canonical source of this file is maintained with gnulib.
5 Bugs can be reported to bug-gnulib@gnu.org. 5 Bugs can be reported to bug-gnulib@gnu.org.
diff --git a/src/sunfns.c b/src/sunfns.c
index 6a16e6cc08f..8de639b7480 100644
--- a/src/sunfns.c
+++ b/src/sunfns.c
@@ -1,5 +1,6 @@
1/* Functions for Sun Windows menus and selection buffer. 1/* Functions for Sun Windows menus and selection buffer.
2 Copyright (C) 1987, 1999, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1987, 1999, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is probably totally obsolete. In any case, the FSF is 5This file is probably totally obsolete. In any case, the FSF is
5unwilling to support it. We agreed to include it in our distribution 6unwilling to support it. We agreed to include it in our distribution
diff --git a/src/syntax.c b/src/syntax.c
index 480fa6de82a..2043cff63d6 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1,5 +1,6 @@
1/* GNU Emacs routines to deal with syntax tables; also word and list parsing. 1/* GNU Emacs routines to deal with syntax tables; also word and list parsing.
2 Copyright (C) 1985, 87, 93, 94, 95, 97, 1998, 1999, 2004 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2002,
3 2003, 2004, 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -132,7 +133,7 @@ update_syntax_table (charpos, count, init, object)
132{ 133{
133 Lisp_Object tmp_table; 134 Lisp_Object tmp_table;
134 int cnt = 0, invalidate = 1; 135 int cnt = 0, invalidate = 1;
135 INTERVAL i, oldi; 136 INTERVAL i;
136 137
137 if (init) 138 if (init)
138 { 139 {
@@ -163,7 +164,7 @@ update_syntax_table (charpos, count, init, object)
163 gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset; 164 gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset;
164 goto update; 165 goto update;
165 } 166 }
166 oldi = i = count > 0 ? gl_state.forward_i : gl_state.backward_i; 167 i = count > 0 ? gl_state.forward_i : gl_state.backward_i;
167 168
168 /* We are guaranteed to be called with CHARPOS either in i, 169 /* We are guaranteed to be called with CHARPOS either in i,
169 or further off. */ 170 or further off. */
@@ -248,7 +249,8 @@ update_syntax_table (charpos, count, init, object)
248 } 249 }
249 else 250 else
250 { 251 {
251 gl_state.b_property = i->position + LENGTH (i) - gl_state.offset; 252 gl_state.b_property
253 = i->position + LENGTH (i) - gl_state.offset;
252 gl_state.backward_i = i; 254 gl_state.backward_i = i;
253 } 255 }
254 return; 256 return;
@@ -257,7 +259,12 @@ update_syntax_table (charpos, count, init, object)
257 { 259 {
258 if (count > 0) 260 if (count > 0)
259 { 261 {
260 gl_state.e_property = i->position + LENGTH (i) - gl_state.offset; 262 gl_state.e_property
263 = i->position + LENGTH (i) - gl_state.offset
264 /* e_property at EOB is not set to ZV but to ZV+1, so that
265 we can do INC(from);UPDATE_SYNTAX_TABLE_FORWARD without
266 having to check eob between the two. */
267 + (NULL_INTERVAL_P (next_interval (i)) ? 1 : 0);
261 gl_state.forward_i = i; 268 gl_state.forward_i = i;
262 } 269 }
263 else 270 else
@@ -3168,6 +3175,14 @@ syms_of_syntax ()
3168 3175
3169 staticpro (&Vsyntax_code_object); 3176 staticpro (&Vsyntax_code_object);
3170 3177
3178 staticpro (&gl_state.object);
3179 staticpro (&gl_state.global_code);
3180 staticpro (&gl_state.current_syntax_table);
3181 staticpro (&gl_state.old_prop);
3182
3183 /* Defined in regex.c */
3184 staticpro (&re_match_object);
3185
3171 Qscan_error = intern ("scan-error"); 3186 Qscan_error = intern ("scan-error");
3172 staticpro (&Qscan_error); 3187 staticpro (&Qscan_error);
3173 Fput (Qscan_error, Qerror_conditions, 3188 Fput (Qscan_error, Qerror_conditions,
diff --git a/src/syntax.h b/src/syntax.h
index 581b4a783e0..c29e26c20b5 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -1,5 +1,6 @@
1/* Declarations having to do with GNU Emacs syntax tables. 1/* Declarations having to do with GNU Emacs syntax tables.
2 Copyright (C) 1985, 93, 94, 97, 1998 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1993, 1994, 1997, 1998, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/sysdep.c b/src/sysdep.c
index 7f0c363f7c4..9ffb167bdf0 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1,6 +1,6 @@
1/* Interfaces to system-dependent kernel and library entries. 1/* Interfaces to system-dependent kernel and library entries.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001,
3 2003, 2004, 2005 Free Software Foundation, Inc. 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/sysselect.h b/src/sysselect.h
index 0030e737bc2..d57527f9ed1 100644
--- a/src/sysselect.h
+++ b/src/sysselect.h
@@ -1,5 +1,5 @@
1/* sysselect.h - System-dependent definitions for the select function. 1/* sysselect.h - System-dependent definitions for the select function.
2 Copyright (C) 1995 Free Software Foundation, Inc. 2 Copyright (C) 1995, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/syssignal.h b/src/syssignal.h
index 2f8aa43f2f6..1e9c0dbb38a 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -1,5 +1,6 @@
1/* syssignal.h - System-dependent definitions for signals. 1/* syssignal.h - System-dependent definitions for signals.
2 Copyright (C) 1993, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/systime.h b/src/systime.h
index cf2bc0b084b..12d8d406d8e 100644
--- a/src/systime.h
+++ b/src/systime.h
@@ -1,5 +1,6 @@
1/* systime.h - System-dependent definitions for time manipulations. 1/* systime.h - System-dependent definitions for time manipulations.
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1994, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/systty.h b/src/systty.h
index b322ca60087..af9f5e3aa88 100644
--- a/src/systty.h
+++ b/src/systty.h
@@ -1,5 +1,6 @@
1/* systty.h - System-dependent definitions for terminals. 1/* systty.h - System-dependent definitions for terminals.
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1994, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/syswait.h b/src/syswait.h
index 78057e3fed4..37d59d68ac5 100644
--- a/src/syswait.h
+++ b/src/syswait.h
@@ -1,5 +1,6 @@
1/* Define wait system call interface for Emacs. 1/* Define wait system call interface for Emacs.
2 Copyright (C) 1993, 1994, 1995, 2000 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1994, 1995, 2000, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/term.c b/src/term.c
index e340edb6c17..77720779baf 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1,6 +1,6 @@
1/* Terminal control module for terminals described by TERMCAP 1/* Terminal control module for terminals described by TERMCAP
2 Copyright (C) 1985, 86, 87, 93, 94, 95, 98, 2000, 2001, 2002, 2005 2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1998, 2000, 2001,
3 Free Software Foundation, Inc. 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -245,6 +245,17 @@ tty_set_terminal_modes (struct device *display)
245 245
246 if (tty->output) 246 if (tty->output)
247 { 247 {
248 if (tty->TS_termcap_modes)
249 OUTPUT (tty, tty->TS_termcap_modes);
250 else
251 {
252 /* Output enough newlines to scroll all the old screen contents
253 off the screen, so it won't be overwritten and lost. */
254 int i;
255 for (i = 0; i < FRAME_LINES (XFRAME (selected_frame)); i++)
256 putchar ('\n');
257 }
258
248 OUTPUT_IF (tty, tty->TS_termcap_modes); 259 OUTPUT_IF (tty, tty->TS_termcap_modes);
249 OUTPUT_IF (tty, tty->TS_cursor_visible); 260 OUTPUT_IF (tty, tty->TS_cursor_visible);
250 OUTPUT_IF (tty, tty->TS_keypad_mode); 261 OUTPUT_IF (tty, tty->TS_keypad_mode);
@@ -1846,24 +1857,20 @@ turn_on_face (f, face_id)
1846 1857
1847 if (tty->TN_max_colors > 0) 1858 if (tty->TN_max_colors > 0)
1848 { 1859 {
1849 char *p; 1860 char *ts, *p;
1850 1861
1851 if (fg >= 0 && tty->TS_set_foreground) 1862 ts = tty->standout_mode ? tty->TS_set_background : tty->TS_set_foreground;
1863 if (fg >= 0 && ts)
1852 { 1864 {
1853 if (tty->standout_mode) 1865 p = tparam (ts, NULL, 0, (int) fg);
1854 p = tparam (tty->TS_set_background, NULL, 0, (int) fg);
1855 else
1856 p = tparam (tty->TS_set_foreground, NULL, 0, (int) fg);
1857 OUTPUT (tty, p); 1866 OUTPUT (tty, p);
1858 xfree (p); 1867 xfree (p);
1859 } 1868 }
1860 1869
1861 if (bg >= 0 && tty->TS_set_background) 1870 ts = tty->standout_mode ? tty->TS_set_foreground : tty->TS_set_background;
1871 if (bg >= 0 && ts)
1862 { 1872 {
1863 if (tty->standout_mode) 1873 p = tparam (ts, NULL, 0, (int) bg);
1864 p = tparam (tty->TS_set_foreground, NULL, 0, (int) bg);
1865 else
1866 p = tparam (tty->TS_set_background, NULL, 0, (int) bg);
1867 OUTPUT (tty, p); 1874 OUTPUT (tty, p);
1868 xfree (p); 1875 xfree (p);
1869 } 1876 }
diff --git a/src/termcap.c b/src/termcap.c
index 5f2fa55556a..2f6f324eada 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -1,6 +1,6 @@
1/* Work-alike for termcap, plus extra features. 1/* Work-alike for termcap, plus extra features.
2 Copyright (C) 1985, 86, 93, 94, 95, 2000, 2001 2 Copyright (C) 1985, 1986, 1993, 1994, 1995, 2000, 2001, 2002, 2003,
3 Free Software Foundation, Inc. 3 2004, 2005 Free Software Foundation, Inc.
4 4
5This program is free software; you can redistribute it and/or modify 5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by 6it under the terms of the GNU General Public License as published by
diff --git a/src/termchar.h b/src/termchar.h
index 1f6580b91f3..87072136317 100644
--- a/src/termchar.h
+++ b/src/termchar.h
@@ -1,5 +1,6 @@
1/* Flags and parameters describing terminal's characteristics. 1/* Flags and parameters describing terminal's characteristics.
2 Copyright (C) 1985, 1986 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/termhooks.h b/src/termhooks.h
index 5b411c6ab78..3fea7c366fb 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -1,5 +1,6 @@
1/* Parameters and display hooks for output devices 1/* Parameters and display hooks for output devices.
2 Copyright (C) 1985,86,93,94,2003 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1993, 1994, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/terminfo.c b/src/terminfo.c
index 8f040d10c68..5c0aa1ccf05 100644
--- a/src/terminfo.c
+++ b/src/terminfo.c
@@ -1,5 +1,6 @@
1/* Interface from Emacs to terminfo. 1/* Interface from Emacs to terminfo.
2 Copyright (C) 1985, 1986 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/termopts.h b/src/termopts.h
index 94d3f3bb9d7..2e5da3c9948 100644
--- a/src/termopts.h
+++ b/src/termopts.h
@@ -1,5 +1,6 @@
1/* Flags and parameters describing user options for handling the terminal. 1/* Flags and parameters describing user options for handling the terminal.
2 Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1990, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/textprop.c b/src/textprop.c
index 718051e38f2..fa9b0e498c5 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -1,6 +1,6 @@
1/* Interface code for dealing with text properties. 1/* Interface code for dealing with text properties.
2 Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004 2 Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003,
3 Free Software Foundation, Inc. 3 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -719,7 +719,7 @@ it finds a change in some text property, or the beginning or end of an
719overlay, and returns the position of that. 719overlay, and returns the position of that.
720If none is found, the function returns (point-max). 720If none is found, the function returns (point-max).
721 721
722If the optional third argument LIMIT is non-nil, don't search 722If the optional second argument LIMIT is non-nil, don't search
723past position LIMIT; return LIMIT if nothing is found before LIMIT. */) 723past position LIMIT; return LIMIT if nothing is found before LIMIT. */)
724 (position, limit) 724 (position, limit)
725 Lisp_Object position, limit; 725 Lisp_Object position, limit;
@@ -744,7 +744,7 @@ finds a change in some text property, or the beginning or end of an
744overlay, and returns the position of that. 744overlay, and returns the position of that.
745If none is found, the function returns (point-max). 745If none is found, the function returns (point-max).
746 746
747If the optional third argument LIMIT is non-nil, don't search 747If the optional second argument LIMIT is non-nil, don't search
748past position LIMIT; return LIMIT if nothing is found before LIMIT. */) 748past position LIMIT; return LIMIT if nothing is found before LIMIT. */)
749 (position, limit) 749 (position, limit)
750 Lisp_Object position, limit; 750 Lisp_Object position, limit;
diff --git a/src/tparam.c b/src/tparam.c
index e05f01f4911..e593589d5cb 100644
--- a/src/tparam.c
+++ b/src/tparam.c
@@ -1,5 +1,6 @@
1/* Merge parameters into a termcap entry string. 1/* Merge parameters into a termcap entry string.
2 Copyright (C) 1985, 87, 93, 95, 2000 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1987, 1993, 1995, 2000, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This program is free software; you can redistribute it and/or modify 5This program is free software; you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by 6it under the terms of the GNU General Public License as published by
diff --git a/src/uaf.h b/src/uaf.h
index 71ae7267147..7863c41227e 100644
--- a/src/uaf.h
+++ b/src/uaf.h
@@ -1,5 +1,5 @@
1/* GNU Emacs VMS UAF definition file. 1/* GNU Emacs VMS UAF definition file.
2 Copyright (C) 1986 Free Software Foundation, Inc. 2 Copyright (C) 1986, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/undo.c b/src/undo.c
index 13ee40130a9..9839906ca7e 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -1,6 +1,6 @@
1/* undo handling for GNU Emacs. 1/* undo handling for GNU Emacs.
2 Copyright (C) 1990, 1993, 1994, 2000, 2002, 2004, 2005 2 Copyright (C) 1990, 1993, 1994, 2000, 2002, 2003, 2004,
3 Free Software Foundation, Inc. 3 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/unexaix.c b/src/unexaix.c
index 4c9f2727e88..071f09898ed 100644
--- a/src/unexaix.c
+++ b/src/unexaix.c
@@ -1,5 +1,6 @@
1/* Dump an executable image. 1/* Dump an executable image.
2 Copyright (C) 1985, 1986, 1987, 1988, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1987, 1988, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/unexalpha.c b/src/unexalpha.c
index aa32f411fcb..069c39b398b 100644
--- a/src/unexalpha.c
+++ b/src/unexalpha.c
@@ -1,6 +1,7 @@
1/* Unexec for DEC alpha. schoepf@sc.ZIB-Berlin.DE (Rainer Schoepf). 1/* Unexec for DEC alpha. schoepf@sc.ZIB-Berlin.DE (Rainer Schoepf).
2 2
3 Copyright (C) 1994, 2000 Free Software Foundation, Inc. 3 Copyright (C) 1994, 2000, 2002, 2003, 2004,
4 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
diff --git a/src/unexapollo.c b/src/unexapollo.c
index d9bff963695..f1481d684a3 100644
--- a/src/unexapollo.c
+++ b/src/unexapollo.c
@@ -1,5 +1,6 @@
1/* unexapollo.c -- COFF File UNEXEC for GNU Emacs on Apollo SR10.x 1/* unexapollo.c -- COFF File UNEXEC for GNU Emacs on Apollo SR10.x
2 Copyright (C) 1988, 1994 Free Software Foundation, Inc. 2 Copyright (C) 1988, 1994, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/unexconvex.c b/src/unexconvex.c
index cbd1dd29fda..6f05e4ae938 100644
--- a/src/unexconvex.c
+++ b/src/unexconvex.c
@@ -7,7 +7,8 @@
7 think about it, or about whether other Emacs maintenance might 7 think about it, or about whether other Emacs maintenance might
8 break it. 8 break it.
9 9
10 Copyright (C) 1985, 1986, 1988 Free Software Foundation, Inc. 10 Copyright (C) 1985, 1986, 1988, 2002, 2003, 2004,
11 2005 Free Software Foundation, Inc.
11 12
12This file is part of GNU Emacs. 13This file is part of GNU Emacs.
13 14
diff --git a/src/unexcw.c b/src/unexcw.c
index 77d5866136b..cfd87781a16 100644
--- a/src/unexcw.c
+++ b/src/unexcw.c
@@ -1,8 +1,7 @@
1/* unexec() support for Cygwin; 1/* unexec() support for Cygwin;
2 complete rewrite of xemacs Cygwin unexec() code 2 complete rewrite of xemacs Cygwin unexec() code
3 3
4 Copyright (C) 2004 4 Copyright (C) 2004, 2005 Free Software Foundation, Inc.
5 Free Software Foundation, Inc.
6 5
7This file is part of GNU Emacs. 6This file is part of GNU Emacs.
8 7
diff --git a/src/unexec.c b/src/unexec.c
index bf231b00626..ebf813306da 100644
--- a/src/unexec.c
+++ b/src/unexec.c
@@ -1,4 +1,5 @@
1/* Copyright (C) 1985,86,87,88,92,93,94 Free Software Foundation, Inc. 1/* Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 2002, 2003, 2004,
2 2005 Free Software Foundation, Inc.
2 3
3This file is part of GNU Emacs. 4This file is part of GNU Emacs.
4 5
diff --git a/src/unexelf.c b/src/unexelf.c
index 9e8b827a754..ee563b36a97 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -1,5 +1,5 @@
1/* Copyright (C) 1985,86,87,88,90,92,1999,2000,01,2003 1/* Copyright (C) 1985, 1986, 1987, 1988, 1990, 1992, 1999, 2000, 2001,
2 Free Software Foundation, Inc. 2 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/unexenix.c b/src/unexenix.c
index 94ac3eb821d..159c0b2f6d8 100644
--- a/src/unexenix.c
+++ b/src/unexenix.c
@@ -6,7 +6,8 @@
6 we don't plan to think about it, or about whether other Emacs 6 we don't plan to think about it, or about whether other Emacs
7 maintenance might break it. 7 maintenance might break it.
8 8
9 Copyright (C) 1988, 1994 Free Software Foundation, Inc. 9 Copyright (C) 1988, 1994, 2002, 2003, 2004,
10 2005 Free Software Foundation, Inc.
10 11
11This file is part of GNU Emacs. 12This file is part of GNU Emacs.
12 13
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index a191c0721e5..9db9622f6f5 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -1,5 +1,5 @@
1/* Dump Emacs in Mach-O format for use on Mac OS X. 1/* Dump Emacs in Mach-O format for use on Mac OS X.
2 Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc. 2 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/unexmips.c b/src/unexmips.c
index 53b40f62742..212f7ed5926 100644
--- a/src/unexmips.c
+++ b/src/unexmips.c
@@ -6,7 +6,8 @@
6 we don't plan to think about it, or about whether other Emacs 6 we don't plan to think about it, or about whether other Emacs
7 maintenance might break it. 7 maintenance might break it.
8 8
9 Copyright (C) 1988, 1994 Free Software Foundation, Inc. 9 Copyright (C) 1988, 1994, 2002, 2003, 2004,
10 2005 Free Software Foundation, Inc.
10 11
11This file is part of GNU Emacs. 12This file is part of GNU Emacs.
12 13
diff --git a/src/unexnext.c b/src/unexnext.c
index 2a0b66bc868..b374dd8e9b8 100644
--- a/src/unexnext.c
+++ b/src/unexnext.c
@@ -1,5 +1,6 @@
1/* Dump Emacs in macho format. 1/* Dump Emacs in macho format.
2 Copyright (C) 1990, 1993 Free Software Foundation, Inc. 2 Copyright (C) 1990, 1993, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 Written by Bradley Taylor (btaylor@next.com). 4 Written by Bradley Taylor (btaylor@next.com).
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
diff --git a/src/unexsni.c b/src/unexsni.c
index 0c67af899d5..d6b3ae68969 100644
--- a/src/unexsni.c
+++ b/src/unexsni.c
@@ -1,6 +1,6 @@
1/* Unexec for Siemens machines running Sinix (modified SVR4). 1/* Unexec for Siemens machines running Sinix (modified SVR4).
2 Copyright (C) 1985, 1986, 1987, 1988, 1990, 1992, 1993, 1994, 1995 2 Copyright (C) 1985, 1986, 1987, 1988, 1990, 1992, 1993, 1994, 1995, 2002,
3 Free Software Foundation, Inc. 3 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/unexsunos4.c b/src/unexsunos4.c
index 9ad06b6adaf..5e221050f36 100644
--- a/src/unexsunos4.c
+++ b/src/unexsunos4.c
@@ -1,5 +1,6 @@
1/* Unexec for Sunos 4 using shared libraries. 1/* Unexec for Sunos 4 using shared libraries.
2 Copyright (C) 1990, 1994, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1990, 1994, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/unexw32.c b/src/unexw32.c
index 5380ca5c8f7..bc462c18a10 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -1,5 +1,5 @@
1/* unexec for GNU Emacs on Windows NT. 1/* unexec for GNU Emacs on Windows NT.
2 Copyright (C) 1994, 2005 Free Software Foundation, Inc. 2 Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/vm-limit.c b/src/vm-limit.c
index 1840eb61c0c..0c12dec9b04 100644
--- a/src/vm-limit.c
+++ b/src/vm-limit.c
@@ -1,5 +1,6 @@
1/* Functions for memory limit warnings. 1/* Functions for memory limit warnings.
2 Copyright (C) 1990, 1992 Free Software Foundation, Inc. 2 Copyright (C) 1990, 1992, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/w16select.c b/src/w16select.c
index 406f0a1b884..b0c30eb58d8 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -1,5 +1,6 @@
1/* 16-bit Windows Selection processing for emacs on MS-Windows 1/* 16-bit Windows Selection processing for emacs on MS-Windows
2 Copyright (C) 1996, 1997, 2001 Free Software Foundation. 2 Copyright (C) 1996, 1997, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/w32.c b/src/w32.c
index 77959037913..c7f6e3172f9 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -1,5 +1,6 @@
1/* Utility and Unix shadow routines for GNU Emacs on the Microsoft W32 API. 1/* Utility and Unix shadow routines for GNU Emacs on the Microsoft W32 API.
2 Copyright (C) 1994, 1995, 2000, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1994, 1995, 2000, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -20,8 +21,6 @@ Boston, MA 02110-1301, USA.
20 21
21 Geoff Voelker (voelker@cs.washington.edu) 7-29-94 22 Geoff Voelker (voelker@cs.washington.edu) 7-29-94
22*/ 23*/
23
24
25#include <stddef.h> /* for offsetof */ 24#include <stddef.h> /* for offsetof */
26#include <stdlib.h> 25#include <stdlib.h>
27#include <stdio.h> 26#include <stdio.h>
@@ -73,6 +72,7 @@ Boston, MA 02110-1301, USA.
73#define _ANONYMOUS_STRUCT 72#define _ANONYMOUS_STRUCT
74#endif 73#endif
75#include <windows.h> 74#include <windows.h>
75#include <shlobj.h>
76 76
77#ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */ 77#ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */
78#include <sys/socket.h> 78#include <sys/socket.h>
@@ -100,6 +100,9 @@ Boston, MA 02110-1301, USA.
100#include "w32heap.h" 100#include "w32heap.h"
101#include "systime.h" 101#include "systime.h"
102 102
103typedef HRESULT (WINAPI * ShGetFolderPath_fn)
104 (IN HWND, IN int, IN HANDLE, IN DWORD, OUT char *);
105
103void globals_of_w32 (); 106void globals_of_w32 ();
104 107
105extern Lisp_Object Vw32_downcase_file_names; 108extern Lisp_Object Vw32_downcase_file_names;
@@ -903,7 +906,9 @@ init_environment (char ** argv)
903 static const char * const tempdirs[] = { 906 static const char * const tempdirs[] = {
904 "$TMPDIR", "$TEMP", "$TMP", "c:/" 907 "$TMPDIR", "$TEMP", "$TMP", "c:/"
905 }; 908 };
909
906 int i; 910 int i;
911
907 const int imax = sizeof (tempdirs) / sizeof (tempdirs[0]); 912 const int imax = sizeof (tempdirs) / sizeof (tempdirs[0]);
908 913
909 /* Make sure they have a usable $TMPDIR. Many Emacs functions use 914 /* Make sure they have a usable $TMPDIR. Many Emacs functions use
@@ -942,6 +947,8 @@ init_environment (char ** argv)
942 LPBYTE lpval; 947 LPBYTE lpval;
943 DWORD dwType; 948 DWORD dwType;
944 char locale_name[32]; 949 char locale_name[32];
950 struct stat ignored;
951 char default_home[MAX_PATH];
945 952
946 static struct env_entry 953 static struct env_entry
947 { 954 {
@@ -964,6 +971,35 @@ init_environment (char ** argv)
964 {"LANG", NULL}, 971 {"LANG", NULL},
965 }; 972 };
966 973
974 /* For backwards compatibility, check if a .emacs file exists in C:/
975 If not, then we can try to default to the appdata directory under the
976 user's profile, which is more likely to be writable. */
977 if (stat ("C:/.emacs", &ignored) < 0)
978 {
979 HRESULT profile_result;
980 /* Dynamically load ShGetFolderPath, as it won't exist on versions
981 of Windows 95 and NT4 that have not been updated to include
982 MSIE 5. Also we don't link with shell32.dll by default. */
983 HMODULE shell32_dll;
984 ShGetFolderPath_fn get_folder_path;
985 shell32_dll = GetModuleHandle ("shell32.dll");
986 get_folder_path = (ShGetFolderPath_fn)
987 GetProcAddress (shell32_dll, "SHGetFolderPathA");
988
989 if (get_folder_path != NULL)
990 {
991 profile_result = get_folder_path (NULL, CSIDL_APPDATA, NULL,
992 0, default_home);
993
994 /* If we can't get the appdata dir, revert to old behaviour. */
995 if (profile_result == S_OK)
996 env_vars[0].def_value = default_home;
997 }
998
999 /* Unload shell32.dll, it is not needed anymore. */
1000 FreeLibrary (shell32_dll);
1001 }
1002
967 /* Get default locale info and use it for LANG. */ 1003 /* Get default locale info and use it for LANG. */
968 if (GetLocaleInfo (LOCALE_USER_DEFAULT, 1004 if (GetLocaleInfo (LOCALE_USER_DEFAULT,
969 LOCALE_SABBREVLANGNAME | LOCALE_USE_CP_ACP, 1005 LOCALE_SABBREVLANGNAME | LOCALE_USE_CP_ACP,
diff --git a/src/w32.h b/src/w32.h
index 622a2256f0f..2981e5bb979 100644
--- a/src/w32.h
+++ b/src/w32.h
@@ -2,7 +2,7 @@
2#define EMACS_W32_H 2#define EMACS_W32_H
3 3
4/* Support routines for the NT version of Emacs. 4/* Support routines for the NT version of Emacs.
5 Copyright (C) 1994 Free Software Foundation, Inc. 5 Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
6 6
7This file is part of GNU Emacs. 7This file is part of GNU Emacs.
8 8
diff --git a/src/w32bdf.c b/src/w32bdf.c
index e8612c7b5d6..10780f2f0c9 100644
--- a/src/w32bdf.c
+++ b/src/w32bdf.c
@@ -1,5 +1,5 @@
1/* Implementation of BDF font handling on the Microsoft W32 API. 1/* Implementation of BDF font handling on the Microsoft W32 API.
2 Copyright (C) 1999 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32bdf.h b/src/w32bdf.h
index ca8a5f368cb..9d3d306d56f 100644
--- a/src/w32bdf.h
+++ b/src/w32bdf.h
@@ -1,5 +1,5 @@
1/* Definitions and header for handling BDF fonts on the Microsoft W32 API. 1/* Definitions and header for handling BDF fonts on the Microsoft W32 API.
2 Copyright (C) 1999 Free Software Foundation, Inc. 2 Copyright (C) 1999, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32console.c b/src/w32console.c
index 0ebda179667..a81591fb96f 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -1,5 +1,6 @@
1/* Terminal hooks for GNU Emacs on the Microsoft W32 API. 1/* Terminal hooks for GNU Emacs on the Microsoft W32 API.
2 Copyright (C) 1992, 1999 Free Software Foundation, Inc. 2 Copyright (C) 1992, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/w32fns.c b/src/w32fns.c
index eedc06dda12..93469418137 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1,6 +1,6 @@
1/* Graphical user interface functions for the Microsoft W32 API. 1/* Graphical user interface functions for the Microsoft W32 API.
2 Copyright (C) 1989, 1992, 93, 94, 95, 96, 97, 98, 99, 2000, 01, 04 2 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3 Free Software Foundation, Inc. 3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -153,7 +153,7 @@ int display_hourglass_p;
153 over text or in the modeline. */ 153 over text or in the modeline. */
154 154
155Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape; 155Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape;
156Lisp_Object Vx_hourglass_pointer_shape, Vx_window_horizontal_drag_shape, Vx_hand_shape; 156Lisp_Object Vx_hourglass_pointer_shape, Vx_window_horizontal_drag_shape;
157 157
158/* The shape when over mouse-sensitive text. */ 158/* The shape when over mouse-sensitive text. */
159 159
@@ -395,10 +395,10 @@ x_window_to_frame (dpyinfo, wdesc)
395} 395}
396 396
397 397
398BOOL my_show_window P_ ((struct frame *, HWND, int));
399void my_set_window_pos P_ ((HWND, HWND, int, int, int, int, UINT));
400static Lisp_Object unwind_create_frame P_ ((Lisp_Object)); 398static Lisp_Object unwind_create_frame P_ ((Lisp_Object));
401static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object)); 399static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object));
400static void my_create_window P_ ((struct frame *));
401static void my_create_tip_window P_ ((struct frame *));
402 402
403/* TODO: Native Input Method support; see x_create_im. */ 403/* TODO: Native Input Method support; see x_create_im. */
404void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 404void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
@@ -3847,7 +3847,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
3847 return 0; 3847 return 0;
3848} 3848}
3849 3849
3850void 3850static void
3851my_create_window (f) 3851my_create_window (f)
3852 struct frame * f; 3852 struct frame * f;
3853{ 3853{
@@ -3863,7 +3863,7 @@ my_create_window (f)
3863 indirectly via the Window thread, as we do not need to process Window 3863 indirectly via the Window thread, as we do not need to process Window
3864 messages for the tooltip. Creating tooltips indirectly also creates 3864 messages for the tooltip. Creating tooltips indirectly also creates
3865 deadlocks when tooltips are created for menu items. */ 3865 deadlocks when tooltips are created for menu items. */
3866void 3866static void
3867my_create_tip_window (f) 3867my_create_tip_window (f)
3868 struct frame *f; 3868 struct frame *f;
3869{ 3869{
@@ -8760,6 +8760,8 @@ versions of Windows) characters. */);
8760 staticpro (&Qw32_charset_ansi); 8760 staticpro (&Qw32_charset_ansi);
8761 Qw32_charset_ansi = intern ("w32-charset-ansi"); 8761 Qw32_charset_ansi = intern ("w32-charset-ansi");
8762 staticpro (&Qw32_charset_symbol); 8762 staticpro (&Qw32_charset_symbol);
8763 Qw32_charset_default = intern ("w32-charset-default");
8764 staticpro (&Qw32_charset_default);
8763 Qw32_charset_symbol = intern ("w32-charset-symbol"); 8765 Qw32_charset_symbol = intern ("w32-charset-symbol");
8764 staticpro (&Qw32_charset_shiftjis); 8766 staticpro (&Qw32_charset_shiftjis);
8765 Qw32_charset_shiftjis = intern ("w32-charset-shiftjis"); 8767 Qw32_charset_shiftjis = intern ("w32-charset-shiftjis");
diff --git a/src/w32gui.h b/src/w32gui.h
index 1fd145cd026..644adcea924 100644
--- a/src/w32gui.h
+++ b/src/w32gui.h
@@ -1,5 +1,5 @@
1/* Definitions and headers for communication on the Microsoft W32 API. 1/* Definitions and headers for communication on the Microsoft W32 API.
2 Copyright (C) 1995 Free Software Foundation, Inc. 2 Copyright (C) 1995, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32heap.c b/src/w32heap.c
index 7de08bb2b4e..a0c50da5506 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -1,5 +1,5 @@
1/* Heap management routines for GNU Emacs on the Microsoft W32 API. 1/* Heap management routines for GNU Emacs on the Microsoft W32 API.
2 Copyright (C) 1994 Free Software Foundation, Inc. 2 Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32heap.h b/src/w32heap.h
index 259d0bf9ede..1b3b815b115 100644
--- a/src/w32heap.h
+++ b/src/w32heap.h
@@ -1,5 +1,5 @@
1/* Heap management routines (including unexec) for GNU Emacs on Windows NT. 1/* Heap management routines (including unexec) for GNU Emacs on Windows NT.
2 Copyright (C) 1994 Free Software Foundation, Inc. 2 Copyright (C) 1994, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32inevt.c b/src/w32inevt.c
index cc7c5e1e612..ffa2cd0989a 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -1,5 +1,6 @@
1/* Input event support for Emacs on the Microsoft W32 API. 1/* Input event support for Emacs on the Microsoft W32 API.
2 Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc. 2 Copyright (C) 1992, 1993, 1995, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/w32inevt.h b/src/w32inevt.h
index f811c96c313..e0a9428720f 100644
--- a/src/w32inevt.h
+++ b/src/w32inevt.h
@@ -1,5 +1,5 @@
1/* Input routines for GNU Emacs on the Microsoft W32 API. 1/* Input routines for GNU Emacs on the Microsoft W32 API.
2 Copyright (C) 1995 Free Software Foundation, Inc. 2 Copyright (C) 1995, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/w32menu.c b/src/w32menu.c
index 065355f8755..d441d14b259 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -1,5 +1,6 @@
1/* Menu support for GNU Emacs on the Microsoft W32 API. 1/* Menu support for GNU Emacs on the Microsoft W32 API.
2 Copyright (C) 1986,88,93,94,96,98,1999,2003 Free Software Foundation, Inc. 2 Copyright (C) 1986, 1988, 1993, 1994, 1996, 1998, 1999, 2002, 2003,
3 2004, 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -2320,7 +2321,23 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item)
2320 item != NULL ? (UINT) item 2321 item != NULL ? (UINT) item
2321 : (UINT) wv->call_data, 2322 : (UINT) wv->call_data,
2322 utf16_string); 2323 utf16_string);
2323 if (fuFlags & MF_OWNERDRAW) 2324 if (!return_value)
2325 {
2326 /* On W9x/ME, unicode menus are not supported, though AppendMenuW
2327 apparently does exist at least in some cases and appears to be
2328 stubbed out to do nothing. out_string is UTF-8, but since
2329 our standard menus are in English and this is only going to
2330 happen the first time a menu is used, the encoding is
2331 of minor importance compared with menus not working at all. */
2332 return_value =
2333 AppendMenu (menu, fuFlags,
2334 item != NULL ? (UINT) item: (UINT) wv->call_data,
2335 out_string);
2336 /* Don't use unicode menus in future. */
2337 unicode_append_menu = NULL;
2338 }
2339
2340 if (unicode_append_menu && (fuFlags & MF_OWNERDRAW))
2324 local_free (out_string); 2341 local_free (out_string);
2325 } 2342 }
2326 else 2343 else
@@ -2418,8 +2435,11 @@ w32_menu_display_help (HWND owner, HMENU menu, UINT item, UINT flags)
2418 struct frame *f = x_window_to_frame (&one_w32_display_info, owner); 2435 struct frame *f = x_window_to_frame (&one_w32_display_info, owner);
2419 Lisp_Object frame, help; 2436 Lisp_Object frame, help;
2420 2437
2421 /* No help echo on owner-draw menu items. */ 2438 /* No help echo on owner-draw menu items, or when the keyboard is used
2422 if (flags & MF_OWNERDRAW || flags & MF_POPUP) 2439 to navigate the menus, since tooltips are distracting if they pop
2440 up elsewhere. */
2441 if (flags & MF_OWNERDRAW || flags & MF_POPUP
2442 || !(flags & MF_MOUSESELECT))
2423 help = Qnil; 2443 help = Qnil;
2424 else 2444 else
2425 { 2445 {
diff --git a/src/w32proc.c b/src/w32proc.c
index 0e3f8f2fd47..628a763c675 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -1,5 +1,6 @@
1/* Process support for GNU Emacs on the Microsoft W32 API. 1/* Process support for GNU Emacs on the Microsoft W32 API.
2 Copyright (C) 1992, 95, 99, 2000, 01, 04 Free Software Foundation, Inc. 2 Copyright (C) 1992, 1995, 1999, 2000, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -2146,6 +2147,8 @@ syms_of_ntproc ()
2146{ 2147{
2147 Qhigh = intern ("high"); 2148 Qhigh = intern ("high");
2148 Qlow = intern ("low"); 2149 Qlow = intern ("low");
2150 staticpro (&Qhigh);
2151 staticpro (&Qlow);
2149 2152
2150#ifdef HAVE_SOCKETS 2153#ifdef HAVE_SOCKETS
2151 defsubr (&Sw32_has_winsock); 2154 defsubr (&Sw32_has_winsock);
@@ -2241,6 +2244,9 @@ the truename of a file can be slow. */);
2241Note that this option is only useful for files on NTFS volumes, where hard links 2244Note that this option is only useful for files on NTFS volumes, where hard links
2242are supported. Moreover, it slows down `file-attributes' noticeably. */); 2245are supported. Moreover, it slows down `file-attributes' noticeably. */);
2243 Vw32_get_true_file_attributes = Qt; 2246 Vw32_get_true_file_attributes = Qt;
2247
2248 staticpro (&Vw32_valid_locale_ids);
2249 staticpro (&Vw32_valid_codepages);
2244} 2250}
2245/* end of ntproc.c */ 2251/* end of ntproc.c */
2246 2252
diff --git a/src/w32reg.c b/src/w32reg.c
index a70835ac303..40d84df3d14 100644
--- a/src/w32reg.c
+++ b/src/w32reg.c
@@ -1,5 +1,6 @@
1/* Emulate the X Resource Manager through the registry. 1/* Emulate the X Resource Manager through the registry.
2 Copyright (C) 1990, 1993, 1994 Free Software Foundation. 2 Copyright (C) 1990, 1993, 1994, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/w32select.c b/src/w32select.c
index db29c078149..3556c62a35f 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -1,5 +1,6 @@
1/* Selection processing for Emacs on the Microsoft W32 API. 1/* Selection processing for Emacs on the Microsoft W32 API.
2 Copyright (C) 1993, 1994, 2004 Free Software Foundation. 2 Copyright (C) 1993, 1994, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/w32term.c b/src/w32term.c
index abf8e377ef1..4e7ed968b8d 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1,6 +1,6 @@
1/* Implementation of GUI terminal on the Microsoft W32 API. 1/* Implementation of GUI terminal on the Microsoft W32 API.
2 Copyright (C) 1989, 93, 94, 95, 96, 1997, 1998, 1999, 2000, 2001 2 Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
3 Free Software Foundation, Inc. 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -272,6 +272,11 @@ static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
272static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int, 272static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int,
273 enum text_cursor_kinds)); 273 enum text_cursor_kinds));
274static void w32_clip_to_row P_ ((struct window *, struct glyph_row *, int, HDC)); 274static void w32_clip_to_row P_ ((struct window *, struct glyph_row *, int, HDC));
275static BOOL my_show_window P_ ((struct frame *, HWND, int));
276static void my_set_window_pos P_ ((HWND, HWND, int, int, int, int, UINT));
277static void my_set_focus P_ ((struct frame *, HWND));
278static void my_set_foreground_window P_ ((HWND));
279static void my_destroy_window P_ ((struct frame *, HWND));
275 280
276static Lisp_Object Qvendor_specific_keysyms; 281static Lisp_Object Qvendor_specific_keysyms;
277 282
@@ -3632,7 +3637,7 @@ my_create_scrollbar (f, bar)
3632 3637
3633/*#define ATTACH_THREADS*/ 3638/*#define ATTACH_THREADS*/
3634 3639
3635BOOL 3640static BOOL
3636my_show_window (FRAME_PTR f, HWND hwnd, int how) 3641my_show_window (FRAME_PTR f, HWND hwnd, int how)
3637{ 3642{
3638#ifndef ATTACH_THREADS 3643#ifndef ATTACH_THREADS
@@ -3643,7 +3648,7 @@ my_show_window (FRAME_PTR f, HWND hwnd, int how)
3643#endif 3648#endif
3644} 3649}
3645 3650
3646void 3651static void
3647my_set_window_pos (HWND hwnd, HWND hwndAfter, 3652my_set_window_pos (HWND hwnd, HWND hwndAfter,
3648 int x, int y, int cx, int cy, UINT flags) 3653 int x, int y, int cx, int cy, UINT flags)
3649{ 3654{
@@ -3661,7 +3666,7 @@ my_set_window_pos (HWND hwnd, HWND hwndAfter,
3661#endif 3666#endif
3662} 3667}
3663 3668
3664void 3669static void
3665my_set_focus (f, hwnd) 3670my_set_focus (f, hwnd)
3666 struct frame * f; 3671 struct frame * f;
3667 HWND hwnd; 3672 HWND hwnd;
@@ -3670,14 +3675,15 @@ my_set_focus (f, hwnd)
3670 (WPARAM) hwnd, 0); 3675 (WPARAM) hwnd, 0);
3671} 3676}
3672 3677
3673void 3678static void
3674my_set_foreground_window (hwnd) 3679my_set_foreground_window (hwnd)
3675 HWND hwnd; 3680 HWND hwnd;
3676{ 3681{
3677 SendMessage (hwnd, WM_EMACS_SETFOREGROUND, (WPARAM) hwnd, 0); 3682 SendMessage (hwnd, WM_EMACS_SETFOREGROUND, (WPARAM) hwnd, 0);
3678} 3683}
3679 3684
3680void 3685
3686static void
3681my_destroy_window (f, hwnd) 3687my_destroy_window (f, hwnd)
3682 struct frame * f; 3688 struct frame * f;
3683 HWND hwnd; 3689 HWND hwnd;
diff --git a/src/w32term.h b/src/w32term.h
index 1557a45653f..34932c44d3b 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -1,5 +1,6 @@
1/* Definitions and headers for communication on the Microsoft W32 API. 1/* Definitions and headers for communication on the Microsoft W32 API.
2 Copyright (C) 1995, 2001 Free Software Foundation, Inc. 2 Copyright (C) 1995, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/w32xfns.c b/src/w32xfns.c
index ba705d9498d..46a71b942c7 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -1,5 +1,6 @@
1/* Functions taken directly from X sources for use with the Microsoft W32 API. 1/* Functions taken directly from X sources for use with the Microsoft W32 API.
2 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1999 Free Software Foundation. 2 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1999, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/widget.c b/src/widget.c
index fdd927cb175..0386890d93b 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -1,5 +1,6 @@
1/* The emacs frame widget. 1/* The emacs frame widget.
2 Copyright (C) 1992, 1993, 2000 Free Software Foundation, Inc. 2 Copyright (C) 1992, 1993, 2000, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/widget.h b/src/widget.h
index 174a6a720de..00d743234c0 100644
--- a/src/widget.h
+++ b/src/widget.h
@@ -1,5 +1,5 @@
1/* The emacs frame widget public header file. 1/* The emacs frame widget public header file.
2 Copyright (C) 1993 Free Software Foundation, Inc. 2 Copyright (C) 1993, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/widgetprv.h b/src/widgetprv.h
index ce087e825cb..2027b4f602d 100644
--- a/src/widgetprv.h
+++ b/src/widgetprv.h
@@ -1,5 +1,5 @@
1/* The emacs frame widget private header file. 1/* The emacs frame widget private header file.
2 Copyright (C) 1993 Free Software Foundation, Inc. 2 Copyright (C) 1993, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/window.c b/src/window.c
index c0cf06d5e46..3140bbaf001 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1,7 +1,7 @@
1/* Window creation, deletion and examination for GNU Emacs. 1/* Window creation, deletion and examination for GNU Emacs.
2 Does not include redisplay. 2 Does not include redisplay.
3 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 3 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
4 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 4 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
@@ -5626,8 +5626,6 @@ struct saved_window
5626 Lisp_Object scroll_bar_width, vertical_scroll_bar_type; 5626 Lisp_Object scroll_bar_width, vertical_scroll_bar_type;
5627}; 5627};
5628 5628
5629#define SAVED_WINDOW_VECTOR_SIZE 24 /* Arg to Fmake_vector */
5630
5631#define SAVED_WINDOW_N(swv,n) \ 5629#define SAVED_WINDOW_N(swv,n) \
5632 ((struct saved_window *) (XVECTOR ((swv)->contents[(n)]))) 5630 ((struct saved_window *) (XVECTOR ((swv)->contents[(n)])))
5633 5631
@@ -6207,7 +6205,7 @@ redirection (see `redirect-frame-focus'). */)
6207 data->saved_windows = tem; 6205 data->saved_windows = tem;
6208 for (i = 0; i < n_windows; i++) 6206 for (i = 0; i < n_windows; i++)
6209 XVECTOR (tem)->contents[i] 6207 XVECTOR (tem)->contents[i]
6210 = Fmake_vector (make_number (SAVED_WINDOW_VECTOR_SIZE), Qnil); 6208 = Fmake_vector (make_number (VECSIZE (struct saved_window)), Qnil);
6211 save_window_save (FRAME_ROOT_WINDOW (f), XVECTOR (tem), 0); 6209 save_window_save (FRAME_ROOT_WINDOW (f), XVECTOR (tem), 0);
6212 XSETWINDOW_CONFIGURATION (tem, data); 6210 XSETWINDOW_CONFIGURATION (tem, data);
6213 return (tem); 6211 return (tem);
@@ -6248,33 +6246,33 @@ Second arg LEFT-WIDTH specifies the number of character cells to
6248reserve for the left marginal area. Optional third arg RIGHT-WIDTH 6246reserve for the left marginal area. Optional third arg RIGHT-WIDTH
6249does the same for the right marginal area. A nil width parameter 6247does the same for the right marginal area. A nil width parameter
6250means no margin. */) 6248means no margin. */)
6251 (window, left, right) 6249 (window, left_width, right_width)
6252 Lisp_Object window, left, right; 6250 Lisp_Object window, left_width, right_width;
6253{ 6251{
6254 struct window *w = decode_window (window); 6252 struct window *w = decode_window (window);
6255 6253
6256 /* Translate negative or zero widths to nil. 6254 /* Translate negative or zero widths to nil.
6257 Margins that are too wide have to be checked elsewhere. */ 6255 Margins that are too wide have to be checked elsewhere. */
6258 6256
6259 if (!NILP (left)) 6257 if (!NILP (left_width))
6260 { 6258 {
6261 CHECK_NUMBER (left); 6259 CHECK_NUMBER (left_width);
6262 if (XINT (left) <= 0) 6260 if (XINT (left_width) <= 0)
6263 left = Qnil; 6261 left_width = Qnil;
6264 } 6262 }
6265 6263
6266 if (!NILP (right)) 6264 if (!NILP (right_width))
6267 { 6265 {
6268 CHECK_NUMBER (right); 6266 CHECK_NUMBER (right_width);
6269 if (XINT (right) <= 0) 6267 if (XINT (right_width) <= 0)
6270 right = Qnil; 6268 right_width = Qnil;
6271 } 6269 }
6272 6270
6273 if (!EQ (w->left_margin_cols, left) 6271 if (!EQ (w->left_margin_cols, left_width)
6274 || !EQ (w->right_margin_cols, right)) 6272 || !EQ (w->right_margin_cols, right_width))
6275 { 6273 {
6276 w->left_margin_cols = left; 6274 w->left_margin_cols = left_width;
6277 w->right_margin_cols = right; 6275 w->right_margin_cols = right_width;
6278 6276
6279 adjust_window_margins (w); 6277 adjust_window_margins (w);
6280 6278
@@ -6319,22 +6317,22 @@ the command `set-fringe-style'.
6319If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes 6317If optional fourth arg OUTSIDE-MARGINS is non-nil, draw the fringes
6320outside of the display margins. By default, fringes are drawn between 6318outside of the display margins. By default, fringes are drawn between
6321display marginal areas and the text area. */) 6319display marginal areas and the text area. */)
6322 (window, left, right, outside_margins) 6320 (window, left_width, right_width, outside_margins)
6323 Lisp_Object window, left, right, outside_margins; 6321 Lisp_Object window, left_width, right_width, outside_margins;
6324{ 6322{
6325 struct window *w = decode_window (window); 6323 struct window *w = decode_window (window);
6326 6324
6327 if (!NILP (left)) 6325 if (!NILP (left_width))
6328 CHECK_NATNUM (left); 6326 CHECK_NATNUM (left_width);
6329 if (!NILP (right)) 6327 if (!NILP (right_width))
6330 CHECK_NATNUM (right); 6328 CHECK_NATNUM (right_width);
6331 6329
6332 if (!EQ (w->left_fringe_width, left) 6330 if (!EQ (w->left_fringe_width, left_width)
6333 || !EQ (w->right_fringe_width, right) 6331 || !EQ (w->right_fringe_width, right_width)
6334 || !EQ (w->fringes_outside_margins, outside_margins)) 6332 || !EQ (w->fringes_outside_margins, outside_margins))
6335 { 6333 {
6336 w->left_fringe_width = left; 6334 w->left_fringe_width = left_width;
6337 w->right_fringe_width = right; 6335 w->right_fringe_width = right_width;
6338 w->fringes_outside_margins = outside_margins; 6336 w->fringes_outside_margins = outside_margins;
6339 6337
6340 adjust_window_margins (w); 6338 adjust_window_margins (w);
diff --git a/src/window.h b/src/window.h
index 7e34ddee26c..4ca46b20af5 100644
--- a/src/window.h
+++ b/src/window.h
@@ -1,6 +1,6 @@
1/* Window definitions for GNU Emacs. 1/* Window definitions for GNU Emacs.
2 Copyright (C) 1985,86,93,95,97,98,99, 2000,01,03,04 2 Copyright (C) 1985, 1986, 1993, 1995, 1997, 1998, 1999, 2000, 2001,
3 Free Software Foundation, Inc. 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/xdisp.c b/src/xdisp.c
index 1754598f929..a32cb70f436 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1,6 +1,7 @@
1/* Display generation from window structure and buffer text. 1/* Display generation from window structure and buffer text.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1997, 1998, 1999, 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995,
3 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3 1997, 1998, 1999, 2000, 2001, 2002, 2003,
4 2004, 2005 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -231,7 +232,7 @@ extern Lisp_Object Qhelp_echo;
231 232
232Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; 233Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
233Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; 234Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions;
234Lisp_Object Qredisplay_end_trigger_functions; 235Lisp_Object Qredisplay_end_trigger_functions, Vredisplay_end_trigger_functions;
235Lisp_Object Qinhibit_point_motion_hooks; 236Lisp_Object Qinhibit_point_motion_hooks;
236Lisp_Object QCeval, QCfile, QCdata, QCpropertize; 237Lisp_Object QCeval, QCfile, QCdata, QCpropertize;
237Lisp_Object Qfontified; 238Lisp_Object Qfontified;
@@ -1333,6 +1334,9 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p)
1333 1334
1334 current_header_line_height = current_mode_line_height = -1; 1335 current_header_line_height = current_mode_line_height = -1;
1335 1336
1337 if (visible_p && XFASTINT (w->hscroll) > 0)
1338 *x -= XFASTINT (w->hscroll);
1339
1336 return visible_p; 1340 return visible_p;
1337} 1341}
1338 1342
@@ -2395,7 +2399,9 @@ start_display (it, w, pos)
2395 init_iterator (it, w, CHARPOS (pos), BYTEPOS (pos), row, DEFAULT_FACE_ID); 2399 init_iterator (it, w, CHARPOS (pos), BYTEPOS (pos), row, DEFAULT_FACE_ID);
2396 it->first_vpos = first_vpos; 2400 it->first_vpos = first_vpos;
2397 2401
2398 if (!it->truncate_lines_p) 2402 /* Don't reseat to previous visible line start if current start
2403 position is in a string or image. */
2404 if (it->method == GET_FROM_BUFFER && !it->truncate_lines_p)
2399 { 2405 {
2400 int start_at_line_beg_p; 2406 int start_at_line_beg_p;
2401 int first_y = it->current_y; 2407 int first_y = it->current_y;
@@ -5858,6 +5864,15 @@ next_element_from_composition (it)
5858 Moving an iterator without producing glyphs 5864 Moving an iterator without producing glyphs
5859 ***********************************************************************/ 5865 ***********************************************************************/
5860 5866
5867/* Check if iterator is at a position corresponding to a valid buffer
5868 position after some move_it_ call. */
5869
5870#define IT_POS_VALID_AFTER_MOVE_P(it) \
5871 ((it)->method == GET_FROM_STRING \
5872 ? IT_STRING_CHARPOS (*it) == 0 \
5873 : 1)
5874
5875
5861/* Move iterator IT to a specified buffer or X position within one 5876/* Move iterator IT to a specified buffer or X position within one
5862 line on the display without producing glyphs. 5877 line on the display without producing glyphs.
5863 5878
@@ -6366,8 +6381,12 @@ move_it_vertically_backward (it, dy)
6366 y-distance. */ 6381 y-distance. */
6367 it2 = *it; 6382 it2 = *it;
6368 it2.max_ascent = it2.max_descent = 0; 6383 it2.max_ascent = it2.max_descent = 0;
6369 move_it_to (&it2, start_pos, -1, -1, it2.vpos + 1, 6384 do
6370 MOVE_TO_POS | MOVE_TO_VPOS); 6385 {
6386 move_it_to (&it2, start_pos, -1, -1, it2.vpos + 1,
6387 MOVE_TO_POS | MOVE_TO_VPOS);
6388 }
6389 while (!IT_POS_VALID_AFTER_MOVE_P (&it2));
6371 xassert (IT_CHARPOS (*it) >= BEGV); 6390 xassert (IT_CHARPOS (*it) >= BEGV);
6372 it3 = it2; 6391 it3 = it2;
6373 6392
@@ -6565,21 +6584,45 @@ move_it_by_lines (it, dvpos, need_y_p)
6565 last_height = 0; 6584 last_height = 0;
6566 } 6585 }
6567 else if (dvpos > 0) 6586 else if (dvpos > 0)
6568 move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS); 6587 {
6588 move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS);
6589 if (!IT_POS_VALID_AFTER_MOVE_P (it))
6590 move_it_to (it, IT_CHARPOS (*it) + 1, -1, -1, -1, MOVE_TO_POS);
6591 }
6569 else 6592 else
6570 { 6593 {
6571 struct it it2; 6594 struct it it2;
6572 int start_charpos, i; 6595 int start_charpos, i;
6573 6596
6574 /* Start at the beginning of the screen line containing IT's 6597 /* Start at the beginning of the screen line containing IT's
6575 position. */ 6598 position. This may actually move vertically backwards,
6599 in case of overlays, so adjust dvpos accordingly. */
6600 dvpos += it->vpos;
6576 move_it_vertically_backward (it, 0); 6601 move_it_vertically_backward (it, 0);
6602 dvpos -= it->vpos;
6577 6603
6578 /* Go back -DVPOS visible lines and reseat the iterator there. */ 6604 /* Go back -DVPOS visible lines and reseat the iterator there. */
6579 start_charpos = IT_CHARPOS (*it); 6605 start_charpos = IT_CHARPOS (*it);
6580 for (i = -dvpos; i && IT_CHARPOS (*it) > BEGV; --i) 6606 for (i = -dvpos; i > 0 && IT_CHARPOS (*it) > BEGV; --i)
6581 back_to_previous_visible_line_start (it); 6607 back_to_previous_visible_line_start (it);
6582 reseat (it, it->current.pos, 1); 6608 reseat (it, it->current.pos, 1);
6609
6610 /* Move further back if we end up in a string or an image. */
6611 while (!IT_POS_VALID_AFTER_MOVE_P (it))
6612 {
6613 /* First try to move to start of display line. */
6614 dvpos += it->vpos;
6615 move_it_vertically_backward (it, 0);
6616 dvpos -= it->vpos;
6617 if (IT_POS_VALID_AFTER_MOVE_P (it))
6618 break;
6619 /* If start of line is still in string or image,
6620 move further back. */
6621 back_to_previous_visible_line_start (it);
6622 reseat (it, it->current.pos, 1);
6623 dvpos--;
6624 }
6625
6583 it->current_x = it->hpos = 0; 6626 it->current_x = it->hpos = 0;
6584 6627
6585 /* Above call may have moved too far if continuation lines 6628 /* Above call may have moved too far if continuation lines
@@ -7044,6 +7087,9 @@ message3_nolog (m, nbytes, multibyte)
7044 set_message (NULL, m, nbytes, multibyte); 7087 set_message (NULL, m, nbytes, multibyte);
7045 if (minibuffer_auto_raise) 7088 if (minibuffer_auto_raise)
7046 Fraise_frame (frame); 7089 Fraise_frame (frame);
7090 /* Assume we are not echoing.
7091 (If we are, echo_now will override this.) */
7092 echo_message_buffer = Qnil;
7047 } 7093 }
7048 else 7094 else
7049 clear_message (1, 1); 7095 clear_message (1, 1);
@@ -7587,13 +7633,16 @@ display_echo_area_1 (a1, a2, a3, a4)
7587 int window_height_changed_p = 0; 7633 int window_height_changed_p = 0;
7588 7634
7589 /* Do this before displaying, so that we have a large enough glyph 7635 /* Do this before displaying, so that we have a large enough glyph
7590 matrix for the display. */ 7636 matrix for the display. If we can't get enough space for the
7637 whole text, display the last N lines. That works by setting w->start. */
7591 window_height_changed_p = resize_mini_window (w, 0); 7638 window_height_changed_p = resize_mini_window (w, 0);
7592 7639
7640 /* Use the starting position chosen by resize_mini_window. */
7641 SET_TEXT_POS_FROM_MARKER (start, w->start);
7642
7593 /* Display. */ 7643 /* Display. */
7594 clear_glyph_matrix (w->desired_matrix); 7644 clear_glyph_matrix (w->desired_matrix);
7595 XSETWINDOW (window, w); 7645 XSETWINDOW (window, w);
7596 SET_TEXT_POS (start, BEG, BEG_BYTE);
7597 try_window (window, start, 0); 7646 try_window (window, start, 0);
7598 7647
7599 return window_height_changed_p; 7648 return window_height_changed_p;
@@ -7649,8 +7698,14 @@ resize_mini_window_1 (a1, exactly, a3, a4)
7649 7698
7650/* Resize mini-window W to fit the size of its contents. EXACT:P 7699/* Resize mini-window W to fit the size of its contents. EXACT:P
7651 means size the window exactly to the size needed. Otherwise, it's 7700 means size the window exactly to the size needed. Otherwise, it's
7652 only enlarged until W's buffer is empty. Value is non-zero if 7701 only enlarged until W's buffer is empty.
7653 the window height has been changed. */ 7702
7703 Set W->start to the right place to begin display. If the whole
7704 contents fit, start at the beginning. Otherwise, start so as
7705 to make the end of the contents appear. This is particularly
7706 important for y-or-n-p, but seems desirable generally.
7707
7708 Value is non-zero if the window height has been changed. */
7654 7709
7655int 7710int
7656resize_mini_window (w, exact_p) 7711resize_mini_window (w, exact_p)
@@ -7662,6 +7717,11 @@ resize_mini_window (w, exact_p)
7662 7717
7663 xassert (MINI_WINDOW_P (w)); 7718 xassert (MINI_WINDOW_P (w));
7664 7719
7720 /* By default, start display at the beginning. */
7721 set_marker_both (w->start, w->buffer,
7722 BUF_BEGV (XBUFFER (w->buffer)),
7723 BUF_BEGV_BYTE (XBUFFER (w->buffer)));
7724
7665 /* Don't resize windows while redisplaying a window; it would 7725 /* Don't resize windows while redisplaying a window; it would
7666 confuse redisplay functions when the size of the window they are 7726 confuse redisplay functions when the size of the window they are
7667 displaying changes from under them. Such a resizing can happen, 7727 displaying changes from under them. Such a resizing can happen,
@@ -7725,7 +7785,7 @@ resize_mini_window (w, exact_p)
7725 if (height > max_height) 7785 if (height > max_height)
7726 { 7786 {
7727 height = max_height; 7787 height = max_height;
7728 init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID); 7788 init_iterator (&it, w, ZV, ZV_BYTE, NULL, DEFAULT_FACE_ID);
7729 move_it_vertically_backward (&it, (height - 1) * unit); 7789 move_it_vertically_backward (&it, (height - 1) * unit);
7730 start = it.current.pos; 7790 start = it.current.pos;
7731 } 7791 }
@@ -10050,7 +10110,9 @@ select_frame_for_redisplay (frame)
10050 (BUFFER_LOCAL_VALUEP (val) 10110 (BUFFER_LOCAL_VALUEP (val)
10051 || SOME_BUFFER_LOCAL_VALUEP (val))) 10111 || SOME_BUFFER_LOCAL_VALUEP (val)))
10052 && XBUFFER_LOCAL_VALUE (val)->check_frame) 10112 && XBUFFER_LOCAL_VALUE (val)->check_frame)
10053 Fsymbol_value (sym); 10113 /* Use find_symbol_value rather than Fsymbol_value
10114 to avoid an error if it is void. */
10115 find_symbol_value (sym);
10054 10116
10055 for (tail = XFRAME (old)->param_alist; CONSP (tail); tail = XCDR (tail)) 10117 for (tail = XFRAME (old)->param_alist; CONSP (tail); tail = XCDR (tail))
10056 if (CONSP (XCAR (tail)) 10118 if (CONSP (XCAR (tail))
@@ -10061,7 +10123,7 @@ select_frame_for_redisplay (frame)
10061 (BUFFER_LOCAL_VALUEP (val) 10123 (BUFFER_LOCAL_VALUEP (val)
10062 || SOME_BUFFER_LOCAL_VALUEP (val))) 10124 || SOME_BUFFER_LOCAL_VALUEP (val)))
10063 && XBUFFER_LOCAL_VALUE (val)->check_frame) 10125 && XBUFFER_LOCAL_VALUE (val)->check_frame)
10064 Fsymbol_value (sym); 10126 find_symbol_value (sym);
10065} 10127}
10066 10128
10067 10129
@@ -10135,6 +10197,16 @@ redisplay_internal (preserve_echo_area)
10135 ++redisplaying_p; 10197 ++redisplaying_p;
10136 specbind (Qinhibit_free_realized_faces, Qnil); 10198 specbind (Qinhibit_free_realized_faces, Qnil);
10137 10199
10200 {
10201 Lisp_Object tail, frame;
10202
10203 FOR_EACH_FRAME (tail, frame)
10204 {
10205 struct frame *f = XFRAME (frame);
10206 f->already_hscrolled_p = 0;
10207 }
10208 }
10209
10138 retry: 10210 retry:
10139 pause = 0; 10211 pause = 0;
10140 reconsider_clip_changes (w, current_buffer); 10212 reconsider_clip_changes (w, current_buffer);
@@ -10569,8 +10641,12 @@ redisplay_internal (preserve_echo_area)
10569 if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f)) 10641 if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f))
10570 { 10642 {
10571 /* See if we have to hscroll. */ 10643 /* See if we have to hscroll. */
10572 if (hscroll_windows (f->root_window)) 10644 if (!f->already_hscrolled_p)
10573 goto retry; 10645 {
10646 f->already_hscrolled_p = 1;
10647 if (hscroll_windows (f->root_window))
10648 goto retry;
10649 }
10574 10650
10575 /* Prevent various kinds of signals during display 10651 /* Prevent various kinds of signals during display
10576 update. stdio is not robust about handling 10652 update. stdio is not robust about handling
@@ -11301,7 +11377,7 @@ cursor_row_fully_visible_p (w, force_p, current_matrix_p)
11301 window_height = window_box_height (w); 11377 window_height = window_box_height (w);
11302 if (row->height >= window_height) 11378 if (row->height >= window_height)
11303 { 11379 {
11304 if (!force_p || w->vscroll) 11380 if (!force_p || MINI_WINDOW_P (w) || w->vscroll)
11305 return 1; 11381 return 1;
11306 } 11382 }
11307 return 0; 11383 return 0;
@@ -11831,7 +11907,10 @@ try_cursor_movement (window, startp, scroll_step)
11831 while (!row->mode_line_p 11907 while (!row->mode_line_p
11832 && (MATRIX_ROW_START_CHARPOS (row) > PT 11908 && (MATRIX_ROW_START_CHARPOS (row) > PT
11833 || (MATRIX_ROW_START_CHARPOS (row) == PT 11909 || (MATRIX_ROW_START_CHARPOS (row) == PT
11834 && MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P (row))) 11910 && (MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P (row)
11911 || (/* STARTS_IN_MIDDLE_OF_STRING_P (row) */
11912 row > w->current_matrix->rows
11913 && (row-1)->ends_in_newline_from_string_p))))
11835 && (row->y > top_scroll_margin 11914 && (row->y > top_scroll_margin
11836 || CHARPOS (startp) == BEGV)) 11915 || CHARPOS (startp) == BEGV))
11837 { 11916 {
@@ -12661,10 +12740,9 @@ redisplay_window (window, just_this_one_p)
12661 12740
12662#ifdef HAVE_WINDOW_SYSTEM 12741#ifdef HAVE_WINDOW_SYSTEM
12663 if (FRAME_WINDOW_P (f) 12742 if (FRAME_WINDOW_P (f)
12664 && update_window_fringes (w, 0) 12743 && update_window_fringes (w, (just_this_one_p
12665 && !just_this_one_p 12744 || (!used_current_matrix_p && !overlay_arrow_seen)
12666 && (used_current_matrix_p || overlay_arrow_seen) 12745 || w->pseudo_window_p)))
12667 && !w->pseudo_window_p)
12668 { 12746 {
12669 update_begin (f); 12747 update_begin (f);
12670 BLOCK_INPUT; 12748 BLOCK_INPUT;
@@ -12741,7 +12819,8 @@ try_window (window, pos, check_margins)
12741 } 12819 }
12742 12820
12743 /* Don't let the cursor end in the scroll margins. */ 12821 /* Don't let the cursor end in the scroll margins. */
12744 if (check_margins) 12822 if (check_margins
12823 && !MINI_WINDOW_P (w))
12745 { 12824 {
12746 int this_scroll_margin, cursor_height; 12825 int this_scroll_margin, cursor_height;
12747 12826
@@ -15006,10 +15085,12 @@ cursor_row_p (w, row)
15006 if (PT == MATRIX_ROW_END_CHARPOS (row)) 15085 if (PT == MATRIX_ROW_END_CHARPOS (row))
15007 { 15086 {
15008 /* If the row ends with a newline from a string, we don't want 15087 /* If the row ends with a newline from a string, we don't want
15009 the cursor there (if the row is continued it doesn't end in a 15088 the cursor there, but we still want it at the start of the
15010 newline). */ 15089 string if the string starts in this row.
15090 If the row is continued it doesn't end in a newline. */
15011 if (CHARPOS (row->end.string_pos) >= 0) 15091 if (CHARPOS (row->end.string_pos) >= 0)
15012 cursor_row_p = row->continued_p; 15092 cursor_row_p = (row->continued_p
15093 || PT >= MATRIX_ROW_START_CHARPOS (row));
15013 else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)) 15094 else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))
15014 { 15095 {
15015 /* If the row ends in middle of a real character, 15096 /* If the row ends in middle of a real character,
@@ -17566,6 +17647,15 @@ calc_pixel_width_or_height (res, it, prop, font, width_p, align_to)
17566 if (pixels > 0) 17647 if (pixels > 0)
17567 { 17648 {
17568 double ppi; 17649 double ppi;
17650#ifdef HAVE_WINDOW_SYSTEM
17651 if (FRAME_WINDOW_P (it->f)
17652 && (ppi = (width_p
17653 ? FRAME_X_DISPLAY_INFO (it->f)->resx
17654 : FRAME_X_DISPLAY_INFO (it->f)->resy),
17655 ppi > 0))
17656 return OK_PIXELS (ppi / pixels);
17657#endif
17658
17569 if ((ppi = NUMVAL (Vdisplay_pixels_per_inch), ppi > 0) 17659 if ((ppi = NUMVAL (Vdisplay_pixels_per_inch), ppi > 0)
17570 || (CONSP (Vdisplay_pixels_per_inch) 17660 || (CONSP (Vdisplay_pixels_per_inch)
17571 && (ppi = (width_p 17661 && (ppi = (width_p
@@ -23001,7 +23091,7 @@ of the top or bottom of the window. */);
23001 scroll_margin = 0; 23091 scroll_margin = 0;
23002 23092
23003 DEFVAR_LISP ("display-pixels-per-inch", &Vdisplay_pixels_per_inch, 23093 DEFVAR_LISP ("display-pixels-per-inch", &Vdisplay_pixels_per_inch,
23004 doc: /* Pixels per inch on current display. 23094 doc: /* Pixels per inch value for non-window system displays.
23005Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */); 23095Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */);
23006 Vdisplay_pixels_per_inch = make_float (72.0); 23096 Vdisplay_pixels_per_inch = make_float (72.0);
23007 23097
@@ -23088,6 +23178,12 @@ and its new display-start position. Note that the value of `window-end'
23088is not valid when these functions are called. */); 23178is not valid when these functions are called. */);
23089 Vwindow_scroll_functions = Qnil; 23179 Vwindow_scroll_functions = Qnil;
23090 23180
23181 DEFVAR_LISP ("redisplay-end-trigger-functions", &Vredisplay_end_trigger_functions,
23182 doc: /* Functions called when redisplay of a window reaches the end trigger.
23183Each function is called with two arguments, the window and the end trigger value.
23184See `set-window-redisplay-end-trigger'. */);
23185 Vredisplay_end_trigger_functions = Qnil;
23186
23091 DEFVAR_BOOL ("mouse-autoselect-window", &mouse_autoselect_window, 23187 DEFVAR_BOOL ("mouse-autoselect-window", &mouse_autoselect_window,
23092 doc: /* *Non-nil means autoselect window with mouse pointer. */); 23188 doc: /* *Non-nil means autoselect window with mouse pointer. */);
23093 mouse_autoselect_window = 0; 23189 mouse_autoselect_window = 0;
diff --git a/src/xfaces.c b/src/xfaces.c
index 0667d3823c7..06022383cb9 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -1,6 +1,6 @@
1/* xfaces.c -- "Face" primitives. 1/* xfaces.c -- "Face" primitives.
2 Copyright (C) 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 2 Copyright (C) 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3 Free Software Foundation. 3 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -786,8 +786,6 @@ x_free_gc (f, gc)
786#ifdef MAC_OS 786#ifdef MAC_OS
787/* Mac OS emulation of GCs */ 787/* Mac OS emulation of GCs */
788 788
789extern XGCValues *XCreateGC (void *, Window, unsigned long, XGCValues *);
790
791static INLINE GC 789static INLINE GC
792x_create_gc (f, mask, xgcv) 790x_create_gc (f, mask, xgcv)
793 struct frame *f; 791 struct frame *f;
@@ -3926,7 +3924,7 @@ Value is a vector of face attributes. */)
3926DEFUN ("internal-lisp-face-p", Finternal_lisp_face_p, 3924DEFUN ("internal-lisp-face-p", Finternal_lisp_face_p,
3927 Sinternal_lisp_face_p, 1, 2, 0, 3925 Sinternal_lisp_face_p, 1, 2, 0,
3928 doc: /* Return non-nil if FACE names a face. 3926 doc: /* Return non-nil if FACE names a face.
3929If optional second parameter FRAME is non-nil, check for the 3927If optional second argument FRAME is non-nil, check for the
3930existence of a frame-local face with name FACE on that frame. 3928existence of a frame-local face with name FACE on that frame.
3931Otherwise check for the existence of a global face. */) 3929Otherwise check for the existence of a global face. */)
3932 (face, frame) 3930 (face, frame)
@@ -4735,7 +4733,12 @@ x_update_menu_appearance (f)
4735 const char *suffix = "List"; 4733 const char *suffix = "List";
4736 Bool motif = True; 4734 Bool motif = True;
4737#else 4735#else
4736#if defined HAVE_X_I18N
4737
4738 const char *suffix = "Set";
4739#else
4738 const char *suffix = ""; 4740 const char *suffix = "";
4741#endif
4739 Bool motif = False; 4742 Bool motif = False;
4740#endif 4743#endif
4741#if defined HAVE_X_I18N 4744#if defined HAVE_X_I18N
@@ -6757,14 +6760,21 @@ try_font_list (f, attrs, family, registry, fonts, prefer_face_family)
6757 nfonts = try_alternative_families (f, try_family, registry, fonts); 6760 nfonts = try_alternative_families (f, try_family, registry, fonts);
6758 6761
6759#ifdef MAC_OS 6762#ifdef MAC_OS
6760 /* When realizing the default face and a font spec does not matched 6763 if (nfonts == 0 && STRINGP (try_family) && STRINGP (registry))
6761 exactly, Emacs looks for ones with the same registry as the 6764 if (xstricmp (SDATA (registry), "mac-roman") == 0)
6762 default font. On the Mac, this is mac-roman, which does not work 6765 /* When realizing the default face and a font spec does not
6763 if the family is -etl-fixed, e.g. The following widens the 6766 matched exactly, Emacs looks for ones with the same registry
6764 choices and fixes that problem. */ 6767 as the default font. On the Mac, this is mac-roman, which
6765 if (nfonts == 0 && STRINGP (try_family) && STRINGP (registry) 6768 does not work if the family is -etl-fixed, e.g. The
6766 && xstricmp (SDATA (registry), "mac-roman") == 0) 6769 following widens the choices and fixes that problem. */
6767 nfonts = try_alternative_families (f, try_family, Qnil, fonts); 6770 nfonts = try_alternative_families (f, try_family, Qnil, fonts);
6771 else if (SBYTES (try_family) > 0
6772 && SREF (try_family, SBYTES (try_family) - 1) != '*')
6773 /* Some Central European/Cyrillic font family names have the
6774 Roman counterpart name as their prefix. */
6775 nfonts = try_alternative_families (f, concat2 (try_family,
6776 build_string ("*")),
6777 registry, fonts);
6768#endif 6778#endif
6769 6779
6770 if (EQ (try_family, family)) 6780 if (EQ (try_family, family))
diff --git a/src/xfns.c b/src/xfns.c
index f629ee31aef..11f4c2eadb1 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1,6 +1,6 @@
1/* Functions for the X window system. 1/* Functions for the X window system.
2 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3 2001, 2002, 2003, 2004, 2005 Free Software Foundation. 3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/xmenu.c b/src/xmenu.c
index 321e6deb7c6..4abf89655df 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1,6 +1,6 @@
1/* X Communication module for terminals which understand the X protocol. 1/* X Communication module for terminals which understand the X protocol.
2 Copyright (C) 1986, 1988, 1993, 1994, 1996, 1999, 2000, 2001, 2003, 2004, 2 Copyright (C) 1986, 1988, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003,
3 2005 Free Software Foundation, Inc. 3 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/xrdb.c b/src/xrdb.c
index 248e5eba64d..822fb6e2624 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -1,5 +1,6 @@
1/* Deal with the X Resource Manager. 1/* Deal with the X Resource Manager.
2 Copyright (C) 1990, 1993, 1994, 2000, 2001 Free Software Foundation. 2 Copyright (C) 1990, 1993, 1994, 2000, 2001, 2002, 2003, 2004,
3 2005 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
diff --git a/src/xselect.c b/src/xselect.c
index e7c6d57f870..432365fdb63 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1,6 +1,6 @@
1/* X Selection processing for Emacs. 1/* X Selection processing for Emacs.
2 Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004 2 Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003,
3 Free Software Foundation. 3 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -2986,7 +2986,6 @@ A value of 0 means wait as long as necessary. This is initialized from the
2986 QTEXT = intern ("TEXT"); staticpro (&QTEXT); 2986 QTEXT = intern ("TEXT"); staticpro (&QTEXT);
2987 QCOMPOUND_TEXT = intern ("COMPOUND_TEXT"); staticpro (&QCOMPOUND_TEXT); 2987 QCOMPOUND_TEXT = intern ("COMPOUND_TEXT"); staticpro (&QCOMPOUND_TEXT);
2988 QUTF8_STRING = intern ("UTF8_STRING"); staticpro (&QUTF8_STRING); 2988 QUTF8_STRING = intern ("UTF8_STRING"); staticpro (&QUTF8_STRING);
2989 QTIMESTAMP = intern ("TIMESTAMP"); staticpro (&QTIMESTAMP);
2990 QDELETE = intern ("DELETE"); staticpro (&QDELETE); 2989 QDELETE = intern ("DELETE"); staticpro (&QDELETE);
2991 QMULTIPLE = intern ("MULTIPLE"); staticpro (&QMULTIPLE); 2990 QMULTIPLE = intern ("MULTIPLE"); staticpro (&QMULTIPLE);
2992 QINCR = intern ("INCR"); staticpro (&QINCR); 2991 QINCR = intern ("INCR"); staticpro (&QINCR);
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 88bc416e5d9..fc427a29790 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -1,6 +1,6 @@
1/* Session management module for systems which understand the X Session 1/* Session management module for systems which understand the X Session
2 management protocol. 2 management protocol.
3 Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. 3 Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/xterm.c b/src/xterm.c
index aa0ea804ae6..04f9b895742 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1,6 +1,6 @@
1/* X Communication module for terminals which understand the X protocol. 1/* X Communication module for terminals which understand the X protocol.
2 Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2 Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
3 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -9285,7 +9285,14 @@ x_wm_set_icon_pixmap (f, pixmap_id)
9285#endif 9285#endif
9286 } 9286 }
9287 9287
9288#ifdef USE_X_TOOLKIT /* same as in x_wm_set_window_state. */ 9288
9289#ifdef USE_GTK
9290 {
9291 xg_set_frame_icon (f, icon_pixmap, icon_mask);
9292 return;
9293 }
9294
9295#elif defined (USE_X_TOOLKIT) /* same as in x_wm_set_window_state. */
9289 9296
9290 { 9297 {
9291 Arg al[1]; 9298 Arg al[1];
@@ -9295,12 +9302,12 @@ x_wm_set_icon_pixmap (f, pixmap_id)
9295 XtSetValues (f->output_data.x->widget, al, 1); 9302 XtSetValues (f->output_data.x->widget, al, 1);
9296 } 9303 }
9297 9304
9298#else /* not USE_X_TOOLKIT */ 9305#else /* not USE_X_TOOLKIT && not USE_GTK */
9299 9306
9300 f->output_data.x->wm_hints.flags |= (IconPixmapHint | IconMaskHint); 9307 f->output_data.x->wm_hints.flags |= (IconPixmapHint | IconMaskHint);
9301 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints); 9308 XSetWMHints (FRAME_X_DISPLAY (f), window, &f->output_data.x->wm_hints);
9302 9309
9303#endif /* not USE_X_TOOLKIT */ 9310#endif /* not USE_X_TOOLKIT && not USE_GTK */
9304} 9311}
9305 9312
9306void 9313void
diff --git a/src/xterm.h b/src/xterm.h
index 835434d0901..aa615d06a17 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -1,6 +1,6 @@
1/* Definitions and headers for communication with X protocol. 1/* Definitions and headers for communication with X protocol.
2 Copyright (C) 1989, 1993, 1994, 1998, 1999, 2000,01,02,03,04 2 Copyright (C) 1989, 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003,
3 Free Software Foundation, Inc. 3 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6