commit 09a66ceb5e906e704be58d5f40c45096307f0b9e (HEAD, refs/remotes/origin/master) Author: Nicolas Petton Date: Thu Dec 15 10:24:57 2016 +0100 Fix circular list handling in seq-mapn * lisp/emacs-lisp/seq.el (seq-mapn): Do not copy list arguments. * test/lisp/emacs-lisp/seq-tests.el (test-seq-mapn-circular-lists): Add a regression test. diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 5ddc5a5..9890e60 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -178,7 +178,10 @@ Return a list of the results. \(fn FUNCTION SEQUENCES...)" (let ((result nil) - (sequences (seq-map (lambda (s) (seq-into s 'list)) + (sequences (seq-map (lambda (s) + (if (listp s) + s + (seq-into s 'list))) (cons sequence sequences)))) (while (not (memq nil sequences)) (push (apply function (seq-map #'car sequences)) result) diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el index 2e533ac..fc65c98 100644 --- a/test/lisp/emacs-lisp/seq-tests.el +++ b/test/lisp/emacs-lisp/seq-tests.el @@ -386,5 +386,10 @@ Evaluate BODY for each created sequence. (should-error (seq-random-elt [])) (should-error (seq-random-elt ""))) +(ert-deftest test-seq-mapn-circular-lists () + (let ((l1 '#1=(1 . #1#))) + (should (equal (seq-mapn #'+ '(3 4 5 7) l1) + '(4 5 6 8))))) + (provide 'seq-tests) ;;; seq-tests.el ends here commit acbe32abddd9740acd756419f068cb4bc345567c Author: Michael Albinus Date: Thu Dec 15 09:37:35 2016 +0100 Check in tramp-tests.el, that environment variables are set correctly * test/lisp/net/tramp-tests.el (tramp--test-check-files): Check also, that environment variables are set correctly. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index e80af42..893dc54 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2283,7 +2283,34 @@ Several special characters do not work properly there." (delete-file file2) (should-not (file-exists-p file2)) (delete-directory file1) - (should-not (file-exists-p file1))))) + (should-not (file-exists-p file1)))) + + ;; Check, that environment variables are set correctly. + (when (and tramp--test-expensive-test (tramp--test-sh-p)) + (dolist (elt files) + ;; Tramp does not support environment variables with + ;; leading or trailing spaces. It also does not + ;; support the tab character. + (setq elt (replace-regexp-in-string "\t" " " elt) + elt (replace-regexp-in-string "^\\s-+\\|\\s-+$" "" elt)) + (let* ((default-directory tramp-test-temporary-file-directory) + (shell-file-name "/bin/sh") + (envvar + (concat "VAR_" (upcase (md5 (current-time-string))))) + (tramp-remote-process-environment + (cons + (format "%s=%s" envvar elt) + tramp-remote-process-environment))) + ;; We force a reconnect, in order to have a clean + ;; environment. + (tramp-cleanup-connection + (tramp-dissect-file-name tramp-test-temporary-file-directory) + 'keep-debug 'keep-password) + (should + (string-equal + elt + (shell-command-to-string + (format "echo -n $%s" envvar)))))))) ;; Cleanup. (ignore-errors (delete-directory tmp-name1 'recursive)) commit d381db25a201fa67b7e274a758d6a7c2c350067e Author: Dominique Quatravaux Date: Thu Dec 15 09:37:00 2016 +0100 Protect environment variables with double quotes in Tramp * lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): Protect environment variables with double quotes. Copyright-paperwork-exempt: yes diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 419dccb..31ef2ef 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4201,10 +4201,11 @@ process to set up. VEC specifies the connection." (when vars (tramp-send-command vec - (format "while read var val; do export $var=$val; done <<'%s'\n%s\n%s" - tramp-end-of-heredoc - (mapconcat 'identity vars "\n") - tramp-end-of-heredoc) + (format + "while read var val; do export $var=\"$val\"; done <<'%s'\n%s\n%s" + tramp-end-of-heredoc + (mapconcat 'identity vars "\n") + tramp-end-of-heredoc) t)) (when unset (tramp-send-command commit 0a5898c3dd2e32431268bc2bcf3536d4cd62ad39 Author: Tino Calancha Date: Thu Dec 15 15:02:32 2016 +0900 * lisp/ibuf-macs.el (define-ibuffer-filter): Wrap ,@body in a progn. diff --git a/lisp/ibuf-macs.el b/lisp/ibuf-macs.el index 3c95f4c..fc8c127 100644 --- a/lisp/ibuf-macs.el +++ b/lisp/ibuf-macs.el @@ -304,7 +304,7 @@ bound to the current value of the filter. (push (list ',name ,description (lambda (buf qualifier) (condition-case nil - ,@body + (progn ,@body) (error (ibuffer-pop-filter) (when (eq ',name 'predicate) (error "Wrong filter predicate: %S" commit d0388bd12d68d0f40f655474c970d572a133f5e7 Author: Mark Oteiza Date: Wed Dec 14 20:36:06 2016 -0500 * lisp/image-dired.el (image-dired-create-thumb): Create parent directories. diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 61cf89c..a23dbfe 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -648,7 +648,7 @@ according to the Thumbnail Managing Standard." (when (not (file-exists-p (setq thumbnail-dir (file-name-directory thumbnail-file)))) (message "Creating thumbnail directory.") - (make-directory thumbnail-dir)) + (make-directory thumbnail-dir t)) (call-process shell-file-name nil nil nil shell-command-switch command))) ;;;###autoload commit 0c77bcb3935e5dd82baeb2cd5fecbb45879d11b0 Author: Mark Oteiza Date: Wed Dec 14 16:36:31 2016 -0500 * lisp/image-mode.el (image-mode-winprops-alist): Add docstring. diff --git a/lisp/image-mode.el b/lisp/image-mode.el index f526685..ce56208 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -43,7 +43,10 @@ ;;; Image mode window-info management. -(defvar-local image-mode-winprops-alist t) +(defvar-local image-mode-winprops-alist t + "Alist of windows to window properties. +Each element has the form (WINDOW . ALIST). +See `image-mode-winprops'.") (defvar image-mode-new-window-functions nil "Special hook run when image data is requested in a new window. commit 53e8d7fb80d5c99b11906f100d9cb1ace358a0dc Author: Mark Oteiza Date: Wed Dec 14 16:34:12 2016 -0500 Recognize pngnq or pngnq-s9 * lisp/image-dired.el (image-dired-cmd-pngnq-program): Also consider pngnq-s9 as a possible executable. diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 066a994..61cf89c 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -255,9 +255,13 @@ is replaced by the file name of the temporary file." :type 'string :group 'image-dired) -(defcustom image-dired-cmd-pngnq-program (executable-find "pngnq") +(defcustom image-dired-cmd-pngnq-program + (or (executable-find "pngnq") + (executable-find "pngnq-s9")) "The file name of the `pngnq' program. -It quantizes colors of PNG images down to 256 colors." +It quantizes colors of PNG images down to 256 colors or fewer +using the Neuquant procedure." + :version "26.1" :type '(choice (const :tag "Not Set" nil) string) :group 'image-dired) commit 66ccc65935c389942f1bc72e968846d8dab9951b Author: Mark Oteiza Date: Wed Dec 14 14:34:21 2016 -0500 Update standard image-dired thumbnail location * lisp/image-dired.el (image-dired-thumb-name): Conform to the latest standard: consider XDG_CACHE_HOME, falling back on ~/.cache. diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 1c99db3..066a994 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -587,9 +587,12 @@ the thumbnail file name unique. For per-directory storage, just add a subdirectory. For standard storage, produce the file name according to the Thumbnail Managing Standard." (cond ((eq 'standard image-dired-thumbnail-storage) - (expand-file-name - (concat "~/.thumbnails/normal/" - (md5 (concat "file://" (expand-file-name file))) ".png"))) + (let* ((xdg (getenv "XDG_CACHE_HOME")) + (dir (if (and xdg (file-name-absolute-p xdg)) + xdg "~/.cache"))) + (expand-file-name + (concat (md5 (concat "file://" (expand-file-name file))) ".png") + (expand-file-name "thumbnails/normal" dir)))) ((eq 'use-image-dired-dir image-dired-thumbnail-storage) (let* ((f (expand-file-name file)) (md5-hash commit 44a77d34c63fb4188edca6e1a875c9a1ec01f3f7 Author: Mark Oteiza Date: Wed Dec 14 12:25:04 2016 -0500 Reset window scroll when displaying an image When viewing a large image full size and scrolling, for instance, to the lower right corner, then selecting a much smaller image in the thumbnail buffer, the window stays scrolled so the new image is out of the window. One must scroll back to the "origin" to view the new displayed image, or just kill the image-dired-display-image buffer and try again. This fixes the issue. * lisp/image-dired.el (image-dired-display-window-width): (image-dired-display-window-height): Operate on a window as argument. (image-dired-display-image): Bind (image-dired-display-window) and use it. Set window vscroll and hscroll to zero when refreshing the buffer's contents. diff --git a/lisp/image-dired.el b/lisp/image-dired.el index cff4ef8..1c99db3 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -1674,14 +1674,14 @@ Ask user how many thumbnails should be displayed per row." (equal (window-buffer window) buf)))) (error "No thumbnail image at point")))) -(defun image-dired-display-window-width () - "Return width, in pixels, of image-dired's image display window." - (- (image-dired-window-width-pixels (image-dired-display-window)) +(defun image-dired-display-window-width (window) + "Return width, in pixels, of WINDOW." + (- (image-dired-window-width-pixels window) image-dired-display-window-width-correction)) -(defun image-dired-display-window-height () - "Return height, in pixels, of image-dired's image display window." - (- (image-dired-window-height-pixels (image-dired-display-window)) +(defun image-dired-display-window-height (window) + "Return height, in pixels, of WINDOW." + (- (image-dired-window-height-pixels window) image-dired-display-window-height-correction)) (defun image-dired-display-image (file &optional original-size) @@ -1697,13 +1697,14 @@ original size." (image-dired--check-executable-exists 'image-dired-cmd-create-temp-image-program) (let ((new-file (expand-file-name image-dired-temp-image-file)) + (window (image-dired-display-window)) width height command ret (image-type 'jpeg)) (setq file (expand-file-name file)) (if (not original-size) (progn - (setq width (image-dired-display-window-width)) - (setq height (image-dired-display-window-height)) + (setq width (image-dired-display-window-width window)) + (setq height (image-dired-display-window-height window)) (setq command (format-spec image-dired-cmd-create-temp-image-options @@ -1725,6 +1726,8 @@ original size." (clear-image-cache) (image-dired-insert-image image-dired-temp-image-file image-type 0 0) (goto-char (point-min)) + (set-window-vscroll window 0) + (set-window-hscroll window 0) (image-dired-update-property 'original-file-name file))))) (defun image-dired-display-thumbnail-original-image (&optional arg)