From: Miles Bader Date: Wed, 17 May 2006 07:46:49 +0000 (+0000) Subject: Merge from emacs--devo--0 X-Git-Tag: emacs-pretest-23.0.90~8295^2~951 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4ed925c6687e25373e8d75e68b9072f1170d571a;p=emacs.git Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 274-284) - Update from CVS - Update etc/MORE.STUFF. - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 101) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-62 --- 4ed925c6687e25373e8d75e68b9072f1170d571a diff --cc lib-src/makefile.w32-in index 10b7c07f5c2,6aa15964f45..c145e47f197 --- a/lib-src/makefile.w32-in +++ b/lib-src/makefile.w32-in @@@ -192,6 -192,17 +192,7 @@@ lisp1= $(lispsource)international/mule-conf.el \ $(lispsource)international/mule-cmds.elc \ $(lispsource)international/characters.elc \ - $(lispsource)international/ucs-tables.elc \ - $(lispsource)international/utf-8.elc \ - $(lispsource)international/utf-16.elc \ - $(lispsource)international/latin-1.el \ - $(lispsource)international/latin-2.el \ - $(lispsource)international/latin-3.el \ - $(lispsource)international/latin-4.el \ - $(lispsource)international/latin-5.el \ - $(lispsource)international/latin-8.el \ - $(lispsource)international/latin-9.el \ + $(lispsource)fringe.elc \ $(lispsource)image.elc \ $(lispsource)international/fontset.elc \ $(lispsource)dnd.elc \ diff --cc lisp/arc-mode.el index 9da83f1a635,0b016b981e2..5b08182b7ee --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@@ -1519,11 -1501,16 +1523,15 @@@ This doesn't recover lost files, it jus files (cons (vector prname ifnname fiddle mode (1- p)) files)) (cond ((= hdrlvl 1) - (setq p (+ p hsize 2 csize))) + ;; p needs to stay an integer, since we use it in goto-char + ;; above. Passing through `round' limits the compressed size + ;; to most-positive-fixnum, but if the compressed size exceeds + ;; that, we cannot visit the archive anyway. + (setq p (+ p hsize 2 (round csize)))) ((or (= hdrlvl 2) (= hdrlvl 0)) - (setq p (+ p thsize 2 csize)))) + (setq p (+ p thsize 2 (round csize))))) )) (goto-char (point-min)) - (set-buffer-multibyte default-enable-multibyte-characters) (let ((dash (concat (if archive-alternate-display "- -------- ----- ----- " "- ---------- -------- ----------- -------- ") diff --cc lisp/desktop.el index cfde6237cd9,8e9d09d4d32..69815117bc2 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@@ -763,45 -763,42 +763,42 @@@ See also `desktop-base-file-name'. (setq locals (cdr locals))) ll))) (buffer-list))) - (eager desktop-restore-eager) - (buf (get-buffer-create "*desktop*"))) - (set-buffer buf) - (erase-buffer) - - (insert - ";; -*- mode: emacs-lisp; coding: utf-8-emacs; -*-\n" - desktop-header - ";; Created " (current-time-string) "\n" - ";; Desktop file format version " desktop-file-version "\n" - ";; Emacs version " emacs-version "\n\n" - ";; Global section:\n") - (mapc (function desktop-outvar) desktop-globals-to-save) - (if (memq 'kill-ring desktop-globals-to-save) - (insert - "(setq kill-ring-yank-pointer (nthcdr " - (int-to-string (- (length kill-ring) (length kill-ring-yank-pointer))) - " kill-ring))\n")) - - (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n") - (mapc #'(lambda (l) - (when (apply 'desktop-save-buffer-p l) - (insert "(" - (if (or (not (integerp eager)) - (unless (zerop eager) - (setq eager (1- eager)) - t)) - "desktop-create-buffer" - "desktop-append-buffer-args") - " " - desktop-file-version) - (mapc #'(lambda (e) - (insert "\n " (desktop-value-to-string e))) - l) - (insert ")\n\n"))) - info) - (setq default-directory dirname) - (let ((coding-system-for-write 'utf-8-emacs)) - (write-region (point-min) (point-max) filename nil 'nomessage)))) + (eager desktop-restore-eager)) + (with-temp-buffer - (insert - ";; -*- mode: emacs-lisp; coding: emacs-mule; -*-\n" - desktop-header - ";; Created " (current-time-string) "\n" - ";; Desktop file format version " desktop-file-version "\n" - ";; Emacs version " emacs-version "\n\n" - ";; Global section:\n") - (mapc (function desktop-outvar) desktop-globals-to-save) - (if (memq 'kill-ring desktop-globals-to-save) - (insert - "(setq kill-ring-yank-pointer (nthcdr " - (int-to-string (- (length kill-ring) (length kill-ring-yank-pointer))) - " kill-ring))\n")) - - (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n") - (mapc #'(lambda (l) - (when (apply 'desktop-save-buffer-p l) - (insert "(" - (if (or (not (integerp eager)) - (unless (zerop eager) - (setq eager (1- eager)) - t)) - "desktop-create-buffer" - "desktop-append-buffer-args") - " " - desktop-file-version) - (mapc #'(lambda (e) - (insert "\n " (desktop-value-to-string e))) - l) - (insert ")\n\n"))) - info) - (setq default-directory dirname) - (let ((coding-system-for-write 'emacs-mule)) - (write-region (point-min) (point-max) filename nil 'nomessage))))) ++ (insert ++ ";; -*- mode: emacs-lisp; coding: utf-8-emacs; -*-\n" ++ desktop-header ++ ";; Created " (current-time-string) "\n" ++ ";; Desktop file format version " desktop-file-version "\n" ++ ";; Emacs version " emacs-version "\n\n" ++ ";; Global section:\n") ++ (mapc (function desktop-outvar) desktop-globals-to-save) ++ (if (memq 'kill-ring desktop-globals-to-save) ++ (insert ++ "(setq kill-ring-yank-pointer (nthcdr " ++ (int-to-string (- (length kill-ring) (length kill-ring-yank-pointer))) ++ " kill-ring))\n")) ++ ++ (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n") ++ (mapc #'(lambda (l) ++ (when (apply 'desktop-save-buffer-p l) ++ (insert "(" ++ (if (or (not (integerp eager)) ++ (unless (zerop eager) ++ (setq eager (1- eager)) ++ t)) ++ "desktop-create-buffer" ++ "desktop-append-buffer-args") ++ " " ++ desktop-file-version) ++ (mapc #'(lambda (e) ++ (insert "\n " (desktop-value-to-string e))) ++ l) ++ (insert ")\n\n"))) ++ info) ++ (setq default-directory dirname) ++ (let ((coding-system-for-write 'utf-8-emacs)) ++ (write-region (point-min) (point-max) filename nil 'nomessage))))) (setq desktop-dirname dirname)) ;; ---------------------------------------------------------------------------- diff --cc src/fileio.c index 066668d107f,12ce3c411e8..84b32f8dda9 --- a/src/fileio.c +++ b/src/fileio.c @@@ -4278,43 -4279,58 +4278,38 @@@ actually used. */ how_much += this; - if (CODING_MAY_REQUIRE_DECODING (&coding)) - { - int require, result; - - this += unprocessed; - - /* If we are using more space than estimated, - make CONVERSION_BUFFER bigger. */ - require = decoding_buffer_size (&coding, this); - if (inserted + require + 2 * (total - how_much) > bufsize) - { - bufsize = inserted + require + 2 * (total - how_much); - conversion_buffer = (unsigned char *) xrealloc (conversion_buffer, bufsize); - } - - /* Convert this batch with results in CONVERSION_BUFFER. */ - if (how_much >= total) /* This is the last block. */ - coding.mode |= CODING_MODE_LAST_BLOCK; - if (coding.composing != COMPOSITION_DISABLED) - coding_allocate_composition_data (&coding, BEGV); - result = decode_coding (&coding, read_buf, - conversion_buffer + inserted, - this, bufsize - inserted); - - /* Save for next iteration whatever we didn't convert. */ - unprocessed = this - coding.consumed; - bcopy (read_buf + coding.consumed, read_buf, unprocessed); - if (!NILP (current_buffer->enable_multibyte_characters)) - this = coding.produced; - else - this = str_as_unibyte (conversion_buffer + inserted, - coding.produced); - } - - inserted += this; + BUF_SET_PT (XBUFFER (conversion_buffer), + BUF_Z (XBUFFER (conversion_buffer))); + decode_coding_c_string (&coding, read_buf, unprocessed + this, + conversion_buffer); + unprocessed = coding.carryover_bytes; + if (coding.carryover_bytes > 0) + bcopy (coding.carryover, read_buf, unprocessed); } + UNGCPRO; + emacs_close (fd); - /* At this point, INSERTED is how many characters (i.e. bytes) - are present in CONVERSION_BUFFER. - HOW_MUCH should equal TOTAL, - or should be <= 0 if we couldn't read the file. */ + /* At this point, HOW_MUCH should equal TOTAL, or should be <= 0 + if we couldn't read the file. */ if (how_much < 0) - { - if (how_much == -1) - error ("IO error reading %s: %s", - SDATA (orig_filename), emacs_strerror (errno)); - else if (how_much == -2) - error ("maximum buffer size exceeded"); - } ++ error ("IO error reading %s: %s", ++ SDATA (orig_filename), emacs_strerror (errno)); + + if (unprocessed > 0) { - xfree (conversion_buffer); - coding_free_composition_data (&coding); - error ("IO error reading %s: %s", - SDATA (orig_filename), emacs_strerror (errno)); + coding.mode |= CODING_MODE_LAST_BLOCK; + decode_coding_c_string (&coding, read_buf, unprocessed, + conversion_buffer); + coding.mode &= ~CODING_MODE_LAST_BLOCK; } - /* Compare the beginning of the converted file - with the buffer text. */ + decoded = BUF_BEG_ADDR (XBUFFER (conversion_buffer)); + inserted = (BUF_Z_BYTE (XBUFFER (conversion_buffer)) + - BUF_BEG_BYTE (XBUFFER (conversion_buffer))); + + /* Compare the beginning of the converted string with the buffer + text. */ bufpos = 0; while (bufpos < inserted && same_at_start < same_at_end