unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* kill-visual-line / line-move, goal column etc.
@ 2008-08-02 21:21 David Reitter
  0 siblings, 0 replies; only message in thread
From: David Reitter @ 2008-08-02 21:21 UTC (permalink / raw)
  To: Emacs-Devel devel

[-- 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 --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-08-02 21:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-02 21:21 kill-visual-line / line-move, goal column etc David Reitter

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