What does 'run' do in cperl-mode?
flag
Messages 1 - 10 of 86 - Collapse all
/groups/adfetch?adid=Py1dxBAAAABwKY1ZQ8i2IgsT6P-ZnS2G
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
1.  formido  
View profile  
 More options Jul 24 2008, 1:36 pm
Newsgroups: gnu.emacs.help
From: formido <form...@gmail.com>
Date: Thu, 24 Jul 2008 10:36:02 -0700 (PDT)
Local: Thurs, Jul 24 2008 1:36 pm
Subject: What does 'run' do in cperl-mode?
So, I've got:

print "Hello World\n";

... in the buffer and it's saved. I can use the debugger command to
run it. Strangely to me, 'run' is disabled. What does 'run' do? In
other IDEs I've used, I type some code, then I either compile or don't
depending on the language, and then I run. What's different here?

More generally, when confronted by a menu command, how can I easily go
to its definition?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
2.  formido  
View profile  
 More options Jul 24 2008, 11:02 pm
Newsgroups: gnu.emacs.help
From: formido <form...@gmail.com>
Date: Thu, 24 Jul 2008 20:02:26 -0700 (PDT)
Local: Thurs, Jul 24 2008 11:02 pm
Subject: Re: What does 'run' do in cperl-mode?
On Jul 24, 10:36 am, formido <form...@gmail.com> wrote:

> So, I've got:

> print "Hello World\n";

> ... in the buffer and it's saved. I can use the debugger command to
> run it. Strangely to me, 'run' is disabled. What does 'run' do? In
> other IDEs I've used, I type some code, then I either compile or don't
> depending on the language, and then I run. What's different here?

> More generally, when confronted by a menu command, how can I easily go
> to its definition?

And I found the answer to the first question, buried in cperl's page
at emacswiki: Apparently you have to install something called Mode
Compile.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
3.  Xah  
View profile  
 More options Jul 25 2008, 10:55 am
Newsgroups: gnu.emacs.help
From: Xah <xah...@gmail.com>
Date: Fri, 25 Jul 2008 07:55:29 -0700 (PDT)
Local: Fri, Jul 25 2008 10:55 am
Subject: Re: What does 'run' do in cperl-mode?
On Jul 24, 10:36 am, formido <form...@gmail.com> wrote:

> So, I've got:

> print "Hello World\n";

> ... in the buffer and it's saved. I can use the debugger command to
> run it. Strangely to me, 'run' is disabled. What does 'run' do? In
> other IDEs I've used, I type some code, then I either compile or don't
> depending on the language, and then I run. What's different here?

I don't know. But you can run it by typing Alt+x shell-command
(shortcut Alt+x !) then type “perl ‹filename›”.

Or, you can write a short elisp so that pressing a key will run the
program in current buffer.

(defun run-current-file ()
  "Execute or compile the current file.
For example, if the current buffer is the file x.pl,
then it'll call “perl x.pl” in a shell.
The file can be php, perl, python, bash, java.
File suffix is used to determine what program to run."
(interactive)
  (let (ext-map file-name file-ext prog-name cmd-str)
; get the file name
; get the program name
; run it
    (setq ext-map
          '(
            ("php" . "php")
            ("pl" . "perl")
            ("py" . "python")
            ("sh" . "bash")
            ("java" . "javac")
            )
          )
    (setq file-name (buffer-file-name))
    (setq file-ext (file-name-extension file-name))
    (setq prog-name (cdr (assoc file-ext ext-map)))
    (setq cmd-str (concat prog-name " " file-name))
    (shell-command cmd-str)))

