all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: David Reitter <david.reitter@gmail.com>,
	Emacs-Devel devel <emacs-devel@gnu.org>
Subject: Re: Longlines mode in menu
Date: Fri, 20 Jun 2008 20:50:15 +0200	[thread overview]
Message-ID: <485BFBE7.30304@gmail.com> (raw)
In-Reply-To: <jwvfxr9r0s5.fsf-monnier+emacs@gnu.org>

Stefan Monnier wrote:
>>>> Thanks. What key bindings do you suggest? Maybe this could be
>>>> a minor mode?
> 
> It should be either a global minor mode which adds `remap' bindings to
> the global map, or a buffer-local minor mode which adds the same remap
> bindings but via a minor-mode map.


Maybe something like this? I think it is essential to be able to use the 
original move and kill commands too.

   (defalias 'original-next-line 'next-line "test")
   (defalias 'original-previous-line 'previous-line "test")
   (defalias 'original-kill-line 'kill-line "test")

   (defvar visual-line-map
     (let ((map (make-sparse-keymap)))
       (define-key map [remap next-line] 'visual-line-down)
       (define-key map [remap previous-line] 'visual-line-up)
       (define-key map [(control down)] 'original-next-line)
       (define-key map [(control up)] 'original-previous-line)
       (define-key map [remap kill-line] 'kill-visual-line)
       (define-key map [(control shift ?k)] 'original-kill-line)
       (define-key map [remap kill-whole-line] 'kill-whole-visual-line)
       map))

   (define-minor-mode visual-line-mode
     "Define key binding for visual line moves etc."
     :lighter " vl"
     :global t
     :keymap visual-line-map
     :group 'convenience)





  reply	other threads:[~2008-06-20 18:50 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05  5:42 Longlines mode in menu Chong Yidong
2008-06-05  5:53 ` Miles Bader
2008-06-05 12:50   ` Chong Yidong
2008-06-05 16:41 ` Paul R
2008-06-05 18:55   ` Chong Yidong
2008-06-06 21:27 ` Chong Yidong
2008-06-12 10:48 ` David Reitter
2008-06-12 11:00   ` Miles Bader
2008-07-11 21:21     ` Kim F. Storm
2008-07-12  2:51       ` Chong Yidong
2008-07-14  3:08         ` Miles Bader
2008-06-12 15:05   ` Chong Yidong
2008-06-12 16:12     ` David Reitter
2008-06-12 16:38       ` Chong Yidong
2008-06-12 17:14         ` Chong Yidong
2008-06-12 22:32           ` Chong Yidong
2008-06-13  6:45             ` David Reitter
2008-06-12 19:38       ` Stefan Monnier
2008-06-13  3:04         ` Kevin Rodgers
2008-06-13  3:13           ` Stefan Monnier
2008-06-13  7:36             ` Lennart Borgman (gmail)
2008-06-18  6:48         ` David Reitter
2008-06-18  7:13           ` Lennart Borgman (gmail)
2008-06-18  8:38             ` David Reitter
2008-06-18 16:17               ` Lennart Borgman (gmail)
2008-06-18 16:55                 ` David Reitter
2008-06-18 20:50                   ` Lennart Borgman (gmail)
2008-06-18 20:59                     ` David Reitter
2008-06-18 21:17                       ` Lennart Borgman (gmail)
2008-06-18 21:38                         ` David Reitter
2008-06-18 21:53                           ` Lennart Borgman (gmail)
2008-06-19  0:22                     ` Miles Bader
2008-06-19  7:21                       ` Lennart Borgman
2008-06-19  7:39                         ` Miles Bader
2008-06-19  7:58                           ` Lennart Borgman (gmail)
2008-06-19 13:51                     ` Stefan Monnier
2008-06-20 18:50                       ` Lennart Borgman (gmail) [this message]
2008-06-20 19:47                         ` Stefan Monnier
2008-06-20 19:53                           ` Lennart Borgman (gmail)
2008-06-20 20:13                             ` Miles Bader
2008-06-20 20:16                               ` Lennart Borgman (gmail)
2008-06-21  0:11                                 ` Miles Bader
2008-06-21  0:15                                   ` Lennart Borgman (gmail)
2008-06-20 21:23                             ` Stefan Monnier
2008-06-20 23:39                               ` Lennart Borgman (gmail)
2008-06-21  7:19                                 ` David Reitter
2008-06-21 13:08                                   ` Lennart Borgman (gmail)
2008-06-12 19:39     ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=485BFBE7.30304@gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=david.reitter@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.