summaryrefslogtreecommitdiff
path: root/devel/python-components-create-menu.el
blob: 9e4371ff5039045cfc3c7a613ae4842997c53510 (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
;;; python-components-create-menu.el - Generate the menu

;; Copyright (C) 2015  Andreas Röhler

;; Author: Andreas Röhler <andreas.roehler@easy-emacs.de>

;; Keywords: languages, processes, python, oop

;; Python-components-mode started from python-mode.el
;; and python.el, where Tim Peters, Barry A. Warsaw,
;; Skip Montanaro, Ken Manheimer, Dave Love and many
;; others wrote major parts. Author of ipython.el's
;; stuff merged is Alexander Schmolck.

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;;; Some of this forms to generate parts of
;; python-mode.el are just drafts, others outdated.
;; Kept for inspiration.

;;; Code:

;; Forms used building the menu

(setq py-menu-abbrev-form "	   :help \"see also `py-add-abbrev'\"
	   :filter (lambda (&rest junk)
		     (abbrev-table-menu python-mode-abbrev-table))")

(setq py-menu-head ";; python-components-menu.el --- Provide the python-mode menu

;; This file not shipped as part of GNU Emacs.

;; Copyright (C) 2015  Andreas Röhler
;; Author: Andreas Röhler <andreas.roehler@easy-emacs.de>

;; Keywords: languages, processes, python, oop

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;;; Code:
")


(setq py-menu-custom-forms "         (\"Customize\"

	  [\"Python-mode customize group\" (customize-group 'python-mode)
	   :help \"Open the customization buffer for Python mode\"]
	  (\"Switches\"
	   :help \"Toggle useful modes like `highlight-indentation'\"
	   (\"Interpreter\"

	    [\"Shell prompt read only\"
	     (setq py-shell-prompt-read-only
		   (not py-shell-prompt-read-only))
	     :help \"If non-nil, the python prompt is read only.  Setting this variable will only effect new shells.Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-shell-prompt-read-only]

	    [\"Remove cwd from path\"
	     (setq py-remove-cwd-from-path
		   (not py-remove-cwd-from-path))
	     :help \"Whether to allow loading of Python modules from the current directory.
If this is non-nil, Emacs removes '' from sys.path when starting
a Python process.  This is the default, for security
reasons, as it is easy for the Python process to be started
without the user's realization (e.g. to perform completion).Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-remove-cwd-from-path]

	    [\"Honor IPYTHONDIR \"
	     (setq py-honor-IPYTHONDIR-p
		   (not py-honor-IPYTHONDIR-p))
	     :help \"When non-nil ipython-history file is constructed by \\\$IPYTHONDIR
followed by \"/history\". Default is nil.

Otherwise value of py-ipython-history is used. Use `M-x customize-variable' to set it permanently\"
:style toggle :selected py-honor-IPYTHONDIR-p]

	    [\"Honor PYTHONHISTORY \"
	     (setq py-honor-PYTHONHISTORY-p
		   (not py-honor-PYTHONHISTORY-p))
	     :help \"When non-nil python-history file is set by \\\$PYTHONHISTORY
Default is nil.

Otherwise value of py-python-history is used. Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-honor-PYTHONHISTORY-p]

	    [\"Enforce py-shell-name\" force-py-shell-name-p-on
	     :help \"Enforce customized default `py-shell-name' should upon execution. \"]

	    [\"Don't enforce default interpreter\" force-py-shell-name-p-off
	     :help \"Make execute commands guess interpreter from environment\"]

	    [\"Enforce local Python shell \" py-force-local-shell-on
	     :help \"Locally indicated Python being enforced upon sessions execute commands. \"]

	    [\"Remove local Python shell enforcement, restore default\" py-force-local-shell-off
	     :help \"Restore `py-shell-name' default value and `behaviour'. \"])

	   (\"Execute\"

	    [\"Fast process\" py-fast-process-p
	     :help \" `py-fast-process-p'

Use `py-fast-process'\\.

Commands prefixed \\\"py-fast-...\\\" suitable for large output

See: large output makes Emacs freeze, lp:1253907

Output-buffer is not in comint-mode\"
	     :style toggle :selected py-fast-process-p]

	    [\"Python mode v5 behavior\"
	     (setq python-mode-v5-behavior-p
		   (not python-mode-v5-behavior-p))
	     :help \"Execute region through `shell-command-on-region' as
v5 did it - lp:990079. This might fail with certain chars - see UnicodeEncodeError lp:550661

Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected python-mode-v5-behavior-p]

	    [\"Force shell name \"
	     (setq py-force-py-shell-name-p
		   (not py-force-py-shell-name-p))
	     :help \"When `t', execution with kind of Python specified in `py-shell-name' is enforced, possibly shebang doesn't take precedence. Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-force-py-shell-name-p]

	    [\"Execute \\\"if name == main\\\" blocks p\"
	     (setq py-if-name-main-permission-p
		   (not py-if-name-main-permission-p))
	     :help \" `py-if-name-main-permission-p'

Allow execution of code inside blocks delimited by
if __name__ == '__main__'

Default is non-nil. \"
	     :style toggle :selected py-if-name-main-permission-p]

	    [\"Ask about save\"
	     (setq py-ask-about-save
		   (not py-ask-about-save))
	     :help \"If not nil, ask about which buffers to save before executing some code.
Otherwise, all modified buffers are saved without asking.Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-ask-about-save]

	    [\"Store result\"
	     (setq py-store-result-p
		   (not py-store-result-p))
	     :help \" `py-store-result-p'

When non-nil, put resulting string of `py-execute-...' into kill-ring, so it might be yanked. \"
	     :style toggle :selected py-store-result-p]

	    [\"Prompt on changed \"
	     (setq py-prompt-on-changed-p
		   (not py-prompt-on-changed-p))
	     :help \"When called interactively, ask for save before a changed buffer is sent to interpreter.

Default is `t'Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-prompt-on-changed-p]

	    [\"Dedicated process \"
	     (setq py-dedicated-process-p
		   (not py-dedicated-process-p))
	     :help \"If commands executing code use a dedicated shell.

Default is nilUse `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-dedicated-process-p]

	    [\"Execute without temporary file\"
	     (setq py-execute-no-temp-p
		   (not py-execute-no-temp-p))
	     :help \" `py-execute-no-temp-p'
Seems Emacs-24.3 provided a way executing stuff without temporary files.
In experimental state yet \"
	     :style toggle :selected py-execute-no-temp-p]

	    [\"Warn tmp files left \"
	     (setq py--warn-tmp-files-left-p
		   (not py--warn-tmp-files-left-p))
	     :help \"Messages a warning, when `py-temp-directory' contains files susceptible being left by previous Python-mode sessions. See also lp:987534 Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py--warn-tmp-files-left-p])

	   (\"Edit\"

	    (\"Completion\"

	     [\"Set Pymacs-based complete keymap \"
	      (setq py-set-complete-keymap-p
		    (not py-set-complete-keymap-p))
	      :help \"If `py-complete-initialize', which sets up enviroment for Pymacs based py-complete, should load it's keys into `python-mode-map'

Default is nil.
See also resp. edit `py-complete-set-keymap' Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-set-complete-keymap-p]

	     [\"Indent no completion \"
	      (setq py-indent-no-completion-p
		    (not py-indent-no-completion-p))
	      :help \"If completion function should indent when no completion found. Default is `t'

Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-indent-no-completion-p]

	     [\"Company pycomplete \"
	      (setq py-company-pycomplete-p
		    (not py-company-pycomplete-p))
	      :help \"Load company-pycomplete stuff. Default is nilUse `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-company-pycomplete-p])

	    (\"Filling\"

	     (\"Docstring styles\"
	      :help \"Switch docstring-style\"

	      [\"Nil\" py-set-nil-docstring-style
	       :help \" `py-set-nil-docstring-style'

Set py-docstring-style to nil, format string normally. \"]

	      [\"pep-257-nn\" py-set-pep-257-nn-docstring-style
	       :help \" `py-set-pep-257-nn-docstring-style'

Set py-docstring-style to 'pep-257-nn \"]

	      [\"pep-257\" py-set-pep-257-docstring-style
	       :help \" `py-set-pep-257-docstring-style'

Set py-docstring-style to 'pep-257 \"]

	      [\"django\" py-set-django-docstring-style
	       :help \" `py-set-django-docstring-style'

Set py-docstring-style to 'django \"]

	      [\"onetwo\" py-set-onetwo-docstring-style
	       :help \" `py-set-onetwo-docstring-style'

Set py-docstring-style to 'onetwo \"]

	      [\"symmetric\" py-set-symmetric-docstring-style
	       :help \" `py-set-symmetric-docstring-style'

Set py-docstring-style to 'symmetric \"])

	     [\"Auto-fill mode\"
	      (setq py-auto-fill-mode
		    (not py-auto-fill-mode))
	      :help \"Fill according to `py-docstring-fill-column' and `py-comment-fill-column'

Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-auto-fill-mode])

	    [\"Use current dir when execute\"
	     (setq py-use-current-dir-when-execute-p
		   (not py-use-current-dir-when-execute-p))
	     :help \" `toggle-py-use-current-dir-when-execute-p'

Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-use-current-dir-when-execute-p]

	    (\"Indent\"
	     (\"TAB related\"

	      [\"indent-tabs-mode\"
	       (setq indent-tabs-mode
		     (not indent-tabs-mode))
	       :help \"Indentation can insert tabs if this is non-nil.

Use `M-x customize-variable' to set it permanently\"
	       :style toggle :selected indent-tabs-mode]

	      [\"Tab indent\"
	       (setq py-tab-indent
		     (not py-tab-indent))
	       :help \"Non-nil means TAB in Python mode calls `py-indent-line'.Use `M-x customize-variable' to set it permanently\"
	       :style toggle :selected py-tab-indent]

	      [\"Tab shifts region \"
	       (setq py-tab-shifts-region-p
		     (not py-tab-shifts-region-p))
	       :help \"If `t', TAB will indent/cycle the region, not just the current line.

Default is nil
See also `py-tab-indents-region-p'

Use `M-x customize-variable' to set it permanently\"
	       :style toggle :selected py-tab-shifts-region-p]

	      [\"Tab indents region \"
	       (setq py-tab-indents-region-p
		     (not py-tab-indents-region-p))
	       :help \"When `t' and first TAB doesn't shift, indent-region is called.

Default is nil
See also `py-tab-shifts-region-p'

Use `M-x customize-variable' to set it permanently\"
	       :style toggle :selected py-tab-indents-region-p])

	     [\"Close at start column\"
	      (setq py-closing-list-dedents-bos
		    (not py-closing-list-dedents-bos))
	      :help \"When non-nil, indent list's closing delimiter like start-column.

It will be lined up under the first character of
 the line that starts the multi-line construct, as in:

my_list = \\[
    1, 2, 3,
    4, 5, 6,
]

Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-closing-list-dedents-bos]

	     [\"Closing list keeps space\"
	      (setq py-closing-list-keeps-space
		    (not py-closing-list-keeps-space))
	      :help \"If non-nil, closing parenthesis dedents onto column of opening plus `py-closing-list-space', default is nil Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-closing-list-keeps-space]

	     [\"Closing list space\"
	      (setq py-closing-list-space
		    (not py-closing-list-space))
	      :help \"Number of chars, closing parenthesis outdent from opening, default is 1 Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-closing-list-space]

	     [\"Tab shifts region \"
	      (setq py-tab-shifts-region-p
		    (not py-tab-shifts-region-p))
	      :help \"If `t', TAB will indent/cycle the region, not just the current line.

Default is nil
See also `py-tab-indents-region-p'Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-tab-shifts-region-p]

	     [\"Lhs inbound indent\"
	      (setq py-lhs-inbound-indent
		    (not py-lhs-inbound-indent))
	      :help \"When line starts a multiline-assignment: How many colums indent should be more than opening bracket, brace or parenthesis. Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-lhs-inbound-indent]

	     [\"Continuation offset\"
	      (setq py-continuation-offset
		    (not py-continuation-offset))
	      :help \"With numeric ARG different from 1 py-continuation-offset is set to that value; returns py-continuation-offset. Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-continuation-offset]

	     [\"Electric colon\"
	      (setq py-electric-colon-active-p
		    (not py-electric-colon-active-p))
	      :help \" `py-electric-colon-active-p'

`py-electric-colon' feature.  Default is `nil'. See lp:837065 for discussions. \"
	      :style toggle :selected py-electric-colon-active-p]

	     [\"Electric colon at beginning of block only\"
	      (setq py-electric-colon-bobl-only
		    (not py-electric-colon-bobl-only))
	      :help \"When inserting a colon, do not indent lines unless at beginning of block.

Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-electric-colon-bobl-only]

	     [\"Electric yank active \"
	      (setq py-electric-yank-active-p
		    (not py-electric-yank-active-p))
	      :help \" When non-nil, `yank' will be followed by an `indent-according-to-mode'.

Default is nilUse `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-electric-yank-active-p]

	     [\"Electric kill backward \"
	      (setq py-electric-kill-backward-p
		    (not py-electric-kill-backward-p))
	      :help \"Affects `py-electric-backspace'. Default is nil.

If behind a delimited form of braces, brackets or parentheses,
backspace will kill it's contents

With when cursor after
my_string\\[0:1]
--------------^

==>

my_string\\[]
----------^

In result cursor is insided emptied delimited form.Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-electric-kill-backward-p]

	     [\"Trailing whitespace smart delete \"
	      (setq py-trailing-whitespace-smart-delete-p
		    (not py-trailing-whitespace-smart-delete-p))
	      :help \"Default is nil. When t, python-mode calls
    (add-hook 'before-save-hook 'delete-trailing-whitespace nil 'local)

Also commands may delete trailing whitespace by the way.
When editing other peoples code, this may produce a larger diff than expected Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-trailing-whitespace-smart-delete-p]

	     [\"Newline delete trailing whitespace \"
	      (setq py-newline-delete-trailing-whitespace-p
		    (not py-newline-delete-trailing-whitespace-p))
	      :help \"Delete trailing whitespace maybe left by `py-newline-and-indent'.

Default is `t'. See lp:1100892 Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-newline-delete-trailing-whitespace-p]

	     [\"Dedent keep relative column\"
	      (setq py-dedent-keep-relative-column
		    (not py-dedent-keep-relative-column))
	      :help \"If point should follow dedent or kind of electric move to end of line. Default is t - keep relative position. Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-dedent-keep-relative-column]

	     [\"Indent paren spanned multilines \"
	      (setq py-indent-paren-spanned-multilines-p
		    (not py-indent-paren-spanned-multilines-p))
	      :help \"If non-nil, indents elements of list a value of `py-indent-offset' to first element:

def foo():
    if (foo &&
            baz):
        bar()

Default lines up with first element:

def foo():
    if (foo &&
        baz):
        bar()
Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-indent-paren-spanned-multilines-p]

	     [\"Indent honors multiline listing\"
	      (setq py-indent-honors-multiline-listing
		    (not py-indent-honors-multiline-listing))
	      :help \"If `t', indents to 1\\+ column of opening delimiter. If `nil', indent adds one level to the beginning of statement. Default is `nil'. Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-indent-honors-multiline-listing]

	     [\"Indent comment \"
	      (setq py-indent-comments
		    (not py-indent-comments))
	      :help \"If comments should be indented like code. Default is `nil'.

Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-indent-comments]

	     [\"Uncomment indents \"
	      (setq py-uncomment-indents-p
		    (not py-uncomment-indents-p))
	      :help \"When non-nil, after uncomment indent lines. Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-uncomment-indents-p]

	     [\"Indent honors inline comment\"
	      (setq py-indent-honors-inline-comment
		    (not py-indent-honors-inline-comment))
	      :help \"If non-nil, indents to column of inlined comment start.
Default is nil. Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-indent-honors-inline-comment]

	     [\"Kill empty line\"
	      (setq py-kill-empty-line
		    (not py-kill-empty-line))
	      :help \"If t, py-indent-forward-line kills empty lines. Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-kill-empty-line]

	     (\"Smart indentation\"
	      :help \"Toggle py-smart-indentation'

Use `M-x customize-variable' to set it permanently\"

	      [\"Toggle py-smart-indentation\" toggle-py-smart-indentation
	       :help \"Toggles py-smart-indentation

Use `M-x customize-variable' to set it permanently\"]

	      [\"py-smart-indentation on\" py-smart-indentation-on
	       :help \"Switches py-smart-indentation on

Use `M-x customize-variable' to set it permanently\"]

	      [\"py-smart-indentation off\" py-smart-indentation-off
	       :help \"Switches py-smart-indentation off

Use `M-x customize-variable' to set it permanently\"])

	     [\"Beep if tab change\"
	      (setq py-beep-if-tab-change
		    (not py-beep-if-tab-change))
	      :help \"Ring the bell if `tab-width' is changed.
If a comment of the form

                           	# vi:set tabsize=<number>:

is found before the first code line when the file is entered, and the
current value of (the general Emacs variable) `tab-width' does not
equal <number>, `tab-width' is set to <number>, a message saying so is
displayed in the echo area, and if `py-beep-if-tab-change' is non-nil
the Emacs bell is also rung as a warning.Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-beep-if-tab-change]

	     [\"Highlight indentation\" highlight-indentation
	      :help \"Toggle highlight indentation.

Use `M-x customize-variable' to set it permanently

Make sure `highlight-indentation' is installed\"

	      ]

	     [\"Electric comment \"
	      (setq py-electric-comment-p
		    (not py-electric-comment-p))
	      :help \"If \\\"#\\\" should call `py-electric-comment'. Default is `nil'.

Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-electric-comment-p]

	     [\"Electric comment add space \"
	      (setq py-electric-comment-add-space-p
		    (not py-electric-comment-add-space-p))
	      :help \"If py-electric-comment should add a space.  Default is `nil'. Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-electric-comment-add-space-p]

	     [\"Empty line closes \"
	      (setq py-empty-line-closes-p
		    (not py-empty-line-closes-p))
	      :help \"When non-nil, dedent after empty line following block

if True:
    print(\\\"Part of the if-statement\\\")

print(\\\"Not part of the if-statement\\\")

Default is nil

If non-nil, a C-j from empty line dedents.
Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-empty-line-closes-p])
	    [\"Defun use top level \"
	     (setq py-defun-use-top-level-p
		   (not py-defun-use-top-level-p))
	     :help \"When non-nil, keys C-M-a, C-M-e address top-level form.

Beginning- end-of-defun forms use
commands `py-backward-top-level', `py-forward-top-level'

mark-defun marks top-level form at point etc. \"
	     :style toggle :selected py-defun-use-top-level-p]

	    [\"Close provides newline\"
	     (setq py-close-provides-newline
		   (not py-close-provides-newline))
	     :help \"If a newline is inserted, when line after block isn't empty. Default is non-nil. Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-close-provides-newline]

	    [\"Block comment prefix \"
	     (setq py-block-comment-prefix-p
		   (not py-block-comment-prefix-p))
	     :help \"If py-comment inserts py-block-comment-prefix.

Default is tUse `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-block-comment-prefix-p])

	   (\"Display\"

	    (\"Index\"

	     [\"Imenu create index \"
	      (setq py--imenu-create-index-p
		    (not py--imenu-create-index-p))
	      :help \"Non-nil means Python mode creates and displays an index menu of functions and global variables. Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py--imenu-create-index-p]

	     [\"Imenu show method args \"
	      (setq py-imenu-show-method-args-p
		    (not py-imenu-show-method-args-p))
	      :help \"Controls echoing of arguments of functions & methods in the Imenu buffer.
When non-nil, arguments are printed.Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-imenu-show-method-args-p]
	     [\"Switch index-function\" py-switch-imenu-index-function
	      :help \"`py-switch-imenu-index-function'
Switch between `py--imenu-create-index' from 5.1 series and `py--imenu-create-index-new'.\"])

	    (\"Fontification\"

	     [\"Mark decorators\"
	      (setq py-mark-decorators
		    (not py-mark-decorators))
	      :help \"If py-mark-def-or-class functions should mark decorators too. Default is `nil'. Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-mark-decorators]

	     [\"Fontify shell buffer \"
	      (setq py-fontify-shell-buffer-p
		    (not py-fontify-shell-buffer-p))
	      :help \"If code in Python shell should be highlighted as in script buffer.

Default is nil.

If `t', related vars like `comment-start' will be set too.
Seems convenient when playing with stuff in IPython shell
Might not be TRT when a lot of output arrives Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-fontify-shell-buffer-p]

	     [\"Use font lock doc face \"
	      (setq py-use-font-lock-doc-face-p
		    (not py-use-font-lock-doc-face-p))
	      :help \"If documention string inside of def or class get `font-lock-doc-face'.

`font-lock-doc-face' inherits `font-lock-string-face'.

Call M-x `customize-face' in order to have a visible effect. Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-use-font-lock-doc-face-p])

	    [\"Switch buffers on execute\"
	     (setq py-switch-buffers-on-execute-p
		   (not py-switch-buffers-on-execute-p))
	     :help \"When non-nil switch to the Python output buffer.

Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-switch-buffers-on-execute-p]

	    [\"Split windows on execute\"
	     (setq py-split-window-on-execute
		   (not py-split-window-on-execute))
	     :help \"When non-nil split windows.

Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-split-window-on-execute]

	    [\"Keep windows configuration\"
	     (setq py-keep-windows-configuration
		   (not py-keep-windows-configuration))
	     :help \"If a windows is splitted displaying results, this is directed by variable `py-split-window-on-execute'\\. Also setting `py-switch-buffers-on-execute-p' affects window-configuration\\. While commonly a screen splitted into source and Python-shell buffer is assumed, user may want to keep a different config\\.

Setting `py-keep-windows-configuration' to `t' will restore windows-config regardless of settings mentioned above\\. However, if an error occurs, it's displayed\\.

To suppres window-changes due to error-signaling also: M-x customize-variable RET. Set `py-keep-4windows-configuration' onto 'force

Default is nil Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-keep-windows-configuration]

	    [\"Which split windows on execute function\"
	     (progn
	       (if (eq 'split-window-vertically py-split-windows-on-execute-function)
		   (setq py-split-windows-on-execute-function'split-window-horizontally)
		 (setq py-split-windows-on-execute-function 'split-window-vertically))
	       (message \"py-split-windows-on-execute-function set to: %s\" py-split-windows-on-execute-function))

	     :help \"If `split-window-vertically' or `...-horizontally'. Use `M-x customize-variable' RET `py-split-windows-on-execute-function' RET to set it permanently\"
	     :style toggle :selected py-split-windows-on-execute-function]

	    [\"Modeline display full path \"
	     (setq py-modeline-display-full-path-p
		   (not py-modeline-display-full-path-p))
	     :help \"If the full PATH/TO/PYTHON should be displayed in shell modeline.

Default is nil. Note: when `py-shell-name' is specified with path, it's shown as an acronym in buffer-name already. Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-modeline-display-full-path-p]

	    [\"Modeline acronym display home \"
	     (setq py-modeline-acronym-display-home-p
		   (not py-modeline-acronym-display-home-p))
	     :help \"If the modeline acronym should contain chars indicating the home-directory.

Default is nil Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-modeline-acronym-display-home-p]

	    [\"Hide show hide docstrings\"
	     (setq py-hide-show-hide-docstrings
		   (not py-hide-show-hide-docstrings))
	     :help \"Controls if doc strings can be hidden by hide-showUse `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-hide-show-hide-docstrings]

	    [\"Hide comments when hiding all\"
	     (setq py-hide-comments-when-hiding-all
		   (not py-hide-comments-when-hiding-all))
	     :help \"Hide the comments too when you do `hs-hide-all'. Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-hide-comments-when-hiding-all]

	    [\"Max help buffer \"
	     (setq py-max-help-buffer-p
		   (not py-max-help-buffer-p))
	     :help \"If \\\"\\\*Python-Help\\\*\\\"-buffer should appear as the only visible.

Default is nil. In help-buffer, \\\"q\\\" will close it.  Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-max-help-buffer-p]

	    [\"Current defun show\"
	     (setq py-current-defun-show
		   (not py-current-defun-show))
	     :help \"If `py-current-defun' should jump to the definition, highlight it while waiting PY-WHICH-FUNC-DELAY seconds, before returning to previous position.

Default is `t'.Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-current-defun-show]

	    [\"Match paren mode\"
	     (setq py-match-paren-mode
		   (not py-match-paren-mode))
	     :help \"Non-nil means, cursor will jump to beginning or end of a block.
This vice versa, to beginning first.
Sets `py-match-paren-key' in python-mode-map.
Customize `py-match-paren-key' which key to use. Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-match-paren-mode])

	   (\"Debug\"

	    [\"py-debug-p\"
	     (setq py-debug-p
		   (not py-debug-p))
	     :help \"When non-nil, keep resp\\. store information useful for debugging\\.

Temporary files are not deleted\\. Other functions might implement
some logging etc\\. Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-debug-p]

	    [\"Pdbtrack do tracking \"
	     (setq py-pdbtrack-do-tracking-p
		   (not py-pdbtrack-do-tracking-p))
	     :help \"Controls whether the pdbtrack feature is enabled or not.
When non-nil, pdbtrack is enabled in all comint-based buffers,
e.g. shell buffers and the \\\*Python\\\* buffer.  When using pdb to debug a
Python program, pdbtrack notices the pdb prompt and displays the
source file and line that the program is stopped at, much the same way
as gud-mode does for debugging C programs with gdb.Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-pdbtrack-do-tracking-p]

	    [\"Jump on exception\"
	     (setq py-jump-on-exception
		   (not py-jump-on-exception))
	     :help \"Jump to innermost exception frame in Python output buffer.
When this variable is non-nil and an exception occurs when running
Python code synchronously in a subprocess, jump immediately to the
source code of the innermost traceback frame.

Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-jump-on-exception]

	    [\"Highlight error in source \"
	     (setq py-highlight-error-source-p
		   (not py-highlight-error-source-p))
	     :help \"Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-highlight-error-source-p])

	   (\"Other\"

	    (\"Directory\"

	     [\"Guess install directory \"
	      (setq py-guess-py-install-directory-p
		    (not py-guess-py-install-directory-p))
	      :help \"If in cases, `py-install-directory' isn't set,  `py-set-load-path'should guess it from `buffer-file-name'. Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-guess-py-install-directory-p]

	     [\"Use local default\"
	      (setq py-use-local-default
		    (not py-use-local-default))
	      :help \"If `t', py-shell will use `py-shell-local-path' instead
of default Python.

Making switch between several virtualenv's easier,
                               `python-mode' should deliver an installer, so named-shells pointing to virtualenv's will be available. Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-use-local-default]

	     [\"Use current dir when execute \"
	      (setq py-use-current-dir-when-execute-p
		    (not py-use-current-dir-when-execute-p))
	      :help \"When `t', current directory is used by Python-shell for output of `py-execute-buffer' and related commands.

See also `py-execute-directory'Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-use-current-dir-when-execute-p]

	     [\"Keep shell dir when execute \"
	      (setq py-keep-shell-dir-when-execute-p
		    (not py-keep-shell-dir-when-execute-p))
	      :help \"Don't change Python shell's current working directory when sending code.

See also `py-execute-directory'Use `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-keep-shell-dir-when-execute-p]

	     [\"Fileless buffer use default directory \"
	      (setq py-fileless-buffer-use-default-directory-p
		    (not py-fileless-buffer-use-default-directory-p))
	      :help \"When `py-use-current-dir-when-execute-p' is non-nil and no buffer-file exists, value of `default-directory' sets current working directory of Python output shellUse `M-x customize-variable' to set it permanently\"
	      :style toggle :selected py-fileless-buffer-use-default-directory-p])

	    (\"Underscore word syntax\"
	     :help \"Toggle `py-underscore-word-syntax-p'\"

	     [\"Toggle underscore word syntax\" toggle-py-underscore-word-syntax-p
	      :help \" `toggle-py-underscore-word-syntax-p'

If `py-underscore-word-syntax-p' should be on or off.

  Returns value of `py-underscore-word-syntax-p' switched to. .

Use `M-x customize-variable' to set it permanently\"]

	     [\"Underscore word syntax on\" py-underscore-word-syntax-p-on
	      :help \" `py-underscore-word-syntax-p-on'

Make sure, py-underscore-word-syntax-p' is on.

Returns value of `py-underscore-word-syntax-p'. .

Use `M-x customize-variable' to set it permanently\"]

	     [\"Underscore word syntax off\" py-underscore-word-syntax-p-off
	      :help \" `py-underscore-word-syntax-p-off'

Make sure, `py-underscore-word-syntax-p' is off.

Returns value of `py-underscore-word-syntax-p'. .

Use `M-x customize-variable' to set it permanently\"])

	    [\"Load pymacs \"
	     (setq py-load-pymacs-p
		   (not py-load-pymacs-p))
	     :help \"If Pymacs related stuff should be loaded.

Default is nil.

Pymacs has been written by François Pinard and many others.
See original source: http://pymacs.progiciels-bpi.caUse `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-load-pymacs-p]

	    [\"Verbose \"
	     (setq py-verbose-p
		   (not py-verbose-p))
	     :help \"If functions should report results.

Default is nil. Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-verbose-p]

	    [\"Empty comment line separates paragraph \"
	     (setq py-empty-comment-line-separates-paragraph-p
		   (not py-empty-comment-line-separates-paragraph-p))
	     :help \"Consider paragraph start/end lines with nothing inside but comment sign.

Default is non-nilUse `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-empty-comment-line-separates-paragraph-p]

	    [\"Org cycle \"
	     (setq py-org-cycle-p
		   (not py-org-cycle-p))
	     :help \"When non-nil, command `org-cycle' is available at shift-TAB, <backtab>

Default is nil. Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-org-cycle-p]

	    [\"Set pager cat\"
	     (setq py-set-pager-cat-p
		   (not py-set-pager-cat-p))
	     :help \"If the shell environment variable \\\$PAGER should set to `cat'.

If `t', use `C-c C-r' to jump to beginning of output. Then scroll normally.

Avoids lp:783828, \\\"Terminal not fully functional\\\", for help('COMMAND') in python-shell

When non-nil, imports module `os' Use `M-x customize-variable' to
set it permanently\"
	     :style toggle :selected py-set-pager-cat-p]

	    [\"Edit only \"
	     (setq py-edit-only-p
		   (not py-edit-only-p))
	     :help \"When `t' `python-mode' will not take resort nor check for installed Python executables. Default is nil.

See bug report at launchpad, lp:944093. Use `M-x customize-variable' to set it permanently\"
	     :style toggle :selected py-edit-only-p])))")

(defun py--emen-curb-docu (line)
  "Make docu fit for displaying in tooltip. "
  (setq end (copy-marker (line-end-position)))
  (while (< 5 (- line origline))
    (while (and (not (bobp)) (< orig (point)) (forward-line -1) (not (empty-line-p))))
    (delete-region (line-beginning-position) end)))

(defun py--emen (&optional symbol)
  "Provide menu draft. "
  (interactive "*")
  (let* ((orig (copy-marker (point)))
	 (erg (or symbol (car kill-ring)))
         (name (intern-soft erg))
         (doku (if (functionp name)
                   (documentation name)
                 (documentation-property name 'variable-documentation)))
	 (cui (current-indentation))
	 origline end line)
    ;; (goto-char (point-max))
    ;; (switch-to-buffer (current-buffer))
    (indent-according-to-mode)
    (insert (concat "\[\"" (replace-regexp-in-string "-" " " (replace-regexp-in-string "^py-" "" erg)) "\" " erg "
 :help \" `" erg "'"))
    (beginning-of-line)
    (indent-according-to-mode)
    ;; (insert (make-string cui ? ))
    (save-excursion
      (goto-char orig)
      (skip-chars-forward "[[:punct:]]")
      (capitalize-word 1))
    (end-of-line)
    (when doku
      (setq doku (substring doku 0 (string-match "\n" doku)))
      ;; (setq origline (py-count-lines))
      (newline)
      ;; (insert (regexp-quote doku))
      (insert doku)
      (setq end (copy-marker (point)))
      (goto-char orig)
      (when (search-forward ":help" end t)
	(end-of-line)
	(py--escape-doublequotes (point) end))
      ;; (when (< 5 (- (setq line (py-count-lines)) origline))
      ;; (py--emen-curb-docu line))
      )
    (goto-char (point-max))
    (skip-chars-backward " \t\r\n\f")
    (insert "\"]\n")))
  ;; (goto-char orig)

(defun py--create-menu-insert-intern (ele)
  (save-excursion (py--emen ele))
  (let ((orig (point)))
    (forward-list 1)
    (indent-region orig (point))
    (newline)))

(defun py--create-menu-insert (liste &optional prefix suffix exclude)
  (dolist (ele liste)
    (unless (stringp ele) (setq ele (prin1-to-string ele)))
    ;; Can't shift left top-level
    (unless (or (string= "" ele) (string= exclude ele))
      (when (string= "top-level" ele)
	(message "%s" exclude))
      (when prefix (setq ele (concat prefix ele)))
      (when suffix (setq ele (concat ele suffix)))
      (insert (concat "\n" (make-string 10 ? )))
      ;; (py--create-menu-insert-intern ele)
      ;; (switch-to-buffer (current-buffer))
      (save-excursion (py--emen ele))
      (forward-list)
      (newline))))

(defun py--create-menu-minor-fixes ()
  (newline)
  (delete-region (point) (point-max))
  (goto-char (point-min))
  (search-forward "(and (ignore-errors (require 'easymenu) t)")
  ;; (switch-to-buffer (current-buffer))
  )

(defun py-create-menu ()
  "Re-create the menu. "
  (interactive)
  (when py-verbose-p (message "%s" "Initiating the menu"))
  (with-current-buffer (get-buffer-create "python-components-menu.el")
    (erase-buffer)
    (when (interactive-p) (switch-to-buffer (current-buffer)))
    (insert py-menu-head)
    (newline)
    (insert "(and (ignore-errors (require 'easymenu) t)
     ;; (easy-menu-define py-menu map \"Python Tools\"
     ;;           `(\"PyTools\"
     (easy-menu-define
       py-menu python-mode-map \"Python Mode menu\"
       `(\"Python\"
	 (\"Interpreter\"")
    (emacs-lisp-mode)
    ;; (switch-to-buffer (current-buffer))
    ;; (py--create-menu-insert py-checks-symbols)

    ;; (py--create-menu-insert (list 'import-or-reload) "py-execute-")
    (py--create-menu-insert py-shells)
    (insert (concat (make-string 10 ? )")\n"))
    (insert (concat (make-string 9 ? )"(\"Edit\"\n"))

    (insert (concat (make-string 10 ? )"(\"Shift\"\n"))

    (insert (concat (make-string 11 ? )"(\"Shift right\""))
    (py--create-menu-insert py-shift-forms "py-shift-" "-right")
    (insert (concat (make-string 12 ? )")\n"))

    (insert (concat (make-string 11 ? )"(\"Shift left\""))
    (py--create-menu-insert py-shift-forms "py-shift-" "-left" "top-level")
    (insert (concat (make-string 12 ? )"))\n"))

    (insert (concat (make-string 10 ? )"(\"Mark\""))
    (py--create-menu-insert py-positions-forms "py-mark-")
    (insert (concat (make-string 11 ? )")\n"))

    (insert (concat (make-string 10 ? )"(\"Copy\""))
    (py--create-menu-insert py-positions-forms "py-copy-")
    (insert (concat (make-string 11 ? )")\n"))

    (insert (concat (make-string 10 ? )"(\"Kill\""))
    (py--create-menu-insert py-positions-forms "py-kill-")
    (insert (concat (make-string 11 ? )")\n"))

    (insert (concat (make-string 10 ? )"(\"Delete\""))
    (py--create-menu-insert py-positions-forms "py-delete-")
    (insert (concat (make-string 11 ? )")\n"))

    (insert (concat (make-string 10 ? )"(\"Comment\""))
    (py--create-menu-insert py-comment-forms "py-comment-")

    ;; Edit end
    (insert (concat (make-string 11 ? ) "))\n"))

    (insert (concat (make-string 9 ? )"(\"Move\"\n"))

    (insert (concat (make-string 10 ? )"(\"Backward\""))
    (py--create-menu-insert py-move-forms "py-backward-")
    (insert (concat (make-string 11 ? )")\n"))

    (insert (concat (make-string 10 ? )"(\"Forward\""))
    (py--create-menu-insert py-move-forms "py-forward-")
    (insert (concat (make-string 11 ? )")\n"))

    (insert (concat (make-string 10 ? )"(\"BOL-forms\"\n"))

    (insert (concat (make-string 11 ? )"(\"Backward\""))
    (py--create-menu-insert py-move-forms "py-backward-" "-bol" "top-level")
    (insert (concat (make-string 12 ? )")\n"))

    (insert (concat (make-string 11 ? )"(\"Forward\""))
    (py--create-menu-insert py-move-forms "py-forward-" "-bol")
    ;; BOL forms end
    (insert (concat (make-string 12 ? )"))\n"))

    (insert (concat (make-string 10 ? )"(\"Up/Down\""))
    (py--create-menu-insert (list 'up) "py-")
    (py--create-menu-insert (list 'down) "py-")

    ;; Move ends
    (insert (concat (make-string 11 ? )"))\n"))

    (insert (concat (make-string 9 ? )"(\"Send\""))
    (py--create-menu-insert py-execute-forms "py-execute-")

    (insert (concat (make-string 11 ? )"(\"Other\"\n"))
    (dolist (ele py-shells)
      (unless (string= "" ele)
      (setq ele (prin1-to-string ele))
      ;; Shell forms
      (insert (concat (make-string 12 ? ))"(\"")
      (cond ((string-match "ipython" ele)
	     (insert (concat "IP" (substring ele 2))))
	    (t (insert (capitalize ele))))
      (insert "\"")
      (setq ele (concat "-" ele))
      (py--create-menu-insert py-execute-forms "py-execute-" ele)
      (insert (concat (make-string 13 ? )")\n"))))
    (insert (make-string 12 ? ))
    (insert "(\"Ignoring defaults \"\n")
    (insert (concat (make-string 13 ? )":help \"`M-x py-execute-statement- TAB' for example list commands ignoring defaults\n\n of `py-switch-buffers-on-execute-p' and `py-split-window-on-execute'\"\n"))
    (insert (concat (make-string 13 ? ) ")))\n"))

    (insert (concat (make-string 9 ? )"(\"Hide-Show\"\n"))

    (insert (concat (make-string 10 ? )"(\"Hide\""))
    (py--create-menu-insert py-hide-names "py-hide-")
    (insert (concat (make-string 11 ? )")\n"))

    (insert (concat (make-string 10 ? )"(\"Show\""))
    (py--create-menu-insert py-hide-names "py-show-")

    ;; Hide-show ends
    (insert (concat (make-string 11 ? )"))\n"))

    (insert (concat (make-string 9 ? )"(\"Fast process\""))
    (py--create-menu-insert py-fast-core "py-execute-" "-fast")
    (insert (concat (make-string 10 ? )")\n"))

    (insert (concat (make-string 9 ? )"(\"Virtualenv\""))
    (py--create-menu-insert py-virtualenv-symbols "virtualenv-")
    (insert (concat (make-string 10 ? )")\n"))

    (py--create-menu-insert (list 'import-or-reload) "py-execute-")
    (insert (concat (make-string 9 ? )"(\"Help\""))
    (py--create-menu-insert py-help-symbols)
    (insert (concat (make-string 10 ? )")\n"))

    (insert (concat (make-string 10 ? )"(\"Debugger\""))
    (py--create-menu-insert py-debugger-symbols)
    (insert (concat (make-string 12 ? )")\n"))

    (insert (concat (make-string 10 ? )"(\"Checks\""))
    (py--create-menu-insert py-checks-symbols)

    (insert (concat (make-string 10 ? )"(\"Pylint\""))
    (py--create-menu-insert py-pylint-symbols)
    (insert (concat (make-string 12 ? )")\n"))

    (insert (concat (make-string 10 ? )"(\"Pep8\""))
    (py--create-menu-insert py-pep8-symbols)
    (insert (concat (make-string 12 ? )")\n"))

    (insert (concat (make-string 10 ? )"(\"Pyflakes\""))
    (py--create-menu-insert py-pyflakes-symbols)
    (insert (concat (make-string 12 ? )")\n"))

    (insert (concat (make-string 10 ? )"(\"Flake8\""))
    (py--create-menu-insert py-flake8-symbols)

    (insert (concat (make-string 10 ? )"(\"Pyflakes-pep8\""))
    (py--create-menu-insert py-pyflakes-pep8-symbols)

    ;; close Pyflakes
    ;; close Checks
    (insert (concat (make-string 12 ? ) ")))\n"))
    (insert py-menu-custom-forms)
    (newline)
    (insert (concat (make-string 9 ? )"(\"Other\""))
    (py--create-menu-insert py-other-symbols "py-")

    (insert (concat (make-string 10 ? )"(\"Electric\""))
    (py--create-menu-insert py-electric-symbols "py-")
    (insert (concat (make-string 12 ? )")\n"))

    (insert (concat (make-string 10 ? )"(\"Filling\""))
    (py--create-menu-insert py-filling-symbols "py-")
    (insert (concat (make-string 12 ? )")\n"))

    (insert (concat (make-string 10 ? )"(\"Abbrevs\""))
    (insert py-menu-abbrev-form)
    (insert (concat (make-string 12 ? )")\n"))
    (py--create-menu-insert (list 'py-add-abbrev))

    (insert (concat (make-string 10 ? )"(\"Completion\""))
    (py--create-menu-insert py-completion-symbols "py-")
    (insert (concat (make-string 12 ? )")\n"))

    (py--create-menu-insert (list 'py-find-function))

    ;; nicht vorhanden
    ;; (insert (concat (make-string 10 ? )"(\"Skeletons\""))
    ;; (py--create-menu-insert py-skeletons)
    ;; (insert (concat (make-string 12 ? )")\n"))

    ;; Close Other
    (insert (concat (make-string 12 ? )")\n"))

    ;; final
    (insert (concat (make-string 12 ? ) ")))\n\n"))
    (insert "(provide 'python-components-menu)\n;;; python-components-menu.el ends here\n\n")
    (py--create-menu-minor-fixes)
    (eval-buffer)
    (when py-debug-p (write-file (concat py-install-directory "/python-components-menu.el")))
    ;; (set-buffer "python-components-menu.el")
    ))

(provide 'python-components-create-menu)
;;; python-components-menu.el ends here