home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / emacs / sources / 926 < prev    next >
Encoding:
Text File  |  1993-01-08  |  3.3 KB  |  95 lines

  1. Path: sparky!uunet!ittc!fpb
  2. From: fpb@ittc.wec.com (Frank P. Bresz)
  3. Newsgroups: gnu.emacs.sources
  4. Subject: compile.el v18.59 to handle tree walking makes.
  5. Message-ID: <FPB.93Jan8102232@ittc.ittc.wec.com>
  6. Date: 8 Jan 93 15:22:32 GMT
  7. Sender: news@ittc.wec.com
  8. Distribution: gnu
  9. Organization: Westinghouse, ITTC, Pgh, PA.
  10. Lines: 83
  11.  
  12.  
  13. Here are some changes to allow compile.el to parse and understand Makes
  14. like we have locally that end up walking up and down a tree building
  15. things.  
  16.  
  17. enjoy.
  18.  
  19. # rcsdiff -r1.1 -cw compile.el
  20. *** /tmp/T0a27037    Fri Jan  8 10:19:45 1993
  21. --- compile.el    Fri Jan  8 10:19:34 1993
  22. ***************
  23. *** 46,51 ****
  24. --- 46,54 ----
  25.     "\\([^ :\n]+\\(: *\\|, line \\|(\\)[0-9]+\\)\\|\\([0-9]+ *of *[^ \n]+\\)"
  26.     "Regular expression for filename/linenumber in error in compilation log.")
  27.   
  28. + (defvar compilation-cd-regexp "^cd"
  29. +   "Regular expression to be used to glean any cd-ing the make may do")
  30.   (defun compile (command)
  31.     "Compile the program including the current buffer.  Default: run `make'.
  32.   Runs COMMAND, a shell command, in a separate process asynchronously
  33. ***************
  34. *** 230,236 ****
  35.       ;; This matters for grep.
  36.       (if (bobp)
  37.       (forward-line 2))
  38. !     (while (re-search-forward compilation-error-regexp nil t)
  39.         (let (linenum filename
  40.           error-marker text-marker)
  41.       ;; Extract file name and line number from error message.
  42. --- 233,261 ----
  43.       ;; This matters for grep.
  44.       (if (bobp)
  45.       (forward-line 2))
  46. !     (while (re-search-forward 
  47. !         (concat compilation-error-regexp "\\|" compilation-cd-regexp) nil t)
  48. !       ;; Go to the beginninnng of the match and see if we are at a cd line
  49. !       ;; If so the change directory 
  50. !       ;; This allows cd'ing within Make i.e. the tree walking makes can
  51. !       ;; be parsed with this.
  52. !       (goto-char (match-beginning 0))
  53. !       (if (looking-at compilation-cd-regexp)
  54. !       (let (dir)
  55. !         ;; Code snarfed from shell.el to get directory.
  56. !         (skip-chars-forward "^ ")
  57. !         (skip-chars-forward " \t")
  58. !         (file-directory-p
  59. !          (setq dir
  60. !            (expand-file-name
  61. !             (substitute-in-file-name
  62. !              (buffer-substring
  63. !               (point)
  64. !               (progn
  65. !             (skip-chars-forward "^\n \t;")
  66. !             (point)))))))
  67. !         (cd dir))
  68. !     (re-search-forward compilation-error-regexp nil t)
  69.       (let (linenum filename
  70.                 error-marker text-marker)
  71.         ;; Extract file name and line number from error message.
  72. ***************
  73. *** 296,302 ****
  74.           (setq compilation-error-list
  75.                 (cons (list error-marker text-marker)
  76.                   compilation-error-list)))))
  77. !     (forward-line 1)))
  78.       (setq compilation-parsing-end (point-max)))
  79.     (message "Parsing error messages...done")
  80.     (setq compilation-error-list (nreverse compilation-error-list)))
  81. --- 321,327 ----
  82.             (setq compilation-error-list
  83.               (cons (list error-marker text-marker)
  84.                     compilation-error-list)))))
  85. !       (forward-line 1))))
  86.       (setq compilation-parsing-end (point-max)))
  87.     (message "Parsing error messages...done")
  88.     (setq compilation-error-list (nreverse compilation-error-list)))
  89. --
  90. Frank P. Bresz <fpb@ittc.pgh.wec.com>, uunet!ittc!fpb, +1 412 733 6749, Fx 6444
  91. My opinions are mine, Westinghouse pays big money for *official* opinions
  92. Member: League for Programming Freedom (LPF)  | STOP Software Patents
  93. For more information on the 'LPF' send mail   | before they stop you.
  94.