(provide (quote compile)) (defvar compilation-process nil "Process created by compile command, or nil if none exists now. Note that the process may have been \"deleted\" and still be the value of this variable.") (defvar compilation-error-list nil "List of error message descriptors for visiting erring functions. Each error descriptor is a list of length two. Its car is a marker pointing to an error message. Its cadr is a marker pointing to the text of the line the message is about, or nil if that is not interesting. The value may be t instead of a list; this means that the buffer of error messages should be reparsed the next time the list of errors is wanted.") (defvar compilation-parsing-end nil "Position of end of buffer when last error messages parsed.") (defvar compilation-error-message nil "Message to print when no more matches for compilation-error-regexp are found") (defvar compilation-error-regexp "\\([^ ]+\\(: *\\|, line \\|(\\)[0-9]+\\)\\|\\([0-9]+.*of *[^ ]+\\)" "Regular expression for filename/linenumber in error in compilation log.") (defun compile (command) "\ Compile the program including the current buffer. Default: run make. Runs COMMAND, a shell command, in a separate process asynchronously with output going to the buffer *compilation*. You can then use the command \\[next-error] to find the next error message and move to the source code that caused it." (interactive (byte-code "\"C" [compile-command read-input "Compile command: "] 3)) (byte-code " \"" [compile-command command nil compile1 "No more errors"] 3)) (defun grep (command) "\ Run grep, with user-specified args, and collect output in a buffer. While grep runs asynchronously, you can use the \\[next-error] command to find the text that grep hits refer to." (interactive "sRun grep (with args): ") (byte-code "Q#" [command nil compile1 "grep -n " " /dev/null" "No more grep hits" "grep"] 4)) (defun compile1 (command error-message &optional name-of-mode) (byte-code " # !=? ! !$ P%ݐ!! ! !! ))\"!! p= db q! \" = \" )+" [compilation-process nil compilation-error-list t compilation-error-message error-message shell-file-name command default-directory regexp compilation-error-regexp thisdir outbuf outwin mode-name name-of-mode mode-line-format save-some-buffers process-status run yes-or-no-p "A compilation process is running; kill it? " (byte-code "!" [compilation-process delete-process] 2) ((error (byte-code "" [nil] 1))) error "Cannot have two compilation processes" compilation-forget-errors start-process "compilation" "*compilation*" "-c" "exec " princ "cd " terpri switch-to-buffer make-local-variable set-process-sentinel compilation-sentinel process-buffer get-buffer-window buffer-flush-undo set-window-start 1 selected-window set-window-point fundamental-mode "Compilation" "--%1*%1*-Emacs: %17b % %[(%m: %s)%]----%3p--%-"] 23)) (defun compilation-sentinel (proc msg) (byte-code "!>>