org-mode ctrl-a & ctrl-e

I had been using a customized ctrl-a and ctrl-e (beginning-of-line and end-of-line) in my Emacs.

(defun smart-beginning-of-line ()
"Move point to first non-whitespace character or beginning-of-line.

If point was already at that position, move point to beginning of line."
(interactive)
(let ((oldpos (point)))
(back-to-indentation)
(and (= oldpos (point))
(beginning-of-line)
)))

Those of you who are OS X users: are basic Emacs keybindings which out of the box bound in a similar way.

Org-mode has been my note taking, todo list, and everything for a while. But one thing has been that the keybindings haven’t quite been right. Instead of going to the logical beginning of a heading (the text)

* Tasks

Should go to the beginning of the T in Tasks, in Org-mode the cursor would jump to the systematic beginning of the line. Uhuh, that makes sense but it isn’t what my brain _really_ wants.

Thus the amaziness of org and having a setting for everything

org-special-ctrl-a/e

Which smartly moves the cursor to where it should belong.

Thus the doctoring speaketh:

org-special-ctrl-a/e is a variable defined in `org.el'.
Its value is t
Original value was nil

Documentation:
Non-nil means `C-a' and `C-e' behave specially in headlines and items.

When t, `C-a' will bring back the cursor to the beginning of the
headline text, i.e. after the stars and after a possible TODO
keyword. In an item, this will be the position after bullet and
check-box, if any. When the cursor is already at that position,
another `C-a' will bring it to the beginning of the line.

