1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 00:01:33 -08:00
Commit graph

31066 commits

Author SHA1 Message Date
Eli Zaretskii
15cbd324fd Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files (bug#8528).
src/fileio.c (Finsert_file_contents): Don't limit file size to 1/4
 of MOST_POSITIVE_FIXNUM.
 src/coding.c (coding_alloc_by_realloc): Error out if destination
 will grow beyond MOST_POSITIVE_FIXNUM.
 (decode_coding_emacs_mule): Abort if there isn't enough place in
 charbuf for the composition carryover bytes.  Reserve an extra
 space for up to 2 characters produced in a loop.
 (decode_coding_iso_2022): Abort if there isn't enough place in
 charbuf for the composition carryover bytes.
2011-04-29 22:47:29 +03:00
Eli Zaretskii
ae940ccad1 Don't abort in doprnt when passed unsupported %ll modifier.
src/doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
 aborting when %lld or %lll format is passed.
 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
 %llo or %llx format is passed.  (Bug#8545)
2011-04-29 22:34:06 +03:00
Eli Zaretskii
03ab8921a8 Fix bug #7952 with vertical motion in Grep buffers.
src/window.c (window_scroll_line_based): Use a marker instead of
 simple variables to record original value of point.
2011-04-29 21:03:00 +03:00
Eli Zaretskii
afda143761 Fix doprnt when buffer is too small for multibyte sequences.
src/doprnt.c (doprnt): Fix the case where a multibyte sequence
 produced by %s or %c overflows available buffer space.  (Bug#8545)
2011-04-29 14:01:11 +03:00
Paul Eggert
f40b429dbf Document doprnt's behavior a bit better. 2011-04-28 15:02:15 -07:00
Paul Eggert
fc96fbabd3 Remove confusing word from comment. 2011-04-28 14:41:39 -07:00
Paul Eggert
ca2d627477 Improve comment. 2011-04-28 13:27:52 -07:00
Paul Eggert
283cdbef2a * doprnt.c (SIZE_MAX): Move defn after all includes, as they might #define it. 2011-04-28 13:11:17 -07:00
Paul Eggert
f76dee0c23 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545). 2011-04-28 13:09:37 -07:00
Juanma Barranquero
fdc5744d4f src/w32.c (init_environment): Warn about defaulting HOME to C:\. 2011-04-28 21:51:12 +02:00
Juanma Barranquero
638f053a0e Add delayed warnings support.
* etc/NEWS: Document `delayed-warnings-list' and `delayed-warnings-hook'.

* lisp/subr.el (display-delayed-warnings): New function.
  (delayed-warnings-hook): New variable.

* src/keyboard.c (Qdelayed_warnings_hook): Define.
  (command_loop_1): Run `delayed-warnings-hook' if Vdelayed_warnings_list
  is non-nil.
  (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
  (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
2011-04-28 21:35:20 +02:00
Eli Zaretskii
d178f87164 Fix return value from doprnt when message is truncated at non-ASCII character.
src/doprnt.c (doprnt): Don't return value smaller than the buffer
 size if the message was truncated.  (Bug#8545).
2011-04-28 07:46:40 -04:00
Juanma Barranquero
b124fd93b0 src/w32fns.c: #if-0 some functions entirely, not just the bodies. 2011-04-28 04:01:33 +02:00
Paul Eggert
4cf0fdcb15 Merge: * doprnt.c (doprnt): Support "ll" length modifier, for long long. 2011-04-27 16:48:43 -07:00
Juanma Barranquero
ea51cceb3c src/makefile.w32-in: Update dependencies. 2011-04-28 01:35:33 +02:00
Paul Eggert
b71a1728a9 Fix comments. 2011-04-27 16:04:20 -07:00
Paul Eggert
226be1b02f * doprnt.c (doprnt): Fix two typos for long long. 2011-04-27 15:59:09 -07:00
Paul Eggert
54b8e3f775 Merge from mainline. 2011-04-27 15:29:33 -07:00
Juanma Barranquero
841a157789 Fix ChangeLog typos. 2011-04-27 21:51:19 +02:00
Paul Eggert
8f41de3a66 Add FIXME comment. 2011-04-27 12:05:21 -07:00
Paul Eggert
e810457d00 * doprnt.c (doprnt): Support "ll" length modifier, for long long. 2011-04-27 11:22:21 -07:00
Eli Zaretskii
94dcfacf12 Improve `doprnt' and its usage. (Bug#8545)
src/doprnt.c (doprnt): Make sure `format' is never accessed beyond
 `format_end'.  Remove support for %l as a conversion specifier.
 Don't use xrealloc.  Improve diagnostics when the %l size modifier
 is used.  Update the commentary.
 src/eval.c (verror): Simplify calculation of size_t.
 src/coding.c (Ffind_operation_coding_system): Fix diagnostic error
 messages.
2011-04-27 21:15:29 +03:00
Paul Eggert
f61f41d747 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing change 2011-04-27 01:06:26 -07:00
Paul Eggert
96fb4434c8 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
This makes this file independent of the recent pseudovector change.
2011-04-26 23:01:43 -07:00
Paul Eggert
aa0b008761 * lisp.h: Add comments about struct vectorlike_header. 2011-04-26 12:14:07 -07:00
Paul Eggert
69e9b5a37c * keyboard.c (handle_user_signal): Fix pointer signedness problem. 2011-04-26 11:02:10 -07:00
Paul Eggert
b5f869a7d8 Merge from mainline. 2011-04-26 10:50:51 -07:00
Juanma Barranquero
895009e16a src/keyboard.c (QCrtl): Rename from Qrtl. All uses changed. 2011-04-26 16:02:55 +02:00
Ted Zlatanov
6a7a1b0b74 Don't return in emacs_gnutls_handshake without an explicit value.
* gnutls.c (emacs_gnutls_handshake): Return an error if we're not
supposed to be handshaking.
Reported by Paul Eggert <eggert@cs.ucla.edu>.
2011-04-26 07:59:12 -05:00
Daniel Colascione
0438ce915d Implement debug-on-event 2011-04-26 04:26:05 -07:00
Paul Eggert
847ab9d19c Add bug numbers. 2011-04-26 00:52:52 -07:00
Paul Eggert
c892615246 * gnutls.c (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0. 2011-04-26 00:35:23 -07:00
Paul Eggert
8d4c395517 * gnutls.c: Remove unused local. 2011-04-26 00:26:02 -07:00
Paul Eggert
7754e1516f * gnutls.c (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *. 2011-04-26 00:23:56 -07:00
Paul Eggert
0c8c7e5cff * gnutls.c (emacs_gnutls_handle_error): Remove unused local. 2011-04-26 00:20:51 -07:00
Paul Eggert
080e5a8d90 * gnutls.c (emacs_gnutls_handshake): Don't return a garbage value.
Expect the caller to check whether GNUTLS_STAGE_HANDSHAKE_CANDO <=
proc->gnutls_initstage, if the check is needed.  The check isn't
needed for one caller, Fgnutls_boot.
(emacs_gnutls_read): Do that check.  This is the other caller.
2011-04-26 00:12:16 -07:00
Paul Eggert
671875dac1 Merge from mainline. 2011-04-25 23:17:52 -07:00
Paul Eggert
f904488ff4 Combine changelog entries. 2011-04-25 14:50:24 -07:00
Paul Eggert
c4cfe310db * lisp.h (XVECTORLIKE_HEADER_SIZE): Remove. The only use is now expanded. 2011-04-25 14:38:32 -07:00
Dan Nicolaescu
f2d3ba6f13 Convert some function definitions to standard C.
* src/alloc.c (check_sblock, check_string_bytes)
(check_string_free_list): Convert to standard C.
2011-04-25 14:36:06 -07:00
Paul Eggert
77b37c0557 * lisp.h: (XVECTOR_SIZE): Remove. All uses replaced with ASIZE.
(ASIZE): Now contains previous implementation of XVECTOR_SIZE
instead of invoking XVECTOR_SIZE.
2011-04-25 14:34:39 -07:00
Paul Eggert
b102ceb110 * lisp.h: Say "vectorlike header" rather than "vector header.
(struct vectorlike_header): Rename from struct vector_header.
(XVECTORLIKE_HEADER_SIZE): Renamed from XVECTOR_HEADER_SIZE.
All uses changed.
2011-04-25 12:40:22 -07:00
Ted Zlatanov
42ce4c631e Fix typo in GnuTLS W32 support.
* w32.c (emacs_gnutls_push): Fix typo.
2011-04-25 07:48:24 -05:00
Eli Zaretskii
fb11d64dc8 Avoid compilation warnings in gnutls.c on 64-bit hosts.
src/gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
 "cast to pointer from integer of different size".
2011-04-25 13:42:57 +03:00
Eli Zaretskii
825cd63ca9 Improve doprnt and its use in verror. (Bug#8545)
src/doprnt.c (doprnt): Document the set of format control sequences
 supported by the function.  Use SAFE_ALLOCA instead of always
 using `alloca'.
 src/eval.c (verror): Don't limit the buffer size at size_max-1, that
 is one byte too soon.  Don't use xrealloc; instead xfree and
 xmalloc anew.
2011-04-25 11:04:22 +03:00
Paul Eggert
179dade402 Fix minor typos in previous change. 2011-04-25 00:33:57 -07:00
Paul Eggert
eab3844f96 lisp.h: Fix a problem with aliasing and vector headers.
GCC 4.6.0 optimizes based on type-based alias analysis.  For
example, if b is of type struct buffer * and v of type struct
Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
!= &v->size, and therefore "v->size = 1; b->size = 2; return
v->size;" must therefore return 1.  This assumption is incorrect
for Emacs, since it type-puns struct Lisp_Vector * with many other
types.  To fix this problem, this patch adds a new type struct
vector_header that documents the constraints on layout of vectors
and pseudovectors, and helps optimizing compilers not get fooled
by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
* lisp.h (XVECTOR_SIZE): New convenience macro.  All previous uses of
XVECTOR (foo)->size replaced to use this macro, to avoid the hassle
of writing XVECTOR (foo)->header.size.
(XVECTOR_HEADER_SIZE): New macro, for use in XSETPSEUDOVECTOR.
(XSETTYPED_PVECTYPE): New macro, specifying the name of the size
member.
(XSETPVECTYPE): Rewrite in terms of new macro.
(XSETPVECTYPESIZE): New macro, specifying both type and size.
This is a bit clearer, and further avoids the possibility of
undesirable aliasing.
(XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
(XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR
and XVECTOR_HEADER_SIZE.
(XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
since Lisp_Subr is a special case (no "next" field).
(ASIZE): Rewrite in terms of XVECTOR_SIZE.
(struct vector_header): New type.
(TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
object, to help avoid aliasing.
(PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
(SUBRP): Likewise, since Lisp_Subr is a special case.
* lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
(struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
(struct Lisp_Hash_Table): Combine first two members into a single
struct vector_header member.  All uses of "size" and "next" members
changed to be "header.size" and "header.next".
* buffer.h (struct buffer): Likewise.
* font.h (struct font_spec, struct font_entity, struct font): Likewise.
* frame.h (struct frame): Likewise.
* process.h (struct Lisp_Process): Likewise.
* termhooks.h (struct terminal): Likewise.
* window.c (struct save_window_data, struct saved_window): Likewise.
* window.h (struct window): Likewise.
* alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
* buffer.c (init_buffer_once): Likewise.
* lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
special case.
* process.c (Fformat_network_address): Use local var for size,
for brevity.
2011-04-25 00:14:46 -07:00
Ted Zlatanov
e061a11b5a Add GnuTLS support for W32 and certificate and hostname verification in GnuTLS.
* src/gnutls.c: Renamed global_initialized to
gnutls_global_initialized.  Added internals for the
:verify-hostname-error, :verify-error, and :verify-flags
parameters of `gnutls-boot' and documented those parameters in the
docstring.  Start callback support.
(emacs_gnutls_handshake): Add Woe32 support. Retry handshake
unless a fatal error occured. Call gnutls_alert_send_appropriate
on error. Return error code.
(emacs_gnutls_write): Call emacs_gnutls_handle_error.
(emacs_gnutls_read): Likewise.
(Fgnutls_boot): Return handshake error code.
(emacs_gnutls_handle_error): New function.
(wsaerror_to_errno): Likewise.

* src/gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
callbacks stage.

* src/w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
(emacs_gnutls_push): Likewise.

* src/w32.h (emacs_gnutls_pull): Add prototype.
(emacs_gnutls_push): Likewise.
2011-04-24 20:30:51 -05:00
Eli Zaretskii
eb35682e38 Minor cleanup in src/xdisp.c.
src/xdisp.c (handle_single_display_spec): Rename the
 display_replaced_before_p argument into display_replaced_p, to
 make it consistent with the commentary.  Fix typos in the
 commentary.
2011-04-24 19:59:37 +03:00
Eli Zaretskii
e2ad650c71 Minor cleanup in src/textprop.c.
src/textprop.c (syms_of_textprop): Remove dead code.
 (copy_text_properties): Delete obsolete commentary about an
 interface that was deleted long ago.  Fix typos in the description
 of arguments.
2011-04-24 19:28:57 +03:00