commit 4fbfd7ad53810153371a588a9bd1a69230f60dd5 (HEAD, refs/remotes/origin/master) Author: Lars Brinkhoff Date: Sat Apr 8 07:07:32 2017 +0200 Fix circular read syntax for records. * lread.c (substitute_object_recurse): Work with records. * lread-tests.el (lread-record-1): New test. diff --git a/src/lread.c b/src/lread.c index 6de9fe6e08..513f63e431 100644 --- a/src/lread.c +++ b/src/lread.c @@ -3400,7 +3400,8 @@ substitute_object_recurse (Lisp_Object object, Lisp_Object placeholder, Lisp_Obj if (BOOL_VECTOR_P (subtree)) return subtree; /* No sub-objects anyway. */ else if (CHAR_TABLE_P (subtree) || SUB_CHAR_TABLE_P (subtree) - || COMPILEDP (subtree) || HASH_TABLE_P (subtree)) + || COMPILEDP (subtree) || HASH_TABLE_P (subtree) + || RECORDP (subtree)) length = ASIZE (subtree) & PSEUDOVECTOR_SIZE_MASK; else if (VECTORP (subtree)) length = ASIZE (subtree); diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el index a783afd312..27f967f045 100644 --- a/test/src/lread-tests.el +++ b/test/src/lread-tests.el @@ -112,4 +112,8 @@ (should-error (read "#24r") :type 'invalid-read-syntax) (should-error (read "#") :type 'invalid-read-syntax)) +(ert-deftest lread-record-1 () + (should (equal '(#s(foo) #s(foo)) + (read "(#1=#s(foo) #1#)")))) + ;;; lread-tests.el ends here commit a2b3fea957440b8358d3632a4a05e41dee964b5d Author: Paul Eggert Date: Fri Apr 7 18:54:40 2017 -0700 Deprecate copy-record in favor of copy-sequence Since copy-sequence seems to be needed anyway for records, have it work on records, and remove copy-record as being superfluous. * doc/lispref/records.texi (Records, Record Functions): * lisp/emacs-lisp/cl-macs.el (cl-defstruct): * lisp/emacs-lisp/eieio.el (make-instance, clone): * test/src/alloc-tests.el (record-3): Use copy-sequence, not copy-record, to copy records. * doc/lispref/sequences.texi (Sequence Functions) (Array Functions): Document that aref and copy-sequence work on records. * etc/NEWS: Omit copy-record. * src/alloc.c (Fcopy_record): Remove. * src/data.c (Faref): Document that arg can be a record. * src/fns.c (Fcopy_sequence): Copy records, too. diff --git a/doc/lispref/records.texi b/doc/lispref/records.texi index 2533a8a4ca..7cc36f1406 100644 --- a/doc/lispref/records.texi +++ b/doc/lispref/records.texi @@ -13,8 +13,9 @@ underlying representation of @code{cl-defstruct} and @code{defclass} instances. Internally, a record object is much like a vector; its slots can be -accessed using @code{aref}. However, the first slot is used to hold -its type as returned by @code{type-of}. Also, in the current +accessed using @code{aref} and it can be copied using +@code{copy-sequence}. However, the first slot is used to hold its +type as returned by @code{type-of}. Also, in the current implementation records can have at most 4096 slots, whereas vectors can be much larger. Like arrays, records use zero-origin indexing: the first slot has index 0. @@ -74,38 +75,6 @@ This function returns a new record with type @var{type} and @end example @end defun -@defun copy-record record -This function returns a shallow copy of @var{record}. The copy is the -same type as the original record, and it has the same slots in the -same order. - - Storing a new slot into the copy does not affect the original -@var{record}, and vice versa. However, the slots of the new record -are not copies; they are identical (@code{eq}) to the slots of the -original. Therefore, changes made within these slots, as found via -the copied record, are also visible in the original record. - -@example -@group -(setq x (record 'foo 1 2)) - @result{} #s(foo 1 2) -@end group -@group -(setq y (copy-record x)) - @result{} #s(foo 1 2) -@end group - -@group -(eq x y) - @result{} nil -@end group -@group -(equal x y) - @result{} t -@end group -@end example -@end defun - @node Backward Compatibility @section Backward Compatibility diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index 2c88ee38cb..93e8fa8a5f 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -151,20 +151,19 @@ This function generalizes @code{aref} (@pxref{Array Functions}) and @code{nth} (@pxref{Definition of nth}). @end defun -@defun copy-sequence sequence +@defun copy-sequence seqr @cindex copying sequences -This function returns a copy of @var{sequence}. The copy is the same -type of object as the original sequence, and it has the same elements -in the same order. +This function returns a copy of @var{seqr}, which should be either a +sequence or a record. The copy is the same type of object as the +original, and it has the same elements in the same order. Storing a new element into the copy does not affect the original -@var{sequence}, and vice versa. However, the elements of the new -sequence are not copies; they are identical (@code{eq}) to the elements +@var{seqr}, and vice versa. However, the elements of the copy +are not copies; they are identical (@code{eq}) to the elements of the original. Therefore, changes made within these elements, as -found via the copied sequence, are also visible in the original -sequence. +found via the copy, are also visible in the original. -If the sequence is a string with text properties, the property list in +If the argument is a string with text properties, the property list in the copy is itself a copy, not shared with the original's property list. However, the actual values of the properties are shared. @xref{Text Properties}. @@ -1148,10 +1147,10 @@ vector, a string, a bool-vector or a char-table). @end example @end defun -@defun aref array index +@defun aref arr index @cindex array elements -This function returns the @var{index}th element of @var{array}. The -first element is at index zero. +This function returns the @var{index}th element of the array or record +@var{arr}. The first element is at index zero. @example @group diff --git a/etc/NEWS b/etc/NEWS index aaca229d5c..e351abc159 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -863,9 +863,9 @@ instead of its first. +++ ** Emacs now supports records for user-defined types, via the new -functions 'copy-record', 'make-record', 'record', and 'recordp'. -Records are now used internally to represent cl-defstruct and defclass -instances, for example. +functions 'make-record', 'record', and 'recordp'. Records are now +used internally to represent cl-defstruct and defclass instances, for +example. +++ ** 'save-some-buffers' now uses 'save-some-buffers-default-predicate' diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 25c9f99992..ecb89fd51d 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2808,8 +2808,7 @@ non-nil value, that slot cannot be set via `setf'. (setq slots (nreverse slots) defaults (nreverse defaults)) (and copier - (push `(defalias ',copier - ,(if (null type) '#'copy-record '#'copy-sequence)) + (push `(defalias ',copier #'copy-sequence) forms)) (if constructor (push (list constructor diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index 858b2fdaa0..e21d46e528 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -699,8 +699,8 @@ SLOTS are the initialization slots used by `initialize-instance'. This static method is called when an object is constructed. It allocates the vector used to represent an EIEIO object, and then calls `initialize-instance' on that object." - (let* ((new-object (copy-record (eieio--class-default-object-cache - (eieio--class-object class))))) + (let* ((new-object (copy-sequence (eieio--class-default-object-cache + (eieio--class-object class))))) (if (and slots (let ((x (car slots))) (or (stringp x) (null x)))) @@ -804,7 +804,7 @@ first and modify the returned object.") (cl-defmethod clone ((obj eieio-default-superclass) &rest params) "Make a copy of OBJ, and then apply PARAMS." - (let ((nobj (copy-record obj))) + (let ((nobj (copy-sequence obj))) (if (stringp (car params)) (funcall (if eieio-backward-compatibility #'ignore #'message) "Obsolete name %S passed to clone" (pop params))) diff --git a/src/alloc.c b/src/alloc.c index fad84b8a0b..88a1a1ed66 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3440,19 +3440,6 @@ usage: (record TYPE &rest SLOTS) */) } -DEFUN ("copy-record", Fcopy_record, Scopy_record, 1, 1, 0, - doc: /* Return a new record that is a shallow copy of the argument RECORD. */) - (Lisp_Object record) -{ - CHECK_RECORD (record); - ptrdiff_t size = ASIZE (record) & PSEUDOVECTOR_SIZE_MASK; - struct Lisp_Vector *new = allocate_record (size); - memcpy (new->contents, XVECTOR (record)->contents, - size * sizeof (Lisp_Object)); - return make_lisp_ptr (new, Lisp_Vectorlike); -} - - DEFUN ("make-vector", Fmake_vector, Smake_vector, 2, 2, 0, doc: /* Return a newly created vector of length LENGTH, with each element being INIT. See also the function `vector'. */) @@ -7523,7 +7510,6 @@ The time is in seconds as a floating point value. */); defsubr (&Slist); defsubr (&Svector); defsubr (&Srecord); - defsubr (&Scopy_record); defsubr (&Sbool_vector); defsubr (&Smake_byte_code); defsubr (&Smake_list); diff --git a/src/data.c b/src/data.c index 3ffca54658..903e809d23 100644 --- a/src/data.c +++ b/src/data.c @@ -2266,8 +2266,8 @@ function chain of symbols. */) /* Extract and set vector and string elements. */ DEFUN ("aref", Faref, Saref, 2, 2, 0, - doc: /* Return the element of ARRAY at index IDX. -ARRAY may be a vector, a string, a char-table, a bool-vector, + doc: /* Return the element of ARG at index IDX. +ARG may be a vector, a string, a char-table, a bool-vector, a record, or a byte-code object. IDX starts at 0. */) (register Lisp_Object array, Lisp_Object idx) { diff --git a/src/fns.c b/src/fns.c index 47da5f8b4b..2f07c2ccfb 100644 --- a/src/fns.c +++ b/src/fns.c @@ -475,13 +475,19 @@ usage: (vconcat &rest SEQUENCES) */) DEFUN ("copy-sequence", Fcopy_sequence, Scopy_sequence, 1, 1, 0, - doc: /* Return a copy of a list, vector, string or char-table. -The elements of a list or vector are not copied; they are shared -with the original. */) + doc: /* Return a copy of a list, vector, string, char-table or record. +The elements of a list, vector or record are not copied; they are +shared with the original. */) (Lisp_Object arg) { if (NILP (arg)) return arg; + if (RECORDP (arg)) + { + ptrdiff_t size = ASIZE (arg) & PSEUDOVECTOR_SIZE_MASK; + return Frecord (size, XVECTOR (arg)->contents); + } + if (CHAR_TABLE_P (arg)) { return copy_char_table (arg); diff --git a/test/src/alloc-tests.el b/test/src/alloc-tests.el index 8b4ef8ce7d..1cf1fc3be5 100644 --- a/test/src/alloc-tests.el +++ b/test/src/alloc-tests.el @@ -47,7 +47,7 @@ (ert-deftest record-3 () (let* ((x (record 'foo 1 2 3)) - (y (copy-record x))) + (y (copy-sequence x))) (should-not (eq x y)) (dotimes (i 4) (should (eql (aref x i) (aref y i)))))) commit a614cd416c5dd71702428a008992589395a722fc Author: Paul Eggert Date: Fri Apr 7 18:54:40 2017 -0700 Fix dependency checking in src/Makefile.in * src/Makefile.in (AUTO_DEPEND, DEPDIR, DEPFLAGS): Move includes of dependency files until after ALLOBJS is defined, since it uses ALLOBJS. Otherwise, some dependencies will be missed. diff --git a/src/Makefile.in b/src/Makefile.in index 5a3d0bd044..bed53f8f4b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -347,16 +347,6 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -AUTO_DEPEND = @AUTO_DEPEND@ -DEPDIR = deps -ifeq ($(AUTO_DEPEND),yes) - DEPFLAGS = -MMD -MF $(DEPDIR)/$*.d -MP - -include $(ALLOBJS:%.o=$(DEPDIR)/%.d) -else - DEPFLAGS = - include $(srcdir)/deps.mk -endif - # Flags that might be in WARN_CFLAGS but are not valid for Objective C. NON_OBJC_CFLAGS = -Wignored-attributes -Wignored-qualifiers -Wopenmp-simd @@ -445,6 +435,16 @@ otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \ FIRSTFILE_OBJ=@FIRSTFILE_OBJ@ ALLOBJS = $(FIRSTFILE_OBJ) $(VMLIMIT_OBJ) $(obj) $(otherobj) +AUTO_DEPEND = @AUTO_DEPEND@ +DEPDIR = deps +ifeq ($(AUTO_DEPEND),yes) + DEPFLAGS = -MMD -MF $(DEPDIR)/$*.d -MP + -include $(ALLOBJS:%.o=$(DEPDIR)/%.d) +else + DEPFLAGS = + include $(srcdir)/deps.mk +endif + all: emacs$(EXEEXT) $(OTHER_FILES) .PHONY: all commit 6fbbfc77d4071cbc3df86d14f9d21c1fd7a09683 Author: Paul Eggert Date: Fri Apr 7 18:54:39 2017 -0700 Minor tuneup of write-region change * src/fileio.c (write_region): Use SCHARS, not Flength, on a value known to be a string. diff --git a/src/fileio.c b/src/fileio.c index fc853f2667..7f65cf5aae 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5156,9 +5156,9 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, : ! NILP (append) ? "Added to `%s' (%d characters)" : "Wrote `%s' (%d characters)"); - CALLN (Fmessage, format, visit_file, - (STRINGP (start) ? Flength (start) - : make_number (XINT (end) - XINT (start)))); + EMACS_INT nchars = (STRINGP (start) ? SCHARS (start) + : XINT (end) - XINT (start)); + CALLN (Fmessage, format, visit_file, make_number (nchars)); } return Qnil; } commit c323659344ba4db7a0b074b2e29d0a5f33d5eb80 Author: Noam Postavsky Date: Fri Apr 7 19:54:11 2017 -0400 Adjust write-region so file name is at the beginning again * lisp/epa-file.el (epa-file-write-region): * lisp/gnus/mm-util.el (mm-append-to-file): * lisp/jka-compr.el (jka-compr-write-region): * lisp/net/ange-ftp.el (ange-ftp-write-region): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region): * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): * src/fileio.c (write_region): Put file name at the beginning and move number of characters to the end of the message. diff --git a/lisp/epa-file.el b/lisp/epa-file.el index 2e06c8374f..64e00e0aba 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -290,11 +290,10 @@ If no one is selected, symmetric encryption will be performed. " (if (or (eq visit t) (eq visit nil) (stringp visit)) - (message "Wrote %d characters to `%s'" + (message "Wrote `%s' (%d characters)" buffer-file-name (cond ((null start) (buffer-size)) ((stringp start) (length start)) - (t (- end start))) - buffer-file-name)))) + (t (- end start))))))) (put 'write-region 'epa-file 'epa-file-write-region) (defun epa-file-select-keys () diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index f0dc803edd..f4e79e5373 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -736,7 +736,7 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'." inhibit-file-name-handlers) inhibit-file-name-handlers))) (write-region start end filename t 'no-message) - (message "Appended %d characters to `%s'" (- end start) filename))) + (message "Appended to `%s' (%d characters)" filename (- end start)))) (defun mm-write-region (start end filename &optional append visit lockname coding-system inhibit) diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el index a5e24a6f9a..e4f7348c81 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el @@ -357,11 +357,10 @@ There should be no more than seven characters after the final `/'." (and (or (eq visit t) (eq visit nil) (stringp visit)) - (message "Wrote %d characters to `%s'" + (message "Wrote `%s' (%d characters)" visit-file (cond ((null start) (buffer-size)) ((stringp start) (length start)) - (t (- end start))) - visit-file)) + (t (- end start))))) ;; ensure `last-coding-system-used' has an appropriate value (setq last-coding-system-used coding-system-used) diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 6e84269e30..cd0ae8d420 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -3284,11 +3284,10 @@ system TYPE.") (set-buffer-modified-p nil))) ;; ensure `last-coding-system-used' has an appropriate value (setq last-coding-system-used coding-system-used) - (ange-ftp-message "Wrote %d characters to `%s'" + (ange-ftp-message "Wrote `%s' (%d characters)" abbr (cond ((null start) (buffer-size)) ((stringp start) (length start)) - (t (- end start))) - abbr) + (t (- end start)))) (ange-ftp-add-file-entry filename)) (ange-ftp-real-write-region start end filename append visit)))) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index b7477271d7..593be33e83 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1223,11 +1223,10 @@ file-notify events." ;; The end. (when (or (eq visit t) (null visit) (stringp visit)) - (tramp-message v 0 "Wrote %d characters to `%s'" + (tramp-message v 0 "Wrote `%s' (%d characters)" filename (cond ((null start) (buffer-size)) ((stringp start) (length start)) - (t (- end start))) - filename)) + (t (- end start))))) (run-hooks 'tramp-handle-write-region-hook))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index a8556b9a0d..475f2b9a5d 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3411,11 +3411,10 @@ the result will be a local, non-Tramp, file name." (when need-chown (tramp-set-file-uid-gid filename uid gid)) (when (or (eq visit t) (null visit) (stringp visit)) - (tramp-message v 0 "Wrote %d characters to `%s'" + (tramp-message v 0 "Wrote `%s' (%d characters)" filename (cond ((null start) (buffer-size)) ((stringp start) (length start)) - (t (- end start))) - filename)) + (t (- end start))))) (run-hooks 'tramp-handle-write-region-hook))))) (defvar tramp-vc-registered-file-names nil diff --git a/src/fileio.c b/src/fileio.c index 567f56c906..fc853f2667 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5152,14 +5152,13 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, if (!auto_saving && !noninteractive) { AUTO_STRING (format, NUMBERP (append) - ? "Updated %d characters of `%s'" + ? "Updated `%s' (%d characters)" : ! NILP (append) - ? "Added %d characters to `%s'" - : "Wrote %d characters to `%s'"); - CALLN (Fmessage, format, + ? "Added to `%s' (%d characters)" + : "Wrote `%s' (%d characters)"); + CALLN (Fmessage, format, visit_file, (STRINGP (start) ? Flength (start) - : make_number (XINT (end) - XINT (start))), - visit_file); + : make_number (XINT (end) - XINT (start)))); } return Qnil; } commit 75824977851f27146638672bba4d3789f2a32612 Author: Kaushal Modi Date: Wed Apr 5 17:16:33 2017 -0400 Check that file argument is a string * lisp/vc/ediff-diff.el (ediff-exec-process): Check that the argument passed to `file-local-copy' is a string (Bug#26378). Also fix the existing comment for this function, and convert it to its doc-string. diff --git a/lisp/vc/ediff-diff.el b/lisp/vc/ediff-diff.el index cfa08ef360..ded82c41c9 100644 --- a/lisp/vc/ediff-diff.el +++ b/lisp/vc/ediff-diff.el @@ -1134,12 +1134,20 @@ delimiter regions")) )) -;; Execute PROGRAM asynchronously, unless OS/2, Windows-*, or DOS, or unless -;; SYNCH is non-nil. BUFFER must be a buffer object, and must be alive. The -;; OPTIONS arg is a list of options to pass to PROGRAM. It may be a blank -;; string. All elements in FILES must be strings. We also delete nil from -;; args. (defun ediff-exec-process (program buffer synch options &rest files) + "Execute the diff PROGRAM. + +The PROGRAM output is sent to BUFFER, which must be a live buffer +object. + +The PROGRAM is executed asynchronously unless `system-type' is +`windows-nt' or `ms-dos', or SYNCH is non-nil. + +OPTIONS is a string of space-separated options to pass to PROGRAM. It +may be a blank string. + +FILES is a list of filenames to pass to PROGRAM; nil and \"\" elements +are ignored." (let ((data (match-data)) ;; If this is a buffer job, we are diffing temporary files ;; produced by Emacs with ediff-coding-system-for-write, so @@ -1151,8 +1159,9 @@ delimiter regions")) args) (setq args (append (split-string options) (mapcar (lambda (file) - (file-name-unquote - (or (file-local-copy file) file))) + (when (stringp file) + (file-name-unquote + (or (file-local-copy file) file)))) files))) (setq args (delete "" (delq nil args))) ; delete nil and "" from arguments ;; the --binary option, if present, should be used only for buffer jobs commit 9e27e0d1a6c90d0d29e41884155245b6c3378b0a Author: Noam Postavsky Date: Fri Apr 7 18:24:35 2017 -0400 Fix handling of non-integer START param to write-region The previous patch for Bug#354 incorrectly assumed that START would always be an integer. * lisp/epa-file.el (epa-file-write-region): * lisp/jka-compr.el (jka-compr-write-region): * lisp/net/ange-ftp.el (ange-ftp-write-region): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region): * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): * src/fileio.c (write_region): Handle nil and string values of START. diff --git a/lisp/epa-file.el b/lisp/epa-file.el index 72ffb58c30..2e06c8374f 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -290,7 +290,11 @@ If no one is selected, symmetric encryption will be performed. " (if (or (eq visit t) (eq visit nil) (stringp visit)) - (message "Wrote %d characters to `%s'" (- end start) buffer-file-name)))) + (message "Wrote %d characters to `%s'" + (cond ((null start) (buffer-size)) + ((stringp start) (length start)) + (t (- end start))) + buffer-file-name)))) (put 'write-region 'epa-file 'epa-file-write-region) (defun epa-file-select-keys () diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el index 55440a709c..a5e24a6f9a 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el @@ -357,7 +357,11 @@ There should be no more than seven characters after the final `/'." (and (or (eq visit t) (eq visit nil) (stringp visit)) - (message "Wrote %d characters to `%s'" (- end start) visit-file)) + (message "Wrote %d characters to `%s'" + (cond ((null start) (buffer-size)) + ((stringp start) (length start)) + (t (- end start))) + visit-file)) ;; ensure `last-coding-system-used' has an appropriate value (setq last-coding-system-used coding-system-used) diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index aecb9e1ecb..6e84269e30 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -3284,7 +3284,11 @@ system TYPE.") (set-buffer-modified-p nil))) ;; ensure `last-coding-system-used' has an appropriate value (setq last-coding-system-used coding-system-used) - (ange-ftp-message "Wrote %d characters to `%s'" (- end start) abbr) + (ange-ftp-message "Wrote %d characters to `%s'" + (cond ((null start) (buffer-size)) + ((stringp start) (length start)) + (t (- end start))) + abbr) (ange-ftp-add-file-entry filename)) (ange-ftp-real-write-region start end filename append visit)))) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 8ab34af85b..b7477271d7 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1223,7 +1223,11 @@ file-notify events." ;; The end. (when (or (eq visit t) (null visit) (stringp visit)) - (tramp-message v 0 "Wrote %d characters to `%s'" (- end start) filename)) + (tramp-message v 0 "Wrote %d characters to `%s'" + (cond ((null start) (buffer-size)) + ((stringp start) (length start)) + (t (- end start))) + filename)) (run-hooks 'tramp-handle-write-region-hook))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index f78f54154f..a8556b9a0d 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3412,7 +3412,10 @@ the result will be a local, non-Tramp, file name." (tramp-set-file-uid-gid filename uid gid)) (when (or (eq visit t) (null visit) (stringp visit)) (tramp-message v 0 "Wrote %d characters to `%s'" - (- end start) filename)) + (cond ((null start) (buffer-size)) + ((stringp start) (length start)) + (t (- end start))) + filename)) (run-hooks 'tramp-handle-write-region-hook))))) (defvar tramp-vc-registered-file-names nil diff --git a/src/fileio.c b/src/fileio.c index 0fc5229401..567f56c906 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5157,7 +5157,8 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, ? "Added %d characters to `%s'" : "Wrote %d characters to `%s'"); CALLN (Fmessage, format, - make_number (XINT (end) - XINT (start)), + (STRINGP (start) ? Flength (start) + : make_number (XINT (end) - XINT (start))), visit_file); } return Qnil; commit 88532ae818f3e0211c14826a618bd0a80e30e993 Author: Glenn Morris Date: Fri Apr 7 13:42:58 2017 -0400 * lisp/textmodes/rst.el (rst-package-emacs-version-alist): Fixes. diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 1820254542..490ea23109 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -296,8 +296,8 @@ in parentheses follows the development revision and the time stamp.") ("1.4.1" . "25.1") ("1.4.2" . "25.1") ("1.5.0" . "26.1") - ("1.5.1" . "26.2") - ("1.5.2" . "26.2") + ("1.5.1" . "26.1") + ("1.5.2" . "26.1") ;; Whatever the Emacs version is this rst.el version ends up in. )) commit 5c6b0136047215c24b44d67f5e8372af743b2820 Author: Michael Albinus Date: Fri Apr 7 18:43:25 2017 +0200 Add Tramp versions to `customize-package-emacs-version-alist' * lisp/net/trampver.el (customize-package-emacs-version-alist): Add Tramp versions to `customize-package-emacs-version-alist'. diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 35b5eb6728..e770ecc5a7 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -60,6 +60,16 @@ (match-string 0 (emacs-version))))))) (unless (string-match "\\`ok\\'" x) (error "%s" x))) +;; Tramp versions integrated into Emacs. +(add-to-list + 'customize-package-emacs-version-alist + '(Tramp ("2.0.55" . "22.1") ("2.0.57" . "22.2") ("2.0.58-pre" . "22.3") + ("2.1.15" . "23.1") ("2.1.18-23.2" . "23.2") + ("2.1.20" . "23.3") ("2.1.21-pre" . "23.4") + ("2.2.3-24.1" . "24.1") ("2.2.3-24.1" . "24.2") ("2.2.6-24.3" . "24.3") + ("2.2.9-24.4" . "24.4") ("2.2.11-24.5" . "24.5") + ("2.2.13.25.1" . "25.1") ("2.2.13.25.2" . "25.2"))) + (add-hook 'tramp-unload-hook (lambda () (unload-feature 'trampver 'force))) commit dc48ac63f5f830535e6049db0c66943707bd9dbb Author: Tom Tromey Date: Fri Apr 7 09:43:42 2017 -0600 * lisp/textmodes/rst.el (rst-toc-link-keymap): Move before first use. diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 7fad83da6b..1820254542 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -2711,6 +2711,12 @@ indentation style: :group 'rst-toc) (rst-testcover-defcustom) +(defconst rst-toc-link-keymap + (let ((map (make-sparse-keymap))) + (define-key map [mouse-1] 'rst-toc-mouse-follow-link) + map) + "Keymap used for links in TOC.") + (defun rst-toc-insert (&optional max-level) ;; testcover: ok. "Insert the table of contents of the current section at the current column. @@ -2773,12 +2779,6 @@ If KEYMAP use this as keymap property. PFX is inserted before text." (error "Buffer for this section was killed")) mrkr)) -(defconst rst-toc-link-keymap - (let ((map (make-sparse-keymap))) - (define-key map [mouse-1] 'rst-toc-mouse-follow-link) - map) - "Keymap used for links in TOC.") - (defun rst-toc-insert-tree (stn buf style depth keymap tgt-stn) ;; testcover: ok. "Insert table of contents of tree below top node STN in buffer BUF.