bpt/emacs.git
12 years agoUse gnulib's alloca-opt module.
Paul Eggert [Tue, 21 Jun 2011 16:15:07 +0000 (09:15 -0700)]
Use gnulib's alloca-opt module.

* .bzrignore: Add lib/alloca.h.
* Makefile.in (GNULIB_MODULES): Add alloca-opt.
* configure.in (AC_FUNC_ALLOCA): Remove almost all the alloca stuff,
as gnulib now does that for us.  Put alloca check after gl_INIT.
* lib/gnulib.mk, m4/gl-comp.m4: Regenerate.
* lib/alloca.in.h, m4/alloca.m4: New files, from gnulib.

12 years agoDon't make popup frames unsplittable by default.
Martin Rudalics [Tue, 21 Jun 2011 15:16:32 +0000 (17:16 +0200)]
Don't make popup frames unsplittable by default.

(display-buffer-alist, display-buffer-default-specifiers): Don't
make new frame unsplittable by default.
(display-buffer-normalize-argument): Fix doc-string typo and use
'same-frame-other-window instead of 'other-window when associating
with display-buffer-macro-specifiers.

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

12 years agolisp/misc.el (list-dynamic-libraries): Fix computation of header fields.
Juanma Barranquero [Tue, 21 Jun 2011 10:04:28 +0000 (12:04 +0200)]
lisp/misc.el (list-dynamic-libraries): Fix computation of header fields.

12 years agoNew primitive secure-hash supporting md5, sha-1 and sha-2
Leo Liu [Tue, 21 Jun 2011 08:55:22 +0000 (16:55 +0800)]
New primitive secure-hash supporting md5, sha-1 and sha-2

12 years agoFix last fix of display-buffer-normalize-options.
Martin Rudalics [Tue, 21 Jun 2011 08:51:30 +0000 (10:51 +0200)]
Fix last fix of display-buffer-normalize-options.

12 years agoAdd crypto/sha256 and crypto/sha512 modules from gnulib
Leo Liu [Tue, 21 Jun 2011 08:45:39 +0000 (16:45 +0800)]
Add crypto/sha256 and crypto/sha512 modules from gnulib

12 years agoHandle old buffer display options more faithfully.
Martin Rudalics [Tue, 21 Jun 2011 08:29:43 +0000 (10:29 +0200)]
Handle old buffer display options more faithfully.

* window.el (display-buffer-alist): In default value do not
enforce searching a window on any but the selected frame.
Reported by Katsumi Yamaoka <yamaoka@jpl.org>.
(display-buffer-select-window): Remove function.
(display-buffer-in-window): When a window on another frame gets
reused, do not select it any more but just raise its frame if
necessary (Bug#8851) and (Bug#8856).
(display-buffer-normalize-options): Handle pop-up-frames related
options more faithfully.
(pop-to-buffer): Don't rely on `display-buffer' selecting the
window if it is on another frame.

12 years ago* lisp/play/5x5.el (5x5-solve-rotate-left, 5x5-solve-rotate-right): New funs.
Vincent Belaïche [Tue, 21 Jun 2011 03:16:02 +0000 (23:16 -0400)]
* lisp/play/5x5.el (5x5-solve-rotate-left, 5x5-solve-rotate-right): New funs.
(5x5-mode-map, 5x5-mode-menu): Bind them.
(5x5-draw-grid): Tweak the solver's rendering.

12 years ago* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): Rename
Stefan Monnier [Tue, 21 Jun 2011 02:10:10 +0000 (22:10 -0400)]
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): Rename
`caml' to `python-tracebacks-and-caml'; allow leading tabs.

Fixes: debbugs:8585

12 years ago* lisp/menu-bar.el: Use function variable instead of switch-to-buffer.
Drew Adams [Tue, 21 Jun 2011 01:49:36 +0000 (21:49 -0400)]
* lisp/menu-bar.el: Use function variable instead of switch-to-buffer.
(menu-bar-select-buffer-function): New variable.
(menu-bar-update-buffers): Use it.

