emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r117076: Use file-accessible-directory-p in some mor


From: Glenn Morris
Subject: [Emacs-diffs] trunk r117076: Use file-accessible-directory-p in some more places
Date: Fri, 09 May 2014 07:02:22 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117076
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Fri 2014-05-09 00:02:00 -0700
message:
  Use file-accessible-directory-p in some more places
  
  * lisp/files.el (file-expand-wildcards):
  * lisp/man.el (Man-support-local-filenames):
  * lisp/printing.el (pr-i-directory, pr-interface-directory):
  * lisp/progmodes/grep.el (lgrep, rgrep):
  * lisp/textmodes/ispell.el (ispell-call-process)
  (ispell-call-process-region, ispell-start-process)
  (ispell-init-process):
  * lisp/mh-e/mh-e.el (mh-variants):
  Use file-accessible-directory-p.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/files.el                  files.el-20091113204419-o5vbwnq5f7feedwu-265
  lisp/man.el                    man.el-20091113204419-o5vbwnq5f7feedwu-582
  lisp/mh-e/ChangeLog            changelog-20091113204419-o5vbwnq5f7feedwu-2547
  lisp/mh-e/mh-e.el              mhe.el-20091113204419-o5vbwnq5f7feedwu-2534
  lisp/printing.el               
printing.el-20091113204419-o5vbwnq5f7feedwu-2550
  lisp/progmodes/grep.el         grep.el-20091113204419-o5vbwnq5f7feedwu-2948
  lisp/textmodes/ispell.el       ispell.el-20091113204419-o5vbwnq5f7feedwu-694
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-05-08 03:41:21 +0000
+++ b/lisp/ChangeLog    2014-05-09 07:02:00 +0000
@@ -1,3 +1,13 @@
+2014-05-09  Glenn Morris  <address@hidden>
+
+       * files.el (file-expand-wildcards):
+       * man.el (Man-support-local-filenames):
+       * printing.el (pr-i-directory, pr-interface-directory):
+       * progmodes/grep.el (lgrep, rgrep):
+       * textmodes/ispell.el (ispell-call-process)
+       (ispell-call-process-region, ispell-start-process)
+       (ispell-init-process): Use file-accessible-directory-p.
+
 2014-05-08  Stefan Monnier  <address@hidden>
 
        * xt-mouse.el: Drop spurious/oddly shaped events (bug#17378).

=== modified file 'lisp/files.el'
--- a/lisp/files.el     2014-04-07 20:54:16 +0000
+++ b/lisp/files.el     2014-05-09 07:02:00 +0000
@@ -5987,10 +5987,9 @@
                             (file-expand-wildcards (directory-file-name 
dirpart)))
                   (list dirpart)))
           contents)
-      (while dirs
-       (when (or (null (car dirs))     ; Possible if DIRPART is not wild.
-                 (and (file-directory-p (directory-file-name (car dirs)))
-                      (file-readable-p (car dirs))))
+      (dolist (dir dirs)
+       (when (or (null dir)    ; Possible if DIRPART is not wild.
+                 (file-accessible-directory-p dir))
          (let ((this-dir-contents
                 ;; Filter out "." and ".."
                 (delq nil
@@ -5998,16 +5997,15 @@
                                   (unless (string-match "\\`\\.\\.?\\'"
                                                         
(file-name-nondirectory name))
                                     name))
-                              (directory-files (or (car dirs) ".") full
+                              (directory-files (or dir ".") full
                                                (wildcard-to-regexp nondir))))))
            (setq contents
                  (nconc
-                  (if (and (car dirs) (not full))
-                      (mapcar (function (lambda (name) (concat (car dirs) 
name)))
+                  (if (and dir (not full))
+                      (mapcar #'(lambda (name) (concat dir name))
                               this-dir-contents)
                     this-dir-contents)
-                  contents))))
-       (setq dirs (cdr dirs)))
+                  contents)))))
       contents)))
 
 ;; Let Tramp know that `file-expand-wildcards' does not need an advice.

=== modified file 'lisp/man.el'
--- a/lisp/man.el       2014-02-10 01:34:22 +0000
+++ b/lisp/man.el       2014-05-09 07:02:00 +0000
@@ -1,7 +1,6 @@
 ;;; man.el --- browse UNIX manual pages  -*- coding: utf-8 -*-
 
-;; Copyright (C) 1993-1994, 1996-1997, 2001-2014 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1993-1994, 1996-1997, 2001-2014 Free Software Foundation, Inc.
 
 ;; Author: Barry A. Warsaw <address@hidden>
 ;; Maintainer: address@hidden
@@ -695,9 +694,8 @@
             (with-temp-buffer
               (let ((default-directory
                       ;; Ensure that `default-directory' exists and is 
readable.
-                      (if (and (file-directory-p default-directory)
-                               (file-readable-p default-directory))
-                        default-directory
+                      (if (file-accessible-directory-p default-directory)
+                          default-directory
                         (expand-file-name "~/"))))
                 (ignore-errors
                   (call-process manual-program nil t nil "--help")))

=== modified file 'lisp/mh-e/ChangeLog'
--- a/lisp/mh-e/ChangeLog       2014-03-17 00:50:05 +0000
+++ b/lisp/mh-e/ChangeLog       2014-05-09 07:02:00 +0000
@@ -1,3 +1,7 @@
+2014-05-09  Glenn Morris  <address@hidden>
+
+       * mh-e.el (mh-variants): Use file-accessible-directory-p.
+
 2014-03-16  Bill Wohler  <address@hidden>
 
        * mh-folder.el (mh-regenerate-headers): Fix scan: bad message list

