unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* More conventient move beginning/end of line
@ 2007-09-22  1:03 Lennart Borgman (gmail)
  2007-09-22 16:56 ` Thien-Thi Nguyen
  2007-09-24 16:30 ` Davis Herring
  0 siblings, 2 replies; 3+ messages in thread
From: Lennart Borgman (gmail) @ 2007-09-22  1:03 UTC (permalink / raw)
  To: Emacs Devel

Some editor I used long ago had some behaviour similar to the functions 
below. One press on HOME moved to the beginning of line, next to the 
start of the text on that line. It would be nice to have this in Emacs 
(maybe the ARG part should be skipped):

(defun my-move-beginning-of-line(arg)
   (interactive "p")
   (or arg (setq arg 1))
   (let ((pos (point)))
     (move-beginning-of-line arg)
     (when (= pos (point)) (skip-chars-forward " \t"))))
(put 'my-move-beginning-of-line 'CUA 'move)
(global-set-key [home] 'my-move-beginning-of-line)

(defun my-move-end-of-line(arg)
   (interactive "p")
   (or arg (setq arg 1))
   (let ((pos (point)))
     (move-end-of-line arg)
     (when (= pos (point)) (skip-chars-backward " \t"))))
(put 'my-move-end-of-line 'CUA 'move)
(global-set-key [end] 'my-move-end-of-line)

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

end of thread, other threads:[~2007-09-24 16:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-22  1:03 More conventient move beginning/end of line Lennart Borgman (gmail)
2007-09-22 16:56 ` Thien-Thi Nguyen
2007-09-24 16:30 ` Davis Herring

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).