Author Topic: Emacs For Zaurus  (Read 17248 times)

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Emacs For Zaurus
« on: March 31, 2007, 11:52:27 am »
What is [span style=\'font-size:14pt;line-height:100%\']Emacs[/span]?

According to the Emacs Manual, Emacs is: "Emacs is the extensible, customizable, self-documenting real-time display editor."

An alternative definition: Emacs is simple, powerful, all-purpose text-mode environment in which you can edit different files (e.g. texts, source codes), do PIM, implement GTD (David Allen's "Getting Things Done" approach), do outlining, play games (e.g. tetris, nethack), listen to music, emailing, do programming, and even have the whole shell live in it ......

Homepage: http://www.gnu.org/software/emacs/

Let me start a new thread here for people to discuss various tips and tricks for using Emacs ON ZAURUS, in order not to confuse the thread for testing builds.  

Although I use it under pdaXrom, I suppose virtually all the tips and tricks should work across platforms for Z.

My initial plan is to summarize the points we have in https://www.oesf.org/forums/index.php?showtopic=23455 ,
and I would like to add new things to this very first post for easy reference.

Of course, this is not meant to start any flame or holy war between emacs and vi, which for me is totally pointless and nonsense from the point of view of a non-geek common user.  

I am just a very dummy beginner and I am looking forward to learning from you all!  

*********

[span style=\'font-size:14pt;line-height:100%\']Where to download Emacs for Zaurus:[/span]

Sharp/Cacko: Emacs 22 CVS 2007-03-22 http://www.focv.com/ipkg/
pdaXrom:
Emacs 21.4, the latest stable release
Emacs 23 (CVS 2007-03-14), the latest developmental version, with good utf8 and CJK support)
OZ: ?

Sample .emacs file (all the settings in one plain text file put under the HOME directory): https://www.oesf.org/forums/index.php?act=A...pe=post&id=4189  (will update constantly)

Very newbie guide for Z users:
https://www.oesf.org/forums/index.php?act=A...pe=post&id=4261
(please comment and help improve that. the only principle: keep it simple and geek-free)


Different (compiled) mode packages for Z:
PIM-Suite (planner, muse, bbdb, remember)
« Last Edit: April 01, 2007, 07:00:51 am by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Emacs For Zaurus
« Reply #1 on: March 31, 2007, 12:56:10 pm »
[span style=\'font-size:14pt;line-height:100%\']Tips & Tricks:[/span]
#1 You can always edit the file [span style=\'font-size:14pt;line-height:100%\']~/.emacs[/span]  to add new settings and to modify how Emacs behave to suit your needs. It's just a plain text file.

#2 Online help
The very first screen gives you a number of key combos that take you to a wealth of information. For example,
C-h r : the Emacs manual
C-h i : all the manuals
C-h m : summary of commands of the current mode
C-h b : shortcut keys of the current mode

#3 To use Dire Mode:
Add this to .emacs:
Code: [Select]
(setq dired-use-ls-dired nil)  
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
(radiochickenwax)

#4 To use stylus/mouse/finger (  ) to help nevigating:
Add this to the end of .emacs:
Code: [Select]
(xterm-mouse-mode)(zdevil)


#5 To enable SCIM/ UIM/ GCIN/ XIM inputmethods to enter CJK (or other multi-byte) characters:
Run emacs 23 from a terminal program like this:
Code: [Select]
emacs -nw -color
(zdevil)

#6 Emacs also uses the directory /usr/share/emacs/site-lisp/ for third party site-wide package installations
(pgas)


#7 Make C-x C-b work better to switch between buffers
Code: [Select]
(global-set-key [?\C-x?\C-b]
              (lambda (&optional files-only)
                   (interactive "P")
                   (let ((b (list-buffers-noselect files-only)))
                     (display-buffer B)
                     (pop-to-buffer B))))
(zi99y)

#8 Switch through buffer list easily.

- Download swbuff.el and copy it to your elisp folder (http://sourceforge.net/projects/emhacks/).

- Add the following to your .emacs config file:
Code: [Select]
(require 'swbuff)
(global-set-key (kbd "C-x b") 'swbuff-switch-to-next-buffer)

To cycle forward thru buffers use "C-x b". You can add another line to bind another key to "swbuff-switch-to-previous-buffer" cycle in the opposite direction.
(zi99y)
« Last Edit: April 02, 2007, 01:14:52 pm by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Emacs For Zaurus
« Reply #2 on: March 31, 2007, 12:56:21 pm »
[span style=\'font-size:14pt;line-height:100%\']Links:[/span]

General:

Emacswiki -- the ultimate source of information
http://www.emacswiki.org

Mode-specific:
PlannerMode QuickStart:
http://www.emacswiki.org/cgi-bin/wiki/PlannerModeQuickStart

eclair's very nice newbie guide to planner mode:
http://eclair.bizhat.com/emacs/plannernewbie.html
http://eclair.bizhat.com/emacs/plannerscreen1.html
http://eclair.bizhat.com/emacs/plannerscreen2.html

GTD with Emacs PlannerMode:   
http://pigpog.com/node/1974

J. Klymak --- Planner Mode (good read)
http://saturna.seos.uvic.ca/~jklymak/PlannerMode.html

Just another GTD hacker:   
http://genehack.org/2004/09/21

Sacha Chua's (the maintainer of planner.el) page, with lots of practical and insightful tips:
http://sacha.free.net.ph/notebook/wiki/PlannerMode.php

Nethack for Emacs!
http://www.nongnu.org/nethack-el/
« Last Edit: March 31, 2007, 02:45:25 pm by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

zi99y

  • Sr. Member
  • ****
  • Posts: 282
    • View Profile
Emacs For Zaurus
« Reply #3 on: March 31, 2007, 12:56:56 pm »
Howto: Add php-mode and css-mode and autoload them when you open a php/css file:

- Download the two lisp files to your elisp dir:
  - http://www.emacswiki.org/cgi-bin/wiki/download/css-mode.el
  - http://www.ontosys.com/src/php-mode.el

- Add the following to your .emacs config file:

Code: [Select]
(autoload 'php-mode "php-mode" "PHP editing mode" t)
(add-to-list 'auto-mode-alist '("\\.php3\\'" . php-mode))
(setq auto-mode-alist
       (append '(("\\.php$" . php-mode))
               auto-mode-alist))

(autoload 'css-mode "css-mode" "Mode for editing CSS files" t)
(setq auto-mode-alist
       (append '(("\\.css$" . css-mode))
               auto-mode-alist))

- Note: There are other versions of php-mode to choose from here:
  - http://www.emacswiki.org/cgi-bin/wiki/PhpMode

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
Emacs For Zaurus
« Reply #4 on: March 31, 2007, 11:19:18 pm »
not to steal EMACs thunder (and dont want to start a flame war) but nano is handy for those who prefer the ctrl bindings rather than esc as its shipped by default with most distros (so instead of using vi and you want somthing closer to emacs while setting the system up give it a go)

nowhere near the amount of features as emacs, just handy on new or unfamiliar systems
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware

xjqian

  • Sr. Member
  • ****
  • Posts: 497
    • View Profile
    • http://
Emacs For Zaurus
« Reply #5 on: April 01, 2007, 01:08:22 am »
great info. any plan to add this to the OESF wiki.
My Blog | 6000L Tosa + sled | is: Angstrom | was: pdaXrom 1.1.0beta1 | was: stock 1.12 rom + no-ffpe fash kernel + X/Qt Debian |
CF GPS (FGPCFCD01) | USB "Prolific 2303" GPS (USB-UG-200) | Socket CF BT rev. H |  USB "Pegasus II" Ethernet (ADM8511) | PocketTop IR kbd | sip:527630@fwd.pulver.com
Todo: OESF wiki | stable VOIP app | usable GPS app |      Wishlist: VOIP + Bluetooth | GPS + Routing Calc

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Emacs For Zaurus
« Reply #6 on: April 01, 2007, 03:40:33 am »
Quote
#8 Switch through buffer list easily.
the method often recomended for switching buffers is iswitchb (included in emacs from v21)
see:
http://www.emacswiki.org/cgi-bin/emacs-en/IswitchBuffers
(and if you like it be sure to check http://www.emacswiki.org/cgi-bin/emacs-en/...ctivelyDoThings which is included in emacs from cvs)

also, in emacs from cvs (22,23) there are next-buffer and previous buffer
bound by default to C-x <right> and C-x <left>
SLC-860 cacko / senao wifi

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Emacs For Zaurus
« Reply #7 on: April 02, 2007, 12:22:29 pm »
I find it clumsy to type "yes/no" in many confirmation messages with the Z keyboard.
So I add this line in ~/.emacs:

Code: [Select]
(fset 'yes-or-no-p 'y-or-n-p)
Restart Emacs. Then you will only need to type "y" or "n" to all dialogues.  

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Emacs For Zaurus
« Reply #8 on: April 02, 2007, 12:33:30 pm »
also try Esc / (M-/) it tries to complete the word, searching for possible completion in the opened buffers
SLC-860 cacko / senao wifi

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Emacs For Zaurus
« Reply #9 on: April 02, 2007, 12:57:13 pm »
Customizing the keys (Example: PlannerMode GTD use)

1. In order to use Planner more smoothly, I remap the key combos (C-x command) so as to press fewer keys on the Zaurus keyboard:

Most default keys are already using the Control key, but not so much for the Alt (Cancel) key

I did this in ~/.emacs:

2. To write down a task/note/persistent memo, I use these:
Code: [Select]
(global-set-key (kbd "M-0") 'planner-create-task-from-buffer)
(global-set-key (kbd "M-9") 'planner-create-note)
(global-set-key (kbd "M-8") 'remember)
meaning:
Alt + 0 = "I think of one new task!"
Alt + 9 = "Let me jot down a note."
Alt + 8 = "I want to keep this note both for today and in its project/plan page."

3. Besides recording stuff, I also need to manage them from time to time. I use these keys for the most frequent actions:
Code: [Select]
(global-set-key (kbd "M-7") 'planner-copy-or-move-task)
(global-set-key (kbd "M-6") 'planner-delete-task)
(global-set-key (kbd "M-5") 'planner-delete-note)
meaning:
Alt/Cancel + 7 = Duplicate a task or move it to somewhere.
Alt/Cancel + 6 = Delete the task.
Alt/Cancel + 5 = Delete the note.
(I can use both because the number keys "7", "8", "9" are in the middle of the top row.   )

4. To evaluate and keep track of my work (tasks), I use these keys:
Code: [Select]
(global-set-key (kbd "M-i") 'planner-task-in-progress)
(global-set-key (kbd "M-k") 'planner-task-done)
(global-set-key (kbd "M-u") 'planner-task-pending)
(global-set-key (kbd "M-o") 'planner-task-open)
(global-set-key (kbd "M-l") 'planner-task-delegated)
(global-set-key (kbd "M-.") 'planner-raise-task-priority)
(global-set-key (kbd "M-,") 'planner-lower-task-priority
meaning:
Alt + k = "I have finished it!"
Alt + i = "I am doing it."
Alt + l = "I will let somebody else do it (for me)." (add a contact entry using bbdb)
Alt + u = "I have to stop doing it (for now)."
Alt + o = "Hmm... I have to rethink about its status..."
Alt + . = "This task is both urgent and important!"  (Priority A)
Alt + , = "This task is important but not very urgent"  (Priority C)

[A small note: I give the Task Priorities A/B/C my own interpretation different from John Wrigleys'. For me it's more intuitive to weigh tasks in terms of the matrix of URGENCY and IMPORTANCE. So i have: urgent and important (A), urgent and not important (B ), not urgent but important (C ), while leaving things neither urgent nor important to general notes (hence no priority). By default a newly created task is given a "B" status (urgent) to remind me of dealing with it. ]

Together with very straightforward context tags (e.g. @Home, @Office, @Internet, @Supermarket ... as individual "pages"), my basic working GTD setup begins to emerge.    


A technical question: I find the key setting command M-x global-set-key fails to recognize quite a number of keys on the Zaurus keyboard, including Fn, the applications keys (Calendar, Address, Mail) and the screen keys. Any workaround?  
« Last Edit: April 03, 2007, 05:53:25 am by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Emacs For Zaurus
« Reply #10 on: April 02, 2007, 04:32:40 pm »
A list of games specially for Emacs:    
http://www.emacswiki.org/cgi-bin/wiki/CategoryGames

Of course we can also play all those "console" games (in the shell mode).
« Last Edit: April 02, 2007, 04:33:34 pm by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Emacs For Zaurus
« Reply #11 on: April 04, 2007, 07:03:39 am »
Using the BBDB address book: a short how-to

BBDB  (the Insidious Big Brother Database   http://bbdb.sourceforge.net/ ) is a very popular address book mode in Emacs. It is simple yet very powerful as you can link its address book entries easily to your notes, plans, emails, etc.

Setting up:
Before using BBDB, make sure you have these lines in your .emacs:
Code: [Select]
(add-to-list 'load-path "/usr/share/emacs/23.0.0/lisp/bbdb/lisp")    # OR any other path where BBDB is installed.
(require 'bbdb)    # This is to enable BBDB in Emacs
(require 'planner-bbdb)    # This is to enable BBDB in Planner Mode
(setq bbdb-north-american-phone-numbers-p nil)    # You need this line unless ALL your contacts have phone numbers in the US format.
(bbdb-initialize)    # This is to load BBDB when starting Emacs (?)  

Create an address book entry in BBDB:
Simply use the command [span style=\'font-size:14pt;line-height:100%\']M-x bbdb-create[/span] (you may want to assign an easier keyboard shortcut to this) anywhere.
Then you will be asked for providing these in order: Name, Company, Net address, Address Description, Street Line(s), City, State, Zip Code, Country, Phone Location, Phone, Additional Comments.
Here is an example of a faked entry:

 [ Invalid Attachment ]

To view a whole list of entries in your address book, simply do a [span style=\'font-size:14pt;line-height:100%\']M-x bbdb [Enter] [Enter].[/span]
You can always modify the record in the BBDB window, such as e (edit current field), d (delete current field or record), and so on, for more see http://bbdb.sourceforge.net/bbdb.html#SEC33

The whole bbdb database is just a plain text file ~/.bbdb. But we'd better modify things in Emacs but not directly in the file manually or something may go wrong.

BBDB seems to support import and export its database a vcard or csv format. But I have yet to play with them.

Importing:
http://www.emacswiki.org/cgi-bin/wiki/BbdbImporters
http://anirudhs.chaosnet.org/blog/2004.09.20.html
http://www.splode.com/~friedman/software/e...sp/src/vcard.el

Exporting:
http://www.emacswiki.org/cgi-bin/wiki/BbdbExporters
http://www.emacswiki.org/cgi-bin/wiki/bbdb-vcard-export.el


Next I will demonstrate how to use BBDB in Planner.
« Last Edit: April 04, 2007, 07:15:55 am by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Emacs For Zaurus
« Reply #12 on: April 04, 2007, 07:09:22 am »
Adding contacts linking to BBDB address book

Example: Adding contacts in Planner:

Ok, now here is a way to add contacts linking to the BBDB address book, so that you task or note or scheduled items or even things in your project (plan) pages will be associated with some particular person, and you can always look it up by simply clicking the hyperlink.

The way to add contacts in Planner Mode is actually very simple: just type [span style=\'font-size:14pt;line-height:100%\']bbdb://NAME[/span] in the exact location where you want the contact to appear.
(Many thanks to Sacha Chua who makes this happen!)

Upon finishing the last bit, that line will automatically turn into a link to bbdb!
The actual structure is:
Code: [Select]
[[bbdb://NAME]]      # you can see the structure when you are editing it.By NAME, you can use either a full personal name, URL, or email address, OR, more easily, just any word in the address book entry (or more technically, anything that is a searchable *regular expression*, see http://linuxreviews.org/beginner/tao_of_regular_expressions/ for a good start.   )

In cases where there is space between the NAME words (which is not unusual), just put a "." between them, e.g. to add "John Smith" we can use bbdb://john.smith

Let's say we have an address book entry for OE forum and I'm creating a task associated with this entry. After writing down the task and adding entry for oesf there, this is what you will see when clicking the contact link:

 [ Invalid Attachment ]

Actually you can make contacts linking to the BBDB address book in many different modes. Using gnus Gnus (a popular email client in Emacs) with BBDB seems very common (for setting up, see http://bbdb.sourceforge.net/bbdb.html#SEC19 ). The BBDB in my pdaXrom emacs-pim-suite package was not compiled with Gnus. Perhaps I should include this in the next version of the pim package.  
« Last Edit: April 04, 2007, 07:38:31 am by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

danr

  • Full Member
  • ***
  • Posts: 138
    • View Profile
    • http://
Emacs For Zaurus
« Reply #13 on: April 04, 2007, 10:43:20 am »
Hi ZDevil,

I was trying out the Planner method to GTD, but then this threw a spanner in the works: Org mode.  Org mode appears to be a method of taking down notes using outlines, and can do many other things as well, including a number of different GTD methodologies.  I've had a go with it and it is very complex to learn; in fact the manual weighs in at nearly 100 pages!  But I think the main advantage is that notes and todos are kept together in one place, which is better than having two copies of the same data as in Planner.  There are key presses to show you all your todos, and to hide the bits you're not currently working on.

Dan
SL-C860 running Debian EABI on top of Angstrom 2.6 kernel

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Emacs For Zaurus
« Reply #14 on: April 04, 2007, 03:13:11 pm »
Yes, I am aware of Org Mode, and am very interested in trying it out as well.
The reason why I took the trouble to read about and set up Planner is its wiki functionality and free-form: I can casually jot down anything I think of *before* organizing (or processing, categorizing) the ideas. Functions kinda like THE GTD inbox.
Prioritizing, tracking, annotating, etc can all come later when they are being processed altogether.
And the notes and tasks can always be associated with one another freely and with some "page" (I call it "Project plan").
Planner also allows me to publish any related stuff together in one single html.

I am not sure about how Org Mode fares in this respect. But I am more tempted to use a free association approach than a stricter hierarchical way. Moreover Sacha Chua has done such a great job to finetune Planner specially for GTD use (just check out her blog   ).  Being able to use contextual tags (and more than one is allowed for each task/note) is a great plus.

By the way I have already reserved two good reads for the coming holiday:
http://dto.freeshell.org/notebook/OrgTutorial.html
http://members.optusnet.com.au/~charles57/GTD/orgmode.html

Of course it will be cool if you can tell me how you use Org Mode to help organize RL.
« Last Edit: April 04, 2007, 03:31:27 pm by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]