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!
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 ./
Please download a physical-line.el file from http://www.taiyaki.org/elisp/physical-line/src/.
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")
"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.
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)
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)
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.