Check-in [178b66d4b7]

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

Overview
SHA1:178b66d4b795bc4454b81d7c4ecc1b442478521d
Date: 2017-12-16 21:04:43
User: cfuhrman
Comment:Optimize emacs packaging loading & configuration - Move additional mode-spectific variables into their respective use-package blocks - Re-organize where functions are loaded, with mode-specific functions belonging to their respective use-package blocks - Simplify prog-mode-hook & text-mode-hook customization - Customize trash directory on Mac OS X systems - Lose osx-trash which is s-l-o-w - Customize & simplify auto-complete[1] mode setup. Also, set up auto-complete /before/ yasnippet[2] - Massively simplify yasnippet configuration - Switch keybinding for ace-window[3] - Switch to using arjen grey theme[4] - Switch to using melpa stable[5] where applicable - Disable global-emojify-mode-line-mode since it wrecks havoc with cut-n-paste - I haven't found an excuse to use Go, so don't install go-mode. Hopefully this will change - Don't use ac-php since it's resource intensive. I may readdress this in the future Also, do not accidentally hose network-security.data file Footnotes: [1] https://github.com/auto-complete/auto-complete [2] https://github.com/joaotavora/yasnippet [3] https://github.com/abo-abo/ace-window [4] https://github.com/credmp/arjen-grey-theme [5] http://stable.melpa.org/#/
Tags And Properties
Context
2018-02-10
23:48
[392bdcb90e] Leaf: Further customizations of emacs environment (docs/README.org) - Bump copyright - Update list of supported operating systems (emacs.d/init.el) - Install and configure the following packages: + popwin[1] + calfw[2] + geben[3] + go-mode[4] and related packages - Pin the following packages to melpa-stable + all-the-icons + all-the-icons-ivy - Break out all-the-icons-dired and all-the-icons-ivy to their separate use-package blocks - Switch to using php-doc.el for automatically generating PHP documentation blocks (emacs-d/cmf-org-settings.el) - Add journal tag to all journal entries (setup.sh) - Install gocode and gotags to use with go-mode Footnotes: [1] https://github.com/m2ym/popwin-el [2] https://github.com/m2ym/popwin-el [3] https://github.com/ahungry/geben [4] https://github.com/dominikh/go-mode.el (user: cfuhrman, tags: trunk, v2018.02.11)
2017-12-16
21:04
[178b66d4b7] Optimize emacs packaging loading & configuration - Move additional mode-spectific variables into their respective use-package blocks - Re-organize where functions are loaded, with mode-specific functions belonging to their respective use-package blocks - Simplify prog-mode-hook & text-mode-hook customization - Customize trash directory on Mac OS X systems - Lose osx-trash which is s-l-o-w - Customize & simplify auto-complete[1] mode setup. Also, set up auto-complete /before/ yasnippet[2] - Massively simplify yasnippet configuration - Switch keybinding for ace-window[3] - Switch to using arjen grey theme[4] - Switch to using melpa stable[5] where applicable - Disable global-emojify-mode-line-mode since it wrecks havoc with cut-n-paste - I haven't found an excuse to use Go, so don't install go-mode. Hopefully this will change - Don't use ac-php since it's resource intensive. I may readdress this in the future Also, do not accidentally hose network-security.data file Footnotes: [1] https://github.com/auto-complete/auto-complete [2] https://github.com/joaotavora/yasnippet [3] https://github.com/abo-abo/ace-window [4] https://github.com/credmp/arjen-grey-theme [5] http://stable.melpa.org/#/ (user: cfuhrman, tags: trunk, v2017.12.16)
2017-12-03
21:56
[3c1101ac0d] Sync latest changes from my personal repository (README.org) - Bump Copyright (emacs) - Re-enable installation of vc-fossil for Emacs 25 and greater - Install and configure the following packages: + flyspell-correct-ivy[1] + all-the-icons[2] + all-the-icons-dired[3] + all-the-icons-ivy[4] + which-key[5] + ace-window[6] + highlight-parentheses[7] + flyspell-correct-ivy[8] - Force set fill-column to 80 characters for text-mode - Enable global-emojify-mode-line-mode - Automatically install fonts required for all-the-icons - Use emoji for common modes presented in the mode-line + 💡: beacon Mode + 📔: eldoc mode + 🦋: flycheck-mode + 🄶: ggtags-mode + 🌲: undo-tree + 🅈: yas-minor-mode - Load package archives more intelligently - Massive reworking of yasnippet[9] and auto-complete[10]. - Move mode-specific variables into their own use-package blocks - Bootstrap diminish prior to installation of use-package - Added boiler-plates for (c)perl-mode - Optimize loading of custom files (setup.sh) - Bump Copyright Footnotes: [1] https://github.com/d12frosted/flyspell-correct [2] https://github.com/domtronn/all-the-icons.el [3] https://github.com/jtbm37/all-the-icons-dired [4] https://github.com/asok/all-the-icons-ivy [5] https://github.com/justbur/emacs-which-key [6] https://github.com/abo-abo/ace-window [7] https://github.com/tsdh/highlight-parentheses.el [8] https://github.com/d12frosted/flyspell-correct/blob/master/flyspell-correct-ivy.el [9] https://github.com/joaotavora/yasnippet [10] https://github.com/auto-complete/auto-complete (user: cfuhrman, tags: trunk, v2017.12)
Changes

