physical-line-mode

[ English | Japanese ]

What's physical-line-mode?

Physical-line-mode.el provides a minor mode to move a cursor across "physical lines", which are actual lines displayed on your Emacs screen. Usually Emacs takes a line as "logical" one, which is defined as a string between two newline characters. So if you type C-p (or C-n) on a sentence which stretches for several lines, it seems to skip the part you really want to move to. Physical-line-mode.el makes your Emacs recognize physical lines correctly in the following commands: previous-line, next-line, beginning-of-line, end-of-line. It will make your Emacs-life much more comfortable!

How to Install

Debian Package

Please download a physical-line-el package from http://www.taiyaki.org/debian/. You don't need to edit your .emacs.

When you use apt, please add the following line to /etc/apt/sources.list

deb http://www.taiyaki.org/debian ./

Download

Please download a physical-line.el file from http://www.taiyaki.org/elisp/physical-line/src/.

Configuration of .emacs

If you download the file, say, ~/elisp/, add the following lines to your .emacs.

(setq load-path (cons (expand-file-name "~/elisp") load-path))
(load "physical-line")
  

How to use

"M-x physical-line-mode" toggles physical line minor mode. A string "PL" on a modeline indicates that this minor mode is on. "C-u M-x physical-line-mode" forces this minor mode to be on, and "C-u - M-x physical-line-mode" forces off.

M-x physical-line-mode
Toggle the physical line minor mode
C-p (M-x previous-line)
Move the cursor vertically up the physical line(s).
C-n (M-x next-line)
Move the cursor vertically down the physical line(s).
C-a (M-x beginning-of-line)
Move the cursor to the beginning of the current physical line. A repeat of this command moves the cursor to the beginning of the logical (= usual) line.
C-e (M-x end-of-line)
Move the cursor to the end of the current physical line. A repeat of this command moves the cursor to the end of the logical (= usual) line.

Customization

I want physical-line-mode always on under text-mode

Almost all major modes like text-mode have <mode name>-hook. So you can use this hook.

(add-hook 'text-mode-hook 'physical-line-mode-on)
  

I want physical-line-mode always on under all major modes without some specific modes

A hook find-file-hooks will be invoked, when you open a file. So you can use this hook.

(setq physical-line-mode-without-exception '(dired-mode c-mode))
(add-hook 'find-file-hooks 'physical-line-mode-without-exception)
  

BUG & TODO

License

This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.


ホームページ
天照
ELisp
replace-region
rectangle
ac-mode
accel-key
table
wordnet
urlencode
visible-mark
physical-line-mode
my-keisen-mule
myimage
text-adjust
Palm
Linux & Unix
日記
観測カメラ
Index を閉じる
Hiroyuki Komatsu <komatsu@taiyaki.org>
$Id: index.html.en,v 1.5 2002/09/28 06:26:05 komatsu Exp $