12 years ago* lisp/emacs-lisp/bytecomp.el (add-to-list): Add handler to check the
Stefan Monnier [Tue, 21 Jun 2011 01:43:56 +0000 (21:43 -0400)]
* lisp/emacs-lisp/bytecomp.el (add-to-list): Add handler to check the
variable's status.

12 years ago* x-dnd.el (x-dnd-version-from-flags)
Jan Djärv [Mon, 20 Jun 2011 20:49:12 +0000 (22:49 +0200)]
* x-dnd.el (x-dnd-version-from-flags)
(x-dnd-more-than-3-from-flags): New functions that handle long-as-cons
and long as number.
(x-dnd-handle-xdnd): Call functions above.

Fixes: debbugs:8899

12 years ago* lisp/minibuffer.el (completion-metadata): Prepend the alist with `metadata'.
Stefan Monnier [Mon, 20 Jun 2011 20:16:20 +0000 (16:16 -0400)]
* lisp/minibuffer.el (completion-metadata): Prepend the alist with `metadata'.
(completion-try-completion, completion-all-completions): Compute the
metadata argument if it's missing; make it optional.

Fixes: debbugs:8795

12 years ago* doc/misc/eshell.texi (Known problems): Fix typo.
Stefan Monnier [Mon, 20 Jun 2011 16:14:01 +0000 (12:14 -0400)]
* doc/misc/eshell.texi (Known problems): Fix typo.

12 years agoUse completion-at-point rather than completion-in-region.
Stefan Monnier [Mon, 20 Jun 2011 16:02:31 +0000 (12:02 -0400)]
Use completion-at-point rather than completion-in-region.
* lisp/wid-edit.el: Use lexical scoping and move towards completion-at-point.
(widget-complete): Use new :completion-function property.
(widget-completions-at-point): New function.
(default): Use :completion-function instead of :complete.
(widget-default-completions): Rename from widget-default-complete, rewrite.
(widget-string-complete, widget-file-complete, widget-color-complete):
Remove functions.
(file, symbol, function, variable, coding-system, color):
* lisp/international/mule-cmds.el (default-input-method, charset)
(language-info-custom-alist):
* lisp/cus-edit.el (face): Use new property :completions.

* lisp/progmodes/pascal.el (pascal-completions-at-point): New function.
(pascal-mode): Use it.
(pascal-mode-map): Use completion-at-point.
(pascal-toggle-completions): Make obsolete.
(pascal-complete-word, pascal-show-completions):
* lisp/progmodes/octave-mod.el (octave-complete-symbol):
Redefine as obsolete alias.
* lisp/progmodes/octave-inf.el (inferior-octave-completion-at-point):
Signal absence of completion info for old Octave,
(inferior-octave-complete): Redefine as obsolete alias.
* lisp/progmodes/meta-mode.el: Use lexical-binding and completion-at-point.
(meta-completions-at-point): Rename from meta-complete-symbol and
adapt it for use on completion-at-point-functions.
(meta-common-mode): Use it.
(meta-looking-at-backward, meta-match-buffer): Remove.
(meta-complete-symbol): Redefine as obsolete alias.
(meta-common-mode-map): Use completion-at-point.
* lisp/progmodes/make-mode.el: Use lexical-binding and completion-at-point.
(makefile-mode-map): Use completion-at-point.
(makefile-completions-at-point): Rename from makefile-complete and
adapt it for use on completion-at-point-functions.
(makefile-mode): Use it.
(makefile-complete): Redefine as obsolete alias.

12 years ago* lisp/net/rcirc.el: Delete trailing whitespaces once and for all.
Deniz Dogan [Mon, 20 Jun 2011 12:55:24 +0000 (14:55 +0200)]
* lisp/net/rcirc.el: Delete trailing whitespaces once and for all.

12 years ago* src/process.c (Fset_process_buffer): Clarify return value in docstring.
Deniz Dogan [Mon, 20 Jun 2011 12:54:05 +0000 (14:54 +0200)]
* src/process.c (Fset_process_buffer): Clarify return value in docstring.

