all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Converting from compile-internal to compilation-start
@ 2009-01-07 21:13 kidologie
  2009-01-08 15:18 ` kidologie
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: kidologie @ 2009-01-07 21:13 UTC (permalink / raw)
  To: help-gnu-emacs

Hello - after upgrading to emacs22, I see that compile-internal is now
obsolete - I need to use compilation-start.

What is the correct way to do this:

 (compile-internal (concat "nits -emacs" command)
		    "All done" "rt-nits" nil grep-regexp-alist)

using compilation-start?

Thanks!


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Converting from compile-internal to compilation-start
  2009-01-07 21:13 Converting from compile-internal to compilation-start kidologie
@ 2009-01-08 15:18 ` kidologie
  2009-01-08 15:24 ` Kevin Rodgers
       [not found] ` <mailman.4338.1231428224.26697.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 5+ messages in thread
From: kidologie @ 2009-01-08 15:18 UTC (permalink / raw)
  To: help-gnu-emacs

On Jan 7, 4:13 pm, kidologie <richwel...@gmail.com> wrote:
> Hello - after upgrading to emacs22, I see that compile-internal is now
> obsolete - I need to use compilation-start.
>
> What is the correct way to do this:
>
>  (compile-internal (concat "nits -emacs" command)
>                     "All done" "rt-nits" nil grep-regexp-alist)
>
> using compilation-start?
>
> Thanks!

Ok this handles both emacs21 and emacs 22 versions:

(defun my-compile-start (command &optional mode buf-name highlight-
regexp)
  (if (fboundp 'compilation-start)    ; Emacs 22
      (compilation-start command mode
             #'(lambda (mode-name) (concat "*" buf-name "*"))
highlight-regexp)
    ; else
    (compile-internal command
              "No more hits" buf-name nil highlight-regexp)))


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Converting from compile-internal to compilation-start
  2009-01-07 21:13 Converting from compile-internal to compilation-start kidologie
  2009-01-08 15:18 ` kidologie
@ 2009-01-08 15:24 ` Kevin Rodgers
       [not found] ` <mailman.4338.1231428224.26697.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2009-01-08 15:24 UTC (permalink / raw)
  To: help-gnu-emacs

kidologie wrote:
> Hello - after upgrading to emacs22, I see that compile-internal is now
> obsolete - I need to use compilation-start.
> 
> What is the correct way to do this:
> 
>  (compile-internal (concat "nits -emacs" command)
> 		    "All done" "rt-nits" nil grep-regexp-alist)
> 
> using compilation-start?

Try

(compilation-start (concat "nits -emacs" command)
		   'grep-mode (lambda () "rt-nits"))

-- 
Kevin Rodgers
Denver, Colorado, USA





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Converting from compile-internal to compilation-start
       [not found] ` <mailman.4338.1231428224.26697.help-gnu-emacs@gnu.org>
@ 2009-01-08 20:38   ` kidologie
  2009-01-10  3:04     ` Kevin Rodgers
  0 siblings, 1 reply; 5+ messages in thread
From: kidologie @ 2009-01-08 20:38 UTC (permalink / raw)
  To: help-gnu-emacs

On Jan 8, 10:24 am, Kevin Rodgers <kevin.d.rodg...@gmail.com> wrote:
> kidologie wrote:
> > Hello - after upgrading to emacs22, I see that compile-internal is now
> > obsolete - I need to use compilation-start.
>
> > What is the correct way to do this:
>
> >  (compile-internal (concat "nits -emacs" command)
> >                "All done" "rt-nits" nil grep-regexp-alist)
>
> > using compilation-start?
>
> Try
>
> (compilation-start (concat "nits -emacs" command)
>                    'grep-mode (lambda () "rt-nits"))
>
> --
> Kevin Rodgers
> Denver, Colorado, USA

Hmm had problems:
compilation-buffer-name: Wrong number of arguments: #[nil "À‡" ["rt-
nits"] 1 "rt-nits"], 1

I did:

  (compilation-start (concat "/auto/eigrp/bin/nits -emacs " command)
		    nil #'(lambda (mode-name) "*rt-nits*"))

And that worked fine - I just pulled it as an example from the emacs
source - without understanding why it's happy.

Which brings me to another point with the new compilation-start - why
am I forced to enter a mode - as in your example - 'grep-mode? In my
cases I'm just kicking off a unix script under the covers and it
doesn't below to any particular mode..

Thanks!



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Converting from compile-internal to compilation-start
  2009-01-08 20:38   ` kidologie
@ 2009-01-10  3:04     ` Kevin Rodgers
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2009-01-10  3:04 UTC (permalink / raw)
  To: help-gnu-emacs

kidologie wrote:
> Hmm had problems:
> compilation-buffer-name: Wrong number of arguments: #[nil "À‡" ["rt-
> nits"] 1 "rt-nits"], 1
> 
> I did:
> 
>   (compilation-start (concat "/auto/eigrp/bin/nits -emacs " command)
> 		    nil #'(lambda (mode-name) "*rt-nits*"))
> 
> And that worked fine - I just pulled it as an example from the emacs
> source - without understanding why it's happy.

Oops, sorry for forgetting the mode-name argument.

> Which brings me to another point with the new compilation-start - why
> am I forced to enter a mode - as in your example - 'grep-mode? In my
> cases I'm just kicking off a unix script under the covers and it
> doesn't below to any particular mode..

The mode defines the regexp-alist used to match errors/hits/whatever you
want to navigate to via C-x `.

-- 
Kevin Rodgers
Denver, Colorado, USA





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-01-10  3:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-07 21:13 Converting from compile-internal to compilation-start kidologie
2009-01-08 15:18 ` kidologie
2009-01-08 15:24 ` Kevin Rodgers
     [not found] ` <mailman.4338.1231428224.26697.help-gnu-emacs@gnu.org>
2009-01-08 20:38   ` kidologie
2009-01-10  3:04     ` Kevin Rodgers

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.