commit 2db3307e8a966a8f652a210d8f8eb83daddd7d9f (HEAD, refs/remotes/origin/master) Author: Tino Calancha Date: Sun Sep 4 11:09:31 2016 +0900 image-type-from-file-name: Perform a case insensitive match Fix Bug#24317 * lisp/image.el (image-type-from-file-name): Bind case-fold-search to a non-nil value to force a case insensitive match. * lisp/image-dired.el (image-dired-rotate-original): Use image-type (Bug#24317). (image-dired-get-exif-file-name): Idem. Set 'no-exif-data-found' and 'data' in same setq call. Use file-attribute-modification-time. diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 67b023d..34e4eae 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -1912,8 +1912,8 @@ overwritten. This confirmation can be turned off using (message "No image at point") (let ((file (image-dired-original-file-name)) command) - (if (not (string-match "\\.[jJ][pP[eE]?[gG]$" file)) - (error "Only JPEG images can be rotated!")) + (unless (eq 'jpeg (image-type file)) + (error "Only JPEG images can be rotated!")) (setq command (format-spec image-dired-cmd-rotate-original-options (list @@ -1952,15 +1952,14 @@ for traceability. The format of the returned file name is YYYY_MM_DD_HH_MM_DD_ORIG_FILE_NAME.jpg. Used from `image-dired-copy-with-exif-file-name'." (let (data no-exif-data-found) - (if (not (string-match "\\.[Jj][Pp][Ee]?[Gg]$" (expand-file-name file))) - (progn - (setq no-exif-data-found t) - (setq data - (format-time-string - "%Y:%m:%d %H:%M:%S" - (nth 5 (file-attributes (expand-file-name file)))))) + (if (not (eq 'jpeg (image-type (expand-file-name file)))) + (setq no-exif-data-found t + data (format-time-string + "%Y:%m:%d %H:%M:%S" + (file-attribute-modification-time + (file-attributes (expand-file-name file))))) (setq data (image-dired-get-exif-data (expand-file-name file) - "DateTimeOriginal"))) + "DateTimeOriginal"))) (while (string-match "[ :]" data) (setq data (replace-match "_" nil nil data))) (format "%s%s%s" data diff --git a/lisp/image.el b/lisp/image.el index 791a902..e1f52de 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -343,7 +343,7 @@ be determined." "Determine the type of image file FILE from its name. Value is a symbol specifying the image type, or nil if type cannot be determined." - (let (type first) + (let (type first (case-fold-search t)) (catch 'found (dolist (elem image-type-file-name-regexps first) (when (string-match-p (car elem) file) commit 7c16c89c5772a1777e4d73ebc5ea2a3ff8344c22 Author: Tino Calancha Date: Sun Sep 4 10:59:07 2016 +0900 image-increase-size: Fix non-interactive calls * lisp/image.el (image-increase-size, image-decrease-size): Compute a floating point division. Problem reported in: https://lists.gnu.org/archive/html/emacs-devel/2016-09/msg00067.html diff --git a/lisp/image.el b/lisp/image.el index 272cee5..791a902 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -957,7 +957,7 @@ If N is 3, then the image size will be increased by 30%. The default is 20%." (interactive "P") (image--change-size (if n - (1+ (/ n 10)) + (1+ (/ n 10.0)) 1.2))) (defun image-decrease-size (n) @@ -966,7 +966,7 @@ If N is 3, then the image size will be decreased by 30%. The default is 20%." (interactive "P") (image--change-size (if n - (- 1 (/ n 10)) + (- 1 (/ n 10.0)) 0.8))) (defun image--get-image () commit 2ad16e4bf9b43c169bcfa1e6240584488fbc3d78 Author: Robert Cochran Date: Fri Aug 19 18:03:24 2016 -0700 Fix uses of (call-interactively) in lisp/emacs-lisp/checkdoc.el Passing the prefix argument as the 3rd argument to 'call-interactively' causes the prefix argument to be interpreted as events, which is not only wrong, but also causes a type error, as 'current-prefix-arg' can never be a vector as 'call-interactively' expects. 'call-interactively' automatically passes its prefix argument to the called function, so just do that, eliminating faulty behavior. * lisp/emacs-lisp/checkdoc.el (checkdoc-ispell): (checkdoc-ispell-current-buffer): (checkdoc-ispell-interactive): (checkdoc-ispell-message-text): (checkdoc-ispell-start): (checkdoc-ispell-continue): (checkdoc-ispell-comments): (checkdoc-ispell-defun): Do not pass 'current-prefix-arg' to 'call-interactively' as an event vector; merely allow it to propagate forward to the interactive call. diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 3a81ade..769c2fe 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1062,7 +1062,7 @@ Calls `checkdoc' with spell-checking turned on. Prefix argument is the same as for `checkdoc'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc nil current-prefix-arg))) + (call-interactively #'checkdoc))) ;;;###autoload (defun checkdoc-ispell-current-buffer () @@ -1071,7 +1071,7 @@ Calls `checkdoc-current-buffer' with spell-checking turned on. Prefix argument is the same as for `checkdoc-current-buffer'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc-current-buffer nil current-prefix-arg))) + (call-interactively #'checkdoc-current-buffer))) ;;;###autoload (defun checkdoc-ispell-interactive () @@ -1080,7 +1080,7 @@ Calls `checkdoc-interactive' with spell-checking turned on. Prefix argument is the same as for `checkdoc-interactive'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc-interactive nil current-prefix-arg))) + (call-interactively #'checkdoc-interactive))) ;;;###autoload (defun checkdoc-ispell-message-interactive () @@ -1099,7 +1099,7 @@ Calls `checkdoc-message-text' with spell-checking turned on. Prefix argument is the same as for `checkdoc-message-text'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc-message-text nil current-prefix-arg))) + (call-interactively #'checkdoc-message-text))) ;;;###autoload (defun checkdoc-ispell-start () @@ -1108,7 +1108,7 @@ Calls `checkdoc-start' with spell-checking turned on. Prefix argument is the same as for `checkdoc-start'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc-start nil current-prefix-arg))) + (call-interactively #'checkdoc-start))) ;;;###autoload (defun checkdoc-ispell-continue () @@ -1117,7 +1117,7 @@ Calls `checkdoc-continue' with spell-checking turned on. Prefix argument is the same as for `checkdoc-continue'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc-continue nil current-prefix-arg))) + (call-interactively #'checkdoc-continue))) ;;;###autoload (defun checkdoc-ispell-comments () @@ -1126,7 +1126,7 @@ Calls `checkdoc-comments' with spell-checking turned on. Prefix argument is the same as for `checkdoc-comments'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc-comments nil current-prefix-arg))) + (call-interactively #'checkdoc-comments))) ;;;###autoload (defun checkdoc-ispell-defun () @@ -1135,7 +1135,7 @@ Calls `checkdoc-defun' with spell-checking turned on. Prefix argument is the same as for `checkdoc-defun'" (interactive) (let ((checkdoc-spellcheck-documentation-flag t)) - (call-interactively #'checkdoc-defun nil current-prefix-arg))) + (call-interactively #'checkdoc-defun))) ;;; Error Management ;; commit 5fbba6cceaf843cfca449eb000a0a65243b61808 Author: Richard Stallman Date: Fri Sep 2 21:55:09 2016 -0400 Fix mail-combine-fields * lisp/mail/sendmail.el (mail-combine-fields): Call `save-excursion' to avoid losing our place in the search loop. diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 58f708a..3d22209 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -1110,10 +1110,11 @@ to combine them into one, and does so if the user says y." (save-restriction ;; This is just so the screen doesn't change. (narrow-to-region (point-min) old-max) - (goto-char old-point) - (setq query-asked t) - (if (y-or-n-p (format "Message contains multiple %s fields. Combine? " field)) - (setq query-answer t)))) + (save-excursion + (goto-char old-point) + (setq query-asked t) + (if (y-or-n-p (format "Message contains multiple %s fields. Combine? " field)) + (setq query-answer t))))) (when query-answer (let ((this-to-start (line-beginning-position)) this-to-end