(global-set-key (kbd "<f7>") 'run-current-file)

for detail, see:
http://xahlee.org/emacs/elisp_run_current_file.html

> More generally, when confronted by a menu command, how can I easily go
> to its definition?

Type Alt+x describe-key, then pull the menu. Then, you'll get the
command name run by that menu. Then, type Alt+x describe-function.
It'll pop up the online doc of the function with link to the source
code where the function is defined.

  Xah
http://xahlee.org/



 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
4.  Ted Zlatanov  
View profile  
 More options Jul 25 2008, 12:41 pm
Newsgroups: gnu.emacs.help
From: Ted Zlatanov <t...@lifelogs.com>
Date: Fri, 25 Jul 2008 11:41:51 -0500
Local: Fri, Jul 25 2008 12:41 pm
Subject: Re: What does 'run' do in cperl-mode?
On Fri, 25 Jul 2008 07:55:29 -0700 (PDT) Xah <xah...@gmail.com> wrote:

X> But you can run it by typing Alt+x shell-command (shortcut Alt+x !)

Please note that Alt is not the preferred prefix name for Emacs
purposes.  It's Meta, abbreviated M (e.g. M-x), for two reasons:

1) Meta can be mapped to keys other than Alt

2) Meta can be invoked with ESC as well, which is very handy in a
terminal session (I actually use ESC all the time even in a graphical
session)

Ted


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
5.  Xah  
View profile  
 More options Jul 25 2008, 5:55 pm
Newsgroups: gnu.emacs.help
From: Xah <xah...@gmail.com>
Date: Fri, 25 Jul 2008 14:55:48 -0700 (PDT)
Local: Fri, Jul 25 2008 5:55 pm
Subject: Re: What does 'run' do in cperl-mode?
On Jul 25, 9:41 am, Ted Zlatanov <t...@lifelogs.com> wrote:

> On Fri, 25 Jul 2008 07:55:29 -0700 (PDT)Xah<xah...@gmail.com> wrote:

> X> But you can run it by typing Alt+x shell-command (shortcut Alt+x !)

> Please note that Alt is not the preferred prefix name for Emacs
> purposes.  It's Meta, abbreviated M (e.g. M-x), for two reasons:

> 1) Meta can be mapped to keys other than Alt

> 2) Meta can be invoked with ESC as well, which is very handy in a
> terminal session (I actually use ESC all the time even in a graphical
> session)

> Ted

Thanks for the info, i think it's good to know.

Here're some reason i think emacs should adopt the Alt+‹key› or
Alt-‹key› notation throughout its documentation.

• The Alt+‹key› or Alt-‹key› notation is universal among Windows and
Linux. Which accounts for about 95% of personal computers used word
wide. (Apple's computers, which account for about %4 marke share
today, also support the Alt key on their keyboards, and OSX's
documentation also use ‹modifier›-‹key› notation. Aquamacs, perhaps
the most widely used emacs distro on OSX, by default has Alt for Meta
too.) (Note that Microsoft Windows used to use the Alt-‹key› notation.
Only in recent years they changed to the Alt+‹key› notation. Arguably,
this is a good change.)

• The Meta name isn't in some linguistic sense superior that covers
different modifier keys on different OSes. It was one of the modifier
key on obsolete keyboards used by lisp machines in the 1980s.

• By default on all major OSes in use (Windows and Linux and OSX),
emacs maps its Meta to Alt key. So, practically speaking, it works
that way.

• Historically, a “Meta+‹key›” shortcut in emacs can also be invoked
by “Esc ‹key›” or “Ctrl+[”. The design was that way mostly because at
the time, many terminals do not have or support the Meta key, and
Terminal is a primary application in computer use in the 1980s. Today,
perhaps all terminal/console/“command line interface” apps support
Meta as Alt either by default or in a preference setting.

• The ability of pressing Esc for Meta might be still useful for some
people. Users who needed that feature could easily read about it in
emacs doc. (I myself used “esc ‹key›” exclusively during 1998-2004,
mostly because it was a one-brainless solution that works on all
telnet apps regardless of hardware, OS, or setup, and i frequently
need to use different machine, OS, or remote servers. Today, i dont
think i ever press Esc ‹key› for Meta+‹key›)

• A argument from user interface perspective, is that multiple
insignificant options are not good because it increases complexity and
causes the user to sidetrack their focus on tasks. KDE and Gnome,
solved this problem for linuxes by adopting wholesale Microsoft
Window's interface starting about 1998. (before KDE and Gnome, GUI
apps on unix use a variety of “Windows Managers” that has incompatible
User Interfaces.)

