Friday, October 2, 2015


Working with Emacs and Cygwin


I'm currently running emacs in Cygwin so that I can access to the gnu tools like grep, sed, etc. This entry details how I installed emacs on Cygwin to make it work for me.

1. Install Cygwin

Download the setup program from https://cygwin.com/ and install Cygwin.

2. Install apt-get

apt-cyg is a Cygwin package manager. You don't have to use and can install all Cygwin applications using the setup program.

To install apt-cyg:
  1. run the Cygwin Terminal shortcut as administrator
  2. enter the following in the terminal
  3. lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg 
    install apt-cyg /usr/local/bin
Example use of apt-cyg:
apt-cyg install unzip
apt-cyg install wget

3. Install cask

I'm playing around with using cask to manage my emacs packages. See the installation page for installation options.
I simply cloned the repository in my ~ (home) directory.
git clone https://github.com/cask/cask.git ~/.cask

4. Install emacs

Run the following command in the Cygwin Terminal to install emacs.
apt-cyg install emacs-w32

5. Customize bash

Open the bash initialization file using emacs.
emacs .bash_profile

Enter the following. There are more example settings for bash on the Cywgin Customizing bash page.

#see https://cygwin.com/cygwin-ug-net/setup-files.html
# Ignore case while completing
set completion-ignore-case on
# Make Bash 8bit clean
set meta-flag on
set convert-meta offset output-meta on
# Variables for emacs server
export ALTERNATE_EDITOR=""
export EDITOR=emacsclient
# start emacs
#  emacs --daemon
#  emacsclient -c -n
#  emacsclient -t

# Close emacs
#  emacsclient -e '(kill-emacs)'

6. Emacs source TAGS

I wanted the source available for teh Emacs lisp files so that I could see how the functions were implemented. I downloaded the source files using the Cygwin setup program but I couldn't get it to build. Since I only wanted the lisp source files I decided to generate the TAG file manually.

The source was copied to the /usr/src/emacs-24.5-2.src/. The source files are located in the emacs-24.5/lisp directory. I copied all the *.el files to the /usr/share/emacs/24.5/lisp directory.

To create the tags file run the following commands in the Cygwin Terminal. I've taken this from the MakeFile in the lisp src directory. I've taken this from the MakeFile in the lisp src directory.

cd /usr/share/emacs/24.5/lisp
echo ./*.el ./*/*.el ./*/*/*.el ./*/*/*/*.el | \
   sed -e 's,./[^ ]*loaddefs[^ ]*,,g' \
     -e 's,./ldefs-boot[^ ]*,,' \
     -e 's,./[^ ]*esh-groups.el[^ ]*,,' | \
     xargs "etags" -a -o TAGS

7. Ruby

I decided to install ruby using the following. See the websites for installation instructions.

Add the following to .bashrc.
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh
#Create version file to automatically enable ruby version.
echo "ruby-2.2.3" > ~/.ruby-version

Install the inf-ruby scripts for emacs.
cp ~/src/ruby-2.2.3/misc/* .emacs.d/vendor/

Tuesday, August 25, 2015

Emacs Cheat Sheet and Reference Card

I felt that the GNU Emacs Reference Card was to complex for me as a beginner user of Emacs so I decided to create my own reference card.

I copied Emacs Cheat Sheet by Bob Rogers into a word processor so I could print it easier on one page and I created a new reference card using the information on the Emacs Tour page.

Download the cheat sheet and reference card below:
  • Emacs Cheat Sheet - Bob Rogers  (pdf) (xlsx)
  • Emacs Tour Reference Card (pdf) (docx)



Wednesday, May 28, 2014

Check Galaxy Device Charging Level using Cool Tool

To check the charging current of your Samsung Galaxy device add a custom label pointing to
/sys/class/power_supply/battery/current_max.


I've been using Cool Tool since I've started using the ArchiDroid ROM.

You can customize Cool Tool to show a variety of settings.

Sunday, January 27, 2013

Enable Alt Tab For Windows Of Same MS Office Application on Windows 7

If you constantly work with Microsoft Excel and Microsoft Word and need to switch between the windows quickly you can change the settings in the application to ungroup the windows of the application.

  1. Click the Microsoft Office Button and then click Excel Options (For Microsoft Excel 2007) or Word Options (For Microsoft Word 2007)
  2. On the Advanced tab, under Display, select the Show all windows in the Taskbar check box and then click OK.

Tuesday, January 22, 2013

The Happiness Machine

An interesting article on how Google became such a great place to work http://slate.me/XUBRJ1.
Other companies can learn from this.

Wednesday, October 10, 2012

NotePad++ Regex

Regex with Notepad++

I found this blog entry by detailing some of the Regex rules for Notepad++. I created a simple cheat sheet from his blog.

Friday, July 20, 2012

Inkscape Cheat Sheet

I couldn't find a cheat sheet for Inkscape so I created my own. The cheat sheet contains the commands from the Inkspace Basic Tutorial.

You can get it here.