(occur-read-primary-args): Pass default to read-from-minibuffer.
[bpt/emacs.git] / lisp / fast-lock.el
index b9308a8..6812361 100644 (file)
@@ -1,12 +1,13 @@
-;;; fast-lock.el --- Automagic text properties caching for fast Font Lock mode.
+;;; fast-lock.el --- automagic text properties caching for fast Font Lock mode
 
 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 
-;; Author: Simon Marshall <simon@gnu.ai.mit.edu>
+;; Author: Simon Marshall <simon@gnu.org>
+;; Maintainer: FSF
 ;; Keywords: faces files
 ;; Version: 3.14
 
-;;; This file is part of GNU Emacs.
+;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -33,7 +34,7 @@
 ;; See also the lazy-lock package.  (But don't use the two at the same time!)
 
 ;; Installation:
-;; 
+;;
 ;; Put in your ~/.emacs:
 ;;
 ;; (setq font-lock-support-mode 'fast-lock-mode)
@@ -66,7 +67,7 @@
 ;; 1.01--2.00: complete rewrite---not worth the space to document
 ;; - Changed structure of text properties cache and threw out file mod checks
 ;; 2.00--2.01:
-;; - Made `condition-case' forms understand `quit'. 
+;; - Made `condition-case' forms understand `quit'.
 ;; - Made `fast-lock' require `font-lock'
 ;; - Made `fast-lock-cache-name' chase links (from Ben Liblit)
 ;; 2.01--3.00:
     (error "`fast-lock' was written for long file name systems"))
 
 (eval-when-compile
-  ;;
-  ;; We don't do this at the top-level as we only use non-autoloaded macros.
-  (require 'cl)
-  ;;
-  ;; We use this to preserve or protect things when modifying text properties.
-  (defmacro save-buffer-state (varlist &rest body)
-    "Bind variables according to VARLIST and eval BODY restoring buffer state."
-    (` (let* ((,@ (append varlist
-                  '((modified (buffer-modified-p)) (buffer-undo-list t)
-                    (inhibit-read-only t) (inhibit-point-motion-hooks t)
-                    before-change-functions after-change-functions
-                    deactivate-mark buffer-file-name buffer-file-truename))))
-        (,@ body)
-        (when (and (not modified) (buffer-modified-p))
-          (set-buffer-modified-p nil)))))
-  (put 'save-buffer-state 'lisp-indent-function 1)
-  ;;
-  ;; We use this to verify that a face should be saved.
-  (defmacro fast-lock-save-facep (face)
-    "Return non-nil if FACE is one of `fast-lock-save-faces'."
-    (` (or (null fast-lock-save-faces)
-          (if (symbolp (, face))
-              (memq (, face) fast-lock-save-faces)
-            (let ((faces (, face)))
-              (while (unless (memq (car faces) fast-lock-save-faces)
-                       (setq faces (cdr faces))))
-              faces)))))
-  ;;
-  ;; We use this for compatibility with a future Emacs.
-  (or (fboundp 'with-temp-message)
-      (defmacro with-temp-message (message &rest body)
-       (` (let ((current-message (current-message)))
-            (unwind-protect
-                (progn (message (, message)) (,@ body))
-              (message current-message))))))
-  ;;
-  ;; We use this for compatibility with a future Emacs.
-  (or (fboundp 'defcustom)
-      (defmacro defcustom (symbol value doc &rest args) 
-       (` (defvar (, symbol) (, value) (, doc))))))
+ ;;
+ ;; We don't do this at the top-level as we only use non-autoloaded macros.
+ (require 'cl)
+ ;;
+ ;; We use this to preserve or protect things when modifying text properties.
+ (defmacro save-buffer-state (varlist &rest body)
+   "Bind variables according to VARLIST and eval BODY restoring buffer state."
+   `(let* (,@(append varlist
+                     '((modified (buffer-modified-p)) (buffer-undo-list t)
+                       (inhibit-read-only t) (inhibit-point-motion-hooks t)
+                       before-change-functions after-change-functions
+                       deactivate-mark buffer-file-name buffer-file-truename)))
+     ,@body
+     (when (and (not modified) (buffer-modified-p))
+       (set-buffer-modified-p nil))))
+ (put 'save-buffer-state 'lisp-indent-function 1)
+ ;;
+ ;; We use this to verify that a face should be saved.
+ (defmacro fast-lock-save-facep (face)
+   "Return non-nil if FACE is one of `fast-lock-save-faces'."
+   `(or (null fast-lock-save-faces)
+     (if (symbolp ,face)
+         (memq ,face fast-lock-save-faces)
+         (let ((faces ,face))
+           (while (unless (memq (car faces) fast-lock-save-faces)
+                    (setq faces (cdr faces))))
+           faces))))
+ ;;
+ ;; We use this for compatibility with a future Emacs.
+ (or (fboundp 'with-temp-message)
+     (defmacro with-temp-message (message &rest body)
+       `(let ((temp-message ,message) current-message)
+         (unwind-protect
+              (progn
+                (when temp-message
+                  (setq current-message (current-message))
+                  (message temp-message))
+                ,@body)
+           (when temp-message
+             (message current-message))))))
+ ;;
+ ;; We use this for compatibility with a future Emacs.
+ (or (fboundp 'defcustom)
+     (defmacro defcustom (symbol value doc &rest args)
+       `(defvar ,symbol ,value ,doc))))
 
 ;(defun fast-lock-submit-bug-report ()
 ;  "Submit via mail a bug report on fast-lock.el."
 ;  (interactive)
 ;  (let ((reporter-prompt-for-summary-p t))
-;    (reporter-submit-bug-report "simon@gnu.ai.mit.edu" "fast-lock 3.14"
+;    (reporter-submit-bug-report "simon@gnu.org" "fast-lock 3.14"
 ;     '(fast-lock-cache-directories fast-lock-minimum-size
 ;       fast-lock-save-others fast-lock-save-events fast-lock-save-faces
 ;       fast-lock-verbose)
@@ -528,13 +534,13 @@ See `fast-lock-cache-directories'."
 ;; than one file would have the same cache name in that directory, if the luser
 ;; made a link from one relative cache directory to another.  (Phew!)
 (defun fast-lock-cache-name (directory)
-  "Return full cache path name using caching DIRECTORY.
-If DIRECTORY is `.', the path is the buffer file name appended with `.flc'.
-Otherwise, the path name is constructed from DIRECTORY and the buffer's true
+  "Return full cache file name using caching DIRECTORY.
+If DIRECTORY is `.', the file name is the buffer file name appended with `.flc'.
+Otherwise, the file name is constructed from DIRECTORY and the buffer's true
 abbreviated file name, with all `/' characters in the name replaced with `#'
 characters, and appended with `.flc'.
 
-If the same file has different cache path names when edited on different
+If the same file has different cache file names when edited on different
 machines, e.g., on one machine the cache file name has the prefix `#home',
 perhaps due to automount, try putting in your `~/.emacs' something like:
 
@@ -547,7 +553,7 @@ See `fast-lock-cache-directory'."
       (concat buffer-file-name ".flc")
     (let* ((bufile (expand-file-name buffer-file-truename))
           (chars-alist
-           (if (memq system-type '(emx windowsnt))
+           (if (memq system-type '(emx windows-nt cygwin))
                '((?/ . (?#)) (?# . (?# ?#)) (?: . (?\;)) (?\; . (?\; ?\;)))
              '((?/ . (?#)) (?# . (?# ?#)))))
           (mapchars
@@ -574,9 +580,8 @@ See `fast-lock-cache-directory'."
                   fast-lock-verbose))
        (saved t))
     (with-temp-message
-       (if verbose
-           (format "Saving %s font lock cache..." (buffer-name))
-         (current-message))
+       (when verbose
+         (format "Saving %s font lock cache..." (buffer-name)))
       (condition-case nil
          (save-excursion
            (print (list 'fast-lock-cache-data 3
@@ -631,9 +636,8 @@ See `fast-lock-cache-directory'."
            (not (equal keywords font-lock-keywords)))
        (setq loaded nil)
       (with-temp-message
-         (if verbose
-             (format "Loading %s font lock cache..." (buffer-name))
-           (current-message))
+         (when verbose
+           (format "Loading %s font lock cache..." (buffer-name)))
        (condition-case nil
            (fast-lock-add-properties syntactic-properties face-properties)
          (error (setq loaded 'error)) (quit (setq loaded 'quit))))
@@ -803,7 +807,7 @@ See `fast-lock-get-face-properties'."
            (font-lock-set-face (nth 0 regions) (nth 1 regions) face)
            (setq regions (nthcdr 2 regions)))
          (setq face-properties (cdr face-properties))))
-      ;; XEmacs does not support the `syntax-table' text property.      
+      ;; XEmacs does not support the `syntax-table' text property.
       ))
   ;;
   ;; XEmacs 19.12 font-lock.el's `font-lock-fontify-buffer' runs a hook.
@@ -855,4 +859,5 @@ See `fast-lock-get-face-properties'."
 
 (provide 'fast-lock)
 
+;;; arch-tag: 638c431e-8cae-4538-80a1-963ff97d233e
 ;;; fast-lock.el ends here