For some detail related to the Meta key, see:
“Why Emacs's Keyboard Shortcuts Are Painful”
http://xahlee.org/emacs/emacs_kb_shortcuts_pain.html

  Xah
http://xahlee.org/



 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
6.  Lennart Borgman (gmail)  
View profile  
 More options Jul 25 2008, 8:33 pm
Newsgroups: gnu.emacs.help
From: "Lennart Borgman (gmail)" <lennart.borg...@gmail.com>
Date: Sat, 26 Jul 2008 02:33:41 +0200
Local: Fri, Jul 25 2008 8:33 pm
Subject: Re: What does 'run' do in cperl-mode?

Why should the documentation call Meta for Alt when it is not Alt? In
for example the patched version of Emacs+EmacsW32 it is possible to use
left and/or right windows keys as Meta. I guess a lot of people do that.

The advantage is that you can use the menus the same way as you are used
to in other w32 programs.

I think it is much better to clearly tell new users the distinction.
They will need to know it at least on w32 from the beginning, cause
otherwise they will get confused by that the menus does not work (if
they use Alt as Meta).


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
7.  Xah  
View profile  
 More options Jul 25 2008, 9:41 pm
Newsgroups: gnu.emacs.help
From: Xah <xah...@gmail.com>
Date: Fri, 25 Jul 2008 18:41:59 -0700 (PDT)
Local: Fri, Jul 25 2008 9:41 pm
Subject: Re: What does 'run' do in cperl-mode?
On Jul 25, 5:33 pm, "Lennart Borgman (gmail)"

<lennart.borg...@gmail.com> wrote:
> Why should the documentation call Meta for Alt when it is not Alt? In
> for example the patched version of Emacs+EmacsW32 it is possible to use
> left and/or right windows keys as Meta. I guess a lot of people do that.

Standard and familiarity is important. Going by tech details, each app
will argue about the superiority of their terminology to no ends.

For example, Linux's KDE and Gnome largely adated all Windows's terms.
Left mouse button, right mouse button, instead of some 1st button or
2nd button (which emacs still use). Desktop, instad of various “Window
Managers” or “File managers” (or Directory Editor in older days).
Keyboard shortcut, as apposed to keybinding. File alias or File
shortcut, as opposed to Hard Link, Soft Link. Folders, as opposed to
Directory. File names, as opposed to File ID (older unix term)... etc.

Bottom line is that words and terms change with time, in computing as
well in science. Most tech geekers likes to associate “modern” with
“Microsoft” which they hate. But if we want to be hardcore, lots of
emacs's terms is invented by itself and not logical.

The following is a excerpt from the Wikipedia article on Common User
Access↗:

-------------------

    CUA was a detailed specification and set strict rules about how
applications should look and function. Its aim was in part to bring
about harmony between MS-DOS applications, which until then had
implemented totally different user interfaces.

    Examples:

        * In WordPerfect, the command to open a file was [F7], [3].
        * In Lotus 1-2-3, a file was opened with [/] (to open the
menus), [W] (for Workspace), [R] (for Retrieve).
        * In Microsoft Word, a file was opened with [Esc] (to open the
menus), [T] (for Transfer), [L] (for Load).
        * In WordStar, it was [Ctrl]+[K]+[O].
        * In Emacs, a file was opened with [Ctrl]+[x] followed by
[Ctrl]+[f] (for find-file).

    Some programs used [Esc] to cancel an action, some used it to
complete one; WordPerfect used it to repeat a character. Some programs
used [End] to go to the end of a line, some used it to complete
filling in a form. [F1] was often help but in WordPerfect that was
[F3]. [Ins] sometimes toggled between overtype and inserting
characters, but some programs used it for “paste”.

    Thus, every program had to be learned individually and its
complete user interface memorized. It was a sign of expertise to have
learned the UIs of dozens of applications, since a novice user facing
a new program would find their existing knowledge of a similar
application absolutely no use whatsoever.

-------------------

