| 299 | | (buffer-undo-list t)) |
|---|
| 300 | | (erase-buffer) |
|---|
| 301 | | |
|---|
| 302 | | (setq locate-current-filter filter) |
|---|
| 303 | | |
|---|
| 304 | | (if run-locate-command |
|---|
| 305 | | (shell-command search-string locate-buffer-name) |
|---|
| 306 | | (apply 'call-process locate-cmd nil t nil locate-cmd-args)) |
|---|
| 307 | | |
|---|
| 308 | | (and filter |
|---|
| 309 | | (locate-filter-output filter)) |
|---|
| 310 | | |
|---|
| 311 | | (locate-do-setup search-string) |
|---|
| 312 | | )) |
|---|
| 313 | | (and (not (string-equal (buffer-name) locate-buffer-name)) |
|---|
| 314 | | (switch-to-buffer-other-window locate-buffer-name)) |
|---|
| | 306 | (buffer-undo-list t)) |
|---|
| | 307 | (erase-buffer) |
|---|
| | 308 | |
|---|
| | 309 | (set (make-local-variable 'locate-current-search) search-string) |
|---|
| | 310 | (set (make-local-variable 'locate-current-filter) filter) |
|---|
| | 311 | |
|---|
| | 312 | (if run-locate-command |
|---|
| | 313 | (shell-command search-string) |
|---|
| | 314 | (apply 'call-process locate-cmd nil t nil locate-cmd-args)) |
|---|
| | 315 | |
|---|
| | 316 | (and filter |
|---|
| | 317 | (locate-filter-output filter)) |
|---|
| | 318 | |
|---|
| | 319 | (locate-do-setup search-string))) |
|---|
| | 320 | |
|---|
| | 321 | (unless (eq (current-buffer) locate-buffer) |
|---|
| | 322 | (switch-to-buffer-other-window locate-buffer)) |
|---|
| 495 | | (kill-buffer locate-buffer-name) |
|---|
| 496 | | (if locate-current-filter |
|---|
| 497 | | (error "Locate: no match for %s in database using filter %s" |
|---|
| 498 | | search-string locate-current-filter) |
|---|
| 499 | | (error "Locate: no match for %s in database" search-string)))) |
|---|
| | 504 | (let ((filter locate-current-filter)) ; local |
|---|
| | 505 | (kill-buffer (current-buffer)) |
|---|
| | 506 | (if filter |
|---|
| | 507 | (error "Locate: no match for %s in database using filter %s" |
|---|
| | 508 | search-string filter) |
|---|
| | 509 | (error "Locate: no match for %s in database" search-string))))) |
|---|
| 583 | | (let ((str (car locate-history-list))) |
|---|
| 584 | | (and locate-update-when-revert |
|---|
| 585 | | (yes-or-no-p "Update locate database (may take a few seconds)? ") |
|---|
| 586 | | ;; `expand-file-name' is used in order to autoload Tramp if |
|---|
| 587 | | ;; necessary. It cannot be loaded when `default-directory' |
|---|
| 588 | | ;; is remote. |
|---|
| 589 | | (let ((default-directory (expand-file-name locate-update-path))) |
|---|
| 590 | | (shell-command locate-update-command))) |
|---|
| 591 | | (locate str))) |
|---|
| | 593 | (and locate-update-when-revert |
|---|
| | 594 | (yes-or-no-p "Update locate database (may take a few seconds)? ") |
|---|
| | 595 | ;; `expand-file-name' is used in order to autoload Tramp if |
|---|
| | 596 | ;; necessary. It cannot be loaded when `default-directory' |
|---|
| | 597 | ;; is remote. |
|---|
| | 598 | (let ((default-directory (expand-file-name locate-update-path))) |
|---|
| | 599 | (shell-command locate-update-command))) |
|---|
| | 600 | (locate locate-current-search locate-current-filter)) |
|---|