소스 검색

Added historical orgified-init back

George Jones 9 년 전
부모
커밋
7f826e9eba

+ 78 - 0
historical/.emacs.d.20150501/README.org

@@ -0,0 +1,78 @@
+#+TITLE: README on installing my emacs environment
+#+DATE: <2013-11-29 Fri>
+#+AUTHOR: George Jones
+#+EMAIL: george@filge
+#+OPTIONS: ':nil *:t -:t ::t <:t H:3 \n:nil ^:t arch:headline
+#+OPTIONS: author:t c:nil creator:comment d:(not LOGBOOK) date:t e:t
+#+OPTIONS: email:nil f:t inline:t num:t p:nil pri:nil prop:nil stat:t
+#+OPTIONS: tags:t tasks:t tex:t timestamp:t toc:nil todo:t |:t
+#+CREATOR: Emacs 24.3.50.1 (Org mode 8.2.1)
+#+DESCRIPTION:
+#+EXCLUDE_TAGS: noexport
+#+KEYWORDS:
+#+LANGUAGE: en
+#+SELECT_TAGS: export
+
+
+* Instlaling my emacs envirioment
+  Thsee are note on seting up my emacs environment on a new system.
+  These could probably be =#+BEGIN_SRC= blocks for automation
+
+** Ubuntu Specific
+*** Install or update latest emacs-snapshot
+    - see https://launchpad.net/~cassou/+archive/emacs
+*** Install texinfo
+    #+BEGIN_EXAMPLE
+    $ apt-get install texinfo
+    #+END_EXAMPLE
+** Mac Specific
+*** Install or update latest emacs-snapshot
+    - Use macports
+** Pull dotfiles from github and install
+
+    Some/all of this README could go into installDotfiles.sh
+
+    #+BEGIN_EXAMPLE
+    $ cd ~/git
+    $ git clone https://github.com/eludom/dotfiles.git
+    $ cd ~/git/dotfiles/
+    $ ./installDotfiles.sh # or similar by hand
+     #+END_EXAMPLE
+
+** To switch versions
+
+    #+BEGIN_EXAMPLE
+    $ cd ~/src/org-mode
+    $ git tag
+    $ git checkout release_8.1.1
+    $ make
+    #+END_EXAMPLE
+
+
+** Generic
+*** Install the latest org-mode
+    #+BEGIN_EXAMPLE
+    $ mkdir -p ~/src
+    $ cd ~/src/
+    $ git clone git://orgmode.org/org-mode.git
+    $ make autoloads
+    #+END_EXAMPLE
+
+** Install packages
+   - color-theme
+   - org2blog
+     + then unistall the version of org that comes along because we
+       use git version in ~/src
+   - twittering-mode
+   - magit
+   
+** LaTeX Installation
+   - Install pdflatex (from whaterever package/ports are required)
+   - Install bibtex
+   - Install bibtex2html
+
+#+BEGIN_SRC emacs-lisp
+(message "See README.org for manual installation and setup requirements.")
+#+END_SRC
+
+

+ 17 - 0
historical/.emacs.d.20150501/examples/ox-bibtex-example.bib

@@ -0,0 +1,17 @@
+@book{dominik2010org,
+  title={The Org Mode 7 Reference Manual-Organize your life with GNU Emacs},
+  author={Dominik, Carsten},
+  year={2010},
+  publisher={Network Theory Ltd.}
+}
+
+@article{schulte2012multi,
+  title={A multi-language computing environment for literate programming and reproducible research},
+  author={Schulte, Eric and Davison, Dan and Dye, Thomas and Dominik, Carsten},
+  journal={Journal of Statistical Software},
+  volume={46},
+  number={3},
+  pages={1--24},
+  year={2012},
+  publisher={American Statistical Association}
+}

+ 86 - 0
historical/.emacs.d.20150501/examples/ox-bibtex-example.org

