help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: perl-mode


From: Kevin Rodgers
Subject: Re: perl-mode
Date: Mon, 28 Feb 2005 12:26:12 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Dietmar Kehr wrote:
> On Sat, 26 Feb 2005 18:50:40 +0100, Peter J. Acklam wrote:
>
>>but you could always use
>>
>>   C-x h M-| p e r l RET

I would suggest:

(add-hook 'perl-mode-hook
          (lambda ()
            (set (make-local-variable 'compile-command)
                 (format "perl %s"
                         (file-name-nondirectory buffer-file-name)))))

and then `M-x compile', which gives you a *compilation* buffer whose
error messges you can navigate (instead of a *Shell Command Output*
buffer).

> It doesn't work :-(
> Can someone explain this construction?

,----[ C-h k C-x h ]
| C-x h runs the command mark-whole-buffer
|    which is an interactive compiled Lisp function in `simple'.
| (mark-whole-buffer)
|
| Put point at beginning and mark at end of buffer.
| You probably should not use this function in Lisp programs;
| it is usually a mistake for a Lisp function to use any subroutine
| that uses or sets the mark.
`----
u
,----[ C-h k M-| ]
| M-| runs the command shell-command-on-region
|    which is an interactive compiled Lisp function in `simple'.
| (shell-command-on-region START END COMMAND &optional OUTPUT-BUFFER REPLACE ERROR-BUFFER)
|
| Execute string COMMAND in inferior shell with region as input.
| Normally display output (if any) in temp buffer `*Shell Command Output*';
| Prefix arg means replace the region with it.  Return the exit code of
| COMMAND.
|
| To specify a coding system for converting non-ASCII characters
| in the input and output to the shell command, use C-x RET c
| before this command.  By default, the input (from the current buffer)
| is encoded in the same coding system that will be used to save the file,
| `buffer-file-coding-system'. If the output is going to replace the region,
| then it is decoded from that same coding system.
|
| The noninteractive arguments are START, END, COMMAND, OUTPUT-BUFFER,
| REPLACE, ERROR-BUFFER.  Noninteractive callers can specify coding
| systems by binding `coding-system-for-read' and
| `coding-system-for-write'.
|
| If the output is short enough to display in the echo area (which is
| determined by the variable `max-mini-window-height' if
| `resize-mini-windows' is non-nil), it is shown there, but it is
| nonetheless available in buffer `*Shell Command Output*' even though
| that buffer is not automatically displayed.  If there is no output, or
| if output is inserted in the current buffer, then `*Shell Command
| Output*' is deleted.
|
| If the optional fourth argument OUTPUT-BUFFER is non-nil,
| that says to put the output in some other buffer.
| If OUTPUT-BUFFER is a buffer or buffer name, put the output there.
| If OUTPUT-BUFFER is not a buffer and not nil,
| insert output in the current buffer.
| In either case, the output is inserted after point (leaving mark after it).
|
| If REPLACE, the optional fifth argument, is non-nil, that means insert
| the output in place of text from START to END, putting point and mark
| around it.
|
| If optional sixth argument ERROR-BUFFER is non-nil, it is a buffer
| or buffer name to which to direct the command's standard error output.
| If it is nil, error output is mingled with regular output.
| In an interactive call, the variable `shell-command-default-error-buffer'
| specifies the value of ERROR-BUFFER.
`----

--
Kevin Rodgers

reply via email to

[Prev in Thread] Current Thread [Next in Thread]