aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2007-09-19 15:16:31 +0000
committerStefan Monnier2007-09-19 15:16:31 +0000
commit91cc505c59b41b6fd5dacfa7301263da60fe7737 (patch)
tree6479d8c6c5a9623e81533b3633d495d47de8e7f2
parentbf8aa90140afba8b76917d740f7d05b19bbce432 (diff)
downloademacs-91cc505c59b41b6fd5dacfa7301263da60fe7737.tar.gz
emacs-91cc505c59b41b6fd5dacfa7301263da60fe7737.zip
Remove spurious * in docstrings.
(filesets-running-xemacs): Remove. Use (featurep 'xemacs) instead. (filesets-conditional-sort): Remove unused arg `simply-do-it'. (filesets-ingroup-collect): Remove unused arg `depth'. (filesets-update): Remove unused arg `version'.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/filesets.el191
2 files changed, 99 insertions, 98 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ca679f2978e..5c76f891e78 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,11 @@
12007-09-19 Stefan Monnier <monnier@iro.umontreal.ca> 12007-09-19 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * filesets.el: Remove spurious * in docstrings.
4 (filesets-running-xemacs): Remove. Use (featurep 'xemacs) instead.
5 (filesets-conditional-sort): Remove unused arg `simply-do-it'.
6 (filesets-ingroup-collect): Remove unused arg `depth'.
7 (filesets-update): Remove unused arg `version'.
8
3 * finder.el (finder-compile-keywords): Fix up comment style. 9 * finder.el (finder-compile-keywords): Fix up comment style.
4 (finder-mouse-face-on-line): previous-line -> forward-line. 10 (finder-mouse-face-on-line): previous-line -> forward-line.
5 11
diff --git a/lisp/filesets.el b/lisp/filesets.el
index ae605e6806c..e5dde847853 100644
--- a/lisp/filesets.el
+++ b/lisp/filesets.el
@@ -92,9 +92,6 @@
92 92
93 93
94;;; Some variables 94;;; Some variables
95(eval-and-compile
96 (defvar filesets-running-xemacs (string-match "XEmacs\\|Lucid" emacs-version)
97 "Non-nil means we are running XEmacs."))
98 95
99(defvar filesets-menu-cache nil 96(defvar filesets-menu-cache nil
100 "The whole filesets menu.") 97 "The whole filesets menu.")
@@ -115,12 +112,11 @@
115(defvar filesets-updated-buffers nil 112(defvar filesets-updated-buffers nil
116 "A list of buffers with updated menu bars.") 113 "A list of buffers with updated menu bars.")
117(defvar filesets-menu-use-cached-flag nil 114(defvar filesets-menu-use-cached-flag nil
118 "Use cached data. See `filesets-menu-ensure-use-cached' for details.") 115 "Use cached data. See `filesets-menu-ensure-use-cached' for details.")
119(defvar filesets-update-cache-file-flag nil 116(defvar filesets-update-cache-file-flag nil
120 "Non-nil means the cache needs updating.") 117 "Non-nil means the cache needs updating.")
121(defvar filesets-ignore-next-set-default nil 118(defvar filesets-ignore-next-set-default nil
122 "A list of custom variables for which the next `set-default' will be 119 "List of custom variables for which the next `set-default' will be ignored.")
123ignored.")
124 120
125(defvar filesets-output-buffer-flag nil 121(defvar filesets-output-buffer-flag nil
126 "Non-nil means the current buffer is an output buffer created by filesets. 122 "Non-nil means the current buffer is an output buffer created by filesets.
@@ -131,7 +127,7 @@ Is buffer local variable.")
1310 means no messages at all.") 1270 means no messages at all.")
132 128
133(defvar filesets-menu-ensure-use-cached 129(defvar filesets-menu-ensure-use-cached
134 (and filesets-running-xemacs 130 (and (featurep 'xemacs)
135 (if (fboundp 'emacs-version>=) 131 (if (fboundp 'emacs-version>=)
136 (not (emacs-version>= 21 5)))) 132 (not (emacs-version>= 21 5))))
137 "Make sure (X)Emacs uses filesets' cache. 133 "Make sure (X)Emacs uses filesets' cache.
@@ -184,7 +180,7 @@ Like `some', return the first value of FSS-PRED that is non-nil."
184 180
185(defun filesets-member (fsm-item fsm-lst &rest fsm-keys) 181(defun filesets-member (fsm-item fsm-lst &rest fsm-keys)
186 "Find the first occurrence of FSM-ITEM in FSM-LST. 182 "Find the first occurrence of FSM-ITEM in FSM-LST.
187It is supposed to work like cl's `member*'. At the moment only the :test 183It is supposed to work like cl's `member*'. At the moment only the :test
188key is supported." 184key is supported."
189 (let ((fsm-test (or (plist-get fsm-keys ':test) 185 (let ((fsm-test (or (plist-get fsm-keys ':test)
190 (function equal)))) 186 (function equal))))
@@ -214,11 +210,11 @@ key is supported."
214 (file-name-nondirectory (substring this 0 (- (length this) 1)))))) 210 (file-name-nondirectory (substring this 0 (- (length this) 1))))))
215 211
216(defun filesets-which-command (cmd) 212(defun filesets-which-command (cmd)
217 "Calls \"which CMD\"." 213 "Call \"which CMD\"."
218 (shell-command-to-string (format "which %s" cmd))) 214 (shell-command-to-string (format "which %s" cmd)))
219 215
220(defun filesets-which-command-p (cmd) 216(defun filesets-which-command-p (cmd)
221 "Calls \"which CMD\" and returns non-nil if the command was found." 217 "Call \"which CMD\" and return non-nil if the command was found."
222 (when (string-match (format "\\(/[^/]+\\)?/%s" cmd) 218 (when (string-match (format "\\(/[^/]+\\)?/%s" cmd)
223 (filesets-which-command cmd)) 219 (filesets-which-command cmd))
224 cmd)) 220 cmd))
@@ -252,7 +248,7 @@ key is supported."
252; (filesets-build-menu)) 248; (filesets-build-menu))
253 249
254;; It seems this is a workaround for the XEmacs issue described in the 250;; It seems this is a workaround for the XEmacs issue described in the
255;; doc-string of filesets-menu-ensure-use-cached. Under Emacs this is 251;; doc-string of filesets-menu-ensure-use-cached. Under Emacs this is
256;; essentially just `set-default'. 252;; essentially just `set-default'.
257(defun filesets-set-default (sym val &optional init-flag) 253(defun filesets-set-default (sym val &optional init-flag)
258 "Set-default wrapper function used in conjunction with `defcustom'. 254 "Set-default wrapper function used in conjunction with `defcustom'.
@@ -307,55 +303,55 @@ SYM to VAL and return t. If INIT-FLAG is non-nil, set with
307 :version "22.1") 303 :version "22.1")
308 304
309(defcustom filesets-menu-name "Filesets" 305(defcustom filesets-menu-name "Filesets"
310 "*Filesets' menu name." 306 "Filesets' menu name."
311 :set (function filesets-set-default) 307 :set (function filesets-set-default)
312 :type 'sexp 308 :type 'sexp
313 :group 'filesets) 309 :group 'filesets)
314 310
315(defcustom filesets-menu-path nil 311(defcustom filesets-menu-path nil
316 "*The menu under which the filesets menu should be inserted. 312 "The menu under which the filesets menu should be inserted.
317See `add-submenu' for documentation." 313See `add-submenu' for documentation."
318 :set (function filesets-set-default) 314 :set (function filesets-set-default)
319 :type 'sexp 315 :type 'sexp
320 :group 'filesets) 316 :group 'filesets)
321 317
322(defcustom filesets-menu-before "File" 318(defcustom filesets-menu-before "File"
323 "*The name of a menu before which this menu should be added. 319 "The name of a menu before which this menu should be added.
324See `add-submenu' for documentation." 320See `add-submenu' for documentation."
325 :set (function filesets-set-default) 321 :set (function filesets-set-default)
326 :type 'sexp 322 :type 'sexp
327 :group 'filesets) 323 :group 'filesets)
328 324
329(defcustom filesets-menu-in-menu nil 325(defcustom filesets-menu-in-menu nil
330 "*Use that instead of `current-menubar' as the menu to change. 326 "Use that instead of `current-menubar' as the menu to change.
331See `add-submenu' for documentation." 327See `add-submenu' for documentation."
332 :set (function filesets-set-default) 328 :set (function filesets-set-default)
333 :type 'sexp 329 :type 'sexp
334 :group 'filesets) 330 :group 'filesets)
335 331
336(defcustom filesets-menu-shortcuts-flag t 332(defcustom filesets-menu-shortcuts-flag t
337 "*Non-nil means to prepend menus with hopefully unique shortcuts." 333 "Non-nil means to prepend menus with hopefully unique shortcuts."
338 :set (function filesets-set-default!) 334 :set (function filesets-set-default!)
339 :type 'boolean 335 :type 'boolean
340 :group 'filesets) 336 :group 'filesets)
341 337
342(defcustom filesets-menu-shortcuts-marker "%_" 338(defcustom filesets-menu-shortcuts-marker "%_"
343 "*String for marking menu shortcuts." 339 "String for marking menu shortcuts."
344 :set (function filesets-set-default!) 340 :set (function filesets-set-default!)
345 :type 'string 341 :type 'string
346 :group 'filesets) 342 :group 'filesets)
347 343
348;(defcustom filesets-menu-cnvfp-flag nil 344;;(defcustom filesets-menu-cnvfp-flag nil
349; "*Non-nil means show \"Convert :pattern to :files\" entry for :pattern menus." 345;; "*Non-nil means show \"Convert :pattern to :files\" entry for :pattern menus."
350; :set (function filesets-set-default!) 346;; :set (function filesets-set-default!)
351; :type 'boolean 347;; :type 'boolean
352; :group 'filesets) 348;; :group 'filesets)
353 349
354(defcustom filesets-menu-cache-file 350(defcustom filesets-menu-cache-file
355 (if filesets-running-xemacs 351 (if (featurep 'xemacs)
356 "~/.xemacs/filesets-cache.el" 352 "~/.xemacs/filesets-cache.el"
357 (concat user-emacs-directory "filesets-cache.el")) 353 (concat user-emacs-directory "filesets-cache.el"))
358 "*File to be used for saving the filesets menu between sessions. 354 "File to be used for saving the filesets menu between sessions.
359Set this to \"\", to disable caching of menus. 355Set this to \"\", to disable caching of menus.
360Don't forget to check out `filesets-menu-ensure-use-cached'." 356Don't forget to check out `filesets-menu-ensure-use-cached'."
361 :set (function filesets-set-default) 357 :set (function filesets-set-default)
@@ -368,16 +364,16 @@ Don't forget to check out `filesets-menu-ensure-use-cached'."
368 filesets-submenus 364 filesets-submenus
369 filesets-menu-cache 365 filesets-menu-cache
370 filesets-ingroup-cache) 366 filesets-ingroup-cache)
371 "*Stuff we want to save in `filesets-menu-cache-file'. 367 "Stuff we want to save in `filesets-menu-cache-file'.
372 368
373Possible uses: don't save configuration data in the main startup files 369Possible uses: don't save configuration data in the main startup files
374but in filesets's own cache. In this case add `filesets-data' to this 370but in filesets's own cache. In this case add `filesets-data' to this
375list. 371list.
376 372
377There is a second reason for putting `filesets-data' on this list. If 373There is a second reason for putting `filesets-data' on this list. If
378you frequently add and remove buffers on the fly to :files filesets, you 374you frequently add and remove buffers on the fly to :files filesets, you
379don't need to save your customizations if `filesets-data' is being 375don't need to save your customizations if `filesets-data' is being
380mirrored in the cache file. In this case the version in the cache file 376mirrored in the cache file. In this case the version in the cache file
381is the current one, and the version in your startup file will be 377is the current one, and the version in your startup file will be
382silently updated later on. 378silently updated later on.
383 379
@@ -407,7 +403,7 @@ Don't forget to check out `filesets-menu-ensure-use-cached'."
407 :group 'filesets) 403 :group 'filesets)
408 404
409(defcustom filesets-cache-fill-content-hooks nil 405(defcustom filesets-cache-fill-content-hooks nil
410 "*Hooks to run when writing the contents of filesets' cache file. 406 "Hooks to run when writing the contents of filesets' cache file.
411 407
412The hook is called with the cache file as current buffer and the cursor 408The hook is called with the cache file as current buffer and the cursor
413at the last position. I.e. each hook has to make sure that the cursor is 409at the last position. I.e. each hook has to make sure that the cursor is
@@ -429,7 +425,7 @@ Don't forget to check out `filesets-menu-ensure-use-cached'."
429 :group 'filesets) 425 :group 'filesets)
430 426
431(defcustom filesets-cache-hostname-flag nil 427(defcustom filesets-cache-hostname-flag nil
432 "*Non-nil means cache the hostname. 428 "Non-nil means cache the hostname.
433If the current name differs from the cached one, 429If the current name differs from the cached one,
434rebuild the menu and create a new cache file." 430rebuild the menu and create a new cache file."
435 :set (function filesets-set-default) 431 :set (function filesets-set-default)
@@ -437,16 +433,16 @@ rebuild the menu and create a new cache file."
437 :group 'filesets) 433 :group 'filesets)
438 434
439(defcustom filesets-cache-save-often-flag nil 435(defcustom filesets-cache-save-often-flag nil
440 "*Non-nil means save buffer on every change of the filesets menu. 436 "Non-nil means save buffer on every change of the filesets menu.
441If this variable is set to nil and if Emacs crashes, the cache and 437If this variable is set to nil and if Emacs crashes, the cache and
442filesets-data could get out of sync. Set this to t if this happens from 438filesets-data could get out of sync. Set this to t if this happens from
443time to time or if the fileset cache causes troubles." 439time to time or if the fileset cache causes troubles."
444 :set (function filesets-set-default) 440 :set (function filesets-set-default)
445 :type 'boolean 441 :type 'boolean
446 :group 'filesets) 442 :group 'filesets)
447 443
448(defcustom filesets-max-submenu-length 25 444(defcustom filesets-max-submenu-length 25
449 "*Maximum length of submenus. 445 "Maximum length of submenus.
450Set this value to 0 to turn menu splitting off. BTW, parts of submenus 446Set this value to 0 to turn menu splitting off. BTW, parts of submenus
451will not be rewrapped if their length exceeds this value." 447will not be rewrapped if their length exceeds this value."
452 :set (function filesets-set-default) 448 :set (function filesets-set-default)
@@ -454,13 +450,13 @@ will not be rewrapped if their length exceeds this value."
454 :group 'filesets) 450 :group 'filesets)
455 451
456(defcustom filesets-max-entry-length 50 452(defcustom filesets-max-entry-length 50
457 "*Truncate names of splitted submenus to this length." 453 "Truncate names of splitted submenus to this length."
458 :set (function filesets-set-default) 454 :set (function filesets-set-default)
459 :type 'integer 455 :type 'integer
460 :group 'filesets) 456 :group 'filesets)
461 457
462(defcustom filesets-browse-dir-function 'dired 458(defcustom filesets-browse-dir-function 'dired
463 "*A function or command used for browsing directories. 459 "A function or command used for browsing directories.
464When using an external command, \"%s\" will be replaced with the 460When using an external command, \"%s\" will be replaced with the
465directory's name. 461directory's name.
466 462
@@ -478,7 +474,7 @@ Note: You have to manually rebuild the menu if you change this value."
478 :group 'filesets) 474 :group 'filesets)
479 475
480(defcustom filesets-open-file-function 'filesets-find-or-display-file 476(defcustom filesets-open-file-function 'filesets-find-or-display-file
481 "*The function used for opening files. 477 "The function used for opening files.
482 478
483`filesets-find-or-display-file' ... Filesets' default function for 479`filesets-find-or-display-file' ... Filesets' default function for
484visiting files. This function checks if an external viewer is defined 480visiting files. This function checks if an external viewer is defined
@@ -486,7 +482,7 @@ for a specific file type. Either this viewer, if defined, or
486`find-file' will be used to visit a file. 482`find-file' will be used to visit a file.
487 483
488`filesets-find-file' ... An alternative function that always uses 484`filesets-find-file' ... An alternative function that always uses
489`find-file'. If `filesets-be-docile-flag' is true, a file, which isn't 485`find-file'. If `filesets-be-docile-flag' is true, a file, which isn't
490readable, will not be opened. 486readable, will not be opened.
491 487
492Caveat: Changes will take effect only after rebuilding the menu." 488Caveat: Changes will take effect only after rebuilding the menu."
@@ -501,7 +497,7 @@ Caveat: Changes will take effect only after rebuilding the menu."
501 :group 'filesets) 497 :group 'filesets)
502 498
503(defcustom filesets-save-buffer-function 'save-buffer 499(defcustom filesets-save-buffer-function 'save-buffer
504 "*The function used to save a buffer. 500 "The function used to save a buffer.
505Caveat: Changes will take effect after rebuilding the menu." 501Caveat: Changes will take effect after rebuilding the menu."
506 :set (function filesets-set-default) 502 :set (function filesets-set-default)
507 :type '(choice :tag "Function:" 503 :type '(choice :tag "Function:"
@@ -512,10 +508,10 @@ Caveat: Changes will take effect after rebuilding the menu."
512 :group 'filesets) 508 :group 'filesets)
513 509
514(defcustom filesets-find-file-delay 510(defcustom filesets-find-file-delay
515 (if (and filesets-running-xemacs gutter-buffers-tab-visible-p) 511 (if (and (featurep 'xemacs) gutter-buffers-tab-visible-p)
516 0.5 512 0.5
517 0) 513 0)
518 "*Delay before calling find-file. 514 "Delay before calling `find-file'.
519This is for calls via `filesets-find-or-display-file' 515This is for calls via `filesets-find-or-display-file'
520or `filesets-find-file'. 516or `filesets-find-file'.
521 517
@@ -525,7 +521,7 @@ Set this to 0, if you don't use XEmacs' buffer tabs."
525 :group 'filesets) 521 :group 'filesets)
526 522
527(defcustom filesets-be-docile-flag nil 523(defcustom filesets-be-docile-flag nil
528 "*Non-nil means don't complain if a file or a directory doesn't exist. 524 "Non-nil means don't complain if a file or a directory doesn't exist.
529This is useful if you want to use the same startup files in different 525This is useful if you want to use the same startup files in different
530computer environments." 526computer environments."
531 :set (function filesets-set-default) 527 :set (function filesets-set-default)
@@ -533,19 +529,19 @@ computer environments."
533 :group 'filesets) 529 :group 'filesets)
534 530
535(defcustom filesets-sort-menu-flag t 531(defcustom filesets-sort-menu-flag t
536 "*Non-nil means sort the filesets menu alphabetically." 532 "Non-nil means sort the filesets menu alphabetically."
537 :set (function filesets-set-default) 533 :set (function filesets-set-default)
538 :type 'boolean 534 :type 'boolean
539 :group 'filesets) 535 :group 'filesets)
540 536
541(defcustom filesets-sort-case-sensitive-flag t 537(defcustom filesets-sort-case-sensitive-flag t
542 "*Non-nil means sorting of the filesete menu is case sensitive." 538 "Non-nil means sorting of the filesete menu is case sensitive."
543 :set (function filesets-set-default) 539 :set (function filesets-set-default)
544 :type 'boolean 540 :type 'boolean
545 :group 'filesets) 541 :group 'filesets)
546 542
547(defcustom filesets-tree-max-level 3 543(defcustom filesets-tree-max-level 3
548 "*Maximum scan depth for directory trees. 544 "Maximum scan depth for directory trees.
549A :tree fileset is defined by a base directory the contents of which 545A :tree fileset is defined by a base directory the contents of which
550will be recursively added to the menu. `filesets-tree-max-level' tells up 546will be recursively added to the menu. `filesets-tree-max-level' tells up
551to which level the directory structure should be scanned/listed, 547to which level the directory structure should be scanned/listed,
@@ -579,7 +575,7 @@ including directory trees to the menu can take a lot of memory."
579 ("Run Shell Command" 575 ("Run Shell Command"
580 filesets-cmd-shell-command 576 filesets-cmd-shell-command
581 (filesets-cmd-shell-command-getargs))) 577 (filesets-cmd-shell-command-getargs)))
582 "*Commands to run on filesets. 578 "Commands to run on filesets.
583An association list of names, functions, and an argument list (or a 579An association list of names, functions, and an argument list (or a
584function that returns one) to be run on a filesets' files. 580function that returns one) to be run on a filesets' files.
585 581
@@ -607,16 +603,16 @@ the filename."
607 603
608(defcustom filesets-external-viewers 604(defcustom filesets-external-viewers
609 (let 605 (let
610; ((ps-cmd (or (and (boundp 'my-ps-viewer) my-ps-viewer) 606 ;; ((ps-cmd (or (and (boundp 'my-ps-viewer) my-ps-viewer)
611; (filesets-select-command "ggv gv"))) 607 ;; (filesets-select-command "ggv gv")))
612; (pdf-cmd (or (and (boundp 'my-ps-viewer) my-pdf-viewer) 608 ;; (pdf-cmd (or (and (boundp 'my-ps-viewer) my-pdf-viewer)
613; (filesets-select-command "xpdf acroread"))) 609 ;; (filesets-select-command "xpdf acroread")))
614; (dvi-cmd (or (and (boundp 'my-ps-viewer) my-dvi-viewer) 610 ;; (dvi-cmd (or (and (boundp 'my-ps-viewer) my-dvi-viewer)
615; (filesets-select-command "xdvi tkdvi"))) 611 ;; (filesets-select-command "xdvi tkdvi")))
616; (doc-cmd (or (and (boundp 'my-ps-viewer) my-doc-viewer) 612 ;; (doc-cmd (or (and (boundp 'my-ps-viewer) my-doc-viewer)
617; (filesets-select-command "antiword"))) 613 ;; (filesets-select-command "antiword")))
618; (pic-cmd (or (and (boundp 'my-ps-viewer) my-pic-viewer) 614 ;; (pic-cmd (or (and (boundp 'my-ps-viewer) my-pic-viewer)
619; (filesets-select-command "gqview ee display")))) 615 ;; (filesets-select-command "gqview ee display"))))
620 ((ps-cmd "ggv") 616 ((ps-cmd "ggv")
621 (pdf-cmd "xpdf") 617 (pdf-cmd "xpdf")
622 (dvi-cmd "xdvi") 618 (dvi-cmd "xdvi")
@@ -644,7 +640,7 @@ the filename."
644 ((:ignore-on-open-all t) 640 ((:ignore-on-open-all t)
645 (:ignore-on-read-text t) 641 (:ignore-on-read-text t)
646 (:constraint-flag ,pic-cmd))))) 642 (:constraint-flag ,pic-cmd)))))
647 "*Association list of file patterns and external viewers for use with 643 "Association list of file patterns and external viewers for use with
648`filesets-find-or-display-file'. 644`filesets-find-or-display-file'.
649 645
650Has the form ((FILE-PATTERN VIEWER PROPERTIES) ...), VIEWER being either a 646Has the form ((FILE-PATTERN VIEWER PROPERTIES) ...), VIEWER being either a
@@ -674,21 +670,20 @@ variables my-ps-viewer, my-pdf-viewer, my-dvi-viewer, my-pic-viewer.
674In order to view pdf or rtf files in an Emacs buffer, you could use these: 670In order to view pdf or rtf files in an Emacs buffer, you could use these:
675 671
676 672
677 \(\"^.+\\.pdf$\" \"pdftotext\" 673 \(\"^.+\\\\.pdf\\\\'\" \"pdftotext\"
678 \((:capture-output t) 674 \((:capture-output t)
679 \(:args (\"%S - | fmt -w \" window-width)) 675 \(:args (\"%S - | fmt -w \" window-width))
680 \(:ignore-on-read-text t) 676 \(:ignore-on-read-text t)
681 \(:constraintp (lambda () 677 \(:constraintp (lambda ()
682 \(and \(filesets-which-command-p \"pdftotext\") 678 \(and \(filesets-which-command-p \"pdftotext\")
683 \(filesets-which-command-p \"fmt\")))))) 679 \(filesets-which-command-p \"fmt\"))))))
684 \(\"^.+\\.rtf$\" \"rtf2htm\" 680 \(\"^.+\\\\.rtf\\\\'\" \"rtf2htm\"
685 \((:capture-output t) 681 \((:capture-output t)
686 \(:args (\"%S 2> /dev/null | w3m -dump -T text/html\")) 682 \(:args (\"%S 2> /dev/null | w3m -dump -T text/html\"))
687 \(:ignore-on-read-text t) 683 \(:ignore-on-read-text t)
688 \(:constraintp (lambda () 684 \(:constraintp (lambda ()
689 \(and (filesets-which-command-p \"rtf2htm\") 685 \(and (filesets-which-command-p \"rtf2htm\")
690 \(filesets-which-command-p \"w3m\")))))) 686 \(filesets-which-command-p \"w3m\"))))))"
691"
692 :set (function filesets-set-default) 687 :set (function filesets-set-default)
693 :type '(repeat :tag "Viewer" 688 :type '(repeat :tag "Viewer"
694 (list :tag "Definition" 689 (list :tag "Definition"
@@ -814,7 +809,7 @@ In order to view pdf or rtf files in an Emacs buffer, you could use these:
814 emacs-wiki-directories 809 emacs-wiki-directories
815 nil)))))))) 810 nil))))))))
816 811
817 "*Inclusion group definitions. 812 "Inclusion group definitions.
818 813
819Define how to find included file according to a file's mode (being 814Define how to find included file according to a file's mode (being
820defined by a file pattern). 815defined by a file pattern).
@@ -865,8 +860,8 @@ Stubs:
865 860
866First, a stub is a file that shows up in the menu but will not be 861First, a stub is a file that shows up in the menu but will not be
867included in an ingroup's file listing -- i.e. filesets will never 862included in an ingroup's file listing -- i.e. filesets will never
868operate on this file automatically. Secondly, in opposition to normal 863operate on this file automatically. Secondly, in opposition to normal
869files stubs are not scanned for new inclusion groups. This is useful if 864files stubs are not scanned for new inclusion groups. This is useful if
870you want to have quick access to library headers. 865you want to have quick access to library headers.
871 866
872In the menu, an asterisk is appended to the stub's name. 867In the menu, an asterisk is appended to the stub's name.
@@ -937,9 +932,8 @@ With duplicates removed, it would be:
937 :group 'filesets) 932 :group 'filesets)
938(put 'filesets-ingroup-patterns 'risky-local-variable t) 933(put 'filesets-ingroup-patterns 'risky-local-variable t)
939 934
940(defcustom filesets-data 935(defcustom filesets-data nil
941 nil 936 "Fileset definitions.
942 "*Fileset definitions.
943 937
944A fileset is either a list of files, a file pattern, a base directory 938A fileset is either a list of files, a file pattern, a base directory
945and a search pattern (for files), or a base file. Changes to this 939and a search pattern (for files), or a base file. Changes to this
@@ -1065,27 +1059,27 @@ defined in `filesets-ingroup-patterns'."
1065 1059
1066 1060
1067(defcustom filesets-query-user-limit 15 1061(defcustom filesets-query-user-limit 15
1068 "*Query the user before opening a fileset with that many files." 1062 "Query the user before opening a fileset with that many files."
1069 :set (function filesets-set-default) 1063 :set (function filesets-set-default)
1070 :type 'integer 1064 :type 'integer
1071 :group 'filesets) 1065 :group 'filesets)
1072 1066
1073;;; Emacs compatibility 1067;;; Emacs compatibility
1074(eval-and-compile 1068(eval-and-compile
1075 (if filesets-running-xemacs 1069 (if (featurep 'xemacs)
1076 (fset 'filesets-error 'error) 1070 (fset 'filesets-error 'error)
1077 1071
1078 (require 'easymenu) 1072 (require 'easymenu)
1079 1073
1080 (defun filesets-error (class &rest args) 1074 (defun filesets-error (class &rest args)
1081 "`error' wrapper." 1075 "`error' wrapper."
1082 (error (mapconcat 'identity args " "))) 1076 (error "%s" (mapconcat 'identity args " ")))
1083 1077
1084 )) 1078 ))
1085 1079
1086(defun filesets-filter-dir-names (lst &optional negative) 1080(defun filesets-filter-dir-names (lst &optional negative)
1087 "Remove non-directory names from a list of strings. If NEGATIVE is 1081 "Remove non-directory names from a list of strings.
1088non-nil, remove all directory names." 1082If NEGATIVE is non-nil, remove all directory names."
1089 (filesets-filter-list lst 1083 (filesets-filter-list lst
1090 (lambda (x) 1084 (lambda (x)
1091 (and (not (string-match "^\\.+/$" x)) 1085 (and (not (string-match "^\\.+/$" x))
@@ -1093,7 +1087,7 @@ non-nil, remove all directory names."
1093 (not (string-match "[:/\\]$" x)) 1087 (not (string-match "[:/\\]$" x))
1094 (string-match "[:/\\]$" x)))))) 1088 (string-match "[:/\\]$" x))))))
1095 1089
1096(defun filesets-conditional-sort (lst &optional access-fn simply-do-it) 1090(defun filesets-conditional-sort (lst &optional access-fn)
1097 "Return a sorted copy of LST, LST being a list of strings. 1091 "Return a sorted copy of LST, LST being a list of strings.
1098If `filesets-sort-menu-flag' is nil, return LST itself. 1092If `filesets-sort-menu-flag' is nil, return LST itself.
1099 1093
@@ -1116,10 +1110,11 @@ If SIMPLY-DO-IT is non-nil, the list is sorted regardless of
1116 1110
1117(defun filesets-directory-files (dir &optional 1111(defun filesets-directory-files (dir &optional
1118 pattern what full-flag match-dirs-flag) 1112 pattern what full-flag match-dirs-flag)
1119 "Get WHAT (:files or :dirs) in DIR. If PATTERN is provided return only 1113 "Get WHAT (:files or :dirs) in DIR.
1120those entries matching this regular expression. If MATCH-DIRS-FLAG is 1114If PATTERN is provided return only those entries matching this
1121non-nil, also match directory entries. Return full path if FULL-FLAG is 1115regular expression.
1122non-nil." 1116If MATCH-DIRS-FLAG is non-nil, also match directory entries.
1117Return full path if FULL-FLAG is non-nil."
1123 (filesets-message 2 "Filesets: scanning %S" dir) 1118 (filesets-message 2 "Filesets: scanning %S" dir)
1124 (cond 1119 (cond
1125 ((file-exists-p dir) 1120 ((file-exists-p dir)
@@ -1262,7 +1257,7 @@ non-nil."
1262 filesets-external-viewers))) 1257 filesets-external-viewers)))
1263 1258
1264(defun filesets-filetype-property (filename event &optional entry) 1259(defun filesets-filetype-property (filename event &optional entry)
1265 "Returns non-nil if a file of a specific type has special flags/tags. 1260 "Return non-nil if a file of a specific type has special flags/tags.
1266 1261
1267Events (corresponding tag): 1262Events (corresponding tag):
1268 1263
@@ -1291,7 +1286,7 @@ on-close-all ... not used"
1291 nil t))) 1286 nil t)))
1292 1287
1293(defun filesets-filetype-get-prop (property filename &optional entry) 1288(defun filesets-filetype-get-prop (property filename &optional entry)
1294 "Returns PROPERTY for filename -- use ENTRY if provided." 1289 "Return PROPERTY for filename -- use ENTRY if provided."
1295 (let ((def (filesets-eviewer-get-props 1290 (let ((def (filesets-eviewer-get-props
1296 (or entry 1291 (or entry
1297 (filesets-get-external-viewer filename))))) 1292 (filesets-get-external-viewer filename)))))
@@ -1411,7 +1406,7 @@ not be opened."
1411 name args))))) 1406 name args)))))
1412 1407
1413(defun filesets-get-fileset-name (something) 1408(defun filesets-get-fileset-name (something)
1414 "Get SOMETHING's name. (Don't ask.)" 1409 "Get SOMETHING's name (Don't ask)."
1415 (cond 1410 (cond
1416 ((listp something) 1411 ((listp something)
1417 (car something)) 1412 (car something))
@@ -1419,11 +1414,11 @@ not be opened."
1419 something))) 1414 something)))
1420 1415
1421(defun filesets-data-get-name (entry) 1416(defun filesets-data-get-name (entry)
1422 "Access to `filesets-data'. Get the entry's name" 1417 "Access to `filesets-data'. Get the entry's name."
1423 (car entry)) 1418 (car entry))
1424 1419
1425(defun filesets-data-get-data (entry) 1420(defun filesets-data-get-data (entry)
1426 "Access to `filesets-data'. Get the entry's data section" 1421 "Access to `filesets-data'. Get the entry's data section."
1427 (cdr entry)) 1422 (cdr entry))
1428 1423
1429(defun filesets-alist-get (alist key &optional default carp) 1424(defun filesets-alist-get (alist key &optional default carp)
@@ -1534,8 +1529,8 @@ Use FILESET-ENTRY for finding the save function, if provided."
1534 (filesets-data-get entry ':ingroup nil t)) 1529 (filesets-data-get entry ':ingroup nil t))
1535 1530
1536(defun filesets-file-open (open-function file-name &optional fileset-name) 1531(defun filesets-file-open (open-function file-name &optional fileset-name)
1537 "Open FILE-NAME using OPEN-FUNCTION. If OPEN-FUNCTION is nil, its 1532 "Open FILE-NAME using OPEN-FUNCTION.
1538value will be deduced from FILESET-NAME." 1533If OPEN-FUNCTION is nil, its value will be deduced from FILESET-NAME."
1539 (let ((open-function (or open-function 1534 (let ((open-function (or open-function
1540 (filesets-entry-get-open-fn fileset-name)))) 1535 (filesets-entry-get-open-fn fileset-name))))
1541 (if (file-readable-p file-name) 1536 (if (file-readable-p file-name)
@@ -1597,7 +1592,7 @@ SAVE-FUNCTION takes no argument, but works on the current buffer."
1597 (newline)) 1592 (newline))
1598 1593
1599(defun filesets-run-cmd--repl-fn (arg &optional format-fn) 1594(defun filesets-run-cmd--repl-fn (arg &optional format-fn)
1600 "Helper function for `filesets-run-cmd'. Apply FORMAT-FN to arg. 1595 "Helper function for `filesets-run-cmd'. Apply FORMAT-FN to arg.
1601Replace <file-name> or <<file-name>> with filename." 1596Replace <file-name> or <<file-name>> with filename."
1602 (funcall format-fn (cond 1597 (funcall format-fn (cond
1603 ((equal arg "<file-name>") 1598 ((equal arg "<file-name>")
@@ -1787,7 +1782,7 @@ Use LOOKUP-NAME for deducing the save-function, if provided."
1787 (filesets-error 'error "Filesets: Unknown fileset: " name)))) 1782 (filesets-error 'error "Filesets: Unknown fileset: " name))))
1788 1783
1789(defun filesets-add-buffer (&optional name buffer) 1784(defun filesets-add-buffer (&optional name buffer)
1790 "Add BUFFER (or current-buffer) to the fileset called NAME. 1785 "Add BUFFER (or current buffer) to the fileset called NAME.
1791User will be queried, if no fileset name is provided." 1786User will be queried, if no fileset name is provided."
1792 (interactive) 1787 (interactive)
1793 (let* ((buffer (or buffer 1788 (let* ((buffer (or buffer
@@ -1822,7 +1817,7 @@ User will be queried, if no fileset name is provided."
1822 (message "Filesets: Can't add '%s' to fileset '%s'" this name))))))) 1817 (message "Filesets: Can't add '%s' to fileset '%s'" this name)))))))
1823 1818
1824(defun filesets-remove-buffer (&optional name buffer) 1819(defun filesets-remove-buffer (&optional name buffer)
1825 "Remove BUFFER (or current-buffer) to fileset NAME. 1820 "Remove BUFFER (or current buffer) to fileset NAME.
1826User will be queried, if no fileset name is provided." 1821User will be queried, if no fileset name is provided."
1827 (interactive) 1822 (interactive)
1828 (let* ((buffer (or buffer 1823 (let* ((buffer (or buffer
@@ -2014,11 +2009,11 @@ LOOKUP-NAME is used as lookup name for retrieving fileset specific settings."
2014 "Access to `filesets-ingroup-patterns'. Extract remove-duplicates-flag." 2009 "Access to `filesets-ingroup-patterns'. Extract remove-duplicates-flag."
2015 (filesets-ingroup-get-data master 1)) 2010 (filesets-ingroup-get-data master 1))
2016 2011
2017(defun filesets-ingroup-collect-finder (patt case-sencitivep) 2012(defun filesets-ingroup-collect-finder (patt case-sensitivep)
2018 "Helper function for `filesets-ingroup-collect'. Find pattern PATT." 2013 "Helper function for `filesets-ingroup-collect'. Find pattern PATT."
2019 (let ((cfs case-fold-search) 2014 (let ((cfs case-fold-search)
2020 (rv (progn 2015 (rv (progn
2021 (setq case-fold-search (not case-sencitivep)) 2016 (setq case-fold-search (not case-sensitivep))
2022 (re-search-forward patt nil t)))) 2017 (re-search-forward patt nil t))))
2023 (setq case-fold-search cfs) 2018 (setq case-fold-search cfs)
2024 rv)) 2019 rv))
@@ -2107,8 +2102,8 @@ LOOKUP-NAME is used as lookup name for retrieving fileset specific settings."
2107 (filesets-message 2 "Filesets: no patterns defined for %S" master))))) 2102 (filesets-message 2 "Filesets: no patterns defined for %S" master)))))
2108 2103
2109(defun filesets-ingroup-collect-build-menu (fs flist &optional other-count) 2104(defun filesets-ingroup-collect-build-menu (fs flist &optional other-count)
2110 "Helper function for `filesets-ingroup-collect'. Build the menu. 2105 "Helper function for `filesets-ingroup-collect'. Build the menu.
2111FS is a fileset's name. FLIST is a list returned by 2106FS is a fileset's name. FLIST is a list returned by
2112`filesets-ingroup-collect-files'." 2107`filesets-ingroup-collect-files'."
2113 (if (null flist) 2108 (if (null flist)
2114 nil 2109 nil
@@ -2150,7 +2145,7 @@ FS is a fileset's name. FLIST is a list returned by
2150 ,@(filesets-get-menu-epilog master ':ingroup fsn))) 2145 ,@(filesets-get-menu-epilog master ':ingroup fsn)))
2151 `([,nm (filesets-file-open nil ',master ',fsn)]))))))))) 2146 `([,nm (filesets-file-open nil ',master ',fsn)])))))))))
2152 2147
2153(defun filesets-ingroup-collect (fs remdupl-flag master &optional depth) 2148(defun filesets-ingroup-collect (fs remdupl-flag master)
2154 "Collect names of included files & build submenu." 2149 "Collect names of included files & build submenu."
2155 (filesets-ingroup-cache-put master nil) 2150 (filesets-ingroup-cache-put master nil)
2156 (filesets-message 2 "Filesets: parsing %S" master) 2151 (filesets-message 2 "Filesets: parsing %S" master)
@@ -2306,7 +2301,7 @@ Construct a shortcut from COUNT."
2306 lookup-name t))))))))))) 2301 lookup-name t)))))))))))
2307 2302
2308(defun filesets-remove-from-ubl (&optional buffer) 2303(defun filesets-remove-from-ubl (&optional buffer)
2309 "BUFFER or current-buffer require update of the filesets menu." 2304 "BUFFER or current buffer require update of the filesets menu."
2310 (let ((b (or buffer 2305 (let ((b (or buffer
2311 (current-buffer)))) 2306 (current-buffer))))
2312 (if (member b filesets-updated-buffers) 2307 (if (member b filesets-updated-buffers)
@@ -2470,7 +2465,7 @@ We apologize for the inconvenience."))
2470 (find-file-other-window cf)) 2465 (find-file-other-window cf))
2471 (filesets-error 'error msg)))) 2466 (filesets-error 'error msg))))
2472 2467
2473(defun filesets-update (version cached-version) 2468(defun filesets-update (cached-version)
2474 "Do some cleanup after updating filesets.el." 2469 "Do some cleanup after updating filesets.el."
2475 (cond 2470 (cond
2476 ((or (not cached-version) 2471 ((or (not cached-version)
@@ -2492,7 +2487,7 @@ We apologize for the inconvenience."))
2492 (progn 2487 (progn
2493 (setq filesets-update-cache-file-flag nil) 2488 (setq filesets-update-cache-file-flag nil)
2494 t) 2489 t)
2495 (filesets-update filesets-version filesets-cache-version))) 2490 (filesets-update filesets-cache-version)))
2496 (t 2491 (t
2497 (setq filesets-update-cache-file-flag t) 2492 (setq filesets-update-cache-file-flag t)
2498 nil))) 2493 nil)))
@@ -2504,7 +2499,7 @@ We apologize for the inconvenience."))
2504(defun filesets-init () 2499(defun filesets-init ()
2505 "Filesets initialization. 2500 "Filesets initialization.
2506Set up hooks, load the cache file -- if existing -- and build the menu." 2501Set up hooks, load the cache file -- if existing -- and build the menu."
2507 (add-hook (if filesets-running-xemacs 'activate-menubar-hook 'menu-bar-update-hook) 2502 (add-hook (if (featurep 'xemacs) 'activate-menubar-hook 'menu-bar-update-hook)
2508 (function filesets-build-menu-maybe)) 2503 (function filesets-build-menu-maybe))
2509 (add-hook 'kill-buffer-hook (function filesets-remove-from-ubl)) 2504 (add-hook 'kill-buffer-hook (function filesets-remove-from-ubl))
2510 (add-hook 'first-change-hook (function filesets-reset-filename-on-change)) 2505 (add-hook 'first-change-hook (function filesets-reset-filename-on-change))
@@ -2522,9 +2517,9 @@ Set up hooks, load the cache file -- if existing -- and build the menu."
2522 2517
2523(provide 'filesets) 2518(provide 'filesets)
2524 2519
2525;;; Local Variables: 2520;; Local Variables:
2526;;; sentence-end-double-space:t 2521;; sentence-end-double-space:t
2527;;; End: 2522;; End:
2528 2523
2529;;; arch-tag: 2c03f85f-c3df-4cec-b0a3-b46fd5592d70 2524;; arch-tag: 2c03f85f-c3df-4cec-b0a3-b46fd5592d70
2530;;; filesets.el ends here 2525;;; filesets.el ends here