Re: EMACS: POD-Highlighting under Cperl-mode?
by doom (Deacon) on Feb 19, 2009 at 16:41 UTC
|
You might find a pointer to a solution over at the emacs wiki: PerlLanguage.
Though on the other hand you might not. Methods of perl development inside of emacs still needs some work, I think. Please do let us know if you find a good emacs pod-handling solution.
| [reply] |
|
|
> Please do let us know if you find a good emacs pod-handling solution.
tinyperl-mode sounds promising! 8 )
(haven't tested it yet!)
UPDATE: I gave up trying to get tinyperl.el installed. All these tiny* libs are more kind of a overcomplicated framework, where the various differing installation guides seem not up-to-date!
And finally I found doom's "beware-tinytools" blogentry, showing that it's not only a question of mastering elisp.
That's really sad ...anyhow if somebody get's it working with emacs 22 please give me a note how!
| [reply] |
|
|
;; ....................................................... &t-install
+...
;; Put this file on your Emacs-Lisp `load-path', add following into yo
+ur
;; ~/.emacs startup file.
(add-to-list 'load-path "~/.emacs.d/exp/emacs-tiny-tools-devel/lisp/ti
+ny")
;;
(require 'tinyperl)
;;
;; Autoload, prefer this one, your emacs starts quicker. The addition
+al
;; features are turned on only when `perl-mode' runs.
;;
(autoload 'turn-on-tinyperl-mode "tinyperl" "" t)
(add-hook 'perl-mode-hook 'turn-on-tinyperl-mode)
(add-hook 'cperl-mode-hook 'turn-on-tinyperl-mode)
for some reason tinyurl-mode has to be activated manually, after this following links is possible.
| [reply] [d/l] |
Re: EMACS: POD-Highlighting under Cperl-mode?
by MidLifeXis (Monsignor) on Feb 19, 2009 at 16:29 UTC
|
I was thinking that perhaps Org Mode might have a minor mode that could work for some of the linking stuff, but alas, only orgtbl-mode is available.
Since this is an itch I have, I would love to scratch it, but alas do not have the time to do this yet. Is there anyone else hacking on a solution for this general problem in emacs, perhaps using org-mode as the tool?
| [reply] |
|
|
> Is there anyone else hacking on a solution for this general problem in emacs, perhaps using org-mode as the tool?
Well the "easiest" solution I can see is to realize an extended POD-mode!
One usage might be visiting the same file in different buffers with according modes ...
Another switching modes by a keystroke (optionally folding away the "opposite" text-portions)
Anyway my knowledge of lisp is quite reduced and I don't dare manipulating cperl-mode. AFAIS here http://math.berkeley.edu/~ilya/software/emacs/cperl-mode.el.6.2.bz2 it does mark pod-sections with a "pod-here" flag, so this could be point to intercept.
The best lisp solution would be to ask Ilya to make cperl more modularizable, such that others could provide plugins...
The best overall solution might be to have a CPAN-Module which builds and tests the lisp-code. ... or extending perltidy such that the html-export is interpretable for emacs ... but thats a dream.
UPDATE:
* MidLifeXis Thanks for pointing me to org mode (tutorial), looks very interesting and reminds me a lot of ideas I had in my backmind for years. 8 )
| [reply] |
Re: EMACS: pod-mode
by LanX (Saint) on Feb 21, 2009 at 19:41 UTC
|
I just installed pod-mode.el to have starting point for modifications.
Well it works somehow, but renders all formatting-codes the same way. Tried to change them all to "bold" face but this doesn't work ... seems as if the faces must start with "font-lock-...". Example
' (append pod-font-lock-keywords-2
(
("[IBCFXZS]<\\([^>]*\\)>" 1 font-lock-warning-face)
("L<\\(\\([^|>]*\\)|\\)\\([^>]+\\)>"
(2 font-lock-reference-face)
(3 font-lock-function-name-face))
("L<\\([^|>]+\\)>" 1 font-lock-function-name-face)
("E<\\([^>]*\\)>" 1 font-lock-function-name-face)
("\"\\([^\"]+\\)\"" 0 font-lock-string-face)
))
In this example I changed to font-lock-warning-face, which works.
I couldn't find out how to define new Font-lock faces, maybe somebody here knows...
PS: This is far beyond customization, experimenting with elisp takes hours and days...
UPDATE: OK, solved the problem, "FACESPEC is a Lisp variable (a symbol) whose value is a face name." I just needed to define a variable! | [reply] [d/l] |
Re: EMACS: POD-Highlighting under Cperl-mode?
by chb (Deacon) on Feb 20, 2009 at 09:26 UTC
|
| [reply] |
Re: EMACS: POD-Highlighting under Cperl-mode?
by educated_foo (Vicar) on Feb 20, 2009 at 04:38 UTC
|
I don't know of anything that does this now. You might try mumamo or mmm-mode, both of which allow multiple major modes to coexist in a single buffer. If, as another commenter said, cperl-mode marks POD regions as such, and if you know a bit of elisp, then it shouldn't be too hard to write what you want. If not, it's a great opportunity to learn how to customize your editor. | [reply] |
|
|
If, as another commenter said, cperl-mode marks POD regions as such, and if you know a bit of elisp, then it shouldn't be too hard to write what you want. If not, it's a great opportunity to learn how to customize your editor.
well the "other commenter" was me and I'm using emacs for nearly 20 years now (wow!), and I definitely know it should be too hard! ;)
Elisp doesn't scale well, different packages tend to to sabotage each other, inhibit portability and need plenty of maintenance.
A minor mode which hooks reliably well into cperl-mode including clickable URLs would take man-weeks for me to achieve !
| [reply] |
|
|
On the other hand, customization in Emacs is not divided into a crippled configuration file and a byzantine plugin interface. Sure, Emacs is a big ball of mud, but I would rather play with a ball of mud lovingly shaped by actual programmers than a tower of stone crafted by enterprise architects.
| [reply] |