From: Glenn Morris <rgm@gnu.org>
Date: Wed, 20 Feb 2008 06:01:01 +0000 (+0000)
Subject: (rmail-autodetect): Add .exe extension to movemail on Windows.
X-Git-Tag: emacs-pretest-22.1.92~114
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=219d93b8b4e14cf639c2032e5f31b60590b44b1f;p=emacs.git

(rmail-autodetect): Add .exe extension to movemail on Windows.
---

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 739f6f919cc..20a51a2ecc6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-20  Glenn Morris  <rgm@gnu.org>
+
+	* mail/rmail.el (rmail-autodetect): Add .exe extension to movemail
+	on Windows.
+
 2008-02-19  Alan Mackenzie  <acm@muc.de>
 
 	Set of changes so that "obtrusive" syntactic elements in a
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index b3a234a6210..4869f95689e 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1,7 +1,8 @@
 ;;; rmail.el --- main code of "RMAIL" mail reader for Emacs
 
 ;; Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998,
-;;   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: mail
@@ -214,7 +215,15 @@ Otherwise, look for `movemail' in the directories in
       (dolist (dir (append rmail-movemail-search-path exec-path
 			   (list exec-directory)))
 	(when (and dir (file-accessible-directory-p dir))
-	  (let ((progname (expand-file-name "movemail" dir)))
+	  ;; Previously, this didn't have to work on Windows, because
+	  ;; rmail-insert-inbox-text before r1.439 fell back to using
+	  ;; (expand-file-name "movemail" exec-directory) and just
+	  ;; assuming it would work.
+	  ;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2008-02/msg00087.html
+	  (let ((progname (expand-file-name
+			   (concat "movemail"
+				   (if (memq system-type '(ms-dos windows-nt))
+				       ".exe")) dir)))
 	    (when (and (not (file-directory-p progname))
 		       (file-executable-p progname))
 	      (let ((x (rmail-probe progname)))