]> git.eshelyaron.com Git - emacs.git/log
emacs.git
13 years agoAdjust further in response to jan.h.d's comments.
Paul Eggert [Sat, 6 Aug 2011 01:10:24 +0000 (18:10 -0700)]
Adjust further in response to jan.h.d's comments.

13 years agoMerge from trunk.
Paul Eggert [Fri, 5 Aug 2011 23:35:10 +0000 (16:35 -0700)]
Merge from trunk.

13 years ago* lisp/progmodes/js.el (js--regexp-literal): Accept regexps at the beginning
Stefan Monnier [Fri, 5 Aug 2011 19:53:46 +0000 (15:53 -0400)]
* lisp/progmodes/js.el (js--regexp-literal): Accept regexps at the beginning
of statements and in a few more cases.

Fixes: debbugs:9183
13 years ago* lisp/emacs-lisp/cl-macs.el (cl--make-usage-var, cl--make-usage-args):
Stefan Monnier [Fri, 5 Aug 2011 16:31:21 +0000 (12:31 -0400)]
* lisp/emacs-lisp/cl-macs.el (cl--make-usage-var, cl--make-usage-args):
New functions.
(cl-transform-lambda): Use them.

Fixes: debbugs:9239
13 years agoBug #9224 was fixed together with bug #9221.
Eli Zaretskii [Fri, 5 Aug 2011 14:31:40 +0000 (17:31 +0300)]
Bug #9224 was fixed together with bug #9221.

13 years agoMake bidi_cache_total_alloc static.
Eli Zaretskii [Fri, 5 Aug 2011 14:08:16 +0000 (17:08 +0300)]
Make bidi_cache_total_alloc static.

 src/bidi.c <bidi_cache_total_alloc>: Now static.
 (bidi_initialize): Initialize bidi_cache_total_alloc.

13 years agoFix bug #9221 with memory leak in bidi display.
Eli Zaretskii [Fri, 5 Aug 2011 11:04:44 +0000 (14:04 +0300)]
Fix bug #9221 with memory leak in bidi display.
Add code to monitor memory allocation for bidi cache shelving.

 src/xdisp.c (display_line): Release buffer allocated for shelved bidi
 cache.
 src/bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
 amount allocated this far in `bidi_cache_total_alloc'.
 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
 non-zero, only free the data buffer without restoring the cache
 contents.  All callers changed.
 src/dispextern.h (bidi_unshelve_cache): Update prototype.
 src/xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
 (move_it_in_display_line, move_it_to)
 (move_it_vertically_backward, move_it_by_lines): Replace the call
 to xfree to an equivalent call to bidi_unshelve_cache.
 (move_it_in_display_line_to): Fix logic of returning
 MOVE_POS_MATCH_OR_ZV in the bidi case.

13 years agoFix bug #9221 with resource allocation under word-wrap.
Eli Zaretskii [Fri, 5 Aug 2011 10:48:37 +0000 (13:48 +0300)]
Fix bug #9221 with resource allocation under word-wrap.
Add diagnostic facility for monitoring memory allocated for cache shelving.

 src/xdisp.c (display_line): Release buffer allocated for shelved bidi
 cache.  (Bug#9221)
 src/bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
 amount allocated this far in `bidi_cache_total_alloc'.
 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
 non-zero, only free the data buffer without restoring the cache
 contents.  All callers changed.
 src/dispextern.h (bidi_unshelve_cache): Update prototype.
 src/xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
 (move_it_in_display_line, move_it_to)
 (move_it_vertically_backward, move_it_by_lines): Replace the call
 to xfree to an equivalent call to bidi_unshelve_cache.
 (move_it_in_display_line_to): Fix logic of returning
 MOVE_POS_MATCH_OR_ZV in the bidi case.

