all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* perl-mode.el file in Mac OS X
@ 2005-02-02  3:54 Nicholas Tamara
  2005-02-02  8:54 ` Ismael Valladolid Torres
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Nicholas Tamara @ 2005-02-02  3:54 UTC (permalink / raw)


Hello,

Can anyone point me to the right location to place the perl-mod.el
file so that the emacs that comes with Mac OS X recognizes .pl files
as Perl script files? Thanks.

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

* Re: perl-mode.el file in Mac OS X
  2005-02-02  3:54 perl-mode.el file in Mac OS X Nicholas Tamara
@ 2005-02-02  8:54 ` Ismael Valladolid Torres
  2005-02-02  9:39 ` Peter Dyballa
       [not found] ` <mailman.448.1107338600.2841.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 9+ messages in thread
From: Ismael Valladolid Torres @ 2005-02-02  8:54 UTC (permalink / raw)
  Cc: help-gnu-emacs

Nicholas Tamara escribe:
> Can anyone point me to the right location to place the perl-mod.el
> file so that the emacs that comes with Mac OS X recognizes .pl files
> as Perl script files? Thanks.

Not exactly perl-mod.el related, but these snippets in your .emacs
should work with any similar package:

(add-to-list 'load-path (expand-file-name "~/.elisp"))

Put perl-mod.el inside ~/.elisp, then add also:

(if (load "perl-mod" 't)
    (setq
     auto-mode-alist
     (cons '("\\.pl$" . post-mode) auto-mode-alist)))

If later you byte-compile perl-mod, then instead this will use the
faster-loading resulting .elc file.

EmacsWiki is your friend!

Cordially, Ismael

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

* Re: perl-mode.el file in Mac OS X
  2005-02-02  3:54 perl-mode.el file in Mac OS X Nicholas Tamara
  2005-02-02  8:54 ` Ismael Valladolid Torres
@ 2005-02-02  9:39 ` Peter Dyballa
       [not found] ` <mailman.448.1107338600.2841.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2005-02-02  9:39 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 02.02.2005 um 04:54 schrieb Nicholas Tamara:

> Hello,
>
> Can anyone point me to the right location to place the perl-mod.el
> file so that the emacs that comes with Mac OS X recognizes .pl files
> as Perl script files? Thanks.

It's not the Elisp file that you have to put anywhere -- it's probably 
right now in a place that Emacs searches. You can check that with "C-h 
v load-path" and then check that you to have

/usr/share/emacs/21.2/lisp/progmodes/cperl-mode.el
/usr/share/emacs/21.2/lisp/progmodes/perl-mode.el


What you need to do is to either "(require 'perl-mode)" actively or to 
set auto-mode-alist in a manner like this (to have only one place where 
you augment this list):

(setq auto-mode-alist
   (append
     '(("\\.xsl$"       . sgml-mode)
       ("\\.plist$"     . sgml-mode)
       ("\\.idd$"       . sgml-mode)
       ("\\.ide$"       . sgml-mode)
       ("\\.xml$"       . xml-mode)
       ("\\.xsl$"       . xml-mode)
       ("\\.fo$"        . xml-mode)
       ("\\.nw$"        . noweb-mode)
       ("\\.f90$"       . f90-mode)
       ("\\.pl$"        . perl-mode)
       ("\\.pod$"       . perl-mode)
       ("\\.tgz$"       . tar-mode)
       ("\\.tar\\.bz2$" . tar-mode)
       ("\\.tar\\.gz$"  . tar-mode))
   auto-mode-alist))

------------------------------- Info --------------------------------
There is an Emacs list for Mac OS X users too:

List Post: <mailto:macosx-emacs@email.esm.psu.edu>
List Archives: <http://www.esm.psu.edu/mac-tex/MacOSX-Emacs-Digests/>

--
Greetings

   Pete

Either this man is dead or my watch has stopped. - Groucho Marx

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

* Re: perl-mode.el file in Mac OS X
       [not found] ` <mailman.448.1107338600.2841.help-gnu-emacs@gnu.org>
@ 2005-02-02 14:58   ` Stefan Monnier
  2005-02-02 15:40     ` Ismael Valladolid Torres
                       ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Stefan Monnier @ 2005-02-02 14:58 UTC (permalink / raw)


> (setq auto-mode-alist
>    (append
>      '(("\\.xsl$"       . sgml-mode)
>        ("\\.plist$"     . sgml-mode)
>        ("\\.idd$"       . sgml-mode)
>        ("\\.ide$"       . sgml-mode)
>        ("\\.xml$"       . xml-mode)
>        ("\\.xsl$"       . xml-mode)
>        ("\\.fo$"        . xml-mode)
>        ("\\.nw$"        . noweb-mode)
>        ("\\.f90$"       . f90-mode)
>        ("\\.pl$"        . perl-mode)
>        ("\\.pod$"       . perl-mode)
>        ("\\.tgz$"       . tar-mode)
>        ("\\.tar\\.bz2$" . tar-mode)
>        ("\\.tar\\.gz$"  . tar-mode))
>    auto-mode-alist))

IIRC, the problem with the .pl extension is that it's used both for Perl and
Prolog files, so I recommend people avoid it and use one of the many other
possible extensions, such as ".perl".

Oh and BTW, while I'm posting a useless message, I might as well use
<anal-mode> and point out that the above regexps should be "\\.xsl\\'",
"\\.plist\\'", ..., "\\.pl\\'", ..., "\\.tar\\.gz\\'" (i.e. replace $ with
\\' because $ would also match an embedded newline in a file name whereas
\\' really only matches the end of the file name).

If you feel like shortening such a list, you can also use things like:

(setq auto-mode-alist
   (append
     '(("\\.\\(xsl\\|plist\\|id[de]\\)\\'"     . sgml-mode)
       ("\\.\\(xml\\|xsl\\|fo\\)\\'"           . xml-mode)
       ("\\.nw\\'"                             . noweb-mode)
       ("\\.f90\\'"                            . f90-mode)
       ("\\.\\(pl\\|pod\\)\\'"                 . perl-mode)
       ("\\.\\(tgz\\|tar.\\(gz\\|bz2\\)\\)\\'" . tar-mode))
     auto-mode-alist))


-- Stefan

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

* Re: perl-mode.el file in Mac OS X
  2005-02-02 14:58   ` Stefan Monnier
@ 2005-02-02 15:40     ` Ismael Valladolid Torres
  2005-02-02 16:01     ` David Kastrup
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Ismael Valladolid Torres @ 2005-02-02 15:40 UTC (permalink / raw)
  Cc: help-gnu-emacs

Stefan Monnier escribe:
>        ("\\.\\(tgz\\|tar.\\(gz\\|bz2\\)\\)\\'" . tar-mode))

This one can be made even shorter. Left as an exercise to the
reader. =:)

Cordially, Ismael

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

* Re: perl-mode.el file in Mac OS X
  2005-02-02 14:58   ` Stefan Monnier
  2005-02-02 15:40     ` Ismael Valladolid Torres
@ 2005-02-02 16:01     ` David Kastrup
  2005-02-02 16:12       ` **Re: " Ismael Valladolid Torres
  2005-02-02 18:05     ` Peter Dyballa
       [not found]     ` <mailman.557.1107368636.2841.help-gnu-emacs@gnu.org>
  3 siblings, 1 reply; 9+ messages in thread
From: David Kastrup @ 2005-02-02 16:01 UTC (permalink / raw)


Stefan Monnier <monnier@iro.umontreal.ca> writes:

> If you feel like shortening such a list, you can also use things like:
>
> (setq auto-mode-alist
>    (append
>      '(("\\.\\(xsl\\|plist\\|id[de]\\)\\'"     . sgml-mode)
>        ("\\.\\(xml\\|xsl\\|fo\\)\\'"           . xml-mode)
>        ("\\.nw\\'"                             . noweb-mode)
>        ("\\.f90\\'"                            . f90-mode)
>        ("\\.\\(pl\\|pod\\)\\'"                 . perl-mode)
>        ("\\.\\(tgz\\|tar.\\(gz\\|bz2\\)\\)\\'" . tar-mode))
>      auto-mode-alist))

I don't think a file named woozle.tarigz should trigger tar-mode.  And
regexp-opt suggests

"\\.t\\(?:ar\\.\\(?:bz2\\|gz\\)\\|gz\\)\\'"

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* **Re: perl-mode.el file in Mac OS X
  2005-02-02 16:01     ` David Kastrup
@ 2005-02-02 16:12       ` Ismael Valladolid Torres
  0 siblings, 0 replies; 9+ messages in thread
From: Ismael Valladolid Torres @ 2005-02-02 16:12 UTC (permalink / raw)
  Cc: help-gnu-emacs

David Kastrup escribe:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 
> > If you feel like shortening such a list, you can also use things like:
> >
> > (setq auto-mode-alist
> >    (append
> >      '(("\\.\\(xsl\\|plist\\|id[de]\\)\\'"     . sgml-mode)
> >        ("\\.\\(xml\\|xsl\\|fo\\)\\'"           . xml-mode)
> >        ("\\.nw\\'"                             . noweb-mode)
> >        ("\\.f90\\'"                            . f90-mode)
> >        ("\\.\\(pl\\|pod\\)\\'"                 . perl-mode)
> >        ("\\.\\(tgz\\|tar.\\(gz\\|bz2\\)\\)\\'" . tar-mode))
> >      auto-mode-alist))
> 
> I don't think a file named woozle.tarigz should trigger tar-mode.

A file with such a stupid name would hang Emacs anyway. :o)

Cordially, Ismael

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

* Re: perl-mode.el file in Mac OS X
  2005-02-02 14:58   ` Stefan Monnier
  2005-02-02 15:40     ` Ismael Valladolid Torres
  2005-02-02 16:01     ` David Kastrup
@ 2005-02-02 18:05     ` Peter Dyballa
       [not found]     ` <mailman.557.1107368636.2841.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2005-02-02 18:05 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 02.02.2005 um 15:58 schrieb Stefan Monnier:

> Oh and BTW, while I'm posting a useless message, I might as well use
> <anal-mode> and point out that the above regexps should be "\\.xsl\\'",
> "\\.plist\\'", ..., "\\.pl\\'", ..., "\\.tar\\.gz\\'" (i.e. replace $ 
> with
> \\' because $ would also match an embedded newline in a file name 
> whereas
> \\' really only matches the end of the file name).

Ah, that's good news! I've seen a few times this "...\\'" and wondered 
what it might mean.

Thank you for making my evening brighter!

--
Greetings

   Pete

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

* Re: perl-mode.el file in Mac OS X
       [not found]     ` <mailman.557.1107368636.2841.help-gnu-emacs@gnu.org>
@ 2005-02-03  3:53       ` Stefan Monnier
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2005-02-03  3:53 UTC (permalink / raw)


> Ah, that's good news! I've seen a few times this "...\\'" and wondered what
> it might mean.

Instead, you could have looked up the "regular expressions" node in
the manual.


        Stefan

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

end of thread, other threads:[~2005-02-03  3:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-02  3:54 perl-mode.el file in Mac OS X Nicholas Tamara
2005-02-02  8:54 ` Ismael Valladolid Torres
2005-02-02  9:39 ` Peter Dyballa
     [not found] ` <mailman.448.1107338600.2841.help-gnu-emacs@gnu.org>
2005-02-02 14:58   ` Stefan Monnier
2005-02-02 15:40     ` Ismael Valladolid Torres
2005-02-02 16:01     ` David Kastrup
2005-02-02 16:12       ` **Re: " Ismael Valladolid Torres
2005-02-02 18:05     ` Peter Dyballa
     [not found]     ` <mailman.557.1107368636.2841.help-gnu-emacs@gnu.org>
2005-02-03  3:53       ` 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.