bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#7940: 23.2; Home and End keys don't work as expected with both pc-se


From: Stefan Monnier
Subject: bug#7940: 23.2; Home and End keys don't work as expected with both pc-selection-mode and visual-line-mode enabled
Date: Tue, 01 Feb 2011 16:11:19 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> I've attached two (mutually exclusive) patches against the trunk.  I've
> never submitted a patch to Emacs before, so please let me know which is more
> in line with the preferred way of doing things.

That's a good question.  I think the second looks cleaner, but suffers
from the major problem that simple.el ends up referring to
pc-select-mode, which is a mode that's rather deprecated.

I think we should actually declare pc-selection-mode obsolete.
Could you turn it off (and enable-delete-selection-mode instead, which
is otherwise enabled by pc-selection-mode) and see which other features
of pc-selection-mode you miss?


        Stefan

> --PJ
> # Bazaar merge directive format 2 (Bazaar 0.90)
> # revision_id: address@hidden
> #   nuvqsje84yncvflq
> # target_branch: bzr://bzr.savannah.gnu.org/emacs/trunk/
> # testament_sha1: b4d2fcdcc523cadc51d5f47e1965a9610cfcb2db
> # timestamp: 2011-01-29 20:56:16 -0800
> # base_revision_id: address@hidden
> #   jminwifpi767oiw5
> # 
> # Begin patch
> === modified file 'lisp/emulation/pc-select.el'
> --- lisp/emulation/pc-select.el       2011-01-25 04:08:28 +0000
> +++ lisp/emulation/pc-select.el       2011-01-30 04:55:42 +0000
> @@ -366,8 +366,11 @@
>  If scan reaches end of buffer, stop there without error."
>    (interactive "p")
>    (pc-select-ensure-mark)
> -  (end-of-line arg)
> -  (setq this-command 'end-of-line))
> +  (let ((eol-command (if visual-line-mode
> +                         'end-of-visual-line
> +                       'end-of-line)))
> +    (funcall eol-command arg)
> +    (setq this-command eol-command)))
 
>  (defun backward-line-mark (&optional arg)
>    "Ensure mark is active; move cursor vertically up ARG lines."
> @@ -501,8 +504,11 @@
>  If scan reaches end of buffer, stop there without error."
>    (interactive "p")
>    (pc-select-maybe-deactivate-mark)
> -  (end-of-line arg)
> -  (setq this-command 'end-of-line))
> +  (let ((eol-command (if visual-line-mode
> +                         'end-of-visual-line
> +                       'end-of-line)))
> +    (funcall eol-command arg)
> +    (setq this-command eol-command)))
 
>  (defun backward-line-nomark (&optional arg)
>    "Deactivate mark; move cursor vertically up ARG lines."
> @@ -628,8 +634,9 @@
>  If scan reaches end of buffer, stop there without error."
>    (interactive "p")
>    (pc-select-ensure-mark)
> -  (beginning-of-line arg))
> -
> +  (if visual-line-mode
> +      (beginning-of-visual-line arg)
> +    (beginning-of-line arg)))
 
>  (defun scroll-up-mark (&optional arg)
>    "Ensure mark is active; scroll upward ARG lines; or near full screen if no 
> ARG.
> @@ -728,7 +735,9 @@
>  If scan reaches end of buffer, stop there without error."
>    (interactive "p")
>    (pc-select-maybe-deactivate-mark)
> -  (beginning-of-line arg))
> +  (if visual-line-mode
> +      (beginning-of-visual-line arg)
> +    (beginning-of-line arg)))
 
>  (defun scroll-up-nomark (&optional arg)
>    "Deactivate mark; scroll upward ARG lines; or near full screen if no ARG.

> # Begin bundle
> IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWRC6JvgAAed/gFAQCgBQ4//3
> UhJAgL////BQBD5T3uvBYo9T2u73CSSNGiZTTwJoAp6eqe1Gp6R6j1DE9IMoJhNqaaJ6U9IeiAAA
> ABoMSaJo0pjQj1B6Jo9IAAAGgilGqeKeieET1GR6QGQAAAAkkTETKeQmeoaTRhAxAAAQAw3lYeef
> 1M04C3ipM5mIQotSMsIPjeRqjCNoCHAHwOOBBxl4aWGYPXxKaJFljmeQGTDWtzs+2mz7/y3CNPGO
> rdiId27xSXTNBg1nYJIe2zPTfXNNzHMLabjUbTcdQ4ekxuDQMMXOFjHmc+tmMoDYLXVEgExiUdae
> GQGR+qsItp2CvVpcDG411hLyxqtblv4nf1X5b5B0QdsOyOVsYGx0wJtKSfccbmALQrF4csGUjUwe
> D1PWK2YRUMYeCIGAv1ZK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bbsbg1e
> # target_branch: bzr://bzr.savannah.gnu.org/emacs/trunk/
> # testament_sha1: 10ade64307d860af931f9f6fd8d3162c0b4d71e1
> # timestamp: 2011-01-29 19:42:53 -0800
> # base_revision_id: address@hidden
> #   jminwifpi767oiw5
> # 
> # Begin patch
> === modified file 'lisp/emulation/pc-select.el'
> --- lisp/emulation/pc-select.el       2011-01-25 04:08:28 +0000
> +++ lisp/emulation/pc-select.el       2011-01-30 03:31:00 +0000
> @@ -369,6 +369,15 @@
>    (end-of-line arg)
>    (setq this-command 'end-of-line))
 
> +(defun end-of-visual-line-mark (&optional arg)
> +  "Ensure mark is active; move point to end of current visual line.
> +With argument ARG not nil or 1, move forward ARG - 1 lines first.
> +If scan reaches end of buffer, stop there without error."
> +  (interactive "p")
> +  (pc-select-ensure-mark)
> +  (end-of-visual-line arg)
> +  (setq this-command 'end-of-visual-line))
> +
>  (defun backward-line-mark (&optional arg)
>    "Ensure mark is active; move cursor vertically up ARG lines."
>    (interactive "p")
> @@ -504,6 +513,15 @@
>    (end-of-line arg)
>    (setq this-command 'end-of-line))
 
> +(defun end-of-visual-line-nomark (&optional arg)
> +  "Deactivate mark; move point to end of current visual line.
> +With argument ARG not nil or 1, move forward ARG - 1 lines first.
> +If scan reaches end of buffer, stop there without error."
> +  (interactive "p")
> +  (pc-select-maybe-deactivate-mark)
> +  (end-of-visual-line arg)
> +  (setq this-command 'end-of-visual-line))
> +
>  (defun backward-line-nomark (&optional arg)
>    "Deactivate mark; move cursor vertically up ARG lines."
>    (interactive "p")
> @@ -630,6 +648,13 @@
>    (pc-select-ensure-mark)
>    (beginning-of-line arg))
 
> +(defun beginning-of-visual-line-mark (&optional arg)
> +  "Ensure mark is active; move point to beginning of current visual line.
> +With argument ARG not nil or 1, move forward ARG - 1 lines first.
> +If scan reaches end of buffer, stop there without error."
> +  (interactive "p")
> +  (pc-select-ensure-mark)
> +  (beginning-of-visual-line arg))
 
>  (defun scroll-up-mark (&optional arg)
>    "Ensure mark is active; scroll upward ARG lines; or near full screen if no 
> ARG.
> @@ -730,6 +755,14 @@
>    (pc-select-maybe-deactivate-mark)
>    (beginning-of-line arg))
 
> +(defun beginning-of-visual-line-nomark (&optional arg)
> +  "Deactivate mark; move point to beginning of current visual line.
> +With argument ARG not nil or 1, move forward ARG - 1 lines first.
> +If scan reaches end of buffer, stop there without error."
> +  (interactive "p")
> +  (pc-select-maybe-deactivate-mark)
> +  (beginning-of-visual-line arg))
> +
>  (defun scroll-up-nomark (&optional arg)
>    "Deactivate mark; scroll upward ARG lines; or near full screen if no ARG.
>  A near full screen is `next-screen-context-lines' less than a full screen.

> === modified file 'lisp/simple.el'
> --- lisp/simple.el    2011-01-25 04:08:28 +0000
> +++ lisp/simple.el    2011-01-30 03:31:00 +0000
> @@ -4808,6 +4808,10 @@
>      (define-key map [remap kill-line] 'kill-visual-line)
>      (define-key map [remap move-beginning-of-line] 'beginning-of-visual-line)
>      (define-key map [remap move-end-of-line]  'end-of-visual-line)
> +    (define-key map [remap end-of-line-nomark] 'end-of-visual-line-nomark)
> +    (define-key map [remap end-of-line-mark] 'end-of-visual-line-mark)
> +    (define-key map [remap beginning-of-line-nomark] 
> 'beginning-of-visual-line-nomark)
> +    (define-key map [remap beginning-of-line-mark] 
> 'beginning-of-visual-line-mark)
>      ;; These keybindings interfere with xterm function keys.  Are
>      ;; there any other suitable bindings?
>      ;; (define-key map "\M-[" 'previous-logical-line)

> # Begin bundle
> IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWR1fby0AAxBfgEAQUef//3ay
> UIq////wYAb33lpoYCyDUgGgGhjmAAmTAAmEwTCGAIwAJRCnkZDTKbUJtSehNDQDQAGmjQOYACZM
> ACYTBMIYAjAAlNJTyp7RNRp5TBDamgAAAGTQA5gAJkwAJhMEwhgCMABUkgQNJoZNTDQSn5Mp6mU0
> NGhtTajNRgQSZxTY1VX7O39po16MUCIKJv4QLJDe92gGCSVi1ZX9XwrDTda/HcSyRRt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