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 
Return to the default flat view Create a new topic Submit Reply
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
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: IDLWave Reference Card?
Next Topic: Re: Vector comparison.

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

Current Time: Sat Oct 11 08:16:47 PDT 2025

Total time taken to generate the page: 1.11797 seconds