223 |
|
|
224 |
|
|
225 |
(eval-when-compile |
(eval-when-compile |
226 |
;; We use this to preserve or protect things when modifying text |
;; We use this to preserve or protect things when modifying text |
227 |
;; properties. Stolen from lazy-lock and font-lock. Ugly!!! |
;; properties. Stolen from lazy-lock and font-lock. Ugly!!! |
228 |
;; Probably most of this is not needed? |
;; Probably most of this is not needed? |
229 |
(defmacro save-buffer-state (varlist &rest body) |
(defmacro save-buffer-state (varlist &rest body) |
230 |
"Bind variables according to VARLIST and eval BODY restoring buffer state." |
"Bind variables according to VARLIST and eval BODY restoring buffer state." |
231 |
(` (let* ((,@ (append varlist |
`(let* (,@(append varlist |
232 |
'((modified (buffer-modified-p)) (buffer-undo-list t) |
'((modified (buffer-modified-p)) (buffer-undo-list t) |
233 |
(inhibit-read-only t) (inhibit-point-motion-hooks t) |
(inhibit-read-only t) (inhibit-point-motion-hooks t) |
234 |
before-change-functions after-change-functions |
before-change-functions after-change-functions |
235 |
deactivate-mark buffer-file-name buffer-file-truename)))) |
deactivate-mark buffer-file-name buffer-file-truename))) |
236 |
(,@ body) |
,@body |
237 |
(when (and (not modified) (buffer-modified-p)) |
(when (and (not modified) (buffer-modified-p)) |
238 |
(set-buffer-modified-p nil))))) |
(set-buffer-modified-p nil)))) |
239 |
(put 'save-buffer-state 'lisp-indent-function 1)) |
(put 'save-buffer-state 'lisp-indent-function 1)) |
240 |
|
|
241 |
(defun ansi-color-unfontify-region (beg end &rest xemacs-stuff) |
(defun ansi-color-unfontify-region (beg end &rest xemacs-stuff) |
242 |
"Replacement function for `font-lock-default-unfontify-region'. |
"Replacement function for `font-lock-default-unfontify-region'. |