Check-in [fbadd18174]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Sync with personal public repository (*GNUmakefile) - Be sure to clean up additional files typically left over from a merge (README.md) - Regen (bashrc) - Reformatting - Set up perl environment - Add alias for `ls -alh` (emacs.d/cmf-org-export.el) - Reformat (emacs.d/init.el) - Add ~/bin to cmf-path-list - Reformatting - Replace auto-complete mode with company-mode[1] - Do not install calfw sub-packages until calfw is utilized - Install and configure docker[2] and dockerfile[3] - Do not use melpa-stable version of emojify[4] as the regular version seems to support Emacs 26.1 without issue - Install and configure flyspell-correct-ivy[5] - Remove personal forecast api key and note where API key can be gotten from - Only install go-mode sub-packages when go-mode is loaded - Only install php-mode sub-packages when php-mode is loaded - Switch to using elpy[6] for Python development - Correct issue whereby any file with the word "SQL" in its full path would cause sql-mode to be loaded instead - Whoops, do not leak my twitter username - Add undo-tree-mode to conf-mode hook - Install and configure vue-mode[7] - Diminish which-key mode - Add subword-mode to yaml-mode-hook (emacs.d/lisp/cmf-org-settings) - Switch to using file+olp+datetree for archive location. This is the mode supported by Emacs 26.1+ (global-excludes) - Add network-security.data - Add transient directory - Sort alphabetically (setup.sh) - Update copyright to reflect new year - Add option for installing PLsense[8] for auto-complete functionality when editing perl files - Make quotes consistent - Sort Python packages installed alphabetically - Add setuptools-black to list of Python packages installed - Install and link tmux.conf file based on version of tmux(1) installed (thirdparty/git-completion.bash) - Update git completion and prompt scripts to v2.20.1 Footnotes: [1] https://company-mode.github.io/ [2] https://github.com/Silex/docker.el [3] https://github.com/spotify/dockerfile-mode [4] https://github.com/iqbalansari/emacs-emojify [5] https://github.com/d12frosted/flyspell-correct/blob/master/flyspell-correct-ivy.el [6] https://github.com/jorgenschaefer/elpy [7] https://github.com/AdamNiederer/vue-mode [8] https://github.com/aki2o/plsense
Timelines: family | ancestors | descendants | both | trunk | v2019.05
Files: files | file ages | folders
SHA1:fbadd1817432d752cdea9192e980b73ae6cac7a1
User & Date: cfuhrman 2019-05-31 04:57:08
Context
2019-06-04
16:25
Sync w/ personal repo (README.md) - Regen (docs/README.org) - Document PLSense setup - Bump copyright (emacs.d/init.el) - Recent versions of php_mode no longer require php-ext, so don't load it (emacs.d/lisp/cmf-org-settings.el) - Switch to using file+olp+datetree Leaf check-in: ec6721512f user: cfuhrman tags: trunk, v2019.06
2019-05-31
04:57
Sync with personal public repository (*GNUmakefile) - Be sure to clean up additional files typically left over from a merge (README.md) - Regen (bashrc) - Reformatting - Set up perl environment - Add alias for `ls -alh` (emacs.d/cmf-org-export.el) - Reformat (emacs.d/init.el) - Add ~/bin to cmf-path-list - Reformatting - Replace auto-complete mode with company-mode[1] - Do not install calfw sub-packages until calfw is utilized - Install and configure docker[2] and dockerfile[3] - Do not use melpa-stable version of emojify[4] as the regular version seems to support Emacs 26.1 without issue - Install and configure flyspell-correct-ivy[5] - Remove personal forecast api key and note where API key can be gotten from - Only install go-mode sub-packages when go-mode is loaded - Only install php-mode sub-packages when php-mode is loaded - Switch to using elpy[6] for Python development - Correct issue whereby any file with the word "SQL" in its full path would cause sql-mode to be loaded instead - Whoops, do not leak my twitter username - Add undo-tree-mode to conf-mode hook - Install and configure vue-mode[7] - Diminish which-key mode - Add subword-mode to yaml-mode-hook (emacs.d/lisp/cmf-org-settings) - Switch to using file+olp+datetree for archive location. This is the mode supported by Emacs 26.1+ (global-excludes) - Add network-security.data - Add transient directory - Sort alphabetically (setup.sh) - Update copyright to reflect new year - Add option for installing PLsense[8] for auto-complete functionality when editing perl files - Make quotes consistent - Sort Python packages installed alphabetically - Add setuptools-black to list of Python packages installed - Install and link tmux.conf file based on version of tmux(1) installed (thirdparty/git-completion.bash) - Update git completion and prompt scripts to v2.20.1 Footnotes: [1] https://company-mode.github.io/ [2] https://github.com/Silex/docker.el [3] https://github.com/spotify/dockerfile-mode [4] https://github.com/iqbalansari/emacs-emojify [5] https://github.com/d12frosted/flyspell-correct/blob/master/flyspell-correct-ivy.el [6] https://github.com/jorgenschaefer/elpy [7] https://github.com/AdamNiederer/vue-mode [8] https://github.com/aki2o/plsense check-in: fbadd18174 user: cfuhrman tags: trunk, v2019.05
2019-03-24
16:00
Sync check-in: f448cb6cd4 user: cfuhrman tags: trunk
Changes

Changes to GNUmakefile.

108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

disabled: ${DISABLEDHOSTS}
	@echo 'All disabled hosts updated (Are they working now?)'

clean: clean-echo ${CLEANDIRS} clean-dist clean-tags
	@rm ${RM_OPTS} *.bak
	@rm ${RM_OPTS} *~
	@rm ${RM_OPTS} *-baseline
	@rm ${RM_OPTS} *-merge
	@rm ${RM_OPTS} *-original

clean-echo:
	@echo 'Cleaning old files:'

clean-elc: clean-home-elc

clean-home-elc:







|
|
|







108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

disabled: ${DISABLEDHOSTS}
	@echo 'All disabled hosts updated (Are they working now?)'

clean: clean-echo ${CLEANDIRS} clean-dist clean-tags
	@rm ${RM_OPTS} *.bak
	@rm ${RM_OPTS} *~
	@rm ${RM_OPTS} *-baseline*
	@rm ${RM_OPTS} *-merge*
	@rm ${RM_OPTS} *-original*

clean-echo:
	@echo 'Cleaning old files:'

clean-elc: clean-home-elc

clean-home-elc:

Changes to README.md.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
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
..
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
..
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
...
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


# Table of Contents