`C-e' will jump to the end of the headline, ignoring the presence
of tags in the headline. A second `C-e' will then jump to the
true end of the line, after any tags. This also means that, when
this variable is non-nil, `C-e' also will never jump beyond the
end of the heading of a folded section, i.e. not after the
ellipses.

When set to the symbol `reversed', the first `C-a' or `C-e' works
normally, going to the true line boundary first. Only a directly
following, identical keypress will bring the cursor to the
special positions.

This may also be a cons cell where the behavior for `C-a' and
`C-e' is set separately.

You can customize this variable.

 

Gotcha: sRGB, Emacs 24, themes

I’ve been working with the Solarized color theme in my Emacs for a while. The homebrew recipe for Emacs has an option to pull in a patch which corrects the Cocoa port for Emacs to handle srgb colors correctly. But for the longest time I couldn’t get the colors to exactly line up to the references.

But I finally figured out that the theme was expecting a variable to be set:

(setq solarized-broken-srgb nil)

From the customize information:

Emacs bug #8402 results in incorrect color handling on Macs. If this is t (the default on Macs), Solarized works around it with alternative colors. However, these colors are not totally portable, so you may be able to edit the “Gen RGB” column in solarized-definitions.el to improve them further.

The gotcha is that if you set this through customize, generally the default custom.el loads after init.el with a lightly managed Emacs. So if you thought you were setting the variable in customize and it would work, you are wrong, since normally themes are loaded through your init.el, either through a separate library or directly in mine.

So for me to load solarized with correct srbg support:

(setq solarized-broken-srgb nil)
(load-theme 'solarized-dark t)

Installing Jekyll on OSX 10.9

Installing Jekyll

Recipe for installing RVM + Latest Stable Ruby + Jekyll on OS X 10.9. This is mostly so I can experiment with using GitHub pages to publish web sites. Loosely following instructions from GitHub how to set Jekyll up.

Install RVM + Latest Stable Ruby

RVM isn’t provided as a formula in homebrew/homebrew since RVM installs on a per user basis and it does some other non homebrew’y stuff. Depending on RVMs autolibs feature to install all its dependencies automatically using homebrew.

$ \curl -sSL https://get.rvm.io | bash -s stable --ruby=

RVM will run and your shell should be set up to use the new Ruby.

Other options include using the system ruby as the default: and then invoking rvm to call the relevant ruby we want.

$ rvm --default use system
Now using system ruby.
Now using system ruby.
Warning! Executable 'ruby' missing, something went wrong with this ruby installation!
Warning! Executable 'gem' missing, something went wrong with this ruby installation!
Warning! Executable 'irb' missing, something went wrong with this ruby installation!
$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
$ which ruby
/usr/bin/ruby

In that case I go back to the new installed ruby to isolate it from the system environment:

$ rvm use 2.1.0

Install Jeyll with RubyGems

Bundler is installed automatically by RVM, so dependencies should be installed!

$ gem install jekyll

It Lives

$ jekyll new newProject
New jekyll site installed in /Users/gugek/Desktop/newProject.
$ cd newProject/
$ jekyll serve
Configuration file: /Users/gugek/Desktop/newProject/_config.yml
            Source: /Users/gugek/Desktop/newProject
       Destination: /Users/gugek/Desktop/newProject/_site
      Generating... done.
    Server address: http://0.0.0.0:4000
  Server running... press ctrl-c to stop.

 

org-mode agenda

I’ve been using emacs’ org-mode to handle project and task tracking. There are a number of views in the agenda mode that weren’t clear to me what they did until I had to go back and see everything I’ve been doing for the last year:

‘a’ Agenda for current week or day

Week view of your (active) TODOs. With some options you can see archived and hiddent events and TODOs. The default brings in any TODO that has an active timestamp or is scheduled. After you bring it up you can then change the view to include everything from the last month, year, or arbitrary date. This is the view you need if you want to see completed tasks in an archive; using the ‘Log-All’ function when you have the view up along with adding the archive option if you are using an archive file.

‘L’ timeline

Timeline view of all date tagged items in the current org-mode buffer. Strangely, this view doesn’t respond to any of the agenda options, except for viewing things in logged format. You’d think it could give you an overview but it doesn’t.

‘t’ List of all TODOs

This is the list of active TODOs. A tasklist, which is configurable with a number of options to sort and surface the particular ones to the top.

 

 

 

Authorized Access Points

I’ve been using RDA for original cataloging since October 2012 at MPOW. With authority records things have been great. There is a lot more flexibility to add and not add things. One hangup is the transition period where records need to be evaluated. Some weirdnesses I’ve encountered have been titles of nobility see: 100 1# Vitzthum, Wolfgang, $c Graf.

Other issues include media types for streaming media. Actually digital files in general are handled poorly. Everything needs a carrier. What exactly is the carrier for a file that is sitting on filesystem in the cloud?

338 ## other $2 rdacarrier

or perhaps if it is published:

338 ## online resource $2 rdacarrier

The file characteristics get handled elsewhere; not a terribly horrible thing, but not exactly intuitive.

More thoughts later.

Textarea’s Firefox (Windows 7) & Safari (OS X Lion)

I was looking into using org-mode in emacs (I am a vi user, though I had started as an emacs users in college). But I came across a really amazing Stack Overflow question and answer on using Emacs’ org-mode, Markdown, and a Firefox plugin It’s All Text. The idea of being to edit a textarea in my editor of choice was obvious in hindsight, so I went ahead and started using the plugin, instead calling vim, and modifying relevant ftdetect and ftplugins to handle the hosts that I would be editing in.

So for example, I edit a Confluence wiki for project tracking and documentation. My ftdetect then for the confluencewiki.vim syntax is:


" confluence filetype file
au BufRead,BufNewFile *.cfl,*.confluence set filetype=confluencewiki
au BufRead,BufNewFile wiki.duke.edu.*.txt set filetype=confluencewiki

Using the plugin pulls the text out of the textarea, adds it to a vim buffer and then lets me edit it; while monitoring the file to update the control in the webpage. Pretty awesome

Of course after using it for half a day on Windows at MPOW, I have to do it on my Macbook Air, where I use Safari. I know there are reasons to not use Safari, but my big reason for using it is that I remain consistent with all the Fluid site specific browsers I use for a number of important sites, Gmail, Google Docs, Facebook. Of course Safari’s extension mechanism isn’t as well used as Firefox’s but it seems like that the textarea editing with an external editor itch isn’t limited: thus Quick Cursor which basically acts as a sophisticated copy and paste clipboard into any control that accepts text in OS X. I got the impression that the operating system used to have some other mechanism to achieve something similar, but for whatever reason that has been deprecated