home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / prog / c / quik_fix.lzh / quik-fix.el < prev    next >
Lisp/Scheme  |  1992-12-08  |  3KB  |  135 lines

  1. ;;;;======================================================================
  2. ;;;; quik-fix.el (v1.0) by Patrick Fitzgerald
  3. ;;;; for GNU emacs (18.58, Amiga port 1.25DG)
  4. ;;;;======================================================================
  5.  
  6.  
  7. ;;;
  8. ;;; Config
  9. ;;;
  10.  
  11. (setq quik-fix-buffer-name "*QuikFix*")
  12.  
  13. ; Set this to t and work backward for best results
  14. (setq quik-fix-backward nil)
  15.  
  16.  
  17.  
  18. ;;
  19. ;; quik-fix-start
  20. ;;
  21. ;; Loads the file "AxtecC.Err"
  22. ;; and finds the first (or last) error
  23. ;;
  24. (defun quik-fix-start (directory)
  25.   (get-buffer-create quik-fix-buffer-name)
  26.   (switch-to-buffer quik-fix-buffer-name)
  27.   (erase-buffer)
  28.   (setq default-directory directory)
  29.   (insert-file "AztecC.Err")
  30.  
  31.   (if quik-fix-backward ; Go to the first error
  32.       (quik-fix-last)
  33.     (quik-fix-first)))
  34.  
  35.  
  36. ;;
  37. ;; quik-fix-recompile
  38. ;;
  39. (defun quik-fix-recompile ()
  40.   (interactive)
  41.   (save-some-buffers)
  42.   (amiga-arexx-send-command "address QuikFix 'RECOMPILE'" t)
  43. )
  44.  
  45.  
  46. ;;
  47. ;; quik-fix-stop
  48. ;;
  49. (defun quik-fix-stop ()
  50.   (interactive)
  51.   (save-some-buffers)
  52.   (amiga-arexx-send-command "address QuikFix 'STOP'" t)
  53. )
  54.  
  55.  
  56. ;;
  57. ;; quik-fix-first
  58. ;;
  59. (defun quik-fix-first ()
  60.   (interactive)
  61.  
  62.   (switch-to-buffer quik-fix-buffer-name)
  63.   (goto-char (point-min))
  64.   (quik-fix-do-line))
  65.  
  66.  
  67. ;;
  68. ;; quik-fix-last
  69. ;;
  70. (defun quik-fix-last ()
  71.   (interactive)
  72.  
  73.   (switch-to-buffer quik-fix-buffer-name)
  74.   (goto-char (point-max))
  75.   (forward-line -1)
  76.   (quik-fix-do-line))
  77.  
  78.  
  79. ;;
  80. ;; quik-fix-next
  81. ;;
  82. (defun quik-fix-next ()
  83.   (interactive)
  84.  
  85.   (switch-to-buffer quik-fix-buffer-name)
  86.   (forward-line 1)
  87.   (quik-fix-do-line))
  88.  
  89.  
  90. ;;
  91. ;; quik-fix-previous
  92. ;;
  93. (defun quik-fix-previous ()
  94.   (interactive)
  95.  
  96.   (switch-to-buffer quik-fix-buffer-name)
  97.   (forward-line -1)
  98.   (quik-fix-do-line))
  99.  
  100.  
  101. ;;
  102. ;; quik-fix-current
  103. ;;
  104. (defun quik-fix-current ()
  105.   (interactive)
  106.  
  107.   (switch-to-buffer quik-fix-buffer-name)
  108.   (quik-fix-do-line))
  109.  
  110.  
  111.  
  112.  
  113. ;;
  114. ;; quik-fix-get-line
  115. ;;
  116. (defun quik-fix-do-line ()
  117.   (beginning-of-line)
  118.  
  119.   ; Format of line:
  120.   ; str>int:int:char:int:str:
  121.  
  122.   (if (re-search-forward "^\\(.*\\)>\\(.*\\):\\(.*\\):\\(.*\\):\\(.*\\):\\(.*\\):" nil t)
  123.       (let ((file (buffer-substring (match-beginning 1) (match-end 1)))
  124.         (line (string-to-int (buffer-substring (match-beginning 2) (match-end 2))))
  125.         (col  (string-to-int (buffer-substring (match-beginning 3) (match-end 3))))
  126.         (ew   (buffer-substring (match-beginning 4) (match-end 4)))
  127.         (code (buffer-substring (match-beginning 5) (match-end 5)))
  128.         (msg  (buffer-substring (match-beginning 6) (match-end 6))))
  129.     (find-file file)
  130.     (goto-line line)
  131.     (goto-char (+ (point) col))
  132.     (message (concat ew "(" code "):" msg)))
  133.     (progn (beep)
  134.        (message "quik-fix: cannot find error"))))
  135.