Mercurial > hg > xemacs-beta
comparison lisp/lib-complete.el @ 380:8626e4521993 r21-2-5
Import from CVS: tag r21-2-5
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:07:10 +0200 |
parents | c42ec1d1cded |
children | 74fd4e045ea6 |
comparison
equal
deleted
inserted
replaced
379:76b7d63099ad | 380:8626e4521993 |
---|---|
36 ;; Author : Mike Williams <mike-w@cs.aukuni.ac.nz> | 36 ;; Author : Mike Williams <mike-w@cs.aukuni.ac.nz> |
37 ;; Created On : Sat Apr 20 17:47:21 1991 | 37 ;; Created On : Sat Apr 20 17:47:21 1991 |
38 ;; Last Modified By: Heiko M|nkel <muenkel@tnt.uni-hannover.de> | 38 ;; Last Modified By: Heiko M|nkel <muenkel@tnt.uni-hannover.de> |
39 ;; Additional XEmacs integration By: Chuck Thompson <cthomp@cs.uiuc.edu> | 39 ;; Additional XEmacs integration By: Chuck Thompson <cthomp@cs.uiuc.edu> |
40 ;; Last Modified On: Thu Jul 1 14:23:00 1994 | 40 ;; Last Modified On: Thu Jul 1 14:23:00 1994 |
41 ;; RCS Info : $Revision: 1.3 $ $Locker: $ | 41 ;; RCS Info : $Revision: 1.3.2.1 $ $Locker: $ |
42 ;; ======================================================================== | 42 ;; ======================================================================== |
43 ;; NOTE: XEmacs must be redumped if this file is changed. | 43 ;; NOTE: XEmacs must be redumped if this file is changed. |
44 ;; | 44 ;; |
45 ;; Copyright (C) Mike Williams <mike-w@cs.aukuni.ac.nz> 1991 | 45 ;; Copyright (C) Mike Williams <mike-w@cs.aukuni.ac.nz> 1991 |
46 ;; | 46 ;; |
102 (setq sorted (cdr sorted))) | 102 (setq sorted (cdr sorted))) |
103 compressed))))) | 103 compressed))))) |
104 | 104 |
105 ;;=== Utilities =========================================================== | 105 ;;=== Utilities =========================================================== |
106 | 106 |
107 (defmacro progn-with-message (MESSAGE &rest FORMS) | 107 (defmacro progn-with-message (message &rest forms) |
108 "(progn-with-message MESSAGE FORMS ...) | 108 "(progn-with-message MESSAGE FORMS ...) |
109 Display MESSAGE and evaluate FORMS, returning value of the last one." | 109 Display MESSAGE and evaluate FORMS, returning value of the last one." |
110 ;; based on Hallvard Furuseth's funcall-with-message | 110 ;; based on Hallvard Furuseth's funcall-with-message |
111 (` | 111 `(if (eq (selected-window) (minibuffer-window)) |
112 (if (eq (selected-window) (minibuffer-window)) | |
113 (save-excursion | 112 (save-excursion |
114 (goto-char (point-max)) | 113 (goto-char (point-max)) |
115 (let ((orig-pmax (point-max))) | 114 (let ((orig-pmax (point-max))) |
116 (unwind-protect | 115 (unwind-protect |
117 (progn | 116 (progn |
118 (insert " " (, MESSAGE)) (goto-char orig-pmax) | 117 (insert " " ,message) (goto-char orig-pmax) |
119 (sit-for 0) ; Redisplay | 118 (sit-for 0) ; Redisplay |
120 (,@ FORMS)) | 119 ,@forms) |
121 (delete-region orig-pmax (point-max))))) | 120 (delete-region orig-pmax (point-max))))) |
122 (prog2 | 121 (prog2 |
123 (message "%s" (, MESSAGE)) | 122 (message "%s" ,message) |
124 (progn (,@ FORMS)) | 123 (progn ,@forms) |
125 (message ""))))) | 124 (message "")))) |
126 | 125 |
127 (put 'progn-with-message 'lisp-indent-hook 1) | 126 (put 'progn-with-message 'lisp-indent-hook 1) |
128 | 127 |
129 ;;=== Completion caching ================================================== | 128 ;;=== Completion caching ================================================== |
130 | 129 |
216 ;; Trim cache | 215 ;; Trim cache |
217 (let ((tail (nthcdr lib-complete:max-cache-size lib-complete:cache))) | 216 (let ((tail (nthcdr lib-complete:max-cache-size lib-complete:cache))) |
218 (if tail (setcdr tail nil))))) | 217 (if tail (setcdr tail nil))))) |
219 | 218 |
220 ;;=== Read a filename, with completion in a search path =================== | 219 ;;=== Read a filename, with completion in a search path =================== |
220 (defvar read-library-internal-search-path) | |
221 | 221 |
222 (defun read-library-internal (FILE FILTER FLAG) | 222 (defun read-library-internal (FILE FILTER FLAG) |
223 "Don't call this." | 223 "Don't call this." |
224 ;; Relies on read-library-internal-search-path being let-bound | 224 ;; Relies on read-library-internal-search-path being let-bound |
225 (let ((completion-table | 225 (let ((completion-table |