forked from jdtsmith/idlwave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
idlw-variables.el
1354 lines (1170 loc) · 52.1 KB
/
idlw-variables.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;; IDLWAVE variables, customizations, and constants
(defgroup idlwave nil
"Major mode for editing IDL .pro files."
:tag "IDLWAVE"
:link '(url-link :tag "Home Page"
"http://github.com/jdtsmith/idlwave")
:link '(emacs-commentary-link :tag "Commentary in idlw-shell.el"
"idlw-shell.el")
:link '(emacs-commentary-link :tag "Commentary in idlwave.el" "idlwave.el")
:link '(custom-manual "(idlwave)Top")
:prefix "idlwave"
:group 'languages)
;;----------------------------------------------------
;; Indentation behavior
(defgroup idlwave-code-formatting nil
"Indentation and formatting options for IDLWAVE mode."
:group 'idlwave)
(defcustom idlwave-main-block-indent 2
"*Extra indentation for the main block of code.
That is the block between the FUNCTION/PRO statement and the END
statement for that program unit."
:group 'idlwave-code-formatting
:type 'integer)
(defcustom idlwave-block-indent 3
"*Extra indentation applied to block lines.
If you change this, you probably also want to change `idlwave-end-offset'."
:group 'idlwave-code-formatting
:type 'integer)
(defcustom idlwave-end-offset -3
"*Extra indentation applied to block END lines.
A value equal to negative `idlwave-block-indent' will make END lines
line up with the block BEGIN lines."
:group 'idlwave-code-formatting
:type 'integer)
(defcustom idlwave-continuation-indent 3
"*Extra indentation applied to continuation lines.
This extra offset applies to the first of a set of continuation lines.
The following lines receive the same indentation as the first."
:group 'idlwave-code-formatting
:type 'integer)
(defcustom idlwave-max-extra-continuation-indent 40
"*Maximum additional indentation for special continuation indent.
Several special indentations are tried to help line up continuation
lines in routine calls or definitions, other statements with
parentheses, or assignment statements. This variable specifies a
maximum amount by which this special indentation can exceed the
standard continuation indentation, otherwise defaulting to a fixed
offset. Set to 0 to effectively disable all special continuation
indentation, or to a large number (like 100) to enable it in all
cases. See also `idlwave-indent-to-open-paren', which can override
this variable."
:group 'idlwave-code-formatting
:type 'integer)
(defcustom idlwave-indent-to-open-paren t
"*Non-nil means, indent continuation lines to innermost open parenthesis.
This indentation occurs even if otherwise disallowed by
`idlwave-max-extra-continuation-indent'. Matching parens and the
interleaving args are lined up. Example:
x = function_a(function_b(function_c( a, b, [1,2,3, $
4,5,6 $
], $
c, d $
)))
When this variable is nil, paren alignment may still occur, based on
the value of `idlwave-max-extra-continuation-indent', which, if zero,
would yield:
x = function_a(function_b(function_c( a, b, [1,2,3, $
4,5,6 $
], $
c, d $
)))"
:group 'idlwave-code-formatting
:type 'boolean)
(defcustom idlwave-indent-parens-nested nil
"*Non-nil means, indent continuation lines with parens by nesting
lines at consecutively deeper levels."
:group 'idlwave-code-formatting
:type 'boolean)
(defcustom idlwave-hanging-indent t
"*If set non-nil then comment paragraphs are indented under the
hanging indent given by `idlwave-hang-indent-regexp' match in the first line
of the paragraph."
:group 'idlwave-code-formatting
:type 'boolean)
(defcustom idlwave-hang-indent-regexp "- "
"*Regular expression matching the position of the hanging indent
in the first line of a comment paragraph. The size of the indent
extends to the end of the match for the regular expression."
:group 'idlwave-code-formatting
:type 'regexp)
(defcustom idlwave-use-last-hang-indent nil
"*If non-nil then use last match on line for `idlwave-indent-regexp'."
:group 'idlwave-code-formatting
:type 'boolean)
(defcustom idlwave-fill-comment-line-only t
"*If non-nil then auto fill will only operate on comment lines."
:group 'idlwave-code-formatting
:type 'boolean)
(defcustom idlwave-auto-fill-split-string t
"*If non-nil then auto fill will split strings with the IDL `+' operator.
When the line end falls within a string, string concatenation with the
'+' operator will be used to distribute a long string over lines.
If nil and a string is split then a terminal beep and warning are issued.
This variable is ignored when `idlwave-fill-comment-line-only' is
non-nil, since in this case code is not auto-filled."
:group 'idlwave-code-formatting
:type 'boolean)
(defcustom idlwave-split-line-string t
"*If non-nil then `idlwave-split-line' will split strings with `+'.
When the splitting point of a line falls inside a string, split the string
using the `+' string concatenation operator. If nil and a string is
split then a terminal beep and warning are issued."
:group 'idlwave-code-formatting
:type 'boolean)
(defcustom idlwave-no-change-comment ";;;"
"*The indentation of a comment that starts with this regular
expression will not be changed. Note that the indentation of a comment
at the beginning of a line is never changed."
:group 'idlwave-code-formatting
:type 'string)
(defcustom idlwave-begin-line-comment nil
"*A comment anchored at the beginning of line.
A comment matching this regular expression will not have its
indentation changed. If nil the default is \"^;\", i.e., any line
beginning with a \";\". Expressions for comments at the beginning of
the line should begin with \"^\"."
:group 'idlwave-code-formatting
:type '(choice (const :tag "Any line beginning with `;'" nil)
'regexp))
(defcustom idlwave-code-comment ";;[^;]"
"*A comment that starts with this regular expression on a line by
itself is indented as if it is a part of IDL code. As a result if
the comment is not preceded by whitespace it is unchanged."
:group 'idlwave-code-formatting
:type 'regexp)
;; Comments not matching any of the above will be indented as a
;; right-margin comment, i.e., to a minimum of `comment-column'.
;;----------------------------------------------------
;; Routine Info and Completion
(defgroup idlwave-routine-info nil
"Routine Info options for IDLWAVE mode."
:group 'idlwave)
(defcustom idlwave-use-library-catalogs t
"*Non-nil means search the IDL path for library catalog files.
These files, named .idlwave_catalog, document routine information for
individual directories and libraries of IDL .pro files. Many popular
libraries come with catalog files by default, so leaving this on is
usually a good idea."
:group 'idlwave-routine-info
:type 'boolean)
(defcustom idlwave-init-rinfo-when-idle-after 10
"*Seconds of idle time before routine info is automatically initialized.
Initializing the routine info can take a long time, in particular if a
large number of library catalogs are involved. When Emacs is idle for
more than the number of seconds specified by this variable, it starts
the initialization. The process is split into five steps, in order to
keep work interruption as short as possible. If one of the steps
finishes, and no user input has arrived in the mean time, initialization
proceeds immediately to the next step. A good value for this variable
is about 1/3 of the time initialization take in your setup. So if you
have a fast machine and no problems with a slow network connection,
don't hesitate to set this to 2 seconds. A value of 0 means, don't
initialize automatically, but instead wait until routine information is
needed, and initialize then."
:group 'idlwave-routine-info
:type 'number)
(defcustom idlwave-scan-all-buffers-for-routine-info t
"*Non-nil means, scan buffers for IDL programs when updating info.
The scanning is done by the command `idlwave-update-routine-info'.
The following values are allowed:
nil Don't scan any buffers.
t Scan all `idlwave-mode' buffers in the current editing session.
current Scan only the current buffer, but no other buffers."
:group 'idlwave-routine-info
:type '(choice
(const :tag "No buffer" nil)
(const :tag "All buffers" t)
(const :tag "Current buffer only" 'current)))
(defcustom idlwave-query-shell-for-routine-info t
"*Non-nil means query the shell for info about compiled routines.
Querying the shell is useful to get information about compiled modules,
and it is turned on by default. However, when you have a complete library
scan, this is not necessary."
:group 'idlwave-routine-info
:type 'boolean)
(defcustom idlwave-auto-routine-info-updates
'(find-file save-buffer kill-buffer compile-buffer)
"*Controls under what circumstances routine info is updated automatically.
Possible values:
nil Never
t All available
\(...) A list of circumstances. Allowed members are:
find-file Add info for new IDLWAVE buffers.
save-buffer Update buffer info when buffer is saved
kill-buffer Remove buffer info when buffer gets killed
compile-buffer Update shell info after `idlwave-shell-save-and...'"
:group 'idlwave-routine-info
:type '(choice
(const :tag "Never" nil)
(const :tag "As often as possible" t)
(set :tag "Checklist" :greedy t
(const :tag "When visiting a file" find-file)
(const :tag "When saving a buffer" save-buffer)
(const :tag "After a buffer was killed" kill-buffer)
(const :tag "After a buffer was compiled successfully, update shell info" compile-buffer))))
(defcustom idlwave-rinfo-max-source-lines 5
"*Maximum number of source files displayed in the Routine Info window.
When an integer, it is the maximum number of source files displayed.
A value of t means to show all source files."
:group 'idlwave-routine-info
:type 'integer)
(defcustom idlwave-library-path nil
"Library path for Windows and MacOS (OS9). Not needed under UNIX.
When selecting the directories to scan for IDL user catalog routine
info, IDLWAVE can, under UNIX, query the shell for the exact search
path \(the value of !PATH). However, under Windows and MacOS
\(pre-OSX), the IDLWAVE shell does not work. In this case, this
variable can be set to specify the paths where IDLWAVE can find PRO
files. The shell will only be asked for a list of paths when this
variable is nil. The value is a list of directories. A directory
preceeded by a `+' will be searched recursively. If you set this
variable on a UNIX system, the shell will not be queried. See also
`idlwave-system-directory'."
:group 'idlwave-routine-info
:type '(repeat (directory)))
(defcustom idlwave-system-directory ""
"The IDL system directory for Windows and MacOS. Not needed under
UNIX. Set this to the value of the `!DIR' system variable in IDL.
IDLWAVE uses this to find out which of the library routines belong to
the official system library. All files inside the `lib' subdirectory
are considered system library files - so don't install private stuff
in this directory. On UNIX systems, IDLWAVE queries the shell for the
value of `!DIR'. See also `idlwave-library-path'."
:group 'idlwave-routine-info
:type 'directory)
;; Configuration files
(defcustom idlwave-config-directory
(convert-standard-filename "~/.idlwave")
"*Directory for configuration files and user-library catalog."
:group 'idlwave-routine-info
:type 'file)
(defcustom idlwave-special-lib-alist nil
"Alist of regular expressions matching special library directories.
When listing routine source locations, IDLWAVE gives a short hint where
the file defining the routine is located. By default it lists `SystemLib'
for routines in the system library `!DIR/lib' and `Library' for anything
else. This variable can define additional types. The car of each entry
is a regular expression matching the file name (they normally will match
on the path). The cdr is the string to be used as identifier. Max 10
chars are allowed."
:group 'idlwave-routine-info
:type '(repeat
(cons regexp string)))
(defcustom idlwave-auto-write-paths t
"Write out path (!PATH) and system directory (!DIR) info automatically.
Path info is needed to locate library catalog files. If non-nil,
whenever the path-list changes as a result of shell-query, etc., it is
written to file. Otherwise, the menu option \"Write Paths\" can be
used to force a write."
:group 'idlwave-routine-info
:type 'boolean)
(defgroup idlwave-completion nil
"Completion options for IDLWAVE mode."
:prefix "idlwave"
:group 'idlwave)
(eval-and-compile
(defconst idlwave-tmp
'(choice :tag "by applying the function"
(const upcase)
(const downcase)
(const capitalize)
(const preserve)
(symbol :tag "Other"))))
(defcustom idlwave-completion-case '((routine . upcase)
(keyword . upcase)
(class . preserve)
(method . preserve))
"Association list setting the case of completed words.
This variable determines the case (UPPER/lower/Capitalized...) of
words inserted into the buffer by completion. The preferred case can
be specified separately for routine names, keywords, classes and
methods.
This alist should therefore have entries for `routine' (normal
functions and procedures, i.e. non-methods), `keyword', `class', and
`method'. Plausible values are
upcase upcase whole word, like `BOX_CURSOR'
downcase downcase whole word, like `read_ppm'
capitalize capitalize each part, like `Widget_Control'
preserve preserve case as is, like `IDLgrView'
The value can also be any Emacs Lisp function which transforms the
case of characters in a string.
A value of `preserve' means that the case of the completed word is
identical to the way it was written in the definition statement of the
routine. This was implemented to allow for mixed-case completion, in
particular of object classes and methods.
If a completable word is defined in multiple locations, the meaning of
`preserve' is not unique since the different definitions might be
cased differently. Therefore IDLWAVE always takes the case of the
*first* definition it encounters during routine info collection and
uses the case derived from it consistently.
Note that a lowercase-only string in the buffer will always be completed in
lower case (but see the variable `idlwave-completion-force-default-case').
After changing this variable, you need to either restart Emacs or press
`C-u C-c C-i' to update the internal lists."
:group 'idlwave-completion
:type `(repeat
(cons (symbol :tag "Derive completion case for")
,idlwave-tmp)))
(defcustom idlwave-completion-force-default-case nil
"*Non-nil means, completion will always honor `idlwave-completion-case'.
When nil, only the completion of a mixed case or upper case string
will honor the default settings in `idlwave-completion-case', while
the completion of lower case strings will be completed entirely in
lower case."
:group 'idlwave-completion
:type 'boolean)
(defcustom idlwave-complete-empty-string-as-lower-case nil
"*Non-nil means, the empty string is considered downcase for completion.
The case of what is already in the buffer determines the case of completions.
When this variable is non-nil, the empty string is considered to be downcase.
Completing on the empty string then offers downcase versions of the possible
completions."
:group 'idlwave-completion
:type 'boolean)
(defcustom idlwave-buffer-case-takes-precedence nil
"*Non-nil means, the case of tokens in buffers dominates over system stuff.
To make this possible, we need to re-case everything each time we update
the routine info from the buffers. This is slow.
The default is to consider the case given in the system and library files
first which makes updating much faster."
:group 'idlwave-completion
:type 'boolean)
(defcustom idlwave-highlight-help-links-in-completion t
"*Non-nil means, highlight completions for which system help is available.
Help can then be accessed with mouse-3.
This option is only effective when the online help system is installed."
:group 'idlwave-completion
:type 'boolean)
(defcustom idlwave-support-inheritance t
"Non-nil means, treat inheritance with completion, online help etc.
When nil, IDLWAVE only knows about the native methods and tags of a class,
not about inherited ones."
:group 'idlwave-routine-info
:type 'boolean)
(defcustom idlwave-keyword-class-inheritance '("^[gs]etproperty$" "^init$")
"List of regular expressions for class-driven keyword inheritance.
Keyword inheritance is often tied to class inheritance by \"chaining\"
up the class tree. While it cannot be assumed that the presence of an
_EXTRA or _REF_EXTRA symbol guarantees such chaining will occur, for
certain methods this assumption is almost always true. The methods
for which to assume this can be set here."
:group 'idlwave-routine-info
:type '(repeat (regexp :tag "Match method:")))
(defcustom idlwave-complete-structure-tags t
"Whether to complete structure tags in source and shell."
:group 'idlwave-routine-info
:type 'boolean)
(defcustom idlwave-completion-show-classes 1
"*Number of classes to show when completing object methods and keywords.
When completing methods or keywords for an object with unknown class,
the *Completions* buffer will show the valid classes for each completion
like this:
MyMethod <Class1,Class2,Class3>
The value of this variable may be nil to inhibit display, or an integer to
indicate the maximum number of classes to display.
On XEmacs, a full list of classes will also be placed into a `help-echo'
property on the completion items, so that the list of classes for the current
item is displayed in the echo area. If the value of this variable is a
negative integer, the `help-echo' property will be suppressed."
:group 'idlwave-completion
:type '(choice (const :tag "Don't show" nil)
(integer :tag "Number of classes shown" 1)))
(defcustom idlwave-completion-fontify-classes t
"*Non-nil means, fontify the classes in completions buffer.
This makes it easier to distinguish the completion items from the extra
class info listed. See `idlwave-completion-show-classes'."
:group 'idlwave-completion
:type 'boolean)
(defcustom idlwave-query-class '((method-default . nil)
(keyword-default . nil))
"Association list governing specification of object classes for completion.
When IDLWAVE tries to complete object-oriented methods, it usually
cannot determine the class of a given object from context. In order
to provide the user with a correct list of methods or keywords, it
needs to determine the appropriate class. IDLWAVE has two ways of
doing this (well, three ways if you count the shell... see
`idlwave-shell-query-for-class'):
1. Combine the items of all available classes which contain this
method for the purpose of completion. So when completing a method,
all methods of all known classes are available, and when completing
a keyword, all keywords allowed for this method in any class are
shown. This behavior is very much like normal completion and is
therefore the default. It works much better than one might think -
only for the INIT, GETPROPERTY and SETPROPERTY the keyword lists
become uncomfortably long. See also
`idlwave-completion-show-classes'.
2. The second possibility is to ask the user on each occasion. To
make this less interruptive, IDLWAVE can store the class as a text
property on the object operator `->'. For a given object in the
source code, class selection will then be needed only once
- for example to complete the method. Keywords to the method can
then be completed directly, because the class is already known.
You will have to turn on the storage of the selected class
explicitly with the variable `idlwave-store-inquired-class'.
This variable allows you to configure IDLWAVE's method and
method-keyword completion behavior. Its value is an alist, which
should contain at least two elements: (method-default . VALUE) and
\(keyword-default . VALUE), where VALUE is either t or nil. These
specify if the class should be found during method and keyword
completion, respectively.
The alist may have additional entries specifying exceptions from the
keyword completion rule for specific methods, like INIT or
GETPROPERTY. In order to turn on class specification for the INIT
method, add an entry (\"INIT\" . t). The method name must be ALL-CAPS."
:group 'idlwave-completion
:type '(list
(cons (const method-default)
(boolean :tag "Determine class when completing METHODS "))
(cons (const keyword-default)
(boolean :tag "Determine class when completing KEYWORDS "))
(repeat
:tag "Exceptions to defaults"
:inline t
(cons (string :tag "MODULE" :value "")
(boolean :tag "Determine class for this method")))))
(defcustom idlwave-store-inquired-class t
"*Non-nil means, store class of a method call as text property on `->'.
IDLWAVE sometimes has to ask the user for the class associated with a
particular object method call. This happens during the commands
`idlwave-routine-info' and `idlwave-complete', depending upon the
value of the variable `idlwave-query-class'.
When you specify a class, this information can be stored as a text
property on the `->' arrow in the source code, so that during the same
editing session, IDLWAVE will not have to ask again. When this
variable is non-nil, IDLWAVE will store and reuse the class information.
The class stored can be checked and removed with `\\[idlwave-routine-info]'
on the arrow.
The default of this variable is nil, since the result of commands then
is more predictable. However, if you know what you are doing, it can
be nice to turn this on.
An arrow which knows the class will be highlighted with
`idlwave-class-arrow-face'. The command \\[idlwave-routine-info]
displays (with prefix arg: deletes) the class stored on the arrow
at point."
:group 'idlwave-completion
:type 'boolean)
(defcustom idlwave-class-arrow-face 'bold
"*Face to highlight object operator arrows `->' which carry a class property.
When IDLWAVE stores a class name as text property on an object arrow
\(see variable `idlwave-store-inquired-class', it highlights the arrow
with this font in order to remind the user that this arrow is special."
:group 'idlwave-completion
:type 'symbol)
(defcustom idlwave-resize-routine-help-window t
"*Non-nil means, resize the Routine-info *Help* window to fit the content."
:group 'idlwave-completion
:type 'boolean)
(defcustom idlwave-keyword-completion-adds-equal t
"*Non-nil means, completion automatically adds `=' after completed keywords."
:group 'idlwave-completion
:type 'boolean)
(defcustom idlwave-function-completion-adds-paren t
"*Non-nil means, completion automatically adds `(' after completed function.
nil means, don't add anything.
A value of `2' means, also add the closing parenthesis and position cursor
between the two."
:group 'idlwave-completion
:type '(choice (const :tag "Nothing" nil)
(const :tag "(" t)
(const :tag "()" 2)))
(defcustom idlwave-completion-restore-window-configuration t
"*Non-nil means, try to restore the window configuration after completion.
When completion is not unique, Emacs displays a list of completions.
This messes up your window configuration. With this variable set, IDLWAVE
restores the old configuration after successful completion."
:group 'idlwave-completion
:type 'boolean)
;;----------------------------------------------------
;; Abbrev and action
(defgroup idlwave-abbrev-and-indent-action nil
"IDLWAVE performs actions when expanding abbreviations or indenting lines.
The variables in this group govern this."
:group 'idlwave)
(defcustom idlwave-do-actions nil
"*Non-nil means performs actions when indenting.
The actions that can be performed are listed in `idlwave-indent-action-table'."
:group 'idlwave-abbrev-and-indent-action
:type 'boolean)
(defcustom idlwave-abbrev-start-char "\\"
"*A single character string used to start abbreviations in abbrev mode.
Possible characters to chose from: ~`\%
or even '?'. '.' is not a good choice because it can make structure
field names act like abbrevs in certain circumstances.
Changes to this in `idlwave-mode-hook' will have no effect. Instead a user
must set it directly using `setq' in the init file before idlwave.el
is loaded."
:group 'idlwave-abbrev-and-indent-action
:type 'string)
(defcustom idlwave-surround-by-blank nil
"*Non-nil means, enable `idlwave-surround'.
If non-nil, `=',`<',`>',`&',`,', `->' are surrounded with spaces by
`idlwave-surround'.
See help for `idlwave-indent-action-table' for symbols using `idlwave-surround'.
Also see the default key bindings for keys using `idlwave-surround'.
Keys are bound and made into actions calling `idlwave-surround' with
`idlwave-action-and-binding'.
See help for `idlwave-action-and-binding' for examples.
Also see help for `idlwave-surround'."
:group 'idlwave-abbrev-and-indent-action
:type 'boolean)
(defcustom idlwave-pad-keyword t
"*Non-nil means pad '=' in keywords (routine calls or defs) like assignment.
Whenever `idlwave-surround' is non-nil then this affects how '=' is
padded for keywords and for variables. If t, pad the same as for
assignments. If nil then spaces are removed. With any other value,
spaces are left unchanged."
:group 'idlwave-abbrev-and-indent-action
:type '(choice
(const :tag "Pad like assignments" t)
(const :tag "Remove space near `='" nil)
(const :tag "Keep space near `='" 'keep)))
(defcustom idlwave-show-block t
"*Non-nil means point blinks to block beginning for `idlwave-show-begin'."
:group 'idlwave-abbrev-and-indent-action
:type 'boolean)
(defcustom idlwave-expand-generic-end nil
"*Non-nil means expand generic END to ENDIF/ENDELSE/ENDWHILE etc."
:group 'idlwave-abbrev-and-indent-action
:type 'boolean)
(defcustom idlwave-reindent-end t
"*Non-nil means re-indent line after END was typed."
:group 'idlwave-abbrev-and-indent-action
:type 'boolean)
(defcustom idlwave-abbrev-move t
"*Non-nil means the abbrev hook can move point.
Set to nil by `idlwave-expand-region-abbrevs'. To see the abbrev
definitions, use the command `list-abbrevs', for abbrevs that move
point. Moving point is useful, for example, to place point between
parentheses of expanded functions.
See `idlwave-check-abbrev'."
:group 'idlwave-abbrev-and-indent-action
:type 'boolean)
(defcustom idlwave-abbrev-change-case nil
"*Non-nil means all abbrevs will be forced to either upper or lower case.
If the value t, all expanded abbrevs will be upper case.
If the value is 'down then abbrevs will be forced to lower case.
If nil, the case will not change.
If `idlwave-reserved-word-upcase' is non-nil, reserved words will always be
upper case, regardless of this variable."
:group 'idlwave-abbrev-and-indent-action
:type 'boolean)
(defcustom idlwave-reserved-word-upcase nil
"*Non-nil means, reserved words will be made upper case via abbrev expansion.
If nil case of reserved words is controlled by `idlwave-abbrev-change-case'.
Has effect only if in abbrev-mode."
:group 'idlwave-abbrev-and-indent-action
:type 'boolean)
;;; Action/Expand Tables.
;;
;; The average user may have difficulty modifying this directly. It
;; can be modified/set in idlwave-mode-hook, but it is easier to use
;; idlwave-action-and-binding. See help for idlwave-action-and-binding for
;; examples of how to add an action.
;;
;; The action table is used by `idlwave-indent-line' whereas both the
;; action and expand tables are used by `idlwave-indent-and-action'. In
;; general, the expand table is only used when a line is explicitly
;; indented. Whereas, in addition to being used when the expand table
;; is used, the action table is used when a line is indirectly
;; indented via line splitting, auto-filling or a new line creation.
;;
;; Example actions:
;;
;; Capitalize system vars
;; (idlwave-action-and-binding idlwave-sysvar '(capitalize-word 1) t)
;;
;; Capitalize procedure name
;; (idlwave-action-and-binding "\\<\\(pro\\|function\\)\\>[ \t]*\\<"
;; '(capitalize-word 1) t)
;;
;; Capitalize common block name
;; (idlwave-action-and-binding "\\<common\\>[ \t]+\\<"
;; '(capitalize-word 1) t)
;; Capitalize label
;; (idlwave-action-and-binding (concat "^[ \t]*" idlwave-label)
;; '(capitalize-word -1) t)
(defvar idlwave-indent-action-table nil
"*Associated array containing action lists of search string (car),
and function as a cdr. This table is used by `idlwave-indent-line'.
See documentation for `idlwave-do-action' for a complete description of
the action lists.
Additions to the table are made with `idlwave-action-and-binding' when a
binding is not requested.
See help on `idlwave-action-and-binding' for examples.")
(defvar idlwave-indent-expand-table nil
"*Associated array containing action lists of search string (car),
and function as a cdr. The table is used by the
`idlwave-indent-and-action' function. See documentation for
`idlwave-do-action' for a complete description of the action lists.
Additions to the table are made with `idlwave-action-and-binding' when a
binding is requested.
See help on `idlwave-action-and-binding' for examples.")
;;----------------------------------------------------
;; Documentation header and history keyword
(defgroup idlwave-documentation nil
"Options for documenting IDLWAVE files."
:group 'idlwave)
(defvar idlwave-file-header
(list nil
";+
; NAME:
;
;
;
; PURPOSE:
;
;
;
; CATEGORY:
;
;
;
; CALLING SEQUENCE:
;
;
;
; INPUTS:
;
;
;
; OPTIONAL INPUTS:
;
;
;
; KEYWORD PARAMETERS:
;
;
;
; OUTPUTS:
;
;
;
; OPTIONAL OUTPUTS:
;
;
;
; COMMON BLOCKS:
;
;
;
; SIDE EFFECTS:
;
;
;
; RESTRICTIONS:
;
;
;
; PROCEDURE:
;
;
;
; EXAMPLE:
;
;
;
; MODIFICATION HISTORY:
;
;-
")
"*A list (PATHNAME STRING) specifying the doc-header template to use for
summarizing a file. If PATHNAME is non-nil then this file will be included.
Otherwise STRING is used. If nil, the file summary will be omitted.
For example you might set PATHNAME to the path for the
lib_template.pro file included in the IDL distribution.")
(defcustom idlwave-header-to-beginning-of-file t
"*Non-nil means, the documentation header will always be at start of file.
When nil, the header is positioned between the PRO/FUNCTION line of
the current routine and the code, allowing several routine headers in
a file."
:group 'idlwave-documentation
:type 'boolean)
(defcustom idlwave-timestamp-hook 'idlwave-default-insert-timestamp
"*The hook function used to update the timestamp of a function."
:group 'idlwave-documentation
:type 'function)
(defcustom idlwave-doc-modifications-keyword "HISTORY"
"*The modifications keyword to use with the log documentation commands.
A ':' is added to the keyword end.
Inserted by doc-header and used to position logs by doc-modification.
If nil it will not be inserted."
:group 'idlwave-documentation
:type 'string)
(defcustom idlwave-doclib-start "^;+\\+"
"*Regexp matching the start of a document library header."
:group 'idlwave-documentation
:type 'regexp)
(defcustom idlwave-doclib-end "^;+-"
"*Regexp matching the end of a document library header."
:group 'idlwave-documentation
:type 'regexp)
;;----------------------------------------------------
;; External Programs
(defgroup idlwave-external-programs nil
"Path locations of external commands used by IDLWAVE."
:group 'idlwave)
(defcustom idlwave-shell-explicit-file-name "idl"
"*If non-nil, this is the command to run IDL.
Should be an absolute file path or path relative to the current environment
execution search path. If you want to specify command line switches
for the IDL program, use `idlwave-shell-command-line-options'.
I know the name of this variable is badly chosen, but I cannot change
it without compromising backwards-compatibility."
:group 'idlwave-external-programs
:type 'string)
(defcustom idlwave-shell-command-line-options nil
"*A list of command line options for calling the IDL program.
Since IDL is executed directly without going through a shell like /bin/sh,
this should be a list of strings like '(\"-rt=file\" \"-nw\") with a separate
string for each argument. But you may also give a single string which
contains the options whitespace-separated. Emacs will be kind enough to
split it for you."
:type '(choice
string
(repeat (string :value "")))
:group 'idlwave-external-programs)
(defcustom idlwave-help-application "idlhelp"
"*The external application providing reference help for programming.
Obsolete, if the IDL Assistant is being used for help."
:group 'idlwave-external-programs
:type 'string)
;;----------------------------------------------------
;; Help
(defgroup idlwave-online-help nil
"Online Help options for IDLWAVE mode."
:group 'idlwave)
(defcustom idlwave-html-help-pre-v6 nil
"Whether pre or post-v6.0 IDL help documents are being used.
OBSOLETE. The full link anchor is now stored."
:group 'idlwave-online-help
:type 'boolean)
(defcustom idlwave-html-system-help-location nil
"The directory, relative to idlwave-system-directory, where the
idl HTML help files live, for IDL 7.0 and later. By default,
this location is discovered automatically from the installation.
This location, if found, is used in preference to the old
idlwave-html-help-location. Note that IDL v6.3-v7.0 used
help/online_help."
:group 'idlwave-online-help
:type 'directory)
(defcustom idlwave-html-help-location
(if (memq system-type '(ms-dos windows-nt))
nil
"/usr/local/etc/")
"The directory where the idl_html_help/ dir lives.
OBSOLETE (see idlwave-html-system-help-location)."
:group 'idlwave-online-help
:type 'directory)
(defcustom idlwave-help-browser-function browse-url-browser-function
"Function to use to display html help.
Defaults to `browse-url-browser-function', which see."
:group 'idlwave-online-help
:type 'function)
(defcustom idlwave-help-browser-generic-program browse-url-generic-program
"Program to run if using browse-url-generic-program."
:group 'idlwave-online-help
:type 'string)
(defvar browse-url-generic-args)
(defcustom idlwave-help-browser-generic-args
(if (boundp 'browse-url-generic-args)
browse-url-generic-args "")
"Program args to use if using browse-url-generic-program."
:group 'idlwave-online-help
:type 'string)
(defcustom idlwave-help-browser-is-local nil
"Whether the browser will display locally in an Emacs window.
Several browsers run and/or display inside Emacs windows, but most are
external programs. If the browser name contains \"-w3\", it is
assumed to be local to Emacs. For other local browsers, this variable
must be explicitly set non-nil in order for the variable
`idlwave-help-use-dedicated-frame' to function."
:group 'idlwave-online-help
:type 'boolean)
(defcustom idlwave-help-use-dedicated-frame t
"*Non-nil means, use a separate frame for Online Help if possible."
:group 'idlwave-online-help
:type 'boolean)
(defcustom idlwave-help-frame-parameters
'((height . 32) (unsplittable . t))
"The frame parameters for the special Online Help frame.
See also `idlwave-help-use-dedicated-frame'.
If you do not set the frame width here, the value specified in
`idlw-help.el' will be used."
:group 'idlwave-online-help
:type '(repeat
(cons symbol sexp)))
(defcustom idlwave-max-popup-menu-items 20
"Maximum number of items per pane in popup menus.
Currently only used for class selection during completion help."
:group 'idlwave-online-help
:type 'integer)
(defcustom idlwave-extra-help-function 'idlwave-help-with-source
"The function to call for online help if the normal help fails.
Online help works only for system routines which are described in the
IDL manuals. A function may be specified to access help from other sources.
The function must accept four arguments: NAME, TYPE, CLASS, KEYWORD.
The Help buffer is current when this function is called, and the help
text should be loaded into this buffer. If help is found, the
function should return the buffer position which should be used as
`window-start' in the help window. Also, the variable
`idlwave-help-mode-line-indicator' should be set to a useful string,
which will be displayed in the mode line of the help window. If
should also set the variable `idlwave-help-min-frame-width' to a
positive integer. IDLWAVE will ensure that the help frame is at least
that many columns wide. Failure to find help should be indicated by
throwing an error.
When this variable is non-nil, IDLWAVE will allow the mouse-3 help click
for every routine and keyword, even though the item may not be highlighted
in blue (indicating the availability of system documentation).
The default value for this function is `idlwave-help-with-source' which
loads the routine source file into the help buffer. If you try to write
a different function which accesses a special help file or so, it is
probably a good idea to still call this function as a fallback."
:group 'idlwave-online-help
:type 'symbol)
(defcustom idlwave-help-fontify-source-code t
"*Non-nil means, fontify source code displayed as help like normal code."
:group 'idlwave-online-help
:type 'boolean)
(defcustom idlwave-help-source-try-header t
"*Non-nil means, try to find help in routine header when displaying source.
Routines which are not documented in the system manual use their source as
help text. When this variable is non-nil, we try to find a description of
the help item in the first routine doclib header above the routine definition.
If the variable is nil, or if we cannot find/parse the header, the routine
definition is displayed instead."
:group 'idlwave-online-help
:type 'boolean)
(defcustom idlwave-help-doclib-name "name"
"*A regexp for the heading word to search for in doclib headers
which specifies the `name' section. Can be used for localization
support."
:group 'idlwave-online-help
:type 'string)
(defcustom idlwave-help-doclib-keyword "KEYWORD"
"*A regexp for the heading word to search for in doclib headers
which specifies the `keywords' section. Can be used for localization
support."
:group 'idlwave-online-help
:type 'string)
;;----------------------------------------------------
;; Shell
(defcustom idlwave-shell-debug-modifiers '()
"List of modifiers to be used for the debugging commands.
Will be used to bind debugging commands in the shell buffer and in all
source buffers. These are additional convenience bindings, the debugging
commands are always available with the `C-c C-d' prefix.
If you set this to '(control shift), this means setting a breakpoint will
be on `C-S-b', compiling a source file on `C-S-c' etc. Possible modifiers
are `control', `meta', `super', `hyper', `alt', and `shift'."
:group 'idlwave-shell-general-setup
:type '(set :tag "Specify modifiers"
(const control)
(const meta)
(const super)
(const hyper)
(const alt)
(const shift)))
(defcustom idlwave-shell-automatic-start nil
"*If non-nil attempt invoke `idlwave-shell' if not already running.
This is checked when an attempt to send a command to an