@@ -0,0 +1,86 @@
+#+Title: An Example Demonstrating ox-bibtex Usage
+#+Author: Eric Schulte
+#+Options: toc:nil ^:{}
+
+An example document demonstrating generation of bibliographies for
+LaTeX, HTML and ASCII export using Org-mode cite:dominik2010org with
+the =ox-bibtex= contributed package.  Included code blocks are
+executable for reproducibility cite:schulte2012multi.
+
+(taken from the comments at the top of =ox-bibtex.el=)
+
+* Introduction and Requirements
+Use =cite= syntax for Org links (e.g., =cite:bibtexid=).  For HTML and
+ascii it uses the bibtex2html software from
+http://www.lri.fr/~filliatr/bibtex2html/, and for ascii it uses the
+pandoc software from http://johnmacfarlane.net/pandoc/.
+
+* Usage
+The usage is as follows:
+
+: #+BIBLIOGRAPHY: bibfilebasename stylename optional-options
+
+e.g. given =foo.bib= and using style "plain":
+
+: #+BIBLIOGRAPHY: foo plain option:-d
+
+"stylename" can also be "nil", in which case no style will be used.
+
+Optional options are of the form:
+
+: option:-foobar
+
+pass '-foobar' to bibtex2html
+
+e.g.,
+
+| =option:-d= | sort by date                                 |
+| =option:-a= | sort as BibTeX (usually by author) *default* |
+| =option:-u= | unsorted i.e. same order as in .bib file     |
+| =option:-r= | reverse the sort                             |
+
+See the bibtex2html man page for more.  Multiple options can be
+combined like:
+
+: option:-d option:-r
+
+Limiting to only the entries cited in the document:
+
+: limit:t
+
+For LaTeX export this simply inserts the lines
+
+: \bibliographystyle{plain}
+: \bibliography{foo}
+
+into the TeX file when exporting.
+
+For HTML export it:
+1) converts all =\cite{foo}= and =[[cite:foo]]= to links to the
+   bibliography,
+2) creates a =foo.html= and =foo_bib.html=,
+3) includes the contents of =foo.html= in the exported HTML file.
+
+For ascii export it:
+1) converts all =\cite{foo}= and =[[cite:foo]]= to links to the
+   bibliography,
+2) creates a =foo.txt= and =foo_bib.html=,
+3) includes the contents of foo.txt in the exported ascii file.
+
+For LaTeX export it:
+1) converts all =[[cite:foo=]] to =\cite{foo}=.
+
+* Emacs Configuration
+The =.emacs= configuration is simple.  With path to Org-mode's
+=contrib/= repository in your load path, require =ox-bibtex= as in the
+following example.
+
+#+begin_src emacs-lisp
+(add-to-list 'load-path "~/src/org-mode/contrib/lisp/")
+(require 'ox-bibtex)
+#+end_src
+
+#+RESULTS:
+: ox-bibtex
+
+#+BIBLIOGRAPHY: ox-bibtex-example plain

+ 77 - 0
historical/.emacs.d.20150501/init.el

@@ -0,0 +1,77 @@
+(message "in .init.el")
+
+; Adapted from: http://orgmode.org/worg/org-contrib/babel/intro.html#sec-8-2-1
+
+; To set up org mode
+;
+; $ mkdir -p ~/src
+; $ cd ~/src/
+; $ git clone git://orgmode.org/org-mode.git
+					; $ make autoloads
+
+; workaround? from: http://lists.gnu.org/archive/html/emacs-orgmode/2013-11/msg00174.html
+(defun org-element-cache-reset (&optional all) (interactive))
+
+; standard eamcs.d stuff first
+(add-to-list 'load-path "~/.emacs.d/orgified-init")
+
+;;; init.el --- Where all the magic begins
+;;
+;; This file loads Org-mode and then loads the rest of our Emacs initialization from Emacs lisp
+;; embedded in literate Org-mode files.
+
+;; Load up Org Mode and (now included) Org Babel for elisp embedded in Org Mode files
+;(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))
+(setq dotfiles-dir "~/.emacs.d/orgified-init")
+
+; Set up basic org-mode stuff here because the rest of this init file
+; is going to use org
+
+(add-to-list 'load-path (expand-file-name "~/src/org-mode/lisp/"))
+(add-to-list 'load-path (expand-file-name "~/src/org-mode/contrib/lisp/"))
+
+;; Set up Info directory to point to installed docs
+;; INFOPATH hack from http://www.emacswiki.org/emacs/InfoPath
+(setenv "INFOPATH" (concat
+		    (expand-file-name "~/src/org-mode/doc/")
+		    ":"
+		    (getenv "INFOPATH")
+		    )
+	)
+(add-hook 'Info-mode-hook; After Info-mode has started
+        (lambda ()
+	      (setq Info-additional-directory-list Info-default-directory-list)
+	      ))
+(require 'org)
+(require 'org-install)
+(require 'ob-tangle)
+(require 'ox-bibtex)
+;; load up all literate org-mode files in this directory
+(mapc #'org-babel-load-file (directory-files dotfiles-dir t "\\.org$"))
+
+;;; init.el ends here
+(custom-set-variables
+ ;; custom-set-variables was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ '(ansi-color-names-vector
+   ["#212526" "#ff4b4b" "#b4fa70" "#fce94f" "#729fcf" "#e090d7" "#8cc4ff" "#eeeeec"])
+ '(custom-enabled-themes (quote (manoj-dark)))
+ '(display-time-mode t)
+ '(doc-view-continuous t)
+ '(major-mode (quote org-mode))
+ '(org-contacts-files (quote ("~/Org/contacts.org")))
+ '(org-ditaa-jar-path "/Users/gmj/src/org-mode/contrib/scripts/ditaa.jar")
+ '(send-mail-function (quote smtpmail-send-it)))
+(put 'upcase-region 'disabled nil)
+
+; load specific files
+
+;(load "bibhook.el")
+(custom-set-faces
+ ;; custom-set-faces was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ )

+ 42 - 0
historical/.emacs.d.20150501/orgified-init/00-packageStuff.org

@@ -0,0 +1,42 @@
+*  Emacs package setup
+** What
+   Emacs pacakge setup things
+** Why
+   Because all this package stuff has to be set up somewhre
+** How
+   See code below.
+** Code
+   #+BEGIN_SRC emacs-lisp
+   (require 'package) (package-initialize) 
+   (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
+                           ("marmalade" . "http://marmalade-repo.org/packages/")
+                           ("melpa" . "http://melpa.milkbox.net/packages/")))
+   (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
+
+   ; manual path additions
+
+   ;(add-to-list 'load-path (expand-file-name "~/elisp/"))
+   ;(add-to-list 'load-path (expand-file-name "~/.emacs.d/"))
+   #+END_SRC
+
+** Things to do
+*** TODO Figure out how to keep elpa from pulling in org-mode when I insall org2blog
+   - I want to stay with direct git pulls of org
+   - When I install the org2blog package, it also pulls down org,
+     creating confusoin and load order problems.
+*** TODO Cheeck out https://github.com/jwiegley/use-package  
+** Also See
+   - http://orgmode.org/worg/org-contrib/babel/intro.html for a
+     description of how to orgify an ~/.emacs or ~/.emacs.d/init.el
+     config 
+   - To list packages installed
+     #+BEGIN_EXAMPLE
+     package-activated-list is a variable defined in `package.el'.
+     Its value is
+     (dired+ dired-details+ dired-details org-mime org-plus-contrib solarized-theme)
+     #+END_EXAMPLE
+
+
+
+
+

+ 148 - 0
historical/.emacs.d.20150501/orgified-init/05-misc-startup-stuff.org

@@ -0,0 +1,148 @@
+* Misc startup settings
+** What
+** Why
+** How
+** Code
+
+*** Misc
+#+BEGIN_SRC emacs-lisp
+#+END_SRC
+
+*** Set org-mode as the default major mode.
+#+BEGIN_SRC emacs-lisp
+; (setq major-mode 'org-mode)
+#+END_SRC 
+
+*** DONE Load up various code snippits
+#+BEGIN_SRC emacs-lisp
+(add-to-list 'load-path "~/elisp")
+(load "copyFilePath")
+(load "netWrapper")
+(load "git-timemachine")
+(load "gmj-orgDemoteNext")
+(load "gmj-wikilink")
+#+END_SRC 
+
+
+*** DONE random cusotmizations
+#+BEGIN_SRC emacs-lisp
+(setq visible-bell t)
+(setq require-final-newline t
+      default-major-mode 'text-mode
+      text-mode-hook 'turn-on-auto-fill
+      describe-function-show-arglist t)
+#+END_SRC 
+
+*** Pathexec stuff for OSX paths
+#+BEGIN_SRC emacs-lisp
+(require 'exec-path-from-shell) ;; if not using the ELPA package
+(exec-path-from-shell-initialize)
+#+END_SRC 
+
+
+
+*** DONE Flyspell
+
+#+BEGIN_SRC emacs-lisp
+    (dolist (hook '(text-mode-hook))
+      (add-hook hook (lambda () (flyspell-mode 1))))
+#+END_SRC
+
+*** DONE IDO Mode
+
+    See http://www.masteringemacs.org/articles/2010/10/10/introduction-to-ido-mode/
+
+#+BEGIN_SRC emacs-lisp
+  (setq ido-enable-flex-matching t)
+  (setq ido-everywhere t)
+  (ido-mode 1) 
+
+  (setq ido-use-filename-at-point 'guess)
+  (setq ido-create-new-buffer 'always) ; not working?  Still prompts
+  (setq ido-file-extensions-order '(".org" ".txt" ".py" ".log" ".el" ))
+  (setq ido-separator "\n")
+#+END_SRC
+
+#+RESULTS:
+: 
+
+*** DONE Recent files
+
+    See http://stackoverflow.com/questions/3527150/open-recent-in-emacs
+
+#+BEGIN_SRC emacs-lisp :output none
+(require 'recentf)
+(recentf-mode 1)
+(global-set-key "\C-xf" 'recentf-open-files)
+(setq recentf-auto-cleanup 'never)
+#+END_SRC
+
+
+
+*** Command abbrevs
+    See  http://ergoemacs.org/misc/emacs_abbrev_shell_elisp.html
+#+BEGIN_SRC emacs-lisp
+(defcustom xah-shell-abbrev-alist nil "alist of xah's shell abbrevs")
+
+(setq xah-shell-abbrev-alist
+          '(
+            ("rsync1" . "rsync -z -r -v -t --chmod=Dugo+x --chmod=ugo+r --delete --exclude='*~' --exclude='.bash_history' --exclude='logs/'  --rsh='ssh -l u80781' ~/web/ u80781@s30097.example.com:~/")
+
+            ("ssh" . "ssh -l u80781 xahlee.org ")
+            ("img1" . "convert -quality 85% ")
+            ("imgScale" . "convert -scale 50% -quality 85% ")
+            ("img256" . "convert +dither -colors 256 ")
+            ("imgBatch" . "find . -name \"*png\" | xargs -l -i basename \"{}\" \".png\" | xargs -l -i  convert -quality 85% \"{}.png\" \"{}.jpg\"")
+            ("img-bmp2png" . "find . -name \"*bmp\" | xargs -l -i basename \"{}\" \".bmp\" | xargs -l -i  convert \"{}.bmp\" \"{}.png\"")
+
+            ("grep" . "grep -r -F 'xxx' --include='*html' ~/web")
+
+            ("rm_empty" . "find . -type f -empty")
+            ("chmod_file" . "find . -type f -exec chmod 644 {} ';'")
+            ("rm~" . "find . -name \"*~\" -exec rm {} ';'")
+            ("findEmptyDir" . "find . -depth -empty -type d")
+            ("rmEmptyDir" . "find . -depth -empty -type d -exec rmdir {} ';'")
+            ("chmod2" . "find . -type d -exec chmod 755 {} ';'")
+            ("lynx" . "lynx -dump -assume_local_charset=utf-8 -display_charset=utf-8 -width=100")
+            ("vp" . "feh --randomize --recursive --auto-zoom --action \"gvfs-trash '%f'\" --geometry 1600x1000 ~/Pictures/ &")
+            )
+
+          )
+
+(defun xah-shell-commands (cmdAbbrev)
+  "insert shell command from a selection prompt."
+  (interactive
+   (list
+      (ido-completing-read "shell abbrevs:" (mapcar (lambda (x) (car x)) xah-shell-abbrev-alist) "PREDICATE" "REQUIRE-MATCH") ) )
+  (progn
+    (insert (cdr (assoc cmdAbbrev xah-shell-abbrev-alist)))
+    ))
+#+END_SRC
+
+#+RESULTS:
+: xah-shell-commands
+
+
+* R and ESS set up
+  See  http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html#sec-2
+#+BEGIN_SRC emacs-lisp :output none
+(add-to-list 'load-path "~/.emacs.d/elpa/ess-20141024.1610/lisp")
+(require 'ess-site)
+#+END_SRC
+
+#+RESULTS:
+: ess-site
+
+#+header: :width 8 :height 8 :R-dev-args bg="olivedrab", fg="hotpink"
+#+begin_src R :file z.pdf :results graphics
+,plot(matrix(rnorm(100), ncol=2), type="l")
+#+end_src
+
+#+RESULTS:
+
+** Things To Do
+?
+
+#+BEGIN_SRC emacs-lisp
+(message "05-misc-startup.org finished.")
+#+END_SRC

+ 225 - 0
historical/.emacs.d.20150501/orgified-init/10-ifdef.org

@@ -0,0 +1,225 @@
+* What
+  Code to do cpp ifdef-like substitution on org-mode export.
+* Why
+  Because I wanted to ifdef my resume for different versoins
+  (LinkedIn, etc)
+* How
+  Define functions to implmenet #define, #ifdef, etc.  Add as an
+  org-mode export hook.  Define keybindings.
+
+  See sample text below.
+
+* Who
+* When
+  To run on the current buffer by hand NOW type =C-x # b=.
+
+  To run automatically AT EXPORT, just run org-mode export.  The hook should fire.
+
+* Code
+** ifdef keybindings and function definitions
+#+BEGIN_SRC emacs-lisp
+  (global-set-key (kbd "C-x # i") 'ifdef-ifdef)
+  (global-set-key (kbd "C-x # d") 'ifdef-define)
+  (global-set-key (kbd "C-x # b") 'ifdef-buffer)
+
+  ; define global config things for ifdef.
+  ; I'm pretty sure global setq is not the right way...
+
+  ; set one of these
+  (setq ifdef-delete-chunks t) ;  delete non-matching chunks
+  (setq ifdef-comment-chunks nil) ;  delete non-matching chunks
+  (setq comment-start "#")
+
+  (defun my-text-mode-hook ()
+    (setq comment-start "#")
+    ; (message "my-text-mode-hook ran.")
+    )
+
+  (defun my-ifdef-hook (backend)
+    "Apply cpp(1) style ifdefs to buffer before org-mode export."
+    (ifdef-org-export-hook))
+
+  (add-hook 'org-export-before-parsing-hook 'my-ifdef-hook)
+
+
+  (add-hook 'text-mode-hook 'my-text-mode-hook)
+
+(defun ifdef-org-export-hook ()
+  "Export hook to apply #ifdef logic to buffer during org-mode export"
+  (interactive)
+  (setq ifdef-delete-chunks t) ;  delete non-matching chunks
+  (ifdef-buffer)
+  (ifdef-delete-all-ifdef-lines)
+)
+
+(defun ifdef-buffer ()
+  "Apply cpp-like #ifdef processing to current buffer."
+  (interactive)
+
+  (ifdef-define)
+  (goto-char (point-min))
+  (while (ifdef-ifdef) nil)
+  (ifdef-delete-all-ifdef-lines)
+)
+
+
+(defun ifdef-delete-all-ifdef-lines ()
+  "Delete all #define, #ifdef, and #endif lines in the current buffer"
+  (interactive)
+
+  (goto-char (point-min))
+
+  (while (re-search-forward "^\\s\-\*#\\(ifdef\\|define\\|endif\\)" nil t)
+    (setq pos1 (line-beginning-position) )
+    (forward-line 1)
+    (beginning-of-line)
+    (setq pos2 (line-beginning-position) )
+    (delete-region pos1 pos2)
+  )
+)
+
+(defun ifdef-define ()
+  "Find #ifdef FOO. (setq ifdef-condition FOO).  FOO can be an elisp regexp.
+
+e.g.  #define \(interesting\|contributions\)"
+  (interactive)
+  (setq ifdef-condition nil)
+
+  (let ((case-fold-search t))
+    (save-excursion 
+      (goto-char (point-min))
+      ; first #define wins
+      (if (search-forward-regexp "^\\s\-\*\\(#define\\) \\(.*$\\)" nil t) (setq ifdef-condition (match-string 2)))
+    ) ; save-excursion
+  ) ;let
+
+   (message (concat (concat "ifdef-condition is \"" ifdef-condition) "\""))
+  ifdef-condition
+)
+
+(defun ifdef-ifdef ()
+  "Delete the next non-matching #ifdef section.
+
+Find ifdef FOO. Cut it out if conditional not defined.
+Return t if #ifdef section found (matching or not), nil if not found or no pattern."
+
+  (interactive)
+  (catch 'exit
+    ; (message "ifdef-ifdef")
+    (let ((case-fold-search t))
+      (if (boundp 'ifdef-condition)
+          (progn ; true
+          (setq ifdef-look-for-this (concat "#ifdef " ifdef-condition))
+          ; (message (concat "ifdef-look-for-this " ifdef-look-for-this))
+          )
+          (progn ; false
+            (message "ifdef-condition not defined")
+          (throw 'exit nil)
+          )
+      )
+      (setq ifdef-found-ifdef-section nil)
+  
+      ; (message "ifdef-ifdef continue")
+      (let (beg end (cnt 1) ifdefChunk)
+  ;      (save-excursion
+         (progn
+           ; (message "ifdef-ifdef looking for chunk to delete")
+  	(when (re-search-forward
+  	       "^\\s\-\*#ifdef" nil t)
+  
+  	  (setq beg (match-beginning 0))
+  	  (while (re-search-forward "^\\s\-\*#endif" nil t)
+  	    (setq ifdef-chunk (buffer-substring beg (point)))
+            ; (message (concat "ifdef-chunk-START>" ifdef-chunk "<ifdef-chunk-END"))
+            ; (message (concat "ifdef-look-for-this " ifdef-look-for-this))
+            (setq ifdef-found-ifdef-section t)
+            (setq ifdef-delete-or-comment-this-chunk nil)
+
+            (when (not (string-match ifdef-look-for-this ifdef-chunk))
+              (setq ifdef-delete-or-comment-this-chunk t))
+              ; (message "ifdef-delete-or-comment-this-chunk")
+              (if ifdef-delete-or-comment-this-chunk
+                  (if ifdef-delete-chunks ; if delete-chunks
+                      (progn ; if delete chunks
+                        ; (message "deleting chunk")
+                        (delete-region beg (point))
+                           ; now get rid of any resulting blank lines
+  
+                        (setq ifdef-this-line-is-blank (looking-at "[ \t]*$"))
+                        (setq ifdef-this-line-is-blank t)
+                        (if ifdef-this-line-is-blank
+                            (delete-blank-lines); collapse surrounding bank lines to one
+                        )  
+                      )
+                      (if ifdef-comment-chunks ; else if comment chunks
+                          (progn 
+                            (comment-region beg (point))
+                          ) 
+                      ) ; if commenting this chunk
+                   ) ; if deleting this chunk
+               ) ; if commenting or deleting this chunk
+
+  	    (throw 'exit ifdef-found-ifdef-section)))
+  	nil)))))
+#+END_SRC
+
+* Some sample text
+#+BEGIN_EXAMPLE
+#deFine \(ALICE\|LARRY\)
+
+The start of the story is the same.
+
+#iFdef ALICE
+Alice is special, this message is just for her.
+#endif
+#ifdef BOB
+Bob gets a different story
+#endif
+#ifdef ALiCE
+For Alice, the story continues.
+#endif
+#ifdef BOB
+but Bob is left in the dark.
+#endif
+#ifdef LARRY
+Larry Boy.  Lean and mean, green machine, outta sight, DYN-O-MITE !!!
+Lorum ipsum.
+Foo.
+#endif
+#+END_EXAMPLE
+
+* To Do List
+** Clean up symbols
+   - [X] Make everything ifdef-
+   - [ ] Avoid globals (setq) whehn not neede
+** Check logic
+   - [X] correct placement after ifdef-ifdef ?
+** Think about name of ifdef-cut
+   - [X] should it be something like ifdef-ifdef ?
+** Think about doing it without regexps
+   - [ ] narrow-to-region
+   - [ ] see Le Wang's reply to my post on G++
+         https://github.com/lewang/ws-butler/blob/master/ws-butler.el#L109
+** Inhibit ifdef expansoin of example above on export
+   - It would be more useful as an example if ifdef left it alone
+   - Probably a conditional in the export hook.  Look for this file
+     name and skip ifdef processing, or find a way to quote the
+     #ifdefs
+** TODO Seems to only work with one #define, fix this
+** TODO Add #else or #ifndef
+
+* Test
+
+This is some text
+
+#define foo
+#define bar
+
+#ifdef foo
+   foo - should see this
+#endif
+
+#ifdef bar
+   bar - should see this too, but seems not to work.
+#endif
+

+ 98 - 0
historical/.emacs.d.20150501/orgified-init/10-usefulFunctions.org

@@ -0,0 +1,98 @@
+* Define Useful functions
+
+;; Adapted form From http://draketo.de/light/english/emacs/babcore
+;;
+;; save the current macro as reusable 
+;;
+;; gmj mods: save in ~/.emacs/savedKeyboardMacros.org
+;
+;(setq saved-keyboard-marcos-file (format "%s/%s" dotfiles-dir "savedKeyboardMacros.org"))
+;
+;(defun save-current-kbd-macro (name)
+;  "Save the current macro as named function definition inside
+;your initialization file so you can reuse it anytime in the
+;future."
+;  (interactive "SSave Macro as: ")
+;  (name-last-kbd-macro name)
+;  (save-excursion 
+;    (find-file-literally saved-keyboard-marcos-file)
+;    (goto-char (point-max))
+;    (insert "\n\n;; Saved macro\n")
+;    (insert "#+BEGIN_SRC emacs-lisp\n")
+;    (insert-kbd-macro name)
+;    (insert "\n")
+;    (insert "#+END_SRC\n")
+;    ))
+
+#+BEGIN_SRC emacs-lisp
+(defun chomp (str)
+  "Chomp leading and tailing whitespace from STR."
+  (while (string-match "\\`\n+\\|^\\s-+\\|\\s-+$\\|\n+\\'"
+		       str)
+    (setq str (replace-match "" t t str)))
+str
+)
+
+(defun insert-foo ()
+  "Insert foo in buffer"
+  (interactive)
+  (insert-string "foo")
+)
+
+
+(defun insert-date ()
+  "Insert current date and time in buffer"
+  (interactive)
+  (insert-string (current-time-string))
+)
+
+
+(defun insert-bar ()
+  "Insert bar in buffer"
+  (interactive)
+  (insert-string "bar")
+)
+
+
+; Adapted form From http://draketo.de/light/english/emacs/babcore
+;
+; save the current macro as reusable 
+;
+; gmj mods: save in ~/.emacs/savedKeyboardMacros.org
+
+(setq saved-keyboard-marcos-file (format "%s/%s" dotfiles-dir "savedKeyboardMacros.org"))
+
+(defun save-current-kbd-macro (name)
+  "Save the current macro as named function definition inside
+your initialization file so you can reuse it anytime in the
+future."
+  (interactive "SSave Macro as: ")
+  (name-last-kbd-macro name)
+  (save-excursion 
+    (find-file-literally saved-keyboard-marcos-file)
+    (goto-char (point-max))
+    (insert "\n\n;; Saved macro\n")
+    (insert "#+BEGIN_SRC emacs-lisp\n")
+    (insert-kbd-macro name)
+    (insert "\n")
+    (insert "#+END_SRC\n")
+    ))
+
+
+; From http://ergoemacs.org/emacs/emacs_unfill-paragraph.html
+(defun unfill-paragraph ()
+  "Replace newline chars in current paragraph by single spaces.
+This command does the inverse of `fill-paragraph'."
+  (interactive)
+  (let ((fill-column 90002000)) ; 90002000 is just random. you can use `most-positive-fixnum'
+    (fill-paragraph nil)))
+
+(defun unfill-region (start end)
+  "Replace newline chars in region by single spaces.
+This command does the inverse of `fill-region'."
+  (interactive "r")
+  (let ((fill-column 90002000))
+    (fill-region start end)))
+
+(message "usefulFunctions.org finished.")
+#+END_SRC

+ 52 - 0
historical/.emacs.d.20150501/orgified-init/15-locationLocationLocation.org

@@ -0,0 +1,52 @@
+* Determine locatoin and network connectoins
+
+;  
+; Attempt to determine location and set up things that are location dependant
+;
+; This needs work.
+;
+; Maybe look on stackoverflow to see how others are dealing with these issues;
+;
+
+
+#+BEGIN_SRC emacs-lisp
+
+; these should be set by .bashrc
+; I have srcipts in in ~/bin that try to figure this all out.
+
+; the Mac seems ill-behaved.  Check stackoverflow?
+
+(setq myOS (getenv "myOS"))
+(setq myLocation (getenv "myLocation"))
+(setq myPublicIP (getenv "myPublicIP"))
+(setq myPublicDomainName (getenv "myPublicDomainName"))
+(setq myNoSuchVar (getenv "myNoSuchVar"))
+
+
+(setq atHome nil)
+(setq atWork nil)
+(cond ((string-equal myLocation "home") (setq atHome t))
+      ((string-equal myLocation "work") (setq atWork t))
+      (t (message "Location Unknown"))
+      )
+
+(setq onMac nil)
+(setq onUbuntu nil)
+(cond ((string-equal myOS "mac") (setq onMac t))
+      ((string-equal myOS "ubuntu") (setq onUbuntu t))
+      (t (message "OS Unknown"))
+      )
+
+; execute stuff based on where we are.
+; expand this.
+
+; Do work specific setup here
+(if (file-exists-p "/Users/gmj/.emacs.atWork")
+      (load "/Users/gmj/.emacs.atWork"))
+
+(message "locationLocationLocation.org finished.")
+#+END_SRC
+
+#+RESULTS:
+: locationLocationLocation.org finished.
+

+ 87 - 0
historical/.emacs.d.20150501/orgified-init/20-acientKeybinding.org

@@ -0,0 +1,87 @@
+* My keybindings from ages past...
+
+#+BEGIN_SRC emacs-lisp
+(setq display-time-day-and-date t
+      display-time-24hr-format t)
+(display-time)
+
+;(global-set-key "\C-Xd" 'insert-date)
+(global-set-key "\C-\\" 'compile)
+;(global-set-key "\C-XP" 'plan)
+(global-set-key "\C-XR" 'gnus)
+;(global-set-key "\C-XW" 'w3m)
+(global-set-key "\C-]" 'call-last-kbd-macro)
+(global-set-key "\eq" 'query-replace)
+(global-set-key "\ey" 'yow)
+
+(global-set-key "\er" 'replace-string)
+(global-set-key "\em" 'set-mark-command)
+(global-set-key "\e " 'set-mark-command)
+(global-set-key "\e#" 'what-line)
+(global-set-key "\eg" 'goto-line)
+(global-set-key "\ei" 'ispell-buffer)
+;(global-set-key "\C-X\C-K" 'bury-buffer)
+(global-set-key "\C-he" 'emacs-version)
+(global-set-key "\ep" 'set-fill-prefix)
+(global-set-key "\C-Xp" 'fill-paragraph)
+(global-set-key "\C-Xc" 'copy-region-as-kill)
+(global-set-key "\C-X!" 'compile)
+(global-unset-key "\C-X\C-l")
+#+END_SRC
+
+
+* Newest Keybinding
+
+: http://emacsredux.com/blog/2013/05/19/delete-whitespace-around-point/
+
+(global-set-key (kbd "C-c j") 'just-one-space)
+
+; Courtesy of Xah Lee  http://ergoemacs.org/emacs/emacs_keybinding_power_of_keys_sequence.html
+
+#+BEGIN_SRC emacs-lisp
+(global-set-key (kbd "<f9> <f6>") 'visual-line-mode)
+(global-set-key (kbd "<f9> <f7>") 'linum-mode)
+(global-set-key (kbd "<f9> <f8>") 'whitespace-mode)    
+(global-set-key (kbd "<f9> <f9>") 'shell)
+(global-set-key (kbd "<f9> <f10>") 'calc)
+(global-set-key (kbd "<f9> <f11>") 'calendar)
+
+;(global-set-key (kbd "<f9> 3") 'xah-elisp-mode)
+;(global-set-key (kbd "<f9> 4") 'xah-php-mode)
+;(global-set-key (kbd "<f9> 5") 'xah-html-mode)
+;(global-set-key (kbd "<f9> 6") 'html-mode)
+
+;(global-set-key (kbd "<f9> <return>") 'xah-run-current-file)
+(global-set-key (kbd "<f9> SPC") 'flyspell-buffer)
+ #+END_SRC
+
+* Newer Keybinding
+
+#+BEGIN_SRC emacs-lisp
+(global-set-key "\C-X5" 'split-window-horizontally)
+(global-set-key (kbd "C-h SPC") 'man)
+#+END_SRC
+
+* Override bad defaults
+
+
+#+BEGIN_SRC emacs-lisp
+(defun use-gnus-to-send-mail ()
+  (interactive)
+  (error (substitute-command-keys "Use GNUS to send mail.")))
+
+(global-set-key "\C-Xm" 'use-gnus-to-send-mail)
+
+(defun dont-kill-emacs ()
+  (interactive)
+  (error (substitute-command-keys "To exit emacs: \\[kill-emacs]")))
+
+(global-set-key "\C-x\C-c" 'dont-kill-emacs)
+
+(message "locationLocationLocation.org finished.")
+#+END_SRC
+
+#+RESULTS:
+
+
+#  LocalWords:  SPC

+ 178 - 0
historical/.emacs.d.20150501/orgified-init/20-dired.org

@@ -0,0 +1,178 @@
+* What
+   Dired setup.   Part of an
+   ever evolving worldview mediated by
+   https://github.com/eludom/dotfiles
+* Why
+  Because you never want to use the mouse. 
+* How
+* Code
+#+BEGIN_SRC emacs-lisp
+
+
+
+
+; Dired setup
+;
+; Ideas from:
+;   http://truongtx.me/2013/04/24/dired-as-default-file-manager-1-introduction/
+;   http://blog.nguyenvq.com/2009/12/01/file-management-emacs-dired-to-replace-finder-in-mac-os-x-and-other-os/
+;
+
+(require 'dired)
+
+; sort by modified time by default
+(setq dired-listing-switches "-alt")
+
+; I kinda like having "." and ".." for navigation... (gmj)
+;
+;(setq-default dired-omit-mode t
+;				dired-omit-files "^\\.?#\\|^\\.$\\|^\\.\\.$\\|^\\.")
+;;; toggle omit mode C-o
+;(define-key dired-mode-map (kbd "C-o") 'dired-omit-mode)
+
+;
+; Mac specific stuff
+;
+
+(defun dired-do-shell-mac-open-vqn ()
+  (interactive)
+  (save-window-excursion
+    (dired-do-async-shell-command
+     "open" current-prefix-arg
+     (dired-get-marked-files t current-prefix-arg))))
+
+
+(defun tmtxt/dired-open-current-directory-in-finder ()
+  "Open the current directory in Finder"
+  (interactive)
+  (save-window-excursion
+    (dired-do-async-shell-command
+     "open .")))
+
+
+(if (eq system-type 'darwin)
+  (progn
+    (require 'ls-lisp)
+    (setq ls-lisp-use-insert-directory-program t)
+    (setq insert-directory-program "/usr/local/bin/gls")
+    (define-key dired-mode-map (kbd "s-o") 'dired-do-shell-mac-open-vqn)
+    (define-key dired-mode-map (kbd "s-O") 'tmtxt/dired-open-current-directory-in-finder)
+  )
+)
+
+
+;
+; Ubuntu specific stuff
+;
+
+; Ultimately  from  https://github.com/ubolonton/.emacs.d/blob/master/config/ublt-dired.el
+; Replace "gnome-open" as approipiate for the sytem (e.g. on a mac, it's just "open")
+; Should probably collapse this funciton with dired-do-shell-mac-open-vqn () and
+; parametirze the open funciont.
+
+(defun dired-open-native ()
+  "Open marked files (or the file the cursor is on) from dired."
+  (interactive)
+  (let* ((files (dired-get-marked-files t current-prefix-arg))
+         (n (length files)))
+    (when (or (<= n 3)
+              (y-or-n-p (format "Open %d files?" n)))
+      (dolist (file files)
+        (call-process "gnome-open"
+                      nil 0 nil file)))))
+
+; The use of "gnome-open" here should probably be parameterized.
+
+(defun dired-open-current-directory-in-GUI-file-manager ()
+  "Open the current directory in native GUI file namanger
+For those times when dired just wont do.
+"
+  (interactive)
+  (save-window-excursion
+    (dired-do-async-shell-command
+     "gnome-open .")))
+
+
+(if (eq system-type 'gnu/linux)
+  (progn
+     (setq on-gnu-linux t)
+;    (require 'ls-lisp)
+;    (setq ls-lisp-use-insert-directory-program t)
+;    (setq insert-directory-program "/opt/local/libexec/gnubin/ls")
+    (define-key dired-mode-map (kbd "s-o") 'dired-open-native)
+; this is not quite working 
+    (define-key dired-mode-map (kbd "s-O") 'dired-open-current-directory-in-GUI-file-manager)
+  )
+)
+
+; this may need to be changed if one does not have/use gnu ls(1)
+;(setq dired-listing-switches "--group-directories-first -atlh")
+
+; set up sorting options
+
+;(load-file "~/.emacs.d/dired-sort-map.el")
+
+;;;; dired-sort-map.el --- in Dired: press s then s, x, t or n to sort by Size, eXtension, Time or Name
+;
+;;; Copyright (C) 2002 -> Free Software Foundation, Inc.
+;
+;;; Inspired by Francis J. Wright's dired-sort-menu.el
+;;; Authors: Patrick Anderson, Santiago Mejia, Andy Stewart,
+;;;  Prof. Jayanth R Varma
+;
+;;; Versions:
+;;; don't remember
+;;; 2.2a bundled in NoteMacs
+;;; 2.2 Add help message suggested by Santiago Mejia
+;;; 2.3 Precede each switch with " -" as found by Prof. Jayanth R Varma
+;
+;;; This file is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2, or (at your option)
+;;; any later version.
+;
+;;;; Install:
+;;; Copy this file to a directory in your load path.
+;;; Execute: M-x eval-buffer :so you don't have to restart.
+;;; Add the line: (require 'dired-sort-map) : to your .emacs
+;
+;;;; Todo:
+;;; (add-hook
+;;;  'dired-load-hook
+;;;  '(lambda ()
+;;;     (progn
+;
+;;;; Code:
+;(require 'dired)
+;(defvar dired-sort-map (make-sparse-keymap))
+;
+;(define-key dired-mode-map "s" dired-sort-map)
+;
+;; (dired-sort-toggle-or-edit)  is this bound to a key?  It needs to be to acccess these....(gmj Sun Apr 28 07:57:41 2013)
+;
+;(define-key dired-sort-map "s" (lambda () "sort by Size" (interactive) (dired-sort-other (concat dired-listing-switches " -S"))))
+;(define-key dired-sort-map "x" (lambda () "sort by eXtension" (interactive) (dired-sort-other (concat dired-listing-switches " -X"))))
+;(define-key dired-sort-map "t" (lambda () "sort by Time" (interactive) (dired-sort-other (concat dired-listing-switches " -t"))))
+;(define-key dired-sort-map "n" (lambda () "sort by Name" (interactive) (dired-sort-other dired-listing-switches)))
+;(define-key dired-sort-map "?" (lambda () "sort help" (interactive) (message "s Size; x eXtension; t Time; n Name")))
+;;; )))
+;
+;(provide 'dired-sort-map)
+;;;; dired-sort-map.el ends here
+
+(message "20-dired.org finished.")
+#+END_SRC
+* 
+* To Do
+** TODO Merge darwin and ubuntu open fuctions  
+  
+** TODO fix arguments to allow listing of directorys first
+   - breaks dired directory listing over ssh to some systems
+     #+BEGIN_EXAMPLE
+     ;(setq dired-listing-switches "--group-directories-first -atlh")
+     #+END_EXAMPLE
+* For more info
+
+
+
+

+ 30 - 0
historical/.emacs.d.20150501/orgified-init/20-gnusSettings.org

@@ -0,0 +1,30 @@
+* Generic GNUS/mail setup.
+
+; Specific GNUS/mail setup (servers)
+;   - should be elsewhere
+
+#+BEGIN_SRC emacs-lisp
+(setq mm-discouraged-alternatives '("text/html" "text/richtext"))
+(setq gnus-inhibit-mime-unbuttonizing t)
+(setq gnus-mime-display-multipart-related-as-mixed t)
+(setq gnus-buttonized-mime-types
+      '("multipart/alternative" "multipart/signed"))
+
+(setq-default
+ gnus-summary-line-format "%U%R%z %(%&user-date;  %-15,15f %* %B%s%)\n"
+ gnus-user-date-format-alist '((t . "%Y-%m-%d %H:%M"))
+ gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references
+ gnus-thread-sort-functions '(gnus-thread-sort-by-date)
+ gnus-sum-thread-tree-false-root ""
+ gnus-sum-thread-tree-indent " "
+ gnus-sum-thread-tree-leaf-with-other "├► "
+ gnus-sum-thread-tree-root ""
+ gnus-sum-thread-tree-single-leaf "╰► "
+ gnus-sum-thread-tree-vertical "│")
+
+(message "gnusSettings.org finished.")
+#+END_SRC
+
+#+RESULTS:
+: │
+

+ 152 - 0
historical/.emacs.d.20150501/orgified-init/20-orgModeStuff.org

@@ -0,0 +1,152 @@
+* OrgMode Settings
+** What
+   - Set up various org-mode things
+** Why
+   - Because org-mode config stuff needs to be collected somewhere
+** How
+   - See code below
+** Code
+
+*** Randomness
+#+BEGIN_SRC emacs-lisp
+(defun org-random-element ()
+  "Choose a random element from the buffer.
+See URL `http://thread.gmane.org/gmane.emacs.orgmode/83545'.
+After all, who would not want the random number generator 
+in emacs lisp to chose what they have for dinner :-)"
+  (interactive)
+  (let ((element-start -1)
+        (count 1))
+    (while (not (org-first-sibling-p))
+      (org-goto-sibling t))
+    (save-excursion
+      (while (org-goto-sibling)
+              (setq count (+ 1 count))))
+    (org-forward-heading-same-level (random count))))
+(global-set-key "\eR" 'org-random-element)
+#+END_SRC
+
+
+*** Genreal Org stuff
+#+BEGIN_SRC emacs-lisp
+;(require 'ox-bibtex) ;; BIBTEX export to LaTeX not working.  Fix.
+;(setenv "TMPDIR" ".") ;; Why was this here ?  Breaks dired via ssh to to some hosts
+
+; gneral org mode settings
+
+(setq org-return-follows-link t)
+(setq org-use-property-inheritance t)
+(setq org-export-with-toc nil)
+
+; planning and agenda things
+
+;  
+
+(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
+
+(add-to-list 'org-structure-template-alist '("Q" "#+BEGIN_QUOTE\n?\"...\"\n#+END_QUOTE" "<quote>\n?\"...\"\n</quote>") )
+(global-set-key "\C-cl" 'org-store-link)
+;(global-set-key "\C-ca" 'org-agenda)
+;(global-set-key "\C-cb" 'org-iswitchb)
+;(global-set-key "\M-\C-g" 'org-plot/gnuplot)
+(setq org-agenda-include-diary t)
+(setq org-todo-keywords '((sequence "TODO" "IN-PROGRESS"  "|" "DONE" "WAITING" "DELEGATED" "CANCELED")))
+(setq org-directory "~/plans/")
+
+; org-mode babel settings
+
+;(require 'org-exp-blocks)
+(org-babel-do-load-languages
+    'org-babel-load-languages '((python . t) (sh . t) (lisp . t) (R . t) (ditaa . t)))
+(setq org-export-babel-evaluate nil)
+(setq org-confirm-babel-evaluate nil)
+(setq org-babel-sh-command "bash")
+
+; org-mode HTMLize email
+
+(require 'org-mime)
+(setq org-mime-library 'mml)
+(add-hook 'message-mode-hook
+          (lambda ()
+            (local-set-key "\C-c\M-o" 'org-mime-htmlize)))
+(add-hook 'org-mode-hook
+          (lambda ()
+            (local-set-key "\C-c\M-o" 'org-mime-org-buffer-htmlize)))
+
+(add-hook 'org-mime-html-hook
+          (lambda ()
+            (org-mime-change-element-style
+             "blockquote" "border-left: 2px solid gray; padding-left: 4px;")))  
+
+(add-hook 'org-mime-html-hook
+          (lambda ()
+            (org-mime-change-element-style
+             "pre" (format "color: %s; background-color: %s; padding: 0.5em;"
+                           "#E6E1DC" "#232323"))))
+;
+; Contacts setup
+;
+
+(require 'org-contacts)
+(setq org-contacts-files '("~/Org/contacts.org"))
+
+
+;      org-capture-templates '(("c" "contacts" entry (file "~/org/contacts.org")
+;                               "* %(mu4e-view-snarf-from 'name)
+
+(require 'org-capture)
+
+(setq org-directory "~/Org")
+(setq org-default-notes-file "~/Org/refile.org")
+
+;; I use C-M-r to start capture mode
+;(global-set-key (kbd "C-M-r") 'org-capture)
+(global-set-key (kbd "\C-cc") 'org-capture)
+;; I use C-c r to start capture mode when using SSH from my Android phone
+;(global-set-key (kbd "C-c r") 'org-capture)
+;; Capture templates for: TODO tasks, Notes, appointments, phone calls, and org-protocol
+(setq org-capture-templates
+      (quote (("t" "todo" entry (file "~/Org/refile.org")
+               "* TODO %?\n%U\n%a\n" :clock-in t :clock-resume t)
+              ("r" "respond" entry (file "~/Org/refile.org")
+               "* TODO Respond to %:from on %:subject\n%U\n%a\n" :clock-in t :clock-resume t :immediate-finish t)
+              ("n" "note" entry (file "~/Org/refile.org")
+               "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t)
+              ("j" "Journal" entry (file+datetree "~/Org/diary.org")
+               "* %?\n     %U\n     %a\n")
+              ("w" "org-protocol" entry (file "~/Org/refile.org")
+               "* TODO Review %c\n%U\n" :immediate-finish t)
+              ("p" "Phone call" entry (file "~/Org/refile.org")
+               "* PHONE %? :PHONE:\n%U" :clock-in t :clock-resume t)
+              ("h" "Habit" entry (file "~/Org/refile.org")
+               "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"<%Y-%m-%d %a .+1d/3d>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n"))))
+
+(add-to-list 'org-capture-templates
+             '("c" "Contacts" entry (file "~/Org/contacts.org")
+               "* %(org-contacts-template-name)
+                  :PROPERTIES:
+                  :EMAIL: %(org-contacts-template-email)
+                  :END:"))
+
+(require 'ox-confluence)
+
+(message "orgModeStuff.org finished.")
+#+END_SRC
+
+** Things to do
+*** TODO Think about splitting things out of here
+    - Stuff has accreted here over time
+*** TODO Clean up old cruft
+*** TODO Deal with different vesions of org here if needed
+    - curently ox-bibtex does not load on some older versions of org
+      (8.0.5), but org2blog/wp-new-entry has errors with newer versions
+    - Try to fix/and or isolate these failures here.
+*** TODO make bibtex export to LaTeX work
+*** TODO figure out why TMPDIR env was set and if unsetting breaks anything
+    - Was this needed for babel remote execution?
+    - was breaking DIRED on some hosts
+
+
+
+
+

+ 41 - 0
historical/.emacs.d.20150501/orgified-init/20-savedKeyboardMacros.org

@@ -0,0 +1,41 @@
+* Saved keyboard macros
+
+#+BEGIN_SRC emacs-lisp
+  
+  (fset 'sumrow
+     (lambda (&optional arg) "Sum a row of an ORG table.
+  Assumes starting position is at start of a row.
+  Assumes lirst column is a name and not to be summed.
+  Assumes last column is TOTAL. "
+       (interactive "p") (kmacro-exec-ring-item (quote ([5 18 124 18 6 67108896 5 2 23 1 19 19 19 6 2 67108896 5 2 3 43 25 tab] 0 "%d")) arg)))
+  
+  (fset 'sumcolumn
+     (lambda (&optional arg) "Sum a column of an ORG table.
+  Assumes point is in a column.
+  Wipes out current value.
+  Sums the column.
+  Moves to next column."
+       (interactive "p") (kmacro-exec-ring-item (quote ([18 124 6 67108896 19 124 2 23 3 43 25 tab] 0 "%d")) arg)))
+  
+  
+  ;; Saved macros
+  
+  ;; How do I add docstrings to these fset macros ?
+  ;; Can I just turn them into lamba with docstrings as above?  will the [...] work in kmacro-exec-ring-item?
+  
+  ; yank a (presumably) unfilled paragraph of text, unfill it, go to previous line (presumably
+  ; an element in a prevoulsy started org-mode bullet list, insert a new bullet, re-fill paragraph.
+  ; May want a option to add quotes.
+  (fset 'unfill-then-fill-bullet
+     [?\C-y escape ?x ?u ?n ?f ?i ?  ?p ?  return ?\C-a ?\C-p ?\C-e ?\C-c return ?\C-d ?\C-e ? ])
+  
+  (fset 'foo
+     [?\C-r ?d ?e ?f ?u ?n ?\C-a ?\C-  ?\C-e escape ?x ?c ?o ?p ?y ?- ?r ?e ?g ?  ?a ?  ?k ?  return])
+  
+  ;; Saved macro
+  
+  (fset 'upcaseFOO
+     [?\C-s ?f ?o ?o ?\C-b escape ?b escape ?u])
+  
+  (message "savedKeybaordMacros.org finished.")
+#+END_SRC

+ 121 - 0
historical/.emacs.d.20150501/orgified-init/30-blogging.org

@@ -0,0 +1,121 @@
+* Blogging
+* README
+  - These are some setup files for blogging to blogger.com from emacs org-mode
+  -  My .emacs.d/ setup for context https://github.com/eludom/dotfiles/tree/master/.emacs.d
+* Atom blogging via BPE
+** BPE Installation
+*** DONE Install Google Client commandline/API tools
+    On Ubuntu try
+    #+BEGIN_EXAMPLE
+    sudo apt-get install googlecl
+    #+END_EXAMPLE
+*** DONE Insall g-client emacs interface
+    See 
+    - http://www.emacswiki.org/emacs/GoogleClient
+    - http://emacspeak.blogspot.com/2007/03/emacs-client-for-google-services.html
+    - http://emacsgeek.blogspot.com/
+*** DONE Configure package
+     For me this looked like
+
+     #+BEGIN_EXAMPLE
+     cd ~src
+     bzunzip2 g-client.tar.bz2
+     tar -xvf g-client.tar
+     cd src/g-client
+     make config
+     make
+     #+END_EXAMPLE
+
+*** DONE install BPE form packages
+     
+** BPE posting instructions
+   - open an .org file
+   - C-c C-i to insert a template
+   - write the post
+   - C-c C-p to posts
+   - posts as draft
+   - bug: have to insert a " tagname" after "#+TAG:" in template.
+** BPE configuraiton code
+#+BEGIN_SRC emacs-lisp
+;; set up emacs interface to googlecl
+;(add-to-list 'load-path "~/src/g-client" t)
+;(load-library "g")
+;
+;; setup bpe
+;(require 'bpe)
+;(require 'htmlize nil 'noerror) ; to fontify source code block on your blog.
+;(setq bpe:account   "eludom@gmail.com")
+;(setq bpe:blog-name "usefulfoo")
+;(define-key org-mode-map (kbd "C-c C-p") 'bpe:post-article)
+;(define-key org-mode-map (kbd "C-c C-i") 'bpe:insert-template)
+;;; For Japanese, default is $LANG environment variable.
+;;(setq bpe:lang "ja_JP.UTF-8")
+
+#+END_SRC
+    
+* Wordpress blogging
+** org2blog installation
+** org2blog useful links
+   - https://github.com/punchagan/org2blog
+   - http://sachachua.com/blog/2013/08/helping-someone-get-started-with-emacs-and-org-mode-through-org2blog-troubleshooting-steps/
+** org2blog posting instructions
+   - Log in =M-x org2blog/wp-login=
+   - Create a posting template =M-x org2blog/wp-new-entry=
+   - post buffer as draft =C-c d M-x org2blog/wp-post-buffer=
+   - publish buffer  =C-c p C-u M-x org2blog/wp-post-buffer=
+   - post buffer as page draft  =C-c D M-x org2blog/wp-post-buffer-as-page=
+   - publish buffer as page  =C-c P C-u M-x org2blog/wp-post-buffer-as-page=
+** org2blog learning
+*** TODO play with it
+*** TODO learn how to post to different blogs
+*** TODO learn about tags, links, categories, etc.
+
+** org2blog configuration code
+#+BEGIN_SRC emacs-lisp
+(setq load-path (cons "~/.emacs.d/elpa/org2blog-20130707.323/" load-path))
+(require 'org2blog-autoloads)
+
+(setq org2blog/wp-blog-alist
+      '(("eludom"
+	 :url "http://eludom.wordpress.com/xmlrpc.php"
+	 :username "eludom"
+	 :default-title "Set a title next time"
+	 :default-categories ("personal")
+	 :tags-as-categories nil)
+	("food8forthought"
+	 :url "http://food8forthought.wordpress.com/xmlrpc.php"
+	 :username "eludom"
+	 :default-title "Set a title next time"
+	 :default-categories ("musings")
+	 :tags-as-categories nil)
+	("amusingfoo"
+	 :url "http://amusingfoo.wordpress.com/xmlrpc.php"
+	 :username "eludom"
+	 :default-title "Set a title next time"
+	 :default-categories ("amusing")
+	 :tags-as-categories nil)
+	("securityfoo"
+	 :url "http://securityfoo.wordpress.com/xmlrpc.php"
+	 :username "eludom"
+	 :default-title "Set a title next time"
+	 :default-categories ("security")
+	 :tags-as-categories nil)
+	("rawfoo"
+	 :url "http://rawfoo.wordpress.com/xmlrpc.php"
+	 :username "eludom"
+	 :default-title "Set a title next time"
+	 :default-categories ("raw")
+	 :tags-as-categories nil)
+	("usefulfoo"
+	 :url "http://usefulfoo.wordpress.com/xmlrpc.php"
+	 :username "eludom"
+	 :default-title "Set a title next time"
+	 :default-categories ("useful")
+	 :tags-as-categories nil)
+	))
+#+END_SRC
+
+#+BEGIN_SRC emacs-lisp
+(message "30-blogging.org finished.")
+#+END_SRC
+

+ 36 - 0
historical/.emacs.d.20150501/orgified-init/80-appearance.org

@@ -0,0 +1,36 @@
+* What: Things that affect appearance
+
+ Put things here that affect appearance.
+
+** How
+*** TODO Install "color-theme" pacakge
+
+** Documentation and links
+   - setting default font on macs ::  http://stackoverflow.com/questions/1257426/emacs-mac-osx-and-changing-default-font 
+** Why
+
+   Because the default text colors are sometimes bad.
+
+** Code
+#+BEGIN_SRC emacs-lisp
+(if (eq system-type 'darwin)
+    (set-face-attribute 'default nil :family "Andale_Mono" :height 200  :weight 'normal)
+  (set-face-attribute 'default (selected-frame) :height 150))
+
+; this is not working right on the mac.
+; it seems to be setting the theme, but 
+; then something is overriding it.
+
+(if (require 'color-theme nil t)
+    (progn
+      (setq color-theme-is-global t)
+      (color-theme-initialize)
+      (color-theme-charcoal-black)
+      )
+     (message "You need to install color-theme package")
+)
+
+
+(message "80-appearance done.")
+#+END_SRC
+

+ 14 - 0
historical/.emacs.d.20150501/orgified-init/99-runLast.org

@@ -0,0 +1,14 @@
+* Run these last
+
+;
+; Load my stuff last.  May override defaults
+;
+
+#+BEGIN_SRC emacs-lisp
+(load "~/elisp/emacs-rc-override") 
+(eval-after-load "org-exp" '(load "~/elisp/emacs-rc-override"))
+(message ".emacs finished")
+
+(message "99-runLast.org finished.")
+#+END_SRC
+

+ 93 - 0
install.sh

@@ -0,0 +1,93 @@
+#! /bin/bash
+#
+# Usage:
+#  installDotFiles [install|delete|list]
+#
+# Install my dotfiles on a new system. 
+#
+# Symlink everything from ~/ to ~/git/github.com/eludom/dotfiles
+#
+
+set -u -e
+
+if [ $# -eq 0 ]; then
+    op="install"
+elif [ $# -eq 1 ]; then
+    op=$1
+else
+    echo too many aruments
+    echo usage: $0 [install|delete|list]
+    exit
+fi
+
+GITREPO="git://github.com/eludom/dotfiles.git"
+GITHUBDIR="${HOME}/git/github.com/eludom"
+DOTFILES=${GITHUBDIR}/dotfiles
+
+NOW=`date "+%Y-%m-%d:%H:%M:%S"`
+
+if [ ! -d ${DOTFILES} ]; then
+    echo "installing dotfiles from github"
+
+    if [ -d GITHUBDIR ]; then
+	cd ${GITHUBDIR}
+	git pull ${GITREPO}
+    else
+	mkdir -p ${GITHUBDIR}
+	cd ${GITHUBDIR}
+	git clone ${GITREPO}
+    fi
+fi
+
+
+# install
+
+linkThese=( .bashrc .gitconfig bin)
+cd ${HOME}
+
+
+if [ "$op" == "install" ]; then
+
+  for linkThis in ${linkThese[@]}; do
+    if [ -L ${HOME}/${linkThis} ]; then
+      rm ${HOME}/${linkThis} # always redo the link in case I move things
+      ln -s ${DOTFILES}/${linkThis} .
+    elif [ -f ${HOME}/${linkThis} ]; then
+      mv ${linkThis} ${linkThis}.${NOW}.old
+      ln -s ${DOTFILES}/${linkThis} .
+    elif [ -d ${HOME}/${linkThis} ]; then
+       mv ${linkThis} ${linkThis}.${NOW}.old
+       ln -s ${DOTFILES}/${linkThis} .
+    else
+      ln -s ${DOTFILES}/${linkThis} .
+    fi
+  done
+
+# delete
+
+elif [ "$op" == "delete" ]; then
+  for linkThis in ${linkThese[@]}; do
+    if [ -L ${HOME}/${linkThis} ]; then
+	rm ${HOME}/${linkThis}
+    fi
+  done
+
+# list
+
+elif [ "$op" == "list" ]; then
+  for linkThis in ${linkThese[@]}; do
+    if [ -e ${HOME}/${linkThis} ]; then
+	file ${HOME}/${linkThis}
+    else
+	echo ${HOME}/${linkThis} does not exist
+    fi
+  done
+
+else
+  echo bad option $op. Should be one of insall or delete
+fi
+
+
+
+
+