NW C-c ` | N C-c <UP> | NE C-c ' |
W C-c <LEFT> | E C-c <RIGHT> | |
SW C-c / | S C-c <DOWN> | SE C-c \ |
This will be only available after you activate picture-mode, (M-x picture-mode). Now, because picture-mode is often used in combination with another (say, you want to draw a nice little ascii-art diagram in an e-mail), you can activate picture mode, do your drawing action, and then go back to the previous mode with C-c C-c. There are some more interesting commands; please see the emacs reference manual for details.
ditaa
Now, after you've written all these fine ascii-art diagrams, you might want to make them a bit more flashy for inclusing in another document. For that, there is Ditaa, which I learned from my dear colleague Stefan. Ditaa is a GPL Java program, that takes an ascii-art diagram, and turns it into something flashy. See below for an example; we take some simple ascii art, and ditaa turns it into the nice picture on the right:(setq ditaa-cmd "java -jar <path-to-ditaa>ditaa0_6b.jar") (defun djcb-ditaa-generate () (interactive) (shell-command (concat ditaa-cmd " " buffer-file-name)))after which you can generate those pictures with M-x djcb-ditaa-generate. This is rather primitive of course. For example, it should be possible to integrate this with DocView (screencast), which is to be part of emacs 23. But this is left as an exercise to the reader...
artist-mode
There's another mode for emacs, called artist-mode, which is better suited when you want to express your emotions through art. It must be said, however, that it's often quicker to create some figures in artist-mode than in picture-mode; that's not really a problem, as you can switch between the two. There's a nice screen cast of someone using artist-mode to draw a linked-list in a code comment.For artist-mode, the most important thing to remember is Shift + middle-click on your mouse to change the tool you are using. And see the picture, which is my interpretation of naïve art. My lack of talent, however, cannot be blaimed on artist-mode, I'm afraid...
5 comments:
My emacs gives the artist-mode menu with just plain middle-click - I think the shift might be redundant.
don't know if this is the right post to comment on, but how when using this with org-mode, how do we get around the "C-c '"? These bindings de/activate the separate buffer for the chunk, and it is used for the NW direction. did u run into this?
@vinhdizzo: you can of course change the keybinding, or edit in another buffer.
but yeah, the C-c prefix is used in many places (esp. org-mode), conflicts are to be expected.
Using artist-mode in org-mode with sections collapsed causes a problem. It looks like artist-mode is matching the line you click on to a relative line (presumably to the top on the screen) in the buffer. Which counts the hidden lines too.
for using artist-mode in org-mode, just select some part, then use narrow-to-region, enable artist-mode, draw, then switch back to org-mode and use widen.
(imagine M-x in front of most commands :) )
Post a Comment