OESF Portables Forum

Everything Else => General Support and Discussion => Zaurus General Forums => Archived Forums => Software => Topic started by: ZDevil on March 31, 2007, 11:52:27 am

Title: Emacs For Zaurus
Post by: ZDevil 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/ (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 (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/ (http://www.focv.com/ipkg/)
pdaXrom:
Emacs 21.4, the latest stable release (http://distro.ibiblio.org/pub/linux/distributions/pdaxrom/download/contrib/pgas/)
Emacs 23 (CVS 2007-03-14), the latest developmental version (https://www.oesf.org/forums/index.php?showtopic=23455&st=16), 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 (https://www.oesf.org/forums/index.php?act=Attach&type=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 (https://www.oesf.org/forums/index.php?act=Attach&type=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) (https://www.oesf.org/forums/index.php?act=Attach&type=post&id=4231)
Title: Emacs For Zaurus
Post by: ZDevil 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)
Title: Emacs For Zaurus
Post by: ZDevil 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 (http://www.emacswiki.org)

Mode-specific:
PlannerMode QuickStart:
http://www.emacswiki.org/cgi-bin/wiki/PlannerModeQuickStart (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/plannernewbie.html)
http://eclair.bizhat.com/emacs/plannerscreen1.html (http://eclair.bizhat.com/emacs/plannerscreen1.html)
http://eclair.bizhat.com/emacs/plannerscreen2.html (http://eclair.bizhat.com/emacs/plannerscreen2.html)

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

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

Just another GTD hacker:   
http://genehack.org/2004/09/21 (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 (http://sacha.free.net.ph/notebook/wiki/PlannerMode.php)

Nethack for Emacs!
http://www.nongnu.org/nethack-el/ (http://www.nongnu.org/nethack-el/)
Title: Emacs For Zaurus
Post by: zi99y 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.emacswiki.org/cgi-bin/wiki/download/css-mode.el)
  - http://www.ontosys.com/src/php-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 (http://www.emacswiki.org/cgi-bin/wiki/PhpMode)
Title: Emacs For Zaurus
Post by: Da_Blitz 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
Title: Emacs For Zaurus
Post by: xjqian on April 01, 2007, 01:08:22 am
great info. any plan to add this to the OESF wiki.
Title: Emacs For Zaurus
Post by: pgas 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 (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 (http://www.emacswiki.org/cgi-bin/emacs-en/InteractivelyDoThings) 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>
Title: Emacs For Zaurus
Post by: ZDevil 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.  
Title: Emacs For Zaurus
Post by: pgas 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
Title: Emacs For Zaurus
Post by: ZDevil 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?  
Title: Emacs For Zaurus
Post by: ZDevil on April 02, 2007, 04:32:40 pm
A list of games specially for Emacs:    
http://www.emacswiki.org/cgi-bin/wiki/CategoryGames (http://www.emacswiki.org/cgi-bin/wiki/CategoryGames)

Of course we can also play all those "console" games (in the shell mode).
Title: Emacs For Zaurus
Post by: ZDevil 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/ (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:

 [ You are not allowed to view attachments ]

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 (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://www.emacswiki.org/cgi-bin/wiki/BbdbImporters)
http://anirudhs.chaosnet.org/blog/2004.09.20.html (http://anirudhs.chaosnet.org/blog/2004.09.20.html)
http://www.splode.com/~friedman/software/e...sp/src/vcard.el (http://www.splode.com/~friedman/software/emacs-lisp/src/vcard.el)

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


Next I will demonstrate how to use BBDB in Planner.
Title: Emacs For Zaurus
Post by: ZDevil 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/ (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:

 [ You are not allowed to view attachments ]

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 (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.  
Title: Emacs For Zaurus
Post by: danr 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 (http://staff.science.uva.nl/~dominik/Tools/org/).  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
Title: Emacs For Zaurus
Post by: ZDevil 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://dto.freeshell.org/notebook/OrgTutorial.html)
http://members.optusnet.com.au/~charles57/GTD/orgmode.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.
Title: Emacs For Zaurus
Post by: ZDevil on April 04, 2007, 03:29:50 pm
BTW here is a great short wikipedia introduction to G(etting) T(hings) D(one). It's no philosophy, religion or mechanical procedure. It's just an (intuitive) approach to the amorphous, ever-changing pattern in real life.

http://en.wikipedia.org/wiki/Getting_Things_Done (http://en.wikipedia.org/wiki/Getting_Things_Done)
Title: Emacs For Zaurus
Post by: ZDevil on April 04, 2007, 04:56:41 pm
Alright, here are two antitheses:  

GTD: A new cult for the Info Age
http://www.wired.com/culture/lifestyle/news/2005/07/68103 (http://www.wired.com/culture/lifestyle/news/2005/07/68103)

Introducing the Hipster PDA  (really cool!     )
http://www.43folders.com/2004/09/03/introd...he-hipster-pda/ (http://www.43folders.com/2004/09/03/introducing-the-hipster-pda/)

Off topic, sorry ...
Title: Emacs For Zaurus
Post by: ZDevil on April 05, 2007, 07:17:10 am
Setting deadlines for tasks

Here is yet another useful functionality: setting deadlines to tasks.

First, add this in ~/.emacs:
Code: [Select]
(require 'planner-deadline)(Re)Start Emacs Planner to let the change take effect.

Then go to your tasks. Add a deadline by M-x planner-deadline-add.
You will see a deadline tag show up at the end of the task, e.g.
Code: [Select]
#B _ Return books to the library {{Task 12}} {{Deadline: 2007.04.12 - 7 days}} (@Research)which is read off as: Priority | Status | Task description | Task id | Deadline (with remaining days | Context tag
Also Planner will tell you how many days are left.  Nice!

Of course, since you can add deadlines, you can change them. Try
M-x planner-deadline-remove
M-x planner-deadline-change
M-x planner-deadline-update


Again, you may want to assign easy keys for them if you use them a lot.
Title: Emacs For Zaurus
Post by: ZDevil on April 05, 2007, 05:38:49 pm
Maximize your view in Emacs

Because of the small screen size, every single row and column counts in displaying text. Here is a trick to have Emacs display in the whole screen on your Z.

(Go directly to Step 2 if you are not using GTKTerm2 to launch Emacs)

Step 1: Maximize view in GTKTerm2
Run GTKTerm2 with this:
Code: [Select]
gtkterm2 -s --win-height=52(-s = "Stealth" mode; --win-height = number of rows)
Or you can edit /usr/share/applications/gtkterm2.desktop once and for all.

Then GTKTerm2 will run without any window thingies (frame, scroll bar, menu tool bar) but only a big box filling up the display.  (You should use a slightly lower window height, say 48, in Matchbox because the matchbox panel is not collapsible and may block the view of the last few rows.

If you want to reclaim the remaining few rows at the bottom, then maximize the window, in the same way as in any other application, e.g. Ctrl-Alt-M in matchbox, and set you own keys in icewm in ~/.icewm/preferences


Step 2: Get rid of UI stuff in Emacs
Add these in your .emacs file:
Code: [Select]
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(Got it from: htp://www.cabochon.com/~stevey/blog-rants/effective-emacs.html)


Before ...

[img]http://farm1.static.flickr.com/195/447615634_290e64bf19_o.png\" border=\"0\" class=\"linked-image\" /]

After ...

[img]http://farm1.static.flickr.com/221/447615654_88e316382b_o.png\" border=\"0\" class=\"linked-image\" /]

Now Emacs can work more efficiently on your Z!
Title: Emacs For Zaurus
Post by: leskimo on April 06, 2007, 06:00:44 am
Thanks for the planner tips! Didn't know about the deadline feature..

I got rid of the toolbar, menubar etc a couple of months ago and yes it makes the work area bigger but also looks so much nicer
Title: Emacs For Zaurus
Post by: ZDevil on April 06, 2007, 06:38:49 am
Actually there is much more to explore in Planner... it's a really powerful mode.
Next I'm gonna find out how to generate status report, which is very useful for task review.  

Please let me know if you come up with anything interesting.
Title: Emacs For Zaurus
Post by: ZDevil on May 13, 2007, 05:08:38 am
Just compiled Emacs-unicode2 on OpenBSD/Zaurus.
Compilation goes faster and smoother than using zgcc on pdaX.
And the build also loads and runs much faster under OBSD!
Time to resume working with Emacs@Zaurus.
Title: Emacs For Zaurus
Post by: telemetric_au on May 14, 2007, 06:22:48 am
just a note: i yesterday compiled and ran successfully emacs 21.4ish on my 5500 with pdaxrom with too much hassle... only prob is screen way to small so ended up taking it off straight away... just had to check it out after seeing mew on my big puter

you want to see this post/thread for the only error i got for a fix:

https://www.oesf.org/forums/index.php?showtopic=3241&st=0# (https://www.oesf.org/forums/index.php?showtopic=3241&st=0#)
https://www.oesf.org/forums/index.php?showtopic=3241&st=15# (https://www.oesf.org/forums/index.php?showtopic=3241&st=15#)
Title: Emacs For Zaurus
Post by: ShiroiKuma on June 06, 2007, 07:13:33 am
Does anyone know how to enable history when running bash in Emacs via M-x shell

What I mean is, when you press the up arrow in a terminal you get the previous command you keyed in.

This works in eshell in Emacs, however if you run bash in Emacs and hit the up arrow it just moves the cursor up...

Now I'd like to run bash for chrooting in emacs, because you can chroot in eshell, but then input completion doesn't work.

Any solution for this?
Title: Emacs For Zaurus
Post by: tanjian2 on June 06, 2007, 08:37:12 am
Quote
Does anyone know how to enable history when running bash in Emacs via M-x shell

What I mean is, when you press the up arrow in a terminal you get the previous command you keyed in.

This works in eshell in Emacs, however if you run bash in Emacs and hit the up arrow it just moves the cursor up...

Now I'd like to run bash for chrooting in emacs, because you can chroot in eshell, but then input completion doesn't work.

Any solution for this?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=162691\"][{POST_SNAPBACK}][/a][/div]
Try M-p (Emacs speak for esc-p or alt-p).
Title: Emacs For Zaurus
Post by: pgas on June 06, 2007, 08:38:03 am
either use M-p M-n
or put:
Code: [Select]
(add-hook 'shell-mode-hook
  (lambda ()
   (local-set-key '[up] 'comint-previous-input)
   (local-set-key '[down] 'comint-next-input)))
in your .emacs
Title: Emacs For Zaurus
Post by: ShiroiKuma on June 06, 2007, 10:27:48 am
Thanks a lot.
Title: Emacs For Zaurus
Post by: ShiroiKuma on June 06, 2007, 04:16:23 pm
One more thing, is it possible to get previous input based on what you type, I mean for instance when you type ls and then up arrow, you get choices only from prior commands starting with ls...

I found the comint-previous-matching-input, but this then asks you for regexp, thus if you give it ls, it'll come up with the history. But if you type ls in the shell buffer and then run comint-previous-matching-input it again asks you for the regexp, and doesn't take what you entered on the line as the regexp.

Is there a way to do this?
Title: Emacs For Zaurus
Post by: pgas on June 07, 2007, 04:50:33 am
I don't think there is something like that, maybe some extensions...
or use M-x ansi-term RET RET and the C-r from read-line ...
Title: Emacs For Zaurus
Post by: Asterix on August 10, 2007, 08:52:18 pm
Quote
Where to download Emacs for Zaurus:
[div align=\"right\"][a href=\"index.php?act=findpost&pid=157666\"][{POST_SNAPBACK}][/a][/div]

Thanks for posting this. I've been looking all over for a non-X Emacs.

Asterix
Title: Emacs For Zaurus
Post by: gojira on October 19, 2008, 10:22:40 am
Quote from: ZDevil
#4 To use stylus/mouse/finger (  ) to help nevigating:
Add this to the end of .emacs:
Code: [Select]
(xterm-mouse-mode)(zdevil)

this works with qkonsole in sharprom, nice, thanks! (but should be
Code: [Select]
(xterm-mouse-mode t)I think)
Title: Emacs For Zaurus
Post by: gojira on October 19, 2008, 10:25:12 am
Quote from: Asterix
Thanks for posting this. I've been looking all over for a non-X Emacs.

X-enabled emacs all run in terminal mode if there's no X present (as in emacs -nw).