all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to enable <stdin> when run Perl in Emacs?
@ 2021-02-28 18:45 znavko--- via Users list for the GNU Emacs text editor
  2021-02-28 19:15 ` Dieter Klünter
  2021-03-03 18:20 ` znavko
  0 siblings, 2 replies; 4+ messages in thread
From: znavko--- via Users list for the GNU Emacs text editor @ 2021-02-28 18:45 UTC (permalink / raw)
  To: help-gnu-emacs

Hello, Emacs Help!
I tried to use Emacs Elpy for Python, and there was a simple way to run my code with just only C-c C-c. 
Standard input worked fine there, I could interact with my program in separate Emacs window.

I wish the same codeing on Perl in Emacs. I've installed Perl Development Environment from CPAN
and added lines into .emacs file. Perl highlights perfectly, but there are some inconvenience:

1. Running scripts is very slow, because I need to press 'C-c r', then Emacs ask 'would you like to save file', also it may ask me 'there is a process of compilation, do you want to kill it?'
Here i want just one single command torun my script without any question.

2. There is no possibility tointeract with my program in the Emacs window where my script is executing.
I found some hacks how to use <stdin> in PDE but that is for running scripts with Emacs from terminal, not from the window where I coding it.

Is there any comfortable Emacs module for Perl editing and debugging like Elpy for python?
This is my simple program that cannot get any input from the emacs window:
#!/usr/bin/env perl

use strict;
use warnings;
use feature 'say';

say 'Hello!';

print "How old are you?";
my $age = <>;
print "WOW! You are $age years old!";
This is my .emacs:

; One window mode
 (setq inhibit-startup-screen t)
