1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-23 16:30:46 -08:00
Commit graph

101033 commits

Author SHA1 Message Date
Paul Eggert
ff672d2c87 Merge from trunk. 2011-06-15 11:07:38 -07:00
Lars Magne Ingebrigtsen
b96e6cde3e Renamed process-alive-p' to process-live-p' for consistency with other `-live-p' functions. 2011-06-15 19:30:41 +02:00
Stefan Monnier
efdcdbf823 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.
2011-06-15 13:20:36 -04:00
Dan Nicolaescu
50328a1b27 * lisp/progmodes/cfengine.el (cfengine-mode): Derive from prog-mode. 2011-06-15 07:47:57 -07:00
Dan Nicolaescu
679e968891 Remove some macros that are either not used anymore or don't really
need documenting here.
2011-06-15 07:11:04 -07:00
Dan Nicolaescu
c5cde04220 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.
2011-06-15 07:07:48 -07:00
Glenn Morris
571e1872c0 Auto-commit of generated files. 2011-06-15 06:18:57 -04:00
Martin Rudalics
baa1c9abaa 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).
2011-06-15 09:09:47 +02:00
Paul Eggert
e69dafade3 * 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.
2011-06-14 18:07:35 -07:00
Paul Eggert
566684ead5 * fns.c (Fload_average): Don't assume 100 * load average fits in int. 2011-06-14 16:18:53 -07:00
Paul Eggert
de41a81069 * fns.c (Fcopy_sequence): Don't assume vector length fits in int. 2011-06-14 15:41:38 -07:00
Paul Eggert
6346d30171 * fns.c (Fnthcdr, Fsort): Don't assume list length fits in int. 2011-06-14 15:39:35 -07:00
Paul Eggert
e6966cd635 * 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.
2011-06-14 15:32:12 -07:00
Paul Eggert
00c604f263 * 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.
2011-06-14 15:01:32 -07:00
Paul Eggert
dd0b0efbab * 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.
2011-06-14 14:30:16 -07:00
Jan Djärv
c195f2de12 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.
2011-06-14 23:08:20 +02:00
Paul Eggert
86fe5cfe4d * 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?
2011-06-14 13:57:33 -07:00
Paul Eggert
80e88859ec * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length. 2011-06-14 13:12:13 -07:00
Paul Eggert
4a2f0ad6c1 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now. 2011-06-14 13:09:52 -07:00
Paul Eggert
e8f2a94471 Merge from trunk. 2011-06-14 11:58:22 -07:00
Paul Eggert
f66c7cf8f7 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.
2011-06-14 11:57:19 -07:00
Paul Eggert
a1759b7624 * callint.c (Fcall_interactively): Don't use index var as event count. 2011-06-13 22:51:17 -07:00
Chong Yidong
c5dd5a516c 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.
2011-06-14 01:06:26 -04:00
Chong Yidong
b9958282dc * etc/themes/dichromacy-theme.el: New theme. 2011-06-14 01:00:35 -04:00
Paul Eggert
d96be9fc87 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
* mem-limits.h (SIZE): Remove; no longer used.
2011-06-13 21:49:24 -07:00
Paul Eggert
3c3a05dfb7 Merge from trunk. 2011-06-13 17:58:31 -07:00
Glenn Morris
d647b7c44e 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.
2011-06-13 17:42:40 -04:00
Paul Eggert
a690a978ec * xterm.c (x_alloc_nearest_color_1): Go back to original algorithm. 2011-06-13 09:08:46 -07:00
Martin Rudalics
357f93d245 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.
2011-06-13 15:14:42 +02:00
Martin Rudalics
9481c00201 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.
2011-06-13 10:21:09 +02:00
Paul Eggert
01103c441a Merge from trunk. 2011-06-13 01:00:15 -07:00
Paul Eggert
5efd304be9 * xterm.c (x_alloc_nearest_color_1): Use a more-precise algorithm
for nearest color, one that neither overflows nor relies on unsigned
arithmetic.
2011-06-13 00:53:14 -07:00
Paul Eggert
578c21e6cb 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.
2011-06-12 23:53:31 -07:00
Paul Eggert
96f53c6c3d * 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.
2011-06-12 23:49:00 -07:00
Paul Eggert
83c77d31ac * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts. 2011-06-12 23:34:04 -07:00
Paul Eggert
ee2079f16e * unexelf.c (unexec): Don't assume BSS addr fits in unsigned. 2011-06-12 22:55:57 -07:00
Paul Eggert
6da655361c * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned. 2011-06-12 22:49:35 -07:00
Paul Eggert
7147c4a44b * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX. 2011-06-12 22:43:30 -07:00
Paul Eggert
193e32d9a8 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test. 2011-06-12 22:24:58 -07:00
Paul Eggert
e5533da60e * lread.c (Fload): Don't compare a possibly-garbage time_t value. 2011-06-12 22:18:27 -07:00
Paul Eggert
9910e595e7 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.
2011-06-12 22:15:27 -07:00
Paul Eggert
2638320e07 * character.h (CHAR_VALID_P): Remove unused parameter.
* fontset.c, lisp.h, xdisp.c: All uses changed.
2011-06-12 21:55:03 -07:00
Paul Eggert
045eb8d982 * editfns.c (Ftranslate_region_internal): Omit redundant test. 2011-06-12 21:27:45 -07:00
Paul Eggert
c1f134b59b * 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.
2011-06-12 19:41:13 -07:00
Paul Eggert
395fcb936e * floatfns.c (Fexpt): Omit unnecessary cast to unsigned. 2011-06-12 19:27:16 -07:00
Paul Eggert
327eeec881 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned. 2011-06-12 19:23:58 -07:00
Paul Eggert
abbd3d23f4 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
for characters.
2011-06-12 19:21:14 -07:00
Paul Eggert
684a03ef99 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives. 2011-06-12 19:09:34 -07:00
Paul Eggert
0fed43f396 * 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.
2011-06-12 19:02:16 -07:00
Paul Eggert
8fd02eb7d3 * 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.
2011-06-12 18:38:25 -07:00