(smtpmail-try-auth-methods): If the user has stored a user name, then
query for the password first, instead of waiting for SMTP to give an
error message and the trying again.
Paul Eggert [Wed, 22 Jun 2011 18:15:23 +0000 (11:15 -0700)]
GLYPH_DEBUG fixes
The following patches are for when GLYPH_DEBUG && !XASSERT.
* dispextern.h (trace_redisplay_p, dump_glyph_string):
* dispnew.c (flush_stdout):
* xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
Mark as externally visible.
* dispnew.c (check_window_matrix_pointers): Now static.
* dispnew.c (window_to_frame_vpos):
* xfns.c (unwind_create_frame):
* xterm.c (x_check_font): Remove unused local.
* scroll.c (CHECK_BOUNDS):
* xfaces.c (cache_fache): Rename local to avoid shadowing.
* xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
* xdisp.c (check_window_end): Now a no-op if !XASSERTS.
(debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
(debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
Now static.
(debug_method_add): Use va_list and vsprintf rather than relying
on undefined behavior with wrong number of arguments.
(dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
Don't assume ptrdiff_t and EMACS_INT are the same width as int.
In this code, it's OK to assume C99 behavior for ptrdiff_t formats
since we're not interested in debugging glyphs with old libraries.
* xfaces.c (cache_face): Move debugging code earlier; this pacifies
GCC 4.6.0's static checking.
Martin Rudalics [Wed, 22 Jun 2011 07:12:18 +0000 (09:12 +0200)]
Remove preset entries for pop-up-frame-alist from window.el defaults.
* window.el (display-buffer-default-specifiers)
(display-buffer-alist): Remove entries for pop-up-frame-alist.
Suggested by Katsumi Yamaoka <yamaoka@jpl.org>.
* frame.el (pop-up-frame-alist, pop-up-frame-function)
(special-display-frame-alist, special-display-popup-frame):
Remove duplicate declarations. These are now in window.el.
Rewritten smtpmail.el to use `open-network-stream' to do STARTTLS
upgrades opportunistically, and to only use auth-source for all
credentials. Mostly backwards compatible, but
`smtpmail-auth-credentials' and `smtpmail-starttls-credentials' are
removed, and users who relied on those will have to put the
credentials in ~/.authinfo instead.
David Reitter [Tue, 21 Jun 2011 18:45:36 +0000 (11:45 -0700)]
ns-win: set ApplePressAndHoldEnabled to NO as it is unsupported.
This is in preparation for OS X "Lion"; it is a stop-gap solution
until this new input mechanism is supported correctly.
Paul Eggert [Tue, 21 Jun 2011 16:47:56 +0000 (09:47 -0700)]
Port to Sun C.
* composite.c (find_automatic_composition): Omit needless 'return 0;'
that Sun C diagnosed.
* fns.c (secure_hash): Fix pointer signedness issue.
* intervals.c (static_offset_intervals): New function.
(offset_intervals): Use it.
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.
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.
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.
Paul Eggert [Tue, 21 Jun 2011 02:15:16 +0000 (19:15 -0700)]
* xrdb.c: Don't assume strlen fits in int; avoid some strlens.
* xrdb.c (magic_file_p, search_magic_path):
Omit last arg SUFFIX; it was always 0. All callers changed.
(magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
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.
not unsigned long, as we prefer signed integers. All callers changed.
Detect integer overflow in repeat count.
(message_dolog): Don't assume print length fits in 39 bytes.
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.
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.
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.
Paul Eggert [Mon, 20 Jun 2011 03:11:40 +0000 (20:11 -0700)]
* filelock.c: Fix some buffer overrun and integer overflow issues.
(get_boot_time): Don't assume that gzip command string fits in 100 bytes.
Reformulate so as not to need the command string.
Invoke gzip -cd rather than gunzip, as it's more portable.
(lock_info_type, lock_file_1, lock_file):
Don't assume pid_t and time_t fit in unsigned long.
(LOCK_PID_MAX): Remove; we now use more-reliable bounds.
(current_lock_owner): Prefer signed type for sizes.
Use memcpy, not strncpy, where memcpy is what is really wanted.
Don't assume (via atoi) that time_t and pid_t fit in int.
Check for time_t and/or pid_t out of range, e.g., via a network share.
Don't alloca where an auto var works fine.
Paul Eggert [Sun, 19 Jun 2011 19:06:16 +0000 (12:06 -0700)]
* fileio.c: Fix some integer overflow issues.
(file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
Don't assume string length fits in int.
(directory_file_name): Don't assume string length fits in long.
(make_temp_name): Don't assume pid fits in int, or that its print
length is less than 20.
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.
Paul Eggert [Sun, 19 Jun 2011 01:31:41 +0000 (18:31 -0700)]
* lread.c (invalid_syntax): Omit length argument.
All uses changed. This doesn't fix a bug, but it simplifies the
code away from its former Hollerith-constant appearance, and it's
one less 'int' to worry about when looking at integer-overflow issues.
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.