home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / util / jade-3.0.lha / Jade / lisp / compile.jlc < prev    next >
Encoding:
Text File  |  1994-04-20  |  4.1 KB  |  63 lines

  1.  
  2. (provide (quote compile))
  3.  
  4. (setq gcc-error-regexp "^(.*):([0-9]+):(.+)" gcc-file-expand "\\1" gcc-line-expand "\\2" gcc-error-expand "\\3")
  5.  
  6. (defvar compile-error-regexp gcc-error-regexp)
  7.  
  8. (defvar compile-file-expand gcc-file-expand)
  9.  
  10. (defvar compile-line-expand gcc-line-expand)
  11.  
  12. (defvar compile-error-expand gcc-error-expand)
  13.  
  14. (defvar compile-keymap (make-keylist))
  15.  
  16. (unless (boundp (quote compile-buffer)) (bind-keys compile-keymap "ctrl-c" (quote kill-compilation) "ctrl-z" (quote stop-compilation) "ctrl-f" (quote continue-compilation) "r" (quote (start-compile-command compile-default-cmd compile-type-str)) "ctrl-r" (quote compile)))
  17.  
  18. (defvar compile-buffer nil)
  19.  
  20. (defvar compile-proc nil)
  21.  
  22. (defvar compile-argv ["sh" "-c" nil])
  23.  
  24. (defvar compile-errors nil 61196)
  25.  
  26. (defvar compile-error-pos nil)
  27.  
  28. (defvar compile-type-str nil)
  29.  
  30. (defvar compile-error-parsed-errors-p nil)
  31.  
  32. (defvar compile-errors-exist-p nil)
  33.  
  34. (defvar compile-default-cmd "make" 61239)
  35.  
  36. (defvar compile-command nil 61338)
  37.  
  38. (set-buffer-variable (quote compile-command))
  39.  
  40. (defun compile-init nil (lisp-code "ü€Š\tû€ž\tF H±F%G±HH†J\nHþ€È‡\tHˆ‰Š\t\nHI&‹I&ŒI&Ž\nF&HJ" [compile-buffer clear-buffer make-buffer "*compilation*" compile-keymap ctrl-c-keymap set-buffer-special add-buffer set-file-name path-name file-name compile-errors compile-parsed-errors-p compile-errors-exists-p pos 1 compile-error-pos] 4))
  41.  
  42. (defun compile-proc-end nil (lisp-code "þ€´±H\tü€›JK\t û€¦JK†‡\t Hˆ‰IRHIF G±H" [compile-proc compile-buffer beep process-exit-value format "\ncompilation exited with value %d\n" "\ncompilation exited abnormally: status 0x%x\n" process-exit-status compile-argv 2] 6))
  43.  
  44. (defun start-compile-command (command type-str &aux shell-cmd) 61454 (lisp-code "ü€Š}û€áHH†\tH‡†JKˆ\n ‰Š‹Œ`ü€±û€´‹ŽF&‘H’†‘\nH“”‘RH•–“ þ€á—F&˜H" [compile-proc error ("Compilation process already running") save-some-buffers compile-init goto-buffer compile-buffer make-process compile-proc-end concat "cd " file-name "" "." " && " command 10 shell-cmd write compile-argv 2 fork-process "/bin/sh" type-str compile-type-str] 6))
  45.  
  46. (defun kill-compilation nil (lisp-code "þ€‡\t" [compile-proc interrupt-process] 2))
  47.  
  48. (defun stop-compilation nil (lisp-code "\tþ€‰\t" [process-running-p compile-proc stop-process] 2))
  49.  
  50. (defun continue-compilation nil (lisp-code "\tþ€‰\t" [process-stopped-p compile-proc continue-process] 2))
  51.  
  52. (defun compile (&optional command) (lisp-code "ÿ€ÿ€Ž\nF$F Hþ€›†J " [command compile-command prompt "Compile command: " compile-default-cmd start-compile-command "errors"] 4))
  53.  
  54. (defun compile-parse-errors nil (lisp-code "ÿ ±DI2I3I4I5I6†‡ˆ‰\nF&‰þ€ýŠ‹ˆŒ‰ \tF#H]ÿ€¶cþ€ó$Ž‹ˆ‰ \nF\"H`ü€ÙF\"û€ÜF%H‘’\n\n“‰\tK†KF&†H”F&‰Hû€’H†þ“•–—†\t\n&–JF&˜EG±HH™ÿ JF HJ" [compile-parsed-errors-p compile-buffer error-file error-line last-e-line last-e-file new-errors find-next-regexp compile-error-regexp compile-error-pos read-from-string regexp-expand-line compile-line-expand file-concat file-name compile-file-expand make-mark pos 1 pos-line find-last-end-pos nconc compile-errors nreverse compile-errors-exist-p compile-proc] 7))
  55.  
  56. (defun next-error nil 61681 (lisp-code "HDL2MF!H]ü€¯†þ€›‡ˆ‰þ€¤Š \tH‹HIû€ÖJü€ÕŒL\tHMþ€ÐŽ‘M\n’ \tHJû€ÖIE" [compile-parse-errors compile-errors err title concat "No " compile-errors-exist-p "more " compile-type-str compile-proc " yet" beep goto-mark regexp-expand-line compile-error-regexp compile-error-expand pos 1 compile-buffer] 7))
  57.  
  58. (defun grep (&optional args) 61791 (lisp-code "ÿ€‰\tF Hþ€™† ‡I " [args prompt "Grep with args: " start-compile-command concat "grep -n " " /dev/null /dev/null" "grep-hits"] 5))
  59.  
  60. (defvar grep-buffer-regexp nil 62003)
  61.  
  62. (defun grep-buffer (&optional regexp) 62052 (lisp-code "þ€‡F!Hþ€Žþ€ñD\n5†6‡ˆJK6‰Š‰‹\nHŒ\nF%þ€ß‰Ž\t‘’\t“\t\nH‡VF&‡H“\tF%Hû€©H”ˆ\tH•\n\tH‡E" [regexp grep-buffer-regexp compile-init pos 1 scanpos 0 number compile-buffer stream write 10 find-next-regexp format "%s:%d:%s\n" file-name pos-line copy-area line-start line-end goto-buffer goto] 9))
  63.