Paul Eggert [Tue, 15 Mar 2011 18:53:29 +0000 (11:53 -0700)]
* regex.c (RETALLOC_IF): Define only if needed.
(WORDCHAR_P): Likewise. This one is never needed, but is used
only in a comment talking about a compiler bug, so put inside
the #if 0 of that comment.
(CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
(PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
Remove; unused.
Paul Eggert [Tue, 15 Mar 2011 07:04:00 +0000 (00:04 -0700)]
Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
dired.c's scmp function, had undefined behavior.
* lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
(NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
* buffer.h: ... to here, because these macros use current_buffer,
and the new implementation with inline functions needs to have
current_buffer in scope now, rather than later when the macros
are used.
(downcase, upcase1): New static inline functions.
(DOWNCASE, UPCASE1): Reimplement using these functions.
This avoids undefined behavior in expressions like
DOWNCASE (x) == DOWNCASE (y), which previously suffered
from race conditions in accessing the global variables
case_temp1 and case_temp2.
* casetab.c (case_temp1, case_temp2): Remove; no longer needed.
* lisp.h (case_temp1, case_temp2): Remove their decls.
* character.h (ASCII_CHAR_P): Move from here ...
* lisp.h: ... to here, so that the inline functions mentioned
above can use them.
Chong Yidong [Sun, 13 Mar 2011 22:25:16 +0000 (18:25 -0400)]
Fix BUF_* macros to handle indirect buffers properly (Bug#8219).
* buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
(BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
These macros can no longer be used for assignment.
* buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Assign
struct members directly, instead of using BUF_BEGV etc.
(record_buffer_markers, fetch_buffer_markers): New functions for
recording and fetching special buffer markers.
(set_buffer_internal_1, set_buffer_temp): Use them.
* lread.c (unreadchar): Use SET_BUF_PT_BOTH.
* insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
* intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
(get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
* xdisp.c (hscroll_window_tree):
(reconsider_clip_changes): Use PT instead of BUF_PT.
Ted Zlatanov [Sun, 13 Mar 2011 22:17:17 +0000 (17:17 -0500)]
Add `auth-source-search' integration for LDAP searches.
* net/ldap.el (ldap-search-internal): Add `auth-source-search'
integration for LDAP parameters. The host, base, user or binddn,
and secret tokens can be specified in a netrc file, for instance.
This is optional because an `auth-source' parameter must be
specified in the search attributes.
Paul Eggert [Sun, 13 Mar 2011 08:31:16 +0000 (00:31 -0800)]
* gtkutil.c (int_gtk_range_get_value): New function, which avoids a diagnostic
from gcc -Wbad-function-cast.
(xg_set_toolkit_scroll_bar_thumb): Use it.
(xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
diagnostic from gcc -Wbad-function-cast.
Teodor Zlatanov [Sun, 13 Mar 2011 04:07:38 +0000 (04:07 +0000)]
Merge changes made in Gnus trunk.
auth.texi (Help for developers): Update docs to explain that the :save-function will only run the first time.
auth-source.el (auth-source-format-prompt): Always convert the value to a string to avoid evaluating non-string arguments.
(auth-source-netrc-create): Offer default properly, not as initial content in `read-string'.
(auth-source-netrc-saver): Use a cache keyed by file name and MD5 hash of line to determine if we've been run before. If so, don't run again, but print a trivial message to indicate the cache was hit instead.
Michael Albinus [Sat, 12 Mar 2011 13:26:19 +0000 (14:26 +0100)]
* net/tramp.el (tramp-progress-reporter-update): Use
`tramp-compat-funcall'.
(tramp-handle-start-file-process): Use `tramp-compat-process-get'.
(tramp-handle-insert-file-contents): Make `file-remote-p' call
compatible.
(tramp-open-connection-setup-interactive-shell): Use
`tramp-compat-process-put'.
* net/tramp-compat.el (tramp-compat-process-get)
(tramp-compat-process-put): New defuns.
Eli Zaretskii [Sat, 12 Mar 2011 12:03:24 +0000 (14:03 +0200)]
Make termcap.c implementations consistent with tparam.h prototypes.
src/termcap.c [MSDOS]: Include "msdos.h.
(find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
Constify `char *' arguments and their references according to
prototypes in tparam.h.
src/deps.mk (termcap.o): Depend on tparam.h and msdos.h.
Gnus developers [Sat, 12 Mar 2011 08:53:34 +0000 (08:53 +0000)]
Merge changes made in Gnus trunk.
gnus-sync.el (gnus-sync-install-hooks, gnus-sync-unload-hook): Don't install `gnus-sync-read' to any hooks by default. It's buggy. The user will have to run `gnus-sync-read' manually and wait for Cloudy Gnus.
mm-uu.el (mm-uu-type-alist): Add support for diff starting with "=== modified file".
Paul Eggert [Sat, 12 Mar 2011 06:49:53 +0000 (22:49 -0800)]
Improve quality of tests for time stamp overflow. For example,
without this patch (encode-time 0 0 0 1 1 1152921504606846976)
returns the obviously-bogus value (-948597 62170) on my RHEL 5.5
x86-64 host. With it, it reports time overflow.
* deps.mk (editfns.o): Depend on ../lib/intprops.h.
* editfns.c: Include limits.h and intprops.h.
(TIME_T_MIN, TIME_T_MAX): New macros.
(time_overflow): Move earlier, to before first use.
(hi_time, lo_time): New functions, for an accurate test for
out-of-range times.
(Fcurrent_time, Fget_internal_run_time, make_time): Use them.
(Fget_internal_run_time): Don't assume time_t fits in int.
(make_time): Use list2 instead of Fcons twice.
(Fdecode_time): More accurate test for out-of-range times.
(check_tm_member): New function.
(Fencode_time): Use it, to test for out-of-range times.