12 years agoRestore old behavior of get-window-with-predicate and get-buffer-window-list.
Martin Rudalics [Mon, 20 Jun 2011 08:41:57 +0000 (10:41 +0200)]
Restore old behavior of get-window-with-predicate and get-buffer-window-list.

* window.el (get-window-with-predicate): Start scanning with
window following selected window to restore Emacs 23 behavior.
Clarify doc-string.
(get-buffer-window-list): Start scanning with selected window to
restore Emacs 23 behavior.  Clarify doc-string.

12 years ago* emacs-lisp/syntax.el (syntax-ppss): Further improve docstring.
Daniel Colascione [Mon, 20 Jun 2011 03:36:16 +0000 (20:36 -0700)]
* emacs-lisp/syntax.el (syntax-ppss): Further improve docstring.

12 years agoFix last change.
Chong Yidong [Sun, 19 Jun 2011 18:59:58 +0000 (14:59 -0400)]
Fix last change.

12 years ago* lisp/files.el (auto-mode-alist): Entry for m2-mode (Bug#8852).
Chong Yidong [Sun, 19 Jun 2011 18:53:49 +0000 (14:53 -0400)]
* lisp/files.el (auto-mode-alist): Entry for m2-mode (Bug#8852).

12 years ago* info.el (Info-apropos-toc-nodes): Minor doc fix (Bug#8833).
Chong Yidong [Sun, 19 Jun 2011 18:42:06 +0000 (14:42 -0400)]
* info.el (Info-apropos-toc-nodes): Minor doc fix (Bug#8833).

12 years agoAuto-commit of loaddefs files.
Glenn Morris [Sun, 19 Jun 2011 18:39:24 +0000 (14:39 -0400)]
Auto-commit of loaddefs files.

12 years agoAuto-commit of generated files.
Glenn Morris [Sun, 19 Jun 2011 18:33:17 +0000 (14:33 -0400)]
Auto-commit of generated files.

12 years ago* lib/unistd.in.h, m4/getloadavg.m4: Merge from gnulib.
Paul Eggert [Sun, 19 Jun 2011 18:22:16 +0000 (11:22 -0700)]
* lib/unistd.in.h, m4/getloadavg.m4: Merge from gnulib.

12 years agoRegroup clauses in display-buffer-normalize-options (Bug#8851) and (Bug#8856).
Martin Rudalics [Sun, 19 Jun 2011 14:32:12 +0000 (16:32 +0200)]
Regroup clauses in display-buffer-normalize-options (Bug#8851) and (Bug#8856).

* window.el (display-buffer-normalize-options): Move special-display-p
group after pop-up-frame group (Bug#8851) and (Bug#8856).

12 years agoProvide functions for saving window configurations as Lisp objects.
Martin Rudalics [Sun, 19 Jun 2011 10:17:56 +0000 (12:17 +0200)]
Provide functions for saving window configurations as Lisp objects.

* window.el (window-list-no-nils, window-state-ignored-parameters)
(window-state-get-1, window-state-get, window-state-put-list)
(window-state-put-1, window-state-put-2, window-state-put): New
functions.

12 years agoSanitize processing of display specifiers; new option frame-auto-delete.
Martin Rudalics [Sun, 19 Jun 2011 09:59:58 +0000 (11:59 +0200)]
Sanitize processing of display specifiers; new option frame-auto-delete.

* window.el (display-buffer-other-window-means-other-frame):
Call display-buffer-normalize-alist.
(display-buffer-normalize-specifiers-1): Rename to
display-buffer-normalize-argument.  New argument other-frame.
Rewrite.
(display-buffer-normalize-specifiers-2): Rename to
display-buffer-normalize-options.
(display-buffer-normalize-alist-1): New function.
(display-buffer-normalize-specifiers-3): Rename to
display-buffer-normalize-alist.  Call
display-buffer-normalize-alist-1.
(display-buffer-normalize-options-inhibit): New variable.
(display-buffer-normalize-specifiers): Rewrite calling
display-buffer-normalize-alist,
display-buffer-normalize-argument, and
display-buffer-normalize-options.  Don't call the latter if
display-buffer-normalize-options-inhibit is non-nil.
(frame-auto-delete): New option.
(window-deletable-p): Use frame-auto-delete.

12 years agoauth-source.el (auth-source-netrc-use-gpg-tokens): Replace `auth-source-save-secrets...
Teodor Zlatanov [Sat, 18 Jun 2011 22:23:55 +0000 (22:23 +0000)]
auth-source.el (auth-source-netrc-use-gpg-tokens): Replace `auth-source-save-secrets' with a more sensitive alist that can be configured per file.  Experimental, so defaults to 'never.
 (auth-source-netrc-create): Use it.  Still experimental code.
 (with-auth-source-epa-overrides): Use `find-file-hooks' if `find-file-hook' is unbound (XEmacs fix).  Fix backquoting bug.

12 years agoAdd rx.el support for numbered groups (Bug#8776).
Chong Yidong [Sat, 18 Jun 2011 21:12:33 +0000 (17:12 -0400)]
Add rx.el support for numbered groups (Bug#8776).

* lisp/emacs-lisp/rx.el (rx-constituents): Add support for numbered groups.
(rx-submatch-n): New function.
(rx): Document it.

12 years ago* dired-x.el (dired-mark-unmarked-files): Fix interactive spec (Bug#8768).
Chong Yidong [Sat, 18 Jun 2011 20:17:30 +0000 (16:17 -0400)]
* dired-x.el (dired-mark-unmarked-files): Fix interactive spec (Bug#8768).

12 years ago* lisp/textmodes/fill.el (default-justification): Add :safe (Bug#8879).
Chong Yidong [Sat, 18 Jun 2011 19:21:16 +0000 (15:21 -0400)]
* lisp/textmodes/fill.el (default-justification): Add :safe (Bug#8879).

12 years agoFixes for GLYPH_DEBUG.
Chong Yidong [Sat, 18 Jun 2011 19:15:06 +0000 (15:15 -0400)]
Fixes for GLYPH_DEBUG.

* dispnew.c (add_window_display_history): Use BVAR.

* xdisp.c (debug_method_add): Use BVAR.
(check_window_end, dump_glyph_matrix, dump_glyph)
(dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.

* xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
Likewise.

* xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
check till after the cache is created in init_frame_faces.

12 years agoFix for disable-theme/defface interaction (Bug#8889).
Chong Yidong [Sat, 18 Jun 2011 18:49:19 +0000 (14:49 -0400)]
Fix for disable-theme/defface interaction (Bug#8889).

* lisp/cus-face.el (custom-declare-face): Call custom-theme-recalc face
anytime existing face settings are present.

12 years agoUse define-derived-mode in delphi-mode.
Chong Yidong [Sat, 18 Jun 2011 16:23:11 +0000 (12:23 -0400)]
Use define-derived-mode in delphi-mode.

* lisp/progmodes/delphi.el (delphi-mode-syntax-table): Use defvar.
(delphi-mode): Use define-derived-mode to inherit from prog-mode.
Remove unused argument.

12 years agoOne more fix for display-buffer-normalize-specifiers-1.
Martin Rudalics [Sat, 18 Jun 2011 15:14:35 +0000 (17:14 +0200)]
One more fix for display-buffer-normalize-specifiers-1.

* window.el (display-buffer-normalize-specifiers-1): Fix thinko.

12 years agoAdditional fixes in handling of buffer display specifiers.
Martin Rudalics [Sat, 18 Jun 2011 14:23:14 +0000 (16:23 +0200)]
Additional fixes in handling of buffer display specifiers.

* window.el (display-buffer-default-specifiers): Remove
pop-up-frame.  Add pop-up-window-min-height,
pop-up-window-min-width, and another reuse-window specifier
(Bug#8882).  Reported by Dan Nicolaescu <dann@gnu.org>.
(display-buffer-normalize-specifiers-2): Handle
split-height-threshold and split-width-threshold also when
pop-up-windows is unset.  Add a reuse-window specifier for the
case popping up a new window fails.
(special-display-popup-frame): Remove double quoting.

12 years ago* lisp/pcomplete.el: Convert to lexical binding and fix bug#8819.
Stefan Monnier [Fri, 17 Jun 2011 18:52:46 +0000 (14:52 -0400)]
* lisp/pcomplete.el: Convert to lexical binding and fix bug#8819.
(pcomplete-suffix-list): Mark as obsolete.
(pcomplete-completions-at-point): Capture pcomplete-norm-func and
pcomplete-seen in the closure.
(pcomplete-comint-setup): Setup completion-at-point as well.
(pcomplete--entries): New function.
(pcomplete--env-regexp): New var.
(pcomplete-entries): Rewrite to work with partial-completion and
without relying on pcomplete-suffix-list.
(pcomplete-pare-list): Remove, unused.
* lisp/shell.el (shell-completion-vars): Set pcomplete-termination-string
according to comint-completion-addsuffix.

12 years agoAuto-commit of generated files.
Glenn Morris [Fri, 17 Jun 2011 17:41:21 +0000 (13:41 -0400)]
Auto-commit of generated files.

12 years agoFix previous change.
Glenn Morris [Fri, 17 Jun 2011 17:32:58 +0000 (13:32 -0400)]
Fix previous change.

12 years agoSmall configure.in fix.
Glenn Morris [Fri, 17 Jun 2011 17:29:50 +0000 (13:29 -0400)]
Small configure.in fix.

Ref: http://lists.gnu.org/archive/html/emacs-buildstatus/2011-06/msg00007.html

* configure.in: Restore the behavior of checking crt-dir only
when the user specified it (not all platforms use it).

12 years agoUpdate doc-string of display-buffer-alist.
Martin Rudalics [Fri, 17 Jun 2011 16:07:55 +0000 (18:07 +0200)]
Update doc-string of display-buffer-alist.

12 years ago* src/fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
Stefan Monnier [Fri, 17 Jun 2011 15:18:54 +0000 (11:18 -0400)]
* src/fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.

12 years agoRewrite display-buffer-alist and display-buffer-normalize-specifiers.
Martin Rudalics [Fri, 17 Jun 2011 14:50:11 +0000 (16:50 +0200)]
Rewrite display-buffer-alist and display-buffer-normalize-specifiers.

* window.el (display-buffer-alist): Set pop-up-window-min-height
and pop-up-window-min-width in default value.  Reported by
Thierry Volpiatto <thierry.volpiatto@gmail.com>.  New specifier
other-window-means-other-frame.
(display-buffer-macro-specifiers): Comment out entry for
other-window specifier.
(display-buffer-other-window-means-other-frame): New function.
(display-buffer-normalize-specifiers-1): New arguments
buffer-name and label.  Treat other-window case specially.
(display-buffer-normalize-specifiers-2): Treat other-window case
specially.
(display-buffer-normalize-specifiers-3): New function.
(display-buffer-normalize-specifiers): Call
display-buffer-normalize-specifiers-3.

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

12 years agoFix handling of old `display-buffer' options (bug#8851) (bug#8856).
Martin Rudalics [Fri, 17 Jun 2011 08:45:37 +0000 (10:45 +0200)]
Fix handling of old `display-buffer' options (bug#8851) (bug#8856).

* window.el (display-buffer-normalize-specifiers-1): Don't
check pop-up-frames for 'unset initialization.
(display-buffer-normalize-specifiers-2): Major rewrite using
special-display-p and same-window-p (Bug#8851) and (Bug#8856).
(pop-up-frames, display-buffer-reuse-frames)
(display-buffer-mark-dedicated): Don't initialize to 'unset.
Suggested by David Engster <deng@randomsample.de>.
(even-window-heights): Initialize to 'unset.
(display-buffer-alist-set): Handle new 'unset initializations.

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.