commit 6bf83218314db1c63ce34564edfb994d9431b28a (HEAD, refs/remotes/origin/master) Author: Mark Oteiza Date: Fri Dec 16 10:14:01 2016 -0500 Be more selective clearing the image cache * lisp/image-dired.el (image-dired-create-thumbs): (image-dired-rotate-thumbnail, image-dired-refresh-thumb): Only clear the current thumbnail file from the image cache. diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 2925d0c..96570a5 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -1549,8 +1549,8 @@ With prefix argument ARG, create thumbnails even if they already exist ;; If the user overrides the exist check, we must clear the ;; image cache so that if the user wants to display the ;; thumbnail, it is not fetched from cache. - (if arg - (clear-image-cache)) + (when arg + (clear-image-cache (expand-file-name thumb-name))) (when (or (not (file-exists-p thumb-name)) arg) (when (not (= 0 (image-dired-create-thumb curr-file thumb-name))) @@ -1808,18 +1808,17 @@ With prefix argument ARG, display image in its original size." 'image-dired-cmd-rotate-thumbnail-program) (if (not (image-dired-image-at-point-p)) (message "No thumbnail at point") - (let ((file (image-dired-thumb-name (image-dired-original-file-name))) - command) + (let* ((file (image-dired-thumb-name (image-dired-original-file-name))) + (thumb (expand-file-name file)) + command) (setq command (format-spec image-dired-cmd-rotate-thumbnail-options (list (cons ?p image-dired-cmd-rotate-thumbnail-program) (cons ?d degrees) - (cons ?t (expand-file-name file))))) + (cons ?t thumb)))) (call-process shell-file-name nil nil nil shell-command-switch command) - ;; Clear the cache to refresh image. I wish I could just refresh - ;; the current file but I do not know how to do that. Yet... - (clear-image-cache)))) + (clear-image-cache thumb)))) (defun image-dired-rotate-thumbnail-left () "Rotate thumbnail left (counter clockwise) 90 degrees. @@ -1842,9 +1841,10 @@ overwritten. This confirmation can be turned off using (defun image-dired-refresh-thumb () "Force creation of new image for current thumbnail." (interactive) - (let ((file (image-dired-original-file-name))) - (clear-image-cache) - (image-dired-create-thumb file (image-dired-thumb-name file)))) + (let* ((file (image-dired-original-file-name)) + (thumb (expand-file-name (image-dired-thumb-name file)))) + (clear-image-cache (expand-file-name thumb)) + (image-dired-create-thumb file thumb))) (defun image-dired-rotate-original (degrees) "Rotate original image DEGREES degrees." commit b3cf281174674ced4e167081e6908b2b0ee29deb Author: Eli Zaretskii Date: Fri Dec 16 12:50:06 2016 +0200 Unbreak the MinGW build * lib/stdio-impl.h [__MINGW32__]: Don't include errno.h. Without this, temacs crashes while dumping. diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h index 766d693..1972a33 100644 --- a/lib/stdio-impl.h +++ b/lib/stdio-impl.h @@ -26,7 +26,9 @@ # include #endif +#ifndef __MINGW32__ #include /* For detecting Plan9. */ +#endif #if defined __sferror || defined __DragonFly__ || defined __ANDROID__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ commit fb2fdb1435d2520c1cbf2a3d6a53128512a38458 Author: Nicolas Petton Date: Fri Dec 16 11:18:04 2016 +0100 Make seq-into return the sequence when no conversion needed * lisp/emacs-lisp/seq.el (seq-into): Do not convert the sequence when no conversion is needed. * test/lisp/emacs-lisp/seq-tests.el (test-seq-into-and-identity): Add a regression test checking for identity. diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 9890e60..7451024 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -179,9 +179,7 @@ Return a list of the results. \(fn FUNCTION SEQUENCES...)" (let ((result nil) (sequences (seq-map (lambda (s) - (if (listp s) - s - (seq-into s 'list))) + (seq-into s 'list)) (cons sequence sequences)))) (while (not (memq nil sequences)) (push (apply function (seq-map #'car sequences)) result) @@ -275,9 +273,9 @@ of sequence." TYPE can be one of the following symbols: vector, string or list." (pcase type - (`vector (vconcat sequence)) - (`string (concat sequence)) - (`list (append sequence nil)) + (`vector (seq--into-vector sequence)) + (`string (seq--into-string sequence)) + (`list (seq--into-list sequence)) (_ (error "Not a sequence type name: %S" type)))) (cl-defgeneric seq-filter (pred sequence) @@ -514,6 +512,24 @@ Signal an error if SEQUENCE is empty." (null list)) +(defun seq--into-list (sequence) + "Concatenate the elements of SEQUENCE into a list." + (if (listp sequence) + sequence + (append sequence nil))) + +(defun seq--into-vector (sequence) + "Concatenate the elements of SEQUENCE into a vector." + (if (vectorp sequence) + sequence + (vconcat sequence))) + +(defun seq--into-string (sequence) + "Concatenate the elements of SEQUENCE into a string." + (if (stringp sequence) + sequence + (concat sequence))) + (defun seq--activate-font-lock-keywords () "Activate font-lock keywords for some symbols defined in seq." (font-lock-add-keywords 'emacs-lisp-mode diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el index fc65c98..a7a4347 100644 --- a/test/lisp/emacs-lisp/seq-tests.el +++ b/test/lisp/emacs-lisp/seq-tests.el @@ -391,5 +391,13 @@ Evaluate BODY for each created sequence. (should (equal (seq-mapn #'+ '(3 4 5 7) l1) '(4 5 6 8))))) +(ert-deftest test-seq-into-and-identity () + (let ((lst '(1 2 3)) + (vec [1 2 3]) + (str "foo bar")) + (should (eq (seq-into lst 'list) lst)) + (should (eq (seq-into vec 'vector) vec)) + (should (eq (seq-into str 'string) str)))) + (provide 'seq-tests) ;;; seq-tests.el ends here