just a snapshot of current working state
authorIan Kelling <ian@iankelling.org>
Thu, 11 Aug 2016 23:53:06 +0000 (16:53 -0700)
committerIan Kelling <ian@iankelling.org>
Mon, 9 Jan 2017 18:09:34 +0000 (10:09 -0800)
17 files changed:
.gitignore [new file with mode: 0644]
COPYING [new file with mode: 0644]
README [new file with mode: 0644]
compile-init-dir.el [new file with mode: 0644]
init.el [new file with mode: 0644]
my-init.org [new file with mode: 0644]
snippets/emacs-lisp-mode/.yas-parents [new file with mode: 0644]
snippets/emacs-lisp-mode/cond [new file with mode: 0644]
snippets/emacs-lisp-mode/defun [new file with mode: 0644]
snippets/emacs-lisp-mode/global-set-key [new file with mode: 0644]
snippets/emacs-lisp-mode/kbd [new file with mode: 0644]
snippets/org-mode/.yas-parents [new file with mode: 0644]
snippets/org-mode/src-block [new file with mode: 0644]
snippets/org-mode/src-emacs-lisp [new file with mode: 0644]
snippets/org-mode/src-haskell [new file with mode: 0644]
snippets/org-mode/src-shell [new file with mode: 0644]
snippets/sh-mode/ssh-here-doc [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..cbbab4e
--- /dev/null
@@ -0,0 +1,50 @@
+/abbrev_devs
+/ac-comphist.dat
+/auto-save-list
+/%backup%~
+/backups
+/bbdb
+/bookmarks
+/custom.el
+/elpa
+/emacs
+/eshell
+/flycheck-init*
+/.ido.last
+/info
+/ltxpng
+/my-init.el
+/network-security.data
+/org-clock-save.el
+/.org-id-locations
+/places
+/.python-environments
+/recentf
+/.savehist
+/.smex-items
+/tramp
+/url
+
+*.elc
+
+
+## ignore mail/gnus cruft for those who keep mail in this directory
+drafts
+Mail
+mail
+.newsrc-dribble
+.nnmail-cache
+#.newsrc-dribble#
+*.SCORE
+marks
+.session
+abbrev_defs
+scratch
+secret.org
+.emacs.desktop*
+.*~
+agent/*
+
+# until i get submodules going
+/src
+/src2
diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..94a9ed0
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program 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 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..a82a6e7
--- /dev/null
+++ b/README
@@ -0,0 +1,4 @@
+You won't want to try to use this repo as a whole due to very custom
+keybindings and thus some other stuff like package submodules I didn't
+setup. However, there is lots of stuff that could be useful, but
+ymmv: it's got some bugs and hasn't been cleaned up for publication.
diff --git a/compile-init-dir.el b/compile-init-dir.el
new file mode 100644 (file)
index 0000000..2427db7
--- /dev/null
@@ -0,0 +1,24 @@
+;; Copyright (C) 2014 Ian Kelling
+
+;; This program 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 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+(require 'dash)
+(cd "~/.emacs.d/src")
+(--map (when (and (not (string= it "gnus"))
+                  (not (string= it "bbdb"))
+                  (file-directory-p it))
+         (byte-recompile-directory (expand-file-name it) 0 t))
+       (directory-files "."))
+(byte-recompile-directory (expand-file-name "~/.emacs.d/elpa") 0 t)
+(byte-recompile-file (expand-file-name "~/.emacs.d/my-init.el") t)
diff --git a/init.el b/init.el
new file mode 100644 (file)
index 0000000..b3312e4
--- /dev/null
+++ b/init.el
@@ -0,0 +1,91 @@
+;; Copyright (C) 2014 Ian Kelling
+
+;; This program 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 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+;; do m-x benchmark-init to see some benchmark stats
+;;(add-to-list 'load-path "~/.emacs.d/src/benchmark-init-el/")
+;;(require 'benchmark-init-loaddefs)
+;;(benchmark-init/activate)
+
+
+;;; init.el --- the start of customization
+
+;; (toggle-debug-on-error) ;uncomment to help debug
+
+;; stop from minimizing & freezing the gui
+
+;; Added by Package.el.  This must come before configurations of
+;; installed packages.  Don't delete this line.  If you don't want it,
+;; just comment it out by adding a semicolon to the start of the line.
+;; You may delete these explanatory comments.
+(package-initialize)
+
+(global-unset-key (kbd "C-z"))
+
+;; these need to be done before the hook in order to satisfy the byte compiler
+(add-to-list 'load-path "~/.emacs.d/elpa/smartparens-20140328.809")
+(add-to-list 'load-path "~/.emacs.d/elpa/dash-20140308.656")
+
+(add-to-list 'load-path "~/.emacs.d/src/yasnippet")
+(add-to-list 'load-path "~/.emacs.d/src/ghci-completion")
+(add-to-list 'load-path "~/.emacs.d/src")
+(add-to-list 'load-path "~/.emacs.d/emacs/site-lisp/org")
+
+;; git version of gnus
+(add-to-list 'load-path "~/.emacs.d/src/gnus/lisp")
+(require 'info)
+(add-to-list 'Info-default-directory-list "~/.emacs.d/src/gnus/texi")
+
+;; needed for git version
+;;(add-to-list 'load-path "~/.emacs.d/src/haskell-mode")
+;;(require 'haskell-mode-autoloads)
+;;(add-to-list 'Info-default-directory-list "~/.emacs.d/src/haskell-mode")
+
+(require 'bbdb-loaddefs "~/.emacs.d/src/bbdb/lisp/bbdb-loaddefs.el")
+(setq bbdb-print-tex-path "~/.emacs.d/src/bbdb/tex")
+
+
+(add-to-list 'load-path "/a/opt/magit/git-modes")
+(add-to-list 'load-path "/a/opt/magit/magit")
+
+
+(add-hook 'server-visit-hook 'raise-frame)
+
+
+;; load init in `after-init-hook' so all packages are loaded
+;; todo, learn about the weird evaluation order of this hook that requires the quoting.
+;; adapted from starter-kit
+(add-hook 'after-init-hook
+          `(lambda ()
+             ;; todo, set this var in my-init.org and use it instead
+             ;; of .emacs.d
+             (setq init-dir ,(file-name-directory load-file-name))
+             (unless (equal (user-uid) 0) ; don't make root owned files
+               (byte-recompile-directory init-dir))
+             ;; (byte-recompile-directory init-dir 0) ; with the 0,
+             ;; compile .el files that have no .elc file already
+
+             ;; this must be loaded first to avoid an error:  void-function(cl-member)
+             (require 'cl)
+             ;;  added org-habit, org-drill, org-mobile from the defaults
+
+             (require 'org)
+             (setq org-modules (quote (org-bbdb org-bibtex org-docview org-gnus
+                                                org-info org-jsinfo org-irc org-mew
+                                                org-mhe org-rmail org-vm org-wl org-w3m
+                                                org-habit org-drill org-mobile)))
+             (org-babel-load-file (expand-file-name "my-init.org" init-dir))))
+
+;;; init.el ends here
diff --git a/my-init.org b/my-init.org
new file mode 100644 (file)
index 0000000..6d698da
--- /dev/null
@@ -0,0 +1,9238 @@
+#+TITLE: My Personal Init Customization
+#+OPTIONS: toc:nil num:nil ^:nil
+* copyright
+# Copyright (C) 2016 Ian Kelling
+
+# This program 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 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+* things that should be at the beginning
+#+begin_src emacs-lisp
+;; todo, evaluating this manually disables debug on error instead of toggling it
+;;(toggle-debug-on-error) ;uncomment to help debug and catch errors
+
+
+#+end_src
+
+
+packages installed from package manager: i pretty much prioritize repos this way: gnu, then melpa, then marmalade.
+
+package-activated-list:
+ac-dabbrev ac-haskell-process ack-and-a-half alect-themes auctex bash-completion bbdb csv-mode cyberpunk-theme dot-mode expand-region f find-file-in-project flycheck foreign-regexp ggtags ghc gnuplot-mode goto-chg haskell-mode heroku-theme highlight-indentation highlight-symbol htmlize inf-ruby info+ inkpot-theme jedi auto-complete jedi-core epc ctable concurrent key-chord leuven-theme logstash-conf magit git-commit magit-popup misc-fns mouse+ naquadah-theme nginx-mode occidental-theme org paredit pcsv php-mode pkg-info epl popup py-autopep8 python-environment deferred python-info python-mode rainbow-mode rust-mode rw-hunspell s smartparens smex smooth-scroll sr-speedbar strings swiper ivy tabulated-list tangotango-theme thingatpt+ undo-tree vimrc-mode volatile-highlights web-mode with-editor dash async ws-butler yasnippet
+
+alternate keyboards
+#+begin_src emacs-lisp
+;; todo, figure out an easy way to disable this when using external keyboard
+(if (display-graphic-p)
+    (setq
+     enter-key (kbd "<return>")
+     s-enter-key (kbd "<S-return>")
+     c-m-enter-key (kbd "<C-M-return>")
+     m-enter (kbd "<M-return>")
+     c-enter (kbd "<C-return>"))
+  (setq
+   enter-key (kbd "C-m")
+    s-enter-key (kbd "C-8")
+    c-m-enter-key (kbd "C-M-8")
+    m-enter (kbd "M-m")
+    c-enter (kbd "C-8")))
+
+(setq x200 (string= (system-name) "x2"))
+(setq search-key (if x200 "<menu>" "<kp-add>"))
+(setq shell-key (if x200 "<S-menu>" "<S-kp-equal>"))
+#+end_src
+
+- Ubiquitous Packages which should be loaded on startup rather than
+  autoloaded on demand since they are likely to be used in every
+  session.
+  #+name: starter-kit-load-on-startup
+  #+begin_src emacs-lisp
+    (require 'saveplace)
+    (require 'ffap)
+    (require 'uniquify)
+    (require 'ansi-color)
+    (require 'recentf)
+
+  #+end_src
+
+
+- Better to have a list of packages in here vs installed manually.
+  However, I install manually because sometimes there are two
+  versions and it is not necessarily easy to reconcile that.
+  #+begin_src emacs-lisp
+ ;; based on marmalage website front page.
+(require 'package)
+
+;; little kit to help remove a down server
+;; (setq package-archives nil)
+
+(add-to-list 'package-archives
+             '("marmalade" .
+               "http://marmalade-repo.org/packages/"))
+
+(add-to-list 'package-archives
+             '("melpa" . "http://melpa.milkbox.net/packages/") t)
+
+;; if this is a new machine/config, get package list
+;; not sure why we need it, but it is recommended in starter kit,
+;; and doesn't seem like a bad thing
+(unless package-archive-contents (package-refresh-contents))
+
+  #+end_src
+
+
+ keep our init.el clean, by moving customization elisp to it's own file
+#+name: m-x-customize-customizations
+#+begin_src emacs-lisp
+(setq custom-file "~/.emacs.d/custom.el")
+(load custom-file 'noerror)
+#+end_src
+
+undo tree stuff
+#+begin_src emacs-lisp
+;; more resilient undo-tree-history if we have their locations set up front.
+(setq undo-tree-history-directory-alist '(("." . "~/.undo-tree-history")))
+;; Undo in region just happens accidentally, and throws me off, and it's been buggy in the past
+(setq undo-tree-enable-undo-in-region nil)
+#+end_src
+
+* Stuff that I do not recommend that others use without reading,
+understanding, and customizing themselves are
+
+all mouse stuff disabled till i have time to figure it out again.
+#+begin_src emacs-lisp :tangle no
+(defun xterm-mouse-translate-1 (&optional extension)
+  (save-excursion
+    (let* ((event (xterm-mouse-event extension))
+           (ev-command (nth 0 event))
+           (ev-data    (nth 1 event))
+           (ev-where   (nth 1 ev-data))
+           (vec (vector event))
+           (is-down (string-match "down-" (symbol-name ev-command))))
+
+      (cond
+       ((null event) nil)              ;Unknown/bogus byte sequence!
+       (is-down
+        (setf (terminal-parameter nil 'xterm-mouse-last-down) event)
+        vec)
+       (t
+        (let* ((down (terminal-parameter nil 'xterm-mouse-last-down))
+               (down-data (nth 1 down))
+               (down-where (nth 1 down-data)))
+          (setf (terminal-parameter nil 'xterm-mouse-last-down) nil)
+          (cond
+           ((null down)
+            ;; This is an "up-only" event.  Pretend there was an up-event
+            ;; right before and keep the up-event for later.
+            (push event unread-command-events)
+            (vector (cons (intern (replace-regexp-in-string
+                                   "\\`\\([ACMHSs]-\\)*" "\\&down-"
+                                   (symbol-name ev-command) t))
+                          (cdr event))))
+           ((equal ev-where down-where) vec)
+           (t
+            (let ((drag (if (symbolp ev-where)
+                            0          ;FIXME: Why?!?
+                          (list (intern (replace-regexp-in-string
+                                         "\\`\\([ACMHSs]-\\)*" "\\&drag-"
+                                         (symbol-name ev-command) t))
+                                down-data ev-data))))
+              (if (null track-mouse)
+                  (vector drag)
+                (push drag unread-command-events)
+                (vector (list 'mouse-movement ev-data))))))))))))
+
+#+end_src
+* how to find auto-saved files that need recovering
+find a recently dated file in ~/.emacs.d/auto-save-list/, and see the files listed in it.
+#file# is an auto-save file. It may or may not be different than the file is corresponds to.
+If it is different, emacs will give a message about recovering it when you open it.
+
+
+
+* TODO shell mode reverse search hides 2nd+ line of multi-line result
+* TODO button for switching to scratch buffer
+* TODO figure out browsing files with broken nfs mount
+causes emacs to freeze until I kill -9 it.
+* TODO make a keybind to print var under cursor
+and actually, putting the start of it in th emodeline might be cool
+* TODO fix undo tree files literering filesystem
+* TODO c-<delete> in shell mode should send over
+previous line if current line is empty
+* TODO make c-m-s be just a control key for easier use
+* TODO bind a in group mode of gnus to c-u a,
+also, make a default for number of articles
+* TODO make auto-complete be on by default in sql-mode
+* TODO make an easy bind for open previous buffer
+* TODO i think my autosave for sudo-edit might be too fast
+it sometimes leaves #_asdfjasdf files littered
+* TODO readline-compleste doesn't work when you cat a file without a newline,
+and so the prompt is messed up. not sure exactly what needs to be in end, or if its anything
+* TODO figure out how to paste a path into find file
+probably have to use the old kind of find file
+* TODO readline-complete doesn't escape special chars in filenames
+* TODO readline-complete dev
+
+
+
+** misc fixes
+
+bad code, the comment this relates to was removed, but not the comment
+             /* If waiting for this channel, arrange to return as
+                soon as no more input to be processed.  No more
+                waiting.  */
+
+
+(status_notify): New arg WAIT_PROC. this is unused, this is a bug.
+The change in status_notify's return is just passing more information
+from what it did already. No changes at all inside this function.
+
+
+* TODO readline-complete: remove the hardcoded rlc-no-readline-hook
+* TODO isearch doesn't automatically wrap in info
+* TODO look into fixing shell mode reverse search
+and why auto-complete dies
+caveat is that it doesn't work well with certain unusual prompts, for example if $/# is not used at the end
+see if we can load history, or reverse search with history commands
+* TODO keybinds for s-delete/tab etc
+* TODO fix bbdb info packaging in melpa
+* TODO figure out why my emacs startup script doesn't work from dmenu
+* TODO post idea to make customize group show function var names so we can read doc strings
+* TODO report/fix bug that kill-whole-line doesn't work right with append kill
+* TODO make bash keybind for copy paste interoperate with x windows
+* TODO fix org stderr redirection
+make this produce output of "ok"
+#+begin_src sh
+echo ok >&2
+
+#+end_src
+* TODO make ido keybinds better
+* TODO fix indenting in org
+
+  (defun my-org-indent-region (start end)
+    "Indent region."
+    (interactive "r")
+    (save-excursion
+      (let ((line-end (org-current-line end)))
+        (goto-char start)
+        (while (< (org-current-line) line-end)
+          (cond ((org-in-src-block-p) (org-babel-do-in-edit-buffer (indent-according-to-mode)))
+                (t (call-interactively 'org-indent-line)))
+          (move-beginning-of-line 2)))))
+
+
+
+org-indent-region is broken for source blocks
+the above function works, but has several problems.
+first: it should not have separate logic from org-indent-line
+second: it runs way too slow, mainly the command
+ (org-babel-do-in-edit-buffer (indent-according-to-mode)))
+
+
+* TODO figure out newline in prompt shell issue
+setting this before readline-complete is loaded allows completion to work,
+but auto-completion still fails. Need to debug readline-complete to figure this out.
+(setq shell-prompt-pattern "^[^#$%>]*[#$]\n")
+* TODO setup bind for find tag / lisp function at point
+
+* TODO org-delete-char should also work for the delete/backspace keys!
+  fix and send patch
+
+* TODO checkout projectile / graphene's project settings
+
+* TODO check up on recent changes to 3rd party default configs
+- last checked apr 24
+  https://github.com/eschulte/emacs24-starter-kit/commits/master
+
+last checked mayish
+https://github.com/bbatsov/prelude
+- redefined mouse functions from this file
+
+* TODO figure out how to setup emacs to format text nicely like thunderbird
+* TODO it appears impossible make C-[ not be the same as escape
+* TODO movement within info buffer after opening a link doesn't cancel isearch
+leads to many frustrations
+* TODO fix org resolve clock message. it is innacurate
+  i is not the same, becuase it does not make org realize there is an active clock
+
+* TODO add apropos commands to help prefix, from
+  http://stackoverflow.com/questions/3124844/what-are-your-favorite-global-key-bindings-in-emacs
+* TODO my autosave goes into an endless prompting loop
+when running save buffer, and the buffer has been changed
+outside of emacs
+* TODO smart peren does not see ?\\) as a valid paren
+
+* TODO why does org-end-of-line not go all the way to the end on a closed headline?
+* TODO org makes random ... things, and delete right before them does ctrl-i
+* TODO try mark word, which might be a useful keybind
+* TODO fix org-cycle: it assumes which key it is bound to for its last alternative
+* TODO checkout lisp-complete-symbol to augment auto-complete
+* TODO learn dired.
+* TODO emacs keylogger to optimize key binds
+* TODO remap/investigate find tag, find tag at point
+* TODO set key to cycle buffers by mode, example below
+
+(defun cycle-buffer-by-mode (p-mode)
+  "Cycle buffers by mode name"
+  (interactive)
+  (dolist (buffer (buffer-list))
+    (with-current-buffer buffer
+      (when (buffer-live-p buffer)
+        (if (string-match p-mode mode-name) ;(regexp-quote p-mode)
+            (setq switch2buffer buffer)))))
+  (when (boundp 'switch2buffer)
+    (switch-to-buffer switch2buffer)))
+
+And I have bound this to my F9 key
+
+(global-set-key [f9]             '(lambda () (interactive) (cycle-buffer-by-mode "Shell$")))
+
+* TODO test out usefulness of forward/back sexp in different languages
+
+* TODO major mode settings to check out in future
+** emacs24 starter kit
+- Nxhtml -- utilities for web development
+[[http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html][Nxhtml]] is a large package of utilities for web development and for
+embedding multiple major modes in a single buffer.
+
+Nxhtml is not installed in this version of the starter-kit by default,
+for information on installing nxhtml see [[http://www.emacswiki.org/emacs/NxhtmlMode][EmacsWiki-Nxhtml]].
+
+web-mode is competing package and actively developed, so i'm using that instead
+
+
+  (dolist (package '(yaml-mode js2-mode))
+    (unless (package-installed-p package)
+
+- Associate modes with file extensions
+
+(add-to-list 'auto-mode-alist '("COMMIT_EDITMSG$" . diff-mode))
+(add-to-list 'auto-mode-alist '("\\.css$" . css-mode))
+(require 'yaml-mode)
+(add-to-list 'auto-mode-alist '("\\.ya?ml$" . yaml-mode))
+(add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
+(add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
+(add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js2-mode))
+;; (add-to-list 'auto-mode-alist '("\\.xml$" . nxml-mode))
+
+- clojure in starter-kit-lisp.org
+
+- others = gnus, js, publish, perl, python, perl, ruby
+   they each have their own starter kit file.
+
+- snippets for various modes other than org-mode
+
+* TODO update yasnippet documentation
+  yas expand key customization is rediculously hard to figure out
+  and completely undocumented
+* TODO fix org source indenting, send patch
+* TODO check out bundling aka compiling yasnippet
+* TODO try xml/html mode url func
+
+(defun view-url ()
+  "Open a new buffer containing the contents of URL."
+  (interactive)
+  (let* ((default (thing-at-point-url-at-point))
+         (url (read-from-minibfer "URL: " default)))
+    (switch-to-buffer (url-retrieve-synchronously url))
+    (rename-buffer url t)
+    ;; TODO: switch to nxml/nxhtml mode
+    (cond ((search-forward "<?xml" nil t) (xml-mode))
+          ((search-forward "<html" nil t) (html-mode)))))
+
+* TODO flyspell-buffer automatically
+
+* TODO respond to ediff thread
+* TODO fix horizontal mouse resizing
+  resizing a window horizontally with the mouse should be allowed in more places
+
+* TODO try using / making abbreviations
+
+* abbreviations
+#+begin_src emacs-lisp
+
+  ;; turn on abbrev mode globally
+  (setq-default abbrev-mode t)
+
+#+end_src
+default abbreviation mode file is .emacs.d/abbrev_defs.
+add-global-abbrev, add-mode-abbrev for expansion at point
+if all else fails, edit the abbrev file
+
+* auto-complete
+
+#+begin_src emacs-lisp
+;; auto-completion in minibuffer
+(icomplete-mode)
+
+(require 'auto-complete-config)
+(ac-config-default)
+
+
+;; complete after 1 char instead of default 2
+(setq ac-auto-start 1)
+(setq ac-delay 0.001)
+
+(add-to-list 'ac-modes 'org-mode 'sql-mode)
+
+(defun ac-common-setup ()
+  (add-to-list 'ac-sources 'ac-source-yasnippet))
+
+;; for org mode completion source taken from wiki.
+;; it did not work. no idea why. todo, investigate
+;; the ac-sources code is at http://www.emacswiki.org/emacs/AutoCompleteSources
+;; i've deleted it here so as to save space and not spam this file
+;;(defun my-ac-org-mode ()
+;;  (setq ac-sources (append ac-sources '(ac-source-org))))
+
+
+;; this makes the org-self-insert command not do a flyspell spell check.
+;; low priority thing to look into sometime
+(ac-flyspell-workaround)
+
+
+(define-key ac-completing-map (kbd "<up>") nil)
+(define-key ac-completing-map (kbd "<down>") nil)
+(define-key ac-completing-map (kbd "<S-return>") 'ac-expand)
+(define-key ac-completing-map "\t" 'ac-complete)
+(define-key ac-completing-map (kbd "<tab>") 'ac-complete)
+
+
+
+#+end_src
+* auto-complete readline-complete
+#+begin_src emacs-lisp
+
+(add-to-list 'load-path "~/.emacs.d/src/readline-complete")
+(require 'readline-complete)
+;; not sure how I made these, but I deleted, and
+;; it would be nice to make them again sometime
+;;(require 'src-loaddefs)
+
+;; disabled cuz broken
+;; redefining function in readline-complete so ac-complete only uses readline as a source
+(defun ac-rlc-setup-sources ()
+  "Add me to shell-mode-hook!"
+  (setq ac-sources '(ac-source-shell)))
+(add-hook 'shell-mode-hook 'ac-rlc-setup-sources)
+
+;; generally unnecessary, but why not
+(setq explicit-shell-file-name "bash")
+
+;; readline-complete says to add this line.
+;; however, it messes up my procfs directory tracking hook
+;; because get-process doesn't notice the child shell.
+;; instead, I've removed export EMACS=t from
+;;  comint-exec-1 (the function which initially sets it)
+;; by finding it in emacs sources and redefinind it here
+;; and done stty echo in my bashrc
+;;(setq explicit-bash-args '("-c" "export EMACS=; stty echo; bash"))
+
+(setenv "EMACS" "")
+(setq explicit-bash-args nil)
+(setq comint-process-echoes t)
+
+(add-to-list 'ac-modes 'shell-mode)
+
+;; readline-complete recommends this (i assume this format),
+;; but greping finds no reference in emacs or my .emacs.d
+;; so I'm assuming it is for an older emacs
+;;(setq explicit-ssh-args '("-t"))
+
+(add-hook 'shell-mode-hook
+          (lambda ()
+            (define-key shell-mode-map (kbd "<tab>") 'auto-complete)))
+
+
+#+end_src
+#+RESULTS:
+: comint-exec-1
+
+debugging
+
+
+* auto save & backup
+
+there is a bug that when emacs has been running for a long time,
+auto-save-timeout never happens simply by waiting.
+doing something like an M-x function will trigger it.
+Todo: report this bug.
+
+#+begin_src emacs-lisp
+
+;; enable auto-save hook
+(setq auto-save-timeout 1) ; idle time before auto-save.
+
+
+;; main hook for my auto save
+(add-hook 'auto-save-hook 'my-auto-save)
+;; additional hook to try to deal with emacs not auto-saving when a buffer isn't active
+(add-hook 'window-configuration-change-hook 'my-auto-save)
+
+
+(defun my-auto-save ()
+  (if (and my-as (buffer-file-name) (buffer-modified-p))
+      (let (message-log-max)
+        ;; a bit of a hack to partially suppress the constant saving in the echo area
+        (with-temp-message ""
+          (basic-save-buffer)))))
+
+(defun my-as-off ()
+  (interactive)
+  (setq my-as nil))
+
+(defun my-as-on ()
+  (interactive)
+  (setq my-as t))
+
+;; based on suggestion in the emacs docs, redefine these 2 functions
+;; to avoid prompt spamming the user when we do auto-save
+(defun ask-user-about-supersession-threat (fn)
+  (discard-input)
+  (message
+   "File for %s has changed on disk outside of emacs. Auto-save is overwriting it, however
+a backup is being created in case that is not what you intended." buffer-file-name)
+  (setq buffer-backed-up nil))
+
+(defadvice ask-user-about-lock (before lock-deactivate-as activate)
+  (make-local-variable 'my-as)
+  (setq my-as nil)
+  (message "proper autosave has been turned off for this buffer because of lock file problem.
+  In this buffer, do M-x my-as-on to reenable"))
+
+;; todo, this doesn't work consistently to override the auto-save message
+(defalias 'do-auto-save-original (symbol-function 'do-auto-save))
+(defun do-auto-save (&optional no-message current-only)
+  "This function has been modified to wrap the original so that NO-MESSAGE
+is  always set to t, since we auto-save a lot, it spams otherwise.
+The original doc string is as follows:
+
+Auto-save all buffers that need it.
+This is all buffers that have auto-saving enabled
+and are changed since last auto-saved.
+Auto-saving writes the buffer into a file
+so that your editing is not lost if the system crashes.
+This file is not the file you visited; that changes only when you save.
+Normally we run the normal hook `auto-save-hook' before saving.
+
+
+A non-nil NO-MESSAGE argument means do not print any message if successful.
+A non-nil CURRENT-ONLY argument means save only current buffer."
+  (interactive)
+  (do-auto-save-original t current-only))
+
+;; enable MY auto-save
+(my-as-on)
+
+#+end_src
+
+
+backups, separate from auto-save
+
+#+begin_src emacs-lisp
+
+    ;; set backup file location
+(setq backup-directory-alist '(("." . "~/.editor-backups")))
+(setq auto-save-file-name-transforms
+          '((".*" "~/.editor-backups/" t)))
+
+(setq version-control t ;; Use version numbers for backups
+      kept-new-versions 100
+      kept-old-versions 2
+      delete-old-versions t ;; delete old versions silently
+      ;; assume hard linked files are done on purpose, don't screw them up
+      backup-by-copying-when-linked t)
+
+;; todo, the time needs to be an integer, not a vector type thing
+(defun constant-backup ()
+  "Backup conditioned on some time passing since last one.
+  Hooked into 'before-save-hook."
+  (cl-flet ((b-time (minutes)
+                    (< last-backup-time
+                       (- (current-time) (* 60 minutes)))))
+    (when (or (not (boundp 'last-backup-time)) (and (< (buffer-size) 10000000) (b-time 5)) (b-time 30))
+      (setq buffer-backed-up nil)
+      (setq-local last-backup-time (current-time)))))
+
+;; make a backup on auto-save, because the backup feature is not
+;; utilized with my-auto-save, only normal interactive save.
+;; todo, enable when fixed
+;;(add-hook 'before-save-hook 'constant-backup)
+
+(add-hook 'auto-save-hook 'auto-save-size-limit)
+
+(defun auto-save-size-limit ()
+  (when (and (not backup-inhibited) (> (buffer-size) 2000000))
+    (message "Backups disabled for this buffer due to size > 2 megs")
+    (make-local-variable 'backup-inhibited)
+    (setq backup-inhibited t)))
+
+#+end_src
+
+
+
+background:
+      the faq suggests to auto-save using
+(setq auto-save-visited-file-name t)
+        and to toggle auto-saving in the current buffer, type `M-x auto-save-mode'
+
+        however, this is  buggy.
+        it leaves around lock files, which can be disabled with
+        (setq create-lockfiles nil)
+        but it is also buggy on other things that appear to hook onto file saving
+        so i created my own function, which originally had bugs,
+        but new emacs version fixed all that, yay!.
+
+
+; not using, but here for documentation,
+; alternate way to enable and specify how long between autosaves.
+        ; number of input events between autosave.
+        ; lowest bound of functionality is actually about 15 input events
+        ;(setq auto-save-interval
+** todo keep an eye out for why/when and fix the fact that normal auto-save files are being made soemtimes
+they are #filename#
+seems they are created
+
+* bbdb
+#+begin_src emacs-lisp
+;; based on bbdb manual
+;; also has instructions to initialize upon launching gnus, etc
+;; but I figure try this to make sure everything works all the time first
+(require 'bbdb)
+(bbdb-initialize 'message)
+
+;; recommended by gnus,
+;; but seems like it could be good to have set for other stuff
+(setq user-full-name "Ian Kelling"
+      user-mail-address "ian@iankelling.org")
+;; general email setting? recommended by mu4e
+(setq message-kill-buffer-on-exit t)
+
+
+;; based on emacs24-starter-kit
+(setq bbdb-offer-save 'auto
+      bbdb-notice-auto-save-file t
+      bbdb-expand-mail-aliases t
+      bbdb-canonicalize-redundant-nets-p t
+      bbdb-complete-name-allow-cycling t)
+
+;; use d instead
+(add-hook 'bbdb-mode-hook
+          (lambda () (define-key bbdb-mode-map (kbd "C-k") nil)))
+
+(add-to-list 'load-path "~/.emacs.d/src/bbdb-csv-import")
+(require 'bbdb-csv-import)
+        #+end_src
+
+* bookmark settings
+#+begin_src emacs-lisp
+; save bookmarks whenever they are changed instead of just when emacs quits
+(setq bookmark-save-flag 1)
+; increase bookmark context size for better functionality
+(setq bookmark-search-size 2000)
+#+end_src
+* c-like settings
+#+begin_src emacs-lisp
+;; change last thing from gnu.
+;; notably this avoids brace indent after if, and 4 space indent
+(setq c-default-style '((java-mode . "java")
+                        (awk-mode . "awk")
+                        (other . "stroustrup")))
+;; for emacs itself, use
+;; (setq c-default-style '((java-mode . "java")
+;;                         (awk-mode . "awk")
+;;                         (other . "gnu")))
+;; (setq-default c-basic-offset 2)
+#+end_src
+* color theme
+
+A Theme builder is available at http://elpa.gnu.org/themes/ along with
+a list of pre-built themes at http://elpa.gnu.org/themes/view.html and
+themes are available through ELPA.
+
+
+interesting light themes
+
+
+  #+begin_src emacs-lisp
+    (defun override-theme (arg)
+      (interactive)
+      (while custom-enabled-themes
+        (disable-theme (car custom-enabled-themes)))
+      (load-theme arg t))
+    (setq color-theme-is-global t)
+
+    (defun toggle-night ()
+     (interactive)
+      (if (equal (car custom-enabled-themes) 'naquadah)
+          (override-theme 'leuven)
+      (override-theme 'naquadah)))
+
+
+    (override-theme 'leuven) ;; org mode features, with monitor darkened. part of org-mode i think
+
+
+
+    ;; disable color thing with this:
+    ;;(disable-theme (car custom-enabled-themes))
+
+    ;; decent dark themes
+
+   ;;(override-theme 'tangotango)
+    ;;(override-theme 'deeper-blue)
+    ;;(override-theme 'tango-dark)
+    ;;(override-theme 'tsdh-dark)
+
+    ;;(override-theme 'heroku)
+    ;;(override-theme 'inkpot)  ;; part of inkpot-theme package
+    ;;(override-theme 'naquadah) ; org mode features, part of  naquadah-theme package
+    ;;(override-theme 'spolsky) ;; part of sublime-themes package
+    ;;(override-theme 'twilight-anti-bright)  ;; from twilight-anti-bright-theme package
+
+    ;; interesting but not usable colors
+    ;;(override-theme 'cyberpunk) ; cool org mode features, from cyberpunk-theme package
+    ;;(override-theme 'wombat) ; cursor not visible enough. from a wombat package, not sure which
+    ;;(override-theme 'misterioso) ; cursor not visible enough
+
+
+
+    ;;decent light themes
+    ;;(override-theme 'alect-light) ; theres a -alt version, don't see a dif. could use this without dimming. from alect-something package
+    ;;(override-theme 'occidental) ; from occidental-theme package
+
+
+    ;;color-theme is deprecated in emacs 24.
+
+;; theme packages i tried then removed:
+;; ignored ones that didn't use the new theme engine
+
+;;66 packages (zenburn-theme-2.1, zen-and-art-theme-1.0.1, waher-theme-20130917.7, ujelly-theme-1.0.35, twilight-theme-1.0.0, twilight-bright-theme-20130605.143, twilight-anti-bright-theme-20120713.316, tronesque-theme-1.3, tron-theme-12, toxi-theme-0.1.0, tommyh-theme-1.2, tango-2-theme-1.0.0, sunny-day-theme-20131203.1250, sublime-themes-20140117.323, subatomic-theme-20131011.1048, soothe-theme-0.3.16, soft-morning-theme-20131211.1342, soft-charcoal-theme-20130924.1206, sea-before-storm-theme-0.3, purple-haze-theme-20130929.1751, phoenix-dark-pink-theme-20130905.941, phoenix-dark-mono-theme-20130306.1215, pastels-on-dark-theme-0.3, obsidian-theme-20130920.937, nzenburn-theme-20130513, noctilux-theme-20131019.31, mustang-theme-20130920.939, monokai-theme-0.0.10, molokai-theme-20130828.0, late-night-theme-0.0, jujube-theme-0.1, ir-black-theme-20130302.2355, gruvbox-theme-20131229.1458, gruber-darker-theme-0.6, grandshell-theme-20140118.1003, github-theme-0.0.3, gandalf-theme-0.1, flatland-theme-20131204.858, django-theme-20131022.202, deep-thought-theme-0.1.1, dakrone-theme-20131212.1159, colorsarenice-theme-20131128.1106, color-theme-wombat+-0.0.2, color-theme-wombat-0.0.1, color-theme-twilight-0.1, color-theme-tango-0.0.2, color-theme-solarized-20120301, color-theme-sanityinc-solarized-2.25, color-theme-railscasts-0.0.2, color-theme-monokai-0.0.5, color-theme-molokai-0.1, color-theme-ir-black-1.0.1, color-theme-heroku-1.0.0, color-theme-github-0.0.3, color-theme-eclipse-0.0.2, color-theme-dpaste-0.0.1, color-theme-dawn-night-1.0, color-theme-colorful-obsolescence-0.0.1, color-theme-cobalt-0.0.2, color-theme-20080305.34, clues-theme-20130908.801, busybee-theme-20130920.942, bubbleberry-theme-0.1.2, assemblage-theme-20130715.621, anti-zenburn-theme-20140104.1542, ample-zen-theme-0.2)
+
+
+
+#+end_src
+
+* yasnippet
+cd ~/.emacs.d/src
+git clone --recursive https://github.com/capitaomorte/yasnippet
+touch snippets/.yas-make-groups
+
+  This all makes it so I can look through the default snippets
+  in the menu bar, but they don't show up elsewhere, because they are
+  mostly things I don't want.
+
+#+begin_src emacs-lisp
+
+    (require 'yasnippet)
+    ;; this needs to be before yas-global-mode
+    (setq yas-snippet-dirs (list "~/.emacs.d/snippets"))
+    (yas-global-mode 1)
+
+    (setq
+     yas-also-auto-indent-first-line t
+     yas-choose-tables-first t
+     yas-use-menu (quote full)
+     ;; this sets ido-prompt as first function
+     yas-prompt-functions
+     '(yas-ido-prompt yas-dropdown-prompt yas-x-prompt yas-completing-prompt yas-no-prompt))
+
+    ;; todo, explore this option for wrapping region
+    ;; '(yas/wrap-around-region t))
+
+#+end_src
+
+#+RESULTS:
+| yas-ido-prompt | yas-dropdown-prompt | yas-x-prompt | yas-completing-prompt | yas-no-prompt |
+
+* cross session settings
+  #+begin_src emacs-lisp
+
+;; Save a list of recent files visited.
+(recentf-mode 1)
+(setq recentf-max-saved-items 200
+      recentf-max-menu-items 15)
+
+
+(setq save-place t
+      save-place-version-control 'nospecial
+      save-place-limit 40000
+      save-place-file "~/.emacs.d/places")
+
+
+
+;; savehist keeps track of some history
+;; search entries
+(setq savehist-additional-variables '(kill-ring search-ring regexp-search-ring)
+      ;; save every minute
+      savehist-autosave-interval 60
+      ;; keep the home clean
+      savehist-file "~/.emacs.d/.savehist")
+(savehist-mode 1)
+
+#+end_src
+
+* ediff
+#+begin_src emacs-lisp
+;; ediff-buffers is the main command to use
+
+;; ediff - don't start another frame for the control panel
+;; unfortunately, this doesn't allow me to use 2 frames for the diff buffers
+;; so disable this temporarily with the next line if you want that
+;; sometime I should setup 2 functions to explicitly do each type
+(setq ediff-window-setup-function 'ediff-setup-windows-plain)
+;;(setq ediff-window-setup-function 'ediff-setup-windows-default)
+
+;; do side by side diffs
+(setq ediff-split-window-function 'split-window-horizontally)
+
+
+#+end_src
+
+
+
+Things I tried which didn't work, which intuitively I think should work better: I can open the second diff buffer in a new frame, and close it's window in the first frame after starting ediff, but when I hit n to go to the next diff, it restores the window in the first frame. Another thing I tried is to open 2 new frames and set them up as I want. However, if I try to open the *Ediff Control Panel* buffer in a different window from its original one, my mouse jumps to one of the diff frames, or if that isn't visible, the buffer just hangs until I select the original ediff control panel window. This seems like a bug to me. I am using a very recent development version of emacs.
+
+* dired
+#+begin_src emacs-lisp
+
+;; dired - reuse current buffer by pressing 'a'
+(put 'dired-find-alternate-file 'disabled nil)
+#+end_src
+
+* disabled but saved for documentation purposes
+  :PROPERTIES:
+  :tangle:   no
+  :END:
+** bash-completion
+#+begin_src emacs-lisp
+;; this eventually gets set in
+;; comint-dynamic-complete-functions
+;; (car comint-dynamic-complete-functions)
+(autoload 'bash-completion-dynamic-complete "bash-completion"
+  "BASH completion hook")
+(add-hook 'shell-dynamic-complete-functions
+          'bash-completion-dynamic-complete)
+
+;; this appears useless, but was in the recommended init code
+(add-hook 'shell-command-complete-functions
+          'bash-completion-dynamic-complete)
+
+(defun ac-rlc-setup-sources ()
+  "Add me to shell-mode-hook!"
+  (setq ac-sources '(ac-source-shell)))
+(add-hook 'shell-mode-hook 'ac-rlc-setup-sources)
+
+#+end_src
+
+** ace-jump
+  It is an awesome mode for keyboard navigation.
+  However, using the mouse takes less thought and works as well,
+  especially with my foot mouse ;)
+
+  #+begin_src emacs-lisp
+
+
+
+
+    ;; this has a problem that it doesn't work with emacsclient, so I'm using a more standard method
+    ;; This has the benefit of working with less fuss otherwise, I think.
+    ;; no method works on a terminal
+    ;; makes C-i and tab be distinct. same deal is done for c-m
+    ;;(setq local-function-key-map (delete '(tab . [9]) local-function-key-map))
+    ;;  (define-key input-decode-map (kbd "C-i") [f15])
+    ;;  (define-key input-decode-map (kbd "<f15>") [?\C-i])
+    ;;  (define-key input-decode-map (kbd "<tab>") [?\C-i])
+    ;;  (global-set-key (kbd "<f15>") 'query-replace)
+
+
+                                            ; not using ace jump mode, but if mouse is ever not good,
+                                            ; here is config for it
+    (require 'ace-jump-mode)
+    (eval-after-load "ace-jump-mode"
+      '(ace-jump-mode-enable-mark-sync))
+    (define-key global-map (kbd "") 'ace-jump-mode)
+
+
+
+    ;; revert buffers automatically when underlying files are changed externally
+    ;; too dangerous, and thus disabled.
+    ;; do m-x auto-revert-mode to auto-rever a specific buffer
+    ;;(global-auto-revert-mode t)
+
+
+    ;; whitespace-mode config. minimal for bad whitespace
+                                            ;(setq whitespace-line-column 80) ; for style of lines-tail, but I have it disabled
+    (setq whitespace-style '(face tabs empty trailing))
+                                            ;to enable whitespace mode
+    (whitespace-mode +1)
+
+
+
+    (defun org-set-mark-command (arg)
+      "Do set-mark-command and then org-show-context if the point
+              moves to invisible text."
+      (interactive "P")
+      (let ((initial-point (point)))
+        (setq this-command 'set-mark-command)
+        (set-mark-command (arg))
+        (if (and (not (= (point) initial-point))
+                 (or (outline-invisible-p) (org-invisible-p2)))
+            (org-show-context 'mark-goto))))
+
+    (defun org-exchange-point-and-mark (&optional arg)
+      (interactive "P")
+      (let ((initial-point (point)))
+        (exchange-point-and-mark)
+        (if (and (not (= (point) initial-point))
+                 (or (outline-invisible-p) (org-invisible-p2)))
+            (org-show-context 'mark-goto))))
+
+
+    (defun toggle-mode-line ()
+      "Toggle mode line on and off."
+      (interactive)
+      (if mode-line-format
+          (progn (setq my-saved-mode-line-format mode-line-format)
+                 (setq mode-line-format nil))
+        (setq mode-line-format my-saved-mode-line-format))
+      (force-mode-line-update))
+    (toggle-mode-line)
+    (global-set-key (kbd "M-m") 'toggle-mode-line)
+    (add-hook 'after-change-major-mode-hook
+              (lambda () (setq my-saved-mode-line-format mode-line-format)
+                (setq mode-line-format nil)))
+
+
+  #+end_src
+
+** Copy mode-line to the top
+  #+begin_src emacs-lisp
+;; Copy mode-line to the top
+(setq-default header-line-format mode-line-format
+mode-line-format nil)
+;; copied the mode-line theme into the header theme, else it is unreadable
+;; this goes after loading the theme
+(let ((class '((class color) (min-colors 89))))
+(custom-theme-set-faces
+   'leuven
+     `(header-line ((,class (:box (:line-width 1 :color "#1A2F54") :foreground "#85CEEB" :background "#335EA8"))))))
+
+  #+end_src
+
+** tab bindings for when I wanted to make tab be for search
+#+begin_src emacs-lisp
+
+  (define-key emacs-lisp-mode-map (kbd "<tab>") nil)
+  (define-key button-buffer-map "\t" nil)
+  (define-key button-buffer-map (kbd "f") 'forward-button)
+  (define-key Info-mode-map "\t" nil)
+  (define-key widget-keymap "\t" nil)
+  (define-key widget-keymap (kbd "<tab>") nil)
+
+  (add-hook 'compilation-mode-hook (lambda ()
+                                     (define-key compilation-mode-map (kbd "<tab>") nil)
+                                     (define-key compilation-mode-map "\t" nil)))
+
+;; unbind c-i for yas. it already separately binds <tab>
+  (add-hook 'yas-minor-mode-hook (lambda ()
+                                     (define-key yas-minor-mode-map "\t" nil)))
+
+  (add-hook 'haskell-interactive-mode-hook
+            (lambda ()
+              (define-key haskell-interactive-mode-map "\t" nil)
+              (define-key haskell-interactive-mode-map (kbd "<tab>") 'haskell-interactive-mode-tab)))
+
+    (define-key minibuffer-local-must-match-map "\t" nil)
+  (define-key minibuffer-local-must-match-map (kbd "<tab>") 'minibuffer-complete)
+  (define-key minibuffer-local-completion-map (kbd "<tab>") 'minibuffer-complete)
+  (define-key minibuffer-local-completion-map "\t" 'minibuffer-complete)
+
+  (add-hook 'ido-setup-hook
+            (lambda()
+              (define-key ido-completion-map (kbd "<tab>") 'ido-complete)
+              (define-key ido-completion-map "\t" nil)))
+
+#+end_src
+
+** kill buffer and window
+#+begin_src emacs-lisp
+ (defun kill-buffer-and-window ()
+        "Close the current window and kill the buffer it's visiting."
+        (interactive)
+        (progn
+          (kill-buffer)
+          (delete-window)))
+#+end_src
+** sending multiple commands to a comint buffer
+without waiting for commands to finish is unreliable.
+seems like 1 in 100 times, an invisible command to restore prompt didn't work
+#+begin_src emacs-lisp
+(setq shell-unset-prompt "unset PROMPT_COMMAND; unset PS1")
+  (setq shell-set-prompt "PROMPT_COMMAND=prompt_command")
+
+(if (boundp 'shell-unset-prompt)
+              (send-invisible-string proc shell-unset-prompt))
+(if (boundp 'shell-set-prompt)
+              (send-invisible-string proc shell-set-prompt))
+
+
+  (defun send-invisible-string (proc string)
+    "Like send-invisible, but non-interactive"
+    (comint-snapshot-last-prompt)
+    (funcall comint-input-sender proc string))
+
+#+end_src
+
+
+
+** mu4e
+
+alsot tried notmuch, it had some glitches, and it's config
+has a list of folders which i'd rather not publish, so it's config is archived.
+
+#+begin_src emacs-lisp
+(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e")
+(require 'mu4e)
+(setq send-mail-function (quote sendmail-send-it) ;; common to gnus also
+      mu4e-sent-folder   "/Sent Items"
+      mu4e-drafts-folder "/Drafts"
+      mu4e-trash-folder  "/Trash"
+      mu4e-refile-folder "/Archive"
+      mu4e-get-mail-command "offlineimap"
+      mu4e-update-interval 60
+      mu4e-sent-messages-behavior 'delete
+      mu4e-use-fancy-chars t
+      mu4e-confirm-quit nil
+      mu4e-headers-leave-behavior 'apply ;; dont ask
+      mu4e-headers-fields (delq (assoc :mailing-list mu4e-headers-fields) mu4e-headers-fields)
+      ;; a bit faster than the default 500
+      mu4e-headers-results-limit 80)
+
+(define-key mu4e-headers-mode-map (kbd "<return>") 'mu4e-headers-view-message)
+
+(defun my-mu4e-to ()
+  "inspired by mu4e info manual"
+  (--reduce-from (if (mu4e-message-contact-field-matches
+                      mu4e-compose-parent-message :to (cadr it))
+                     (concat (car it) (cadr it))
+                   acc)
+                 '("Ian Kelling <ian@iankelling.org")
+                 ;;'(("Ian Kelling " "<alternate1@example.com>")
+                 ;;  ("Ian Kelling " "<alternate2@example.com>"))
+                   ))
+
+(add-hook 'mu4e-compose-pre-hook 'my-mu4e-to)
+
+(add-to-list 'mu4e-view-actions
+             '("ViewInBrowser" . mu4e-action-view-in-browser) t)
+(setq mu4e-maildir-shortcuts
+      '( ("/INBOX"     . ?i)
+         ("/bog"  . ?b)
+         ("/Drafts"     . ?d)))
+
+#+end_src
+
+
+
+
+** org-mode auto-complete source
+
+todo, someday take a look at this. it is broken.
+
+;(defvar ac-source-eshell-pcomplete
+;  '((candidates . (pcomplete-completions))))
+;(defun ac-complete-eshell-pcomplete ()
+;  (interactive)
+;  (auto-complete '(ac-source-eshell-pcomplete)))
+
+;(add-hook 'org-mode-hook (lambda () (setq ac-sources (cons 'ac-source-eshell-pcomplete ac-sources))))
+;(add-to-list 'ac-modes 'eshell-mode)
+
+
+** gnus nice unicode
+
+
+this looks nice, but it lags gnus just a bit
+#+begin_src emacs-lisp
+
+(defun gnus-pretty-chars-setup ()
+  (when window-system
+    (setq gnus-sum-thread-tree-indent "  "
+          gnus-sum-thread-tree-root "● "
+          gnus-sum-thread-tree-false-root "◯ "
+          gnus-sum-thread-tree-single-indent "◎ "
+          gnus-sum-thread-tree-leaf-with-other "├─► "
+          gnus-sum-thread-tree-vertical "│"
+          gnus-sum-thread-tree-single-leaf "╰─► ")))
+;; dunno why, but this didn't work just setting on startup
+(add-hook 'gnus-startup-hook 'gnus-pretty-chars-setup)
+
+#+end_src
+
+** readline complete fix, replaced with proper solution
+
+i had commented out a few lines here, but instead I am setting in my profile
+the environment variable I commented out here. Yes, that is not the best explanation, but I will probably delete this as
+old history anyways.
+#+begin_src emacs-lisp
+
+(defun comint-exec-1 (name buffer command switches)
+  (let ((process-environment
+        (nconc
+         ;; If using termcap, we specify `emacs' as the terminal type
+         ;; because that lets us specify a width.
+         ;; If using terminfo, we specify `dumb' because that is
+         ;; a defined terminal type.  `emacs' is not a defined terminal type
+         ;; and there is no way for us to define it here.
+         ;; Some programs that use terminfo get very confused
+         ;; if TERM is not a valid terminal type.
+         ;; ;; There is similar code in compile.el.
+         (if (and (boundp 'system-uses-terminfo) system-uses-terminfo)
+             (list "TERM=dumb" "TERMCAP="
+                   (format "COLUMNS=%d" (window-width)))
+           (list "TERM=emacs"
+                 (format "TERMCAP=emacs:co#%d:tc=unknown:" (window-width))))
+          ;; ian: commented this out
+         ;;(unless (getenv "EMACS")
+         ;;  (list "EMACS=t"))
+         (list (format "INSIDE_EMACS=%s,comint" emacs-version))
+         process-environment))
+       (default-directory
+         (if (file-accessible-directory-p default-directory)
+             default-directory
+           "/"))
+       proc decoding encoding changed)
+    (let ((exec-path (if (and command (file-name-directory command))
+                        ;; If the command has slashes, make sure we
+                        ;; first look relative to the current directory.
+                        (cons default-directory exec-path) exec-path)))
+      (setq proc (apply 'start-file-process name buffer command switches)))
+    ;; Some file name handler cannot start a process, fe ange-ftp.
+    (unless (processp proc) (error "No process started"))
+    (let ((coding-systems (process-coding-system proc)))
+      (setq decoding (car coding-systems)
+           encoding (cdr coding-systems)))
+    ;; Even if start-file-process left the coding system for encoding data
+    ;; sent from the process undecided, we had better use the same one
+    ;; as what we use for decoding.  But, we should suppress EOL
+    ;; conversion.
+    (if (and decoding (not encoding))
+       (setq encoding (coding-system-change-eol-conversion decoding 'unix)
+             changed t))
+    (if changed
+       (set-process-coding-system proc decoding encoding))
+    proc))
+#+end_src
+** misc
+#+begin_src emacs-lisp
+
+; todo, is this require things necessary?
+;    (require 'flyspell)
+
+
+
+  ; whenever M-tab is completion, swap it with tab
+  ;(define-key emacs-lisp-mode-map (kbd "<tab>") 'completion-at-point)
+  ;(define-key emacs-lisp-mode-map (kbd "C-M-i") 'indent-for-tab-command)
+  ;(define-key lisp-interaction-mode-map (kbd "<tab>") 'completion-at-point)
+  ;(define-key lisp-interaction-mode-map (kbd "C-M-i") 'indent-for-tab-command)
+  ;the global tab keyind. for some reason this totally screws up mini-buffer tab.
+  ; disabled until I actually find myself using this, and find a fix for the above problem
+  ;(global-set-key (kbd "<tab>")  'complete-symbol)
+
+
+  ; todo, see how mastering emacs defines this function
+  ;(global-set-key (kbd "M-j") 'ido-goto-symbol)
+
+
+  ; todo, make my custom overlays have an underline if they are
+  ;  overriding a paren matching overlay
+  ; make right click set the mark
+  ; make search tab do completion instead of meta-tab
+  ; in isearch, move C-y to C-v
+  ; in isearch, move c-s to c-f
+
+  ;  some testing to figure out the underlining when paren highlight conflicts
+  ;      (let ((extra-overlays (overlays-at (1+ end-point))))
+  ;       (when extra-overlays (print extra-overlays)))
+
+
+
+
+  ; commented out because it messes up yank-pop.
+; todo, fix it someday
+  ; make yank linewise if it ends in a newline
+  ;(defadvice yank (before linewise-yank-advice activate)
+  ;  (let ((arg (ad-get-arg 0)))
+  ;  (when (string-match "\n[ \t]*$" (current-kill (cond
+  ;;                        ((listp arg) 0)
+  ;;                        ((eq arg '-) -2)
+  ;;                        (t (1- arg))) t))
+  ;; (move-beginning-of-line nil))))
+
+
+
+; todo, look into augmenting auto-complete with hippie expand.
+; starter kit has some hippie expand settings to look into:
+; (when (boundp 'hippie-expand-try-functions-list)
+;    (delete 'try-expand-line hippie-expand-try-functions-list)
+;    (delete 'try-expand-list hippie-expand-try-functions-list))
+
+
+;; hippie expand is dabbrev expand on steroids
+;(setq hippie-expand-try-functions-list '(try-expand-dabbrev
+;                                         try-expand-dabbrev-all-buffers
+;                                         try-expand-dabbrev-from-kill
+;                                         try-complete-file-name-partially
+;                                         try-complete-file-name
+;                                         try-expand-all-abbrevs
+;                                         try-expand-list
+;                                         try-expand-line
+;                                         try-complete-lisp-symbol-partially
+;                                         try-complete-lisp-symbol))
+;; use hippie-expand instead of dabbrev
+;(global-set-key (kbd "M-/") 'hippie-expand)
+
+
+; commented because i haven't had time to check it out yet
+;; shorter aliases for ack-and-a-half commands
+;(defalias 'ack 'ack-and-a-half)
+;(defalias 'ack-same 'ack-and-a-half-same)
+;(defalias 'ack-find-file 'ack-and-a-half-find-file)
+;(defalias 'ack-find-file-same 'ack-and-a-half-find-file-same)
+
+
+
+
+; todo. take a look at fixing this
+;delete-old-versions t ; fix description in http://www.emacswiki.org/emacs/ForceBackups
+
+
+
+
+;; prelude uses paredit mode.
+;; paredit has some useful stuff but also annoying stuff.
+;; if I ever do a ton of lisp coding, I should look into it
+
+
+
+
+
+
+  ; random notes and example code
+
+
+  ; usefull thing
+  ;(map 'list #'list tabSwapKeys (reverse (getBinds tabSwapKeys)))
+
+  ; example of getting keymap info
+  ;(car (car (minor-mode-key-binding (kbd "C-/") t)))
+  ;(cdr (car (minor-mode-key-binding (kbd "C-/") t)))
+  ;(global-key-binding (kbd "C-M-i") t)
+  ;(minor-mode-key-binding (kbd "<tab>") t)
+  ;(local-key-binding (kbd "C-M-i") t)
+  ;(current-minor-mode-maps)
+  ;(cdr (assq 'undo-tree-mode minor-mode-map-alist))
+
+
+  ; center on incremental search, instead of being at top or bottom of screen.
+  ; i'm hoping that setting Isearch Allow Scroll is good enough to fix this annoyance
+  ;from http://stackoverflow.com/questions/11052678/emacs-combine-iseach-forward-and-recenter-top-bottom
+
+  ;example of constant definition of an overlay and propreries
+  ;(defface mouse-flash-position '((t (:background "Yellow")))
+  ;  "*Face used to highlight mouse position temporarily."
+  ;  :group 'mouse)
+  ;(defface mouse-flash-position '((t (:background "Yellow")))
+  ;  "*Face used to highlight mouse position temporarily."
+  ;  :group 'mouse)
+  ;(defconst mouse-flash-posn-overlay
+  ;    ;; Create and immediately delete, to get "overlay in no buffer".
+  ;  (let ((ol  (make-overlay (point-min) (point-max))))
+  ;    ;(delete-overlay ol)
+  ;    ;(overlay-put ol 'face 'mouse-flash-position)
+  ;    (overlay-put ol 'mouse-face 'mouse-flash-position)
+  ;    (overlay-put ol 'priority 1000000)
+  ;    ol)
+  ;  "Overlay to highlight current mouse position.")
+
+
+  ;tip, put the last interactive command as elisp on the kill ring:
+  ;C-x <ESC> <ESC> C-a C-k C-g
+
+  ; example of overlay testing
+  ;(setq foo (make-overlay 2 3 nil t nil))
+  ;(setq foo2 (make-overlay 3 4 nil t nil))
+  ;(overlay-put foo 'face '(:background "red3" :foreground "black"))
+  ;(overlay-put foo2 'face '(:background "red1" :foreground "black"))
+  ;(overlay-put foo 'face 'visible-mark-face)
+  ;(overlay-put foo 'face visible-mark-face2)
+
+
+#+end_src
+
+
+** SQL
+
+disabled, as I haven't used it in a long time. I think it was good for learning some sql stuff.
+#+begin_src emacs-lisp :tangle no
+(require 'sqlup-mode)
+(add-hook 'sql-mode-hook 'sqlup-mode)
+(add-hook 'sql-interactive-mode-hook 'sqlup-mode)
+
+(setq sql-product 'postgres)
+#+end_src
+
+
+* elisp settings
+#+begin_src emacs-lisp
+; when manually evaluating lisp, go into debugger on error
+(setq eval-expression-debug-on-error t)
+;reminder of useful var: debug-on-error
+#+end_src
+
+
+
+
+
+* gnus
+
+good info http://www.emacswiki.org/emacs/GnusTutorial
+good info http://www.emacs.uniyar.ac.ru/doc/em24h/emacs183.htm
+
+searching / accessing old mailing list messages:
+http://wiki.list.org/display/DOC/How+do+I+make+the+archives+searchable
+3 options suggested. nabble is very good, and you can even reply directly from their web interface with your own email
+address.
+google with site:example.com/archive works
+However, it has the downside of relying on a 3rd party running unreleased software.
+mail-archive.com and gmane.org search do not work.
+
+Some lists mirror to a newsgroup via gmane, and then mirror the newsgroup via a google group, which has good search
+ability, and you can post via the newsgroup.
+
+Downsides of nabble/google. Doesn't integrate with normal email programs, and lock in. They store and show you what you
+have and haven't read, what messages you've sent, etc. migrating that data to a normal mail program is undocumented and
+ unsupported.
+
+mailmans normal public archives are a bit obfuscated, but there is also a "private" archive, available to subscribers,
+which is not obfuscated, and can be easily imported to your local email program.
+you have to sub and log in to the web interfact to access it, and then the url is unpublished, but follows a format,
+which is documented in a few places around the web like
+https://mail.python.org/pipermail/mailman-users/2005-September/046757.html
+its form is:
+https://lists.fedorahosted.org/mailman/private/hyperkitty-devel.mbox/hyperkitty-devel.mbox
+http://www.example.com/mailman/private/<listname>.mbox/<listname>.mbox
+if you copy the url after logging in, and pass it to this function, it will print the transformed url
+lurl() { local x="${1#*/options/}"; x="${x%%/*}.mbox"; echo "${1%/mailman/*}/mailman/private/$x/$x"; }
+
+Then you can download that url. Actually downloading the url is something firefox doesn't make the easiest out of the box.
+ Here are some options:
+- paste in the url bar, the save the page
+as a file after it loads.
+- use downthemall extension or similar and paste the url in it.
+- put it in an html page as
+a link (or a small javascript program which will display input as a link), then right click and save as.
+wget won't work because you need to have (i assume) the authorization cookie mailman gives your browser
+
+people have written various tools to de-obfuscate the normal public archives and sometimes import them to a mail
+program. It seems they were not aware of the private archive. However, these tools are probably still useful to automate
+things. None of them has a lot of usage, so I decided it was not worth the risk of hitting bugs vs doing a few extra clicks.
+
+this was the most interesting one I found within a few minutes of googling.
+https://github.com/wcdolphin/mailman-downloader
+
+Once you have an mbox file, there are rather straightforward ways to get it into any mail program, but I will cover
+gnus, which I use and is a bit tricky.
+
+gnus has a native search (limited, too slow for body text searches), and external search engine integration.
+gnus manual recommends converting to maildir for searching local mail, but importing lots of maildir messages to gnus
+takes 10+ minutes, so scratch that option. it suggests 2 alternate options
+mairix. for mbox, it doesn't integrate 100% with gnus, it copies the search results to a mbox
+and tells gnus to make a group of that mbox and display it. This means the read state won't be persistent, but otherwise
+works great.
+
+local imap server which will use the mbox and provide search.
+dovecot is modular, theres a dovecot-common which uses recommends to install i guess it's most used modules. Its
+description is completely not useful. Anyways, I'm not sure if there is any benefit to installing this over just the
+module we need.
+pi dovecot-imapd
+
+dovecot by default also makes a an inbox folder based on the normal local mail location /var/mail/<username>
+those locations are adjustable and well documented via the var mail_location in
+/etc/dovecot/conf.d/10-mail.conf
+I forward my local mail, didn't see immediately how to turn off the inbox, but it will always be empty, so I left as
+is. you could make the var be empty, which apparently has the same effect.
+
+Originally just linked the default location ~/.mail, but I changed to altering the config since ~/.mail since it seems
+other things like postfix use that location
+
+based on http://roland.entierement.nu/blog/2010/09/08/gnus-dovecot-offlineimap-search-a-howto.html
+other links that poped up contained outdated, innacurate information
+http://sachachua.com/blog/2008/05/geek-how-to-use-offlineimap-and-the-dovecot-mail-server-to-read-your-gmail-in-emacs-efficiently/
+http://www.emacswiki.org/emacs/JamesFerguson
+http://www.sanityinc.com/articles/read-mailing-lists-in-emacs-over-imap/
+
+Within emacs you can move messages between mbox and maildir etc, which is a nice flexibility.
+
+
+
+doc group for mbox:
+in gnus, do gnus-group-make-doc-group (G f in groups buffer) and point to the file
+
+info about groups created within gnus is stored in ~/.newsrc.eld
+also stored is a duplication of what email messages are read/unread,
+what newsgroups are subsribed to and read/unread,
+probably more stuff, everything that gnus saves.
+
+
+searching the body of the messages, i cut off after a few minutes.
+i can grep the file in just a couple seconds
+
+
+random side note
+we can also get mbox from gmane
+http://notmuchmail.org/howto/#index7h2
+
+
+gnus can't search mboxes except with its builtin search which is extremely slow. mairix can do mbox files from the command
+line, but not from within gnus, but from mairix.el, which can then open the results in gnus
+
+mbox can be converted to maildir easily, but gnus loads lots of maildir messages extremely slow. it parses all the
+headers and generates a nov file for each.
+
+nnfolder-generate-active-file
+
+to reset things, when changing mail group. I duno all the proper way, but it works to delete
+~/Mail ~/.newsrc.eld ~/.dribble (or something)
+
+
+** mail sources vs select methods background
+I found this very confusing when first reading through the manual.  "mail sources" is a term that does not simply mean
+sources of mail, it is much narrower for gnus. sources of mail can be either "mail sources" or select methods. Mail
+sources will move mail to ~/Mail (not sure what format), and split it into groups according to variables. You can use
+"mail sources" for maildir / imap, but those can also be read via select methods, which do not move the mail from their
+location, but use them in their native format. This is what I want to do, and I can simply ignore mail
+sources. Confusing terminology is that "fetching mail" "scanning mail", lots of things mail doesn't mean all mail, it
+means specifically from "mail sources". The words "articles" and "news" is used in connection with select methods, aka my actual mail.
+
+
+
+** caching background
+
+caching:
+there is also ~/News/cache, filled with a bunch of articles, like 300 megs. can't figure out why.
+Grepped for caching in the manual, found 2 main things.
+cache is for 2 purposes. to cache locally, and to keep articles from expiring, called persistence
+gnus-use-cache, which puts things if they are
+gnus-cache-enter-articles
+things go in cache when they are marked certain ways by default, ticked and dormant
+and read articles are moved out of the cache
+still no idea why i have a bunch in the cache, but I set a var so that my mail won't get cached
+I'm gonna delete the cache, and check on it later see what exactly is going in there
+And of course, I moved ~/News to my encrypted drive and symlinked it
+
+
+* haskell
+:LOGBOOK:
+:END:
+
+useful comint-shell mode commands. If not prefaced with *, it means it is not in the haskell custom repl
+*todo: setup haskell c-t toggle arrow keys
+tab completion
+C-q insert prev arg
+C-( history search
+c-m-left/right move to next/prev prompts
+*c-enter, multi-line input
+*s-delete, send input across windows. (i can implement this)
+*c-m-l clear screen
+*haskell-process-interrupt, c-cc terminate job (i can implement this maybe)
+
+nice bash/readline functions missing in comint:
+yank-nth-arg
+operate-get-next
+menu-complete
+
+usefull comint commands:
+c-cl : list historic command in temp buffer
+C-c C-o comint-delete-output
+comint-restore-input, todo: put this on a randomish c-c key
+
+
+
+todo:
+checkout haskell repl functions:
+c-cv haskell-check, hlint
+C-M-q           prog-indent-sexp
+c-c.  haskell-mode-format-imports
+C-c M-/         haskell-doc-check-active
+haskell-process-generate-tags
+haskell-process-cabal-build
+haskell-cabal-command.. or something
+haskell-process-restart
+C-h v haskell-process-log
+C-h v haskell-process-show-debug-tips
+
+various not immediately useful functions:
+haskell-process-add-dependency
+haskell-process-touch-buffer
+haskell-process-cd
+haskell-process-unignore
+haskell-process-reload-devel-main
+
+
+rebind
+home: C-a             haskell-interactive-mode-beginning
+c-return: C-j             haskell-interactive-mode-newline-indent
+up/down: <C-down>        haskell-interactive-mode-history-next
+
+todo haskell mode better binds for:
+'haskell-process-load-file
+'haskell-process-do-type
+'haskell-process-do-info
+'inferior-haskell-send-decl
+
+
+commands which don't work in haskell-interactive-mode(hi) vs inferior-haskell-mode(ih, default)
+functions not in hi:
+inferior-haskell-find-definition, use tags instead
+inferior-haskell-find-haddock, todo, test if this works
+
+redefined ih to hi
+switch-to-haskell -> 'haskell-interactive-switch
+haskell-process-load-file -> inferior-haskell-load-file
+haskell-process-do-type -> inferior-haskell-type
+switch-to-haskell -> haskell-interactive-switch
+inferior-haskell-load-file -> 'haskell-process-load-file
+
+
+haskell-mode installation from source, based on its readme
+in the git directory,
+make all
+
+#+begin_src emacs-lisp
+
+
+
+;; remove default option to not link the file
+(setq haskell-compile-command "ghc -Wall -ferror-spans -fforce-recomp %s")
+(add-hook 'haskell-indentation-mode-hook
+          (lambda ()
+            (define-key haskell-indentation-mode-map [?\C-d] nil)
+            (define-key haskell-indentation-mode-map
+              (kbd "<deletechar>")
+              'haskell-indentation-delete-char)))
+
+;;copied from haskell-mode docs in order to use the new, better, nondefault
+;;interactive mode.
+(eval-after-load "haskell-mode"
+  '(progn
+     (define-key haskell-mode-map (kbd "C-x C-d") nil)
+     (define-key haskell-mode-map (kbd "C-c C-z") 'haskell-interactive-switch)
+     (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-file)
+     (define-key haskell-mode-map (kbd "C-c C-b") 'haskell-interactive-switch)
+     (define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type)
+     (define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info)
+     (define-key haskell-mode-map (kbd "C-c M-.") nil)
+     (define-key haskell-mode-map (kbd "C-c C-d") nil)))
+
+;; ghc-mod install http://www.mew.org/~kazu/proj/ghc-mod/en/emacs.html
+;; todo, try this out
+;; (autoload 'ghc-init "ghc" nil t)
+;;(add-hook 'haskell-mode-hook (lambda () (ghc-init) (flymake-mode)))
+
+
+
+(add-to-list 'load-path "~/.emacs.d/src/ghci-completion")
+;; from the package readme for ghci-completion
+(require 'ghci-completion)
+(add-hook 'inferior-haskell-mode-hook 'turn-on-ghci-completion)
+
+
+;; disable some rebinds. they are set to appropriate keys in the keybinds section
+(eval-after-load "haskell-mode"
+  '(progn
+     (define-key haskell-mode-map (kbd "C-a") 'nil)
+     (define-key haskell-mode-map (kbd "C-j") 'nil)))
+
+(defun pretty-lambdas-haskell ()
+  (font-lock-add-keywords
+   nil `((,(concat "(?\\(" (regexp-quote "\\") "\\)")
+          (0 (progn (compose-region (match-beginning 1) (match-end 1)
+                                    ,(make-char 'greek-iso8859-7 107))
+                    nil))))))
+;; from haskell-mode manual
+(add-hook 'haskell-mode-hook 'turn-on-haskell-decl-scan)
+(when (window-system)
+  (add-hook 'haskell-mode-hook 'pretty-lambdas-haskell))
+
+;; added from haskell-mode website install instructions
+                                        ;(load "/usr/share/emacs/site-lisp/haskell-mode/haskell-site-file")
+(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
+;;the three indentation modules are mutually exclusive - add at most one. Trying out the "most advanced"
+(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
+;;(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
+;;(add-hook 'haskell-mode-hook 'turn-on-haskell-simple-indent)
+
+
+;; todo, set this to some other key
+;;    (local-set-key (kbd "C-e") 'my-haskell-load-and-run)
+
+(defun my-haskell-load-and-run ()
+  "Loads and runs the current Haskell file."
+  (interactive)
+  (let ((start-buffer (current-buffer)))
+    (inferior-haskell-load-and-run inferior-haskell-run-command)
+    (sleep-for 0 100)
+    (end-of-buffer)
+    (pop-to-buffer start-buffer)))
+
+;; show haskell function in mode line
+;; todo, this broke after updating emacs
+;;(eval-after-load "which-func"
+;;  '(add-to-list 'which-func-modes 'haskell-mode))
+
+
+
+(add-hook 'interactive-haskell-mode-hook 'ac-haskell-process-setup)
+(add-hook 'haskell-interactive-mode-hook 'ac-haskell-process-setup)
+(eval-after-load "auto-complete"
+  '(add-to-list 'ac-modes 'haskell-interactive-mode))
+
+(add-hook 'haskell-mode-hook
+          (lambda () (define-key haskell-mode-map (kbd "C-(")
+                  (lambda () (interactive)
+                    (basic-save-buffer)
+                    (haskell-compile)
+                    (run-with-timer .3 nil 'repeat-shell)))))
+(add-hook 'haskell-cabal-mode-hook
+          (lambda () (define-key haskell-cabal-mode-map (kbd "C-(") 'haskell-compile)))
+
+
+
+(add-hook 'haskell-interactive-mode-hook
+          (lambda ()
+            (define-key haskell-interactive-mode-map "\r" nil)
+            (define-key haskell-interactive-mode-map (kbd "<return>") 'haskell-interactive-mode-return)))
+(add-hook 'haskell-indentation-mode-hook (lambda () (define-key haskell-indentation-mode-map "\r" nil)))
+
+
+
+(add-hook 'haskell-interactive-mode-hook
+          (lambda ()
+            (define-key haskell-interactive-mode-map (kbd "<C-M-return>") 'haskell-interactive-mode-newline-indent)))
+
+  #+end_src
+
+#+RESULTS:
+| (lambda nil (define-key haskell-interactive-mode-map (kbd <C-M-return>) (quote haskell-interactive-mode-newline-indent))) | (lambda nil (define-key haskell-interactive-mode-map \n nil) (define-key haskell-interactive-mode-map (kbd <return>) (quote haskell-interactive-mode-return))) | ac-haskell-process-setup |
+
+* ido
+#+begin_src emacs-lisp
+
+;; easier to read, and more than the default 12
+(setq ido-separator nil)
+(setq ido-max-prospects 20)
+
+(ido-mode t)
+(ido-everywhere t)  ;; file dialogs
+
+;; do out of order matching when all else fails
+(setq ido-enable-flex-matching t
+      ido-create-new-buffer 'always ;; create new buffer/file without asking
+      ido-use-filename-at-point 'guess ;; use filename at point if it makes sense
+      ido-save-directory-list-file "~/.emacs.d/.ido.last"
+      ido-default-file-method 'selected-window) ;; make duplicate windows
+;; todo, the next 2 functions seem to do roughly the same.
+;;   figure out which one is better. the first comes from emacs starter kit,
+;;   i forget about the second.
+(defun ido-imenu ()
+  "Update the imenu index and then use ido to select a symbol to navigate to.
+  Symbols matching the text at point are put first in the completion list."
+  (interactive)
+  (imenu--make-index-alist)
+  (let ((name-and-pos '())
+        (symbol-names '()))
+    (cl-flet ((addsymbols (symbol-list)
+                          (when (listp symbol-list)
+                            (dolist (symbol symbol-list)
+                              (let ((name nil) (position nil))
+                                (cond
+                                 ((and (listp symbol) (imenu--subalist-p symbol))
+                                  (addsymbols symbol))
+
+                                 ((listp symbol)
+                                  (setq name (car symbol))
+                                  (setq position (cdr symbol)))
+
+                                 ((stringp symbol)
+                                  (setq name symbol)
+                                  (setq position (get-text-property 1 'org-imenu-marker symbol))))
+
+                                (unless (or (null position) (null name))
+                                  (add-to-list 'symbol-names name)
+                                  (add-to-list 'name-and-pos (cons name position))))))))
+      (addsymbols imenu--index-alist))
+    ;; If there are matching symbols at point, put them at the beginning of `symbol-names'.
+    (let ((symbol-at-point (thing-at-point 'symbol)))
+      (when symbol-at-point
+        (let* ((regexp (concat (regexp-quote symbol-at-point) "$"))
+               (matching-symbols (delq nil (mapcar (lambda (symbol)
+                                                     (if (string-match regexp symbol) symbol))
+                                                   symbol-names))))
+          (when matching-symbols
+            (sort matching-symbols (lambda (a b) (> (length a) (length b))))
+            (mapc (lambda (symbol) (setq symbol-names (cons symbol (delete symbol symbol-names))))
+                  matching-symbols)))))
+    (let* ((selected-symbol (ido-completing-read "Symbol? " symbol-names))
+           (position (cdr (assoc selected-symbol name-and-pos))))
+      (goto-char position))))
+
+(defun ido-goto-symbol (&optional symbol-list)
+  "Refresh imenu and jump to a place in the buffer using Ido."
+  (interactive)
+  (unless (featurep 'imenu)
+    (require 'imenu nil t))
+  (cond
+   ((not symbol-list)
+    (let ((ido-mode ido-mode)
+          (ido-enable-flex-matching
+           (if (boundp 'ido-enable-flex-matching)
+               ido-enable-flex-matching t))
+          name-and-pos symbol-names position)
+      (unless ido-mode
+        (ido-mode 1)
+        (setq ido-enable-flex-matching t))
+      (while (progn
+               (imenu--cleanup)
+               (setq imenu--index-alist nil)
+               (ido-goto-symbol (imenu--make-index-alist))
+               (setq selected-symbol
+                     (ido-completing-read "Symbol? " symbol-names))
+               (string= (car imenu--rescan-item) selected-symbol)))
+      (unless (and (boundp 'mark-active) mark-active)
+        (push-mark nil t nil))
+      (setq position (cdr (assoc selected-symbol name-and-pos)))
+      (cond
+       ((overlayp position)
+        (goto-char (overlay-start position)))
+       (t
+        (goto-char position)))))
+   ((listp symbol-list)
+    (dolist (symbol symbol-list)
+      (let (name position)
+        (cond
+         ((and (listp symbol) (imenu--subalist-p symbol))
+          (ido-goto-symbol symbol))
+         ((listp symbol)
+          (setq name (car symbol))
+          (setq position (cdr symbol)))
+         ((stringp symbol)
+          (setq name symbol)
+          (setq position
+                (get-text-property 1 'org-imenu-marker symbol))))
+        (unless (or (null position) (null name)
+                    (string= (car imenu--rescan-item) name))
+          (add-to-list 'symbol-names (substring-no-properties name))
+          (add-to-list 'name-and-pos (cons (substring-no-properties name) position))))))))
+
+#+end_src
+
+* isearch
+#+begin_src emacs-lisp
+(setq
+isearch-allow-scroll t
+search-ring-update t) ;; dont start an edit when going to previous search
+
+   (defun isearch-yank-regexp (regexp)
+     "Pull REGEXP into search regexp."
+     (let ((isearch-regexp nil)) ;; Dynamic binding of global.
+       (isearch-yank-string regexp))
+     (isearch-search-and-update))
+
+   (defun isearch-yank-symbol (&optional partialp backward)
+     "Put symbol at current point into search string.
+
+     If PARTIALP is non-nil, find all partial matches."
+     (interactive "P")
+
+     (let (from to bound sym)
+       (setq sym
+   ; this block taken directly from find-tag-default
+   ; we couldn't use the function because we need the internal from and to values
+             (when (or (progn
+                         ;; Look at text around `point'.
+                         (save-excursion
+                           (skip-syntax-backward "w_") (setq from (point)))
+                         (save-excursion
+                           (skip-syntax-forward "w_") (setq to (point)))
+                         (> to from))
+                       ;; Look between `line-beginning-position' and `point'.
+                       (save-excursion
+                         (and (setq bound (line-beginning-position))
+                              (skip-syntax-backward "^w_" bound)
+                              (> (setq to (point)) bound)
+                              (skip-syntax-backward "w_")
+                              (setq from (point))))
+                       ;; Look between `point' and `line-end-position'.
+                       (save-excursion
+                         (and (setq bound (line-end-position))
+                              (skip-syntax-forward "^w_" bound)
+                              (< (setq from (point)) bound)
+                              (skip-syntax-forward "w_")
+                              (setq to (point)))))
+               (buffer-substring-no-properties from to)))
+       (cond ((null sym)
+              (message "No symbol at point"))
+             ((null backward)
+              (goto-char (1+ from)))
+             (t
+              (goto-char (1- to))))
+       (isearch-search)
+       (if partialp
+           (isearch-yank-string sym)
+         (isearch-yank-regexp
+          (concat "\\_<" (regexp-quote sym) "\\_>")))))
+
+   (defun isearch-current-symbol (&optional partialp)
+     "Incremental search forward with symbol under point.
+
+     Prefixed with \\[universal-argument] will find all partial
+     matches."
+     (interactive "P")
+     (let ((start (point)))
+       (isearch-forward-regexp nil 1)
+       (isearch-yank-symbol partialp)))
+;; todo, make this
+
+   (defun isearch-backward-current-symbol (&optional partialp)
+     "Incremental search backward with symbol under point.
+
+     Prefixed with \\[universal-argument] will find all partial
+     matches."
+     (interactive "P")
+     (let ((start (point)))
+       (isearch-backward-regexp nil 1)
+       (isearch-yank-symbol partialp)))
+
+
+
+   ; lets look through emacs starter kit before we throw this out.
+
+
+ ;   automatically wrap to the top of the buffer when isearch fails
+     (defadvice isearch-search (after isearch-no-fail activate)
+       (unless isearch-success
+         (ad-disable-advice 'isearch-search 'after 'isearch-no-fail)
+         (ad-activate 'isearch-search)
+         (isearch-repeat (if isearch-forward 'forward))
+         (ad-enable-advice 'isearch-search 'after 'isearch-no-fail)
+         (ad-activate 'isearch-search)))
+
+   ;; Activate occur easily inside isearch
+   (define-key isearch-mode-map (kbd "C-o")
+     (lambda () (interactive)
+       (let ((case-fold-search isearch-case-fold-search))
+         (occur (if isearch-regexp
+                    isearch-string
+                  (regexp-quote isearch-string))))))
+
+
+#+end_src
+
+* lisp / elisp mode setings
+#+begin_src emacs-lisp
+
+  (add-hook 'emacs-lisp-mode-hook 'starter-kit-remove-elc-on-save)
+  (defun starter-kit-remove-elc-on-save ()
+    "If you're saving an elisp file, likely the .elc is no longer valid."
+    (make-local-variable 'after-save-hook)
+    (add-hook 'after-save-hook
+              (lambda ()
+                (if (file-exists-p (concat buffer-file-name "c"))
+                    (delete-file (concat buffer-file-name "c"))))))
+
+
+  (defun emacs-lisp-mode-defaults ()
+    ;; checkdoc has an annoying feature that wants a header and footer
+    ;; in every elisp buffer as if they all were packages
+    ;; todo, see if there is a way
+    ;; to make checkdoc usable instead of just disabling it as I do here
+    (if (boundp 'flycheck-checkers)
+        (setq flycheck-checkers (remove 'emacs-lisp-checkdoc flycheck-checkers)))
+    (eldoc-mode 1))
+  (add-hook 'emacs-lisp-mode-hook 'emacs-lisp-mode-defaults)
+
+  (define-key lisp-mode-map (kbd "<M-up>") 'backward-up-list)
+  (define-key lisp-mode-map (kbd "<M-down>") 'down-list)
+  (define-key emacs-lisp-mode-map (kbd "<M-up>") 'backward-up-list)
+  (define-key emacs-lisp-mode-map (kbd "<M-down>") 'down-list)
+  (define-key emacs-lisp-mode-map (kbd "<M-escape>") 'find-function-at-point)
+
+  ;; interactive modes don't need whitespace checks
+  (defun interactive-lisp-coding-defaults ()
+    (whitespace-mode -1))
+  (setq prelude-interactive-lisp-coding-hook 'prelude-interactive-lisp-coding-defaults)
+
+
+  ;; ielm is an interactive Emacs Lisp shell
+  (defun ielm-mode-defaults ()
+    (run-hooks 'prelude-interactive-lisp-coding-hook)
+    (turn-on-eldoc-mode))
+  (add-hook 'ielm-mode-hook 'ielm-mode-defaults)
+
+#+end_src
+
+
+* java eclim
+
+based on https://github.com/senny/emacs-eclim
+
+
+eclim: eclipse completion, searching, validation, etc inside emacs
+install
+#+begin_src sh :tangle no
+cd ~/opt
+git clone git://github.com/ervandew/eclim.git
+cd eclim
+pi ant
+ant -Declipse.home=/a/opt/eclipse
+#+end_src
+
+
+currently makes emacs hang a bunch. dunno why. just using eclipse instead
+#+begin_src emacs-lisp :tangle no
+(require 'eclim)
+(global-eclim-mode)
+
+;; just do java
+(setq eclim-accepted-file-regexps
+ '("\\.java"))
+
+(custom-set-variables
+  '(eclim-eclipse-dirs '("/a/opt/eclipse"))
+  '(eclim-executable "/a/opt/eclipse/eclim"))
+
+(setq help-at-pt-display-when-idle t)
+(setq help-at-pt-timer-delay 0.1)
+(help-at-pt-set-timer)
+
+;; dunno if this line is needed
+(require 'eclimd)
+(setq eclimd-default-workspace "/a/bin/eclipse-workspace")
+
+;;add the emacs-eclim source
+(require 'ac-emacs-eclim-source)
+(add-hook 'java-mode-hook 'ac-emacs-eclim-java-setup)
+
+#+end_src
+
+#+RESULTS:
+| ac-emacs-eclim-java-setup |
+
+* mediawiki
+#+begin_src emacs-lisp
+
+(add-to-list 'load-path "~/.emacs.d/src/mediawiki-el")
+(eval-after-load "mediawiki"
+  '(progn
+    (remove-hook 'outline-minor-mode-hook 'mediawiki-outline-magic-keys)
+    (add-hook 'mediawiki-mode-hook
+              (lambda () (define-key mediawiki-mode-map (kbd "C-(") 'mediawiki-save-reload)))
+
+    ;; mediawiki mode has a bug that it will claim an edit conflict unless you reload after saving.
+    ;; I also like to save with no edit summary for previewing on my local mw instance
+    (defun mediawiki-save-reload ()
+      (interactive)
+      (and (mediawiki-save "") (mediawiki-reload)))))
+#+end_src
+* modes with little configuration needed
+  #+begin_src emacs-lisp
+
+(require 'ws-butler)
+(ws-butler-global-mode)
+
+
+(require 'nginx-mode)
+;;The mode should automatically activate for files called nginx.conf and files under /etc/nginx - if not, you can add something like this to your init file:
+;;(add-to-list 'auto-mode-alist '("/etc/nginx/sites-available/.*" . nginx-mode))
+
+;; todo, put this on a hook with prog mode
+;;(highlight-indentation-mode 1)
+
+(add-hook 'auto-revert-tail-mode-hook
+          (lambda ()
+            (when (string=
+                   buffer-file-name
+                   "/var/log/cloudman/development/cm-service.log")
+              (setq-local prev-auto-revert-max 0)
+              ;; set buffer-local hook
+              (add-hook 'after-revert-hook 'tail-colorize nil t))))
+(defun tail-colorize ()
+  (ansi-color-apply-on-region prev-auto-revert-max (point-max))
+  (setq-local prev-auto-revert-max (point-max)))
+
+
+;; gnu global
+(require 'ggtags)
+(add-hook 'c-mode-common-hook
+          (lambda () (ggtags-mode 1)
+            (setq c-label-minimum-indentation 0)))
+
+;; specific to my unusual keybind setup, you may want to
+;; pick different keys
+(define-key ggtags-mode-map (kbd "C-M-o") 'ggtags-find-tag-dwim)
+(define-key ggtags-mode-map (kbd "C-M-m") 'ggtags-grep)
+
+(defun gtags-update-single(filename)
+  "Update Gtags database for changes in a single file"
+  (interactive)
+  (start-process "update-gtags" "update-gtags" "bash" "-c" (concat "cd " ggtags-project-root " ; gtags --single-update " filename )))
+
+(defun gtags-update-current-file()
+  (interactive)
+  (let ((rel-filename (replace-regexp-in-string
+                       ggtags-project-root "."
+                       (buffer-file-name (current-buffer)))))
+    (gtags-update-single rel-filename)))
+
+(defun gtags-update-hook()
+  "Update GTAGS file incrementally upon saving a file"
+  (when (and ggtags-mode ggtags-project-root)
+    (gtags-update-current-file)))
+
+(add-hook 'after-save-hook 'gtags-update-hook)
+
+;; i'd like to make some elisp which modifies a keymap to remove
+;; all binds which don't match a predicate.
+;; I tried setting a keymap to a new keymap,
+;; but that didn't register as functional.
+;; so I'd need to modify the list in place.
+
+(require 'magit)
+
+
+;; http://ergoemacs.org/emacs/emacs_CSS_colors.html
+;; there's also rainbow mode, which seems to only work for specific colors? it didn't work at all for me in a css file.
+;; todo, do config group on it, and try out one of those colors.
+(defun xah-syntax-color-hsl ()
+  "Syntax color hex color spec such as 「hsl(0,90%,41%)」 in current buffer."
+  (interactive)
+  (font-lock-add-keywords
+   nil
+   '(("hsl( *\\([0-9]\\{1,3\\}\\) *, *\\([0-9]\\{1,3\\}\\)% *, *\\([0-9]\\{1,3\\}\\)% *)"
+      (0 (put-text-property
+          (+ (match-beginning 0) 3)
+          (match-end 0)
+          'face (list :background
+                      (concat "#" (mapconcat 'identity
+                                             (mapcar
+                                              (lambda (x) (format "%02x" (round (* x 255))))
+                                              (color-hsl-to-rgb
+                                               (/ (string-to-number (match-string-no-properties 1)) 360.0)
+                                               (/ (string-to-number (match-string-no-properties 2)) 100.0)
+                                               (/ (string-to-number (match-string-no-properties 3)) 100.0)
+                                               ) )
+                                             "" )) ;  "#00aa00"
+                      ))))) )
+  (font-lock-fontify-buffer)
+  )
+
+(add-hook 'css-mode-hook 'xah-syntax-color-hsl)
+(add-hook 'php-mode-hook 'xah-syntax-color-hsl)
+(add-hook 'html-mode-hook 'xah-syntax-color-hsl)
+
+
+;; message mode prompted me on first message.
+;; a function which describes options then sets this
+;; the other options were to use smtp directly or pass to another mail client
+;; here we use the standard sendmail interface, which I use postfix for
+(setq send-mail-function (quote sendmail-send-it))
+
+(add-to-list 'load-path "~/.emacs.d/src/spray")
+(require 'spray)
+(global-set-key (kbd "C-M-w") 'spray-mode)
+;; remember, h/l = move. f/s = faster/slower, space = pause, all others quit
+
+;; delete active selection with self-insert commands
+(delete-selection-mode t)
+
+;; Transparently open compressed files
+(auto-compression-mode t)
+
+;; Highlight matching parenthesesq when the pointq is on them.
+;; not needed since smart paren mode?
+;;  (show-paren-mode 1)
+
+
+;; not documented, but looking at the source, I find this
+;; stops me from being asked what command on every C-c-c
+;; when doing a latex document.
+(setq TeX-command-force "LaTeX")
+
+;; dot mode, repeats last action
+(require 'dot-mode)
+(add-hook 'find-file-hooks 'dot-mode-on)
+
+
+;; clean up obsolete buffers automatically at midnight
+(require 'midnight)
+
+
+;; disabled because it takes 400ms on startup
+;; ;; emacs regexes are too limited.
+;; (require 'foreign-regexp)
+;; ;; perl is most powerful, but javascript is pretty close and
+;; ;; I'd rather know javascript stuff than perl
+;; (custom-set-variables
+;;  '(foreign-regexp/regexp-type 'javascript) ;; Choose by your preference.
+;;  '(reb-re-syntax 'foreign-regexp)) ;; Tell re-builder to use foreign regexp.
+;; ;; it would be nice to add documentation to do this for more commands to that package
+;; ;; disabled because it's too slow. but I'd still m-x it for advanced replacements
+;; ;;(define-key global-map [remap isearch-forward-regexp] 'foreign-regexp/isearch-forward)
+
+
+;; saner regex syntax
+(require 're-builder)
+(setq reb-re-syntax 'string)
+
+
+;; use shift + arrow keys to switch between visible buffers
+;; todo, set these keys to something else
+(require 'windmove)
+(windmove-default-keybindings)
+
+
+;; show the name of the current function definition in the modeline
+(require 'which-func)
+(setq which-func-modes t)
+(which-function-mode 1)
+
+
+;; enable winner-mode to manage window configurations
+(winner-mode +1)
+
+;; meaningful names for buffers with the same name
+(require 'uniquify)
+(setq uniquify-buffer-name-style 'forward
+      uniquify-separator "/"
+      ;; for sdx work. until I figure out a better way.
+      ;; maybe something like projectile can do it,
+      ;; or hacking around the status bar
+      uniquify-min-dir-content 2
+      uniquify-after-kill-buffer-p t ; rename after killing uniquified
+      uniquify-ignore-buffers-re "^\\*") ; don't muck with special buffers
+
+
+;; makefiles require tabs
+;; todo: find a makefile indent function that works,
+;; best I could find is this one which means don't indent at all
+;;
+(add-hook 'makefile-mode-hook
+          (lambda ()
+            (setq indent-tabs-mode t)
+            (setq indent-line-function (lambda () 'no-indent))))
+
+
+;; todo, turn on auto-fill just for txt files
+;;(add-hook 'text-mode-hook 'turn-on-auto-fill)
+(add-hook 'text-mode-hook 'turn-on-flyspell)
+
+
+;; auto indent shell script comments
+(setq sh-indent-comment t)
+
+;; random extra highlights
+(require 'volatile-highlights)
+(volatile-highlights-mode t)
+
+
+;; make help buffers smaller when it makes sense
+(temp-buffer-resize-mode 1)
+
+
+(require 'info+)
+;; based on suggestions in info+.el, I also installed  misc-fns, strings, and thingatpt+
+;; remove some bad keybinds from info+
+(define-key Info-mode-map [mouse-4]         nil)
+(define-key Info-mode-map [mouse-5]         nil)
+
+
+(require 'smooth-scroll)
+;; long gnus summary buffers lags too much with this,
+;; but I like it enough to leave it enabled by default
+;; and crank up the step size to be faster
+;; and it doesn't have a way to enable it only for certain modes etc.
+;; todo sometime, make it work for certain modes only
+(smooth-scroll-mode t)
+;; its too slow with the default of 2
+(setq smooth-scroll/vscroll-step-size 7)
+;; sublimity doesn't work as good going fast by default
+;; smooth-scrolling.el, does not do smooth scrolling. its about cursor location
+
+
+(setq sh-here-document-word "'EOF'")
+
+(setq tramp-default-method "ssh")
+  #+end_src
+* misc general settings
+
+#+begin_src emacs-lisp
+
+(setq vc-follow-symlinks t)
+
+;; give us a shell to start instead of scratch
+;;(setq initial-buffer-choice (lambda () (new-shell)))
+
+;; disable this nasty function, as I always use a gui
+(defun suspend-frame() (interactive))
+
+;; to reopen just ido-switch-buffer (c-l), *scratch*
+;;  (kill-buffer "*scratch*")
+
+;; Seed the random-number generator
+(random t)
+
+;; easier to remember than keybinds
+(defalias 'scrypt 'mml-secure-message-encrypt-pgpmime)
+(defalias 'sign 'mml-secure-message-sign-pgpmime)
+(defun encrypt ()
+  (interactive)
+  (mml-secure-message-encrypt-pgpmime 'dontsign))
+
+;; don't highlight the region.
+(set-face-background 'region nil)
+
+;; this fixes save error for python example code
+(define-coding-system-alias 'UTF-8 'utf-8)
+
+;; i don't use frame titles, but if I ever do
+;; this starter kit setting is probably good
+(if window-system (setq frame-title-format '(buffer-file-name "%f" ("%b"))))
+
+(set-terminal-coding-system 'utf-8)
+(set-keyboard-coding-system 'utf-8)
+(prefer-coding-system 'utf-8)
+
+;; remove ugly 3d box feature
+(set-face-attribute 'mode-line nil :box nil)
+
+(add-to-list 'default-frame-alist
+             '(font . "DejaVu Sans Mono-11"))
+; the default will jump 2 sizes.
+(setq text-scale-mode-step 1.1)
+(setq font-lock-maximum-decoration t
+      inhibit-startup-message t
+      transient-mark-mode t
+      delete-by-moving-to-trash t
+      shift-select-mode nil
+      truncate-partial-width-windows nil
+      uniquify-buffer-name-style 'forward
+      oddmuse-directory "~/.emacs.d/oddmuse"
+      echo-keystrokes 0.1
+      mark-ring-max 160
+      sort-fold-case t  ; case insensitive line sorting
+      global-mark-ring-max 1000
+      ;; the bell seems to lag the ui
+      ;;visible-bell t
+      case-replace nil
+      revert-without-query '(".*")
+      ;; don't pause display code on input.
+      ;; smoother display performance at slight cost of input performance
+      redisplay-dont-pause t
+      font-lock-maximum-decoration t) ; probably default and not necesary
+
+
+(setq-default indent-tabs-mode nil ;; don't use tabs to indent
+              cursor-type 'box
+              fill-column 72
+
+              ;; wrap at word boundaries instead of mid-word
+              word-wrap t
+              imenu-auto-rescan t
+              indicate-empty-lines t) ; mark end of buffer
+
+
+(blink-cursor-mode '(-4))
+(menu-bar-mode -1)
+(tool-bar-mode -1)
+(set-scroll-bar-mode 'left)
+
+
+;; enable various commands
+(put 'narrow-to-region 'disabled nil)
+(put 'narrow-to-page 'disabled nil)
+(put 'narrow-to-defun 'disabled nil)
+(put 'upcase-region 'disabled nil)
+(put 'downcase-region 'disabled nil)
+(put 'scroll-left 'disabled nil)
+;; these from graphene, haven't read about them yet
+(put 'ido-complete 'disabled nil)
+(put 'ido-exit-minibuffer 'disabled nil)
+(put 'dired-find-alternate-file 'disabled nil)
+(put 'autopair-newline 'disabled nil)
+
+
+
+;;disable and minimize various prompts/messages
+(fset 'yes-or-no-p 'y-or-n-p)
+(setq confirm-nonexistent-file-or-buffer nil
+      inhibit-startup-message t
+      inhibit-startup-echo-area-message t
+      inhibit-startup-screen t
+      compilation-read-command nil ;; just don't compile with unsafe file local vars
+      kill-buffer-query-functions (remq 'process-kill-buffer-query-function
+                                        kill-buffer-query-functions))
+
+
+;; exit without bothering me
+;; http://stackoverflow.com/questions/2706527/make-emacs-stop-asking-active-processes-exist-kill-them-and-exit-anyway/2708042#2708042
+(add-hook 'comint-exec-hook
+      (lambda () (set-process-query-on-exit-flag (get-buffer-process (current-buffer)) nil)))
+;; based on save-buffers-kill-emacs help string, don't ask about clients when exiting
+;; apparently this would need to be in some later hook. dunno where is best, but this works
+(defadvice save-buffers-kill-emacs (before no-client-prompt-advice activate)
+  (setq kill-emacs-query-functions (delq 'server-kill-emacs-query-function kill-emacs-query-functions)))
+
+
+
+;; (custom-set-faces
+;;  ;; setting header-line-format to " " as a hack for a top margin the oly thning I could find to do a top margin
+;;  '(header-line ((t (:background "default" :foreground "default" :overline nil :underline nil))))
+;;  ;; don't highlight the region
+;;  '(region ((t nil))))
+(setq-default header-line-format " ")
+
+
+(setq initial-scratch-message nil)
+ #+end_src
+
+
+vertical margin background.
+google turned up: http://lists.gnu.org/archive/html/help-gnu-emacs/2014-03/msg00544.html
+the xresource doesn't work for me, probably an xmonad thing.
+
+figured out I needed to customize the header line face. To find the face, M-x list-faces-display or just google / search
+info,
+then M-x customize-face
+header-line
+unchecked some stuff so that it inherits from default.
+
+* misc function definitions
+#+begin_src emacs-lisp
+
+
+(defun next-backup-dir ()
+"In a directory listing from rsync -n,
+Go to the next directory based on where the cursor is."
+  (interactive)
+  (let* ((start-col (current-column))
+         (end-col (progn (skip-chars-forward "^/\n") (current-column)))
+         (dir (progn
+                (beginning-of-line 1)
+                (buffer-substring-no-properties (point) (+ (point) end-col)))))
+    (message dir)
+    (forward-line 1)
+    (while (and (not (eobp))
+                (string= dir (buffer-substring-no-properties (point) (+ (point) end-col))))
+      (forward-line 1))
+    (forward-char-same-line start-col)))
+;; copy paste this for fast keybind
+;;(local-set-key (kbd "<kp-enter>"))
+
+
+(defun goto-buffer-or-find-file (file-name)
+  "If buffer is with FILE-NAME exists, go to it, else open the file using full path."
+  (interactive)
+  (let ((b (get-buffer (file-name-nondirectory file-name))))
+    (if b
+        (switch-to-buffer b)
+      (find-file file-name))))
+
+
+
+
+;; todo, i think this is broken. perhaps the last goto-char is not accounting for buffer or something
+(defun unpop-global-mark ()
+  "Unpop off global mark ring. Does nothing if mark ring is empty."
+  (interactive)
+  (when global-mark-ring
+    (setq global-mark-ring (cons (copy-marker (mark-marker)) global-mark-ring))
+    (let ((lm (car (last global-mark-ring))))
+      (set-marker (mark-marker) (marker-position lm) (marker-buffer lm)))
+    (when (null (mark t)) (ding))
+    (setq global-mark-ring (nbutlast global-mark-ring))
+    (goto-char (marker-position (mark-marker)))))
+
+(defun indent-buffer ()
+  "Indents the entire buffer."
+  (interactive)
+  (cond ((derived-mode-p 'org-mode)
+         (org-indent-region (point-min) (point-max)))
+        ((derived-mode-p 'python-mode)
+         (py-autopep8))
+        (t
+         (indent-region (point-min) (point-max)))))
+
+
+;; TODO doesn't work with uniquify
+(defun rename-file-and-buffer ()
+  "Renames current buffer and file it is visiting."
+  (interactive)
+  (let ((name (buffer-name))
+        (filename (buffer-file-name)))
+    (if (not (and filename (file-exists-p filename)))
+        (message "Buffer '%s' is not visiting a file!" name)
+      (let ((new-name (read-file-name "New name: " filename)))
+        (cond ((get-buffer new-name)
+               (message "A buffer named '%s' already exists!" new-name))
+              (t
+               (rename-file name new-name 1)
+               (rename-buffer new-name)
+               (set-visited-file-name new-name)
+               (set-buffer-modified-p nil)))))))
+
+
+
+(defun sudo-edit (&optional arg)
+  (interactive "P")
+  (if (or arg (not buffer-file-name))
+      (find-file (concat "/sudo:root@localhost:" (ido-read-file-name "File: ")))
+    (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
+
+
+
+(defun backward-symbol (arg)
+  (interactive "p")
+  (forward-symbol (- arg)))
+
+#+end_src
+
+* mode line
+#+begin_src emacs-lisp
+
+  ; -----------------------------
+  ; fixing up the mode line
+  ; modified from mastering emacs blog
+  ; ----------------------------
+
+  (defvar mode-line-cleaner-alist
+    `((auto-complete-mode . "")
+      (yas/minor-mode . "")
+      (paredit-mode . "")
+      (auto-fill-function . "")
+      (eldoc-mode . "")
+      (abbrev-mode . "")
+      (flyspell-mode . "")
+      (glasses-mode . "")
+      (dot-mode . "")
+      (yas-global-mode . "")
+      (yas-minor-mode . "")
+      (undo-tree-mode . "")
+      (volatile-highlights-mode . "")
+      (highlight-symbol-mode . "")
+      ;; Major modes
+      (lisp-interaction-mode . "λ")
+      (hi-lock-mode . "")
+      (python-mode . "Py")
+      (emacs-lisp-mode . "EL")
+      (nxhtml-mode . "nx"))
+    "Alist for `clean-mode-line'.
+
+  When you add a new element to the alist, keep in mind that you
+  must pass the correct minor/major mode symbol and a string you
+  want to use in the modeline *in lieu of* the original.")
+
+
+  (defun clean-mode-line ()
+    (interactive)
+    (loop for cleaner in mode-line-cleaner-alist
+          do (let* ((mode (car cleaner))
+                    (mode-str (cdr cleaner))
+                    (old-mode-str (cdr (assq mode minor-mode-alist))))
+               (when old-mode-str
+                 (setcar old-mode-str mode-str))
+               ;; major mode
+               (when (eq mode major-mode)
+                 (setq mode-name mode-str)))))
+
+; disabled
+;  (add-hook 'after-change-major-mode-hook 'clean-mode-line)
+
+
+  ;;; alias the new `flymake-report-status-slim' to
+  ;;; `flymake-report-status'
+  (defalias 'flymake-report-status 'flymake-report-status-slim)
+  (defun flymake-report-status-slim (e-w &optional status)
+    "Show \"slim\" flymake status in mode line."
+    (when e-w
+      (setq flymake-mode-line-e-w e-w))
+    (when status
+      (setq flymake-mode-line-status status))
+    (let* ((mode-line " Φ"))
+      (when (> (length flymake-mode-line-e-w) 0)
+        (setq mode-line (concat mode-line ":" flymake-mode-line-e-w)))
+      (setq mode-line (concat mode-line flymake-mode-line-status))
+      (setq flymake-mode-line mode-line)
+      (force-mode-line-update)))
+
+
+(add-hook 'after-change-major-mode-hook (lambda ()
+
+(setq mode-line-mule-info nil
+mode-line-position nil
+mode-line-modes nil))) ; todo, make only flymake status show up
+
+#+end_src
+
+* mouse related
+** settings
+#+begin_src emacs-lisp
+  (setq focus-follows-mouse t
+        mouse-autoselect-window t
+        xterm-mouse-mode t)
+#+end_src
+** move-mouse-to-point
+todo, this is buggy with multiple windows open.
+#+begin_src emacs-lisp
+(defun move-mouse-to-point ()
+  (interactive)
+  (let* ((pos (posn-col-row (posn-at-point)))
+         (x (+ (car pos) 2)) ; no idea why this is off by 1-2
+         (y (cdr pos)))
+    (set-mouse-position (selected-frame) x y)))
+#+end_src
+** cursor highlight
+disabled until fixed
+#+begin_src emacs-lisp :tangle no
+    (defun mouse-follow-cursor ()
+      ;(if (not (equal this-command last-command)) (print this-command))
+;debug
+ ;    (print this-command)
+      (when (and this-command (not (string= this-command "show-pointer")))
+        (let* ((pos (posn-col-row (posn-at-point)))
+               (x (1+ (car pos))) ; no idea why this is off by 1
+               (y (cdr pos)))
+      (setq ignore-mouse-visibility t)
+          (set-mouse-position (selected-frame) x y))
+    ;(sleep-for 0 100)
+        (frame-make-pointer-invisible)))
+
+    ;    (when this-command
+    ;      (if (string= this-command "show-pointer")
+    ;    (frame-make-pointer-visible)
+  ;))
+
+
+
+    (defun show-pointer ()
+      (interactive)
+      (if ignore-mouse-visibility
+          (setq ignore-mouse-visibility nil)
+;  (print "visible")
+      (frame-make-pointer-visible)))
+
+      (setq ignore-mouse-visibility t)
+; disabled
+ ;   (global-set-key (kbd "<mouse-movement>") 'show-pointer)
+
+ ;   (add-hook 'post-command-hook 'mouse-follow-cursor t)
+
+
+    ; status. working, except that all scroll wheel actions send a mouse-movement command before doing their actual command, which makes the pointer flicker.
+   ; this is just an artifact of xbindkeys. when i do my own mouse chip, it will fix this.
+
+; we could set track-mouse to nil, then do the command, then set it back. i like that idea a bit better.
+    ; we could do the same thing in the other case of ignore-mouse-visibility.
+
+    ; there are also other issues, it doesn't work with changing buffers on a split screen.
+   ; i think a good idea along with this would be for the cursor to follow the mouse all the time.
+   ; i have done code for that in my mouse 1 function,
+   ; i just need to read it again and try it out.
+
+
+
+
+    ; this does not take care of scrolling,
+    ; a post-command hook function below does,
+    ; but it breaks when the frame is split.
+    ; the bug is specifically in mouse-pixel-position
+    ; todo, fix this eventually
+    (defun mouse-highlight-event (event)
+      (interactive "e")
+      (when (or (not event) (mouse-movement-p event)
+                (memq (car-safe event) '(switch-frame select-window)))
+        (let ((pos (posn-point (event-end event))))
+          (if (eq (overlay-buffer mouse-hi-ov) (current-buffer))
+              (move-overlay mouse-hi-ov pos (1+ pos))
+            (delete-overlay mouse-hi-ov)
+            (setq mouse-hi-ov
+                  (make-overlay pos (1+ pos)))
+            (overlay-put mouse-hi-ov
+                         'insert-in-front-hooks (list 'mouse-hi-modification))
+            (overlay-put mouse-hi-ov 'priority 1001))
+          (cond ((save-excursion (goto-char pos) (eolp))
+                 (overlay-put mouse-hi-ov 'face nil)
+                 (overlay-put mouse-hi-ov 'before-string
+                              (propertize
+                               " "
+                               'cursor t
+                               'face 'mouse-cursor-face)))
+                (t
+                 (overlay-put mouse-hi-ov 'face 'mouse-cursor-face)
+                 (overlay-put mouse-hi-ov 'before-string nil))))))
+
+
+    ; overlay changed hook function
+    (defun mouse-hi-modification (ov timing beginning end &optional length)
+      "Make an overlay of length 1 not expand when text is inserted at the front."
+      (when timing
+        (let ((start (overlay-start ov)))
+          (move-overlay ov start (1+ start)))))
+
+
+
+
+    (defun mouse-hi-command-hook ()
+    ; not sure if I need to deal with case of a nil mouse position in some unforseen situation.
+      (let ((x-y (cdr (mouse-pixel-position))))
+        (when (wholenump (car x-y))
+          (let ((pos (posn-point (posn-at-x-y (car x-y) (cdr x-y) nil t))))
+            (when pos
+              (if (eq (overlay-buffer mouse-hi-ov) (current-buffer))
+                  (move-overlay mouse-hi-ov pos (1+ pos))
+                (delete-overlay mouse-hi-ov)
+                (setq mouse-hi-ov
+                      (make-overlay pos (1+ pos)))
+
+                (overlay-put mouse-hi-ov 'priority 1001))
+              (cond ((save-excursion (goto-char pos) (eolp))
+
+                     (overlay-put mouse-hi-ov 'face nil)
+                     (overlay-put mouse-hi-ov 'before-string
+                                  (propertize
+                                   " "
+                                   'cursor t
+                                   'face 'mouse-cursor-face)))
+                    (t
+                     (overlay-put mouse-hi-ov 'face 'mouse-cursor-face)
+                     (overlay-put mouse-hi-ov 'before-string nil))))))))
+    ; (pcase-let ((`(,_ ,x . ,y) (mouse-pixel-position)))
+    ;                   (posn-point (posn-at-x-y x y)))))
+    ; equivalent of above to find pos. todo, learn about the above syntax
+
+    (setq mouse-hi-ov (make-overlay 1 1))
+    (delete-overlay mouse-hi-ov)
+    ; initialized overlay
+    ; temporarily set to nil instead of t because it is broken and
+    ; also has a bug that makes emacs not remember the column when
+    ; doing  up and down movements.
+    ; it also messes up yas/insert-snippet, dunno why.
+; i should test out whether it is something in the post-command hook
+;    (setq track-mouse t)
+    ;(add-hook 'post-command-hook 'mouse-hi-command-hook)
+
+    ;(mouse-hi-command-hook)
+    ;(setq debug-on-error nil)
+
+  #+end_src
+** mouse 1 drag func
+  :PROPERTIES:
+
+disabled as it breaks in newer emacs versions with this error, when
+clicking on info links
+
+"and: Symbol's function definition is void: mouse--remap-link-click-p"
+
+#+begin_src emacs-lisp :tangle no
+
+  ; Copied from mouse.el and modified.
+  ; my modifications have comments prefaced by "ian"
+  (defun mouse-drag-track (start-event  &optional
+                                        do-mouse-drag-region-post-process)
+    "Track mouse drags by highlighting area between point and cursor.
+  The region will be defined with mark and point.
+  DO-MOUSE-DRAG-REGION-POST-PROCESS should only be used by
+  `mouse-drag-region'."
+    (mouse-minibuffer-check start-event)
+    (setq mouse-selection-click-count-buffer (current-buffer))
+  ; ian. removed as unneeded since I don't use TMM
+  ;(deactivate-mark)
+    (let* ((scroll-margin 0) ; Avoid margin scrolling (Bug#9541).
+           (original-window (selected-window))
+           ;; We've recorded what we needed from the current buffer and
+           ;; window, now let's jump to the place of the event, where things
+           ;; are happening.
+           (_ (mouse-set-point start-event))
+           (echo-keystrokes 0)
+           (start-posn (event-start start-event))
+           (start-point (posn-point start-posn))
+           (start-window (posn-window start-posn))
+           (start-window-start (window-start start-window))
+           (start-hscroll (window-hscroll start-window))
+           (bounds (window-edges start-window))
+           (make-cursor-line-fully-visible nil)
+           (top (nth 1 bounds))
+           (bottom (if (window-minibuffer-p start-window)
+                       (nth 3 bounds)
+                     ;; Don't count the mode line.
+                     (1- (nth 3 bounds))))
+           (on-link (and mouse-1-click-follows-link
+                         ;; Use start-point before the intangibility
+                         ;; treatment, in case we click on a link inside
+                         ;; intangible text.
+                         (mouse-on-link-p start-posn)))
+           (click-count (1- (event-click-count start-event)))
+           (remap-double-click (and on-link
+                                    (eq mouse-1-click-follows-link 'double)
+                                    (= click-count 1)))
+           ;; Suppress automatic hscrolling, because that is a nuisance
+           ;; when setting point near the right fringe (but see below).
+           (auto-hscroll-mode-saved auto-hscroll-mode)
+           (auto-hscroll-mode nil)
+           moved-off-start event end end-point)
+
+      (setq mouse-selection-click-count click-count)
+      ;; In case the down click is in the middle of some intangible text,
+      ;; use the end of that text, and put it in START-POINT.
+      (if (< (point) start-point)
+          (goto-char start-point))
+      (setq start-point (point))
+      (if remap-double-click
+          (setq click-count 0))
+
+      ;; Activate the region, using `mouse-start-end' to determine where
+      ;; to put point and mark (e.g., double-click will select a word).
+      (setq transient-mark-mode
+            (if (eq transient-mark-mode 'lambda)
+                '(only)
+              (cons 'only transient-mark-mode)))
+      (delete-overlay mouse-hi-ov) ; ian, added this.
+
+      (let ((range (mouse-start-end start-point start-point click-count)))
+        (push-mark (nth 0 range) t t)
+        (goto-char (nth 1 range)))
+
+      ;; Track the mouse until we get a non-movement event.
+      (track-mouse
+        (while (progn
+                 (setq event (read-event))
+                 (or (mouse-movement-p event)
+                     (memq (car-safe event) '(switch-frame select-window))))
+          (unless (memq (car-safe event) '(switch-frame select-window))
+            ;; Automatic hscrolling did not occur during the call to
+            ;; `read-event'; but if the user subsequently drags the
+            ;; mouse, go ahead and hscroll.
+            (let ((auto-hscroll-mode auto-hscroll-mode-saved))
+              (redisplay))
+            (setq end (event-end event)
+                  end-point (posn-point end))
+            ;; Note whether the mouse has left the starting position.
+            (unless (eq end-point start-point)
+              (setq moved-off-start t))
+            (if (and (eq (posn-window end) start-window)
+                     (integer-or-marker-p end-point))
+                (mouse--drag-set-mark-and-point start-point
+                                                end-point click-count)
+              (let ((mouse-row (cdr (cdr (mouse-position)))))
+                (cond
+                 ((null mouse-row))
+                 ((< mouse-row top)
+                  (mouse-scroll-subr start-window (- mouse-row top)
+                                     nil start-point))
+                 ((>= mouse-row bottom)
+                  (mouse-scroll-subr start-window (1+ (- mouse-row bottom))
+                                     nil start-point))))))
+          (visible-mark-move-overlays))) ; ian, added this
+
+
+      ;; Handle the terminating event if possible.
+      (when (consp event)
+        ;; Ensure that point is on the end of the last event.
+        (when (and (setq end-point (posn-point (event-end event)))
+                   (eq (posn-window end) start-window)
+                   (integer-or-marker-p end-point)
+                   (/= start-point end-point))
+          (mouse--drag-set-mark-and-point start-point
+                                          end-point click-count))
+
+        ;; Find its binding.
+        (let* ((fun (key-binding (vector (car event))))
+               (do-multi-click (and (> (event-click-count event) 0)
+                                    (functionp fun)
+                                    (not (memq fun '(mouse-set-point
+                                                     mouse-set-region))))))
+          (if (and (/= (mark) (point))
+                   (not do-multi-click))
+
+              ;; If point has moved, finish the drag.
+              (let* (last-command this-command)
+                (and mouse-drag-copy-region
+                     do-mouse-drag-region-post-process
+                     (let (deactivate-mark)
+                       (copy-region-as-kill (mark) (point)))))
+
+            ;; Otherwise, run binding of terminating up-event.
+            (if do-multi-click
+                (goto-char start-point)
+              (deactivate-mark)
+              (unless moved-off-start
+                ;; ian: poping the mark is a poor choice of behavior.
+                ;; we should delete the mark instead.
+                ;; The first way I found to delete it is to pop it first
+                (pop-mark)
+                (setq mark-ring (nbutlast mark-ring))))
+
+            (when (and (functionp fun)
+                       (= start-hscroll (window-hscroll start-window))
+                       ;; Don't run the up-event handler if the window
+                       ;; start changed in a redisplay after the
+                       ;; mouse-set-point for the down-mouse event at
+                       ;; the beginning of this function.  When the
+                       ;; window start has changed, the up-mouse event
+                       ;; contains a different position due to the new
+                       ;; window contents, and point is set again.
+                       (or end-point
+                           (= (window-start start-window)
+                              start-window-start)))
+
+              (when (and on-link
+                         (= start-point (point))
+                         (mouse--remap-link-click-p start-event event))
+
+                ;; If we rebind to mouse-2, reselect previous selected
+                ;; window, so that the mouse-2 event runs in the same
+                ;; situation as if user had clicked it directly.  Fixes
+                ;; the bug reported by juri@jurta.org on 2005-12-27.
+                (if (or (vectorp on-link) (stringp on-link))
+                    (setq event (aref on-link 0))
+                  (select-window original-window)
+                  (setcar event 'mouse-2)
+                  ;; If this mouse click has never been done by the
+                  ;; user, it doesn't have the necessary property to be
+                  ;; interpreted correctly.
+                  (put 'mouse-2 'event-kind 'mouse-click)))
+              (push event unread-command-events)))))))
+#+end_src
+
+** mouse 3
+#+begin_src emacs-lisp :tangle no
+
+
+  (defun mouse3-range-mark (start click click-count)
+    (let* ((range (mouse-start-end start click click-count))
+           (beg (nth 0 range))
+           (end (nth 1 range)))
+      (cond ((<= click start)
+             (set-mark beg))
+            (t
+             (set-mark end))))
+    (visible-mark-move-overlays))
+
+
+  (defun mouse3-set-mark (event)
+    "in development"
+    (interactive "e")
+    (mouse-minibuffer-check event)
+    ;; Use event-end in case called from mouse-drag-region.
+    ;; If EVENT is a click, event-end and event-start give same value.
+    (set-mark (posn-point (event-end event)))
+    (visible-mark-move-overlays))
+
+
+  (defun mouse3-func (start-event)
+    "in development"
+    (interactive "e")
+
+    (run-hooks 'mouse-leave-buffer-hook)
+
+    (mouse-minibuffer-check start-event)
+    (setq mouse-selection-click-count-buffer (current-buffer))
+    (push-mark (posn-point (event-end start-event)))
+
+    (let* ((scroll-margin 0) ; Avoid margin scrolling (Bug#9541).
+           (original-window (selected-window))
+           ;; We've recorded what we needed from the current buffer and
+           ;; window, now let's jump to the place of the event, where things
+           ;; are happening.
+  ;(_ (mouse-set-point start-event)) ; ian: commented, replaced
+           (echo-keystrokes 0)
+           (start-posn (event-start start-event))
+           (start-point (posn-point start-posn))
+           (start-window (posn-window start-posn))
+           (start-window-start (window-start start-window))
+           (start-hscroll (window-hscroll start-window))
+           (bounds (window-edges start-window))
+           (make-cursor-line-fully-visible nil)
+           (top (nth 1 bounds))
+           (bottom (if (window-minibuffer-p start-window)
+                       (nth 3 bounds)
+                     ;; Don't count the mode line.
+                     (1- (nth 3 bounds))))
+           (click-count (1- (event-click-count start-event)))
+           ;; Suppress automatic hscrolling, because that is a nuisance
+           ;; when setting point near the right fringe (but see below).
+           (auto-hscroll-mode-saved auto-hscroll-mode)
+           (auto-hscroll-mode nil)
+           moved-off-start event end end-point)
+
+      (setq mouse-selection-click-count click-count)
+      ;; In case the down click is in the middle of some intangible text,
+      ;; use the end of that text, and put it in START-POINT.
+      (if (< (mark) start-point) ; ian: change point to the mark
+          (set-mark start-point)
+        (visible-mark-move-overlays))
+      (setq start-point (mark))
+
+      (delete-overlay mouse-hi-ov) ; ian, added this.
+
+      ;; Activate the region, using `mouse-start-end' to determine where
+      ;; to put point and mark (e.g., double-click will select a word).
+      (let ((range (mouse-start-end start-point start-point click-count)))
+        (set-mark (nth 1 range)))
+      (visible-mark-move-overlays)
+
+
+      ;; Track the mouse until we get a non-movement event.
+      (track-mouse
+
+        (while (progn
+                 (setq event (read-event))
+                 (or (mouse-movement-p event)
+                     (memq (car-safe event) '(switch-frame select-window))))
+          (unless (memq (car-safe event) '(switch-frame select-window))
+
+            ;; Automatic hscrolling did not occur during the call to
+            ;; `read-event'; but if the user subsequently drags the
+            ;; mouse, go ahead and hscroll.
+            (let ((auto-hscroll-mode auto-hscroll-mode-saved))
+              (redisplay))
+            (setq end (event-end event)
+                  end-point (posn-point end))
+            ;; Note whether the mouse has left the starting position.
+
+            (unless (eq end-point start-point)
+              (setq moved-off-start t))
+            (if (and (eq (posn-window end) start-window)
+                     (integer-or-marker-p end-point))
+                (mouse3-range-mark start-point end-point click-count); ian, set mark
+
+  ; do scrolling if needed
+              (let ((mouse-row (cdr (cdr (mouse-position)))))
+                (cond
+                 ((null mouse-row))
+                 ((< mouse-row top)
+                  (mouse-scroll-subr start-window (- mouse-row top)
+                                     nil start-point))
+                 ((>= mouse-row bottom)
+                  (mouse-scroll-subr start-window (1+ (- mouse-row bottom))
+                                     nil start-point))))))))
+
+      ;; Handle the terminating event if possible.
+      (when (consp event)
+        ;; Ensure that point is on the end of the last event.
+        (when (and (setq end-point (posn-point (event-end event)))
+                   (eq (posn-window end) start-window)
+                   (integer-or-marker-p end-point)
+                   (/= start-point end-point))
+  ;(mouse--drag-set-mark-and-point start-point ; ian, set mark
+  ;end-point click-count))
+          (mouse3-range-mark start-point end-point click-count)); ian, set mark
+
+        ;; Find its binding.
+        (let* ((fun (key-binding (vector (car event))))
+               (do-multi-click (and (> (event-click-count event) 0)
+                                    (functionp fun)
+                                    (not (memq fun '(mouse3-set-mark))))))
+          (if (and (/= end-point start-point)
+                   (not do-multi-click))
+
+              ;; If point has moved, finish the drag.
+              (let* (last-command this-command)
+                (and mouse-drag-copy-region
+                     do-mouse-drag-region-post-process
+                     (let (deactivate-mark)
+                       (copy-region-as-kill (mark) (point)))))
+
+            ;; Otherwise, run binding of terminating up-event.
+            (when do-multi-click
+              (set-mark start-point)) ; ian, change this. why?
+            (visible-mark-move-overlays)
+
+
+            (when (and (functionp fun)
+                       (= start-hscroll (window-hscroll start-window))
+                       ;; Don't run the up-event handler if the window
+                       ;; start changed in a redisplay after the
+                       ;; mouse-set-point for the down-mouse event at
+                       ;; the beginning of this function.  When the
+                       ;; window start has changed, the up-mouse event
+                       ;; contains a different position due to the new
+                       ;; window contents, and point is set again.
+                       (or end-point
+                           (= (window-start start-window)
+                              start-window-start)))
+
+              (push event unread-command-events)))))))
+
+#+end_src
+
+
+
+
+
+* org mode
+
+#+begin_src emacs-lisp
+
+;; todo work on org-cycle-emulate-tab
+
+;; todo, this doesn't work for a non-standard keybind
+;;(setq org-special-ctrl-k t)
+
+;; todo, generally fix org mode keys
+;; todo, org-mark-element, unbdind from M-h, bind to mark defun key
+
+(org-babel-do-load-languages
+ 'org-babel-load-languages
+ '((emacs-lisp . t)
+   (sh . t)))
+
+;; make shell work like interactive bash shell
+(setq org-babel-default-header-args:sh
+      '((:results . "output") (:shebang . "#!/bin/bash -l")))
+
+;; my patch to output stderr
+(setq org-babel-use-error-buffer nil)
+
+                                        ;
+;; org-mode manual suggests these, but I haven't used them.
+;;(global-set-key "\C-cl" 'org-store-link)
+;;(global-set-key "\C-ca" 'org-agenda)
+;; this got in the way of a haskell mode command
+;;(global-set-key "\C-cb" 'org-iswitchb)
+
+
+
+      ;; org-src-tab-acts-natively t ; broken option. using next instead, todo fix
+
+(setq org-src-fontify-natively t ; make babel blocks nice
+      org-adapt-indentation nil
+      org-src-preserve-indentation t
+      ;; The most basic logging is to keep track of when a TODO item was finished.
+      org-log-done 'time
+      ;; use a drawer to keep the logs tidy
+      org-log-into-drawer t
+      org-extend-today-until 0
+      org-startup-truncated nil
+      org-clock-persist t
+      org-clock-mode-line-total 'today
+      ;; global STYLE property values for completion
+      org-global-properties (quote (("STYLE_ALL" . "habit")))
+      org-special-ctrl-a/e t  ;; home and end work special in headlines
+      org-completion-use-ido t
+      org-catch-invisible-edits 'smart)
+
+      ;; non universally recommended settings
+(setq
+      org-default-notes-file (concat org-directory "/a/t.org")
+      org-agenda-files (quote ("/a/t.org"))
+      org-mobile-directory "/p/org-mobile"
+      org-mobile-inbox-for-pull "/p/from-mobile.org"
+      org-directory "/p")
+
+;; modeilne populated from (org-clock-get-clocked-time)
+;; which is populated from the var org-clock-total-time
+;; which is populated by a function which starts from (org-clock-get-sum-start)
+;;
+
+(org-clock-persistence-insinuate)
+
+
+(defun time-to-org-day (time)
+  (round (time-to-number-of-days
+          (time-subtract time (list 0 (* 3600 org-extend-today-until) 0)))))
+
+
+(defun my-org-confirm-babel-evaluate (lang body)
+  (not (or (string= (buffer-file-name) "/a/t.org")
+           (string= (buffer-file-name) "/home/ian/.emacs.d/my-init.org")
+           )))
+(setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate)
+
+
+(defun org-time-stamp-with-time (arg)
+  (interactive "P")
+  ;; '(4) is the argument passed by universal prefix
+  (org-time-stamp (if arg arg '(4)) t))
+
+(defun ian-org-work-time ()
+  (interactive)
+  (save-excursion
+    (set-buffer "t.org")
+    (goto-char (org-find-entry-with-id "ian-identifier-1"))
+    (org-clock-in)))
+
+(defun ian-org-idle-time ()
+  (interactive)
+  (save-excursion
+    (goto-char (org-find-entry-with-id "ian-identifier-2"))
+    (set-buffer "t.org")
+    (org-clock-in)))
+
+
+;; use org-publish-current-project with a project file open
+(setq org-publish-project-alist
+      '(("org"
+         :base-directory "/a/h/src"
+         :publishing-directory "/a/h/output"
+         :base-extension "org"
+         ;;:publishing-function org-org-publish-to-org
+         :publishing-function org-html-publish-to-html
+         :preserve-breaks t
+         :html-postamble "Everything here is <a rel=\"license\"
+    href=\"http://creativecommons.org/licenses/by-sa/4.0/\"><img
+    alt=\"Creative Commons License\" style=\"border-width:0\"
+    src=\"http://i.creativecommons.org/l/by-sa/4.0/80x15.png\" /></a>"
+         :html-head "<link rel=\"stylesheet\"
+                               href=\"style.css\"
+                               type=\"text/css\"/>"
+         :htmlized-source t)
+        ("othersrc"
+         :base-directory "/a/h/src"
+         :base-extension "css\\|el\\|"
+         :publishing-directory "/a/h/output"
+         :publishing-function org-publish-attachment)
+        ("other"
+         :base-directory "/a/h/other"
+         :base-extension ".*"
+         :publishing-directory "/a/h/output"
+         :publishing-function org-publish-attachment)))
+;; default is xhtml-strict. don't really care, but this is more common
+(setq org-html-doctype "html4-strict")
+
+;; this is needed for worg
+;; todo: for my own site, I need to define the css in a separate file
+;; in order to use this setting. see the variable help for info
+(setq org-export-htmlize-output-type t)
+
+
+;; based on http://stackoverflow.com/questions/3758139/variable-pitch-for-org-mode-fixed-pitch-for-tables
+;; keywords: proportional font, monospace
+(add-hook 'fundamental-mode-hook 'variable-pitch-mode)
+(add-hook 'text-mode-hook 'variable-pitch-mode)
+(set-face-attribute 'org-table nil :family (face-attribute 'fixed-pitch :family))
+(set-face-attribute 'org-code nil :family (face-attribute 'fixed-pitch :family))
+(set-face-attribute 'org-formula nil :family (face-attribute 'fixed-pitch :family))
+(set-face-attribute 'org-link nil :family (face-attribute 'fixed-pitch :family))
+(set-face-attribute 'org-block nil :family (face-attribute 'fixed-pitch :family))
+(set-face-attribute 'org-block-background nil :family (face-attribute 'fixed-pitch :family))
+(set-face-attribute 'org-date nil :family (face-attribute 'fixed-pitch :family))
+
+
+(defun remove-org-binds ()
+  (define-key org-mode-map (kbd "<M-return>") nil)
+  (define-key org-mode-map (kbd "C-'") nil)
+  (define-key org-mode-map (kbd "C-y") nil)
+  (define-key org-mode-map (kbd "<C-return>") nil)
+  (define-key org-mode-map (kbd "<C-M-kp-enter>") nil)
+  (define-key org-mode-map (kbd "C-,") nil)
+  (define-key org-mode-map (kbd "C-M-m") nil)
+  (define-key org-mode-map (kbd "C-k") nil)
+  (define-key org-mode-map (kbd "C-j") nil)
+  (define-key org-mode-map (kbd "C-M-i") nil)
+  (define-key org-mode-map (kbd "C-M-t") nil)
+  (define-key org-mode-map (kbd "M-a") 'nil)
+  (define-key org-mode-map (kbd "C-a") nil)
+  (define-key org-mode-map (kbd "M-e") nil)
+  (define-key org-mode-map (kbd "C-e") nil)
+  (define-key org-mode-map (kbd "C-3") nil)
+  (define-key org-mode-map (kbd "<M-left>") nil)
+  (define-key org-mode-map (kbd "<M-right>") nil)
+  (define-key org-mode-map (kbd "<S-return>") nil)
+  (define-key org-mode-map (kbd "<tab>") nil)
+  (define-key org-mode-map (kbd "<C-S-down>") nil)
+  (define-key org-mode-map (kbd "<C-S-up>") nil)
+  (define-key org-mode-map (kbd "<S-down>") nil)
+  (define-key org-mode-map (kbd "<S-up>") nil)
+  (define-key org-mode-map "\t" nil))
+(add-hook 'org-mode-hook 'remove-org-binds)
+
+#+end_src
+
+
+* org drill
+
+
+#+begin_src emacs-lisp :tangle no
+
+  (setq
+   ;; account actual time, not just scheduled time
+   org-drill-adjust-intervals-for-early-and-late-repetitions-p t
+
+   ;; still show leeches, but warn
+   org-drill-leech-method (quote warn)
+   ;; increased from default 20
+   org-drill-maximum-duration 60
+   ;; especially when starting, I want to drill hard
+   org-drill-maximum-items-per-session nil
+   ;; don't prompt to save buffer, auto-save will do that
+   org-drill-save-buffers-after-drill-sessions-p nil
+;; this one deals with varying difficulty items better
+;; sm2 is similar, but more simplistic
+ org-drill-spaced-repetition-algorithm (quote simple8)
+)
+#+end_src
+;; todo, make the prompting text reflect this number.
+   ;; org-drill-failure-quality
+
+* os specific settings
+
+disabled cuz I have none yet
+  #+begin_src emacs-lisp :tangle no
+ (cond ((eq system-type 'darwin))
+        ((eq system-type 'gnu/linux))
+        ((eq system-type 'windows-nt))
+        (t ))
+  #+end_src
+
+
+* prog-mode-defaults
+
+#+begin_src emacs-lisp
+
+
+(defun prog-mode-defaults ()
+  "Default coding hook, useful with any programming language."
+  ;; so that I can do completion before the dialog pops up
+  (local-set-key (kbd "<tab>") 'auto-complete)
+  ;; todo, this is causing error message on loading file, prolly not working
+  ;;(flycheck-mode +1)
+  (setq ac-sources (delq 'ac-source-dictionary ac-sources))
+  (highlight-symbol-mode)
+  (make-local-variable 'column-number-mode)
+  (set (make-local-variable 'comment-auto-fill-only-comments) t)
+  (auto-fill-mode t)
+  (column-number-mode t)
+  (turn-on-smartparens-mode)
+
+  ;; prettify lambdas
+  (font-lock-add-keywords
+   nil `(("(\\(lambda\\>\\)"
+          (0 (progn (compose-region (match-beginning 1) (match-end 1)
+                                    ,(make-char 'greek-iso8859-7 107))
+                    nil))))))
+(add-hook 'prog-mode-hook 'prog-mode-defaults)
+
+;; enable flyspell in prog mode. text mode is handled
+(add-hook 'prog-mode-hook 'flyspell-prog-mode)
+
+
+
+#+end_src
+
+** yank auto-indent
+#+begin_src emacs-lisp
+;; automatically indenting yanked text if in programming-modes
+(defvar yank-indent-modes
+  '(LaTeX-mode TeX-mode)
+  "Modes in which to indent regions that are yanked (or yank-popped).
+Only modes that don't derive from `prog-mode' should be listed here.")
+
+(defvar yank-indent-blacklisted-modes
+  '(python-mode slim-mode haml-mode)
+  "Modes for which auto-indenting is suppressed.")
+
+(defvar yank-advised-indent-threshold 2000
+  "Threshold (# chars) over which indentation does not automatically occur.")
+
+(defun yank-advised-indent-function (beg end)
+  "Do indentation, as long as the region isn't too large."
+  (if (<= (- end beg) yank-advised-indent-threshold)
+      (indent-region beg end nil)))
+
+(defadvice yank (after yank-indent activate)
+  "If current mode is one of 'yank-indent-modes,
+indent yanked text (with prefix arg don't indent)."
+  (if (and (not (ad-get-arg 0))
+           (not (member major-mode yank-indent-blacklisted-modes))
+           (or (derived-mode-p 'prog-mode)
+               (member major-mode yank-indent-modes)))
+      (let ((transient-mark-mode nil))
+        (yank-advised-indent-function (region-beginning) (region-end)))))
+
+(defadvice yank-pop (after yank-pop-indent activate)
+  "If current mode is one of 'yank-indent-modes,
+indent yanked text (with prefix arg don't indent)."
+  (if (and (not (ad-get-arg 0))
+           (not (member major-mode yank-indent-blacklisted-modes))
+           (or (derived-mode-p 'prog-mode)
+               (member major-mode yank-indent-modes)))
+      (let ((transient-mark-mode nil))
+        (yank-advised-indent-function (region-beginning) (region-end)))))
+
+#+end_src
+
+
+* shell mode
+  #+begin_src emacs-lisp
+;; avoid stupid git crap like "warning, terminal not fully functional"
+(setenv "PAGER" "cat")
+;; don't store successive duplicates in comint command history
+(setq comint-input-ignoredups t)
+
+(defun add-mode-line-dirtrack ()
+  (add-to-list 'mode-line-buffer-identification
+               '(:propertize (" " default-directory " ") face dired-directory)))
+(add-hook 'shell-mode-hook 'add-mode-line-dirtrack)
+
+
+;; don't fully understand it, but it works.
+;; http://www.emacswiki.org/emacs/ShellDirtrackByProcfs
+(defun track-shell-directory/procfs ()
+  (shell-dirtrack-mode 0)
+  (add-hook 'comint-preoutput-filter-functions
+            (lambda (str)
+              (prog1 str
+                (when (string-match comint-prompt-regexp str)
+                  (cd (file-symlink-p
+                       (format "/proc/%s/cwd" (process-id
+                                               (get-buffer-process
+                                                (current-buffer)))))))))
+            nil t))
+(setq comint-buffer-maximum-size 100000)
+(add-to-list 'comint-output-filter-functions 'comint-truncate-buffer)
+(defun new-shell ()
+  (interactive)
+  (shell (generate-new-buffer-name "*shell*")))
+;;
+(defun shell-wrap (prefix)
+"wrap the shell function, automatically generate a new name for a prefix arg"
+  (interactive "P")
+  (if prefix
+      (new-shell)
+    (shell)))
+
+(add-hook 'shell-mode-hook 'track-shell-directory/procfs)
+#+end_src
+* smartparens
+the melpa git version had a catastrophic bug I reported.
+downgraded to marmalade version and everything is working fine.
+#+begin_src emacs-lisp
+(require 'smartparens-config)
+(show-smartparens-global-mode t)
+
+
+(defun gp/sp/pair-on-newline-and-indent (id action context)
+  "Open a new brace or bracket expression, with relevant newlines and indent. "
+  (save-excursion
+    (newline)
+    (indent-according-to-mode))
+  (indent-according-to-mode))
+
+;; when opening a pair, and then inserting a newline, push the closing pair to another newline
+(sp-pair "{" nil :post-handlers
+         '(:add ((lambda (id action context)
+                   (gp/sp/pair-on-newline-and-indent id action context)) (kbd "<return>"))))
+(sp-pair "[" nil :post-handlers
+         '(:add ((lambda (id action context)
+                   (gp/sp/pair-on-newline-and-indent id action context)) (kbd "<return>"))))
+
+
+;; in my version, this is not a pairing.
+;; not sure if it is in a future version since I reverted to marmalade
+;; Don't need c-comments in strings -- they frustrate filename globs
+;; (sp-pair "/*" nil :unless '(sp-in-string-p))
+
+;; Don't need quotes to pair next to words
+(sp-pair "\"" nil :unless '(sp-point-before-word-p sp-point-after-word-p))
+(sp-pair "'" nil :unless '(sp-point-before-word-p sp-point-after-word-p))
+
+
+;; todo, testout these mode specific settings from graphene.
+;; Ruby-specific pairs and handlers
+(require 'smartparens-ruby)
+
+;; Markdown
+(sp-local-pair '(markdown-mode gfm-mode) "*" "*"
+               :unless '(sp-in-string-p)
+               :actions '(insert wrap))
+
+;; Except in HTML
+(sp-local-pair 'html-mode "\"" nil :unless '(:rem sp-point-after-word-p))
+;; CoffeeScript PyStrings
+(push 'coffee-mode sp-autoescape-string-quote-if-empty)
+
+
+
+  #+end_src
+* smex
+  todo; check out smex-show-unbound-commands shows frequently used commands that have no key bindings.
+  #+begin_src emacs-lisp
+; these must be before smex-initialize
+    (setq
+     smex-save-file "~/.emacs.d/.smex-items")
+
+    (smex-initialize)
+  #+end_src
+* speedbar
+(sr-speedbar-close)
+(sr-speedbar-open)
+
+** todo, disabled cuz of broken package
+      #+begin_src emacs-lisp :tangle no
+(require 'sr-speedbar)
+  (setq speedbar-hide-button-brackets-flag t ;; didn't notice a diff
+      speedbar-file-unshown-regexp "flycheck-.*"
+      sr-speedbar-width 40
+      sr-speedbar-width-x 40
+      sr-speedbar-auto-refresh nil
+      sr-speedbar-skip-other-window-p t
+      sr-speedbar-right-side nil
+speedbar-hide-button-brackets-flag nil)
+      #+end_src
+* spell correction
+#+begin_src emacs-lisp
+  (setq
+   ispell-program-name "hunspell"
+   ispell-silently-savep t) ; don't prompt to save personal dictionary
+
+  (require 'rw-hunspell)
+#+end_src
+rw-hunspell sets up hunspell dictionary automagically.
+
+
+Rant: Hunspell SHOULD be standard. its used by firefox and openoffice and
+osx. In contrast, the first few words I added to aspell dictionary were
+"emacs" "customizable" and "timestamp". Hunspell already has those,
+thank god.
+
+ispell-personal-dictionary does not document where the hunspell
+dictionary goes by default, but it is ~/.hunspell_en_US for me
+
+
+* tex
+#+begin_src emacs-lisp
+(setq-default TeX-PDF-mode t) ; use pdf
+
+; more sensible defaults based on info manual quickstart
+ (setq TeX-auto-save t)
+     (setq TeX-parse-self t)
+
+
+#+end_src
+* undo tree
+#+begin_src emacs-lisp
+
+  ;; undo-tree checks for minor modes which override
+  ;; its minor mode keymap, and sets global keybinds if
+  ;; that happens. this will prevent that, but I have no
+  ;; reason to do that, so it is commented.
+  ;; (defun undo-tree-overridden-undo-bindings-p () nil)
+
+;; todo, send patch undo-tree-visualize should scroll with the scroll key, instead of just pgup pgdn (aka next/prior)
+  (global-undo-tree-mode)
+  ;; disabled due to bug, something like unknown entry in undo tree canary
+  ;; (setq undo-tree-auto-save-history t)
+  (setq undo-outer-limit 100000000 ; per undo command
+   undo-limit 500000000 ; undo history limit
+   undo-strong-limit 600000000) ; undo history limit plus some extra
+
+
+#+end_src
+
+* visible mark mode
+
+these colors were better for dark theme
+#+begin_src emacs-lisp :tangle no
+
+
+
+(defface visible-mark-face1
+    '((((type tty) (class mono)))
+      (t (:background "LimeGreen"))) "")
+  (defface visible-mark-face2
+    '((((type tty) (class mono)))
+      (t (:background "red4"))) "")
+  (defface visible-mark-forward-face1
+    '((((type tty) (class mono)))
+      (t (:background "dark magenta"))) "")
+  (defface visible-mark-active
+    '((((type tty) (class mono)))
+      (t (:background "gold"))) "")
+  (defface mouse-cursor-face
+    '((((type tty) (class mono)))
+      (t (:background "DeepPink1"))) "")
+
+#+end_src
+
+
+#+begin_src emacs-lisp
+
+(add-to-list 'load-path "~/.emacs.d/src/visible-mark")
+
+    ;; since it is not easy to change the mark overlay priority, I change this one.
+    (setq show-paren-priority 999)
+
+
+  (defface visible-mark-active
+    '((((type tty) (class mono)))
+      (t (:background "magenta"))) "")
+
+
+
+  (defface mouse-cursor-face
+    '((((type tty) (class mono)))
+      (t (:background "DeepPink1"))) "")
+
+
+  (require 'visible-mark)
+
+(setq visible-mark-faces '(visible-mark-face1 visible-mark-face2))
+  (setq visible-mark-forward-faces '(visible-mark-forward-face1))
+
+
+  ; highlight the last 2 marks
+  (setq visible-mark-max 2)
+  ; highlight 1 forward mark
+  (setq visible-mark-forward-max 1)
+  ; globally activate visible-mark-mode
+  (global-visible-mark-mode +1)
+
+
+;; todo, it doesn't seem to be exposed in elisp, but it would be nice
+;; if I could define overlay faces to use inverse foreground color
+
+
+#+end_src
+
+#+RESULTS:
+: t
+
+
+* key binds. keep at end of file
+this should come at the end because it depends on key maps being
+created in earlier sections.
+
+** emacs keys notes
+commands not needed in ido mode and their replacement in ido mode
+spell check fix -> use current pattern and start new one
+narrow -> create subdirectory
+org-cycle -> M-s search recently used directory
+vert split Window -> create file instead of select match
+delete-other-windows -> open dired buffer
+delete current window -> delete buffer/file
+find file -> search within all subdirectories
+
+forward/back error
+
+buffer select -> toggle find file / buffer
+up/down -> next/previous history
+forward/back -> ido-forward/back
+
+
+right keyboard attributes:  movement, involve typing words
+left keyboard attributes:  non-typing  universal  non-movement
+
+
+
+
+todo
+fix global unpop mark ring
+setup helm
+learn cedet and projectile and helm
+setup key for pop-global-mark
+try out C-M-\ indent region
+set quoted insert to some obscure keybind
+make currently overrided M-u uppercase word into something obscure
+remember mode
+bind shell-command to something better
+investigate tags
+investigate keys in isearch mode and find file mode
+try out occur. M-s o
+investigate programming modes. M-g n/b next/previous error. gdb?
+investigate org mode keys
+learn version control
+learn mail
+check out imenu
+bind capitalize-word to something obscure
+sentance/paragraph movement/marking should be swapped with sexp/paren movement based on mode
+bind fill-paragraph to something obscure
+setup linewise paste
+install magit (git control)
+magpie expansion provides a completion key for acronym expansion based on buffer text
+learn ediff
+universal google
+figure out auto-indent
+learn eshell and prelude settings for it
+combine register prefix and c-x prefix
+note: remember to think of mouse & foot pedals
+commands to change: select other window: C-x o.
+** prefix keybind changes
+#+begin_src emacs-lisp
+
+
+  ; prefix key binds.
+  ; good info http://www.masteringemacs.org/articles/2011/02/08/mastering-key-bindings-emacs/
+  ; rebinding the prefix keys are tricky. apparently, some modes ignore any redefinition of a prefix key and use it explicitly,
+  ; so you have to dig into their key maps and redo things.
+  ; There are 2 simpler alternatives which have their own downsides.
+  ; One is cua mode, which I do not like because it smashes 2 keybinds onto 1 and limits what you can do.
+  ; The other is keyboard-translate, which translates the key presses before anything else.
+  ; The downside is that it translates them when you aren't using them as a prefix.
+  ; Since the swaps I'm using are all very accessible, the only downside is some mental jugling when reading docs etc about these keybinds.
+
+  ; I've seen this as an another suggestion, it was a total fail. The prefix command took over both keys.
+  ; (define-key key-translation-map [f12] "\C-c")
+  ; (define-key key-translation-map "\C-c" [left])
+
+
+  ;idea to remove the hook later since it is only needed at startup.
+  ; did not work however, and there is not a real need to fix it, so I did not investigate
+  ;(defun removeSwapHook ()
+  ;  (remove-hook 'buffer-list-update-hook 'myKeySwap)
+  ;  (remove-hook 'change-major-mode-hook 'removeSwapHook))
+  ;(add-hook 'change-major-mode-hook 'removeSwapHook)
+
+
+  ; went through almost all the relevant standard hooks,
+  ; this overcomes a known bug that (keyboard-translate) does not get applied when running emacs daemon
+  (add-hook 'buffer-list-update-hook (lambda () (interactive)
+                                       (keyboard-translate ?\C-x ?\C-s)
+                                       (keyboard-translate ?\C-s ?\C-x)
+                                       (keyboard-translate ?\C-c ?\C-d)
+                                       (keyboard-translate ?\C-d ?\C-c)))
+
+
+
+  ; these all don't work
+  ; don't know why this doesn't error but reversing the keys does
+  ;(keyboard-translate ?\t ?\M-\t)
+  ;(keyboard-translate [M-tab] [tab])
+  ; from what i can tell, it wants to use a keyboard-translate-table,
+  ; which is a char table, which is a vector indexed by chars,
+  ; and mod+tab is not a char (it has too many bits), it is an integer
+  ; it actually says it can hold vectors or strings, but that it is obsolete to do so
+  ;(characterp ?\M-a)
+  ;(characterp ?\C-a)
+
+
+
+#+end_src
+
+** named commands
+*** tramp sudo
+/ssh:host|sudo:host:
+when in the same session, you can then do:
+/sudo:root@host:
+
+*** org insert table row
+[org-shiftmetadown/up]
+*** toggle line continuation / truncation / wrap                      :drill:
+SCHEDULED: <2014-04-07 Mon>
+:PROPERTIES:
+:ID:       5f3f567a-0926-4d92-81f3-4e4cd6070af2
+:DRILL_LAST_INTERVAL: 28.6736
+:DRILL_REPEATS_SINCE_FAIL: 5
+:DRILL_TOTAL_REPEATS: 5
+:DRILL_FAILURE_COUNT: 1
+:DRILL_AVERAGE_QUALITY: 3.4
+:DRILL_EASE: 2.666
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:37>
+:END:
+    [toggle-truncate-lines]
+*** auto-save on/off                                                  :drill:
+SCHEDULED: <2014-05-13 Tue>
+:PROPERTIES:
+:ID:       462f859d-1a06-46a3-ac72-6ffe5b4417c9
+:DRILL_LAST_INTERVAL: 71.5839
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 4.75
+:DRILL_EASE: 4.85
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:11>
+:END:
+    [my-as-on/my-as-off]
+*** toggle menu bar
+[menu-bar-mode]
+*** show abbreviations  :drill:
+SCHEDULED: <2014-03-24 Mon>
+:PROPERTIES:
+:ID:       479a2ced-b952-4088-a6e3-862cd37693a9
+:DRILL_LAST_INTERVAL: 32.7466
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 4.0
+:DRILL_EASE: 3.204
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 18:03>
+:END:
+[list-abbrevs]
+
+*** rename-file-and-buffer
+*** ediff-buffers
+*** refill-mode
+automatically balance a paragraph with newlines
+*** executable-make-buffer-file-executable-if-script-p
+make a script executable
+*** (setq lazy-highlight-cleanup nil)
+*** auto-revert-tail-mode
+tail a file
+*** trash-file-and-buffer
+#+begin_src emacs-lisp
+(defun trash-file-and-buffer ()
+  "Removes file connected to current buffer and kills buffer."
+  (interactive)
+  (let ((filename (buffer-file-name))
+        (buffer (current-buffer))
+        (name (buffer-name)))
+    (if (not (and filename (file-exists-p filename)))
+        (error "Buffer '%s' is not visiting a file!" name)
+      (delete-file filename)
+      (kill-buffer buffer)
+      (message "File '%s' successfully removed" filename))))
+
+#+end_src
+*** what-line
+*** linum-mode
+line numbers
+
+*** sgml-pretty-print
+format xml in nxml-mode
+*** visual-line-mode
+toggle word wrap.
+** compound commands
+*** C-xc
+:PROPERTIES:
+:ID:       d0802daa-9281-4a9f-ab4a-47d9f7ef7cfd
+:END:
+exit
+*** [C-x x]                                                           :drill:
+SCHEDULED: <2014-03-24 Mon>
+:PROPERTIES:
+:ID:       2f7d1353-3c20-4e00-95ea-1f84c4d87fc1
+:DRILL_LAST_INTERVAL: 32.7466
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 4.0
+:DRILL_EASE: 3.204
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 18:03>
+:END:
+save file
+*** [C-x e]                                                           :drill:
+SCHEDULED: <2014-03-27 Thu>
+:PROPERTIES:
+:ID:       b802eeb8-ddcd-4778-844a-b6e737b54d7d
+:DRILL_LAST_INTERVAL: 50.6823
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 3
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 5.0
+:DRILL_EASE: 5.815
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:41>
+:END:
+eval last sexp
+*** C-x u
+[undo-tree-visualize]
+*** C-j u/U
+[undo-tree save/restore state via register]
+*** C-c -
+[org insert table horizontal line or create list]
+*** [C-x tab]                                                         :drill:
+SCHEDULED: <2014-03-24 Mon>
+:PROPERTIES:
+:ID:       ceb701d7-3d44-4781-ae23-7309ca887a01
+:DRILL_LAST_INTERVAL: 32.7466
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 4.0
+:DRILL_EASE: 3.204
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:50>
+:END:
+dumb indent
+
+[shift-left and shift-right are default for indenting by tab stop,
+and they are only defined as lambdas so I copy them here
+to use with up and down.
+#+begin_src emacs-lisp
+;; condition cuz emacs24 release doesn't have this yet
+(when (boundp 'indent-rigidly-map)
+    (define-key indent-rigidly-map (kbd "<C-left>")
+      (lambda (beg end) (interactive "r")
+        (let* ((current (indent-rigidly--current-indentation beg end))
+               (next (indent--next-tab-stop current)))
+          (indent-rigidly beg end (- next current)))))
+
+    (define-key indent-rigidly-map (kbd "<C-right>")
+      (lambda (beg end) (interactive "r")
+        (let* ((current (indent-rigidly--current-indentation beg end))
+               (next (indent--next-tab-stop current 'prev)))
+          (indent-rigidly beg end (- next current))))))
+#+end_src
+]
+*** C-x *
+[calc-dispatch]
+*** C-x =
+[point information]
+*** C-x d
+[dired]
+*** C-xb
+[ibuffer]
+#+begin_src emacs-lisp
+  (global-set-key (kbd "C-x C-b") 'ibuffer)
+#+end_src
+** gnus
+searching overview.
+3 types:
+ingroup searching
+nnir searching with notmuch, specific group (not sure if it can do multiple)
+search all groups with mairix
+*** [a]
+compose new message
+*** [C-c C-c]
+send message
+*** [s]
+save newsrc file, alterations to groups.
+*** [g]
+gnus refresh / get new
+*** [m]
+gnus new message
+*** [F]
+gnus quoted reply all
+*** [e]
+gnus draft edit message
+*** [delete]
+gnus delete draft
+#+begin_src emacs-lisp
+(add-hook 'gnus-startup-hook
+          (lambda ()
+            (define-key gnus-summary-mode-map (kbd "<delete>") 'gnus-summary-delete-article)))
+#+end_src
+
+*** [b]
+mairix search
+#+begin_src emacs-lisp
+(add-hook 'gnus-startup-hook
+          (lambda ()
+            (define-key gnus-group-mode-map "b" 'nnmairix-search)
+            (define-key gnus-summary-mode-map "b" 'nnmairix-search)))
+#+end_src
+*** [B m]
+move message, or messages in region
+*** [#]
+mark article, move with B m
+*** [B delete]
+gnus delete draft
+*** [/ plus x a / b]
+search current group (or see info manual for more groups),
+using the gnus native search (its slow, do a notmuch or mairix search instead)
+x= extra (ie. to)
+todo; send in patch to make author search to in sent folder
+a = author
+/ = subject
+b = body
+see C-h m for a full list
+*** [ G G ]
+do a nnir notmuch search, for the group on the current line
+*** [ A T ]
+jump to thread from nnir group
+
+*** [marks]
+! = saved for later
+E = expired
+M-& apply process mark to a non-process mark command
+*** [S D e]
+edit as new
+** message mode
+*** [C-ck]
+discard message
+** notmuch
+*** [space]
+notmuch advance to next message/thread
+
+** readline / bash / .inputrc
+*** [M-0-9]
+SCHEDULED: <2014-05-13 Tue>
+:PROPERTIES:
+:ID:       dac68f2e-37c2-448e-861d-0554e51f1414
+:DRILL_LAST_INTERVAL: 71.5839
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 4.75
+:DRILL_EASE: 4.85
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
+:END:
+bash digit-argument
+
+removed drill from all these because I'm using emacs for shell now
+*** [C-2]
+SCHEDULED: <2014-03-15 Sat>
+:PROPERTIES:
+:ID:       d2e87812-6ab7-432f-ad7c-4281c0e3b86b
+:DRILL_LAST_INTERVAL: 12.979
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 3
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 3.333
+:DRILL_EASE: 2.626
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:00>
+:END:
+terminal X paste
+*** [C-3]
+SCHEDULED: <2014-03-15 Sat>
+:PROPERTIES:
+:ID:       3b156730-eb92-4149-b4ce-f93a9098d2b4
+:DRILL_LAST_INTERVAL: 12.979
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 3
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 3.333
+:DRILL_EASE: 2.626
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:00>
+:END:
+terminal open file manager
+*** [C-q]
+SCHEDULED: <2014-03-12 Wed>
+:PROPERTIES:
+:ID:       ed6a19de-d000-4469-9dd9-7b9e35f6c751
+:DRILL_LAST_INTERVAL: 2.8975
+:DRILL_REPEATS_SINCE_FAIL: 2
+:DRILL_TOTAL_REPEATS: 10
+:DRILL_FAILURE_COUNT: 12
+:DRILL_AVERAGE_QUALITY: 2.692
+:DRILL_EASE: 2.311
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:33>
+:END:
+bash exchange-point-and-mark
+
+*** [C-M-q]
+SCHEDULED: <2014-03-14 Fri>
+:PROPERTIES:
+:ID:       9827eb7e-532e-41fb-8d91-8c95c23553f5
+:DRILL_LAST_INTERVAL: 11.6739
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 3
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 3.333
+:DRILL_EASE: 2.626
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
+:END:
+quoted insert
+*** [C-w]
+SCHEDULED: <2014-04-07 Mon>
+:PROPERTIES:
+:ID:       58fea89a-def9-4aac-95d4-fdd63fde8097
+:DRILL_LAST_INTERVAL: 28.6736
+:DRILL_REPEATS_SINCE_FAIL: 5
+:DRILL_TOTAL_REPEATS: 5
+:DRILL_FAILURE_COUNT: 1
+:DRILL_AVERAGE_QUALITY: 3.4
+:DRILL_EASE: 2.666
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
+:END:
+    bash kill-region
+*** [C-e]
+SCHEDULED: <2014-03-27 Thu>
+:PROPERTIES:
+:ID:       3ee7662f-3ac7-46ff-afe7-73244656d48b
+:DRILL_LAST_INTERVAL: 50.6823
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 3
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 5.0
+:DRILL_EASE: 5.815
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
+:END:
+    bash yank-last-arg
+*** C-r
+:PROPERTIES:
+:ID:       579a9008-0758-4ba9-a52f-175f264fe96a
+:END:
+    bash history-search-backward
+*** [C-t]
+SCHEDULED: <2014-04-04 Fri>
+:PROPERTIES:
+:ID:       25e737fe-52c4-452b-ab93-037575375579
+:DRILL_LAST_INTERVAL: 26.2331
+:DRILL_REPEATS_SINCE_FAIL: 5
+:DRILL_TOTAL_REPEATS: 5
+:DRILL_FAILURE_COUNT: 1
+:DRILL_AVERAGE_QUALITY: 3.2
+:DRILL_EASE: 2.554
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
+:END:
+    shell-expand-line, expand like bash does u hit enter
+*** [C-a]
+SCHEDULED: <2014-04-06 Sun>
+:PROPERTIES:
+:ID:       384b3337-3cb0-4b3b-8a1a-8ae299ae212b
+:DRILL_LAST_INTERVAL: 27.9921
+:DRILL_REPEATS_SINCE_FAIL: 5
+:DRILL_TOTAL_REPEATS: 5
+:DRILL_FAILURE_COUNT: 1
+:DRILL_AVERAGE_QUALITY: 3.6
+:DRILL_EASE: 2.802
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:37>
+:END:
+    bash comment-line
+*** [C-s]
+SCHEDULED: <2014-03-10 Mon>
+:PROPERTIES:
+:ID:       4b5c71f9-6035-4b92-bcad-e400e5e25d66
+:DRILL_LAST_INTERVAL: 8.225
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 7
+:DRILL_FAILURE_COUNT: 4
+:DRILL_AVERAGE_QUALITY: 2.879
+:DRILL_EASE: 2.399
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 20:57>
+:END:
+    bash yank-nth-arg
+    yank $1 of last argument, or nth if prefixed with a digit argument
+*** [C-d]
+SCHEDULED: <2014-03-12 Wed>
+:PROPERTIES:
+:ID:       f5da97c1-6e3c-44dd-a2f1-7dacd7f523da
+:DRILL_LAST_INTERVAL: 9.8132
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 7
+:DRILL_FAILURE_COUNT: 3
+:DRILL_AVERAGE_QUALITY: 3.21
+:DRILL_EASE: 2.559
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:04>
+:END:
+   bash undo
+*** [C-f]
+SCHEDULED: <2014-05-13 Tue>
+:PROPERTIES:
+:ID:       0f1def18-0d94-45e7-b258-f621e67cefd7
+:DRILL_LAST_INTERVAL: 71.5839
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 4.75
+:DRILL_EASE: 4.85
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:11>
+:END:
+bash menu-complete
+*** [C-g]
+SCHEDULED: <2014-03-10 Mon>
+:PROPERTIES:
+:ID:       263e9479-de1d-4e78-8600-5a0f3a8e2dd9
+:DRILL_LAST_INTERVAL: 8.0608
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 8
+:DRILL_FAILURE_COUNT: 5
+:DRILL_AVERAGE_QUALITY: 2.966
+:DRILL_EASE: 2.439
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:04>
+:END:
+   bash edit-and-execute-command
+*** C-z
+*** C-x
+    emacs hard to rebind
+    looks like it actually wouldn't be that hard.
+    possibly take the output from bind -p, make all those keys undefined.
+*** C-c
+    quit/cancel
+*** C-v
+    yank, aka paste
+*** C-M-v
+    yank-pop
+*** [C-b]
+SCHEDULED: <2014-03-14 Fri>
+:PROPERTIES:
+:ID:       1a688c40-4bba-4053-a28b-0e1e8d3f4985
+:DRILL_LAST_INTERVAL: 4.9208
+:DRILL_REPEATS_SINCE_FAIL: 2
+:DRILL_TOTAL_REPEATS: 8
+:DRILL_FAILURE_COUNT: 4
+:DRILL_AVERAGE_QUALITY: 3.066
+:DRILL_EASE: 2.487
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:33>
+:END:
+   bash menu-complete-backward
+*** tab
+completion
+*** [C-tab]
+SCHEDULED: <2014-03-14 Fri>
+:PROPERTIES:
+:ID:       75d57537-8a32-4a18-982e-6d6f756a9ba6
+:DRILL_LAST_INTERVAL: 12.2744
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 3
+:DRILL_FAILURE_COUNT: 2
+:DRILL_AVERAGE_QUALITY: 3.667
+:DRILL_EASE: 2.855
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
+:END:
+terminal find
+*** [C-left/right]
+SCHEDULED: <2014-03-27 Thu>
+:PROPERTIES:
+:ID:       5587c07b-c003-470f-bef4-fa55f00524ff
+:DRILL_LAST_INTERVAL: 50.6823
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 3
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 5.0
+:DRILL_EASE: 5.815
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:41>
+:END:
+   forward/backward-word
+
+*** [C-u]
+SCHEDULED: <2014-03-19 Wed>
+:PROPERTIES:
+:ID:       b5342b6b-f14f-4a6b-99d8-110fdef243f2
+:DRILL_LAST_INTERVAL: 24.3844
+:DRILL_REPEATS_SINCE_FAIL: 5
+:DRILL_TOTAL_REPEATS: 5
+:DRILL_FAILURE_COUNT: 2
+:DRILL_AVERAGE_QUALITY: 3.0
+:DRILL_EASE: 2.456
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:51>
+:END:
+   bash backward-kill-word
+*** [C-i]
+SCHEDULED: <2014-03-14 Fri>
+:PROPERTIES:
+:ID:       6e306a04-8f21-4142-8c00-8a87a3544d6e
+:DRILL_LAST_INTERVAL: 11.6739
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 3
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 3.333
+:DRILL_EASE: 2.626
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 20:58>
+:END:
+terminal find up
+[ terminal crap, duplicate of tab ]
+*** [C-o]
+SCHEDULED: <2014-03-15 Sat>
+:PROPERTIES:
+:ID:       40b6d9ce-2427-4905-b444-d6d90c5a4da4
+:DRILL_LAST_INTERVAL: 23.5247
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 3.5
+:DRILL_EASE: 2.73
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:25>
+:END:
+   bash operate-and-get-next, submit and bring up next item in history
+*** [C-p]
+SCHEDULED: <2014-03-11 Tue>
+:PROPERTIES:
+:ID:       4956027e-c5da-48de-8925-6f6b6dd98cec
+:DRILL_LAST_INTERVAL: 1.575
+:DRILL_REPEATS_SINCE_FAIL: 1
+:DRILL_TOTAL_REPEATS: 9
+:DRILL_FAILURE_COUNT: 8
+:DRILL_AVERAGE_QUALITY: 2.597
+:DRILL_EASE: 2.265
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:38>
+:END:
+bash dabbrev-expand,
+    complete historical command names
+*** C-h
+    terminal incompatible junk
+*** [C-k]
+SCHEDULED: <2014-05-09 Fri>
+:PROPERTIES:
+:ID:       f91ff161-8d8c-4f47-beb5-09f86bf774d5
+:DRILL_LAST_INTERVAL: 67.6174
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 1
+:DRILL_AVERAGE_QUALITY: 4.75
+:DRILL_EASE: 4.85
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
+:END:
+   bash kill-line, to end of line
+*** [C-l]
+SCHEDULED: <2014-05-13 Tue>
+:PROPERTIES:
+:ID:       4798acc1-4fc8-406e-bc95-8131cfa255a5
+:DRILL_LAST_INTERVAL: 71.5839
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 4.75
+:DRILL_EASE: 4.85
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:12>
+:END:
+   bash clear screen
+*** [C-m]
+SCHEDULED: <2014-03-14 Fri>
+:PROPERTIES:
+:ID:       119a0a90-9253-4131-b0c8-5aa7d8cf2259
+:DRILL_LAST_INTERVAL: 11.6739
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 3
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 3.333
+:DRILL_EASE: 2.626
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 20:58>
+:END:
+[--------]
+#+begin_src emacs-lisp
+(add-hook 'comint-mode-hook
+          (lambda ()
+            (define-key comint-mode-map "\C-m" nil)))
+
+#+end_src
+*** [C-space]
+SCHEDULED: <2014-03-12 Wed>
+:PROPERTIES:
+:ID:       803e2480-4e11-41d0-a261-4f5930a7f9a9
+:DRILL_LAST_INTERVAL: 10.0687
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 6
+:DRILL_FAILURE_COUNT: 1
+:DRILL_AVERAGE_QUALITY: 2.875
+:DRILL_EASE: 2.397
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:06>
+:END:
+bash set mark
+*** [C-delete]
+SCHEDULED: <2014-03-15 Sat>
+:PROPERTIES:
+:ID:       3d0c188b-3cf0-4f0a-83c8-78f6e4040ee5
+:DRILL_LAST_INTERVAL: 24.4352
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 3.75
+:DRILL_EASE: 2.929
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:44>
+:END:
+   bash delete word
+** isearch
+*** [C-w]                                                             :drill:
+SCHEDULED: <2014-03-27 Thu>
+:PROPERTIES:
+:ID:       f0e2b6e2-809b-40c2-8d72-0f7e35eda9b3
+:DRILL_LAST_INTERVAL: 50.6823
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 3
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 5.0
+:DRILL_EASE: 5.815
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
+:END:
+paste word/char under cursor into isearch
+*** [M-n/p]                                                           :drill:
+SCHEDULED: <2014-03-27 Thu>
+:PROPERTIES:
+:ID:       b3692e47-458e-41a0-b2be-c5f61b4eadbd
+:DRILL_LAST_INTERVAL: 50.6823
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 3
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 5.0
+:DRILL_EASE: 5.815
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:41>
+:END:
+next/previous isearch history
+*** [C-o]                                                             :drill:
+SCHEDULED: <2014-03-11 Tue>
+:PROPERTIES:
+:ID:       8e36b562-7e0c-45e6-a41b-3cd96c134b33
+:DRILL_LAST_INTERVAL: 19.9622
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 3.5
+:DRILL_EASE: 2.73
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:30>
+:END:
+isearch-occur
+    Activate occur easily inside isearch
+[
+    from starter-kit
+#+begin_src emacs-lisp
+  (define-key isearch-mode-map (kbd "C-o")
+    (lambda () (interactive)
+      (let ((case-fold-search isearch-case-fold-search))
+        (occur (if isearch-regexp
+                   isearch-string
+                 (regexp-quote isearch-string))))))
+#+end_src
+]
+*** [m-r]
+#+begin_src emacs-lisp
+  (defun my-isearch-toggle-regexp ()
+    (interactive)
+    (isearch-toggle-regexp)
+    (cond (isearch-regexp
+           (global-set-key (kbd "C-r") 'isearch-backward-regexp)
+           (define-key global-map (kbd search-key) 'isearch-forward-regexp))
+          (t
+           (global-set-key (kbd "C-r") 'isearch-backward)
+           (define-key global-map (kbd search-key) 'isearch-forward))))
+  (define-key isearch-mode-map (kbd "M-r") 'my-isearch-toggle-regexp)
+  #+end_src
+
+** icomplete
+*** C-. C-,
+icomplete-forward/backward-completions
+
+** ido
+*** [C-j]                                                             :drill:
+SCHEDULED: <2014-04-01 Tue>
+:PROPERTIES:
+:ID:       9cc3392d-00a1-4564-8c57-b418a20d9235
+:DRILL_LAST_INTERVAL: 22.6411
+:DRILL_REPEATS_SINCE_FAIL: 5
+:DRILL_TOTAL_REPEATS: 6
+:DRILL_FAILURE_COUNT: 1
+:DRILL_AVERAGE_QUALITY: 2.833
+:DRILL_EASE: 2.378
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:34>
+:END:
+ido-find-file create file
+*** [//]                                                             :drill:
+SCHEDULED: <2014-03-27 Thu>
+:PROPERTIES:
+:ID:       18ce7d51-93ca-4d41-8e8d-1958cff9c726
+:DRILL_LAST_INTERVAL: 50.6823
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 3
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 5.0
+:DRILL_EASE: 5.815
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
+:END:
+ido goto root
+*** [C-k]                                                             :drill:
+:PROPERTIES:
+:ID:       af4cc865-fe0c-424b-aa5b-2097320d6fb6
+:DRILL_LAST_INTERVAL: 0.0
+:DRILL_REPEATS_SINCE_FAIL: 0
+:DRILL_TOTAL_REPEATS: 5
+:DRILL_FAILURE_COUNT: 2
+:DRILL_AVERAGE_QUALITY: 3.083
+:DRILL_EASE: 2.496
+:DRILL_LAST_QUALITY: 2
+:DRILL_LAST_REVIEWED: <2014-04-14 Mon 11:31>
+:END:
+    ido kill buffer/file
+*** [C-d]                                                             :drill:
+SCHEDULED: <2014-04-04 Fri>
+:PROPERTIES:
+:ID:       c93d6e0c-ae33-45aa-9610-ce33cfc406a0
+:DRILL_LAST_INTERVAL: 25.8141
+:DRILL_REPEATS_SINCE_FAIL: 5
+:DRILL_TOTAL_REPEATS: 5
+:DRILL_FAILURE_COUNT: 1
+:DRILL_AVERAGE_QUALITY: 3.0
+:DRILL_EASE: 2.456
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:37>
+:END:
+ido open dired buffer
+*** [M-d]                                                             :drill:
+SCHEDULED: <2014-03-11 Tue>
+:PROPERTIES:
+:ID:       8eab4299-207f-4a4a-a698-38f31cb5ff1b
+:DRILL_LAST_INTERVAL: 1.7651
+:DRILL_REPEATS_SINCE_FAIL: 1
+:DRILL_TOTAL_REPEATS: 6
+:DRILL_FAILURE_COUNT: 6
+:DRILL_AVERAGE_QUALITY: 2.583
+:DRILL_EASE: 2.258
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:38>
+:END:
+ido search within all subdirectories
+*** [M-m]                                                             :drill:
+SCHEDULED: <2014-03-10 Mon>
+:PROPERTIES:
+:ID:       cb7f6420-1f70-4ddb-ad73-83c3b22ef0e2
+:DRILL_LAST_INTERVAL: 7.6174
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 8
+:DRILL_FAILURE_COUNT: 4
+:DRILL_AVERAGE_QUALITY: 2.583
+:DRILL_EASE: 2.257
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:01>
+:END:
+ido create subdirectory
+*** [M-s]                                                             :drill:
+SCHEDULED: <2014-04-01 Tue>
+:PROPERTIES:
+:ID:       eb798918-4dd2-40e1-9d08-82ade145869d
+:DRILL_LAST_INTERVAL: 23.2268
+:DRILL_REPEATS_SINCE_FAIL: 5
+:DRILL_TOTAL_REPEATS: 6
+:DRILL_FAILURE_COUNT: 4
+:DRILL_AVERAGE_QUALITY: 3.083
+:DRILL_EASE: 2.496
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:34>
+:END:
+ido search recently used directories
+*** [M-n/p]                                                           :drill:
+SCHEDULED: <2014-03-14 Fri>
+:PROPERTIES:
+:ID:       db965c9e-feb0-4213-b631-7cfa0208cfdb
+:DRILL_LAST_INTERVAL: 23.0811
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 1
+:DRILL_AVERAGE_QUALITY: 3.75
+:DRILL_EASE: 2.929
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:36>
+:END:
+ido next/previous recently used directory
+*** [C-s]
+**** TODO implement this keybind, normally ctrl-space
+ido use current pattern and start a new one
+** info
+*** [[]]
+goto next-prev node regardless of structure
+*** [f]
+goto cross reference
+*** [x]
+Info-follow-nearest-node
+#+begin_src emacs-lisp
+(define-key Info-mode-map "x" 'Info-follow-nearest-node)
+#+end_src
+m, f, n, p or ^ command, depending on where you click.
+** auto-complete
+*** [S-return]                                                        :drill:
+SCHEDULED: <2014-03-11 Tue>
+:PROPERTIES:
+:ID:       b9e47939-8033-4adc-8bf4-734b25f4fc47
+:DRILL_LAST_INTERVAL: 2.0943
+:DRILL_REPEATS_SINCE_FAIL: 1
+:DRILL_TOTAL_REPEATS: 7
+:DRILL_FAILURE_COUNT: 3
+:DRILL_AVERAGE_QUALITY: 2.633
+:DRILL_EASE: 2.282
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:38>
+:END:
+ac-expand, then select next candidates
+*** [C-s]                                                             :drill:
+SCHEDULED: <2014-03-14 Fri>
+:PROPERTIES:
+:ID:       828416d4-7ce4-4817-aede-068b80f3041f
+:DRILL_LAST_INTERVAL: 23.0811
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 1
+:DRILL_AVERAGE_QUALITY: 3.75
+:DRILL_EASE: 2.929
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:38>
+:END:
+ac filter completions
+** agenda
+*** [t]                                                               :drill:
+SCHEDULED: <2014-03-22 Sat>
+:PROPERTIES:
+:ID:       173e9cec-e401-4f03-90cc-72cba462b2f2
+:DRILL_LAST_INTERVAL: 31.1381
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 3.75
+:DRILL_EASE: 2.929
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:50>
+:END:
+agenda cycle todo state
+** org
+*** [C-c / t]                                                         :drill:
+SCHEDULED: <2014-03-13 Thu>
+:PROPERTIES:
+:ID:       a5775c4f-c5d3-4024-a280-6628c5e7ab39
+:DRILL_LAST_INTERVAL: 10.7692
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 6
+:DRILL_FAILURE_COUNT: 1
+:DRILL_AVERAGE_QUALITY: 3.167
+:DRILL_EASE: 2.537
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
+:END:
+show todo items
+*** [S-<tab>]                                                         :drill:
+SCHEDULED: <2014-03-27 Thu>
+:PROPERTIES:
+:ID:       1c1a4061-5cff-4826-aec2-8f677aab33a9
+:DRILL_LAST_INTERVAL: 50.6823
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 3
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 5.0
+:DRILL_EASE: 5.815
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:44>
+:END:
+org-shifttab global visibility cycle / move table cell
+*** [C-cs]                                                            :drill:
+SCHEDULED: <2014-03-14 Fri>
+:PROPERTIES:
+:ID:       9ba74a38-655c-4f96-8443-b574ee25c544
+:DRILL_LAST_INTERVAL: 5.238
+:DRILL_REPEATS_SINCE_FAIL: 2
+:DRILL_TOTAL_REPEATS: 7
+:DRILL_FAILURE_COUNT: 2
+:DRILL_AVERAGE_QUALITY: 2.801
+:DRILL_EASE: 2.362
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:33>
+:END:
+schedule todo item
+*** [C-cx p]                                                          :drill:
+SCHEDULED: <2014-03-15 Sat>
+:PROPERTIES:
+:ID:       4b486f48-219d-4517-96c2-83ef839abda5
+:DRILL_LAST_INTERVAL: 24.4352
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 3.75
+:DRILL_EASE: 2.929
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:39>
+:END:
+org set property
+*** [C-c -]                                                           :drill:
+SCHEDULED: <2014-03-24 Mon>
+:PROPERTIES:
+:ID:       60e57e56-d815-4d9b-ba78-2a56164db209
+:DRILL_LAST_INTERVAL: 32.7466
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 4.0
+:DRILL_EASE: 3.204
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:52>
+:END:
+org insert horizontal line
+*** [C-cq]                                                            :drill:
+SCHEDULED: <2014-03-24 Mon>
+:PROPERTIES:
+:ID:       6987ba15-fbc0-459b-bc27-cf9016baebc3
+:DRILL_LAST_INTERVAL: 32.7466
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 4.0
+:DRILL_EASE: 3.204
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:50>
+:END:
+    org tag
+** calc
+i'd like to drill these sometime when I have space in my head, or I
+plan to use calc.
+*** space
+[enter input to the stack, or duplicate top stack item]
+*** C-M-i
+[cycle 3 elements on stack]
+*** tab
+[cycle 2 elements on stack]
+*** n
+[negate]
+*** _
+[begin negative number]
+*** /
+[reciprocal]
+*** x
+[calc named command]
+*** M-delete
+[delete 2nd from top of stack]
+*** C-u [-]0-9
+[0=whole stack, 1-9=that many, -1-9=that element]
+*** delete
+[remove from the top of the stack]
+*** '
+[algebraic mode. infix expressions are calculated when input to the stack]
+*** m a
+[auto algebraic mode]
+*** $,$$,$$$
+[top x of stack reference]
+*** s s/t/r/u
+[store to variable: store, top, retrieve, unstore. the quick variables 0-9 don't need s prefix]
+*** U/D
+[undo/redo]
+*** t p/n/]/y
+[trail prev/next/end/yankh]
+*** `
+[calc edit mode, to edit the top of stack]
+
+** single/special keys
+:PROPERTIES:
+:ID:       beginning-of-keybind-table-data
+:END:
+*** [tab key]
+:PROPERTIES:
+:CUSTOM_ID: 6c10a716-1d8e-4ce4-8e26-64468f19c17a
+:END:
+isearch
+#+begin_src emacs-lisp
+(define-key isearch-mode-map (kbd "<tab>") 'isearch-query-replace)
+#+end_src
+*** tab
+    :PROPERTIES:
+    :ID:       d93321a4-6732-421f-9c03-0073c4cbfdcb
+    :CUSTOM_ID: 51ece189-1840-41a1-8ca0-19f9a0481895
+    :END:
+isearch-forward
+#+begin_src emacs-lisp
+;; explained in http://stackoverflow.com/questions/7411920/how-to-bind-search-and-search-repeat-to-c-f-in-emacs
+(global-set-key (kbd search-key) 'isearch-forward)
+(define-key isearch-mode-map "\t" nil)
+(define-key isearch-mode-map (kbd search-key) 'isearch-repeat-forward)
+;; get rid of the standard completion binding, always use auto-complete
+;; this didn't work very well
+;;(global-set-key (kbd "TAB") 'auto-complete)
+(define-key global-map [remap completion-at-point] 'auto-complete)
+
+#+end_src
+
+*** end
+    :PROPERTIES:
+    :ID:       7e71b6fe-dcef-4f91-87d9-d996ddf7db5d
+    :CUSTOM_ID: 00d589b7-2b8e-494c-b761-3afefebe6ec6
+    :END:
+    move-end-of-line
+#+begin_src emacs-lisp
+;; taken from emacs wiki, along with home function
+;; http://www.emacswiki.org/emacs/BackToIndentationOrBeginning
+(defun point-in-comment ()
+  "Determine if the point is inside a comment"
+  (interactive)
+  (let ((syn (syntax-ppss)))
+    (and (nth 8 syn)
+         (not (nth 3 syn)))))
+(defun end-of-code-or-line (arg)
+  "Move to end of line, or before start of comments depending on situation.
+ Toggle back and forth positions if we are already at one.
+ Comments are recognized in any mode that sets syntax-ppss
+ properly."
+  (interactive "P")
+  (when (catch 'bol
+          (let ((start (point))
+                (bol (save-excursion
+                       (beginning-of-line)
+                       (point)))
+                (eol (progn (move-end-of-line arg) (point))))
+            (while (point-in-comment)
+              (backward-char)
+              (when (= (point) bol)
+                (throw 'bol t)))
+            (throw 'bol (and (not (= eol start)) (>= start (point))))))
+    (move-end-of-line arg)))
+
+(global-set-key (kbd "<end>") 'end-of-code-or-line)(add-hook 'org-mode-hook (lambda () (define-key org-mode-map (kbd "<end>") 'org-end-of-line)))
+#+end_src
+
+*** home
+    :PROPERTIES:
+    :ID:       f52de4a4-212c-4133-9038-2b652c739ad2
+    :CUSTOM_ID: 7800e455-c3f6-4a8f-8907-b2292449ab67
+    :END:
+back-to-indentation
+#+begin_src emacs-lisp
+  (defun back-to-indentation-or-beginning ()
+    (interactive)
+    (if (= (point) (progn (back-to-indentation) (point)))
+        (if (derived-mode-p 'org-mode)
+            (org-beginning-of-line)
+          (beginning-of-line))))
+    (global-set-key (kbd "<home>") 'back-to-indentation-or-beginning)
+
+#+end_src
+
+*** [s-tab]
+:PROPERTIES:
+:CUSTOM_ID: 3072901e-5cf3-4d6e-9ac8-3ef64a5f6ad2
+:END:
+indent-buffer
+    [
+#+begin_src emacs-lisp
+(global-set-key (kbd "<S-iso-lefttab>") 'indent-buffer)
+#+end_src
+    ]
+*** [s-delete]
+:PROPERTIES:
+:CUSTOM_ID: e53728b6-054d-4443-a03e-6cf02d13724d
+:END:
+send-shell
+#+begin_src emacs-lisp
+
+(global-set-key (kbd "<S-delete>") 'send-shell)
+
+;; optional variables used by send-shell
+(setq shell-send-yank-key nil)
+
+(defun repeat-shell ()
+  (interactive)
+  "Repeat the last command in shell-mode, displaying the window if needed."
+  (let ((shell-buffer (get-buffer "*shell*")))
+    (if shell-buffer
+        (buffer-window-show shell-buffer)
+      (let ((original-buffer (current-buffer)))
+        (funcall 'shell)
+        (setq shell-buffer (current-buffer))
+        (switch-to-buffer original-buffer)))
+    (with-current-buffer shell-buffer
+      (goto-char (point-max))
+      (call-interactively 'comint-previous-input)
+      ;; the t flag makes the buffer advance
+      (comint-send-input nil t))))
+
+(setq compilation-filenames '("Makefile" "makefile"))
+
+(defun get-nearest-compilation-file ()
+  "Search for the compilation file traversing up the directory tree."
+  (interactive)
+  (let ((dir default-directory)
+       (parent-dir (file-name-directory (directory-file-name default-directory)))
+       (nearest-compilation-file 'nil))
+    (while (and (not (string= dir parent-dir))
+               (not nearest-compilation-file))
+      (dolist (filename compilation-filenames)
+       (setq file-path (concat dir filename))
+       (when (file-readable-p file-path)
+         (setq nearest-compilation-file file-path)))
+      (setq dir parent-dir
+           parent-dir (file-name-directory (directory-file-name parent-dir))))
+    nearest-compilation-file))
+(defun run ()
+  (interactive)
+  "call run-fun if it is set, else run make if there is a makefile,
+else save and repeat last shell command.
+run-fun is meant to store file local variables, which show how to
+do the main thing we want on this file, generally compile and
+run.
+
+example of setting it in a file:
+;; Local Variables:
+;; run-fun: merge-test
+;; End: "
+  (basic-save-buffer)
+  (if (and (boundp 'run-fun) run-fun)
+      (funcall run-fun)
+    (let ((makefile (get-nearest-compilation-file)))
+      (if (and makefile (stringp mode-name) (string= mode-name "C/l"))
+          (compile (format
+                    "make -f %s" (get-nearest-compilation-file)))
+        (repeat-shell)))))
+
+
+(defun send-shell ()
+  (interactive)
+  (send-shell-buffer "*shell*" 'shell (kbd "C-v")))
+
+(defun send-python ()
+  (interactive)
+  (send-shell-buffer "*Python*" 'py-shell (kbd "C-v")))
+
+
+(defun send-shell-buffer (buffer-name &optional init shell-send-yank-key)
+  "Send current line or region to shell-mode buffer.
+When in shell-mode, copy the current line to the
+most recently visited visible window.
+
+SHELL-SEND-YANK-KEY: key to use instead
+of yank to paste into recent window. This allows compatibility with
+modes like org-mode which have their own yank function."
+  (if (string= (buffer-name) buffer-name)
+;; this section is copied out of comint-send-input
+      (progn
+        (let ((proc (get-buffer-process (current-buffer))))
+          (if (not proc) (user-error "Current buffer has no process")
+            (widen)
+
+            (let* ((pmark (process-mark proc))
+                   (intxt (if (>= (point) (marker-position pmark))
+                              (progn (if comint-eol-on-send (end-of-line))
+                                     (buffer-substring pmark (point)))
+                            (let ((copy (funcall comint-get-old-input)))
+                              (goto-char pmark)
+                              (insert copy)
+                              copy))))
+
+              (if (= (length intxt) 0)
+                  (kill-new (comint-previous-matching-input-string "." 1))
+                (kill-new intxt)))))
+        (kill-append "\n" nil)
+        (select-window (previous-window nil nil 'visible))
+        (if (and (boundp 'shell-send-yank-key) shell-send-yank-key)
+            (call-interactively (global-key-binding shell-send-yank-key))
+          (yank))
+        (select-window (next-window nil nil 'visible)))
+    (let (start end)
+      (if mark-active
+          (setq start (mark)
+                end (point))
+        (setq start (save-excursion (beginning-of-line) (point))
+              end (save-excursion (end-of-line) (point)))
+        (let (line-move-visual)
+          (call-interactively 'next-line)))
+      (send-comint-input buffer-name start end init))))
+
+;; supporting functions
+
+
+(defun send-comint-input (buffer-name start end &optional init)
+  "Input the region to BUFFER-NAME, assuming it is a comint-derived buffer.
+                             Show BUFFER-NAME if it is not show.
+                             Call INIT if BUFFER-NAME does not exist."
+  (let ((input (filter-buffer-substring start end))
+        (buffer (get-buffer buffer-name)))
+    (unless buffer
+      (message "nobuffer")
+      ;; save-excursion etc. don't work for (shell), so I do this instead
+      (if init (let ((original-buffer (current-buffer)))
+                 (funcall init (and (boundp 'send-shell-buffer-name) send-shell-buffer-name))
+                 (switch-to-buffer original-buffer)
+                 (setq buffer (get-buffer buffer-name)))
+        (error "No existing buffer found and no init function argument. ")))
+    (buffer-window-show buffer)
+    (with-current-buffer buffer
+      (let ((proc (get-buffer-process buffer)))
+        (goto-char (process-mark proc))
+        (insert input)
+        (comint-send-input nil t)))))
+
+(defun buffer-window-show (&optional buffer action)
+  "Like temp-buffer-window-show, but removed stuff
+        relevant to it being temp or help."
+  (let (window frame)
+    (with-current-buffer buffer
+      (when (let ((window-combination-limit
+                   ;; When `window-combination-limit' equals
+                   ;; `temp-buffer' or `temp-buffer-resize' and
+                   ;; `temp-buffer-resize-mode' is enabled in this
+                   ;; buffer bind it to t so resizing steals space
+                   ;; preferably from the window that was split.
+                   (if (or (eq window-combination-limit 'temp-buffer)
+                           (and (eq window-combination-limit
+                                    'temp-buffer-resize)
+                                temp-buffer-resize-mode))
+                       t
+                     window-combination-limit)))
+              ;; debug
+              ;;(message "window-combination-limit")
+              ;;(print window-combination-limit)
+              (setq window (display-buffer buffer action)))
+        (setq frame (window-frame window))
+        (unless (eq frame (selected-frame))
+          (raise-frame frame))
+        (setq minibuffer-scroll-window window)
+        (set-window-hscroll window 0)
+        ;; Return the window.
+        window))))
+
+
+;; when poping help, etc, allow reusing a window in a different frame if it is visible
+;; figured this out after spending quite a while reading doc string for display-buffer
+;; which is the main function which uses this.
+;; it will use other vars or its arg to override this,
+;; but those things are often nil.
+;; aha moments in reading it: ACTION = (FUNCTION-or-FUNCTIONLIST ALIST)
+;; FRAME adds an association to ACTION's alist, but it's not used if ACTION arg is nil.
+(setq display-buffer-fallback-action `(,(car display-buffer-fallback-action) . '(reusable-frames . visible)))
+;; stop splitting windows verticallly when I open a buffer or shell
+(setq split-height-threshold nil)
+#+end_src
+
+*** s-left arrow
+:PROPERTIES:
+:CUSTOM_ID: d8c473ac-5507-4a6b-9e5a-46558c17b09f
+:END:
+shell
+#+begin_src emacs-lisp
+(global-set-key (kbd shell-key) 'shell-wrap)
+#+end_src
+*** s-right arrow
+:PROPERTIES:
+:CUSTOM_ID: 2365f5a7-b89a-4a97-b272-ac8ae9c2cc66
+:END:
+previous-buffer
+#+begin_src emacs-lisp
+(global-set-key (kbd "<S-kp-divide>") 'previous-buffer)
+#+end_src
+*** esc
+:PROPERTIES:
+:CUSTOM_ID: 60a56803-f38d-4d0a-8ed5-1c94ba97b6f6
+:END:
+*** return
+:PROPERTIES:
+:CUSTOM_ID: fab6adea-ed20-45ab-a0a3-776c68d5c3a5
+:END:
+new line
+
+#+begin_src emacs-lisp
+;; todo, this doesn't set the keybind for the help minibuffer
+(when (boundp 'icomplete-minibuffer-map)
+  (define-key icomplete-minibuffer-map (kbd "<return>")
+    'minibuffer-force-complete-and-exit))
+
+(add-hook 'ido-setup-hook
+          (lambda()
+            (define-key ido-completion-map (kbd "<return>") 'ido-exit-minibuffer)))
+(define-key minibuffer-local-completion-map (kbd "<return>") 'exit-minibuffer)
+
+
+(define-key isearch-mode-map (kbd "<return>") 'isearch-exit)
+(define-key isearch-mode-map "\r" nil)
+
+
+(global-set-key (kbd "<return>") 'indent-new-comment-line)
+(define-key ac-completing-map (kbd "<return>") nil)
+(define-key ac-completing-map "\r" nil)
+(define-key minibuffer-local-map "\r" nil)
+(define-key minibuffer-local-map (kbd "<return>") 'exit-minibuffer)
+(define-key icomplete-minibuffer-map (kbd "C-j") 'exit-minibuffer)
+(define-key minibuffer-local-map (kbd "C-j") 'exit-minibuffer)
+(define-key minibuffer-local-must-match-map (kbd "C-j") 'exit-minibuffer)
+(define-key minibuffer-local-must-match-map "\r" nil)
+(define-key minibuffer-local-must-match-map (kbd "<return>")
+  'minibuffer-complete-and-exit)
+
+(add-hook 'Man-mode-hook
+          (lambda ()
+            (define-key Man-mode-map "\r" nil)
+            (define-key Man-mode-map "x" 'man-follow)))
+
+(add-hook 'comint-mode-hook
+          (lambda ()
+            (define-key comint-mode-map "\r" nil)
+            (define-key comint-mode-map (kbd "<return>") 'comint-send-input)))
+
+(add-hook 'org-mode-hook
+          (lambda ()
+            (define-key org-mode-map "\r" nil)
+            (define-key org-mode-map (kbd "<return>") 'org-return-indent)))
+
+(add-hook 'comint-mode-hook
+          (lambda ()
+            (define-key comint-mode-map "\C-m" nil)
+            (define-key comint-mode-map "\C-d" nil)))
+;; use space instead of enter in calc mode,
+;; cuz it is not easy to rebind enter in calc mode
+#+end_src
+
+*** [s-return]                                                        :drill:
+SCHEDULED: <2014-03-10 Mon>
+    :PROPERTIES:
+    auto-correct-prev-word
+    :ID:       db46193b-f202-4927-bc76-2ad74d9f0ed7
+    :CUSTOM_ID: 819cfb55-3a2f-4f20-8591-f819d1a6869a
+    :DRILL_LAST_INTERVAL: 7.9493
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 7
+    :DRILL_FAILURE_COUNT: 4
+    :DRILL_AVERAGE_QUALITY: 2.696
+    :DRILL_EASE: 2.312
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:05>
+    :END:
+auto-correct-prev-word
+    [
+    #+begin_src emacs-lisp
+    (global-set-key (kbd "<S-return>") 'flyspell-auto-correct-previous-word)
+#+end_src
+]
+
+*** down arrow
+    :PROPERTIES:
+    :CUSTOM_ID: 7a868484-9c63-4a73-abda-7751cb2c02be
+    :END:
+mark
+#+begin_src emacs-lisp
+  (global-set-key (kbd "<kp-enter>") 'set-mark-command)
+#+end_src
+*** s-down arrow
+:PROPERTIES:
+:CUSTOM_ID: 097b97e0-8ad8-40f7-8388-c4ace1706b38
+:END:
+extended command
+#+begin_src emacs-lisp
+  (global-set-key (kbd "<S-kp-enter>") 'smex)
+#+end_src
+*** s-up arrow
+
+** mouse
+*** [mouse-2 mode line]                                               :drill:
+SCHEDULED: <2014-03-17 Mon>
+    :PROPERTIES:
+    :ID:       d79167ad-9782-40b3-8e40-55aaa8428dec
+    :CUSTOM_ID: 69aaa631-6fb5-4beb-b2d8-c0f3d92c0a98
+    :DRILL_LAST_INTERVAL: 15.2345
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 7
+    :DRILL_FAILURE_COUNT: 2
+    :DRILL_AVERAGE_QUALITY: 2.893
+    :DRILL_EASE: 2.405
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:06>
+    :END:
+    mouse-delete-other-windows
+*** C-mouse-2 mode line
+:PROPERTIES:
+:CUSTOM_ID: 501479ab-e1e2-497e-bd86-071f8afa3378
+:END:
+    mouse-split-window-horizontally
+*** M-mouse-2 mode line
+:PROPERTIES:
+:CUSTOM_ID: 8de14d73-499e-406a-b5c4-e295e53d3f4c
+:END:
+*** S-mouse-2 mode line
+:PROPERTIES:
+:CUSTOM_ID: f389cdbb-186a-4cad-af45-b3c75a508275
+:END:
+*** C-M-mouse-2 mode line
+:PROPERTIES:
+:CUSTOM_ID: cb2be69c-f86c-4120-b7f2-1c09b7bcd816
+:END:
+*** C-S-mouse2 mode line
+:PROPERTIES:
+:CUSTOM_ID: 7b4eced3-ce5e-49ce-8bfe-8823e8f5f93e
+:END:
+*** [mouse-3 mode line]                                               :drill:
+SCHEDULED: <2014-03-19 Wed>
+    :PROPERTIES:
+    :ID:       324e43e7-d468-4edc-b892-c1e249ff49fa
+    :CUSTOM_ID: 917a1844-8c38-4f31-8616-50fc81334f2c
+    :DRILL_LAST_INTERVAL: 27.607
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 3.5
+    :DRILL_EASE: 2.73
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:50>
+    :END:
+    mouse-delete-window
+*** C-mouse-3 mode line
+:PROPERTIES:
+:CUSTOM_ID: b36a218f-6a92-4594-940b-13ffdf79cc9c
+:END:
+*** M-mouse-3 mode line
+:PROPERTIES:
+:CUSTOM_ID: 11c48311-05a4-440e-b742-ec397f22f479
+:END:
+*** S-mouse-3 mode line
+:PROPERTIES:
+:CUSTOM_ID: 03768943-d8cd-4dcb-bc48-393e9a6bb31f
+:END:
+*** C-M-mouse-3 mode line
+:PROPERTIES:
+:CUSTOM_ID: ab213201-bab7-4d30-8f61-fee80e7f2c6f
+:END:
+*** C-S-mouse-3 mode line
+:PROPERTIES:
+:CUSTOM_ID: 0bcac7a3-2943-49b7-b281-d834d374caf9
+:END:
+*** mouse-1
+:PROPERTIES:
+:CUSTOM_ID: 4e60e2e4-8c2f-4450-8060-2d793ede530c
+:END:
+    set cursor/mark
+*** [C-mouse-1]                                                       :drill:
+SCHEDULED: <2014-03-15 Sat>
+:PROPERTIES:
+:CUSTOM_ID: b661f84f-57df-4095-9dc1-d1a876a53ee5
+:ID:       6b82708e-d5de-48cc-8abd-225186eb8729
+:DRILL_LAST_INTERVAL: 24.4352
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 3.75
+:DRILL_EASE: 2.929
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 18:03>
+:END:
+buffer list context menu
+*** M-mouse-1
+:PROPERTIES:
+:CUSTOM_ID: c71c8a71-7027-44f3-be19-1d3c18ff5129
+:END:
+*** S-mouse-1
+:PROPERTIES:
+:CUSTOM_ID: 84507cd6-8a75-4754-bf9e-5a30f57fa4ac
+:END:
+*** C-M-mouse-1
+:PROPERTIES:
+:CUSTOM_ID: 95eea58e-82b0-48a3-a7c8-0d17c50b7c2e
+:END:
+*** C-S-mouse-1
+:PROPERTIES:
+:CUSTOM_ID: 2d450c06-d9aa-4751-a926-0922c0c3a402
+:END:
+*** mouse-2
+:PROPERTIES:
+:CUSTOM_ID: 086b0b50-054f-462d-92fa-b27852f887b0
+:END:
+    paste
+*** C-mouse-2
+:PROPERTIES:
+:CUSTOM_ID: 48b8de22-6638-44da-986f-16e0e69312dd
+:END:
+*** M-mouse-2
+:PROPERTIES:
+:CUSTOM_ID: fb315a27-6351-4ce2-9692-589608793c43
+:END:
+*** S-mouse-2
+:PROPERTIES:
+:CUSTOM_ID: 7cc73036-844b-44d3-afe1-1e76ee626b53
+:END:
+*** C-M-mouse-2
+:PROPERTIES:
+:CUSTOM_ID: 85f35287-5130-47ab-832d-af78dc2a3e70
+:END:
+*** C-S-mouse-2
+:PROPERTIES:
+:CUSTOM_ID: a27ad43f-3be2-4155-9a9f-c144170372ce
+:END:
+*** mouse-3
+:PROPERTIES:
+:CUSTOM_ID: 0481632e-9c50-4328-9365-c4b5bf967b66
+:END:
+set-mark
+#+begin_src emacs-lisp
+  (define-key global-map [down-mouse-3] 'mouse3-func)
+  (global-set-key [mouse-3]       'mouse3-set-mark)
+  (global-set-key [drag-mouse-3]  'mouse3-set-mark)
+#+end_src
+*** [C-mouse-3]                                                       :drill:
+SCHEDULED: <2014-03-13 Thu>
+    :PROPERTIES:
+    :ID:       b075e62c-55c6-46f5-a23a-4c4c5b9f267e
+    :CUSTOM_ID: 9623c78f-7705-4cbe-a990-c24eb1067377
+    :DRILL_LAST_INTERVAL: 22.1939
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 3.5
+    :DRILL_EASE: 2.73
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:38>
+    :END:
+    global menu
+*** M-mouse-3
+:PROPERTIES:
+:CUSTOM_ID: fb6f4840-7e44-4c94-b913-f2014fda3325
+:END:
+*** S-mouse-3
+:PROPERTIES:
+:CUSTOM_ID: a6d91332-c731-474c-9959-ddd03e8b2786
+:END:
+*** C-M-mouse-3
+:PROPERTIES:
+:CUSTOM_ID: 6b4d0e4d-1a2c-4e42-a925-e39548c4e264
+:END:
+*** C-S-mouse-3
+:PROPERTIES:
+:CUSTOM_ID: a983a7c5-c17e-4e08-b3e2-a45a44d7a2b6
+:END:
+*** [mouse-9]
+:PROPERTIES:
+:CUSTOM_ID: efaec161-b279-4129-86fd-b410430926e4
+:END:
+move-mouse-to-point
+[
+#+begin_src emacs-lisp
+  (global-set-key (kbd "<mouse-6>") 'move-mouse-to-point)
+#+end_src
+]
+*** C-mouse-9
+:PROPERTIES:
+:CUSTOM_ID: e055ae8a-cc94-4e0f-9e98-9cb62453b8d6
+:END:
+*** M-mouse-9
+:PROPERTIES:
+:CUSTOM_ID: 7d1c03a9-b153-47dc-a037-7ee333ca8da9
+:END:
+*** S-mouse-9
+:PROPERTIES:
+:CUSTOM_ID: 8f688d00-8cdb-4163-818c-a0cfba3b1c0a
+:END:
+*** C-M-mouse-9
+:PROPERTIES:
+:CUSTOM_ID: 90ce7df8-2346-4203-8ced-5da51c7c1bfc
+:END:
+*** C-S-mouse-9
+:PROPERTIES:
+:CUSTOM_ID: 0afdad0a-f9c4-4bfa-baa8-cc20d6cab628
+:END:
+*** mouse-8
+:PROPERTIES:
+:CUSTOM_ID: ea9d2415-0fd7-4f83-9867-a7a81899e74b
+:END:
+*** C-mouse-8
+:PROPERTIES:
+:CUSTOM_ID: dc2428d2-412c-4811-8327-3bb70bfa0e76
+:END:
+*** M-mouse-8
+:PROPERTIES:
+:CUSTOM_ID: 530ed41d-6ed6-4bcd-9df7-58ddbfe8b44a
+:END:
+*** S-mouse-8
+:PROPERTIES:
+:CUSTOM_ID: c7d388c3-f4a6-4489-b23a-20ebb7515430
+:END:
+*** C-M-mouse-8
+:PROPERTIES:
+:CUSTOM_ID: fc6ac9e8-fd9a-4270-9cd8-26713d6bc40f
+:END:
+*** C-S-mouse-8
+:PROPERTIES:
+:CUSTOM_ID: 401503ad-3750-4002-a28e-1f1345412bc6
+:END:
+*** 1/kp-end
+:PROPERTIES:
+:CUSTOM_ID: c306a3ef-4b81-4d54-a914-99f312d8f92f
+:END:
+*** C-1/kp-end
+:PROPERTIES:
+:CUSTOM_ID: 11059916-0a48-4f08-b85a-9b82243e4145
+:END:
+*** M-1/kp-end
+:PROPERTIES:
+:CUSTOM_ID: fddd8716-5b16-484e-9d70-358fea201d99
+:END:
+*** S-1/kp-end
+:PROPERTIES:
+:CUSTOM_ID: c6a7978b-a5cf-4ae7-b1d2-57ea72adb487
+:END:
+*** C-M-1/kp-end
+:PROPERTIES:
+:CUSTOM_ID: 376b8b84-ae1b-4bff-b1c8-263049186637
+:END:
+*** C-S-1/kp-end
+:PROPERTIES:
+:CUSTOM_ID: 4e8081cb-5692-4d2e-8657-c6c7931046fd
+:END:
+*** 2/kp-down
+:PROPERTIES:
+:CUSTOM_ID: a1108fd9-0df0-43ac-9dbb-0402d24f5b57
+:END:
+*** C-2/kp-down
+:PROPERTIES:
+:CUSTOM_ID: e9fe4916-14f5-4dc6-8dba-ed982b7172a1
+:END:
+*** M-2/kp-down
+:PROPERTIES:
+:CUSTOM_ID: 50db5a06-452e-491f-875b-3de936a4d04a
+:END:
+#+begin_src emacs-lisp
+;; for when we have a standard keyboard which is not remapped
+(global-set-key (kbd "M-2") 'smex)
+
+#+end_src
+
+*** S-2/kp-down
+:PROPERTIES:
+:CUSTOM_ID: c3ad691b-0082-46f3-8588-ef2223eab643
+:END:
+*** C-M-2/kp-down
+:PROPERTIES:
+:CUSTOM_ID: 90963055-086b-4d96-8131-d890ff3cb597
+:END:
+*** C-S-2/kp-down
+:PROPERTIES:
+:CUSTOM_ID: 4d13741e-2207-4d2c-a719-e818bb9f3419
+:END:
+*** 3/kp-next
+:PROPERTIES:
+:CUSTOM_ID: b441f9e2-d035-4907-b947-0f3b4d6d062d
+:END:
+*** C-3/kp-next
+:PROPERTIES:
+:CUSTOM_ID: 3ea6ff26-4db4-46c8-b681-e08acd9b6a06
+:END:
+*** M-3/kp-next
+:PROPERTIES:
+:CUSTOM_ID: a376d2fb-999d-48fd-8c9e-36b7661c5ba7
+:END:
+*** S-3/kp-next
+:PROPERTIES:
+:CUSTOM_ID: 50b8356c-7ba5-4e89-b4d6-618f6c571678
+:END:
+*** C-M-3/kp-next
+:PROPERTIES:
+:CUSTOM_ID: cd997379-f611-4d06-91c7-ed6cabb618ee
+:END:
+*** C-S-3/kp-next
+:PROPERTIES:
+:CUSTOM_ID: 1c8941c9-3025-4dff-bcf3-09d8de44f44f
+:END:
+*** 4/kp-left
+    :PROPERTIES:
+    :ID:       bef4fed5-5338-4c66-a759-13dc20ab9bfb
+    :CUSTOM_ID: c44d0f65-9502-4cc6-9642-96d907f6b093
+    :END:
+    indent-region
+#+begin_src emacs-lisp
+  (global-set-key (kbd "<kp-left>") 'indent-region)
+#+end_src
+*** C-4/kp-left
+:PROPERTIES:
+:CUSTOM_ID: dd0cd32a-1d62-4b19-9d4f-ee242fb7c7b9
+:END:
+*** M-4/kp-left
+:PROPERTIES:
+:CUSTOM_ID: 4f7c3799-28a7-4fc2-85fc-16d768d2047c
+:END:
+*** S-4/kp-left
+:PROPERTIES:
+:CUSTOM_ID: f84a7347-f88a-4888-bf5d-e15b98b5c3a2
+:END:
+*** C-M-4/kp-left
+:PROPERTIES:
+:CUSTOM_ID: 74a1afca-bd24-469b-93e9-7a9681a9e467
+:END:
+*** C-S-4/kp-left
+:PROPERTIES:
+:CUSTOM_ID: 6c822a4a-0e64-430b-8d21-46b387911f2f
+:END:
+*** 5/kp-begin
+    :PROPERTIES:
+    :ID:       0e93f6a0-3d6f-45b1-b14e-10abbdfa3ee4
+    :CUSTOM_ID: 2458c6bc-7113-4d4b-bbdf-206e1cb842a7
+    :END:
+    mark-defun
+#+begin_src emacs-lisp
+  (global-set-key (kbd "<kp-begin>") 'mark-defun)
+#+end_src
+*** C-5/kp-begin
+:PROPERTIES:
+:CUSTOM_ID: 39588066-77b8-4863-be0d-0f1fad8f0e2a
+:END:
+*** M-5/kp-begin
+:PROPERTIES:
+:CUSTOM_ID: b3542b42-9d71-4a3f-92b1-f79f275bcf52
+:END:
+*** S-5/kp-begin
+:PROPERTIES:
+:CUSTOM_ID: 66aed3e7-d7bb-4393-a95b-b90b3a410684
+:END:
+*** C-M-5/kp-begin
+:PROPERTIES:
+:CUSTOM_ID: 1060d464-eed3-4a17-a5c4-d8e8941f6925
+:END:
+*** C-S-5/kp-begin
+:PROPERTIES:
+:CUSTOM_ID: efd7867a-a87f-43ef-a849-0e4029431d7f
+:END:
+*** 6/kp-right
+    :PROPERTIES:
+    :ID:       d156225a-b48e-45e2-80a7-ea1a7dbbc794
+    :CUSTOM_ID: 3b79bc58-6067-43bd-9471-9d592744a25a
+    :END:
+    ibuffer
+#+begin_src emacs-lisp
+  (global-set-key (kbd "<kp-right>") 'ibuffer)
+#+end_src
+*** C-6/kp-right
+:PROPERTIES:
+:CUSTOM_ID: 5592b3d3-7ade-4486-ac94-aed0aa3d78f5
+:END:
+*** M-6/kp-right
+:PROPERTIES:
+:CUSTOM_ID: c76bedd9-90a7-41fe-9327-607f88f60a3a
+:END:
+*** S-6/kp-right
+:PROPERTIES:
+:CUSTOM_ID: 8bbda9a2-7909-44fb-af24-a86dbbd5d16f
+:END:
+*** C-M-6/kp-right
+:PROPERTIES:
+:CUSTOM_ID: 7c5838f6-5cc9-4bbc-bd07-403cc009cf35
+:END:
+*** C-S-6/kp-right
+:PROPERTIES:
+:CUSTOM_ID: c6f2edc9-ffd3-400f-8014-bb92ea6e520b
+:END:
+*** 7/kp-home
+:PROPERTIES:
+:CUSTOM_ID: c98ba390-f2e3-4c14-8d41-142b54e76d77
+:END:
+*** C-7/kp-home
+:PROPERTIES:
+:CUSTOM_ID: 5597d00f-4a89-4af2-aac1-98808763744c
+:END:
+*** M-7/kp-home
+:PROPERTIES:
+:CUSTOM_ID: 5cbafd0e-0c8f-4e14-a24e-f847c341e5c1
+:END:
+*** S-7/kp-home
+:PROPERTIES:
+:CUSTOM_ID: 92f7d836-ae32-4bba-9120-72e747feb832
+:END:
+*** C-M-7/kp-home
+:PROPERTIES:
+:CUSTOM_ID: 30170d01-412e-4098-b27e-ed9294d8cf92
+:END:
+*** C-S-7/kp-home
+:PROPERTIES:
+:CUSTOM_ID: 81300d39-e60e-4b09-865e-584153f3b827
+:END:
+*** 8/kp-up
+:PROPERTIES:
+:CUSTOM_ID: 0591db2b-6c5c-4438-9451-dcd686170c9d
+:END:
+*** C-8/kp-up
+:PROPERTIES:
+:CUSTOM_ID: 028ad953-1641-4f0c-83c2-72787310e447
+:END:
+*** M-8/kp-up
+:PROPERTIES:
+:CUSTOM_ID: 7c55f717-1093-48a7-b764-8f788540a4d7
+:END:
+*** S-8/kp-up
+:PROPERTIES:
+:CUSTOM_ID: f477fa15-3f04-48f6-a66a-4ba6eb0475f1
+:END:
+*** C-M-8/kp-up
+:PROPERTIES:
+:CUSTOM_ID: f280c9ab-49a8-4399-987b-bfde07c339be
+:END:
+*** C-S-8/kp-up
+:PROPERTIES:
+:CUSTOM_ID: 68a316aa-a05d-4ab0-87e4-88e8f2613795
+:END:
+*** 9/kp-prior
+    :PROPERTIES:
+    :ID:       f3c60889-d948-4144-b5b0-04aeeec95309
+    :CUSTOM_ID: a3b51adb-4405-4d9f-9b88-a8faa479fbe7
+    :END:
+    delete-horizontal-space
+#+begin_src emacs-lisp
+  (global-set-key (kbd "<kp-prior>") 'delete-horizontal-space)
+#+end_src
+*** C-9/kp-prior
+:PROPERTIES:
+:CUSTOM_ID: 2683f49c-a465-42d0-b85b-6aa345ac2213
+:END:
+*** M-9/kp-prior
+:PROPERTIES:
+:CUSTOM_ID: 91b0ee09-9eba-4b60-b05f-720eaca53065
+:END:
+*** S-9/kp-prior
+:PROPERTIES:
+:CUSTOM_ID: b79e626c-4425-409f-92ce-b88335629c34
+:END:
+*** C-M-9/kp-prior
+:PROPERTIES:
+:CUSTOM_ID: 4838285f-905b-4e18-8605-ff24a20ce9e1
+:END:
+*** C-S-9/kp-prior
+:PROPERTIES:
+:CUSTOM_ID: 763edfac-da7d-4360-a383-6a7f42cc2e02
+:END:
+*** 10/kp-insert
+:PROPERTIES:
+:CUSTOM_ID: 57e1a794-26f8-4fb6-b753-ef1ad1ff0af9
+:END:
+*** C-10/kp-insert
+:PROPERTIES:
+:CUSTOM_ID: 32426751-f87b-4fd5-b435-914ac8f54e5f
+:END:
+*** M-10/kp-insert
+:PROPERTIES:
+:CUSTOM_ID: 1b83659c-61dc-425f-bead-fc2a0d198dde
+:END:
+*** S-10/kp-insert
+:PROPERTIES:
+:CUSTOM_ID: d2f07180-2d20-4633-9c79-78f4d992f7a6
+:END:
+*** C-M-10/kp-insert
+:PROPERTIES:
+:CUSTOM_ID: 1f6eabdc-703c-4a05-829c-553ccf7d082d
+:END:
+*** C-S-10/kp-insert
+:PROPERTIES:
+:CUSTOM_ID: bb361418-370f-4b15-b7e1-8e85c7a6f032
+:END:
+*** 11/kp-subtract
+:PROPERTIES:
+:CUSTOM_ID: 0f84dddc-a1d2-428d-8c17-cf9ddbd24784
+:END:
+*** C-11/kp-subtract
+:PROPERTIES:
+:CUSTOM_ID: 4c3309ee-eb67-43ff-bc4a-44574b1c5e0f
+:END:
+*** M-11/kp-subtract
+:PROPERTIES:
+:CUSTOM_ID: e95a2822-5f0d-4b32-a17f-15d4650e086f
+:END:
+*** S-11/kp-subtract
+:PROPERTIES:
+:CUSTOM_ID: 667a9853-38c6-4bb2-8c01-6a30075929b4
+:END:
+*** C-M-11/kp-subtract
+:PROPERTIES:
+:CUSTOM_ID: d5b17698-9bfe-4bd7-af26-b5dd51684e7d
+:END:
+*** C-S-11/kp-subtract
+:PROPERTIES:
+:CUSTOM_ID: cfde57be-a728-4955-8b96-9ae5aa1cce01
+:END:
+*** 12/kp-add
+:PROPERTIES:
+:CUSTOM_ID: 5e7a0116-a847-4fec-81ed-a0286bb08ac5
+:END:
+*** C-12/kp-add
+:PROPERTIES:
+:CUSTOM_ID: 41dcdb69-8436-495b-9e55-a0cd623ac5aa
+:END:
+*** M-12/kp-add
+:PROPERTIES:
+:CUSTOM_ID: ebda57a2-cab3-4fed-b3b0-014a7e60c96f
+:END:
+*** S-12/kp-add
+:PROPERTIES:
+:CUSTOM_ID: 7e4c6085-cfbe-4c05-9edb-2aec2325f7b9
+:END:
+*** C-M-12/kp-add
+:PROPERTIES:
+:CUSTOM_ID: 7904cafb-7371-4bc9-a661-262d78f8f9b8
+:END:
+*** C-S-12/kp-add
+    :PROPERTIES:
+    :CUSTOM_ID: dcf498f0-5bcf-4402-bce0-561c11effb38
+    :END:
+*** scroll
+:PROPERTIES:
+:CUSTOM_ID: 33433f0f-5b0e-46ba-8452-d2a51e54769b
+:END:
+    up/dn / scroll
+on standard mouse, this scrolls,
+because we have the accuracy to pick things up and
+down easier, and because it is familiar.
+*** [C-scroll]                                                        :drill:
+SCHEDULED: <2014-03-27 Thu>
+    :PROPERTIES:
+    cycle recent buffers
+    :ID:       678b14e8-e991-46da-84a0-50d142ecbbba
+    :CUSTOM_ID: 16506ba5-e8f2-4aec-bc1b-d2854d4e504c
+    :DRILL_LAST_INTERVAL: 50.6823
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 3
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 5.0
+    :DRILL_EASE: 5.815
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:36>
+    :END:
+cursor up/down fast
+    [
+#+begin_src emacs-lisp
+;; compiling warns that next-line should be called interactively,
+;; but we would have to do something dumb, like give it a
+;; vector of keys in order to supply the 8 argument
+(defun down-fast ()
+  (interactive)
+  (next-line 8))
+(defun up-fast ()
+  (interactive)
+  (next-line -8))
+
+(global-set-key (kbd "<C-up>") 'up-fast)
+(global-set-key (kbd "<C-down>") 'down-fast)
+
+(add-hook 'comint-mode-hook
+          (lambda ()
+            (define-key comint-mode-map (kbd "<C-mouse-4>") 'comint-previous-prompt)
+            (define-key comint-mode-map (kbd "<C-mouse-5>") 'comint-next-prompt)))
+#+end_src
+]
+
+*** [M-scroll]
+:PROPERTIES:
+:CUSTOM_ID: e1e2e253-450d-4620-af9e-78d378f49ad5
+:END:
+forward/back s-exp
+[
+#+begin_src emacs-lisp
+  (global-set-key (kbd "<M-mouse-4>") 'backward-sexp)
+  (global-set-key (kbd "<M-mouse-5>") 'forward-sexp)
+#+end_src
+]
+*** [S-scroll]                                                        :drill:
+SCHEDULED: <2014-03-22 Sat>
+    :PROPERTIES:
+    expand region
+    :ID:       c2da442e-b8c0-4b8a-899f-989af89bd857
+    :CUSTOM_ID: 74b2196a-345d-453a-b7be-1915360eb201
+    :DRILL_LAST_INTERVAL: 27.0855
+    :DRILL_REPEATS_SINCE_FAIL: 5
+    :DRILL_TOTAL_REPEATS: 5
+    :DRILL_FAILURE_COUNT: 2
+    :DRILL_AVERAGE_QUALITY: 3.4
+    :DRILL_EASE: 2.666
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-23 Sun 02:26>
+    :END:
+expand/contract region
+    [
+#+begin_src emacs-lisp
+(global-set-key (kbd "<S-mouse-13>") 'my-contract-region)
+(global-set-key (kbd "<S-mouse-14>") 'er/expand-region)
+(global-set-key (kbd "<S-mouse-4>") 'my-contract-region)
+(global-set-key (kbd "<S-mouse-5>") 'er/expand-region)
+(global-set-key (kbd "<S-up>") 'my-contract-region)
+(global-set-key (kbd "<S-down>") 'er/expand-region)
+
+(defun my-contract-region (arg)
+  (interactive "p")
+  (let ((current-prefix-arg '-))
+    (call-interactively 'er/expand-region)))
+#+end_src
+    ]
+*** [C-M-scroll]                                                      :drill:
+SCHEDULED: <2014-03-27 Thu>
+    :PROPERTIES:
+    scroll
+    :ID:       b94d89ed-5a06-4916-b5f5-e0bf1a552362
+    :CUSTOM_ID: bd2ca117-408c-49fc-a5ac-a938be21dfc0
+    :DRILL_LAST_INTERVAL: 50.6823
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 3
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 5.0
+    :DRILL_EASE: 5.815
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
+    :END:
+scroll
+    [
+background: I originally tried to make c-scroll be scroll
+, but this made
+for better compatibility with the standard mouse
+#+begin_src emacs-lisp
+  (global-set-key (kbd "<C-M-mouse-4>") 'mwheel-scroll)
+  (global-set-key (kbd "<C-M-mouse-5>") 'mwheel-scroll)
+; (require 'smooth-scroll)
+ ;   (smooth-scroll-mode nil)
+ ; (global-set-key (kbd "<C-M-mouse-4>") 'scroll-up-1)
+  ;(global-set-key (kbd "<C-M-mouse-5>") 'scroll-down-1)
+#+end_src
+]
+*** [C-S-scroll]                                                      :drill:
+SCHEDULED: <2014-03-18 Tue>
+    :PROPERTIES:
+    zoom
+    :ID:       368f60cb-91e5-4694-b342-e0049e5d3e2c
+    :CUSTOM_ID: a69254a4-cf2d-450f-b477-2694b44a7e0d
+    :DRILL_LAST_INTERVAL: 9.2113
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 7
+    :DRILL_FAILURE_COUNT: 3
+    :DRILL_AVERAGE_QUALITY: 2.943
+    :DRILL_EASE: 2.429
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:34>
+    :END:
+increase / decrease text size
+    [
+#+begin_src emacs-lisp
+(global-set-key (kbd "<C-S-mouse-4>") 'text-scale-increase)
+(global-set-key (kbd "<C-S-mouse-5>") 'text-scale-decrease)
+(global-set-key (kbd "<C-S-mouse-13>") 'text-scale-increase)
+(global-set-key (kbd "<C-S-mouse-14>") 'text-scale-decrease)
+(global-set-key (kbd "<C-S-down>") 'text-scale-increase)
+(global-set-key (kbd "<C-S-up>") 'text-scale-decrease)
+#+end_src
+]
+*** left-scroll
+:PROPERTIES:
+:CUSTOM_ID: d2d5c5c7-f0de-4e08-953b-d41d3e282ba7
+:END:
+left/right
+*** [C-left-scroll]                                                   :drill:
+SCHEDULED: <2014-03-27 Thu>
+    :PROPERTIES:
+    :CUSTOM_ID: 7bb95aa5-381e-454a-a6c6-aaeec728db08
+    :ID:       04bdffa0-52fe-4d90-a222-a6e41d75b13b
+    :DRILL_LAST_INTERVAL: 50.6823
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 3
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 5.0
+    :DRILL_EASE: 5.815
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:35>
+    :END:
+back / forward word
+#+begin_src emacs-lisp
+  (global-set-key (kbd "<C-left>") 'backward-symbol)
+  (global-set-key (kbd "<C-right>") 'forward-symbol)
+  #+end_src
+*** [M-left-scroll]                                                   :drill:
+    :PROPERTIES:
+    winner undo redo
+    :CUSTOM_ID: 49db3764-b154-4cfc-8d0d-f0e0451815e3
+    :ID:       97ef29fd-aea5-49ce-aff2-7a8c8d1b3d5d
+    :DRILL_LAST_INTERVAL: 0.0
+    :DRILL_REPEATS_SINCE_FAIL: 0
+    :DRILL_TOTAL_REPEATS: 9
+    :DRILL_FAILURE_COUNT: 10
+    :DRILL_AVERAGE_QUALITY: 2.518
+    :DRILL_EASE: 2.225
+    :DRILL_LAST_QUALITY: 2
+    :DRILL_LAST_REVIEWED: <2014-04-14 Mon 11:30>
+    :END:
+
+*** S-left-scroll
+:PROPERTIES:
+:CUSTOM_ID: ca5cdcd4-b3da-4d7b-86ab-4c7c0ac2caf7
+:END:
+---
+    unreachable
+*** C-M-left-scroll
+unreachable
+*** C-S-left-scroll
+:PROPERTIES:
+:CUSTOM_ID: 7b4f1f49-6d93-4210-a30c-8278d6e63655
+:ID:       b6ea3b66-d9a6-4a33-ae1c-0464d118f006
+:END:
+unreachable
+** left primary
+*** [C-2]                                                             :drill:
+SCHEDULED: <2014-04-04 Fri>
+    :PROPERTIES:
+    :ID:       845cf47f-22d5-4100-837d-fbc066e33c9c
+    :CUSTOM_ID: 4f29b011-3844-4a4a-b75d-cdf8f49e9adb
+    :DRILL_LAST_INTERVAL: 26.3927
+    :DRILL_REPEATS_SINCE_FAIL: 5
+    :DRILL_TOTAL_REPEATS: 6
+    :DRILL_FAILURE_COUNT: 2
+    :DRILL_AVERAGE_QUALITY: 3.25
+    :DRILL_EASE: 2.58
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
+    :END:
+narrow-to-defun/subtree
+[
+#+begin_src emacs-lisp
+(global-unset-key (kbd "C-2"))
+(defun copy-symbol (&optional arg)
+  "Copy symbol at point into kill-ring"
+  (interactive "P")
+  (kill-new (thing-at-point 'symbol)))
+
+(global-set-key (kbd "C-2") 'copy-symbol)
+
+(global-set-key (kbd "C-4") 'narrow-to-defun)
+(add-hook 'org-mode-hook
+          (lambda () (local-set-key (kbd "C-4") 'org-narrow-to-subtree)))
+#+end_src
+]
+*** M-2
+:PROPERTIES:
+:CUSTOM_ID: 53ecfda2-d9f6-4882-b7a2-9b3c859e3bcb
+:END:
+*** [C-M-2]
+:PROPERTIES:
+:CUSTOM_ID: 33c4996d-92bc-4df0-b005-11553677be13
+:END:
+---
+[
+#+begin_src emacs-lisp
+  (global-unset-key (kbd "C-M-2"))
+#+end_src
+]
+*** C-S-2
+:PROPERTIES:
+:CUSTOM_ID: 43af8e87-216d-47f7-9779-48ef66c7ca5f
+:END:
+*** [C-3]                                                             :drill:
+SCHEDULED: <2014-03-27 Thu>
+    :PROPERTIES:
+    :ID:       9495ba60-017a-49b0-b0b6-366c3334e909
+    :CUSTOM_ID: 7851a05e-7177-4a8f-af5a-3325a8f116fe
+    :DRILL_LAST_INTERVAL: 50.6823
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 3
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 5.0
+    :DRILL_EASE: 5.815
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:41>
+    :END:
+    dot-mode-execute
+    [
+#+begin_src emacs-lisp
+  (global-set-key (kbd "C-3") 'dot-mode-execute)
+ #+end_src
+    ]
+*** M-3
+:PROPERTIES:
+:CUSTOM_ID: ddceb843-06db-4078-914f-da225cac107e
+:END:
+*** [C-M-3]                                                           :drill:
+SCHEDULED: <2014-03-11 Tue>
+    :PROPERTIES:
+    :CUSTOM_ID: 9a00e17f-a1c9-48fc-b03b-c6a1a3cbda1c
+    :ID:       75be5945-8bc4-4041-a44f-de2d9af66f4f
+    :DRILL_LAST_INTERVAL: 19.6736
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 5
+    :DRILL_FAILURE_COUNT: 1
+    :DRILL_AVERAGE_QUALITY: 3.4
+    :DRILL_EASE: 2.666
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:48>
+    :END:
+    recenter-top-bottom
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-M-3") 'recenter-top-bottom)
+#+end_src
+    ]
+*** C-S-3
+:PROPERTIES:
+:CUSTOM_ID: 224cf9b0-2e12-4cc7-a7e1-746784c87777
+:END:
+*** [C-q]                                                             :drill:
+SCHEDULED: <2014-03-27 Thu>
+    :PROPERTIES:
+    :ID:       e7f30a61-8557-4b7e-898c-96db9d649f39
+    :CUSTOM_ID: 679fd3cd-c43b-409c-be36-4175a5f27cd3
+    :DRILL_LAST_INTERVAL: 50.6823
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 3
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 5.0
+    :DRILL_EASE: 5.815
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:42>
+    :END:
+    org-cycle, comint previous arg
+    [
+#+begin_src emacs-lisp
+  (add-hook 'org-mode-hook
+            (lambda () (define-key org-mode-map (kbd "C-q") 'org-cycle)))
+  (define-key widget-keymap (kbd "C-q") 'widget-forward)
+  (add-hook 'comint-mode-hook
+            (lambda () (define-key comint-mode-map (kbd "C-q") 'comint-insert-previous-argument)))
+#+end_src
+    ]
+*** [M-q]                                                             :drill:
+SCHEDULED: <2014-03-19 Wed>
+:PROPERTIES:
+org-archive-to-archive-sibling
+:CUSTOM_ID: 72bada0e-5d62-4a8f-ae62-4972778ff1bc
+:ID:       4c8104f4-9251-4915-b076-6989c7cce3be
+:DRILL_LAST_INTERVAL: 10.3717
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 8
+:DRILL_FAILURE_COUNT: 6
+:DRILL_AVERAGE_QUALITY: 2.6
+:DRILL_EASE: 2.266
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:35>
+:END:
+org-archive-to-archive-sibling
+[
+#+begin_src emacs-lisp
+(global-set-key (kbd "M-q") 'org-archive-to-archive-sibling)
+#+end_src
+]
+
+*** [C-M-q]                                                           :drill:
+SCHEDULED: <2014-03-12 Wed>
+:PROPERTIES:
+:ID:       ab67e1da-41dd-40bd-96c1-556cafc6b630
+:DRILL_LAST_INTERVAL: 9.9427
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 6
+:DRILL_FAILURE_COUNT: 2
+:DRILL_AVERAGE_QUALITY: 3.104
+:DRILL_EASE: 2.506
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 20:57>
+:CUSTOM_ID: 1f5e9b63-7ce0-445c-a426-b41839585d38
+:END:
+quoted-insert
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-M-q") 'quoted-insert)
+#+end_src
+    ]
+*** C-S-q
+:PROPERTIES:
+:CUSTOM_ID: c16f1753-126b-499b-af0e-669129ccd3ea
+:END:
+*** [C-w]
+:PROPERTIES:
+:CUSTOM_ID: 20005b6d-9a9d-4b58-882c-7ce860c7a395
+:END:
+goto-t.org
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-w") (lambda () (interactive) (goto-buffer-or-find-file "/a/t.org")))
+#+end_src
+]
+*** [M-w]                                                             :drill:
+SCHEDULED: <2014-03-18 Tue>
+    :PROPERTIES:
+    org-clock-in
+    :ID:       c271d82d-e40a-43c3-9c16-753633c1fc14
+    :CUSTOM_ID: 331da6e5-7936-4663-8f58-9d8601b5915c
+    :DRILL_LAST_INTERVAL: 41.7787
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 3
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.667
+    :DRILL_EASE: 4.583
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:36>
+    :END:
+org-clock-in
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "M-w") 'org-clock-in)
+#+end_src
+    ]
+*** C-M-w
+:PROPERTIES:
+:CUSTOM_ID: cede4936-de2f-404f-a0e6-264f08215a7c
+:END:
+*** C-S-w
+:PROPERTIES:
+:CUSTOM_ID: 3465b986-717a-43b4-910f-3d187789c027
+:END:
+*** [C-e]
+copy-line
+    [
+#+begin_src emacs-lisp
+; todo, make repeated calls to this append the kills
+  (defun copy-line (&optional arg)
+    "Copy lines (as many as prefix argument) in the kill ring.
+        Ease of use features:
+        - Move to start of next line.
+        - Appends the copy on sequential calls.
+        - Use newline as last char even on the last line of the buffer.
+        - If region is active, copy its lines."
+    (interactive "p")
+    (let ((beg (line-beginning-position))
+          (end (line-end-position (or arg 1))))
+      (when mark-active
+        (if (> (point) (mark))
+            (setq beg (save-excursion (goto-char (mark)) (line-beginning-position)))
+          (setq end (save-excursion (goto-char (mark)) (line-end-position)))))
+      (if (eq last-command 'copy-line)
+          (kill-append (buffer-substring beg end) (< end beg))
+        (kill-ring-save beg end)))
+    (kill-append "\n" nil)
+    ;; dun need cuz I have yank-better
+    ;;(beginning-of-line (or (and arg (1+ arg)) 2))
+    (if (and arg (not (= 1 arg))) (message "%d lines copied" arg)))
+
+  (global-set-key (kbd "C-e") 'copy-line)
+#+end_src
+    :PROPERTIES:
+    :ID:       4ff8e0ad-15c0-4cb0-b6cc-314e7b5f80c0
+    :CUSTOM_ID: 24e34f4b-d1e8-4380-933f-ab1f78ebc782
+    :DRILL_LAST_INTERVAL: 2.4849
+    :DRILL_REPEATS_SINCE_FAIL: 1
+    :DRILL_TOTAL_REPEATS: 1
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 5.0
+    :DRILL_EASE: 5.815
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-01-11 Sat 01:30>
+    :END:
+    ]
+*** [M-e]                                                             :drill:
+SCHEDULED: <2014-04-01 Tue>
+    :PROPERTIES:
+    org-clock-in-last
+    :ID:       39424175-21e2-4126-9a51-dea451497841
+    :CUSTOM_ID: 0a771449-0cd5-4dc9-82ca-bcac5f7abd17
+    :DRILL_LAST_INTERVAL: 36.7949
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.0
+    :DRILL_EASE: 3.204
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:48>
+    :END:
+org-clock-in-last
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "M-e") 'org-clock-in-last)
+  #+end_src
+    ]
+*** C-M-e
+:PROPERTIES:
+:CUSTOM_ID: 4a7a4324-e03d-43dc-8e9c-9622788519fb
+:END:
+*** C-S-e
+:PROPERTIES:
+:CUSTOM_ID: e202e1d5-b7ac-4171-b86a-b77592344f30
+:END:
+*** [C-r]                                                             :drill:
+SCHEDULED: <2014-04-07 Mon>
+    :PROPERTIES:
+    isearch-backward
+    :ID:       39bcde9c-2b49-401e-9e81-ee42941233bf
+    :CUSTOM_ID: 5c55f461-f43f-493d-81eb-1ca747175ef1
+    :DRILL_LAST_INTERVAL: 42.8284
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.5
+    :DRILL_EASE: 4.122
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:51>
+    :END:
+isearch-backward
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-r") 'isearch-backward)
+(add-hook 'comint-mode-hook
+            (lambda ()
+              (define-key comint-mode-map (kbd "C-r") 'comint-history-isearch-backward-regexp)))
+
+#+end_src
+    ]
+*** [M-r]                                                             :drill:
+SCHEDULED: <2014-04-30 Wed>
+    :PROPERTIES:
+    org-clock-out
+    :ID:       dc2c7192-6cfb-4c06-bd17-ff2cef3b05a6
+    :CUSTOM_ID: dd9575bd-e471-418e-9519-4fc2b874ddcd
+    :DRILL_LAST_INTERVAL: 59.1432
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.25
+    :DRILL_EASE: 3.59
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
+    :END:
+org-clock-out
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "M-r") 'org-clock-out)
+#+end_src
+    ]
+*** C-M-r
+*** C-S-r
+:PROPERTIES:
+:CUSTOM_ID: 05e2290b-0d2c-407c-9bf0-adc7a008336b
+:END:
+*** [C-a]                                                             :drill:
+SCHEDULED: <2014-03-15 Sat>
+    :PROPERTIES:
+    copy-all
+    :CUSTOM_ID: db4b76df-9420-4256-8242-dc44b56d55d7
+    :ID:       f6b2b504-b88d-418b-b6b0-5e0e582bd205
+    :DRILL_LAST_INTERVAL: 24.4352
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 3.75
+    :DRILL_EASE: 2.929
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:39>
+    :END:
+copy buffer
+    [
+    #+begin_src emacs-lisp
+(defun copy-all ()
+    "Copy entire buffer to clipboard"
+    (interactive)
+    (clipboard-kill-ring-save (point-min) (point-max)))
+(global-set-key (kbd "C-a") 'copy-all)
+    #+end_src
+]
+*** [M-a]                                                             :drill:
+SCHEDULED: <2014-03-27 Thu>
+    :PROPERTIES:
+    kmacro-start-macro-or-in...
+    :ID:       4019514b-abb1-464e-b4c9-d9ca39af2a82
+    :CUSTOM_ID: e865a1e5-55bf-4a98-a0d0-cb05a88de352
+    :DRILL_LAST_INTERVAL: 50.6823
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 3
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 5.0
+    :DRILL_EASE: 5.815
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
+    :END:
+macro record
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "M-a") 'kmacro-start-macro-or-insert-counter)
+
+#+end_src
+    ]
+*** [C-M-a]                                                           :drill:
+SCHEDULED: <2014-03-27 Thu>
+    :PROPERTIES:
+    kmacro-end-or-call-macro
+    :ID:       10cdc522-2bea-4601-acf9-ec81a52a34d8
+    :CUSTOM_ID: c6278a5a-024f-4c80-a8d4-65f127fd24a8
+    :DRILL_LAST_INTERVAL: 50.6823
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 3
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 5.0
+    :DRILL_EASE: 5.815
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:35>
+    :END:
+macro end / call
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-M-a") 'kmacro-end-or-call-macro)
+(add-hook 'LaTeX-mode-hook (lambda () (define-key LaTeX-mode-map (kbd "C-M-a") nil)))
+(add-hook 'c-mode-hook
+          (lambda () (define-key c-mode-map (kbd "C-M-a") nil)))
+
+#+end_src
+    ]
+*** C-S-a
+:PROPERTIES:
+:CUSTOM_ID: 649a3fe7-3932-475a-b23c-28db9874de27
+:END:
+*** C-s
+    :PROPERTIES:
+    C-x prefix
+    :ID:       e05a67d7-f7ee-4b23-afb1-0053d5eefb4c
+    :CUSTOM_ID: 01da04da-cdba-493f-892b-c4c064cf937e
+    :END:
+c-x prefix
+
+*** M-s
+:PROPERTIES:
+:CUSTOM_ID: 5e4bf939-90a1-4ace-a7bf-add95c8596d2
+:END:
+*** [C-M-s]                                                           :drill:
+SCHEDULED: <2014-03-18 Tue>
+    :PROPERTIES:
+    split-window-vertically
+    :ID:       18a271e1-c1d2-45e6-aed3-6b81b4b6ea71
+    :CUSTOM_ID: 4b33022d-27f0-4d21-9931-2e2e692790e8
+    :DRILL_LAST_INTERVAL: 26.5334
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 3.75
+    :DRILL_EASE: 2.929
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:46>
+    :END:
+split-window-vertically
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-M-s") 'split-window-vertically)
+#+end_src
+    ]
+*** C-S-s
+:PROPERTIES:
+:CUSTOM_ID: 901a2445-200c-42f2-91c6-4309d71b39dd
+:END:
+*** C-d
+:PROPERTIES:
+:CUSTOM_ID: b699614a-9994-4fe7-b2c6-f0fe81b7ad2b
+:END:
+    C-c prefix
+*** [M-d]                                                             :drill:
+SCHEDULED: <2014-04-05 Sat>
+    :PROPERTIES:
+    whitespace-cleanup
+    :ID:       58f5421a-9df0-44cd-acb9-d018ccdba58c
+    :CUSTOM_ID: 06bcc5e2-f3a7-41c6-a793-ac6c9813fb6e
+    :DRILL_LAST_INTERVAL: 27.3693
+    :DRILL_REPEATS_SINCE_FAIL: 5
+    :DRILL_TOTAL_REPEATS: 6
+    :DRILL_FAILURE_COUNT: 2
+    :DRILL_AVERAGE_QUALITY: 3.417
+    :DRILL_EASE: 2.676
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
+    :END:
+whitespace-cleanup
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "M-d") 'whitespace-cleanup)
+#+end_src
+    ]
+*** [C-M-d]                                                           :drill:
+SCHEDULED: <2014-03-19 Wed>
+:PROPERTIES:
+swap buffer
+:CUSTOM_ID: 8cf6053d-792b-4abd-a3a6-66efd7fbee68
+:ID:       747aabec-b164-4813-93c8-92d5c8778635
+:DRILL_LAST_INTERVAL: 9.5325
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 10
+:DRILL_FAILURE_COUNT: 8
+:DRILL_AVERAGE_QUALITY: 2.636
+:DRILL_EASE: 2.284
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:35>
+:END:
+swap buffer across windows
+[
+from http://www.emacswiki.org/emacs/TransposeWindows
+#+begin_src emacs-lisp
+ (setq swapping-buffer nil)
+ (setq swapping-window nil)
+  (defun swap-buffers-in-windows ()
+   "Swap buffers between two windows"
+   (interactive)
+   (if (and swapping-window
+            swapping-buffer)
+       (let ((this-buffer (current-buffer))
+             (this-window (selected-window)))
+         (if (and (window-live-p swapping-window)
+                  (buffer-live-p swapping-buffer))
+             (progn (switch-to-buffer swapping-buffer)
+                    (select-window swapping-window)
+                    (switch-to-buffer this-buffer)
+                    (select-window this-window)
+                    (message "Swapped buffers."))
+           (message "Old buffer/window killed.  Aborting."))
+         (setq swapping-buffer nil)
+         (setq swapping-window nil))
+     (progn
+       (setq swapping-buffer (current-buffer))
+       (setq swapping-window (selected-window))
+       (message "Buffer and window marked for swapping."))))
+
+ (global-set-key (kbd "C-M-d") 'swap-buffers-in-windows)
+#+end_src
+]
+*** C-S-d
+:PROPERTIES:
+:CUSTOM_ID: d3166178-3d87-4caa-a937-9797fc2b6a39
+:END:
+*** [C-f]
+:PROPERTIES:
+:CUSTOM_ID: 2695ed8a-e0d3-4e84-8688-98e3c50723b0
+:END:
+kill-whole-line
+    [
+#+begin_src emacs-lisp
+  (global-set-key (kbd "C-f") 'kill-whole-line-wrapper)
+  (defun kill-whole-line-wrapper (&optional arg)
+    "If we are at the end of the file, kill backwards instead of doing nothing."
+    (interactive "P")
+    (if (= (point) (point-max))
+        (kill-whole-line -1)
+      (kill-whole-line arg)))
+#+end_src
+    ]
+*** M-f
+:PROPERTIES:
+:CUSTOM_ID: 869f0aec-c739-4fb7-8e3a-8b55ab637765
+:END:
+*** [C-M-f]
+:PROPERTIES:
+:CUSTOM_ID: e7e4dd0b-418f-48ee-b366-9e733e3bec61
+:END:
+kill rest of line
+    [
+#+begin_src emacs-lisp
+
+  (add-hook 'org-mode-hook
+            (lambda ()
+              (define-key org-mode-map (kbd "C-M-f") 'org-kill-line)))
+
+    (global-set-key (kbd "C-M-f") 'kill-line)
+#+end_src
+    ]
+*** C-S-f
+:PROPERTIES:
+:CUSTOM_ID: a59eb2ca-9439-4836-81f9-384bc8c07739
+:END:
+*** [C-g]
+SCHEDULED: <2014-01-13 Mon>
+    :PROPERTIES:
+    other-window / cancel
+    :ID:       a4e9c495-02c1-432e-beba-12a9d4d61e8a
+    :CUSTOM_ID: 4af40595-7010-4be6-8cfe-a43797ca6e33
+    :DRILL_LAST_INTERVAL: 2.4849
+    :DRILL_REPEATS_SINCE_FAIL: 1
+    :DRILL_TOTAL_REPEATS: 1
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 5.0
+    :DRILL_EASE: 5.815
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-01-11 Sat 01:41>
+    :END:
+cancel / other window
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-g") 'other-window)
+#+end_src
+    ]
+*** [M-g]                                                             :drill:
+SCHEDULED: <2014-03-13 Thu>
+    :PROPERTIES:
+    abort-recursive-edit
+    :ID:       1e8e0c57-2885-4c0c-9b94-3ec0c02b706e
+    :CUSTOM_ID: fb0b343f-fdff-463a-94f4-3152191e17c4
+    :DRILL_LAST_INTERVAL: 22.1939
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 3.5
+    :DRILL_EASE: 2.73
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:33>
+    :END:
+abort-recursive-edit
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "M-g") 'abort-recursive-edit)
+#+end_src
+    ]
+*** [C-M-g]
+:PROPERTIES:
+:CUSTOM_ID: 327e18af-30b7-47e5-aa53-5f678788b4c1
+:END:
+gnus
+[
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-M-g") 'gnus)
+#+end_src
+    ]
+*** C-S-g
+:PROPERTIES:
+:CUSTOM_ID: 1d4edc55-7b30-4648-b869-b82f8f1d7b1a
+:END:
+*** C-z
+    :PROPERTIES:
+    undo-tree-undo
+    :ID:       42d7f2bf-3ba3-488b-b501-bd4680dbb8de
+    :CUSTOM_ID: 707c4938-a790-4da9-8230-61855ea57d09
+    :END:
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-z") 'undo-tree-undo)
+#+end_src
+    ]
+*** M-z
+:PROPERTIES:
+:CUSTOM_ID: a01c110e-9970-4571-84ab-379eecc7dd31
+:END:
+*** [C-M-z]
+*** C-S-z
+:PROPERTIES:
+:CUSTOM_ID: 3d56370d-11cd-4026-8e6b-3ae9b7b51714
+:END:
+*** C-x
+:PROPERTIES:
+:CUSTOM_ID: ec1403d3-528e-41b1-a195-5563bc93e124
+:END:
+kill-region
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-s") 'kill-region)
+#+end_src
+*** [M-x]                                                             :drill:
+SCHEDULED: <2014-03-31 Mon>
+:PROPERTIES:
+:CUSTOM_ID: bb7c95d5-dd97-439d-bf1f-cdac98d11543
+:ID:       909cf249-c2f2-4251-bf18-c990ca9c6ff9
+:DRILL_LAST_INTERVAL: 21.5453
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 3.25
+:DRILL_EASE: 2.58
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:33>
+:END:
+append-next-kill
+[
+#+begin_src emacs-lisp
+(global-set-key (kbd "M-x") 'append-next-kill)
+#+end_src
+]
+*** [C-M-x]                                                           :drill:
+SCHEDULED: <2014-03-17 Mon>
+    :PROPERTIES:
+    append-next-kill
+    :ID:       b2b60fb4-95a3-4311-8ccd-7132f03ac9a8
+    :CUSTOM_ID: c988370e-602c-431c-80a9-608459583f8b
+    :DRILL_LAST_INTERVAL: 26.0772
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 1
+    :DRILL_AVERAGE_QUALITY: 3.5
+    :DRILL_EASE: 2.73
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:49>
+    :END:
+cut-to-register
+    [
+#+begin_src emacs-lisp
+;; same args as copy-to-register
+(defun cut-to-register (register start end &optional delete-flag region)
+  (interactive (list (register-read-with-preview "Cut to register: ")
+                     (region-beginning)
+                     (region-end)
+                     current-prefix-arg
+                     t))
+  (copy-to-register register start end t region))
+
+(global-set-key (kbd "C-M-x") 'cut-to-register)
+#+end_src
+    ]
+*** C-S-x
+:PROPERTIES:
+:CUSTOM_ID: 0ce7383c-0776-407e-9ac5-981d1476f541
+:END:
+*** C-c
+    :PROPERTIES:
+    :ID:       5416e482-6f36-4d35-84c3-49bb184a53e9
+    :CUSTOM_ID: 400f06e1-8e45-443c-8d7b-3d1bb1176aab
+    :END:
+copy
+#+begin_src emacs-lisp
+(global-set-key (kbd "C-d") 'kill-ring-save)
+(add-hook 'c-mode-hook
+          (lambda () (define-key c-mode-map (kbd "C-d") nil)))
+(add-hook 'comint-mode-hook
+          (lambda ()
+            (define-key comint-mode-map (kbd "C-d") nil)))
+;; the base map is shared by many c-modes, like java
+(add-hook 'c-mode-hook
+          (lambda ()
+            (define-key c-mode-base-map "\C-d" nil)
+            (define-key c-mode-base-map (kbd "<deletechar>") 'c-electric-delete-forward)))
+
+#+end_src
+*** [M-c]                                                             :drill:
+SCHEDULED: <2014-03-24 Mon>
+    :PROPERTIES:
+    org-capture
+    :ID:       bf1cb358-ec72-425d-aebb-0c1f0ece7717
+    :CUSTOM_ID: f4c3317a-a317-4d04-8cb7-e46d0716bf1d
+    :DRILL_LAST_INTERVAL: 32.7466
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.0
+    :DRILL_EASE: 3.204
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:53>
+    :END:
+org-capture
+    [
+#+begin_src emacs-lisp
+  (define-key global-map "\M-c" 'org-capture)
+#+end_src
+]
+*** [C-M-c]                                                           :drill:
+SCHEDULED: <2014-03-24 Mon>
+    :PROPERTIES:
+    copy-to-register
+    :ID:       956fd2ec-ad26-4842-b56c-f2165648c461
+    :CUSTOM_ID: 0a151d99-47ae-4e8f-8407-82e77d24a3e7
+    :DRILL_LAST_INTERVAL: 32.7466
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.0
+    :DRILL_EASE: 3.204
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:51>
+    :END:
+copy-to-register
+    [
+#+begin_src emacs-lisp
+  (global-set-key (kbd "C-M-c") 'copy-to-register)
+#+end_src
+]
+*** C-S-c
+:PROPERTIES:
+:CUSTOM_ID: b78d717f-cfb3-477a-b951-63f523635f5c
+:END:
+*** C-v
+:PROPERTIES:
+:CUSTOM_ID: 16411f68-7fe0-49e8-9a73-212471594f9e
+:END:
+yank
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-v") 'yank-better)
+
+
+
+    (defun yank-better (arg)
+  "Paste, linewise if our kill ends with a newline.
+  I change the behavior of plain prefix. It makes it not do linewise paste,
+  because sometimes you want to yank pop and a linewise paste screws that up.
+  c-u with no number normally makes the point go before the yank.
+  That is pointless for me, as it would be just as easier and less
+  thought to pop the mark after yanking cuz it is set to before the mark."
+      (interactive "*P")
+      (if (and (not (equal arg '(4))) (string-suffix-p "\n" (current-kill 0 t)))
+          (beginning-of-line))
+      (if (and (stringp mode-name) (string= mode-name "Org"))
+          (call-interactively 'org-yank)
+        (setq this-command 'yank)
+        (call-interactively 'yank (and (not (equal arg '(4)))))))
+
+    (put 'yank-better 'delete-selection 'yank)
+#+end_src
+*** [M-v]                                                             :drill:
+SCHEDULED: <2014-03-11 Tue>
+    :PROPERTIES:
+    insert-register
+    :ID:       7e21df8d-fdf7-47ed-8648-f9d182445145
+    :CUSTOM_ID: d67f6371-a13f-4a75-8d8c-e4013ff4e131
+    :DRILL_LAST_INTERVAL: 2.2172
+    :DRILL_REPEATS_SINCE_FAIL: 1
+    :DRILL_TOTAL_REPEATS: 5
+    :DRILL_FAILURE_COUNT: 2
+    :DRILL_AVERAGE_QUALITY: 2.84
+    :DRILL_EASE: 2.381
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:38>
+    :END:
+insert-register
+    [
+#+begin_src emacs-lisp
+  (global-set-key (kbd "M-v") 'insert-register)
+#+end_src
+    ]
+*** [C-M-v]                                                           :drill:
+SCHEDULED: <2014-05-13 Tue>
+    :PROPERTIES:
+    yank pop
+    :ID:       e05d9d8f-1387-44b3-b348-a45cf6083bd2
+    :CUSTOM_ID: 25f86658-9999-40f7-b3a4-615981751b93
+    :DRILL_LAST_INTERVAL: 71.5839
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.75
+    :DRILL_EASE: 4.85
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
+    :END:
+yank-pop
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-M-v") 'yank-pop)
+#+end_src
+    ]
+*** C-S-v
+:PROPERTIES:
+:CUSTOM_ID: 6732ed10-a473-445d-b14a-5f4c17c6a3ef
+:END:
+*** [C-b]                                                             :drill:
+SCHEDULED: <2014-03-27 Thu>
+    :PROPERTIES:
+    delete-other-windows
+    :ID:       c9309da7-6801-4d94-a21e-140f4b258c28
+    :CUSTOM_ID: e682305e-0110-4d2f-afbd-2c401bcb9313
+    :DRILL_LAST_INTERVAL: 50.6823
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 3
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 5.0
+    :DRILL_EASE: 5.815
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:34>
+    :END:
+delete-other-windows
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-b") 'delete-other-windows)
+#+end_src
+    ]
+*** [M-b]                                                             :drill:
+SCHEDULED: <2014-04-07 Mon>
+    :PROPERTIES:
+    isearch-backward-current-symbol
+    :CUSTOM_ID: 05e3d0db-36dc-455f-8bed-f87886ca6004
+    :ID:       0272efdb-eb85-485c-b24f-410ceabeb330
+    :DRILL_LAST_INTERVAL: 28.6736
+    :DRILL_REPEATS_SINCE_FAIL: 5
+    :DRILL_TOTAL_REPEATS: 5
+    :DRILL_FAILURE_COUNT: 1
+    :DRILL_AVERAGE_QUALITY: 3.4
+    :DRILL_EASE: 2.666
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
+    :END:
+isearch-backward-current-symbol
+    [
+#+begin_src emacs-lisp
+   (global-set-key (kbd "M-b") 'isearch-backward-current-symbol)
+#+end_src
+]
+*** [C-M-b]                                                           :drill:
+SCHEDULED: <2014-04-04 Fri>
+    :PROPERTIES:
+    isearch-current-symbol
+    :ID:       235b96a8-e724-419d-8d07-8d0a021213eb
+    :CUSTOM_ID: 6c63790c-28c1-4b73-96e2-ee859f57e734
+    :DRILL_LAST_INTERVAL: 40.0706
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 3.75
+    :DRILL_EASE: 2.929
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-02-23 Sun 02:26>
+    :END:
+isearch-current-symbol
+    [
+    #+begin_src emacs-lisp
+(global-set-key (kbd "C-M-b") 'isearch-current-symbol)
+#+end_src
+]
+*** C-S-b
+:PROPERTIES:
+:CUSTOM_ID: a220d7e0-12df-4d37-a57a-266785e7f3c5
+:END:
+*** [C-tab]                                                           :drill:
+SCHEDULED: <2014-03-27 Thu>
+    :PROPERTIES:
+    yas-insert-snippet
+    :CUSTOM_ID: edc45592-c69f-4439-8305-48f2c65696c3
+    :ID:       92eac3e1-0675-4746-a130-7539f9bc213a
+    :DRILL_LAST_INTERVAL: 50.6823
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 3
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 5.0
+    :DRILL_EASE: 5.815
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:42>
+    :END:
+yas-expand
+    [
+    #+begin_src emacs-lisp
+;; yas keymaps are already initialized when this runs,
+;; but I use a hook because it the way I do it for all other minor modes
+  (add-hook 'yas-minor-mode-hook (lambda ()
+                                   (define-key yas-minor-mode-map (kbd "<C-tab>") 'yas-expand)
+                                   (define-key yas-keymap (kbd "<C-tab>") 'yas-next-field-or-maybe-expand)))
+  (global-set-key (kbd "<C-tab>") 'yas-insert-snippet)
+#+end_src
+]
+*** [M-tab]                                                           :drill:
+SCHEDULED: <2014-03-14 Fri>
+    :PROPERTIES:
+    indent line
+    :ID:       35b77d8a-9e69-4f8e-a2ac-c78fcf6dc1f5
+    :CUSTOM_ID: 71264957-45fd-455a-a6d1-b08823c02d25
+    :DRILL_LAST_INTERVAL: 23.0811
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 1
+    :DRILL_AVERAGE_QUALITY: 3.75
+    :DRILL_EASE: 2.929
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:35>
+    :END:
+indent line
+    [
+#+begin_src emacs-lisp
+
+  (global-set-key (kbd "<M-tab>") 'indent-for-tab-command)
+
+  ; todo, <M-tab> overrides calculator mode map
+#+end_src
+]
+*** C-M-tab
+:PROPERTIES:
+:CUSTOM_ID: 33b76824-317c-4657-8a5b-2b126b8f7fc9
+:END:
+*** C-S-tab
+:PROPERTIES:
+:CUSTOM_ID: 89d1aeca-47ed-4e4a-89d2-ff70c06e08c8
+:END:
+*** [C-delete]                                                        :drill:
+SCHEDULED: <2014-05-13 Tue>
+    :PROPERTIES:
+    kill-symbol
+    :ID:       bb7ae41f-8fab-42ee-9338-33dd22d7f173
+    :CUSTOM_ID: 2688b61d-9fdd-44af-b9bd-b126f0da00bd
+    :DRILL_LAST_INTERVAL: 71.5839
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.75
+    :DRILL_EASE: 4.85
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:12>
+    :END:
+kill-symbol
+    [
+#+begin_src emacs-lisp
+  (global-set-key (kbd "<C-delete>") 'kill-symbol)
+(defun kill-symbol (arg)
+    (interactive "p")
+    (kill-region (point) (save-excursion (forward-symbol arg) (point))))
+
+#+end_src
+]
+*** M-delete
+:PROPERTIES:
+:CUSTOM_ID: 60747222-b0e5-4983-9bed-e6d44f65483a
+:END:
+*** [C-M-delete]                                                      :drill:
+SCHEDULED: <2014-03-24 Mon>
+    :PROPERTIES:
+    kill-sexp
+    kill-sexp
+    :CUSTOM_ID: 21876759-a8e6-4896-8a08-eda40d0eaff3
+    :ID:       7f2797e1-dd39-4d0a-8b87-264e2757543b
+    :DRILL_LAST_INTERVAL: 28.5089
+    :DRILL_REPEATS_SINCE_FAIL: 5
+    :DRILL_TOTAL_REPEATS: 5
+    :DRILL_FAILURE_COUNT: 2
+    :DRILL_AVERAGE_QUALITY: 3.6
+    :DRILL_EASE: 2.802
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-23 Sun 02:27>
+    :END:
+kill-sexp
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "<C-M-delete>") 'kill-sexp)
+#+end_src
+    ]
+*** C-S-delete
+:PROPERTIES:
+:CUSTOM_ID: 696e9e0f-f717-44cd-90e7-a73d76a58162
+:END:
+
+*** [C-left-arrow]                                                    :drill:
+SCHEDULED: <2014-03-15 Sat>
+    :PROPERTIES:
+    compile
+    :ID:       fbc09f29-fb89-479f-b509-255352e4e9d1
+    :CUSTOM_ID: b15da91f-0786-49d1-b0b9-331b3b94f6ae
+    :DRILL_LAST_INTERVAL: 24.2738
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 1
+    :DRILL_AVERAGE_QUALITY: 4.0
+    :DRILL_EASE: 3.204
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:24>
+    :END:
+compile / comint search
+    [
+#+begin_src emacs-lisp
+(defun set-p (var)
+  (and (bound-and-true-p var)
+       (not (eq var 'unset))))
+(global-set-key (kbd "C-(") 'run)
+
+;; make compile work from the gtags root dir
+(defadvice compile (before pre-compile-advice activate)
+  (basic-save-buffer)
+  (when (set-p ggtags-project-root)
+    (setq-local compile-saved-dir default-directory)
+    (setq default-directory ggtags-project-root)))
+(defadvice compile (after post-compile-advice activate)
+  (when (bound-and-true-p compile-saved-dir)
+    (setq default-directory compile-saved-dir)))
+
+
+(add-hook 'c-mode-hook (lambda () (define-key c-mode-map (kbd "C-(") 'compile)))
+(add-hook 'comint-mode-hook
+          (lambda ()
+            (define-key isearch-mode-map (kbd "C-(") 'isearch-repeat-backward)
+            (define-key comint-mode-map (kbd "C-(") 'isearch-backward)))
+
+#+end_src
+]
+*** M-left-arrow
+:PROPERTIES:
+:CUSTOM_ID: 73085b60-95f3-44bf-af71-70d6a7f9b9c6
+:END:
+*** [C-M-left-arrow]                                                  :drill:
+SCHEDULED: <2014-03-10 Mon>
+:PROPERTIES:
+org-shiftup
+:CUSTOM_ID: 13faf5d4-34be-4363-948d-4ff04a9f570b
+:ID:       39390478-6d33-460e-ab47-0dc6ac4c5249
+:DRILL_LAST_INTERVAL: 7.6079
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 7
+:DRILL_FAILURE_COUNT: 6
+:DRILL_AVERAGE_QUALITY: 2.886
+:DRILL_EASE: 2.402
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:01>
+:END:
+org-shiftup
+[
+#+begin_src emacs-lisp
+ (add-hook 'org-mode-hook
+            (lambda () (define-key org-mode-map (kbd "C-M-(") 'org-shiftup)))
+#+end_src
+]
+*** C-S-left-arrow
+:PROPERTIES:
+:CUSTOM_ID: 4e3a7ead-efb5-46d8-9465-1867d47e5ec2
+:END:
+*** [C-right-arrow]                                                   :drill:
+SCHEDULED: <2014-05-13 Tue>
+:PROPERTIES:
+paste selection
+:CUSTOM_ID: 3f3cac16-097d-451a-a14a-da7717d06730
+:ID:       1b0ac338-d87b-4a37-b192-bc4305a337cc
+:DRILL_LAST_INTERVAL: 71.5839
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 4.75
+:DRILL_EASE: 4.85
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:11>
+:END:
+keyboard-yank-primary
+[
+#+begin_src emacs-lisp
+(defun keyboard-yank-primary ()
+  (interactive)
+  (let ((mouse-yank-at-point t))
+    (mouse-yank-primary nil)))
+;; paste selection
+(global-set-key (kbd "C-)") 'keyboard-yank-primary)
+#+end_src
+]
+*** M-right-arrow
+:PROPERTIES:
+:CUSTOM_ID: 97a4513f-6837-47c5-9e2b-354542d67d29
+:END:
+*** C-M-right-arrow
+:PROPERTIES:
+org-shiftdown
+:CUSTOM_ID: 34e66314-1d97-4eeb-b704-fe0733849ae4
+:END:
+[
+#+begin_src emacs-lisp
+ (add-hook 'org-mode-hook
+            (lambda () (define-key org-mode-map (kbd "C-M-)") 'org-shiftdown)))
+#+end_src
+]
+*** C-S-right-arrow
+:PROPERTIES:
+:CUSTOM_ID: f441e351-ccd7-4ac1-9a4d-a0a1dd17b73e
+:END:
+*** [C-backspace]                                                     :drill:
+SCHEDULED: <2014-05-13 Tue>
+    :PROPERTIES:
+    backward-kill-symbol
+    :CUSTOM_ID: 85bb4701-42e6-4617-8de8-dfb1f03b0358
+    :ID:       9c0e1f0a-7b45-4670-86a2-9df945142cbe
+    :DRILL_LAST_INTERVAL: 71.5839
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.75
+    :DRILL_EASE: 4.85
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:12>
+    :END:
+backward-kill-symbol
+    [
+#+begin_src emacs-lisp
+(global-set-key (kbd "<C-backspace>") 'backward-kill-symbol)
+(add-hook 'comint-mode-hook
+            (lambda ()
+              (define-key comint-mode-map (kbd "<C-backspace>") 'backward-kill-word)))
+(defun backward-kill-symbol (arg)
+    (interactive "p")
+    (kill-region (point) (save-excursion (backward-symbol arg) (point))))
+#+end_src
+]
+*** M-backspace
+:PROPERTIES:
+:CUSTOM_ID: d4b3e996-208a-4b6d-a747-076e56bd7da3
+:END:
+*** [C-M-backspace]                                                   :drill:
+SCHEDULED: <2014-03-18 Tue>
+:PROPERTIES:
+:ID:       1030c81d-2cc2-42ba-8aa5-fe98271a00f2
+:DRILL_LAST_INTERVAL: 26.5334
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 3.75
+:DRILL_EASE: 2.929
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:46>
+:CUSTOM_ID: 606b0991-7431-4a8a-a909-b872e104cc88
+:END:
+backward-kill-sexp
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "<C-M-backspace>") 'backward-kill-sexp)
+#+end_src
+    ]
+*** C-S-backspace
+:PROPERTIES:
+:CUSTOM_ID: 9c826109-76fd-403e-b15e-ceee5f925f6c
+:END:
+*** C-f7
+:PROPERTIES:
+:CUSTOM_ID: 8e4b9a2c-35ff-4300-91ff-65d19d6b2fde
+:END:
+*** M-f7
+:PROPERTIES:
+:CUSTOM_ID: 390a5b78-f5fe-41b6-bb36-ea9c81806989
+:END:
+*** C-M-f7
+:PROPERTIES:
+:CUSTOM_ID: a8e9d8e4-4f29-4da6-a7b8-3d136a3e1c18
+:END:
+*** C-S-f7
+:PROPERTIES:
+:CUSTOM_ID: 60bb5cd8-aeb3-4014-81f2-4cee72e9547c
+:END:
+
+** right primary
+*** [C-*]                                                             :drill:
+SCHEDULED: <2014-03-16 Sun>
+    :PROPERTIES:
+    split-window-horizontally
+    :ID:       c9f11b06-583f-48e5-8d0a-56107feb0010
+    :CUSTOM_ID: f745b337-8b65-44cc-849a-5e0953c9ebd9
+    :DRILL_LAST_INTERVAL: 13.9711
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 6
+    :DRILL_FAILURE_COUNT: 3
+    :DRILL_AVERAGE_QUALITY: 2.982
+    :DRILL_EASE: 2.447
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:04>
+    :END:
+split-window-horizontally
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-*") 'split-window-horizontally)
+#+end_src
+    ]
+*** M-*
+*** [C-M-*]                                                           :drill:
+SCHEDULED: <2014-03-17 Mon>
+:PROPERTIES:
+calc-dispatch
+:CUSTOM_ID: 5dbe3437-7364-4802-b558-00b2d5faacf6
+:ID:       2cffe3fb-a21a-4a49-83f8-65218c7a45a2
+:DRILL_LAST_INTERVAL: 15.2345
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 7
+:DRILL_FAILURE_COUNT: 2
+:DRILL_AVERAGE_QUALITY: 2.893
+:DRILL_EASE: 2.405
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
+:END:
+calc-dispatch
+[
+#+begin_src emacs-lisp
+  (global-set-key (kbd "C-M-*") 'calc-dispatch)
+#+end_src
+]
+*** C-S-*
+:PROPERTIES:
+:CUSTOM_ID: 8c414142-8a42-46df-9ab2-898f1be636c8
+:END:
+*** [C-9]                                                             :drill:
+SCHEDULED: <2014-03-27 Thu>
+:PROPERTIES:
+:ID:       eda4444e-f1c4-4db7-918d-96789f6a0b2b
+:CUSTOM_ID: 43d14154-2722-4ba5-b547-1b78c6274ebf
+:DRILL_LAST_INTERVAL: 50.6823
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 3
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 5.0
+:DRILL_EASE: 5.815
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:40>
+:END:
+delete-window-or-exit
+[
+#+begin_src emacs-lisp
+  (global-set-key (kbd "C-9") 'delete-window-or-exit)
+
+  (defun delete-window-or-exit ()
+    "Delete window or exit emacs."
+    (interactive)
+    (if (condition-case nil (delete-window) (error t))
+        (if (or (boundp 'server-process) (> (length (frame-list)) 1))
+            (delete-frame)
+          (save-buffers-kill-terminal t))))
+
+#+end_src
+]
+*** [M-9]                                                             :drill:
+SCHEDULED: <2014-03-12 Wed>
+    :PROPERTIES:
+    kill-buffer-and-window
+    :CUSTOM_ID: 9dc95338-4321-4354-9de2-69409f383a10
+    :ID:       24b7dd06-c5cc-4264-954f-d8190d44c1bf
+    :DRILL_LAST_INTERVAL: 20.7344
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 3.75
+    :DRILL_EASE: 2.928
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:33>
+    :END:
+kill-buffer
+    [
+    #+begin_src emacs-lisp
+(defun kill-buffer-no-ido ()
+"kill-buffer, avoid the ido remapping"
+  (interactive)
+  (kill-buffer))
+(global-set-key (kbd "M-9") 'kill-buffer-no-ido)
+    #+end_src
+]
+strangely, in simple mode, this is overridden.
+I found this map to override, but it didn't work, so it seems its being bound some other way.
+I did a grep of the emacs sources, but couldn't find anything.
+(define-key universal-argument-map [?9] nil)
+
+*** [C-M-9]                                                           :drill:
+SCHEDULED: <2014-03-17 Mon>
+    :PROPERTIES:
+    kill client buffer
+    :ID:       2046ac28-1c06-410b-bdd9-39eaeada50c0
+    :CUSTOM_ID: ffe9f636-31e5-48ba-b8fe-7c158ace744c
+    :DRILL_LAST_INTERVAL: 25.6978
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.0
+    :DRILL_EASE: 3.204
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:41>
+    :END:
+end server edit
+    ,save & kill buffer it was opened externally via emacsclient
+
+ [
+    #+begin_src emacs-lisp
+      (defun server-edit-save ()
+        (interactive)
+        (save-buffer)
+        (server-edit))
+      (global-set-key (kbd "C-M-9") 'server-edit-save)
+    #+end_src
+]
+*** C-S-9
+:PROPERTIES:
+:CUSTOM_ID: 56d86cb3-cb86-42d8-9516-d7f2e086d88a
+:END:
+*** [C-u]                                                             :drill:
+SCHEDULED: <2014-03-27 Thu>
+    :PROPERTIES:
+    :ID:       a254c137-8a33-440d-b71e-5fbf9a21e2f5
+    :CUSTOM_ID: 327992c0-6eba-4935-aec1-49871c2a8619
+    :DRILL_LAST_INTERVAL: 50.6823
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 3
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 5.0
+    :DRILL_EASE: 5.815
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:45>
+    :END:
+universal-argument
+*** M-u
+*** [C-M-u]                                                           :drill:
+SCHEDULED: <2014-03-27 Thu>
+    :PROPERTIES:
+    search-keybind
+    :ID:       a2e31aed-143f-4aa2-841b-857729417993
+    :CUSTOM_ID: 62735d64-b89a-46b7-b32e-2453b651039d
+    :DRILL_LAST_INTERVAL: 50.6823
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 3
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 5.0
+    :DRILL_EASE: 5.815
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:43>
+    :END:
+search-keybind
+    [
+#+begin_src emacs-lisp
+  (global-set-key (kbd "C-M-u") 'search-keybind)
+
+  (defun search-keybind (regexp &optional nlines)
+    (interactive (occur-read-primary-args))
+    (save-excursion
+      (describe-bindings)
+      (set-buffer "*Help*")
+      (occur regexp)
+      (delete-windows-on "*Help*")
+      ))
+#+end_src
+    ]
+*** C-S-u
+:PROPERTIES:
+:CUSTOM_ID: 7f72dfa0-ba8e-4cd5-b25b-8ff6066464e6
+:END:
+*** C-i
+:PROPERTIES:
+:CUSTOM_ID: 3124e200-1d6e-4ad2-9a36-0d03e1e7dc38
+:END:
+-----
+*** M-i
+:PROPERTIES:
+:CUSTOM_ID: 95ab2045-88bf-4656-b8b1-6cebc87b89e0
+:END:
+*** [C-M-i]                                                           :drill:
+SCHEDULED: <2014-03-17 Mon>
+    :PROPERTIES:
+    query-replace-regexp
+    :CUSTOM_ID: a3260b61-7c51-4d97-9a91-3ed702c5ae29
+    :ID:       93f569b8-4bc8-49e1-a38e-ced3d3198ce8
+    :DRILL_LAST_INTERVAL: 26.3579
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 1
+    :DRILL_AVERAGE_QUALITY: 4.0
+    :DRILL_EASE: 3.204
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:45>
+    :END:
+query-replace-regexp
+    [
+#+begin_src emacs-lisp
+  (global-set-key (kbd "C-M-i") 'query-replace-regexp)
+ (add-hook 'flyspell-mode-hook
+            (lambda () (define-key flyspell-mode-map (kbd "C-M-i") nil)))
+(add-hook 'text-mode-hook
+            (lambda () (define-key text-mode-map (kbd "C-M-i") nil)))
+
+#+end_src
+    ]
+*** C-S-i
+:PROPERTIES:
+:CUSTOM_ID: 076edcc2-040e-4371-9851-4e587766e1fe
+:END:
+*** [C-o]                                                             :drill:
+SCHEDULED: <2014-05-13 Tue>
+    :PROPERTIES:
+    occur
+    :ID:       a502687a-24b4-4b73-9abc-bc85b89ab235
+    :CUSTOM_ID: 82215193-63b3-4d63-8f70-d11a328fe72d
+    :DRILL_LAST_INTERVAL: 71.5839
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.75
+    :DRILL_EASE: 4.85
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
+    :END:
+occur
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-o") 'occur)
+#+end_src
+    ]
+*** M-o
+:PROPERTIES:
+:CUSTOM_ID: 8c58b99d-b1e4-4270-8d4a-8ae72e2a6470
+:END:
+*** [C-M-o]                                                           :drill:
+SCHEDULED: <2014-03-12 Wed>
+    :PROPERTIES:
+    ido-goto-symbol
+    :CUSTOM_ID: 05d1ef50-43ee-46d7-b1ad-dd952543ab45
+    :ID:       6dfcaa31-d223-4a14-904e-2f2395b2cf75
+    :DRILL_LAST_INTERVAL: 10.3122
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 9
+    :DRILL_FAILURE_COUNT: 9
+    :DRILL_AVERAGE_QUALITY: 2.994
+    :DRILL_EASE: 2.453
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
+    :END:
+ido-goto-symbol
+    [
+#+begin_src emacs-lisp
+  (global-set-key (kbd "C-M-o") 'ido-goto-symbol)
+#+end_src
+    ]
+*** C-S-o
+:PROPERTIES:
+:CUSTOM_ID: 7eacf048-4da8-4b2b-8a51-a4772111e285
+:END:
+*** [C-p]                                                             :drill:
+SCHEDULED: <2014-03-15 Sat>
+    :PROPERTIES:
+    move-mouse-to-point
+    :ID:       6b1abcf6-7f95-45c4-a87f-0e86c43c5af1
+    :CUSTOM_ID: 9c2e2ba9-f34e-48fe-b4ff-b9826882c1cc
+    :DRILL_LAST_INTERVAL: 23.5247
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 3.5
+    :DRILL_EASE: 2.73
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:41>
+    :END:
+move-mouse-to-point
+    [
+#+begin_src emacs-lisp
+  (global-set-key (kbd "C-p") 'move-mouse-to-point)
+#+end_src
+]
+*** M-p
+*** [C-M-p]                                                     :drill:leech:
+    :PROPERTIES:
+    delete-horizontal-space
+    :ID:       e2972d5b-28e7-46aa-896f-66d68a6df0de
+    :CUSTOM_ID: d55616d3-a3f6-4e83-8807-748578a7b726
+    :DRILL_LAST_INTERVAL: 0.0
+    :DRILL_REPEATS_SINCE_FAIL: 0
+    :DRILL_TOTAL_REPEATS: 10
+    :DRILL_FAILURE_COUNT: 16
+    :DRILL_AVERAGE_QUALITY: 2.433
+    :DRILL_EASE: 2.18
+    :DRILL_LAST_QUALITY: 2
+    :DRILL_LAST_REVIEWED: <2014-04-14 Mon 11:31>
+    :END:
+delete-horizontal-space
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-M-p") 'delete-horizontal-space)
+#+end_src
+    ]
+*** C-S-p
+:PROPERTIES:
+:CUSTOM_ID: f0cffe8d-d2cb-4f5d-a3f2-fa900e093ef7
+:END:
+*** [C-j]                                                             :drill:
+SCHEDULED: <2014-03-15 Sat>
+pop-to-mark
+    [
+#+begin_src emacs-lisp
+(defun my-pop-to-mark-command ()
+  "Jump to mark, and pop a new position for mark off the ring.
+                     \(Does not affect global mark ring\)."
+  (interactive)
+  (pop-to-mark-command)
+  (if (and (derived-mode-p 'org-mode) (outline-invisible-p))
+      (org-show-context 'mark-goto)))
+
+(global-set-key (kbd "C-j") 'my-pop-to-mark-command)
+(define-key ido-common-completion-map (kbd "C-j") 'ido-select-text)
+(add-hook 'ido-setup-hook
+          (lambda () (define-key ido-common-completion-map (kbd "C-j") 'ido-select-text)))
+(add-hook 'lisp-interaction-mode-hook
+          (lambda ()
+            (define-key lisp-interaction-mode-map (kbd "C-j") nil)))
+
+#+end_src
+]
+*** [M-j]                                                             :drill:
+SCHEDULED: <2014-03-13 Thu>
+    :PROPERTIES:
+    previous-error
+    :ID:       cb5f0e6f-815d-488f-bfb2-5d31bd5dc215
+    :CUSTOM_ID: 474a3e12-95ac-4f43-b83a-36716f3e6f76
+    :DRILL_LAST_INTERVAL: 21.5453
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 3.25
+    :DRILL_EASE: 2.58
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:39>
+    :END:
+previous-error
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "M-j") 'previous-error)
+#+end_src
+    ]
+*** [C-M-j]
+
+register prefix
+[
+    :PROPERTIES:
+    :CUSTOM_ID: ebcf7c71-3c93-431b-af6b-7c5df7f2945e
+    :ID:       d2604f6e-341d-4d57-91c8-ec6f2cdeb901
+    :DRILL_LAST_INTERVAL: 23.5247
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 3.5
+    :DRILL_EASE: 2.73
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:45>
+    :END:
+#+begin_src emacs-lisp
+(define-key global-map (kbd "C-M-j") ctl-x-r-map)
+(define-key ctl-x-r-map "m" 'kmacro-to-register)
+#+end_src
+    ]
+
+*** C-S-j
+:PROPERTIES:
+:CUSTOM_ID: 381a6c7c-e763-4d9a-86f5-55a5e0afcee1
+:END:
+*** [C-k]                                                             :drill:
+SCHEDULED: <2014-05-13 Tue>
+    :PROPERTIES:
+    jump to register
+    :CUSTOM_ID: 25a7ba1c-ddf3-47f1-9516-914a552e7a36
+    :ID:       095be13e-f98c-4f42-9353-08329fa47d06
+    :DRILL_LAST_INTERVAL: 71.5839
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.75
+    :DRILL_EASE: 4.85
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
+    :END:
+jump-to-register
+    [
+#+begin_src emacs-lisp
+
+    (global-set-key (kbd "C-k") 'jump-to-register)
+#+end_src
+    ]
+*** [M-k]                                                             :drill:
+SCHEDULED: <2014-03-15 Sat>
+    :PROPERTIES:
+    next-error
+    :ID:       c9f19dcc-4c14-4bdd-b350-c426dff14189
+    :CUSTOM_ID: a96691bb-9e4c-414b-a093-d9961d453e21
+    :DRILL_LAST_INTERVAL: 24.4352
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 3.75
+    :DRILL_EASE: 2.929
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:40>
+    :END:
+next-error
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "M-k") 'next-error)
+#+end_src
+    ]
+*** [C-M-k]                                                           :drill:
+SCHEDULED: <2014-03-21 Fri>
+:PROPERTIES:
+man
+:CUSTOM_ID: f61ea4ea-4597-422e-b7e3-d3cfad82603d
+:ID:       4c874a82-22dd-4bc2-a0ac-24420c30b888
+:DRILL_LAST_INTERVAL: 29.8228
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 4.25
+:DRILL_EASE: 3.589
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:46>
+:END:
+man
+[
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-M-k") 'man)
+#+end_src
+]
+*** C-S-k
+:PROPERTIES:
+:CUSTOM_ID: da51b99a-1782-45ad-92be-f4c0a645bea8
+:END:
+*** [C-l]                                                             :drill:
+SCHEDULED: <2014-05-13 Tue>
+    :PROPERTIES:
+    ido-switch-buffer
+    :ID:       3c7fabd9-572d-4945-ab4b-d7a8dc2cd9c5
+    :CUSTOM_ID: 8a7572bd-4b5e-4464-b937-3d35adb1783f
+    :DRILL_LAST_INTERVAL: 71.5839
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.75
+    :DRILL_EASE: 4.85
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
+    :END:
+ido-switch-buffer
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-l") 'ido-switch-buffer)
+#+end_src
+    ]
+*** M-l
+:PROPERTIES:
+:CUSTOM_ID: 27f47c6c-36ad-430e-b4b0-5e96b635bf36
+:END:
+
+*** [C-M-l]                                                           :drill:
+SCHEDULED: <2014-04-04 Fri>
+    :PROPERTIES:
+    move cursor top bottom mid
+    :ID:       37a3ccad-9b61-44b0-bddb-219a024cd963
+    :CUSTOM_ID: 24b660d4-3ec4-4416-8a6a-b8224ed1ee8b
+    :DRILL_LAST_INTERVAL: 25.8141
+    :DRILL_REPEATS_SINCE_FAIL: 5
+    :DRILL_TOTAL_REPEATS: 5
+    :DRILL_FAILURE_COUNT: 1
+    :DRILL_AVERAGE_QUALITY: 3.0
+    :DRILL_EASE: 2.456
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
+    :END:
+move cursor top bottom mid, comint clear screen
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-M-l") 'move-to-window-line-top-bottom)
+#+end_src
+    ]
+*** C-S-l
+:PROPERTIES:
+:CUSTOM_ID: c355178f-c9b4-4ae7-9627-b4117fef45b9
+:END:
+*** [C-;]                                                             :drill:
+SCHEDULED: <2014-03-19 Wed>
+    :PROPERTIES:
+    comment-dwim
+    :CUSTOM_ID: 7e3710eb-5460-4460-8bf0-488302e4ce35
+    :ID:       1c1b7a4a-484b-4faf-ae20-65d096ff2574
+    :DRILL_LAST_INTERVAL: 27.9041
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.0
+    :DRILL_EASE: 3.204
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:45>
+    :END:
+comment-dwim
+    [
+#+begin_src emacs-lisp
+  (global-set-key (kbd "C-;") 'comment-dwim)
+  (add-hook 'flyspell-mode-hook
+            (lambda () (define-key flyspell-mode-map (kbd "C-;") nil)))
+#+end_src
+]
+*** M-;
+:PROPERTIES:
+:CUSTOM_ID: 211e76d9-d89a-4cc6-abce-69397d456fda
+:END:
+*** [C-M-;]                                                           :drill:
+SCHEDULED: <2014-04-07 Mon>
+    :PROPERTIES:
+    comment-current-line-dwim
+    :ID:       9ff312cc-f460-4f5d-9e4b-37f7ed538209
+    :CUSTOM_ID: 28680a96-5223-4632-80b9-b1facdd541e7
+    :DRILL_LAST_INTERVAL: 42.8284
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.5
+    :DRILL_EASE: 4.122
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:51>
+    :END:
+comment-current-line-dwim
+    [
+#+begin_src emacs-lisp
+  (defun comment-current-line-dwim ()
+    "Comment or uncomment the current line."
+    (interactive)
+    (save-excursion
+      (push-mark (beginning-of-line) t t)
+      (end-of-line)
+      (comment-dwim nil))
+    (move-beginning-of-line 2))
+  (global-set-key (kbd "C-M-;") 'comment-current-line-dwim)
+#+end_src
+    ]
+*** C-S-;
+:PROPERTIES:
+:CUSTOM_ID: c9f00d6c-f9d2-420f-a08e-21ea78023066
+:END:
+*** [C-m]
+:PROPERTIES:
+:CUSTOM_ID: deee53ba-dfa2-4910-894c-55ae98d11aa4
+:END:
+*** M-m
+:PROPERTIES:
+:CUSTOM_ID: f7237459-96b6-4de9-937f-5fbfa9ca5b1e
+:END:
+*** [C-M-m]                                                           :drill:
+SCHEDULED: <2014-03-11 Tue>
+    :PROPERTIES:
+    recursive grep
+    :CUSTOM_ID: f283f705-cba0-45db-b80f-5d20415b2eee
+    :ID:       b952fa90-b492-4f85-9d8e-5cd24c060b94
+    :DRILL_LAST_INTERVAL: 9.1491
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 7
+    :DRILL_FAILURE_COUNT: 3
+    :DRILL_AVERAGE_QUALITY: 2.924
+    :DRILL_EASE: 2.42
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:05>
+    :END:
+recursive grep
+    [
+#+begin_src emacs-lisp
+  (define-key global-map (kbd "C-M-m") 'rgrep)
+#+end_src
+]
+*** C-S-m
+:PROPERTIES:
+:CUSTOM_ID: dd3136a5-5383-4fc7-8c9f-fcbaba251a76
+:END:
+*** [C-,]                                                             :drill:
+SCHEDULED: <2014-05-13 Tue>
+    :PROPERTIES:
+    ido-find-file
+    :CUSTOM_ID: 6cbf3a85-f260-453a-920b-850ff5e986b1
+    :ID:       df0f3769-bcfc-4cb9-8943-bb86dafb2711
+    :DRILL_LAST_INTERVAL: 71.5839
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.75
+    :DRILL_EASE: 4.85
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
+    :END:
+ido-find-file
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-,") 'ido-find-file)
+(add-hook 'flyspell-mode-hook
+            (lambda () (define-key flyspell-mode-map (kbd "C-,") nil)))
+#+end_src
+    ]
+*** M-,
+*** [C-M-,]                                                           :drill:
+SCHEDULED: <2014-03-19 Wed>
+:PROPERTIES:
+find-file-in-project
+:ID:       fca85295-0567-4443-ac74-a54b93a2e603
+:CUSTOM_ID: bfdf6111-029d-462b-bcca-50a3ed2162d5
+:DRILL_LAST_INTERVAL: 24.3844
+:DRILL_REPEATS_SINCE_FAIL: 5
+:DRILL_TOTAL_REPEATS: 5
+:DRILL_FAILURE_COUNT: 2
+:DRILL_AVERAGE_QUALITY: 3.0
+:DRILL_EASE: 2.456
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:51>
+:END:
+find-file-in-project
+[
+    #+begin_src emacs-lisp
+    (global-set-key (kbd "C-M-,") 'find-file-in-project)
+#+end_src
+ ]
+*** C-S-,
+:PROPERTIES:
+:CUSTOM_ID: 74a86b9e-9a56-4f5e-a6eb-9f2cd09da613
+:END:
+*** [C-.]                                                             :drill:
+SCHEDULED: <2014-03-27 Thu>
+    :PROPERTIES:
+    recentf-ido-find-file
+    :CUSTOM_ID: 0675c171-8677-44a8-882c-e7ed42715e31
+    :ID:       a600d171-1964-4a81-a39e-cfac4716f96d
+    :DRILL_LAST_INTERVAL: 50.6823
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 3
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 5.0
+    :DRILL_EASE: 5.815
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:41>
+    :END:
+find recent file
+    [
+Taken from starter kit.
+#+begin_src emacs-lisp
+  (defun recentf-ido-find-file ()
+    "Find a recent file using Ido."
+    (interactive)
+    (let* ((file-assoc-list
+            (mapcar (lambda (x)
+                      (cons (file-name-nondirectory x)
+                            x))
+                    recentf-list))
+           (filename-list
+            (remove-duplicates (mapcar #'car file-assoc-list)
+                               :test #'string=))
+           (filename (ido-completing-read "Choose recent file: "
+                                          filename-list
+                                          nil
+                                          t)))
+      (when filename
+        (find-file (cdr (assoc filename
+                               file-assoc-list))))))
+
+ (add-hook 'flyspell-mode-hook
+            (lambda () (define-key flyspell-mode-map (kbd "C-.") nil)))
+    (define-key dot-mode-map (kbd "C-.") nil)
+    (global-set-key (kbd "C-.") 'recentf-ido-find-file)
+ (add-hook 'php-mode-hook
+            (lambda () (define-key php-mode-map (kbd "C-.") nil)))
+#+end_src
+]
+*** M-.
+*** C-M-.
+:PROPERTIES:
+:CUSTOM_ID: 824d422c-67b6-4d68-af11-6a2135e528f5
+:END:
+-
+[
+#+begin_src emacs-lisp
+  (define-key dot-mode-map (kbd "C-M-.") nil)
+;;  (global-set-key (kbd "C-M-.") 'execute-extended-command)
+#+end_src
+    ]
+*** C-S-.
+:PROPERTIES:
+:CUSTOM_ID: 346effe7-027b-4c4a-a236-3bc6ef541a0c
+:END:
+*** [C-/]                                                             :drill:
+:PROPERTIES:
+:CUSTOM_ID: 941a7fa8-84b9-434d-89a0-1487385ec479
+:ID:       1bf4af8d-58bb-4b58-af60-2ed87f32f4eb
+:END:
+join lines
+    [
+#+begin_src emacs-lisp
+  (defun vim-style-join-line ()
+    (interactive)
+    (join-line '(4)))
+  (global-set-key (kbd "C-/") 'vim-style-join-line)
+(define-key undo-tree-map (kbd "C-/") nil)
+#+end_src
+    ]
+*** M-/
+:PROPERTIES:
+:CUSTOM_ID: f65acefa-7e11-438e-a59c-42a9c7c71607
+:END:
+*** [C-M-/]                                                           :drill:
+:PROPERTIES:
+:CUSTOM_ID: 37f67593-4f60-4d3b-9aad-6c9bc4882443
+:ID:       c41dd5ab-619f-40fe-9471-9ba59d0fef46
+:END:
+copy-variable
+[
+#+begin_src emacs-lisp
+(defun copy-variable (variable)
+  (interactive
+   (let ((v (variable-at-point))
+        (enable-recursive-minibuffers t)
+        val)
+     (setq val (completing-read (if (symbolp v)
+                                   (format
+                                    "Describe variable (default %s): " v)
+                                 "Describe variable: ")
+                               obarray
+                               (lambda (vv)
+                                  (or (get vv 'variable-documentation)
+                                      (and (boundp vv) (not (keywordp vv)))))
+                               t nil nil
+                               (if (symbolp v) (symbol-name v))))
+     (list (if (equal val "")
+              v (intern val)))))
+  (kill-new (symbol-value variable)))
+(global-set-key (kbd "C-M-/") 'copy-variable)
+
+#+end_src
+]
+*** C-S-/
+:PROPERTIES:
+:CUSTOM_ID: ff612b05-8a3f-4599-a95b-f8af19b71b47
+:END:
+*** [C-8]                                                             :drill:
+SCHEDULED: <2014-03-13 Thu>
+:PROPERTIES:
+calc-embedded-word
+:CUSTOM_ID: 251c4a1a-a683-4804-a706-d0d3752e42fa
+:ID:       8084cd41-1833-4e16-ac01-60a5738d0bf3
+:DRILL_LAST_INTERVAL: 22.2211
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 1
+:DRILL_AVERAGE_QUALITY: 3.5
+:DRILL_EASE: 2.73
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:35>
+:END:
+calc-embedded-word
+[
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-8") 'calc-embedded-word)
+#+end_src
+]
+*** M-8
+:PROPERTIES:
+:CUSTOM_ID: 34f4f850-c3e4-4724-aabc-08eee19f034a
+:END:
+*** C-M-8
+:PROPERTIES:
+:CUSTOM_ID: 52191c76-756e-4dcc-87a5-2b84c550db5f
+:END:
+*** C-S-8
+:PROPERTIES:
+:CUSTOM_ID: 3f677c1a-7011-467e-ae4c-4b944807376b
+:END:
+*** [C-up-arrow]                                                      :drill:
+SCHEDULED: <2014-03-14 Fri>
+    :PROPERTIES:
+    back defun/headline
+    :CUSTOM_ID: f47d312a-063d-42ed-a352-176298a2cb0c
+    :ID:       93fe8dac-4206-4131-9264-3411e6467b01
+    :DRILL_LAST_INTERVAL: 23.4066
+    :DRILL_REPEATS_SINCE_FAIL: 5
+    :DRILL_TOTAL_REPEATS: 5
+    :DRILL_FAILURE_COUNT: 3
+    :DRILL_AVERAGE_QUALITY: 3.2
+    :DRILL_EASE: 2.554
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 18:04>
+    :END:
+org prev headline
+    [
+#+begin_src emacs-lisp
+  (define-key undo-tree-map "\C-_" nil)
+;; disabled just because i don't want to accidentally hit it
+  (define-key global-map "\C-_" nil)
+    (global-set-key (kbd "<C-_>") 'beginning-of-defun)
+
+    (add-hook 'org-mode-hook
+            (lambda ()
+              (define-key org-mode-map (kbd "\C-_") 'outline-previous-visible-heading)))
+
+#+end_src
+
+
+]
+*** M-up-arrow
+:PROPERTIES:
+:CUSTOM_ID: 30f87801-2c2d-4722-9348-fb38ea6c09b0
+:END:
+*** C-M-up-arrow
+*** C-S-up-arrow        :drill:
+winner undo
+    [
+#+begin_src emacs-lisp
+  (global-set-key (kbd "<C-S-_>") 'winner-undo)
+#+end_src
+    ]
+*** [C-down-arrow]                                                    :drill:
+SCHEDULED: <2014-03-13 Thu>
+    :PROPERTIES:
+    forward dfun/headline
+    :CUSTOM_ID: 27435136-b3d7-4f25-aa85-2a7363a7f366
+    :ID:       da405d83-b0af-4778-9703-a3f109a1233d
+    :DRILL_LAST_INTERVAL: 10.7692
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 6
+    :DRILL_FAILURE_COUNT: 1
+    :DRILL_AVERAGE_QUALITY: 3.167
+    :DRILL_EASE: 2.537
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:09>
+    :END:
+org next headline
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "<C-kp-enter>") 'end-of-defun)
+
+    (add-hook 'org-mode-hook
+            (lambda ()
+              (define-key org-mode-map (kbd "<C-kp-enter>") 'outline-next-visible-heading)))
+
+#+end_src
+
+
+    ]
+*** M-down-arrow
+*** [C-M-down-arrow]                                                  :drill:
+SCHEDULED: <2014-03-20 Thu>
+:PROPERTIES:
+toggle-mark-activation
+:ID:       c57f3bab-8ea1-423d-b759-e1ec2586753c
+:CUSTOM_ID: 3bcb35fd-6d54-4213-b94f-2739c0bc0041
+:DRILL_LAST_INTERVAL: 17.6506
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 7
+:DRILL_FAILURE_COUNT: 4
+:DRILL_AVERAGE_QUALITY: 3.661
+:DRILL_EASE: 2.851
+:DRILL_LAST_QUALITY: 5
+:DRILL_LAST_REVIEWED: <2014-03-02 Sun 21:10>
+:END:
+toggle-mark-activation
+[
+#+begin_src emacs-lisp
+  (defun toggle-mark-activation ()
+    (interactive)
+    (if mark-active
+        (deactivate-mark t)
+      (activate-mark)))
+
+  (global-set-key (kbd "<C-M-kp-enter>") 'toggle-mark-activation)
+#+end_src
+]
+winner redo
+    [
+#+begin_src emacs-lisp
+  (global-set-key (kbd "<C-S-kp-enter>") 'winner-redo)
+#+end_src
+    ]
+
+*** [C-S-down-arrow]                                                             :drill:
+SCHEDULED: <2014-03-19 Wed>
+    :PROPERTIES:
+    smex-major-mode-commands
+    :CUSTOM_ID: 1434bdd0-c5a8-4c96-9b92-9474e88fd1c5
+    :ID:       1e992e46-ec69-416c-b7d7-7c87da109b43
+    :DRILL_LAST_INTERVAL: 24.3844
+    :DRILL_REPEATS_SINCE_FAIL: 5
+    :DRILL_TOTAL_REPEATS: 5
+    :DRILL_FAILURE_COUNT: 2
+    :DRILL_AVERAGE_QUALITY: 3.0
+    :DRILL_EASE: 2.456
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-02-23 Sun 02:28>
+    :END:
+m-x for major mode
+    [
+    #+begin_src emacs-lisp
+  (global-set-key (kbd "<C-S-kp-enter>") 'smex-major-mode-commands)
+#+end_src
+]
+*** C-lbracket
+:PROPERTIES:
+:CUSTOM_ID: 9d9916dd-3280-47dd-aab1-cd28d5ebfe15
+:END:
+----
+*** M-lbracket
+*** [C-M-lbracket]                                                    :drill:
+SCHEDULED: <2014-03-15 Sat>
+:PROPERTIES:
+scroll-right
+:CUSTOM_ID: 7411b1a5-c8fa-4bcc-8788-798e5635dd62
+:ID:       0bf13532-1df9-4eb3-953c-10901f2a5da5
+:DRILL_LAST_INTERVAL: 23.5247
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 3.5
+:DRILL_EASE: 2.73
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:25>
+:END:
+scroll-right
+[
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-M-[") 'scroll-right)
+    #+end_src
+]
+*** C-S-lbracket
+*** [C-rbracket]
+:PROPERTIES:
+:CUSTOM_ID: 21b38c6b-3a46-4a08-8eca-d44abb148287
+:END:
+fill-paragraph
+#+begin_src emacs-lisp
+  (global-set-key (kbd "C-]") 'fill-paragraph)
+#+end_src
+*** M-rbracket
+*** [C-M-rbracket]                                                    :drill:
+SCHEDULED: <2014-03-15 Sat>
+:PROPERTIES:
+scroll-left
+:CUSTOM_ID: c9c18f48-d0ca-4a1b-a751-7165f40118a3
+:ID:       ff008422-b6f5-4770-9e53-e6acdac90b45
+:DRILL_LAST_INTERVAL: 24.4352
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 3.75
+:DRILL_EASE: 2.929
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:44>
+:END:
+scroll-left
+[
+    #+begin_src emacs-lisp
+    (global-set-key (kbd "C-M-]") 'scroll-left)
+    #+end_src
+]
+*** C-S-rbracket
+:PROPERTIES:
+:CUSTOM_ID: d42245ca-3246-477b-bda9-8776cd668cd1
+:END:
+*** [C-return]                                                        :drill:
+SCHEDULED: <2014-03-12 Wed>
+    :PROPERTIES:
+    newline next line
+    :ID:       20e450f0-6467-40f2-bd1b-b4038693e73f
+    :CUSTOM_ID: baf7ea5a-d16d-4fee-a6ce-542cc11beb97
+    :DRILL_LAST_INTERVAL: 20.7344
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 3.75
+    :DRILL_EASE: 2.928
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:29>
+    :END:
+newline-anywhere
+    [
+#+begin_src emacs-lisp
+(defun newline-anywhere ()
+  "Add a newline from anywhere in the line."
+  (interactive)
+  (end-of-line)
+  (newline-and-indent))
+(global-set-key (kbd "<C-return>") 'newline-anywhere)
+
+#+end_src
+]
+*** [M-return]                                                        :drill:
+SCHEDULED: <2014-03-11 Tue>
+    :PROPERTIES:
+    non-indented newline
+    :ID:       4fc4d372-765e-4e2e-87f4-0a0e1fd93f34
+    :CUSTOM_ID: e6895ad3-a2c8-46c8-abbc-1bba94a88596
+    :DRILL_LAST_INTERVAL: 19.9622
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 3.5
+    :DRILL_EASE: 2.73
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:30>
+    :END:
+plain newline
+    [
+#+begin_src emacs-lisp
+(defun plain-newline ()
+(interactive)
+(insert "\n"))
+(global-set-key (kbd "<M-return>") 'plain-newline)
+#+end_src
+]
+
+*** C-M-return
+:PROPERTIES:
+open newline on previous line
+:CUSTOM_ID: 2a8fc6ea-a550-4437-9e35-3b3f2776788a
+:END:
+[
+#+begin_src emacs-lisp
+(defun newline-anywhere-previous ()
+  "Add a newline from anywhere in the line."
+  (interactive)
+  (forward-line -1)
+  (end-of-line)
+  (newline-and-indent))
+(global-set-key (kbd "<C-M-return>") 'newline-anywhere-previous)
+#+end_src
+]
+*** C-S-return
+:PROPERTIES:
+:CUSTOM_ID: 787cc59e-ce0f-4291-a9d5-fd4e14b0b83b
+:END:
+*** [C-space]                                                         :drill:
+SCHEDULED: <2014-03-18 Tue>
+:PROPERTIES:
+org-edit-special
+:CUSTOM_ID: 132daa1a-8e5f-47f1-a28d-35bee873aeac
+:ID:       3204f2ca-10b2-469b-8b70-fb660e35478a
+:DRILL_LAST_INTERVAL: 41.7787
+:DRILL_REPEATS_SINCE_FAIL: 3
+:DRILL_TOTAL_REPEATS: 3
+:DRILL_FAILURE_COUNT: 0
+:DRILL_AVERAGE_QUALITY: 4.667
+:DRILL_EASE: 4.583
+:DRILL_LAST_QUALITY: 4
+:DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:44>
+:END:
+org-edit-special
+[
+#+begin_src emacs-lisp
+;; (kbd "<C-space>") does not work, (kbd "C-SPC") should work
+(add-hook 'org-mode-hook
+          (lambda ()
+            (define-key org-mode-map (kbd "C-SPC") 'org-edit-special)
+            (define-key org-src-mode-map (kbd "C-SPC") 'org-edit-src-exit)))
+#+end_src
+]
+*** M-space
+:PROPERTIES:
+:CUSTOM_ID: bbffb12e-03f2-4a26-a9e4-fd263ad6b518
+:END:
+*** C-M-space
+:PROPERTIES:
+spell check word
+:CUSTOM_ID: 02359b66-bf6e-4f41-9f03-e83fcbe3e68c
+:END:
+    [
+    before or under cursor
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-M-SPC") 'ispell-word)
+#+end_src
+    ]
+*** C-S-space
+:PROPERTIES:
+:CUSTOM_ID: a28e904f-f2bd-48d3-9718-af3f541e611e
+:END:
+** left secondary
+*** C-=
+:PROPERTIES:
+:CUSTOM_ID: 6b01dcdd-d1c1-4e3f-9e28-9c3574682f95
+:END:
+*** M-=
+:PROPERTIES:
+:CUSTOM_ID: 6a63486f-ea5b-4ece-a535-5277022e0cde
+:END:
+*** C-M-=
+:PROPERTIES:
+:CUSTOM_ID: 1e245ef6-5bdb-4f99-b8e2-f5d45a7c0847
+:END:
+*** C-S-=
+:PROPERTIES:
+:CUSTOM_ID: 0f9aa2b8-83c7-433c-80e0-f90ee802365f
+:END:
+*** C-1
+:PROPERTIES:
+:CUSTOM_ID: 06374c1c-025b-47c2-90b2-82f37031093b
+:END:
+*** M-1
+:PROPERTIES:
+:CUSTOM_ID: 51810ebd-52f3-4e68-9434-e2347a834787
+:END:
+*** C-M-1
+:PROPERTIES:
+:CUSTOM_ID: 9207526f-a925-4ecc-bd30-98cbd580d67a
+:END:
+*** C-S-1
+:PROPERTIES:
+:CUSTOM_ID: 58a7a929-50b5-4393-9b08-59ad2039b263
+:END:
+*** C-4
+:PROPERTIES:
+:CUSTOM_ID: 24a0c3c4-bce7-4a94-8a31-e5259387c573
+:END:
+*** M-4
+:PROPERTIES:
+:CUSTOM_ID: 2d4fa927-2140-424b-9990-e8f2c3424e57
+:END:
+*** C-M-4                                                             :drill:
+widen
+[
+:PROPERTIES:
+:CUSTOM_ID: 3ff50f5f-f286-4a73-962b-58dbcf3b09b1
+:ID:       addc832b-5547-4d45-a1f5-3e9283920612
+:END:
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-M-4") 'widen)
+#+end_src
+]
+*** C-S-4
+:PROPERTIES:
+:CUSTOM_ID: ba9ed568-7ba1-4283-b4c7-57fcb9a5a477
+:END:
+*** C-5
+:PROPERTIES:
+:CUSTOM_ID: 83bc2d8a-a225-4b6f-ab98-f47aa6d1e73f
+:END:
+*** M-5
+:PROPERTIES:
+:CUSTOM_ID: 1b8f04c3-91b5-43cd-8a1a-94c8105eff24
+:END:
+*** C-M-5
+:PROPERTIES:
+:CUSTOM_ID: fab28de6-7fe4-45d7-a856-5d29a9085f5d
+:END:
+*** C-S-5
+:PROPERTIES:
+:CUSTOM_ID: b22cdf04-bc77-493b-a65c-5992befc1a62
+:END:
+*** [C-tab-key]                                                       :drill:
+SCHEDULED: <2014-03-12 Wed>
+:PROPERTIES:
+query-replace
+:CUSTOM_ID: 68313551-90cd-47a6-8170-1745348add17
+:ID:       5b315ca6-c623-4b23-bef3-31b325591d01
+:DRILL_LAST_INTERVAL: 20.9905
+:DRILL_REPEATS_SINCE_FAIL: 4
+:DRILL_TOTAL_REPEATS: 4
+:DRILL_FAILURE_COUNT: 2
+:DRILL_AVERAGE_QUALITY: 3.5
+:DRILL_EASE: 2.73
+:DRILL_LAST_QUALITY: 3
+:DRILL_LAST_REVIEWED: <2014-02-19 Wed 16:32>
+:END:
+query-replace
+[
+#+begin_src emacs-lisp
+
+  (global-set-key (kbd "<C-kp-add>") 'query-replace)
+#+end_src
+]
+*** M-tab-key
+*** C-M-tab-key
+*** C-S-tab-key
+*** [C-t]                                                             :drill:
+SCHEDULED: <2014-03-24 Mon>
+    :PROPERTIES:
+    org change todo state
+    :ID:       b9a6ec32-9b64-403f-be09-73769f778d1f
+    :CUSTOM_ID: aaac3048-9125-4fd5-b8f2-21bafcc1ff1c
+    :DRILL_LAST_INTERVAL: 32.7466
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.0
+    :DRILL_EASE: 3.204
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:53>
+    :END:
+org cycle todo / toggle comint motion
+    [
+#+begin_src emacs-lisp
+(add-hook 'org-mode-hook
+          (lambda ()
+            (define-key org-mode-map (kbd "C-t") 'org-todo)))
+
+(defun my-comint-previous-input (arg)
+  (interactive "*p")
+  (if (comint-after-pmark-p)
+      (comint-previous-input arg)
+    (forward-line -1)))
+
+(defun my-comint-next-input (arg)
+  (interactive "*p")
+  (if (comint-after-pmark-p)
+      (comint-next-input arg)
+    (forward-line)))
+
+(add-hook 'comint-mode-hook
+          (lambda ()
+            (define-key comint-mode-map (kbd "C-t") 'comint-toggle-arrow-keys)
+            (define-key comint-mode-map (kbd "<up>") 'my-comint-previous-input)
+            (define-key comint-mode-map (kbd "<down>") 'my-comint-next-input)))
+
+
+(defun comint-toggle-arrow-keys ()
+  (interactive)
+  (toggle-arrow-keys comint-mode-map))
+
+(setq-default comint-arrow-movement nil)
+(defun toggle-arrow-keys (map)
+  (cond ((lookup-key map (kbd "<up>"))
+         (setq-local comint-arrow-movement t)
+         (define-key map (kbd "<up>") nil)
+         (define-key map (kbd "<down>") nil))
+        (t
+         (setq-local comint-arrow-movement nil)
+         (define-key map (kbd "<up>") 'my-comint-previous-input)
+         (define-key map (kbd "<down>") 'my-comint-next-input)
+         (goto-char (point-max)))))
+
+(defun ian-sign-email ()
+  (interactive)
+  (insert "Ian Kelling
+https://iankelling.org"))
+
+(eval-after-load "message"
+  '(define-key message-mode-map (kbd "C-t") 'ian-sign-email))
+#+end_src
+Thanks for the update. I will be enjoying it.
+
+#+RESULTS:
+: comint-toggle-arrow-keys
+    ]
+*** M-t
+:PROPERTIES:
+:CUSTOM_ID: 4542dc3a-d876-4726-8c8e-61c7c9cecd64
+:END:
+*** [C-M-t]                                                           :drill:
+SCHEDULED: <2014-03-15 Sat>
+    :PROPERTIES:
+    org insert timestamp
+    :ID:       ed43d561-cf73-4123-8cf2-12e184f99e0f
+    :CUSTOM_ID: 5bc609b1-9428-4b82-a55d-811fefe65331
+    :DRILL_LAST_INTERVAL: 23.5247
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 3.5
+    :DRILL_EASE: 2.73
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-02-19 Wed 17:41>
+    :END:
+org timestamp
+    [
+#+begin_src emacs-lisp
+(global-set-key (kbd "C-M-t") 'org-time-stamp-with-time)
+#+end_src
+]
+*** C-S-t
+:PROPERTIES:
+:CUSTOM_ID: 6a6fcd06-5822-4a3d-8e2e-1fc0f64357b2
+:END:
+*** C-home
+:PROPERTIES:
+:CUSTOM_ID: 1919659a-b466-4519-9276-8bf06a916066
+:END:
+start of buffer
+*** M-home
+:PROPERTIES:
+:CUSTOM_ID: 29a3b536-201d-4499-b131-afe58e6f45b4
+:END:
+*** C-M-home
+:PROPERTIES:
+:CUSTOM_ID: d9df9b43-357a-43e1-bb1c-47d61f095738
+:END:
+*** C-S-home
+:PROPERTIES:
+:CUSTOM_ID: a91ee772-a59c-4083-a65c-6f9b294b517c
+:END:
+*** C-end
+:PROPERTIES:
+:CUSTOM_ID: 0a7bd629-cbcc-4761-8fe2-cc9370b985a4
+:END:
+end of buffer
+*** M-end
+:PROPERTIES:
+:CUSTOM_ID: 1c215db5-a50c-4718-868a-871d69acf117
+:END:
+*** C-M-end
+:PROPERTIES:
+:CUSTOM_ID: cf2df317-a0b1-41e6-9919-67e77bb796f8
+:END:
+*** C-S-end
+:PROPERTIES:
+:CUSTOM_ID: a4721bb0-9cbc-4f3c-b292-645d5121c839
+:END:
+*** C-f9
+:PROPERTIES:
+:CUSTOM_ID: 014536d9-68e3-46f5-9594-e74fe64f4d9e
+:END:
+*** M-f9
+:PROPERTIES:
+:CUSTOM_ID: 6dee0f1b-3680-4a72-8a80-e31b9c7c219d
+:END:
+*** C-M-f9
+:PROPERTIES:
+:CUSTOM_ID: f5e835dd-e2b8-42eb-b7f1-9ec76c7dfcb8
+:END:
+*** C-S-f9
+:PROPERTIES:
+:CUSTOM_ID: c3aba493-9e85-40b7-989d-7e17ba2b55a7
+:END:
+** right secondary
+*** C-6
+:PROPERTIES:
+:CUSTOM_ID: e44e584b-d925-4036-9ad5-a90d02e74bef
+:END:
+save-buffers-kill-emacs
+[
+#+begin_src emacs-lisp
+(global-set-key (kbd "C-6") 'save-buffers-kill-emacs)
+#+end_src
+]
+*** M-6
+*** [C-M-6]                                                           :drill:
+:PROPERTIES:
+:CUSTOM_ID: da73de75-0914-4f48-81d5-9b408433b14b
+:ID:       bcf78e2e-810e-4a6d-9056-bd488aaa373b
+:END:
+  insert-small-copyright
+[
+#+begin_src emacs-lisp
+(defun insert-small-copyright ()
+    (interactive)
+    (beginning-of-line)
+    (let ((beg (point)))
+      (insert "Copyright (C) 2016 Ian Kelling\nThis program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>")
+      (comment-region beg (point))))
+
+  (global-set-key (kbd "C-M-6") 'insert-small-copyright)
+#+end_src
+]
+*** C-S-6
+*** C-7
+*** M-7
+*** [C-M-7]              :drill:
+:PROPERTIES:
+:CUSTOM_ID: a68c6b8e-9911-475e-ab35-e239771fe881
+:ID:       ae9704b8-1492-4dc0-806a-dd3407526733
+:END:
+insert-full-copyright
+[
+#+begin_src emacs-lisp
+(defun insert-full-copyright ()
+  (interactive)
+  (beginning-of-line)
+  (let ((beg (point)))
+    (insert "Copyright (C) 2016 Ian Kelling\n")
+    (insert "\n")
+    (insert "This program is free software: you can redistribute it and/or modify\n")
+    (insert "it under the terms of the GNU General Public License as published by\n")
+    (insert "the Free Software Foundation, either version 3 of the License, or\n")
+    (insert "(at your option) any later version.\n")
+    (insert "\n")
+    (insert "This program is distributed in the hope that it will be useful,\n")
+    (insert "but WITHOUT ANY WARRANTY; without even the implied warranty of\n")
+    (insert "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n")
+    (insert "GNU General Public License for more details.\n")
+    (insert "\n")
+    (insert "You should have received a copy of the GNU General Public License\n")
+    (insert "along with this program.  If not, see <http://www.gnu.org/licenses/>.\n")
+    (comment-region beg (point))))
+
+(global-set-key (kbd "C-M-7") 'insert-full-copyright)
+
+#+end_src
+]
+*** C-S-7
+:PROPERTIES:
+:CUSTOM_ID: 05f5737b-a320-403c-a8f1-fa0a02f679e1
+:END:
+*** C-0
+:PROPERTIES:
+:CUSTOM_ID: 96ae2fcc-3a0c-40c4-aef8-06aff3fd42be
+:END:
+text-scale-reset
+[
+#+begin_src emacs-lisp
+(defun text-scale-reset ()
+  (interactive)
+  (text-scale-set 0))
+(global-set-key (kbd "C-0") 'text-scale-reset)
+#+end_src
+]
+*** M-0
+:PROPERTIES:
+:CUSTOM_ID: c5735fdf-d0d9-468c-917c-3936e409a2bc
+:END:
+*** C-M-0
+:PROPERTIES:
+:CUSTOM_ID: 0e7f83a5-600e-4016-af98-95904300c016
+:END:
+*** C-S-0
+:PROPERTIES:
+:CUSTOM_ID: d1706bc7-7cf0-4b49-87d0-15bf76eaca5f
+:END:
+*** C--
+:PROPERTIES:
+:CUSTOM_ID: 3713b701-b31a-4612-b663-f232005b4122
+:END:
+*** M--
+:PROPERTIES:
+:CUSTOM_ID: ca833b78-b279-4d1f-b1c9-6c70fdf20f57
+:END:
+*** C-M--
+:PROPERTIES:
+:CUSTOM_ID: 6febc7ea-9cc7-488c-af34-538b8e69633b
+:END:
+*** C-S--
+:PROPERTIES:
+:CUSTOM_ID: c73af1d7-61f2-4c1b-935e-43f077d8d915
+:END:
+*** [C-y]                                                             :drill:
+SCHEDULED: <2014-03-27 Thu>
+    :PROPERTIES:
+    :ID:       4c0f74f8-04ed-40d8-8ec3-6e2bed03c2b9
+    :CUSTOM_ID: 97aee7f1-3647-4602-a65a-45e8a3aa3a7c
+    :DRILL_LAST_INTERVAL: 50.6823
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 3
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 5.0
+    :DRILL_EASE: 5.815
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-04 Tue 11:45>
+    :END:
+    undo-tree-redo
+    [
+#+begin_src emacs-lisp
+  (global-set-key (kbd "C-y") 'undo-tree-redo)
+#+end_src
+
+    ]
+*** M-y
+:PROPERTIES:
+:CUSTOM_ID: 35072ca8-7fd6-4a64-bc7a-2636de575bd1
+:END:
+*** C-M-y
+*** C-S-y
+:PROPERTIES:
+:CUSTOM_ID: 964fa784-37e3-48c6-af4b-c7e91f67a93a
+:END:
+*** C-\
+    :PROPERTIES:
+    sr-speedbar-toggle
+    :CUSTOM_ID: b8ad3ee9-7bf6-4069-a300-49cd298008a7
+    :END:
+    [
+#+begin_src emacs-lisp
+  (global-set-key (kbd "C-\\") 'sr-speedbar-toggle)
+#+end_src
+    ]
+*** M-\
+:PROPERTIES:
+:CUSTOM_ID: c1d53d84-b8a9-49cb-bfd6-4420931c8873
+:END:
+*** [C-M-\]                                                           :drill:
+SCHEDULED: <2014-03-21 Fri>
+    :PROPERTIES:
+    mark-defun
+    :ID:       d45bce17-45bc-41f0-8994-aa7bc3b2fa92
+    :CUSTOM_ID: 6a583354-48f8-4503-bf87-b8ba56411435
+    :DRILL_LAST_INTERVAL: 11.7003
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 9
+    :DRILL_FAILURE_COUNT: 6
+    :DRILL_AVERAGE_QUALITY: 2.815
+    :DRILL_EASE: 2.369
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:36>
+    :END:
+mark-defun
+    [
+#+begin_src emacs-lisp
+  (global-set-key (kbd "C-M-\\") 'mark-defun)
+#+end_src
+    ]
+*** C-S-\
+:PROPERTIES:
+:CUSTOM_ID: 30edfb48-852f-4f2c-ba38-2635927d4950
+:END:
+*** C-h
+:PROPERTIES:
+:CUSTOM_ID: 3c5f241f-fc62-459d-ab85-6b7c1fb04801
+:END:
+help-prefix
+
+*** M-h
+:PROPERTIES:
+:CUSTOM_ID: 6df13b90-490b-4cca-a49d-4f2e3ce5bea3
+:END:
+*** C-M-h
+:PROPERTIES:
+:CUSTOM_ID: 47f0d1f3-78ea-49d7-a6d7-06627ca745bd
+:END:
+*** C-S-h
+:PROPERTIES:
+:CUSTOM_ID: 3be3db5c-9905-474b-b773-1aee515625f5
+:END:
+*** C-'
+:PROPERTIES:
+:CUSTOM_ID: 9f252721-a2d5-46c6-b268-8ed597256229
+:END:
+eval-expression
+[
+#+begin_src emacs-lisp
+(global-set-key (kbd "C-'") 'eval-expression)
+#+end_src
+]
+*** M-'
+:PROPERTIES:
+:CUSTOM_ID: f00b9c88-68bb-4831-872f-afb5ff82c104
+:END:
+*** C-M-'
+:PROPERTIES:
+:CUSTOM_ID: 0d39d36c-115a-4570-b4b1-818718409a49
+:END:
+*** C-S-'
+:PROPERTIES:
+:CUSTOM_ID: 230f50ef-48fd-4f13-aa62-e4a492c4515d
+:END:
+*** [C-n]                                                             :drill:
+SCHEDULED: <2014-04-07 Mon>
+    :PROPERTIES:
+    unpop-to-mark-command
+    :CUSTOM_ID: 52ebb720-589b-485c-89dc-0dfb78e6dad4
+    :ID:       32f1c87d-ee1f-4117-8059-32fd8facbeff
+    :DRILL_LAST_INTERVAL: 42.8284
+    :DRILL_REPEATS_SINCE_FAIL: 4
+    :DRILL_TOTAL_REPEATS: 4
+    :DRILL_FAILURE_COUNT: 0
+    :DRILL_AVERAGE_QUALITY: 4.5
+    :DRILL_EASE: 4.122
+    :DRILL_LAST_QUALITY: 5
+    :DRILL_LAST_REVIEWED: <2014-02-23 Sun 01:51>
+    :END:
+unpop to mark
+    [
+    #+begin_src emacs-lisp
+      (defun unpop-to-mark-command ()
+        "Unpop off mark ring. Does nothing if mark ring is empty."
+        (interactive)
+        (when mark-ring
+          (let ((pos (marker-position (car (last mark-ring)))))
+            (if (not (= (point) pos))
+                (goto-char pos)
+              (setq mark-ring (cons (copy-marker (mark-marker)) mark-ring))
+              (set-marker (mark-marker) pos)
+              (setq mark-ring (nbutlast mark-ring))
+              (goto-char (marker-position (car (last mark-ring))))))))
+
+      (global-set-key (kbd "C-n") 'unpop-to-mark-command)
+#+end_src
+]
+*** M-n
+:PROPERTIES:
+:CUSTOM_ID: 00c2ab64-696d-4492-8236-f7ebc12e4a93
+:END:
+*** [C-M-n]                                                           :drill:
+SCHEDULED: <2014-03-17 Mon>
+    :PROPERTIES:
+    narrow-to-region
+    :ID:       59e48dcc-434b-4c96-bdb3-c083c41ae8b3
+    :CUSTOM_ID: 43997316-8d3f-4750-873b-ade09628fdd5
+    :DRILL_LAST_INTERVAL: 7.6409
+    :DRILL_REPEATS_SINCE_FAIL: 3
+    :DRILL_TOTAL_REPEATS: 8
+    :DRILL_FAILURE_COUNT: 4
+    :DRILL_AVERAGE_QUALITY: 2.59
+    :DRILL_EASE: 2.261
+    :DRILL_LAST_QUALITY: 3
+    :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:34>
+    :END:
+narrow-to-region
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "C-M-n") 'narrow-to-region)
+#+end_src
+]
+*** C-S-n
+:PROPERTIES:
+:CUSTOM_ID: f01c2c61-f606-49ea-885a-63a831eaae3d
+:END:
+*** C-rshift
+*** M-rshift
+*** C-M-rshift
+*** C-S-rshift
+*** [C-escape]                                                        :drill:
+SCHEDULED: <2014-04-05 Sat>
+    :PROPERTIES:
+    find-tag
+    :ID:       a6dd7e4c-1831-4493-bbfd-557dc2f9c856
+    :CUSTOM_ID: 6901fa1b-c827-4525-b24b-bdb8fe5f638b
+    :DRILL_LAST_INTERVAL: 27.3693
+    :DRILL_REPEATS_SINCE_FAIL: 5
+    :DRILL_TOTAL_REPEATS: 6
+    :DRILL_FAILURE_COUNT: 2
+    :DRILL_AVERAGE_QUALITY: 3.417
+    :DRILL_EASE: 2.676
+    :DRILL_LAST_QUALITY: 4
+    :DRILL_LAST_REVIEWED: <2014-03-09 Sun 18:37>
+    :END:
+find-tag
+    [
+#+begin_src emacs-lisp
+    (global-set-key (kbd "<C-escape>") 'find-tag)
+#+end_src
+    ]
+*** M-escape
+    :PROPERTIES:
+    :ID:       7224837b-addc-4c82-8313-467c6dcb7a52
+    :CUSTOM_ID: f505f1b9-82f6-4139-9e3e-78df548175ec
+    :END:
+*** C-M-escape
+:PROPERTIES:
+:CUSTOM_ID: d77136c5-4aec-4f02-8b4b-e417249fbac1
+:END:
+*** C-S-escape
+:PROPERTIES:
+:CUSTOM_ID: d61ae40a-3f2d-4ef6-a515-8864a7d7c8ea
+:END:
+* keybind table src
+  :PROPERTIES:
+  :CUSTOM_ID: ff8f3092-187a-4b2c-940f-01743f7a51b6
+  :END:
+not necessary to have at the end, but its convenient to have it next
+to its output.
+  #+NAME: keybind-table-generator
+#+BEGIN_SRC emacs-lisp :results silent
+  (defun org-custom-id-get (&optional pom create prefix)
+    "Get the CUSTOM_ID property of the entry at point-or-marker POM.
+              If POM is nil, refer to the entry at point.
+              If the entry does not have a CUSTOM_ID, the function returns nil.
+              However, when CREATE is non nil, create an ID if none is present already.
+              PREFIX will be passed through to `org-id-new'.
+              In any case, the CUSTOM_ID of the entry is returned."
+    (org-with-point-at pom
+      (let ((id (org-entry-get nil "CUSTOM_ID")))
+        (cond
+         ((and id (stringp id) (string-match "\\S-" id))
+          id)
+         (create
+          (setq id (org-id-new prefix))
+          (org-entry-put pom "CUSTOM_ID" id)
+          (org-id-add-location id (buffer-file-name (buffer-base-buffer)))
+          id)))))
+
+  (defun get-title()
+    (interactive)
+    (let ((title (plist-get (cadr (org-element-at-point)) ':title)))
+      ;; remove brackets from [title]
+      (string-match "[^[ ][^]]*" title)
+      (setq title (match-string 0 title))
+      (print title)
+      title))
+
+
+  (defun org-dblock-write:keybind-dblock (arg)
+    (let (output)
+      (save-excursion
+        (goto-char (org-find-entry-with-id "beginning-of-keybind-table-data"))
+        (let* ((table-level (org-current-level))
+               (keybind-level (1+ table-level))
+               (prefixes (list "C-M-S-" "C-M-" "C-S-" "M-S-" "M-"  "C-" "S-"))
+               table-title
+               previous-prefixes
+               )
+          (while (>= (org-current-level) table-level)
+            (setq table-title (get-title))
+            (outline-next-heading)
+            (let (found-prefixes
+                  found-all-prefixes)
+              ;; go through the first few elements of the table to find out what column headings aka prefixes it should have
+              (save-excursion
+                (while (not found-all-prefixes)
+                  (let ((prefixes-copy prefixes)
+                        current-prefix
+                        found-prefix)
+                    (while (and prefixes-copy (not found-prefix))
+                      (setq current-prefix (car prefixes-copy))
+                      (when (and (> (length (get-title)) (length current-prefix))
+                                 (string= (substring (get-title) 0 (length current-prefix)) current-prefix))
+                        (setq found-prefix t))
+                      (setq prefixes-copy (cdr prefixes-copy)))
+                    (unless found-prefix
+                      (setq current-prefix ""))
+                    (if (and found-prefixes (string= (car (last found-prefixes)) current-prefix))
+                        (setq found-all-prefixes t)
+                      (push current-prefix found-prefixes)))
+                  (outline-next-heading)))
+              (setq found-prefixes (reverse found-prefixes))
+
+              ;; start a new table or repeat the prefixes in the current table
+
+              (if (or (not previous-prefixes) (equal previous-prefixes found-prefixes))
+                  (setq output (concat output "|-|\n| "))
+                (setq output (concat output "|-|\n\n|-|\n| ")))
+              (setq output (concat output table-title " | "))
+              (setq previous-prefixes found-prefixes)
+
+              ;; add the prefixes
+              (dolist (prefix found-prefixes)
+                (setq output (concat output prefix "|")))
+              (setq output (concat output "\n|-|\n"))
+
+
+              (let (subtree-end)
+                (while (>= (org-current-level) keybind-level)
+                  (dotimes (i (length found-prefixes))
+                    ;; add keybind name
+                    (when (= i 0)
+                      (setq output (concat output "| " (substring (get-title) (length (car found-prefixes))) " | ")))
+                    ;; add keybinds by searching for regex [keybind] to the start of the next heading
+                    (save-excursion
+                      (outline-next-heading)
+                      (setq subtree-end (point)))
+;; skip over scheduled line
+                    (re-search-forward "^SCHEDULED:" subtree-end t)
+
+                    ;; see comment after source block to understand this regex
+                    (re-search-forward "^\\s-*\\([^*: ].*?$\\)" subtree-end t)
+                    (let ((m (match-string 1)))
+                      (when m
+                        (setq output (concat output "[[#" (org-custom-id-get (point) 'create) "][" m "]]")))
+                      (setq output (concat output " | ")))
+                    ;; advance to next keybind
+                    (outline-next-heading))
+                  (setq output (concat output "\n"))
+                  ))))))
+      (setq output (concat output "|-|"))
+      (insert output))
+    (org-table-map-tables 'org-table-align 'quietly))
+
+
+#+END_SRC
+  after source block due to bad parsing of comments in non emacs lisp mode
+      some easily forgotten regex elements. whitespace: \\s-
+      non-greedy star: *?
+      subexpression for close bracket char or nothing: \\(\\]\\|\\)
+
+* keybind tables
+dunno why but it takes doing ctrl-c twice to update this
+  #+BEGIN: keybind-dblock
+|---------------------+------------------------|
+| single/special keys |                        |
+|---------------------+------------------------|
+| tab key             | [[#6c10a716-1d8e-4ce4-8e26-64468f19c17a][isearch]]                |
+| tab                 | [[#51ece189-1840-41a1-8ca0-19f9a0481895][isearch-forward]]        |
+| end                 | [[#00d589b7-2b8e-494c-b761-3afefebe6ec6][move-end-of-line]]       |
+| home                | [[#7800e455-c3f6-4a8f-8907-b2292449ab67][back-to-indentation]]    |
+| s-tab               | [[#3072901e-5cf3-4d6e-9ac8-3ef64a5f6ad2][indent-buffer]]          |
+| s-delete            | [[#e53728b6-054d-4443-a03e-6cf02d13724d][send-shell]]             |
+| s-left arrow        | [[#d8c473ac-5507-4a6b-9e5a-46558c17b09f][shell]]                  |
+| s-right arrow       | [[#2365f5a7-b89a-4a97-b272-ac8ae9c2cc66][previous-buffer]]        |
+| esc                 |                        |
+| return              | [[#fab6adea-ed20-45ab-a0a3-776c68d5c3a5][new line]]               |
+| s-return            | [[#819cfb55-3a2f-4f20-8591-f819d1a6869a][auto-correct-prev-word]] |
+| down arrow          | [[#7a868484-9c63-4a73-abda-7751cb2c02be][mark]]                   |
+| s-down arrow        | [[#097b97e0-8ad8-40f7-8388-c4ace1706b38][extended command]]       |
+| s-up arrow          |                        |
+|---------------------+------------------------|
+
+|-------------------+----------------------------+---------------------------------+--------------------+---------------+-------------------+-------------|
+| mouse             |                            | C-                              | M-                 | S-            | C-M-              | C-S-        |
+|-------------------+----------------------------+---------------------------------+--------------------+---------------+-------------------+-------------|
+| mouse-2 mode line | [[#69aaa631-6fb5-4beb-b2d8-c0f3d92c0a98][mouse-delete-other-windows]] | [[#501479ab-e1e2-497e-bd86-071f8afa3378][mouse-split-window-horizontally]] |                    |               |                   |             |
+| mouse-3 mode line | [[#917a1844-8c38-4f31-8616-50fc81334f2c][mouse-delete-window]]        |                                 |                    |               |                   |             |
+| mouse-1           | [[#4e60e2e4-8c2f-4450-8060-2d793ede530c][set cursor/mark]]            | [[#b661f84f-57df-4095-9dc1-d1a876a53ee5][buffer list context menu]]        |                    |               |                   |             |
+| mouse-2           | [[#086b0b50-054f-462d-92fa-b27852f887b0][paste]]                      |                                 |                    |               |                   |             |
+| mouse-3           | [[#0481632e-9c50-4328-9365-c4b5bf967b66][set-mark]]                   | [[#9623c78f-7705-4cbe-a990-c24eb1067377][global menu]]                     |                    |               |                   |             |
+| mouse-9           | [[#efaec161-b279-4129-86fd-b410430926e4][move-mouse-to-point]]        |                                 |                    |               |                   |             |
+| mouse-8           |                            |                                 |                    |               |                   |             |
+| 1/kp-end          |                            |                                 |                    |               |                   |             |
+| 2/kp-down         |                            |                                 |                    |               |                   |             |
+| 3/kp-next         |                            |                                 |                    |               |                   |             |
+| 4/kp-left         | [[#c44d0f65-9502-4cc6-9642-96d907f6b093][indent-region]]              |                                 |                    |               |                   |             |
+| 5/kp-begin        | [[#2458c6bc-7113-4d4b-bbdf-206e1cb842a7][mark-defun]]                 |                                 |                    |               |                   |             |
+| 6/kp-right        | [[#3b79bc58-6067-43bd-9471-9d592744a25a][ibuffer]]                    |                                 |                    |               |                   |             |
+| 7/kp-home         |                            |                                 |                    |               |                   |             |
+| 8/kp-up           |                            |                                 |                    |               |                   |             |
+| 9/kp-prior        | [[#a3b51adb-4405-4d9f-9b88-a8faa479fbe7][delete-horizontal-space]]    |                                 |                    |               |                   |             |
+| 10/kp-insert      |                            |                                 |                    |               |                   |             |
+| 11/kp-subtract    |                            |                                 |                    |               |                   |             |
+| 12/kp-add         |                            |                                 |                    |               |                   |             |
+| scroll            | [[#33433f0f-5b0e-46ba-8452-d2a51e54769b][up/dn / scroll]]             | [[#16506ba5-e8f2-4aec-bc1b-d2854d4e504c][cycle recent buffers]]            | [[#e1e2e253-450d-4620-af9e-78d378f49ad5][forward/back s-exp]] | [[#74b2196a-345d-453a-b7be-1915360eb201][expand region]] | [[#bd2ca117-408c-49fc-a5ac-a938be21dfc0][scroll]]            | [[#a69254a4-cf2d-450f-b477-2694b44a7e0d][zoom]]        |
+| left-scroll       | [[#d2d5c5c7-f0de-4e08-953b-d41d3e282ba7][left/right]]                 | [[#7bb95aa5-381e-454a-a6c6-aaeec728db08][back / forward word]]             | [[#49db3764-b154-4cfc-8d0d-f0e0451815e3][winner undo redo]]   | [[#ca5cdcd4-b3da-4d7b-86ab-4c7c0ac2caf7][---]]           | [[#32c00bb2-3e5a-4670-8849-04d23b9f8364][forward/back sexp]] | [[#7b4f1f49-6d93-4210-a30c-8278d6e63655][unreachable]] |
+|-------------------+----------------------------+---------------------------------+--------------------+---------------+-------------------+-------------|
+
+|-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
+| left primary    | C-                             | M-                              | C-M-                          | C-S-                     |
+|-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
+| 2               | [[#4f29b011-3844-4a4a-b75d-cdf8f49e9adb][narrow-to-defun/subtree]]        |                                 | [[#33c4996d-92bc-4df0-b005-11553677be13][---]]                           |                          |
+| 3               | [[#7851a05e-7177-4a8f-af5a-3325a8f116fe][dot-mode-execute]]               |                                 | [[#9a00e17f-a1c9-48fc-b03b-c6a1a3cbda1c][recenter-top-bottom]]           |                          |
+| q               | [[#679fd3cd-c43b-409c-be36-4175a5f27cd3][org-cycle, comint previous arg]] | [[#72bada0e-5d62-4a8f-ae62-4972778ff1bc][org-archive-to-archive-sibling]]  | [[#1f5e9b63-7ce0-445c-a426-b41839585d38][quoted-insert]]                 |                          |
+| w               | [[#20005b6d-9a9d-4b58-882c-7ce860c7a395][goto-t.org]]                     | [[#331da6e5-7936-4663-8f58-9d8601b5915c][org-clock-in]]                    |                               |                          |
+| e               | [[#24e34f4b-d1e8-4380-933f-ab1f78ebc782][copy-line]]                      | [[#0a771449-0cd5-4dc9-82ca-bcac5f7abd17][org-clock-in-last]]               |                               |                          |
+| r               | [[#5c55f461-f43f-493d-81eb-1ca747175ef1][isearch-backward]]               | [[#dd9575bd-e471-418e-9519-4fc2b874ddcd][org-clock-out]]                   |                               |                          |
+| a               | [[#db4b76df-9420-4256-8242-dc44b56d55d7][copy-all]]                       | [[#e865a1e5-55bf-4a98-a0d0-cb05a88de352][kmacro-start-macro-or-in...]]     | [[#c6278a5a-024f-4c80-a8d4-65f127fd24a8][kmacro-end-or-call-macro]]      |                          |
+| s               | [[#01da04da-cdba-493f-892b-c4c064cf937e][C-x prefix]]                     |                                 | [[#4b33022d-27f0-4d21-9931-2e2e692790e8][split-window-vertically]]       |                          |
+| d               | [[#b699614a-9994-4fe7-b2c6-f0fe81b7ad2b][C-c prefix]]                     | [[#06bcc5e2-f3a7-41c6-a793-ac6c9813fb6e][whitespace-cleanup]]              | [[#8cf6053d-792b-4abd-a3a6-66efd7fbee68][swap buffer]]                   |                          |
+| f               | [[#2695ed8a-e0d3-4e84-8688-98e3c50723b0][kill-whole-line]]                |                                 | [[#e7e4dd0b-418f-48ee-b366-9e733e3bec61][kill rest of line]]             |                          |
+| g               | [[#4af40595-7010-4be6-8cfe-a43797ca6e33][other-window / cancel]]          | [[#fb0b343f-fdff-463a-94f4-3152191e17c4][abort-recursive-edit]]            | [[#327e18af-30b7-47e5-aa53-5f678788b4c1][gnus]]                          |                          |
+| z               | [[#707c4938-a790-4da9-8230-61855ea57d09][undo-tree-undo]]                 |                                 |                               |                          |
+| x               | [[#ec1403d3-528e-41b1-a195-5563bc93e124][kill-region]]                    | [[#bb7c95d5-dd97-439d-bf1f-cdac98d11543][append-next-kill]]                | [[#c988370e-602c-431c-80a9-608459583f8b][append-next-kill]]              |                          |
+| c               | [[#400f06e1-8e45-443c-8d7b-3d1bb1176aab][copy]]                           | [[#f4c3317a-a317-4d04-8cb7-e46d0716bf1d][org-capture]]                     | [[#0a151d99-47ae-4e8f-8407-82e77d24a3e7][copy-to-register]]              |                          |
+| v               | [[#16411f68-7fe0-49e8-9a73-212471594f9e][yank]]                           | [[#d67f6371-a13f-4a75-8d8c-e4013ff4e131][insert-register]]                 | [[#25f86658-9999-40f7-b3a4-615981751b93][yank pop]]                      |                          |
+| b               | [[#e682305e-0110-4d2f-afbd-2c401bcb9313][delete-other-windows]]           | [[#05e3d0db-36dc-455f-8bed-f87886ca6004][isearch-backward-current-symbol]] | [[#6c63790c-28c1-4b73-96e2-ee859f57e734][isearch-current-symbol]]        |                          |
+| tab             | [[#edc45592-c69f-4439-8305-48f2c65696c3][yas-insert-snippet]]             | [[#71264957-45fd-455a-a6d1-b08823c02d25][indent line]]                     |                               |                          |
+| delete          | [[#2688b61d-9fdd-44af-b9bd-b126f0da00bd][kill-symbol]]                    |                                 | [[#21876759-a8e6-4896-8a08-eda40d0eaff3][kill-sexp]]                     |                          |
+| left-arrow      | [[#b15da91f-0786-49d1-b0b9-331b3b94f6ae][compile]]                        |                                 | [[#13faf5d4-34be-4363-948d-4ff04a9f570b][org-shiftup]]                   |                          |
+| right-arrow     | [[#3f3cac16-097d-451a-a14a-da7717d06730][paste selection]]                |                                 | [[#34e66314-1d97-4eeb-b704-fe0733849ae4][org-shiftdown]]                 |                          |
+| backspace       | [[#85bb4701-42e6-4617-8de8-dfb1f03b0358][backward-kill-symbol]]           |                                 | [[#606b0991-7431-4a8a-a909-b872e104cc88][backward-kill-sexp]]            |                          |
+| f7              |                                |                                 |                               |                          |
+|-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
+| right primary   | C-                             | M-                              | C-M-                          | C-S-                     |
+|-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
+| *               | [[#f745b337-8b65-44cc-849a-5e0953c9ebd9][split-window-horizontally]]      |                                 | [[#5dbe3437-7364-4802-b558-00b2d5faacf6][calc-dispatch]]                 |                          |
+| 9               | [[#43d14154-2722-4ba5-b547-1b78c6274ebf][delete-window-or-exit]]          | [[#9dc95338-4321-4354-9de2-69409f383a10][kill-buffer-and-window]]          | [[#ffe9f636-31e5-48ba-b8fe-7c158ace744c][kill client buffer]]            |                          |
+| u               | [[#327992c0-6eba-4935-aec1-49871c2a8619][universal-argument]]             |                                 | [[#62735d64-b89a-46b7-b32e-2453b651039d][search-keybind]]                |                          |
+| i               | [[#3124e200-1d6e-4ad2-9a36-0d03e1e7dc38][-----]]                          |                                 | [[#a3260b61-7c51-4d97-9a91-3ed702c5ae29][query-replace-regexp]]          |                          |
+| o               | [[#82215193-63b3-4d63-8f70-d11a328fe72d][occur]]                          |                                 | [[#05d1ef50-43ee-46d7-b1ad-dd952543ab45][ido-goto-symbol]]               |                          |
+| p               | [[#9c2e2ba9-f34e-48fe-b4ff-b9826882c1cc][move-mouse-to-point]]            |                                 | [[#d55616d3-a3f6-4e83-8807-748578a7b726][delete-horizontal-space]]       |                          |
+| j               | [[#ebcf7c71-3c93-431b-af6b-7c5df7f2945e][register prefix]]                | [[#474a3e12-95ac-4f43-b83a-36716f3e6f76][previous-error]]                  |                               |                          |
+| k               | [[#25a7ba1c-ddf3-47f1-9516-914a552e7a36][jump to register]]               | [[#a96691bb-9e4c-414b-a093-d9961d453e21][next-error]]                      | [[#f61ea4ea-4597-422e-b7e3-d3cfad82603d][man]]                           |                          |
+| l               | [[#8a7572bd-4b5e-4464-b937-3d35adb1783f][ido-switch-buffer]]              |                                 | [[#24b660d4-3ec4-4416-8a6a-b8224ed1ee8b][move cursor top bottom mid]]    |                          |
+| ;               | [[#7e3710eb-5460-4460-8bf0-488302e4ce35][comment-dwim]]                   |                                 | [[#28680a96-5223-4632-80b9-b1facdd541e7][comment-current-line-dwim]]     |                          |
+| m               | [[#deee53ba-dfa2-4910-894c-55ae98d11aa4][pop-to-mark]]                    |                                 | [[#f283f705-cba0-45db-b80f-5d20415b2eee][recursive grep]]                |                          |
+| ,               | [[#6cbf3a85-f260-453a-920b-850ff5e986b1][ido-find-file]]                  |                                 | [[#bfdf6111-029d-462b-bcca-50a3ed2162d5][find-file-in-project]]          |                          |
+| .               | [[#0675c171-8677-44a8-882c-e7ed42715e31][recentf-ido-find-file]]          |                                 | [[#824d422c-67b6-4d68-af11-6a2135e528f5][-]]                             |                          |
+| /               | [[#941a7fa8-84b9-434d-89a0-1487385ec479][join lines]]                     |                                 | [[#37f67593-4f60-4d3b-9aad-6c9bc4882443][copy-variable]]                 |                          |
+| 8               | [[#251c4a1a-a683-4804-a706-d0d3752e42fa][calc-embedded-word]]             |                                 |                               |                          |
+| up-arrow        | [[#f47d312a-063d-42ed-a352-176298a2cb0c][back defun/headline]]            |                                 |                               |                          |
+| down-arrow      | [[#27435136-b3d7-4f25-aa85-2a7363a7f366][forward dfun/headline]]          |                                 | [[#3bcb35fd-6d54-4213-b94f-2739c0bc0041][toggle-mark-activation]]        | [[#1434bdd0-c5a8-4c96-9b92-9474e88fd1c5][smex-major-mode-commands]] |
+| lbracket        | [[#9d9916dd-3280-47dd-aab1-cd28d5ebfe15][----]]                           |                                 | [[#7411b1a5-c8fa-4bcc-8788-798e5635dd62][scroll-right]]                  |                          |
+| rbracket        | [[#21b38c6b-3a46-4a08-8eca-d44abb148287][fill-paragraph]]                 |                                 | [[#c9c18f48-d0ca-4a1b-a751-7165f40118a3][scroll-left]]                   |                          |
+| return          | [[#baf7ea5a-d16d-4fee-a6ce-542cc11beb97][newline next line]]              | [[#e6895ad3-a2c8-46c8-abbc-1bba94a88596][non-indented newline]]            | [[#2a8fc6ea-a550-4437-9e35-3b3f2776788a][open newline on previous line]] |                          |
+| space           | [[#132daa1a-8e5f-47f1-a28d-35bee873aeac][org-edit-special]]               |                                 | [[#02359b66-bf6e-4f41-9f03-e83fcbe3e68c][spell check word]]              |                          |
+|-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
+| left secondary  | C-                             | M-                              | C-M-                          | C-S-                     |
+|-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
+| =               |                                |                                 |                               |                          |
+| 1               |                                |                                 |                               |                          |
+| 4               |                                |                                 | [[#3ff50f5f-f286-4a73-962b-58dbcf3b09b1][widen]]                         |                          |
+| 5               |                                |                                 |                               |                          |
+| tab-key         | [[#68313551-90cd-47a6-8170-1745348add17][query-replace]]                  |                                 |                               |                          |
+| t               | [[#aaac3048-9125-4fd5-b8f2-21bafcc1ff1c][org change todo state]]          |                                 | [[#5bc609b1-9428-4b82-a55d-811fefe65331][org insert timestamp]]          |                          |
+| home            | [[#1919659a-b466-4519-9276-8bf06a916066][start of buffer]]                |                                 |                               |                          |
+| end             | [[#0a7bd629-cbcc-4761-8fe2-cc9370b985a4][end of buffer]]                  |                                 |                               |                          |
+| f9              |                                |                                 |                               |                          |
+|-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
+| right secondary | C-                             | M-                              | C-M-                          | C-S-                     |
+|-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
+| 6               | [[#e44e584b-d925-4036-9ad5-a90d02e74bef][save-buffers-kill-emacs]]        |                                 | [[#da73de75-0914-4f48-81d5-9b408433b14b][insert-small-copyright]]        |                          |
+| 7               |                                |                                 | [[#a68c6b8e-9911-475e-ab35-e239771fe881][insert-full-copyright]]         |                          |
+| 0               |                                |                                 |                               |                          |
+| -               |                                |                                 |                               |                          |
+| y               | [[#97aee7f1-3647-4602-a65a-45e8a3aa3a7c][undo-tree-redo]]                 |                                 |                               |                          |
+| \               | [[#b8ad3ee9-7bf6-4069-a300-49cd298008a7][sr-speedbar-toggle]]             |                                 | [[#6a583354-48f8-4503-bf87-b8ba56411435][mark-defun]]                    |                          |
+| h               | [[#3c5f241f-fc62-459d-ab85-6b7c1fb04801][help-prefix]]                    |                                 |                               |                          |
+| '               | [[#9f252721-a2d5-46c6-b268-8ed597256229][eval-expression]]                |                                 |                               |                          |
+| n               | [[#52ebb720-589b-485c-89dc-0dfb78e6dad4][unpop-to-mark-command]]          |                                 | [[#43997316-8d3f-4750-873b-ade09628fdd5][narrow-to-region]]              |                          |
+| rshift          |                                |                                 |                               |                          |
+| escape          | [[#6901fa1b-c827-4525-b24b-bdb8fe5f638b][find-tag]]                       |                                 |                               |                          |
+|-----------------+--------------------------------+---------------------------------+-------------------------------+--------------------------|
+  #+END:
+
+* persistent registers
+This needs to be at the end, because I visit a file, thus setting a
+mode, and the mode hook needs to be setup before that.
+
+I'm using persistent registers instead of bookmarks. I dun use them
+much, so the added hassle of having to set it within this file is
+worth the benefit of only having one concept in my mind.
+#+begin_src emacs-lisp
+  (dolist
+      (r `((?i (file . ,"~/.emacs.d/my-init.org"))
+           ))
+    (set-register (car r) (cadr r)))
+#+end_src
+
+* keybind notes
+common keys, which would be better off doing swaps than rebinds:
+c-x prefix -> c-s
+c-c prefix -> c-d
+yank c-y -> c-c
+search c-s -> kp-add
+kill line c-k -> c-f
+undo c-_ -> c-z
+set-mark-command c-@ -> kp-enter
+quoted-insert c-q -> c-m-q
+recenter-top-bottom c-l -> c-m-3
+kill-region c-w -> c-x
+
+commands to make less accessible
+narrow-to-defun/subtree -> M-2 maybe
+occur
+
+command to make more accessible, ...
+
+
+* misc useful functions I'd rather have in a list than burried
+#+begin_src emacs-lisp :tangle no
+;; these are usefull with (goto-char)
+;; find named entity, other than headline
+(org-find-entry-with-id "string-number-or-symbol")
+
+(org-find-exact-headline-in-buffer "heading" nil t)
+
+(byte-recompile-file (expand-file-name "~/.emacs.d/my-init.el") t 0)
+(byte-recompile-directory (expand-file-name "~/.emacs.d") 0)
+(byte-recompile-directory (expand-file-name "~/.emacs.d/src/haskell-mode") 0)
+
+;; remove any indent level which is throughout the buffer
+(org-do-remove-indentation)
+
+#+end_src
+
+* TESTING / DEVELOPMENT AREA
+
+:PROPERTIES:
+  :tangle:   no
+:END:
+** new
+#+begin_src emacs-lisp
+
+
+#+end_src
+
+** key logging
+this article convinced me that trying to experiment with modal editing is a waste.
+http://chrisdone.com/posts/speculations-on-exclusive-editing
+I want to record my emacs commands simply to find optimiaztions, like if I often do some M-x command and should bind it
+to a key.
+
+
+#+begin_src emacs-lisp :tangle no
+
+(setq keylog-list nil)
+(setq keylog-mode nil)
+
+(defun keylog-save ()
+
+  ;; Check that the lock file does not exist
+  (when (keyfreq-file-is-unlocked)
+    ;; Lock the file
+    (keyfreq-file-claim-lock)
+
+    ;; Check that we have the lock
+    (if (eq (keyfreq-file-owner) (emacs-pid))
+(unwind-protect
+(progn
+;; Load values and merge them with the current keyfreq-table
+(keyfreq-table-load table)
+
+;; Write the new frequencies
+(with-temp-file keyfreq-file
+(prin1 (cdr (keyfreq-list table 'no-sort)) (current-buffer))))
+
+;; Release the lock and reset the hash table.
+(keyfreq-file-release-lock)
+(clrhash table))
+      )))
+
+(defun my-keylogger-function ()
+  (setq keylog-list (cons (list (current-time) current-prefix-arg this-command) keylog-list)))
+(add-hook 'pre-command-hook 'my-keylogger-function)
+
+#+end_src
+
+in a lisp expression, ;  \\[ throws off forward-sexp
+when not in emacs lisp mode,
+even with (with-syntax-table emacs-lisp-mode-syntax-table
+forward-sexp)
+which is found in preceding-sexp
+potentially a bug, either in with-syntax-table, or
+in scan-lists, which is implemented in C
+
+
+
+
+why did it go to the init file?
+change EDITOR to emacsclient
+xserver-xorg-core=2:1.14.3-3ubuntu2
+(setq-default header-line-format nil) ; Copy mode-line
+(setq-default mode-line-format nil) ;
+
+
+#+RESULTS:
+: set-food-completions
+
+
+
+useless gnus group keys:
+a
+c
+
+
+(add-to-list 'load-path "~/.emacs.d/emacs/site-lisp/org")
+
+#+begin_src emacs-lisp
+  (add-hook 'org-mode-hook
+            (lambda () (define-key org-mode-map (kbd "C-y") nil)))
+
+#+end_src
+
+
+
+
+(defun comint-send-string (process string)
+  "Like `process-send-string', but also does extra bookkeeping for Comint mode."
+  (if process
+      (with-current-buffer (if (processp process)
+                              (process-buffer process)
+                            (get-buffer process))
+       (comint-snapshot-last-prompt))
+    (comint-snapshot-last-prompt))
+  (process-send-string process string))
+
+
+* python
+todo: get smart-operator to work
+todo, checkout https://github.com/python-rope/ropemacs refactoring python,
+todo, try py-autopep8, autoformatter
+todo, check out some python linting stuff. pychecker is one, others are in *packages*
+todo, finish reading through python-mode.el functions
+;; todo, figure out multi-line input in shell mode
+
+
+usefull m-x commands:
+m-x py-describe-mode: doc for mode which is extensive
+m-x py-sort-imports
+m-x py-guess-indent-offset: setup indent for code i didn't write
+
+possibly usefull commands:
+found via looking through python-mode.el, quit like 1/4 through, cuz its tedious, last spot was at:
+(defun py-comment-region (beg end &optional arg)
+after finding py-describe-mode, it seemed to do a good job of documenting all the most important stuff
+
+py-switch-to-python
+python-shell-completion-complete-or-indent may be usefull to get completion working in the shell
+py-insert-default-shebang
+py-electric-*
+py-indent-line-outmost
+py-newline-and-close-block
+py-indent-and-forward (indent line, move to next)
+py-fill-*
+py-which-function (for showing in the modeline)
+py-help-at-point
+py-execute-import-or-reload
+py-execute-def-or-class
+various pdb functions
+
+
+installing jedi
+#+begin_src sh :tangle no
+pi python-pip
+s pip install jedi virtualenv
+#+end_src
+then do m-x jedi:install-server
+
+
+
+disabled because it takes 152 ms to load,
+and I don't know how to do it conditioally
+#+begin_src emacs-lisp :tangle no
+
+;; change from default python3 to be compatibile with Pywikibot
+(setq py-shell-name "/usr/bin/python")
+(require 'python-mode)
+
+(setq py-autopep8-options '("--max-line-length=110"))
+
+(defun py-execute-block-or-clause-create-shell ()
+  (interactive)
+  (cond ((get-buffer "*Python*")
+         (py--execute-prepare "block-or-clause")
+         (py-execute-block-or-clause)
+         (call-interactively 'next-line))
+        (t
+         (py-shell)
+         ;; py-shell starts the shell but not display the buffer on the first run
+         ;; subsequent runs, it does. I grabbed this command from inside to
+         ;; do just the relevant part from the second run, as a hack.
+         ;; todo: report a bug on this
+         (py--shell-manage-windows py-buffer-name))))
+(setq py-tab-shifts-region-p t)
+(setq py-tab-indents-region-p t)
+
+(defun py-run ()
+  "default action to run the current buffer"
+  (basic-save-buffer)
+  (py-execute-buffer))
+
+
+(add-hook 'python-mode-hook
+          (lambda ()
+            (setq run-fun 'py-run)
+            (define-key python-mode-map (kbd "C-M-a") nil)
+            (define-key python-mode-map (kbd "C-M-d") nil)
+            (define-key python-mode-map (kbd "C-M-e") nil)
+            (define-key python-mode-map (kbd "C-M-h") nil)
+            (define-key python-mode-map (kbd "C-M-i") nil)
+            (define-key python-mode-map (kbd "C-M-u") nil)
+            (define-key python-mode-map (kbd "C-M-x") nil)
+            (define-key python-mode-map (kbd "<tab>") 'indent-for-tab-command)
+            (define-key python-mode-map (kbd "C-j") nil)
+            (define-key python-mode-map (kbd "<C-backspace>") nil)
+            ;;(define-key python-mode-map (kbd "C-(") (lambda () (interactive) (basic-save-buffer) (py-execute-buffer)))
+            ;; fix default return bindings
+            (define-key python-mode-map (kbd "C-j") nil)
+            (define-key python-mode-map (kbd "RET") nil)
+            (define-key python-mode-map (kbd "<return>") 'py-newline-and-indent)
+            (define-key python-mode-map (kbd "<M-tab>") 'py-indent-line)
+            (define-key python-mode-map (kbd "C-M-(") 'py-shift-left)
+            (define-key python-mode-map (kbd "C-M-)") 'py-shift-right)
+            (define-key python-mode-map (kbd "<home>") 'py-beginning-of-line)
+            (define-key python-mode-map (kbd "<end>") 'py-end-of-line)
+            (define-key python-mode-map (kbd "C-t") 'py-execute-block-or-clause-create-shell)
+            (define-key python-mode-map (kbd "<S-delete>") 'py-ian-execute-line-or-region)
+            ;; python mode adds these to this list, which is normally empty.
+            ;; it makes my send-python function not reuse an existing python shell window
+            ;; there are other ways to override this, but I don't know of any other value of
+            ;; having this set.
+            (setq same-window-buffer-names (delete "*Python*" same-window-buffer-names))
+            (setq same-window-buffer-names (delete "*IPython*" same-window-buffer-names))))
+
+;; i dunno, why, but this didn't work:
+;; and we can't eval-after-load cuz it is part of the greater python mode file
+(add-hook 'py-shell-hook
+          (lambda ()
+            (define-key py-shell-map "\r" nil)
+            (define-key py-shell-map (kbd "<return>") 'comint-send-input)
+            (define-key py-shell-map (kbd "C-t") 'py-shell-toggle-arrow-keys)
+            (define-key py-shell-map "\C-d" nil)
+            (define-key py-shell-map (kbd "<up>") 'my-comint-previous-input)
+            (define-key py-shell-map (kbd "<down>") 'my-comint-next-input)))
+
+
+(defun py-ian-execute-line-or-region ()
+  (interactive)
+  (cond ((get-buffer "*Python*")
+         (if mark-active
+             (py-execute-region)
+           (py-execute-statement))
+         (call-interactively 'next-line))
+        (t (py-shell))))
+
+;; http://tkf.github.io/emacs-jedi/latest/
+(add-hook 'python-mode-hook 'jedi:setup)
+(setq jedi:complete-on-dot t)
+
+(defun py-shell-toggle-arrow-keys ()
+  (interactive)
+  (toggle-arrow-keys py-shell-map))
+
+#+end_src
+
+
+;; py-shell window stuff
+;; it splits the window if the shell is in a different frame
+;; which seems to be a bug, but it can be fixed with this option
+;; (setq py-keep-windows-configuration 'force)
+;; however, with py-execute-block-or-clause, if the shell is in a different frame,
+;; you get errors "buffer is read only", when the point is near the beginning of a command
+;; todo: test with emacs -Q and file a bug
+;; if you execute py-execute-... without a python shell open,
+;; it starts one, doesn't display it, and subsequent py-execute commands
+;; give error "buffer is read only"
+;; these functions fix / improve these problems
+
+
+** initial python-mode setup
+
+python-mode seems to be the most canonical package, based on
+https://docs.python.org/devguide/emacs.html
+much more feature rich than the emacs built in one.
+
+getting it, it wants you to setup an account on launchpad by default,
+there is some way to get anonymous bzr access, but google didn't answer it right away,
+so fuck it, ill go the happy path.
+
+based on error messages,
+add public ssh key to https://launchpad.net/people/+me
+bzr launchpad-login iank
+cd  ~/.emacs.d/src/
+bzr branch lp:python-mode
+
+add lines from INSTALL to init
+
+
+** background on packages
+jedi appears most popular based on github stats
+pysmell appears dead
+ac-python appears dead
+https://github.com/proofit404/anaconda-mode seems to be kicking along
+
+
+** misc notes:
+
+python-mode has a TON of functions that are just aliases or verbatim wrappers of other functions.
+also has undocumented/unused vars all around. it is quite annoying.
+
+the dedicated argument to py-shell does nothing,
+and py-dedicated-shell just sets that, so it is a waste
+
+
+** background on sending to python shell
+
+using the builtin python execute shell functions, sending one line doesn't really work well.
+The bulit in functions don't wait for further input if a block is not closed.
+And doing a copy/paste thing gets messed up because of indents.
+With some hacking, I could probably do copy/paste and remove indents, only to a
+certain level if we have entered a block and are waiting to finish it.
+But just doing the builtin execute block is a decent work around.
+
+
+Here is the scrapped function for single line built in sending to shell.
+
+
+(setq w32-enable-num-lock nil)
+(global-set-key (kbd "<num_lock>") 'left-char)
+
+
+(defun sqlup-find-correct-keywords ()
+  "If emacs is handling the logic for syntax highlighting of SQL keywords, then we piggyback on top of that logic. If not, we use an sql-mode function to create a list of regular expressions and use that."
+    (mapcar 'car (sql-add-product-keywords sql-product '())))
+
+
+largest subarray sum, array of pos and neg ints.
diff --git a/snippets/emacs-lisp-mode/.yas-parents b/snippets/emacs-lisp-mode/.yas-parents
new file mode 100644 (file)
index 0000000..eed5b44
--- /dev/null
@@ -0,0 +1 @@
+text-mode
diff --git a/snippets/emacs-lisp-mode/cond b/snippets/emacs-lisp-mode/cond
new file mode 100644 (file)
index 0000000..6de806b
--- /dev/null
@@ -0,0 +1,8 @@
+# -*- mode: snippet -*-
+# name: cond
+# key: cond
+# --
+(cond
+(($0) )
+()
+)
\ No newline at end of file
diff --git a/snippets/emacs-lisp-mode/defun b/snippets/emacs-lisp-mode/defun
new file mode 100644 (file)
index 0000000..51bbbf0
--- /dev/null
@@ -0,0 +1,8 @@
+# -*- mode: snippet -*-
+# name: defun
+# key: d
+# --
+(defun $1 ()
+  ""
+    $0
+  )# contributor: Ian Kelling
diff --git a/snippets/emacs-lisp-mode/global-set-key b/snippets/emacs-lisp-mode/global-set-key
new file mode 100644 (file)
index 0000000..83f2ef3
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: global-set-key
+# key: gsk
+# --
+(global-set-key (kbd "$1") '$0)
\ No newline at end of file
diff --git a/snippets/emacs-lisp-mode/kbd b/snippets/emacs-lisp-mode/kbd
new file mode 100644 (file)
index 0000000..e10a8ae
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: kbd
+# key: kbd
+# --
+(kbd "$1") $0
diff --git a/snippets/org-mode/.yas-parents b/snippets/org-mode/.yas-parents
new file mode 100644 (file)
index 0000000..42c5e7e
--- /dev/null
@@ -0,0 +1 @@
+sh-mode emacs-lisp-mode
\ No newline at end of file
diff --git a/snippets/org-mode/src-block b/snippets/org-mode/src-block
new file mode 100644 (file)
index 0000000..bf43055
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: src-block
+# key: bsb
+# --
+#+begin_src $1
+$0
+#+end_src
\ No newline at end of file
diff --git a/snippets/org-mode/src-emacs-lisp b/snippets/org-mode/src-emacs-lisp
new file mode 100644 (file)
index 0000000..2159b6f
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: src-emacs-lisp
+# key: sel
+# --
+#+begin_src emacs-lisp
+`yas/selected-text`$0
+#+end_src
\ No newline at end of file
diff --git a/snippets/org-mode/src-haskell b/snippets/org-mode/src-haskell
new file mode 100644 (file)
index 0000000..dd6cf09
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: src-haskell
+# key: hs
+# --
+#+begin_src haskell
+`yas/selected-text`$0
+#+end_src
\ No newline at end of file
diff --git a/snippets/org-mode/src-shell b/snippets/org-mode/src-shell
new file mode 100644 (file)
index 0000000..8a1a8b7
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: src-shell
+# key: ss
+# --
+#+begin_src sh
+`yas/selected-text`$0
+#+end_src
\ No newline at end of file
diff --git a/snippets/sh-mode/ssh-here-doc b/snippets/sh-mode/ssh-here-doc
new file mode 100644 (file)
index 0000000..e1a8bb6
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- mode: snippet -*-
+# name: ssh-here-doc
+# key: <?
+# --
+<<'EOSSH'
+`yas/selected-text`$0
+EOSSH
\ No newline at end of file