diff options
| author | Richard M. Stallman | 1995-01-30 07:16:14 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-01-30 07:16:14 +0000 |
| commit | 51566783f012d3cfb23c35d9cd71974e05c97659 (patch) | |
| tree | 4641c56bdfb926b6844ac66ce6eeb833c51e2c58 | |
| parent | 577ed2b24db60ae5f277463aeb93490b66c6e0e0 (diff) | |
| download | emacs-51566783f012d3cfb23c35d9cd71974e05c97659.tar.gz emacs-51566783f012d3cfb23c35d9cd71974e05c97659.zip | |
(make-extent, delete-extent, set-extent-property)
(set-extent-face): New functions.
| -rw-r--r-- | lisp/emacs-lisp/lucid.el | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/lucid.el b/lisp/emacs-lisp/lucid.el index d32ec9de75e..c0e8a6551fc 100644 --- a/lisp/emacs-lisp/lucid.el +++ b/lisp/emacs-lisp/lucid.el | |||
| @@ -152,6 +152,38 @@ bottom of the buffer stack." | |||
| 152 | (defalias 'get-face 'internal-get-face) | 152 | (defalias 'get-face 'internal-get-face) |
| 153 | (defalias 'try-face-font 'internal-try-face-font) | 153 | (defalias 'try-face-font 'internal-try-face-font) |
| 154 | 154 | ||
| 155 | (defun make-extent (beg end &optional buffer) | ||
| 156 | (make-overlay beg end buffer)) | ||
| 157 | |||
| 158 | (defun set-extent-property (extent prop value) | ||
| 159 | (if (eq prop 'duplicable) | ||
| 160 | (cond ((and value (not (overlay-get extent prop))) | ||
| 161 | ;; If becoming duplicable, copy all overlayprops to text props. | ||
| 162 | (add-text-properties (overlay-start extent) | ||
| 163 | (overlay-end extent) | ||
| 164 | (overlay-properties extent) | ||
| 165 | (overlay-buffer extent))) | ||
| 166 | ;; If becoming no longer duplicable, remove these text props. | ||
| 167 | ((and (not value) (overlay-get extent prop)) | ||
| 168 | (remove-text-properties (overlay-start extent) | ||
| 169 | (overlay-end extent) | ||
| 170 | (overlay-properties extent) | ||
| 171 | (overlay-buffer extent)))) | ||
| 172 | ;; If extent is already duplicable, put this property | ||
| 173 | ;; on the text as well as on the overlay. | ||
| 174 | (if (overlay-get extent 'duplicable) | ||
| 175 | (put-text-property (overlay-start extent) | ||
| 176 | (overlay-end extent) | ||
| 177 | prop value (overlay-buffer extent)))) | ||
| 178 | (overlay-put extent prop value)) | ||
| 179 | |||
| 180 | (defun set-extent-face (extent face) | ||
| 181 | (set-extent-property extent 'face face)) | ||
| 182 | |||
| 183 | (defun delete-extent (extent) | ||
| 184 | (set-extent-property extent 'duplicable nil) | ||
| 185 | (delete-overlay extent)) | ||
| 186 | |||
| 155 | ;; Support the Lucid names with `screen' instead of `frame'. | 187 | ;; Support the Lucid names with `screen' instead of `frame'. |
| 156 | 188 | ||
| 157 | (defalias 'current-screen-configuration 'current-frame-configuration) | 189 | (defalias 'current-screen-configuration 'current-frame-configuration) |