Mercurial > emacs
comparison lisp/find-file.el @ 13896:d23e1ac7b432
Doc fixes.
(ff-get-file): Use get-file-buffer to avoid false match.
(ff-switch-to-buffer): Rename arg FILE to BUFFER-OR-NAME.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 31 Dec 1995 00:10:18 +0000 |
parents | f6e5a73b96e4 |
children | 83f275dcd93a |
comparison
equal
deleted
inserted
replaced
13895:0c12b3398d37 | 13896:d23e1ac7b432 |
---|---|
514 | 514 |
515 (cond | 515 (cond |
516 ((not filename) | 516 ((not filename) |
517 nil) | 517 nil) |
518 | 518 |
519 ((bufferp (get-buffer filename)) | 519 ((bufferp (get-file-buffer filename)) |
520 (ff-switch-to-buffer filename other-window) | 520 (ff-switch-to-buffer (get-file-buffer filename) other-window) |
521 filename) | 521 filename) |
522 | 522 |
523 ((file-exists-p filename) | 523 ((file-exists-p filename) |
524 (ff-find-file filename other-window nil) | 524 (ff-find-file filename other-window nil) |
525 filename) | 525 filename) |
641 (message "%s found" found)) | 641 (message "%s found" found)) |
642 | 642 |
643 found)) | 643 found)) |
644 | 644 |
645 (defun ff-string-match (regexp string &optional start) | 645 (defun ff-string-match (regexp string &optional start) |
646 "Like string-match (which see), but set `case-fold-search' temporarily. | 646 "Like `string-match', but set `case-fold-search' temporarily. |
647 The value used comes from `ff-case-fold-search'." | 647 The value used comes from `ff-case-fold-search'." |
648 (let ((case-fold-search ff-case-fold-search)) | 648 (let ((case-fold-search ff-case-fold-search)) |
649 (if regexp | 649 (if regexp |
650 (string-match regexp string start)))) | 650 (string-match regexp string start)))) |
651 | 651 |
665 (setq var (car search-list))) | 665 (setq var (car search-list))) |
666 (setq search-list (reverse list)))) | 666 (setq search-list (reverse list)))) |
667 | 667 |
668 (defun ff-treat-as-special () | 668 (defun ff-treat-as-special () |
669 "Returns the file to look for if the construct was special, else nil. | 669 "Returns the file to look for if the construct was special, else nil. |
670 The construct is defined in the variable `ff-special-constructs' (which see)." | 670 The construct is defined in the variable `ff-special-constructs'." |
671 (let* (fname | 671 (let* (fname |
672 (list ff-special-constructs) | 672 (list ff-special-constructs) |
673 (elem (car list)) | 673 (elem (car list)) |
674 (regexp (car elem)) | 674 (regexp (car elem)) |
675 (match (cdr elem))) | 675 (match (cdr elem))) |
733 (run-hooks 'ff-file-created-hooks))) | 733 (run-hooks 'ff-file-created-hooks))) |
734 (if ff-post-load-hooks | 734 (if ff-post-load-hooks |
735 (run-hooks 'ff-post-load-hooks))) | 735 (run-hooks 'ff-post-load-hooks))) |
736 | 736 |
737 (defun ff-find-file (file &optional in-other-window new-file) | 737 (defun ff-find-file (file &optional in-other-window new-file) |
738 "Like `find-file' (which see), but may put the file in another window." | 738 "Like `find-file', but may show the file in another window." |
739 (ff-switch-file 'find-file | 739 (ff-switch-file 'find-file |
740 'find-file-other-window | 740 'find-file-other-window |
741 file in-other-window new-file)) | 741 file in-other-window new-file)) |
742 | 742 |
743 (defun ff-switch-to-buffer (file &optional in-other-window) | 743 (defun ff-switch-to-buffer (buffer-or-name &optional in-other-window) |
744 "Like `switch-to-buffer' (which see), but may put the buffer in another window." | 744 "Like `switch-to-buffer', but may show the buffer in another window." |
745 | 745 |
746 (ff-switch-file 'switch-to-buffer | 746 (ff-switch-file 'switch-to-buffer |
747 'switch-to-buffer-other-window | 747 'switch-to-buffer-other-window |
748 file in-other-window nil)) | 748 buffer-or-name in-other-window nil)) |
749 | 749 |
750 (cond | 750 (cond |
751 ((ff-emacs-19) | 751 ((ff-emacs-19) |
752 (defun ff-goto-click (event) | 752 (defun ff-goto-click (event) |
753 (set-buffer (window-buffer (posn-window (event-end event)))) | 753 (set-buffer (window-buffer (posn-window (event-end event)))) |