GNU Emacs with xlc on AIX3.1 Was: Shutdown: EMACS vs. vi

GNU Emacs with xlc on AIX3.1 Was: Shutdown: EMACS vs. vi

Post by Haiyan Wa » Wed, 05 Jun 1991 15:33:28




>    As has been pointed out (back to serious discussion), once you get
>     used to it & use Emacs' compile/grep etc interfaces, you will see why
>     line numbers are relatively hard to get at; they're not normally
>     necessary - they're something you can forget all about.  No more
>     "Error x at line y"!!!  I do remember when I first used Emacs how I
>     could get at my beloved line numbers, but now I needn't care...

Speaking of line number and related stuff, is there a way to let the GNU
Emacs 18.57 to understand the error messages from cc on AIX 3.1?

>    Si.
>_______________________________________________________________________________
>Simon Marshall, Dept. of Computer Science, University of Hull, Hull HU6 7RX, UK
>          "``La la la la la la la la la'' means I love you."

>    Telephone:      +44 482 465951 (office)          Fax:   +44 482 466666

Haiyan Wang

 
 
 

GNU Emacs with xlc on AIX3.1 Was: Shutdown: EMACS vs. vi

Post by Ian G Batt » Thu, 06 Jun 1991 16:49:36



> Speaking of line number and related stuff, is there a way to let the GNU
> Emacs 18.57 to understand the error messages from cc on AIX 3.1?

I'm on the point of writing the code to do this.  Has anyone else
started?

ian

 
 
 

GNU Emacs with xlc on AIX3.1 Was: Shutdown: EMACS vs. vi

Post by Wolfgang S. Rupprec » Sat, 08 Jun 1991 00:39:08


i...@fulcrum.bt.co.uk (Ian G Batten) writes:

>In article <1991Jun04.063328.21...@lynx.CS.ORST.EDU> wa...@beasley.CS.ORST.EDU (Haiyan Wang) writes:
>> Speaking of line number and related stuff, is there a way to let the GNU
>> Emacs 18.57 to understand the error messages from cc on AIX 3.1?
>I'm on the point of writing the code to do this.  Has anyone else
>started?

Ok, I'll bite.  

Here is a general error message parser that I have been using in
various forms since 1987.  It is all table driven and adding another
parser template is as trivial as adding one regexp to describe the
error output.

It already knows about most errors that I have needed to parse.  In
addition it does 3-window hacks for lint's inconsistent usage
messages.  It can also hunt for files (as in make's "Make: error on
line 31" type errors, or the brain damaged multi-line System V lint
output.)

Unlike the normal emacs function, this next error is cursor-driven,
and doesn't pre-parse any errors.  One can select an error message by
moving the cursor to the line *above* the desired message and invoking
next-error.

This file also contains a multiple *compilation* buffer hack.  This
allows one to compile in one buffer, grep in another, and watch
something else in a third.  One selects the current compilation buffer
(for next-error use) by typing "C-u C-x `" from inside the buffer one
wants to select.  (Anyone have any good ideas on how to input &optional
args from (interactive)?  Perhaps a "M-x command<space>option" syntax?)

I normally start off a compilation and then rename the *compilation*
buffer to be something more descriptive (eg. *make-dirname* ,
*grep-dirname*, *lint-dirname*, etc.).  This is just the thing when
one has greps of several source trees, and a few compiles active and
needs to switch between them.

One can also have wrappers to start up compilations in different
buffers as in:

    (defun gidbuild (command)
      (interactive (list (read-input "Run gid (with args): "
                                     (symbol-around-point))))
      (let ((default-directory (substitute-in-file-name "$BUILD")))
      (compile1 (concat "gid " command)
                "No more gidbuild hits" "gidbuild" "*gidbuild*")))

To install it just put the the rest of the message into a single file
called 'compile.el' somewhere in your emacs load-path.

-wolfgang
---
Wolfgang Rupprecht    wolfg...@wsrcc.com (or) uunet!wsrcc!wolfgang
Snail Mail Address:   Box 6524, Alexandria, VA 22306-0524

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                                                           ;;
;;      File:     mult-compile.el                                            ;;
;;      Author:   Wolfgang S Rupprecht <wolfg...@wsrcc.com>                  ;;
;;      Created:  Wed Jan 30 15:51:48 EST 1991                               ;;
;;      Contents: Gnu compile.el with multiple process interface             ;;
;;                                                                           ;;
;;      Copyright (c) 1991 Wolfgang S Rupprecht.                             ;;
;;                                                                           ;;
;;      $Header$                                                             ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Run compiler as inferior of Emacs, and parse its error messages.
;; Copyright (C) 1985, 1986 Free Software Foundation, Inc.

;; This file is part of GNU Emacs.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY.  No author or distributor
;; accepts responsibility to anyone for the consequences of using it
;; or for whether it serves any particular purpose or works at all,
;; unless he says so in writing.  Refer to the GNU Emacs General Public
;; License for full details.

;; Everyone is granted permission to copy, modify and redistribute
;; GNU Emacs, but only under the conditions described in the
;; GNU Emacs General Public License.   A copy of this license is
;; supposed to have been given to you along with GNU Emacs so you
;; can know your rights and responsibilities.  It should be in a
;; file named COPYING.  Among other things, the copyright notice
;; and this notice must be preserved on all copies.

