From: znavko--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: How to enable <stdin> when run Perl in Emacs?
Date: Sun, 28 Feb 2021 18:45:28 +0000 [thread overview]
Message-ID: <a4b9a3e0388b603139dc5dc1cc6565b9@disroot.org> (raw)
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
next reply other threads:[~2021-02-28 18:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-28 18:45 znavko--- via Users list for the GNU Emacs text editor [this message]
2021-02-28 19:15 ` How to enable <stdin> when run Perl in Emacs? Dieter Klünter
2021-03-03 18:20 ` znavko
2021-03-03 20:26 ` Stefan Monnier
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a4b9a3e0388b603139dc5dc1cc6565b9@disroot.org \
--to=help-gnu-emacs@gnu.org \
--cc=znavko@disroot.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).