all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs and Perl syntax compile
@ 2003-08-01 12:17 Harter, Douglas
  0 siblings, 0 replies; 6+ messages in thread
From: Harter, Douglas @ 2003-08-01 12:17 UTC (permalink / raw)


I am creating a good many Perl scripts on a Unix using emacs. 

Can someone tell me what I need in my .emacs to do Perl syntax compiles from
emacs and allow compilation mode to handle the errors?



.


.

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

* Re: Emacs and Perl syntax compile
       [not found] <mailman.837.1059744293.8231.help-gnu-emacs@gnu.org>
@ 2003-08-01 20:42 ` Kai Großjohann
  2003-08-21 12:57   ` Janusz S. Bień
  0 siblings, 1 reply; 6+ messages in thread
From: Kai Großjohann @ 2003-08-01 20:42 UTC (permalink / raw)


"Harter, Douglas" <dharter@state.pa.us> writes:

> Can someone tell me what I need in my .emacs to do Perl syntax compiles from
> emacs and allow compilation mode to handle the errors?

Perl syntax compiles?

Do you mean perl -c?  It ought to be sufficient to set the variable
compile-command, perhaps from a mode hook:

(defun douglas-perl-setup ()
  (setq compile-command (format "perl -c %s" (buffer-file-name))))
(add-hook 'perl-mode-hook 'douglas-perl-setup)

If you use cperl mode instead of perl mode, replace perl-mode-hook
with cperl-mode-hook.
-- 
~/.signature

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

* RE: Emacs and Perl syntax compile
@ 2003-08-07 13:42 andrew.maguire
  0 siblings, 0 replies; 6+ messages in thread
From: andrew.maguire @ 2003-08-07 13:42 UTC (permalink / raw)


I do this to set up C-c C-c to do the compile:

;;Compilation mode for perl files
(require 'compile)
(add-to-list 'compilation-error-regexp-alist '(".* \\([-a-zA-Z._/]+\\) line
\\([0-9]+\\)." 1 2))
(defun perl-compile (&optional prefix)
  "Compile perl file"
  (interactive "P")
  (let* ((include-path (if (eq window-system 'w32) "-I%SP%" "-I$SP")) 
	 (compile-command (concat "perl "include-path " -cw "
(buffer-file-name)))
	 (compilation-read-command prefix))
    (call-interactively 'compile)))
(require 'perl-mode)
(require 'cperl-mode)
(define-key perl-mode-map "\C-c\C-c" 'perl-compile)
(define-key cperl-mode-map "\C-c\C-c" 'perl-compile)


> -----Original Message-----
> From: Harter, Douglas [mailto:dharter@state.pa.us]
> Sent: 01 August 2003 13:17
> To: Help Emacs (E-mail)
> Subject: Emacs and Perl syntax compile
> 
> 
> I am creating a good many Perl scripts on a Unix using emacs. 
> 
> Can someone tell me what I need in my .emacs to do Perl 
> syntax compiles from
> emacs and allow compilation mode to handle the errors?
> 
> 
> 
> .
> 
> 
> .
> 
> 
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
> 

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

* Re: Emacs and Perl syntax compile
       [not found] <mailman.186.1060263856.29551.help-gnu-emacs@gnu.org>
@ 2003-08-12 16:37 ` Kevin Rodgers
  2003-08-12 16:58   ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Rodgers @ 2003-08-12 16:37 UTC (permalink / raw)


andrew.maguire@ps.ge.com wrote:

> I do this to set up C-c C-c to do the compile:
> 
> ;;Compilation mode for perl files
> (require 'compile)
> (add-to-list 'compilation-error-regexp-alist
> 	       '(".* \\([-a-zA-Z._/]+\\) line \\([0-9]+\\)." 1 2))

So far, so good.

> (defun perl-compile (&optional prefix)
>   "Compile perl file"
>   (interactive "P")
>   (let* ((include-path (if (eq window-system 'w32) "-I%SP%" "-I$SP")) 
> 	 (compile-command (concat "perl "include-path " -cw "
> (buffer-file-name)))
> 	 (compilation-read-command prefix))
>     (call-interactively 'compile)))

Why not just:

(add-hook 'perl-mode-hook
	  (lambda ()
	    (set (make-local-variable 'compile-command)
		 (format "perl %s -cw %s"
			 (if (eq window-system 'w32) "-I%SP%" "-I$SP")
			 (file-name-nondirectory buffer-file-name)))))

> (require 'perl-mode)
> (require 'cperl-mode)


Can perl-mode and cperl-mode be used simultaneously?

> (define-key perl-mode-map "\C-c\C-c" 'perl-compile)
> (define-key cperl-mode-map "\C-c\C-c" 'perl-compile)


When compile-command is buffer local, you can just bind a key to the
normal compile command.

-- 
Kevin Rodgers

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

* Re: Emacs and Perl syntax compile
  2003-08-12 16:37 ` Kevin Rodgers
@ 2003-08-12 16:58   ` Stefan Monnier
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2003-08-12 16:58 UTC (permalink / raw)


>> (require 'perl-mode)
>> (require 'cperl-mode)
> Can perl-mode and cperl-mode be used simultaneously?

At least in Emacs-CVS they can.


        Stefan

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

* Re: Emacs and Perl syntax compile
  2003-08-01 20:42 ` Kai Großjohann
@ 2003-08-21 12:57   ` Janusz S. Bień
  0 siblings, 0 replies; 6+ messages in thread
From: Janusz S. Bień @ 2003-08-21 12:57 UTC (permalink / raw)


"Harter, Douglas" <dharter@state.pa.us> writes:

> Can someone tell me what I need in my .emacs to do Perl syntax compiles from
> emacs and allow compilation mode to handle the errors?

There is `mode-compile.el', now at version 2.28 of 2003/04/01,
available from

        http://www.tls.cena.fr/~boubaker/Emacs/

I haven't tried it yet, but it is mentioned in cperl-mode
documentation:

        Note that to enable Compile choices in the menu you need to install
        mode-compile.el.

Regards

Janusz

-- 
                     ,   
dr hab. Janusz S. Bien, prof. UW
Prof. Janusz S. Bien, Warsaw Uniwersity
jsbien@mimuw.edu.pl, jsbien@uw.edu.pl
http://www.orient.uw.edu.pl/~jsbien/
http://www.mimuw.edu.pl/~jsbien/

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

end of thread, other threads:[~2003-08-21 12:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-07 13:42 Emacs and Perl syntax compile andrew.maguire
     [not found] <mailman.186.1060263856.29551.help-gnu-emacs@gnu.org>
2003-08-12 16:37 ` Kevin Rodgers
2003-08-12 16:58   ` Stefan Monnier
     [not found] <mailman.837.1059744293.8231.help-gnu-emacs@gnu.org>
2003-08-01 20:42 ` Kai Großjohann
2003-08-21 12:57   ` Janusz S. Bień
  -- strict thread matches above, loose matches on Subject: below --
2003-08-01 12:17 Harter, Douglas

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.