Show
Ignore:
Timestamp:
01/28/06 09:46:44 (3 years ago)
Author:
miyoshi
Message:

Update.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • vendor/emacs-CVS_HEAD/lisp/complete.el

    r3988 r4018  
    207207 
    208208Partial Completion mode extends the meaning of `completion-auto-help' (which 
    209 see) so that if it is neither nil nor t, Emacs will show the  *Completions* 
    210 buffer only on the second attempt to complete.  I.e. if TAB finds nothing 
    211 to complete, the first TAB will just say \"Next char not unique\" without 
    212 bringing up the *Completions* buffer, and the second TAB will then bring up 
    213 the *Completions* buffer." 
     209see), so that if it is neither nil nor t, Emacs shows the `*Completions*' 
     210buffer only on the second attempt to complete.  That is, if TAB finds nothing 
     211to complete, the first TAB just says \"Next char not unique\" and the 
     212second TAB brings up the `*Completions*' buffer." 
    214213  :global t :group 'partial-completion 
    215214  ;; Deal with key bindings... 
     
    217216  ;; Deal with include file feature... 
    218217  (cond ((not partial-completion-mode) 
    219          (remove-hook 'find-file-not-found-hooks 'PC-look-for-include-file)) 
     218         (remove-hook 'find-file-not-found-functions 'PC-look-for-include-file)) 
    220219        ((not PC-disable-includes) 
    221          (add-hook 'find-file-not-found-hooks 'PC-look-for-include-file))) 
     220         (add-hook 'find-file-not-found-functions 'PC-look-for-include-file))) 
    222221  ;; ... with some underhand redefining. 
    223222  (cond ((and (not partial-completion-mode) 
     
    262261      (if (and window (window-buffer window) 
    263262               (buffer-name (window-buffer window))) 
    264           (save-excursion 
    265             (set-buffer (window-buffer window)) 
     263          (with-current-buffer (window-buffer window) 
    266264            (if (pos-visible-in-window-p (point-max) window) 
    267265                (set-window-start window (point-min) nil) 
     
    347345 
    348346(defvar PC-completion-as-file-name-predicate 
    349   (function 
    350    (lambda () 
    351      (memq minibuffer-completion-table 
    352            '(read-file-name-internal read-directory-name-internal)))) 
    353    "A function testing whether a minibuffer completion now will work filename-style. 
     347  (lambda () minibuffer-completing-file-name) 
     348  "A function testing whether a minibuffer completion now will work filename-style. 
    354349The function takes no arguments, and typically looks at the value 
    355350of `minibuffer-completion-table' and the minibuffer contents.") 
     
    618613                                    (setq end (1+ end))) 
    619614                                  (setq i (1+ i))) 
    620                                 (or pt (equal (point) beg) 
    621                                     (setq pt (point))) 
     615                                (or pt (setq pt (point))) 
    622616                                (looking-at PC-delim-regex)) 
    623617                              (setq skip (concat skip 
     
    666660                    (with-output-to-temp-buffer "*Completions*" 
    667661                      (display-completion-list (sort helpposs 'string-lessp)) 
    668                       (save-excursion 
    669                         (set-buffer standard-output) 
     662                      (with-current-buffer standard-output 
    670663                        ;; Record which part of the buffer we are completing 
    671664                        ;; so that choosing a completion from the list 
     
    733726  (interactive) 
    734727  (let* ((end (point)) 
    735          (buffer-syntax (syntax-table)) 
    736          (beg (unwind-protect 
    737                   (save-excursion 
    738                     (if lisp-mode-syntax-table 
    739                         (set-syntax-table lisp-mode-syntax-table)) 
    740                     (backward-sexp 1) 
    741                     (while (= (char-syntax (following-char)) ?\') 
    742                       (forward-char 1)) 
    743                     (point)) 
    744                 (set-syntax-table buffer-syntax))) 
     728         (beg (save-excursion 
     729                (with-syntax-table lisp-mode-syntax-table 
     730                  (backward-sexp 1) 
     731                  (while (= (char-syntax (following-char)) ?\') 
     732                    (forward-char 1)) 
     733                  (point)))) 
    745734         (minibuffer-completion-table obarray) 
    746735         (minibuffer-completion-predicate 
     
    768757     (PC-do-completion nil beg end))) 
    769758 
    770 ;;; Use the shell to do globbing. 
    771 ;;; This could now use file-expand-wildcards instead. 
     759;; Use the shell to do globbing. 
     760;; This could now use file-expand-wildcards instead. 
    772761 
    773762(defun PC-expand-many-files (name) 
    774   (save-excursion 
    775     (set-buffer (generate-new-buffer " *Glob Output*")) 
     763  (with-current-buffer (generate-new-buffer " *Glob Output*") 
    776764    (erase-buffer) 
    777765    (shell-command (concat "echo " name) t) 
     
    805793        p)))) 
    806794 
    807 ;;; Facilities for loading C header files.  This is independent from the 
    808 ;;; main completion code.  See also the variable `PC-include-file-path' 
    809 ;;; at top of this file. 
     795;; Facilities for loading C header files.  This is independent from the 
     796;; main completion code.  See also the variable `PC-include-file-path' 
     797;; at top of this file. 
    810798 
    811799(defun PC-look-for-include-file () 
     
    818806        (kill-buffer (current-buffer)) 
    819807        (if (equal name "") 
    820             (save-excursion 
    821               (set-buffer (car (buffer-list))) 
     808            (with-current-buffer (car (buffer-list)) 
    822809              (save-excursion 
    823810                (beginning-of-line) 
     
    856843                  (setq name (concat (file-name-as-directory (car path)) name)) 
    857844                (error "No such include file: <%s>" name))) 
    858           (let ((dir (save-excursion 
    859                        (set-buffer (car (buffer-list))) 
     845          (let ((dir (with-current-buffer (car (buffer-list)) 
    860846                       default-directory))) 
    861847            (if (file-exists-p (concat dir name)) 
     
    866852            ;; no need to verify last-modified time for this! 
    867853            (set-buffer new-buf) 
    868           (setq new-buf (create-file-buffer name)) 
    869           (set-buffer new-buf) 
     854          (set-buffer (create-file-buffer name)) 
    870855          (erase-buffer) 
    871856          (insert-file-contents name t)) 
     
    886871        path))) 
    887872 
    888 ;;; This is adapted from lib-complete.el, by Mike Williams. 
     873;; This is adapted from lib-complete.el, by Mike Williams. 
    889874(defun PC-include-file-all-completions (file search-path &optional full) 
    890875  "Return all completions for FILE in any directory on SEARCH-PATH.