=== modified file 'lisp/mh-e/mh-e.el'
--- a/lisp/mh-e/mh-e.el 2014-02-24 02:04:35 +0000
+++ b/lisp/mh-e/mh-e.el 2014-05-09 07:02:00 +0000
@@ -1,7 +1,7 @@
 ;;; mh-e.el --- GNU Emacs interface to the MH mail system
 
-;; Copyright (C) 1985-1988, 1990, 1992-1995, 1997, 1999-2014 Free
-;; Software Foundation, Inc.
+;; Copyright (C) 1985-1988, 1990, 1992-1995, 1997, 1999-2014
+;;   Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <address@hidden>
 ;; Maintainer: Bill Wohler <address@hidden>
@@ -739,7 +739,7 @@
             (setq dir (file-chase-links (directory-file-name dir)))
             (add-to-list 'list-unique dir))
       (loop for dir in (nreverse list-unique) do
-            (when (and dir (file-directory-p dir) (file-readable-p dir))
+            (when (and dir (file-accessible-directory-p dir))
               (let ((variant (mh-variant-info dir)))
                 (if variant
                     (add-to-list 'mh-variants variant)))))

=== modified file 'lisp/printing.el'
--- a/lisp/printing.el  2014-01-01 07:43:34 +0000
+++ b/lisp/printing.el  2014-05-09 07:02:00 +0000
@@ -6543,8 +6543,7 @@
 
 
 (defun pr-i-directory ()
-  (or (and (file-directory-p pr-i-directory)
-          (file-readable-p pr-i-directory))
+  (or (file-accessible-directory-p pr-i-directory)
       (error "Please specify be a readable directory")))
 
 
@@ -6552,8 +6551,7 @@
   (and pr-buffer-verbose
        (message "You can use M-TAB or ESC TAB for file completion"))
   (let ((dir (widget-value widget)))
-    (and (file-directory-p dir)
-        (file-readable-p dir)
+    (and (file-accessible-directory-p dir)
         (setq pr-i-directory dir))))
 
 

=== modified file 'lisp/progmodes/grep.el'
--- a/lisp/progmodes/grep.el    2014-04-12 19:38:06 +0000
+++ b/lisp/progmodes/grep.el    2014-05-09 07:02:00 +0000
@@ -1,7 +1,6 @@
 ;;; grep.el --- run `grep' and display the results  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985-1987, 1993-1999, 2001-2014 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985-1987, 1993-1999, 2001-2014 Free Software Foundation, Inc.
 
 ;; Author: Roland McGrath <address@hidden>
 ;; Maintainer: address@hidden
@@ -905,7 +904,7 @@
                (confirm (equal current-prefix-arg '(4))))
           (list regexp files dir confirm))))))
   (when (and (stringp regexp) (> (length regexp) 0))
-    (unless (and dir (file-directory-p dir) (file-readable-p dir))
+    (unless (and dir (file-acessible-directory-p dir))
       (setq dir default-directory))
     (let ((command regexp))
       (if (null files)
@@ -986,7 +985,7 @@
                (confirm (equal current-prefix-arg '(4))))
           (list regexp files dir confirm))))))
   (when (and (stringp regexp) (> (length regexp) 0))
-    (unless (and dir (file-directory-p dir) (file-readable-p dir))
+    (unless (and dir (file-accessible-directory-p dir))
       (setq dir default-directory))
     (if (null files)
        (if (not (string= regexp (if (consp grep-find-command)

=== modified file 'lisp/textmodes/ispell.el'
--- a/lisp/textmodes/ispell.el  2014-01-31 09:41:54 +0000
+++ b/lisp/textmodes/ispell.el  2014-05-09 07:02:00 +0000
@@ -931,16 +931,14 @@
 (defun ispell-call-process (&rest args)
   "Like `call-process' but defend against bad `default-directory'."
   (let ((default-directory default-directory))
-    (unless (and (file-directory-p default-directory)
-                (file-readable-p default-directory))
+    (unless (file-accessible-directory-p default-directory)
       (setq default-directory (expand-file-name "~/")))
     (apply 'call-process args)))
 
 (defun ispell-call-process-region (&rest args)
   "Like `call-process-region' but defend against bad `default-directory'."
   (let ((default-directory default-directory))
-    (unless (and (file-directory-p default-directory)
-                (file-readable-p default-directory))
+    (unless (file-accessible-directory-p default-directory)
       (setq default-directory (expand-file-name "~/")))
     (apply 'call-process-region args)))
 
@@ -2939,8 +2937,7 @@
          (ispell-hunspell-fill-dictionary-entry ispell-current-dictionary)))
 
   (let* ((default-directory
-           (if (and (file-directory-p default-directory)
-                    (file-readable-p default-directory))
+           (if (file-accessible-directory-p default-directory)
                default-directory
              ;; Defend against bad `default-directory'.
              (expand-file-name "~/")))
@@ -2998,8 +2995,7 @@
           (if (or ispell-really-aspell
                   ispell-really-hunspell
                   ;; Protect against bad default-directory
-                  (not (and (file-directory-p default-directory)
-                            (file-readable-p default-directory)))
+                  (not (file-accessible-directory-p default-directory))
                   ;; Ispell and per-dir personal dicts available
                   (not (or (file-readable-p (concat default-directory
                                                     ".ispell_words"))


reply via email to

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