Paul Eggert [Tue, 14 Jun 2011 18:58:22 +0000 (11:58 -0700)]
Merge from trunk.
Paul Eggert [Tue, 14 Jun 2011 18:57:19 +0000 (11:57 -0700)]
Variadic C functions now count arguments with ptrdiff_t.
This partly undoes my 2011-03-30 change, which replaced int with size_t.
Back then I didn't know that the Emacs coding style prefers signed int.
Also, in the meantime I found a few more instances where arguments
were being counted with int, which may truncate counts on 64-bit
machines, or EMACS_INT, which may be unnecessarily wide.
* lisp.h (struct Lisp_Subr.function.aMANY)
(DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
Arg counts are now ptrdiff_t, not size_t.
All variadic functions and their callers changed accordingly.
(struct gcpro.nvars): Now size_t, not size_t. All uses changed.
* bytecode.c (exec_byte_code): Check maxdepth for overflow,
to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
* callint.c (Fcall_interactively): Check arg count for overflow,
to avoid potential buffer overrun. Use signed char, not 'int',
for 'varies' array, so that we needn't bother to check its size
calculation for overflow.
* editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
* eval.c (apply_lambda):
* fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
(struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
(mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
Paul Eggert [Tue, 14 Jun 2011 05:51:17 +0000 (22:51 -0700)]
* callint.c (Fcall_interactively): Don't use index var as event count.
Chong Yidong [Tue, 14 Jun 2011 05:06:26 +0000 (01:06 -0400)]
Print theme summaries in *Custom Themes* buffer.
* lisp/cus-theme.el (describe-theme-1): Use custom-theme-p.
(custom-theme-summary): New function.
(customize-themes): Use it.
* etc/themes/light-blue-theme.el:
* etc/themes/misterioso-theme.el:
* etc/themes/tango-dark-theme.el:
* etc/themes/tango-theme.el:
* etc/themes/tsdh-dark-theme.el:
* etc/themes/tsdh-light-theme.el:
* etc/themes/wheatgrass-theme.el:
* etc/themes/wombat-theme.el: Tweak summaries for better listability.
Chong Yidong [Tue, 14 Jun 2011 05:00:35 +0000 (01:00 -0400)]
* etc/themes/dichromacy-theme.el: New theme.
Paul Eggert [Tue, 14 Jun 2011 04:49:24 +0000 (21:49 -0700)]
* vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
* mem-limits.h (SIZE): Remove; no longer used.
Paul Eggert [Tue, 14 Jun 2011 00:58:31 +0000 (17:58 -0700)]
Merge from trunk.
Glenn Morris [Mon, 13 Jun 2011 21:42:40 +0000 (17:42 -0400)]
cus-dep fix for build failure first occurring with 2011-06-13T08:21:09Z!rudalics@gmx.at
The symptom was `make custom-dep' failing with "Unknown terminal type".
This is caused by `display-buffer' trying to pop-up a frame in batch mode.
I think this cus-dep change may be just papering over the immediate
manifestation of the underlying problem.
* lisp/cus-dep.el (custom-make-dependencies): Use up command-line-args-left.
Paul Eggert [Mon, 13 Jun 2011 16:08:46 +0000 (09:08 -0700)]
* xterm.c (x_alloc_nearest_color_1): Go back to original algorithm.
Martin Rudalics [Mon, 13 Jun 2011 13:14:42 +0000 (15:14 +0200)]
Make help and view-mode work with new buffer display facilities.
* help.el (help-window): Remove variable.
(help-window-point-marker, temp-buffer-max-height)
(temp-buffer-resize-mode, help-window-select): Rewrite doc-strings.
(help-print-return-message): Don't set help-window.
(resize-temp-buffer-window): Rewrite cod eand doc-string.
(help-window-setup-finish): Remove.
(help-window-display-message, help-window-setup)
(with-help-window): Major rewrite based on new
display-buffer-window variable.
* help-mode.el (help-mode-finish): Remove help-window related
code.
* view.el (view-exits-all-viewing-windows): Remove reference to
view-return-to-alist in doc-string.
(view-return-to-alist): Make obsolete.
(view-buffer): Call pop-to-buffer-same-window and remove
undo-window code.
(view-buffer-other-window): Call pop-to-buffer-other-window and
simplify code. Ignore second argument.
(view-buffer-other-frame): Call pop-to-buffer-other-frame and
simplify code. Ignore second argument.
(view-return-to-alist-update): Make obsolete.
(view-mode-enter): Rename second argument to QUIT-RESTORE.
Rewrite using quit-restore window parameters.
(view-mode-exit): Rename second argument to EXIT-ONLY. Rewrite
using quit-restore-window.
(View-exit, View-exit-and-edit, View-leave, View-quit)
(View-quit-all, View-kill-and-leave): Call view-mode-exit with
appropriate arguments.
(view-end-message): Use quit-restore window parameter.
Martin Rudalics [Mon, 13 Jun 2011 08:21:09 +0000 (10:21 +0200)]
Install new buffer display functions and variables.
* window.el (display-buffer-function): Rewrite doc-string.
(display-buffer-window, display-buffer-alist): New variables.
(display-buffer-split-specifiers)
(display-buffer-side-specifiers)
(display-buffer-macro-specifiers): New constants.
(display-buffer-even-window-sizes, display-buffer-set-height)
(display-buffer-set-width, display-buffer-select-window)
(display-buffer-in-window, display-buffer-reuse-window)
(display-buffer-split-window-1, display-buffer-split-window)
(display-buffer-split-atom-window, display-buffer-pop-up-window)
(display-buffer-pop-up-frame, display-buffer-pop-up-side-window)
(display-buffer-in-side-window, normalize-buffer-to-display)
(display-buffer-normalize-specifiers-1)
(display-buffer-normalize-specifiers-2)
(display-buffer-normalize-specifiers, display-buffer-frame): New
functions.
(display-buffer): Major rewrite.
(display-buffer-other-window, display-buffer-other-frame)
(pop-to-buffer, switch-to-buffer-other-window)
(switch-to-buffer-other-frame): Rewrite.
(display-buffer-same-window, display-buffer-same-frame)
(display-buffer-same-frame-other-window)
(pop-to-buffer-same-window, pop-to-buffer-same-frame)
(pop-to-buffer-other-window)
(pop-to-buffer-same-frame-other-window)
(pop-to-buffer-other-frame, switch-to-buffer-same-frame)
(switch-to-buffer-other-window-same-frame): New functions.
(same-window-p, special-display-p): Rewrite disabling warnings.
Make obsolete.
(pop-up-frames, display-buffer-reuse-frames, pop-up-windows)
(display-buffer-mark-dedicated): Initialize to symbol 'unset.
Make obsolete
(same-window-buffer-names, same-window-regexps)
(special-display-frame-alist, special-display-popup-frame)
(special-display-function, special-display-buffer-names)
(special-display-regexps, pop-up-frame-alist)
(pop-up-frame-function, split-window-preferred-function)
(split-height-threshold, split-width-threshold)
(even-window-heights): Make obsolete.
Paul Eggert [Mon, 13 Jun 2011 08:00:15 +0000 (01:00 -0700)]
Merge from trunk.
Paul Eggert [Mon, 13 Jun 2011 07:53:14 +0000 (00:53 -0700)]
* xterm.c (x_alloc_nearest_color_1): Use a more-precise algorithm
for nearest color, one that neither overflows nor relies on unsigned
arithmetic.
Paul Eggert [Mon, 13 Jun 2011 06:53:31 +0000 (23:53 -0700)]
Remove unnecessary casts.
* xterm.c (x_term_init):
* xfns.c (x_set_border_pixel):
* widget.c (create_frame_gcs): Remove casts to unsigned long etc.
These aren't needed now that we assume ANSI C.
Paul Eggert [Mon, 13 Jun 2011 06:49:00 +0000 (23:49 -0700)]
* sound.c (Fplay_sound_internal): Remove cast to unsigned long.
It's more likely to cause problems (due to unsigned overflow)
than to cure them.
Paul Eggert [Mon, 13 Jun 2011 06:34:04 +0000 (23:34 -0700)]
* dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
Paul Eggert [Mon, 13 Jun 2011 05:55:57 +0000 (22:55 -0700)]
* unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
Paul Eggert [Mon, 13 Jun 2011 05:49:35 +0000 (22:49 -0700)]
* xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
Paul Eggert [Mon, 13 Jun 2011 05:43:30 +0000 (22:43 -0700)]
* keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
Paul Eggert [Mon, 13 Jun 2011 05:24:58 +0000 (22:24 -0700)]
* lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
Paul Eggert [Mon, 13 Jun 2011 05:18:27 +0000 (22:18 -0700)]
* lread.c (Fload): Don't compare a possibly-garbage time_t value.
Paul Eggert [Mon, 13 Jun 2011 05:15:27 +0000 (22:15 -0700)]
GLYPH_CODE_FACE returns EMACS_INT, not int.
* dispextern.h (merge_faces):
* xfaces.c (merge_faces):
* xdisp.c (get_next_display_element):
(next_element_from_display_vector): Don't assume EMACS_INT fits in int.
Paul Eggert [Mon, 13 Jun 2011 04:55:03 +0000 (21:55 -0700)]
* character.h (CHAR_VALID_P): Remove unused parameter.
* fontset.c, lisp.h, xdisp.c: All uses changed.
Paul Eggert [Mon, 13 Jun 2011 04:27:45 +0000 (21:27 -0700)]
* editfns.c (Ftranslate_region_internal): Omit redundant test.
Paul Eggert [Mon, 13 Jun 2011 02:41:13 +0000 (19:41 -0700)]
* fns.c (concat): Minor tuning based on overflow analysis.
This doesn't fix any bugs. Use int to hold character, instead
of constantly refetching from Emacs object. Use XFASTINT, not
XINT, for value known to be a character. Don't bother comparing
a single byte to 0400, as it's always less.
Paul Eggert [Mon, 13 Jun 2011 02:27:16 +0000 (19:27 -0700)]
* floatfns.c (Fexpt): Omit unnecessary cast to unsigned.
Paul Eggert [Mon, 13 Jun 2011 02:23:58 +0000 (19:23 -0700)]
* fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
Paul Eggert [Mon, 13 Jun 2011 02:21:14 +0000 (19:21 -0700)]
* editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
for characters.
Paul Eggert [Mon, 13 Jun 2011 02:09:34 +0000 (19:09 -0700)]
* doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
Paul Eggert [Mon, 13 Jun 2011 02:02:16 +0000 (19:02 -0700)]
* data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
Without this fix, on a 64-bit host (aset S 0
4294967386) would
incorrectly succeed when S was a string, because
4294967386 was
truncated before it was used.
Paul Eggert [Mon, 13 Jun 2011 01:38:25 +0000 (18:38 -0700)]
* chartab.c (Fchar_table_range): Use CHARACTERP to check range.
Otherwise, an out-of-range integer could cause undefined behavior
on a 64-bit host.
Paul Eggert [Mon, 13 Jun 2011 01:35:47 +0000 (18:35 -0700)]
* composite.c: Use int, not EMACS_INT, for characters.
(fill_gstring_body, composition_compute_stop_pos): Use int, not
EMACS_INT, for values that are known to be in character range.
This doesn't fix any bugs but is the usual style inside Emacs and
may generate better code on 32-bit machines.
Paul Eggert [Mon, 13 Jun 2011 01:07:35 +0000 (18:07 -0700)]
Make sure a 64-bit char is never passed to ENCODE_CHAR.
This is for reasons similar to the recent CHAR_STRING fix.
* charset.c (Fencode_char): Check that character arg is actually
a character. Pass an int to ENCODE_CHAR.
* charset.h (ENCODE_CHAR): Verify that the character argument is no
wider than 'int', as a compile-time check to prevent future regressions
in this area.
Paul Eggert [Mon, 13 Jun 2011 00:36:44 +0000 (17:36 -0700)]
* character.c (char_string): Remove unnecessary casts.
Paul Eggert [Mon, 13 Jun 2011 00:36:03 +0000 (17:36 -0700)]
Make sure a 64-bit char is never passed to CHAR_STRING.
Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
by silently ignoring the top 32 bits, allowing some values
that were far too large to be valid characters.
* character.h: Include <verify.h>.
(CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
arguments are no wider than unsigned, as a compile-time check
to prevent future regressions in this area.
* data.c (Faset):
* editfns.c (Fchar_to_string, general_insert_function, Finsert_char):
(Fsubst_char_in_region):
* fns.c (concat):
* xdisp.c (decode_mode_spec_coding):
Adjust to CHAR_STRING's new requirement.
* editfns.c (Finsert_char, Fsubst_char_in_region):
* fns.c (concat): Check that character args are actually
characters. Without this test, these functions did the wrong
thing with wildly out-of-range values on 64-bit hosts.
Paul Eggert [Sun, 12 Jun 2011 23:28:37 +0000 (16:28 -0700)]
Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
These casts should not be needed on 32-bit hosts, either.
* keyboard.c (read_char):
* lread.c (Fload): Remove casts to unsigned.
Paul Eggert [Sun, 12 Jun 2011 23:25:12 +0000 (16:25 -0700)]
* lisp.h (UNSIGNED_CMP): New macro.
This fixes comparison bugs on 64-bit hosts.
(ASCII_CHAR_P): Use it.
* casefiddle.c (casify_object):
* character.h (ASCII_BYTE_P, CHAR_VALID_P):
(SINGLE_BYTE_CHAR_P, CHAR_STRING):
* composite.h (COMPOSITION_ENCODE_RULE_VALID):
* dispextern.h (FACE_FROM_ID):
* keyboard.c (read_char): Use UNSIGNED_CMP.
Glenn Morris [Sun, 12 Jun 2011 20:18:04 +0000 (13:18 -0700)]
* term/xterm.el (terminal-init-xterm): Still more simplifications.
Glenn Morris [Sun, 12 Jun 2011 20:15:02 +0000 (13:15 -0700)]
* term/xterm.el (terminal-init-xterm): More simplifications.
Glenn Morris [Sun, 12 Jun 2011 19:58:32 +0000 (12:58 -0700)]
* term/xterm.el (terminal-init-xterm): Misc simplifications.
Glenn Morris [Sun, 12 Jun 2011 19:56:41 +0000 (12:56 -0700)]
* term/xterm.el (terminal-init-xterm): `version' may be nil. (Bug#8838)
Michael Albinus [Sun, 12 Jun 2011 19:23:29 +0000 (21:23 +0200)]
* tramp.texi (Customizing Completion): Mention authinfo-style files.
(Password handling): `auth-source-debug' is good for debug messages.
Andreas Schwab [Sun, 12 Jun 2011 10:37:40 +0000 (12:37 +0200)]
* leim/SKK-DIC/SKK-JISYO.L: Add proper coding tag.
* leim/CXTERM-DIC/4Corner.tit, leim/CXTERM-DIC/ARRAY30.tit,
* leim/CXTERM-DIC/CCDOSPY.tit, leim/CXTERM-DIC/ECDICT.tit,
* leim/CXTERM-DIC/ETZY.tit, leim/CXTERM-DIC/PY-b5.tit,
* leim/CXTERM-DIC/Punct-b5.tit, leim/CXTERM-DIC/Punct.tit,
* leim/CXTERM-DIC/QJ-b5.tit, leim/CXTERM-DIC/QJ.tit, leim/CXTERM-DIC/SW.tit,
* leim/CXTERM-DIC/TONEPY.tit, leim/CXTERM-DIC/ZOZY.tit: Likewise.
* leim/MISC-DIC/cangjie-table.b5, leim/MISC-DIC/cangjie-table.cns,
* leim/MISC-DIC/pinyin.map, leim/MISC-DIC/ziranma.cin: Likewise.
Martin Rudalics [Sun, 12 Jun 2011 10:16:46 +0000 (12:16 +0200)]
Fix make_frame, introduce Vtemp_buffer_show_specifiers, cleanup doc-strings.
* frame.c (make_frame): Call other_buffer_safely instead of
other_buffer.
* window.c (temp_output_buffer_show): Call display_buffer with
second argument Vtemp_buffer_show_specifiers and reset latter
immediately after the call.
(Vtemp_buffer_show_specifiers): New variable.
(auto_window_vscroll_p, next_screen_context_lines)
(Vscroll_preserve_screen_position): Remove leading asterisks from
doc-strings.
Andreas Schwab [Sun, 12 Jun 2011 09:01:24 +0000 (11:01 +0200)]
* leim/Makefile.in (TIT_BIG5): Renamed from TIT-BIG5.
Martin Rudalics [Sun, 12 Jun 2011 07:46:56 +0000 (09:46 +0200)]
Restore window-safely-shrinkable-p but avoid using it in calendar.el.
* window.el (window-safely-shrinkable-p): Restore function which
was inadvertently removed in change from 2011-06-11. Declare as
obsolete.
* calendar/calendar.el (calendar-generate-window): Use
window-iso-combined-p instead of combination of one-window-p and
window-safely-shrinkable-p.
Paul Eggert [Sun, 12 Jun 2011 03:59:59 +0000 (20:59 -0700)]
Fix minor problems found by GCC 4.6.0 static checking.
* buffer.c (Qclone_number): Remove for now, as it's unused.
(record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
(record_buffer): Remove unused local.
* frame.c (other_visible_frames, frame_buffer_list): Now static.
(set_frame_buffer_list): Remove; unused.
* frame.h (other_visible_frames): Remove decl.
* keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
* lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
(add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
if HAVE_GPM.
* menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
* process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
Define only if HAVE_GPM.
* widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
(update_hints_inhibit): Remove; never set. All uses removed.
* widgetprv.h (emacsFrameClassRec): Remove decl.
* window.c (delete_deletable_window): Now returns void, since it
wasn't returning anything.
(compare_window_configurations): Remove unused locals.
* xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
* xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
(dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
the same widths as pointers. This follows up on the 2011-05-06 patch.
* xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
* xterm.h: Likewise.
(x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
Paul Eggert [Sun, 12 Jun 2011 03:54:09 +0000 (20:54 -0700)]
Merge from trunk.
Paul Eggert [Sun, 12 Jun 2011 03:53:12 +0000 (20:53 -0700)]
* xmenu.c (x_menu_set_in_use): Fix incorrect assumption.
Juanma Barranquero [Sun, 12 Jun 2011 02:48:18 +0000 (04:48 +0200)]
src/makefile.w32-in: Update dependencies.
Glenn Morris [Sun, 12 Jun 2011 00:57:24 +0000 (17:57 -0700)]
Give % punctuation syntax in fortran modes (bug#8820)
* lisp/progmodes/fortran.el (fortran-mode-syntax-table):
* lisp/progmodes/f90.el (f90-mode-syntax-table):
Set % to punctuation.
(f90-find-tag-default): Remove, no longer needed.
Daniel Colascione [Sun, 12 Jun 2011 00:27:14 +0000 (17:27 -0700)]
* emacs-lisp/syntax.el (syntax-ppss): Clarify which items are invalid.
Chong Yidong [Sat, 11 Jun 2011 23:03:16 +0000 (19:03 -0400)]
Handle gif subimage animation delay correctly.
* lisp/image.el (image-animated-p): Return animation delay in seconds.
Avoid bit manipulation in Lisp; use `delay' entry in the metadata.
(image-animate-timeout): Remove DELAY argument. Use
image-animated-p to get animation delay for each frame.
(image-animate): Caller changed.
* src/image.c (gif_load): Add animation frame delay to the metadata.
(syms_of_image): Use DEFSYM. New symbol `delay'.
Paul Eggert [Sat, 11 Jun 2011 21:32:21 +0000 (14:32 -0700)]
Merge from trunk.
Paul Eggert [Sat, 11 Jun 2011 21:31:32 +0000 (14:31 -0700)]
* buffer.c (Qclone_number): Remove for now, as it's unused.
(record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
(record_buffer): Remove unused local.
* frame.c (other_visible_frames, frame_buffer_list): Now static.
(set_frame_buffer_list): Remove; unused.
* frame.h (other_visible_frames): Remove decl.
* keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
* lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
(add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
if HAVE_GPM.
* menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
* process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
Define only if HAVE_GPM.
* widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
(update_hints_inhibit): Remove; never set. All uses removed.
* widgetprv.h (emacsFrameClassRec): Remove decl.
* window.c (delete_deletable_window): Now returns void, since it
wasn't returning anything.
(compare_window_configurations): Remove unused locals.
* xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
* xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
Omit no-longer-needed #ifdef USE_X_TOOLKIT, since USE_X_TOOLKIT is
implied by USE_GTK || USE_MOTIF.
(dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
the same widths as pointers. This follows up on the 2011-05-06 patch.
* xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
* xterm.h: Likewise.
(x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
Michael Albinus [Sat, 11 Jun 2011 18:30:43 +0000 (20:30 +0200)]
* net/tramp.el (tramp-debug-message): Add `tramp-with-progress-reporter'
to ignored backtrace functions.
Glenn Morris [Sat, 11 Jun 2011 17:54:53 +0000 (10:54 -0700)]
Handle overlapping appointments in appt.el (bug#8377)
* lisp/calendar/appt.el (appt-disp-window-function): Doc fix.
(appt-check): Handle overlapping appointments.
* etc/NEWS: Mention appt-disp-window-function should handle lists now.
Martin Rudalics [Sat, 11 Jun 2011 14:06:16 +0000 (16:06 +0200)]
Window configuration, balancing and fit-to-buffer rewrites.
* window.c (delete_deletable_window): Re-add.
(Fset_window_configuration): Rewrite to handle dead buffers and
consequently deletable windows.
(window_tree, Fwindow_tree): Remove. Supply functionality in
window.el.
(compare_window_configurations): Simplify code.
* window.el (window-tree-1, window-tree): New functions, moving
the latter to window.el.
(bw-get-tree, bw-get-tree-1, bw-find-tree-sub)
(bw-find-tree-sub-1, bw-l, bw-t, bw-r, bw-b, bw-dir, bw-eqdir)
(bw-refresh-edges): Remove.
(balance-windows-1, balance-windows-2): New functions.
(balance-windows): Rewrite in terms of window tree functions,
balance-windows-1 and balance-windows-2.
(bw-adjust-window): Remove.
(balance-windows-area-adjust): New function with functionality of
bw-adjust-window but using resize-window.
(set-window-text-height): Rewrite doc-string. Use
normalize-live-window and resize-window.
(enlarge-window-horizontally, shrink-window-horizontally): Rename
argument to DELTA.
(window-buffer-height): New function.
(fit-window-to-buffer, shrink-window-if-larger-than-buffer):
Rewrite using new window resize routines.
(kill-buffer-and-window, mouse-autoselect-window-select): Use
ignore-errors instead of condition-case.
(quit-window): Call delete-frame instead of delete-windows-on
for the only buffer on frame.
Andreas Schwab [Sat, 11 Jun 2011 10:11:07 +0000 (12:11 +0200)]
* src/image.c (imagemagick_load_image): Fix type mismatch.
(Fimagemagick_types): Likewise.
Andreas Schwab [Sat, 11 Jun 2011 10:11:07 +0000 (12:11 +0200)]
* src/window.h (replace_buffer_in_windows): Declare.
Martin Rudalics [Sat, 11 Jun 2011 09:50:37 +0000 (11:50 +0200)]
Move/add window-buffer-related functions to window.el.
* buffer.c: New Lisp objects Qbuffer_list_update_hook and
Qclone_number. Remove external declaration of Qdelete_window.
(Fbuffer_list): Rewrite doc-string. Minor restructuring of
code.
(Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer): Run
Qbuffer_list_update_hook if allowed.
(Fother_buffer): Rewrite doc-string. Major rewrite for new
buffer list implementation.
(other_buffer_safely): New function.
(Fkill_buffer): Replace call to replace_buffer_in_all_windows by
calls to replace_buffer_in_windows and
replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
if allowed.
(record_buffer): Inhibit quitting and rewrite using quittable
functions. Run Qbuffer_list_update_hook if allowed.
(Frecord_buffer, Funrecord_buffer): New functions.
(switch_to_buffer_1, Fswitch_to_buffer): Remove. Move
switch-to-buffer to window.el.
(bury-buffer): Move to window.el.
(Vbuffer_list_update_hook): New variable.
* lisp.h (other_buffer_safely): Add prototype in buffer.c
section.
* window.h (resize_frame_windows): Move up in code.
(Fwindow_frame): Remove EXFUN.
(replace_buffer_in_all_windows): Remove prototype.
(replace_buffer_in_windows_safely): Add prototype.
* window.c: Declare Qdelete_window static again. Move down
declaration of select_count.
(Fnext_window, Fprevious_window): Rewrite doc-strings.
(Fother_window): Move to window.el.
(window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
(Fdelete_windows_on, Freplace_buffer_in_windows): Move to
window.el.
(replace_buffer_in_windows): Implement by calling
Qreplace_buffer_in_windows.
(replace_buffer_in_all_windows): Remove with some functionality
moved into replace_buffer_in_windows_safely.
(replace_buffer_in_windows_safely): New function.
(select_window_norecord, select_frame_norecord): Move in front
of run_window_configuration_change_hook. Remove now obsolete
declarations.
(Fset_window_buffer): Rewrite doc-string. Call
Qrecord_window_buffer.
(keys_of_window): Move binding for other-window to window.el.
* loadup.el (top-level): Load window before files for the sake
of replace-buffer-in-windows.
* files.el (read-buffer-to-switch)
(switch-to-buffer-other-window)
(switch-to-buffer-other-frame, display-buffer-other-frame): Move
to window.el.
* simple.el (get-next-valid-buffer, last-buffer, next-buffer)
(previous-buffer): Move to window.el.
* bindings.el (unbury-buffer): Move to window.el.
* window.el (delete-other-windows-vertically): Move after
definition of delete-other-windows.
(other-window, delete-windows-on, replace-buffer-in-windows):
Move here from window.c.
(record-window-buffer, unrecord-window-buffer)
(set-window-buffer-start-and-point, switch-to-prev-buffer)
(switch-to-next-buffer): New functions.
(get-next-valid-buffer, last-buffer, next-buffer): Move here
from simple.el. Call switch-to-next-buffer.
(previous-buffer): Move here from simple.el. Call
switch-to-prev-buffer.
(bury-buffer): Move here from buffer.c. Switch to previous
buffer when window cannot be deleted.
(unbury-buffer): Move here from bindings.el.
(ctl-x-map): Move binding for other-window from window.c to
here.
(read-buffer-to-switch, switch-to-buffer-other-window)
(switch-to-buffer-other-frame): Move here from files.el.
(normalize-buffer-to-switch-to): New functions.
(switch-to-buffer): Move here from buffer.c. Use
read-buffer-to-switch and normalize-buffer-to-switch-to.
Paul Eggert [Sat, 11 Jun 2011 05:47:05 +0000 (22:47 -0700)]
Merge from trunk.
Paul Eggert [Sat, 11 Jun 2011 05:46:16 +0000 (22:46 -0700)]
Merge from trunk.
Chong Yidong [Sat, 11 Jun 2011 01:48:59 +0000 (21:48 -0400)]
Cruft removal in struct image.
* src/dispextern.h (struct image): Replace data member, whose int_val
and ptr_val fields were not used by anything, with a single
lisp_val object.
* src/image.c (Fimage_metadata, make_image, mark_image, tiff_load)
(gif_clear_image, gif_load, imagemagick_load_image)
(gs_clear_image, gs_load): Callers changed.
Paul Eggert [Fri, 10 Jun 2011 20:52:30 +0000 (13:52 -0700)]
* buffer.h: Include <time.h>, for time_t.
Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
Paul Eggert [Fri, 10 Jun 2011 20:38:18 +0000 (13:38 -0700)]
Merge: Fix minor problems found by static checking.
* image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
Make identifiers static if they are not used in other modules.
* data.c (Qcompiled_function, Qframe, Qvector):
* image.c (QimageMagick, Qsvg):
* minibuf.c (Qmetadata):
* window.c (resize_window_check, resize_root_window): Now static.
* window.h (resize_window_check, resize_root_window): Remove decls.
* window.c (window_deletion_count, delete_deletable_window):
Remove; unused.
(window_body_lines): Now static.
(Fdelete_other_windows_internal): Mark vars as initialized.
Make sure 'resize_failed' is initialized.
(run_window_configuration_change_hook): Rename local to avoid shadowing.
(resize_window_apply): Remove unused local.
* window.h (delete_deletable_window): Remove decl.
* image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
(imagemagick_load_image): Fix pointer signedness problem by changing
last arg from unsigned char * to char *. All uses changed.
Also, fix a local for similar reasons.
Remove unused locals. Remove locals to avoid shadowing.
(fn_rsvg_handle_free): Remove; unused.
(svg_load, svg_load_image): Fix pointer signedness problem.
(imagemagick_load_image): Don't use garbage pointer image_wand.
* ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
Paul Eggert [Fri, 10 Jun 2011 20:34:05 +0000 (13:34 -0700)]
* image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
Paul Eggert [Fri, 10 Jun 2011 20:05:21 +0000 (13:05 -0700)]
Make identifiers static if they are not used in other modules.
* data.c (Qcompiled_function, Qframe, Qvector):
* image.c (QimageMagick, Qsvg):
* minibuf.c (Qmetadata):
* window.c (resize_window_check, resize_root_window): Now static.
* window.h (resize_window_check, resize_root_window): Remove decls.
Paul Eggert [Fri, 10 Jun 2011 19:52:27 +0000 (12:52 -0700)]
* image.c (imagemagick_load_image): Don't use garbage pointer image_wand.
Paul Eggert [Fri, 10 Jun 2011 19:52:05 +0000 (12:52 -0700)]
* window.c: Fix minor problems reported by GCC 4.6.0.
(window_deletion_count, delete_deletable_window): Remove; unused.
(window_body_lines): Now static.
(Fdelete_other_windows_internal): Mark vars as initialized.
Make sure 'resize_failed' is initialized.
(run_window_configuration_change_hook): Rename local to avoid shadowing.
(resize_window_apply): Remove unused local.
* window.h (delete_deletable_window): Remove decl.
Paul Eggert [Fri, 10 Jun 2011 19:35:58 +0000 (12:35 -0700)]
* image.c: Fix minor problems reported by GCC 4.6.0.
(gif_load, svg_load_image): Rename locals to avoid shadowing.
(imagemagick_load_image): Fix pointer signedness problem by changing
last arg from unsigned char * to char *. All uses changed.
Also, fix a local for similar reasons.
Remove unused locals. Remove locals to avoid shadowing.
(fn_rsvg_handle_free): Remove; unused.
(svg_load, svg_load_image): Fix pointer signedness problem.
Paul Eggert [Fri, 10 Jun 2011 19:31:15 +0000 (12:31 -0700)]
* ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
Paul Eggert [Fri, 10 Jun 2011 18:19:35 +0000 (11:19 -0700)]
Merge from trunk.
Paul Eggert [Fri, 10 Jun 2011 17:50:07 +0000 (10:50 -0700)]
* movemail.c: Fix race condition and related bugs (Bug#8836).
(main) [!MAIL_USE_SYSTEM_LOCK]: Prefer mkstemp to mktemp, as this
fixes some race conditions. Report mkstemp/mktemp errno rather
than a possibly-garbage errno. Reinitialize the template each
time through the loop, as earlier mkstemp/mktemp calls could have
trashed it. Pass 0600 (not 0666) to mktemp, for consistency
with mkstemp; the permissions don't matter anyway.
Chong Yidong [Fri, 10 Jun 2011 15:46:48 +0000 (11:46 -0400)]
* image.c (gif_load): Fix omitted cast error introduced by 2011-06-06 change.
Martin Rudalics [Fri, 10 Jun 2011 13:18:13 +0000 (15:18 +0200)]
Some more window.h fixes missing in 2011-06-10T06:55:18Z!rudalics@gmx.at.
* window.h (resize_proportionally, orig_total_lines)
(orig_top_line): Remove from window structure.
(set_window_height, set_window_width, change_window_heights)
(Fdelete_window): Remove prototypes.
(resize_frame_windows): Remove duplicate declaration.
Eli Zaretskii [Fri, 10 Jun 2011 10:16:15 +0000 (13:16 +0300)]
Avoid compiler warnings about missing prototypes of window.c functions.
src/window.h (resize_frame_windows, resize_window_check)
(delete_deletable_window, resize_root_window)
(resize_frame_windows): Declare prototypes.
src/ window.c (resize_window_apply): Make definition be "static" to
match the prototype.
Martin Rudalics [Fri, 10 Jun 2011 06:55:18 +0000 (08:55 +0200)]
Move window resize code from window.c to window.el.
* window.c: Remove declarations of Qwindow_size_fixed,
window_min_size_1, window_min_size_2, window_min_size,
size_window, window_fixed_size_p, enlarge_window, delete_window.
Remove static from declaration of Qdelete_window, it's
temporarily needed by Fbury_buffer.
(replace_window): Don't assign orig_top_line and
orig_total_lines.
(Fdelete_window, delete_window): Remove. Window deletion is
handled by window.el.
(window_loop): Remove DELETE_OTHER_WINDOWS case. Replace
Fdelete_window calls with calls to Qdelete_window.
(Fdelete_other_windows): Remove. Deleting other windows is
handled by window.el.
(window_fixed_size_p): Remove. Fixed-sizeness of windows is
handled in window.el.
(window_min_size_2, window_min_size_1, window_min_size): Remove.
Window minimum sizes are handled in window.el.
(shrink_windows, size_window, set_window_height)
(set_window_width, change_window_heights, window_height)
(window_width, CURBEG, CURSIZE, enlarge_window)
(adjust_window_trailing_edge, Fadjust_window_trailing_edge)
(Fenlarge_window, Fshrink_window): Remove. Window resizing is
handled in window.el.
(make_dummy_parent): Rename to make_parent_window and give it a
second argument horflag.
(make_window): Don't set resize_proportionally any more.
(Fsplit_window): Remove. Windows are split in window.el.
(save_restore_action, save_restore_orig_size)
(shrink_window_lowest_first, save_restore_orig_size): Remove.
Resize mini windows in window.el.
(grow_mini_window, shrink_mini_window): Implement by calling
Qresize_root_window_vertically, resize_window_check and
resize_window_apply.
(saved_window, Fset_window_configuration, save_window_save): Do
not handle orig_top_line, orig_total_lines, and
resize_proportionally.
(window_min_height, window_min_width): Move to window.el.
(keys_of_window): Move bindings for delete-other-windows,
split-window, delete-window and enlarge-window to window.el.
* buffer.c: Temporarily extern Qdelete_window.
(Fbury_buffer): Temporarily call Qdelete_window instead of
Fdelete_window (Fbury_buffer will move to window.el soon).
* frame.c (set_menu_bar_lines_1): Remove code handling
orig_top_line and orig_total_lines.
* dispnew.c (adjust_frame_glyphs_initially): Don't use
set_window_height but set heights directly.
(change_frame_size_1): Use resize_frame_windows.
* xdisp.c (init_xdisp): Don't use set_window_height but set
heights directly.
* xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): Use
resize_frame_windows instead of change_window_heights and run
run_window_configuration_change_hook.
* w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
instead of change_window_heights and run
run_window_configuration_change_hook.
* window.el (window-min-height, window-min-width): Move here
from window.c. Add defcustoms and rewrite doc-strings.
(resize-mini-window, resize-window): New functions.
(adjust-window-trailing-edge, enlarge-window, shrink-window):
Move here from window.c.
(maximize-window, minimize-window): New functions.
(delete-window, delete-other-windows, split-window): Move here
from window.c.
(window-split-min-size): New function.
(split-window-keep-point): Mention split-window-above-each-other
instead of split-window-vertically.
(split-window-above-each-other, split-window-vertically): Rename
split-window-vertically to split-window-above-each-other and
provide defalias for old definition.
(split-window-side-by-side, split-window-horizontally): Rename
split-window-horizontally to split-window-side-by-side and provide
defalias for the old definition.
(ctl-x-map): Move bindings for delete-window,
delete-other-windows and enlarge-window here from window.c.
Replace bindings for split-window-vertically and
split-window-horizontally by bindings for
split-window-above-each-other and split-window-side-by-side.
* cus-start.el (all): Remove entries for window-min-height and
window-min-width. Add entries for window-splits and
window-nest.
Katsumi Yamaoka [Fri, 10 Jun 2011 00:10:24 +0000 (00:10 +0000)]
Improve Gnus' dribble data handling.
Glenn Morris [Thu, 9 Jun 2011 20:36:04 +0000 (16:36 -0400)]
* lisp/calendar/appt.el (appt-mode-line): Eliminate one local variable.
Glenn Morris [Thu, 9 Jun 2011 20:25:34 +0000 (16:25 -0400)]
Eliminate some code duplication in appt.el.
* lisp/calendar/appt.el (appt-mode-line): New function.
(appt-check, appt-disp-window): Use it.
Glenn Morris [Thu, 9 Jun 2011 20:22:06 +0000 (16:22 -0400)]
Allow/recommend explicit args for minor-modes in file local eval:s.
* lisp/files.el (hack-one-local-variable-eval-safep):
Allow minor-modes with explicit +/-1 arguments.
* doc/emacs/custom.texi (Specifying File Variables):
Recommend explicit arguments for minor modes.
* etc/NEWS: Likewise.
* lisp/doc-view.el, lisp/net/soap-client.el: Update file locals.
Paul Eggert [Thu, 9 Jun 2011 19:08:29 +0000 (12:08 -0700)]
Remove obsolete comment about PNTR_COMPARISON_TYPE.
Paul Eggert [Thu, 9 Jun 2011 19:03:59 +0000 (12:03 -0700)]
* buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
isn't needed on 32-bit machines.
Ted Zlatanov [Thu, 9 Jun 2011 16:58:18 +0000 (11:58 -0500)]
Add `xterm-extra-capabilities' defcustom for terminals where the xterm capabilities query is not needed or wanted.
* term/xterm.el (xterm): Add defgroup.
(xterm-extra-capabilities): Add defcustom to supply known xterm
capabilities, skip querying them, or query them (default).
(terminal-init-xterm): Use it.
(terminal-init-xterm-modify-other-keys): New function to set up
modifyOtherKeys support to simplify `terminal-init-xterm'.
Glenn Morris [Thu, 9 Jun 2011 10:18:21 +0000 (06:18 -0400)]
Auto-commit of generated files.
Martin Rudalics [Thu, 9 Jun 2011 08:41:36 +0000 (10:41 +0200)]
Final preparations in window.el for new window resize code.
* window.el (resize-window-reset, resize-window-reset-1)
(resize-subwindows-skip-p, resize-subwindows-normal)
(resize-subwindows, resize-other-windows, resize-this-window)
(resize-root-window, resize-root-window-vertically)
(window-deletable-p, window-or-subwindow-p)
(frame-root-window-p): New functions.
Martin Rudalics [Thu, 9 Jun 2011 06:35:02 +0000 (08:35 +0200)]
Final preparations for new window resize code.
* window.c (replace_window): Rename second argument REPLACEMENT to
NEW. New third argument SETFLAG. Rewrite.
(delete_window, make_dummy_parent): Call replace_window with
third argument 1.
(window_list_1): Move down in code.
(run_window_configuration_change_hook): Move set_buffer part
before select_frame_norecord part in order to unwind correctly.
Rename count1 to count.
(recombine_windows, delete_deletable_window, resize_root_window)
(Fdelete_other_windows_internal)
(Frun_window_configuration_change_hook, make_parent_window)
(resize_window_check, resize_window_apply, Fresize_window_apply)
(resize_frame_windows, Fsplit_window_internal)
(Fdelete_window_internal, Fresize_mini_window_internal): New
functions.
(syms_of_window): New variables Vwindow_splits and Vwindow_nest.
Glenn Morris [Thu, 9 Jun 2011 06:07:11 +0000 (23:07 -0700)]
ange-ftp fixes for dired switches not being just a single short option.
* lisp/net/ange-ftp.el (ange-ftp-switches-ok): New function.
(ange-ftp-get-files): Use it.
Alexander Klimov [Thu, 9 Jun 2011 05:33:26 +0000 (22:33 -0700)]
Small fixes for dired-listing-switches usage.
Ref: http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg01000.html
* lisp/mail/sendmail.el (mail-recover-1, mail-recover):
* lisp/files.el (recover-file, recover-session):
Handle dired-listing-switches not being just a single short option.
Glenn Morris [Thu, 9 Jun 2011 05:08:11 +0000 (22:08 -0700)]
Allow some appt.el display functions to handle lists.
* lisp/calendar/appt.el (appt-display-message, appt-disp-window):
Handle lists of appointments.
Paul Eggert [Thu, 9 Jun 2011 01:12:45 +0000 (18:12 -0700)]
* xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
not to EMACS_INT, to avoid GCC warning.
Paul Eggert [Thu, 9 Jun 2011 01:11:15 +0000 (18:11 -0700)]
* xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
Paul Eggert [Thu, 9 Jun 2011 01:10:27 +0000 (18:10 -0700)]
* buffer.h (PTR_BYTE_POS): Don't assume a byte count fits in 'unsigned'.
Paul Eggert [Thu, 9 Jun 2011 00:47:45 +0000 (17:47 -0700)]
* buffer.c (advance_to_char_boundary): Return EMACS_INT, not int.
Paul Eggert [Thu, 9 Jun 2011 00:40:43 +0000 (17:40 -0700)]
* buffer.c (Fgenerate_new_buffer_name): Use EMACS_INT for count, not int.
Paul Eggert [Thu, 9 Jun 2011 00:19:18 +0000 (17:19 -0700)]
* data.c (Qcompiled_function): Now static.
Paul Eggert [Wed, 8 Jun 2011 21:45:17 +0000 (14:45 -0700)]
* window.c (window_body_lines): Now static.
Paul Eggert [Wed, 8 Jun 2011 21:44:48 +0000 (14:44 -0700)]
* image.c (gif_load): Rename local to avoid shadowing.
Paul Eggert [Wed, 8 Jun 2011 21:43:46 +0000 (14:43 -0700)]
* print.c (print_object): Fix typo in ptrdiff_t printing.