;ELC ;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:41:22 2003 ;;; from file /home/pot/gnu/emacs-pretest.new/lisp/fast-lock.el ;;; in Emacs version 21.3 ;;; with bytecomp version 2.85.4.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`fast-lock.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\305\306!\210\307=\203\310 \204\311\312!\210\302 B\313\302!\204\314\303 B\313\303!\204+\314\304 B\313\304!\2047\314\314\207" [system-type current-load-list fast-lock-mode fast-lock-cache-timestamp fast-lock-cache-filename require font-lock ms-dos msdos-long-file-names error "`fast-lock' was written for long file name systems" boundp nil] 2) #@527 *Minimum size of a buffer for cached fontification. Only buffers more than this can have associated Font Lock cache files saved. If nil, means cache files are never created. If a list, each element should be a cons pair of the form (MAJOR-MODE . SIZE), where MAJOR-MODE is a symbol or t (meaning the default). For example: ((c-mode . 25600) (c++-mode . 25600) (rmail-mode . 1048576)) means that the minimum size is 25K for buffers in C or C++ modes, one megabyte for buffers in Rmail mode, and size is irrelevant otherwise. (custom-declare-variable 'fast-lock-minimum-size '25600 '(#$ . -991) :type '(choice (const :tag "none" nil) (integer :tag "size") (repeat :menu-tag "mode specific" :tag "mode specific" :value ((t)) (cons :tag "Instance" (radio :tag "Mode" (const :tag "all" t) (symbol :tag "name")) (radio :tag "Size" (const :tag "none" nil) (integer :tag "size"))))) :group 'fast-lock) #@832 *Directories in which Font Lock cache files are saved and read. Each item should be either DIR or a cons pair of the form (REGEXP . DIR) where DIR is a directory name (relative or absolute) and REGEXP is a regexp. An attempt will be made to save or read Font Lock cache files using these items until one succeeds (i.e., until a readable or writable one is found). If an item contains REGEXP, DIR is used only if the buffer file name matches REGEXP. For example: (let ((home (expand-file-name (abbreviate-file-name (file-truename "~/"))))) (list (cons (concat "^" (regexp-quote home)) ".") "~/.emacs-flc")) => (("^/your/true/home/directory/" . ".") "~/.emacs-flc") would cause a file's current directory to be used if the file is under your home directory hierarchy, or otherwise the absolute directory `~/.emacs-flc'. (custom-declare-variable 'fast-lock-cache-directories ''("." "~/.emacs-flc") '(#$ . -1894) :type '(repeat (radio (directory :tag "directory") (cons :tag "Matching" (regexp :tag "regexp") (directory :tag "directory")))) :group 'fast-lock) #@242 *Events under which caches will be saved. Valid events are `save-buffer', `kill-buffer' and `kill-emacs'. If concurrent editing sessions use the same associated cache file for a file's buffer, then you should add `save-buffer' to this list. (custom-declare-variable 'fast-lock-save-events ''(kill-buffer kill-emacs) '(#$ . -2970) :type '(set (const :tag "buffer saving" save-buffer) (const :tag "buffer killing" kill-buffer) (const :tag "emacs killing" kill-emacs)) :group 'fast-lock) #@222 *If non-nil, save Font Lock cache files irrespective of file owner. If nil, means only buffer files known to be owned by you can have associated Font Lock cache files saved. Ownership may be unknown for networked files. (custom-declare-variable 'fast-lock-save-others 't '(#$ . -3462) :type 'boolean :group 'fast-lock) #@138 *If non-nil, means show status messages for cache processing. If a number, only buffers greater than this size have processing messages. (custom-declare-variable 'fast-lock-verbose 'font-lock-verbose '(#$ . -3789) :type '(choice (const :tag "never" nil) (other :tag "always" t) (integer :tag "size")) :group 'fast-lock) #@108 Faces that will be saved in a Font Lock cache file. If nil, means information for all faces will be saved. (defvar fast-lock-save-faces (byte-code "\302 \303\216\304\305\306 \"*\205 \207" [save-match-data-internal font-lock-face-list match-data ((set-match-data save-match-data-internal)) string-match "XEmacs" emacs-version] 3) (#$ . 4116)) #@1122 Toggle Fast Lock mode. With arg, turn Fast Lock mode on if and only if arg is positive and the buffer is associated with a file. Enable it automatically in your `~/.emacs' by: (setq font-lock-support-mode 'fast-lock-mode) If Fast Lock mode is enabled, and the current buffer does not contain any text properties, any associated Font Lock cache is used if its timestamp matches the buffer's file, and its `font-lock-keywords' match those that you are using. Font Lock caches may be saved: - When you save the file's buffer. - When you kill an unmodified file's buffer. - When you exit Emacs, for all unmodified or saved buffers. Depending on the value of `fast-lock-save-events'. See also the commands `fast-lock-read-cache' and `fast-lock-save-cache'. Use \[font-lock-fontify-buffer] to fontify the buffer if the cache is bad. Various methods of control are provided for the Font Lock cache. In general, see variable `fast-lock-cache-directories' and function `fast-lock-cache-name'. For saving, see variables `fast-lock-minimum-size', `fast-lock-save-events', `fast-lock-save-others' and `fast-lock-save-faces'. (defalias 'fast-lock-mode #[(&optional arg) "\306\303!\205\303 >?\205\n\203\307\n!\310V\202 ?L\210 \203-\f\204-\303\304\311!)\207\306\312!\313L\210\306\314!\313L\210 \205E?\205E\315 \207" [buffer-file-truename font-lock-inhibit-thing-lock arg fast-lock-mode font-lock-mode font-lock-support-mode make-local-variable prefix-numeric-value 0 t fast-lock-cache-timestamp nil fast-lock-cache-filename fast-lock-read-cache font-lock-fontified] 3 (#$ . 4469) "P"]) #@400 Read the Font Lock cache for the current buffer. The following criteria must be met for a Font Lock cache file to be read: - Fast Lock mode must be turned on in the buffer. - The buffer must not be modified. - The buffer's `font-lock-keywords' must match the cache's. - The buffer file's timestamp must match the cache's. - Criteria imposed by `fast-lock-cache-directories'. See `fast-lock-mode'. (defalias 'fast-lock-read-cache #[nil "\306 \307 \310\301!\311L\210 \203* \204*\312 @\311\"\311\313\314\217\210 A)\202\315\f!\210 ?\2059\311\n\211,\207" [fast-lock-cache-directories font-lock-fontified fontified inhibit-read-only modified directories buffer-modified-p t make-local-variable nil fast-lock-cache-directory (byte-code "\203\302!\303 !\203\304 \305\211\211$\210\302\207" [directory fast-lock-cache-filename fast-lock-cache-name file-readable-p load t] 5) ((error) (quit)) set-buffer-modified-p directory fast-lock-cache-filename] 4 (#$ . 6071) nil]) #@698 Save the Font Lock cache of BUFFER or the current buffer. The following criteria must be met for a Font Lock cache file to be saved: - Fast Lock mode must be turned on in the buffer. - The event must be one of `fast-lock-save-events'. - The buffer must be at least `fast-lock-minimum-size' bytes long. - The buffer file must be owned by you, or `fast-lock-save-others' must be t. - The buffer must contain at least one `face' text property. - The buffer must not be modified. - The buffer file's timestamp must be the same as the file's on disk. - The on disk file's timestamp must be different than the buffer's cache. - Criteria imposed by `fast-lock-cache-directories'. See `fast-lock-mode'. (defalias 'fast-lock-save-cache #[(&optional buffer) "\212\203q\210\306 !\307 \310 \205\212\311 ?\205\212\312p!\205\212 \232?\205\212\f\205\212\313 \fY\205\212\204E\314 \315\316!8=\205\212\317ed\320\310$\205\212\205\211\n\321>\205\211\322@\323\"\211\205m\324!\211\203\200\325!\203\200\326 \"A*\202R),\207" [buffer fast-lock-minimum-size saved file-timestamp min-size fast-lock-mode font-lock-value-in-major-mode visited-file-modtime nil buffer-modified-p verify-visited-file-modtime buffer-size user-uid 2 file-attributes text-property-not-all face (nil error) fast-lock-cache-directory t fast-lock-cache-name file-writable-p fast-lock-save-cache-1 fast-lock-cache-timestamp fast-lock-save-others buffer-file-name fast-lock-cache-directories directories dir file] 6 (#$ . 7063) nil]) #@41 Unconditionally turn on Fast Lock mode. (defalias 'turn-on-fast-lock #[nil "\300\301!\207" [fast-lock-mode t] 2 (#$ . 8601)]) (defalias 'fast-lock-after-fontify-buffer #[nil "\203\302!\203\303!\210\202\304\305\306 \"\210\307\211\207" [fast-lock-cache-filename fast-lock-cache-timestamp file-writable-p delete-file message "File %s font lock cache cannot be deleted" buffer-name nil] 3]) (defalias 'fast-lock-after-unfontify-buffer 'ignore) (defalias 'fast-lock-save-cache-after-save-file #[nil "\301>\205\302 \207" [fast-lock-save-events save-buffer fast-lock-save-cache] 2]) (defalias 'fast-lock-save-cache-before-kill-buffer #[nil "\301>\205\302 \207" [fast-lock-save-events kill-buffer fast-lock-save-cache] 2]) (defalias 'fast-lock-save-caches-before-kill-emacs #[nil "\301>\205 \302\303\304 \"\207" [fast-lock-save-events kill-emacs mapcar fast-lock-save-cache buffer-list] 3]) #@237 Return usable directory based on DIRECTORY. Returns nil if the directory does not exist, or, if CREATE non-nil, cannot be created. DIRECTORY may be a string or a cons pair of the form (REGEXP . DIR). See `fast-lock-cache-directories'. (defalias 'fast-lock-cache-directory #[(directory create) "\204\306\202( ;\203 \202(\307\n!\306\310 \311\216\312 @\f\"*\205' A*\211\2042\306\202G\313!\203>\202G\205G\306\314\315\217)\207" [buffer-file-name directory buffer-file-truename case-fold-search bufile save-match-data-internal nil expand-file-name match-data ((set-match-data save-match-data-internal)) string-match file-accessible-directory-p (byte-code "\301\302\"\210\207" [dir make-directory t] 3) ((error)) dir create] 4 (#$ . 9509)]) #@739 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 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 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: (setq directory-abbrev-alist (cons '("^/home/" . "/") directory-abbrev-alist)) Emacs automagically removes the common `/tmp_mnt' automount prefix by default. See `fast-lock-cache-directory'. (defalias 'fast-lock-cache-name #[(directory) "\306\230\203\n \307P\207\310\n!\f\311>\203\312\202\313\314\315\310!!\316\317\320\321\322 \"\"\323#\307Q+\207" [directory buffer-file-name buffer-file-truename bufile system-type chars-alist "." ".flc" expand-file-name (emx windows-nt) ((47 35) (35 35 35) (58 59) (59 59 59)) ((47 35) (35 35 35)) #[(c) " \236A\206 C\207" [c chars-alist] 2] file-name-as-directory mapconcat char-to-string apply append mapcar "" mapchars] 8 (#$ . 10277)]) (defalias 'fast-lock-save-cache-1 #[(file timestamp) "\306\307!\247\203\310 V\202\311\n\205\312\313\314 \"\315\316\216 \203.\317 \320\321 \"\210\315\322\323\217\210\324 !\210+ \325=\203G\320\326\314 \"\210\202S \327=\203S\320\330\314 \"\210 +\207" [fast-lock-verbose saved verbose tpbuf #1=#:current-message #2=#:with-temp-message generate-new-buffer " *fast-lock*" buffer-size t format "Saving %s font lock cache..." buffer-name nil ((byte-code "\203 \203 \302\303 \"\210\302\207" [#2# #1# message "%s"] 3)) current-message message "%s" (byte-code "\212\306\307\310\311D\311 D\311\312 D\311\nD\311\313 D\257 \"\210 q\210\314ed\f\315\316%\210\f)\315\207" [timestamp font-lock-syntactic-keywords font-lock-keywords tpbuf file fast-lock-cache-timestamp print fast-lock-cache-data 3 quote fast-lock-get-syntactic-properties fast-lock-get-face-properties write-region nil quietly fast-lock-cache-filename] 9) ((error (byte-code "\301\301\207" [saved error] 1)) (quit (byte-code "\301\301\207" [saved quit] 1))) kill-buffer quit "Saving %s font lock cache...quit" error "Saving %s font lock cache...failed"] 3]) (defalias 'fast-lock-cache-data #[(version timestamp syntactic-keywords syntactic-properties keywords face-properties &rest ignored) "\306!\211\203\f\307! \203\307 !\307\n!\307 !\310 \f\247\203*\311 \fV\202+\f\312\313U\203Q\314 \204Q\232\203Q \232\203Q \n\232\204V\315\202\227\205`\316\317\320 \"\315 \321\216 \203v\322 \323\324 \"\210\315\325\326\217\210+ \327=\203\213\323\330\320 \"\210\202\227 \331=\203\227\323\332\320 \"\210 \312=! \312=\205\244\211\"+\207" [font-lock-syntactic-keywords syntactic-keywords font-lock-keywords keywords fast-lock-verbose loaded font-lock-eval-keywords font-lock-compile-keywords visited-file-modtime buffer-size t 3 buffer-modified-p nil format "Loading %s font lock cache..." buffer-name ((byte-code "\203 \203 \302\303 \"\210\302\207" [#1=#:with-temp-message #2=#:current-message message "%s"] 3)) current-message message "%s" (fast-lock-add-properties syntactic-properties face-properties) ((error (byte-code "\301\301\207" [loaded error] 1)) (quit (byte-code "\301\301\207" [loaded quit] 1))) quit "Loading %s font lock cache...quit" error "Loading %s font lock cache...failed" verbose buf-timestamp version timestamp #2# #1# font-lock-fontified fast-lock-cache-timestamp] 4]) #@214 Return a list of `face' text properties in the current buffer. Each element of the list is of the form (VALUE START1 END1 START2 END2 ...) where VALUE is a `face' property value and STARTx and ENDx are positions. (defalias 'fast-lock-get-face-properties #[nil "\214~\210\306ed\307\310$\310\211\211\211\211\203r\311\f\307\310d$\312\f\307\"\313 \n\"\211\2037\f ABB\241\210\202g \203` 9\203F >\202] \f\f@ >\204Z\fA\211\f\204I\f)\203g \f E\nB\306 d\307\310$\211\204\n.\207" [cell value properties end start fast-lock-save-faces text-property-not-all face nil next-single-property-change get-text-property assoc faces] 6 (#$ . 13936)]) #@109 Return a list of `syntax-table' text properties in the current buffer. See `fast-lock-get-face-properties'. (defalias 'fast-lock-get-syntactic-properties #[nil "\214~\210\305ed\306\307$\307\211\211\211\211\203I\310\f\306\307d$\311\f\306\"\312 \n\"\211\2037\f ABB\241\210\202> \f E\nB\305 d\306\307$\211\204\n.\207" [cell value properties end start text-property-not-all syntax-table nil next-single-property-change get-text-property assoc] 6 (#$ . 14604)]) #@181 Add `syntax-table' and `face' text properties to the current buffer. Any existing `syntax-table' and `face' text properties are removed first. See `fast-lock-get-face-properties'. (defalias 'fast-lock-add-properties #[(syntactic-properties face-properties) "\306\306\307 \310\310\310\306\306\306\306\306\214~\210\311ed\"\210\203O\312@@D@AA \203$\313 @ A@#\210 AA\211\202;\203z\314@@D@AA \203O\313 @ A@#\210 AA\211\202f)\n?\205\210\307 \205\210\315\306!. \207" [plist regions modified buffer-undo-list inhibit-read-only inhibit-point-motion-hooks nil buffer-modified-p t font-lock-unfontify-region syntax-table add-text-properties face set-buffer-modified-p before-change-functions after-change-functions deactivate-mark buffer-file-name buffer-file-truename syntactic-properties face-properties] 5 (#$ . 15086)]) (byte-code "\306 \307\216\310\311\312 \"*\203 \313\314M\210\315\316\317\"\210\320\321M\210\322\323\324\"\210\325\302!\2042\302 B\325\302!\2042\326\325\303!\204D\303 B\325\303!\204D\326\327\330!\204O\315\330\331\"\210\327\332!\204Y\332\333M\210\327\334!\204c\334\335M\210\327\336!\204m\336\337M\210\322\340\341\"\210\322\342\343\"\210\322\344\345\"\210\327\346!\203\223\304 B\325\304!\204\216\326\346\304\326\"\210\304 \236\204\236\347 \350\"\351\352!\207" [save-match-data-internal current-load-list font-lock-syntactic-keywords font-lock-inhibit-thing-lock fast-lock-mode minor-mode-alist match-data ((set-match-data save-match-data-internal)) string-match "XEmacs" emacs-version fast-lock-get-face-properties #[nil "\214~\210\302\211\303\304!\210 +\207" [cell properties nil map-extents #[(extent ignore) "\306!\211\203W\n\203, 9\203 \n>\202)  @\n>\204' A\211\204 )\203W\307!\310!\311  \"\211\f\203M\f \f\fABB\241\210\202V \fE B *)\312\207" [extent value fast-lock-save-faces faces end start extent-face extent-start-position extent-end-position assoc nil properties cell] 5]] 2 "Return a list of `face' text properties in the current buffer.\nEach element of the list is of the form (VALUE START1 END1 START2 END2 ...)\nwhere VALUE is a `face' property value and STARTx and ENDx are positions.\nOnly those `face' VALUEs in `fast-lock-save-faces' are returned."] defalias fast-lock-get-syntactic-properties ignore fast-lock-add-properties #[(syntactic-properties face-properties) "\214~\210\303ed\"\210\2050@@@A \203)\304 @ A@\n#\210 AA\211\204A*\202)\207" [face-properties regions face font-lock-unfontify-region font-lock-set-face] 5 "Set `face' text properties in the current buffer.\nAny existing `face' text properties are removed first.\nSee `fast-lock-get-face-properties'."] add-hook font-lock-after-fontify-buffer-hook fast-lock-after-fontify-buffer boundp nil fboundp font-lock-compile-keywords identity font-lock-eval-keywords #[(keywords) "9\203\301\302!\203 \202\303!!\207\207" [keywords font-lock-eval-keywords fboundp eval] 3] font-lock-value-in-major-mode #[(alist) ":\203 \236\206\302\236A\207\207" [alist major-mode t] 2] current-message #[nil "\300\207" [""] 1 ""] after-save-hook fast-lock-save-cache-after-save-file kill-buffer-hook fast-lock-save-cache-before-kill-buffer kill-emacs-hook fast-lock-save-caches-before-kill-emacs add-minor-mode append ((fast-lock-mode nil)) provide fast-lock] 3)