diff options
| author | Dave Love | 2000-11-12 00:47:18 +0000 |
|---|---|---|
| committer | Dave Love | 2000-11-12 00:47:18 +0000 |
| commit | 8242a6dcded9613233d707363ba8d3a80df263ee (patch) | |
| tree | 804f885ced8d19b447f403c87aa947d83afc8695 /lisp | |
| parent | f06f741699f6e4a7937e8ccfb174d59a5323a913 (diff) | |
| download | emacs-8242a6dcded9613233d707363ba8d3a80df263ee.tar.gz emacs-8242a6dcded9613233d707363ba8d3a80df263ee.zip | |
Remove compatibility code.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/lazy-lock.el | 150 |
1 files changed, 1 insertions, 149 deletions
diff --git a/lisp/lazy-lock.el b/lisp/lazy-lock.el index 081f087ba89..b8a11dc349a 100644 --- a/lisp/lazy-lock.el +++ b/lisp/lazy-lock.el | |||
| @@ -269,16 +269,7 @@ | |||
| 269 | 269 | ||
| 270 | (require 'font-lock) | 270 | (require 'font-lock) |
| 271 | 271 | ||
| 272 | ;; Make sure lazy-lock.el is supported. | ||
| 273 | (if (if (save-match-data (string-match "Lucid\\|XEmacs" (emacs-version))) | ||
| 274 | t | ||
| 275 | (and (= emacs-major-version 19) (< emacs-minor-version 30))) | ||
| 276 | (error "`lazy-lock' was written for Emacs 19.30 or later")) | ||
| 277 | |||
| 278 | (eval-when-compile | 272 | (eval-when-compile |
| 279 | ;; | ||
| 280 | ;; We don't do this at the top-level as idle timers are not necessarily used. | ||
| 281 | (require 'timer) | ||
| 282 | ;; We don't do this at the top-level as we only use non-autoloaded macros. | 273 | ;; We don't do this at the top-level as we only use non-autoloaded macros. |
| 283 | (require 'cl) | 274 | (require 'cl) |
| 284 | ;; | 275 | ;; |
| @@ -301,52 +292,7 @@ | |||
| 301 | The order of execution is thus BODY, TEST, BODY, TEST and so on | 292 | The order of execution is thus BODY, TEST, BODY, TEST and so on |
| 302 | until TEST returns nil." | 293 | until TEST returns nil." |
| 303 | (` (while (progn (,@ body) (, test))))) | 294 | (` (while (progn (,@ body) (, test))))) |
| 304 | (put 'do-while 'lisp-indent-function (get 'while 'lisp-indent-function)) | 295 | (put 'do-while 'lisp-indent-function (get 'while 'lisp-indent-function))) |
| 305 | ;; | ||
| 306 | ;; We use this for clarity and speed. Borrowed from a future Emacs. | ||
| 307 | (or (fboundp 'with-current-buffer) | ||
| 308 | (defmacro with-current-buffer (buffer &rest body) | ||
| 309 | "Execute the forms in BODY with BUFFER as the current buffer. | ||
| 310 | The value returned is the value of the last form in BODY." | ||
| 311 | (` (save-excursion (set-buffer (, buffer)) (,@ body))))) | ||
| 312 | (put 'with-current-buffer 'lisp-indent-function 1) | ||
| 313 | ;; | ||
| 314 | ;; We use this for compatibility with a future Emacs. | ||
| 315 | (or (fboundp 'with-temp-message) | ||
| 316 | (defmacro with-temp-message (message &rest body) | ||
| 317 | (` (let ((temp-message (, message)) current-message) | ||
| 318 | (unwind-protect | ||
| 319 | (progn | ||
| 320 | (when temp-message | ||
| 321 | (setq current-message (current-message)) | ||
| 322 | (message temp-message)) | ||
| 323 | (,@ body)) | ||
| 324 | (when temp-message | ||
| 325 | (message current-message))))))) | ||
| 326 | ;; | ||
| 327 | ;; We use this for compatibility with a future Emacs. | ||
| 328 | (or (fboundp 'defcustom) | ||
| 329 | (defmacro defcustom (symbol value doc &rest args) | ||
| 330 | (` (defvar (, symbol) (, value) (, doc)))))) | ||
| 331 | |||
| 332 | ;(defun lazy-lock-submit-bug-report () | ||
| 333 | ; "Submit via mail a bug report on lazy-lock.el." | ||
| 334 | ; (interactive) | ||
| 335 | ; (let ((reporter-prompt-for-summary-p t)) | ||
| 336 | ; (reporter-submit-bug-report "simon@gnu.org" "lazy-lock 2.11" | ||
| 337 | ; '(lazy-lock-minimum-size lazy-lock-defer-on-the-fly | ||
| 338 | ; lazy-lock-defer-on-scrolling lazy-lock-defer-contextually | ||
| 339 | ; lazy-lock-defer-time lazy-lock-stealth-time | ||
| 340 | ; lazy-lock-stealth-load lazy-lock-stealth-nice lazy-lock-stealth-lines | ||
| 341 | ; lazy-lock-stealth-verbose) | ||
| 342 | ; nil nil | ||
| 343 | ; (concat "Hi Si., | ||
| 344 | ; | ||
| 345 | ;I want to report a bug. I've read the `Bugs' section of `Info' on Emacs, so I | ||
| 346 | ;know how to make a clear and unambiguous report. To reproduce the bug: | ||
| 347 | ; | ||
| 348 | ;Start a fresh editor via `" invocation-name " -no-init-file -no-site-file'. | ||
| 349 | ;In the `*scratch*' buffer, evaluate:")))) | ||
| 350 | 296 | ||
| 351 | (defvar lazy-lock-mode nil) ; Whether we are turned on. | 297 | (defvar lazy-lock-mode nil) ; Whether we are turned on. |
| 352 | (defvar lazy-lock-buffers nil) ; For deferral. | 298 | (defvar lazy-lock-buffers nil) ; For deferral. |
| @@ -1031,65 +977,6 @@ verbosity is controlled via the variable `lazy-lock-stealth-verbose'." | |||
| 1031 | 977 | ||
| 1032 | ;; Version dependent workarounds and fixes. | 978 | ;; Version dependent workarounds and fixes. |
| 1033 | 979 | ||
| 1034 | (when (if (save-match-data (string-match "Lucid\\|XEmacs" (emacs-version))) | ||
| 1035 | nil | ||
| 1036 | (and (= emacs-major-version 19) (= emacs-minor-version 30))) | ||
| 1037 | ;; | ||
| 1038 | ;; We use `post-command-idle-hook' for deferral and stealth. Oh Lordy. | ||
| 1039 | (defun lazy-lock-install-timers (foo bar) | ||
| 1040 | (add-hook 'post-command-idle-hook 'lazy-lock-fontify-post-command t) | ||
| 1041 | (add-hook 'post-command-idle-hook 'lazy-lock-fontify-post-idle t) | ||
| 1042 | (add-to-list 'lazy-lock-install (current-buffer)) | ||
| 1043 | (add-hook 'post-command-hook 'lazy-lock-fontify-after-install)) | ||
| 1044 | (defun lazy-lock-fontify-post-command () | ||
| 1045 | (and lazy-lock-buffers (not executing-kbd-macro) | ||
| 1046 | (progn | ||
| 1047 | (and deactivate-mark (deactivate-mark)) | ||
| 1048 | (sit-for | ||
| 1049 | (or (cdr-safe lazy-lock-defer-time) lazy-lock-defer-time 0))) | ||
| 1050 | (lazy-lock-fontify-after-defer))) | ||
| 1051 | (defun lazy-lock-fontify-post-idle () | ||
| 1052 | (and lazy-lock-stealth-time (not executing-kbd-macro) | ||
| 1053 | (not (window-minibuffer-p (selected-window))) | ||
| 1054 | (progn | ||
| 1055 | (and deactivate-mark (deactivate-mark)) | ||
| 1056 | (sit-for lazy-lock-stealth-time)) | ||
| 1057 | (lazy-lock-fontify-after-idle))) | ||
| 1058 | ;; | ||
| 1059 | ;; Simulate running of `window-scroll-functions' in `set-window-buffer'. | ||
| 1060 | (defvar lazy-lock-install nil) | ||
| 1061 | (defun lazy-lock-fontify-after-install () | ||
| 1062 | (remove-hook 'post-command-hook 'lazy-lock-fontify-after-install) | ||
| 1063 | (while lazy-lock-install | ||
| 1064 | (mapcar 'lazy-lock-fontify-conservatively | ||
| 1065 | (get-buffer-window-list (pop lazy-lock-install) 'nomini t))))) | ||
| 1066 | |||
| 1067 | (when (if (save-match-data (string-match "Lucid\\|XEmacs" (emacs-version))) | ||
| 1068 | nil | ||
| 1069 | (or (and (= emacs-major-version 20) (< emacs-minor-version 4)) | ||
| 1070 | (= emacs-major-version 19))) | ||
| 1071 | ;; | ||
| 1072 | ;; We use `vertical-motion' rather than `window-end' UPDATE arg. | ||
| 1073 | (defun lazy-lock-fontify-after-scroll (window window-start) | ||
| 1074 | ;; Called from `window-scroll-functions'. | ||
| 1075 | ;; Fontify WINDOW from WINDOW-START following the scroll. We cannot use | ||
| 1076 | ;; `window-end' so we work out what it would be via `vertical-motion'. | ||
| 1077 | (let ((inhibit-point-motion-hooks t)) | ||
| 1078 | (save-excursion | ||
| 1079 | (goto-char window-start) | ||
| 1080 | (vertical-motion (window-height window) window) | ||
| 1081 | (lazy-lock-fontify-region window-start (point)))) | ||
| 1082 | (set-window-redisplay-end-trigger window nil)) | ||
| 1083 | (defun lazy-lock-fontify-after-trigger (window trigger-point) | ||
| 1084 | ;; Called from `redisplay-end-trigger-functions'. | ||
| 1085 | ;; Fontify WINDOW from TRIGGER-POINT following the redisplay. We cannot | ||
| 1086 | ;; use `window-end' so we work out what it would be via `vertical-motion'. | ||
| 1087 | (let ((inhibit-point-motion-hooks t)) | ||
| 1088 | (save-excursion | ||
| 1089 | (goto-char (window-start window)) | ||
| 1090 | (vertical-motion (window-height window) window) | ||
| 1091 | (lazy-lock-fontify-region trigger-point (point)))))) | ||
| 1092 | |||
| 1093 | (when (consp lazy-lock-defer-time) | 980 | (when (consp lazy-lock-defer-time) |
| 1094 | ;; | 981 | ;; |
| 1095 | ;; In 2.06.04 and below, `lazy-lock-defer-time' could specify modes and time. | 982 | ;; In 2.06.04 and below, `lazy-lock-defer-time' could specify modes and time. |
| @@ -1142,41 +1029,6 @@ verbosity is controlled via the variable `lazy-lock-stealth-verbose'." | |||
| 1142 | (princ " or change your ~/.emacs now.")) | 1029 | (princ " or change your ~/.emacs now.")) |
| 1143 | (setq lazy-lock-defer-on-scrolling lazy-lock-defer-driven)) | 1030 | (setq lazy-lock-defer-on-scrolling lazy-lock-defer-driven)) |
| 1144 | 1031 | ||
| 1145 | ;; Possibly absent. | ||
| 1146 | |||
| 1147 | (unless (boundp 'font-lock-inhibit-thing-lock) | ||
| 1148 | ;; Font Lock mode uses this to direct Lazy and Fast Lock modes to stay off. | ||
| 1149 | (defvar font-lock-inhibit-thing-lock nil | ||
| 1150 | "List of Font Lock mode related modes that should not be turned on.")) | ||
| 1151 | |||
| 1152 | (unless (fboundp 'font-lock-value-in-major-mode) | ||
| 1153 | (defun font-lock-value-in-major-mode (alist) | ||
| 1154 | ;; Return value in ALIST for `major-mode'. | ||
| 1155 | (if (consp alist) | ||
| 1156 | (cdr (or (assq major-mode alist) (assq t alist))) | ||
| 1157 | alist))) | ||
| 1158 | |||
| 1159 | (unless (fboundp 'buffer-live-p) | ||
| 1160 | ;; We use this to check that a buffer we have to fontify still exists. | ||
| 1161 | (defun buffer-live-p (object) | ||
| 1162 | "Return non-nil if OBJECT is an editor buffer that has not been deleted." | ||
| 1163 | (and (bufferp object) (buffer-name object)))) | ||
| 1164 | |||
| 1165 | (unless (fboundp 'get-buffer-window-list) | ||
| 1166 | ;; We use this to get all windows showing a buffer we have to fontify. | ||
| 1167 | (defun get-buffer-window-list (buffer &optional minibuf frame) | ||
| 1168 | "Return windows currently displaying BUFFER, or nil if none." | ||
| 1169 | (let ((buffer (if (bufferp buffer) buffer (get-buffer buffer))) windows) | ||
| 1170 | (walk-windows (function (lambda (window) | ||
| 1171 | (when (eq (window-buffer window) buffer) | ||
| 1172 | (push window windows)))) | ||
| 1173 | minibuf frame) | ||
| 1174 | windows))) | ||
| 1175 | |||
| 1176 | (unless (fboundp 'current-message) | ||
| 1177 | (defun current-message () | ||
| 1178 | "")) | ||
| 1179 | |||
| 1180 | ;; Install ourselves: | 1032 | ;; Install ourselves: |
| 1181 | 1033 | ||
| 1182 | (add-hook 'window-size-change-functions 'lazy-lock-fontify-after-resize) | 1034 | (add-hook 'window-size-change-functions 'lazy-lock-fontify-after-resize) |