From: David Reitter <david.reitter@gmail.com>
To: Emacs-Devel devel <emacs-devel@gnu.org>
Subject: kill-visual-line / line-move, goal column etc.
Date: Sat, 2 Aug 2008 23:21:36 +0200 [thread overview]
Message-ID: <9895337C-87E8-49D2-88BD-00C64C6BF420@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1506 bytes --]
kill-visual-line behaves incorrectly when a temporary goal column is
set, or when line-move does something sensible but (here) undesirable.
The attached patch takes care of that- however, I'm not sure if just
using `vertical-motion' handles the cases of fields and invisible text
right. (But I'm unsure if line-move itself would DTRT...) Comments
appreciated.
*** simple.el 02 Aug 2008 20:35:34 +0200 1.941
--- simple.el 02 Aug 2008 23:16:20 +0200
***************
*** 4435,4441 ****
(if (eobp)
(signal 'end-of-buffer nil))
(setq end (save-excursion
! (end-of-visual-line) (point)))
(if (or (save-excursion
;; If trailing whitespace is visible,
;; don't treat it as nothing.
--- 4435,4444 ----
(if (eobp)
(signal 'end-of-buffer nil))
(setq end (save-excursion
! (vertical-motion 1)
! ;; we're possibly one too far
! (skip-chars-backward "\r\n" (- (point) 1))
! (point)))
(if (or (save-excursion
;; If trailing whitespace is visible,
;; don't treat it as nothing.
***************
*** 4443,4449 ****
(skip-chars-forward " \t" end))
(= (point) end))
(and kill-whole-line (bolp)))
! (line-move 1)
(goto-char end)))
(kill-region opoint (point))))
--- 4446,4452 ----
(skip-chars-forward " \t" end))
(= (point) end))
(and kill-whole-line (bolp)))
! (vertical-motion 1)
(goto-char end)))
(kill-region opoint (point))))
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]
reply other threads:[~2008-08-02 21:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9895337C-87E8-49D2-88BD-00C64C6BF420@gmail.com \
--to=david.reitter@gmail.com \
--cc=emacs-devel@gnu.org \
/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 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).