;; perl mode pde
 (add-to-list 'load-path "~/elisp/pde/lisp")
 (load "pde-load")
;; python emacs-elpy
; (setq python-shell-interpreter "python3")
; (setq elpy-rpc-python-command "python3")
;(elpy-enable)
;; tab indent
;; set default tab char's display width to 4 spaces
(setq-default tab-width 4) ; emacs 23.1 to 26 default to 8

;; set current buffer's tab char's display width to 4 spaces
(setq tab-width 4)
;; BasicCustomization
(setq inhibit-startup-screen t) ;; disable welcome message
(global-linum-mode t) ;; enable line numbers globally
(setq linum-format "%4d u2502") ;; format line number spacing


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

* Re: How to enable <stdin> when run Perl in Emacs?
  2021-02-28 18:45 How to enable <stdin> when run Perl in Emacs? znavko--- via Users list for the GNU Emacs text editor
@ 2021-02-28 19:15 ` Dieter Klünter
  2021-03-03 18:20 ` znavko
  1 sibling, 0 replies; 4+ messages in thread
From: Dieter Klünter @ 2021-02-28 19:15 UTC (permalink / raw)
  To: znavko--- via Users list for the GNU Emacs text editor; +Cc: znavko

znavko--- via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

> Hello, Emacs Help!
> I tried to use Emacs Elpy for Python, and there was a simple way to
> run my code with just only C-c C-c.
> Standard input worked fine there, I could interact with my program in
> separate Emacs window.
>
> I wish the same codeing on Perl in Emacs. I've installed Perl
> Development Environment from CPAN
> and added lines into .emacs file. Perl highlights perfectly, but there
> are some inconvenience:
>
> 1. Running scripts is very slow, because I need to press 'C-c r', then
> Emacs ask 'would you like to save file', also it may ask me 'there is
> a process of compilation, do you want to kill it?'
> Here i want just one single command torun my script without any question.
>
> 2. There is no possibility tointeract with my program in the Emacs
> window where my script is executing.
> I found some hacks how to use <stdin> in PDE but that is for running
> scripts with Emacs from terminal, not from the window where I coding
> it.
>
> Is there any comfortable Emacs module for Perl editing and debugging
> like Elpy for python?
> This is my simple program that cannot get any input from the emacs window:
> #!/usr/bin/env perl
>
> use strict;
> use warnings;
> use feature 'say';
>
> say 'Hello!';
>
> print "How old are you?";
> my $age = <>;
> print "WOW! You are $age years old!";
> This is my .emacs:
>
> ; One window mode
>  (setq inhibit-startup-screen t)
> ;; perl mode pde
>  (add-to-list 'load-path "~/elisp/pde/lisp")
>  (load "pde-load")
> ;; python emacs-elpy
> ; (setq python-shell-interpreter "python3")
> ; (setq elpy-rpc-python-command "python3")
> ;(elpy-enable)
> ;; tab indent
> ;; set default tab char's display width to 4 spaces
> (setq-default tab-width 4) ; emacs 23.1 to 26 default to 8
>
> ;; set current buffer's tab char's display width to 4 spaces
> (setq tab-width 4)
> ;; BasicCustomization
> (setq inhibit-startup-screen t) ;; disable welcome message
> (global-linum-mode t) ;; enable line numbers globally
> (setq linum-format "%4d u2502") ;; format line number spacing

I use mode-compile, cperl-mode and PDE

(require 'pde)
(defalias 'perl-mode 'cperl-mode)
(setq cperl-hairy t)

mcpan install Emacs::PDE

-Dieter

--
Dieter Klünter | Directory Service
http://sys4.de
53°37'09,95"N
10°08'02,42"E
 



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

* Re: How to enable <stdin> when run Perl in Emacs?
  2021-02-28 18:45 How to enable <stdin> when run Perl in Emacs? znavko--- via Users list for the GNU Emacs text editor
  2021-02-28 19:15 ` Dieter Klünter
@ 2021-03-03 18:20 ` znavko
  2021-03-03 20:26   ` Stefan Monnier
  1 sibling, 1 reply; 4+ messages in thread
From: znavko @ 2021-03-03 18:20 UTC (permalink / raw)
  To: Dieter Klünter,
	znavko--- via Users list for the GNU Emacs text editor

Thank you!

mode-compile has old-style quotes, and emacs says:

Loading mode-compile.el: old-style backquotes detected!

But this is the main thing I wish to have - useful compiler of Perl in emacs.


February 28, 2021 10:24 PM, "Dieter Klünter" <dieter@dkluenter.de> wrote:

> znavko--- via Users list for the GNU Emacs text editor
> <help-gnu-emacs@gnu.org> writes:
> 
>> Hello, Emacs Help!
>> I tried to use Emacs Elpy for Python, and there was a simple way to
>> run my code with just only C-c C-c.
>> Standard input worked fine there, I could interact with my program in
>> separate Emacs window.
>> 
>> I wish the same codeing on Perl in Emacs. I've installed Perl
>> Development Environment from CPAN
>> and added lines into .emacs file. Perl highlights perfectly, but there
>> are some inconvenience:
>> 
>> 1. Running scripts is very slow, because I need to press 'C-c r', then
>> Emacs ask 'would you like to save file', also it may ask me 'there is
>> a process of compilation, do you want to kill it?'
>> Here i want just one single command torun my script without any question.
>> 
>> 2. There is no possibility tointeract with my program in the Emacs
>> window where my script is executing.
>> I found some hacks how to use <stdin> in PDE but that is for running
>> scripts with Emacs from terminal, not from the window where I coding
>> it.
>> 
>> Is there any comfortable Emacs module for Perl editing and debugging
>> like Elpy for python?
>> This is my simple program that cannot get any input from the emacs window:
>> #!/usr/bin/env perl
>> 
>> use strict;
>> use warnings;
>> use feature 'say';
>> 
>> say 'Hello!';
>> 
>> print "How old are you?";
>> my $age = <>;
>> print "WOW! You are $age years old!";
>> This is my .emacs:
>> 
>> ; One window mode
>> (setq inhibit-startup-screen t)
>> ;; perl mode pde
>> (add-to-list 'load-path "~/elisp/pde/lisp")
>> (load "pde-load")
>> ;; python emacs-elpy
>> ; (setq python-shell-interpreter "python3")
>> ; (setq elpy-rpc-python-command "python3")
>> ;(elpy-enable)
>> ;; tab indent
>> ;; set default tab char's display width to 4 spaces
>> (setq-default tab-width 4) ; emacs 23.1 to 26 default to 8
>> 
>> ;; set current buffer's tab char's display width to 4 spaces
>> (setq tab-width 4)
>> ;; BasicCustomization
>> (setq inhibit-startup-screen t) ;; disable welcome message
>> (global-linum-mode t) ;; enable line numbers globally
>> (setq linum-format "%4d u2502") ;; format line number spacing
> 
> I use mode-compile, cperl-mode and PDE
> 
> (require 'pde)
> (defalias 'perl-mode 'cperl-mode)
> (setq cperl-hairy t)
> 
> mcpan install Emacs::PDE
> 
> -Dieter
> 
> --
> Dieter Klünter | Directory Service
> http://sys4.de
> 53°37'09,95"N
> 10°08'02,42"E



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

* Re: How to enable <stdin> when run Perl in Emacs?
  2021-03-03 18:20 ` znavko
@ 2021-03-03 20:26   ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2021-03-03 20:26 UTC (permalink / raw)
  To: help-gnu-emacs

> mode-compile has old-style quotes, and Emacs says:
> Loading mode-compile.el: old-style backquotes detected!

Then you need to take that `mode-compile.el` and adjust it so it uses the
new style backquote syntax.  The old-style syntax has been obsolete for
about 20 years and doesn't work any more in Emacs≥27.

Of course, there's a good chance that what you want to do with
`mode-compile.el` can be done without it, tho.

> But this is the main thing I wish to have - useful compiler of Perl
> in Emacs.

Sorry, but I don't know what that means.  If you can describe your need
in a different way (like: "I want that when I open a file FOO and then
hit keys BAR and BAZ I get some new file FOOBAR is generated by running
command `BAR --on FOO` and some diagnostics is displayed in buffer
*BOOFAR*").


        Stefan




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

end of thread, other threads:[~2021-03-03 20:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-28 18:45 How to enable <stdin> when run Perl in Emacs? znavko--- via Users list for the GNU Emacs text editor
2021-02-28 19:15 ` Dieter Klünter
2021-03-03 18:20 ` znavko
2021-03-03 20:26   ` Stefan Monnier

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.