Show
Ignore:
Timestamp:
08/10/06 11:19:54 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/complete.el

    r4098 r4140  
    544544                                          (file-name-nondirectory (substring str 0 p)) 
    545545                                        (substring str 0 p)) 
    546                                         table 
    547                                         pred))) 
     546                                      table 
     547                                      pred))) 
    548548          (setq p compl) 
    549549          (while p 
     
    553553                   (setq poss (cons (car p) poss)))) 
    554554            (setq p (cdr p))))) 
     555 
     556      ;; Handle completion-ignored-extensions 
     557      (and filename 
     558           (not (eq mode 'help)) 
     559           (let ((p2 poss)) 
     560 
     561             ;; Build a regular expression representing the extensions list 
     562             (or (equal completion-ignored-extensions PC-ignored-extensions) 
     563                 (setq PC-ignored-regexp 
     564                       (concat "\\(" 
     565                               (mapconcat 
     566                                'regexp-quote 
     567                                (setq PC-ignored-extensions 
     568                                      completion-ignored-extensions) 
     569                                "\\|") 
     570                               "\\)\\'"))) 
     571 
     572             ;; Check if there are any without an ignored extension. 
     573             ;; Also ignore `.' and `..'. 
     574             (setq p nil) 
     575             (while p2 
     576               (or (string-match PC-ignored-regexp (car p2)) 
     577                   (string-match "\\(\\`\\|/\\)[.][.]?/?\\'" (car p2)) 
     578                   (setq p (cons (car p2) p))) 
     579               (setq p2 (cdr p2))) 
     580 
     581             ;; If there are "good" names, use them 
     582             (and p (setq poss p)))) 
    555583 
    556584      ;; Now we have a list of possible completions 
     
    576604            (memq mode '(help word))) 
    577605 
    578         ;; Handle completion-ignored-extensions 
    579         (and filename 
    580              (not (eq mode 'help)) 
    581              (let ((p2 poss)) 
    582  
    583                ;; Build a regular expression representing the extensions list 
    584                (or (equal completion-ignored-extensions PC-ignored-extensions) 
    585                    (setq PC-ignored-regexp 
    586                          (concat "\\(" 
    587                                  (mapconcat 
    588                                   'regexp-quote 
    589                                   (setq PC-ignored-extensions 
    590                                         completion-ignored-extensions) 
    591                                   "\\|") 
    592                                  "\\)\\'"))) 
    593  
    594                ;; Check if there are any without an ignored extension. 
    595                ;; Also ignore `.' and `..'. 
    596                (setq p nil) 
    597                (while p2 
    598                  (or (string-match PC-ignored-regexp (car p2)) 
    599                      (string-match "\\(\\`\\|/\\)[.][.]?/?\\'" (car p2)) 
    600                      (setq p (cons (car p2) p))) 
    601                  (setq p2 (cdr p2))) 
    602  
    603                ;; If there are "good" names, use them 
    604                (and p (setq poss p)))) 
    605  
    606606        ;; Is the actual string one of the possible completions? 
    607607        (setq p (and (not (eq mode 'help)) poss)) 
     
    624624            ;; Check if next few letters are the same in all cases 
    625625            (if (and (not (eq mode 'help)) 
    626                      (setq prefix (try-completion (PC-chunk-after basestr skip) (mapcar 'list poss)))) 
     626                     (setq prefix (try-completion (PC-chunk-after basestr skip) 
     627                                                  poss))) 
    627628                (let ((first t) i) 
    628629                  ;; Retain capitalization of user input even if 
     
    670671                                             skip) 
    671672                                            (mapcar 
    672                                              (function 
    673                                               (lambda (x) 
    674                                                 (list 
    675                                                  (and (string-match skip x) 
    676                                                       (substring 
    677                                                        x 
    678                                                        (match-end 0)))))) 
     673                                             (lambda (x) 
     674                                               (when (string-match skip x) 
     675                                                 (substring x (match-end 0)))) 
    679676                                             poss))) 
    680677                              (or (> i 0) (> (length prefix) 0)) 
     
    812809  (with-current-buffer (generate-new-buffer " *Glob Output*") 
    813810    (erase-buffer) 
     811    (when (and (file-name-absolute-p name) 
     812               (not (file-directory-p default-directory))) 
     813      ;; If the current working directory doesn't exist `shell-command' 
     814      ;; signals an error.  So if the file names we're looking for don't 
     815      ;; depend on the working directory, switch to a valid directory first. 
     816      (setq default-directory "/")) 
    814817    (shell-command (concat "echo " name) t) 
    815818    (goto-char (point-min))