Mercurial > hg > xemacs-beta
comparison lisp/packages/recent-files.el @ 134:34a5b81f86ba r20-2b1
Import from CVS: tag r20-2b1
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:30:11 +0200 |
parents | 131b0175ea99 |
children | 489f57a838ef |
comparison
equal
deleted
inserted
replaced
133:b27e67717092 | 134:34a5b81f86ba |
---|---|
1 ;;; recent-files.el --- Maintain menu of recently opened files. | 1 ;;; recent-files.el --- Maintain menu of recently opened files. |
2 ;;; $Header: /afs/informatik.uni-tuebingen.de/local/web/xemacs/xemacs-cvs/XEmacs/xemacs/lisp/packages/Attic/recent-files.el,v 1.1.1.1 1996/12/18 22:42:54 steve Exp $ | 2 ;;; $Header: /afs/informatik.uni-tuebingen.de/local/web/xemacs/xemacs-cvs/XEmacs/xemacs/lisp/packages/Attic/recent-files.el,v 1.2 1997/04/19 23:21:11 steve Exp $ |
3 ;;; | 3 ;;; |
4 ;;; Copyright (C) 1994, 1995 Juergen Nickelsen <nickel@cs.tu-berlin.de> | 4 ;;; Copyright (C) 1994, 1995 Juergen Nickelsen <nickel@cs.tu-berlin.de> |
5 ;;; | 5 ;;; |
6 ;; Keywords: menu, file | 6 ;; Keywords: menu, file |
7 | 7 |
204 (provide 'recent-files) | 204 (provide 'recent-files) |
205 | 205 |
206 | 206 |
207 ;;; User options | 207 ;;; User options |
208 | 208 |
209 (defvar recent-files-number-of-entries 15 | 209 (defgroup recent-files nil |
210 "*Maximum of non-permanent entries in the recent-files menu.") | 210 "Maintain a menu of recently opened files." |
211 | 211 :group 'data) |
212 (defvar recent-files-number-of-saved-entries 50 | 212 |
213 "*Maximum of non-permanent entries saved to `recent-files-save-file'.") | 213 (defgroup recent-files-menu nil |
214 | 214 "Menu options of recent-files." |
215 (defvar recent-files-save-file (expand-file-name "~/.recent-files.el") | 215 :prefix "recent-files-" |
216 "*File to save the recent-files list in.") | 216 :group 'recent-files) |
217 | 217 |
218 (defvar recent-files-dont-include nil | 218 |
219 "*List of regexps for filenames *not* to keep in recent-files.") | 219 (defcustom recent-files-number-of-entries 15 |
220 | 220 "*Maximum of non-permanent entries in the recent-files menu." |
221 (defvar recent-files-use-full-names t | 221 :type 'integer |
222 :group 'recent-files) | |
223 | |
224 (defcustom recent-files-number-of-saved-entries 50 | |
225 "*Maximum of non-permanent entries saved to `recent-files-save-file'." | |
226 :type 'integer | |
227 :group 'recent-files) | |
228 | |
229 (defcustom recent-files-save-file (expand-file-name "~/.recent-files.el") | |
230 "*File to save the recent-files list in." | |
231 :type 'file | |
232 :group 'recent-files) | |
233 | |
234 (defcustom recent-files-dont-include nil | |
235 "*List of regexps for filenames *not* to keep in recent-files." | |
236 :type '(repeat regexp) | |
237 :group 'recent-files) | |
238 | |
239 (defcustom recent-files-use-full-names t | |
222 "*If non-nil, use the full pathname of a file in the recent-files menu. | 240 "*If non-nil, use the full pathname of a file in the recent-files menu. |
223 Otherwise use only the filename part. The `recent-files-filename-replacements' | 241 Otherwise use only the filename part. The `recent-files-filename-replacements' |
224 are not applied in the latter case.") | 242 are not applied in the latter case." |
225 | 243 :type 'boolean |
226 (defvar recent-files-filename-replacements | 244 :group 'recent-files) |
245 | |
246 (defcustom recent-files-filename-replacements | |
227 (list (cons (expand-file-name "~") "~")) | 247 (list (cons (expand-file-name "~") "~")) |
228 "*List of regexp/replacement pairs for filename filenamees. | 248 "*List of regexp/replacement pairs for filename filenamees. |
229 If a filename of a filename matches one of the regexps, it is replaced | 249 If a filename of a filename matches one of the regexps, it is replaced |
230 by the corresponding replacement.") | 250 by the corresponding replacement." |
231 | 251 :type '(repeat (cons regexp (string :tag "Replacement"))) |
232 (defvar recent-files-sort-function (function recent-files-dont-sort) | 252 :group 'recent-files) |
253 | |
254 (defcustom recent-files-sort-function (function recent-files-dont-sort) | |
233 "*Function to sort the recent-files list with. | 255 "*Function to sort the recent-files list with. |
234 The value `recent-files-dont-sort' means to keep the \"most recent on top\" | 256 The value `recent-files-dont-sort' means to keep the \"most recent on top\" |
235 order.") | 257 order." |
236 | 258 :type 'function |
237 (defvar recent-files-permanent-submenu nil | 259 :group 'recent-files) |
238 "*If non-nil, put the permanent entries of recent-files into a submenu.") | 260 |
239 | 261 (defcustom recent-files-permanent-submenu nil |
240 (defvar recent-files-non-permanent-submenu t | 262 "*If non-nil, put the permanent entries of recent-files into a submenu." |
241 "*If non-nil, put the non-permanent entries of recent-files into a submenu.") | 263 :type 'boolean |
242 | 264 :group 'recent-files-menu) |
243 (defvar recent-files-commands-submenu nil | 265 |
244 "*If non-nil, put the commands of recent-files into a submenu.") | 266 (defcustom recent-files-non-permanent-submenu t |
245 | 267 "*If non-nil, put the non-permanent entries of recent-files into a submenu." |
246 (defvar recent-files-commands-submenu-title "Commands..." | 268 :type 'boolean |
247 "*Title of the commands submenu of recent-files.") | 269 :group 'recent-files-menu) |
248 | 270 |
249 (defvar recent-files-menu-title "Recent Files" | 271 (defcustom recent-files-commands-submenu nil |
250 "*Name to be displayed as title of the recent-files menu.") | 272 "*If non-nil, put the commands of recent-files into a submenu." |
251 | 273 :type 'boolean |
252 (defvar recent-files-menu-path nil | 274 :group 'recent-files-menu) |
275 | |
276 (defcustom recent-files-commands-submenu-title "Commands..." | |
277 "*Title of the commands submenu of recent-files." | |
278 :type 'string | |
279 :group 'recent-files-menu) | |
280 | |
281 (defcustom recent-files-menu-title "Recent Files" | |
282 "*Name to be displayed as title of the recent-files menu." | |
283 :type 'string | |
284 :group 'recent-files-menu) | |
285 | |
286 (defcustom recent-files-menu-path nil | |
253 "*Path where to add the recent-files menu. | 287 "*Path where to add the recent-files menu. |
254 A value of nil means add it as top-level menu. | 288 A value of nil means add it as top-level menu. |
255 For more information look up the documentation of `add-menu'.") | 289 For more information look up the documentation of `add-menu'." |
256 | 290 :type '(choice (const :tag "Top Level" nil) |
257 (defvar recent-files-add-menu-before nil | 291 (sexp :tag "Menu Path")) |
292 :group 'recent-files-menu) | |
293 | |
294 (defcustom recent-files-add-menu-before nil | |
258 "*Name of the menu before which the recent-files menu shall be added. | 295 "*Name of the menu before which the recent-files menu shall be added. |
259 A value of nil means add it as the last menu in recent-files-menu-path. | 296 A value of nil means add it as the last menu in recent-files-menu-path. |
260 For more information look up the documentation of `add-menu'.") | 297 For more information look up the documentation of `add-menu'." |
261 | 298 :type '(choice (string :tag "Name") |
262 (defvar recent-files-actions-on-top nil | 299 (const :tag "Last" nil)) |
263 "*If non-nil, put the actions on top of the recent-files menu.") | 300 :group 'recent-files-menu) |
264 | 301 |
265 (defvar recent-files-permanent-first 'sort | 302 (defcustom recent-files-actions-on-top nil |
303 "*If non-nil, put the actions on top of the recent-files menu." | |
304 :type 'boolean | |
305 :group 'recent-files-menu) | |
306 | |
307 (defcustom recent-files-permanent-first 'sort | |
266 "*Control the placement of entries in the recent-files menu. | 308 "*Control the placement of entries in the recent-files menu. |
267 If the value is t, permanent entries are put first. | 309 If the value is t, permanent entries are put first. |
268 If the value is nil, non-permanent entries are put first. | 310 If the value is nil, non-permanent entries are put first. |
269 If the value is neither, the entries are mixed following | 311 If the value is neither, the entries are mixed following |
270 recent-files-sort-function if neither appear in a submenu.") | 312 recent-files-sort-function if neither appear in a submenu." |
271 | 313 :type '(choice (const :tag "Permanent First" t) |
272 (defvar recent-files-find-file-command (function find-file) | 314 (const :tag "Non-Permanent First" nil) |
273 "*Command to invoke with an entry of the recent-files list.") | 315 (sexp :tag "Mixed")) |
274 | 316 :group 'recent-files-menu) |
275 (defvar recent-files-include-save-now nil | 317 |
276 "*If non-nil, have a menu entry to save the recent-files list immediately.") | 318 (defcustom recent-files-find-file-command (function find-file) |
319 "*Command to invoke with an entry of the recent-files list." | |
320 :type 'function | |
321 :group 'recent-files) | |
322 | |
323 (defcustom recent-files-include-save-now nil | |
324 "*If non-nil, have a menu entry to save the recent-files list immediately." | |
325 :type 'boolean | |
326 :group 'recent-files-menu) | |
277 | 327 |
278 ;;; Internal variables | 328 ;;; Internal variables |
279 | 329 |
280 (defconst recent-files-save-list-on-exit t | 330 (defconst recent-files-save-list-on-exit t |
281 "If non-nil, save the recent-files list on exit. | 331 "If non-nil, save the recent-files list on exit. |
363 | 413 |
364 (defun recent-files-version () | 414 (defun recent-files-version () |
365 "Return a string identifying the current verion of recent-files. | 415 "Return a string identifying the current verion of recent-files. |
366 If called interactively, show it in the echo area." | 416 If called interactively, show it in the echo area." |
367 (interactive) | 417 (interactive) |
368 (let ((version "$Header: /afs/informatik.uni-tuebingen.de/local/web/xemacs/xemacs-cvs/XEmacs/xemacs/lisp/packages/Attic/recent-files.el,v 1.1.1.1 1996/12/18 22:42:54 steve Exp $")) | 418 (let ((version "$Header: /afs/informatik.uni-tuebingen.de/local/web/xemacs/xemacs-cvs/XEmacs/xemacs/lisp/packages/Attic/recent-files.el,v 1.2 1997/04/19 23:21:11 steve Exp $")) |
369 (if (interactive-p) | 419 (if (interactive-p) |
370 (message version) | 420 (message version) |
371 version))) | 421 version))) |
372 | 422 |
373 | 423 |