[comp.sources.misc] Gnumacs code for ID stuff

gmcgary@SUN.COM@kumquat.UUCP (Greg Mcgary - Sun ECD Software) (10/14/87)

This comes from Wolfgang Rupprecht, with whom I used to work at
Lisp Machine Inc. in Cambridge.

It's a gnuemacs command for perusing sources with the aid of the ID
database.  It takes advantage of the fact that
`gid' produces lines in the same format as /lib/cpp error messages.
The `gid' emacs command runs `gid' the program and lets you examine
the results as you would ordinary compiler error messages.  I haven't
tested this personally, but I know that Wolfgang has been using it for
quite some time now. (Almost a year)

I would appreciate it if you could post this as an addendum to ID.

Thank you!

--Greg McGary--

PS: Wolfgang says `Hi!'

----- Begin Forwarded Message -----

Here is a present for your 'ids' package. 

		-wolfgang 

;;; put this in your GnuEmacs startup file  '~/.emacs' .
;;; or autoload it from some other file. -wsr
(global-set-key "\e/" 'gid) ; sort of Meta-.

(defun gid (command)
  "Run gid, with user-specified args, and collect output in a buffer.
While gid runs asynchronously, you can use the \\[next-error] command
to find the text that gid hits refer to."
  (interactive (list (read-input "Run gid (with args): "
				 (word-around-point))))
  (compile1 (concat "gid " command)
	    "No more gid hits" "gid"))

(defun word-around-point ()
  "return the word around the point as a string"
  (save-excursion
    (let (beg)
      (if (not (looking-at "\\<"))
	  (forward-word -1))
      (setq beg (point))
      (forward-word 1)
      (buffer-substring beg (point)))))

---
Wolfgang Rupprecht	       UUCP: mirror!mit-mgm!wolfgang
<add us to your host table>    ARPA: wolfgang@mgm.mit.edu (IP addr 18.82.0.114)


----- End Forwarded Message -----