 ;; ** AutoLoading NGender Modules
 
 ;; *** ngender-c
-(autoload 'ngender-c-mode "ngender-c")
-(add-to-list 'auto-mode-alist '("\\.[cChH]\\(pp\\|PP\\|xx\\|XX\\|++\\|\\)\\'" . ngender-c-mode)
+;; (autoload 'ngender-c-mode "ngender-c")
+;; (add-to-list 'auto-mode-alist '("\\.[cChH]\\(pp\\|PP\\|xx\\|XX\\|++\\|\\)\\'" . ngender-c-mode)
 
 ;; *** ngender-clojure
-(autoload 'ngender-clojure-mode "ngender-clojure")
-(add-to-list 'auto-mode-alist '("\\.\\(clj[cxs]\\?\\|dtm\\|edn\\)\\'" . ngender-clojure-mode))
+;; (autoload 'ngender-clojure-mode "ngender-clojure")
+;; (add-to-list 'auto-mode-alist '("\\.\\(clj[cxs]\\?\\|dtm\\|edn\\)\\'" . ngender-clojure-mode))
 
 ;; *** ngender-haskell
-(autoload 'ngender-haskell-mode "ngender-haskell")
-(add-to-list 'auto-mode-alist '("\\.foo\\'" . ngender-haskell-mode))
+;; (autoload 'ngender-haskell-mode "ngender-haskell")
+;; (add-to-list 'auto-mode-alist '("\\.foo\\'" . ngender-haskell-mode))
 
 ;; **** ngender-mozart
 ;; (require "ngender-mozart")

; Somehow M-; got rebound to something weird so reset it
(global-set-key (kbd "M-,") 'tags-loop-continue)

;; *** workgroups

(setq wg-morph-on nil)

;; *** workgroups2

;; Deleted this package Aug 2 2017 because
;; trying to get persp-mode to work
;; and this this is not compatible
;; Comments with ";; ; " are how it was last

;; package is a bit old - is there something better???
;; ; (require 'workgroups2)

;; <prefix> <key>
;; 
;; <prefix> c    - create workgroup
;; <prefix> A    - rename workgroup
;; <prefix> k    - kill workgroup
;; <prefix> v    - switch to workgroup
;; <prefix> C-s  - save session
;; <prefix> C-f  - load session

;;(setq wg-session-load-on-start t)    ; default: (not (daemonp))

;; Change prefix key (before activating WG)
;; ; (setq wg-prefix-key (kbd "C-s-RET"))
;; (setq wg-prefix-key (kbd "C-s-<return>"))

;; Change workgroups session file
;; (setq wg-session-file "~/.emacs.d/.emacs_workgroups")

;; Set your own keyboard shortcuts to reload/save/switch WGs:
;; "s" == "Super" or "Win"-key, "S" == Shift, "C" == Control
;; ;  (global-set-key (kbd "C-s-<down>") 'wg-save-session)
;; ;  (global-set-key (kbd "C-s-<up>") 'wg-load-session)
;; ;  (global-set-key (kbd "C-M-s-<up>") 'wg-reload-session)
;; ;  (global-set-key (kbd "C-s-<right>") 'wg-switch-to-workgroup)
;; ;  (global-set-key (kbd "C-s-<left>") 'wg-switch-to-previous-workgroup)

; (workgroups-mode 1)

;; ** Capture-Mode

;; We're capturing everything under our GTD directory
;; Maybe someday we'll separate these things out?

(global-set-key "\C-cc" 'org-capture)

(defconst gtd-dir (expand-file-name "GTD" org-directory))
(defconst gtd-inbox-org (expand-file-name "inbox.org" gtd-dir))
(defconst gtd-gtd-org (expand-file-name "gtd.org" gtd-dir))
(defconst gtd-tickler-org (expand-file-name "tickler.org" gtd-dir))
(defconst gtd-someday-org (expand-file-name "someday.org" gtd-dir))

(defconst gtd-bookmarks-org (expand-file-name "bookmarks.org" gtd-dir))
(defconst gtd-journal-org (expand-file-name "journal.org" gtd-dir))
(defconst gtd-ideas-org (expand-file-name "ideas.org" gtd-dir))
(defconst gtd-misc-org (expand-file-name "misc.org" gtd-dir))

(setq org-agenda-files (list gtd-inbox-org gtd-gtd-org gtd-tickler-org))

(setq org-capture-templates
	`( ( "t" "Todo [inbox]" entry
			 (file+headline ,gtd-inbox-org "Tasks")
			 "* TODO %i%?" )
		 ( "T" "Tickler" entry
			 (file+headline ,gtd-tickler-org "Tickler")
			 "* %i%? \n %U" )
		 ("b" "Bookmarks" entry (file+headline ,gtd-bookmarks-org "Bookmarks")
			 "* %?\nEntered %U\n  %i\n  %a")
		 ("j" "Journal" entry (file+datetree ,gtd-journal-org)
			 "* %?\nEntered %U\n  %i\n  %a")
		 ("i" "Ideas" entry (file+headline ,gtd-ideas-org "Ideas")
			 "* %?\nEntered %U\n  %i\n  %a")
		 ("m" "Misc" entry (file+headline ,gtd-misc-org "Miscellany")
			 "* %?\nEntered %U\n  %i\n  %a\n  %x")
		 ) )

;; There's some confusion about org-refile-targets
;; Initially none of these worked.  Then the first
;; one started working.  I may have needed to put
;; in a couple of levels of headings.
;; I would definitely like more flexibility and/or
;; to be able to file things to a deeper level!

(setq org-refile-targets `((,gtd-gtd-org :maxlevel . 3)
                           (,gtd-someday-org :level . 1)
                           (,gtd-tickler-org :maxlevel . 2)
                           (,gtd-bookmarks-org :level . 1)
                           (,gtd-journal-org :maxlevel . 4)
                           (,gtd-ideas-org :maxlevel . 4)
                           (,gtd-misc-org :maxlevel . 2)
))

;; (setq org-refile-targets `(
;; 			    (nil :maxlevel . 5)
;; 			    (,org-agenda-files :maxlevel . 5) ; do I want , here?
;; 			    (,gtd-someday-org :level . 1) ))
                           
;; (setq org-refile-targets `(
;; 			    (,org-agenda-files :maxlevel . 5) ; do I want , here?
;; 			    (,gtd-someday-org :level . 1) ))
                           
;; ** Key Settings

;; ignore keysyms generated by my flakey Dell Studio
(global-set-key [XF86AudioMedia] 'ignore)
(global-set-key [C-XF86AudioMedia] 'ignore)
(global-set-key [M-XF86AudioMedia] 'ignore)
(global-set-key [XF86AudioPrev] 'ignore)
(global-set-key [C-XF86AudioPrev] 'ignore)


(global-set-key [M-left]  'beginning-of-line)
(global-set-key [M-right] 'end-of-line)
(global-set-key [M-up]    'move-to-top-of-window)

;; (global-set-key [?\M-c] 'capitalize-region-or-word)
;; (global-set-key [?\M-C] 'upcase-region-or-word)

;; *** Super bindings
(global-set-key [?\s-c] 'upcase-word)
(global-set-key [s-prior] 'ngender-previous-window)
(global-set-key [s-next] 'ngender-next-window)
(global-set-key [?\s-\;] 'comment-region)
(global-set-key [?\s-\:] 'uncomment-region)

;; *** Bindings for Control plus a function key:

(global-set-key [C-f1] 'help-command)	; press f1 for help
(global-set-key [C-f2] 'shell)	; get a Unix shell in a window
