Check-in [6298520d4f]

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

Overview
SHA1:6298520d4f3ce0da7f8c9a51ac8ffb8b25894ab3
Date: 2017-03-15 17:27:47
User: cfuhrman
Comment:(emacs.d/init.el) - Highlight 'LATER' in program files - Rewrite keyboard macros I use - install and configure osx-location[1] - Enhance sql-mode - Use nice-prog-hook when editing JSON files - Use PSR2 format[2] for editing PHP files - Do not defer installation of yaml mode - Only load vc-fossil on versions of Emacs < v25 as it is broken[3] - [org] List delegated files in refile report - [org] Add additional files to org-agenda-files (bashrc) - Add alias for PHP Codesniffer that uses PSR2[2] standard - Add support for go language development (bash*, functions) - Use new function naming convention for functions that are sourced from other files to prevent potential namespace collisions (git scripts) - Update git scripts to v2.8.4 (global-excludes) - Exclude tramp directory - Exclude network security directory Footnotes: [1] https://github.com/purcell/osx-location [2] https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md [3] http://chiselapp.com/user/venks/repository/emacs-fossil/info/eb08c005fa5b6af3
Tags And Properties
Context
2017-03-15
18:00
[77f676b6a0] Regenerate documentation (user: cfuhrman, tags: trunk)
17:27
[6298520d4f] (emacs.d/init.el) - Highlight 'LATER' in program files - Rewrite keyboard macros I use - install and configure osx-location[1] - Enhance sql-mode - Use nice-prog-hook when editing JSON files - Use PSR2 format[2] for editing PHP files - Do not defer installation of yaml mode - Only load vc-fossil on versions of Emacs < v25 as it is broken[3] - [org] List delegated files in refile report - [org] Add additional files to org-agenda-files (bashrc) - Add alias for PHP Codesniffer that uses PSR2[2] standard - Add support for go language development (bash*, functions) - Use new function naming convention for functions that are sourced from other files to prevent potential namespace collisions (git scripts) - Update git scripts to v2.8.4 (global-excludes) - Exclude tramp directory - Exclude network security directory Footnotes: [1] https://github.com/purcell/osx-location [2] https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md [3] http://chiselapp.com/user/venks/repository/emacs-fossil/info/eb08c005fa5b6af3 (user: cfuhrman, tags: trunk, v2017.03)
2016-05-02
17:20
[0585983024] Sync to 501f0d77e4 from personal repo README.md: - Regenerate Bash: - Pre-pend additional directories instead of appending them. This way, I can set, for example, /usr/local/bin to be in front of $PATH - Re-order searched paths to taste Emacs: - Do not byte-recompile all contents of ~/.emacs.d as this causes issues with use-package - Obfuscate latitude & longitude - Obfuscate forecast-api-key (the old one has been invalidated, don't bother using it) - Set tramp default method to ssh - Commenting - Install and configure beacon-mode[1] - Install and configure darktooth theme[2] for non-console modes - Add additional counsel key bindings - Instll and configure osx-specific modes - Switch to using built-in global-prettify-symbols-mode for Emacs versions that have it installed, otherwise continue to use pretty-lambdada mode. - Install sudo-edit[3] - Do not enable ac-emoji mode for log-edit-mode - Switch org-refile-use-outline-path to nil as this was causing issues with refiling tasks under org-mode w/ swiper Git: - Update git-completion scripts to those provided by git v2.6.4, the version of git as shipped with Apple XCode v7.3 Footnotes: [1] https://github.com/Malabarba/beacon [2] https://github.com/emacsfodder/emacs-theme-darktooth [3] http://emacsredux.com/blog/2013/04/21/edit-files-as-root/ (user: cfuhrman, tags: trunk, v2016.05)
Changes

Changes to bashrc.

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
..
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
...
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
...
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
...
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
export GPG_TTY=$(tty)

# Setting for Pine/Alpine remote config
PINE_REMOTE_CONFIG="{mail.example.com/ssl/novalidate-cert/user=cfuhrman@example.com}INBOX.in-my-alpine-config"

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

# Function: setBrowser
#
# Sets BROWSER environment variable
#
# Order of preference:
#
#  * firefox
#  * galeon
#  * konqueror
#  * mozilla
#  * w3m
#  * elinks
#  * lynx

setBrowser ()
{

        # Set preferred browsers in order of evaluation
        browsers=('firefox'                     \
                  'galeon'                      \
                  'epiphany'                    \
                  'konqueror'                   \
................................................................................
                        break;
                fi

        done

        export BROWSER

} # setBrowser()

# Function: setEditor
#
# Sets EDITOR environment variable
#
# Order of preference:
#
#  * emacs
#  * mg
#  * nano
#  * vim
#  * vi (if all else fails)

setEditor ()
{

        # Set preferred editors in order of evaluation
        editors=('emacs'                        \
                 'mg'                           \
                 'nano'                         \
                 'vim'                          \
................................................................................
        # Should the editor be emacs(1), make sure we use console
        # mode, but only if this isn't SunOS (which has issues with
        # the '-nw' flag)
        if [[ ${EDITOR} == 'emacs' && ${OSTYPE} != 'SunOS' ]]; then
                EDITOR='emacs -nw'
        fi

} # setEditor()

# Function: setPager
#
# Sets PAGER environment variable
#
# Order of preference:
#
#  * less
#  * view
#  * more

setPager ()
{

        # Should this be an emacs terminal, then set $PAGER to 'cat' since
        # emacs will do our paging for us
        if [ $TERM == 'dumb' ] || [ $TERM == 'emacs' ]; then
                PAGER='cat'
        else
................................................................................

                done

       fi

        export PAGER

} # setPager()

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

# Source global definitions file
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
................................................................................
        alias no256='export TERM=xterm'
fi

# Alias for fossil
if type -p fossil >/dev/null; then
        alias fl="fossil"
fi










# Program defaults
# --------------------------------------------------------------------

# Determine browser
setBrowser

# Determine editor
setEditor

# Determine pager
setPager

# Bash Command History
# --------------------------------------------------------------------

# Do *not* append the following to our history: consecutive duplicate
# commands, ls, bg and fg, and exit
HISTIGNORE='\&:fg:bg:ls:pwd:cd ..:cd ~-:cd -:cd:jobs:set -x:ls -l:ls -l'







|













|







 







|

|











|







 







|

|









|







 







|







 







>
>
>
>
>
>
>
>
>





|


|


|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
..
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
...
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
...
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
...
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
export GPG_TTY=$(tty)

# Setting for Pine/Alpine remote config
PINE_REMOTE_CONFIG="{mail.example.com/ssl/novalidate-cert/user=cfuhrman@example.com}INBOX.in-my-alpine-config"

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

# Function: __sp_bashrc_set_browser
#
# Sets BROWSER environment variable
#
# Order of preference:
#
#  * firefox
#  * galeon
#  * konqueror
#  * mozilla
#  * w3m
#  * elinks
#  * lynx

__sp_bashrc_set_browser ()
{

        # Set preferred browsers in order of evaluation
        browsers=('firefox'                     \
                  'galeon'                      \
                  'epiphany'                    \
                  'konqueror'                   \
................................................................................
                        break;
                fi

        done

        export BROWSER

} # __sp_bashrc_set_browser()

# Function: __sp_bashrc_set_editor
#
# Sets EDITOR environment variable
#
# Order of preference:
#
#  * emacs
#  * mg
#  * nano
#  * vim
#  * vi (if all else fails)

__sp_bashrc_set_editor ()
{

        # Set preferred editors in order of evaluation
        editors=('emacs'                        \
                 'mg'                           \
                 'nano'                         \
                 'vim'                          \
................................................................................
        # Should the editor be emacs(1), make sure we use console
        # mode, but only if this isn't SunOS (which has issues with
        # the '-nw' flag)
        if [[ ${EDITOR} == 'emacs' && ${OSTYPE} != 'SunOS' ]]; then
                EDITOR='emacs -nw'
        fi

} # __sp_bashrc_set_editor()

# Function: __sp_bashrc_set_pager
#
# Sets PAGER environment variable
#
# Order of preference:
#
#  * less
#  * view
#  * more

__sp_bashrc_set_pager ()
{

        # Should this be an emacs terminal, then set $PAGER to 'cat' since
        # emacs will do our paging for us
        if [ $TERM == 'dumb' ] || [ $TERM == 'emacs' ]; then
                PAGER='cat'
        else
................................................................................

                done

       fi

        export PAGER

} # __sp_bashrc_set_pager()

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

# Source global definitions file
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
................................................................................
        alias no256='export TERM=xterm'
fi

# Alias for fossil
if type -p fossil >/dev/null; then
        alias fl="fossil"
fi

# Aliases for PHP CodeSniffer
if type -p phpcs >/dev/null; then
	alias phpcs='phpcs --standard=PSR2'
fi

if type -p phpcbf >/dev/null; then
	alias phpcbf='phpcbf --standard=PSR2'
fi

# Program defaults
# --------------------------------------------------------------------

# Determine browser
__sp_bashrc_set_browser

# Determine editor
__sp_bashrc_set_editor

# Determine pager
__sp_bashrc_set_pager

# Bash Command History
# --------------------------------------------------------------------

# Do *not* append the following to our history: consecutive duplicate
# commands, ls, bg and fg, and exit
HISTIGNORE='\&:fg:bg:ls:pwd:cd ..:cd ~-:cd -:cd:jobs:set -x:ls -l:ls -l'

Changes to emacs.d/init.el.

83
84
85
86
87
88
89
90
91
92
93
94
95

96

97
98
99
100
101
102
103
...
148
149
150
151
152
153
154







155
156
157
158
159
160
161
...
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
...
321
322
323
324
325
326
327
















































328
329
330
331
332
333
334
...
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
...
510
511
512
513
514
515
516

















517
518
519
520
521
522
523
...
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
...
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
...
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681




682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
...
730
731
732
733
734
735
736
737
738
739
740
741



742
743
744
745
746
747


748
749
750
751
752
753
754
...
800
801
802
803
804
805
806

807
808
809
810
811
812
813
814
815

816
817
818
819
820
821
822
...
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
...
887
888
889
890
891
892
893




894
895
896
897
898
899
900
901
902
903
 '(cperl-highlight-variables-indiscriminately t)
 '(cperl-indent-level 8)
 '(custom-enabled-themes (quote (twilight)))
 '(delete-selection-mode nil)
 '(diff-switches "-u")
 '(dired-listing-switches "-alh")
 '(dired-use-ls-dired (quote unspecified))
 '(flycheck-disabled-checkers (quote (php-phpcs)))
 '(display-time-mode t)
 '(emerge-combine-versions-template "
%b
%a
")

 '(flycheck-highlighting-mode 'lines)

 '(forecast-latitude cmf-latitude)
 '(forecast-longitude cmf-longitude)
 '(forecast-city cmf-location-name)
 '(forecast-country "United States")
 '(forecast-units 'us)
 '(forecast-api-key "set-your-own-key") ; Get your own key from https://developer.forecast.io/
 '(global-hl-line-mode t)
................................................................................

(load custom-file)


;; Programming styles
;; --------------------------------------------------------------------








;; OpenBSD Coding Style
(c-add-style "openbsd"
             '("bsd"
               (c-backspace-function . delete-backward-char)
               (c-syntactic-indentation-in-macros . nil)
               (c-tab-always-indent . nil)
               (c-hanging-braces-alist
................................................................................
(defalias 'perl-mode 'cperl-mode)


;; Macros
;; --------------------------------------------------------------------

(fset 'align-on-equal
      (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([134217848 97 108 105 103 110 45 114 101 103 101 120 112 return 61 return] 0 "%d")) arg)))

(fset 'align-on-hash-arrow
      (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([134217848 97 108 105 103 110 45 114 101 103 101 120 return 61 62 return] 0 "%d")) arg)))


;; Keyboard Bindings
;; --------------------------------------------------------------------

;; Custom key bindings for commonly used commands
(global-set-key [?\C-x ?\C-k ?0] 'normal-erase-is-backspace-mode)
................................................................................
(eval-when-compile
  (require 'use-package))
(require 'diminish)
(require 'bind-key)

;; Packages loaded through external files
(require 'cmf-org-settings)

















































;; apache-mode
(use-package apache-mode
  :ensure t
  :defer t
  :no-require t
  :mode (("\\.htaccess\\'"                   . apache-mode)
................................................................................
;; cc-mode
(use-package cc-mode
  :config
  (add-hook 'c-mode-common-hook 'nice-prog-hook)
  (add-hook 'c-mode-common-hook
            (lambda ()
              (font-lock-add-keywords nil
                                      '(("\\<\\(FIXME\\|TODO\\|BUG\\):" 1 font-lock-warning-face t)))))
  )

;; [c]perl-mode
(use-package cperl-mode
  :config
  (add-hook 'cperl-mode-hook 'nice-prog-hook)
  (add-hook 'cperl-mode-hook
            (lambda ()
              (font-lock-add-keywords nil
                                      '(("\\<\\(FIXME\\|TODO\\|BUG\\):" 1 font-lock-warning-face t)))))

  :mode ("\\.cgi\\'" . cperl-mode)
  )

;; crontab-mode
(use-package crontab-mode
  :ensure t
................................................................................
         ("C-c j"   . counsel-git-grep)
         ("C-x l"   . counsel-locate)
         )

  :init
  (ivy-mode 1)
  )


















;; lisp-mode
(use-package lisp-mode
  :config
  ;; Define a basic hook for Emacs lisp files
  (defun nice-elisp-hook ()
    "Hook for sane editing of Lisp files."
................................................................................
    )

  (add-hook 'emacs-lisp-mode-hook 'nice-prog-hook)
  (add-hook 'emacs-lisp-mode-hook 'nice-elisp-hook)
  (add-hook 'emacs-lisp-mode-hook
            (lambda ()
              (font-lock-add-keywords nil
                                      '(("\\<\\(FIXME\\|TODO\\|BUG\\):" 1 font-lock-warning-face t)))))
  )

;; log-edit-mode
(use-package log-edit
  :init
  (add-hook 'log-edit-mode-hook 'nice-text-hook)
  (add-hook 'log-edit-mode-hook 'turn-on-orgstruct++)
................................................................................
  ;; Org-mode hooks
  (add-hook 'org-mode-hook 'nice-text-hook)
  (add-hook 'org-mode-hook 'nice-org-hook)
  (add-hook 'org-mode-hook 'ac-emoji-setup)
  (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
  )

;; OSX Modes (Mac OS X only)
(when (eq system-type 'darwin)

  ;; osx-lib
  (use-package osx-lib
    :ensure t
    )

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

    :init
    (setq delete-by-moving-to-trash t)

    :config
    (osx-trash-setup)
    )
  )

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

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

  :config
  ;; Define a nice hook for editing php files
  (defun nice-php-hook()
    "Hook for sane editing of PHP files."
    (c-set-style "cmf")
    (if (package-installed-p 'php-auto-yasnippets)
        (define-key php-mode-map (kbd "C-c C-y") 'yas/create-php-snippet))
    (if (package-installed-p 'mmm-mode)
        (mmm-mode t))
    (define-key php-mode-map (kbd "C-x p") 'phpdoc)
    )

  ;; For PHP files
  (add-hook 'php-mode-hook 'nice-php-hook)





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

  ;; Set up mmm-mode
  (require 'mmm-auto)
  (setq mmm-global-mode 'maybe)
  (mmm-add-mode-ext-class 'html-mode "\\.php\\'" 'html-php)

  )

;; pretty-lambdada
(if (version< emacs-version "24.4")
    (use-package pretty-lambdada
      :ensure t
      :defer t
................................................................................
;; sh-script
(use-package sh-script
  :config
  (add-hook 'sh-mode-hook 'nice-prog-hook)
  (add-hook 'sh-mode-hook
            (lambda ()
              (font-lock-add-keywords nil
                                      '(("\\<\\(FIXME\\|TODO\\|BUG\\):" 1 font-lock-warning-face t)))))
  )

;; sql
(use-package sql



  :config
  ;; Define a nice hook for editing SQL files
  (defun nice-sql-hook ()
    "Hook for sane editing of SQL files."
    (if (>= emacs-major-version 23)
        (linum-mode t))


    (auto-fill-mode t)
    (electric-pair-mode t)
    )

  (add-hook 'sql-mode-hook 'nice-sql-hook)
  )

................................................................................

;; undo-tree
(use-package undo-tree
  :ensure t
  )

;; vc-fossil

(use-package vc-fossil
  :ensure t
  :defer t

  :init
  (require 'vc-fossil)

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

  )

;; which-func
(use-package which-func
  :no-require t
  :config
  (custom-set-faces
................................................................................
(use-package xkcd
  :ensure t
  )

;; yaml-mode
(use-package yaml-mode
  :ensure t
  :defer t

  :mode ("\\.sls\\'" . yaml-mode)
  :config
  (add-hook 'yaml-mode-hook 'nice-prog-hook)
  )

(use-package yasnippet
................................................................................
              (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
              (define-key yas/keymap [tab] 'yas/next-field)))

  ;; Wrap around region
  (setq yas-wrap-around-region t)
  )





;; Diminished functions
(diminish 'ivy-mode "")
(diminish 'yas-minor-mode " Y")
(diminish 'undo-tree-mode " UT")

;; Do some byte recompilation
(byte-recompile-directory (expand-file-name "~/.emacs.d/thirdparty") 0)
(byte-recompile-directory (expand-file-name "~/.emacs.d/lisp") 0)

;;; init.el ends here







<





>

>







 







>
>
>
>
>
>
>







 







|


|







 







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







 







|









|







 







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







 







|







 







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



<







 







|


<
<





>
>
>
>




<
<
<
<
<







 







|




>
>
>






>
>







 







>
|
|
|

|
|

|
|
>







 







<







 







>
>
>
>










83
84
85
86
87
88
89

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
...
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
...
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
...
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
...
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
...
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
...
700
701
702
703
704
705
706




















707
708
709

710
711
712
713
714
715
716
...
717
718
719
720
721
722
723
724
725
726


727
728
729
730
731
732
733
734
735
736
737
738
739





740
741
742
743
744
745
746
...
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
...
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
...
891
892
893
894
895
896
897

898
899
900
901
902
903
904
...
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
 '(cperl-highlight-variables-indiscriminately t)
 '(cperl-indent-level 8)
 '(custom-enabled-themes (quote (twilight)))
 '(delete-selection-mode nil)
 '(diff-switches "-u")
 '(dired-listing-switches "-alh")
 '(dired-use-ls-dired (quote unspecified))

 '(display-time-mode t)
 '(emerge-combine-versions-template "
%b
%a
")
 '(flycheck-disabled-checkers (quote (php-phpcs)))
 '(flycheck-highlighting-mode 'lines)
 '(flycheck-phpcs-standard "PSR2")
 '(forecast-latitude cmf-latitude)
 '(forecast-longitude cmf-longitude)
 '(forecast-city cmf-location-name)
 '(forecast-country "United States")
 '(forecast-units 'us)
 '(forecast-api-key "set-your-own-key") ; Get your own key from https://developer.forecast.io/
 '(global-hl-line-mode t)
................................................................................

(load custom-file)


;; Programming styles
;; --------------------------------------------------------------------

;; Shipwire Coding Style
(c-add-style "psr2"
            '("psr2"
              (c-offsets-alist . (
                                  (statement-cont . (first c-lineup-cascaded-calls +))
                                  ))))

;; OpenBSD Coding Style
(c-add-style "openbsd"
             '("bsd"
               (c-backspace-function . delete-backward-char)
               (c-syntactic-indentation-in-macros . nil)
               (c-tab-always-indent . nil)
               (c-hanging-braces-alist
................................................................................
(defalias 'perl-mode 'cperl-mode)


;; Macros
;; --------------------------------------------------------------------

(fset 'align-on-equal
   [?\M-x ?a ?l ?i ?g ?n ?- ?r ?e ?g tab return ?= return])

(fset 'align-on-hash-arrow
   [?\M-x ?a ?l ?i ?g ?n ?- ?r ?e ?g tab return ?= ?> return])


;; Keyboard Bindings
;; --------------------------------------------------------------------

;; Custom key bindings for commonly used commands
(global-set-key [?\C-x ?\C-k ?0] 'normal-erase-is-backspace-mode)
................................................................................
(eval-when-compile
  (require 'use-package))
(require 'diminish)
(require 'bind-key)

;; Packages loaded through external files
(require 'cmf-org-settings)

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

(when (eq system-type 'darwin)

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

    :config
    (osx-location-watch)
    (add-hook 'osx-location-changed-hook
              (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)
                      )
                )
              )
    )

  ;; osx-lib
  (use-package osx-lib
    :ensure t
    )

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

    :init
    (setq delete-by-moving-to-trash t)

    :config
    (osx-trash-setup)
    )
  )

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

;; apache-mode
(use-package apache-mode
  :ensure t
  :defer t
  :no-require t
  :mode (("\\.htaccess\\'"                   . apache-mode)
................................................................................
;; cc-mode
(use-package cc-mode
  :config
  (add-hook 'c-mode-common-hook 'nice-prog-hook)
  (add-hook 'c-mode-common-hook
            (lambda ()
              (font-lock-add-keywords nil
                                      '(("\\<\\(FIXME\\|TODO\\|BUG\\|LATER\\):" 1 font-lock-warning-face t)))))
  )

;; [c]perl-mode
(use-package cperl-mode
  :config
  (add-hook 'cperl-mode-hook 'nice-prog-hook)
  (add-hook 'cperl-mode-hook
            (lambda ()
              (font-lock-add-keywords nil
                                      '(("\\<\\(FIXME\\|TODO\\|BUG\\|LATER\\):" 1 font-lock-warning-face t)))))

  :mode ("\\.cgi\\'" . cperl-mode)
  )

;; crontab-mode
(use-package crontab-mode
  :ensure t
................................................................................
         ("C-c j"   . counsel-git-grep)
         ("C-x l"   . counsel-locate)
         )

  :init
  (ivy-mode 1)
  )

;; jinja2-mode
(use-package jinja2-mode
  :ensure t
  :defer t
  :mode ("\\.j2\\'" . jinja2-mode)
  
  )

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

  :config
  ;; Associated JSON files with nice-prog-hook
  (add-hook 'json-mode-hook 'nice-prog-hook)
  )

;; lisp-mode
(use-package lisp-mode
  :config
  ;; Define a basic hook for Emacs lisp files
  (defun nice-elisp-hook ()
    "Hook for sane editing of Lisp files."
................................................................................
    )

  (add-hook 'emacs-lisp-mode-hook 'nice-prog-hook)
  (add-hook 'emacs-lisp-mode-hook 'nice-elisp-hook)
  (add-hook 'emacs-lisp-mode-hook
            (lambda ()
              (font-lock-add-keywords nil
                                      '(("\\<\\(FIXME\\|TODO\\|BUG\\|LATER\\):" 1 font-lock-warning-face t)))))
  )

;; log-edit-mode
(use-package log-edit
  :init
  (add-hook 'log-edit-mode-hook 'nice-text-hook)
  (add-hook 'log-edit-mode-hook 'turn-on-orgstruct++)
................................................................................
  ;; Org-mode hooks
  (add-hook 'org-mode-hook 'nice-text-hook)
  (add-hook 'org-mode-hook 'nice-org-hook)
  (add-hook 'org-mode-hook 'ac-emoji-setup)
  (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
  )





















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

  :ensure php-mode
  :ensure php-auto-yasnippets
  :ensure php-eldoc
  :ensure php-extras
  :ensure phpcbf
  :ensure phpunit

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

  :config
  ;; Define a nice hook for editing php files
  (defun nice-php-hook()
    "Hook for sane editing of PHP files."
    (c-set-style "psr2")
    (if (package-installed-p 'php-auto-yasnippets)
        (define-key php-mode-map (kbd "C-c C-y") 'yas/create-php-snippet))


    (define-key php-mode-map (kbd "C-x p") 'phpdoc)
    )

  ;; For PHP files
  (add-hook 'php-mode-hook 'nice-php-hook)
  (add-hook 'php-mode-hook
            (lambda ()
              (font-lock-add-keywords nil
                                      '(("\\<\\(FIXME\\|TODO\\|BUG\\|LATER\\)" 1 font-lock-warning-face t)))))

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






  )

;; pretty-lambdada
(if (version< emacs-version "24.4")
    (use-package pretty-lambdada
      :ensure t
      :defer t
................................................................................
;; sh-script
(use-package sh-script
  :config
  (add-hook 'sh-mode-hook 'nice-prog-hook)
  (add-hook 'sh-mode-hook
            (lambda ()
              (font-lock-add-keywords nil
                                      '(("\\<\\(FIXME\\|TODO\\|BUG\\|LATER\\):" 1 font-lock-warning-face t)))))
  )

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

  :config
  ;; Define a nice hook for editing SQL files
  (defun nice-sql-hook ()
    "Hook for sane editing of SQL files."
    (if (>= emacs-major-version 23)
        (linum-mode t))
    (if (package-installed-p 'undo-tree)
        (undo-tree-mode t))
    (auto-fill-mode t)
    (electric-pair-mode t)
    )

  (add-hook 'sql-mode-hook 'nice-sql-hook)
  )

................................................................................

;; undo-tree
(use-package undo-tree
  :ensure t
  )

;; vc-fossil
(if (< emacs-major-version 25)
    (use-package vc-fossil
      :ensure t
      :defer t

      :init
      (require 'vc-fossil)

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

;; which-func
(use-package which-func
  :no-require t
  :config
  (custom-set-faces
................................................................................
(use-package xkcd
  :ensure t
  )

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


  :mode ("\\.sls\\'" . yaml-mode)
  :config
  (add-hook 'yaml-mode-hook 'nice-prog-hook)
  )

(use-package yasnippet
................................................................................
              (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
              (define-key yas/keymap [tab] 'yas/next-field)))

  ;; Wrap around region
  (setq yas-wrap-around-region t)
  )


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

;; Diminished functions
(diminish 'ivy-mode "")
(diminish 'yas-minor-mode " Y")
(diminish 'undo-tree-mode " UT")

;; Do some byte recompilation
(byte-recompile-directory (expand-file-name "~/.emacs.d/thirdparty") 0)
(byte-recompile-directory (expand-file-name "~/.emacs.d/lisp") 0)

;;; init.el ends here

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

37
38
39
40
41
42
43




44
45
46
47
48
49
50
..
62
63
64
65
66
67
68
69


70
71
72
73
74
75
76
                ("~/org/from-mobile.org" "~/org/refile.org")))))
       (todo "STARTED"
             ((org-agenda-files
               (quote
                ("~/org/from-mobile.org" "~/org/refile.org")))))
       (todo "WAITING"
             ((org-agenda-files




               (quote
                ("~/org/from-mobile.org" "~/org/refile.org")))))))
     ("B" "GTD (B)lock Agenda"
      ((tags-todo "OFFICE")
       (tags-todo "GGG")
       (tags-todo "HOME"))
      nil)
................................................................................
         ("+OFFICE")))))
     ("G" "G.G. Guards Agenda"
      ((agenda "")
       (tags-todo "GGG"))
      ((org-agenda-tag-filter-preset
        (quote
         ("+GGG"))))))))
 '(org-agenda-files (quote ("~/org/tasks.org")))


 '(org-ascii-charset (quote utf-8))
 '(org-archive-location "~/org/archive/%s_archive::datetree/")
 '(org-capture-templates
   (quote
    (("t" "Task" entry
      (file+headline "~/org/refile.org" "New Tasks")
      "* TODO %^{Description}  %^G







>
>
>
>







 







|
>
>







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
..
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
                ("~/org/from-mobile.org" "~/org/refile.org")))))
       (todo "STARTED"
             ((org-agenda-files
               (quote
                ("~/org/from-mobile.org" "~/org/refile.org")))))
       (todo "WAITING"
             ((org-agenda-files
               (quote
                ("~/org/from-mobile.org" "~/org/refile.org")))))
       (todo "DELEGATED"
             ((org-agenda-files
               (quote
                ("~/org/from-mobile.org" "~/org/refile.org")))))))
     ("B" "GTD (B)lock Agenda"
      ((tags-todo "OFFICE")
       (tags-todo "GGG")
       (tags-todo "HOME"))
      nil)
................................................................................
         ("+OFFICE")))))
     ("G" "G.G. Guards Agenda"
      ((agenda "")
       (tags-todo "GGG"))
      ((org-agenda-tag-filter-preset
        (quote
         ("+GGG"))))))))
 '(org-agenda-files
   (quote
    ("~/org/tasks.org" "~/org/refile.org" "~/org/notes.org")))
 '(org-ascii-charset (quote utf-8))
 '(org-archive-location "~/org/archive/%s_archive::datetree/")
 '(org-capture-templates
   (quote
    (("t" "Task" entry
      (file+headline "~/org/refile.org" "New Tasks")
      "* TODO %^{Description}  %^G

Changes to global-excludes.

14
15
16
17
18
19
20


21
22
docs/*.org
elpa/
eshell/
ext/
ido.last
org-clock-save.el
recentf


url/
xkcd/







>
>


14
15
16
17
18
19
20
21
22
23
24
docs/*.org
elpa/
eshell/
ext/
ido.last
org-clock-save.el
recentf
network-security.data/
tramp/
url/
xkcd/

Changes to setup.sh.

37
38
39
40
41
42
43


44
45
46
47
48
49
50
...
138
139
140
141
142
143
144
145

146





147




148
149
150
151
152
153
154
...
198
199
200
201
202
203
204








205
206
207
208
209
210
211
...
221
222
223
224
225
226
227








































228
229
230
231
232
233
234
...
293
294
295
296
297
298
299

300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
...
338
339
340
341
342
343
344




345
346
347
348
349
350
351
...
427
428
429
430
431
432
433





434
435
436
437
438
439
440
RSYNC_EXCLUDE=global-excludes
RSYNC_OPTS="-Ccav --delete --exclude-from=${RSYNC_EXCLUDE}"
MAKE=make
COPYRIGHT='Copyright (c) 2000-2016 Christopher M. Fuhrman'
OUTPUTSPACING=55
DRYRUN=""
UNINSTALL=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

................................................................................
        echo -ne "${NORMAL}"
        cat <<EOF
--------------------------------------------------------------------

You are about to uninstall ShellPAK.  Are you SURE you want to do
this?

====================================================================







EOF





        select opt in Yes No
        do
                # Bash versions >= 4.0 support doing ${opt^^} to get uppercase.
                # Unfortunately, Apple still insists on shipping Bash 3.something
                # in OS X, so use tr(1) to make $opt uppercase.
                case $( echo $opt | tr '[:lower:]' '[:upper:]' ) in
................................................................................
                                fi

                        fi

                fi

        done









        # Restore .emacs file if it exists
        if [ -f ${BACKUPDIR}/.emacs ]; then
            inform $L2 $FALSE "Restoring original .emacs"
            mv ${BACKUPDIR}/.emacs ${HOME}
            echo "${GREEN}done${NORMAL}"
        fi
................................................................................
                echo -e "${GREEN}done${NORMAL}"
        fi

        echo ''
        echo "${BOLD}ShellPAK${NORMAL} removed from the home directory of ${USER} on ${CYAN}${HOSTNAME}${NORMAL}!"

} # doUninstall()









































# Function: headerDisplay
#
# Displays a header for the world to see

headerDisplay ()
{
................................................................................

        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                     \\

                -u Uninstall ShellPAK                      \\
                -r perform a trial run with no changes made
                   (implies -n)

STDERR

} # usage()


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

headerDisplay

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

set -- $args

while [ $# -gt 0 ]
do

        case "$1" in
................................................................................
                inform $L1 $TRUE 'DRY-RUN: No changes will be propagated'
                ;;

        -b)
                BACKUPDIR=$2; shift;
                inform $L1 $TRUE "Existing files to be backed up in ${BACKUPDIR}"
                ;;





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

        --)
................................................................................
        # Now rsync(1) things over
        inform $L1 $TRUE "Synchronize ${SHELLDIR}"
        ${RSYNC} ${DRYRUN} ${RSYNC_OPTS} . ${SHELLDIR}

else
        inform $L1 $TRUE 'Synchronization not necessary'
fi






# Set up appropriate symlinks
if [ ${NOLINK} -ne 1 ]; then

        # Set up links
        for file in ${HOMEDOTFILES[@]}; do








>
>







 







<
>

>
>
>
>
>

>
>
>
>







 







>
>
>
>
>
>
>
>







 







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







 







>













|







 







>
>
>
>







 







>
>
>
>
>







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
...
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
...
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
...
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
...
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
...
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
...
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
RSYNC_EXCLUDE=global-excludes
RSYNC_OPTS="-Ccav --delete --exclude-from=${RSYNC_EXCLUDE}"
MAKE=make
COPYRIGHT='Copyright (c) 2000-2016 Christopher M. Fuhrman'
OUTPUTSPACING=55
DRYRUN=""
UNINSTALL=0
GOINSTALL=0
GOPATH=${HOME}/go
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

................................................................................
        echo -ne "${NORMAL}"
        cat <<EOF
--------------------------------------------------------------------

You are about to uninstall ShellPAK.  Are you SURE you want to do
this?


EOF

	if [[ -d ${GOPATH} && $GOINSTALL -ne 0 ]]; then
		cat <<EOF
Note that contents in ${GOPATH} will be removed as well!!!!
Better save it before continuing!

EOF
	fi

	echo '===================================================================='
	echo ''

        select opt in Yes No
        do
                # Bash versions >= 4.0 support doing ${opt^^} to get uppercase.
                # Unfortunately, Apple still insists on shipping Bash 3.something
                # in OS X, so use tr(1) to make $opt uppercase.
                case $( echo $opt | tr '[:lower:]' '[:upper:]' ) in
................................................................................
                                fi

                        fi

                fi

        done

	if [ $GOINSTALL -ne 0 ]; then
		inform $L2 $FALSE \
		       "Removing go environment"

		rm -rf ${GOPATH}
		echo "${GREEN}done${NORMAL}"
	fi

        # Restore .emacs file if it exists
        if [ -f ${BACKUPDIR}/.emacs ]; then
            inform $L2 $FALSE "Restoring original .emacs"
            mv ${BACKUPDIR}/.emacs ${HOME}
            echo "${GREEN}done${NORMAL}"
        fi
................................................................................
                echo -e "${GREEN}done${NORMAL}"
        fi

        echo ''
        echo "${BOLD}ShellPAK${NORMAL} removed from the home directory of ${USER} on ${CYAN}${HOSTNAME}${NORMAL}!"

} # doUninstall()

# Function: goSetup
#
# Sets up directory structure for the go programming language

goSetup ()
{
	local GOBIN=${GOPATH}/bin
	local GOSRC=${GOPATH}/src
	local GOGITHUB=${GOSRC}/github.com

	if [ -d $GOPATH ]; then
		inform $L1 $TRUE \
		       "Go development has already been set up"
		return
	fi

	inform $L1 $TRUE "Setting up development environment for golang"

	# Note we assume the github username is the same as the login
	# name.
	local goSetup_git_user=${GITHUB_USER_NAME:=${USER}}

	# Create the directories
	for goDir in $GOPATH $GOBIN $GOSRC $GOGITHUB
	do
		mkdir -p $goDir
	done

	if [ ! -d ${GOGITHUB}/$goSetup_git_user ]; then
		mkdir ${GOGITHUB}/$goSetup_git_user
	fi

	inform $L2 $TRUE "Environment set up for golang"

	if ! type -p go >/dev/null; then
		inform $L2 $TRUE \
		       "${BOLD}$YELLOW}NOTICE:${NORMAL} Go binary not found in path"
	fi
}

# Function: headerDisplay
#
# Displays a header for the world to see

headerDisplay ()
{
................................................................................

        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        \\
                -u Uninstall ShellPAK                      \\
                -r perform a trial run with no changes made
                   (implies -n)

STDERR

} # usage()


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

headerDisplay

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

set -- $args

while [ $# -gt 0 ]
do

        case "$1" in
................................................................................
                inform $L1 $TRUE 'DRY-RUN: No changes will be propagated'
                ;;

        -b)
                BACKUPDIR=$2; shift;
                inform $L1 $TRUE "Existing files to be backed up in ${BACKUPDIR}"
                ;;

	-g)
		GOINSTALL=1
		;;

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

        --)
................................................................................
        # Now rsync(1) things over
        inform $L1 $TRUE "Synchronize ${SHELLDIR}"
        ${RSYNC} ${DRYRUN} ${RSYNC_OPTS} . ${SHELLDIR}

else
        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

# Set up appropriate symlinks
if [ ${NOLINK} -ne 1 ]; then

        # Set up links
        for file in ${HOMEDOTFILES[@]}; do

Changes to thirdparty/git-completion.bash.

6
7
8
9
10
11
12

13
14
15
16
17
18
19
...
659
660
661
662
663
664
665

666
667
668
669
670
671
672
....
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
....
1306
1307
1308
1309
1310
1311
1312

1313
1314
1315
1316
1317
1318
1319
....
1681
1682
1683
1684
1685
1686
1687

1688
1689



1690
1691
1692
1693
1694
1695
1696
....
1707
1708
1709
1710
1711
1712
1713









1714
1715
1716
1717
1718
1719
1720
....
1730
1731
1732
1733
1734
1735
1736






1737
1738
1739
1740
1741
1742
1743
....
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
....
2034
2035
2036
2037
2038
2039
2040

2041
2042
2043
2044
2045
2046
2047
....
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
....
2382
2383
2384
2385
2386
2387
2388



2389
2390








2391
2392
2393
2394
2395
2396
2397
2398
#
# The contained completion routines provide support for completing:
#
#    *) local and remote branch names
#    *) local and remote tag names
#    *) .git/remotes file names
#    *) git 'subcommands'

#    *) tree paths within 'ref:path/to/file' expressions
#    *) file paths within current working directory and index
#    *) common --long-options
#
# To use these routines:
#
#    1) Copy this file to somewhere (e.g. ~/.git-completion.bash).
................................................................................
		archimport)       : import;;
		cat-file)         : plumbing;;
		check-attr)       : plumbing;;
		check-ignore)     : plumbing;;
		check-mailmap)    : plumbing;;
		check-ref-format) : plumbing;;
		checkout-index)   : plumbing;;

		commit-tree)      : plumbing;;
		count-objects)    : infrequent;;
		credential)       : credentials;;
		credential-*)     : credentials helper;;
		cvsexportcommit)  : export;;
		cvsimport)        : import;;
		cvsserver)        : daemon;;
................................................................................
			--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
			--dirstat --dirstat= --dirstat-by-file
			--dirstat-by-file= --cumulative
			--diff-algorithm=
"

_git_diff ()
{
................................................................................
	--*)
		__gitcomp "
			--cached
			--text --ignore-case --word-regexp --invert-match
			--full-name --line-number
			--extended-regexp --basic-regexp --fixed-strings
			--perl-regexp

			--files-with-matches --name-only
			--files-without-match
			--max-depth
			--count
			--and --or --not --all-match
			"
		return
................................................................................
		;;
	--*)
		__gitcomp "
			--onto --merge --strategy --interactive
			--preserve-merges --stat --no-stat
			--committer-date-is-author-date --ignore-date
			--ignore-whitespace --whitespace=

			--autosquash --fork-point --no-fork-point
			--autostash



			"

		return
	esac
	__gitcomp_nl "$(__git_refs)"
}

................................................................................
}

__git_send_email_confirm_options="always never auto cc compose"
__git_send_email_suppresscc_options="author self cc bodycc sob cccmd body all"

_git_send_email ()
{









	case "$cur" in
	--confirm=*)
		__gitcomp "
			$__git_send_email_confirm_options
			" "" "${cur##--confirm=}"
		return
		;;
................................................................................
		return
		;;
	--thread=*)
		__gitcomp "
			deep shallow
			" "" "${cur##--thread=}"
		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
................................................................................
		return
		;;
	branch.*.merge)
		__gitcomp_nl "$(__git_refs)"
		return
		;;
	branch.*.rebase)
		__gitcomp "false true"
		return
		;;
	remote.pushdefault)
		__gitcomp_nl "$(__git_remotes)"
		return
		;;
	remote.*.fetch)
................................................................................
		core.quotepath
		core.repositoryFormatVersion
		core.safecrlf
		core.sharedRepository
		core.sparseCheckout
		core.symlinks
		core.trustctime

		core.warnAmbiguousRefs
		core.whitespace
		core.worktree
		diff.autorefreshindex
		diff.external
		diff.ignoreSubmodules
		diff.mnemonicprefix
................................................................................
}

_git_show_branch ()
{
	case "$cur" in
	--*)
		__gitcomp "
			--all --remotes --topo-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='--keep-index --no-keep-index --quiet --patch'
	local subcommands='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"
			;;
................................................................................
		case "$subcommand,$cur" in
		save,--*)
			__gitcomp "$save_opts"
			;;
		apply,--*|pop,--*)
			__gitcomp "--index --quiet"
			;;



		show,--*|drop,--*|branch,--*)
			;;








		show,*|apply,*|drop,*|pop,*|branch,*)
			__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
					| sed -n -e 's/:.*//p')"
			;;
		*)
			;;
		esac
	fi







>







 







>







 







|







 







>







 







>
|
|
>
>
>







 







>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>







 







|







 







>







 







|












|







 







>
>
>
|

>
>
>
>
>
>
>
>
|







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
....
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
....
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
....
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
....
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
....
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
....
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
....
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
....
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
....
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
#
# The contained completion routines provide support for completing:
#
#    *) local and remote branch names
#    *) local and remote tag names
#    *) .git/remotes file names
#    *) git 'subcommands'
#    *) git email aliases for git-send-email
#    *) tree paths within 'ref:path/to/file' expressions
#    *) file paths within current working directory and index
#    *) common --long-options
#
# To use these routines:
#
#    1) Copy this file to somewhere (e.g. ~/.git-completion.bash).
................................................................................
		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;;
................................................................................
			--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=
"

_git_diff ()
{
................................................................................
	--*)
		__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
			"
		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
	__gitcomp_nl "$(__git_refs)"
}

................................................................................
}

__git_send_email_confirm_options="always never auto cc compose"
__git_send_email_suppresscc_options="author self cc bodycc sob cccmd body all"

_git_send_email ()
{
	case "$prev" in
	--to|--cc|--bcc|--from)
		__gitcomp "
		$(git --git-dir="$(__gitdir)" send-email --dump-aliases 2>/dev/null)
		"
		return
		;;
	esac

	case "$cur" in
	--confirm=*)
		__gitcomp "
			$__git_send_email_confirm_options
			" "" "${cur##--confirm=}"
		return
		;;
................................................................................
		return
		;;
	--thread=*)
		__gitcomp "
			deep shallow
			" "" "${cur##--thread=}"
		return
		;;
	--to=*|--cc=*|--bcc=*|--from=*)
		__gitcomp "
		$(git --git-dir="$(__gitdir)" send-email --dump-aliases 2>/dev/null)
		" "" "${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
................................................................................
		return
		;;
	branch.*.merge)
		__gitcomp_nl "$(__git_refs)"
		return
		;;
	branch.*.rebase)
		__gitcomp "false true preserve interactive"
		return
		;;
	remote.pushdefault)
		__gitcomp_nl "$(__git_remotes)"
		return
		;;
	remote.*.fetch)
................................................................................
		core.quotepath
		core.repositoryFormatVersion
		core.safecrlf
		core.sharedRepository
		core.sparseCheckout
		core.symlinks
		core.trustctime
		core.untrackedCache
		core.warnAmbiguousRefs
		core.whitespace
		core.worktree
		diff.autorefreshindex
		diff.external
		diff.ignoreSubmodules
		diff.mnemonicprefix
................................................................................
}

_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='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"
			;;
................................................................................
		case "$subcommand,$cur" in
		save,--*)
			__gitcomp "$save_opts"
			;;
		apply,--*|pop,--*)
			__gitcomp "--index --quiet"
			;;
		drop,--*)
			__gitcomp "--quiet"
			;;
		show,--*|branch,--*)
			;;
		branch,*)
			if [ $cword -eq 3 ]; then
				__gitcomp_nl "$(__git_refs)";
			else
				__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
						| sed -n -e 's/:.*//p')"
			fi
			;;
		show,*|apply,*|drop,*|pop,*)
			__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
					| sed -n -e 's/:.*//p')"
			;;
		*)
			;;
		esac
	fi