Re: Columns in pg_shadow?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Michael A(dot) Mayo" <mmayo(at)mcauleybrooklyn(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Columns in pg_shadow?
Date: 2000-05-22 23:41:58
Message-ID: 21250.959038918@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Michael A. Mayo" <mmayo(at)mcauleybrooklyn(dot)org> writes:
> From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>> the One True Editor: I have an emacs macro that invokes glimpse in the
>> same way as grep is called by the standard "grep" macro, so that you can
>> step through all the hits with C-x `. Let me know if you need it.)

> The emacs macro could certianly be useful;

It's just a shameless ripoff of the standard 'grep' macro from
compile.el. (I'm still using Emacs 19, not sure if there are any
changes needed for Emacs 20.)

;; Create 'glimpse', which is essentially just like 'grep' except that
;; we add </dev/null instead of /dev/null to the end of the command.

(require 'compile)

(defvar glimpse-command "glimpse -n "
"Last glimpse command used in \\[glimpse]; default for next glimpse.")
(defvar glimpse-history nil)

(defun glimpse (command-args)
"Run glimpse, with user-specified args, and collect output in a buffer.
While glimpse runs asynchronously, you can use the \\[next-error] command
to find the text that glimpse hits refer to.

This command uses a special history list for its arguments, so you can
easily repeat a glimpse command."
(interactive
(list (read-from-minibuffer "Run glimpse (like this): "
glimpse-command nil nil 'glimpse-history)))
(let ((buf (compile-internal (concat command-args " <" grep-null-device)
"No more glimpse hits" "glimpse"
;; We can use the same match regexp as for grep.
nil grep-regexp-alist)))
(save-excursion
(set-buffer buf)
(set (make-local-variable 'compilation-exit-message-function)
(lambda (status code msg)
(if (eq status 'exit)
(cond ((zerop code)
'("finished\n" . "done"))
((= code 1)
'("finished with no matches found\n" . "no match"))
(t
(cons msg code)))
(cons msg code)))))))

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-05-22 23:46:27 Re: Database is unstable after upgrade
Previous Message Roderick A. Anderson 2000-05-22 23:13:31 Re: [PORTS] Logging (was Re: PostgreSQL 7.0-2 RPMset released.)