diff options
| author | Stefan Monnier | 2006-08-01 19:09:27 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2006-08-01 19:09:27 +0000 |
| commit | b0c76bd4a598b257e8db86e25b05be31baafda84 (patch) | |
| tree | 27de4dc19734d2b4162eea6364c9afb26c195196 | |
| parent | 2821e1b6f8af1bab644fedd85ba1405b24f15f42 (diff) | |
| download | emacs-b0c76bd4a598b257e8db86e25b05be31baafda84.tar.gz emacs-b0c76bd4a598b257e8db86e25b05be31baafda84.zip | |
(font-lock-extend-region-function, font-lock-extend-region):
Move to font-lock.el.
| -rw-r--r-- | lisp/font-core.el | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/lisp/font-core.el b/lisp/font-core.el index d2cb8dccd10..85bbf60f0d9 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el | |||
| @@ -83,34 +83,6 @@ where MAJOR-MODE is a symbol and FONT-LOCK-DEFAULTS is a list of default | |||
| 83 | settings. See the variable `font-lock-defaults', which takes precedence.") | 83 | settings. See the variable `font-lock-defaults', which takes precedence.") |
| 84 | (make-obsolete-variable 'font-lock-defaults-alist 'font-lock-defaults) | 84 | (make-obsolete-variable 'font-lock-defaults-alist 'font-lock-defaults) |
| 85 | 85 | ||
| 86 | (defvar font-lock-extend-region-function nil | ||
| 87 | "A function that determines the region to fontify after a change. | ||
| 88 | |||
| 89 | This buffer-local variable is either nil, or is a function that determines the | ||
| 90 | region to fontify. It is usually set by the major mode. The currently active | ||
| 91 | font-lock after-change function calls this function after each buffer change. | ||
| 92 | |||
| 93 | The function is given three parameters, the standard BEG, END, and OLD-LEN | ||
| 94 | from after-change-functions. It should return either a cons of the beginning | ||
| 95 | and end buffer positions \(in that order) of the region to fontify, or nil | ||
| 96 | \(which directs the caller to fontify a default region). This function need | ||
| 97 | not preserve point or the match-data, but must preserve the current | ||
| 98 | restriction. The region it returns may start or end in the middle of a | ||
| 99 | line.") | ||
| 100 | (make-variable-buffer-local 'font-lock-extend-region-function) | ||
| 101 | |||
| 102 | (defun font-lock-extend-region (beg end old-len) | ||
| 103 | "Determine the region to fontify after a buffer change. | ||
| 104 | |||
| 105 | BEG END and OLD-LEN are the standard parameters from after-change-functions. | ||
| 106 | The return value is either nil \(which directs the caller to chose the region | ||
| 107 | itself), or a cons of the beginning and end \(in that order) of the region. | ||
| 108 | The region returned may start or end in the middle of a line." | ||
| 109 | (if font-lock-extend-region-function | ||
| 110 | (save-match-data | ||
| 111 | (save-excursion | ||
| 112 | (funcall font-lock-extend-region-function beg end old-len))))) | ||
| 113 | |||
| 114 | (defvar font-lock-function 'font-lock-default-function | 86 | (defvar font-lock-function 'font-lock-default-function |
| 115 | "A function which is called when `font-lock-mode' is toggled. | 87 | "A function which is called when `font-lock-mode' is toggled. |
| 116 | It will be passed one argument, which is the current value of | 88 | It will be passed one argument, which is the current value of |