changeset 108846:99df2c060155

Merge from mainline.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Tue, 25 May 2010 22:48:43 +0000
parents 895ee2ff8cc3 (current diff) 73e2a7719a24 (diff)
children 3e401eb6d5ee
files
diffstat 7 files changed, 137 insertions(+), 70 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue May 25 07:23:37 2010 +0000
+++ b/lisp/ChangeLog	Tue May 25 22:48:43 2010 +0000
@@ -1,3 +1,42 @@
+2010-05-25  Thierry Volpiatto  <thierry.volpiatto@gmail.com>
+
+	* dired.el (dired-mode-map): Rebind "\C-t\C-t" from
+	`image-dired-dired-insert-marked-thumbs' to
+	`image-dired-dired-toggle-marked-thumbs'.
+
+	* image-dired.el: Require cl when compiling.
+	(image-dired-dired-toggle-marked-thumbs): Rename from
+	`image-dired-dired-insert-marked-thumbs'.  Add ARG.  Doc fix.
+	Use interactive spec "P".  Set LOCALP arg of `dired-get-filename'
+	to 'no-dir.  Skip files whose names don't match
+	`image-file-name-regexp'.  When file has a thumbnail overlay,
+	delete it.  (Bug#5270)
+
+2010-05-25  Juri Linkov  <juri@jurta.org>
+
+	* image-mode.el (image-mode): Add image-after-revert-hook to
+	after-revert-hook.
+	(image-after-revert-hook): New function.  (Bug#5669)
+
+2010-05-25  Juri Linkov  <juri@jurta.org>
+
+	* image.el (image-animated-p): When delay between animated images
+	is 0, set it to 10 (0.1 sec).  (Bug#6258)
+
+2010-05-25  Christian Lynbech  <christian.lynbech@tieto.com>  (tiny change)
+
+	* net/tramp.el (tramp-handle-insert-directory): Don't use
+	`forward-word', its default syntax could be changed.
+
+2010-05-25  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-progress-reporter-update): New defun.
+	(with-progress-reporter): Use it.
+	(tramp-process-actions):
+	* net/tramp-gvfs.el (tramp-gvfs-handler-askquestion): Preserve
+	current message, in order to let progress reporter continue
+	afterwards.  (Bug#6257)
+
 2010-05-25  Glenn Morris  <rgm@gnu.org>
 
 	* net/rcirc.el (rcirc-default-user-name, rcirc-default-full-name):
@@ -23,19 +62,19 @@
 
 	Replace Lisp calls to delete-backward-char by delete-char.
 	* bs.el, expand.el, ido.el, image-dired.el, lpr.el, pcomplete.el,
-	skeleton.el, term.el, time.el, wid-edit.el, woman.el,
-	calc/calc-graph.el, calc/calc-help.el, calc/calc-incom.el,
-	calc/calc.el, emacs-cl-extra.el, emacs-cl-loaddefs.el,
-	emulation/cua-rect.el, emulation/viper-ex.el, eshell/esh-test.el,
-	eshell/eshell.el, gnus/gnus-uu.el, gnus/nndoc.el, gnus/nnrss.el,
-	gnus/rfc2047.el, gnus/utf7.el, international/utf-7.el,
-	language/ethio-util.el, mh-e/mh-alias.el, mh-e/mh-search.el,
-	net/imap.el, net/rcirc.el, obsolete/complete.el, play/decipher.el,
-	progmodes/ada-mode.el, progmodes/cc-awk.el, progmodes/dcl-mode.el,
-	progmodes/ps-mode.el, progmodes/verilog-mode.el,
-	progmodes/vhdl-mode.el, textmodes/bibtex.el, textmodes/fill.el,
-	textmodes/reftex-auc.el, textmodes/rst.el, textmodes/sgml-mode.el,
-	textmodes/table.el, textmodes/texinfmt.el: Replace Lisp calls to
+	* skeleton.el, term.el, time.el, wid-edit.el, woman.el,
+	* calc/calc-graph.el, calc/calc-help.el, calc/calc-incom.el,
+	* calc/calc.el, emacs-cl-extra.el, emacs-cl-loaddefs.el,
+	* emulation/cua-rect.el, emulation/viper-ex.el, eshell/esh-test.el,
+	* eshell/eshell.el, gnus/gnus-uu.el, gnus/nndoc.el, gnus/nnrss.el,
+	* gnus/rfc2047.el, gnus/utf7.el, international/utf-7.el,
+	* language/ethio-util.el, mh-e/mh-alias.el, mh-e/mh-search.el,
+	* net/imap.el, net/rcirc.el, obsolete/complete.el, play/decipher.el,
+	* progmodes/ada-mode.el, progmodes/cc-awk.el, progmodes/dcl-mode.el,
+	* progmodes/ps-mode.el, progmodes/verilog-mode.el,
+	* progmodes/vhdl-mode.el, textmodes/bibtex.el, textmodes/fill.el,
+	* textmodes/reftex-auc.el, textmodes/rst.el, textmodes/sgml-mode.el,
+	* textmodes/table.el, textmodes/texinfmt.el: Replace Lisp calls to
 	delete-backward-char by calls to delete-char.
 
 2010-05-25  Kenichi Handa  <handa@m17n.org>
--- a/lisp/dired.el	Tue May 25 07:23:37 2010 +0000
+++ b/lisp/dired.el	Tue May 25 22:48:43 2010 +0000
@@ -1409,7 +1409,7 @@
     (define-key map "\C-t." 'image-dired-display-thumb)
     (define-key map "\C-tc" 'image-dired-dired-comment-files)
     (define-key map "\C-tf" 'image-dired-mark-tagged-files)
-    (define-key map "\C-t\C-t" 'image-dired-dired-insert-marked-thumbs)
+    (define-key map "\C-t\C-t" 'image-dired-dired-toggle-marked-thumbs)
     (define-key map "\C-te" 'image-dired-dired-edit-comment-and-tags)
     ;; encryption and decryption (epa-dired)
     (define-key map ":d" 'epa-dired-do-decrypt)
--- a/lisp/image-dired.el	Tue May 25 07:23:37 2010 +0000
+++ b/lisp/image-dired.el	Tue May 25 22:48:43 2010 +0000
@@ -157,6 +157,7 @@
 (require 'widget)
 
 (eval-when-compile
+  (require 'cl)
   (require 'wid-edit))
 
 (defgroup image-dired nil
@@ -632,26 +633,32 @@
     (call-process shell-file-name nil nil nil shell-command-switch command)))
 
 ;;;###autoload
-(defun image-dired-dired-insert-marked-thumbs ()
-  "Insert thumbnails before file names of marked files in the dired buffer."
-  (interactive)
+(defun image-dired-dired-toggle-marked-thumbs (&optional arg)
+  "Toggle thumbnails in front of file names in the dired buffer.
+If no marked file could be found, insert or hide thumbnails on the
+current line.  ARG, if non-nil, specifies the files to use instead
+of the marked files.  If ARG is an integer, use the next ARG (or
+previous -ARG, if ARG<0) files."
+  (interactive "P")
   (dired-map-over-marks
-   (let* ((image-pos (dired-move-to-filename))
-          (image-file (dired-get-filename))
-          (thumb-file (image-dired-get-thumbnail-image image-file))
+   (let* ((image-pos  (dired-move-to-filename))
+          (image-file (dired-get-filename 'no-dir t))
+          thumb-file
           overlay)
-     ;; If image is not already added, then add it.
-     (unless (delq nil (mapcar (lambda (o) (overlay-get o 'put-image))
-                               ;; Can't use (overlays-at (point)), BUG?
-                               (overlays-in (point) (1+ (point)))))
-       (put-image thumb-file image-pos)
-       (setq
-	overlay
-	(car (delq nil (mapcar (lambda (o) (and (overlay-get o 'put-image) o))
-			       (overlays-in (point) (1+ (point)))))))
-       (overlay-put overlay 'image-file image-file)
-       (overlay-put overlay 'thumb-file thumb-file)))
-   nil)
+     (when (and image-file (string-match-p (image-file-name-regexp) image-file))
+       (setq thumb-file (image-dired-get-thumbnail-image image-file))
+       ;; If image is not already added, then add it.
+       (let ((cur-ov (overlays-in (point) (1+ (point)))))
+         (if cur-ov
+             (delete-overlay (car cur-ov))
+	   (put-image thumb-file image-pos)
+	   (setq overlay (loop for o in (overlays-in (point) (1+ (point)))
+			       when (overlay-get o 'put-image) collect o into ov
+			       finally return (car ov)))
+	   (overlay-put overlay 'image-file image-file)
+	   (overlay-put overlay 'thumb-file thumb-file)))))
+   arg             ; Show or hide image on ARG next files.
+   'show-progress) ; Update dired display after each image is updated.
   (add-hook 'dired-after-readin-hook 'image-dired-dired-after-readin-hook nil t))
 
 (defun image-dired-dired-after-readin-hook ()
--- a/lisp/image-mode.el	Tue May 25 07:23:37 2010 +0000
+++ b/lisp/image-mode.el	Tue May 25 22:48:43 2010 +0000
@@ -357,6 +357,7 @@
 	(image-mode-setup-winprops)
 
 	(add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)
+	(add-hook 'after-revert-hook 'image-after-revert-hook nil t)
 	(run-mode-hooks 'image-mode-hook)
 	(message "%s" (concat
 		       (substitute-command-keys
@@ -503,6 +504,14 @@
   (if (image-get-display-property)
       (image-mode-as-text)
     (image-mode)))
+
+(defun image-after-revert-hook ()
+  (when (image-get-display-property)
+    (image-toggle-display-text)
+    ;; Update image display.
+    (redraw-frame (selected-frame))
+    (image-toggle-display-image)))
+
 
 ;;; Support for bookmark.el
 (declare-function bookmark-make-record-default "bookmark"
--- a/lisp/image.el	Tue May 25 07:23:37 2010 +0000
+++ b/lisp/image.el	Tue May 25 22:48:43 2010 +0000
@@ -685,10 +685,13 @@
     (let* ((metadata (image-metadata image))
 	   (images (plist-get metadata 'count))
 	   (extdata (plist-get metadata 'extension-data))
-	   (anim (plist-get extdata #xF9)))
-      (and (integerp images) (> images 1)
-	   (stringp anim) (>= (length anim) 4)
-	   (cons images (+ (aref anim 1) (* (aref anim 2) 256))))))))
+	   (anim (plist-get extdata #xF9))
+	   (tmo (and (integerp images) (> images 1)
+		     (stringp anim) (>= (length anim) 4)
+		     (+ (aref anim 1) (* (aref anim 2) 256)))))
+      (when tmo
+	(if (eq tmo 0) (setq tmo 10))
+	(cons images tmo))))))
 
 
 (provide 'image)
--- a/lisp/net/tramp-gvfs.el	Tue May 25 07:23:37 2010 +0000
+++ b/lisp/net/tramp-gvfs.el	Tue May 25 22:48:43 2010 +0000
@@ -874,10 +874,12 @@
 	    ;; there is only the question whether to accept an unknown
 	    ;; host signature.
 	    (with-temp-buffer
-	      (insert message)
-	      (pop-to-buffer (current-buffer))
-	      (setq choice (if (yes-or-no-p (concat (car choices) " ")) 0 1))
-	      (tramp-message v 6 "%d" choice))
+	      ;; Preserve message for `progress-reporter'.
+	      (with-temp-message ""
+		(insert message)
+		(pop-to-buffer (current-buffer))
+		(setq choice (if (yes-or-no-p (concat (car choices) " ")) 0 1))
+		(tramp-message v 6 "%d" choice)))
 
 	    ;; When the choice is "no", we set an empty
 	    ;; fuse-mountpoint in order to leave the timeout.
@@ -889,8 +891,8 @@
 	     nil ;; no abort of D-Bus.
 	     choice))
 
-	  ;; When QUIT is raised, we shall return this information to D-Bus.
-	  (quit (list nil t 0))))))
+	;; When QUIT is raised, we shall return this information to D-Bus.
+	(quit (list nil t 0))))))
 
 (defun tramp-gvfs-handler-mounted-unmounted (mount-info)
   "Signal handler for the \"org.gtk.vfs.MountTracker.mounted\" and
--- a/lisp/net/tramp.el	Tue May 25 07:23:37 2010 +0000
+++ b/lisp/net/tramp.el	Tue May 25 22:48:43 2010 +0000
@@ -2283,6 +2283,12 @@
 (put 'with-connection-property 'edebug-form-spec t)
 (font-lock-add-keywords 'emacs-lisp-mode '("\\<with-connection-property\\>"))
 
+(defun tramp-progress-reporter-update (reporter &optional value)
+  (let* ((parameters (cdr reporter))
+	 (message (aref parameters 3)))
+    (when (string-match message (or (current-message) ""))
+      (funcall 'progress-reporter-update reporter value))))
+
 (defmacro with-progress-reporter (vec level message &rest body)
   "Executes BODY, spinning a progress reporter with MESSAGE."
   `(let (pr tm)
@@ -2294,7 +2300,8 @@
 		(<= ,level (min tramp-verbose 3)))
        (condition-case nil
 	   (setq pr (tramp-compat-funcall 'make-progress-reporter ,message)
-		 tm (if pr (run-at-time 3 0.1 'progress-reporter-update pr)))
+		 tm (when pr
+		      (run-at-time 3 0.1 'tramp-progress-reporter-update pr)))
 	 (error nil)))
      (unwind-protect
 	 ;; Execute the body.
@@ -4293,13 +4300,11 @@
 	(forward-line -2)
 	(when (looking-at "//SUBDIRED//")
 	  (forward-line -1))
-	(when (looking-at "//DIRED//")
-	  (let ((end (tramp-compat-line-end-position))
-		(linebeg (point)))
+	(when (looking-at "//DIRED//\\s-+")
+	  (let ((databeg (match-end 0))
+		(end (tramp-compat-line-end-position)))
 	    ;; Now read the numeric positions of file names.
-	    (goto-char linebeg)
-	    (forward-word 1)
-	    (forward-char 3)
+	    (goto-char databeg)
 	    (while (< (point) end)
 	      (let ((start (+ beg (read (current-buffer))))
 		    (end (+ beg (read (current-buffer)))))
@@ -6734,27 +6739,29 @@
 
 (defun tramp-process-actions (proc vec actions &optional timeout)
   "Perform actions until success or TIMEOUT."
-  ;; Enable auth-source and password-cache.
-  (tramp-set-connection-property vec "first-password-request" t)
-  (let (exit)
-    (while (not exit)
-      (tramp-message proc 3 "Waiting for prompts from remote shell")
-      (setq exit
-	    (catch 'tramp-action
-	      (if timeout
-		  (with-timeout (timeout)
-		    (tramp-process-one-action proc vec actions))
-		(tramp-process-one-action proc vec actions)))))
-    (with-current-buffer (tramp-get-connection-buffer vec)
-      (tramp-message vec 6 "\n%s" (buffer-string)))
-    (unless (eq exit 'ok)
-      (tramp-clear-passwd vec)
-      (tramp-error-with-buffer
-       nil vec 'file-error
-       (cond
-	((eq exit 'permission-denied) "Permission denied")
-	((eq exit 'process-died) "Process died")
-	(t "Login failed"))))))
+  ;; Preserve message for `progress-reporter'.
+  (with-temp-message ""
+    ;; Enable auth-source and password-cache.
+    (tramp-set-connection-property vec "first-password-request" t)
+    (let (exit)
+      (while (not exit)
+	(tramp-message proc 3 "Waiting for prompts from remote shell")
+	(setq exit
+	      (catch 'tramp-action
+		(if timeout
+		    (with-timeout (timeout)
+		      (tramp-process-one-action proc vec actions))
+		  (tramp-process-one-action proc vec actions)))))
+      (with-current-buffer (tramp-get-connection-buffer vec)
+	(tramp-message vec 6 "\n%s" (buffer-string)))
+      (unless (eq exit 'ok)
+	(tramp-clear-passwd vec)
+	(tramp-error-with-buffer
+	 nil vec 'file-error
+	 (cond
+	  ((eq exit 'permission-denied) "Permission denied")
+	  ((eq exit 'process-died) "Process died")
+	  (t "Login failed")))))))
 
 ;; Utility functions.