1.  [Description](#orgca81bf4)
    1.  [Requirements](#org2c768cc)
    2.  [Supported Platforms](#org43c250a)
2.  [Obtaining ShellPAK](#orgb072061)
    1.  [Alternate Repositories](#org822ffdf)
3.  [Installation](#org7a04f13)
    1.  [Other setup options](#orga848fba)
4.  [Bugs](#orga13e6aa)
5.  [Author](#org19bcca2)
6.  [Copyright](#org994c8f3)



<a id="orgca81bf4"></a>

# Description

ShellPAK allows for the automatic installation and configuration of
my personal [GNU Bash](http://www.gnu.org/software/bash/) shell environment as well as the configuration
of the following programs:

................................................................................
-   [Perl::Tidy](http://search.cpan.org/~shancock/Perl-Tidy-20140711/lib/Perl/Tidy.pod)
-   [tmux](http://tmux.sourceforge.net)

This code is specific to my own needs and is here in the hopes it
will be useful as a reference.


<a id="org2c768cc"></a>

## Requirements

-   GNU Bash version 3.2 or greater
-   GNU Emacs 24.1 or greater (Emacs 24.4 or greater preferred)
-   GNU Make
-   rsync


<a id="org43c250a"></a>

## Supported Platforms

The following operating systems are known to be supported:

-   Mac OS X 10.13 (Darwin)
-   NetBSD 6.1.x
................................................................................
-   SunOS solaris 5.10
-   AIX 1 7

In addition, ShellPAK has been known to run on OpenSUSE, SuSE
Enterprise Linux, Ubuntu, FreeBSD, and Cygwin.


<a id="orgb072061"></a>

# Obtaining ShellPAK

As of <span class="timestamp-wrapper"><span class="timestamp">&lt;2014-07-30 Wed&gt;</span></span>, [ShellPAK](https://chiselapp.com/user/cfuhrman/repository/shpak/home) is managed by the [Fossil](http://fossil-scm.org)
distributed version control system.  To check out a repository:

    # Clone the repository
................................................................................
    $ cd shellpak
    $ fossil open ~/shellpak.fossil

Further information on Fossil can be found at this [Quick Start
Guide](http://www.fossil-scm.org/index.html/doc/trunk/www/quickstart.wiki).


<a id="org822ffdf"></a>

## Alternate Repositories

[ShellPAK](https://chiselapp.com/user/cfuhrman/repository/shpak/home) is also available for checkout from the following
locations:

-   **Git:** [GitHub](https://github.com/cfuhrman/shpak), [BitBucket](https://bitbucket.org/chrisfuhrman/shellpak)
................................................................................
-   **Bazaar:** [Launchpad](https://code.launchpad.net/~cfuhrman/shpak/trunk)

Be aware that portions of the ShellPAK infrastructure relies on
Fossil.  Conversion to support the conventions of an alternative
revision control system is an exercise left to the user.


<a id="org7a04f13"></a>

# Installation

    # Install ShellPAK
    $ ./setup.sh

Note that during installation, ShellPAK will store dot-files (e.g.,
`bashrc`, `bash_profile`, etc) in `~/Backup/shell` (or whatever is
specified by the `-b` flag).  These files will be restored during
un-installation (via the `-u` flag)


<a id="orga848fba"></a>

## Other setup options

    # Perform a dry-run
    $ ./setup.sh -r
    
    # Install into another directory
................................................................................
    $ ./setup.sh -d /path/to/directory
    
    # Do not automatically link files during installation
    $ ./setup.sh -n
    
    # Set up go programming environment
    $ ./setup.sh -g



    
    # Set up python development environment
    $ ./setup.sh -p
    
    # Set up python3 development environment
    $ PYTHON_VERSION=3 PIP_BIN=pip3 setup.sh -p
    
................................................................................
    $ ./setup.sh -h

Previous versions of `setup.sh` provided options for installation
of Emacs packages.  This is no longer required as Emacs will now
automatically install necessary packages on startup.


<a id="orga13e6aa"></a>

# Bugs

Please report any bugs or feature requests by [filing a ticket](https://chiselapp.com/user/cfuhrman/repository/shpak/reportlist) via
the ShellPAK repository website.


<a id="org19bcca2"></a>

# Author

Christopher M. Fuhrman
[cfuhrman@pobox.com](mailto:cfuhrman@pobox.com)


<a id="org994c8f3"></a>

# Copyright

Copyright (c) 2000-2018 Christopher M. Fuhrman
All rights reserved.

All files contained herein can be redistributed and/or modified
under the terms of the Simplified BSD License (also known as the
"2-Clause License" or "FreeBSD License".) unless otherwise noted.




|
|
|
|
|
|
|
|
|
|



|







 







|









|







 







|







 







|







 







|












|







 







>
>
>







 







|







|







|



|





>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
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
..
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
..
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
...
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

# Table of Contents

1.  [Description](#orgf46e4a3)
    1.  [Requirements](#org0727af0)
    2.  [Supported Platforms](#org8e39d37)
2.  [Obtaining ShellPAK](#org106b40a)
    1.  [Alternate Repositories](#orgd42b8ef)
3.  [Installation](#orgb984856)
    1.  [Other setup options](#org125c07e)
4.  [Bugs](#org9931909)
5.  [Author](#org19492b6)
6.  [Copyright](#org6467d02)



<a id="orgf46e4a3"></a>

# Description

ShellPAK allows for the automatic installation and configuration of
my personal [GNU Bash](http://www.gnu.org/software/bash/) shell environment as well as the configuration
of the following programs:

................................................................................
-   [Perl::Tidy](http://search.cpan.org/~shancock/Perl-Tidy-20140711/lib/Perl/Tidy.pod)
-   [tmux](http://tmux.sourceforge.net)

This code is specific to my own needs and is here in the hopes it
will be useful as a reference.


<a id="org0727af0"></a>

## Requirements

-   GNU Bash version 3.2 or greater
-   GNU Emacs 24.1 or greater (Emacs 24.4 or greater preferred)
-   GNU Make
-   rsync


<a id="org8e39d37"></a>

## Supported Platforms

The following operating systems are known to be supported:

-   Mac OS X 10.13 (Darwin)
-   NetBSD 6.1.x
................................................................................
-   SunOS solaris 5.10
-   AIX 1 7

In addition, ShellPAK has been known to run on OpenSUSE, SuSE
Enterprise Linux, Ubuntu, FreeBSD, and Cygwin.


<a id="org106b40a"></a>

# Obtaining ShellPAK

As of <span class="timestamp-wrapper"><span class="timestamp">&lt;2014-07-30 Wed&gt;</span></span>, [ShellPAK](https://chiselapp.com/user/cfuhrman/repository/shpak/home) is managed by the [Fossil](http://fossil-scm.org)
distributed version control system.  To check out a repository:

    # Clone the repository
................................................................................
    $ cd shellpak
    $ fossil open ~/shellpak.fossil

Further information on Fossil can be found at this [Quick Start
Guide](http://www.fossil-scm.org/index.html/doc/trunk/www/quickstart.wiki).


<a id="orgd42b8ef"></a>

## Alternate Repositories

[ShellPAK](https://chiselapp.com/user/cfuhrman/repository/shpak/home) is also available for checkout from the following
locations:

-   **Git:** [GitHub](https://github.com/cfuhrman/shpak), [BitBucket](https://bitbucket.org/chrisfuhrman/shellpak)
................................................................................
-   **Bazaar:** [Launchpad](https://code.launchpad.net/~cfuhrman/shpak/trunk)

Be aware that portions of the ShellPAK infrastructure relies on
Fossil.  Conversion to support the conventions of an alternative
revision control system is an exercise left to the user.


<a id="orgb984856"></a>

# Installation

    # Install ShellPAK
    $ ./setup.sh

Note that during installation, ShellPAK will store dot-files (e.g.,
`bashrc`, `bash_profile`, etc) in `~/Backup/shell` (or whatever is
specified by the `-b` flag).  These files will be restored during
un-installation (via the `-u` flag)


<a id="org125c07e"></a>

## Other setup options

    # Perform a dry-run
    $ ./setup.sh -r
    
    # Install into another directory
................................................................................
    $ ./setup.sh -d /path/to/directory
    
    # Do not automatically link files during installation
    $ ./setup.sh -n
    
    # Set up go programming environment
    $ ./setup.sh -g
    
    # Set up PLSense
    $ ./setup.sh -l
    
    # Set up python development environment
    $ ./setup.sh -p
    
    # Set up python3 development environment
    $ PYTHON_VERSION=3 PIP_BIN=pip3 setup.sh -p
    
................................................................................
    $ ./setup.sh -h

Previous versions of `setup.sh` provided options for installation
of Emacs packages.  This is no longer required as Emacs will now
automatically install necessary packages on startup.


<a id="org9931909"></a>

# Bugs

Please report any bugs or feature requests by [filing a ticket](https://chiselapp.com/user/cfuhrman/repository/shpak/reportlist) via
the ShellPAK repository website.


<a id="org19492b6"></a>

# Author

Christopher M. Fuhrman
[cfuhrman@pobox.com](mailto:cfuhrman@pobox.com)


<a id="org6467d02"></a>

# Copyright

Copyright (c) 2000-2019 Christopher M. Fuhrman
All rights reserved.

All files contained herein can be redistributed and/or modified
under the terms of the Simplified BSD License (also known as the
"2-Clause License" or "FreeBSD License".) unless otherwise noted.

Changes to bashrc.

194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209

210
211
212
213
214
215
216
...
249
250
251
252
253
254
255






256
257
258
259
260
261
262
...
283
284
285
286
287
288
289

290
291
292
293
294
295
296
        else
                promptCMF
        fi

fi

# Determine PATH
paths=('/usr/games'                             \
       '/usr/X11R6/bin'                         \
       '/usr/X11R7/bin'                         \
       '/usr/sbin'                              \
       '/opt/bin'                               \
       '/opt/sbin'                              \
       '/sbin'                                  \
       '/usr/local/sbin'                        \
       "$HOME/.composer/vendor/bin"             \

       "$HOME/bin"
      )

# Pre-pend additional directories if required
for path in ${paths[@]}; do

        # Determine if this directory is already in $PATH
................................................................................
                echo $PATH | egrep '(^|\:)'${GOPATH}'/bin(\:|$)' >/dev/null 2>&1 || PATH=$PATH:${GOPATH}/bin
        fi

fi

export PATH








# OS-Specific variable(s)
# --------------------------------------------------------------------
case $OSTYPE in

Darwin)
        source $SHELLDIR/bash_darwin
................................................................................

# Aliases
# --------------------------------------------------------------------

alias cp='cp -${FILE_OPS_FLAGS}i'
alias rm='rm -${FILE_OPS_FM_FLAGS}i'
alias mv='mv -${FILE_OPS_FLAGS}i'


# Make sure we use the rm binary
if [ -e /bin/rm ]; then
        alias rmrmrm='/bin/rm -${FILE_OPS_RM_FLAGS}f'
else
        alias rmrmrm='rm -${FILE_OPS_RM_FLAGS}f'
fi







|
|
|
|
|
|
|
|
|
>







 







>
>
>
>
>
>







 







>







194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
...
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
...
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
        else
                promptCMF
        fi

fi

# Determine PATH
paths=('/usr/games'				\
       '/usr/X11R6/bin'				\
       '/usr/X11R7/bin'				\
       '/usr/sbin'				\
       '/opt/bin'				\
       '/opt/sbin'				\
       '/sbin'					\
       '/usr/local/sbin'			\
       "$HOME/.composer/vendor/bin"		\
       "$HOME/perl5/bin"			\
       "$HOME/bin"
      )

# Pre-pend additional directories if required
for path in ${paths[@]}; do

        # Determine if this directory is already in $PATH
................................................................................
                echo $PATH | egrep '(^|\:)'${GOPATH}'/bin(\:|$)' >/dev/null 2>&1 || PATH=$PATH:${GOPATH}/bin
        fi

fi

export PATH

# Set up perl environment
PERL5LIB="${HOME}/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="${HOME}/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"${HOME}/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=${HOME}/perl5"; export PERL_MM_OPT;


# OS-Specific variable(s)
# --------------------------------------------------------------------
case $OSTYPE in

Darwin)
        source $SHELLDIR/bash_darwin
................................................................................

# Aliases
# --------------------------------------------------------------------

alias cp='cp -${FILE_OPS_FLAGS}i'
alias rm='rm -${FILE_OPS_FM_FLAGS}i'
alias mv='mv -${FILE_OPS_FLAGS}i'
alias ll='ls -alh'

# Make sure we use the rm binary
if [ -e /bin/rm ]; then
        alias rmrmrm='/bin/rm -${FILE_OPS_RM_FLAGS}f'
else
        alias rmrmrm='rm -${FILE_OPS_RM_FLAGS}f'
fi

Changes to emacs.d/GNUmakefile.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CLEANDIRS=$(SUBDIRS:%=clean-%)

RM_OPTS=$(shell if [ `uname` != "OpenBSD" ]; then echo '-vf'; else echo '-f'; fi)

clean: ${CLEANDIRS}
	@rm ${RM_OPTS} *~
	@rm ${RM_OPTS} *.bak
	@rm ${RM_OPTS} *-baseline
	@rm ${RM_OPTS} *-merge
	@rm ${RM_OPTS} *-original
	@rm ${RM_OPTS} *.elc

${CLEANDIRS} :
	${MAKE} -C $(@:clean-%=%) clean

# Ende







|
|
|






8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CLEANDIRS=$(SUBDIRS:%=clean-%)

RM_OPTS=$(shell if [ `uname` != "OpenBSD" ]; then echo '-vf'; else echo '-f'; fi)

clean: ${CLEANDIRS}
	@rm ${RM_OPTS} *~
	@rm ${RM_OPTS} *.bak
	@rm ${RM_OPTS} *-baseline*
	@rm ${RM_OPTS} *-merge*
	@rm ${RM_OPTS} *-original*
	@rm ${RM_OPTS} *.elc

${CLEANDIRS} :
	${MAKE} -C $(@:clean-%=%) clean

# Ende

Changes to emacs.d/cmf-org-export.el.

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
;;; Code:

;; Grab Org-mode major version number
(defvar cmf-org-version (string-to-number (car (split-string (org-release) "[.]"))))

;; Force export to UTF-8 format
(custom-set-variables
  '(org-ascii-charset (quote utf-8)))

(defun cmf-export-to-txt ()
  "Wrapper function for exporting an 'org-mode' document to text format.

The default encoding for 'org-mode' versions >= 7 is UTF-8.  Older versions
will export to ASCII format."
  (interactive)







|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
;;; Code:

;; Grab Org-mode major version number
(defvar cmf-org-version (string-to-number (car (split-string (org-release) "[.]"))))

;; Force export to UTF-8 format
(custom-set-variables
 '(org-ascii-charset (quote utf-8)))

(defun cmf-export-to-txt ()
  "Wrapper function for exporting an 'org-mode' document to text format.

The default encoding for 'org-mode' versions >= 7 is UTF-8.  Older versions
will export to ASCII format."
  (interactive)

Changes to emacs.d/init.el.

45
46
47
48
49
50
51
52
53
54

55

56
57
58
59
60
61
62
...
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
...
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
...
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
...
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
...
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
...
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
...
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
...
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604






605
606
607
608
609
610
611
...
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
...
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
...
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
...
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
...
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
...
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
...
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
...
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
....
1030
1031
1032
1033
1034
1035
1036

















1037
1038
1039
1040
1041
1042
1043
....
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
....
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
....
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
....
1182
1183
1184
1185
1186
1187
1188



1189
1190
1191
1192
1193
1194
1195
(defvar cmf-custom "~/.emacs.d/custom.el")
(defvar cmf-custom-16 "~/.emacs.d/custom-nox.el")
(defvar cmf-custom-256 "~/.emacs.d/custom-nox256.el")

;; List of paths to search
(defvar cmf-path-list '("/usr/texbin"
                        "/usr/pkg/bin"
			"/opt/pkg/bin"
                        "/usr/local/bin"
                        "~/.composer/vendor/bin"

                        "~/go/bin"

                        "/Library/TeX/texbin"))

;; Customize generic variables
(custom-set-variables
 '(c-default-style
   (quote
    ((c-mode . "cmf")
................................................................................
                (arglist-cont-nonempty . *)
                (statement-cont . *))
               (indent-tabs-mode . t)))

;; My own style
(c-add-style "cmf"
             '("bsd"
	       (indent-tabs-mode . nil)
               (c-offsets-alist
                (statement-cont . (first c-lineup-cascaded-calls +)))))


;; Functions
;; --------------------------------------------------------------------

................................................................................
;; OSX Modes (Mac OS X only)
;;

(when (eq system-type 'darwin)

  ;; Set up mac-specific parameters here
  (setq delete-by-moving-to-trash t
	mac-option-modifier 'meta
	trash-directory "~/.Trash/emacs"
	)

  ;; Make sure backup directory exists
  (if (not (file-exists-p trash-directory))
      (make-directory trash-directory))

  ;; osx-location
  (use-package osx-location
    :ensure t

    :hook
    (osx-location-changed .
			  (lambda ()
			    (setq calendar-latitude osx-location-latitude
				  calendar-longitude osx-location-longitude
				  calendar-location-name (format "%s, %s" osx-location-latitude osx-location-longitude)
				  forecast-latitude osx-location-latitude
				  forecast-longitude osx-location-longitude
				  forecast-city (format "%s, %s" osx-location-latitude osx-location-longitude)))
			  )

    :config
    (osx-location-watch)

    )
  )

;;
;; Generic Packages
;;
;; For use on all operating systems
;;

;; auto-complete
(use-package auto-complete
  :ensure t
  :ensure fuzzy

  :pin melpa-stable

  :demand

  :bind (:map ac-complete-mode-map
              ("\C-n" . ac-next)
              ("\C-p" . ac-previous)
	      )

  :config
  (ac-config-default)
  (setq ac-fuzzy-enable 1 )

  :custom
  (ac-dwim t)
  )

;; yasnippet
(use-package yasnippet
  :ensure t
  :ensure yasnippet-snippets
  :pin melpa-stable

  :init
................................................................................

  :custom
  (yas-wrap-around-region t)
  )

;; ace-window
(if (not(version< emacs-version "24.4"))
  (use-package ace-window
    :ensure t
    :pin melpa-stable

    :config
    (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))

    :bind (
	   ("C-x o" . ace-window))
    )
  )

;; all-the-icons
(if (version< emacs-version "24.4")
    (message "All-the-icons requires Emacs version 24.4 or later.  Unable to install")
  (use-package all-the-icons
    :if window-system
................................................................................

    :config

    ;; Install the font files only if we have not already done so
    (defvar cmf-fonts-installed-file "~/SHELL/emacs.d/.icon-fonts-installed")
    (unless (file-exists-p cmf-fonts-installed-file)
      (progn
	(message "Installing icon fonts")
	(all-the-icons-install-fonts t)
	(with-temp-buffer (write-file cmf-fonts-installed-file)))
      )
    )

  ;; all-the-icons-dired
  (use-package all-the-icons-dired
    :if window-system
    :ensure t
    :after all-the-icons

    :init
    (require 'font-lock+)

    :hook (dired-mode . all-the-icons-dired-mode)


    )

  (use-package all-the-icons-ivy
    :if window-system
    :ensure t
    :after all-the-icons
    :pin melpa-stable
................................................................................
;; arjen-grey-theme
(use-package arjen-grey-theme
  :ensure t
  :if window-system

  :init
  (add-to-list 'custom-safe-themes
	       "c74e83f8aa4c78a121b52146eadb792c9facc5b1f02c917e3dbb454fca931223")
  (load-theme 'arjen-grey t)

  :custom-face
  (highlight ((t (:distant-foreground "LightYellow3" :background "DarkOliveGreen"))))
  )

;; auctex

(use-package auctex
  :ensure t
  :no-require t









  )

;; beacon mode
(use-package beacon
  :ensure t
  :pin melpa-stable

................................................................................
  :config
  (beacon-mode 1)
  )

;; calfw
(use-package calfw
  :ensure t
  :ensure calfw-gcal
  :ensure calfw-ical
  :ensure calfw-org
  :pin melpa-stable

  :init
  (require 'calfw)
  (require 'calfw-ical)
  (require 'calfw-org)

  ;; See https://github.com/kiwanami/emacs-calfw for setting up your
  ;; own calendars
  :config
























  (defun cmf-open-calendar ()
    (interactive)
    (cfw:open-calendar-buffer :contents-sources
			      (list
			       (cfw:org-create-source "Green")  ; orgmode source
			       (cfw:ical-create-source "Google Calendar"
						       "https://calendar.google.com/calendar/ical/jsmith%40example.com/private-set-me-up/basic.ics"
						       "Orange")
			       (cfw:ical-create-source "Trips via Kayak"
			       			       "https://www.kayak.com/trips/ical/tf/blahblah/blahblah/calendar.ics"
			       			       "SteelBlue")
    )
  )



































;; [c]perl-mode
(use-package cperl-mode
  :mode ("\\.cgi\\'" . cperl-mode)

  :init


  (defalias 'perl-mode 'cperl-mode)
  (add-to-list 'exec-path
	       "~/perl5/bin")

  :config
  ;; Functions for perltidy
  (defun cmf/perltidy-region ()
    "Run perltidy on the current region."
    (interactive)
    (save-excursion
................................................................................
      (shell-command-on-region (point) (mark) "perltidy -q" nil t))
    )

  (defun cmf/perltidy-defun ()
    "Run perltidy on the current defun."
    (interactive)
    (save-excursion (mark-defun)
		    (perltidy-region))







    )

  :custom
  (cperl-continued-brace-offset -8)
  (cperl-continued-statement-offset 4)
  (cperl-electric-keywords t)
  (cperl-electric-linefeed t)
................................................................................
(use-package crontab-mode
  :ensure t
  :no-require t

  :mode (("\\.cron\\(tab\\)?\\'" . crontab-mode)
         ("cron\\(tab\\)?\\."    . crontab-mode))
  )

































;; eldoc
(use-package eldoc
  :diminish eldoc-mode " Doc"
  )

;; emojify
................................................................................
(use-package emojify
  ;; While the melpa version of emojify supports an experimental
  ;; version of global-emojify-mode-line-mode, enabling this causes
  ;; issues with cutting & pasting text, so will revisit that option
  ;; when it becomes more stable.
  :ensure t
  :if window-system
  :pin melpa-stable

  :config
  (global-emojify-mode)
  )

;; flycheck
(use-package flycheck
................................................................................
  )

;; flyspell
(use-package flyspell
  :ensure t

  :bind (:map flyspell-mode-map
	      ("C-c ;" . flyspell-correct-previous-word-generic))

  :hook ((prog-mode . flyspell-prog-mode)
	 (text-mode . flyspell-mode))

  :config
  (setq-default ispell-program-name "aspell")
  (ac-flyspell-workaround)






  )

;; forecast
(if (version< emacs-version "24.4")
    (message "Forecast requires Emacs version 24.4 or later.  Unable to install")
  (use-package forecast
    :ensure t
................................................................................

    :custom
    (forecast-latitude cmf-latitude)
    (forecast-longitude cmf-longitude)
    (forecast-city cmf-location-name)
    (forecast-country "United States")
    (forecast-units 'us)
    (forecast-api-key "f78b853ac0c972cccf06e75e21afbe9d")
    )
  )

;; geben
(use-package geben
  :ensure t
  :pin melpa-stable
................................................................................
(if (version< emacs-version "24.4")
    (message "Gited requires Emacs version 24.4 or greater.  Unable to install")
  (use-package gited
    :ensure t
    :no-require t

    :bind (
	   ("C-c C-g" . gited-list-branches)
	   )

    )
  )

;; ggtags
(if (version< emacs-version "25.1")
    (message "GGTags requires Emacs version 25.1 or greater.  Unable to install")
................................................................................
    :hook (prog-mode . ggtags-mode)
    )
  )

;; go-mode
(use-package go-mode
  :ensure t
  :ensure go-autocomplete
  :ensure go-direx
  :ensure go-eldoc
  :ensure go-snippets

  :pin melpa-stable
  :no-require t

  :mode ("\\.go\\'" . go-mode)

  :bind (:map go-mode-map
	      ("C-c C-j" . go-direx-pop-to-buffer))

  :hook ((go-mode . nice-prog-hook)
	 (go-mode . go-eldoc-setup))
  :init
  (add-hook 'go-mode-hook (lambda () (subword-mode 1)))




























  )

;; highlight-parentheses
(use-package highlight-parentheses
  :ensure t
  :diminish highlight-parentheses-mode

................................................................................
  :mode ("\\.tmpl\\'" . html-mode)
  )

;; htmlize
(use-package htmlize
  :ensure t
  :pin melpa-stable
)

;; ivy
(use-package ivy
  :ensure counsel
  :ensure swiper
  :diminish ivy-mode

................................................................................
         ("COMMIT.*"   . log-edit-mode)
         ("ci-comment" . log-edit-mode)
         ("bzr_log\\." . log-edit-mode)
         ("pico\\."    . log-edit-mode)
         )

  :hook ((log-edit-mode . nice-text-hook)
	 (log-edit-mode . turn-on-orgstruct++))

  )

;; magit
(if (version< emacs-version "25.1")
    (message "Magit requires Emacs version 25.1 or later.  Unable to install")
  (use-package magit
................................................................................
;; markdown-mode
(use-package markdown-mode
  :ensure t
  :pin melpa-stable

  :commands (markdown-mode gfm-mode)

  :mode (("README\\.md\\'"	 . gfm-mode)
         ("\\.md\\'"		 . markdown-mode)
         ("\\.markdown\\'"	 . markdown-mode))

  :init (setq markdown-command "multimarkdown")
  )

;; nxml-mode
(use-package nxml-mode
  :ensure auto-complete-nxml

  :mode (("\\.xsd\\'"  . xml-mode)
         ("\\.wsdl\\'" . xml-mode))

  :config
  ;; Under normal circumstances, I would add nice-prog-hook to nxml
  ;; mode and be done with it.  The issue here is that nice-prog-hook
  ;; includes enabling auto-fill-mode, which wrecks havoc when editing
  ;; XML files at work.  So, create my own hook explicitly disabling
  ;; auto-fill-mode
  (defun nice-nxml-hook ()
    "Hook for sane editing of XML files."
    (if (>= emacs-major-version 23)
	(linum-mode t))
    (auto-fill-mode -1)
    )

  ;; Apply hook
  (add-hook 'nxml-mode-hook 'nice-nxml-hook)

  ;; Keystroke for popup help about something at point.
  (setq auto-complete-nxml-popup-help-key "C-:")

  ;; Keystroke for toggle on/off automatic completion.
  (setq auto-complete-nxml-toggle-automatic-key "C-c C-t")
  )

;; org-mode
(use-package org
  :ensure org-ac
  :ensure org-bullets
  :ensure ox-twbs

  :bind (
         ("C-c l" . org-store-link)
         ("C-c a" . org-agenda)
         ("C-c c" . org-capture)
         ("C-c b" . org-iswitchb)
         )

  :hook (org-mode . nice-text-hook)

  :init
  (require 'org-install)
  (require 'org-bullets)
  (require 'org-crypt)

  ;; Enable org-crypt as appropriate
  (org-crypt-use-before-save-magic)

  :config









  (use-package org-fancy-priorities
    :ensure t

    :diminish " 🄵"

    :hook
    (org-mode . org-fancy-priorities-mode)

    :config
    ;; Customization for org-fancy-priorities
    (setq org-fancy-priorities-list '("⚡" "⬆" "⬇" "☕"))
    (setq org-lowest-priority ?D)
    )






  ;; Org-mode settings are kept in a different file
  (require 'cmf-org-settings)
  ;; Define a basic hook for sane editing of org-mode documents
  (defun nice-org-hook ()
    "Hook for sane editing of 'org-mode' documents."
    (org-defkey org-mode-map "\C-c[" 'org-time-stamp-inactive)
    (org-ac/setup-current-buffer)
    (if (equal (car (split-string org-version ".")) 8)
        (require 'ox-md))
    )

  ;; Persist org-clock appropriately
  (org-clock-persistence-insinuate)

................................................................................
;;
;; LATER: When org-gcal is compliant with version 8.2.10 (Default
;; under Emacs 25.3)

;; php-mode
(use-package php-mode
  :ensure t
  :ensure php-auto-yasnippets
  :ensure php-eldoc
  :ensure php-extras
  :ensure phpcbf
  :ensure phpunit

  :no-require t

  :mode ("\\.php\\'" . php-mode)

  :bind (:map php-mode-map
	      ("C-c C--" . php-current-class)
	      ("C-c C-=" . php-current-namespace)
	      ("C-c C-y" . 'yas/create-php-snippet)
	      ("C-x p"   . php-insert-doc-block)
	      )

  :hook (php-mode . nice-prog-hook)

  :init
  (require 'php-doc)
  (require 'php-ext)
  (add-hook 'php-mode-hook (lambda () (subword-mode 1)))

  :config
  ;; Load php documentor
  (load-file "~/.emacs.d/thirdparty/phpdocumentor.el")



































  :custom
  (php-enable-psr2-coding-style)
  (php-lineup-cascaded-calls t)
  (phpcbf-standard "PSR2")
  )

................................................................................
      :config
      (pretty-lambda-for-modes)
      )
  ;; Otherwise use built-in prettify mode
  (global-prettify-symbols-mode t)
  )

;; python-mode












(use-package python-mode
  :ensure t
  :pin melpa-stable

  :mode ("\\.py\\'" . python-mode)

  :init
  (setq abbrev-file-name "~/.emacs.d/.abbrev_defs")
  (if (not (file-exists-p abbrev-file-name))
      (write-region "" "" abbrev-file-name))

  :config
  (setq save-abbrevs t)


  (use-package jedi
    :ensure t
    :ensure auto-virtualenv
    :no-require t

    :pin melpa-stable


    :hook ((python-mode . jedi:setup)
	   (python-mode . jedi:ac-setup)
	   (python-mode . auto-virtualenv-set-virtualenv)
	   (window-configuration-change-hook . auto-virtualenv-set-virtualenv)
	   (focus-in-hook . auto-virtualenv-set-virtualenv))

    :init
    (jedi:install-server)

    :custom
    (jedi:complete-on-dot 1)
    (jedi:install-python-jedi-dev-command
      (quote
       ("pip3" "install" "--upgrade" "git+https://github.com/davidhalter/jedi.git@dev#egg=jedi")))
    )

  (use-package jedi-direx
    :ensure t
    :no-require t

    :bind (:map python-mode-map
		("C-c x" . jedi-direx:pop-to-buffer))



    :hook (jedi-mode-hook . jedi-direx:setup)


    )

  (use-package flycheck-pyflakes
    :ensure t
    )


  (use-package py-autopep8
    :ensure t
    :pin melpa-stable


    :hook (python-mode . py-autopep8-enable-on-save)






    :bind (:map python-mode-map
		("C-c C-p" . autopep8))
    )


  (use-package py-yapf
    :ensure t
    :no-require t
    :pin melpa-stable


    :hook (python-mode . py-yapf-enable-on-save)

    )

  (use-package pyimport
    :ensure t
    :pin melpa-stable


    :bind (:map python-mode-map
		("C-c C-i" . pyimport-insert-missing))
    )

  (use-package sphinx-doc
    :ensure t
    :pin melpa-stable


    :config
    (add-hook 'python-mode-hook (lambda () (sphinx-doc-mode t)))
    )



  )

;; ruby-mode
(use-package ruby-mode
  :init
  (add-hook 'ruby-mode-hook 'nice-prog-hook)
  )
................................................................................
  :ensure t
  :no-require t

  :mode (
         ("*.sed" . sed-mode)
         )
  )


















;; smart-mode-line
(use-package smart-mode-line
  :ensure t

  :init
  (setq sml/no-confirm-load-theme t)
................................................................................
     (progn
       (sml/apply-theme 'dark)
       (setq sml/read-only-char " 🔒")))
    (window-system
     (progn
       (sml/apply-theme 'respectful)
       (setq sml/read-only-char " 🔒"))
    ))

  :custom
  (sml/modified-char "★")
  )

;; sql
(use-package sql
  :mode (
         ("sql*" . sql-mode))

  :hook (sql-mode . nice-prog-hook)
  )

;; sudo-edit
(use-package sudo-edit
  :ensure t
................................................................................

  :custom
  (twittering-display-remaining t)
  (twittering-timer-interval 900)
  (twittering-tinyurl-service (quote tinyurl))
  (twittering-use-icon-storage t)
  (twittering-use-master-password t)
  (twittering-username "wulflock")
  )

;; undo-tree
(use-package undo-tree
  :ensure t
  :diminish " 🆃"

................................................................................
  :init
  (add-hook 'prog-mode-hook
            (lambda ()
              (undo-tree-mode t)))
  (add-hook 'text-mode-hook
            (lambda ()
              (undo-tree-mode t)))




  :custom
  (undo-tree-visualizer-diff t)
  (undo-tree-visualizer-timestamps t)
  )


;; vc-fossil
(use-package vc-fossil
  :ensure t
  :init
  (require 'vc-fossil)

  :config
  (add-to-list 'vc-handled-backends 'Fossil)

  :custom
  (vc-fossil-extra-header-fields (quote (:remote-url :checkout :tags)))
  )











;; which-func
(use-package which-func
  :no-require t

  :custom
  (which-function-mode t)
................................................................................

;; which-key
(if (version< emacs-version "24.4")
    (message "Which-Key requires Emacs version 24.4 or greater.  Unable to install")
  (use-package which-key
    :ensure t
    :pin melpa-stable


    :config
    (which-key-mode)
    )
  )

;; with-editor
(use-package with-editor
  :no-require t

  :hook ((with-editor-mode . nice-text-hook)
	 (with-editor-mode . turn-on-orgstruct++))
  )

;; xkcd
(use-package xkcd
  :ensure t
  :if window-system
  :no-require t
................................................................................
;; yaml-mode
(use-package yaml-mode
  :ensure t
  :no-require t

  :mode ("\\.sls\\'" . yaml-mode)




  :hook (yaml-mode . nice-prog-hook)
  )

;; Miscellany
;; --------------------------------------------------------------------

;; Diminished modes that we have to put here as :diminish doesn't seem







|


>

>







 







|







 







|
|
|











|
|
|
|
|
|
|
|













<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







|
|
|

|
|

|
|
|







 







|
|
|













>
>







 







|







>



>
>
>
>
>
>
>
>
>







 







<
<
<




<
<




>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>













>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






>
>

<
<







 







|
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







<







 







|


|



|
>
>
>
>
>
>







 







|







 







|
|







 







<
<
<
<







|


|


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|







 







|







 







|
|
|






<













|





<
<
<
<
<
<




<
<
<
<











<






>
>
>
>
>
>
>
>
>













>
>
>
>
>







<







 







<
<
<
<
<
<





|
|
|
|
|











>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|
>
>
>
>
>
>
>
>
>
>
>
>
|
<
<

<
<
<
<
<
<
<

<
<
>
|

<
<
<

>

<
<
<
<
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
>
>

<
>
>


<
<
<
<
>
|


>

<
>
>
>
>
>
|
<
<
|
<
>
|

<

>

<
>
|
<
<
<
<
<
>
|
<
<
<
|
<
<
>
|
<
<
|
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|







<
|







 







|







 







>
>
>





<













>
>
>
>
>
>
>
>
>
>







 







>











|







 







>
>
>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
...
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
...
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
...
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
...
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
...
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
...
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
...
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
...
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
...
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
...
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
...
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
...
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
...
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
...
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
...
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
....
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
....
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
....
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202

1203
1204
1205
1206
1207
1208
1209
1210
....
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
....
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268

1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
....
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
....
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
(defvar cmf-custom "~/.emacs.d/custom.el")
(defvar cmf-custom-16 "~/.emacs.d/custom-nox.el")
(defvar cmf-custom-256 "~/.emacs.d/custom-nox256.el")

;; List of paths to search
(defvar cmf-path-list '("/usr/texbin"
                        "/usr/pkg/bin"
                        "/opt/pkg/bin"
                        "/usr/local/bin"
                        "~/.composer/vendor/bin"
                        "~/bin"
                        "~/go/bin"
                        "~/perl5/bin"
                        "/Library/TeX/texbin"))

;; Customize generic variables
(custom-set-variables
 '(c-default-style
   (quote
    ((c-mode . "cmf")
................................................................................
                (arglist-cont-nonempty . *)
                (statement-cont . *))
               (indent-tabs-mode . t)))

;; My own style
(c-add-style "cmf"
             '("bsd"
               (indent-tabs-mode . nil)
               (c-offsets-alist
                (statement-cont . (first c-lineup-cascaded-calls +)))))


;; Functions
;; --------------------------------------------------------------------

................................................................................
;; OSX Modes (Mac OS X only)
;;

(when (eq system-type 'darwin)

  ;; Set up mac-specific parameters here
  (setq delete-by-moving-to-trash t
        mac-option-modifier 'meta
        trash-directory "~/.Trash/emacs"
        )

  ;; Make sure backup directory exists
  (if (not (file-exists-p trash-directory))
      (make-directory trash-directory))

  ;; osx-location
  (use-package osx-location
    :ensure t

    :hook
    (osx-location-changed .
                          (lambda ()
                            (setq calendar-latitude osx-location-latitude
                                  calendar-longitude osx-location-longitude
                                  calendar-location-name (format "%s, %s" osx-location-latitude osx-location-longitude)
                                  forecast-latitude osx-location-latitude
                                  forecast-longitude osx-location-longitude
                                  forecast-city (format "%s, %s" osx-location-latitude osx-location-longitude)))
                          )

    :config
    (osx-location-watch)

    )
  )

;;
;; Generic Packages
;;
;; For use on all operating systems
;;























;; yasnippet
(use-package yasnippet
  :ensure t
  :ensure yasnippet-snippets
  :pin melpa-stable

  :init
................................................................................

  :custom
  (yas-wrap-around-region t)
  )

;; ace-window
(if (not(version< emacs-version "24.4"))
    (use-package ace-window
      :ensure t
      :pin melpa-stable

      :config
      (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))

      :bind (
             ("C-x o" . ace-window))
      )
  )

;; all-the-icons
(if (version< emacs-version "24.4")
    (message "All-the-icons requires Emacs version 24.4 or later.  Unable to install")
  (use-package all-the-icons
    :if window-system
................................................................................

    :config

    ;; Install the font files only if we have not already done so
    (defvar cmf-fonts-installed-file "~/SHELL/emacs.d/.icon-fonts-installed")
    (unless (file-exists-p cmf-fonts-installed-file)
      (progn
        (message "Installing icon fonts")
        (all-the-icons-install-fonts t)
        (with-temp-buffer (write-file cmf-fonts-installed-file)))
      )
    )

  ;; all-the-icons-dired
  (use-package all-the-icons-dired
    :if window-system
    :ensure t
    :after all-the-icons

    :init
    (require 'font-lock+)

    :hook (dired-mode . all-the-icons-dired-mode)

    :diminish all-the-icons-dired-mode " 🄸"
    )

  (use-package all-the-icons-ivy
    :if window-system
    :ensure t
    :after all-the-icons
    :pin melpa-stable
................................................................................
;; arjen-grey-theme
(use-package arjen-grey-theme
  :ensure t
  :if window-system

  :init
  (add-to-list 'custom-safe-themes
               "c74e83f8aa4c78a121b52146eadb792c9facc5b1f02c917e3dbb454fca931223")
  (load-theme 'arjen-grey t)

  :custom-face
  (highlight ((t (:distant-foreground "LightYellow3" :background "DarkOliveGreen"))))
  )

;; auctex
;; TODO: Add company-bibtex, if necessary
(use-package auctex
  :ensure t
  :no-require t

  :config
  (use-package company-auctex
    :ensure t
    :after company

    :init
    (company-auctex-init)
    )
  )

;; beacon mode
(use-package beacon
  :ensure t
  :pin melpa-stable

................................................................................
  :config
  (beacon-mode 1)
  )

;; calfw
(use-package calfw
  :ensure t



  :pin melpa-stable

  :init
  (require 'calfw)



  ;; See https://github.com/kiwanami/emacs-calfw for setting up your
  ;; own calendars
  :config
  ;; calfw-gcal
  (use-package calfw-gcal
    :ensure t

    :init
    (require 'calfw-gcal)
    )

  ;; calfw-ical
  (use-package calfw-ical
    :ensure t

    :init
    (require 'calfw-ical)
    )

  ;; calfw-org
  (use-package calfw-org
    :ensure t

    :init
    (require 'calfw-org)
    )

  (defun cmf-open-calendar ()
    (interactive)
    (cfw:open-calendar-buffer :contents-sources
			      (list
			       (cfw:org-create-source "Green")  ; orgmode source
			       (cfw:ical-create-source "Google Calendar"
						       "https://calendar.google.com/calendar/ical/jsmith%40example.com/private-set-me-up/basic.ics"
						       "Orange")
			       (cfw:ical-create-source "Trips via Kayak"
			       			       "https://www.kayak.com/trips/ical/tf/blahblah/blahblah/calendar.ics"
			       			       "SteelBlue")
    )
  )

;; company-mode
(use-package company
  :ensure t
  :pin gnu

  :diminish company-mode " 🄲"

  :init
  (global-company-mode)

  :bind (:map company-active-map
              ("C-n" . company-select-next)
              ("C-p" . company-select-previous)
              ("TAB" . company-complete-selection)
              )

  :custom
  (company-tooltip-align-annotations t)
  (company-tooltip-minimum-width 27)
  (company-idle-delay 0.3)
  (company-tooltip-limit 10)
  (company-minimum-prefix-length 3)
  (company-tooltip-flip-when-above t)
  )

;; company-ansible
(use-package company-ansible
  :ensure t
  :pin melpa-stable

  :init
  (add-to-list 'company-backends 'company-ansible)
  )

;; [c]perl-mode
(use-package cperl-mode
  :mode ("\\.cgi\\'" . cperl-mode)

  :init
  (if (equal(length(getenv "PERL5LIB")) 0)
      (setenv "PERL5LIB" (concat (getenv "HOME") "/perl5/lib/perl5")))
  (defalias 'perl-mode 'cperl-mode)



  :config
  ;; Functions for perltidy
  (defun cmf/perltidy-region ()
    "Run perltidy on the current region."
    (interactive)
    (save-excursion
................................................................................
      (shell-command-on-region (point) (mark) "perltidy -q" nil t))
    )

  (defun cmf/perltidy-defun ()
    "Run perltidy on the current defun."
    (interactive)
    (save-excursion (mark-defun)
                    (perltidy-region))
    )
  (use-package company-plsense
    :ensure t
    :after company

    :init
    (add-to-list 'company-backends 'company-plsense)
    )

  :custom
  (cperl-continued-brace-offset -8)
  (cperl-continued-statement-offset 4)
  (cperl-electric-keywords t)
  (cperl-electric-linefeed t)
................................................................................
(use-package crontab-mode
  :ensure t
  :no-require t

  :mode (("\\.cron\\(tab\\)?\\'" . crontab-mode)
         ("cron\\(tab\\)?\\."    . crontab-mode))
  )

;; docker
;;
;; Note that I do not use Windows operating systems so do not know if
;; 'windows-nt' works as well.  Feel free to contact me if it does.
(if (member system-type '(darwin gnu/linux))
    (use-package docker
      :ensure t
      :bind ("C-c d" . docker)
      )
  (message "%s is not supported by Docker, so docker.el will not be installed"  (upcase-initials (prin1-to-string system-type)))
  )

;; dockerfile-mode
(use-package dockerfile-mode
  :ensure t
  :pin melpa-stable

  :mode ("Dockerfile\\'" . dockerfile-mode)
  )

;; emacs-lisp
(use-package emacs-lisp
  :no-require t
  :after company

  :init
  (add-hook 'emacs-lisp-mode-hook
            (lambda ()
              (add-to-list 'company-backends 'company-elisp))
            )
  )

;; eldoc
(use-package eldoc
  :diminish eldoc-mode " Doc"
  )

;; emojify
................................................................................
(use-package emojify
  ;; While the melpa version of emojify supports an experimental
  ;; version of global-emojify-mode-line-mode, enabling this causes
  ;; issues with cutting & pasting text, so will revisit that option
  ;; when it becomes more stable.
  :ensure t
  :if window-system


  :config
  (global-emojify-mode)
  )

;; flycheck
(use-package flycheck
................................................................................
  )

;; flyspell
(use-package flyspell
  :ensure t

  :bind (:map flyspell-mode-map
              ("C-c ;" . flyspell-correct-previous-word-generic))

  :hook ((prog-mode . flyspell-prog-mode)
         (text-mode . flyspell-mode))

  :config
  (setq-default ispell-program-name "aspell")
  (use-package flyspell-correct-ivy
    :ensure t
    :pin melpa
    )

  :custom
  (ispell-extra-args (quote ("--run-together")))
  )

;; forecast
(if (version< emacs-version "24.4")
    (message "Forecast requires Emacs version 24.4 or later.  Unable to install")
  (use-package forecast
    :ensure t
................................................................................

    :custom
    (forecast-latitude cmf-latitude)
    (forecast-longitude cmf-longitude)
    (forecast-city cmf-location-name)
    (forecast-country "United States")
    (forecast-units 'us)
    (forecast-api-key "")		; Get API key at https://developer.forecast.io/
    )
  )

;; geben
(use-package geben
  :ensure t
  :pin melpa-stable
................................................................................
(if (version< emacs-version "24.4")
    (message "Gited requires Emacs version 24.4 or greater.  Unable to install")
  (use-package gited
    :ensure t
    :no-require t

    :bind (
           ("C-c C-g" . gited-list-branches)
           )

    )
  )

;; ggtags
(if (version< emacs-version "25.1")
    (message "GGTags requires Emacs version 25.1 or greater.  Unable to install")
................................................................................
    :hook (prog-mode . ggtags-mode)
    )
  )

;; go-mode
(use-package go-mode
  :ensure t





  :pin melpa-stable
  :no-require t

  :mode ("\\.go\\'" . go-mode)

  :bind (:map go-mode-map
              ("C-c C-j" . go-direx-pop-to-buffer))

  :hook ((go-mode . nice-prog-hook)
         (go-mode . go-eldoc-setup))
  :init
  (add-hook 'go-mode-hook (lambda () (subword-mode 1)))

  :config
  ;; company-go
  (use-package company-go
    :ensure t

    :init
    (add-hook 'go-mode-hook
              (lambda ()
                (add-to-list 'company-backends 'company-elisp)))
    )

  ;; go-direx
  (use-package go-direx
    :ensure t
    )

  ;; go-eldoc
  (use-package go-eldoc
    :ensure t
    :after eldoc
    )

  ;; go-snippets
  (use-package go-snippets
    :ensure t
    :after yasnippet
    )
  )

;; highlight-parentheses
(use-package highlight-parentheses
  :ensure t
  :diminish highlight-parentheses-mode

................................................................................
  :mode ("\\.tmpl\\'" . html-mode)
  )

;; htmlize
(use-package htmlize
  :ensure t
  :pin melpa-stable
  )

;; ivy
(use-package ivy
  :ensure counsel
  :ensure swiper
  :diminish ivy-mode

................................................................................
         ("COMMIT.*"   . log-edit-mode)
         ("ci-comment" . log-edit-mode)
         ("bzr_log\\." . log-edit-mode)
         ("pico\\."    . log-edit-mode)
         )

  :hook ((log-edit-mode . nice-text-hook)
         (log-edit-mode . turn-on-orgstruct++))

  )

;; magit
(if (version< emacs-version "25.1")
    (message "Magit requires Emacs version 25.1 or later.  Unable to install")
  (use-package magit
................................................................................
;; markdown-mode
(use-package markdown-mode
  :ensure t
  :pin melpa-stable

  :commands (markdown-mode gfm-mode)

  :mode (("README\\.md\\'"         . gfm-mode)
         ("\\.md\\'"               . markdown-mode)
         ("\\.markdown\\'"         . markdown-mode))

  :init (setq markdown-command "multimarkdown")
  )

;; nxml-mode
(use-package nxml-mode


  :mode (("\\.xsd\\'"  . xml-mode)
         ("\\.wsdl\\'" . xml-mode))

  :config
  ;; Under normal circumstances, I would add nice-prog-hook to nxml
  ;; mode and be done with it.  The issue here is that nice-prog-hook
  ;; includes enabling auto-fill-mode, which wrecks havoc when editing
  ;; XML files at work.  So, create my own hook explicitly disabling
  ;; auto-fill-mode
  (defun nice-nxml-hook ()
    "Hook for sane editing of XML files."
    (if (>= emacs-major-version 23)
        (linum-mode t))
    (auto-fill-mode -1)
    )

  ;; Apply hook
  (add-hook 'nxml-mode-hook 'nice-nxml-hook)






  )

;; org-mode
(use-package org




  :bind (
         ("C-c l" . org-store-link)
         ("C-c a" . org-agenda)
         ("C-c c" . org-capture)
         ("C-c b" . org-iswitchb)
         )

  :hook (org-mode . nice-text-hook)

  :init
  (require 'org-install)

  (require 'org-crypt)

  ;; Enable org-crypt as appropriate
  (org-crypt-use-before-save-magic)

  :config
  ;; org-bullets
  (use-package org-bullets
    :ensure t

    :init
    (require 'org-bullets)
    )

  ;; org-fancy-priorities
  (use-package org-fancy-priorities
    :ensure t

    :diminish " 🄵"

    :hook
    (org-mode . org-fancy-priorities-mode)

    :config
    ;; Customization for org-fancy-priorities
    (setq org-fancy-priorities-list '("⚡" "⬆" "⬇" "☕"))
    (setq org-lowest-priority ?D)
    )

  ;; ox-twbs
  (use-package ox-twbs
    :ensure t
    )

  ;; Org-mode settings are kept in a different file
  (require 'cmf-org-settings)
  ;; Define a basic hook for sane editing of org-mode documents
  (defun nice-org-hook ()
    "Hook for sane editing of 'org-mode' documents."
    (org-defkey org-mode-map "\C-c[" 'org-time-stamp-inactive)

    (if (equal (car (split-string org-version ".")) 8)
        (require 'ox-md))
    )

  ;; Persist org-clock appropriately
  (org-clock-persistence-insinuate)

................................................................................
;;
;; LATER: When org-gcal is compliant with version 8.2.10 (Default
;; under Emacs 25.3)

;; php-mode
(use-package php-mode
  :ensure t






  :no-require t

  :mode ("\\.php\\'" . php-mode)

  :bind (:map php-mode-map
              ("C-c C--" . php-current-class)
              ("C-c C-=" . php-current-namespace)
              ("C-c C-y" . 'yas/create-php-snippet)
              ("C-x p"   . php-insert-doc-block)
              )

  :hook (php-mode . nice-prog-hook)

  :init
  (require 'php-doc)
  (require 'php-ext)
  (add-hook 'php-mode-hook (lambda () (subword-mode 1)))

  :config
  ;; Load php documentor
  (load-file "~/.emacs.d/thirdparty/phpdocumentor.el")

  ;; company-php
  (use-package company-php
    :ensure t
    :pin melpa-stable
    :after company

    :init
    (add-hook 'php-mode-hook
              (lambda ()
                (add-to-list 'company-backends 'company-ac-php-backend )))
    )

  ;; php-auto-yasnippets
  (use-package php-auto-yasnippets
    :ensure t
    :after yasnippet
    )

  ;; php-eldoc
  (use-package php-eldoc
    :ensure t
    :after eldoc
    )

  ;; phpcbf
  (use-package phpcbf
    :ensure t
    )

  ;; phpunit
  (use-package phpunit
    :ensure t
    )

  :custom
  (php-enable-psr2-coding-style)
  (php-lineup-cascaded-calls t)
  (phpcbf-standard "PSR2")
  )

................................................................................
      :config
      (pretty-lambda-for-modes)
      )
  ;; Otherwise use built-in prettify mode
  (global-prettify-symbols-mode t)
  )

;; python
;;
;; Install the following packages beforehand via pip or package
;; manager, if available:
;;
;;  - autopep8
;;  - flake8
;;  - jedi
;;  - setuptools-black
;;  - virtualenv
;;  - yapf
;;
;; Then run `M-x elpy-config'
(use-package python










  :config


  ;; company-jedi
  (use-package company-jedi
    :ensure t



    :pin melpa-stable
    :after company







    :init













    (add-hook 'python-mode-hook

	      (lambda ()
		(add-to-list 'company-backends 'company-jedi)))


    :config
    (company-jedi t)
    )





  ;; elpy
  (use-package elpy
    :ensure t
    :pin melpa-stable
    :after flycheck


    :config
    (elpy-enable)
    (when (require 'flycheck nil t)
      (setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
      (add-hook 'elpy-mode-hook 'flycheck-mode))
    )




  ;; sphinx-doc
  (use-package sphinx-doc
    :ensure t

    :pin melpa-stable
    :diminish " 🆂"


    :bind ("C-x p" . sphinx-doc)






    :init
    (add-hook 'python-mode-hook (lambda ()



                                  (require 'sphinx-doc)


                                  (sphinx-doc-mode t)))
    )



  :custom
  ;; Use python3 by default
  (elpy-rpc-python-command "python3")
  )

;; ruby-mode
(use-package ruby-mode
  :init
  (add-hook 'ruby-mode-hook 'nice-prog-hook)
  )
................................................................................
  :ensure t
  :no-require t

  :mode (
         ("*.sed" . sed-mode)
         )
  )

;; sh-mode
(use-package shell
  :config
  (use-package company-shell
    :ensure t
    :pin melpa-stable

    :init
    (add-hook 'sh-mode-hook
              (lambda ()
                (add-to-list 'company-backends 'company-shell)))

    :custom
    (company-shell-clean-manpage t)
    )
  )

;; smart-mode-line
(use-package smart-mode-line
  :ensure t

  :init
  (setq sml/no-confirm-load-theme t)
................................................................................
     (progn
       (sml/apply-theme 'dark)
       (setq sml/read-only-char " 🔒")))
    (window-system
     (progn
       (sml/apply-theme 'respectful)
       (setq sml/read-only-char " 🔒"))
     ))

  :custom
  (sml/modified-char "★")
  )

;; sql
(use-package sql

  :mode (("/sql[^/]]*" . sql-mode))

  :hook (sql-mode . nice-prog-hook)
  )

;; sudo-edit
(use-package sudo-edit
  :ensure t
................................................................................

  :custom
  (twittering-display-remaining t)
  (twittering-timer-interval 900)
  (twittering-tinyurl-service (quote tinyurl))
  (twittering-use-icon-storage t)
  (twittering-use-master-password t)
  (twittering-username "#####")		; Add your twitter handle here
  )

;; undo-tree
(use-package undo-tree
  :ensure t
  :diminish " 🆃"

................................................................................
  :init
  (add-hook 'prog-mode-hook
            (lambda ()
              (undo-tree-mode t)))
  (add-hook 'text-mode-hook
            (lambda ()
              (undo-tree-mode t)))
  (add-hook 'conf-mode-hook
            (lambda ()
              (undo-tree-mode t)))

  :custom
  (undo-tree-visualizer-diff t)
  (undo-tree-visualizer-timestamps t)
  )


;; vc-fossil
(use-package vc-fossil
  :ensure t
  :init
  (require 'vc-fossil)

  :config
  (add-to-list 'vc-handled-backends 'Fossil)

  :custom
  (vc-fossil-extra-header-fields (quote (:remote-url :checkout :tags)))
  )

;; vue-js
(use-package vue-mode
  :ensure t
  :pin melpa-stable

  :config
  ;; 0, 1, or 2, representing (respectively) none, low, and high coloring
  (setq mmm-submode-decoration-level 2)
  )

;; which-func
(use-package which-func
  :no-require t

  :custom
  (which-function-mode t)
................................................................................

;; which-key
(if (version< emacs-version "24.4")
    (message "Which-Key requires Emacs version 24.4 or greater.  Unable to install")
  (use-package which-key
    :ensure t
    :pin melpa-stable
    :diminish which-key-mode " 🅆"

    :config
    (which-key-mode)
    )
  )

;; with-editor
(use-package with-editor
  :no-require t

  :hook ((with-editor-mode . nice-text-hook)
         (with-editor-mode . turn-on-orgstruct++))
  )

;; xkcd
(use-package xkcd
  :ensure t
  :if window-system
  :no-require t
................................................................................
;; yaml-mode
(use-package yaml-mode
  :ensure t
  :no-require t

  :mode ("\\.sls\\'" . yaml-mode)

  :init
  (add-hook 'yaml-mode-hook (lambda () (subword-mode 1)))

  :hook (yaml-mode . nice-prog-hook)
  )

;; Miscellany
;; --------------------------------------------------------------------

;; Diminished modes that we have to put here as :diminish doesn't seem

Changes to emacs.d/lisp/GNUmakefile.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#
# emacs.d/lisp/GNUmakefile
#

RM_OPTS=$(shell if [ `uname` != "OpenBSD" ]; then echo '-vf'; else echo '-f'; fi)

clean: ${CLEANDIRS}
	@rm ${RM_OPTS} *~
	@rm ${RM_OPTS} *.bak
	@rm ${RM_OPTS} *-baseline
	@rm ${RM_OPTS} *-merge
	@rm ${RM_OPTS} *-original
	@rm ${RM_OPTS} *.elc

# Ende




|
<
<
<
<
<
<
<
<
<
<
1
2
3
4
5










#
# emacs.d/lisp/GNUmakefile
#

include ../../mk/subclean.mk










Changes to emacs.d/lisp/cmf-org-settings.el.

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
       (tags-todo "GGG"))
      ((org-agenda-tag-filter-preset
        (quote
         ("+GGG"))))))))
 '(org-agenda-files
   (quote
    ("~/org/tasks.org" "~/org/refile.org" "~/org/notes.org")))
 '(org-archive-location "~/org/archive/%s_archive::datetree/")
 '(org-ascii-charset (quote utf-8))
 '(org-capture-templates
   (quote
    (("t" "Task" entry
      (file+headline "~/org/refile.org" "New Tasks")
      "* TODO %^{Description}  %^G
  Added: %U







|







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
       (tags-todo "GGG"))
      ((org-agenda-tag-filter-preset
        (quote
         ("+GGG"))))))))
 '(org-agenda-files
   (quote
    ("~/org/tasks.org" "~/org/refile.org" "~/org/notes.org")))
 '(org-archive-location "~/org/archive/%s_archive::file+olp+datetree/")
 '(org-ascii-charset (quote utf-8))
 '(org-capture-templates
   (quote
    (("t" "Task" entry
      (file+headline "~/org/refile.org" "New Tasks")
      "* TODO %^{Description}  %^G
  Added: %U

Changes to emacs.d/thirdparty/GNUmakefile.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#
# emacs.d/thirdparty/GNUmakefile
#

RM_OPTS=$(shell if [ `uname` != "OpenBSD" ]; then echo '-vf'; else echo '-f'; fi)

clean: ${CLEANDIRS}
	@rm ${RM_OPTS} *~
	@rm ${RM_OPTS} *.bak
	@rm ${RM_OPTS} *-baseline
	@rm ${RM_OPTS} *-merge
	@rm ${RM_OPTS} *-original
	@rm ${RM_OPTS} *.elc

# Ende




|
<
<
<
<
<
<
<
<
<
<
1
2
3
4
5










#
# emacs.d/thirdparty/GNUmakefile
#

include ../../mk/subclean.mk










Changes to global-excludes.

1
2
3
4
5

6
7
8
9
10
11
12
..
16
17
18
19
20
21
22

23
24
25

26

27
28
*.tar.gz
*~
.abbrev_defs
.icon-fonts-installed
.fslckout

.org-id-locations
.python-environments
GPATH
GRTAGS
GTAGS
_FOSSIL_
ac-comphist.dat
................................................................................
config/
docs/*.org
elpa/
emojis/
eshell/
ext/
ido.last

org-clock-save.el
recentf
network-security.data

tramp

url/
xkcd/



<

>







 







>


<
>

>


1
2
3

4
5
6
7
8
9
10
11
12
..
16
17
18
19
20
21
22
23
24
25

26
27
28
29
30
*.tar.gz
*~
.abbrev_defs

.fslckout
.icon-fonts-installed
.org-id-locations
.python-environments
GPATH
GRTAGS
GTAGS
_FOSSIL_
ac-comphist.dat
................................................................................
config/
docs/*.org
elpa/
emojis/
eshell/
ext/
ido.last
network-security.data
org-clock-save.el
recentf

session.*
tramp
transient/
url/
xkcd/

Changes to mk/subclean.mk.

2
3
4
5
6
7
8

9
10
11
12
13
# mk/subclean.mk
#

RM_OPTS=$(shell if [ `uname` != "OpenBSD" ]; then echo '-vf'; else echo '-f'; fi)

clean:
	@rm ${RM_OPTS} *~

	@rm ${RM_OPTS} *.bak
	@rm ${RM_OPTS} *-baseline
	@rm ${RM_OPTS} *-merge
	@rm ${RM_OPTS} *-original








>

|
|
|

2
3
4
5
6
7
8
9
10
11
12
13
14
# mk/subclean.mk
#

RM_OPTS=$(shell if [ `uname` != "OpenBSD" ]; then echo '-vf'; else echo '-f'; fi)

clean:
	@rm ${RM_OPTS} *~
	@rm ${RM_OPTS} *.elc
	@rm ${RM_OPTS} *.bak
	@rm ${RM_OPTS} *-baseline*
	@rm ${RM_OPTS} *-merge*
	@rm ${RM_OPTS} *-original*

Changes to setup.sh.

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
..
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
..
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
...
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
...
353
354
355
356
357
358
359







































360
361
362
363
364
365
366
...
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
...
451
452
453
454
455
456
457




458
459
460
461
462
463
464
...
545
546
547
548
549
550
551





552
553
554
555
556
557
558
...
570
571
572
573
574
575
576

577
578
579
580
581
582
583
# DESCRIPTION:
#
#   Set up my personal shell environment to taste, backing up old
#   files and linking appropriate dot files
#
# USAGE:
#
#   bash setup.sh [-hnpru] [-d <directory>] [-b <directory>]
#
# REQUIREMENTS:
#
#   - rsync(1)
#   - bash(1) v3.0 or greater
#   - GNU make compatible make(1)
#
................................................................................
SHELLDIR=${HOME}/SHELL
BACKUPDIR=${HOME}/Backup/shell
HOMETMPDIR=${HOME}/tmp
RSYNC=rsync
RSYNC_EXCLUDE=global-excludes
RSYNC_OPTS="-Ccav --delete --exclude-from=${RSYNC_EXCLUDE}"
MAKE=make
COPYRIGHT='Copyright (c) 2000-2018 Christopher M. Fuhrman'
OUTPUTSPACING=55
DRYRUN=""
UNINSTALL=0
GOINSTALL=0
GOPATH=${HOME}/go
PYINSTALL=0
BUILD_EMACS_PACKAGES=0
EMACS_OUTPUT_LOG=${HOME}/tmp/emacs-pkg-install-$$-`date +%y%m%d`.log
NOLINK=0            # If set to 1 (true), then the following apply:
                    #   - Linked files will not be created
                    #   - ~/tmp directory will not be created
                    #   - Existing files in $HOME will not be backed up

# Variables that can be overridden
: ${PYTHON_VERSION:=3}
................................................................................
# Dot-files to link
HOMEDOTFILES=('bash_logout'			\
              'bash_profile'			\
              'bashrc'				\
              'emacs.d'				\
              'gitconfig'			\
              'indent.pro'			\
              "mg"				\
	      "nanorc"				\
              'perltidyrc'			\
              'tmux.conf'			\
              'screenrc'			\
              'Xresources'
             )

# Use GNU Make if available, otherwise blindly assume that the system
# make is compatible.
makepaths=('/usr/pkg/bin/gmake'                 \
................................................................................

	# Install gotags for go-direx
	if [ ! -f {$GOBIN}/gotags ]; then
		inform $L2 $TRUE "Installing gotags"
		go get -u github.com/jstemmer/gotags
	fi
}























































# Function: pySetup
#
# Installs the tools necessary for python development
pySetup ()
{
	local PYTHON_PKGS=('jedi'		\
			   'flake8'		\
			   'autopep8'		\
			   'yapf'		\

			   'virtualenv'

			  )

	# Make sure that pip is installed
	if ! type ${PIP_BIN} >/dev/null; then
		inform $L1 $TRUE "${RED}ERROR${NORMAL}: python ${PIP_BIN} is not installed on this system.  Cowardly aborting!"
		exit 1
	fi
................................................................................
        echo -n 'DATE : '
        date
        echo -n 'HOST : '
        hostname
        echo ''

} # headerDisplay()








































# Function: inform
#
# Displays a message on STDOUT
#
# Parameters:
#
................................................................................
        cat 1>&2 <<STDERR
usage: ${0##*/} -h This screen                             \\
                -d (Default:\$HOME/SHELL) Target directory  \\
                -b (Default:\$HOME/Backup/shell) Location   \\
                   of backup files
                -n Do _not_ link files                     \\
                -g Set up/remove GoLang Development        \\

		-p Set up Python Development               \\
                -u Uninstall ShellPAK                      \\
                -r perform a trial run with no changes made
                   (implies -n)

STDERR

................................................................................
} # usage()


# --------------------------------------------------------------------

headerDisplay

args=$(getopt d:b:hnrpgu $*)

set -- $args

while [ $# -gt 0 ]
do

        case "$1" in
................................................................................
	-g)
		GOINSTALL=1
		;;

	-p)
		PYINSTALL=1
		;;





        -u)
                UNINSTALL=1
                inform $L1 $TRUE 'UNINSTALL invoked'
                ;;

        --)
................................................................................
        inform $L1 $TRUE 'Synchronization not necessary'
fi

# Do we want to set up our environment for golang development?
if [ ${GOINSTALL} -ne 0 ]; then
	goSetup
fi






# Do we want to set up our environment for python development?
if [ ${PYINSTALL} -ne 0 ]; then
	pySetup
fi

# Set up appropriate symlinks
................................................................................
                        inform $L2 $FALSE "Linking ${DOTFILE}"
                        ln -s ${SHELLDIR}/${file} ${DOTFILE}
                        echo -e "${GREEN}done${NORMAL}"
                fi

        done


fi

# Create ~/tmp directory if it doesn't exist
if [[ ${NOLINK} -ne 1 && ! -d ${HOMETMPDIR} ]]; then
        inform $L1 $FALSE "Creating ${HOMETMPDIR}"
        mkdir ${HOMETMPDIR}
        echo -e "${GREEN}done${NORMAL}"







|







 







|






|
<







 







|
|

<







 








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





|

<
|
>
|
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







 







|







 







>
>
>
>







 







>
>
>
>
>







 







>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
..
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

48
49
50
51
52
53
54
..
88
89
90
91
92
93
94
95
96
97

98
99
100
101
102
103
104
...
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
...
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
...
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
...
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
...
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
...
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
# DESCRIPTION:
#
#   Set up my personal shell environment to taste, backing up old
#   files and linking appropriate dot files
#
# USAGE:
#
#   bash setup.sh -h
#
# REQUIREMENTS:
#
#   - rsync(1)
#   - bash(1) v3.0 or greater
#   - GNU make compatible make(1)
#
................................................................................
SHELLDIR=${HOME}/SHELL
BACKUPDIR=${HOME}/Backup/shell
HOMETMPDIR=${HOME}/tmp
RSYNC=rsync
RSYNC_EXCLUDE=global-excludes
RSYNC_OPTS="-Ccav --delete --exclude-from=${RSYNC_EXCLUDE}"
MAKE=make
COPYRIGHT='Copyright (c) 2000-2019 Christopher M. Fuhrman'
OUTPUTSPACING=55
DRYRUN=""
UNINSTALL=0
GOINSTALL=0
GOPATH=${HOME}/go
PYINSTALL=0
PLINSTALL=0

NOLINK=0            # If set to 1 (true), then the following apply:
                    #   - Linked files will not be created
                    #   - ~/tmp directory will not be created
                    #   - Existing files in $HOME will not be backed up

# Variables that can be overridden
: ${PYTHON_VERSION:=3}
................................................................................
# Dot-files to link
HOMEDOTFILES=('bash_logout'			\
              'bash_profile'			\
              'bashrc'				\
              'emacs.d'				\
              'gitconfig'			\
              'indent.pro'			\
              'mg'				\
              'nanorc'				\
              'perltidyrc'			\

              'screenrc'			\
              'Xresources'
             )

# Use GNU Make if available, otherwise blindly assume that the system
# make is compatible.
makepaths=('/usr/pkg/bin/gmake'                 \
................................................................................

	# Install gotags for go-direx
	if [ ! -f {$GOBIN}/gotags ]; then
		inform $L2 $TRUE "Installing gotags"
		go get -u github.com/jstemmer/gotags
	fi
}

# Function: plSetup
#
# Installs plSense for perl development

plSetup ()
{
	local PLSENSE_REPO="https://github.com/aki2o/plsense.git"
	local PLSENSE_VER="v0.3.4"
	local PLSENSE_MODULE_PREREQUISITES=('Module::Install::CPANfile'	\
					    'PPI::Document'		\
					    'PPI::Lexer'		\
					    'Log::Handler'		\
					    'Config::Tiny'		\
					    'Storable'           	\
 					    'Class::Std::Storable'	\
					    'Cache::FileCache'		\
					    'List::AllUtils'
					   )

	if type -p plsense > /dev/null; then
		inform $L1 $TRUE "PLSense is already installed."
		return
	fi

	inform $L1 $TRUE "Setting up PLSense for perl development"

	for module in ${PLSENSE_MODULE_PREREQUISITES[@]}; do
		inform $L2 $TRUE " ${module}"
		cpan install $module
	done

	inform $L2 $TRUE "Installing PLSense"
	temp_dir="$(mktemp -q -d -t ${0##*/}.XXXXXX 2>/dev/null || mktemp -q -d)"

	git clone ${PLSENSE_REPO} $temp_dir
	pushd . >/dev/null
	cd $temp_dir
	git checkout ${PLSENSE_VERSION}

	# Standard Perl Installation
	perl Makefile.PL &&			\
	make             &&			\
	make test        &&			\
	make install

	# Clean up
	inform $L2 $TRUE "Cleaning up installation"
	popd >/dev/null
	rm -rf $temp_dir

	inform $L1 $TRUE "Setting up PLSense (manual interaction will be necessary)"
	$HOME/perl5/bin/plsense config
}

# Function: pySetup
#
# Installs the tools necessary for python development
pySetup ()
{
	local PYTHON_PKGS=('autopep8'		\
			   'flake8'		\

			   'jedi'		\
			   'setuptools-black'	\
			   'virtualenv'		\
			   'yapf'
			  )

	# Make sure that pip is installed
	if ! type ${PIP_BIN} >/dev/null; then
		inform $L1 $TRUE "${RED}ERROR${NORMAL}: python ${PIP_BIN} is not installed on this system.  Cowardly aborting!"
		exit 1
	fi
................................................................................
        echo -n 'DATE : '
        date
        echo -n 'HOST : '
        hostname
        echo ''

} # headerDisplay()

# Function: linkTmuxConf
#
# Caveats:
#   readlink(1) is neither available on Solaris nor AIX
#
# Links tmux.conf file depending on version

linkTmuxConf ()
{
	local tmux_conf_symlink=$HOME/.tmux.conf

	if ! type tmux >/dev/null 2>&1; then
		inform $L1 $TRUE "tmux is not installed, so configuration files will not be set up"
	else
		if [ -h $tmux_conf_symlink ]; then
			local real_tmux_conf=$( readlink $tmux_conf_symlink )

			if [[ -h $tmux_conf_symlink && ! -e $real_tmux_conf ]]; then
				inform $L1 $TRUE "Removing stale tmux.conf link"
				rm -f $tmux_conf_symlink
			fi

		fi

		if [ ! -e $HOME/.tmux.conf ]; then
			local tmux_version=$( tmux -V | sed 's/tmux \([0-9]\).[0-9][a-z]*/\1/' )

			if [[ $tmux_version -eq 1 ]]; then
				local tmux_conf=${SHELLDIR}/tmux-${tmux_version}.conf
			else
				local tmux_conf=${SHELLDIR}/tmux-2.conf
			fi

			inform $L1 $TRUE "Linking tmux configuration file"
			ln -s $tmux_conf $tmux_conf_symlink
		fi
	fi
}

# Function: inform
#
# Displays a message on STDOUT
#
# Parameters:
#
................................................................................
        cat 1>&2 <<STDERR
usage: ${0##*/} -h This screen                             \\
                -d (Default:\$HOME/SHELL) Target directory  \\
                -b (Default:\$HOME/Backup/shell) Location   \\
                   of backup files
                -n Do _not_ link files                     \\
                -g Set up/remove GoLang Development        \\
                -l Set up PLSense                          \\
		-p Set up Python Development               \\
                -u Uninstall ShellPAK                      \\
                -r perform a trial run with no changes made
                   (implies -n)

STDERR

................................................................................
} # usage()


# --------------------------------------------------------------------

headerDisplay

args=$(getopt d:b:hlnrpgu $*)

set -- $args

while [ $# -gt 0 ]
do

        case "$1" in
................................................................................
	-g)
		GOINSTALL=1
		;;

	-p)
		PYINSTALL=1
		;;

	-l)
		PLINSTALL=1
		;;

        -u)
                UNINSTALL=1
                inform $L1 $TRUE 'UNINSTALL invoked'
                ;;

        --)
................................................................................
        inform $L1 $TRUE 'Synchronization not necessary'
fi

# Do we want to set up our environment for golang development?
if [ ${GOINSTALL} -ne 0 ]; then
	goSetup
fi

# Do we want to set up our environment for perl development?
if [ ${PLINSTALL} -ne 0 ]; then
	plSetup
fi

# Do we want to set up our environment for python development?
if [ ${PYINSTALL} -ne 0 ]; then
	pySetup
fi

# Set up appropriate symlinks
................................................................................
                        inform $L2 $FALSE "Linking ${DOTFILE}"
                        ln -s ${SHELLDIR}/${file} ${DOTFILE}
                        echo -e "${GREEN}done${NORMAL}"
                fi

        done

	linkTmuxConf
fi

# Create ~/tmp directory if it doesn't exist
if [[ ${NOLINK} -ne 1 && ! -d ${HOMETMPDIR} ]]; then
        inform $L1 $FALSE "Creating ${HOMETMPDIR}"
        mkdir ${HOMETMPDIR}
        echo -e "${GREEN}done${NORMAL}"

Changes to thirdparty/git-completion.bash.

24
25
26
27
28
29
30


31
32
33
34
35
36
37
..
87
88
89
90
91
92
93
































































94
95
96
97
98
99
100
...
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
...
298
299
300
301
302
303
304


















305
306
307
308
309
310
311
...
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
...
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
...
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
...
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
...
722
723
724
725
726
727
728

729
730
731
732
733
734
735
...
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
...
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
....
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
....
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
....
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
....
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283

1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
....
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
....
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
....
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459

1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
....
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
....
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681







1682
1683
1684
1685
1686
1687
1688
....
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894

1895
1896
1897
1898
1899

1900
1901
1902
1903
1904
1905
1906
....
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
....
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988














1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017

2018
2019
2020
2021
2022
2023
2024
....
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
....
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
....
2164
2165
2166
2167
2168
2169
2170







2171
2172
2173








2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
....
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
....
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
....
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335







2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
....
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751


2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
....
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849



2850
2851
2852
2853





2854
2855
2856
2857
2858
2859
2860
....
2868
2869
2870
2871
2872
2873
2874



2875
2876
2877
2878
2879
2880
2881
....
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
....
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102



3103
3104
3105
3106
3107
3108
3109














































3110
3111
3112
3113
3114
3115
3116
....
3157
3158
3159
3160
3161
3162
3163
3164
3165






3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
....
3198
3199
3200
3201
3202
3203
3204
3205



3206
3207
3208
3209
3210
3211
3212
....
3246
3247
3248
3249
3250
3251
3252









3253
3254
3255
3256
3257
3258
3259
#       see git-prompt.sh for details.
#
# If you use complex aliases of form '!f() { ... }; f', you can use the null
# command ':' as the first command in the function body to declare the desired
# completion style.  For example '!f() { : git commit ; ... }; f' will
# tell the completion to use commit completion.  This also works with aliases
# of form "!sh -c '...'".  For example, "!sh -c ': git commit ; ... '".


#
# You can set the following environment variables to influence the behavior of
# the completion routines:
#
#   GIT_COMPLETION_CHECKOUT_NO_GUESS
#
#     When set to "1", do not include "DWIM" suggestions in git-checkout
................................................................................
# Runs git with all the options given as argument, respecting any
# '--git-dir=<path>' and '-C <path>' options present on the command line
__git ()
{
	git ${__git_C_args:+"${__git_C_args[@]}"} \
		${__git_dir:+--git-dir="$__git_dir"} "$@" 2>/dev/null
}

































































# The following function is based on code from:
#
#   bash_completion - programmable completion functions for bash 3.2+
#
#   Copyright © 2006-2008, Ian Macdonald <ian@caliban.org>
#             © 2009-2010, Bash Completion Maintainers
................................................................................
__gitcomp ()
{
	local cur_="${3-$cur}"

	case "$cur_" in
	--*=)
		;;
















	*)
		local c i=0 IFS=$' \t\n'
		for c in $1; do







			c="$c${4-}"
			if [[ $c == "$cur_"* ]]; then
				case $c in
				--*=*|*.) ;;
				*) c="$c " ;;
				esac
				COMPREPLY[i++]="${2-}$c"
			fi
		done
		;;
	esac
}










































# Variation of __gitcomp_nl () that appends to the existing list of
# completion candidates, COMPREPLY.
__gitcomp_nl_append ()
{
	local IFS=$'\n'
	__gitcompappend "$1" "${2-}" "${3-$cur}" "${4- }"
................................................................................
#    the default space (optional).  If specified but empty, nothing is
#    appended.
__gitcomp_nl ()
{
	COMPREPLY=()
	__gitcomp_nl_append "$@"
}



















# Generates completion reply with compgen from newline-separated possible
# completion filenames.
# It accepts 1 to 3 arguments:
# 1: List of possible completion filenames, separated by a single newline.
# 2: A directory prefix to be added to each possible completion filename
#    (optional).
................................................................................
	# since tilde expansion is not applied.
	# This means that COMPREPLY will be empty and Bash default
	# completion will be used.
	__gitcompadd "$1" "${2-}" "${3-$cur}" ""

	# use a hack to enable file mode in bash < 4
	compopt -o filenames +o nospace 2>/dev/null ||
	compgen -f /non-existing-dir/ > /dev/null

}

# Execute 'git ls-files', unless the --committable option is specified, in
# which case it runs 'git diff-index' to find out the files that can be
# committed.  It return paths relative to the directory specified in the first
# argument, and using the options specified in the second argument.
__git_ls_files_helper ()
{
	if [ "$2" == "--committable" ]; then

		__git -C "$1" diff-index --name-only --relative HEAD
	else
		# NOTE: $2 is not quoted in order to support multiple options

		__git -C "$1" ls-files --exclude-standard $2
	fi
}


# __git_index_files accepts 1 or 2 arguments:
# 1: Options to pass to ls-files (required).
# 2: A directory path (optional).
#    If provided, only files within the specified directory are listed.
#    Sub directories are never recursed.  Path must have a trailing
#    slash.

__git_index_files ()
{
	local root="${2-.}" file

	__git_ls_files_helper "$root" "$1" |
	while read -r file; do

















































































		case "$file" in
		?*/*) echo "${file%%/*}" ;;
		*) echo "$file" ;;






		esac
	done | sort | uniq


}

# Lists branches from the local repository.
# 1: A prefix to be added to each listed branch (optional).
# 2: List only branches matching this word (optional; list all branches if
#    unset or empty).
# 3: A suffix to be appended to each listed branch (optional).
................................................................................
		case "$cur_" in
		refs|refs/*)
			format="refname"
			refs=("$match*" "$match*/**")
			track=""
			;;
		*)
			for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do
				case "$i" in
				$match*)
					if [ -e "$dir/$i" ]; then
						echo "$pfx$i$sfx"
					fi
					;;
				esac
................................................................................
		fi
	done
	return 1
}

__git_list_merge_strategies ()
{
	git merge -s help 2>&1 |
	sed -n -e '/[Aa]vailable strategies are: /,/^$/{
		s/\.$//
		s/.*://
		s/^[ 	]*//
		s/[ 	]*$//
		p
	}'
................................................................................
		;;
	*)
		__git_complete_refs
		;;
	esac
}


# __git_complete_index_file requires 1 argument:
# 1: the options to pass to ls-file
#
# The exception is --committable, which finds the files appropriate commit.
__git_complete_index_file ()
{
	local pfx="" cur_="$cur"

	case "$cur_" in
	?*/*)
		pfx="${cur_%/*}"
		cur_="${cur_##*/}"
		pfx="${pfx}/"
		;;
	esac

	__gitcomp_file "$(__git_index_files "$1" ${pfx:+"$pfx"})" "$pfx" "$cur_"
}

__git_complete_file ()
{
	__git_complete_revlist_file
}

__git_complete_revlist ()
{
................................................................................
			push) no_complete_refspec=1 ;;
			fetch)
				return
				;;
			*) ;;
			esac
			;;

		-*) ;;
		*) remote="$i"; break ;;
		esac
		((c++))
	done
	if [ -z "$remote" ]; then
		__gitcomp_nl "$(__git_remotes)"
................................................................................
		__gitcomp "$__git_merge_strategies" "" "${cur##--strategy=}"
		return 0
		;;
	esac
	return 1
}

__git_commands () {
	if test -n "${GIT_TESTING_COMMAND_COMPLETION:-}"
	then
		printf "%s" "${GIT_TESTING_COMMAND_COMPLETION}"
	else
		git help -a|egrep '^  [a-zA-Z0-9]'
	fi
}

__git_list_all_commands ()
{
	local i IFS=" "$'\n'
	for i in $(__git_commands)
	do
		case $i in
		*--*)             : helper pattern;;
		*) echo $i;;
		esac
	done
}

__git_all_commands=
__git_compute_all_commands ()
{
	test -n "$__git_all_commands" ||
	__git_all_commands=$(__git_list_all_commands)
}

__git_list_porcelain_commands ()
{
	local i IFS=" "$'\n'
	__git_compute_all_commands
	for i in $__git_all_commands
	do
		case $i in
		*--*)             : helper pattern;;
		applymbox)        : ask gittus;;
		applypatch)       : ask gittus;;
		archimport)       : import;;
		cat-file)         : plumbing;;
		check-attr)       : plumbing;;
		check-ignore)     : plumbing;;
		check-mailmap)    : plumbing;;
		check-ref-format) : plumbing;;
		checkout-index)   : plumbing;;
		column)           : internal helper;;
		commit-tree)      : plumbing;;
		count-objects)    : infrequent;;
		credential)       : credentials;;
		credential-*)     : credentials helper;;
		cvsexportcommit)  : export;;
		cvsimport)        : import;;
		cvsserver)        : daemon;;
		daemon)           : daemon;;
		diff-files)       : plumbing;;
		diff-index)       : plumbing;;
		diff-tree)        : plumbing;;
		fast-import)      : import;;
		fast-export)      : export;;
		fsck-objects)     : plumbing;;
		fetch-pack)       : plumbing;;
		fmt-merge-msg)    : plumbing;;
		for-each-ref)     : plumbing;;
		hash-object)      : plumbing;;
		http-*)           : transport;;
		index-pack)       : plumbing;;
		init-db)          : deprecated;;
		local-fetch)      : plumbing;;
		ls-files)         : plumbing;;
		ls-remote)        : plumbing;;
		ls-tree)          : plumbing;;
		mailinfo)         : plumbing;;
		mailsplit)        : plumbing;;
		merge-*)          : plumbing;;
		mktree)           : plumbing;;
		mktag)            : plumbing;;
		pack-objects)     : plumbing;;
		pack-redundant)   : plumbing;;
		pack-refs)        : plumbing;;
		parse-remote)     : plumbing;;
		patch-id)         : plumbing;;
		prune)            : plumbing;;
		prune-packed)     : plumbing;;
		quiltimport)      : import;;
		read-tree)        : plumbing;;
		receive-pack)     : plumbing;;
		remote-*)         : transport;;
		rerere)           : plumbing;;
		rev-list)         : plumbing;;
		rev-parse)        : plumbing;;
		runstatus)        : plumbing;;
		sh-setup)         : internal;;
		shell)            : daemon;;
		show-ref)         : plumbing;;
		send-pack)        : plumbing;;
		show-index)       : plumbing;;
		ssh-*)            : transport;;
		stripspace)       : plumbing;;
		symbolic-ref)     : plumbing;;
		unpack-file)      : plumbing;;
		unpack-objects)   : plumbing;;
		update-index)     : plumbing;;
		update-ref)       : plumbing;;
		update-server-info) : daemon;;
		upload-archive)   : plumbing;;
		upload-pack)      : plumbing;;
		write-tree)       : plumbing;;
		var)              : infrequent;;
		verify-pack)      : infrequent;;
		verify-tag)       : plumbing;;
		*) echo $i;;
		esac
	done
}

__git_porcelain_commands=
__git_compute_porcelain_commands ()
{
	test -n "$__git_porcelain_commands" ||
	__git_porcelain_commands=$(__git_list_porcelain_commands)
}

# Lists all set config variables starting with the given section prefix,
# with the prefix removed.
__git_get_config_variables ()
{
	local section="$1" i IFS=$'\n'
................................................................................
}

__git_pretty_aliases ()
{
	__git_get_config_variables "pretty"
}

__git_aliases ()
{
	__git_get_config_variables "alias"
}

# __git_aliased_command requires 1 argument
__git_aliased_command ()
{
	local word cmdline=$(__git config --get "alias.$1")
	for word in $cmdline; do
		case "$word" in
		\!gitk|gitk)
................................................................................
		esac
	done

	printf "%d" $c
}

__git_whitespacelist="nowarn warn error error-all fix"


_git_am ()
{
	__git_find_repo_path
	if [ -d "$__git_repo_path"/rebase-apply ]; then
		__gitcomp "--skip --continue --resolved --abort"
		return
	fi
	case "$cur" in
	--whitespace=*)
		__gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
		return
		;;
	--*)
		__gitcomp "
			--3way --committer-date-is-author-date --ignore-date
			--ignore-whitespace --ignore-space-change
			--interactive --keep --no-utf8 --signoff --utf8
			--whitespace= --scissors
			"
		return
	esac
}

_git_apply ()
{
	case "$cur" in
	--whitespace=*)
		__gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
		return
		;;
	--*)
		__gitcomp "
			--stat --numstat --summary --check --index
			--cached --index-info --reverse --reject --unidiff-zero
			--apply --no-add --exclude=
			--ignore-whitespace --ignore-space-change
			--whitespace= --inaccurate-eof --verbose
			--recount --directory=
			"
		return
	esac
}

_git_add ()
{
	case "$cur" in
	--*)
		__gitcomp "
			--interactive --refresh --patch --update --dry-run
			--ignore-errors --intent-to-add --force --edit --chmod=
			"
		return
	esac

	local complete_opt="--others --modified --directory --no-empty-directory"
	if test -n "$(__git_find_on_cmdline "-u --update")"
	then
		complete_opt="--modified"
................................................................................
	done

	case "$cur" in
	--set-upstream-to=*)
		__git_complete_refs --cur="${cur##--set-upstream-to=}"
		;;
	--*)
		__gitcomp "
			--color --no-color --verbose --abbrev= --no-abbrev
			--track --no-track --contains --no-contains --merged --no-merged
			--set-upstream-to= --edit-description --list
			--unset-upstream --delete --move --remotes
			--column --no-column --sort= --points-at
			"
		;;
	*)
		if [ $only_local_ref = "y" -a $has_r = "n" ]; then
			__gitcomp_direct "$(__git_heads "" "$cur" " ")"
		else
			__git_complete_refs
		fi
................................................................................
	__git_has_doubledash && return

	case "$cur" in
	--conflict=*)
		__gitcomp "diff3 merge" "" "${cur##--conflict=}"
		;;
	--*)
		__gitcomp "
			--quiet --ours --theirs --track --no-track --merge
			--conflict= --orphan --patch --detach --ignore-skip-worktree-bits
			--recurse-submodules --no-recurse-submodules
			"
		;;
	*)
		# check if --track, --no-track, or --no-guess was specified
		# if so, disable DWIM mode
		local flags="--track --no-track --no-guess" track_opt="--track"
		if [ "$GIT_COMPLETION_CHECKOUT_NO_GUESS" = "1" ] ||
		   [ -n "$(__git_find_on_cmdline "$flags")" ]; then
................................................................................
			track_opt=''
		fi
		__git_complete_refs $track_opt
		;;
	esac
}

_git_cherry ()
{
	__git_complete_refs
}

_git_cherry_pick ()
{
	__git_find_repo_path
	if [ -f "$__git_repo_path"/CHERRY_PICK_HEAD ]; then
		__gitcomp "--continue --quit --abort"
		return
	fi
	case "$cur" in
	--*)
		__gitcomp "--edit --no-commit --signoff --strategy= --mainline"

		;;
	*)
		__git_complete_refs
		;;
	esac
}

_git_clean ()
{
	case "$cur" in
	--*)
		__gitcomp "--dry-run --quiet"
		return
		;;
	esac

	# XXX should we check for -x option ?
	__git_complete_index_file "--others --directory"
}

_git_clone ()
{
	case "$cur" in
	--*)
		__gitcomp "
			--local
			--no-hardlinks
			--shared
			--reference
			--quiet
			--no-checkout
			--bare
			--mirror
			--origin
			--upload-pack
			--template=
			--depth
			--single-branch
			--no-tags
			--branch
			--recurse-submodules
			--no-single-branch
			--shallow-submodules
			"
		return
		;;
	esac
}

__git_untracked_file_modes="all no normal"

................................................................................
		return
		;;
	--untracked-files=*)
		__gitcomp "$__git_untracked_file_modes" "" "${cur##--untracked-files=}"
		return
		;;
	--*)
		__gitcomp "
			--all --author= --signoff --verify --no-verify
			--edit --no-edit
			--amend --include --only --interactive
			--dry-run --reuse-message= --reedit-message=
			--reset-author --file= --message= --template=
			--cleanup= --untracked-files --untracked-files=
			--verbose --quiet --fixup= --squash=
			--patch --short --date --allow-empty
			"
		return
	esac

	if __git rev-parse --verify --quiet HEAD >/dev/null; then
		__git_complete_index_file "--committable"
	else
		# This is the first commit
................................................................................
	fi
}

_git_describe ()
{
	case "$cur" in
	--*)
		__gitcomp "
			--all --tags --contains --abbrev= --candidates=
			--exact-match --debug --long --match --always --first-parent
			--exclude --dirty --broken
			"
		return
	esac
	__git_complete_refs
}

__git_diff_algorithms="myers minimal patience histogram"

__git_diff_submodule_formats="diff log short"

__git_diff_common_options="--stat --numstat --shortstat --summary
			--patch-with-stat --name-only --name-status --color
			--no-color --color-words --no-renames --check
			--full-index --binary --abbrev --diff-filter=
			--find-copies-harder
			--text --ignore-space-at-eol --ignore-space-change
			--ignore-all-space --ignore-blank-lines --exit-code
			--quiet --ext-diff --no-ext-diff
			--no-prefix --src-prefix= --dst-prefix=
			--inter-hunk-context=
			--patience --histogram --minimal
			--raw --word-diff --word-diff-regex=
			--dirstat --dirstat= --dirstat-by-file
			--dirstat-by-file= --cumulative
			--diff-algorithm=
			--submodule --submodule=
"

_git_diff ()
{
	__git_has_doubledash && return

	case "$cur" in
................................................................................

	case "$cur" in
	--tool=*)
		__gitcomp "$__git_mergetools_common kompare" "" "${cur##--tool=}"
		return
		;;
	--*)
		__gitcomp "--cached --staged --pickaxe-all --pickaxe-regex
			--base --ours --theirs
			--no-renames --diff-filter= --find-copies-harder
			--relative --ignore-submodules
			--tool="

		return
		;;
	esac
	__git_complete_revlist_file
}

__git_fetch_recurse_submodules="yes on-demand no"

__git_fetch_options="
	--quiet --verbose --append --upload-pack --force --keep --depth=
	--tags --no-tags --all --prune --dry-run --recurse-submodules=
	--unshallow --update-shallow
"

_git_fetch ()
{
	case "$cur" in
	--recurse-submodules=*)
		__gitcomp "$__git_fetch_recurse_submodules" "" "${cur##--recurse-submodules=}"
		return
		;;
	--*)
		__gitcomp "$__git_fetch_options"
		return
		;;
	esac
	__git_complete_remote_or_refspec
}

__git_format_patch_options="
	--stdout --attach --no-attach --thread --thread= --no-thread
	--numbered --start-number --numbered-files --keep-subject --signoff
	--signature --no-signature --in-reply-to= --cc= --full-index --binary
	--not --all --cover-letter --no-prefix --src-prefix= --dst-prefix=
	--inline --suffix= --ignore-if-in-upstream --subject-prefix=
	--output-directory --reroll-count --to= --quiet --notes
"

_git_format_patch ()
{
	case "$cur" in
	--thread=*)
		__gitcomp "
			deep shallow
			" "" "${cur##--thread=}"
		return
		;;
	--*)
		__gitcomp "$__git_format_patch_options"
		return
		;;
	esac
	__git_complete_revlist
}

_git_fsck ()
{
	case "$cur" in
	--*)
		__gitcomp "
			--tags --root --unreachable --cache --no-reflogs --full
			--strict --verbose --lost-found --name-objects
			"
		return
		;;
	esac
}

_git_gc ()
{
	case "$cur" in
	--*)
		__gitcomp "--prune --aggressive"
		return
		;;
	esac
}

_git_gitk ()
{
................................................................................

_git_grep ()
{
	__git_has_doubledash && return

	case "$cur" in
	--*)
		__gitcomp "
			--cached
			--text --ignore-case --word-regexp --invert-match
			--full-name --line-number
			--extended-regexp --basic-regexp --fixed-strings
			--perl-regexp
			--threads
			--files-with-matches --name-only
			--files-without-match
			--max-depth
			--count
			--and --or --not --all-match
			--break --heading --show-function --function-context
			--untracked --no-index
			"
		return
		;;
	esac

	case "$cword,$prev" in
	2,*|*,-*)
		__git_complete_symbol && return
................................................................................
	__git_complete_refs
}

_git_help ()
{
	case "$cur" in
	--*)
		__gitcomp "--all --guides --info --man --web"
		return
		;;
	esac
	__git_compute_all_commands
	__gitcomp "$__git_all_commands $(__git_aliases)
		attributes cli core-tutorial cvs-migration
		diffcore everyday gitk glossary hooks ignore modules
		namespaces repository-layout revisions tutorial tutorial-2
		workflows
		"
}

_git_init ()
{
	case "$cur" in
	--shared=*)
		__gitcomp "
			false true umask group all world everybody
			" "" "${cur##--shared=}"
		return
		;;
	--*)
		__gitcomp "--quiet --bare --template= --shared --shared="
		return
		;;
	esac
}

_git_ls_files ()
{
	case "$cur" in
	--*)
		__gitcomp "--cached --deleted --modified --others --ignored
			--stage --directory --no-empty-directory --unmerged
			--killed --exclude= --exclude-from=
			--exclude-per-directory= --exclude-standard
			--error-unmatch --with-tree= --full-name
			--abbrev --ignored --exclude-per-directory
			"
		return
		;;
	esac

	# XXX ignore options like --modified and always suggest all cached
	# files.
	__git_complete_index_file "--cached"
}

_git_ls_remote ()
{
	case "$cur" in
	--*)
		__gitcomp "--heads --tags --refs --get-url --symref"
		return
		;;
	esac
	__gitcomp_nl "$(__git_remotes)"
}

_git_ls_tree ()
{







	__git_complete_file
}

# Options that go well for log, shortlog and gitk
__git_log_common_options="
	--not --all
	--branches --tags --remotes
................................................................................
		__git_complete_symbol --pfx="-S" --cur="${cur#-S}"
		return
		;;
	esac
	__git_complete_revlist
}

# Common merge options shared by git-merge(1) and git-pull(1).
__git_merge_options="
	--no-commit --no-stat --log --no-log --squash --strategy
	--commit --stat --no-squash --ff --no-ff --ff-only --edit --no-edit
	--verify-signatures --no-verify-signatures --gpg-sign
	--quiet --verbose --progress --no-progress
"

_git_merge ()
{
	__git_complete_strategy && return

	case "$cur" in
	--*)
		__gitcomp "$__git_merge_options
			--rerere-autoupdate --no-rerere-autoupdate --abort --continue"
		return
	esac
	__git_complete_refs
}

_git_mergetool ()
{
	case "$cur" in
	--tool=*)
		__gitcomp "$__git_mergetools_common tortoisemerge" "" "${cur##--tool=}"
		return
		;;
	--*)
		__gitcomp "--tool= --prompt --no-prompt"
		return
		;;
	esac
}

_git_merge_base ()
{
	case "$cur" in
	--*)
		__gitcomp "--octopus --independent --is-ancestor --fork-point"
		return
		;;
	esac
	__git_complete_refs
}

_git_mv ()
{
	case "$cur" in
	--*)
		__gitcomp "--dry-run"
		return
		;;
	esac

	if [ $(__git_count_arguments "mv") -gt 0 ]; then
		# We need to show both cached and untracked files (including
		# empty directories) since this may not be the last argument.
		__git_complete_index_file "--cached --others --directory"
	else
		__git_complete_index_file "--cached"
	fi
}

_git_name_rev ()
{
	__gitcomp "--tags --all --stdin"
}

_git_notes ()
{
	local subcommands='add append copy edit list prune remove show'
	local subcommand="$(__git_find_on_cmdline "$subcommands")"

	case "$subcommand,$cur" in
	,--*)
		__gitcomp '--ref'
		;;
	,*)
		case "$prev" in
		--ref)
			__git_complete_refs
			;;
		*)
			__gitcomp "$subcommands --ref"
			;;
		esac
		;;
	add,--reuse-message=*|append,--reuse-message=*|\
	add,--reedit-message=*|append,--reedit-message=*)
		__git_complete_refs --cur="${cur#*=}"
		;;
	add,--*|append,--*)
		__gitcomp '--file= --message= --reedit-message=
				--reuse-message='
		;;
	copy,--*)
		__gitcomp '--stdin'

		;;
	prune,--*)
		__gitcomp '--dry-run --verbose'
		;;
	prune,*)

		;;
	*)
		case "$prev" in
		-m|-F)
			;;
		*)
			__git_complete_refs
................................................................................

	case "$cur" in
	--recurse-submodules=*)
		__gitcomp "$__git_fetch_recurse_submodules" "" "${cur##--recurse-submodules=}"
		return
		;;
	--*)
		__gitcomp "
			--rebase --no-rebase
			$__git_merge_options
			$__git_fetch_options
		"
		return
		;;
	esac
	__git_complete_remote_or_refspec
}

__git_push_recurse_submodules="check on-demand only"
................................................................................
		return
		;;
	--force-with-lease=*)
		__git_complete_force_with_lease "${cur##--force-with-lease=}"
		return
		;;
	--*)
		__gitcomp "
			--all --mirror --tags --dry-run --force --verbose
			--quiet --prune --delete --follow-tags
			--receive-pack= --repo= --set-upstream
			--force-with-lease --force-with-lease= --recurse-submodules=
		"
		return
		;;
	esac
	__git_complete_remote_or_refspec
}















_git_rebase ()
{
	__git_find_repo_path
	if [ -f "$__git_repo_path"/rebase-merge/interactive ]; then
		__gitcomp "--continue --skip --abort --quit --edit-todo"
		return
	elif [ -d "$__git_repo_path"/rebase-apply ] || \
	     [ -d "$__git_repo_path"/rebase-merge ]; then
		__gitcomp "--continue --skip --abort --quit"
		return
	fi
	__git_complete_strategy && return
	case "$cur" in
	--whitespace=*)
		__gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
		return
		;;
	--*)
		__gitcomp "
			--onto --merge --strategy --interactive
			--preserve-merges --stat --no-stat
			--committer-date-is-author-date --ignore-date
			--ignore-whitespace --whitespace=
			--autosquash --no-autosquash
			--fork-point --no-fork-point
			--autostash --no-autostash
			--verify --no-verify
			--keep-empty --root --force-rebase --no-ff

			--exec
			"

		return
	esac
	__git_complete_refs
}
................................................................................
		return
		;;
	--to=*|--cc=*|--bcc=*|--from=*)
		__gitcomp "$(__git send-email --dump-aliases)" "" "${cur#--*=}"
		return
		;;
	--*)
		__gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to
			--compose --confirm= --dry-run --envelope-sender
			--from --identity
			--in-reply-to --no-chain-reply-to --no-signed-off-by-cc
			--no-suppress-from --no-thread --quiet
			--signed-off-by-cc --smtp-pass --smtp-server
			--smtp-server-port --smtp-encryption= --smtp-user
			--subject --suppress-cc= --suppress-from --thread --to
			--validate --no-validate
			$__git_format_patch_options"
		return
		;;
	esac
	__git_complete_revlist
}

_git_stage ()
................................................................................
	--column=*)
		__gitcomp "
			always never auto column row plain dense nodense
			" "" "${cur##--column=}"
		return
		;;
	--*)
		__gitcomp "
			--short --branch --porcelain --long --verbose
			--untracked-files= --ignore-submodules= --ignored
			--column= --no-column
			"
		return
		;;
	esac

	untracked_state="$(__git_get_option_value "-u" "--untracked-files=" \
		"$__git_untracked_file_modes" "status.showUntrackedFiles")"

................................................................................
		esac
		prevword=$word
		c=$((--c))
	done

	__git config $config_file --name-only --list
}








_git_config ()
{








	case "$prev" in
	branch.*.remote|branch.*.pushremote)
		__gitcomp_nl "$(__git_remotes)"
		return
		;;
	branch.*.merge)
		__git_complete_refs
		return
		;;
	branch.*.rebase)
		__gitcomp "false true preserve interactive"
		return
		;;
	remote.pushdefault)
		__gitcomp_nl "$(__git_remotes)"
		return
		;;
	remote.*.fetch)
................................................................................
		__gitcomp "man info web html"
		return
		;;
	log.date)
		__gitcomp "$__git_log_date_formats"
		return
		;;
	sendemail.aliasesfiletype)
		__gitcomp "mutt mailrc pine elm gnus"
		return
		;;
	sendemail.confirm)
		__gitcomp "$__git_send_email_confirm_options"
		return
		;;
................................................................................
		;;
	*.*)
		return
		;;
	esac
	case "$cur" in
	--*)
		__gitcomp "
			--system --global --local --file=
			--list --replace-all
			--get --get-all --get-regexp
			--add --unset --unset-all
			--remove-section --rename-section
			--name-only
			"
		return
		;;
	branch.*.*)
		local pfx="${cur%.*}." cur_="${cur##*.}"
		__gitcomp "remote pushremote merge mergeoptions rebase" "$pfx" "$cur_"
		return
		;;
	branch.*)
		local pfx="${cur%.*}." cur_="${cur#*.}"
		__gitcomp_direct "$(__git_heads "$pfx" "$cur_" ".")"
		__gitcomp_nl_append $'autosetupmerge\nautosetuprebase\n' "$pfx" "$cur_"
		return
		;;
	guitool.*.*)
		local pfx="${cur%.*}." cur_="${cur##*.}"
		__gitcomp "
			argprompt cmd confirm needsfile noconsole norescan
			prompt revprompt revunmerged title
			" "$pfx" "$cur_"
		return
		;;
	difftool.*.*)
		local pfx="${cur%.*}." cur_="${cur##*.}"
		__gitcomp "cmd path" "$pfx" "$cur_"
		return
................................................................................
		__gitcomp_nl "$__git_all_commands" "$pfx" "$cur_"
		return
		;;
	remote.*.*)
		local pfx="${cur%.*}." cur_="${cur##*.}"
		__gitcomp "
			url proxy fetch push mirror skipDefaultUpdate
			receivepack uploadpack tagopt pushurl
			" "$pfx" "$cur_"
		return
		;;
	remote.*)
		local pfx="${cur%.*}." cur_="${cur#*.}"
		__gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "."
		__gitcomp_nl_append "pushdefault" "$pfx" "$cur_"
		return
		;;
	url.*.*)
		local pfx="${cur%.*}." cur_="${cur##*.}"
		__gitcomp "insteadOf pushInsteadOf" "$pfx" "$cur_"
		return
		;;







	esac
	__gitcomp "
		add.ignoreErrors
		advice.amWorkDir
		advice.commitBeforeMerge
		advice.detachedHead
		advice.implicitIdentity
		advice.pushAlreadyExists
		advice.pushFetchFirst
		advice.pushNeedsForce
		advice.pushNonFFCurrent
		advice.pushNonFFMatching
		advice.pushUpdateRejected
		advice.resolveConflict
		advice.rmHints
		advice.statusHints
		advice.statusUoption
		alias.
		am.keepcr
		am.threeWay
		apply.ignorewhitespace
		apply.whitespace
		branch.autosetupmerge
		branch.autosetuprebase
		browser.
		clean.requireForce
		color.branch
		color.branch.current
		color.branch.local
		color.branch.plain
		color.branch.remote
		color.decorate.HEAD
		color.decorate.branch
		color.decorate.remoteBranch
		color.decorate.stash
		color.decorate.tag
		color.diff
		color.diff.commit
		color.diff.frag
		color.diff.func
		color.diff.meta
		color.diff.new
		color.diff.old
		color.diff.plain
		color.diff.whitespace
		color.grep
		color.grep.context
		color.grep.filename
		color.grep.function
		color.grep.linenumber
		color.grep.match
		color.grep.selected
		color.grep.separator
		color.interactive
		color.interactive.error
		color.interactive.header
		color.interactive.help
		color.interactive.prompt
		color.pager
		color.showbranch
		color.status
		color.status.added
		color.status.changed
		color.status.header
		color.status.localBranch
		color.status.nobranch
		color.status.remoteBranch
		color.status.unmerged
		color.status.untracked
		color.status.updated
		color.ui
		commit.cleanup
		commit.gpgSign
		commit.status
		commit.template
		commit.verbose
		core.abbrev
		core.askpass
		core.attributesfile
		core.autocrlf
		core.bare
		core.bigFileThreshold
		core.checkStat
		core.commentChar
		core.compression
		core.createObject
		core.deltaBaseCacheLimit
		core.editor
		core.eol
		core.excludesfile
		core.fileMode
		core.fsyncobjectfiles
		core.gitProxy
		core.hideDotFiles
		core.hooksPath
		core.ignoreStat
		core.ignorecase
		core.logAllRefUpdates
		core.loosecompression
		core.notesRef
		core.packedGitLimit
		core.packedGitWindowSize
		core.packedRefsTimeout
		core.pager
		core.precomposeUnicode
		core.preferSymlinkRefs
		core.preloadindex
		core.protectHFS
		core.protectNTFS
		core.quotepath
		core.repositoryFormatVersion
		core.safecrlf
		core.sharedRepository
		core.sparseCheckout
		core.splitIndex
		core.sshCommand
		core.symlinks
		core.trustctime
		core.untrackedCache
		core.warnAmbiguousRefs
		core.whitespace
		core.worktree
		credential.helper
		credential.useHttpPath
		credential.username
		credentialCache.ignoreSIGHUP
		diff.autorefreshindex
		diff.external
		diff.ignoreSubmodules
		diff.mnemonicprefix
		diff.noprefix
		diff.renameLimit
		diff.renames
		diff.statGraphWidth
		diff.submodule
		diff.suppressBlankEmpty
		diff.tool
		diff.wordRegex
		diff.algorithm
		difftool.
		difftool.prompt
		fetch.recurseSubmodules
		fetch.unpackLimit
		format.attach
		format.cc
		format.coverLetter
		format.from
		format.headers
		format.numbered
		format.pretty
		format.signature
		format.signoff
		format.subjectprefix
		format.suffix
		format.thread
		format.to
		gc.
		gc.aggressiveDepth
		gc.aggressiveWindow
		gc.auto
		gc.autoDetach
		gc.autopacklimit
		gc.logExpiry
		gc.packrefs
		gc.pruneexpire
		gc.reflogexpire
		gc.reflogexpireunreachable
		gc.rerereresolved
		gc.rerereunresolved
		gc.worktreePruneExpire
		gitcvs.allbinary
		gitcvs.commitmsgannotation
		gitcvs.dbTableNamePrefix
		gitcvs.dbdriver
		gitcvs.dbname
		gitcvs.dbpass
		gitcvs.dbuser
		gitcvs.enabled
		gitcvs.logfile
		gitcvs.usecrlfattr
		guitool.
		gui.blamehistoryctx
		gui.commitmsgwidth
		gui.copyblamethreshold
		gui.diffcontext
		gui.encoding
		gui.fastcopyblame
		gui.matchtrackingbranch
		gui.newbranchtemplate
		gui.pruneduringfetch
		gui.spellingdictionary
		gui.trustmtime
		help.autocorrect
		help.browser
		help.format
		http.lowSpeedLimit
		http.lowSpeedTime
		http.maxRequests
		http.minSessions
		http.noEPSV
		http.postBuffer
		http.proxy
		http.sslCipherList
		http.sslVersion
		http.sslCAInfo
		http.sslCAPath
		http.sslCert
		http.sslCertPasswordProtected
		http.sslKey
		http.sslVerify
		http.useragent
		i18n.commitEncoding
		i18n.logOutputEncoding
		imap.authMethod
		imap.folder
		imap.host
		imap.pass
		imap.port
		imap.preformattedHTML
		imap.sslverify
		imap.tunnel
		imap.user
		init.templatedir
		instaweb.browser
		instaweb.httpd
		instaweb.local
		instaweb.modulepath
		instaweb.port
		interactive.singlekey
		log.date
		log.decorate
		log.showroot
		mailmap.file
		man.
		man.viewer
		merge.
		merge.conflictstyle
		merge.log
		merge.renameLimit
		merge.renormalize
		merge.stat
		merge.tool
		merge.verbosity
		mergetool.
		mergetool.keepBackup
		mergetool.keepTemporaries
		mergetool.prompt
		notes.displayRef
		notes.rewrite.
		notes.rewrite.amend
		notes.rewrite.rebase
		notes.rewriteMode
		notes.rewriteRef
		pack.compression
		pack.deltaCacheLimit
		pack.deltaCacheSize
		pack.depth
		pack.indexVersion
		pack.packSizeLimit
		pack.threads
		pack.window
		pack.windowMemory
		pager.
		pretty.
		pull.octopus
		pull.twohead
		push.default
		push.followTags
		rebase.autosquash
		rebase.stat
		receive.autogc
		receive.denyCurrentBranch
		receive.denyDeleteCurrent
		receive.denyDeletes
		receive.denyNonFastForwards
		receive.fsckObjects
		receive.unpackLimit
		receive.updateserverinfo
		remote.pushdefault
		remotes.
		repack.usedeltabaseoffset
		rerere.autoupdate
		rerere.enabled
		sendemail.
		sendemail.aliasesfile
		sendemail.aliasfiletype
		sendemail.bcc
		sendemail.cc
		sendemail.cccmd
		sendemail.chainreplyto
		sendemail.confirm
		sendemail.envelopesender
		sendemail.from
		sendemail.identity
		sendemail.multiedit
		sendemail.signedoffbycc
		sendemail.smtpdomain
		sendemail.smtpencryption
		sendemail.smtppass
		sendemail.smtpserver
		sendemail.smtpserveroption
		sendemail.smtpserverport
		sendemail.smtpuser
		sendemail.suppresscc
		sendemail.suppressfrom
		sendemail.thread
		sendemail.to
		sendemail.validate
		sendemail.smtpbatchsize
		sendemail.smtprelogindelay
		showbranch.default
		status.relativePaths
		status.showUntrackedFiles
		status.submodulesummary
		submodule.
		tar.umask
		transfer.unpackLimit
		url.
		user.email
		user.name
		user.signingkey
		web.browser
		branch. remote.
	"
}

_git_remote ()
{
	local subcommands="
		add rename remove set-head set-branches
		get-url set-url show prune update
		"
	local subcommand="$(__git_find_on_cmdline "$subcommands")"
	if [ -z "$subcommand" ]; then
		case "$cur" in
		--*)
			__gitcomp "--verbose"
			;;
		*)
			__gitcomp "$subcommands"
			;;
		esac
		return
	fi

	case "$subcommand,$cur" in
	add,--*)
		__gitcomp "--track --master --fetch --tags --no-tags --mirror="
		;;
	add,*)
		;;
	set-head,--*)
		__gitcomp "--auto --delete"
		;;
	set-branches,--*)
		__gitcomp "--add"
		;;
	set-head,*|set-branches,*)
		__git_complete_remote_or_refspec
		;;
	update,--*)
		__gitcomp "--prune"
		;;
	update,*)
		__gitcomp "$(__git_get_config_variables "remotes")"
		;;
	set-url,--*)
		__gitcomp "--push --add --delete"
		;;
	get-url,--*)
		__gitcomp "--push --all"
		;;
	prune,--*)
		__gitcomp "--dry-run"
		;;
	*)
		__gitcomp_nl "$(__git_remotes)"
		;;
	esac
}

_git_replace ()
{
	case "$cur" in
	--*)
		__gitcomp "--edit --graft --format= --list --delete"
		return
		;;
	esac
	__git_complete_refs
}

_git_rerere ()
................................................................................

_git_reset ()
{
	__git_has_doubledash && return

	case "$cur" in
	--*)
		__gitcomp "--merge --mixed --hard --soft --patch --keep"
		return
		;;
	esac
	__git_complete_refs
}



_git_revert ()
{
	__git_find_repo_path
	if [ -f "$__git_repo_path"/REVERT_HEAD ]; then
		__gitcomp "--continue --quit --abort"
		return
	fi
	case "$cur" in
	--*)
		__gitcomp "
			--edit --mainline --no-edit --no-commit --signoff
			--strategy= --strategy-option=
			"
		return
		;;
	esac
	__git_complete_refs
}

_git_rm ()
{
	case "$cur" in
	--*)
		__gitcomp "--cached --dry-run --ignore-unmatch --quiet"
		return
		;;
	esac

	__git_complete_index_file "--cached"
}

................................................................................
	__git_complete_revlist_file
}

_git_show_branch ()
{
	case "$cur" in
	--*)
		__gitcomp "
			--all --remotes --topo-order --date-order --current --more=
			--list --independent --merge-base --no-name
			--color --no-color
			--sha1-name --sparse --topics --reflog
			"
		return
		;;
	esac
	__git_complete_revlist
}

_git_stash ()
{
	local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'
	local subcommands='push save list show apply clear drop pop create branch'
	local subcommand="$(__git_find_on_cmdline "$subcommands")"



	if [ -z "$subcommand" ]; then
		case "$cur" in
		--*)
			__gitcomp "$save_opts"





			;;
		*)
			if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then
				__gitcomp "$subcommands"
			fi
			;;
		esac
................................................................................
			;;
		apply,--*|pop,--*)
			__gitcomp "--index --quiet"
			;;
		drop,--*)
			__gitcomp "--quiet"
			;;



		show,--*|branch,--*)
			;;
		branch,*)
			if [ $cword -eq 3 ]; then
				__git_complete_refs
			else
				__gitcomp_nl "$(__git stash list \
................................................................................

_git_tag ()
{
	local i c=1 f=0
	while [ $c -lt $cword ]; do
		i="${words[c]}"
		case "$i" in
		-d|-v)
			__gitcomp_direct "$(__git_tags "" "$cur" " ")"
			return
			;;
		-f)
			f=1
			;;
		esac
................................................................................
	*)
		__git_complete_refs
		;;
	esac

	case "$cur" in
	--*)
		__gitcomp "
			--list --delete --verify --annotate --message --file
			--sign --cleanup --local-user --force --column --sort=
			--contains --no-contains --points-at --merged --no-merged --create-reflog
			"
		;;
	esac
}

_git_whatchanged ()
{
	_git_log
}

_git_worktree ()
{
	local subcommands="add list lock prune unlock"
	local subcommand="$(__git_find_on_cmdline "$subcommands")"
	if [ -z "$subcommand" ]; then
		__gitcomp "$subcommands"
	else
		case "$subcommand,$cur" in
		add,--*)
			__gitcomp "--detach"
			;;
		list,--*)
			__gitcomp "--porcelain"
			;;
		lock,--*)
			__gitcomp "--reason"
			;;
		prune,--*)



			__gitcomp "--dry-run --expire --verbose"
			;;
		*)
			;;
		esac
	fi
}















































__git_main ()
{
	local i c=1 command __git_dir __git_repo_path
	local __git_C_args C_args_count=0

	while [ $c -lt $cword ]; do
................................................................................
			--info-path
			--work-tree=
			--namespace=
			--no-replace-objects
			--help
			"
			;;
		*)     __git_compute_porcelain_commands
		       __gitcomp "$__git_porcelain_commands $(__git_aliases)" ;;






		esac
		return
	fi

	local completion_func="_git_${command//-/_}"
	declare -f $completion_func >/dev/null 2>/dev/null && $completion_func && return

	local expansion=$(__git_aliased_command "$command")
	if [ -n "$expansion" ]; then
		words[1]=$expansion
		completion_func="_git_${expansion//-/_}"
		declare -f $completion_func >/dev/null 2>/dev/null && $completion_func
	fi
}

__gitk_main ()
{
	__git_has_doubledash && return

................................................................................
			"
		return
		;;
	esac
	__git_complete_revlist
}

if [[ -n ${ZSH_VERSION-} ]]; then



	echo "WARNING: this script is deprecated, please see git-completion.zsh" 1>&2

	autoload -U +X compinit && compinit

	__gitcomp ()
	{
		emulate -L zsh
................................................................................
	{
		emulate -L zsh

		local IFS=$'\n'
		compset -P '*[=:]'
		compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
	}










	__gitcomp_file ()
	{
		emulate -L zsh

		local IFS=$'\n'
		compset -P '*[=:]'







>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



>
>
>
>
>
>
>












>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|
>









>
|


>
|










>


|

|
<
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
<
<
>
>
>
>
>
>
|
<
>
>







 







|







 







|







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







>







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







<
<
<
<
<







 







>





|








|
|
<
<
<
<












|
<
<
<
<
<
<
<








|
<
<
<







 







|
<
<
<
<
<
<







 







|
<
<
<
<







 







|
<
<
<





|




|
>











|












|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







|
<
<
<
<
<
<
<
<
<







 







|
<
<
<
<













|










|







 







|
|
|
|
<
>








<
<
<
<
<
<








|






|
|
|
<
<
<
<












|










|
<
<
<
<
<
<
<
<
<
<
<
<
<







 







|
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







|



|
|
|
|
|
|
<












|









|
<
<
<
<
<
<













|








>
>
>
>
>
>
>







 







<
<
<
<
<
<
<
<






|
<













|









|










|













<
<
<
<
<


|




|











|
<


<
<
<
<
|
<
>

<
<
<
|
>







 







|
<
<
<
|







 







|
<
<
<
<
<





>
>
>
>
>
>
>
>
>
>
>
>
>
>





|



|











|







>







 







|



|




|







 







|
<
<
<
<







 







>
>
>
>
>
>
>



>
>
>
>
>
>
>
>
|









|







 







|







 







|
<
<
<
<
<
<
<




|





|





|
|







 







|






|







>
>
>
>
>
>
>

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












|










|




|


|





|


|


|


|


|











|







 







|






>
>




|




|
|
<
<










|







 







|
<
<
<
<
<









|
|
>
>
>




>
>
>
>
>







 







>
>
>







 







|







 







|
<
<
<
<











|






|


|


|


>
>
>
|






>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|
|
>
>
>
>
>
>




|
<




|
<







 







|
>
>
>







 







>
>
>
>
>
>
>
>
>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
..
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
...
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
...
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
...
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
...
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
...
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
...
908
909
910
911
912
913
914




















915
916
917
918
919
920
921
...
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
....
1009
1010
1011
1012
1013
1014
1015





















1016
1017
1018
1019







1020























































































1021
1022
1023
1024
1025
1026
1027
....
1031
1032
1033
1034
1035
1036
1037





1038
1039
1040
1041
1042
1043
1044
....
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189




1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202







1203
1204
1205
1206
1207
1208
1209
1210
1211



1212
1213
1214
1215
1216
1217
1218
....
1281
1282
1283
1284
1285
1286
1287
1288






1289
1290
1291
1292
1293
1294
1295
....
1322
1323
1324
1325
1326
1327
1328
1329




1330
1331
1332
1333
1334
1335
1336
....
1337
1338
1339
1340
1341
1342
1343
1344



1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381



















1382
1383
1384
1385
1386
1387
1388
....
1407
1408
1409
1410
1411
1412
1413
1414









1415
1416
1417
1418
1419
1420
1421
....
1423
1424
1425
1426
1427
1428
1429
1430




1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
....
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499

1500
1501
1502
1503
1504
1505
1506
1507
1508






1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526




1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550













1551
1552
1553
1554
1555
1556
1557
....
1599
1600
1601
1602
1603
1604
1605
1606














1607
1608
1609
1610
1611
1612
1613
....
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633

1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656






1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
....
1794
1795
1796
1797
1798
1799
1800








1801
1802
1803
1804
1805
1806
1807

1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855





1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875

1876
1877




1878

1879
1880



1881
1882
1883
1884
1885
1886
1887
1888
1889
....
1899
1900
1901
1902
1903
1904
1905
1906



1907
1908
1909
1910
1911
1912
1913
1914
....
1951
1952
1953
1954
1955
1956
1957
1958





1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
....
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
....
2104
2105
2106
2107
2108
2109
2110
2111




2112
2113
2114
2115
2116
2117
2118
....
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
....
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
....
2261
2262
2263
2264
2265
2266
2267
2268







2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
....
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337



































































































































































































































































































































2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
....
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442


2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
....
2504
2505
2506
2507
2508
2509
2510
2511





2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
....
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
....
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
....
2748
2749
2750
2751
2752
2753
2754
2755




2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
....
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905

2906
2907
2908
2909
2910

2911
2912
2913
2914
2915
2916
2917
....
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
....
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
#       see git-prompt.sh for details.
#
# If you use complex aliases of form '!f() { ... }; f', you can use the null
# command ':' as the first command in the function body to declare the desired
# completion style.  For example '!f() { : git commit ; ... }; f' will
# tell the completion to use commit completion.  This also works with aliases
# of form "!sh -c '...'".  For example, "!sh -c ': git commit ; ... '".
#
# Compatible with bash 3.2.57.
#
# You can set the following environment variables to influence the behavior of
# the completion routines:
#
#   GIT_COMPLETION_CHECKOUT_NO_GUESS
#
#     When set to "1", do not include "DWIM" suggestions in git-checkout
................................................................................
# Runs git with all the options given as argument, respecting any
# '--git-dir=<path>' and '-C <path>' options present on the command line
__git ()
{
	git ${__git_C_args:+"${__git_C_args[@]}"} \
		${__git_dir:+--git-dir="$__git_dir"} "$@" 2>/dev/null
}

# Removes backslash escaping, single quotes and double quotes from a word,
# stores the result in the variable $dequoted_word.
# 1: The word to dequote.
__git_dequote ()
{
	local rest="$1" len ch

	dequoted_word=""

	while test -n "$rest"; do
		len=${#dequoted_word}
		dequoted_word="$dequoted_word${rest%%[\\\'\"]*}"
		rest="${rest:$((${#dequoted_word}-$len))}"

		case "${rest:0:1}" in
		\\)
			ch="${rest:1:1}"
			case "$ch" in
			$'\n')
				;;
			*)
				dequoted_word="$dequoted_word$ch"
				;;
			esac
			rest="${rest:2}"
			;;
		\')
			rest="${rest:1}"
			len=${#dequoted_word}
			dequoted_word="$dequoted_word${rest%%\'*}"
			rest="${rest:$((${#dequoted_word}-$len+1))}"
			;;
		\")
			rest="${rest:1}"
			while test -n "$rest" ; do
				len=${#dequoted_word}
				dequoted_word="$dequoted_word${rest%%[\\\"]*}"
				rest="${rest:$((${#dequoted_word}-$len))}"
				case "${rest:0:1}" in
				\\)
					ch="${rest:1:1}"
					case "$ch" in
					\"|\\|\$|\`)
						dequoted_word="$dequoted_word$ch"
						;;
					$'\n')
						;;
					*)
						dequoted_word="$dequoted_word\\$ch"
						;;
					esac
					rest="${rest:2}"
					;;
				\")
					rest="${rest:1}"
					break
					;;
				esac
			done
			;;
		esac
	done
}

# The following function is based on code from:
#
#   bash_completion - programmable completion functions for bash 3.2+
#
#   Copyright © 2006-2008, Ian Macdonald <ian@caliban.org>
#             © 2009-2010, Bash Completion Maintainers
................................................................................
__gitcomp ()
{
	local cur_="${3-$cur}"

	case "$cur_" in
	--*=)
		;;
	--no-*)
		local c i=0 IFS=$' \t\n'
		for c in $1; do
			if [[ $c == "--" ]]; then
				continue
			fi
			c="$c${4-}"
			if [[ $c == "$cur_"* ]]; then
				case $c in
				--*=*|*.) ;;
				*) c="$c " ;;
				esac
				COMPREPLY[i++]="${2-}$c"
			fi
		done
		;;
	*)
		local c i=0 IFS=$' \t\n'
		for c in $1; do
			if [[ $c == "--" ]]; then
				c="--no-...${4-}"
				if [[ $c == "$cur_"* ]]; then
					COMPREPLY[i++]="${2-}$c "
				fi
				break
			fi
			c="$c${4-}"
			if [[ $c == "$cur_"* ]]; then
				case $c in
				--*=*|*.) ;;
				*) c="$c " ;;
				esac
				COMPREPLY[i++]="${2-}$c"
			fi
		done
		;;
	esac
}

# Clear the variables caching builtins' options when (re-)sourcing
# the completion script.
if [[ -n ${ZSH_VERSION-} ]]; then
	unset $(set |sed -ne 's/^\(__gitcomp_builtin_[a-zA-Z0-9_][a-zA-Z0-9_]*\)=.*/\1/p') 2>/dev/null
else
	unset $(compgen -v __gitcomp_builtin_)
fi

# This function is equivalent to
#
#    __gitcomp "$(git xxx --git-completion-helper) ..."
#
# except that the output is cached. Accept 1-3 arguments:
# 1: the git command to execute, this is also the cache key
# 2: extra options to be added on top (e.g. negative forms)
# 3: options to be excluded
__gitcomp_builtin ()
{
	# spaces must be replaced with underscore for multi-word
	# commands, e.g. "git remote add" becomes remote_add.
	local cmd="$1"
	local incl="$2"
	local excl="$3"

	local var=__gitcomp_builtin_"${cmd/-/_}"
	local options
	eval "options=\$$var"

	if [ -z "$options" ]; then
		# leading and trailing spaces are significant to make
		# option removal work correctly.
		options=" $incl $(__git ${cmd/_/ } --git-completion-helper) "
		for i in $excl; do
			options="${options/ $i / }"
		done
		eval "$var=\"$options\""
	fi

	__gitcomp "$options"
}

# Variation of __gitcomp_nl () that appends to the existing list of
# completion candidates, COMPREPLY.
__gitcomp_nl_append ()
{
	local IFS=$'\n'
	__gitcompappend "$1" "${2-}" "${3-$cur}" "${4- }"
................................................................................
#    the default space (optional).  If specified but empty, nothing is
#    appended.
__gitcomp_nl ()
{
	COMPREPLY=()
	__gitcomp_nl_append "$@"
}

# Fills the COMPREPLY array with prefiltered paths without any additional
# processing.
# Callers must take care of providing only paths that match the current path
# to be completed and adding any prefix path components, if necessary.
# 1: List of newline-separated matching paths, complete with all prefix
#    path componens.
__gitcomp_file_direct ()
{
	local IFS=$'\n'

	COMPREPLY=($1)

	# use a hack to enable file mode in bash < 4
	compopt -o filenames +o nospace 2>/dev/null ||
	compgen -f /non-existing-dir/ >/dev/null ||
	true
}

# Generates completion reply with compgen from newline-separated possible
# completion filenames.
# It accepts 1 to 3 arguments:
# 1: List of possible completion filenames, separated by a single newline.
# 2: A directory prefix to be added to each possible completion filename
#    (optional).
................................................................................
	# since tilde expansion is not applied.
	# This means that COMPREPLY will be empty and Bash default
	# completion will be used.
	__gitcompadd "$1" "${2-}" "${3-$cur}" ""

	# use a hack to enable file mode in bash < 4
	compopt -o filenames +o nospace 2>/dev/null ||
	compgen -f /non-existing-dir/ >/dev/null ||
	true
}

# Execute 'git ls-files', unless the --committable option is specified, in
# which case it runs 'git diff-index' to find out the files that can be
# committed.  It return paths relative to the directory specified in the first
# argument, and using the options specified in the second argument.
__git_ls_files_helper ()
{
	if [ "$2" == "--committable" ]; then
		__git -C "$1" -c core.quotePath=false diff-index \
			--name-only --relative HEAD -- "${3//\\/\\\\}*"
	else
		# NOTE: $2 is not quoted in order to support multiple options
		__git -C "$1" -c core.quotePath=false ls-files \
			--exclude-standard $2 -- "${3//\\/\\\\}*"
	fi
}


# __git_index_files accepts 1 or 2 arguments:
# 1: Options to pass to ls-files (required).
# 2: A directory path (optional).
#    If provided, only files within the specified directory are listed.
#    Sub directories are never recursed.  Path must have a trailing
#    slash.
# 3: List only paths matching this path component (optional).
__git_index_files ()
{
	local root="$2" match="$3"

	__git_ls_files_helper "$root" "$1" "$match" |

	awk -F / -v pfx="${2//\\/\\\\}" '{
		paths[$1] = 1
	}
	END {
		for (p in paths) {
			if (substr(p, 1, 1) != "\"") {
				# No special characters, easy!
				print pfx p
				continue
			}

			# The path is quoted.
			p = dequote(p)
			if (p == "")
				continue

			# Even when a directory name itself does not contain
			# any special characters, it will still be quoted if
			# any of its (stripped) trailing path components do.
			# Because of this we may have seen the same direcory
			# both quoted and unquoted.
			if (p in paths)
				# We have seen the same directory unquoted,
				# skip it.
				continue
			else
				print pfx p
		}
	}
	function dequote(p,    bs_idx, out, esc, esc_idx, dec) {
		# Skip opening double quote.
		p = substr(p, 2)

		# Interpret backslash escape sequences.
		while ((bs_idx = index(p, "\\")) != 0) {
			out = out substr(p, 1, bs_idx - 1)
			esc = substr(p, bs_idx + 1, 1)
			p = substr(p, bs_idx + 2)

			if ((esc_idx = index("abtvfr\"\\", esc)) != 0) {
				# C-style one-character escape sequence.
				out = out substr("\a\b\t\v\f\r\"\\",
						 esc_idx, 1)
			} else if (esc == "n") {
				# Uh-oh, a newline character.
				# We cant reliably put a pathname
				# containing a newline into COMPREPLY,
				# and the newline would create a mess.
				# Skip this path.
				return ""
			} else {
				# Must be a \nnn octal value, then.
				dec = esc             * 64 + \
				      substr(p, 1, 1) * 8  + \
				      substr(p, 2, 1)
				out = out sprintf("%c", dec)
				p = substr(p, 3)
			}
		}
		# Drop closing double quote, if there is one.
		# (There isnt any if this is a directory, as it was
		# already stripped with the trailing path components.)
		if (substr(p, length(p), 1) == "\"")
			out = out substr(p, 1, length(p) - 1)
		else
			out = out p

		return out
	}'
}

# __git_complete_index_file requires 1 argument:
# 1: the options to pass to ls-file
#
# The exception is --committable, which finds the files appropriate commit.
__git_complete_index_file ()
{
	local dequoted_word pfx="" cur_

	__git_dequote "$cur"

	case "$dequoted_word" in


	?*/*)
		pfx="${dequoted_word%/*}/"
		cur_="${dequoted_word##*/}"
		;;
	*)
		cur_="$dequoted_word"
	esac


	__gitcomp_file_direct "$(__git_index_files "$1" "$pfx" "$cur_")"
}

# Lists branches from the local repository.
# 1: A prefix to be added to each listed branch (optional).
# 2: List only branches matching this word (optional; list all branches if
#    unset or empty).
# 3: A suffix to be appended to each listed branch (optional).
................................................................................
		case "$cur_" in
		refs|refs/*)
			format="refname"
			refs=("$match*" "$match*/**")
			track=""
			;;
		*)
			for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD; do
				case "$i" in
				$match*)
					if [ -e "$dir/$i" ]; then
						echo "$pfx$i$sfx"
					fi
					;;
				esac
................................................................................
		fi
	done
	return 1
}

__git_list_merge_strategies ()
{
	LANG=C LC_ALL=C git merge -s help 2>&1 |
	sed -n -e '/[Aa]vailable strategies are: /,/^$/{
		s/\.$//
		s/.*://
		s/^[ 	]*//
		s/[ 	]*$//
		p
	}'
................................................................................
		;;
	*)
		__git_complete_refs
		;;
	esac
}





















__git_complete_file ()
{
	__git_complete_revlist_file
}

__git_complete_revlist ()
{
................................................................................
			push) no_complete_refspec=1 ;;
			fetch)
				return
				;;
			*) ;;
			esac
			;;
		--multiple) no_complete_refspec=1; break ;;
		-*) ;;
		*) remote="$i"; break ;;
		esac
		((c++))
	done
	if [ -z "$remote" ]; then
		__gitcomp_nl "$(__git_remotes)"
................................................................................
		__gitcomp "$__git_merge_strategies" "" "${cur##--strategy=}"
		return 0
		;;
	esac
	return 1
}






















__git_all_commands=
__git_compute_all_commands ()
{
	test -n "$__git_all_commands" ||







	__git_all_commands=$(git --list-cmds=main,others,alias,nohelpers)























































































}

# Lists all set config variables starting with the given section prefix,
# with the prefix removed.
__git_get_config_variables ()
{
	local section="$1" i IFS=$'\n'
................................................................................
}

__git_pretty_aliases ()
{
	__git_get_config_variables "pretty"
}






# __git_aliased_command requires 1 argument
__git_aliased_command ()
{
	local word cmdline=$(__git config --get "alias.$1")
	for word in $cmdline; do
		case "$word" in
		\!gitk|gitk)
................................................................................
		esac
	done

	printf "%d" $c
}

__git_whitespacelist="nowarn warn error error-all fix"
__git_am_inprogress_options="--skip --continue --resolved --abort --quit --show-current-patch"

_git_am ()
{
	__git_find_repo_path
	if [ -d "$__git_repo_path"/rebase-apply ]; then
		__gitcomp "$__git_am_inprogress_options"
		return
	fi
	case "$cur" in
	--whitespace=*)
		__gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
		return
		;;
	--*)
		__gitcomp_builtin am "" \
			"$__git_am_inprogress_options"




		return
	esac
}

_git_apply ()
{
	case "$cur" in
	--whitespace=*)
		__gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
		return
		;;
	--*)
		__gitcomp_builtin apply







		return
	esac
}

_git_add ()
{
	case "$cur" in
	--*)
		__gitcomp_builtin add



		return
	esac

	local complete_opt="--others --modified --directory --no-empty-directory"
	if test -n "$(__git_find_on_cmdline "-u --update")"
	then
		complete_opt="--modified"
................................................................................
	done

	case "$cur" in
	--set-upstream-to=*)
		__git_complete_refs --cur="${cur##--set-upstream-to=}"
		;;
	--*)
		__gitcomp_builtin branch






		;;
	*)
		if [ $only_local_ref = "y" -a $has_r = "n" ]; then
			__gitcomp_direct "$(__git_heads "" "$cur" " ")"
		else
			__git_complete_refs
		fi
................................................................................
	__git_has_doubledash && return

	case "$cur" in
	--conflict=*)
		__gitcomp "diff3 merge" "" "${cur##--conflict=}"
		;;
	--*)
		__gitcomp_builtin checkout




		;;
	*)
		# check if --track, --no-track, or --no-guess was specified
		# if so, disable DWIM mode
		local flags="--track --no-track --no-guess" track_opt="--track"
		if [ "$GIT_COMPLETION_CHECKOUT_NO_GUESS" = "1" ] ||
		   [ -n "$(__git_find_on_cmdline "$flags")" ]; then
................................................................................
			track_opt=''
		fi
		__git_complete_refs $track_opt
		;;
	esac
}

__git_cherry_pick_inprogress_options="--continue --quit --abort"




_git_cherry_pick ()
{
	__git_find_repo_path
	if [ -f "$__git_repo_path"/CHERRY_PICK_HEAD ]; then
		__gitcomp "$__git_cherry_pick_inprogress_options"
		return
	fi
	case "$cur" in
	--*)
		__gitcomp_builtin cherry-pick "" \
			"$__git_cherry_pick_inprogress_options"
		;;
	*)
		__git_complete_refs
		;;
	esac
}

_git_clean ()
{
	case "$cur" in
	--*)
		__gitcomp_builtin clean
		return
		;;
	esac

	# XXX should we check for -x option ?
	__git_complete_index_file "--others --directory"
}

_git_clone ()
{
	case "$cur" in
	--*)
		__gitcomp_builtin clone



















		return
		;;
	esac
}

__git_untracked_file_modes="all no normal"

................................................................................
		return
		;;
	--untracked-files=*)
		__gitcomp "$__git_untracked_file_modes" "" "${cur##--untracked-files=}"
		return
		;;
	--*)
		__gitcomp_builtin commit









		return
	esac

	if __git rev-parse --verify --quiet HEAD >/dev/null; then
		__git_complete_index_file "--committable"
	else
		# This is the first commit
................................................................................
	fi
}

_git_describe ()
{
	case "$cur" in
	--*)
		__gitcomp_builtin describe




		return
	esac
	__git_complete_refs
}

__git_diff_algorithms="myers minimal patience histogram"

__git_diff_submodule_formats="diff log short"

__git_diff_common_options="--stat --numstat --shortstat --summary
			--patch-with-stat --name-only --name-status --color
			--no-color --color-words --no-renames --check
			--full-index --binary --abbrev --diff-filter=
			--find-copies-harder --ignore-cr-at-eol
			--text --ignore-space-at-eol --ignore-space-change
			--ignore-all-space --ignore-blank-lines --exit-code
			--quiet --ext-diff --no-ext-diff
			--no-prefix --src-prefix= --dst-prefix=
			--inter-hunk-context=
			--patience --histogram --minimal
			--raw --word-diff --word-diff-regex=
			--dirstat --dirstat= --dirstat-by-file
			--dirstat-by-file= --cumulative
			--diff-algorithm=
			--submodule --submodule= --ignore-submodules
"

_git_diff ()
{
	__git_has_doubledash && return

	case "$cur" in
................................................................................

	case "$cur" in
	--tool=*)
		__gitcomp "$__git_mergetools_common kompare" "" "${cur##--tool=}"
		return
		;;
	--*)
		__gitcomp_builtin difftool "$__git_diff_common_options
					--base --cached --ours --theirs
					--pickaxe-all --pickaxe-regex
					--relative --staged

					"
		return
		;;
	esac
	__git_complete_revlist_file
}

__git_fetch_recurse_submodules="yes on-demand no"







_git_fetch ()
{
	case "$cur" in
	--recurse-submodules=*)
		__gitcomp "$__git_fetch_recurse_submodules" "" "${cur##--recurse-submodules=}"
		return
		;;
	--*)
		__gitcomp_builtin fetch
		return
		;;
	esac
	__git_complete_remote_or_refspec
}

__git_format_patch_extra_options="
	--full-index --not --all --no-prefix --src-prefix=
	--dst-prefix= --notes




"

_git_format_patch ()
{
	case "$cur" in
	--thread=*)
		__gitcomp "
			deep shallow
			" "" "${cur##--thread=}"
		return
		;;
	--*)
		__gitcomp_builtin format-patch "$__git_format_patch_extra_options"
		return
		;;
	esac
	__git_complete_revlist
}

_git_fsck ()
{
	case "$cur" in
	--*)
		__gitcomp_builtin fsck













		return
		;;
	esac
}

_git_gitk ()
{
................................................................................

_git_grep ()
{
	__git_has_doubledash && return

	case "$cur" in
	--*)
		__gitcomp_builtin grep














		return
		;;
	esac

	case "$cword,$prev" in
	2,*|*,-*)
		__git_complete_symbol && return
................................................................................
	__git_complete_refs
}

_git_help ()
{
	case "$cur" in
	--*)
		__gitcomp_builtin help
		return
		;;
	esac
	if test -n "$GIT_TESTING_ALL_COMMAND_LIST"
	then
		__gitcomp "$GIT_TESTING_ALL_COMMAND_LIST $(git --list-cmds=alias,list-guide) gitk"
	else
		__gitcomp "$(git --list-cmds=main,nohelpers,alias,list-guide) gitk"
	fi

}

_git_init ()
{
	case "$cur" in
	--shared=*)
		__gitcomp "
			false true umask group all world everybody
			" "" "${cur##--shared=}"
		return
		;;
	--*)
		__gitcomp_builtin init
		return
		;;
	esac
}

_git_ls_files ()
{
	case "$cur" in
	--*)
		__gitcomp_builtin ls-files






		return
		;;
	esac

	# XXX ignore options like --modified and always suggest all cached
	# files.
	__git_complete_index_file "--cached"
}

_git_ls_remote ()
{
	case "$cur" in
	--*)
		__gitcomp_builtin ls-remote
		return
		;;
	esac
	__gitcomp_nl "$(__git_remotes)"
}

_git_ls_tree ()
{
	case "$cur" in
	--*)
		__gitcomp_builtin ls-tree
		return
		;;
	esac

	__git_complete_file
}

# Options that go well for log, shortlog and gitk
__git_log_common_options="
	--not --all
	--branches --tags --remotes
................................................................................
		__git_complete_symbol --pfx="-S" --cur="${cur#-S}"
		return
		;;
	esac
	__git_complete_revlist
}









_git_merge ()
{
	__git_complete_strategy && return

	case "$cur" in
	--*)
		__gitcomp_builtin merge

		return
	esac
	__git_complete_refs
}

_git_mergetool ()
{
	case "$cur" in
	--tool=*)
		__gitcomp "$__git_mergetools_common tortoisemerge" "" "${cur##--tool=}"
		return
		;;
	--*)
		__gitcomp "--tool= --prompt --no-prompt --gui --no-gui"
		return
		;;
	esac
}

_git_merge_base ()
{
	case "$cur" in
	--*)
		__gitcomp_builtin merge-base
		return
		;;
	esac
	__git_complete_refs
}

_git_mv ()
{
	case "$cur" in
	--*)
		__gitcomp_builtin mv
		return
		;;
	esac

	if [ $(__git_count_arguments "mv") -gt 0 ]; then
		# We need to show both cached and untracked files (including
		# empty directories) since this may not be the last argument.
		__git_complete_index_file "--cached --others --directory"
	else
		__git_complete_index_file "--cached"
	fi
}






_git_notes ()
{
	local subcommands='add append copy edit get-ref list merge prune remove show'
	local subcommand="$(__git_find_on_cmdline "$subcommands")"

	case "$subcommand,$cur" in
	,--*)
		__gitcomp_builtin notes
		;;
	,*)
		case "$prev" in
		--ref)
			__git_complete_refs
			;;
		*)
			__gitcomp "$subcommands --ref"
			;;
		esac
		;;
	*,--reuse-message=*|*,--reedit-message=*)

		__git_complete_refs --cur="${cur#*=}"
		;;




	*,--*)

		__gitcomp_builtin notes_$subcommand
		;;



	prune,*|get-ref,*)
		# this command does not take a ref, do not complete it
		;;
	*)
		case "$prev" in
		-m|-F)
			;;
		*)
			__git_complete_refs
................................................................................

	case "$cur" in
	--recurse-submodules=*)
		__gitcomp "$__git_fetch_recurse_submodules" "" "${cur##--recurse-submodules=}"
		return
		;;
	--*)
		__gitcomp_builtin pull




		return
		;;
	esac
	__git_complete_remote_or_refspec
}

__git_push_recurse_submodules="check on-demand only"
................................................................................
		return
		;;
	--force-with-lease=*)
		__git_complete_force_with_lease "${cur##--force-with-lease=}"
		return
		;;
	--*)
		__gitcomp_builtin push





		return
		;;
	esac
	__git_complete_remote_or_refspec
}

_git_range_diff ()
{
	case "$cur" in
	--*)
		__gitcomp "
			--creation-factor= --no-dual-color
			$__git_diff_common_options
		"
		return
		;;
	esac
	__git_complete_revlist
}

_git_rebase ()
{
	__git_find_repo_path
	if [ -f "$__git_repo_path"/rebase-merge/interactive ]; then
		__gitcomp "--continue --skip --abort --quit --edit-todo --show-current-patch"
		return
	elif [ -d "$__git_repo_path"/rebase-apply ] || \
	     [ -d "$__git_repo_path"/rebase-merge ]; then
		__gitcomp "--continue --skip --abort --quit --show-current-patch"
		return
	fi
	__git_complete_strategy && return
	case "$cur" in
	--whitespace=*)
		__gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}"
		return
		;;
	--*)
		__gitcomp "
			--onto --merge --strategy --interactive
			--rebase-merges --preserve-merges --stat --no-stat
			--committer-date-is-author-date --ignore-date
			--ignore-whitespace --whitespace=
			--autosquash --no-autosquash
			--fork-point --no-fork-point
			--autostash --no-autostash
			--verify --no-verify
			--keep-empty --root --force-rebase --no-ff
			--rerere-autoupdate
			--exec
			"

		return
	esac
	__git_complete_refs
}
................................................................................
		return
		;;
	--to=*|--cc=*|--bcc=*|--from=*)
		__gitcomp "$(__git send-email --dump-aliases)" "" "${cur#--*=}"
		return
		;;
	--*)
		__gitcomp_builtin send-email "--annotate --bcc --cc --cc-cmd --chain-reply-to
			--compose --confirm= --dry-run --envelope-sender
			--from --identity
			--in-reply-to --no-chain-reply-to --no-signed-off-by-cc
			--no-suppress-from --no-thread --quiet --reply-to
			--signed-off-by-cc --smtp-pass --smtp-server
			--smtp-server-port --smtp-encryption= --smtp-user
			--subject --suppress-cc= --suppress-from --thread --to
			--validate --no-validate
			$__git_format_patch_extra_options"
		return
		;;
	esac
	__git_complete_revlist
}

_git_stage ()
................................................................................
	--column=*)
		__gitcomp "
			always never auto column row plain dense nodense
			" "" "${cur##--column=}"
		return
		;;
	--*)
		__gitcomp_builtin status




		return
		;;
	esac

	untracked_state="$(__git_get_option_value "-u" "--untracked-files=" \
		"$__git_untracked_file_modes" "status.showUntrackedFiles")"

................................................................................
		esac
		prevword=$word
		c=$((--c))
	done

	__git config $config_file --name-only --list
}

__git_config_vars=
__git_compute_config_vars ()
{
	test -n "$__git_config_vars" ||
	__git_config_vars="$(git help --config-for-completion | sort | uniq)"
}

_git_config ()
{
	local varname

	if [ "${BASH_VERSINFO[0]:-0}" -ge 4 ]; then
		varname="${prev,,}"
	else
		varname="$(echo "$prev" |tr A-Z a-z)"
	fi

	case "$varname" in
	branch.*.remote|branch.*.pushremote)
		__gitcomp_nl "$(__git_remotes)"
		return
		;;
	branch.*.merge)
		__git_complete_refs
		return
		;;
	branch.*.rebase)
		__gitcomp "false true merges preserve interactive"
		return
		;;
	remote.pushdefault)
		__gitcomp_nl "$(__git_remotes)"
		return
		;;
	remote.*.fetch)
................................................................................
		__gitcomp "man info web html"
		return
		;;
	log.date)
		__gitcomp "$__git_log_date_formats"
		return
		;;
	sendemail.aliasfiletype)
		__gitcomp "mutt mailrc pine elm gnus"
		return
		;;
	sendemail.confirm)
		__gitcomp "$__git_send_email_confirm_options"
		return
		;;
................................................................................
		;;
	*.*)
		return
		;;
	esac
	case "$cur" in
	--*)
		__gitcomp_builtin config







		return
		;;
	branch.*.*)
		local pfx="${cur%.*}." cur_="${cur##*.}"
		__gitcomp "remote pushRemote merge mergeOptions rebase" "$pfx" "$cur_"
		return
		;;
	branch.*)
		local pfx="${cur%.*}." cur_="${cur#*.}"
		__gitcomp_direct "$(__git_heads "$pfx" "$cur_" ".")"
		__gitcomp_nl_append $'autoSetupMerge\nautoSetupRebase\n' "$pfx" "$cur_"
		return
		;;
	guitool.*.*)
		local pfx="${cur%.*}." cur_="${cur##*.}"
		__gitcomp "
			argPrompt cmd confirm needsFile noConsole noRescan
			prompt revPrompt revUnmerged title
			" "$pfx" "$cur_"
		return
		;;
	difftool.*.*)
		local pfx="${cur%.*}." cur_="${cur##*.}"
		__gitcomp "cmd path" "$pfx" "$cur_"
		return
................................................................................
		__gitcomp_nl "$__git_all_commands" "$pfx" "$cur_"
		return
		;;
	remote.*.*)
		local pfx="${cur%.*}." cur_="${cur##*.}"
		__gitcomp "
			url proxy fetch push mirror skipDefaultUpdate
			receivepack uploadpack tagOpt pushurl
			" "$pfx" "$cur_"
		return
		;;
	remote.*)
		local pfx="${cur%.*}." cur_="${cur#*.}"
		__gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "."
		__gitcomp_nl_append "pushDefault" "$pfx" "$cur_"
		return
		;;
	url.*.*)
		local pfx="${cur%.*}." cur_="${cur##*.}"
		__gitcomp "insteadOf pushInsteadOf" "$pfx" "$cur_"
		return
		;;
	*.*)
		__git_compute_config_vars
		__gitcomp "$__git_config_vars"
		;;
	*)
		__git_compute_config_vars
		__gitcomp "$(echo "$__git_config_vars" | sed 's/\.[^ ]*/./g')"
	esac



































































































































































































































































































































}

_git_remote ()
{
	local subcommands="
		add rename remove set-head set-branches
		get-url set-url show prune update
		"
	local subcommand="$(__git_find_on_cmdline "$subcommands")"
	if [ -z "$subcommand" ]; then
		case "$cur" in
		--*)
			__gitcomp_builtin remote
			;;
		*)
			__gitcomp "$subcommands"
			;;
		esac
		return
	fi

	case "$subcommand,$cur" in
	add,--*)
		__gitcomp_builtin remote_add
		;;
	add,*)
		;;
	set-head,--*)
		__gitcomp_builtin remote_set-head
		;;
	set-branches,--*)
		__gitcomp_builtin remote_set-branches
		;;
	set-head,*|set-branches,*)
		__git_complete_remote_or_refspec
		;;
	update,--*)
		__gitcomp_builtin remote_update
		;;
	update,*)
		__gitcomp "$(__git_remotes) $(__git_get_config_variables "remotes")"
		;;
	set-url,--*)
		__gitcomp_builtin remote_set-url
		;;
	get-url,--*)
		__gitcomp_builtin remote_get-url
		;;
	prune,--*)
		__gitcomp_builtin remote_prune
		;;
	*)
		__gitcomp_nl "$(__git_remotes)"
		;;
	esac
}

_git_replace ()
{
	case "$cur" in
	--*)
		__gitcomp_builtin replace
		return
		;;
	esac
	__git_complete_refs
}

_git_rerere ()
................................................................................

_git_reset ()
{
	__git_has_doubledash && return

	case "$cur" in
	--*)
		__gitcomp_builtin reset
		return
		;;
	esac
	__git_complete_refs
}

__git_revert_inprogress_options="--continue --quit --abort"

_git_revert ()
{
	__git_find_repo_path
	if [ -f "$__git_repo_path"/REVERT_HEAD ]; then
		__gitcomp "$__git_revert_inprogress_options"
		return
	fi
	case "$cur" in
	--*)
		__gitcomp_builtin revert "" \
			"$__git_revert_inprogress_options"


		return
		;;
	esac
	__git_complete_refs
}

_git_rm ()
{
	case "$cur" in
	--*)
		__gitcomp_builtin rm
		return
		;;
	esac

	__git_complete_index_file "--cached"
}

................................................................................
	__git_complete_revlist_file
}

_git_show_branch ()
{
	case "$cur" in
	--*)
		__gitcomp_builtin show-branch





		return
		;;
	esac
	__git_complete_revlist
}

_git_stash ()
{
	local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'
	local subcommands='push list show apply clear drop pop create branch'
	local subcommand="$(__git_find_on_cmdline "$subcommands save")"
	if [ -n "$(__git_find_on_cmdline "-p")" ]; then
		subcommand="push"
	fi
	if [ -z "$subcommand" ]; then
		case "$cur" in
		--*)
			__gitcomp "$save_opts"
			;;
		sa*)
			if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then
				__gitcomp "save"
			fi
			;;
		*)
			if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then
				__gitcomp "$subcommands"
			fi
			;;
		esac
................................................................................
			;;
		apply,--*|pop,--*)
			__gitcomp "--index --quiet"
			;;
		drop,--*)
			__gitcomp "--quiet"
			;;
		list,--*)
			__gitcomp "--name-status --oneline --patch-with-stat"
			;;
		show,--*|branch,--*)
			;;
		branch,*)
			if [ $cword -eq 3 ]; then
				__git_complete_refs
			else
				__gitcomp_nl "$(__git stash list \
................................................................................

_git_tag ()
{
	local i c=1 f=0
	while [ $c -lt $cword ]; do
		i="${words[c]}"
		case "$i" in
		-d|--delete|-v|--verify)
			__gitcomp_direct "$(__git_tags "" "$cur" " ")"
			return
			;;
		-f)
			f=1
			;;
		esac
................................................................................
	*)
		__git_complete_refs
		;;
	esac

	case "$cur" in
	--*)
		__gitcomp_builtin tag




		;;
	esac
}

_git_whatchanged ()
{
	_git_log
}

_git_worktree ()
{
	local subcommands="add list lock move prune remove unlock"
	local subcommand="$(__git_find_on_cmdline "$subcommands")"
	if [ -z "$subcommand" ]; then
		__gitcomp "$subcommands"
	else
		case "$subcommand,$cur" in
		add,--*)
			__gitcomp_builtin worktree_add
			;;
		list,--*)
			__gitcomp_builtin worktree_list
			;;
		lock,--*)
			__gitcomp_builtin worktree_lock
			;;
		prune,--*)
			__gitcomp_builtin worktree_prune
			;;
		remove,--*)
			__gitcomp "--force"
			;;
		*)
			;;
		esac
	fi
}

__git_complete_common () {
	local command="$1"

	case "$cur" in
	--*)
		__gitcomp_builtin "$command"
		;;
	esac
}

__git_cmds_with_parseopt_helper=
__git_support_parseopt_helper () {
	test -n "$__git_cmds_with_parseopt_helper" ||
		__git_cmds_with_parseopt_helper="$(__git --list-cmds=parseopt)"

	case " $__git_cmds_with_parseopt_helper " in
	*" $1 "*)
		return 0
		;;
	*)
		return 1
		;;
	esac
}

__git_complete_command () {
	local command="$1"
	local completion_func="_git_${command//-/_}"
	if ! declare -f $completion_func >/dev/null 2>/dev/null &&
		declare -f _completion_loader >/dev/null 2>/dev/null
	then
		_completion_loader "git-$command"
	fi
	if declare -f $completion_func >/dev/null 2>/dev/null
	then
		$completion_func
		return 0
	elif __git_support_parseopt_helper "$command"
	then
		__git_complete_common "$command"
		return 0
	else
		return 1
	fi
}

__git_main ()
{
	local i c=1 command __git_dir __git_repo_path
	local __git_C_args C_args_count=0

	while [ $c -lt $cword ]; do
................................................................................
			--info-path
			--work-tree=
			--namespace=
			--no-replace-objects
			--help
			"
			;;
		*)
			if test -n "$GIT_TESTING_PORCELAIN_COMMAND_LIST"
			then
				__gitcomp "$GIT_TESTING_PORCELAIN_COMMAND_LIST"
			else
				__gitcomp "$(git --list-cmds=list-mainporcelain,others,nohelpers,alias,list-complete,config)"
			fi
			;;
		esac
		return
	fi

	__git_complete_command "$command" && return


	local expansion=$(__git_aliased_command "$command")
	if [ -n "$expansion" ]; then
		words[1]=$expansion
		__git_complete_command "$expansion"

	fi
}

__gitk_main ()
{
	__git_has_doubledash && return

................................................................................
			"
		return
		;;
	esac
	__git_complete_revlist
}

if [[ -n ${ZSH_VERSION-} ]] &&
   # Don't define these functions when sourced from 'git-completion.zsh',
   # it has its own implementations.
   [[ -z ${GIT_SOURCING_ZSH_COMPLETION-} ]]; then
	echo "WARNING: this script is deprecated, please see git-completion.zsh" 1>&2

	autoload -U +X compinit && compinit

	__gitcomp ()
	{
		emulate -L zsh
................................................................................
	{
		emulate -L zsh

		local IFS=$'\n'
		compset -P '*[=:]'
		compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
	}

	__gitcomp_file_direct ()
	{
		emulate -L zsh

		local IFS=$'\n'
		compset -P '*[=:]'
		compadd -Q -f -- ${=1} && _ret=0
	}

	__gitcomp_file ()
	{
		emulate -L zsh

		local IFS=$'\n'
		compset -P '*[=:]'

Added tmux-1.conf.























































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
# ====================================================================
#
# tmux.conf
#
# tmux(1) configuration file
#
# ====================================================================

# Generic Settings
set -g history-limit      8192
set -g default-terminal   "screen-256color"
set -g status-keys        emacs

# Status Line
set -g status-utf8        on
set -g status-bg          colour235
set -g status-left        "#[fg=white,bold]#H | #[fg=colour025,bold][#[fg=yellow,bold]#I#[fg=colour025,bold]] "
set -g status-right       "#[fg=white,bold]| %a, %e %b '%y %l:%M %p "
set -g status-left-length 25

# Message options
set -g message-bg         red
set -g message-fg         white
set -g message-attr       bold

# Window options
set-window-option -g mode-attr                    bright
set-window-option -g mode-fg                      white
set-window-option -g mode-bg                      red
set-window-option -g window-status-format         "#I:#W#[fg=green]#F#[fg=default]"
set-window-option -g window-status-attr           bold
set-window-option -g window-status-fg             colour025
set-window-option -g window-status-bg             colour235
set-window-option -g window-status-current-format "#[fg=colour031,bold]{#[fg=green,bold]#I:#W#[fg=colour031,bold]}#[fg=default]"
set-window-option -g window-status-bell-attr      bold
set-window-option -g window-status-bell-fg        red
set-window-option -g window-status-bell-bg        default

# Key bindings
bind-key -r M-v resize-pane -U
bind-key -r C-v resize-pane -D
bind-key -r C-a resize-pane -L
bind-key -r C-e resize-pane -R

Added tmux-2.conf.









































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
# ====================================================================
#
# tmux-2.conf
#
# tmux(1) configuration file for tmux 2.0 and above
#
# --------------------------------------------------------------------

# Generic Settings
set -g history-limit      8192
set -g default-terminal   "screen-256color"
set -g status-keys        emacs

# Status Line
set -g status-bg          colour235
set -g status-left        "#[fg=white,bold]#H | #[fg=colour025,bold][#[fg=yellow,bold]#I#[fg=colour025,bold]] "
set -g status-right       "#[fg=white,bold]| %a, %e %b '%y %l:%M %p "
set -g status-left-length 25

# Message options
set -g message-style      "bg=red,fg=white,bold"

# Mode options
set -g mode-style         "bg=red,fg=white,bright"

# Window options
set -g window-status-style				"bg=colour235,fg=colour025,bold"
set -g window-status-bell-style				"bg=default,fg=red,bold"
set-window-option -g window-status-format		"#I:#W#[fg=green]#F#[fg=default]"
set-window-option -g window-status-current-format	"#[fg=colour031,bold]{#[fg=green,bold]#I:#W#[fg=colour031,bold]}#[fg=default]"

# Key bindings
bind-key -r M-v resize-pane -U
bind-key -r C-v resize-pane -D
bind-key -r C-a resize-pane -L
bind-key -r C-e resize-pane -R

Deleted tmux.conf.

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
# ====================================================================
#
# tmux.conf
#
# tmux(1) configuration file
#
# ====================================================================

# Generic Settings
set -g history-limit      8192
set -g default-terminal   "screen-256color"
set -g status-keys        emacs

# Status Line
set -g status-utf8        on
set -g status-bg          colour235
set -g status-left        "#[fg=white,bold]#H | #[fg=colour025,bold][#[fg=yellow,bold]#I#[fg=colour025,bold]] "
set -g status-right       "#[fg=white,bold]| %a, %e %b '%y %l:%M %p "
set -g status-left-length 25

# Message options
set -g message-bg         red
set -g message-fg         white
set -g message-attr       bold

# Window options
set-window-option -g mode-attr                    bright
set-window-option -g mode-fg                      white
set-window-option -g mode-bg                      red
set-window-option -g window-status-format         "#I:#W#[fg=green]#F#[fg=default]"
set-window-option -g window-status-attr           bold
set-window-option -g window-status-fg             colour025
set-window-option -g window-status-bg             colour235
set-window-option -g window-status-current-format "#[fg=colour031,bold]{#[fg=green,bold]#I:#W#[fg=colour031,bold]}#[fg=default]"
set-window-option -g window-status-bell-attr      bold
set-window-option -g window-status-bell-fg        red
set-window-option -g window-status-bell-bg        default

# Key bindings
bind-key -r M-v resize-pane -U
bind-key -r C-v resize-pane -D
bind-key -r C-a resize-pane -L
bind-key -r C-e resize-pane -R
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<