diff options
| author | Thierry Volpiatto | 2016-02-25 16:43:52 +1030 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-25 16:43:52 +1030 |
| commit | e65d4d3a5d7748aa742112a6065e1eeeac0275a6 (patch) | |
| tree | 183ed8d7b15ec88d74124fa8cd2bc2cd52008466 | |
| parent | fecd5e589d01b39e9c0c2f0a9ed300ba8cb09817 (diff) | |
| download | emacs-e65d4d3a5d7748aa742112a6065e1eeeac0275a6.tar.gz emacs-e65d4d3a5d7748aa742112a6065e1eeeac0275a6.zip | |
Add pcomplete support for find
* lisp/pcmpl-gnu.el (pcomplete/find): Add pcomplete support
for find (bug#10487).
| -rw-r--r-- | lisp/pcmpl-gnu.el | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lisp/pcmpl-gnu.el b/lisp/pcmpl-gnu.el index f84a1ceba41..84e42aefbf9 100644 --- a/lisp/pcmpl-gnu.el +++ b/lisp/pcmpl-gnu.el | |||
| @@ -329,6 +329,41 @@ | |||
| 329 | nil 'identity)))) | 329 | nil 'identity)))) |
| 330 | 330 | ||
| 331 | ;;;###autoload | 331 | ;;;###autoload |
| 332 | (defun pcomplete/find () | ||
| 333 | "Completion for GNU find utility." | ||
| 334 | (let ((prec (pcomplete-arg 'last -1))) | ||
| 335 | (cond ((and (pcomplete-match "^-" 'last) | ||
| 336 | (string= "find" prec)) | ||
| 337 | (pcomplete-opt "HLPDO")) | ||
| 338 | ((pcomplete-match "^-" 'last) | ||
| 339 | (while (pcomplete-here | ||
| 340 | '("-amin" "-anewer" "-atime" "-cmin" "-cnewer" "-context" | ||
| 341 | "-ctime" "-daystart" "-delete" "-depth" "-empty" "-exec" | ||
| 342 | "-execdir" "-executable" "-false" "-fls" "-follow" | ||
| 343 | "-fprint" "-fprint0" "-fprintf" "-fstype" "-gid" "-group" | ||
| 344 | "-help" "-ignore_readdir_race" "-ilname" "-iname" | ||
| 345 | "-inum" "-ipath" "-iregex" "-iwholename" | ||
| 346 | "-links" "-lname" "-ls" "-maxdepth" | ||
| 347 | "-mindepth" "-mmin" "-mount" "-mtime" | ||
| 348 | "-name" "-newer" "-nogroup" "-noignore_readdir_race" | ||
| 349 | "-noleaf" "-nouser" "-nowarn" "-ok" | ||
| 350 | "-okdir" "-path" "-perm" "-print" | ||
| 351 | "-print0" "-printf" "-prune" "-quit" | ||
| 352 | "-readable" "-regex" "-regextype" "-samefile" | ||
| 353 | "-size" "-true" "-type" "-uid" | ||
| 354 | "-used" "-user" "-version" "-warn" | ||
| 355 | "-wholename" "-writable" "-xdev" "-xtype")))) | ||
| 356 | ((string= "-type" prec) | ||
| 357 | (while (pcomplete-here (list "b" "c" "d" "p" "f" "l" "s" "D")))) | ||
| 358 | ((string= "-xtype" prec) | ||
| 359 | (while (pcomplete-here (list "b" "c" "d" "p" "f" "l" "s")))) | ||
| 360 | ((or (string= prec "-exec") | ||
| 361 | (string= prec "-execdir")) | ||
| 362 | (while (pcomplete-here* (funcall pcomplete-command-completion-function) | ||
| 363 | (pcomplete-arg 'last) t)))) | ||
| 364 | (while (pcomplete-here (pcomplete-entries) nil 'identity)))) | ||
| 365 | |||
| 366 | ;;;###autoload | ||
| 332 | (defalias 'pcomplete/gdb 'pcomplete/xargs) | 367 | (defalias 'pcomplete/gdb 'pcomplete/xargs) |
| 333 | 368 | ||
| 334 | ;;; pcmpl-gnu.el ends here | 369 | ;;; pcmpl-gnu.el ends here |