$(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 \
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
"- -------- ----- ----- "
"- ---------- -------- ----------- -------- ")
(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))
;; ----------------------------------------------------------------------------
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