emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: meingbg <meingbg@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Script to get org-mode working on your cell phone.
Date: Fri, 24 Jul 2009 16:56:24 +0200	[thread overview]
Message-ID: <e83e84da0907240756g5ce7a65eu967ca3baa3a2cd50@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1378 bytes --]

Hi,

I recently ran across this comment in the org-mode survey:


> I'm on the lookout for a cell phone that runs Emacs, but… I haven't
> found any mechanisms for remotely adding/editing timestamps,
> changing the state of TODO items, etc. Neither have I found a way
> to trigger reminder sounds, e-mails, phone calls, or IM messages.
> I'm not sure about the best way to approach "mobile org-mode"…
> A web-interface like Webjimbo? More robust import/export/sync to
> iCal or GData? If we can find a way to usefully sync org-mode with
> mobile devices, it'll be just about perfect.


After reading that comment, I wrote cellphone.el that makes it possible to
actually do stuff in emacs on your cell phone.
I have a cell phone with a ssh app, a (very) small qwerty keyboard and
left/right arrow keys, but since there's no Ctrl or Alt keys, working in
Emacs is a pain (every time you need the Ctrl key, you need to go through a
menu). cellphone.el works by setting up several "cellphone keymaps". Each
cellphone keymap binds the letter keys a-z to commands of your choice. An
"orgmode" keymap is included as an example. You can easily select the keymap
with left/right arrow keys.

Please let me know your opinion about the script, as well as any tips of
getting more productive with orgmode on your cell phone.

The script is attached.

//meingbg

[-- Attachment #1.2: Type: text/html, Size: 1503 bytes --]

[-- Attachment #2: meingbg-cellphonemode.el --]
[-- Type: application/octet-stream, Size: 3231 bytes --]

;Author and Copyright 2009: meingbg, email: meingbg at gmail dot com
;License: BSD

;cellphonemode.el is not a real mode for emacs; rather, it's a
;startup script for making it easier to work in emacs on a cell
;phone (through ssh etc)

;When you're on a cell phone, type M-x cellphone-on <RET>

;functions to make the letter keys have different meaning dependent on
;which cellphone keymap is active
(defun cellphone-switch-map (mapname)
  (let ((map (member mapname cellphone-maps)))
    (when map
      (cellphone-cleanmap)
      (cellphone-bind (cadr map))
      (setq cellphone-current-map mapname)
      (message "%s" (concat "KEYBOARD: " mapname)))))
(defun cellphone-bind (bindings)
  (when (cdr bindings)
    (let ((key (car bindings)) (bind (cadr bindings)))
      (cond ((symbolp bind) (global-set-key key bind))
            ((or (vectorp bind) (stringp bind))
             (let ((bf (key-binding bind)))
               (if (symbolp bf) (global-set-key key bf))))))
    (cellphone-bind (cddr bindings))))
(defun cellphone-cleanmap ()
  (mapcar (lambda (x) (global-set-key x 'self-insert-command))
          '("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m"
            "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z"
            "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "," ".")))
(defun cellphone-switch-map-next ()
  (interactive)
  (let ((a (apply #'list cellphone-maps)))
    (setcdr (last a) a)
    (cellphone-switch-map (nth 2 (member cellphone-current-map a)))))
(defun cellphone-switch-map-previous ()
  (interactive)
  (let ((a (apply #'list (reverse cellphone-maps))))
    (setcdr (last a) a)
    (cellphone-switch-map (nth 2 (member cellphone-current-map a)))))
(setq cellphone-off-menu-bar-mode menu-bar-mode)

;Make left and right arrow keys switch cellphone keymap
(defun cellphone-on ()
  (interactive)
  (menu-bar-mode 0)
  (global-set-key [right] 'cellphone-switch-map-next)
  (global-set-key [left] 'cellphone-switch-map-previous)
  (cellphone-switch-map (car cellphone-maps)))
(defun cellphone-off ()
  (interactive)
  (cellphone-cleanmap)
  (menu-bar-mode (if cellphone-off-menu-bar-mode 1 0))
  (global-set-key [right] 'forward-char)
  (global-set-key [left] 'backward-char))



;Define cellphone keymaps                  <<< This is where you CUSTOMIZE
(setq cellphone-current-map "off"
;Each cellphone keymap is defined by two items in cellphone-maps.
;First the name as a string, then a list defining the bindings.
;Each binding is defined by two items in the binding list. First
;a string containing the character two be bound to a function,
;then either a function name it should be bound to or a key
;combination that currently is bound to the desired function.
      cellphone-maps '(
"off"
()
"Movement"
("i" [?\C-p] "j" [?\C-b] "k" [?\C-n] "l" [?\C-f])
"orgmode"
("f" [?\C-c ?\C-n] "d" [?\C-c ?\C-p] "r" [?\C-c ?\C-f] "e" [?\C-c ?\C-b] "u" [?\C-c ?\C-u] "n" [C-return] "h" [?\C-c return] "i" [M-S-up] "j" [M-S-left] "k" [M-S-down] "l" [M-S-right] "w" [?\C-c ?\C-x ?\C-w] "y" [?\C-c ?\C-x ?\C-y] "s" [?\C-c ?/ ?r] "a" [?\C-c ?/] "o" [?\C-c ?\C-o] "t" [?\C-c ?\C-t] "8" [?\C-c ?\C-x ?\C-i] "9" [?\C-c ?\C-x ?\C-o] "7" [?\C-c ?\C-x ?\C-r] "0" fixa-org-klocka "g" [tab] "b" [S-tab])

))

[-- Attachment #3: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

             reply	other threads:[~2009-07-24 14:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-24 14:56 meingbg [this message]
2009-07-24 16:41 ` Script to get org-mode working on your cell phone Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e83e84da0907240756g5ce7a65eu967ca3baa3a2cd50@mail.gmail.com \
    --to=meingbg@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).