diff options
| author | Glenn Morris | 2013-06-12 00:54:57 -0700 |
|---|---|---|
| committer | Glenn Morris | 2013-06-12 00:54:57 -0700 |
| commit | 84d6f46535554f9f51aae3314313112e8d755c65 (patch) | |
| tree | 6d991a504a06be19519068dad45d2a44dd757c55 /lisp | |
| parent | 001809f678cada446aaa752a8a12dad1ae9cdc42 (diff) | |
| download | emacs-84d6f46535554f9f51aae3314313112e8d755c65.tar.gz emacs-84d6f46535554f9f51aae3314313112e8d755c65.zip | |
* lisp/ido.el: Convert some function comments to basic doc strings
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ido.el | 88 |
1 files changed, 43 insertions, 45 deletions
diff --git a/lisp/ido.el b/lisp/ido.el index 14d1be5b763..47c05b080f7 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -3301,7 +3301,7 @@ for first matching file." | |||
| 3301 | res)) | 3301 | res)) |
| 3302 | 3302 | ||
| 3303 | (defun ido-flatten-merged-list (items) | 3303 | (defun ido-flatten-merged-list (items) |
| 3304 | ;; Create a list of directory names based on a merged directory list. | 3304 | "Create a list of directory names based on a merged directory list." |
| 3305 | (let (res) | 3305 | (let (res) |
| 3306 | (while items | 3306 | (while items |
| 3307 | (let* ((item (car items)) | 3307 | (let* ((item (car items)) |
| @@ -3404,7 +3404,7 @@ for first matching file." | |||
| 3404 | res)) | 3404 | res)) |
| 3405 | 3405 | ||
| 3406 | (defun ido-make-buffer-list-1 (&optional frame visible) | 3406 | (defun ido-make-buffer-list-1 (&optional frame visible) |
| 3407 | ;; Return list of non-ignored buffer names | 3407 | "Return list of non-ignored buffer names." |
| 3408 | (delq nil | 3408 | (delq nil |
| 3409 | (mapcar | 3409 | (mapcar |
| 3410 | (lambda (x) | 3410 | (lambda (x) |
| @@ -3414,12 +3414,12 @@ for first matching file." | |||
| 3414 | (buffer-list frame)))) | 3414 | (buffer-list frame)))) |
| 3415 | 3415 | ||
| 3416 | (defun ido-make-buffer-list (default) | 3416 | (defun ido-make-buffer-list (default) |
| 3417 | ;; Return the current list of buffers. | 3417 | "Return the current list of buffers. |
| 3418 | ;; Currently visible buffers are put at the end of the list. | 3418 | Currently visible buffers are put at the end of the list. |
| 3419 | ;; The hook `ido-make-buffer-list-hook' is run after the list has been | 3419 | The hook `ido-make-buffer-list-hook' is run after the list has been |
| 3420 | ;; created to allow the user to further modify the order of the buffer names | 3420 | created to allow the user to further modify the order of the buffer names |
| 3421 | ;; in this list. If DEFAULT is non-nil, and corresponds to an existing buffer, | 3421 | in this list. If DEFAULT is non-nil, and corresponds to an existing buffer, |
| 3422 | ;; it is put to the start of the list. | 3422 | it is put to the start of the list." |
| 3423 | (let* ((ido-current-buffers (ido-get-buffers-in-frames 'current)) | 3423 | (let* ((ido-current-buffers (ido-get-buffers-in-frames 'current)) |
| 3424 | (ido-temp-list (ido-make-buffer-list-1 (selected-frame) ido-current-buffers))) | 3424 | (ido-temp-list (ido-make-buffer-list-1 (selected-frame) ido-current-buffers))) |
| 3425 | (if ido-temp-list | 3425 | (if ido-temp-list |
| @@ -3461,9 +3461,9 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3461 | (nreverse (mapcar #'car ido-virtual-buffers)))))) | 3461 | (nreverse (mapcar #'car ido-virtual-buffers)))))) |
| 3462 | 3462 | ||
| 3463 | (defun ido-make-choice-list (default) | 3463 | (defun ido-make-choice-list (default) |
| 3464 | ;; Return the current list of choices. | 3464 | "Return the current list of choices. |
| 3465 | ;; If DEFAULT is non-nil, and corresponds to an element of choices, | 3465 | If DEFAULT is non-nil, and corresponds to an element of choices, |
| 3466 | ;; it is put to the start of the list. | 3466 | it is put to the start of the list." |
| 3467 | (let ((ido-temp-list ido-choice-list)) | 3467 | (let ((ido-temp-list ido-choice-list)) |
| 3468 | (if default | 3468 | (if default |
| 3469 | (progn | 3469 | (progn |
| @@ -3475,7 +3475,7 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3475 | ido-temp-list)) | 3475 | ido-temp-list)) |
| 3476 | 3476 | ||
| 3477 | (defun ido-to-end (items) | 3477 | (defun ido-to-end (items) |
| 3478 | ;; Move the elements from ITEMS to the end of `ido-temp-list' | 3478 | "Move the elements from ITEMS to the end of `ido-temp-list'." |
| 3479 | (mapc | 3479 | (mapc |
| 3480 | (lambda (elem) | 3480 | (lambda (elem) |
| 3481 | (setq ido-temp-list (delq elem ido-temp-list))) | 3481 | (setq ido-temp-list (delq elem ido-temp-list))) |
| @@ -3519,8 +3519,8 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3519 | (file-name-all-completions "" dir)))) | 3519 | (file-name-all-completions "" dir)))) |
| 3520 | 3520 | ||
| 3521 | (defun ido-file-name-all-completions (dir) | 3521 | (defun ido-file-name-all-completions (dir) |
| 3522 | ;; Return name of all files in DIR | 3522 | "Return name of all files in DIR. |
| 3523 | ;; Uses and updates ido-dir-file-cache | 3523 | Uses and updates `ido-dir-file-cache'." |
| 3524 | (cond | 3524 | (cond |
| 3525 | ((ido-is-unc-root dir) | 3525 | ((ido-is-unc-root dir) |
| 3526 | (mapcar | 3526 | (mapcar |
| @@ -3569,7 +3569,7 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3569 | (ido-file-name-all-completions-1 dir)))) | 3569 | (ido-file-name-all-completions-1 dir)))) |
| 3570 | 3570 | ||
| 3571 | (defun ido-remove-cached-dir (dir) | 3571 | (defun ido-remove-cached-dir (dir) |
| 3572 | ;; Remove dir from ido-dir-file-cache | 3572 | "Remove DIR from `ido-dir-file-cache'." |
| 3573 | (if (and ido-dir-file-cache | 3573 | (if (and ido-dir-file-cache |
| 3574 | (stringp dir) (> (length dir) 0)) | 3574 | (stringp dir) (> (length dir) 0)) |
| 3575 | (let ((cached (assoc dir ido-dir-file-cache))) | 3575 | (let ((cached (assoc dir ido-dir-file-cache))) |
| @@ -3578,8 +3578,8 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3578 | 3578 | ||
| 3579 | 3579 | ||
| 3580 | (defun ido-make-file-list-1 (dir &optional merged) | 3580 | (defun ido-make-file-list-1 (dir &optional merged) |
| 3581 | ;; Return list of non-ignored files in DIR | 3581 | "Return list of non-ignored files in DIR |
| 3582 | ;; If MERGED is non-nil, each file is cons'ed with DIR | 3582 | If MERGED is non-nil, each file is cons'ed with DIR." |
| 3583 | (and (or (ido-is-tramp-root dir) (ido-is-unc-root dir) | 3583 | (and (or (ido-is-tramp-root dir) (ido-is-unc-root dir) |
| 3584 | (file-directory-p dir)) | 3584 | (file-directory-p dir)) |
| 3585 | (delq nil | 3585 | (delq nil |
| @@ -3590,11 +3590,11 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3590 | (ido-file-name-all-completions dir))))) | 3590 | (ido-file-name-all-completions dir))))) |
| 3591 | 3591 | ||
| 3592 | (defun ido-make-file-list (default) | 3592 | (defun ido-make-file-list (default) |
| 3593 | ;; Return the current list of files. | 3593 | "Return the current list of files. |
| 3594 | ;; Currently visible files are put at the end of the list. | 3594 | Currently visible files are put at the end of the list. |
| 3595 | ;; The hook `ido-make-file-list-hook' is run after the list has been | 3595 | The hook `ido-make-file-list-hook' is run after the list has been |
| 3596 | ;; created to allow the user to further modify the order of the file names | 3596 | created to allow the user to further modify the order of the file names |
| 3597 | ;; in this list. | 3597 | in this list." |
| 3598 | (let ((ido-temp-list (ido-make-file-list-1 ido-current-directory))) | 3598 | (let ((ido-temp-list (ido-make-file-list-1 ido-current-directory))) |
| 3599 | (setq ido-temp-list (sort ido-temp-list | 3599 | (setq ido-temp-list (sort ido-temp-list |
| 3600 | (if ido-file-extensions-order | 3600 | (if ido-file-extensions-order |
| @@ -3635,8 +3635,8 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3635 | ido-temp-list)) | 3635 | ido-temp-list)) |
| 3636 | 3636 | ||
| 3637 | (defun ido-make-dir-list-1 (dir &optional merged) | 3637 | (defun ido-make-dir-list-1 (dir &optional merged) |
| 3638 | ;; Return list of non-ignored subdirs in DIR | 3638 | "Return list of non-ignored subdirs in DIR. |
| 3639 | ;; If MERGED is non-nil, each subdir is cons'ed with DIR | 3639 | If MERGED is non-nil, each subdir is cons'ed with DIR." |
| 3640 | (and (or (ido-is-tramp-root dir) (file-directory-p dir)) | 3640 | (and (or (ido-is-tramp-root dir) (file-directory-p dir)) |
| 3641 | (delq nil | 3641 | (delq nil |
| 3642 | (mapcar | 3642 | (mapcar |
| @@ -3646,10 +3646,10 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3646 | (ido-file-name-all-completions dir))))) | 3646 | (ido-file-name-all-completions dir))))) |
| 3647 | 3647 | ||
| 3648 | (defun ido-make-dir-list (default) | 3648 | (defun ido-make-dir-list (default) |
| 3649 | ;; Return the current list of directories. | 3649 | "Return the current list of directories. |
| 3650 | ;; The hook `ido-make-dir-list-hook' is run after the list has been | 3650 | The hook `ido-make-dir-list-hook' is run after the list has been |
| 3651 | ;; created to allow the user to further modify the order of the | 3651 | created to allow the user to further modify the order of the |
| 3652 | ;; directory names in this list. | 3652 | directory names in this list." |
| 3653 | (let ((ido-temp-list (ido-make-dir-list-1 ido-current-directory))) | 3653 | (let ((ido-temp-list (ido-make-dir-list-1 ido-current-directory))) |
| 3654 | (setq ido-temp-list (sort ido-temp-list #'ido-file-lessp)) | 3654 | (setq ido-temp-list (sort ido-temp-list #'ido-file-lessp)) |
| 3655 | (ido-to-end ;; move . files to end | 3655 | (ido-to-end ;; move . files to end |
| @@ -3680,10 +3680,9 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3680 | (defvar ido-bufs-in-frame) | 3680 | (defvar ido-bufs-in-frame) |
| 3681 | 3681 | ||
| 3682 | (defun ido-get-buffers-in-frames (&optional current) | 3682 | (defun ido-get-buffers-in-frames (&optional current) |
| 3683 | ;; Return the list of buffers that are visible in the current frame. | 3683 | "Return the list of buffers that are visible in the current frame. |
| 3684 | ;; If optional argument `current' is given, restrict searching to the | 3684 | If optional argument CURRENT is given, restrict searching to the current |
| 3685 | ;; current frame, rather than all frames, regardless of value of | 3685 | frame, rather than all frames, regardless of value of `ido-all-frames'." |
| 3686 | ;; `ido-all-frames'. | ||
| 3687 | (let ((ido-bufs-in-frame nil)) | 3686 | (let ((ido-bufs-in-frame nil)) |
| 3688 | (walk-windows 'ido-get-bufname nil | 3687 | (walk-windows 'ido-get-bufname nil |
| 3689 | (if current | 3688 | (if current |
| @@ -3692,7 +3691,7 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3692 | ido-bufs-in-frame)) | 3691 | ido-bufs-in-frame)) |
| 3693 | 3692 | ||
| 3694 | (defun ido-get-bufname (win) | 3693 | (defun ido-get-bufname (win) |
| 3695 | ;; Used by `ido-get-buffers-in-frames' to walk through all windows | 3694 | "Used by `ido-get-buffers-in-frames' to walk through all windows." |
| 3696 | (let ((buf (buffer-name (window-buffer win)))) | 3695 | (let ((buf (buffer-name (window-buffer win)))) |
| 3697 | (unless (or (member buf ido-bufs-in-frame) | 3696 | (unless (or (member buf ido-bufs-in-frame) |
| 3698 | (member buf ido-ignore-item-temp-list)) | 3697 | (member buf ido-ignore-item-temp-list)) |
| @@ -3705,7 +3704,7 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3705 | ;;; FIND MATCHING ITEMS | 3704 | ;;; FIND MATCHING ITEMS |
| 3706 | 3705 | ||
| 3707 | (defun ido-set-matches-1 (items &optional do-full) | 3706 | (defun ido-set-matches-1 (items &optional do-full) |
| 3708 | ;; Return list of matches in items | 3707 | "Return list of matches in ITEMS." |
| 3709 | (let* ((case-fold-search ido-case-fold) | 3708 | (let* ((case-fold-search ido-case-fold) |
| 3710 | (slash (and (not ido-enable-prefix) (ido-final-slash ido-text))) | 3709 | (slash (and (not ido-enable-prefix) (ido-final-slash ido-text))) |
| 3711 | (text (if slash (substring ido-text 0 -1) ido-text)) | 3710 | (text (if slash (substring ido-text 0 -1) ido-text)) |
| @@ -3793,13 +3792,13 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3793 | 3792 | ||
| 3794 | 3793 | ||
| 3795 | (defun ido-set-matches () | 3794 | (defun ido-set-matches () |
| 3796 | ;; Set `ido-matches' to the list of items matching prompt | 3795 | "Set `ido-matches' to the list of items matching prompt." |
| 3797 | (when ido-rescan | 3796 | (when ido-rescan |
| 3798 | (setq ido-matches (ido-set-matches-1 (reverse ido-cur-list) (not ido-rotate)) | 3797 | (setq ido-matches (ido-set-matches-1 (reverse ido-cur-list) (not ido-rotate)) |
| 3799 | ido-rotate nil))) | 3798 | ido-rotate nil))) |
| 3800 | 3799 | ||
| 3801 | (defun ido-ignore-item-p (name re-list &optional ignore-ext) | 3800 | (defun ido-ignore-item-p (name re-list &optional ignore-ext) |
| 3802 | ;; Return t if the buffer or file NAME should be ignored. | 3801 | "Return t if the buffer or file NAME should be ignored." |
| 3803 | (or (member name ido-ignore-item-temp-list) | 3802 | (or (member name ido-ignore-item-temp-list) |
| 3804 | (and | 3803 | (and |
| 3805 | ido-process-ignore-lists re-list | 3804 | ido-process-ignore-lists re-list |
| @@ -3839,7 +3838,7 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3839 | (defvar ido-change-word-sub) | 3838 | (defvar ido-change-word-sub) |
| 3840 | 3839 | ||
| 3841 | (defun ido-find-common-substring (items subs) | 3840 | (defun ido-find-common-substring (items subs) |
| 3842 | ;; Return common string following SUBS in each element of ITEMS. | 3841 | "Return common string following SUBS in each element of ITEMS." |
| 3843 | (let (res | 3842 | (let (res |
| 3844 | alist | 3843 | alist |
| 3845 | ido-change-word-sub) | 3844 | ido-change-word-sub) |
| @@ -3859,8 +3858,8 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3859 | comp)))) | 3858 | comp)))) |
| 3860 | 3859 | ||
| 3861 | (defun ido-word-matching-substring (word) | 3860 | (defun ido-word-matching-substring (word) |
| 3862 | ;; Return part of WORD before 1st match to `ido-change-word-sub'. | 3861 | "Return part of WORD before first match to `ido-change-word-sub'. |
| 3863 | ;; If `ido-change-word-sub' cannot be found in WORD, return nil. | 3862 | If `ido-change-word-sub' cannot be found in WORD, return nil." |
| 3864 | (let ((case-fold-search ido-case-fold)) | 3863 | (let ((case-fold-search ido-case-fold)) |
| 3865 | (let ((m (string-match ido-change-word-sub (ido-name word)))) | 3864 | (let ((m (string-match ido-change-word-sub (ido-name word)))) |
| 3866 | (if m | 3865 | (if m |
| @@ -3869,7 +3868,7 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3869 | nil)))) | 3868 | nil)))) |
| 3870 | 3869 | ||
| 3871 | (defun ido-makealist (res) | 3870 | (defun ido-makealist (res) |
| 3872 | ;; Return dotted pair (RES . 1). | 3871 | "Return dotted pair (RES . 1)." |
| 3873 | (cons res 1)) | 3872 | (cons res 1)) |
| 3874 | 3873 | ||
| 3875 | (defun ido-choose-completion-string (choice &rest ignored) | 3874 | (defun ido-choose-completion-string (choice &rest ignored) |
| @@ -4052,8 +4051,8 @@ Record command in `command-history' if optional RECORD is non-nil." | |||
| 4052 | 4051 | ||
| 4053 | 4052 | ||
| 4054 | (defun ido-buffer-window-other-frame (buffer) | 4053 | (defun ido-buffer-window-other-frame (buffer) |
| 4055 | ;; Return window pointer if BUFFER is visible in another frame. | 4054 | "Return window pointer if BUFFER is visible in another frame. |
| 4056 | ;; If BUFFER is visible in the current frame, return nil. | 4055 | If BUFFER is visible in the current frame, return nil." |
| 4057 | (let ((blist (ido-get-buffers-in-frames 'current))) | 4056 | (let ((blist (ido-get-buffers-in-frames 'current))) |
| 4058 | ;;If the buffer is visible in current frame, return nil | 4057 | ;;If the buffer is visible in current frame, return nil |
| 4059 | (if (member buffer blist) | 4058 | (if (member buffer blist) |
| @@ -4537,9 +4536,8 @@ For details of keybindings, see `ido-find-file'." | |||
| 4537 | )))) | 4536 | )))) |
| 4538 | 4537 | ||
| 4539 | (defun ido-completions (name) | 4538 | (defun ido-completions (name) |
| 4540 | ;; Return the string that is displayed after the user's text. | 4539 | "Return the string that is displayed after the user's text. |
| 4541 | ;; Modified from `icomplete-completions'. | 4540 | Modified from `icomplete-completions'." |
| 4542 | |||
| 4543 | (let* ((comps ido-matches) | 4541 | (let* ((comps ido-matches) |
| 4544 | (ind (and (consp (car comps)) (> (length (cdr (car comps))) 1) | 4542 | (ind (and (consp (car comps)) (> (length (cdr (car comps))) 1) |
| 4545 | ido-merged-indicator)) | 4543 | ido-merged-indicator)) |