(provide 'compile)

;; make a more general purpose compilation interface.
;; 1. make compilation-process be buffer-local. (for buffer->process mapping)
;; 2. use the (process-buffer) for process->buffer mapping.
;; 3. make compilation-error-message be a buffer local variable.

;; user preference configurations

(defvar compile-sets-error-buf t
  "*A compile command will set the error buf.")

;; end user configurations

(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.")

;; this isn't used in any meaningful way - kept here for
;; reasons of minimum change.

(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.")

;; not really used.
(defvar compilation-parsing-end nil
  "Position of end of buffer when last error messages parsed.")

;; make this buffer local
(defvar compilation-error-message nil
  "Message to print when no more matches for compilation-error-regexp are found")

;; The filename excludes colons to avoid confusion when error message
;; starts with digits.
(defvar compilation-error-regexp
  "\\([^ :\n]+\\(: *\\|, line \\|(\\)[0-9]+\\)\\|\\([0-9]+ *of *[^ \n]+\\)"
  "Regular expression for filename/linenumber in error in compilation log.")

(defvar last-compilation-buffer "*compilation*")

(defun compile (command &optional buf)

  "NEW COMPILE:Compile the program including the current buffer.
Default: run `make'.  Runs COMMAND, a shell command, in a separate
process asynchronously with output going a buffer (*compilation* by
default).  You can then use the command \\[next-error] to find the
next error message and move to the source code that caused it.

Optional ARG is the buffer or name of the buffer to use for output. If
interactive, C-u will cause command to prompt for filename.  Default
is the last compilation buffer's name."

  (interactive (list (read-string "Compile command: " compile-command)
                     (if current-prefix-arg
                         (read-string "Compilation buffer: "
                                      last-compilation-buffer))))
  (setq compile-command command)
  (if buf
      (setq last-compilation-buffer buf)
    (setq buf last-compilation-buffer))
   (compile1 compile-command "No more errors" nil buf))

; (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): ")
;   (compile1 (concat "grep -n " command " /dev/null")
;           "No more grep hits" "grep")))

(defun compile1 (command error-message &optional name-of-mode comp-buf)
  "Multi-Buffer version of compile1"
  (save-some-buffers)
  (setq comp-buf (get-buffer-create (or comp-buf "*compilation*")))
  (let ((cwd default-directory)         ; catch that slipery animal
        (regexp compilation-error-regexp)
        (comp-buf-name (buffer-name comp-buf))
        (watch-flag (eq comp-buf (current-buffer))))
    (save-excursion
      (set-buffer comp-buf)
      (setq default-directory cwd)      ; and restore...
      (if compilation-process
          (if (or (not (eq (process-status compilation-process) 'run))
                  (yes-or-no-p
                   "A compilation process is running in this buffer; kill it? "
                   ))
              (condition-case ()
                  (let ((comp-proc compilation-process))
                    (interrupt-process comp-proc)
                    (sit-for 1)
                    (delete-process comp-proc))
                (error nil))
            (error "Cannot have two processes in one buffer!")))

      (if compile-sets-error-buf
          (setq last-error-buf comp-buf-name))

      (fundamental-mode)
      (buffer-flush-undo comp-buf)

      (setq mode-name (or name-of-mode "Compilation"))
      ;; Make log buffer's mode line show process state
      (setq mode-line-process '(": %s"))

      (make-local-variable 'compilation-process)
      (setq compilation-process nil)

      (make-local-variable 'compilation-error-message)
      (setq compilation-error-message error-message)

      (make-local-variable 'compilation-error-regexp)
      (setq compilation-error-regexp regexp)

      (compilation-forget-errors)
      (setq compilation-error-list t)

      (setq compilation-process
            (start-process "compilation" comp-buf
                           shell-file-name
                           "-c" (concat "exec " command)))
      ;; side effects: erase buffer, pop up buffer in other window
      (with-output-to-temp-buffer comp-buf-name
        (princ mode-name)
        (princ " started at ")
        (princ (substring (current-time-string) 0 -5))
        (terpri)
        (princ "cd ")
        (princ default-directory)
        (terpri)
        (princ command)
        (terpri))
      (set-process-sentinel compilation-process 'compilation-sentinel))
    (if watch-flag (goto-char (point-max)))))

;; Called when compilation process changes state.

(defun compilation-sentinel (proc msg)
  (cond ((null (buffer-name (process-buffer proc)))
         ;; buffer killed
         (set-process-buffer proc nil))
        ((memq
...

read more »

 
 
 

1. GNU Emacs and some .emacs questions

This may not be the correct place to ask this questions but .......
I am looking for a mail list to join so that I can ask some questions
about GNU Emacs. I have a need to create a .emacs file to remap some
gnu emacs functions to my televideo function keys. It seem what ever I try
enters the function key value into my emacs buffer  and does not interpret
what I want to do as an emacs command. Are there any FTP sites that
store .emacs init files for examples?

Comments?
Thanks Jim

2. chown bug

3. Emacs to replace shell (was Re: VIP - vi plus emacs)

4. OpenGL dev support on Solaris?

5. I am in love with GNU, EMACS, and CAT!

6. cron log error "! read: Bad file number" by inittab process???

7. Emacs vs. vi

8. Matrox Mystique

9. emacs vs vi

10. VI vs. Emacs

11. emacs vs vi

12. vi vs emacs in a student environment