comparison lisp/utils/lib-complete.el @ 165:5a88923fcbfe r20-3b9

Import from CVS: tag r20-3b9
author cvs
date Mon, 13 Aug 2007 09:44:42 +0200
parents 28f395d8dc7a
children
comparison
equal deleted inserted replaced
164:4e0740e5aab2 165:5a88923fcbfe
34 ;; Author : Mike Williams <mike-w@cs.aukuni.ac.nz> 34 ;; Author : Mike Williams <mike-w@cs.aukuni.ac.nz>
35 ;; Created On : Sat Apr 20 17:47:21 1991 35 ;; Created On : Sat Apr 20 17:47:21 1991
36 ;; Last Modified By: Heiko M|nkel <muenkel@tnt.uni-hannover.de> 36 ;; Last Modified By: Heiko M|nkel <muenkel@tnt.uni-hannover.de>
37 ;; Additional XEmacs integration By: Chuck Thompson <cthomp@cs.uiuc.edu> 37 ;; Additional XEmacs integration By: Chuck Thompson <cthomp@cs.uiuc.edu>
38 ;; Last Modified On: Thu Jul 1 14:23:00 1994 38 ;; Last Modified On: Thu Jul 1 14:23:00 1994
39 ;; RCS Info : $Revision: 1.4 $ $Locker: $ 39 ;; RCS Info : $Revision: 1.5 $ $Locker: $
40 ;; ======================================================================== 40 ;; ========================================================================
41 ;; NOTE: XEmacs must be redumped if this file is changed. 41 ;; NOTE: XEmacs must be redumped if this file is changed.
42 ;; 42 ;;
43 ;; Copyright (C) Mike Williams <mike-w@cs.aukuni.ac.nz> 1991 43 ;; Copyright (C) Mike Williams <mike-w@cs.aukuni.ac.nz> 1991
44 ;; 44 ;;
119 (delete-region orig-pmax (point-max))))) 119 (delete-region orig-pmax (point-max)))))
120 (prog2 120 (prog2
121 (message "%s" (, MESSAGE)) 121 (message "%s" (, MESSAGE))
122 (progn (,@ FORMS)) 122 (progn (,@ FORMS))
123 (message ""))))) 123 (message "")))))
124 #+infodock (defalias 'lib-funcall-with-msg 'progn-with-message)
124 125
125 (put 'progn-with-message 'lisp-indent-hook 1) 126 (put 'progn-with-message 'lisp-indent-hook 1)
127 #+infodock (put 'lib-funcall-with-message 'lisp-indent-hook 1)
126 128
127 ;;=== Completion caching ================================================== 129 ;;=== Completion caching ==================================================
128 130
129 (defconst lib-complete:cache nil 131 (defconst lib-complete:cache nil
130 "Used within read-library and read-library-internal to prevent 132 "Used within read-library and read-library-internal to prevent
134 ([<path> <subdir>] <cache-record> <cache-record> ...) 136 ([<path> <subdir>] <cache-record> <cache-record> ...)
135 137
136 where each <cache-record> has the form 138 where each <cache-record> has the form
137 139
138 (<root> <modtimes> <completion-table>)") 140 (<root> <modtimes> <completion-table>)")
141 #+infodock (defvaralias 'lib-completions 'lib-complete:cache)
139 142
140 (defun lib-complete:better-root (ROOT1 ROOT2) 143 (defun lib-complete:better-root (ROOT1 ROOT2)
141 "Return non-nil if ROOT1 is a superset of ROOT2." 144 "Return non-nil if ROOT1 is a superset of ROOT2."
142 (and (equal (file-name-directory ROOT1) (file-name-directory ROOT2)) 145 (and (equal (file-name-directory ROOT1) (file-name-directory ROOT2))
143 (string-match 146 (string-match
188 ;; Cache the completions 191 ;; Cache the completions
189 (lib-complete:cache-completions key root 192 (lib-complete:cache-completions key root
190 path-modtimes completion-table) 193 path-modtimes completion-table)
191 completion-table)))) 194 completion-table))))
192 195
193 (defvar lib-complete:max-cache-size 20 196 (defvar lib-complete:max-cache-size 40
194 "*Maximum number of search paths which are cached.") 197 "*Maximum number of search paths which are cached.")
195 198
196 (defun lib-complete:cache-completions (key root modtimes table) 199 (defun lib-complete:cache-completions (key root modtimes table)
197 (let* ((cache-entry (assoc key lib-complete:cache)) 200 (let* ((cache-entry (assoc key lib-complete:cache))
198 (cache-records (cdr cache-entry)) 201 (cache-records (cdr cache-entry))
313 (interactive 316 (interactive
314 (list (get-library-path) 317 (list (get-library-path)
315 (if current-prefix-arg 318 (if current-prefix-arg
316 (read-coding-system "Coding System: ")))) 319 (read-coding-system "Coding System: "))))
317 (find-file-other-window library codesys)) 320 (find-file-other-window library codesys))
321 #+infodock (defalias 'lib-edit-other-window 'find-library-other-window)
318 322
319 (defun find-library-other-frame (library &optional codesys) 323 (defun find-library-other-frame (library &optional codesys)
320 "Load the library named LIBRARY in a newly-created frame. 324 "Load the library named LIBRARY in a newly-created frame.
321 Under XEmacs/Mule, the optional second argument specifies the 325 Under XEmacs/Mule, the optional second argument specifies the
322 coding system to use when decoding the file. Interactively, 326 coding system to use when decoding the file. Interactively,
330 ; This conflicts with an existing binding 334 ; This conflicts with an existing binding
331 ;(define-key global-map "\C-xl" 'find-library) 335 ;(define-key global-map "\C-xl" 'find-library)
332 (define-key global-map "\C-x4l" 'find-library-other-window) 336 (define-key global-map "\C-x4l" 'find-library-other-window)
333 (define-key global-map "\C-x5l" 'find-library-other-frame) 337 (define-key global-map "\C-x5l" 'find-library-other-frame)
334 338
335 339 #+infodock (defalias 'lib-where-is 'locate-library)
340
341 #+infodock (provide 'lib)
336 (provide 'lib-complete) 342 (provide 'lib-complete)
337
338 ;;; lib-complete.el ends here 343 ;;; lib-complete.el ends here