Changes to emacs.d/init.el.

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
...
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
...
153
154
155
156
157
158
159

160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
...
202
203
204
205
206
207
208
209

210
211
212

213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240


241
242
243
244
245
246
247
248
249
250
251
252
253
254
255



256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
...
315
316
317
318
319
320
321




322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358










359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377

378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406



407
408
409
410

411
412

413
414
415
416

417
418
419
420
421
422
423
424

425
426
427
428

429




430



431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
...
473
474
475
476
477
478
479
480


481
482
483
484

485
486
487
488
489
490
491
492

493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515

516
517
518
519
520
521
522

523

524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578

579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597



598


599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621











622
623
624
625
626

627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713

714
715
716
717
718
719
720
...
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
...
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
...
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817


818
819
820
821
822




823
824
825
826
827
828
829
830
831

832






833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854



855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886

887
888
889
890
891
892
893
894
895
896

897
898
899


900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915

916
917
918
919


920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
...
952
953
954
955
956
957
958

959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981

982


983


984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019

1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044

1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059

1060

1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074









1075
1076
1077
1078
1079

1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
....
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
 '(emerge-combine-versions-template "
%b
%a
")
 '(global-hl-line-mode t)
 '(linum-delay t)
 '(log-edit-hook (quote (log-edit-show-files)))
 '(mac-option-modifier 'meta)
 '(mark-even-if-inactive t)
 '(mark-holidays-in-calendar t)
 '(recentf-mode t)
 '(scroll-bar-mode (quote right))
 '(sh-basic-offset 8)
 '(sh-indent-comment t)
 '(sh-indent-for-case-alt (quote +))
 '(sh-indent-for-case-label 0)
 '(sh-indent-for-continuation 4)
 '(sh-indentation 8)
 '(show-paren-mode 1)
 '(sml/modified-char "★")
 '(sml/read-only-char "🔒")
 '(tramp-default-method "ssh")
 '(transient-mark-mode 1)
 '(use-package-concat t)
 '(user-full-name cmf-full-name)
 '(user-mail-address cmf-mail-address)
 )

................................................................................
        (setq custom-file cmf-custom-256)
      (setq custom-file cmf-custom-16))
  (setq custom-file cmf-custom)
  )

(load custom-file)

;; Fix for bug involving enriched text mode
(if (version< emacs-version "25.3")
    (eval-after-load "enriched"
      '(defun enriched-decode-display-prop (start end &optional param)
         (list start end))))

;; 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
................................................................................

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


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

;; 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))
  )

