aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2006-08-01 19:09:27 +0000
committerStefan Monnier2006-08-01 19:09:27 +0000
commitb0c76bd4a598b257e8db86e25b05be31baafda84 (patch)
tree27de4dc19734d2b4162eea6364c9afb26c195196
parent2821e1b6f8af1bab644fedd85ba1405b24f15f42 (diff)
downloademacs-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.el28
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
83settings. See the variable `font-lock-defaults', which takes precedence.") 83settings. 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
89This buffer-local variable is either nil, or is a function that determines the
90region to fontify. It is usually set by the major mode. The currently active
91font-lock after-change function calls this function after each buffer change.
92
93The function is given three parameters, the standard BEG, END, and OLD-LEN
94from after-change-functions. It should return either a cons of the beginning
95and 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
97not preserve point or the match-data, but must preserve the current
98restriction. The region it returns may start or end in the middle of a
99line.")
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
105BEG END and OLD-LEN are the standard parameters from after-change-functions.
106The return value is either nil \(which directs the caller to chose the region
107itself), or a cons of the beginning and end \(in that order) of the region.
108The 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.
116It will be passed one argument, which is the current value of 88It will be passed one argument, which is the current value of