comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDLWAVE takes over
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: IDLWAVE takes over [message #37039] Thu, 20 November 2003 11:00
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Thu, 20 Nov 2003 08:21:33 -0700, Jack Saba wrote:

> JD Smith wrote:
>
>> On Tue, 18 Nov 2003 06:14:17 -0700, Jack Saba wrote:
>>
>>> I am running emacs on a pc, and using ange-ftp to edit files on our
>>> unix machines. We do not have idl on the pc's, and I do not like the
>>> editor deciding where to put text, how to handle tabs, etc. I do like
>>> the context highlighting, and that's the only part of idlwave that
>>> seems to be usable in this situation that I really want.
>>> ...
>>> HOWEVER, since installing the latest version of IDLWAVE, a problem has
>>> shown up. If I fire up IDL and edit a .pro file that is on the pc,
>>> emacs enters idl-color-mode. When I connect to the unix machine and
>>> edit a file there, emacs enters idlwave-mode, NOT idl-color-mode. After
>>> that, it used idlwave-mode rather than idl-color-mode for any .pro
>>> files, whether on the pc or on the unix box.
>>>
>>> Any suggestions for fixing this? Otherwise, I will go back to an older
>>> version.


> I tried
>
>
>> (add-hook 'idlwave-mode-hook
>> (lambda ()
>> (local-set-key [tab] 'idlwave-hard-tab)))
>
>> This will give you all the power of IDLWAVE, except for the magic of
>> the TAB key.
>
> but that did a couple of things I didn't like, such as using hard tab
> rather than text tab. I really DON'T want the program to do any of the
> alignment, or completion or .... Perhaps I could get used to that with
> time, but I find almost all of that extremely distracting.
>
> I hit the SEND key on the original message before I intended to, so let
> me say now that, even with the minimal use I make of idlwave, I find it
> extremely useful, and very much appreciate the work Carsten and JD and
> others put into it.

Thanks Jack. If you want TAB to behave as it does in text mode, you can
use 'indent-relative instead of 'idlwave-hard-tab in the above. Just to
sample a tiny fraction of what you'd be missing, stick cursor on a routine
name and say "C-c ?".

Good luck,

JD

P.S. idlwave.org is down just now with some domain troubles. I expect it
to be resolved soon.
Re: IDLWAVE takes over [message #37057 is a reply to message #37039] Thu, 20 November 2003 07:21 Go to previous message
Jack Saba is currently offline  Jack Saba
Messages: 30
Registered: January 1996
Member
JD Smith wrote:

> On Tue, 18 Nov 2003 06:14:17 -0700, Jack Saba wrote:
>
>> I am running emacs on a pc, and using ange-ftp to edit files on our unix
>> machines. We do not have idl on the pc's, and I do not like the editor
>> deciding where to put text, how to handle tabs, etc. I do like the
>> context highlighting, and that's the only part of idlwave that seems to
>> be usable in this situation that I really want.
>> ...
>> HOWEVER, since installing the latest version of IDLWAVE, a problem has
>> shown up. If I fire up IDL and edit a .pro file that is on the pc, emacs
>> enters idl-color-mode. When I connect to the unix machine and edit a
>> file there, emacs enters idlwave-mode, NOT idl-color-mode. After that,
>> it used idlwave-mode rather than idl-color-mode for any .pro files,
>> whether on the pc or on the unix box.
>>
>> Any suggestions for fixing this? Otherwise, I will go back to an older
>> version.
>
>
> IDLWAVE taking over... I like the sound of that.
>
> This is a simple case of "you can't please all of the people, all of
> the time". A request was put in to have ".pro" files enter
> idlwave-mode automatically when it's intalled as an XEmacs package,
> which gathers up these snippets and sets them automatically for the
> user. Hence
>
> ;;;###autoload
> (add-to-list 'auto-mode-alist '("\\.[Pp][Rr][Oo]\\'" . idlwave-mode))
>
> was added. The problem is, your add-to-list is happening earlier than
> mine, and thus mine wins. You might get into IDL color mode once, but
> after that, IDLWAVE will win.
>
> You can add to your .emacs:
>

JD,

Thank you. In the end I decided to go with

> (add-hook 'idlwave-load-hook
> (lambda ()
> (let ((list auto-mode-alist) var)
> (while (setq var (car list))
> (if (eq (cdr var) 'idlwave-mode)
> (setcdr var 'idl-color-mode))
> (setq list (cdr list))))))
>
> to go through and stamp out all instances of idlwave-mode in favor of
> idl-color-mode.

I tried

>
> (add-hook 'idlwave-mode-hook
> (lambda ()
> (local-set-key [tab] 'idlwave-hard-tab)))

> This will give you all the power of IDLWAVE, except for the magic of
> the TAB key.

but that did a couple of things I didn't like, such as using hard tab rather
than text tab. I really DON'T want the program to do any of the alignment, or
completion or .... Perhaps I could get used to that with time, but I find almost
all of that extremely distracting.

I hit the SEND key on the original message before I intended to, so let me say
now that, even with the minimal use I make of idlwave, I find it extremely
useful, and very much appreciate the work Carsten and JD and others put into it.

Jack Saba
<jack.saba@gsfc.nasa.gov>
Re: IDLWAVE takes over [message #37132 is a reply to message #37057] Wed, 19 November 2003 13:38 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Tue, 18 Nov 2003 06:14:17 -0700, Jack Saba wrote:

> I am running emacs on a pc, and using ange-ftp to edit files on our unix
> machines. We do not have idl on the pc's, and I do not like the editor
> deciding where to put text, how to handle tabs, etc. I do like the
> context highlighting, and that's the only part of idlwave that seems to
> be usable in this situation that I really want. Therefore, thanks to
> Carsten, I have the following in my .emacs file:
>
> ;;;From Carsten: how to get only syntax highlighting. Posted to
> comp.emacs in ;;;response to my request.
>
> (define-derived-mode idl-color-mode text-mode
> "(IDL color mode)"
> "IDLWAVE syntax-highlighting only mode" (require 'font-lock)
> (require 'idlwave)
> (set (make-local-variable 'font-lock-defaults)
> idlwave-font-lock-defaults)
> (set-syntax-table idlwave-mode-syntax-table) (turn-on-font-lock))
> (add-to-list 'auto-mode-alist '("\\.pro" . idl-color-mode))
>
>
> HOWEVER, since installing the latest version of IDLWAVE, a problem has
> shown up. If I fire up IDL and edit a .pro file that is on the pc, emacs
> enters idl-color-mode. When I connect to the unix machine and edit a
> file there, emacs enters idlwave-mode, NOT idl-color-mode. After that,
> it used idlwave-mode rather than idl-color-mode for any .pro files,
> whether on the pc or on the unix box.
>
> Any suggestions for fixing this? Otherwise, I will go back to an older
> version.

IDLWAVE taking over... I like the sound of that.

This is a simple case of "you can't please all of the people, all of
the time". A request was put in to have ".pro" files enter
idlwave-mode automatically when it's intalled as an XEmacs package,
which gathers up these snippets and sets them automatically for the
user. Hence

;;;###autoload
(add-to-list 'auto-mode-alist '("\\.[Pp][Rr][Oo]\\'" . idlwave-mode))

was added. The problem is, your add-to-list is happening earlier than
mine, and thus mine wins. You might get into IDL color mode once, but
after that, IDLWAVE will win.

You can add to your .emacs:

(add-hook 'idlwave-load-hook
(lambda ()
(let ((list auto-mode-alist) var)
(while (setq var (car list))
(if (eq (cdr var) 'idlwave-mode)
(setcdr var 'idl-color-mode))
(setq list (cdr list))))))

to go through and stamp out all instances of idlwave-mode in favor of
idl-color-mode.

That said, you're cutting off a lot more of IDLWAVE than indentation:
you're losing context help, completion, routine information etc. If
all you want to remove is IDL's auto-indentation, you can probably
skip idl-color-mode and just use:

(add-hook 'idlwave-mode-hook
(lambda ()
(local-set-key [tab] 'idlwave-hard-tab)))

This will give you all the power of IDLWAVE, except for the magic of
the TAB key. Then you can spend countless hours lining up your code
exactly how you like it, using space and TAB ;), but still take
advantage of all of IDLWAVE's other many features (or ignore them).

One other option you may not have fully investigated: the exact style
of IDLWAVE's indentation is highly configurable. Take a spin through
the "IDLWAVE Code Formatting" Customize Menu (e.g. use the menu
IDLWAVE->Customize->Browse IDLWAVE Group). If you don't like how
things are lined up, you can set them to suit you. Here's my minimal
setup:

(add-hook 'idlwave-mode-hook
(lambda ()
(setq
idlwave-block-indent 3 ; Proper Indentation settings
;; Any self-respecting programmer indents his main block
idlwave-main-block-indent 2
idlwave-end-offset -3
idlwave-continuation-indent 3)))

By the way, for those of you always instinctively hitting TAB right
after RET in IDLWAVE, try:

(add-hook 'idlwave-mode-hook
(lambda ()
(local-set-key [return] 'idlwave-newline)))

to have it do this for you!

Good luck,

JD
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDLWave Reference Card?
Next Topic: Re: Vector comparison.

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Nov 29 03:18:14 PST 2020

Total time taken to generate the page: 0.00708 seconds