all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Emacs and Perl syntax compile
Date: Tue, 12 Aug 2003 10:37:31 -0600	[thread overview]
Message-ID: <3F3917CB.70900@yahoo.com> (raw)
In-Reply-To: mailman.186.1060263856.29551.help-gnu-emacs@gnu.org

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

       reply	other threads:[~2003-08-12 16:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.186.1060263856.29551.help-gnu-emacs@gnu.org>
2003-08-12 16:37 ` Kevin Rodgers [this message]
2003-08-12 16:58   ` Emacs and Perl syntax compile Stefan Monnier
2003-08-07 13:42 andrew.maguire
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F3917CB.70900@yahoo.com \
    --to=ihs_4664@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.