summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog283
-rw-r--r--src/ChangeLog.108
-rw-r--r--src/ChangeLog.116
-rw-r--r--src/ChangeLog.28
-rw-r--r--src/ChangeLog.72
-rw-r--r--src/ChangeLog.88
-rw-r--r--src/alloc.c2
-rw-r--r--src/callint.c11
-rw-r--r--src/ccl.c6
-rw-r--r--src/charset.c2
-rw-r--r--src/charset.h4
-rw-r--r--src/cm.h4
-rw-r--r--src/coding.c192
-rw-r--r--src/coding.h2
-rw-r--r--src/data.c2
-rw-r--r--src/dbusbind.c2
-rw-r--r--src/editfns.c2
-rw-r--r--src/emacs.c17
-rw-r--r--src/emacsgtkfixed.c2
-rw-r--r--src/emacsgtkfixed.h2
-rw-r--r--src/eval.c14
-rw-r--r--src/fileio.c20
-rw-r--r--src/font.c8
-rw-r--r--src/font.h6
-rw-r--r--src/fontset.c4
-rw-r--r--src/frame.c2
-rw-r--r--src/ftfont.c9
-rw-r--r--src/ftxfont.c9
-rw-r--r--src/image.c33
-rw-r--r--src/keyboard.c56
-rw-r--r--src/lastfile.c3
-rw-r--r--src/lisp.h15
-rw-r--r--src/lread.c28
-rw-r--r--src/minibuf.c34
-rw-r--r--src/nsfns.m62
-rw-r--r--src/nsfont.m30
-rw-r--r--src/nsmenu.m46
-rw-r--r--src/nsselect.m168
-rw-r--r--src/nsterm.h2
-rw-r--r--src/nsterm.m44
-rw-r--r--src/print.c2
-rw-r--r--src/process.c5
-rw-r--r--src/regex.c2
-rw-r--r--src/regex.h4
-rw-r--r--src/region-cache.c4
-rw-r--r--src/region-cache.h4
-rw-r--r--src/s/gnu-linux.h2
-rw-r--r--src/sysdep.c2
-rw-r--r--src/termhooks.h4
-rw-r--r--src/textprop.c4
-rw-r--r--src/unexelf.c12
-rw-r--r--src/w16select.c9
-rw-r--r--src/w32.c18
-rw-r--r--src/w32fns.c10
-rw-r--r--src/w32font.c2
-rw-r--r--src/w32select.c7
-rw-r--r--src/w32term.c6
-rw-r--r--src/w32term.h2
-rw-r--r--src/window.c19
-rw-r--r--src/window.h2
-rw-r--r--src/xdisp.c23
-rw-r--r--src/xfns.c10
-rw-r--r--src/xftfont.c2
-rw-r--r--src/xmenu.c23
-rw-r--r--src/xselect.c10
-rw-r--r--src/xterm.c12
-rw-r--r--src/xterm.h2
67 files changed, 952 insertions, 408 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 6a13bd87264..f10e2955164 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,264 @@
+2011-12-28 Kenichi Handa <handa@m17n.org>
+
+ * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
+ coding-system ASCII compatible only when it does not produce BOM
+ on encoding (Bug#10383).
+
+2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
+ can scroll.
+ (create_and_show_popup_menu): Always use menu_position_func for
+ Gtk3 (Bug#10361).
+
+2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
+
+ * callint.c (Fcall_interactively): Don't truncate prompt string.
+
+2011-12-23 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (handle_invisible_prop): Handle correctly an invisible
+ property that ends at ZV, so that the bidi iteration could be
+ resumed from there (after widening). (Bug#10360)
+
+2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
+
+2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsterm.m (x_free_frame_resources): Release
+ f->output_data.ns->miniimage
+ (ns_index_color): Fix indentation. Do not retain
+ color_table->colors[i].
+
+ * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
+ before returning.
+
+ * nsfns.m (x_set_background_color): Assign return value from
+ ns_index_color to face-background instead of NSColor*.
+ (ns_implicitly_set_icon_type): Fix indentation.
+ Change assignment in for loop to comparison.
+
+ * emacs.c (ns_pool): New variable.
+ (main): Assign ns_pool.
+ (Fkill_emacs): Call ns_release_autorelease_pool.
+
+ * nsfont.m (ns_spec_to_descriptor): Fix indentation,
+ autorelease fdesc, release fdAttrs and tdict.
+ (ns_get_covering_families): Release charset.
+ (ns_findfonts): Release NSFontDescriptor created with new.
+ (ns_uni_to_glyphs): Fix indentation.
+ (setString): Release attrStr before assigning new value.
+
+2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
+ and NS_IMPL_COCOA.
+ (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
+ (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
+
+2011-12-18 David Reitter <reitter@cmu.edu>
+
+ * nsterm.m (ns_term_init): Subscribe for notifications
+ NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
+ to method trackingNotification in EmacsMenu.
+
+ * nsmenu.m (trackingMenu): New variable.
+ (trackingNotification): New method (from Aquamacs).
+ (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
+ from Aquamacs (Bug#7030).
+
+2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
+ (symbol_to_nsstring): Fix indentation.
+ (ns_symbol_to_pb): New function.
+ (Fns_get_selection_internal): Renamed from Fns_get_cut_buffer_internal.
+ (Fns_rotate_cut_buffers_internal): Removed.
+ (Fns_store_selection_internal): Renamed from
+ Fns_store_cut_buffer_internal.
+ (ns_get_foreign_selection, Fx_own_selection_internal)
+ (Fx_disown_selection_internal, Fx_selection_exists_p)
+ (Fns_get_selection_internal, Fns_store_selection_internal): Use
+ ns_symbol_to_pb and check if return value is nil.
+ (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove
+ defsubr Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
+ renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
+ renamed to Sns_store_selection_internal.
+ (ns_handle_selection_request): Move code to Fx_own_selection_internal
+ and remove this function.
+ (ns_handle_selection_clear): Remove, never used.
+ (Fx_own_selection_internal): Move code from ns_handle_selection_request
+ here.
+
+2011-12-17 Ken Brown <kbrown@cornell.edu>
+
+ * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
+ GID is unknown (Bug#10257).
+
+2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
+ (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
+ which caused a build failure on GNU/Linux IA-64. This problem was
+ introduced by my 2011-10-07 patch.
+
+2011-12-15 Juri Linkov <juri@jurta.org>
+
+ * image.c (imagemagick_error): New function. (Bug#10112)
+ (imagemagick_load_image): Comment out `MagickSetResolution' call.
+ Use `imagemagick_error' where ImageMagick functions return
+ `MagickFalse'.
+ (Fimagemagick_types): Add `Fnreverse' to return the list in the
+ proper order.
+
+2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * xftfont.c (xftfont_draw): Use the font metrics of s->font to
+ fill background (Bug#8992).
+
+2011-12-13 Martin Rudalics <rudalics@gmx.at>
+
+ * window.c (Vwindow_combination_resize)
+ (Vwindow_combination_limit): Use t instead of non-nil in
+ doc-strings.
+ (Vrecenter_redisplay): Add first sentence of doc-string on
+ separate line.
+ (Frecenter): Fix doc-string typo.
+
+2011-12-11 Kenichi Handa <handa@m17n.org>
+
+ * coding.c (Funencodable_char_position): Pay attention to the
+ buffer text relocation (Bug#9389).
+
+2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
+
+ * xterm.c (x_term_init): Move call to gdk_window_add_filter before
+ gtk_init (Bug#10100).
+
+2011-12-10 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
+ IT->string is nil. (Bug#10263)
+
+2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsterm.h (x_free_frame_resources): Declare.
+
+ * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
+ (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
+
+ * nsterm.h (ns_get_defaults_value): Declare.
+
+ * nsterm.m (ns_default): Call ns_get_defaults_value.
+
+2011-12-09 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
+ (Bug#10170)
+
+2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
+ that where the value of an _OBJC_* symbol points to is in the .bss
+ section (Bug#10240).
+
+2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
+
+ * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
+ after the loop to call ccl_driver at least once (Bug#8619).
+
+2011-12-08 Kenichi Handa <handa@m17n.org>
+
+ * ftfont.c (get_adstyle_property): Fix previous change
+ (Bug#10233).
+
+2011-12-07 Juanma Barranquero <lekktu@gmail.com>
+
+ * w32.c (init_environment): If no_site_lisp, remove site-lisp
+ dirs from the default value of EMACSLOADPATH (bug#10208).
+
+2011-12-07 Glenn Morris <rgm@gnu.org>
+
+ * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
+ installation and source directories as well. (Bug#10208)
+
+2011-12-06 Chong Yidong <cyd@gnu.org>
+
+ * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
+
+2011-12-06 Glenn Morris <rgm@gnu.org>
+
+ * process.c (start_process_unwind): Treat any pid <= 0, except -2,
+ as an error, not just -1. (Bug#10217)
+
+2011-12-05 Chong Yidong <cyd@gnu.org>
+
+ * keyboard.c (process_special_events): New function.
+ (swallow_events, Finput_pending_p): Use it (Bug#10195).
+
+2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
+
+ * coding.c (encode_designation_at_bol): Don't use uninitialized
+ local variable (Bug#9318).
+
+2011-12-05 Kenichi Handa <handa@m17n.org>
+
+ * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
+ return Qnil (Bug#8046, Bug#10193).
+
+2011-12-05 Kenichi Handa <handa@m17n.org>
+
+ * coding.c (encode_designation_at_bol): New args charbuf_end and
+ dst. Return the number of produced bytes. Callers changed.
+ (coding_set_source): Return how many bytes coding->source was
+ relocated.
+ (coding_set_destination): Return how many bytes
+ coding->destination was relocated.
+ (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
+ (CODING_CHAR_CHARSET_P): Adjusted for the avove changes.
+
+2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
+
+ * coding.c (CODING_CHAR_CHARSET_P): New macro.
+ (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
+ macro (Bug#9318).
+
+2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
+
+ The following changes are to fix Bug#9318.
+
+ * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
+ (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
+ (encode_coding_iso_2022, encode_coding_sjis)
+ (encode_coding_big5, encode_coding_charset): Use the above macros.
+
+2011-12-05 Juanma Barranquero <lekktu@gmail.com>
+
+ * lisp.h (process_quit_flag): Fix external declaration.
+
+2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Don't macro-inline non-performance-critical code.
+ * eval.c (process_quit_flag): New function.
+ * lisp.h (QUIT): Use it.
+
+2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsfns.m (get_geometry_from_preferences): New function.
+ (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
+
+2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
+
+ * emacs.c (Qkill_emacs): Define.
+ (syms_of_emacs): Initialize it.
+ * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
+ Qquit_flag to `kill-emacs' instead.
+ (quit_throw_to_read_char): Add parameter `from_signal'.
+ All callers changed. Call Fkill_emacs if requested and safe.
+ * lisp.h (QUIT): Call Fkill_emacs if requested.
+
2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
* widget.c (update_wm_hints): Return if wmshell is null.
@@ -58,7 +319,7 @@
* xterm.c (handle_one_xevent): Only set async_visible and friends
if net_wm_state_hidden_seen is non-zero (Bug#10002)
- (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
+ (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
_NET_WM_STATE_HIDDEN is in NET_WM_STATE.
2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
@@ -95,8 +356,8 @@
2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
- * gtkutil.c (xg_create_frame_widgets): Call
- gtk_window_set_has_resize_grip (FALSE) if that function is
+ * gtkutil.c (xg_create_frame_widgets):
+ Call gtk_window_set_has_resize_grip (FALSE) if that function is
present with Gtk+ 2.0.
2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
@@ -303,8 +564,8 @@
* xdisp.c (display_line): Move the call to
highlight_trailing_whitespace before the call to
compute_line_metrics, since the latter needs to see the final
- faces of all the glyphs to compute ROW's hash value. Fixes
- assertion violations in row_equal_p. (Bug#10035)
+ faces of all the glyphs to compute ROW's hash value.
+ Fixes assertion violations in row_equal_p. (Bug#10035)
2011-11-14 Juanma Barranquero <lekktu@gmail.com>
@@ -388,8 +649,8 @@
2011-11-08 Chong Yidong <cyd@gnu.org>
* window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
- (Fwindow_body_height, Fwindow_body_width): Move from Lisp. Signal
- an error if not a live window.
+ (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
+ Signal an error if not a live window.
(Fwindow_total_width, Fwindow_total_height): Move from Lisp.
(Fwindow_total_size, Fwindow_body_size): Move to Lisp.
@@ -521,8 +782,8 @@
(x_destroy_window): Move code to x_free_frame_resources.
* xfns.c (unwind_create_frame): Fix comment.
- (Fx_create_frame, x_create_tip_frame): Move
- terminal->reference_count++ just before making the frame
+ (Fx_create_frame, x_create_tip_frame):
+ Move terminal->reference_count++ just before making the frame
official. Move initialization of image_cache_refcount and
dpyinfo_refcount before calling init_frame_faces (Bug#9943).
@@ -592,8 +853,8 @@
* xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
Don't stop backward scan on the continuation glyph, even though
its CHARPOS is positive.
- (mouse_face_from_buffer_pos, note_mouse_highlight): Rename
- cover_string to disp_string.
+ (mouse_face_from_buffer_pos, note_mouse_highlight):
+ Rename cover_string to disp_string.
2011-11-01 Martin Rudalics <rudalics@gmx.at>
diff --git a/src/ChangeLog.10 b/src/ChangeLog.10
index 7d2f48a03ea..53f7a016654 100644
--- a/src/ChangeLog.10
+++ b/src/ChangeLog.10
@@ -516,7 +516,7 @@
* w32fns.c (current_popup_menu): Use from w32menu.c.
(w32_wnd_proc) <WM_EXITMENULOOP, WM_TIMER>: Use menubar_active
and current_popup_menu to determine whether a menubar menu has
- been cancelled.
+ been canceled.
* w32term.h (w32_output): Remove menu_command_in_progress.
@@ -15816,14 +15816,14 @@
Add prototypes.
* macterm.c (mac_draw_bitmap): Add overlay_p arg.
- (x_draw_fringe_bitmap): Handle overlayed fringe bitmaps;
+ (x_draw_fringe_bitmap): Handle overlaid fringe bitmaps;
thanks to YAMAMOTO Mitsuharu for advice on how to do this.
Use cursor color for displaying cursor in fringe.
(x_redisplay_interface): Add null handlers for
define_fringe_bitmap and destroy_fringe_bitmap functions.
* w32term.c (w32_draw_fringe_bitmap): Copy unadapted code from
- xterm.c to handle overlayed fringe bitmaps and to use cursor color
+ xterm.c to handle overlaid fringe bitmaps and to use cursor color
for displaying cursor in fringe.
(w32_define_fringe_bitmap, w32_destroy_fringe_bitmap): New W32
specific functions to define and destroy fringe bitmaps in fringe_bmp.
@@ -15849,7 +15849,7 @@
(display_line): Handle cursor in fringe at eob.
(display_line): Set row user fringe bitmaps from iterator.
- * xterm.c (x_draw_fringe_bitmap): Handle overlayed fringe bitmaps.
+ * xterm.c (x_draw_fringe_bitmap): Handle overlaid fringe bitmaps.
Use cursor color for displaying cursor in fringe.
(x_redisplay_interface): Add null handlers for
define_fringe_bitmap and destroy_fringe_bitmap functions.
diff --git a/src/ChangeLog.11 b/src/ChangeLog.11
index 7c46dea675c..78639ef0c2b 100644
--- a/src/ChangeLog.11
+++ b/src/ChangeLog.11
@@ -12897,7 +12897,7 @@
* font.c (font_update_drivers): Sanity fallback to avoid disabling
all drivers.
- * nsterm.m (-windowDidResize:): Avoid inf-loop under GNUStep.
+ * nsterm.m (-windowDidResize:): Avoid inf-loop under GNUstep.
2009-05-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
@@ -23182,7 +23182,7 @@
* font.c (font_prop_validate_symbol, font_prop_validate_style)
(font_prop_validate_non_neg, font_prop_validate_spacing):
Delete argument prop_index.
- (font_property_table): Change arguments to validater. Change Callers.
+ (font_property_table): Change arguments to validator. Change Callers.
(font_lispy_object): Delete.
(font_at): Use font_find_object instead fo font_lispy_object.
@@ -30657,7 +30657,7 @@
(display_buffer): Do not set split_height_threshold to twice the
value of window_min_height to avoid changing the value of a
customizable variable. Rather explicitly check whether the
- height of the window that shall be splitted is at least as large
+ height of the window that shall be split is at least as large
as split_height_threshold.
(Fwindow_full_width_p): New defun.
(syms_of_window): Defsubr it.
diff --git a/src/ChangeLog.2 b/src/ChangeLog.2
index 62e3de22b09..d3be0064610 100644
--- a/src/ChangeLog.2
+++ b/src/ChangeLog.2
@@ -1811,7 +1811,7 @@
1987-03-13 Richard M. Stallman (rms@prep)
* sysdep.c: Don't redefine TCSETAW if already defined.
- (Cancelled by change on March 17).
+ (Canceled by change on March 17).
* sunfns.c: New file containing interface to Sun windows.
This is enabled by the switch HAVE_SUN_WINDOWS.
@@ -2254,7 +2254,7 @@
Initialize save_color.
* fileio.c, search.c, sysdep.c, filelock.c, editfns.c, process.c:
- Delete/replace unused/conditionalised variables
+ Delete/replace unused/conditionalized variables
1987-01-15 Richard M. Stallman (rms@prep)
@@ -2632,7 +2632,7 @@
* fns.c: Fding requires an arg; pass Qnil.
* m-alliant.h: define TEXT_START as 0x1000.
- Don't define LIBS_STANDARD; the default (sharable) library
+ Don't define LIBS_STANDARD; the default (shareable) library
is said to work now.
* alloc.c (mark_object): Now pass address of slot being marked.
@@ -4220,7 +4220,7 @@
Increase PURESIZE again (sigh)
* unexec.c (write_segment):
- Kludgey coercions ("(int)") to get this line to compile:
+ Kludgy coercions ("(int)") to get this line to compile:
nwrite = (((int) ptr + 128) & ~127) - (int) ptr;
Also changed incorrect ~128 to ~127.
diff --git a/src/ChangeLog.7 b/src/ChangeLog.7
index fc97acdeb1e..bb18f684242 100644
--- a/src/ChangeLog.7
+++ b/src/ChangeLog.7
@@ -3968,7 +3968,7 @@
1998-01-12 Kenichi Handa <handa@etl.go.jp>
- * minibuf.c (Fminibuffer_complete_word): Fix a bug of refering
+ * minibuf.c (Fminibuffer_complete_word): Fix a bug of referring
`i'. We must refer `i_byte' instead.
* insdel.c (insert_from_string_1): Decrement GAP_SIZE by
diff --git a/src/ChangeLog.8 b/src/ChangeLog.8
index 2f3ee45a1ac..6973717a7d7 100644
--- a/src/ChangeLog.8
+++ b/src/ChangeLog.8
@@ -4027,7 +4027,7 @@
* dispextern.h (struct glyph_row): Flag internal_border_p removed.
* xfns.c (x_create_tip_frame): Don't set bitmapIcon resource
- because this will try to access a nonexisting widget.
+ because this will try to access a nonexistent widget.
1999-07-26 Markus Rost <rost@gnu.org>
@@ -11485,7 +11485,7 @@
Substitute homedir by `~' also in default_filename.
* xdisp.c (try_window_id): Fix computation of tab_offset when
- backing up over a character that is splitted across lines.
+ backing up over a character that is split across lines.
1999-05-08 Kenichi HANDA <handa@etl.go.jp>
@@ -12583,7 +12583,7 @@
quit_char is typed, in order to break out of potential deadlocks.
(cancel_all_deferred_msgs): New function.
(complete_deferred_msg): Don't abort if msg not found; may have
- been cancelled.
+ been canceled.
(Fw32_reconstruct_hot_key): Use pre-interned symbols.
(Fw32_send_sys_command): Wait for system command to
complete before returning.
@@ -13701,7 +13701,7 @@
* ccl.c (CCL_WRITE_CHAR): Don't use bcopy.
(ccl_driver): If BUFFER-MAGNIFICATION of the CCL program is 0,
cause error if the program is going to output some bytes. When
- outputing a string to notify an error, check the case that
+ outputting a string to notify an error, check the case that
DST_BYTES is zero.
* coding.h (CODING_FINISH_INTERRUPT): New macro.
diff --git a/src/alloc.c b/src/alloc.c
index 96d63f53cf9..6f70976c345 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6399,7 +6399,7 @@ If this portion is smaller than `gc-cons-threshold', this is ignored. */);
Vgc_cons_percentage = make_float (0.1);
DEFVAR_INT ("pure-bytes-used", pure_bytes_used,
- doc: /* Number of bytes of sharable Lisp data allocated so far. */);
+ doc: /* Number of bytes of shareable Lisp data allocated so far. */);
DEFVAR_INT ("cons-cells-consed", cons_cells_consed,
doc: /* Number of cons cells that have been consed so far. */);
diff --git a/src/callint.c b/src/callint.c
index 80e24f6c8ee..25a4713e270 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -274,8 +274,6 @@ invoke it. If KEYS is omitted or nil, the return value of
ptrdiff_t i, nargs;
int foo;
- char prompt1[100];
- char *tem1;
int arg_from_tty = 0;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
int key_count;
@@ -491,13 +489,8 @@ invoke it. If KEYS is omitted or nil, the return value of
tem = string;
for (i = 1; *tem; i++)
{
- strncpy (prompt1, tem + 1, sizeof prompt1 - 1);
- prompt1[sizeof prompt1 - 1] = 0;
- tem1 = strchr (prompt1, '\n');
- if (tem1) *tem1 = 0;
-
- visargs[0] = build_string (prompt1);
- if (strchr (prompt1, '%'))
+ visargs[0] = make_string (tem + 1, strcspn (tem + 1, "\n"));
+ if (strchr (SSDATA (visargs[0]), '%'))
callint_message = Fformat (i, visargs);
else
callint_message = visargs[0];
diff --git a/src/ccl.c b/src/ccl.c
index b7228a4d1cd..65a6dcfcb85 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -210,8 +210,8 @@ static Lisp_Object Vccl_program_table;
#define CCL_WriteArrayReadJump 0x0B /* Write an array element, read, and jump:
1:A--D--D--R--E--S--S-rrrXXXXX
2:LENGTH
- 3:ELEMENET[0]
- 4:ELEMENET[1]
+ 3:ELEMENT[0]
+ 4:ELEMENT[1]
...
N:A--D--D--R--E--S--S-rrrYYYYY
------------------------------
@@ -552,7 +552,7 @@ static Lisp_Object Vccl_program_table;
But, when VALm is mapped to VALn and VALn is not a number, the
mapping proceed as below:
- If VALn is nil, the lastest map is ignored and the mapping of VALm
+ If VALn is nil, the last map is ignored and the mapping of VALm
proceed to the next map.
In VALn is t, VALm is reverted to reg[rrr] and the mapping of VALm
diff --git a/src/charset.c b/src/charset.c
index 3c15f1bee54..49fc7288069 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1660,7 +1660,7 @@ maybe_unify_char (int c, Lisp_Object val)
}
-/* Return a character correponding to the code-point CODE of
+/* Return a character corresponding to the code-point CODE of
CHARSET. */
int
diff --git a/src/charset.h b/src/charset.h
index fc35d6bb991..5ca83130b77 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -238,7 +238,7 @@ struct charset
int unified_p;
};
-/* Hash table of charset symbols vs. the correponding attribute
+/* Hash table of charset symbols vs. the corresponding attribute
vectors. */
extern Lisp_Object Vcharset_hash_table;
@@ -389,7 +389,7 @@ extern Lisp_Object Vchar_charset_set;
#endif
-/* Return a character correponding to the code-point CODE of CHARSET.
+/* Return a character corresponding to the code-point CODE of CHARSET.
Try some optimization before calling decode_char. */
#define DECODE_CHAR(charset, code) \
diff --git a/src/cm.h b/src/cm.h
index dbf0820b94c..a8c7e0d7c4b 100644
--- a/src/cm.h
+++ b/src/cm.h
@@ -16,7 +16,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* Holds the minimum and maximum costs for the parametrized capabilities. */
+/* Holds the minimum and maximum costs for the parameterized capabilities. */
struct parmcap
{
int mincost, maxcost;
@@ -79,7 +79,7 @@ struct cm
struct parmcap cc_multiright; /* multiple right (RI) */
#endif
- /* Costs for the non-parametrized capabilities */
+ /* Costs for the non-parameterized capabilities */
int cc_up; /* cost for up */
int cc_down; /* etc. */
int cc_left;
diff --git a/src/coding.c b/src/coding.c
index 79908e9b29b..2db5385c932 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -847,16 +847,16 @@ static int encode_coding_ccl (struct coding_system *);
static void decode_coding_raw_text (struct coding_system *);
static int encode_coding_raw_text (struct coding_system *);
-static void coding_set_source (struct coding_system *);
-static void coding_set_destination (struct coding_system *);
+static EMACS_INT coding_set_source (struct coding_system *);
+static EMACS_INT coding_set_destination (struct coding_system *);
static void coding_alloc_by_realloc (struct coding_system *, EMACS_INT);
static void coding_alloc_by_making_gap (struct coding_system *,
EMACS_INT, EMACS_INT);
static unsigned char *alloc_destination (struct coding_system *,
EMACS_INT, unsigned char *);
static void setup_iso_safe_charsets (Lisp_Object);
-static unsigned char *encode_designation_at_bol (struct coding_system *,
- int *, unsigned char *);
+static int encode_designation_at_bol (struct coding_system *,
+ int *, int *, unsigned char *);
static int detect_eol (const unsigned char *,
EMACS_INT, enum coding_category);
static Lisp_Object adjust_coding_eol_type (struct coding_system *, int);
@@ -915,27 +915,68 @@ record_conversion_result (struct coding_system *coding,
}
}
-/* This wrapper macro is used to preserve validity of pointers into
- buffer text across calls to decode_char, which could cause
- relocation of buffers if it loads a charset map, because loading a
- charset map allocates large structures. */
+/* These wrapper macros are used to preserve validity of pointers into
+ buffer text across calls to decode_char, encode_char, etc, which
+ could cause relocation of buffers if it loads a charset map,
+ because loading a charset map allocates large structures. */
+
#define CODING_DECODE_CHAR(coding, src, src_base, src_end, charset, code, c) \
do { \
+ EMACS_INT offset; \
+ \
charset_map_loaded = 0; \
c = DECODE_CHAR (charset, code); \
- if (charset_map_loaded) \
+ if (charset_map_loaded \
+ && (offset = coding_set_source (coding))) \
{ \
- const unsigned char *orig = coding->source; \
- EMACS_INT offset; \
- \
- coding_set_source (coding); \
- offset = coding->source - orig; \
src += offset; \
src_base += offset; \
src_end += offset; \
} \
} while (0)
+#define CODING_ENCODE_CHAR(coding, dst, dst_end, charset, c, code) \
+ do { \
+ EMACS_INT offset; \
+ \
+ charset_map_loaded = 0; \
+ code = ENCODE_CHAR (charset, c); \
+ if (charset_map_loaded \
+ && (offset = coding_set_destination (coding))) \
+ { \
+ dst += offset; \
+ dst_end += offset; \
+ } \
+ } while (0)
+
+#define CODING_CHAR_CHARSET(coding, dst, dst_end, c, charset_list, code_return, charset) \
+ do { \
+ EMACS_INT offset; \
+ \
+ charset_map_loaded = 0; \
+ charset = char_charset (c, charset_list, code_return); \
+ if (charset_map_loaded \
+ && (offset = coding_set_destination (coding))) \
+ { \
+ dst += offset; \
+ dst_end += offset; \
+ } \
+ } while (0)
+
+#define CODING_CHAR_CHARSET_P(coding, dst, dst_end, c, charset, result) \
+ do { \
+ EMACS_INT offset; \
+ \
+ charset_map_loaded = 0; \
+ result = CHAR_CHARSET_P (c, charset); \
+ if (charset_map_loaded \
+ && (offset = coding_set_destination (coding))) \
+ { \
+ dst += offset; \
+ dst_end += offset; \
+ } \
+ } while (0)
+
/* If there are at least BYTES length of room at dst, allocate memory
for coding->destination and update dst and dst_end. We don't have
@@ -1015,9 +1056,14 @@ record_conversion_result (struct coding_system *coding,
| ((p)[-1] & 0x3F))))
-static void
+/* Update coding->source from coding->src_object, and return how many
+ bytes coding->source was changed. */
+
+static EMACS_INT
coding_set_source (struct coding_system *coding)
{
+ const unsigned char *orig = coding->source;
+
if (BUFFERP (coding->src_object))
{
struct buffer *buf = XBUFFER (coding->src_object);
@@ -1036,11 +1082,18 @@ coding_set_source (struct coding_system *coding)
/* Otherwise, the source is C string and is never relocated
automatically. Thus we don't have to update anything. */
}
+ return coding->source - orig;
}
-static void
+
+/* Update coding->destination from coding->dst_object, and return how
+ many bytes coding->destination was changed. */
+
+static EMACS_INT
coding_set_destination (struct coding_system *coding)
{
+ const unsigned char *orig = coding->destination;
+
if (BUFFERP (coding->dst_object))
{
if (BUFFERP (coding->src_object) && coding->src_pos < 0)
@@ -1065,6 +1118,7 @@ coding_set_destination (struct coding_system *coding)
/* Otherwise, the destination is C string and is never relocated
automatically. Thus we don't have to update anything. */
}
+ return coding->destination - orig;
}
@@ -2650,14 +2704,19 @@ encode_coding_emacs_mule (struct coding_system *coding)
if (preferred_charset_id >= 0)
{
+ int result;
+
charset = CHARSET_FROM_ID (preferred_charset_id);
- if (CHAR_CHARSET_P (c, charset))
+ CODING_CHAR_CHARSET_P (coding, dst, dst_end, c, charset, result);
+ if (result)
code = ENCODE_CHAR (charset, c);
else
- charset = char_charset (c, charset_list, &code);
+ CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list,
+ &code, charset);
}
else
- charset = char_charset (c, charset_list, &code);
+ CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list,
+ &code, charset);
if (! charset)
{
c = coding->default_char;
@@ -2666,7 +2725,8 @@ encode_coding_emacs_mule (struct coding_system *coding)
EMIT_ONE_ASCII_BYTE (c);
continue;
}
- charset = char_charset (c, charset_list, &code);
+ CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list,
+ &code, charset);
}
dimension = CHARSET_DIMENSION (charset);
emacs_mule_id = CHARSET_EMACS_MULE_ID (charset);
@@ -4185,7 +4245,8 @@ decode_coding_iso_2022 (struct coding_system *coding)
#define ENCODE_ISO_CHARACTER(charset, c) \
do { \
- int code = ENCODE_CHAR ((charset), (c)); \
+ int code; \
+ CODING_ENCODE_CHAR (coding, dst, dst_end, (charset), (c), code); \
\
if (CHARSET_DIMENSION (charset) == 1) \
ENCODE_ISO_CHARACTER_DIMENSION1 ((charset), code); \
@@ -4283,15 +4344,19 @@ encode_invocation_designation (struct charset *charset,
/* Produce designation sequences of charsets in the line started from
- SRC to a place pointed by DST, and return updated DST.
+ CHARBUF to a place pointed by DST, and return the number of
+ produced bytes. DST should not directly point a buffer text area
+ which may be relocated by char_charset call.
If the current block ends before any end-of-line, we may fail to
find all the necessary designations. */
-static unsigned char *
-encode_designation_at_bol (struct coding_system *coding, int *charbuf,
+static int
+encode_designation_at_bol (struct coding_system *coding,
+ int *charbuf, int *charbuf_end,
unsigned char *dst)
{
+ unsigned char *orig = dst;
struct charset *charset;
/* Table of charsets to be designated to each graphic register. */
int r[4];
@@ -4309,7 +4374,7 @@ encode_designation_at_bol (struct coding_system *coding, int *charbuf,
for (reg = 0; reg < 4; reg++)
r[reg] = -1;
- while (found < 4)
+ while (charbuf < charbuf_end && found < 4)
{
int id;
@@ -4334,7 +4399,7 @@ encode_designation_at_bol (struct coding_system *coding, int *charbuf,
ENCODE_DESIGNATION (CHARSET_FROM_ID (r[reg]), reg, coding);
}
- return dst;
+ return dst - orig;
}
/* See the above "GENERAL NOTES on `encode_coding_XXX ()' functions". */
@@ -4378,13 +4443,26 @@ encode_coding_iso_2022 (struct coding_system *coding)
if (bol_designation)
{
- unsigned char *dst_prev = dst;
-
/* We have to produce designation sequences if any now. */
- dst = encode_designation_at_bol (coding, charbuf, dst);
- bol_designation = 0;
+ unsigned char desig_buf[16];
+ int nbytes;
+ EMACS_INT offset;
+
+ charset_map_loaded = 0;
+ nbytes = encode_designation_at_bol (coding, charbuf, charbuf_end,
+ desig_buf);
+ if (charset_map_loaded
+ && (offset = coding_set_destination (coding)))
+ {
+ dst += offset;
+ dst_end += offset;
+ }
+ memcpy (dst, desig_buf, nbytes);
+ dst += nbytes;
/* We are sure that designation sequences are all ASCII bytes. */
- produced_chars += dst - dst_prev;
+ produced_chars += nbytes;
+ bol_designation = 0;
+ ASSURE_DESTINATION (safe_room);
}
c = *charbuf++;
@@ -4455,12 +4533,17 @@ encode_coding_iso_2022 (struct coding_system *coding)
if (preferred_charset_id >= 0)
{
+ int result;
+
charset = CHARSET_FROM_ID (preferred_charset_id);
- if (! CHAR_CHARSET_P (c, charset))
- charset = char_charset (c, charset_list, NULL);
+ CODING_CHAR_CHARSET_P (coding, dst, dst_end, c, charset, result);
+ if (! result)
+ CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list,
+ NULL, charset);
}
else
- charset = char_charset (c, charset_list, NULL);
+ CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list,
+ NULL, charset);
if (!charset)
{
if (coding->mode & CODING_MODE_SAFE_ENCODING)
@@ -4471,7 +4554,8 @@ encode_coding_iso_2022 (struct coding_system *coding)
else
{
c = coding->default_char;
- charset = char_charset (c, charset_list, NULL);
+ CODING_CHAR_CHARSET (coding, dst, dst_end, c,
+ charset_list, NULL, charset);
}
}
ENCODE_ISO_CHARACTER (charset, c);
@@ -4897,7 +4981,9 @@ encode_coding_sjis (struct coding_system *coding)
else
{
unsigned code;
- struct charset *charset = char_charset (c, charset_list, &code);
+ struct charset *charset;
+ CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list,
+ &code, charset);
if (!charset)
{
@@ -4909,7 +4995,8 @@ encode_coding_sjis (struct coding_system *coding)
else
{
c = coding->default_char;
- charset = char_charset (c, charset_list, &code);
+ CODING_CHAR_CHARSET (coding, dst, dst_end, c,
+ charset_list, &code, charset);
}
}
if (code == CHARSET_INVALID_CODE (charset))
@@ -4984,7 +5071,9 @@ encode_coding_big5 (struct coding_system *coding)
else
{
unsigned code;
- struct charset *charset = char_charset (c, charset_list, &code);
+ struct charset *charset;
+ CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list,
+ &code, charset);
if (! charset)
{
@@ -4996,7 +5085,8 @@ encode_coding_big5 (struct coding_system *coding)
else
{
c = coding->default_char;
- charset = char_charset (c, charset_list, &code);
+ CODING_CHAR_CHARSET (coding, dst, dst_end, c,
+ charset_list, &code, charset);
}
}
if (code == CHARSET_INVALID_CODE (charset))
@@ -5154,7 +5244,7 @@ encode_coding_ccl (struct coding_system *coding)
&& coding->mode & CODING_MODE_LAST_BLOCK)
ccl->last_block = 1;
- while (charbuf < charbuf_end)
+ do
{
ccl_driver (ccl, charbuf, destination_charbuf,
charbuf_end - charbuf, 1024, charset_list);
@@ -5176,6 +5266,7 @@ encode_coding_ccl (struct coding_system *coding)
|| ccl->status == CCL_STAT_INVALID_CMD)
break;
}
+ while (charbuf < charbuf_end);
switch (ccl->status)
{
@@ -5572,7 +5663,9 @@ encode_coding_charset (struct coding_system *coding)
}
else
{
- charset = char_charset (c, charset_list, &code);
+ CODING_CHAR_CHARSET (coding, dst, dst_end, c, charset_list,
+ &code, charset);
+
if (charset)
{
if (CHARSET_DIMENSION (charset) == 1)
@@ -8663,6 +8756,7 @@ to the string. */)
}
positions = Qnil;
+ charset_map_loaded = 0;
while (1)
{
int c;
@@ -8690,6 +8784,16 @@ to the string. */)
}
from++;
+ if (charset_map_loaded && NILP (string))
+ {
+ p = CHAR_POS_ADDR (from);
+ pend = CHAR_POS_ADDR (to);
+ if (from < GPT && to >= GPT)
+ stop = GPT_ADDR;
+ else
+ stop = pend;
+ charset_map_loaded = 0;
+ }
}
return (NILP (count) ? Fcar (positions) : Fnreverse (positions));
@@ -9208,7 +9312,7 @@ frame's terminal device. */)
= TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1));
Lisp_Object coding_system = CODING_ID_NAME (terminal_coding->id);
- /* For backward compatibility, return nil if it is `undecided'. */
+ /* For backward compatibility, return nil if it is `undecided'. */
return (! EQ (coding_system, Qundecided) ? coding_system : Qnil);
}
@@ -9895,8 +9999,6 @@ usage: (define-coding-system-internal ...) */)
{
Lisp_Object bom;
- CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
-
if (nargs < coding_arg_utf8_max)
goto short_args;
@@ -9910,6 +10012,8 @@ usage: (define-coding-system-internal ...) */)
CHECK_CODING_SYSTEM (val);
}
ASET (attrs, coding_attr_utf_bom, bom);
+ if (NILP (bom))
+ CODING_ATTR_ASCII_COMPAT (attrs) = Qt;
category = (CONSP (bom) ? coding_category_utf_8_auto
: NILP (bom) ? coding_category_utf_8_nosig
diff --git a/src/coding.h b/src/coding.h
index 2621928adc3..b694e6c6b6e 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -457,7 +457,7 @@ struct coding_system
/* Number of error source data found in a decoding routine. */
int errors;
- /* Store the positions of error source data. */
+ /* Store the positions of error source data. */
EMACS_INT *error_positions;
/* Finish status of code conversion. */
diff --git a/src/data.c b/src/data.c
index e8d2b43198f..0ebb17a2e01 100644
--- a/src/data.c
+++ b/src/data.c
@@ -839,7 +839,7 @@ do_symval_forwarding (register union Lisp_Fwd *valcontents)
case Lisp_Fwd_Kboard_Obj:
/* We used to simply use current_kboard here, but from Lisp
- code, it's value is often unexpected. It seems nicer to
+ code, its value is often unexpected. It seems nicer to
allow constructions like this to work as intuitively expected:
(with-selected-frame frame
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 7984be3564b..c5448ee5e7a 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -968,7 +968,7 @@ DEFUN ("dbus-init-bus", Fdbus_init_bus, Sdbus_init_bus, 1, 1, 0,
connection = xd_initialize (bus, TRUE);
/* Add the watch functions. We pass also the bus as data, in order
- to distinguish between the busses in xd_remove_watch. */
+ to distinguish between the buses in xd_remove_watch. */
if (!dbus_connection_set_watch_functions (connection,
xd_add_watch,
xd_remove_watch,
diff --git a/src/editfns.c b/src/editfns.c
index 83cd4bd5535..7077f40e51c 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3870,7 +3870,7 @@ usage: (format STRING &rest OBJECTS) */)
enum
{
/* Maximum precision for a %f conversion such that the
- trailing output digit might be nonzero. Any precisions
+ trailing output digit might be nonzero. Any precision
larger than this will not yield useful information. */
USEFUL_PRECISION_MAX =
((1 - DBL_MIN_EXP)
diff --git a/src/emacs.c b/src/emacs.c
index 8a24b04fc2b..6f6338cefec 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -157,6 +157,8 @@ Lisp_Object Qfile_name_handler_alist;
Lisp_Object Qrisky_local_variable;
+Lisp_Object Qkill_emacs;
+
/* If non-zero, Emacs should not attempt to use a window-specific code,
but instead should use the virtual terminal under which it was started. */
int inhibit_window_system;
@@ -322,6 +324,12 @@ static void (*fatal_error_signal_hook) (void);
pthread_t main_thread;
#endif
+#ifdef HAVE_NS
+/* NS autrelease pool, for memory management. */
+static void *ns_pool;
+#endif
+
+
/* Handle bus errors, invalid instruction, etc. */
#ifndef FLOAT_CATCH_SIGILL
@@ -952,7 +960,7 @@ main (int argc, char **argv)
}
/* Command line option --no-windows is deprecated and thus not mentioned
- in the manual and usage informations. */
+ in the manual and usage information. */
if (argmatch (argv, argc, "-nw", "--no-window-system", 6, NULL, &skip_args)
|| argmatch (argv, argc, "-nw", "--no-windows", 6, NULL, &skip_args))
inhibit_window_system = 1;
@@ -1319,7 +1327,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
= argmatch (argv, argc, "-nsl", "--no-site-lisp", 11, NULL, &skip_args);
#ifdef HAVE_NS
- ns_alloc_autorelease_pool ();
+ ns_pool = ns_alloc_autorelease_pool ();
if (!noninteractive)
{
#ifdef NS_IMPL_COCOA
@@ -2019,6 +2027,10 @@ all of which are called before Emacs is actually killed. */)
shut_down_emacs (0, 0, STRINGP (arg) ? arg : Qnil);
+#ifdef HAVE_NS
+ ns_release_autorelease_pool (ns_pool);
+#endif
+
/* If we have an auto-save list file,
kill it because we are exiting Emacs deliberately (not crashing).
Do it after shut_down_emacs, which does an auto-save. */
@@ -2400,6 +2412,7 @@ syms_of_emacs (void)
{
DEFSYM (Qfile_name_handler_alist, "file-name-handler-alist");
DEFSYM (Qrisky_local_variable, "risky-local-variable");
+ DEFSYM (Qkill_emacs, "kill-emacs");
#ifndef CANNOT_DUMP
defsubr (&Sdump_emacs);
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c
index 8cde68d8303..b8d3fea66e8 100644
--- a/src/emacsgtkfixed.c
+++ b/src/emacsgtkfixed.c
@@ -1,4 +1,4 @@
-/* A Gtk Widget that inherits GtkFixed, but can be shrinked.
+/* A Gtk Widget that inherits GtkFixed, but can be shrunk.
This file is only use when compiling with Gtk+ 3.
Copyright (C) 2011 Free Software Foundation, Inc.
diff --git a/src/emacsgtkfixed.h b/src/emacsgtkfixed.h
index dbac136bd7f..c70e9a3efe3 100644
--- a/src/emacsgtkfixed.h
+++ b/src/emacsgtkfixed.h
@@ -1,4 +1,4 @@
-/* A Gtk Widget that inherits GtkFixed, but can be shrinked.
+/* A Gtk Widget that inherits GtkFixed, but can be shrunk.
This file is only use when compiling with Gtk+ 3.
Copyright (C) 2011 Free Software Foundation, Inc.
diff --git a/src/eval.c b/src/eval.c
index 32b9d366fc3..079c7ecb6c2 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1629,6 +1629,18 @@ static Lisp_Object find_handler_clause (Lisp_Object, Lisp_Object);
static int maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig,
Lisp_Object data);
+void
+process_quit_flag (void)
+{
+ Lisp_Object flag = Vquit_flag;
+ Vquit_flag = Qnil;
+ if (EQ (flag, Qkill_emacs))
+ Fkill_emacs (Qnil);
+ if (EQ (Vthrow_on_input, flag))
+ Fthrow (Vthrow_on_input, Qt);
+ Fsignal (Qquit, Qnil);
+}
+
DEFUN ("signal", Fsignal, Ssignal, 2, 2, 0,
doc: /* Signal an error. Args are ERROR-SYMBOL and associated DATA.
This function does not return.
@@ -3733,7 +3745,7 @@ When lexical binding is not being used, this variable is nil.
A value of `(t)' indicates an empty environment, otherwise it is an
alist of active lexical bindings. */);
Vinternal_interpreter_environment = Qnil;
- /* Don't export this variable to Elisp, so noone can mess with it
+ /* Don't export this variable to Elisp, so no one can mess with it
(Just imagine if someone makes it buffer-local). */
Funintern (Qinternal_interpreter_environment, Qnil);
diff --git a/src/fileio.c b/src/fileio.c
index c0f6c1d2e8e..3306085491e 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2416,15 +2416,27 @@ check_writable (const char *filename)
return (st.st_mode & S_IWRITE || S_ISDIR (st.st_mode));
#else /* not MSDOS */
#ifdef HAVE_EUIDACCESS
- return (euidaccess (filename, 2) >= 0);
-#else
+ int res = (euidaccess (filename, 2) >= 0);
+#ifdef CYGWIN
+ /* euidaccess may have returned failure because Cygwin couldn't
+ determine the file's UID or GID; if so, we return success. */
+ if (!res)
+ {
+ struct stat st;
+ if (stat (filename, &st) < 0)
+ return 0;
+ res = (st.st_uid == -1 || st.st_gid == -1);
+ }
+#endif /* CYGWIN */
+ return res;
+#else /* not HAVE_EUIDACCESS */
/* Access isn't quite right because it uses the real uid
and we really want to test with the effective uid.
But Unix doesn't give us a right way to do it.
Opening with O_WRONLY could work for an ordinary file,
but would lose for directories. */
return (access (filename, 2) >= 0);
-#endif
+#endif /* not HAVE_EUIDACCESS */
#endif /* not MSDOS */
}
@@ -4186,7 +4198,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
/* If REPLACE is non-nil and we succeeded in not replacing the
beginning or end of the buffer text with the file's contents,
call format-decode with `point' positioned at the beginning
- of the buffer and `inserted' equalling the number of
+ of the buffer and `inserted' equaling the number of
characters in the buffer. Otherwise, format-decode might
fail to correctly analyze the beginning or end of the buffer.
Hence we temporarily save `point' and `inserted' here and
diff --git a/src/font.c b/src/font.c
index 35f5703e32e..6ab65281a48 100644
--- a/src/font.c
+++ b/src/font.c
@@ -614,7 +614,7 @@ static const struct
/* Function to validate PROP's value VAL, or NULL if any value is
ok. The value is VAL or its regularized value if VAL is valid,
and Qerror if not. */
- Lisp_Object (*validater) (Lisp_Object prop, Lisp_Object val);
+ Lisp_Object (*validator) (Lisp_Object prop, Lisp_Object val);
} font_property_table[] =
{ { &QCtype, font_prop_validate_symbol },
{ &QCfoundry, font_prop_validate_symbol },
@@ -672,7 +672,7 @@ font_prop_validate (int idx, Lisp_Object prop, Lisp_Object val)
if (idx < 0)
return val;
}
- validated = (font_property_table[idx].validater) (prop, val);
+ validated = (font_property_table[idx].validator) (prop, val);
if (EQ (validated, Qerror))
signal_error ("invalid font property", Fcons (prop, val));
return validated;
@@ -825,7 +825,7 @@ font_expand_wildcards (Lisp_Object *field, int n)
range_mask = (range_mask << 1) | 1;
/* The triplet RANGE_FROM, RANGE_TO, and RANGE_MASK is a
- position-based retriction for FIELD[I]. */
+ position-based restriction for FIELD[I]. */
for (i = 0, range_from = 0, range_to = 14 - n; i < n;
i++, range_from++, range_to++, range_mask <<= 1)
{
@@ -842,7 +842,7 @@ font_expand_wildcards (Lisp_Object *field, int n)
else
{
/* The triplet FROM, TO, and MASK is a value-based
- retriction for FIELD[I]. */
+ restriction for FIELD[I]. */
int from, to;
unsigned mask;
diff --git a/src/font.h b/src/font.h
index 42fc050b670..b6c1acf4a30 100644
--- a/src/font.h
+++ b/src/font.h
@@ -621,7 +621,7 @@ struct font_driver
/* Optional.
Get coordinates of the INDEXth anchor point of the glyph whose
code is CODE. Store the coordinates in *X and *Y. Return 0 if
- the operations was successfull. Otherwise return -1. */
+ the operations was successful. Otherwise return -1. */
int (*anchor_point) (struct font *font, unsigned code, int index,
int *x, int *y);
@@ -705,7 +705,7 @@ struct font_driver
/* Chain of font drivers. There's one global font driver list
- (font_driver_list in font.c). In addition, each frame has it's own
+ (font_driver_list in font.c). In addition, each frame has its own
font driver list at FRAME_PTR->font_driver_list. */
struct font_driver_list
@@ -721,7 +721,7 @@ struct font_driver_list
/* Chain of arbitrary data specific to each font driver. Each frame
- has it's own font data list at FRAME_PTR->font_data_list. */
+ has its own font data list at FRAME_PTR->font_data_list. */
struct font_data_list
{
diff --git a/src/fontset.c b/src/fontset.c
index 7592521cc7d..281ac92f82d 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -166,7 +166,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
These structures are hidden from the other codes than this file.
The other codes handle fontsets only by their ID numbers. They
usually use the variable name `fontset' for IDs. But, in this
- file, we always use varialbe name `id' for IDs, and name `fontset'
+ file, we always use variable name `id' for IDs, and name `fontset'
for an actual fontset object, i.e., char-table.
*/
@@ -643,7 +643,7 @@ fontset_find_font (Lisp_Object fontset, int c, struct face *face, int id, int fa
if (font_has_char (f, font_object, c))
goto found;
- /* Find a font already opened, maching with the current spec,
+ /* Find a font already opened, matching with the current spec,
and supporting C. */
font_def = RFONT_DEF_FONT_DEF (rfont_def);
for (; found_index + 1 < ASIZE (vec); found_index++)
diff --git a/src/frame.c b/src/frame.c
index 039ed6543cb..bd97c5f18c7 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1929,7 +1929,7 @@ request a switch to FOCUS-FRAME, and `last-event-frame' will be
FOCUS-FRAME after reading an event typed at FRAME.
If FOCUS-FRAME is omitted or nil, any existing redirection is
-cancelled, and the frame again receives its own keystrokes.
+canceled, and the frame again receives its own keystrokes.
Focus redirection is useful for temporarily redirecting keystrokes to
a surrogate minibuffer frame when a frame doesn't have its own
diff --git a/src/ftfont.c b/src/ftfont.c
index c48346b0147..dbb2ce2745e 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -164,6 +164,13 @@ get_adstyle_property (FcPattern *p)
char *str, *end;
Lisp_Object adstyle;
+#ifdef FC_FONTFORMAT
+ if ((FcPatternGetString (p, FC_FONTFORMAT, 0, &fcstr) == FcResultMatch)
+ && xstrcasecmp ((char *) fcstr, "bdf") != 0
+ && xstrcasecmp ((char *) fcstr, "pcf") != 0)
+ /* Not a BDF nor PCF font. */
+ return Qnil;
+#endif
if (FcPatternGetString (p, FC_STYLE, 0, &fcstr) != FcResultMatch)
return Qnil;
str = (char *) fcstr;
@@ -953,7 +960,7 @@ ftfont_list (Lisp_Object frame, Lisp_Object spec)
/* Need fix because this finds any fonts. */
if (fontset->nfont == 0 && ! NILP (family))
{
- /* Try maching with configuration. For instance, the
+ /* Try matching with configuration. For instance, the
configuration may specify "Nimbus Mono L" as an alias of
"Courier". */
FcPattern *pat = FcPatternBuild (0, FC_FAMILY, FcTypeString,
diff --git a/src/ftxfont.c b/src/ftxfont.c
index 608cfd8d44d..e04e802a3db 100644
--- a/src/ftxfont.c
+++ b/src/ftxfont.c
@@ -48,8 +48,8 @@ static GC *ftxfont_get_gcs (FRAME_PTR, unsigned long, unsigned long);
static int ftxfont_draw_bitmap (FRAME_PTR, GC, GC *, struct font *,
unsigned, int, int, XPoint *, int, int *,
int);
-static void ftxfont_draw_backgrond (FRAME_PTR, struct font *, GC,
- int, int, int);
+static void ftxfont_draw_background (FRAME_PTR, struct font *, GC,
+ int, int, int);
struct ftxfont_frame_data
{
@@ -219,7 +219,8 @@ ftxfont_draw_bitmap (FRAME_PTR f, GC gc_fore, GC *gcs, struct font *font, unsign
}
static void
-ftxfont_draw_backgrond (FRAME_PTR f, struct font *font, GC gc, int x, int y, int width)
+ftxfont_draw_background (FRAME_PTR f, struct font *font, GC gc, int x, int y,
+ int width)
{
XGCValues xgcv;
@@ -296,7 +297,7 @@ ftxfont_draw (struct glyph_string *s, int from, int to, int x, int y, int with_b
BLOCK_INPUT;
if (with_background)
- ftxfont_draw_backgrond (f, font, s->gc, x, y, s->width);
+ ftxfont_draw_background (f, font, s->gc, x, y, s->width);
code = alloca (sizeof (unsigned) * len);
for (i = 0; i < len; i++)
code[i] = ((XCHAR2B_BYTE1 (s->char2b + from + i) << 8)
diff --git a/src/image.c b/src/image.c
index 81907d8e580..3d189a5504b 100644
--- a/src/image.c
+++ b/src/image.c
@@ -7564,6 +7564,22 @@ extern WandExport void PixelGetMagickColor (const PixelWand *,
MagickPixelPacket *);
#endif
+/* Log ImageMagick error message.
+ Useful when a ImageMagick function returns the status `MagickFalse'. */
+
+static void
+imagemagick_error (MagickWand *wand)
+{
+ char *description;
+ ExceptionType severity;
+
+ description = MagickGetException (wand, &severity);
+ image_error ("ImageMagick error: %s",
+ make_string (description, strlen (description)),
+ Qnil);
+ description = (char *) MagickRelinquishMemory (description);
+}
+
/* Helper function for imagemagick_load, which does the actual loading
given contents and size, apart from frame and image structures,
passed from imagemagick_load. Uses librimagemagick to do most of
@@ -7618,6 +7634,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
image = image_spec_value (img->spec, QCindex, NULL);
ino = INTEGERP (image) ? XFASTINT (image) : 0;
ping_wand = NewMagickWand ();
+ /* MagickSetResolution (ping_wand, 2, 2); (Bug#10112) */
if (filename != NULL)
{
@@ -7628,7 +7645,12 @@ imagemagick_load_image (struct frame *f, struct image *img,
status = MagickPingImageBlob (ping_wand, contents, size);
}
- MagickSetResolution (ping_wand, 2, 2);
+ if (status == MagickFalse)
+ {
+ imagemagick_error (ping_wand);
+ DestroyMagickWand (ping_wand);
+ return 0;
+ }
if (! (0 <= ino && ino < MagickGetNumberImages (ping_wand)))
{
@@ -7669,7 +7691,10 @@ imagemagick_load_image (struct frame *f, struct image *img,
{
image_wand = NewMagickWand ();
if (MagickReadImageBlob (image_wand, contents, size) == MagickFalse)
- goto imagemagick_error;
+ {
+ imagemagick_error (image_wand);
+ goto imagemagick_error;
+ }
}
/* If width and/or height is set in the display spec assume we want
@@ -7697,6 +7722,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
if (status == MagickFalse)
{
image_error ("Imagemagick scale failed", Qnil, Qnil);
+ imagemagick_error (image_wand);
goto imagemagick_error;
}
}
@@ -7751,6 +7777,7 @@ imagemagick_load_image (struct frame *f, struct image *img,
if (status == MagickFalse)
{
image_error ("Imagemagick image rotate failed", Qnil, Qnil);
+ imagemagick_error (image_wand);
goto imagemagick_error;
}
}
@@ -7975,7 +8002,7 @@ recognize as images, such as C. See `imagemagick-types-inhibit'. */)
Qimagemagicktype = intern (imtypes[i]);
typelist = Fcons (Qimagemagicktype, typelist);
}
- return typelist;
+ return Fnreverse (typelist);
}
#endif /* defined (HAVE_IMAGEMAGICK) */
diff --git a/src/keyboard.c b/src/keyboard.c
index 656634b8d31..7873dca3a0e 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -467,7 +467,8 @@ static void input_available_signal (int signo);
static Lisp_Object (Fcommand_execute) (Lisp_Object, Lisp_Object, Lisp_Object,
Lisp_Object);
static void handle_interrupt (void);
-static void quit_throw_to_read_char (void) NO_RETURN;
+static void quit_throw_to_read_char (int) NO_RETURN;
+static void process_special_events (void);
static void timer_start_idle (void);
static void timer_stop_idle (void);
static void timer_resume_idle (void);
@@ -656,7 +657,7 @@ echo_now (void)
echo_kboard = current_kboard;
if (waiting_for_input && !NILP (Vquit_flag))
- quit_throw_to_read_char ();
+ quit_throw_to_read_char (0);
}
/* Turn off echoing, for the start of a new command. */
@@ -3820,7 +3821,7 @@ kbd_buffer_get_event (KBOARD **kbp,
/* If the quit flag is set, then read_char will return
quit_char, so that counts as "available input." */
if (!NILP (Vquit_flag))
- quit_throw_to_read_char ();
+ quit_throw_to_read_char (0);
/* One way or another, wait until input is available; then, if
interrupt handlers have not read it, read it now. */
@@ -4155,14 +4156,12 @@ kbd_buffer_get_event (KBOARD **kbp,
return (obj);
}
-/* Process any events that are not user-visible,
- then return, without reading any user-visible events. */
+/* Process any non-user-visible events (currently X selection events),
+ without reading any user-visible events. */
-void
-swallow_events (int do_display)
+static void
+process_special_events (void)
{
- int old_timers_run;
-
while (kbd_fetch_ptr != kbd_store_ptr)
{
struct input_event *event;
@@ -4197,6 +4196,17 @@ swallow_events (int do_display)
else
break;
}
+}
+
+/* Process any events that are not user-visible, run timer events that
+ are ripe, and return, without reading any user-visible events. */
+
+void
+swallow_events (int do_display)
+{
+ int old_timers_run;
+
+ process_special_events ();
old_timers_run = timers_run;
get_input_pending (&input_pending, READABLE_EVENTS_DO_TIMERS_NOW);
@@ -10538,6 +10548,9 @@ if there is a doubt, the value is t. */)
|| !NILP (Vunread_input_method_events))
return (Qt);
+ /* Process non-user-visible events (Bug#10195). */
+ process_special_events ();
+
get_input_pending (&input_pending,
READABLE_EVENTS_DO_TIMERS_NOW
| READABLE_EVENTS_FILTER_EVENTS);
@@ -10840,7 +10853,7 @@ set_waiting_for_input (struct timeval *time_to_clear)
/* If handle_interrupt was called before and buffered a C-g,
make it run again now, to avoid timing error. */
if (!NILP (Vquit_flag))
- quit_throw_to_read_char ();
+ quit_throw_to_read_char (0);
}
void
@@ -10855,7 +10868,7 @@ clear_waiting_for_input (void)
If we have a frame on the controlling tty, we assume that the
SIGINT was generated by C-g, so we call handle_interrupt.
- Otherwise, the handler kills Emacs. */
+ Otherwise, tell QUIT to kill Emacs. */
static void
interrupt_signal (int signalnum) /* If we don't have an argument, some */
@@ -10872,12 +10885,10 @@ interrupt_signal (int signalnum) /* If we don't have an argument, some */
if (!terminal)
{
/* If there are no frames there, let's pretend that we are a
- well-behaving UN*X program and quit. We cannot do that while
- GC is in progress, though. */
- if (!gc_in_progress && !waiting_for_input)
- Fkill_emacs (Qnil);
- else
- Vquit_flag = Qt;
+ well-behaving UN*X program and quit. We must not call Lisp
+ in a signal handler, so tell QUIT to exit when it is
+ safe. */
+ Vquit_flag = Qkill_emacs;
}
else
{
@@ -11026,15 +11037,20 @@ handle_interrupt (void)
separate event loop thread like W32. */
#ifndef HAVE_NS
if (waiting_for_input && !echoing)
- quit_throw_to_read_char ();
+ quit_throw_to_read_char (1);
#endif
}
/* Handle a C-g by making read_char return C-g. */
static void
-quit_throw_to_read_char (void)
+quit_throw_to_read_char (int from_signal)
{
+ /* When not called from a signal handler it is safe to call
+ Lisp. */
+ if (!from_signal && EQ (Vquit_flag, Qkill_emacs))
+ Fkill_emacs (Qnil);
+
sigfree ();
/* Prevent another signal from doing this before we finish. */
clear_waiting_for_input ();
@@ -12265,7 +12281,7 @@ text in the region before modifying the buffer. The next
DEFVAR_LISP ("debug-on-event",
Vdebug_on_event,
doc: /* Enter debugger on this event. When Emacs
-receives the special event specifed by this variable, it will try to
+receives the special event specified by this variable, it will try to
break into the debugger as soon as possible instead of processing the
event normally through `special-event-map'.
diff --git a/src/lastfile.c b/src/lastfile.c
index d348e4ebb07..ab07e748930 100644
--- a/src/lastfile.c
+++ b/src/lastfile.c
@@ -23,7 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
The files of Emacs are written so as to have no initialized
data that can ever need to be altered except at the first startup.
- This is so that those words can be dumped as sharable text.
+ This is so that those words can be dumped as shareable text.
It is not possible to exercise such control over library files.
So it is necessary to refrain from making their data areas shared.
@@ -47,4 +47,3 @@ char my_endbss[1];
of the bss area used by Emacs. */
static char _my_endbss[1];
char * my_endbss_static = _my_endbss;
-
diff --git a/src/lisp.h b/src/lisp.h
index 6b19396111c..036f1b13330 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2132,7 +2132,10 @@ extern char *stack_bottom;
Exception: if you set immediate_quit to nonzero,
then the handler that responds to the C-g does the quit itself.
This is a good thing to do around a loop that has no side effects
- and (in particular) cannot call arbitrary Lisp code. */
+ and (in particular) cannot call arbitrary Lisp code.
+
+ If quit-flag is set to `kill-emacs' the SIGINT handler has received
+ a request to exit Emacs when it is safe to do. */
#ifdef SYNC_INPUT
extern void process_pending_signals (void);
@@ -2144,16 +2147,11 @@ extern int pending_signals;
#define ELSE_PENDING_SIGNALS
#endif /* not SYNC_INPUT */
+extern void process_quit_flag (void);
#define QUIT \
do { \
if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \
- { \
- Lisp_Object flag = Vquit_flag; \
- Vquit_flag = Qnil; \
- if (EQ (Vthrow_on_input, flag)) \
- Fthrow (Vthrow_on_input, Qt); \
- Fsignal (Qquit, Qnil); \
- } \
+ process_quit_flag (); \
ELSE_PENDING_SIGNALS \
} while (0)
@@ -3295,6 +3293,7 @@ extern Lisp_Object Qfile_name_handler_alist;
#ifdef FLOAT_CATCH_SIGILL
extern void fatal_error_signal (int);
#endif
+extern Lisp_Object Qkill_emacs;
EXFUN (Fkill_emacs, 1) NO_RETURN;
#if HAVE_SETLOCALE
void fixup_locale (void);
diff --git a/src/lread.c b/src/lread.c
index cdbd09d2f89..7c0b0475786 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2822,7 +2822,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
So we now use the same heuristic as for backquote: old-style
unquotes are only recognized when first on a list, and when
followed by a space.
- Because it's more difficult to peak 2 chars ahead, a new-style
+ Because it's more difficult to peek 2 chars ahead, a new-style
,@ can still not be used outside of a `, unless it's in the middle
of a list. */
if (new_backquote_flag
@@ -4180,13 +4180,16 @@ init_lread (void)
}
/* Add site-lisp under the installation dir, if it exists. */
- tem = Fexpand_file_name (build_string ("site-lisp"),
- Vinstallation_directory);
- tem1 = Ffile_exists_p (tem);
- if (!NILP (tem1))
+ if (!no_site_lisp)
{
- if (NILP (Fmember (tem, Vload_path)))
- Vload_path = Fcons (tem, Vload_path);
+ tem = Fexpand_file_name (build_string ("site-lisp"),
+ Vinstallation_directory);
+ tem1 = Ffile_exists_p (tem);
+ if (!NILP (tem1))
+ {
+ if (NILP (Fmember (tem, Vload_path)))
+ Vload_path = Fcons (tem, Vload_path);
+ }
}
/* If Emacs was not built in the source directory,
@@ -4222,11 +4225,14 @@ init_lread (void)
if (NILP (Fmember (tem, Vload_path)))
Vload_path = Fcons (tem, Vload_path);
- tem = Fexpand_file_name (build_string ("site-lisp"),
- Vsource_directory);
+ if (!no_site_lisp)
+ {
+ tem = Fexpand_file_name (build_string ("site-lisp"),
+ Vsource_directory);
- if (NILP (Fmember (tem, Vload_path)))
- Vload_path = Fcons (tem, Vload_path);
+ if (NILP (Fmember (tem, Vload_path)))
+ Vload_path = Fcons (tem, Vload_path);
+ }
}
}
if (!NILP (sitelisp) && !no_site_lisp)
diff --git a/src/minibuf.c b/src/minibuf.c
index 7ece5764203..ad5625e9ee9 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -905,26 +905,36 @@ DEFUN ("read-from-minibuffer", Fread_from_minibuffer,
The optional second arg INITIAL-CONTENTS is an obsolete alternative to
DEFAULT-VALUE. It normally should be nil in new code, except when
HIST is a cons. It is discussed in more detail below.
+
Third arg KEYMAP is a keymap to use whilst reading;
if omitted or nil, the default is `minibuffer-local-map'.
-If fourth arg READ is non-nil, then interpret the result as a Lisp object
+
+If fourth arg READ is non-nil, interpret the result as a Lisp object
and return that object:
in other words, do `(car (read-from-string INPUT-STRING))'
+
Fifth arg HIST, if non-nil, specifies a history list and optionally
the initial position in the list. It can be a symbol, which is the
- history list variable to use, or it can be a cons cell
- (HISTVAR . HISTPOS). In that case, HISTVAR is the history list variable
- to use, and HISTPOS is the initial position for use by the minibuffer
- history commands. For consistency, you should also specify that
- element of the history as the value of INITIAL-CONTENTS. Positions
- are counted starting from 1 at the beginning of the list.
-Sixth arg DEFAULT-VALUE is a default value or list of default values.
- If non-nil, it is available via history commands. If READ is
- non-nil, it is also the default to `read' if the user enters empty
- input. If READ is non-nil, `read-from-minibuffer' does NOT return
- DEFAULT-VALUE for empty input! It returns the empty string.
+ history list variable to use, or a cons cell (HISTVAR . HISTPOS).
+ In that case, HISTVAR is the history list variable to use, and
+ HISTPOS is the initial position for use by the minibuffer history
+ commands. For consistency, you should also specify that element of
+ the history as the value of INITIAL-CONTENTS. Positions are counted
+ starting from 1 at the beginning of the list.
+
+Sixth arg DEFAULT-VALUE, if non-nil, should be a string, which is used
+ as the default to `read' if READ is non-nil and the user enters
+ empty input. But if READ is nil, this function does _not_ return
+ DEFAULT-VALUE for empty input! Instead, it returns the empty string.
+
+ Whatever the value of READ, DEFAULT-VALUE is made available via the
+ minibuffer history commands. DEFAULT-VALUE can also be a list of
+ strings, in which case all the strings are available in the history,
+ and the first string is the default to `read' if READ is non-nil.
+
Seventh arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits
the current input method and the setting of `enable-multibyte-characters'.
+
If the variable `minibuffer-allow-text-properties' is non-nil,
then the string which is returned includes whatever text properties
were present in the minibuffer. Otherwise the value has no text properties.
diff --git a/src/nsfns.m b/src/nsfns.m
index 280fee0b27b..e41b77e242a 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -394,9 +394,8 @@ x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
if (face)
{
col = ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), f);
- face->background
- = (EMACS_UINT) [[col colorWithAlphaComponent: alpha] retain];
- [col release];
+ face->background = ns_index_color
+ ([col colorWithAlphaComponent: alpha], f);
update_face_from_frame_parameter (f, Qbackground_color, arg);
}
@@ -770,7 +769,7 @@ ns_implicitly_set_icon_type (struct frame *f)
{
Lisp_Object tem;
EmacsView *view = FRAME_NS_VIEW (f);
- id image =nil;
+ id image = nil;
Lisp_Object chain, elt;
NSAutoreleasePool *pool;
BOOL setMini = YES;
@@ -797,7 +796,7 @@ ns_implicitly_set_icon_type (struct frame *f)
}
for (chain = Vns_icon_type_alist;
- (image = nil) && CONSP (chain);
+ image == nil && CONSP (chain);
chain = XCDR (chain))
{
elt = XCAR (chain);
@@ -1076,7 +1075,41 @@ unwind_create_frame (Lisp_Object frame)
return Qnil;
}
+/*
+ * Read geometry related parameters from preferences if not in PARMS.
+ * Returns the union of parms and any preferences read.
+ */
+static Lisp_Object
+get_geometry_from_preferences (struct ns_display_info *dpyinfo,
+ Lisp_Object parms)
+{
+ struct {
+ const char *val;
+ const char *cls;
+ Lisp_Object tem;
+ } r[] = {
+ { "width", "Width", Qwidth },
+ { "height", "Height", Qheight },
+ { "left", "Left", Qleft },
+ { "top", "Top", Qtop },
+ };
+
+ int i;
+ for (i = 0; i < sizeof (r)/sizeof (r[0]); ++i)
+ {
+ if (NILP (Fassq (r[i].tem, parms)))
+ {
+ Lisp_Object value
+ = x_get_arg (dpyinfo, parms, r[i].tem, r[i].val, r[i].cls,
+ RES_TYPE_NUMBER);
+ if (! EQ (value, Qunbound))
+ parms = Fcons (Fcons (r[i].tem, value), parms);
+ }
+ }
+
+ return parms;
+}
/* ==========================================================================
@@ -1285,6 +1318,7 @@ This function is an internal primitive--use `make-frame' instead. */)
x_default_parameter (f, parms, Qtitle, Qnil, "title", "Title",
RES_TYPE_STRING);
+ parms = get_geometry_from_preferences (dpyinfo, parms);
window_prompting = x_figure_window_size (f, parms, 1);
tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
@@ -1511,6 +1545,17 @@ Optional arg INIT, if non-nil, provides a default file name to use. */)
return ret ? fname : Qnil;
}
+const char *
+ns_get_defaults_value (const char *key)
+{
+ NSObject *obj = [[NSUserDefaults standardUserDefaults]
+ objectForKey: [NSString stringWithUTF8String: key]];
+
+ if (!obj) return NULL;
+
+ return [[NSString stringWithFormat: @"%@", obj] UTF8String];
+}
+
DEFUN ("ns-get-resource", Fns_get_resource, Sns_get_resource, 2, 2, 0,
doc: /* Return the value of the property NAME of OWNER from the defaults database.
@@ -1525,9 +1570,7 @@ If OWNER is nil, Emacs is assumed. */)
CHECK_STRING (name);
/*fprintf (stderr, "ns-get-resource checking resource '%s'\n", SDATA (name)); */
- value =[[[NSUserDefaults standardUserDefaults]
- objectForKey: [NSString stringWithUTF8String: SDATA (name)]]
- UTF8String];
+ value = ns_get_defaults_value (SDATA (name));
if (value)
return build_string (value);
@@ -2182,8 +2225,7 @@ x_get_string_resource (XrmDatabase rdb, char *name, char *class)
/* --quick was passed, so this is a no-op. */
return NULL;
- res = [[[NSUserDefaults standardUserDefaults] objectForKey:
- [NSString stringWithUTF8String: toCheck]] UTF8String];
+ res = ns_get_defaults_value (toCheck);
return !res ? NULL :
(!strncasecmp (res, "YES", 3) ? "true" :
(!strncasecmp (res, "NO", 2) ? "false" : res));
diff --git a/src/nsfont.m b/src/nsfont.m
index 7d691ced6e1..eb57f5e5953 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -126,8 +126,8 @@ ns_attribute_fvalue (NSFontDescriptor *fdesc, NSString *trait)
/* Converts FONT_WEIGHT, FONT_SLANT, FONT_WIDTH, plus family and script/lang
to NSFont descriptor. Information under extra only needed for matching. */
#define STYLE_REF 100
-static NSFontDescriptor
-*ns_spec_to_descriptor(Lisp_Object font_spec)
+static NSFontDescriptor *
+ns_spec_to_descriptor (Lisp_Object font_spec)
{
NSFontDescriptor *fdesc;
NSMutableDictionary *fdAttrs = [NSMutableDictionary new];
@@ -152,8 +152,13 @@ static NSFontDescriptor
[fdAttrs setObject: tdict forKey: NSFontTraitsAttribute];
fdesc = [NSFontDescriptor fontDescriptorWithFontAttributes: fdAttrs];
- if (family != nil)
+ if (family != nil)
+ {
fdesc = [fdesc fontDescriptorWithFamily: family];
+ }
+
+ [fdAttrs release];
+ [tdict release];
return fdesc;
}
@@ -469,6 +474,7 @@ static NSSet
if ([families count] > 0 || pct < 0.05)
break;
}
+ [charset release];
}
#ifdef NS_IMPL_COCOA
if ([families count] == 0)
@@ -536,12 +542,14 @@ ns_findfonts (Lisp_Object font_spec, BOOL isMatch)
family = [fdesc objectForKey: NSFontFamilyAttribute];
if (family != nil && !foundItal && XINT (Flength (list)) > 0)
{
- NSFontDescriptor *sDesc = [[[NSFontDescriptor new]
- fontDescriptorWithSymbolicTraits: NSFontItalicTrait]
- fontDescriptorWithFamily: family];
+ NSFontDescriptor *s1 = [NSFontDescriptor new];
+ NSFontDescriptor *sDesc
+ = [[s1 fontDescriptorWithSymbolicTraits: NSFontItalicTrait]
+ fontDescriptorWithFamily: family];
list = Fcons (ns_descriptor_to_entity (sDesc,
AREF (font_spec, FONT_EXTRA_INDEX),
"synthItal"), list);
+ [s1 release];
}
/* Return something if was a match and nothing found. */
@@ -630,7 +638,7 @@ nsfont_list (Lisp_Object frame, Lisp_Object font_spec)
}
-/* Return a font entity most closely maching with FONT_SPEC on
+/* Return a font entity most closely matching with FONT_SPEC on
FRAME. The closeness is determined by the font backend, thus
`face-font-selection-order' is ignored here.
Properties to be considered are same as for list(). */
@@ -1293,7 +1301,7 @@ ns_uni_to_glyphs (struct nsfont_info *font_info, unsigned char block)
abort ();
/* create a string containing all Unicode characters in this block */
- for (idx = block<<8, i =0; i<0x100; idx++, i++)
+ for (idx = block<<8, i = 0; i < 0x100; idx++, i++)
if (idx < 0xD800 || idx > 0xDFFF)
unichars[i] = idx;
else
@@ -1309,7 +1317,7 @@ ns_uni_to_glyphs (struct nsfont_info *font_info, unsigned char block)
NSGlyphGenerator *glyphGenerator = [NSGlyphGenerator sharedGlyphGenerator];
/*NSCharacterSet *coveredChars = [nsfont coveredCharacterSet]; */
unsigned int numGlyphs = [font_info->nsfont numberOfGlyphs];
- NSUInteger gInd =0, cInd =0;
+ NSUInteger gInd = 0, cInd = 0;
[glyphStorage setString: allChars font: font_info->nsfont];
[glyphGenerator generateGlyphsForGlyphStorage: glyphStorage
@@ -1317,7 +1325,7 @@ ns_uni_to_glyphs (struct nsfont_info *font_info, unsigned char block)
glyphIndex: &gInd characterIndex: &cInd];
#endif
glyphs = font_info->glyphs[block];
- for (i =0; i<0x100; i++, glyphs++)
+ for (i = 0; i < 0x100; i++, glyphs++)
{
#ifdef NS_IMPL_GNUSTEP
g = unichars[i];
@@ -1425,6 +1433,8 @@ ns_glyph_metrics (struct nsfont_info *font_info, unsigned char block)
- (void) setString: (NSString *)str font: (NSFont *)font
{
[dict setObject: font forKey: NSFontAttributeName];
+ if (attrStr != nil)
+ [attrStr release];
attrStr = [[NSAttributedString alloc] initWithString: str attributes: dict];
maxChar = [str length];
maxGlyph = 0;
diff --git a/src/nsmenu.m b/src/nsmenu.m
index 951282910ac..94c6b6a6198 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -74,6 +74,10 @@ EmacsMenu *mainMenu, *svcsMenu, *dockMenu;
static int popup_activated_flag;
static NSModalSession popupSession;
+/* Nonzero means we are tracking and updating menus. */
+static int trackingMenu;
+
+
/* NOTE: toolbar implementation is at end,
following complete menu implementation. */
@@ -400,6 +404,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu)
items = FRAME_MENU_BAR_ITEMS (f);
if (NILP (items))
{
+ free_menubar_widget_value_tree (first_wv);
[pool release];
UNBLOCK_INPUT;
return;
@@ -427,6 +432,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu)
if (i == n)
{
+ free_menubar_widget_value_tree (first_wv);
[pool release];
UNBLOCK_INPUT;
return;
@@ -543,21 +549,44 @@ set_frame_menubar (struct frame *f, int first_time, int deep_p)
frame = f;
}
+#ifdef NS_IMPL_COCOA
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
+extern NSString *NSMenuDidBeginTrackingNotification;
+#endif
+#endif
+
+#ifdef NS_IMPL_COCOA
+-(void)trackingNotification:(NSNotification *)notification
+{
+ /* Update menu in menuNeedsUpdate only while tracking menus. */
+ trackingMenu = ([notification name] == NSMenuDidBeginTrackingNotification
+ ? 1 : 0);
+}
+#endif
/* delegate method called when a submenu is being opened: run a 'deep' call
to set_frame_menubar */
- (void)menuNeedsUpdate: (NSMenu *)menu
{
- NSEvent *event;
if (!FRAME_LIVE_P (frame))
return;
- event = [[FRAME_NS_VIEW (frame) window] currentEvent];
- /* HACK: Cocoa/Carbon will request update on every keystroke
+
+ /* Cocoa/Carbon will request update on every keystroke
via IsMenuKeyEvent -> CheckMenusForKeyEvent. These are not needed
since key equivalents are handled through emacs.
- On Leopard, even keystroke events generate SystemDefined events, but
- their subtype is 8. */
- if ([event type] != NSSystemDefined || [event subtype] == 8
+ On Leopard, even keystroke events generate SystemDefined event.
+ Third-party applications that enhance mouse / trackpad
+ interaction, or also VNC/Remote Desktop will send events
+ of type AppDefined rather than SysDefined.
+ Menus will fail to show up if they haven't been initialized.
+ AppDefined events may lack timing data.
+
+ Thus, we rely on the didBeginTrackingNotification notification
+ as above to indicate the need for updates.
+ From 10.6 on, we could also use -[NSMenu propertiesToUpdate]: In the
+ key press case, NSMenuPropertyItemImage (e.g.) won't be set.
+ */
+ if (trackingMenu == 0
/* Also, don't try this if from an event picked up asynchronously,
as lots of lisp evaluation happens in ns_update_menubar. */
|| handling_signal != 0)
@@ -1795,6 +1824,11 @@ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_
void
syms_of_nsmenu (void)
{
+#ifndef NS_IMPL_COCOA
+ /* Don't know how to keep track of this in Next/Open/Gnustep. Always
+ update menus there. */
+ trackingMenu = 1;
+#endif
defsubr (&Sx_popup_dialog);
defsubr (&Sns_reset_menu);
defsubr (&Smenu_or_popup_active_p);
diff --git a/src/nsselect.m b/src/nsselect.m
index 867cf3252e5..928eb8652dc 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -35,8 +35,6 @@ GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
#include "termhooks.h"
#include "keyboard.h"
-#define CUT_BUFFER_SUPPORT
-
Lisp_Object QCLIPBOARD, QSECONDARY, QTEXT, QFILE_NAME;
static Lisp_Object Vselection_alist;
@@ -60,13 +58,18 @@ static NSString *
symbol_to_nsstring (Lisp_Object sym)
{
CHECK_SYMBOL (sym);
- if (EQ (sym, QCLIPBOARD)) return NSGeneralPboard;
+ if (EQ (sym, QCLIPBOARD)) return NSGeneralPboard;
if (EQ (sym, QPRIMARY)) return NXPrimaryPboard;
if (EQ (sym, QSECONDARY)) return NXSecondaryPboard;
if (EQ (sym, QTEXT)) return NSStringPboardType;
return [NSString stringWithUTF8String: SDATA (XSYMBOL (sym)->xname)];
}
+static NSPasteboard *
+ns_symbol_to_pb (Lisp_Object symbol)
+{
+ return [NSPasteboard pasteboardWithName: symbol_to_nsstring (symbol)];
+}
static Lisp_Object
ns_string_to_symbol (NSString *t)
@@ -230,70 +233,11 @@ static Lisp_Object
ns_get_foreign_selection (Lisp_Object symbol, Lisp_Object target)
{
id pb;
- pb =[NSPasteboard pasteboardWithName: symbol_to_nsstring (symbol)];
- return ns_string_from_pasteboard (pb);
-}
-
-
-static void
-ns_handle_selection_request (struct input_event *event)
-{
- // FIXME: BIG UGLY HACK!!!
- id pb = (id)*(EMACS_INT*)&(event->x);
- NSString *type = (NSString *)*(EMACS_INT*)&(event->y);
- Lisp_Object selection_name, selection_data, target_symbol, data;
- Lisp_Object successful_p, rest;
-
- selection_name = ns_string_to_symbol ([(NSPasteboard *)pb name]);
- target_symbol = ns_string_to_symbol (type);
- selection_data = assq_no_quit (selection_name, Vselection_alist);
- successful_p = Qnil;
-
- if (!NILP (selection_data))
- {
- data = ns_get_local_selection (selection_name, target_symbol);
- if (!NILP (data))
- {
- if (STRINGP (data))
- ns_string_to_pasteboard_internal (pb, data, type);
- successful_p = Qt;
- }
- }
-
- if (!EQ (Vns_sent_selection_hooks, Qunbound))
- {
- for (rest = Vns_sent_selection_hooks; CONSP (rest); rest = Fcdr (rest))
- call3 (Fcar (rest), selection_name, target_symbol, successful_p);
- }
+ pb = ns_symbol_to_pb (symbol);
+ return pb != nil ? ns_string_from_pasteboard (pb) : Qnil;
}
-static void
-ns_handle_selection_clear (struct input_event *event)
-{
- id pb = (id)*(EMACS_INT*)&(event->x);
- Lisp_Object selection_name, selection_data, rest;
-
- selection_name = ns_string_to_symbol ([(NSPasteboard *)pb name]);
- selection_data = assq_no_quit (selection_name, Vselection_alist);
- if (NILP (selection_data)) return;
-
- if (EQ (selection_data, Fcar (Vselection_alist)))
- Vselection_alist = Fcdr (Vselection_alist);
- else
- {
- for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
- if (EQ (selection_data, Fcar (Fcdr (rest))))
- Fsetcdr (rest, Fcdr (Fcdr (rest)));
- }
-
- if (!EQ (Vns_lost_selection_hooks, Qunbound))
- {
- for (rest = Vns_lost_selection_hooks;CONSP (rest); rest = Fcdr (rest))
- call1 (Fcar (rest), selection_name);
- }
-}
-
/* ==========================================================================
@@ -401,29 +345,44 @@ anything that the functions on `selection-converter-alist' know about. */)
{
id pb;
Lisp_Object old_value, new_value;
+ NSString *type;
+ Lisp_Object successful_p = Qnil, rest;
+ Lisp_Object target_symbol, data;
+
check_ns ();
CHECK_SYMBOL (selection_name);
if (NILP (selection_value))
error ("selection-value may not be nil.");
- pb =[NSPasteboard pasteboardWithName: symbol_to_nsstring (selection_name)];
+ pb = ns_symbol_to_pb (selection_name);
+ if (pb == nil) return Qnil;
+
ns_declare_pasteboard (pb);
old_value = assq_no_quit (selection_name, Vselection_alist);
new_value = Fcons (selection_name, Fcons (selection_value, Qnil));
+
if (NILP (old_value))
Vselection_alist = Fcons (new_value, Vselection_alist);
else
Fsetcdr (old_value, Fcdr (new_value));
- /* XXX An evil hack, but a necessary one I fear XXX */
- {
- struct input_event ev;
- ev.kind = SELECTION_REQUEST_EVENT;
- ev.modifiers = 0;
- ev.code = 0;
- *(EMACS_INT*)(&(ev.x)) = (EMACS_INT)pb; // FIXME: BIG UGLY HACK!!
- *(EMACS_INT*)(&(ev.y)) = (EMACS_INT)NSStringPboardType;
- ns_handle_selection_request (&ev);
- }
+
+ /* We only support copy of text. */
+ type = NSStringPboardType;
+ target_symbol = ns_string_to_symbol (type);
+ data = ns_get_local_selection (selection_name, target_symbol);
+ if (!NILP (data))
+ {
+ if (STRINGP (data))
+ ns_string_to_pasteboard_internal (pb, data, type);
+ successful_p = Qt;
+ }
+
+ if (!EQ (Vns_sent_selection_hooks, Qunbound))
+ {
+ for (rest = Vns_sent_selection_hooks; CONSP (rest); rest = Fcdr (rest))
+ call3 (Fcar (rest), selection_name, target_symbol, successful_p);
+ }
+
return selection_value;
}
@@ -438,8 +397,8 @@ DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal,
CHECK_SYMBOL (selection_name);
if (NILP (assq_no_quit (selection_name, Vselection_alist))) return Qnil;
- pb =[NSPasteboard pasteboardWithName: symbol_to_nsstring (selection_name)];
- ns_undeclare_pasteboard (pb);
+ pb = ns_symbol_to_pb (selection_name);
+ if (pb != nil) ns_undeclare_pasteboard (pb);
return Qt;
}
@@ -460,8 +419,10 @@ and t is the same as `SECONDARY'.) */)
CHECK_SYMBOL (selection);
if (EQ (selection, Qnil)) selection = QPRIMARY;
if (EQ (selection, Qt)) selection = QSECONDARY;
- pb =[NSPasteboard pasteboardWithName: symbol_to_nsstring (selection)];
- types =[pb types];
+ pb = ns_symbol_to_pb (selection);
+ if (pb == nil) return Qnil;
+
+ types = [pb types];
return ([types count] == 0) ? Qnil : Qt;
}
@@ -511,45 +472,31 @@ TYPE is the type of data desired, typically `STRING'. */)
}
-#ifdef CUT_BUFFER_SUPPORT
-DEFUN ("ns-get-cut-buffer-internal", Fns_get_cut_buffer_internal,
- Sns_get_cut_buffer_internal, 1, 1, 0,
- doc: /* Returns the value of the named cut buffer. */)
- (Lisp_Object buffer)
+DEFUN ("ns-get-selection-internal", Fns_get_selection_internal,
+ Sns_get_selection_internal, 1, 1, 0,
+ doc: /* Returns the value of SELECTION as a string.
+SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. */)
+ (Lisp_Object selection)
{
id pb;
check_ns ();
- pb =[NSPasteboard pasteboardWithName: symbol_to_nsstring (buffer)];
- return ns_string_from_pasteboard (pb);
+ pb = ns_symbol_to_pb (selection);
+ return pb != nil ? ns_string_from_pasteboard (pb) : Qnil;
}
-DEFUN ("ns-rotate-cut-buffers-internal", Fns_rotate_cut_buffers_internal,
- Sns_rotate_cut_buffers_internal, 1, 1, 0,
- doc: /* Rotate the values of the cut buffers by N steps.
-Positive N means move values forward, negative means
-backward. CURRENTLY NOT IMPLEMENTED UNDER NEXTSTEP. */ )
- (Lisp_Object n)
-{
- /* XXX This function is unimplemented under NeXTstep XXX */
- Fsignal (Qquit, Fcons (build_string (
- "Warning: ns-rotate-cut-buffers-internal not implemented\n"), Qnil));
- return Qnil;
-}
-
-
-DEFUN ("ns-store-cut-buffer-internal", Fns_store_cut_buffer_internal,
- Sns_store_cut_buffer_internal, 2, 2, 0,
- doc: /* Sets the value of the named cut buffer (typically CUT_BUFFER0). */)
- (Lisp_Object buffer, Lisp_Object string)
+DEFUN ("ns-store-selection-internal", Fns_store_selection_internal,
+ Sns_store_selection_internal, 2, 2, 0,
+ doc: /* Sets the string value of SELECTION.
+SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. */)
+ (Lisp_Object selection, Lisp_Object string)
{
id pb;
check_ns ();
- pb =[NSPasteboard pasteboardWithName: symbol_to_nsstring (buffer)];
- ns_string_to_pasteboard (pb, string);
+ pb = ns_symbol_to_pb (selection);
+ if (pb != nil) ns_string_to_pasteboard (pb, string);
return Qnil;
}
-#endif
void
@@ -572,11 +519,8 @@ syms_of_nsselect (void)
defsubr (&Sx_own_selection_internal);
defsubr (&Sx_selection_exists_p);
defsubr (&Sx_selection_owner_p);
-#ifdef CUT_BUFFER_SUPPORT
- defsubr (&Sns_get_cut_buffer_internal);
- defsubr (&Sns_rotate_cut_buffers_internal);
- defsubr (&Sns_store_cut_buffer_internal);
-#endif
+ defsubr (&Sns_get_selection_internal);
+ defsubr (&Sns_store_selection_internal);
Vselection_alist = Qnil;
staticpro (&Vselection_alist);
diff --git a/src/nsterm.h b/src/nsterm.h
index 52246caac84..14918cca90d 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -760,6 +760,7 @@ extern void ns_release_object (void *obj);
extern void ns_retain_object (void *obj);
extern void *ns_alloc_autorelease_pool ();
extern void ns_release_autorelease_pool ();
+extern const char *ns_get_defaults_value ();
/* in nsmenu */
extern void update_frame_tool_bar (FRAME_PTR f);
@@ -794,6 +795,7 @@ extern void x_set_tool_bar_lines (struct frame *f,
Lisp_Object oldval);
extern void x_activate_menubar (struct frame *);
extern void free_frame_menubar (struct frame *);
+extern void x_free_frame_resources (struct frame *);
#define NSAPP_DATA2_RUNASSCRIPT 10
extern void ns_run_ascript (void);
diff --git a/src/nsterm.m b/src/nsterm.m
index 5e19a397c34..f8e69f98942 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1158,6 +1158,9 @@ x_free_frame_resources (struct frame *f)
xfree (f->output_data.ns);
+ if (f->output_data.ns->miniimage != nil)
+ [f->output_data.ns->miniimage release];
+
[[view window] close];
[view release];
@@ -1351,7 +1354,7 @@ ns_index_color (NSColor *color, struct frame *f)
{
struct ns_color_table *color_table = FRAME_NS_DISPLAY_INFO (f)->color_table;
ptrdiff_t idx;
- NSNumber *index;
+ ptrdiff_t i;
if (!color_table->colors)
{
@@ -1364,21 +1367,13 @@ ns_index_color (NSColor *color, struct frame *f)
}
/* do we already have this color ? */
- {
- ptrdiff_t i;
- for (i = 1; i < color_table->avail; i++)
- {
- if (color_table->colors[i] && [color_table->colors[i] isEqual: color])
- {
- [color_table->colors[i] retain];
- return i;
- }
- }
- }
+ for (i = 1; i < color_table->avail; i++)
+ if (color_table->colors[i] && [color_table->colors[i] isEqual: color])
+ return i;
if ([color_table->empty_indices count] > 0)
{
- index = [color_table->empty_indices anyObject];
+ NSNumber *index = [color_table->empty_indices anyObject];
[color_table->empty_indices removeObject: index];
idx = [index unsignedLongValue];
}
@@ -1411,20 +1406,20 @@ ns_free_indexed_color (unsigned long idx, struct frame *f)
color_table = FRAME_NS_DISPLAY_INFO (f)->color_table;
if (idx <= 0 || idx >= color_table->size) {
- message1("ns_free_indexed_color: Color index out of range.\n");
+ message1 ("ns_free_indexed_color: Color index out of range.\n");
return;
}
index = [NSNumber numberWithUnsignedInt: idx];
if ([color_table->empty_indices containsObject: index]) {
- message1("ns_free_indexed_color: attempt to free already freed color.\n");
+ message1 ("ns_free_indexed_color: attempt to free already freed color.\n");
return;
}
color = color_table->colors[idx];
[color release];
color_table->colors[idx] = nil;
- [color_table->empty_indices addObject: [NSNumber numberWithUnsignedInt: idx]];
+ [color_table->empty_indices addObject: index];
/*fprintf(stderr, "color_table: FREED %d\n",idx);*/
}
@@ -2108,7 +2103,7 @@ ns_scroll_run (struct window *w, struct run *run)
}
else
{
- /* Scolling down. Make sure we don't copy over the mode line.
+ /* Scrolling down. Make sure we don't copy over the mode line.
at the bottom. */
if (to_y + run->height > bottom_y)
height = bottom_y - to_y;
@@ -3824,11 +3819,9 @@ ns_default (const char *parameter, Lisp_Object *result,
Check a parameter value in user's preferences
-------------------------------------------------------------------------- */
{
- const char *value;
+ const char *value = ns_get_defaults_value (parameter);
- if ( (value =[[[NSUserDefaults standardUserDefaults]
- stringForKey: [NSString stringWithUTF8String: parameter]]
- UTF8String]) )
+ if (value)
{
double f;
char *pos;
@@ -4205,6 +4198,15 @@ ns_term_init (Lisp_Object display_name)
[NSApp setServicesMenu: svcsMenu];
/* Needed at least on Cocoa, to get dock menu to show windows */
[NSApp setWindowsMenu: [[NSMenu alloc] init]];
+
+ [[NSNotificationCenter defaultCenter]
+ addObserver: mainMenu
+ selector: @selector (trackingNotification:)
+ name: NSMenuDidBeginTrackingNotification object: mainMenu];
+ [[NSNotificationCenter defaultCenter]
+ addObserver: mainMenu
+ selector: @selector (trackingNotification:)
+ name: NSMenuDidEndTrackingNotification object: mainMenu];
}
#endif /* MAC OS X menu setup */
diff --git a/src/print.c b/src/print.c
index 0fdb750f370..dbe8a8950f7 100644
--- a/src/print.c
+++ b/src/print.c
@@ -622,7 +622,7 @@ A printed representation of an object is text which describes that object. */)
printcharfun = Vprin1_to_string_buffer;
PRINTPREPARE;
print (object, printcharfun, NILP (noescape));
- /* Make Vprin1_to_string_buffer be the default buffer after PRINTFINSH */
+ /* Make Vprin1_to_string_buffer be the default buffer after PRINTFINISH */
PRINTFINISH;
}
diff --git a/src/process.c b/src/process.c
index 05c4be27550..4b0f90b58af 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1521,8 +1521,9 @@ start_process_unwind (Lisp_Object proc)
if (!PROCESSP (proc))
abort ();
- /* Was PROC started successfully? */
- if (XPROCESS (proc)->pid == -1)
+ /* Was PROC started successfully?
+ -2 is used for a pty with no process, eg for gdb. */
+ if (XPROCESS (proc)->pid <= 0 && XPROCESS (proc)->pid != -2)
remove_process (proc);
return Qnil;
diff --git a/src/regex.c b/src/regex.c
index b7699378f5a..0ba05a95fdb 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -53,7 +53,7 @@
(HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC && !emacs)
#endif
-/* For platform which support the ISO C amendement 1 functionality we
+/* For platform which support the ISO C amendment 1 functionality we
support user defined character classes. */
#if WIDE_CHAR_SUPPORT
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
diff --git a/src/regex.h b/src/regex.h
index eba62f2e769..32ccfb7ddef 100644
--- a/src/regex.h
+++ b/src/regex.h
@@ -582,7 +582,7 @@ extern void regfree _RE_ARGS ((regex_t *__preg));
}
#endif /* C++ */
-/* For platform which support the ISO C amendement 1 functionality we
+/* For platform which support the ISO C amendment 1 functionality we
support user defined character classes. */
#if WIDE_CHAR_SUPPORT
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
@@ -592,7 +592,7 @@ extern void regfree _RE_ARGS ((regex_t *__preg));
#if WIDE_CHAR_SUPPORT
/* The GNU C library provides support for user-defined character classes
- and the functions from ISO C amendement 1. */
+ and the functions from ISO C amendment 1. */
# ifdef CHARCLASS_NAME_MAX
# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
# else
diff --git a/src/region-cache.c b/src/region-cache.c
index ed7a07a6709..054374eb688 100644
--- a/src/region-cache.c
+++ b/src/region-cache.c
@@ -699,7 +699,7 @@ know_region_cache (struct buffer *buf, struct region_cache *c,
/* Return true if the text immediately after POS in BUF is known, for
the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest
- position after POS where the knownness changes. */
+ position after POS where the knowledge changes. */
int
region_cache_forward (struct buffer *buf, struct region_cache *c,
ptrdiff_t pos, ptrdiff_t *next)
@@ -736,7 +736,7 @@ region_cache_forward (struct buffer *buf, struct region_cache *c,
/* Return true if the text immediately before POS in BUF is known, for
the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest
- position before POS where the knownness changes. */
+ position before POS where the knowledge changes. */
int region_cache_backward (struct buffer *buf, struct region_cache *c,
ptrdiff_t pos, ptrdiff_t *next)
{
diff --git a/src/region-cache.h b/src/region-cache.h
index 8e1be716776..6758f8bcd08 100644
--- a/src/region-cache.h
+++ b/src/region-cache.h
@@ -97,7 +97,7 @@ extern void invalidate_region_cache (struct buffer *BUF,
/* Return true if the text immediately after POS in BUF is known, for
the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest
- position after POS where the knownness changes. */
+ position after POS where the knowledge changes. */
extern int region_cache_forward (struct buffer *BUF,
struct region_cache *CACHE,
ptrdiff_t POS,
@@ -105,7 +105,7 @@ extern int region_cache_forward (struct buffer *BUF,
/* Return true if the text immediately before POS in BUF is known, for
the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest
- position before POS where the knownness changes. */
+ position before POS where the knowledge changes. */
extern int region_cache_backward (struct buffer *BUF,
struct region_cache *CACHE,
ptrdiff_t POS,
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h
index 3d78bf695bc..d89b14cc080 100644
--- a/src/s/gnu-linux.h
+++ b/src/s/gnu-linux.h
@@ -155,7 +155,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
extern void *__libc_ia64_register_backing_store_base; \
__builtin_ia64_flushrs (); \
mark_memory (__libc_ia64_register_backing_store_base, \
- __builtin_ia64_bsp (), 0); \
+ __builtin_ia64_bsp ()); \
} while (0)
#endif
#endif
diff --git a/src/sysdep.c b/src/sysdep.c
index ae200308bf3..b111fa1324c 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -433,7 +433,7 @@ child_setup_tty (int out)
#endif /* AIX */
/* We originally enabled ICANON (and set VEOF to 04), and then had
- proces.c send additional EOF chars to flush the output when faced
+ process.c send additional EOF chars to flush the output when faced
with long lines, but this leads to weird effects when the
subprocess has disabled ICANON and ends up seeing those spurious
extra EOFs. So we don't send EOFs any more in
diff --git a/src/termhooks.h b/src/termhooks.h
index a025e2798d9..03d336bf0c8 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -556,7 +556,7 @@ struct terminal
/* Arrange for all scroll bars on FRAME to be removed at the next call
to `*judge_scroll_bars_hook'. A scroll bar may be spared if
- `*redeem_scroll_bar_hook' is applied to its window before the judgement.
+ `*redeem_scroll_bar_hook' is applied to its window before the judgment.
This should be applied to each frame each time its window tree is
redisplayed, even if it is not displaying scroll bars at the moment;
@@ -568,7 +568,7 @@ struct terminal
currently displaying them. */
void (*condemn_scroll_bars_hook) (struct frame *frame);
- /* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
+ /* Unmark WINDOW's scroll bar for deletion in this judgment cycle.
Note that it's okay to redeem a scroll bar that is not condemned. */
void (*redeem_scroll_bar_hook) (struct window *window);
diff --git a/src/textprop.c b/src/textprop.c
index 29425f7a550..a1c7593f568 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -1625,7 +1625,7 @@ Return t if any property was actually removed, nil otherwise. */)
DEFUN ("text-property-any", Ftext_property_any,
Stext_property_any, 4, 5, 0,
- doc: /* Check text from START to END for property PROPERTY equalling VALUE.
+ doc: /* Check text from START to END for property PROPERTY equaling VALUE.
If so, return the position of the first character whose property PROPERTY
is `eq' to VALUE. Otherwise return nil.
If the optional fifth argument OBJECT is a buffer (or nil, which means
@@ -1661,7 +1661,7 @@ markers). If OBJECT is a string, START and END are 0-based indices into it. */
DEFUN ("text-property-not-all", Ftext_property_not_all,
Stext_property_not_all, 4, 5, 0,
- doc: /* Check text from START to END for property PROPERTY not equalling VALUE.
+ doc: /* Check text from START to END for property PROPERTY not equaling VALUE.
If so, return the position of the first character whose property PROPERTY
is not `eq' to VALUE. Otherwise, return nil.
If the optional fifth argument OBJECT is a buffer (or nil, which means
diff --git a/src/unexelf.c b/src/unexelf.c
index 04c029f7e80..1715c3670ca 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -1219,9 +1219,15 @@ temacs:
nn = symp->st_shndx;
if (nn > old_bss_index)
nn--;
- old = ((symp->st_value - NEW_SECTION_H (symp->st_shndx).sh_addr)
- + OLD_SECTION_H (nn).sh_offset + old_base);
- memcpy (new, old, symp->st_size);
+ if (nn == old_bss_index)
+ memset (new, 0, symp->st_size);
+ else
+ {
+ old = ((symp->st_value
+ - NEW_SECTION_H (symp->st_shndx).sh_addr)
+ + OLD_SECTION_H (nn).sh_offset + old_base);
+ memcpy (new, old, symp->st_size);
+ }
}
#endif
}
diff --git a/src/w16select.c b/src/w16select.c
index cae7a6f82dd..7ba62fde0e5 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -114,7 +114,7 @@ identify_winoldap_version (void)
return regs.x.ax;
}
-/* Open the clipboard, return non-zero if successfull. */
+/* Open the clipboard, return non-zero if successful. */
unsigned
open_clipboard (void)
{
@@ -137,7 +137,7 @@ open_clipboard (void)
return regs.x.ax;
}
-/* Empty clipboard, return non-zero if successfull. */
+/* Empty clipboard, return non-zero if successful. */
unsigned
empty_clipboard (void)
{
@@ -207,7 +207,7 @@ free_xfer_buf (void)
}
}
-/* Copy data into the clipboard, return zero if successfull. */
+/* Copy data into the clipboard, return zero if successful. */
unsigned
set_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw)
{
@@ -405,7 +405,7 @@ get_clipboard_data (unsigned Format, void *Data, unsigned Size, int Raw)
return (unsigned) (dp - (unsigned char *)Data - 1);
}
-/* Close clipboard, return non-zero if successfull. */
+/* Close clipboard, return non-zero if successful. */
unsigned
close_clipboard (void)
{
@@ -730,4 +730,3 @@ After the communication, this variable is set to nil. */);
}
#endif /* MSDOS */
-
diff --git a/src/w32.c b/src/w32.c
index 304445e2238..b26327462d8 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -1654,6 +1654,24 @@ init_environment (char ** argv)
}
}
+ /* When Emacs is invoked with --no-site-lisp, we must remove the
+ site-lisp directories from the default value of EMACSLOADPATH.
+ This assumes that the site-lisp entries are at the front, and
+ that additional entries do exist. */
+ if (no_site_lisp)
+ {
+ for (i = 0; i < N_ENV_VARS; i++)
+ {
+ if (strcmp (env_vars[i].name, "EMACSLOADPATH") == 0)
+ {
+ char *site;
+ while ((site = strstr (env_vars[i].def_value, "site-lisp")))
+ env_vars[i].def_value = strchr (site, ';') + 1;
+ break;
+ }
+ }
+ }
+
#define SET_ENV_BUF_SIZE (4 * MAX_PATH) /* to cover EMACSLOADPATH */
/* Treat emacs_dir specially: set it unconditionally based on our
diff --git a/src/w32fns.c b/src/w32fns.c
index 7a17c108d4d..822e3530bb6 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -2417,7 +2417,7 @@ complete_deferred_msg (HWND hwnd, UINT msg, LRESULT result)
deferred_msg * msg_buf = find_deferred_msg (hwnd, msg);
if (msg_buf == NULL)
- /* Message may have been cancelled, so don't abort. */
+ /* Message may have been canceled, so don't abort. */
return;
msg_buf->result = result;
@@ -2538,7 +2538,7 @@ post_character_message (HWND hwnd, UINT msg,
the lisp thread to respond.
Note that we don't want to block the input thread waiting for
- a reponse from the lisp thread (although that would at least
+ a response from the lisp thread (although that would at least
solve the deadlock problem above), because we want to be able
to receive C-g to interrupt the lisp thread. */
cancel_all_deferred_msgs ();
@@ -3749,7 +3749,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
flags |= TPM_RIGHTBUTTON;
/* Remember we did a SetCapture on the initial mouse down event,
- so for safety, we make sure the capture is cancelled now. */
+ so for safety, we make sure the capture is canceled now. */
ReleaseCapture ();
button_state = 0;
@@ -4951,7 +4951,7 @@ If TYPE is nil or omitted, get the property as a string.
Otherwise TYPE is the name of the atom that denotes the type expected.
If SOURCE is non-nil, get the property on that window instead of from
FRAME. The number 0 denotes the root window.
-If DELETE_P is non-nil, delete the property after retreiving it.
+If DELETE_P is non-nil, delete the property after retrieving it.
If VECTOR_RET_P is non-nil, don't return a string but a vector of values.
Value is nil if FRAME hasn't a property with name PROP or if PROP has
@@ -6032,7 +6032,7 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */)
file = DECODE_FILE (build_string (filename));
}
- /* User cancelled the dialog without making a selection. */
+ /* User canceled the dialog without making a selection. */
else if (!CommDlgExtendedError ())
file = Qnil;
/* An error occurred, fallback on reading from the mini-buffer. */
diff --git a/src/w32font.c b/src/w32font.c
index 5cc37c0e74f..e8a223de0a4 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -786,7 +786,7 @@ w32font_free_outline (struct font *font, void *outline);
Optional.
Get coordinates of the INDEXth anchor point of the glyph whose
code is CODE. Store the coordinates in *X and *Y. Return 0 if
- the operations was successfull. Otherwise return -1.
+ the operations was successful. Otherwise return -1.
static int
w32font_anchor_point (struct font *font, unsigned code,
int index, int *x, int *y);
diff --git a/src/w32select.c b/src/w32select.c
index e3225c3f996..392cb07a96d 100644
--- a/src/w32select.c
+++ b/src/w32select.c
@@ -39,7 +39,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
*
* When copying or cutting (sending data to the OS), the data is
* announced and stored internally, but only actually rendered on
- * request. The requester determines the format provided. The
+ * request. The requestor determines the format provided. The
* {next-}selection-coding-system is only used, when its corresponding
* clipboard type matches the type requested.
*
@@ -335,7 +335,7 @@ render_all (Lisp_Object ignore)
OpenClipboard (NULL);
- /* There is no usefull means to report errors here, there are none
+ /* There is no useful means to report errors here, there are none
expected anyway, and even if there were errors, they wouldn't do
any harm. So we just go ahead and do what has to be done without
bothering with error handling. */
@@ -750,7 +750,7 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
else
{
/* Advertise all supported formats so that whatever the
- requester chooses, only one encoding step needs to be
+ requestor chooses, only one encoding step needs to be
made. This is intentionally different from what we do in
the handler for WM_RENDERALLFORMATS. */
SetClipboardData (CF_UNICODETEXT, NULL);
@@ -1138,4 +1138,3 @@ globals_of_w32select (void)
clipboard_owner = create_owner ();
}
-
diff --git a/src/w32term.c b/src/w32term.c
index a2ccdd21f7d..29ac9d119b4 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -2665,7 +2665,7 @@ x_scroll_run (struct window *w, struct run *run)
}
else
{
- /* Scolling down. Make sure we don't copy over the mode line.
+ /* Scrolling down. Make sure we don't copy over the mode line.
at the bottom. */
if (to_y + run->height > bottom_y)
height = bottom_y - to_y;
@@ -3286,7 +3286,7 @@ w32_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
***********************************************************************/
/* Handle mouse button event on the tool-bar of frame F, at
- frame-relative coordinates X/Y. EVENT_TYPE is either ButtionPress
+ frame-relative coordinates X/Y. EVENT_TYPE is either ButtonPress
or ButtonRelease. */
static void
@@ -3556,7 +3556,7 @@ x_scroll_bar_remove (struct scroll_bar *bar)
/* Destroy the window. */
my_destroy_window (f, SCROLL_BAR_W32_WINDOW (bar));
- /* Disassociate this scroll bar from its window. */
+ /* Dissociate this scroll bar from its window. */
XWINDOW (bar->window)->vertical_scroll_bar = Qnil;
UNBLOCK_INPUT;
diff --git a/src/w32term.h b/src/w32term.h
index 6c73daba601..f587ee11af9 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -229,7 +229,7 @@ enum
{
/* Values for focus_state, used as bit mask.
EXPLICIT means we received a FocusIn for the frame and know it has
- the focus. IMPLICIT means we recevied an EnterNotify and the frame
+ the focus. IMPLICIT means we received an EnterNotify and the frame
may have the focus if no window manager is running.
FocusOut and LeaveNotify clears EXPLICIT/IMPLICIT. */
FOCUS_NONE = 0,
diff --git a/src/window.c b/src/window.c
index 86fcca25f2e..4f573a67909 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5000,7 +5000,7 @@ the selected window; if the variable `recenter-redisplay' is non-nil,
also erase the entire frame and redraw it (when `auto-resize-tool-bars'
is set to `grow-only', this resets the tool-bar's height to the minimum
height needed); if `recenter-redisplay' has the special value `tty',
-then only tty frame are redrawn.
+then only tty frames are redrawn.
Just C-u as prefix means put point in the center of the window
and redisplay normally--don't erase and redraw the frame. */)
@@ -5772,7 +5772,7 @@ get_leaf_windows (struct window *w, struct window **flat, int i)
/* Return a pointer to the glyph W's physical cursor is on. Value is
- null if W's current matrix is invalid, so that no meaningfull glyph
+ null if W's current matrix is invalid, so that no meaningful glyph
can be returned. */
struct glyph *
get_phys_cursor_glyph (struct window *w)
@@ -6505,28 +6505,31 @@ with the relevant frame selected. */);
Vwindow_configuration_change_hook = Qnil;
DEFVAR_LISP ("recenter-redisplay", Vrecenter_redisplay,
- doc: /* If non-nil, then the `recenter' command with a nil argument
-will redraw the entire frame; the special value `tty' causes the
-frame to be redrawn only if it is a tty frame. */);
+ doc: /* Non-nil means `recenter' redraws entire frame.
+If this option is non-nil, then the `recenter' command with a nil
+argument will redraw the entire frame; the special value `tty' causes
+the frame to be redrawn only if it is a tty frame. */);
Vrecenter_redisplay = Qtty;
DEFVAR_LISP ("window-combination-resize", Vwindow_combination_resize,
- doc: /* Non-nil means resize window combinations proportionally.
+ doc: /* If t, resize window combinations proportionally.
If this variable is nil, splitting a window gets the entire screen space
for displaying the new window from the window to split. Deleting and
resizing a window preferably resizes one adjacent window only.
-If this variable is non-nil, splitting a window tries to get the space
+If this variable is t, splitting a window tries to get the space
proportionally from all windows in the same combination. This also
allows to split a window that is otherwise too small or of fixed size.
Resizing and deleting a window proportionally resize all windows in the
same combination.
+Other values are reserved for future use.
+
This variable takes no effect if `window-combination-limit' is non-nil. */);
Vwindow_combination_resize = Qnil;
DEFVAR_LISP ("window-combination-limit", Vwindow_combination_limit,
- doc: /* Non-nil means splitting a window makes a new parent window.
+ doc: /* If t, splitting a window makes a new parent window.
If this variable is nil, splitting a window will create a new parent
window only if the window has no parent window or the window shall
become a combination orthogonal to the one it is part of.
diff --git a/src/window.h b/src/window.h
index df29ca1368f..b4e268b1a34 100644
--- a/src/window.h
+++ b/src/window.h
@@ -877,7 +877,7 @@ extern int buffer_shared;
extern void check_frame_size (struct frame *frame, int *rows, int *cols);
/* Return a pointer to the glyph W's physical cursor is on. Value is
- null if W's current matrix is invalid, so that no meaningfull glyph
+ null if W's current matrix is invalid, so that no meaningful glyph
can be returned. */
struct glyph *get_phys_cursor_glyph (struct window *w);
diff --git a/src/xdisp.c b/src/xdisp.c
index 530373a4436..1588d490ec3 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1920,7 +1920,7 @@ get_glyph_string_clip_rects (struct glyph_string *s, NativeRectangle *rects, int
environments with anti-aliased text: if the same text is
drawn onto the same place multiple times, it gets thicker.
If the overlap we are processing is for the erased cursor, we
- take the intersection with the rectagle of the cursor. */
+ take the intersection with the rectangle of the cursor. */
if (s->for_overlaps & OVERLAPS_ERASED_CURSOR)
{
XRectangle rc, r_save = r;
@@ -4095,10 +4095,11 @@ handle_invisible_prop (struct it *it)
while (invis_p);
/* The position newpos is now either ZV or on visible text. */
- if (it->bidi_p && newpos < ZV)
+ if (it->bidi_p)
{
EMACS_INT bpos = CHAR_TO_BYTE (newpos);
- int on_newline = FETCH_BYTE (bpos) == '\n';
+ int on_newline =
+ bpos == ZV_BYTE || FETCH_BYTE (bpos) == '\n';
int after_newline =
newpos <= BEGV || FETCH_BYTE (bpos - 1) == '\n';
@@ -4116,16 +4117,16 @@ handle_invisible_prop (struct it *it)
SET_TEXT_POS (tpos, newpos, bpos);
reseat_1 (it, tpos, 0);
- /* If we reseat on a newline, we need to prep the
+ /* If we reseat on a newline/ZV, we need to prep the
bidi iterator for advancing to the next character
- after the newline, keeping the current paragraph
+ after the newline/EOB, keeping the current paragraph
direction (so that PRODUCE_GLYPHS does TRT wrt
prepending/appending glyphs to a glyph row). */
if (on_newline)
{
it->bidi_it.first_elt = 0;
it->bidi_it.paragraph_dir = pdir;
- it->bidi_it.ch = '\n';
+ it->bidi_it.ch = (bpos == ZV_BYTE) ? -1 : '\n';
it->bidi_it.nchars = 1;
it->bidi_it.ch_len = 1;
}
@@ -10288,7 +10289,7 @@ current_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4)
}
-/* Push the current message on Vmessage_stack for later restauration
+/* Push the current message on Vmessage_stack for later restoration
by restore_message. Value is non-zero if the current message isn't
empty. This is a relatively infrequent operation, so it's not
worth optimizing. */
@@ -14421,7 +14422,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
{
int scroll_margin_y;
- /* Compute the pixel ypos of the scroll margin, then move it to
+ /* Compute the pixel ypos of the scroll margin, then move IT to
either that ypos or PT, whichever comes first. */
start_display (&it, w, startp);
scroll_margin_y = it.last_visible_y - this_scroll_margin
@@ -14451,7 +14452,8 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
if (dy > scroll_max)
return SCROLLING_FAILED;
- scroll_down_p = 1;
+ if (dy > 0)
+ scroll_down_p = 1;
}
}
@@ -18991,7 +18993,8 @@ display_line (struct it *it)
#define RECORD_MAX_MIN_POS(IT) \
do \
{ \
- int composition_p = (IT)->what == IT_COMPOSITION; \
+ int composition_p = !STRINGP ((IT)->string) \
+ && ((IT)->what == IT_COMPOSITION); \
EMACS_INT current_pos = \
composition_p ? (IT)->cmp_it.charpos \
: IT_CHARPOS (*(IT)); \
diff --git a/src/xfns.c b/src/xfns.c
index 323b272e9f0..e44f28df870 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1877,7 +1877,7 @@ static XIMStyle supported_xim_styles[] =
#if defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
/* Create an X fontset on frame F with base font name BASE_FONTNAME. */
-static const char xic_defaut_fontset[] = "-*-*-*-r-normal--14-*-*-*-*-*-*-*";
+static const char xic_default_fontset[] = "-*-*-*-r-normal--14-*-*-*-*-*-*-*";
/* Create an Xt fontset spec from the name of a base font.
If `motif' is True use the Motif syntax. */
@@ -1888,7 +1888,7 @@ xic_create_fontsetname (const char *base_fontname, int motif)
char *fontsetname;
/* Make a fontset name from the base font name. */
- if (xic_defaut_fontset == base_fontname)
+ if (xic_default_fontset == base_fontname)
{ /* There is no base font name, use the default. */
ptrdiff_t len = strlen (base_fontname) + 2;
fontsetname = xmalloc (len);
@@ -1912,12 +1912,12 @@ xic_create_fontsetname (const char *base_fontname, int motif)
modify it to generalize it to allcs and allfamilies.
Use the specified font plus the default. */
ptrdiff_t len =
- strlen (base_fontname) + strlen (xic_defaut_fontset) + 3;
+ strlen (base_fontname) + strlen (xic_default_fontset) + 3;
fontsetname = xmalloc (len);
memset (fontsetname, 0, len);
strcpy (fontsetname, base_fontname);
strcat (fontsetname, sep);
- strcat (fontsetname, xic_defaut_fontset);
+ strcat (fontsetname, xic_default_fontset);
}
else
{
@@ -4286,7 +4286,7 @@ If TYPE is nil or omitted, get the property as a string.
Otherwise TYPE is the name of the atom that denotes the type expected.
If SOURCE is non-nil, get the property on that window instead of from
FRAME. The number 0 denotes the root window.
-If DELETE_P is non-nil, delete the property after retreiving it.
+If DELETE_P is non-nil, delete the property after retrieving it.
If VECTOR_RET_P is non-nil, don't return a string but a vector of values.
Value is nil if FRAME hasn't a property with name PROP or if PROP has
diff --git a/src/xftfont.c b/src/xftfont.c
index c27a4fcf91a..8cb4c494854 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -654,7 +654,7 @@ xftfont_draw (struct glyph_string *s, int from, int to, int x, int y, int with_b
if (with_background)
XftDrawRect (xft_draw, &bg,
- x, y - face->font->ascent, s->width, face->font->height);
+ x, y - s->font->ascent, s->width, s->font->height);
code = alloca (sizeof (FT_UInt) * len);
for (i = 0; i < len; i++)
code[i] = ((XCHAR2B_BYTE1 (s->char2b + from + i) << 8)
diff --git a/src/xmenu.c b/src/xmenu.c
index 4b7bbfd73dc..ba99b8ac1e3 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -102,6 +102,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef USE_GTK
#include "gtkutil.h"
+#ifdef HAVE_GTK3
+#include "xgselect.h"
+#endif
#endif
#include "menu.h"
@@ -408,7 +411,15 @@ x_menu_wait_for_event (void *data)
else
ntp = &next_time;
+#ifdef HAVE_GTK3
+ /* Gtk3 have arrows on menus when they don't fit. When the pointer is
+ over an arrow, a timeout scrolls it a bit. Use xg_select so that
+ timeout gets triggered. */
+
+ xg_select (n + 1, &read_fds, (SELECT_TYPE *)0, (SELECT_TYPE *)0, ntp);
+#else
select (n + 1, &read_fds, (SELECT_TYPE *)0, (SELECT_TYPE *)0, ntp);
+#endif
}
}
#endif /* ! MSDOS */
@@ -1435,6 +1446,13 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y,
GtkMenuPositionFunc pos_func = 0; /* Pop up at pointer. */
struct next_popup_x_y popup_x_y;
int specpdl_count = SPECPDL_INDEX ();
+ int use_pos_func = ! for_click;
+
+#ifdef HAVE_GTK3
+ /* Always use position function for Gtk3. Otherwise menus may become
+ too small to show anything. */
+ use_pos_func = 1;
+#endif
if (! FRAME_X_P (f))
abort ();
@@ -1446,7 +1464,7 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y,
G_CALLBACK (menu_highlight_callback));
xg_crazy_callback_abort = 0;
- if (! for_click)
+ if (use_pos_func)
{
/* Not invoked by a click. pop up at x/y. */
pos_func = menu_position_func;
@@ -1461,7 +1479,8 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y,
i = 0; /* gtk_menu_popup needs this to be 0 for a non-button popup. */
}
- else
+
+ if (for_click)
{
for (i = 0; i < 5; i++)
if (FRAME_X_DISPLAY_INFO (f)->grabbed & (1 << i))
diff --git a/src/xselect.c b/src/xselect.c
index 4bfab4143cc..5e5e6a098b6 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -516,7 +516,7 @@ static struct selection_data *converted_selections;
static Atom conversion_fail_tag;
/* Used as an unwind-protect clause so that, if a selection-converter signals
- an error, we tell the requester that we were unable to do what they wanted
+ an error, we tell the requestor that we were unable to do what they wanted
before we throw to top-level or go into the debugger or whatever. */
static Lisp_Object
@@ -693,7 +693,7 @@ x_reply_selection_request (struct input_event *event,
bytes_remaining = cs->size;
bytes_remaining *= format_bytes;
- /* Wait for the requester to ack by deleting the property.
+ /* Wait for the requestor to ack by deleting the property.
This can run Lisp code (process handlers) or signal. */
if (! had_errors)
{
@@ -732,7 +732,7 @@ x_reply_selection_request (struct input_event *event,
if (had_errors) break;
- /* Wait for the requester to ack this chunk by deleting
+ /* Wait for the requestor to ack this chunk by deleting
the property. This can run Lisp code or signal. */
TRACE1 ("Waiting for increment ACK (deletion of %s)",
XGetAtomName (display, cs->property));
@@ -740,7 +740,7 @@ x_reply_selection_request (struct input_event *event,
}
/* Now write a zero-length chunk to the property to tell the
- requester that we're done. */
+ requestor that we're done. */
BLOCK_INPUT;
if (! waiting_for_other_props_on_window (display, window))
XSelectInput (display, window, 0L);
@@ -757,7 +757,7 @@ x_reply_selection_request (struct input_event *event,
/* The window we're communicating with may have been deleted
in the meantime (that's a real situation from a bug report).
In this case, there may be events in the event queue still
- refering to the deleted window, and we'll get a BadWindow error
+ referring to the deleted window, and we'll get a BadWindow error
in XTread_socket when processing the events. I don't have
an idea how to fix that. gerd, 2001-01-98. */
/* 2004-09-10: XSync and UNBLOCK so that possible protocol errors are
diff --git a/src/xterm.c b/src/xterm.c
index 8171fe7738e..3c37b2110d4 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3326,7 +3326,7 @@ x_scroll_run (struct window *w, struct run *run)
}
else
{
- /* Scolling down. Make sure we don't copy over the mode line.
+ /* Scrolling down. Make sure we don't copy over the mode line.
at the bottom. */
if (to_y + run->height > bottom_y)
height = bottom_y - to_y;
@@ -5160,7 +5160,7 @@ x_scroll_bar_remove (struct scroll_bar *bar)
XDestroyWindow (FRAME_X_DISPLAY (f), bar->x_window);
#endif
- /* Disassociate this scroll bar from its window. */
+ /* Dissociate this scroll bar from its window. */
XWINDOW (bar->window)->vertical_scroll_bar = Qnil;
UNBLOCK_INPUT;
@@ -9978,6 +9978,11 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
#ifdef HAVE_CLUTTER
gtk_clutter_init (&argc, &argv2);
#else
+
+ /* NULL window -> events for all windows go to our function.
+ Call before gtk_init so Gtk+ event filters comes after our. */
+ gdk_window_add_filter (NULL, event_handler_gdk, NULL);
+
gtk_init (&argc, &argv2);
#endif
g_log_remove_handler ("GLib", id);
@@ -9988,9 +9993,6 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
dpy = DEFAULT_GDK_DISPLAY ();
- /* NULL window -> events for all windows go to our function */
- gdk_window_add_filter (NULL, event_handler_gdk, NULL);
-
#if GTK_MAJOR_VERSION <= 2 && GTK_MINOR_VERSION <= 90
/* Load our own gtkrc if it exists. */
{
diff --git a/src/xterm.h b/src/xterm.h
index 4385b1a467d..9e0e1acca92 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -643,7 +643,7 @@ enum
{
/* Values for focus_state, used as bit mask.
EXPLICIT means we received a FocusIn for the frame and know it has
- the focus. IMPLICIT means we recevied an EnterNotify and the frame
+ the focus. IMPLICIT means we received an EnterNotify and the frame
may have the focus if no window manager is running.
FocusOut and LeaveNotify clears EXPLICIT/IMPLICIT. */
FOCUS_NONE = 0,