home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / gnu / emacs / help / 3889 < prev    next >
Encoding:
Text File  |  1992-08-30  |  4.3 KB  |  114 lines

  1. Path: sparky!uunet!channel1![rick.sheridan@channel1.com]
  2. From: "rick sheridan" <rick.sheridan@channel1.com>
  3. Newsgroups: gnu.emacs.help
  4. Subject: bc++ w/demacs     #01
  5. Message-ID: <1992Aug29.1277.2638@channel1>
  6. Date: 29 Aug 92 21:46:41 EST
  7. Reply-To: "rick sheridan" <rick.sheridan@channel1.com>
  8. Distribution: gnu
  9. Organization: Channel 1 Communications
  10. Lines: 102
  11.  
  12. Let me thank everyone who has helped me with this, especially Juergen
  13. Nickelsen.
  14.  
  15. Below is the COMPILE.EL file for Demacs 1.2.0 that will work with
  16. Borland C++.  I only have Borland C++ 3.1 but assume the output for
  17. most Borland compilers is
  18.  
  19.         Error|Warning <filename> <linenumber>: <error message>
  20.  
  21. I hope a few Demacs users find this helpful.
  22.  
  23. -------------------------------- cut here -----------------------------
  24.  
  25. ;; 92/08/28 modified by R.L. Sheridan, rick.sheridan@channel1.com,
  26. ;; for use with Borland compilers.
  27. ;; This has been tested only with Borland C++ 3.1, but should
  28. ;; work with all Borland language products.
  29. ;;
  30. ;; 91/10/22 modified for Demacs 1.1 by Manabu Higashida
  31. ;;
  32.  
  33. ;; Run compiler as inferior of Emacs, and parse its error messages.
  34. ;; Copyright (C) 1985, 1986 Free Software Foundation, Inc.
  35.  
  36. ;; This file is part of GNU Emacs.
  37.  
  38. ;; GNU Emacs is distributed in the hope that it will be useful,
  39. ;; but WITHOUT ANY WARRANTY.  No author or distributor
  40. ;; accepts responsibility to anyone for the consequences of using it
  41. ;; or for whether it serves any particular purpose or works at all,
  42. ;; unless he says so in writing.  Refer to the GNU Emacs General Public
  43. ;; License for full details.
  44.  
  45. ;; Everyone is granted permission to copy, modify and redistribute
  46. ;; GNU Emacs, but only under the conditions described in the
  47. ;; GNU Emacs General Public License.   A copy of this license is
  48. ;; supposed to have been given to you along with GNU Emacs so you
  49. ;; can know your rights and responsibilities.  It should be in a
  50. ;; file named COPYING.  Among other things, the copyright notice
  51. ;; and this notice must be preserved on all copies.
  52.  
  53. (provide 'compile)
  54.  
  55. (defvar compilation-process nil
  56.   "Process created by compile command, or nil if none exists now.
  57. Note that the process may have been \"deleted\" and still
  58. be the value of this variable.")
  59.  
  60. (defvar compilation-error-list nil
  61.   "List of error message descriptors for visiting erring functions.
  62. Each error descriptor is a list of length two.
  63. Its car is a marker pointing to an error message.
  64. Its cadr is a marker pointing to the text of the line the message is about,
  65.   or nil if that is not interesting.
  66. The value may be t instead of a list;
  67. this means that the buffer of error messages should be reparsed
  68. the next time the list of errors is wanted.")
  69.  
  70. (defvar compilation-parsing-end nil
  71.   "Position of end of buffer when last error messages parsed.")
  72.  
  73. (defvar compilation-error-message nil
  74.   "Message to print when no more matches for compilation-error-regexp are found")
  75.  
  76. ;; The regular expression has been modified to find error/warning
  77. ;; messages of the form:
  78. ;;
  79. ;;     Error|Warning <filename> <line number>: <error message>
  80. ;;
  81. ;; I only have Borland C++ but assume other Borland language products
  82. ;; use the same format.
  83. (defvar compilation-error-regexp
  84.   "^\\(\\(Error\\|Warning\\) \\([^ ]+\\) \\([0-9]+\\): [ -~]+\\)$"
  85.   "Regular expression for filename/linenumber in error in compilation log.")
  86.  
  87. (defun compile (command)
  88.   "Compile the program including the current buffer.  Default: run `make'.
  89. Runs COMMAND, a shell command, in a separate process asynchronously
  90. with output going to the buffer *compilation*.
  91. On MS-DOS, this function works but syncronously.
  92. You can then use the command \\[next-error] to find the next error message
  93. and move to the source code that caused it."
  94.   (interactive (list (read-string "Compile command: " compile-command)))
  95.   (setq compile-command command)
  96.   (compile1 compile-command "No more errors"))
  97.  
  98. (defun grep (command)
  99.   "Run grep, with user-specified args, and collect output in a buffer.
  100. While grep runs asynchronously, you can use the \\[next-error] command
  101. to find the text that grep hits refer to."
  102.   (interactive "sRun grep (with args): ")
  103.   (compile1 (concat "grep -n " command
  104.             (if (not (eq system-type 'ms-dos))" /dev/null"))
  105.  
  106.  
  107.                  Stay Tuned ... Continued in next message
  108.  
  109. ---
  110.  ■ PMDBM DEMO V1.5ß #0 ■ Evaluation Copy
  111. --
  112. Channel 1 (R)   Cambridge, MA
  113.  
  114.