# HG changeset patch # User Katsumi Yamaoka # Date 1265463365 0 # Node ID 8af8a20eebf0099d4d25b26365854159f56718b7 # Parent 91a3b0edffccf3663f8489e3114054d0e5f07f34# Parent 0afb47d42c748058bcf94508cdc0efcd83aee9c0 Merge from mainline. diff -r 91a3b0edffcc -r 8af8a20eebf0 lisp/ChangeLog --- a/lisp/ChangeLog Sat Feb 06 04:13:19 2010 +0000 +++ b/lisp/ChangeLog Sat Feb 06 13:36:05 2010 +0000 @@ -1,3 +1,12 @@ +2010-02-06 Chong Yidong + + * progmodes/cc-mode.el (c-common-init): Bind temporary variables + beg and end before calling c-get-state-before-change-functions. + +2010-02-06 Dan Nicolaescu + + * vc-bzr.el (vc-bzr-dir-extra-headers): Disable the pending merges header. + 2010-02-05 Juri Linkov * doc-view.el (doc-view-mode): diff -r 91a3b0edffcc -r 8af8a20eebf0 lisp/progmodes/cc-mode.el --- a/lisp/progmodes/cc-mode.el Sat Feb 06 04:13:19 2010 +0000 +++ b/lisp/progmodes/cc-mode.el Sat Feb 06 13:36:05 2010 +0000 @@ -642,9 +642,11 @@ (widen) (save-excursion (if c-get-state-before-change-functions - (mapc (lambda (fn) - (funcall fn beg end)) - c-get-state-before-change-functions)) + (let ((beg (point-min)) + (end (point-max))) + (mapc (lambda (fn) + (funcall fn beg end)) + c-get-state-before-change-functions))) (if c-before-font-lock-function (funcall c-before-font-lock-function (point-min) (point-max) (- (point-max) (point-min)))))) diff -r 91a3b0edffcc -r 8af8a20eebf0 lisp/vc-bzr.el --- a/lisp/vc-bzr.el Sat Feb 06 04:13:19 2010 +0000 +++ b/lisp/vc-bzr.el Sat Feb 06 13:36:05 2010 +0000 @@ -796,8 +796,12 @@ (shelve-help-echo "Use M-x vc-bzr-shelve to create shelves") (root-dir (vc-bzr-root dir)) (pending-merge - (file-exists-p - (expand-file-name ".bzr/checkout/merge-hashes" root-dir))) + ;; FIXME: looking for .bzr/checkout/merge-hashes is not a + ;; reliable method to detect pending merges, disable this + ;; until a proper solution is implemented. + (and nil + (file-exists-p + (expand-file-name ".bzr/checkout/merge-hashes" root-dir)))) (pending-merge-help-echo (format "A merge has been performed.\nA commit from the top-level directory (%s)\nis required before being able to check in anything else" root-dir)) (light-checkout diff -r 91a3b0edffcc -r 8af8a20eebf0 src/ChangeLog --- a/src/ChangeLog Sat Feb 06 04:13:19 2010 +0000 +++ b/src/ChangeLog Sat Feb 06 13:36:05 2010 +0000 @@ -1,3 +1,9 @@ +2010-02-06 Chong Yidong + + * charset.c (load_charset_map_from_file) + (load_charset_map_from_vector): Fix last change to use SAFE_ALLOCA + instead of xmalloc (Bug#5526). Suggested by Vivek Dasmohapatra. + 2010-02-05 Chong Yidong * charset.c (load_charset_map_from_file): Allocate large diff -r 91a3b0edffcc -r 8af8a20eebf0 src/charset.c --- a/src/charset.c Sat Feb 06 04:13:19 2010 +0000 +++ b/src/charset.c Sat Feb 06 13:36:05 2010 +0000 @@ -512,12 +512,13 @@ int eof; Lisp_Object suffixes; struct charset_map_entries *head, *entries; - int n_entries; - int count = SPECPDL_INDEX (); + int n_entries, count; + USE_SAFE_ALLOCA; suffixes = Fcons (build_string (".map"), Fcons (build_string (".TXT"), Qnil)); + count = SPECPDL_INDEX (); specbind (Qfile_name_handler_alist, Qnil); fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil); unbind_to (count, Qnil); @@ -525,8 +526,12 @@ || ! (fp = fdopen (fd, "r"))) error ("Failure in loading charset map: %S", SDATA (mapfile)); - head = entries = ((struct charset_map_entries *) - xmalloc (sizeof (struct charset_map_entries))); + /* Use SAFE_ALLOCA instead of alloca, as `charset_map_entries' is + large (larger than MAX_ALLOCA). */ + SAFE_ALLOCA (head, struct charset_map_entries *, + sizeof (struct charset_map_entries)); + entries = head; + n_entries = 0; eof = 0; while (1) @@ -549,8 +554,8 @@ if (n_entries > 0 && (n_entries % 0x10000) == 0) { - entries->next = ((struct charset_map_entries *) - alloca (sizeof (struct charset_map_entries))); + SAFE_ALLOCA (entries->next, struct charset_map_entries *, + sizeof (struct charset_map_entries)); entries = entries->next; } idx = n_entries % 0x10000; @@ -563,7 +568,7 @@ close (fd); load_charset_map (charset, head, n_entries, control_flag); - xfree (head); + SAFE_FREE (); } static void @@ -578,6 +583,7 @@ int n_entries; int len = ASIZE (vec); int i; + USE_SAFE_ALLOCA; if (len % 2 == 1) { @@ -585,8 +591,12 @@ return; } - head = entries = ((struct charset_map_entries *) - alloca (sizeof (struct charset_map_entries))); + /* Use SAFE_ALLOCA instead of alloca, as `charset_map_entries' is + large (larger than MAX_ALLOCA). */ + SAFE_ALLOCA (head, struct charset_map_entries *, + sizeof (struct charset_map_entries)); + entries = head; + n_entries = 0; for (i = 0; i < len; i += 2) { @@ -619,8 +629,8 @@ if (n_entries > 0 && (n_entries % 0x10000) == 0) { - entries->next = ((struct charset_map_entries *) - alloca (sizeof (struct charset_map_entries))); + SAFE_ALLOCA (entries->next, struct charset_map_entries *, + sizeof (struct charset_map_entries)); entries = entries->next; } idx = n_entries % 0x10000; @@ -631,6 +641,7 @@ } load_charset_map (charset, head, n_entries, control_flag); + SAFE_FREE (); }