13 years agoFix bug #9229 with cursor positioning on display strings.
Eli Zaretskii [Fri, 5 Aug 2011 10:32:06 +0000 (13:32 +0300)]
Fix bug #9229 with cursor positioning on display strings.

 src/xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
 came from a string character with a `cursor' property.

13 years agoAuto-commit of generated files.
Glenn Morris [Fri, 5 Aug 2011 10:18:28 +0000 (06:18 -0400)]
Auto-commit of generated files.

13 years agoTurn some defsubsts into defuns and revert part of last switch-to-buffer fix.
Martin Rudalics [Fri, 5 Aug 2011 06:23:23 +0000 (08:23 +0200)]
Turn some defsubsts into defuns and revert part of last switch-to-buffer fix.

* window.el (display-buffer-same-window)
(display-buffer-same-frame, display-buffer-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): Make them defuns.
(switch-to-buffer): Don't set LABEL argument of pop-to-buffer.

13 years agoMerge from trunk.
Paul Eggert [Fri, 5 Aug 2011 02:19:34 +0000 (19:19 -0700)]
Merge from trunk.

13 years agoAdjust in response to jan.h.d's comments.
Paul Eggert [Fri, 5 Aug 2011 02:15:35 +0000 (19:15 -0700)]
Adjust in response to jan.h.d's comments.

See, for example <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#26>.

13 years agognus.el (registry-ignore): Add nnir groups to the ignore-list.
Andrew Cohen [Thu, 4 Aug 2011 22:14:04 +0000 (22:14 +0000)]
gnus.el (registry-ignore): Add nnir groups to the ignore-list.

13 years agoCheck for pthread and use it if found.
Jan Djärv [Thu, 4 Aug 2011 17:04:39 +0000 (19:04 +0200)]
Check for pthread and use it if found.

* configure.in (HAVE_PTHREAD): Add check for -lpthread.
(HAVE_GTK_AND_PTHREAD): Remove.

* src/Makefile.in (LIB_PTHREAD): New variable.
(LIBES): Add LIB_PTHREAD (Bug#9216).

* src/alloc.c, src/emacs.c, src/gmalloc.c, src/gtkutil.c, src/keyboard.c, src/syssignal.h:
Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).

13 years ago* regex.c (re_iswctype): Remove some redundant boolean conversions.
Andreas Schwab [Thu, 4 Aug 2011 14:25:21 +0000 (16:25 +0200)]
* regex.c (re_iswctype): Remove some redundant boolean conversions.

13 years agoSet _NET_WM_WINDOW_OPACITY on outer window manager window also.
Jan Djärv [Thu, 4 Aug 2011 11:06:22 +0000 (13:06 +0200)]
Set _NET_WM_WINDOW_OPACITY on outer window manager window also.

* xterm.c (x_find_topmost_parent): New function.
(x_set_frame_alpha): Find topmost parent window with
x_find_topmost_parent and set the property there also.
(handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.

Fixes: debbugs:9181
13 years agoMake sure GPG keys are usable when composing non-MIME messages (bug#8955).
Daiki Ueno [Thu, 4 Aug 2011 06:55:53 +0000 (15:55 +0900)]
Make sure GPG keys are usable when composing non-MIME messages (bug#8955).

* mml1991.el (mml1991-epg-find-usable-key)
(mml1991-epg-find-usable-secret-key): New function.
(mml1991-epg-sign): Check if signing key is usable.
(mml1991-epg-encrypt): Check if encrypting key is usable (bug#8955).

13 years ago* callproc.c (Fcall_process): Avoid vfork clobbering
Paul Eggert [Thu, 4 Aug 2011 03:08:01 +0000 (20:08 -0700)]
* callproc.c (Fcall_process): Avoid vfork clobbering

the local vars buffer, coding_systems, current_dir.

13 years agonnir.el (nnir-read-server-parm): Add an argument to restrict to server-variables...
Andrew Cohen [Wed, 3 Aug 2011 22:09:04 +0000 (22:09 +0000)]
nnir.el (nnir-read-server-parm): Add an argument to restrict to server-variables only. This should fix a bug introduced with commit e1889675b7f4adf057833c5513c9374134c4e053.
 (nnir-run-query): 'nnir-search-engine should not be set from the global environment.

13 years ago* src/keymap.c (Fmake_composed_keymap): Move to subr.el.
Stefan Monnier [Wed, 3 Aug 2011 21:40:06 +0000 (17:40 -0400)]
* src/keymap.c (Fmake_composed_keymap): Move to subr.el.
* lisp/subr.el (make-composed-keymap): Move from C.  Change calling
convention, and improve docstring to bring attention to a subtle point.
* lisp/minibuffer.el (completing-read-default): Adjust accordingly.

13 years ago* fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
Paul Eggert [Wed, 3 Aug 2011 19:54:12 +0000 (12:54 -0700)]
* fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE

so that it is not optimized away.

13 years ago* trampver.texi: Update release number.
Michael Albinus [Wed, 3 Aug 2011 19:33:50 +0000 (21:33 +0200)]
* trampver.texi: Update release number.

13 years ago* net/tramp-sh.el (tramp-open-connection-setup-interactive-shell)
Michael Albinus [Wed, 3 Aug 2011 19:31:18 +0000 (21:31 +0200)]
* net/tramp-sh.el (tramp-open-connection-setup-interactive-shell)
(tramp-open-shell): Use `tramp-shell-quote-argument'.

* net/trampver.el: Update release number.

