bpt/emacs.git
12 years ago* buffer.c (struct sortstr.size, record_overlay_string): Don't truncate size to int.
Paul Eggert [Fri, 17 Jun 2011 07:57:42 +0000 (00:57 -0700)]
* buffer.c (struct sortstr.size, record_overlay_string): Don't truncate size to int.

12 years ago* buffer.c (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
Paul Eggert [Fri, 17 Jun 2011 07:52:35 +0000 (00:52 -0700)]
* buffer.c (compare_overlays, cmp_for_strings): Avoid subtraction overflow.

12 years ago* buffer.c (struct sortstr.priority): Now EMACS_INT, not int.
Paul Eggert [Fri, 17 Jun 2011 07:49:50 +0000 (00:49 -0700)]
* buffer.c (struct sortstr.priority): Now EMACS_INT, not int.

12 years ago* buffer.c (struct sortvec.priority): Now EMACS_INT, not int.
Paul Eggert [Fri, 17 Jun 2011 07:47:18 +0000 (00:47 -0700)]
* buffer.c (struct sortvec.priority): Now EMACS_INT, not int.

12 years agoFix two typos in same-window-p.
Martin Rudalics [Fri, 17 Jun 2011 06:04:44 +0000 (08:04 +0200)]
Fix two typos in same-window-p.

* window.el (same-window-p): Fix two typos introduced when
adding with-no-warnings.

12 years ago* m4/lstat.m4: Merge from gnulib (Bug#8878).
Paul Eggert [Thu, 16 Jun 2011 23:10:17 +0000 (16:10 -0700)]
* m4/lstat.m4: Merge from gnulib (Bug#8878).

12 years ago* lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
Paul Eggert [Thu, 16 Jun 2011 22:50:46 +0000 (15:50 -0700)]
* lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.

Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
hosts with pre-C99 libraries, because pD is wrongly defined to "t".

12 years agoImprove buffer-overflow checking (Bug#8873).
Paul Eggert [Thu, 16 Jun 2011 21:25:42 +0000 (14:25 -0700)]
Improve buffer-overflow checking (Bug#8873).

12 years agoMerge from trunk.
Paul Eggert [Thu, 16 Jun 2011 21:19:55 +0000 (14:19 -0700)]
Merge from trunk.

12 years agoImprove buffer-overflow checking.
Paul Eggert [Thu, 16 Jun 2011 21:18:12 +0000 (14:18 -0700)]
Improve buffer-overflow checking.

* fileio.c (Finsert_file_contents):
* insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
Remove the old (too-loose) buffer overflow checks.
They weren't needed, since make_gap checks for buffer overflow.
* insdel.c (make_gap_larger): Catch buffer overflows that were missed.
The old code merely checked for Emacs fixnum overflow, and relied
on undefined (wraparound) behavior.  The new code avoids undefined
behavior, and also checks for ptrdiff_t and/or size_t overflow.

12 years agoconfigure.in: Try to determine CRT_DIR automatically when using gcc
Miles Bader [Thu, 16 Jun 2011 17:50:21 +0000 (02:50 +0900)]
configure.in: Try to determine CRT_DIR automatically when using gcc

12 years ago* editfns.c: Tune. Don't use wider integers than needed. Don't use alloca.
Paul Eggert [Thu, 16 Jun 2011 17:44:43 +0000 (10:44 -0700)]
* editfns.c: Tune.  Don't use wider integers than needed.  Don't use alloca.

Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.

12 years ago* editfns.c (Finsert_char): Don't dump core with very negative counts.
Paul Eggert [Thu, 16 Jun 2011 17:25:16 +0000 (10:25 -0700)]
* editfns.c (Finsert_char): Don't dump core with very negative counts.

12 years agoHave enlarge-/shrink-window not report errors in most cases (bug#8862).
Martin Rudalics [Thu, 16 Jun 2011 14:01:46 +0000 (16:01 +0200)]
Have enlarge-/shrink-window not report errors in most cases (bug#8862).

* window.el (enlarge-window, shrink-window): Don't report an error
when the window can't be resized as requested (Bug#8862).

12 years agoAuto-commit of generated files.
Glenn Morris [Thu, 16 Jun 2011 10:18:50 +0000 (06:18 -0400)]
Auto-commit of generated files.

12 years agoNever ever pop up a new frame in noninteractive mode (bug#8857).
Martin Rudalics [Thu, 16 Jun 2011 09:21:56 +0000 (11:21 +0200)]
Never ever pop up a new frame in noninteractive mode (bug#8857).

(display-buffer): Don't check noninteractive when calling
display-buffer-pop-up-frame.
(display-buffer-pop-up-frame): Never pop up a frame in
noninteractive mode (Bug#8857).

12 years agoFix doc-strings of switch-to-buffer family functions (bug#8875).
Martin Rudalics [Thu, 16 Jun 2011 08:55:08 +0000 (10:55 +0200)]
Fix doc-strings of switch-to-buffer family functions (bug#8875).

(switch-to-buffer-same-frame, switch-to-buffer-other-window)
(switch-to-buffer-other-window-same-frame)
(switch-to-buffer-other-frame): Fix doc-strings.  Reported by Drew
Adams (Bug#8875).

12 years agoImprove cohabitation of pop-up-frames and second argument of display-buffer (bug...
Martin Rudalics [Thu, 16 Jun 2011 07:31:51 +0000 (09:31 +0200)]
Improve cohabitation of pop-up-frames and second argument of display-buffer (bug#8865).

* window.el (display-buffer-normalize-specifiers-1): Respect
current value of pop-up-frames for most reasonable values of
second argument of display-buffer (Bug#8865).

12 years ago* insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
Paul Eggert [Thu, 16 Jun 2011 06:57:02 +0000 (23:57 -0700)]
* insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.

12 years ago* insdel.c, lisp.h (buffer_overflow): New function.
Paul Eggert [Thu, 16 Jun 2011 06:48:01 +0000 (23:48 -0700)]
* insdel.c, lisp.h (buffer_overflow): New function.

(insert_from_buffer_1, replace_range, replace_range_2):
* insdel.c (make_gap_larger):
* editfns.c (Finsert_char):
* fileio.c (Finsert_file_contents): Use it, to normalize wording.

12 years ago* buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
Paul Eggert [Thu, 16 Jun 2011 06:19:26 +0000 (23:19 -0700)]
* buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.

12 years agoMerge changes made in Gnus trunk.
Teodor Zlatanov [Thu, 16 Jun 2011 06:18:18 +0000 (06:18 +0000)]
Merge changes made in Gnus trunk.

auth-source.el (auth-source-save-secrets): New variable to control if secret tokens should be saved encrypted.
 (auth-source-netrc-parse, auth-source-netrc-search): Pass the file name to `auth-source-netrc-normalize'.
 (with-auth-source-epa-overrides): Add convenience macro.  Don't depend on the EPA variables being defined.
 (auth-source-epa-make-gpg-token): Convert text to a "gpg:" token.
 (auth-source-netrc-normalize): Convert "gpg:" tokens back to text in the lexical-let closure.
 (auth-source-netrc-create): Create "gpg:" tokens according to `auth-source-save-secrets'.

12 years agoMerge from gnulib: lib/gnulib.mk, m4/*.m4.
Paul Eggert [Wed, 15 Jun 2011 22:27:54 +0000 (15:27 -0700)]
Merge from gnulib: lib/gnulib.mk, m4/*.m4.

12 years ago(open-network-stream): Add the keyword :always-query-capabilities.
Lars Magne Ingebrigtsen [Wed, 15 Jun 2011 20:44:45 +0000 (22:44 +0200)]
(open-network-stream): Add the keyword :always-query-capabilities.

This is for the case where you want to force a `plain' network
connection, but the protocol still requires the capabilitiy command
(i.e., SMTP and EHLO).

12 years agoInteger overflow and signedness fixes (Bug#8873).
Paul Eggert [Wed, 15 Jun 2011 19:57:25 +0000 (12:57 -0700)]
Integer overflow and signedness fixes (Bug#8873).

12 years ago* ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
Paul Eggert [Wed, 15 Jun 2011 19:40:52 +0000 (12:40 -0700)]
* ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.

(GET_CCL_RANGE, IN_INT_RANGE): Use it.

12 years ago* fileio.c (emacs_lseek): Work around GCC bug 43772.
Paul Eggert [Wed, 15 Jun 2011 19:29:18 +0000 (12:29 -0700)]
* fileio.c (emacs_lseek): Work around GCC bug 43772.

12 years ago* character.h, charset.h: Use verify_expr, not verify_true.
Paul Eggert [Wed, 15 Jun 2011 18:57:45 +0000 (11:57 -0700)]
* character.h, charset.h: Use verify_expr, not verify_true.

12 years agoMerge from trunk.
Paul Eggert [Wed, 15 Jun 2011 18:52:30 +0000 (11:52 -0700)]
Merge from trunk.

12 years ago* lib/ftoastr.c, lib/stdio.in.h, lib/verify.h: Merge from gnulib.
Paul Eggert [Wed, 15 Jun 2011 18:50:18 +0000 (11:50 -0700)]
* lib/ftoastr.c, lib/stdio.in.h, lib/verify.h: Merge from gnulib.

12 years ago* doc/lispref/text.texi (Special Properties): Clarify role of font-lock-face.
Chong Yidong [Wed, 15 Jun 2011 18:45:28 +0000 (14:45 -0400)]
* doc/lispref/text.texi (Special Properties): Clarify role of font-lock-face.

12 years ago* lisp/pcmpl-rpm.el (pcomplete/rpm): Minor simplification.
Stefan Monnier [Wed, 15 Jun 2011 18:40:00 +0000 (14:40 -0400)]
* lisp/pcmpl-rpm.el (pcomplete/rpm): Minor simplification.

12 years ago* lisp/emacs-lisp/debug.el (debug): Don't leave the buffer in Debugger.
Stefan Monnier [Wed, 15 Jun 2011 18:39:04 +0000 (14:39 -0400)]
* lisp/emacs-lisp/debug.el (debug): Don't leave the buffer in Debugger.

12 years ago* src/eval.c (Fdefvaralias): Also mark the target as variable-special-p.
Stefan Monnier [Wed, 15 Jun 2011 18:36:00 +0000 (14:36 -0400)]
* src/eval.c (Fdefvaralias): Also mark the target as variable-special-p.

12 years ago* lisp/abbrev.el (define-abbrev-table): Don't add a table multiple times.
Stefan Monnier [Wed, 15 Jun 2011 18:33:33 +0000 (14:33 -0400)]
* lisp/abbrev.el (define-abbrev-table): Don't add a table multiple times.

12 years agoprogmodes/cc-fonts.el (c-font-lock-declarations): 1: Whilst checking for
Alan Mackenzie [Wed, 15 Jun 2011 18:24:25 +0000 (18:24 +0000)]
progmodes/cc-fonts.el (c-font-lock-declarations): 1: Whilst checking for
declarators, disable knr checking to speed up for normal files.  2:
Refactor, replacing a sequence of nested if forms by a cond form.

12 years agoMerge from trunk.
Paul Eggert [Wed, 15 Jun 2011 18:07:38 +0000 (11:07 -0700)]
Merge from trunk.

12 years agoRenamed `process-alive-p' to `process-live-p' for consistency with other `-live-p...
Lars Magne Ingebrigtsen [Wed, 15 Jun 2011 17:30:41 +0000 (19:30 +0200)]
Renamed `process-alive-p' to `process-live-p' for consistency with other `-live-p' functions.

12 years agoDon't encourage the use of display-buffer-alist from Elisp code.
Stefan Monnier [Wed, 15 Jun 2011 17:20:36 +0000 (13:20 -0400)]
Don't encourage the use of display-buffer-alist from Elisp code.
* lisp/window.el (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, pop-up-frames, display-buffer-reuse-frames)
(pop-up-windows, split-window-preferred-function)
(split-height-threshold, split-width-threshold, even-window-heights)
(display-buffer-mark-dedicated): Fix obsolescence info.

12 years ago* lisp/progmodes/cfengine.el (cfengine-mode): Derive from prog-mode.
Dan Nicolaescu [Wed, 15 Jun 2011 14:47:57 +0000 (07:47 -0700)]
* lisp/progmodes/cfengine.el (cfengine-mode): Derive from prog-mode.

12 years agoRemove some macros that are either not used anymore or don't really
Dan Nicolaescu [Wed, 15 Jun 2011 14:11:04 +0000 (07:11 -0700)]
Remove some macros that are either not used anymore or don't really
need documenting here.

12 years agoDerive some programming modes from prog-mode.
Dan Nicolaescu [Wed, 15 Jun 2011 14:07:48 +0000 (07:07 -0700)]
Derive some programming modes from prog-mode.

* lisp/progmodes/python.el (python-mode): Derive from prog-mode.
* lisp/progmodes/ps-mode.el (ps-mode):
* lisp/progmodes/mixal-mode.el (mixal-mode):
* lisp/progmodes/ld-script.el (ld-script-mode): Likewise.

12 years agoAuto-commit of generated files.
Glenn Morris [Wed, 15 Jun 2011 10:18:57 +0000 (06:18 -0400)]
Auto-commit of generated files.

12 years agoDon't let display-buffer pop up new frames by default (bug#8857).
Martin Rudalics [Wed, 15 Jun 2011 07:09:47 +0000 (09:09 +0200)]
Don't let display-buffer pop up new frames by default (bug#8857).

* window.el (display-buffer-alist): Trim default value to avoid
popping up a new frame (Bug#8857) or reusing an arbitrary window
on another frame.
(display-buffer): Do not fall back on popping up a new frame in
batch mode (Bug#8857).

12 years ago* fileio.c: Don't assume EMACS_INT fits in off_t.
Paul Eggert [Wed, 15 Jun 2011 01:07:35 +0000 (18:07 -0700)]
* fileio.c: Don't assume EMACS_INT fits in off_t.

(emacs_lseek): New static function.
(Finsert_file_contents, Fwrite_region): Use it.
Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.

12 years ago* fns.c (Fload_average): Don't assume 100 * load average fits in int.
Paul Eggert [Tue, 14 Jun 2011 23:18:53 +0000 (16:18 -0700)]
* fns.c (Fload_average): Don't assume 100 * load average fits in int.

12 years ago* fns.c (Fcopy_sequence): Don't assume vector length fits in int.
Paul Eggert [Tue, 14 Jun 2011 22:41:38 +0000 (15:41 -0700)]
* fns.c (Fcopy_sequence): Don't assume vector length fits in int.

12 years ago* fns.c (Fnthcdr, Fsort): Don't assume list length fits in int.
Paul Eggert [Tue, 14 Jun 2011 22:39:35 +0000 (15:39 -0700)]
* fns.c (Fnthcdr, Fsort): Don't assume list length fits in int.

12 years ago* fns.c: Don't overflow int when computing a list length.
Paul Eggert [Tue, 14 Jun 2011 22:32:12 +0000 (15:32 -0700)]
* fns.c: Don't overflow int when computing a list length.

(Fsafe_length): Return a float if the value is not representable
as a fixnum.  This shouldn't happen except in contrived situations.
Use same QUIT_COUNT_HEURISTIC as Flength now does.

12 years ago* fns.c (Flength): Don't overflow int when computing a list length.
Paul Eggert [Tue, 14 Jun 2011 22:01:32 +0000 (15:01 -0700)]
* fns.c (Flength): Don't overflow int when computing a list length.

Use EMACS_INT, not int, to avoid unwanted truncation on 64-bit hosts.
Check for QUIT every 1024 entries rather than every other entry;
that's faster and is responsive enough.  Report an error instead of
overflowing an integer.

12 years ago* alloc.c: Check that resized vectors' lengths fit in fixnums.
Paul Eggert [Tue, 14 Jun 2011 21:30:16 +0000 (14:30 -0700)]
* alloc.c: Check that resized vectors' lengths fit in fixnums.

(header_size, word_size): New constants.
(allocate_vectorlike): Don't check size overflow here.
(allocate_vector): Check it here instead, since this is the only
caller of allocate_vectorlike that could cause overflow.
Check that the new vector's length is representable as a fixnum.

12 years agoFix resize and change of scroll bar width for Gtk3.
Jan Djärv [Tue, 14 Jun 2011 21:08:20 +0000 (23:08 +0200)]
Fix resize and change of scroll bar width for Gtk3.

* configure.in: Add emacsgtkfixed.o to GTK_OBJ if HAVE_GTK3.

* src/emacsgtkfixed.c, src/emacsgtkfixed.h: New files.

* src/gtkutil.c: Include src/emacsgtkfixed.h if HAVE_GTK3.
(int_gtk_range_get_value): Move to the scroll bar part of the file.
(style_changed_cb): Call update_theme_scrollbar_width and call
x_set_scroll_bar_default_width and xg_frame_set_char_size for
all frames.
(xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
Call gtk_window_set_resizable if HAVE_GTK3.
(x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
and height if HAVE_GTK3 (Bug#8505).
(scroll_bar_width_for_theme): New variable.
(update_theme_scrollbar_width): New function.
(xg_get_default_scrollbar_width): Move code to
update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
(xg_initialize): Call update_theme_scrollbar_width.

* src/gtkutil.h (xg_get_default_scrollbar_width): Remove argument.

* src/xfns.c (x_set_scroll_bar_default_width): Remove argument to
xg_get_default_scrollbar_width.

12 years ago* fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
Paul Eggert [Tue, 14 Jun 2011 20:57:33 +0000 (13:57 -0700)]
* fns.c (next_almost_prime): Don't return a multiple of 3 or 5.

The previous code was bogus.  For example, next_almost_prime (32)
returned 39, which is undesirable as it is a multiple of 3; and
next_almost_prime (24) returned 25, which is a multiple of 5 so
why was the code bothering to check for multiples of 7?

12 years ago* bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
Paul Eggert [Tue, 14 Jun 2011 20:12:13 +0000 (13:12 -0700)]
* bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.

12 years ago* eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
Paul Eggert [Tue, 14 Jun 2011 20:09:52 +0000 (13:09 -0700)]
* eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.

12 years agoMerge from trunk.
Paul Eggert [Tue, 14 Jun 2011 18:58:22 +0000 (11:58 -0700)]
Merge from trunk.

12 years agoVariadic C functions now count arguments with ptrdiff_t.
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.

12 years ago* callint.c (Fcall_interactively): Don't use index var as event count.
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.

12 years agoPrint theme summaries in *Custom Themes* buffer.
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.

12 years ago* etc/themes/dichromacy-theme.el: New theme.
Chong Yidong [Tue, 14 Jun 2011 05:00:35 +0000 (01:00 -0400)]
* etc/themes/dichromacy-theme.el: New theme.

12 years ago* vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
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.

12 years agoMerge from trunk.
Paul Eggert [Tue, 14 Jun 2011 00:58:31 +0000 (17:58 -0700)]
Merge from trunk.

12 years agocus-dep fix for build failure first occurring with 2011-06-13T08:21:09Z!rudalics...
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.

12 years ago* xterm.c (x_alloc_nearest_color_1): Go back to original algorithm.
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.

13 years agoMake help and view-mode work with new buffer display facilities.
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.

13 years agoInstall new buffer display functions and variables.
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.

13 years agoMerge from trunk.
Paul Eggert [Mon, 13 Jun 2011 08:00:15 +0000 (01:00 -0700)]
Merge from trunk.

13 years ago* xterm.c (x_alloc_nearest_color_1): Use a more-precise algorithm
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.

13 years agoRemove unnecessary casts.
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.

13 years ago* sound.c (Fplay_sound_internal): Remove cast to unsigned long.
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.

13 years ago* dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
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.

13 years ago* unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
Paul Eggert [Mon, 13 Jun 2011 05:55:57 +0000 (22:55 -0700)]
* unexelf.c (unexec): Don't assume BSS addr fits in unsigned.

13 years ago* xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
Paul Eggert [Mon, 13 Jun 2011 05:49:35 +0000 (22:49 -0700)]
* xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.

13 years ago* keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
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.

13 years ago* lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
Paul Eggert [Mon, 13 Jun 2011 05:24:58 +0000 (22:24 -0700)]
* lisp.h (CHAR_TABLE_SET): Omit now-redundant test.

13 years ago* lread.c (Fload): Don't compare a possibly-garbage time_t value.
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.

13 years agoGLYPH_CODE_FACE returns EMACS_INT, not int.
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.

13 years ago* character.h (CHAR_VALID_P): Remove unused parameter.
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.

13 years ago* editfns.c (Ftranslate_region_internal): Omit redundant test.
Paul Eggert [Mon, 13 Jun 2011 04:27:45 +0000 (21:27 -0700)]
* editfns.c (Ftranslate_region_internal): Omit redundant test.

13 years ago* fns.c (concat): Minor tuning based on overflow analysis.
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.

13 years ago* floatfns.c (Fexpt): Omit unnecessary cast to unsigned.
Paul Eggert [Mon, 13 Jun 2011 02:27:16 +0000 (19:27 -0700)]
* floatfns.c (Fexpt): Omit unnecessary cast to unsigned.

13 years ago* fileio.c (make_temp_name): 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.

13 years ago* editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
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.

13 years ago* doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
Paul Eggert [Mon, 13 Jun 2011 02:09:34 +0000 (19:09 -0700)]
* doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.

13 years ago* data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
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.

13 years ago* chartab.c (Fchar_table_range): Use CHARACTERP to check range.
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.

13 years ago* composite.c: Use int, not EMACS_INT, for characters.
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.

13 years agoMake sure a 64-bit char is never passed to ENCODE_CHAR.
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.

13 years ago* character.c (char_string): Remove unnecessary casts.
Paul Eggert [Mon, 13 Jun 2011 00:36:44 +0000 (17:36 -0700)]
* character.c (char_string): Remove unnecessary casts.

13 years agoMake sure a 64-bit char is never passed to CHAR_STRING.
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.

13 years agoRemove incorrect casts to 'unsigned' that lose info 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.

13 years ago* lisp.h (UNSIGNED_CMP): New macro.
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.

13 years ago* term/xterm.el (terminal-init-xterm): Still more simplifications.
Glenn Morris [Sun, 12 Jun 2011 20:18:04 +0000 (13:18 -0700)]
* term/xterm.el (terminal-init-xterm): Still more simplifications.

13 years ago* term/xterm.el (terminal-init-xterm): More simplifications.
Glenn Morris [Sun, 12 Jun 2011 20:15:02 +0000 (13:15 -0700)]
* term/xterm.el (terminal-init-xterm): More simplifications.

13 years ago* term/xterm.el (terminal-init-xterm): Misc simplifications.
Glenn Morris [Sun, 12 Jun 2011 19:58:32 +0000 (12:58 -0700)]
* term/xterm.el (terminal-init-xterm): Misc simplifications.

13 years ago* term/xterm.el (terminal-init-xterm): `version' may be nil. (Bug#8838)
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)

13 years ago* tramp.texi (Customizing Completion): Mention authinfo-style files.
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.

13 years ago* leim/SKK-DIC/SKK-JISYO.L: Add proper coding tag.
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.

13 years agoFix make_frame, introduce Vtemp_buffer_show_specifiers, cleanup doc-strings.
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.

13 years ago* leim/Makefile.in (TIT_BIG5): Renamed from TIT-BIG5.
Andreas Schwab [Sun, 12 Jun 2011 09:01:24 +0000 (11:01 +0200)]
* leim/Makefile.in (TIT_BIG5): Renamed from TIT-BIG5.