;; Function for loading exec paths
(defun cmf/update-exec-path (pathlist)
  "Add given PATHLIST to 'exec-path'."
  (dolist (path pathlist)
    (add-to-list 'exec-path path)
    (setenv "PATH" (concat (getenv "PATH") ":" path)))
  )
................................................................................
                   (frame-height (1- (frame-height frame))))
              ;; The original value added to the `image-height' for the
              ;; test was 19; however, that causes the test to fail on X11
              ;; by about 1.5 -- so use 17 instead.
              (> frame-height (+ image-height 17))))))
      ))



;; Defined modes
;; --------------------------------------------------------------------


(define-derived-mode nice-msg-mode
  text-mode "Nice"
  "Major mode for editing text documents."
  )

;; Apply hooks as appropriate
(add-hook 'nice-msg-mode-hook 'nice-text-hook)
(add-hook 'nice-msg-mode-hook 'turn-on-orgstruct++)
(add-hook 'nice-msg-mode-hook 'ac-emoji-setup)


;; Hooks
;; --------------------------------------------------------------------

;; Define a nice programming hook
(defun nice-prog-hook ()
  "Enable some sanity for programming source files."
  (if (>= emacs-major-version 23)
      (linum-mode t))
  (if (package-installed-p 'ggtags)
      (ggtags-mode t))
  (if (package-installed-p 'indent-guide)
      (indent-guide-mode t))
  (if (package-installed-p 'undo-tree)
      (undo-tree-mode t))
  (auto-fill-mode t)
  (eldoc-mode t)
  (electric-pair-mode t)


  )

;; Define a basic hook for sane editing of text documents
(defun nice-text-hook ()
  "Hook for sane editing of text (ASCII) documents."
  (auto-fill-mode t)
  (flyspell-mode t)
  (footnote-mode t)
  (if (package-installed-p 'undo-tree)
      (undo-tree-mode t))
  (if (package-installed-p 'auto-complete)
      (auto-complete-mode t))
  )

;; Force fill column for nice-text-hook



(add-hook 'text-mode-hook
          (lambda ()
            (set-fill-column 80)))

;; Aliases
;; --------------------------------------------------------------------

(defalias 'perl-mode 'cperl-mode)


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

(fset 'yes-or-no-p
      'y-or-n-p)

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

;; Use Emacs ls(1) emulation
(require 'ls-lisp)


;; Package configuration
;; --------------------------------------------------------------------





(require 'package)
(setq package-enable-at-startup nil)
(setq package-archives
      '(("melpa" . "https://melpa.org/packages/")
        ("melpa-stable" . "https://stable.melpa.org/packages/")
        ("marmalade" . "https://marmalade-repo.org/packages/")
        ("gnu" . "http://elpa.gnu.org/packages/"))
      )
(package-initialize)

;; Boostrap 'diminish' if necessary
(unless (package-installed-p 'diminish)
   (package-refresh-contents)
   (package-install 'diminish))

;; Bootstrap 'use-package' if necessary
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

;; Enable use-package
(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
;;

;; yasnippet
;;
;; Note this needs to be loaded first since we want to use the version
;; from melpa-stable.
(use-package yasnippet
  :ensure t



  :pin melpa-stable

  :config
  ;; fix some org-mode + yasnippet conflicts:

  (defun yas/org-very-safe-expand ()
    (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))


  ;; Turn on snippets
  (yas-global-mode t)


  ;; Bind `C-c y' to `yas-expand' ONLY.
  (define-key yas-minor-mode-map (kbd "C-c y") #'yas-expand)

  ;; Update org-mode configuration
  (add-hook 'org-mode-hook
            (lambda ()
              (make-variable-buffer-local 'yas/trigger-key)
              (setq yas/trigger-key "C-c y")

              (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)








  :custom
  (yas-snippet-dirs '("~/.emacs.d/snippets"))
  (yas-wrap-around-region t)
  )

;; ace-window
(use-package ace-window
  :ensure t
  :pin melpa-stable

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

  :bind (
         ("M-p" . ace-window))
  )

;; all-the-icons
(use-package all-the-icons
  :if window-system
  :ensure t
  :ensure all-the-icons-dired
................................................................................
  :defer t
  :no-require t
  :mode (("\\.htaccess\\'"                   . apache-mode)
         ("access\\.conf\\'"                 . apache-mode)
         ("httpd\\.conf\\'"                  . apache-mode)
         ("sites-\\(available\\|enabled\\)/" . apache-mode)
         ("srm\\.conf\\'"                    . apache-mode))
  :config


  (add-hook 'apache-mode-hook 'nice-prog-hook)
  )

;; auto-complete

(use-package auto-complete
  :ensure auto-complete
  :ensure ac-emoji
  :ensure ac-ispell

  :init
  (require 'auto-complete)


  :config
  (require 'auto-complete-config)
  (add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
  (ac-config-default)
  (ac-set-trigger-key "TAB")
  (ac-set-trigger-key "<tab>")
  (if (package-installed-p 'ac-ispell)
      (ac-ispell-setup))

  ;; resetting ac-sources
  (setq-default ac-sources '(
                             ac-source-yasnippet
                             ac-source-abbrev
                             ac-source-dictionary
                             ac-source-words-in-same-mode-buffers
                             ac-source-gtags
                             ))
  )

;; auto-compile
(use-package auto-compile
  :ensure t
  :config (auto-compile-on-load-mode))


(setq load-prefer-newer t)

;; beacon mode
(use-package beacon
  :diminish " 💡"
  :ensure t



  :init
  (require 'beacon)

  :config
  (beacon-mode 1)
  )

;; 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)))))
  )

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

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

;; [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)

  :custom
  (cperl-continued-brace-offset -8)
  (cperl-continued-statement-offset 4)
  (cperl-electric-keywords t)
  (cperl-electric-linefeed t)
  (cperl-electric-parens nil)
  (cperl-font-lock t)
  (cperl-highlight-variables-indiscriminately t)
  (cperl-indent-level 8)

  )

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

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

;; csv-nav-mode
(use-package csv-nav-mode
  :ensure csv-nav
  :defer t
  :mode ("\\.csv\\'" . csv-nav-mode)
  )

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

;; emojify
(use-package emojify
  :if window-system



  :ensure t



  :config
  (global-emojify-mode)
  (global-emojify-mode-line-mode)
  )

;; flycheck
(use-package flycheck
  :ensure t
  :defer t

  :init
  (global-flycheck-mode)

  :custom
  (flycheck-disabled-checkers (quote (php-phpcs)))
  (flycheck-highlighting-mode 'lines)
  (flycheck-phpcs-standard "PSR2")

  )

;; flyspell
(use-package flyspell











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

  :custom
  (flycheck-mode-line-prefix "🦋")

  )

;; forecast
(if (version< emacs-version "24.4")
    (message "Forecast requires Emacs version 24.4 or later.  Unable to install")
  (use-package forecast
    :ensure t
    :defer 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")
    )
  )

;; ggtags
(use-package ggtags
  :ensure t
  :defer t
  :diminish ggtags-mode " 🄶"
  )

;; gited - dired for git branches
(use-package gited
  :ensure t
  :defer t

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

  )

;; go-mode
(use-package go-mode
  :no-require t

  :ensure go-mode
  :ensure go-autocomplete
  :ensure go-direx
  :ensure go-eldoc
  :ensure go-mode
  :ensure go-snippets

  :defer t

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

  :config
  (add-hook 'go-mode-hook 'nice-prog-hook)
  )

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

  :config
  (add-hook 'emacs-lisp-mode-hook
            (lambda()
              (highlight-parentheses-mode)
              ))

  (global-highlight-parentheses-mode)
  )

;; html-mode
(use-package html-mode
  :mode ("\\.tmpl\\'" . html-mode)
  )

;; indent-guide
(use-package indent-guide
  :ensure t
  :defer t
  :diminish indent-guide-mode
  )

;; ivy-mode
(use-package ivy-mode
  :ensure counsel
  :ensure flyspell-correct-ivy
  :ensure swiper


  :bind (
         ("C-s"     . swiper)
         ("C-r"     . swiper)
         ("C-c C-r" . ivy-resume)
         ("M-x"     . counsel-M-x)
         ("C-x C-f" . counsel-find-file)
................................................................................
         ("<f1> l"  . counsel-load-library)
         ("M-i"     . counsel-imenu)
         ("<f2> i"  . counsel-info-lookup-symbol)
         ("<f2> u"  . counsel-unicode-char)
         ("C-c g"   . counsel-git)
         ("C-c j"   . counsel-git-grep)
         ("C-x l"   . counsel-locate)
         ("C-c ;"   . flyspell-correct-previous-word-generic)
         )

  :init
  (ivy-mode 1)

  :custom
  (ivy-use-virtual-buffers t)
  (ivy-height 10)
  (ivy-count-format "(%d/%d) ")

  )

;; 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."
    (setq indent-tabs-mode nil)
    )

  (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++)
  )

