diff options
| author | Karoly Lorentey | 2006-10-14 16:56:21 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-10-14 16:56:21 +0000 |
| commit | 3f87f67ee215ffeecbd2f53bd7f342cdf03f47df (patch) | |
| tree | 16f2af9111af08a94d608d96a957f5c3ec5effcc /lisp/complete.el | |
| parent | 350e4fb815d7413ef6d339dd664014706f742927 (diff) | |
| parent | 7a210b69c7f92650c524766d1b9d3f3eefdd67c7 (diff) | |
| download | emacs-3f87f67ee215ffeecbd2f53bd7f342cdf03f47df.tar.gz emacs-3f87f67ee215ffeecbd2f53bd7f342cdf03f47df.zip | |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-371
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-372
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-373
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-374
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-375
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-376
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-377
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-378
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-379
Merge from erc--emacs--21
* emacs@sv.gnu.org/emacs--devo--0--patch-380
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-381
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-382
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-383
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-384
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-385
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-386
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-387
Fix ERC bug introduced in last patch
* emacs@sv.gnu.org/emacs--devo--0--patch-388
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-389
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-390
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-391
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-392
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-393
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-394
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-395
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-396
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-397
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-398
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-399
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-400
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-401
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-402
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-403
Rcirc update from Ryan Yeske
* emacs@sv.gnu.org/emacs--devo--0--patch-404
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-405
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-406
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-407
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-408
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-409
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-410
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-411
Miscellaneous tq-related fixes.
* emacs@sv.gnu.org/emacs--devo--0--patch-412
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-121
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-122
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-123
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-124
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-125
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-126
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-127
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-581
Diffstat (limited to 'lisp/complete.el')
| -rw-r--r-- | lisp/complete.el | 79 |
1 files changed, 41 insertions, 38 deletions
diff --git a/lisp/complete.el b/lisp/complete.el index ca6231893c3..90c1ceceb32 100644 --- a/lisp/complete.el +++ b/lisp/complete.el | |||
| @@ -543,8 +543,8 @@ of `minibuffer-completion-table' and the minibuffer contents.") | |||
| 543 | (let ((compl (all-completions (if env-on | 543 | (let ((compl (all-completions (if env-on |
| 544 | (file-name-nondirectory (substring str 0 p)) | 544 | (file-name-nondirectory (substring str 0 p)) |
| 545 | (substring str 0 p)) | 545 | (substring str 0 p)) |
| 546 | table | 546 | table |
| 547 | pred))) | 547 | pred))) |
| 548 | (setq p compl) | 548 | (setq p compl) |
| 549 | (while p | 549 | (while p |
| 550 | (and (string-match regex (car p)) | 550 | (and (string-match regex (car p)) |
| @@ -553,6 +553,34 @@ of `minibuffer-completion-table' and the minibuffer contents.") | |||
| 553 | (setq poss (cons (car p) poss)))) | 553 | (setq poss (cons (car p) poss)))) |
| 554 | (setq p (cdr p))))) | 554 | (setq p (cdr p))))) |
| 555 | 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)))) | ||
| 583 | |||
| 556 | ;; Now we have a list of possible completions | 584 | ;; Now we have a list of possible completions |
| 557 | (cond | 585 | (cond |
| 558 | 586 | ||
| @@ -575,34 +603,6 @@ of `minibuffer-completion-table' and the minibuffer contents.") | |||
| 575 | ((or (cdr (setq helpposs poss)) | 603 | ((or (cdr (setq helpposs poss)) |
| 576 | (memq mode '(help word))) | 604 | (memq mode '(help word))) |
| 577 | 605 | ||
| 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 | |||
| 606 | ;; Is the actual string one of the possible completions? | 606 | ;; Is the actual string one of the possible completions? |
| 607 | (setq p (and (not (eq mode 'help)) poss)) | 607 | (setq p (and (not (eq mode 'help)) poss)) |
| 608 | (while (and p | 608 | (while (and p |
| @@ -623,7 +623,8 @@ of `minibuffer-completion-table' and the minibuffer contents.") | |||
| 623 | 623 | ||
| 624 | ;; Check if next few letters are the same in all cases | 624 | ;; Check if next few letters are the same in all cases |
| 625 | (if (and (not (eq mode 'help)) | 625 | (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))) | ||
| 627 | (let ((first t) i) | 628 | (let ((first t) i) |
| 628 | ;; Retain capitalization of user input even if | 629 | ;; Retain capitalization of user input even if |
| 629 | ;; completion-ignore-case is set. | 630 | ;; completion-ignore-case is set. |
| @@ -669,13 +670,9 @@ of `minibuffer-completion-table' and the minibuffer contents.") | |||
| 669 | (+ beg (length dirname)) end) | 670 | (+ beg (length dirname)) end) |
| 670 | skip) | 671 | skip) |
| 671 | (mapcar | 672 | (mapcar |
| 672 | (function | 673 | (lambda (x) |
| 673 | (lambda (x) | 674 | (when (string-match skip x) |
| 674 | (list | 675 | (substring x (match-end 0)))) |
| 675 | (and (string-match skip x) | ||
| 676 | (substring | ||
| 677 | x | ||
| 678 | (match-end 0)))))) | ||
| 679 | poss))) | 676 | poss))) |
| 680 | (or (> i 0) (> (length prefix) 0)) | 677 | (or (> i 0) (> (length prefix) 0)) |
| 681 | (or (not (eq mode 'word)) | 678 | (or (not (eq mode 'word)) |
| @@ -811,6 +808,12 @@ or properties are considered." | |||
| 811 | (defun PC-expand-many-files (name) | 808 | (defun PC-expand-many-files (name) |
| 812 | (with-current-buffer (generate-new-buffer " *Glob Output*") | 809 | (with-current-buffer (generate-new-buffer " *Glob Output*") |
| 813 | (erase-buffer) | 810 | (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 "/")) | ||
| 814 | (shell-command (concat "echo " name) t) | 817 | (shell-command (concat "echo " name) t) |
| 815 | (goto-char (point-min)) | 818 | (goto-char (point-min)) |
| 816 | ;; CSH-style shells were known to output "No match", whereas | 819 | ;; CSH-style shells were known to output "No match", whereas |