-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatlab.elc
More file actions
executable file
·950 lines (933 loc) · 132 KB
/
matlab.elc
File metadata and controls
executable file
·950 lines (933 loc) · 132 KB
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
;ELC
;;; Compiled by Administrator@ALTU on Mon May 19 20:17:08 2008
;;; from file c:/emacs/matlab.el
;;; in Emacs version 23.0.0.1
;;; with all optimizations.
;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
(< (aref emacs-version (1- (length emacs-version))) ?A)
(or (and (boundp 'epoch::version) epoch::version)
(string-lessp emacs-version "19.29")))
(error "`matlab.el' was compiled for Emacs 19.29 or later"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(byte-code "\300\301!\210\300\302!\210\300\303!\207" [require easymenu tempo derived] 2)
#@33 Current version of MATLAB mode.
(defconst matlab-mode-version "2.3" (#$ . 649))
(byte-code "\301\302\303\217\210\304\305!\203 \306\307!\204! \310\311M\210\312\313M\210\314\315M\210\316\317M\210\320\321\"\203N \322\323\324\"\210\322\325\326\"\210\322\327\330\"\210\322\331\332\"\210\322\333\334\"\210\322\335\336\"\210\322\337\340\"\210\202q \322\323\341\"\210\322\325\342\"\210\322\327\343\"\210\322\331\344\"\210\322\333\345\"\210\322\335\346\"\210\322\337\347\"\210\306\350!\203\204 \322\351\350\"\210\322\352\353\"\210\202\237 \306\354!\203\227 \322\351\354\"\210\322\352\355\"\210\202\237 \351\356M\210\352\357M\210\301\207" [emacs-version nil (byte-code "\300\301!\207" [require custom] 2) ((error)) featurep custom fboundp custom-declare-variable defgroup (macro . #[(&rest args) "\300\207" [nil] 1]) custom-add-option (macro . #[(&rest args) "\300\207" [nil] 1]) defface (macro . #[(&rest args) "\300\207" [nil] 1]) defcustom (macro . #[(var value doc &rest args) "\303 \nF\207" [var value doc defvar] 4]) string-match "X[Ee]macs" defalias matlab-make-overlay make-extent matlab-overlay-put set-extent-property matlab-delete-overlay delete-extent matlab-overlay-start extent-start matlab-overlay-end extent-end matlab-cancel-timer delete-itimer matlab-run-with-idle-timer #[(secs repeat function &rest args) "\300\301\302\217\207" [nil (byte-code "\304\305\306 \n\205\n \307\211&\207" [function secs repeat args apply start-itimer "matlab" t] 9) ((error (byte-code "\303\304 \n\205 $\207" [function secs repeat start-itimer "matlab"] 5)))] 3] make-overlay overlay-put delete-overlay overlay-start overlay-end cancel-timer run-with-idle-timer point-at-bol matlab-point-at-bol matlab-point-at-eol point-at-eol line-beginning-position line-end-position (macro . #[nil "\212\300 \210`)\207" [beginning-of-line] 1]) (macro . #[nil "\212\300\210`)\207" [nil] 1])] 3)
#@67 Execute BODY only if the active buffer is a MATLAB
M-file buffer.
(defalias 'matlab-run-in-matlab-mode-only '(macro . #[(&rest body) "\301\302\303B\304BBB\207" [body if (eq major-mode 'matlab-mode) progn ((error "This command works only in a MATLAB M-file buffer."))] 4 (#$ . 2534)]))
#@42 Return non-nil if Emacs Link is running.
(defalias 'matlab-with-emacs-link #[nil "\301\302!\205 \207" [matlab-eei-process featurep matlab-eei] 2 (#$ . 2826)])
(custom-declare-group 'matlab nil "MATLAB mode." :prefix "matlab-" :group 'languages)
#@49 *The basic indentation amount in `matlab-mode'.
(custom-declare-variable 'matlab-indent-level '2 '(#$ . -3079) :group 'matlab :type 'integer)
#@70 *Basic indentation after continuation if no other methods are found.
(custom-declare-variable 'matlab-cont-level '4 '(#$ . -3227) :group 'matlab :type 'integer)
#@206 *Specify if ellipses are required at the end of a line for continuation.
Future versions of Matlab may not require ellipses ... , so a heuristic determining if
there is to be continuation is used instead.
(custom-declare-variable 'matlab-cont-requires-ellipsis 't '(#$ . -3395) :group 'matlab :type 'integer)
#@465 *How far to indent case/otherwise statements in a switch.
This can be an integer, which is the distance to indent the CASE and
OTHERWISE commands, and how far to indent commands appearing in CASE
and OTHERWISE blocks. It can also be a cons cell which is of form
(CASEINDENT . COMMANDINDENT)
where CASEINDENT is the indentation of the CASE and OTHERWISE
statements, and COMMANDINDENT is the indentation of commands appearing
after the CASE or OTHERWISE command.
(custom-declare-variable 'matlab-case-level ''(1 . 1) '(#$ . -3711) :group 'matlab :type 'sexp)
#@39 *If non-nil, indent body of function.
(custom-declare-variable 'matlab-indent-function 'nil '(#$ . -4277) :group 'matlab :type 'boolean)
#@226 *Regex describing functions whose first arg is special.
This specialness means that all following parameters which appear on
continued lines should appear indented to line up with the second
argument, not the first argument.
(custom-declare-variable 'matlab-indent-past-arg1-functions '"[sg]et\\(_param\\)?\\|waitfor" '(#$ . -4421) :group 'matlab :type 'string)
#@192 *The maximum length to indent when indenting past arg1.
If arg1 is exceptionally long, then only this number of characters
will be indented beyond the open paren starting the parameter list.
(custom-declare-variable 'matlab-arg1-max-indent-length '15 '(#$ . -4790))
#@357 Alist of maximum indentations when lining up code.
Each element is of the form (CHAR . INDENT) where char is a character
the indent engine is using, and INDENT is the maximum indentation
allowed. Indent could be of the form (MAXIMUM . INDENT), where
MAXIMUM is the maximum allowed calculated indent, and INDENT is the
amount to use if MAXIMUM is reached.
(custom-declare-variable 'matlab-maximum-indents ''((61 10 . 4) (40 . 50) (91 . 20) (123 . 20)) '(#$ . 5063) :group 'matlab :type '(repeat (cons (character :tag "Open List Character") (sexp :tag "Number (max) or cons (max indent)"))))
#@215 *If true, add in a few simulink customizations.
This variable's state is mostly useful when set at load time when
simulink font lock keywords can be removed. This will handle
additional cases as the need arrises.
(custom-declare-variable 'matlab-handle-simulink 't '(#$ . -5661) :group 'matlab :type 'boolean)
#@73 *If true, set variable `auto-fill-function' to our function at startup.
(custom-declare-variable 'matlab-auto-fill 't '(#$ . -5978) :group 'matlab :type 'boolean)
#@453 Number of characters around `fill-column' we can fudge filling.
Basically, there are places that are very convenient to fill at, but
might not be the closest fill spot, or occur after `fill-column'.
If they occur within this fudge factor, we will use them.
Also, if none of the above occur, and we find a symbol to break at,
but an open paren (group) starts or ends within this fudge factor,
move there to boost the amount of fill leverage we can get.
(custom-declare-variable 'matlab-fill-fudge '10 '(#$ . 6148) :group 'matlab :type 'integer)
#@170 The longest line allowed when auto-filling code.
This overcomes situations where the `fill-column' plus the
`matlab-fill-fudge' is greater than some hard desired limit.
(custom-declare-variable 'matlab-fill-fudge-hard-maximum '79 '(#$ . 6699) :group 'matlab :type 'integer)
#@108 Text used to perform continuation on code lines.
This is used to generate and identify continuation lines.
(custom-declare-variable 'matlab-elipsis-string '"..." '(#$ . 6980))
#@77 *If true, `auto-fill-mode' causes code lines to be automatically continued.
(custom-declare-variable 'matlab-fill-code 't '(#$ . -7162) :group 'matlab :type 'boolean)
#@143 *Non-nil means to count the ellipsis when auto filling.
This effectively shortens the `fill-column' by the length of
`matlab-elipsis-string'.
(custom-declare-variable 'matlab-fill-count-ellipsis-flag 't '(#$ . -7336))
#@199 *Non-nil means that when auto-fill is on, strings are broken across lines.
If `matlab-fill-count-ellipsis-flag' is non nil, this shortens the
`fill-column' by the length of `matlab-elipsis-string'.
(custom-declare-variable 'matlab-fill-strings-flag 't '(#$ . -7561))
#@52 *The goal comment column in `matlab-mode' buffers.
(custom-declare-variable 'matlab-comment-column '40 '(#$ . -7834) :group 'matlab :type 'integer)
#@70 *Amount of anti-indentation to use for comments in relation to code.
(custom-declare-variable 'matlab-comment-anti-indent '0 '(#$ . -7988) :group 'matlab :type 'integer)
#@45 *String to start comment on line by itself.
(custom-declare-variable 'matlab-comment-line-s '"% " '(#$ . -8164) :group 'matlab :type 'string)
#@45 *String to start comment on line with code.
(custom-declare-variable 'matlab-comment-on-line-s '"% " '(#$ . -8312) :group 'matlab :type 'string)
#@79 *String inserted by \[matlab-comment-region] at start of each line in region.
(custom-declare-variable 'matlab-comment-region-s '"% $$$ " '(#$ . -8463) :group 'matlab :type 'string)
#@53 *Non-nil means to verify M whenever we save a file.
(custom-declare-variable 'matlab-verify-on-save-flag 't '(#$ . -8651) :group 'matlab :type 'boolean)
#@184 List of function symbols which perform a verification and fix to M code.
Each function gets no arguments, and returns nothing. They can move
point, but it will be restored for them.
(custom-declare-variable 'matlab-mode-verify-fix-functions ''(matlab-mode-vf-functionname) '(#$ . 8811) :group 'matlab :type '(repeat (choice :tag "Function: " '(matlab-mode-vf-functionname matlab-mode-vf-block-matches-forward matlab-mode-vf-block-matches-backward matlab-mode-vf-quietafy-buffer))))
#@66 *Largest buffer size allowed for block verification during save.
(custom-declare-variable 'matlab-block-verify-max-buffer-size '50000 '(#$ . -9300) :group 'matlab :type 'integer)
#@50 *If non-nil, show the version number on startup.
(custom-declare-variable 'matlab-vers-on-startup 't '(#$ . -9485) :group 'matlab :type 'boolean)
#@140 *Non-nil means to highlight the matching if/end/whatever.
The highlighting only occurs when the cursor is on a block start or end
keyword.
(custom-declare-variable 'matlab-highlight-block-match-flag 't '(#$ . -9638) :group 'matlab :type 'boolean)
#@127 *Non-nil means to show code details in the minibuffer.
This will only work if `matlab-highlight-block-match-flag' is non-nil.
(custom-declare-variable 'matlab-show-periodic-code-details-flag 'nil '(#$ . -9892) :group 'matlab :type 'boolean)
#@53 *List of functions to call on entry to MATLAB mode.
(custom-declare-variable 'matlab-mode-hook 'nil '(#$ . -10139) :group 'matlab :type 'hook)
#@385 *How the `matlab-complete-symbol' interfaces with the user.
Valid values are:
'increment - which means that new strings are tried with each
successive call until all methods are exhausted.
(Similar to `hippie-expand'.)
'complete - Which means that if there is no single completion, then
all possibilities are displayed in a completion buffer.
(custom-declare-variable 'matlab-completion-technique ''complete '(#$ . -10289) :group 'matlab :type '(radio (const :tag "Incremental completion (hippie-expand)." increment) (const :tag "Show completion buffer." complete)))
(byte-code "\301\302!\203/ \303\304!\203/ \305\306!\203 \306\202 \307\310\311\312\313\314!\315\316!FDC\317\320\321%\210)\202B \305\306!\203= \322\306\311\"\210\202B \322\307\311\"\210\301\207" [l-region-face featurep custom fboundp custom-declare-variable facep region zmacs-region custom-declare-face matlab-region-face t :background face-background :foreground face-foreground "*Face used to highlight a matlab region." :group matlab copy-face] 8)
#@46 Self reference for unterminated string face.
(defvar matlab-unterminated-string-face 'matlab-unterminated-string-face (#$ . 11358))
#@39 Self reference for simulink keywords.
(defvar matlab-simulink-keyword-face 'matlab-simulink-keyword-face (#$ . 11496))
#@74 Make adjustments for font lock.
If font lock is not loaded, lay in wait.
(defalias 'matlab-font-lock-adjustments #[nil "\302\303!\2039 \304\305!\2039 \306\307\310\311\312!\313\314!\315\310\257DC\316\317\320%\210\306\321\310\311\312 !\313\314 !\315\310\257DC\322#\210\202g \323\300!\203G \324\300\307\"\210\202K \325\307!\210\326\307\310\"\210\323\301!\203^ \324\301\321\"\210\202b \325\321!\210\326\321\310\"\210\327\330\331\"\207" [font-lock-string-face font-lock-type-face featurep custom fboundp custom-declare-variable custom-declare-face matlab-unterminated-string-face t :background face-background :foreground face-foreground :underline "*Face used to highlight unterminated strings." :group matlab matlab-simulink-keyword-face "*Face used to highlight simulink specific functions." facep copy-face make-face set-face-underline-p remove-hook font-lock-mode-hook matlab-font-lock-adjustments] 9 (#$ . 11621)])
(byte-code "\300\301!\203\f \302 \210\202 \303\304\302\"\210\300\207" [featurep font-lock matlab-font-lock-adjustments add-hook font-lock-mode-hook] 3)
#@40 List of templates used in MATLAB mode.
(defvar matlab-tempo-tags nil (#$ . 12700))
#@49 The syntax table used in `matlab-mode' buffers.
(defvar matlab-mode-syntax-table (byte-code "\301\302 !\303\304\305#\210\303\306\307#\210\303\310\311#\210\303\312\313#\210\303\314\315#\210\303\316\313#\210\303\317\313#\210\303\320\313#\210\303\321\313#\210\303\322\313#\210\303\323\313#\210\303\324\313#\210\303\325\313#\210\303\326\313#\210\303\327\313#\210)\207" [st make-syntax-table standard-syntax-table modify-syntax-entry 95 "_" 37 "<" 10 ">" 92 "." 9 " " 43 45 42 39 47 61 60 62 38 124] 4) (#$ . 12789))
#@47 The syntax table used when navigating blocks.
(defvar matlab-mode-special-syntax-table (byte-code "\302!\303\304\305 #\210 )\207" [matlab-mode-syntax-table st copy-syntax-table modify-syntax-entry 95 "w"] 4) (#$ . 13324))
#@49 The abbrev table used in `matlab-mode' buffers.
(defvar matlab-mode-abbrev-table nil (#$ . 13554))
(define-abbrev-table 'matlab-mode-abbrev-table nil)
#@61 The help key map for `matlab-mode' and `matlab-shell-mode'.
(defvar matlab-help-map (byte-code "\301 \302\303\304#\210\302\305\306#\210\302\307\310#\210\302\311\312#\210\302\313\314#\210)\207" [km make-sparse-keymap define-key "r" matlab-shell-run-command "f" matlab-shell-describe-command "a" matlab-shell-apropos "v" matlab-shell-describe-variable "t" matlab-shell-topic-browser] 4) (#$ . 13711))
#@58 Keymap used for inserting simple texts based on context.
(defvar matlab-insert-map (byte-code "\301 \302\303\304#\210\302\305\306#\210\302\307\310#\210\302\311\312#\210\302\313\314#\210\302\315\316#\210\302\317\320#\210\302\321\322#\210\302\323\324#\210\302\325\326#\210\302\327\330#\210\302\331\332#\210)\207" [km make-sparse-keymap define-key "c" matlab-insert-next-case "e" matlab-insert-end-block "i" tempo-template-matlab-if "I" tempo-template-matlab-if-else "f" tempo-template-matlab-for "s" tempo-template-matlab-switch "t" tempo-template-matlab-try "w" tempo-template-matlab-while "F" tempo-template-matlab-function "'" matlab-stringify-region "" matlab-ispell-strings "" matlab-ispell-comments] 4) (#$ . 14123))
#@35 The keymap used in `matlab-mode'.
(defvar matlab-mode-map (byte-code "\304 \305\306\307#\210\305\310\311#\210\305\312\313#\210\305\314\315#\210\305\316 #\210\305\317\320#\210\305\321\322#\210\305\323\324#\210\305\325\326#\210\305\327\330#\210\305\331\332#\210\305\333\334#\210\305\335\n#\210\305\336\337#\210\305\340\341#\210\305\342\343#\210\305\344\345#\210\305\346\347#\210\305\350\351#\210\305\352\353#\210\305\354\355#\210\305\356\357#\210\305\360\361#\210\305\362\363#\210\305\364\365#\210\305\366\367#\210\370\371\"\203\257 \305\372\373#\210\202\265 \305\374\373#\210\375\376\311#\210)\207" [km matlab-insert-map matlab-help-map emacs-version make-sparse-keymap define-key [return] matlab-return ";" matlab-comment-region ":" matlab-uncomment-region [(control c) return] matlab-comment-return [(control c) (control c)] [(control c) (control f)] matlab-fill-comment-line [(control c) (control j)] matlab-justify-line [(control c) (control q)] matlab-fill-region [(control c) (control s)] matlab-shell-save-and-go [(control c) (control r)] matlab-shell-run-region [(control c) (control t)] matlab-show-line-info [(control c) 46] matlab-find-file-on-path [(control h) (control m)] [(control j)] matlab-linefeed "\215" newline [(meta \;)] matlab-comment [(meta q)] matlab-fill-paragraph [(meta a)] matlab-beginning-of-command [(meta e)] matlab-end-of-command [(meta j)] matlab-comment-line-break-function [(meta s)] matlab-show-matlab-shell-buffer "\211" matlab-complete-symbol [(meta control f)] matlab-forward-sexp [(meta control b)] matlab-backward-sexp [(meta control a)] matlab-beginning-of-defun [(meta control e)] matlab-end-of-defun string-match "XEmacs" [(control meta button1)] matlab-find-file-click [(control meta mouse-2)] substitute-key-definition comment-region] 4) (#$ . 14866))
#@190 Regexp used to represent the character before the string char '.
The ' character has restrictions on what starts a string which is needed
when attempting to understand the current context.
(defvar matlab-string-start-regexp "\\(^\\|[^]})a-zA-Z0-9_.']\\)" (#$ . 16705))
#@191 Regexp used to represent the character pattern for ending a string.
The ' character can be used as a transpose, and can transpose transposes.
Therefore, to end, we must check all that goop.
(defvar matlab-string-end-regexp "[^'\n]*\\(''[^'\n]*\\)*'" (#$ . 16981))
#@115 When font locking strings, call this function for normal strings.
Argument LIMIT is the maximum distance to scan.
(defalias 'matlab-font-lock-string-match-normal #[(limit) "\303\304 \305\306\260\n\"\207" [matlab-string-start-regexp matlab-string-end-regexp limit matlab-font-lock-string-match-here "\\('" "\\)" "\\([^']\\|$\\)"] 6 (#$ . 17252)])
#@115 When font locking strings, call this function for normal strings.
Argument LIMIT is the maximum distance to scan.
(defalias 'matlab-font-lock-string-match-unterminated #[(limit) "\302\303P \"\207" [matlab-string-start-regexp limit matlab-font-lock-string-match-here "\\('[^'\n]*\\(''[^'\n]*\\)*\\)$"] 3 (#$ . 17607)])
#@192 When font-locking strings, call this function to determine a match.
Argument REGEX is the expression to scan for. Match 2 must be the string.
Argument LIMIT is the maximum distance to scan.
(defalias 'matlab-font-lock-string-match-here #[(regex limit) "\303\304 \n\305#\203- \306\225\306\224b\210\307 \206\"