Paul Eggert [Tue, 24 May 2011 05:16:14 +0000 (22:16 -0700)]
* dbusbind.c: Serial number integer overflow fixes.
(CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
(xd_invalid_serial): New static function.
(Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
to hold a serial number that is too large for a fixnum.
(Fdbus_method_return_internal, Fdbus_method_error_internal):
Check for serial numbers out of range. Decode any serial number
that was so large that it became a float.
Paul Eggert [Tue, 24 May 2011 01:59:17 +0000 (18:59 -0700)]
* dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
(Fdbus_call_method, Fdbus_call_method_asynchronously):
Use XFASTINT rather than XUINT when numbers are nonnegative.
(xd_append_arg, Fdbus_method_return_internal):
(Fdbus_method_error_internal): Likewise. Also, for unsigned
arguments, check that Lisp number is nonnegative, rather than
silently wrapping negative numbers around.
Paul Eggert [Mon, 23 May 2011 06:50:03 +0000 (23:50 -0700)]
ccl: add integer overflow checks
* ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
(IN_INT_RANGE): New macros.
(ccl_driver): Use them to check for integer overflow when
decoding a CCL program. Many of the new checks are whether XINT (x)
fits in int; it doesn't always, on 64-bit hosts. The new version
doesn't catch all possible integer overflows, but it's an
improvement.
Paul Eggert [Mon, 23 May 2011 00:03:40 +0000 (17:03 -0700)]
* gnutls.c: Remove unused macros.
(fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
(fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
Remove macros that are defined and never used.
Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
Chong Yidong [Sun, 22 May 2011 21:57:43 +0000 (17:57 -0400)]
Remove var mistakenly introduced in 2011-05-22T19:46:47Z!cyd@stupidchicken.com.
* src/xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
(Fx_get_selection_internal): Minor cleanup.
(Fx_own_selection_internal): Rename arguments for consistency with
select.el.
Paul Eggert [Sun, 22 May 2011 20:27:07 +0000 (13:27 -0700)]
Rework Fformat to avoid integer overflow issues.
* editfns.c: Include <float.h> unconditionally, as it's everywhere
now (part of C89). Include <verify.h>.
(MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
(pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
(Fformat): Avoid the prepass trying to compute sizes; it was only
approximate and thus did not catch overflow reliably. Instead, walk
through the format just once, formatting and computing sizes as we go,
checking for integer overflow at every step, and allocating a larger
buffer as needed. Keep track separately whether the format is
multibyte. Keep only the most-recently calculated precision, rather
than them all. Record whether each argument has been converted to
string. Use EMACS_INT, not int, for byte and char and arg counts.
Support field widths and precisions larger than INT_MAX. Avoid
sprintf's undefined behavior with conversion specifications such as %#d
and %.0c. Fix bug with strchr succeeding on '\0' when looking for
flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
formatting out-of-range floating point numbers with int
formats. (Bug#8668)
Stefan Monnier [Sun, 22 May 2011 18:22:30 +0000 (15:22 -0300)]
* lisp/emacs-lisp/macroexp.el (macroexpand-all-1): Convert ' to #' for
funcall as well. Warn when performing those conversions.
* lisp/emacs-lisp/bytecomp.el (byte-compile-form): Fix error report.
Glenn Morris [Sun, 22 May 2011 00:04:49 +0000 (17:04 -0700)]
More small hack-local-variables tweaks for MODE-ONLY case.
* lisp/files.el (hack-local-variables-prop-line): Small simplifications.
(hack-local-variables, hack-local-variables-prop-line):
If MODE-ONLY, return the mode, rather than just `t'.
Paul Eggert [Sat, 21 May 2011 05:38:43 +0000 (22:38 -0700)]
* data.c: Avoid integer truncation in expressions involving floats.
* data.c: Include <intprops.h>.
(arith_driver): When there's an integer overflow in an expression
involving floating point, convert the integers to floating point
so that the resulting value does not suffer from catastrophic
integer truncation. For example, on a 64-bit host (* 4
most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
Do not rely on undefined behavior after integer overflow.
* character.c, character.h (count_size_as_multibyte):
Renamed from parse_str_to_multibyte; all uses changed.
Check for integer overflow.
* insdel.c, lisp.h (count_size_as_multibyte): Remove,
since it's now a duplicate of the other. This is more of
a character than a buffer op, so better that it's in character.c.
* fns.c, print.c: Adjust to above changes.
Eli Zaretskii [Fri, 20 May 2011 09:47:59 +0000 (12:47 +0300)]
Fix the MSDOS build as follows from 2011-05-19T06:04:16Z!rgm@gnu.org, 2011-05-20T00:41:03Z!rgm@gnu.org.
config.bat: Concatenate lisp.mk onto the end of src/Makefile.
msdos/sed1v2.inp (make-docfile commands): Recognize only if the line
begins with a TAB. Use $(etc) rather than a literal "../etc".
(`sed SED-COMMAND $(srcdir)/lisp.mk`): Edit to replace with "$(lisp).
(@lisp_frag@): Edit out.
msdos/sedlibmk.inp (GNULIB_GROUP_MEMBER, HAVE_GROUP_MEMBER): Edit to
zero.
src/callproc.c (Fcall_process) [MSDOS]: Fix arguments to
report_file_error introduced by the change from 2011-05-07.
Paul Eggert [Fri, 20 May 2011 06:37:13 +0000 (23:37 -0700)]
* systime.h (Time): Define only if emacs is defined.
This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
where the include path doesn't have X11/X.h by default. See
<http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
Glenn Morris [Fri, 20 May 2011 00:41:03 +0000 (17:41 -0700)]
Remove $shortlisp from src/Makefile.in.
* configure.in (lisp_frag): New output file.
* src/lisp.mk: New file, split from Makefile.in, and inheriting its
copyright years.
* src/Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
(shortlisp): Remove.
($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
Glenn Morris [Thu, 19 May 2011 06:04:16 +0000 (23:04 -0700)]
Remove the SOME_MACHINE_LISP distinction in src/Makefile.in.
See discussion in http://debbugs.gnu.org/8302
* configure.in (NS_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
(WINDOW_SUPPORT): Remove output variables that are no longer used.
* lib-src/makefile.w32-in (echolisp): Remove rule that is no longer needed.
(clean): No more echolisp.tmp.
* .bzrignore: Remove lib-src/echolisp.tmp.
* lisp/emacs-lisp/autoload.el (batch-update-autoloads):
Set autoload-excludes by parsing lisp/loadup.el rather than Makefiles.
* lisp/loadup.el: Update commentary.
* msdos/sed1x.inp (TOOLTIP_SUPPORT, WINDOW_SUPPORT):
* msdos/sed1v2.inp (MSDOS_SUPPORT, NS_SUPPORT, MOUSE_SUPPORT)
(TOOLTIP_SUPPORT, WINDOW_SUPPORT): No need to edit these any more.
* src/Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
(REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
(BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
(lisp): Set the order to that of loadup.el.
(shortlisp): Make it a copy of $lisp.
(SOME_MACHINE_LISP): Remove.
($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
Use just $shortlisp, not $SOME_MACHINE_LISP too.
Teodor Zlatanov [Wed, 18 May 2011 22:16:26 +0000 (22:16 +0000)]
gnus.texi (Gnus Registry Setup): Rename from "Setup".
(Store custom flags and keywords): Mention `gnus-registry-user-format-function-M' and `gnus-registry-user-format-function-M2'.
gnus-registry.el (gnus-registry-user-format-function-M): Use `mapconcat'.
(gnus-registry-user-format-function-M2): Use to see the full text of the marks. Make "," the mark text separator.
Glenn Morris [Wed, 18 May 2011 03:20:13 +0000 (20:20 -0700)]
Rationalize calendar handling of day and month abbrev-arrays.
* lisp/calendar/calendar.el (calendar-customized-p): New function.
(calendar-abbrev-construct, calendar-make-alist): Change what it does.
(calendar-day-name-array, calendar-month-name-array): Doc fix.
Add :set function.
(calendar-abbrev-length, calendar-day-abbrev-array)
(calendar-month-abbrev-array): Make defcustoms, with appropriate :set.
(calendar-day-abbrev-array, calendar-month-abbrev-array):
Elements may no longer be nil.
(calendar-day-name, calendar-month-name):
Update for changed nature of abbrev arrays.
* calendar/diary-lib.el (diary-name-pattern):
Update for changed nature of abbrev arrays.
(diary-mark-entries-1): Update calendar-make-alist calls.
(diary-font-lock-date-forms): Doc fix for changed abbrev arrays.
* calendar/cal-html.el (cal-html-day-abbrev-array):
Simply inherit from calendar-day-abbrev-array.
Glenn Morris [Tue, 17 May 2011 02:36:51 +0000 (19:36 -0700)]
appt.el mainly doc fixes.
* lisp/calendar/appt.el (appt-message-warning-time, appt-display-mode-line)
(appt-display-diary, appt-display-interval, appt-prev-comp-time)
(appt-check): Doc fixes.
(appt-disp-window-function, appt-delete-window-function):
Remove needless special case in custom :type.
(appt-display-count): Default to 0, not nil.
(appt-check): Reset appt-display-count to 0, not nil.
Kevin Ryde [Mon, 16 May 2011 17:41:03 +0000 (14:41 -0300)]
* lisp/info-look.el (makefile-automake-mode): New setups, looking in
automake manual, then makefile-mode.
(makefile-mode): Remove automake manual, have it just in
makefile-automake-mode since there's various things different or
not relevant to plain make.
(makefile-mode): Remove "other-modes" non-existent automake-mode,
believe a hypothetical automake-mode would go to makefile-mode,
not the other way around.