Who is to say, that the DOS era (~1990) of Microsoft Word's system of
shortcuts is not consistent and superior and more extensible than the
modern Ctrl+‹key› ones? Heck, it even used the words “Transfer” and
“Load”, which describes the technical detail of what's happening more
correctly than the popular “Open”.

-------------------

The purpose of a standard, or standard terminology and notation, is so
that everyone understands it without having to spend time on app xyz.
There are always drawbacks with one particular way, but overall
standards do good for all.

> The advantage is that you can use the menus the same way as you are used
> to in other w32 programs.

> I think it is much better to clearly tell new users the distinction.
> They will need to know it at least on w32 from the beginning, cause
> otherwise they will get confused by that the menus does not work (if
> they use Alt as Meta).

Emacs features remains they are. Any user can easily learn and use all
the features as before.

-----------------------

Even technically, Meta is just wrong. There is no Meta key except Sun
Microsystem's keyboard with perhaps 0.0001% market share.

Emacs did not adapt the changing landscape of computing industry, and
emacs suffers greatly for it today, with dwindling user base (possibly
just 1% of professional programers) while all sort of less power IDEs
and editors sprang up even today (e.g. in recent years TextMate ($63
USD)) with large number of enthuisastic users who basically has no
idea what power or flexiblity emacs has.

PS previous post on “Emacs's M-‹key› Notation vs Alt+‹key› Notation”
is now archived here:
 http://xahlee.org/emacs/modernization_meta_key.html

  Xah
http://xahlee.org/



 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
8.  Florian Beck  
View profile  
 More options Jul 25 2008, 8:05 pm
Newsgroups: gnu.emacs.help
From: Florian Beck <abstrakt...@t-online.de>
Date: Sat, 26 Jul 2008 02:05:37 +0200
Local: Fri, Jul 25 2008 8:05 pm
Subject: Re: What does 'run' do in cperl-mode?

Xah <xah...@gmail.com> writes:
> • The Meta name isn't in some linguistic sense superior that covers
> different modifier keys on different OSes. It was one of the modifier
> key on obsolete keyboards used by lisp machines in the 1980s.

Actually, Meta is the name X11 gives to one of the modifier keys. Others
are control, alt, super and hyper.

The problem with your suggestion is that while on some keyboards the key
that has ALT written on it is the one meant in Emacs by Meta, calling
Meta Alt in the documentation would be endlessly confusing for people
who make use of X for their keybindings.
--
Florian Beck


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
9.  Xah  
View profile  
 More options Jul 25 2008, 10:04 pm
Newsgroups: gnu.emacs.help
From: Xah <xah...@gmail.com>
Date: Fri, 25 Jul 2008 19:04:03 -0700 (PDT)
Local: Fri, Jul 25 2008 10:04 pm
Subject: Re: What does 'run' do in cperl-mode?
Xah writes:

«The Meta name isn't in some linguistic sense superior that covers
different modifier keys on different OSes. It was one of the modifier
key on obsolete keyboards used by lisp machines in the 1980s.»

On Jul 25, 5:05 pm, Florian Beck wrote:
«Actually, Meta is the name X11 gives to one of the modifier keys.
Others are control, alt, super and hyper.»

I am sure Lisp Machine's keyboards predate X11. One way to start
research on this is to look at Wikipedia.

Unless, you actually have knowledge in the history of the subject. In
that case, sorry. Please give us more detail, i'm interested to know
about the origin of the Meta personally.

Thanks.

  Xah
http://xahlee.org/



 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
10.  Nikolaj Schumacher  
View profile  
 More options Jul 28 2008, 7:42 am
Newsgroups: gnu.emacs.help
From: Nikolaj Schumacher <n_schumac...@web.de>
Date: Mon, 28 Jul 2008 13:42:00 +0200
Subject: Re: What does 'run' do in cperl-mode?

Xah <xah...@gmail.com> wrote:
> Here're some reason i think emacs should adopt the Alt+‹key› or
> Alt-‹key› notation throughout its documentation.

This mailing list is not for feature suggestions or bug reports.

regards,
Nikolaj Schumacher


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2012 Google