emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Wanrong Lin <wanrong.lin@gmail.com>
Cc: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: Org-mode on Windows - Putty
Date: Fri, 14 Mar 2008 15:33:22 -0400	[thread overview]
Message-ID: <47DAD302.9090302@gmail.com> (raw)
In-Reply-To: <e7cdbe30803141203y69b4c533q31cabf5d9018b60b@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2195 bytes --]

Yes, your understanding is correct (I use that for SSH session into my 
remote Linux box). The biggest benefit I got from AutoHotKey is now I 
can use the right Alt key in Putty sessions, since I mapped the right 
Alt key to the left Alt key.
I don't understand why under Putty, a lot of control keys work out of 
box on editors like "nano", but it is so twisted to have them work in 
Emacs. As much as I like Emacs, I think people dreaming in "Emacs is 
(nearly) perfect" need to wake up.

Here is some example key bindings from my emacs config:

--------------
  ;; this is inside my org-mode-hook

  ;; Alternative key binding for putty. basically Meta is replaced with 
C-x, Ctrl is
  ;; replaced with C-c

  ;; for M-up/down/left/right
  (define-key org-mode-map [(control x) up] 'org-metaup)
  (define-key org-mode-map [(control x) down] 'org-metadown)
  (define-key org-mode-map [(control x) left] 'org-metaleft)
  (define-key org-mode-map [(control x) right] 'org-metaright)

  ;; for C-up/down/left/right
  (define-key org-mode-map [(control c) up] 'org-shiftup)
  (define-key org-mode-map [(control c) down] 'org-shiftdown)
  (define-key org-mode-map [(control c) left] 'org-shiftleft)
  (define-key org-mode-map [(control c) right] 'org-shiftright)

  ;; actually, M-return works in putty. So we use "C-x return" to do 
"M-S return"
  (local-unset-key (kbd "C-x RET")) ;; originally bound globally to char 
coding commands
  (define-key org-mode-map (kbd "C-x RET") 'org-insert-todo-heading)
-----------

Attached is my AutoHotKey script.


Manish wrote:
> On Fri, Mar 14, 2008 at 8:55 PM, Wanrong Lin <wanrong.lin@gmail.com> wrote:
>   
>> What I did is:
>>  Add some alternative TTY key bindings for some frequently used commands,
>>  and use "AutoHotkey" to map things like "M-RET" to those TTY key
>>  bindings. Not ideal, but works fine.
>>
>>     
>
> If I understand you correctly, what you are suggesting is to use
> alternative key binds as suggested by Giovanni and use AutoHotKey to
> `translate' S-<left> to C-c <left> for example.  Hmm.  Not a bad idea
> at all.  Should work.
>
> Can you please share relevant pieces from your .emacs and AHK script?
>
> -- Manish
>   


[-- Attachment #2: AutoHotkey.ahk --]
[-- Type: text/plain, Size: 2484 bytes --]

;; Put this file under "My Documents"

; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a
; semicolon, such as this one, are comments.  They are not executed.

; This script has a special filename and path because it is automatically
; launched when you run the program directly.  Also, any text file whose
; name ends in .ahk is associated with the program, which means that it
; can be launched simply by double-clicking it.  You can have as many .ahk
; files as you want, located in any folder.  You can also run more than
; one ahk file simultaneously and each will get its own tray icon.

; SAMPLE HOTKEYS: Below are two sample hotkeys.  The first is Win+Z and it
; launches a web site in the default browser.  The second is Control+Alt+N
; and it launches a new Notepad window (or activates an existing one).  To
; try out these hotkeys, run AutoHotkey again, which will load this file.

;;; sample hot keys

; #z::Run www.autohotkey.com

; ^!n::
; IfWinExist Untitled - Notepad
	; WinActivate
; else
	; Run Notepad
; return


; Note: From now on whenever you run AutoHotkey directly, this script
; will be loaded.  So feel free to customize it to suit your needs.

; Please read the QUICK-START TUTORIAL near the top of the help file.
; It explains how to perform common automation tasks such as sending
; keystrokes and mouse clicks.  It also explains more about hotkeys.

;;; my own hot keys (worked with 1.0.47 AutoHotKey)

; Modifier                Abbrevation     AHK-Symbol
; --------------------------------------------------
; Control-key             Ctrl-           ^
; Alt-key                 Alt-            !
; Shift-key               Shift-          +
; Windows-key             Win-            #

; putty + emacs

#IfWinActive ahk_class PuTTY

;; this is the killer
RAlt::LAlt

PgDn::Send ^v
PgUp::Send !v
Home::Send ^a
End::Send ^e
Delete::Send ^d
^Home::Send !<
^End::Send !>
^Space::Send ^c{Space}   ;; to avoid Chinese input ZiGuan to intercept the Ctrl-SPC

;; modified arrow and return keys
^Up::Send ^c{Up}
^Down::Send ^c{Down}
^Right::Send ^c{Right}
^Left::Send ^c{Left}
^Return::Send ^c{Return}
!Up::Send ^x{Up}
!Down::Send ^x{Down}
!Right::Send ^x{Right}
!Left::Send ^x{Left}
+!Return::Send ^x{Return}

;; mark and selection commands
+Home::Send ^x{Space}^a
+End::Send ^x{Space}^e
+PgDn::Send ^x{Space}^v
+PgUp::Send ^x{Space}!v
!+Home::Send ^x{Space}!<
!+End::Send ^x{Space}!>
^+Home::Send ^x{Space}^a
^+End::Send ^x{Space}^e

#IfWinActive

[-- 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:[~2008-03-14 19:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-14 10:58 Org-mode on Windows Manish
2008-03-14 12:07 ` Tim O'Callaghan
2008-03-14 12:29   ` Org-mode on Windows - Putty Giovanni Ridolfi
2008-03-14 13:27     ` Manish
2008-03-14 15:25       ` Wanrong Lin
2008-03-14 15:29         ` Carsten Dominik
2008-03-14 19:03         ` Manish
2008-03-14 19:33           ` Wanrong Lin [this message]
2008-04-18 20:20             ` Manish
2008-03-14 15:43   ` Org-mode on Windows Russell Adams
2008-03-14 19:13     ` Manish

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=47DAD302.9090302@gmail.com \
    --to=wanrong.lin@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).