13 years agoAuto-commit of loaddefs files.
Glenn Morris [Wed, 3 Aug 2011 10:20:59 +0000 (06:20 -0400)]
Auto-commit of loaddefs files.

13 years ago* xdisp.c (compute_display_string_pos): Remove unused local.
Paul Eggert [Wed, 3 Aug 2011 05:24:30 +0000 (22:24 -0700)]
* xdisp.c (compute_display_string_pos): Remove unused local.

13 years ago* lisp/progmodes/sh-script.el (sh-font-lock-paren): "main" is not "in".
Stefan Monnier [Wed, 3 Aug 2011 02:00:22 +0000 (22:00 -0400)]
* lisp/progmodes/sh-script.el (sh-font-lock-paren): "main" is not "in".

Fixes: debbugs:9190
13 years agoMerge changes made in Gnus trunk.
Gnus developers [Tue, 2 Aug 2011 22:16:33 +0000 (22:16 +0000)]
Merge changes made in Gnus trunk.

nnir.el (nnir-search-thread): Position point on referring article line.
 (nnir-warp-to-article): Clean up summary buffers.
nnimap.el (nnimap-request-thread): Whitespace fix.
nnimap.el (nnimap-get-groups): Decode "&" correctly.

13 years ago(sendmail-query-once): Restore the current buffer after querying
Lars Magne Ingebrigtsen [Tue, 2 Aug 2011 19:43:09 +0000 (21:43 +0200)]
(sendmail-query-once): Restore the current buffer after querying

Fixes: debbugs:9074
13 years agoFix bug #9218 with slow cursor motion and scrolling Org Mode buffers.
Eli Zaretskii [Tue, 2 Aug 2011 19:16:32 +0000 (22:16 +0300)]
Fix bug #9218 with slow cursor motion and scrolling Org Mode buffers.

 src/dispextern.h (struct bidi_it): New member disp_prop_p.
 src/xdisp.c: Remove one-slot cache of display string positions.
 (compute_display_string_pos): Accept an additional argument
 DISP_PROP_P; callers changed. Scan at most 5K characters forward
 for a display string or property.  If found, set DISP_PROP_P
 non-zero.
 src/bidi.c (bidi_fetch_char): Accept an additional argument
 DISP_PROP_P, and pass it to compute_display_string_pos.  Only
 handle text covered by a display string if DISP_PROP_P is returned
 non-zero.  All callers of bidi_fetch_char changed.

13 years agoUse different faces for marked and flagged files in dired
Lars Magne Ingebrigtsen [Tue, 2 Aug 2011 19:05:04 +0000 (21:05 +0200)]
Use different faces for marked and flagged files in dired

Fixes: debbugs:6117
13 years agodolist doc fix.
Lars Magne Ingebrigtsen [Tue, 2 Aug 2011 18:49:12 +0000 (20:49 +0200)]
dolist doc fix.

(dolist): Mention that there's a nil block

13 years ago* src/keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
Stefan Monnier [Tue, 2 Aug 2011 16:02:52 +0000 (12:02 -0400)]
* src/keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.

13 years ago(ido-mode): Switch off the message if called non-interactively.
Lars Magne Ingebrigtsen [Tue, 2 Aug 2011 15:59:31 +0000 (17:59 +0200)]
(ido-mode): Switch off the message if called non-interactively.

13 years agoPrefer port smtp over port 587 when sending mail.
Lars Magne Ingebrigtsen [Tue, 2 Aug 2011 15:57:35 +0000 (17:57 +0200)]
Prefer port smtp over port 587 when sending mail.

* mail/smtpmail.el (smtpmail-query-smtp-server): Try port 25
before 587, since it appears that that's more likely to work for
more people.

13 years agoWhen running under emacs -q, always refuse to save the customisations, even if the...
Lars Magne Ingebrigtsen [Tue, 2 Aug 2011 15:46:07 +0000 (17:46 +0200)]
When running under emacs -q, always refuse to save the customisations, even if the .emacs file doesn't exist.

This makes it easier to reproduce testing runs under "emacs -Q" more
reliably.

13 years agoFix non-prefix key error message when last character M-[char] is translated to ESC...
Don March [Tue, 2 Aug 2011 15:27:38 +0000 (17:27 +0200)]
Fix non-prefix key error message when last character M-[char] is translated to ESC [char]

13 years ago* info.el: Remove the `Info-beginning-of-buffer' function
Lars Magne Ingebrigtsen [Tue, 2 Aug 2011 15:21:07 +0000 (17:21 +0200)]
* info.el: Remove the `Info-beginning-of-buffer' function

