unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* line-move-down-up
@ 2011-04-18 13:26 A Soare
  2011-04-18 13:36 ` line-move-down-up Deniz Dogan
  2011-04-18 14:30 ` line-move-down-up Stephen J. Turnbull
  0 siblings, 2 replies; 14+ messages in thread
From: A Soare @ 2011-04-18 13:26 UTC (permalink / raw)
  To: emacs-devel


(defun line-move-down (n)
  (let ((column (current-column))
        (line (delete-and-extract-region
               (prog2 (beginning-of-line) (point))
               (prog2 (end-of-line) (1+ (point)) ))))
    (next-line n)
    (beginning-of-line)
    (insert-string line)
    (backward-char)
    (move-to-column column)
    'down
  ))

(define-key global-map [(meta up)] (lambda (&optional n) (interactive "P")
(line-move-down (if (numberp n) (- n) -1))))

(define-key global-map [(meta down)] (lambda (&optional n) (interactive "P")
(line-move-down (if (numberp n) n 1))))





^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-04-21  9:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-18 13:26 line-move-down-up A Soare
2011-04-18 13:36 ` line-move-down-up Deniz Dogan
2011-04-18 13:40   ` line-move-down-up A Soare
2011-04-18 14:51     ` line-move-down-up A Soare
2011-04-18 15:31       ` line-move-down-up Deniz Dogan
2011-04-18 15:37         ` line-move-down-up A Soare
2011-04-18 14:30 ` line-move-down-up Stephen J. Turnbull
2011-04-18 14:53   ` line-move-down-up A Soare
     [not found]   ` <BANLkTimKts-mZSMmbeo=rOCeP8+Un2aZjA@mail.gmail.com>
     [not found]     ` <87d3kjpnef.fsf@uwakimon.sk.tsukuba.ac.jp>
2011-04-18 15:56       ` line-move-down-up Alin Soare
2011-04-18 19:24         ` line-move-down-up Davis Herring
2011-04-20 17:22           ` line-move-down-up Alin Soare
2011-04-19  8:20         ` line-move-down-up Ivan Andrus
2011-04-19  9:34           ` line-move-down-up Deniz Dogan
2011-04-21  9:28             ` line-move-down-up Ivan Andrus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).