The Geek Parade
[Recent Entries][Archive][Friends][User Info]
Below are the 7 most recent journal entries recorded in the "uncle_toby" journal:
12:00 pm
[Link] |
emacs tips 2 * intro This is the second of the emacs tips series. The previous tip was sent earlier to some people on this list. I resent it with the license and so that it would be archived here. (Earlier versions will be available there)
For a look ahead, note that each email is formatted in org-mode. These can be read in emacs org-mode or exported as html; to be explained in a later tip. The next tips should be approximately weekly.
* the .emacs file
This is the initialization file that sets up your particular emacs environment, and it is the starting point for making emacs do exactly what you want. The file is usually found in the home directory (e.g., /Users/pball or /home/pball); the home directory is written as ~/
The first thing emacs does when it is run is to load and to evaluate the ~/.emacs file. "Evaluate" means that all the lisp commands in .emacs are executed. Remember that emacs is a lisp interpreter, and it's running all the time. Lisp programs that you run affect how emacs works. This can be helpful and a lot of fun.
* cool stuff to put in .emacs
Semicolons ; indicate comments in elisp. I've commented the following that you might want in your .emacs file.
(setq inhibit-startup-message t ;; you've seen it enough recursive-load-depth-limit nil ;; let emacs use all the resources it wants line-number-mode t ;; errors often point to line numbers column-number-mode t ;; good to keep you the left of 70 size-indication-mode t ;; I like to remember how big the file is frame-title-format "%b" ;; put the filename on the window title menu-bar-mode t ;; let's keep the menu bar visible-bell 1 ;; and DO NOT make noise pop-up-windows nil ;; self-explanatory pop-up-frames nil ;; ditto global-font-lock-mode t ;; turn code-coloring on font-lock-maximum-decoration t ;; make code maximally colorful mouse-yank-at-point nil ;; paste where you're pointing, not at `point' transient-mark-mode t ;; require-final-newline t ;; always put \n at the end of the file (stata...) tool-bar-mode nil ;; we don't need icons on a tool bar show-paren-mode t ;; always make parens colorful delete-selection-mode t ;; delete a marked block if user types global-auto-revert-mode t ;; always reload buffer if the file changes savehist-mode 1) ;; remember the ring of commands at M-x.
* if these emails don't work for you
There are lots of strategies to learn emacs: other tutorials, books, and example code. The following sites give lots of other sources of information.
http://www.gnu.org/software/emacs/manual/emacs.html http://www.emacswiki.org/cgi-bin/emacs-en/LearningEmacs http://tiny-tools.sourceforge.net/emacs-elisp.html
* less silly than it seems http://catb.org/~esr/writings/unix-koans/
One evening, Master Foo and Nubi attended a gathering of programmers who had met to learn from each other. One of the programmers asked Nubi to what school he and his master belonged. Upon being told they were followers of the Great Way of Unix, the programmer grew scornful.
“The command-line tools of Unix are crude and backward,” he scoffed. “Modern, properly designed operating systems do everything through a graphical user interface.”
Master Foo said nothing, but pointed at the moon. A nearby dog began to bark at the master's hand.
“I don't understand you!” said the programmer.
Master Foo remained silent, and pointed at an image of the Buddha. Then he pointed at a window.
“What are you trying to tell me?” asked the programmer.
Master Foo pointed at the programmer's head. Then he pointed at a rock.
“Why can't you make yourself clear?” demanded the programmer.
Master Foo frowned thoughtfully, tapped the programmer twice on the nose, and dropped him in a nearby trashcan.
As the programmer was attempting to extricate himself from the garbage, the dog wandered over and piddled on him.
At that moment, the programmer achieved enlightenment.
* License: CreativeCommons Attribution-ShareAlike 3.0 You are free: * to Share — to copy, distribute and transmit the work * to Remix — to adapt the work Under the following conditions: * Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). * Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license. * For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page. * Any of the above conditions can be waived if you get permission from the copyright holder. * Nothing in this license impairs or restricts the author's moral rights. See http://creativecommons.org/licenses/by-sa/3.0/ for the full text. * last revised: [2007-04-08 01:21PDT]
Tags: emacs
|
12:00 pm
[Link] |
printers, 3x5", and linux In my quest to join emacs' org-mode to a hipster PDA, I need a printer that will write on 3x5" index cards.
I went to Fry's, found the Samsung ML-2250, and noted that on the box it said that it printed 3x5" and was linux [sic] compatible. I like Samsung, I've got a bunch of very nice monitors from them, so I bought it. All good, I thought, but when I got it home, I found that it didn't quite work.
The gnu/linux print system, CUPS, uses PPD files to define each printer's specific capabilities. The Samsung's PPD file that comes from the linuxprinting.org folks does not include a 3x5" page definition, nor does it have a custom size stanza, i.e., something that looks like this:
*%==== Custom Page Sizes ==================== *NonUIOrderDependency: 40 AnySetup *CustomPageSize *VariablePaperSize: True *LeadingEdge Short: "" *DefaultLeadingEdge: Short *MaxMediaWidth: "612" *MaxMediaHeight: "1152" *HWMargins: 13 13 13 13 *CustomPageSize True: " <</brcustompagesize>> setpagedevice pop pop pop << /PageSize [ 5 -2 roll ] /ImagingBBox null >> setpagedevice " *End *ParamCustomPageSize Width: 1 points 197 612 *ParamCustomPageSize Height: 2 points 328 1152 *ParamCustomPageSize WidthOffset: 3 points 0 0 *ParamCustomPageSize HeightOffset: 4 points 0 0 *ParamCustomPageSize Orientation: 5 int 0 3
Six or so frustrating hours of googling and PPD file hacking got me no closer. Genehack showed how it should be done, but on a Brother printer.
I took the Samsung back to Fry's, and to their credit, they took it back without charging me anything for the used toner. I got the Brother HL-5250DN, and it Just Works. Kudos to Brother for well-written, GPL'd PPD files!
A whole night killed, but I did get it done, at last.
Current Mood: accomplished Current Music: Madeleine Peyroux, "Careless Love" Tags: emacs
|
12:00 am
[Link] | There was no way I could just use the hipster PDA, though I admire it deeply in principle. That meant that I had to find a way to store my GTD lists in some electronic form. This turns out to be less easy than one might think.
The geeks over at 43 folders have some good pages on getting started with toys. Still, I found too much on Windows and OSX, not enough open source.
My pre-GTD technique was just lists, and more lists. I had "yellow stickies" all over my desktop. When I finished tasks, I'd cut them and paste them into a "done" todo with a timestamp. But I wanted a little more.
GTD recommends that you keep the "right buckets" of places to put information:
- Projects & project plans
- Waiting (for someone else to do something - time/date)
- Next actions (for me to do ASAP, with priorities)
- Calendar (stuff that happens at a specific time, the "hard edges")
- Reference material
- Someday/maybe (hold for review, new project ideas)
- and Trash.
On top of these pieces, each item needs to be tagged with a "context" that describes the appropriate place/time/resource needed to do the task ("with computer," "online," "talking to boss," etc).
The calendar is easy, I'll just keep using http://www.kontact.org/korganizer. But the rest of it was hard. I came up with the following critiera for a good system:
- Ease of entry
- relevant fields
- sorting and filtering
- context tags
- portability (version control, multiple machines, on mobile device?)
- done marking & archiving
I considered staying with the yellow-stickies, which are great for ease of entry but suck at everything else. Then I tried a spreadsheet, but the macro programming was a PITA and the binary storage meant that version control systems can't integrate changes I might make simultaneously on different machines. The GTDTiddlyWiki is pretty cool, but it's a little slow, and entries involve too many steps. QToDo and other to-do specific task managers (such as korganizer's to-do) were both limited in what I could do, and slow to get entries in.
And, as is so often the case, emacs is the answer. I tried planner-mode, but that was too complicated. emacs' org-mode turned out to be exactly what I need. More on how I've tweaked it as we go along.
Current Mood: busy Tags: emacs
|
05:41 pm
[Link] |
problem with emacs faces

there's a problem with the faces: something is hard-coded to a gray90 or so. Is it blank-space-face? blank-tab-face? fringe? I've tried resetting all of them and they're all equally wrong.
Tags: emacs
|
05:37 pm
[Link] |
keithp's xft emacs is better available here. Compiled in 64-bit mode, needed to install texinfo pkg. Still segfaults, but much less than my first attempt.
Tags: emacs
|
01:55 pm
[Link] |
xemacs is not the answer Trying to install xemacs 21.5.26 from source, it needed the xbitmaps package which weirdly was not installed by default. It just needs an apt-get, but bitmaps doesn't come in with the rest of the xlibs.
The compile goes ok after many additional packages are installed. Weird configure options:
./configure --with-x-toolkit=gtk --with-xft=emacs,tabs,menubars,gauges --with-debug=no --with-error-checking=no --with-widgets=athena
Is what's needed. However, there's a porting job b/c I have to make emacs' ado-mode for stata work for xemacs -- I have to duplicate the :inherit functionality of fsf-emacs for ado-mode. Plus, I have to say that I think xemacs is not as clean looking as fsf-emacs. Back to fsf-emacs.
Current Location: at work, of course Tags: emacs
|
01:22 pm
[Link] |
xft emacs is flaky Somehow emacs 22.0.50 with the XFT patch has become completely flaky. I compiled it in 64-bit and it segfaults in seconds, ditto in a 32-bit chroot. Ah well. On the Ubuntu forum, folks watching the changelog suggest that the XFT development has stalled or branched. The ubuntu maintainer of emacs-cvs thinks that it will be a few months before there's any stability. Argh.
Current Location: work, of course Current Mood: aggravated Tags: emacs
|
|