13 years agoUse `starttls-available-p' to see whether starttls.el can be used.
Lars Magne Ingebrigtsen [Tue, 2 Aug 2011 13:34:05 +0000 (15:34 +0200)]
Use `starttls-available-p' to see whether starttls.el can be used.

13 years ago(starttls-available-p): Renamed from `starttls-any-program-available' and changed...
Lars Magne Ingebrigtsen [Tue, 2 Aug 2011 13:30:46 +0000 (15:30 +0200)]
(starttls-available-p): Renamed from `starttls-any-program-available' and changed return convention.

13 years agosrc/ChangeLog: Fix format.
Kenichi Handa [Tue, 2 Aug 2011 03:50:38 +0000 (12:50 +0900)]
src/ChangeLog: Fix format.

13 years agoMake uniprop_table non-static.
Kenichi Handa [Tue, 2 Aug 2011 03:49:09 +0000 (12:49 +0900)]
Make uniprop_table non-static.

13 years agoDon't set dedicated status for reused normal windows (Bug#9215).
Martin Rudalics [Mon, 1 Aug 2011 18:10:58 +0000 (20:10 +0200)]
Don't set dedicated status for reused normal windows (Bug#9215).

* window.el (display-buffer-in-window): Don't set dedicated status
of window here (Bug#9215).
(display-buffer-pop-up-window, display-buffer-pop-up-frame)
(display-buffer-pop-up-side-window)
(display-buffer-in-side-window): Set dedicated status of window
here.

13 years agoFix last change for bug#9212.
Eli Zaretskii [Mon, 1 Aug 2011 17:59:35 +0000 (20:59 +0300)]
Fix last change for bug#9212.

13 years agoFix bug #9212 with selective-display under bidi.
Eli Zaretskii [Mon, 1 Aug 2011 17:34:04 +0000 (20:34 +0300)]
Fix bug #9212 with selective-display under bidi.

 src/xdisp.c (forward_to_next_line_start): Accept additional argument
 BIDI_IT_PREV, and store into it the state of the bidi iterator had
 on the newline.
 (reseat_at_next_visible_line_start): Use the bidi iterator state
 returned by forward_to_next_line_start to restore the state of
 it->bidi_it after backing up to previous newline.  (Bug#9212)

13 years ago* lisp/emacs-lisp/package.el (package-generate-autoloads): Load autoloads
Stefan Monnier [Mon, 1 Aug 2011 15:54:09 +0000 (11:54 -0400)]
* lisp/emacs-lisp/package.el (package-generate-autoloads): Load autoloads
before binding generated-autoload-file.

13 years ago* lisp/net/rcirc.el (rcirc-handler-333): Clarify docstring.
Deniz Dogan [Mon, 1 Aug 2011 12:30:18 +0000 (14:30 +0200)]
* lisp/net/rcirc.el (rcirc-handler-333): Clarify docstring.

13 years agoAuto-commit of loaddefs files.
Glenn Morris [Mon, 1 Aug 2011 10:21:26 +0000 (06:21 -0400)]
Auto-commit of loaddefs files.

13 years agoTweak grammar files to match up with variable names used in parser files.
Chong Yidong [Mon, 1 Aug 2011 00:11:37 +0000 (20:11 -0400)]
Tweak grammar files to match up with variable names used in parser files.

13 years agoMerge changes made in Gnus trunk.
Gnus developers [Sun, 31 Jul 2011 22:15:44 +0000 (22:15 +0000)]
Merge changes made in Gnus trunk.

nnmaildir.el (nnmaildir-request-accept-article): Don't call `unix-sync' unless it's defined.
gnus-art.el (gnus-article-stop-animations): Use `elt' instead of `aref' for XEmacs compatibiltiy.
spam.el (spam-fetch-field-fast): Rewrite slightly for clarity.
gnus-sum.el (gnus-summary-refer-thread): Since lambdas aren't closures, quote the form properly (bug#9194).
gnus-sum.el (gnus-summary-insert-new-articles): Clean up slightly.
 (gnus-summary-insert-new-articles): Protect against servers that are down.

13 years agosrc/w32term.c: Fix typos in comments.
Juanma Barranquero [Sun, 31 Jul 2011 20:38:48 +0000 (22:38 +0200)]
src/w32term.c: Fix typos in comments.

13 years agoFix copyrights for javascript and python grammars.
Chong Yidong [Sun, 31 Jul 2011 00:11:05 +0000 (20:11 -0400)]
Fix copyrights for javascript and python grammars.

Since these grammars were transcribed from the ECMAScript spec (BSD
licensed) and Python sources (PSL) respectively, the copyright and
license notices must be included in these files.

13 years agoFix copyright headers for grammar files
Chong Yidong [Sat, 30 Jul 2011 21:18:40 +0000 (17:18 -0400)]
Fix copyright headers for grammar files
authored by Eric M. Ludlam, David Ponce, and Klaus Berndl (assignments on file).

13 years agoFix regexp for finding code blocks
Carsten Dominik [Sat, 30 Jul 2011 16:29:20 +0000 (18:29 +0200)]
Fix regexp for finding code blocks

13 years ago* mini.texi (Minibuffer File): Insert a reference to Tramp for
Michael Albinus [Sat, 30 Jul 2011 15:50:56 +0000 (17:50 +0200)]
* mini.texi (Minibuffer File): Insert a reference to Tramp for
remote file name completion.  (Bug#9197)

13 years agoSync with Tramp 2.2.2.
Michael Albinus [Sat, 30 Jul 2011 14:59:27 +0000 (16:59 +0200)]
Sync with Tramp 2.2.2.

* trampver.texi: Update release number.

13 years agoSync with Tramp 2.2.2.
Michael Albinus [Sat, 30 Jul 2011 14:57:12 +0000 (16:57 +0200)]
Sync with Tramp 2.2.2.

* net/trampver.el: Update release number.

13 years ago* src/regex.c (re_comp): Protoize.
Andreas Schwab [Sat, 30 Jul 2011 13:20:04 +0000 (15:20 +0200)]
* src/regex.c (re_comp): Protoize.
(re_exec): Fix return type.
(regexec): Fix type of `ret'.

13 years agoAuto-commit of loaddefs files.
Glenn Morris [Sat, 30 Jul 2011 10:18:37 +0000 (06:18 -0400)]
Auto-commit of loaddefs files.

13 years ago* lisp/dired-aux.el (dired-touch-initial): Remove function.
Juri Linkov [Sat, 30 Jul 2011 09:14:58 +0000 (12:14 +0300)]
* lisp/dired-aux.el (dired-touch-initial): Remove function.
(dired-do-chxxx): For op-symbol `touch', set `initial' to the
current time, and `default' to the last modification time of the
current marked file.

Fixes: debbugs:6887
13 years agoFix require statement in semantic/grammar.el.
Chong Yidong [Sat, 30 Jul 2011 02:11:31 +0000 (22:11 -0400)]
Fix require statement in semantic/grammar.el.

* lisp/semantic/grammar.el (semantic-grammar-insert-defanalyzers): Fix
require.

13 years agoAdd Semantic grammar files to etc/grammars
Chong Yidong [Sat, 30 Jul 2011 02:06:43 +0000 (22:06 -0400)]
Add Semantic grammar files to etc/grammars

13 years agoAuto-commit of generated files.
Glenn Morris [Fri, 29 Jul 2011 10:18:43 +0000 (06:18 -0400)]
Auto-commit of generated files.

13 years agomm-decode.el (mm-dissect-buffer): Add a default content-disposition in mm handle...
Daniel Dehennin [Fri, 29 Jul 2011 09:29:35 +0000 (09:29 +0000)]
mm-decode.el (mm-dissect-buffer): Add a default content-disposition in mm handle if none is specified.

13 years ago* image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
Paul Eggert [Fri, 29 Jul 2011 07:05:17 +0000 (00:05 -0700)]
* image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).

This is needed if max-image-size is a floating-point number.

13 years agoFix my mail address.
Reiner Steib [Fri, 29 Jul 2011 06:47:56 +0000 (08:47 +0200)]
Fix my mail address.

13 years agoMerge from trunk.
Paul Eggert [Fri, 29 Jul 2011 05:31:12 +0000 (22:31 -0700)]
Merge from trunk.

13 years agoAlphabetize the long ChangeLog entry.
Paul Eggert [Fri, 29 Jul 2011 05:27:47 +0000 (22:27 -0700)]
Alphabetize the long ChangeLog entry.

13 years ago* xterm.c: Integer and memory overflow issues.
Paul Eggert [Fri, 29 Jul 2011 05:12:49 +0000 (22:12 -0700)]
* xterm.c: Integer and memory overflow issues.

(x_color_cells, handle_one_xevent, x_term_init):
Check for size calculation overflow.
(x_color_cells): Don't store size until memory allocation succeeds.
(handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
(x_term_init): Don't assume length fits in int (sprintf is limited
to int size).

13 years ago* xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
Paul Eggert [Fri, 29 Jul 2011 05:09:32 +0000 (22:09 -0700)]
* xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.

13 years ago* xselect.c: Integer and memory overflow issues.
Paul Eggert [Fri, 29 Jul 2011 05:08:30 +0000 (22:08 -0700)]
* xselect.c: Integer and memory overflow issues.

(X_LONG_SIZE, X_USHRT_MAX, X_ULONG_MAX): New macros.
Use them to make the following changes clearer.
(MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
This change doesn't affect the value now, but it may help remind
future maintainers not to raise the value too much later.
(SELECTION_QUANTUM): Remove, replacing with ...
(selection_quantum): ... new function, which avoids overflow.
All uses changed.
(struct selection_data.size): Now ptrdiff_t, not int, to avoid
assumption that selection length fits in 'int'.
(x_reply_selection_request, x_handle_selection_request)
(x_get_window_property, receive_incremental_selection)
(x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
(lisp_data_to_selection_data, clean_local_selection_data):
Use ptrdiff_t, not int, to record length of selection.
(x_reply_selection_request, x_get_window_property)
(receive_incremental_selection, x_property_data_to_lisp):
Redo calculations to avoid overflow.
(x_reply_selection_request): When sending hint, ceiling it at
X_ULONG_MAX rather than relying on wraparound overflow to send
something.
(x_get_window_property, receive_incremental_selection)
(lisp_data_to_selection_data, x_property_data_to_lisp):
Check for size-calculation overflow.
(x_get_window_property, receive_incremental_selection)
(lisp_data_to_selection_data, Fx_register_dnd_atom):
Don't store size until memory allocation succeeds.
(x_get_window_property): Plug memory leak on memory exhaustion.
Don't double-block input; malloc is safe here.  Don't assume 2**34
- 4 fits in unsigned long.  Add an xassert to check
XGetWindowProperty overflow.  Be more careful about overflow
calculations, and distinguish size from memory overflow better.
(receive_incremental_selection): When tracing, don't assume
unsigned int is less than INT_MAX.
(x_selection_data_to_lisp_data): Remove unnecessary (and in theory
harmful) conversions of unsigned short to int.
(lisp_data_to_selection_data): Don't assume that integers
in the range -65535 through -1 fit in an X unsigned short.
Don't assume that ULONG_MAX == X_ULONG_MAX.  Don't store into
result parameters unless successful.  Rely on cons_to_unsigned
to report problems with elements; the old code wasn't right anyway.
(x_check_property_data): Check for int overflow; we cannot use
a wider type due to X limits.
(x_handle_dnd_message): Use unsigned int, to avoid int overflow.

13 years ago* xrdb.c: Integer and memory overflow issues.
Paul Eggert [Fri, 29 Jul 2011 01:59:57 +0000 (18:59 -0700)]
* xrdb.c: Integer and memory overflow issues.

(magic_file_p): Plug memory leak on size overflow.
(get_environ_db): Don't assume path length fits in int,
as sprintf is limited to int lengths.

13 years ago* xgselect.c (xg_select): Check for size calculation overflow.
Paul Eggert [Fri, 29 Jul 2011 01:56:54 +0000 (18:56 -0700)]
* xgselect.c (xg_select): Check for size calculation overflow.

Don't update size until alloc done.

13 years ago* xfns.c: Integer and memory overflow fixes.
Paul Eggert [Fri, 29 Jul 2011 01:55:31 +0000 (18:55 -0700)]
* xfns.c: Integer and memory overflow fixes.

(x_encode_text, x_set_name_internal, Fx_change_window_property):
Use ptrdiff_t, not int, to count sizes, since they can exceed
INT_MAX in size.  Check for size calculation overflow.

13 years ago* xfaces.c: Integer and memory overflow fixes.
Paul Eggert [Fri, 29 Jul 2011 01:52:29 +0000 (18:52 -0700)]
* xfaces.c: Integer and memory overflow fixes.

(Finternal_make_lisp_face): Use ptrdiff_t, not int, for sizes.
Check for size calculation overflow.
(cache_face): Do not overflow in size calculation.

13 years ago* xdisp.c: Integer and memory overflow fixes.
Paul Eggert [Fri, 29 Jul 2011 01:50:56 +0000 (18:50 -0700)]
* xdisp.c: Integer and memory overflow fixes.

(store_mode_line_noprop_char, x_consider_frame_title):
Use ptrdiff_t, not int, for sizes.
(store_mode_line_noprop_char): Don't update size until alloc done.

13 years ago* tparam.c: Integer and memory overflow fixes.
Paul Eggert [Fri, 29 Jul 2011 01:49:31 +0000 (18:49 -0700)]
* tparam.c: Integer and memory overflow fixes.

(tparam1): Use ptrdiff_t, not int, for sizes.
Don't update size until alloc done.
Redo size calculations to avoid overflow.
Check for size calculation overflow.

13 years ago* termcap.c: Integer and memory overflow issues.
Paul Eggert [Fri, 29 Jul 2011 01:24:19 +0000 (18:24 -0700)]
* termcap.c: Integer and memory overflow issues.

(tgetent): Use ptrdiff_t, not int, to record results of
subtracting pointers.
(gobble_line): Check for overflow more carefully.  Don't update size
until alloc done.

13 years ago* term.c: Integer and memory overflow issues.
Paul Eggert [Fri, 29 Jul 2011 01:22:19 +0000 (18:22 -0700)]
* term.c: Integer and memory overflow issues.

(max_frame_lines): Remove; unused.
(encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
not int.
(encode_terminal_code, calculate_costs): Check for size
calculation overflow.
(encode_terminal_code): Use ptrdiff_t, not int, to record glyph
table lengths and related sizes.  Don't update size until alloc
done.  Redo calculations to avoid overflow.
(calculate_costs): Don't bother calling xmalloc when xrealloc will do.

13 years ago* sysdep.c: Integer and memory overflow issues.
Paul Eggert [Fri, 29 Jul 2011 01:16:54 +0000 (18:16 -0700)]
* sysdep.c: Integer and memory overflow issues.

(system_process_attributes): Use ptrdiff_t, not int, for command
line length.  Do not attempt to address one before the beginning
of an array, as that's not portable.

13 years ago* search.c: Integer and memory overflow fixes.
Paul Eggert [Fri, 29 Jul 2011 01:13:10 +0000 (18:13 -0700)]
* search.c: Integer and memory overflow fixes.

(Freplace_match): Check for size calculation overflow.
(Fset_match_data): Don't assume list lengths fit in 'int'.

13 years ago* scroll.c: Integer and memory overflow fixes.
Paul Eggert [Fri, 29 Jul 2011 01:11:37 +0000 (18:11 -0700)]
* scroll.c: Integer and memory overflow fixes.

(do_line_insertion_deletion_costs): Check for size calculation overflow.
Don't bother calling xmalloc when xrealloc will do.

13 years ago* region-cache.c (move_cache_gap): Check for size calculation overflow.
Paul Eggert [Fri, 29 Jul 2011 01:10:08 +0000 (18:10 -0700)]
* region-cache.c (move_cache_gap): Check for size calculation overflow.

13 years ago* process.c (Fnetwork_interface_list): Check for overflow
Paul Eggert [Fri, 29 Jul 2011 01:05:39 +0000 (18:05 -0700)]
* process.c (Fnetwork_interface_list): Check for overflow

in size calculation.

13 years ago* nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
Paul Eggert [Fri, 29 Jul 2011 01:04:51 +0000 (18:04 -0700)]
* nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):

Now ptrdiff_t, not int.
* nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
(ns_draw_fringe_bitmap): Rewrite to avoid overflow.

13 years ago* minibuf.c (read_minibuf_noninteractive): Don't leak memory
Paul Eggert [Fri, 29 Jul 2011 01:01:17 +0000 (18:01 -0700)]
* minibuf.c (read_minibuf_noninteractive): Don't leak memory

on memory overflow.

13 years ago* macros.c: Integer and memory overflow fixes.
Paul Eggert [Fri, 29 Jul 2011 01:00:29 +0000 (18:00 -0700)]
* macros.c: Integer and memory overflow fixes.

(Fstart_kbd_macro): Don't update size until alloc done.
(store_kbd_macro_char): Reorder multiplicands to avoid overflow.

13 years ago* lread.c (read1, init_obarray): Don't update size until alloc done.
Paul Eggert [Fri, 29 Jul 2011 00:59:16 +0000 (17:59 -0700)]
* lread.c (read1, init_obarray): Don't update size until alloc done.

13 years ago* keymap.c: Integer overflow fixes.
Paul Eggert [Fri, 29 Jul 2011 00:32:09 +0000 (17:32 -0700)]
* keymap.c: Integer overflow fixes.

(cmm_size, current_minor_maps): Use ptrdiff_t, not int, to count maps.
(current_minor_maps): Check for size calculation overflow.
* keymap.h: Change prototypes to match the above.

13 years ago* keyboard.c: Integer and memory overflow fixes.
Paul Eggert [Fri, 29 Jul 2011 00:30:00 +0000 (17:30 -0700)]
* keyboard.c: Integer and memory overflow fixes.

(read_char, menu_bar_items, tool_bar_items, read_char_x_menu_prompt)
(read_char_minibuf_menu_width, read_char_minibuf_menu_prompt)
(follow_key, read_key_sequence): Use ptrdiff_t, not int, to count maps.
(read_char_minibuf_menu_prompt): Check for overflow in size
calculations.  Don't update size until allocation succeeds.  Redo
calculations to avoid overflow.
* keyboard.h: Change prototypes to match the above.

13 years ago* image.c: Integer and memory overflow fixes.
Paul Eggert [Fri, 29 Jul 2011 00:23:08 +0000 (17:23 -0700)]
* image.c: Integer and memory overflow fixes.

(RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these are duplicate
now that they've been promoted to lisp.h.
(x_allocate_bitmap_record, x_alloc_image_color)
(make_image_cache, cache_image, xpm_load):
Don't update size until alloc is done.
(xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
(x_detect_edges):
Check for size calculation overflow.
(ct_colors_allocated_max): New constant.
(x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
overflow.

13 years ago* gtkutil.c: Integer overflow fixes.
Paul Eggert [Thu, 28 Jul 2011 23:58:05 +0000 (16:58 -0700)]
* gtkutil.c: Integer overflow fixes.

(get_utf8_string, xg_store_widget_in_map):
Check for size-calculation overflow.
(get_utf8_string): Use ptrdiff_t, not size_t, where either will
do, as we prefer signed integers.
(id_to_widget.max_size, id_to_widget.used)
(xg_store_widget_in_map, xg_remove_widget_from_map)
(xg_get_widget_from_map, xg_get_scroll_id_for_window)
(xg_remove_scroll_bar, xg_update_scrollbar_pos):
Use and return ptrdiff_t, not int.
(xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
* gtkutil.h: Change prototypes to match the above.

13 years ago* ftfont.c: Check for size overflow.
Paul Eggert [Thu, 28 Jul 2011 23:51:50 +0000 (16:51 -0700)]
* ftfont.c: Check for size overflow.

(ftfont_get_open_type_spec, setup_otf_gstring, ftfont_shape_by_flt):
Check for integer overflow in size calculations.

13 years ago* fringe.c (Fdefine_fringe_bitmap): Don't update size until alloc works.
Paul Eggert [Thu, 28 Jul 2011 23:47:01 +0000 (16:47 -0700)]
* fringe.c (Fdefine_fringe_bitmap): Don't update size until alloc works.

13 years ago* frame.h (struct frame): Use int, not EMACS_INT, where int works.
Paul Eggert [Thu, 28 Jul 2011 21:51:29 +0000 (14:51 -0700)]
* frame.h (struct frame): Use int, not EMACS_INT, where int works.

This is for the members text_lines, text_cols, total_lines, total_cols,
where the system imposes an 'int' limit.

13 years ago* frame.c: Integer overflow fixes.
Paul Eggert [Thu, 28 Jul 2011 21:49:16 +0000 (14:49 -0700)]
* frame.c: Integer overflow fixes.

(set_menu_bar_lines, x_set_frame_parameters, x_set_scroll_bar_width)
(x_figure_window_size): Check for integer overflow.
(x_set_alpha): Do not assume XINT fits in int.

13 years ago* eval.c: Integer and memory overflow fixes.
Paul Eggert [Thu, 28 Jul 2011 21:42:59 +0000 (14:42 -0700)]
* eval.c: Integer and memory overflow fixes.

(init_eval_once, grow_specpdl): Don't update size until alloc succeeds.
(call_debugger, grow_specpdl): Redo calculations to avoid overflow.

13 years ago* emacs.c (main, sort_args): Check for size-calculation overflow.
Paul Eggert [Thu, 28 Jul 2011 21:38:23 +0000 (14:38 -0700)]
* emacs.c (main, sort_args): Check for size-calculation overflow.

13 years ago* editfns.c: Integer and memory overflow fixes.
Paul Eggert [Thu, 28 Jul 2011 21:37:15 +0000 (14:37 -0700)]
* editfns.c: Integer and memory overflow fixes.

(set_time_zone_rule): Don't assume environment length fits in int.
(message_length): Now ptrdiff_t, not int.
(Fmessage_box): Don't update size until allocation succeeds.
Don't assume message length fits in int.
(Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.

13 years ago* doc.c: Integer and memory overflow fixes.
Paul Eggert [Thu, 28 Jul 2011 21:34:39 +0000 (14:34 -0700)]
* doc.c: Integer and memory overflow fixes.

(get_doc_string_buffer_size): Now ptrdiff_t, not int.
(get_doc_string): Check for size calculation overflow.
Don't update size until allocation succeeds.
(get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
EMACS_INT, where ptrdiff_t will do.
(Fsubstitute_command_keys): Check for string overflow.