emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: Re: rmail passing movemail an option it doesn't like


From: Glenn Morris
Subject: Re: address@hidden: Re: rmail passing movemail an option it doesn't like]
Date: Wed, 22 Aug 2007 23:54:56 -0400

Replying to message received off-list. I don't have much of an opinion
here; other might.


Johannes Weiner wrote (on Wed, 22 Aug 2007 at 07:11 +0200):

> 1. If M-x rmail is *not* the only entry point, `rmail-insert-inbox-text'
>    should be safe for the worst case.

Personally, I think it's tidier to do initialization of global
variables near the top-level, rather than "hidden" away in a function,
even if it does work.

> 2. `rmail-autodetect' currently does not do what its comment says.

But it works, so this is just semantics IMO.

> I think I fixed both issues with the attached patch.  Please have a look at
> it.  HTH!
> 
>       Hannes
> diff -Naur emacs.orig/lisp/mail/rmail.el emacs/lisp/mail/rmail.el
> --- emacs.orig/lisp/mail/rmail.el     2007-08-22 06:44:42.000000000 +0200
> +++ emacs/lisp/mail/rmail.el  2007-08-22 06:52:58.000000000 +0200
> @@ -203,24 +203,26 @@
>         ;; FIXME:
>         'emacs))))))
>  
> -(defun rmail-autodetect ()
> +(defun rmail-find-movemail-program ()
>    "Determine and return the file name of the `movemail' program.
>  If `rmail-movemail-program' is non-nil, use it.
>  Otherwise, look for `movemail' in the directories in
>  `rmail-movemail-search-path', those in `exec-path', and `exec-directory'."
> -  (if rmail-movemail-program
> -      (rmail-probe rmail-movemail-program)
> -    (catch 'scan
> -      (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)))
> -         (when (and (not (file-directory-p progname))
> -                    (file-executable-p progname))
> -           (let ((x (rmail-probe progname)))
> -             (when x
> +  (or rmail-movemail-program
> +      (catch 'scan
> +     (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)))
> +           (when (and (not (file-directory-p progname))
> +                      (file-executable-p progname))
> +             (when (rmail-probe progname)
>                 (setq rmail-movemail-program progname)
> -               (throw 'scan x))))))))))
> +               (throw 'scan progname)))))))))
> +
> +(defun rmail-autodetect ()
> +  "Determine the flavor of the `movemail' program."
> +  (rmail-probe (rmail-find-movemail-program)))
>  
>  (defvar rmail-movemail-variant-in-use nil
>    "The movemail variant currently in use. Known variants are:
> @@ -1818,9 +1820,7 @@
>                (buffer-disable-undo errors)
>                (let ((args
>                       (append
> -                      (list (or rmail-movemail-program
> -                                (expand-file-name "movemail"
> -                                                  exec-directory))
> +                      (list (rmail-find-movemail-program)
>                              nil errors nil)
>                        (if rmail-preserve-inbox
>                            (list "-p")





reply via email to

[Prev in Thread] Current Thread [Next in Thread]