diff options
| author | Stefan Monnier | 2006-01-09 19:11:28 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2006-01-09 19:11:28 +0000 |
| commit | 6fee12e66daa90d6724c4e9cc433bfddaad0a239 (patch) | |
| tree | 841d729689db6fe3e9858d27eafa1256d474d329 | |
| parent | 4c9ca1a3ebeea5942a2f9e06160e627eec43a1ed (diff) | |
| download | emacs-6fee12e66daa90d6724c4e9cc433bfddaad0a239.tar.gz emacs-6fee12e66daa90d6724c4e9cc433bfddaad0a239.zip | |
Use `require' rather than autoload for XEmacs's overlays.
(flymake-get-common-file-prefix, flymake-build-relative-filename):
Delete. Use file-relative-name instead.
(flymake-get-syntax-check-program-args, flymake-perl-init):
Simplify the resulting code.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/progmodes/flymake.el | 76 |
2 files changed, 21 insertions, 62 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0cfbd8e8c63..6eb27f1749d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2006-01-09 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2006-01-09 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * progmodes/flymake.el: Use `require' rather than autoload for | ||
| 4 | XEmacs's overlays. | ||
| 5 | (flymake-get-common-file-prefix, flymake-build-relative-filename): | ||
| 6 | Delete. Use file-relative-name instead. | ||
| 7 | (flymake-get-syntax-check-program-args, flymake-perl-init): | ||
| 8 | Simplify the resulting code. | ||
| 9 | |||
| 3 | * log-view.el (log-view-file-re, log-view-message-re): Add support | 10 | * log-view.el (log-view-file-re, log-view-message-re): Add support |
| 4 | for DaRCS output. | 11 | for DaRCS output. |
| 5 | 12 | ||
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 4b14d321a46..f5e4f58cb8f 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el | |||
| @@ -32,6 +32,9 @@ | |||
| 32 | 32 | ||
| 33 | ;;; Code: | 33 | ;;; Code: |
| 34 | 34 | ||
| 35 | (eval-when-compile (require 'cl)) | ||
| 36 | (if (featurep 'xemacs) (require 'overlay)) | ||
| 37 | |||
| 35 | (defvar flymake-is-running nil | 38 | (defvar flymake-is-running nil |
| 36 | "If t, flymake syntax check process is running for the current buffer.") | 39 | "If t, flymake syntax check process is running for the current buffer.") |
| 37 | (make-variable-buffer-local 'flymake-is-running) | 40 | (make-variable-buffer-local 'flymake-is-running) |
| @@ -60,17 +63,6 @@ | |||
| 60 | "Same as `flymake-err-info', effective when a syntax check is in progress.") | 63 | "Same as `flymake-err-info', effective when a syntax check is in progress.") |
| 61 | (make-variable-buffer-local 'flymake-new-err-info) | 64 | (make-variable-buffer-local 'flymake-new-err-info) |
| 62 | 65 | ||
| 63 | ;;;; [[ Xemacs overlay compatibility | ||
| 64 | (if (featurep 'xemacs) (progn | ||
| 65 | (autoload 'make-overlay "overlay" "Overlay compatibility kit." t) | ||
| 66 | (autoload 'overlayp "overlay" "Overlay compatibility kit." t) | ||
| 67 | (autoload 'overlays-in "overlay" "Overlay compatibility kit." t) | ||
| 68 | (autoload 'delete-overlay "overlay" "Overlay compatibility kit." t) | ||
| 69 | (autoload 'overlay-put "overlay" "Overlay compatibility kit." t) | ||
| 70 | (autoload 'overlay-get "overlay" "Overlay compatibility kit." t) | ||
| 71 | )) | ||
| 72 | ;;;; ]] | ||
| 73 | |||
| 74 | ;;;; [[ cross-emacs compatibility routines | 66 | ;;;; [[ cross-emacs compatibility routines |
| 75 | (defsubst flymake-makehash (&optional test) | 67 | (defsubst flymake-makehash (&optional test) |
| 76 | (if (fboundp 'make-hash-table) | 68 | (if (fboundp 'make-hash-table) |
| @@ -361,43 +353,6 @@ Return t if so, nil if not." | |||
| 361 | (equal (flymake-fix-file-name file-name-one) | 353 | (equal (flymake-fix-file-name file-name-one) |
| 362 | (flymake-fix-file-name file-name-two))) | 354 | (flymake-fix-file-name file-name-two))) |
| 363 | 355 | ||
| 364 | (defun flymake-get-common-file-prefix (string-one string-two) | ||
| 365 | "Return common prefix for two file names STRING-ONE and STRING-TWO." | ||
| 366 | (setq string-one (file-name-as-directory string-one)) | ||
| 367 | (setq string-two (file-name-as-directory string-two)) | ||
| 368 | (let ((n (compare-strings string-one nil nil string-two nil nil))) | ||
| 369 | (if (eq n t) string-one | ||
| 370 | (setq n (abs (1+ n))) | ||
| 371 | (file-name-directory (substring string-one 0 n))))) | ||
| 372 | |||
| 373 | (defun flymake-build-relative-filename (from-dir to-dir) | ||
| 374 | "Return rel: FROM-DIR/rel == TO-DIR." | ||
| 375 | ;; FIXME: Why not use `file-relative-name'? | ||
| 376 | (if (not (equal (elt from-dir 0) (elt to-dir 0))) | ||
| 377 | (error "First chars in file names %s, %s must be equal (same drive)" | ||
| 378 | from-dir to-dir) | ||
| 379 | (let* ((from (file-name-as-directory (flymake-fix-file-name from-dir))) | ||
| 380 | (to (file-name-as-directory (flymake-fix-file-name to-dir))) | ||
| 381 | (prefix (flymake-get-common-file-prefix from to)) | ||
| 382 | (from-suffix (substring from (length prefix))) | ||
| 383 | (up-count (length (flymake-split-string from-suffix "[/]"))) | ||
| 384 | (to-suffix (substring to (length prefix))) | ||
| 385 | (idx 0) | ||
| 386 | (rel nil)) | ||
| 387 | (if (and (> (length to-suffix) 0) (equal "/" (char-to-string (elt to-suffix 0)))) | ||
| 388 | (setq to-suffix (substring to-suffix 1))) | ||
| 389 | |||
| 390 | (while (< idx up-count) | ||
| 391 | (if (> (length rel) 0) | ||
| 392 | (setq rel (concat rel "/"))) | ||
| 393 | (setq rel (concat rel "..")) | ||
| 394 | (setq idx (1+ idx))) | ||
| 395 | (if (> (length rel) 0) | ||
| 396 | (setq rel (concat rel "/"))) | ||
| 397 | (if (> (length to-suffix) 0) | ||
| 398 | (setq rel (concat rel to-suffix))) | ||
| 399 | (or rel "./")))) | ||
| 400 | |||
| 401 | (defcustom flymake-master-file-dirs '("." "./src" "./UnitTest") | 356 | (defcustom flymake-master-file-dirs '("." "./src" "./UnitTest") |
| 402 | "Dirs where to look for master files." | 357 | "Dirs where to look for master files." |
| 403 | :group 'flymake | 358 | :group 'flymake |
| @@ -1686,16 +1641,14 @@ Return full-name. Names are real, not patched." | |||
| 1686 | ;;;; make-specific init-cleanup routines | 1641 | ;;;; make-specific init-cleanup routines |
| 1687 | (defun flymake-get-syntax-check-program-args (source-file-name base-dir use-relative-base-dir use-relative-source get-cmd-line-f) | 1642 | (defun flymake-get-syntax-check-program-args (source-file-name base-dir use-relative-base-dir use-relative-source get-cmd-line-f) |
| 1688 | "Create a command line for syntax check using GET-CMD-LINE-F." | 1643 | "Create a command line for syntax check using GET-CMD-LINE-F." |
| 1689 | (let* ((my-base-dir base-dir) | 1644 | (funcall get-cmd-line-f |
| 1690 | (my-source source-file-name)) | 1645 | (if use-relative-source |
| 1691 | 1646 | (file-relative-name source-file-name base-dir) | |
| 1692 | (when use-relative-base-dir | 1647 | source-file-name) |
| 1693 | (setq my-base-dir (flymake-build-relative-filename (file-name-directory source-file-name) base-dir))) | 1648 | (if use-relative-base-dir |
| 1694 | 1649 | (file-relative-name base-dir | |
| 1695 | (when use-relative-source | 1650 | (file-name-directory source-file-name)) |
| 1696 | (setq my-source (concat (flymake-build-relative-filename base-dir (file-name-directory source-file-name)) | 1651 | base-dir))) |
| 1697 | (file-name-nondirectory source-file-name)))) | ||
| 1698 | (funcall get-cmd-line-f my-source my-base-dir))) | ||
| 1699 | 1652 | ||
| 1700 | (defun flymake-get-make-cmdline (source base-dir) | 1653 | (defun flymake-get-make-cmdline (source base-dir) |
| 1701 | (list "make" | 1654 | (list "make" |
| @@ -1769,10 +1722,9 @@ Use CREATE-TEMP-F for creating temp copy." | |||
| 1769 | (defun flymake-perl-init () | 1722 | (defun flymake-perl-init () |
| 1770 | (let* ((temp-file (flymake-init-create-temp-buffer-copy | 1723 | (let* ((temp-file (flymake-init-create-temp-buffer-copy |
| 1771 | 'flymake-create-temp-inplace)) | 1724 | 'flymake-create-temp-inplace)) |
| 1772 | (local-file (concat (flymake-build-relative-filename | 1725 | (local-file (file-relative-name |
| 1773 | (file-name-directory buffer-file-name) | 1726 | temp-file |
| 1774 | (file-name-directory temp-file)) | 1727 | (file-name-directory buffer-file-name)))) |
| 1775 | (file-name-nondirectory temp-file)))) | ||
| 1776 | (list "perl" (list "-wc " local-file)))) | 1728 | (list "perl" (list "-wc " local-file)))) |
| 1777 | 1729 | ||
| 1778 | ;;;; tex-specific init-cleanup routines | 1730 | ;;;; tex-specific init-cleanup routines |