| 1 |
;;; esml-du-mlton.el --- esml-du-mlton.el -*- lexical-binding: t; -*- |
| 2 |
;; Copyright (C) 2007-2008 Vesa Karvonen |
| 3 |
;; |
| 4 |
;; MLton is released under a HPND-style license. |
| 5 |
;; See the file MLton-LICENSE for details. |
| 6 |
|
| 7 |
(require 'def-use-mode) |
| 8 |
(require 'bg-job) |
| 9 |
(require 'esml-util) |
| 10 |
|
| 11 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 12 |
;; Customization |
| 13 |
|
| 14 |
(defgroup esml-du nil |
| 15 |
"MLton def-use info plugin for `def-use-mode'." |
| 16 |
:group 'sml) |
| 17 |
|
| 18 |
(defcustom esml-du-notify 'never |
| 19 |
"Notify certain events, such as when a def-use -file has been |
| 20 |
(re)loaded." |
| 21 |
:type '(choice (const :tag "Never" never) |
| 22 |
(const :tag "Always" always)) |
| 23 |
:group 'esml-du) |
| 24 |
|
| 25 |
(defcustom esml-du-dufs-auto-load nil |
| 26 |
"Automatic loading of `esml-du-dufs-recent' at startup." |
| 27 |
:type '(choice |
| 28 |
(const :tag "Disabled" nil) |
| 29 |
(const :tag "Enabled" t)) |
| 30 |
:group 'esml-du) |
| 31 |
|
| 32 |
(defcustom esml-du-dufs-recent '() |
| 33 |
"Automatically updated list of def-use -files currently or previously |
| 34 |
loaded. This customization variable is not usually manipulated directly |
| 35 |
by the user." |
| 36 |
:type '(repeat |
| 37 |
(file :tag "Def-Use file" :must-match t)) |
| 38 |
:group 'esml-du) |
| 39 |
|
| 40 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 41 |
;; Interface |
| 42 |
|
| 43 |
(defvar esml-du-mlton-history nil) |
| 44 |
|
| 45 |
(defvar esml-du-live-dufs nil) |
| 46 |
|
| 47 |
(defun esml-du-mlton (&optional duf dont-save) |
| 48 |
"Gets def-use information from a def-use file produced by MLton." |
| 49 |
(interactive) |
| 50 |
(cond |
| 51 |
((not duf) |
| 52 |
(esml-du-mlton |
| 53 |
(read-file-name |
| 54 |
"Specify def-use -file: " nil nil t nil) |
| 55 |
dont-save)) |
| 56 |
((not (and (file-readable-p duf) |
| 57 |
(file-regular-p duf))) |
| 58 |
(error "Specified file is not a regular readable file")) |
| 59 |
((run-with-idle-timer |
| 60 |
0.5 nil |
| 61 |
(function |
| 62 |
(lambda (duf dont-save) |
| 63 |
(let ((duf (def-use-file-truename duf))) |
| 64 |
(unless (member duf esml-du-live-dufs) |
| 65 |
(let ((ctx (esml-du-ctx duf))) |
| 66 |
(esml-du-load ctx) |
| 67 |
(esml-du-set-live-dufs (cons duf esml-du-live-dufs) dont-save) |
| 68 |
(def-use-add-dus |
| 69 |
(function esml-du-title) |
| 70 |
(function esml-du-sym-at-ref) |
| 71 |
(function esml-du-sym-to-uses) |
| 72 |
(function esml-du-finalize) |
| 73 |
(function esml-du-ctx-attr) |
| 74 |
ctx)))))) |
| 75 |
duf dont-save)))) |
| 76 |
|
| 77 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 78 |
;; Move to symbol |
| 79 |
|
| 80 |
(defun esml-du-character-class (c) |
| 81 |
(cond |
| 82 |
((cl-find c esml-sml-symbolic-chars) |
| 83 |
'symbolic) |
| 84 |
((and c (<= ?0 c) (<= c ?9)) |
| 85 |
'numeric) |
| 86 |
((cl-find c esml-sml-alphanumeric-chars) |
| 87 |
'alpha))) |
| 88 |
|
| 89 |
(defun esml-du-extract-following-symbol (chars) |
| 90 |
(save-excursion |
| 91 |
(let ((start (point))) |
| 92 |
(skip-chars-forward chars) |
| 93 |
(buffer-substring start (point))))) |
| 94 |
|
| 95 |
(defun esml-du-move-to-symbol-start () |
| 96 |
"Moves to the start of the SML symbol at point. If the point is between |
| 97 |
two symbols, one symbolic and other alphanumeric (e.g. !x) the symbol |
| 98 |
following the point is preferred. This ensures that the symbol does not |
| 99 |
change surprisingly after a jump." |
| 100 |
(let ((point (point))) |
| 101 |
(let ((bef (esml-du-character-class (char-before))) |
| 102 |
(aft (esml-du-character-class (char-after)))) |
| 103 |
(cond |
| 104 |
((and (or (eq bef 'alpha) (eq bef 'numeric)) (eq aft 'symbolic) |
| 105 |
(cl-find (esml-du-extract-following-symbol esml-sml-symbolic-chars) |
| 106 |
esml-sml-symbolic-keywords |
| 107 |
:test 'equal)) |
| 108 |
(skip-chars-backward esml-sml-alphanumeric-chars)) |
| 109 |
((and (eq bef 'symbolic) |
| 110 |
(or (eq aft 'numeric) |
| 111 |
(and (eq aft 'alpha) |
| 112 |
(cl-find (esml-du-extract-following-symbol |
| 113 |
esml-sml-alphanumeric-chars) |
| 114 |
esml-sml-alphanumeric-keywords |
| 115 |
:test 'equal)))) |
| 116 |
(skip-chars-backward esml-sml-symbolic-chars)) |
| 117 |
((and (eq bef 'symbolic) (not (eq aft 'alpha))) |
| 118 |
(skip-chars-backward esml-sml-symbolic-chars)) |
| 119 |
((and (or (eq bef 'alpha) (eq bef 'numeric)) (not (eq aft 'symbolic))) |
| 120 |
(skip-chars-backward esml-sml-alphanumeric-chars)))) |
| 121 |
(when (let ((c (char-after))) (and c (<= ?0 c) (<= c ?9))) |
| 122 |
(search-forward-regexp esml-sml-numeric-literal-regexp point t)))) |
| 123 |
|
| 124 |
(cl-loop for mode in esml-sml-modes do |
| 125 |
(add-to-list 'def-use-mode-to-move-to-symbol-start-alist |
| 126 |
(cons mode (function esml-du-move-to-symbol-start)))) |
| 127 |
|
| 128 |
(defun esml-du-move-to-symbol-end () |
| 129 |
"Moves to the end of the SML symbol at point assuming that we are at the |
| 130 |
beginning of the symbol." |
| 131 |
(let ((limit (def-use-point-at-next-line))) |
| 132 |
(when (zerop (skip-chars-forward esml-sml-alphanumeric-chars limit)) |
| 133 |
(skip-chars-forward esml-sml-symbolic-chars limit)))) |
| 134 |
|
| 135 |
(cl-loop for mode in esml-sml-modes do |
| 136 |
(add-to-list 'def-use-mode-to-move-to-symbol-end-alist |
| 137 |
(cons mode (function esml-du-move-to-symbol-end)))) |
| 138 |
|
| 139 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 140 |
;; Methods |
| 141 |
|
| 142 |
(defun esml-du-title (ctx) |
| 143 |
(concat |
| 144 |
(esml-du-ctx-duf ctx) |
| 145 |
" [loaded " (int-to-string (esml-du-ctx-load-cnt ctx)) " times]")) |
| 146 |
|
| 147 |
(defun esml-du-sym-at-ref (ref ctx) |
| 148 |
(esml-du-reload ctx) |
| 149 |
(unless (or (let ((buffer (def-use-find-buffer-visiting-file |
| 150 |
(def-use-ref-src ref)))) |
| 151 |
(and buffer (buffer-modified-p buffer))) |
| 152 |
(def-use-attr-newer? |
| 153 |
(file-attributes (def-use-ref-src ref)) |
| 154 |
(esml-du-ctx-attr ctx))) |
| 155 |
(or (gethash ref (esml-du-ctx-ref-to-sym-table ctx)) |
| 156 |
(and (esml-du-try-to-read-symbol-at-ref ref ctx) |
| 157 |
(gethash ref (esml-du-ctx-ref-to-sym-table ctx)))))) |
| 158 |
|
| 159 |
(defun esml-du-sym-to-uses (sym ctx) |
| 160 |
(esml-du-reload ctx) |
| 161 |
(let ((file-to-poss (def-use-make-hash-table))) |
| 162 |
;; Process by buffer/file as it avoids repeated work |
| 163 |
(mapc (function |
| 164 |
(lambda (ref) |
| 165 |
(puthash (def-use-ref-src ref) |
| 166 |
(cons ref |
| 167 |
(gethash (def-use-ref-src ref) file-to-poss)) |
| 168 |
file-to-poss))) |
| 169 |
(gethash sym (esml-du-ctx-sym-to-uses-table ctx))) |
| 170 |
;; Remove references to modified buffers |
| 171 |
(mapc (function |
| 172 |
(lambda (buffer) |
| 173 |
(when (buffer-modified-p buffer) |
| 174 |
(remhash (def-use-buffer-file-truename buffer) |
| 175 |
file-to-poss)))) |
| 176 |
(buffer-list)) |
| 177 |
;; Remove references to modified files |
| 178 |
(mapc (function |
| 179 |
(lambda (file) |
| 180 |
(when (def-use-attr-newer? |
| 181 |
(file-attributes file) |
| 182 |
(esml-du-ctx-attr ctx)) |
| 183 |
(remhash file file-to-poss)))) |
| 184 |
(def-use-hash-table-to-key-list file-to-poss)) |
| 185 |
(apply (function nconc) |
| 186 |
(def-use-hash-table-to-value-list file-to-poss)))) |
| 187 |
|
| 188 |
(defun esml-du-stop-parsing (ctx) |
| 189 |
(let ((buffer (esml-du-ctx-buf ctx))) |
| 190 |
(when buffer |
| 191 |
(kill-buffer buffer)))) |
| 192 |
|
| 193 |
(defun esml-du-set-live-dufs (dufs &optional dont-save) |
| 194 |
(setq esml-du-live-dufs dufs) |
| 195 |
(when (and (not dont-save) |
| 196 |
esml-du-dufs-auto-load) |
| 197 |
(customize-save-variable |
| 198 |
'esml-du-dufs-recent |
| 199 |
(cl-copy-list dufs)))) |
| 200 |
|
| 201 |
(defun esml-du-finalize (ctx) |
| 202 |
(esml-du-stop-parsing ctx) |
| 203 |
(let ((timer (esml-du-ctx-poll-timer ctx))) |
| 204 |
(when timer |
| 205 |
(cancel-timer timer) |
| 206 |
(esml-du-ctx-set-poll-timer nil ctx))) |
| 207 |
(let ((timer (esml-du-ctx-reload-timer ctx))) |
| 208 |
(when timer |
| 209 |
(cancel-timer timer) |
| 210 |
(esml-du-ctx-set-reload-timer nil ctx))) |
| 211 |
(esml-du-set-live-dufs |
| 212 |
(cl-remove (esml-du-ctx-duf ctx) |
| 213 |
esml-du-live-dufs |
| 214 |
:test (function equal)))) |
| 215 |
|
| 216 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 217 |
;; Context |
| 218 |
|
| 219 |
(defun esml-du-ctx (duf) |
| 220 |
(vector (def-use-make-hash-table) (def-use-make-hash-table) duf nil nil nil 0 |
| 221 |
nil nil)) |
| 222 |
|
| 223 |
(defun esml-du-ctx-reload-timer (ctx) (aref ctx 7)) |
| 224 |
(defun esml-du-ctx-load-cnt (ctx) (aref ctx 6)) |
| 225 |
(defun esml-du-ctx-poll-timer (ctx) (aref ctx 5)) |
| 226 |
(defun esml-du-ctx-buf (ctx) (aref ctx 4)) |
| 227 |
(defun esml-du-ctx-attr (ctx) (aref ctx 3)) |
| 228 |
(defun esml-du-ctx-duf (ctx) (aref ctx 2)) |
| 229 |
(defun esml-du-ctx-ref-to-sym-table (ctx) (aref ctx 1)) |
| 230 |
(defun esml-du-ctx-sym-to-uses-table (ctx) (aref ctx 0)) |
| 231 |
|
| 232 |
(defun esml-du-ctx-inc-load-cnt (ctx) |
| 233 |
(aset ctx 6 (1+ (aref ctx 6)))) |
| 234 |
|
| 235 |
(defun esml-du-ctx-set-reload-timer (timer ctx) (aset ctx 7 timer)) |
| 236 |
(defun esml-du-ctx-set-poll-timer (timer ctx) (aset ctx 5 timer)) |
| 237 |
(defun esml-du-ctx-set-buf (buf ctx) (aset ctx 4 buf)) |
| 238 |
(defun esml-du-ctx-set-attr (attr ctx) (aset ctx 3 attr)) |
| 239 |
|
| 240 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 241 |
;; Parsing |
| 242 |
|
| 243 |
(defun esml-du-read (taking skipping) |
| 244 |
(let ((start (point))) |
| 245 |
(skip-chars-forward taking) |
| 246 |
(let ((result (buffer-substring start (point)))) |
| 247 |
(skip-chars-forward skipping) |
| 248 |
result))) |
| 249 |
|
| 250 |
(defun esml-du-read-opt-str () |
| 251 |
(when (= (char-after) ?\") |
| 252 |
(forward-char 1) |
| 253 |
(esml-du-read "^\"" "\""))) |
| 254 |
|
| 255 |
(defconst esml-du-classes ;; XXX Needs customization |
| 256 |
`((,(def-use-intern "variable") . ,font-lock-variable-name-face) |
| 257 |
(,(def-use-intern "type") . ,font-lock-variable-name-face) |
| 258 |
(,(def-use-intern "constructor") . ,font-lock-variable-name-face) |
| 259 |
(,(def-use-intern "structure") . ,font-lock-variable-name-face) |
| 260 |
(,(def-use-intern "signature") . ,font-lock-variable-name-face) |
| 261 |
(,(def-use-intern "functor") . ,font-lock-variable-name-face) |
| 262 |
(,(def-use-intern "exception") . ,font-lock-variable-name-face))) |
| 263 |
|
| 264 |
(defun esml-du-reload (ctx) |
| 265 |
"Schedules a reload of the def-use file if it has been modified." |
| 266 |
(let ((attrs (file-attributes (esml-du-ctx-duf ctx)))) |
| 267 |
(when (def-use-attr-changed? |
| 268 |
attrs |
| 269 |
(esml-du-ctx-attr ctx)) |
| 270 |
(when (esml-du-ctx-reload-timer ctx) |
| 271 |
(cancel-timer (esml-du-ctx-reload-timer ctx))) |
| 272 |
(esml-du-ctx-set-reload-timer |
| 273 |
(run-with-idle-timer |
| 274 |
0.5 |
| 275 |
nil |
| 276 |
(function |
| 277 |
(lambda (ctx attrs) |
| 278 |
(if (def-use-attr-changed? |
| 279 |
(file-attributes (esml-du-ctx-duf ctx)) |
| 280 |
attrs) |
| 281 |
(esml-du-reload ctx) |
| 282 |
(esml-du-ctx-set-reload-timer nil ctx) |
| 283 |
(esml-du-load ctx)))) |
| 284 |
ctx attrs) |
| 285 |
ctx)))) |
| 286 |
|
| 287 |
(defun esml-du-try-to-read-symbol-at-ref-once (ref ctx) |
| 288 |
(when (search-forward (esml-du-ref-to-appx-syntax ref) nil t) |
| 289 |
(beginning-of-line) |
| 290 |
(while (= ?\ (char-after)) |
| 291 |
(forward-line -1)) |
| 292 |
(esml-du-read-one-symbol ctx))) |
| 293 |
|
| 294 |
(defun esml-du-try-to-read-all-symbols-at-ref (ref ctx) |
| 295 |
(let ((syms nil)) |
| 296 |
(goto-char 1) |
| 297 |
(while (let ((sym (esml-du-try-to-read-symbol-at-ref-once ref ctx))) |
| 298 |
(when sym |
| 299 |
(push sym syms)))) |
| 300 |
syms)) |
| 301 |
|
| 302 |
(defun esml-du-try-to-read-symbol-at-ref (ref ctx) |
| 303 |
"Tries to read the symbol at the specified ref from the duf. Returns |
| 304 |
non-nil if something was actually read." |
| 305 |
(let ((buffer (esml-du-ctx-buf ctx))) |
| 306 |
(when buffer |
| 307 |
(bury-buffer buffer) |
| 308 |
(with-current-buffer buffer |
| 309 |
(let ((syms (esml-du-try-to-read-all-symbols-at-ref ref ctx))) |
| 310 |
(when syms |
| 311 |
(while syms |
| 312 |
(let* ((sym (pop syms)) |
| 313 |
(more-syms |
| 314 |
(esml-du-try-to-read-all-symbols-at-ref |
| 315 |
(def-use-sym-ref sym) ctx))) |
| 316 |
(when more-syms |
| 317 |
(setq syms (nconc more-syms syms))))) |
| 318 |
t)))))) |
| 319 |
|
| 320 |
(defun esml-du-ref-to-appx-syntax (ref) |
| 321 |
(let ((pos (def-use-ref-pos ref))) |
| 322 |
(concat |
| 323 |
(file-name-nondirectory (def-use-ref-src ref)) " " |
| 324 |
(int-to-string (def-use-pos-line pos)) "." |
| 325 |
(int-to-string (1+ (def-use-pos-col pos)))))) |
| 326 |
|
| 327 |
(defconst esml-du-highlight-type-map ;; XXX Needs customization |
| 328 |
`(("\\([a-zA-Z0-9_]+\\)[:]" |
| 329 |
. ,font-lock-constant-face) |
| 330 |
("\\([a-zA-Z0-9_]+\\)\\>\\(?:[^:]\\|$\\)" |
| 331 |
. ,font-lock-type-face) |
| 332 |
("\\(\\<andalso\\>\\)" |
| 333 |
. ,font-lock-keyword-face) |
| 334 |
(,(concat "\\<\\(" |
| 335 |
(regexp-opt |
| 336 |
'("array" "bool" "char" "exn" "int" "list" "option" "order" |
| 337 |
"real" "ref" "string" "substring" "unit" "vector" "word")) |
| 338 |
"\\)\\>") |
| 339 |
. ,font-lock-builtin-face) |
| 340 |
("\\('[a-zA-Z0-9_]+\\)" |
| 341 |
. ,font-lock-variable-name-face))) |
| 342 |
|
| 343 |
(defun esml-du-highlight-type (string) |
| 344 |
(when string |
| 345 |
(cl-loop for pat-face in esml-du-highlight-type-map do |
| 346 |
(let ((pat (car pat-face)) |
| 347 |
(prop `(face ,(cdr pat-face))) |
| 348 |
(start 0)) |
| 349 |
(while (string-match pat string start) |
| 350 |
(add-text-properties |
| 351 |
(match-beginning 1) |
| 352 |
(match-end 1) |
| 353 |
prop |
| 354 |
string) |
| 355 |
(setq start (match-end 0)))))) |
| 356 |
string) |
| 357 |
|
| 358 |
(defun esml-du-read-one-symbol (ctx) |
| 359 |
"Reads one symbol from the current buffer starting at the current point. |
| 360 |
Returns the symbol read and deletes the read symbol from the buffer." |
| 361 |
(let* ((start (point)) |
| 362 |
(ref-to-sym (esml-du-ctx-ref-to-sym-table ctx)) |
| 363 |
(sym-to-uses (esml-du-ctx-sym-to-uses-table ctx)) |
| 364 |
(class (def-use-intern (esml-du-read "^ " " "))) |
| 365 |
(name (def-use-intern (esml-du-read "^ " " "))) |
| 366 |
(src (def-use-file-truename (esml-du-read "^ " " "))) |
| 367 |
(line (string-to-number (esml-du-read "^." "."))) |
| 368 |
(col (1- (string-to-number (esml-du-read "^ \n" " ")))) |
| 369 |
(msg (esml-du-highlight-type |
| 370 |
(def-use-intern (esml-du-read-opt-str)))) |
| 371 |
(pos (def-use-pos line col)) |
| 372 |
(ref (def-use-ref src pos)) |
| 373 |
(sym (def-use-sym class msg name ref |
| 374 |
(cdr (assoc class esml-du-classes)))) |
| 375 |
(uses nil)) |
| 376 |
(let ((old-sym (gethash ref ref-to-sym))) |
| 377 |
(when old-sym |
| 378 |
(setq sym old-sym)) |
| 379 |
(puthash ref sym ref-to-sym)) |
| 380 |
(skip-chars-forward "\n") |
| 381 |
(while (< 0 (skip-chars-forward " ")) |
| 382 |
(let* ((src (def-use-file-truename (esml-du-read "^ " " "))) |
| 383 |
(line (string-to-number (esml-du-read "^." "."))) |
| 384 |
(col (1- (string-to-number (esml-du-read "^\n" "\n")))) |
| 385 |
(pos (def-use-pos line col)) |
| 386 |
(ref (def-use-ref src pos))) |
| 387 |
(let ((old-sym (gethash ref ref-to-sym))) |
| 388 |
(when old-sym |
| 389 |
(let ((old-uses (gethash old-sym sym-to-uses))) |
| 390 |
(remhash old-sym sym-to-uses) |
| 391 |
(mapc |
| 392 |
(function |
| 393 |
(lambda (ref) |
| 394 |
(puthash ref sym ref-to-sym))) |
| 395 |
old-uses) |
| 396 |
(setq uses (nconc uses old-uses))))) |
| 397 |
(puthash ref sym ref-to-sym) |
| 398 |
(push ref uses))) |
| 399 |
(puthash sym uses sym-to-uses) |
| 400 |
(setq buffer-read-only nil) |
| 401 |
(delete-char (- start (point))) |
| 402 |
(setq buffer-read-only t) |
| 403 |
sym)) |
| 404 |
|
| 405 |
(defun esml-du-load (ctx) |
| 406 |
"Loads the def-use file to a buffer for performing queries." |
| 407 |
(esml-du-ctx-set-attr (file-attributes (esml-du-ctx-duf ctx)) ctx) |
| 408 |
(if (esml-du-ctx-buf ctx) |
| 409 |
(with-current-buffer (esml-du-ctx-buf ctx) |
| 410 |
(goto-char 1) |
| 411 |
(setq buffer-read-only nil) |
| 412 |
(delete-char (1- (point-max)))) |
| 413 |
(esml-du-ctx-set-buf |
| 414 |
(generate-new-buffer (concat "** " (esml-du-ctx-duf ctx) " **")) ctx) |
| 415 |
(with-current-buffer (esml-du-ctx-buf ctx) |
| 416 |
(buffer-disable-undo) |
| 417 |
(add-hook |
| 418 |
'kill-buffer-hook |
| 419 |
(let ((ctx ctx)) |
| 420 |
(function |
| 421 |
(lambda () |
| 422 |
(esml-du-ctx-set-buf nil ctx)))) |
| 423 |
nil t))) |
| 424 |
(bury-buffer (esml-du-ctx-buf ctx)) |
| 425 |
(with-current-buffer (esml-du-ctx-buf ctx) |
| 426 |
(insert-file-contents (esml-du-ctx-duf ctx)) |
| 427 |
(setq buffer-read-only t) |
| 428 |
(goto-char 1)) |
| 429 |
(clrhash (esml-du-ctx-ref-to-sym-table ctx)) |
| 430 |
(clrhash (esml-du-ctx-sym-to-uses-table ctx)) |
| 431 |
(garbage-collect) |
| 432 |
(when (memq esml-du-notify '(always)) |
| 433 |
(message "Loaded %s" (esml-du-ctx-duf ctx))) |
| 434 |
(esml-du-ctx-inc-load-cnt ctx)) |
| 435 |
|
| 436 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 437 |
|
| 438 |
(run-with-idle-timer |
| 439 |
1.0 nil |
| 440 |
(function |
| 441 |
(lambda () |
| 442 |
(when esml-du-dufs-auto-load |
| 443 |
(mapc (function |
| 444 |
(lambda (file) |
| 445 |
(when (and (file-readable-p file) |
| 446 |
(file-regular-p file)) |
| 447 |
(esml-du-mlton file t)))) |
| 448 |
esml-du-dufs-recent))))) |
| 449 |
|
| 450 |
(provide 'esml-du-mlton) |