Configuration Examples
**********************
Question: So now you have all these complicated configuration options
in your package, but which ones do _you_ as the maintainer actually set
in your own configuration?
Answer: Hardly any. As the maintainer, I set the default of most
options to what I think is best. However, the default settings do not
turn on features which
- are not self-evident (i.e. too magic) when used by an unsuspecting
user
- are too intrusive
- will not work properly on all Emacs installations out there
- break with widely used standards.
To see what I mean, here is the _entire_ configuration I have in my
`.emacs':
(setq idlwave-shell-debug-modifiers '(control shift)
idlwave-store-inquired-class t
idlwave-shell-automatic-start t
idlwave-main-block-indent 2
idlwave-help-dir "~/lib/emacs/idlwave"
idlwave-special-lib-alist '(("/idl-astro/" . "AstroLib")
("/jhuapl/" . "JHUAPL-Lib")
("/dominik/lib/idl/" . "MyLib")))
However, if you are an Emacs power-user and want IDLWAVE to work
completely differently, the options allow you to change almost every
aspect of it. Here is an example of a much more extensive configuration
of IDLWAVE. To say it again - this is not what I recommend, but the
user is King!
;;; Settings for IDLWAVE mode
(setq idlwave-block-indent 3) ; Indentation settings
(setq idlwave-main-block-indent 3)
(setq idlwave-end-offset -3)
(setq idlwave-continuation-indent 1)
(setq idlwave-begin-line-comment "^;[^;]") ; Leave ";" but not ";;"
; anchored at start of line.
(setq idlwave-surround-by-blank t) ; Turn on padding ops =,<,>
(setq idlwave-pad-keyword nil) ; Remove spaces for keyword '='
(setq idlwave-expand-generic-end t) ; convert END to ENDIF etc...
(setq idlwave-reserved-word-upcase t) ; Make reserved words upper case
; (with abbrevs only)
(setq idlwave-abbrev-change-case nil) ; Don't force case of expansions
(setq idlwave-hang-indent-regexp ": ") ; Change from "- " for auto-fill
(setq idlwave-show-block nil) ; Turn off blinking to begin
(setq idlwave-abbrev-move t) ; Allow abbrevs to move point
;; Some setting can only be done from a mode hook. Here is an example:
(add-hook 'idlwave-mode-hook
(lambda ()
(setq abbrev-mode 1) ; Turn on abbrevs (-1 for off)
(setq case-fold-search nil) ; Make searches case sensitive
;; Run other functions here
(font-lock-mode 1) ; Turn on font-lock mode
(idlwave-auto-fill-mode 0) ; Turn off auto filling
;;
;; Pad with 1 space (if -n is used then make the
;; padding a minimum of n spaces.) The defaults use -1
;; instead of 1.
(idlwave-action-and-binding "=" '(idlwave-expand-equal 1 1))
(idlwave-action-and-binding "<" '(idlwave-surround 1 1))
(idlwave-action-and-binding ">" '(idlwave-surround 1 1 '(?-)))
(idlwave-action-and-binding "&" '(idlwave-surround 1 1))
;;
;; Only pad after comma and with exactly 1 space
(idlwave-action-and-binding "," '(idlwave-surround nil 1))
(idlwave-action-and-binding "&" '(idlwave-surround 1 1))
;;
;; Pad only after `->', remove any space before the arrow
(idlwave-action-and-binding "->" '(idlwave-surround 0 -1 nil 2))
;;;
;; Set some personal bindings
;; (In this case, makes `,' have the normal self-insert behavior.)
(local-set-key "," 'self-insert-command)
;; Create a newline, indenting the original and new line.
;; A similar function that does _not_ reindent the original
;; line is on "\C-j" (The default for emacs programming modes).
(local-set-key "\n" 'idlwave-newline)
;; (local-set-key "\C-j" 'idlwave-newline) ; My preference.
))
;;; Settings for IDLWAVE SHELL mode
(setq idlwave-shell-overlay-arrow "=>") ; default is ">"
(setq idlwave-shell-use-dedicated-frame t) ; Make a dedicated frame
(setq idlwave-shell-prompt-pattern "^WAVE> ") ; default is "^IDL> "
(setq idlwave-shell-explicit-file-name "wave")
(setq idlwave-shell-process-name "wave")
(setq idlwave-shell-use-toolbar nil) ; No toolbar