Paul Eggert [Mon, 11 Jul 2011 18:36:33 +0000 (11:36 -0700)]
* dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
The plain *_OVERFLOW macros run afoul of GCC bug 49705
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
and therefore cause GCC to emit a bogus diagnostic in some cases.
Bill Wohler [Sun, 10 Jul 2011 16:23:40 +0000 (09:23 -0700)]
* mh-folder.el (mh-inc-folder, mh-modify, mh-scan-folder)
(mh-make-folder): Replace calls to switch-to-buffer with of
pop-to-buffer. The former is intended for interactive use only and
generates warnings in Emacs 24.
See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00478.html
for a discussion of the link face. The changes to the startup faces
are so that they can take advantage of the light/dark background
settings already defined for those faces.
* lisp/faces.el (link): Use a less saturated blue on light backgrounds.
* lisp/startup.el (fancy-startup-text, fancy-about-text)
(fancy-startup-tail): Use font-lock faces, for background safety.
Martin Rudalics [Sat, 9 Jul 2011 12:32:38 +0000 (14:32 +0200)]
Simplify normalization of default buffer display specifieres and options.
* window.el (display-buffer-default-specifiers): Remove.
(display-buffer-macro-specifiers): Remove default specifiers.
(display-buffer-alist): Default to nil.
(display-buffer-reuse-window): New optional argument
other-window.
(display-buffer-pop-up-window): Allow splitting internal
windows. Check whether a live window was created.
(display-buffer-other-window-means-other-frame)
(display-buffer-normalize-arguments): Rename to
display-buffer-normalize-argument and rewrite. Set the
other-window specifier.
(display-buffer-normalize-special): New function.
(display-buffer-normalize-options): Rename to
display-buffer-normalize-default and rewrite.
(display-buffer-normalize-options-inhibit): Remove.
(display-buffer-normalize-specifiers): Rewrite.
(display-buffer): Process other-window specifier and call
display-buffer-reuse-window with it. Emulate Emacs 23 behavior
more faithfully.
(pop-up-windows, even-window-heights): Restore Emacs 23 default
values.
(display-buffer-alist-set): Don't handle 'unset default values.
(display-buffer-in-window, display-buffer-alist-set): Replace
symbol "dedicated" by "dedicate". Reported by Tassilo Horn
<tassilo@member.fsf.org>.
test, which runs afoul of Automake installations where, for example,
/usr/share/aclocal contains a copy of gl_THREADLIB.
Problem reported by Sven Joachim in
<http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00529.html>.
This is just a quick temporary fix, specific to Emacs; I'll work
with the other gnulib maintainers to get a more-permanent fix.
Paul Eggert [Sat, 9 Jul 2011 07:01:24 +0000 (00:01 -0700)]
* image.c: Integer signedness and overflow and related fixes.
This is not an exhaustive set of fixes, but it's time to
record what I've got.
(lookup_pixel_color, check_image_size): Remove redundant decls.
(check_image_size): Don't assume that arbitrary EMACS_INT values
fit in 'int', or that arbitrary 'double' values fit in 'int'.
(x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
(tiff_load, imagemagick_load_image):
Check for overflow in size calculations.
(x_create_x_image_and_pixmap): Remove unnecessary test for
xmalloc returning NULL; that can't happen.
(xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
(xpm_color_bucket): Use better integer hashing function.
(xpm_cache_color): Don't possibly over-allocate memory.
(struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
(gif_memory_source):
Use ptrdiff_t, not int or size_t, to record sizes.
(png_load): Don't assume values greater than 2**31 fit in 'int'.
(our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
either works, as we prefer signed integers.
(tiff_read_from_memory, tiff_write_from_memory):
Return tsize_t, not size_t, since that's what the TIFF API wants.
(tiff_read_from_memory): Don't fail simply because the read would
go past EOF; instead, return a short read.
(tiff_load): Omit no-longer-needed casts.
(Fimagemagick_types): Don't assume size fits into 'int'.
Paul Eggert [Fri, 8 Jul 2011 20:20:19 +0000 (13:20 -0700)]
Simplify Emacs part of pthread_sigmask support.
* Makefile.in (GNULIB_TOOL_FLAGS): Do not avoid sigprocmask.
* configure.in (AC_TYPE_UID_T): New dummy macro.
Configure gnulib after adjusting LIBS,
so that gnulib can assume the libraries in LIBS.
* lib/pthread_sigmask.c, lib/sigprocmask.c, m4/signalblocking.m4:
New files, automatically imported from gnulib.
* lib/gnulib.mk, m4/gl-comp.m4: Regenerate.
* src/Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
(LIBES): Use it.
Jan Djärv [Fri, 8 Jul 2011 17:25:17 +0000 (19:25 +0200)]
Don't let Gtk+ linewrap tooltips.
* gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
Put text in x->ttip_lbl instead of gtk_tooltip_set_text.
(xg_hide_tooltip): Fix comment.
Jan Djärv [Fri, 8 Jul 2011 10:04:23 +0000 (12:04 +0200)]
Fix warnings in ns*m files: Replace deprecated methods, declare new interfaces.
* emacs.c: Declare unexec_init_emacs_zone.
* nsfns.m (check_ns_display_info): Cast to long and use %ld in error
to avoid warning.
* nsimage.m (allocInitFromFile): Don't use deprecated method
bestRepresentationForDevice on OSX >= 10.6.
* nsmenu.m (fillWithWidgetValue): Don't use depercated method
sizeToFit on OSX >= 10.2.
* nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
cString and lossyCString on OSX >= 10.4
* nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
(MAC_OS_X_VERSION_10_5): Define if not defined.
(EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
(EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
(EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
* nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
variable firstTime not needed on OSX >= 10.6.
(setPosition): setFloatValue:knobProportion: is deprecated on OSX
>= 10.5. Use setKnobProportion, setDoubleValue.
Jan Djärv [Fri, 8 Jul 2011 08:11:35 +0000 (10:11 +0200)]
Fix services menu empty on OSX 1.6+.
* nsfns.m (Fx_open_connection): Remove NSStringPboardType from
ns_return_types.
(Fns_list_services): Just return Qnil on 10.6, code not working there.
* nsmenu.m (ns_update_menubar): Remove useless setDelegate call
on svcsMenu.
* nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
* nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
(ns_get_local_selection): Declare.
* nsterm.m (QUTF8_STRING): Declare.
(initFrameFromEmacs): Call registerServicesMenuSendTypes.
(validRequestorForSendType): Return type is (id).
Change indexOfObjectIdenticalTo to indexOfObject.
Check if we have local selection before returning self (Bug#8842).
(writeSelectionToPasteboard): Put local selection into paste board
if we have a local selection (Bug#8842).
(syms_of_nsterm): DEFSYM QUTF8_STRING.
* mail/sendmail.el (sendmail-query-once): If we aren't allowed to
save customizations (with "emacs -Q"), just set the variable
instead of erroring out.
Paul Eggert [Fri, 8 Jul 2011 00:51:25 +0000 (17:51 -0700)]
Improve hashing quality when configured --with-wide-int.
* fns.c (hash_string): New function, taken from sxhash_string.
Do not discard information about ASCII character case; this
discarding is no longer needed.
(sxhash-string): Use it. Change sig to match it. Caller changed.
* lisp.h: Declare it.
* lread.c (hash_string): Remove, since we now use fns.c's version.
The fns.c version returns a wider integer if --with-wide-int is
specified, so this should help the quality of the hashing a bit.
Juri Linkov [Fri, 8 Jul 2011 00:08:53 +0000 (03:08 +0300)]
* lisp/arc-mode.el (archive-zip-expunge, archive-zip-update)
(archive-zip-update-case): Use 7z if found by `executable-find'.
The order of searching the available programs is the same as in
`archive-zip-extract'.
gnus-msg.el (gnus-bug): Don't insert user variables. It usually isn't very interesting any more, and it leaks potentially secret data.
(gnus-debug): Removed.
gnus-art.el (gnus-ignored-headers): Removed obsolete and non-working use of :custom-show.
Paul Eggert [Thu, 7 Jul 2011 22:45:25 +0000 (15:45 -0700)]
* emacs.c: Integer overflow minor fix.
(heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
Define only if GNU_LINUX.
(main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
Paul Eggert [Thu, 7 Jul 2011 22:14:22 +0000 (15:14 -0700)]
* dispnew.c: Integer signedness and overflow fixes.
Remove unnecessary forward decls, that were a maintenance hassle.
(history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
All uses changed.
(adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
(scrolling_window): Use ptrdiff_t, not int, for byte count.
(prepare_desired_row, line_draw_cost):
Use int, not unsigned, where either works.
(save_current_matrix, restore_current_matrix):
Use ptrdiff_t, not size_t, where either works.
(init_display): Check for overflow more accurately, and without
relying on undefined behavior.
Remove, replacing with the new symbols in lisp.h. All uses changed.
* fileio.c (make_temp_name):
* filelock.c (lock_file_1, lock_file):
* xdisp.c (message_dolog):
Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
Use pMd etc. instead.
* lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
replacing the pWIDE etc. symbols removed from editfns.c.