;; magit
(if (version< emacs-version "24.4")
................................................................................
    ("C-x g" . magit-status)
    )
  )

;; make-mode
(use-package make-mode
  :mode ("[Mm]akefile\\." . makefile-mode)

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

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

;; markdown-mode
(use-package markdown-mode
  :ensure t
  :defer t
  )

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


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

  :config
  ;; Define a nice hook for editing nXML files




  (defun nice-nxml-hook ()
    "Hook for sane editing of nXML files."
    (if (>= emacs-major-version 23)
        (linum-mode t))
    (if (package-installed-p 'indent-guide)
        (indent-guide-mode t))
    (auto-fill-mode -1)
    )


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






  )

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

  :defer t

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

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

  :config



  ;; 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))
    (if (package-installed-p 'undo-tree)
        (undo-tree-mode t))
    )

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

  ;; 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)))))

  (add-hook 'php-mode-hook
            '(lambda ()
               (require 'ac-php)
               (setq ac-sources (cons 'ac-source-php ac-sources))
               (ac-php-core-eldoc-setup ) ;; enable eldoc
               
               (define-key php-mode-map  (kbd "C-]") 'ac-php-find-symbol-at-point)   ;goto define
               (define-key php-mode-map  (kbd "C-t") 'ac-php-location-stack-back)    ;go back
               ))
  

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

  :custom


  (phpcbf-standard "PSR2")

  )

;; planet-theme
(if (not(equal window-system nil))
    (use-package planet-theme
      :ensure t

      :init
      (load-theme 'planet t)
      )
  )

;; pretty-lambdada
(if (version< emacs-version "24.4")
    (use-package pretty-lambdada
      :ensure t
      :defer t

      :init
      (require 'pretty-lambdada)

      :config
      (pretty-lambda-for-modes)
      )
................................................................................
  :init
  (add-hook 'ruby-mode-hook 'nice-prog-hook)
  )

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


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

  :init
  (add-hook 'sed-mode-hook 'nice-prog-hook)

  )

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

  :init
  (add-to-list 'custom-safe-themes
               "3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa")
  (add-to-list 'custom-safe-themes
               "a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e")
  (sml/setup)

  :config
  (if (equal custom-file cmf-custom-16)

      (sml/apply-theme 'light)


    (sml/apply-theme 'dark)


    )
  )

;; 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)
  )

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

  )

;; tex
(use-package tex
  :ensure auctex
  )

;; text-mode
(use-package text-mode
  :mode (
         ("COMMIT.*"   . nice-msg-mode)
         ("ci-comment" . nice-msg-mode)
         ("bzr_log\\." . nice-msg-mode)
         ("pico\\."    . nice-msg-mode)
         )

  :init
  (add-hook 'text-mode-hook     'nice-text-hook)
  )

;; twilight-theme
(if (equal custom-file cmf-custom-256)
    (use-package twilight-theme
      :ensure t


      :init
      (load-theme 'twilight t)
      )
  )

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

  :config
  (add-hook 'twittering-edit-mode-hook 'nice-text-hook)

  :if window-system
  :config

  (twittering-icon-mode 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
  :diminish " 🌲"
  :ensure t










  :custom
  (undo-tree-visualizer-diff t)
  (undo-tree-visualizer-timestamps 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
   '(which-func ((t (:foreground "goldenrod")))))

  :custom
  (which-function-mode t)
  )

;; which-key
(use-package which-key
................................................................................
  :config
  (which-key-mode)
  )

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

  (add-hook 'with-editor-mode-hook 'nice-text-hook)
  (add-hook 'with-editor-mode-hook 'turn-on-orgstruct++)
  )

;; xkcd
(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)
  )

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

;; Diminished functions
(diminish 'ivy-mode "")
(diminish 'yas-minor-mode " 🅈")

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







<











<
<







 







<
<
<
<
<




<
<
<
<
<
<
<







 







>




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







 







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










<
<
<
<
<
<



>
>




|

<

<
<
<
<


<
>
>
>




<
<
<
<
<







 







>
>
>
>













|
|











<
<
<
<







>
>
>
>
>
>
>
>
>
>




|
<











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









|
<
<
<
|

>
>
>


|
<
>
|
|
>
|
<
<

>
|
|

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

>
>
>

<












|







 







<
>
>



<
>
|
<
|
|


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

<
>
|
<



<

>

>







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










<





|
>




<
<
<
<
<
<
<


|




|
>
>
>

>
>



<





<








<




>
>
>
>
>
>
>
>
>
>
>


<
<
<
>







|











<
<
<
<
<
<
<



|







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








<
<
<
<
<








<
<
<
<
<
<
<
|
|

<

>







 







<









<







 







|




|
|
|
|
|
|
|
|

<
<
<
<
<
<
<
<
<
<







 







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




>
>




|
>
>
>
>

|

|
<
<



>

>
>
>
>
>
>








<
<












>
>
>







<
<








<





|
<






|
>


<
|
|
|
<
<
|
<
>
|

<
>
>
|
|
<
<
<

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



>
>

<
<
<
<
<
<
<
<
<
<
<






<







 







>




<
<
<
<







|
<
<
<



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







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





>


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

<
|
|
<
>
|
|
<





|

|


<

>
|
>












<

>
>
>
>
>
>
>
>
>





>




<
<










<
<
<







 







|
>







>
>





>


<
>
|





|
|







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
...
115
116
117
118
119
120
121





122
123
124
125







126
127
128
129
130
131
132
...
138
139
140
141
142
143
144
145
146
147
148
149















150
151
152
153
154
155
156
...
173
174
175
176
177
178
179

180
181
182

183
184








185
186
187
188
189
190
191
192
193
194






195
196
197
198
199
200
201
202
203
204
205

206




207
208

209
210
211
212
213
214
215





216
217
218
219
220
221
222
...
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302




303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324

325
326
327
328
329
330
331
332
333
334
335
336

337
338


339










340
341
342
343
344
345
346
347
348
349



350
351
352
353
354
355
356
357

358
359
360
361
362


363
364
365
366
367
368
369
370
371

372
373
374
375

376
377
378
379
380
381
382
383
384
385
386

387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
...
427
428
429
430
431
432
433

434
435
436
437
438

439
440

441
442
443
444
445

446
447







448








449

450
451
452

453
454

455
456
457

458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492







493
494
495
496
497
498
499
500
501
502

503
504
505
506
507
508
509
510
511
512
513







514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530

531
532
533
534
535

536
537
538
539
540
541
542
543

544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560



561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580







581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601







602
603
604
605
606
607
608
609





610
611
612
613
614
615
616
617







618
619
620

621
622
623
624
625
626
627
628
629
...
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
...
688
689
690
691
692
693
694
















695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713


714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732


733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754


755
756
757
758
759
760
761
762

763
764
765
766
767
768

769
770
771
772
773
774
775
776
777
778

779
780
781


782

783
784
785

786
787
788
789



790










791
792
793
794
795
796
797
798











799
800
801
802
803
804

805
806
807
808
809
810
811
...
818
819
820
821
822
823
824
825
826
827
828
829




830
831
832
833
834
835
836
837



838
839
840
841
842
843
844
845
846
847
848
849





850
851



852
853
854
855
856
857
858
859











860
861
862
863
864
865
866
867
868


















869

870
871

872
873
874

875
876
877
878
879
880
881
882
883
884

885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900

901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920


921
922
923
924
925
926
927
928
929
930



931
932
933
934
935
936
937
...
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
 '(emerge-combine-versions-template "
%b
%a
")
 '(global-hl-line-mode t)
 '(linum-delay t)
 '(log-edit-hook (quote (log-edit-show-files)))

 '(mark-even-if-inactive t)
 '(mark-holidays-in-calendar t)
 '(recentf-mode t)
 '(scroll-bar-mode (quote right))
 '(sh-basic-offset 8)
 '(sh-indent-comment t)
 '(sh-indent-for-case-alt (quote +))
 '(sh-indent-for-case-label 0)
 '(sh-indent-for-continuation 4)
 '(sh-indentation 8)
 '(show-paren-mode 1)


 '(tramp-default-method "ssh")
 '(transient-mark-mode 1)
 '(use-package-concat t)
 '(user-full-name cmf-full-name)
 '(user-mail-address cmf-mail-address)
 )

................................................................................
        (setq custom-file cmf-custom-256)
      (setq custom-file cmf-custom-16))
  (setq custom-file cmf-custom)
  )

(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
................................................................................

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


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
















;; Function for loading exec paths
(defun cmf/update-exec-path (pathlist)
  "Add given PATHLIST to 'exec-path'."
  (dolist (path pathlist)
    (add-to-list 'exec-path path)
    (setenv "PATH" (concat (getenv "PATH") ":" path)))
  )
................................................................................
                   (frame-height (1- (frame-height frame))))
              ;; The original value added to the `image-height' for the
              ;; test was 19; however, that causes the test to fail on X11
              ;; by about 1.5 -- so use 17 instead.
              (> frame-height (+ image-height 17))))))
      ))


;; Fix for bug involving enriched text mode
(if (version< emacs-version "25.3")
    (eval-after-load "enriched"

      '(defun enriched-decode-display-prop (start end &optional param)
         (list start end))))










;; Hooks
;; --------------------------------------------------------------------

;; Define a nice programming hook
(defun nice-prog-hook ()
  "Enable some sanity for programming source files."
  (if (>= emacs-major-version 23)
      (linum-mode t))






  (auto-fill-mode t)
  (eldoc-mode t)
  (electric-pair-mode t)
  (font-lock-add-keywords nil
                          '(("\\<\\(FIXME\\|TODO\\|BUG\\|LATER\\):" 1 font-lock-warning-face t)))
  )

;; Define a basic hook for sane editing of text documents
(defun nice-text-hook ()
  "Hook for sane editing of text documents."
  (auto-fill-mode t)

  (footnote-mode t)




  )


;; Apply hooks as appropriate
(add-hook 'prog-mode-hook 'nice-prog-hook)
(add-hook 'text-mode-hook 'nice-text-hook)
(add-hook 'text-mode-hook
          (lambda ()
            (set-fill-column 80)))







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

(fset 'yes-or-no-p
      'y-or-n-p)

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

;; Use Emacs ls(1) emulation
(require 'ls-lisp)


;; Package configuration
;; --------------------------------------------------------------------

;;
;; package.el installation and configuration
;;

(require 'package)
(setq package-enable-at-startup nil)
(setq package-archives
      '(("melpa" . "https://melpa.org/packages/")
        ("melpa-stable" . "https://stable.melpa.org/packages/")
        ("marmalade" . "https://marmalade-repo.org/packages/")
        ("gnu" . "http://elpa.gnu.org/packages/"))
      )
(package-initialize)

;; Boostrap 'diminish' if necessary
(unless (package-installed-p 'diminish)
  (package-refresh-contents)
  (package-install 'diminish))

;; Bootstrap 'use-package' if necessary
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

;; Enable use-package
(eval-when-compile
  (require 'use-package))
(require 'diminish)
(require 'bind-key)





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

    :init

    (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)
                      )
                )
              )


    :config
    (osx-location-watch)













    )
  )

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

;; auto-complete



(use-package auto-complete
  :ensure t
  :ensure ac-ispell
  :ensure fuzzy

  :pin melpa-stable

  :demand


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



  :init
  (add-hook 'text-mode-hook 'ac-ispell-ac-setup)
  (add-hook 'log-mode-hook  'ac-ispell-ac-setup)

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


  :custom
  (ac-dwim t)
  )


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

  :init
  (yas-global-mode 1)

  :custom

  (yas-wrap-around-region t)
  )

;; ace-window
(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
(use-package all-the-icons
  :if window-system
  :ensure t
  :ensure all-the-icons-dired
................................................................................
  :defer t
  :no-require t
  :mode (("\\.htaccess\\'"                   . apache-mode)
         ("access\\.conf\\'"                 . apache-mode)
         ("httpd\\.conf\\'"                  . apache-mode)
         ("sites-\\(available\\|enabled\\)/" . apache-mode)
         ("srm\\.conf\\'"                    . apache-mode))


  :init
  (add-hook 'apache-mode-hook 'nice-prog-hook)
  )


;; 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)







  )










;; auctex
(use-package auctex
  :ensure t

  :no-require t
  )


;; beacon mode
(use-package beacon

  :ensure t
  :pin melpa-stable

  :diminish " 🄱"
  :init
  (require 'beacon)

  :config
  (beacon-mode 1)
  )

;; [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)
  (cperl-electric-parens nil)
  (cperl-font-lock t)
  (cperl-highlight-variables-indiscriminately t)
  (cperl-indent-level 8)

  )

;; crontab-mode
(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
  :ensure t


  :init
  (global-flycheck-mode)

  :custom
  (flycheck-disabled-checkers (quote (php-phpcs)))
  (flycheck-highlighting-mode 'lines)
  (flycheck-phpcs-standard "PSR2")

  )

;; flyspell
(use-package flyspell
  :ensure t
  :ensure flyspell-correct-ivy

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

  :init
  (require 'flyspell-correct-ivy)
  (add-hook 'prog-mode-hook 'flyspell-prog-mode)
  (add-hook 'text-mode-hook '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
    :no-require 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")
    )
  )








;; gited - dired for git branches
(use-package gited
  :ensure t
  :no-require t

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

  )

;; ggtags
(use-package ggtags
  :ensure t

  :diminish ggtags-mode " 🄶"

  :init
  (add-hook 'prog-mode-hook
            (lambda ()
              (ggtags-mode t)))







  )

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

  :config





  (global-highlight-parentheses-mode)
  )

;; html-mode
(use-package html-mode
  :mode ("\\.tmpl\\'" . html-mode)
  )








;; ivy
(use-package ivy
  :ensure counsel

  :ensure swiper
  :diminish ivy-mode

  :bind (
         ("C-s"     . swiper)
         ("C-r"     . swiper)
         ("C-c C-r" . ivy-resume)
         ("M-x"     . counsel-M-x)
         ("C-x C-f" . counsel-find-file)
................................................................................
         ("<f1> l"  . counsel-load-library)
         ("M-i"     . counsel-imenu)
         ("<f2> i"  . counsel-info-lookup-symbol)
         ("<f2> u"  . counsel-unicode-char)
         ("C-c g"   . counsel-git)
         ("C-c j"   . counsel-git-grep)
         ("C-x l"   . counsel-locate)

         )

  :init
  (ivy-mode 1)

  :custom
  (ivy-use-virtual-buffers t)
  (ivy-height 10)
  (ivy-count-format "(%d/%d) ")

  )

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

  )

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

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

;; log-edit-mode
(use-package log-edit
  :mode (
         ("COMMIT.*"   . log-edit-mode)
         ("ci-comment" . log-edit-mode)
         ("bzr_log\\." . log-edit-mode)
         ("pico\\."    . log-edit-mode)
         )











  :init
  (add-hook 'log-edit-mode-hook 'nice-text-hook)
  (add-hook 'log-edit-mode-hook 'turn-on-orgstruct++)
  )

;; magit
(if (version< emacs-version "24.4")
................................................................................
    ("C-x g" . magit-status)
    )
  )

;; make-mode
(use-package make-mode
  :mode ("[Mm]akefile\\." . makefile-mode)
















  )

;; 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)
         )

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

  :config

  ;; 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)

  ;; Org-mode hooks
  (add-hook 'org-mode-hook 'nice-text-hook)
  (add-hook 'org-mode-hook 'nice-org-hook)

  (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
  )

;; 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" . 'phpdoc)
	      )


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














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

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











  )

;; pretty-lambdada
(if (version< emacs-version "24.4")
    (use-package pretty-lambdada
      :ensure t


      :init
      (require 'pretty-lambdada)

      :config
      (pretty-lambda-for-modes)
      )
................................................................................
  :init
  (add-hook 'ruby-mode-hook 'nice-prog-hook)
  )

;; sed-mode
(use-package sed-mode
  :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)



  (sml/setup)

  :config
  (if (equal window-system nil)
      (progn
	(sml/apply-theme 'dark)
	(setq sml/read-only-char " 🔒"))
    (progn
      (sml/apply-theme 'dark)
      (setq sml/read-only-char " 🅛"))
    (sml/apply-theme 'respectful))






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



  )

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

  :init











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

;; sudo-edit
(use-package sudo-edit
  :ensure t
  :no-require t
  )



















;; twilight-theme

(use-package twilight-theme
  :ensure t

  :if (equal custom-file cmf-custom-256)
  :init
  (load-theme 'twilight t)

  )

;; twittering-mode
(use-package twittering-mode
  :ensure t
  :no-require t

  :init
  (add-hook 'twittering-edit-mode-hook 'nice-text-hook)


  :config
  (unless (equal window-system nil)
    (setq twittering-icon-mode 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)
  )

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




  :custom
  (which-function-mode t)
  )

;; which-key
(use-package which-key
................................................................................
  :config
  (which-key-mode)
  )

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

  :init
  (add-hook 'with-editor-mode-hook 'nice-text-hook)
  (add-hook 'with-editor-mode-hook '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 'prog-mode-hook)
  )

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

;; Diminished modes that we have to put here as :diminish doesn't seem
;; to want to work :/
(diminish 'yas-minor-mode " 🅈")

;; 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 global-excludes.

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







|



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