Results tagged “emacs” from SweetFriday

Relative Timing With Org-Mode

|

I hve been re-arranging my TODO lists using Emacs's Org-Mode and when I realized that it could calculate the exact hours taken for a bunch of tasks, I felt I should explore the rest of the Org-Mode manual and see what else I had been missing out on.

Org-Mode allows you to use relative timers which, it says, are useful for recording notes during a meeting or video viewing. I did not understand exactly how to use the relative timers, but it looks like they are like timestamps. Here's a brief run-down and example on how to use them.

Quick Notes on Annotations

|

I just stumbled upon the Online Journalism Blog. My entry point was a post on how to make money from [online] content. An interesting topic because it appears that much of the money is made indirectly through advertising, events, etc. What was more interesting, however, was a post on the the death of the interactive presentation tool Flowgram.

For a course I was taking part-time at Ryerson University, I had to use the Processing language to create a 2d animation. I wasn't keen on Processing at first because the language looks like Java but it isn't that bad because Processing lets you avoid the Java stuff by supplying its own functions to use.

Emacs: Org-mode WikiPedia links

|

The other day I was going through some notes that I organize using Org-mode and I realized that it's a pain in the ass to write up links to Wikipedia entries all the time. So I whipped up some code that adds an org-mode link.

Update on The Update

|

I overslept by a few hours but I decided to change the colour scheme. The stylesheet I uploaded last night was hideous, though good enough for testing. The new styles and page generation functions are up and I've switched the main page to PHP. The Friend of a Friend Creator is also partially up. I need to add more of the FOAF specification stuff of course, but there's a fancy new date picker (Thanks jQuery-UI!)

The design is very retro, very 70s I would say...at least in terms of the colours. The striped background reminds me of the swimshorts I bought that also have racing stripes. Obviously the design is solid because of this, heh.

Some details...

Emacs Poetry Snippet

|

The following is a snippet for LaTeX mode in Emacs. The snippet uses the wonderful YASnippet package and inserts the date of the poem being written and a tiny bit of LaTeX around it.

;; LaTeX snippets
(yas/define-snippets
  'latex-mode ; Snippet is available when in LaTeX mode
  '(
    ("poem" ; Keyword that will trigger the snippet
     ; The snippet itself
     ; (Each newline can be replaced with \n to make the snippet fit on one line)
     "\\begin{verse}
\\poemtitle{${1:untitled}}
% Written on ${2:$(format-time-string \"%e %B %Y\")}
$0

\\end{verse}
"
     "begin verse ..." ; Name of the snippet
     nil)
  )
)

Squeak Break

|

I have taken the last two days off as a break from writing Java and JavaScript, and finally took a proper look at Squeak. It is impressive, and similar to working in Emacs in some ways (though much cooler).

The greatest feature of Squeak, and Emacs (and Lisps), is that the documentation for the language and environment is always around and accessible. If I don't know how a function works in Emacs or which methods an object has in Squeak, I can look it up while working in them. This has saved me from asking many stupid questions on the #emacs and #squeak IRC channels, heh.

Anyway, the break was needed because JavaScript reminded me of Scheme, and I had forgotten how horrible coding in Java can be (e.g. RedundantType x = new RedundantType...). Squeak's user interfaces may inspire Sandals in some ways, we shall see.

Check out the Squeak Language Reference

Here's a function for Emacs that counts the number of words in a buffer by using a regular expression:

(defun wc ()
  (interactive)
  (message "Word count: %s" (how-many "\\w+" (point-min) (point-max))))

The regular expression matches against one or more word characters. It doesn't move the current point of the buffer so you don't have to keep re-positioning the cursor every time you run this function.

The reason I'm posting this is because I was searching for something like this and everyone keeps suggesting to use the "wc" shell command while in Linux, but I'm in Windows! How can I use it? Another thing I found is that people write up functions that loop through words and count them. I'm guilty of doing that, but using the above function is much much easier.

Emacs has most everything that you can think of. The problem is that it's all hidden away somewhere and you have to take the time to dig around.

Update: The how-many function is defined in replace.el. To find out more about it, press C-h f how-many RET.

Emacs: Turning Day into night

|

I have gained an interest in cyberpunk novels again and have been looking at the Shadowrun RPG. One of the hallmarks of cyberpunk is a dark, depressing atmosphere. This darkness is also associated with the coolness that is running the shadows or jacking into the Matrix or whatever. But, I believe, there is a benefit to a dark-themed desktop: it hurts the eyes less after hours of staring at a light-themed desktop.

Find recent content on the main index or look in the archives to find all content.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by Movable Type 4.1