From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 30 07:04:37 2011 Received: (at submit) by debbugs.gnu.org; 30 Jan 2011 12:04:37 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PjW1A-0001gc-PN for submit@debbugs.gnu.org; Sun, 30 Jan 2011 07:04:37 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PjPGf-0000Wf-1e for submit@debbugs.gnu.org; Sat, 29 Jan 2011 23:52:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjPOe-0004uv-Ha for submit@debbugs.gnu.org; Sun, 30 Jan 2011 00:00:21 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:36477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PjPOe-0004ur-C4 for submit@debbugs.gnu.org; Sun, 30 Jan 2011 00:00:20 -0500 Received: from [140.186.70.92] (port=47952 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjPOc-0000EC-Eu for bug-gnu-emacs@gnu.org; Sun, 30 Jan 2011 00:00:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjPOa-0004u2-SK for bug-gnu-emacs@gnu.org; Sun, 30 Jan 2011 00:00:18 -0500 Received: from smtpauth17.prod.mesa1.secureserver.net ([64.202.165.29]:56838) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PjPOa-0004tF-AF for bug-gnu-emacs@gnu.org; Sun, 30 Jan 2011 00:00:16 -0500 Received: (qmail 24015 invoked from network); 30 Jan 2011 04:40:47 -0000 Received: from unknown (209.85.161.41) by smtpauth17.prod.mesa1.secureserver.net (64.202.165.29) with ESMTP; 30 Jan 2011 04:40:46 -0000 Received: by fxm12 with SMTP id 12so5533369fxm.0 for ; Sat, 29 Jan 2011 21:00:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.119.129 with SMTP id z1mr4395446faq.50.1296363609240; Sat, 29 Jan 2011 21:00:09 -0800 (PST) Received: by 10.223.102.70 with HTTP; Sat, 29 Jan 2011 21:00:09 -0800 (PST) Date: Sat, 29 Jan 2011 21:00:09 -0800 Message-ID: Subject: 23.2; Home and End keys don't work as expected with both pc-selection-mode and visual-line-mode enabled From: PJ Weisberg To: bug-gnu-emacs@gnu.org Content-Type: multipart/mixed; boundary=001636c5a7d66db4be049b092c0d X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 64.202.165.29 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 30 Jan 2011 07:04:31 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) --001636c5a7d66db4be049b092c0d Content-Type: multipart/alternative; boundary=001636c5a7d66db4a6049b092c0b --001636c5a7d66db4a6049b092c0b Content-Type: text/plain; charset=ISO-8859-1 1) Open or create a file with logical lines longer than the width of the window. 2) Enable visual-line-mode and pc-selection-mode (order doesn't matter). 3) Press the and/or keys with point on one of these long lines. Expected: Point moves to the beginning/end of the current visual line. Observed: Point moves to the beginning/end of the current logical line. 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. --PJ --001636c5a7d66db4a6049b092c0b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 1) Open or create a file with logical lines longer than the width of thewindow.
2) Enable visual-line-mode and pc-selection-mode (order doesn&#= 39;t matter).
3) Press the <home> and/or <end> keys with poi= nt on one of these long
lines.

Expected: Point moves to the beginning/end of the current vis= ual line.
Observed: Point moves to the beginning/end of the current logi= cal line.

I've attached two (mutually exclusive) patches against= the trunk.=A0 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.
--PJ
--001636c5a7d66db4a6049b092c0b-- --001636c5a7d66db4be049b092c0d Content-Type: text/x-patch; charset=US-ASCII; name="pc-visual-line_if.patch" Content-Disposition: attachment; filename="pc-visual-line_if.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gjjhc0g20 IyBCYXphYXIgbWVyZ2UgZGlyZWN0aXZlIGZvcm1hdCAyIChCYXphYXIgMC45MCkKIyByZXZpc2lv bl9pZDogcGpAaXJyZWd1bGFyZXhwcmVzc2lvbnMubmV0LTIwMTEwMTMwMDQ1NTQyLVwKIyAgIG51 dnFzamU4NHluY3ZmbHEKIyB0YXJnZXRfYnJhbmNoOiBienI6Ly9ienIuc2F2YW5uYWguZ251Lm9y Zy9lbWFjcy90cnVuay8KIyB0ZXN0YW1lbnRfc2hhMTogYjRkMmZjZGNjNTIzY2FkYzUxZDVmNDdl MTk2NWE5NjEwY2ZjYjJkYgojIHRpbWVzdGFtcDogMjAxMS0wMS0yOSAyMDo1NjoxNiAtMDgwMAoj IGJhc2VfcmV2aXNpb25faWQ6IHNjaHdhYkBsaW51eC1tNjhrLm9yZy0yMDExMDEzMDAwMzUzNS1c CiMgICBqbWlud2lmcGk3NjdvaXc1CiMgCiMgQmVnaW4gcGF0Y2gKPT09IG1vZGlmaWVkIGZpbGUg J2xpc3AvZW11bGF0aW9uL3BjLXNlbGVjdC5lbCcKLS0tIGxpc3AvZW11bGF0aW9uL3BjLXNlbGVj dC5lbAkyM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klTU2QzQ3FYYmdRU0NTQm5GekNzc1QzdgptVnMrckVUd1lu a1YxUU1TUUNHUVZZNVpqc0szRUNmS1R0Mm1GamlCMkdhemNEY0RBTGt4RzE1bWxsaXhjME5RbTQ2 eDZaOE1oTi9pCjdraW5DaElDRjBUZkFBPT0K --001636c5a7d66db4be049b092c0d Content-Type: text/x-patch; charset=US-ASCII; name="pc-visual-line_function.patch" Content-Disposition: attachment; filename="pc-visual-line_function.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gjjhcgk51 IyBCYXphYXIgbWVyZ2UgZGlyZWN0aXZlIGZvcm1hdCAyIChCYXphYXIgMC45MCkKIyByZXZpc2lv bl9pZDogcGpAaXJyZWd1bGFyZXhwcmVzc2lvbnMubmV0LTIwMTEwMTMwMDMzMTAwLVwKIyAgIHI4 cXMxY2NwYmJic2JnMWUKIyB0YXJnZXRfYnJhbmNoOiBienI6Ly9ienIuc2F2YW5uYWguZ251Lm9y Zy9lbWFjcy90cnVuay8KIyB0ZXN0YW1lbnRfc2hhMTogMTBhZGU2NDMwN2Q4NjBhZjkzMWY5ZjZm ZDhkMzE2MmMwYjRkNzFlMQojIHRpbWVzdGFtcDogMjAxMS0wMS0yOSAxOTo0Mjo1MyAtMDgwMAoj IGJhc2VfcmV2aXNpb25faWQ6IHNjaHdhYkBsaW51eC1tNjhrLm9yZy0yMDExMDEzMDAwMzUzNS1c CiMgICBqbWlud2lmcGk3NjdvaXc1CiMgCiMgQmVnaW4gcGF0Y2gKPT09IG1vZGlmaWVkIGZpbGUg J2xpc3AvZW11bGF0aW9uL3BjLXNlbGVjdC5lbCcKLS0tIGxpc3AvZW11bGF0aW9uL3BjLXNlbGVj dC5lbAkyMDExLTAxLTI1IDA0OjA4OjI4ICswMDAwCisrKyBsaXNwL2VtdWxhdGlvbi9wYy1zZWxl Y3QuZWwJMjAxMS0wMS0zMCAwMzozMTowMCArMDAwMApAQCAtMzY5LDYgKzM2OSwxNSBAQAogICAo ZW5kLW9mLWxp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aHNFU0FuU1FPSjByR2Nla1V3N2RyeWZwTmVNME5RMDZKb211dFJlWlI2S2t5WVhtSVdpcQpr UytqNlFxUnB4T0tOTjZMMHZPMU1vZm8wcGlWSlJVcWpuV2g0OGpTbTUwNnhjaDhEZk9EY25kNDFO aFBlb2F0aFg4R3dzWFJ3amZ1Cm0yaStiRGZtYzQvczRpODdqdncyOXRLT2tlaGovcFdNMGJaZXZs TXZsak5KdTVmV0dPbzZIUW5vTGp2NktMRlRrS0xSK0Y1cVhsTmgKMXcrNVJoSnRobjU0eStHaWhx akJZdTliSmZTU3B6WGFOSjN3Mkdnc1ZsbFVseTRkbG5QRDZnL1YxQUpoTkw2b2FpdDFGR0xRNDhW aQpoSkFjWUI2M1NFT2tyTTFSZklWdU9GRzgzbGhrT2RhbVpVeHZ2ZFpoZVd2endOWjhka1drb3kx WjVydGxjU3lNak9HcWJGWmFMR3J3ClN6R1EzZFI1dzVlRmlqVGpHWnVOTTFuMFNpNUZMcHRqbU90 RlVYenltb3htRWJVcm1UakpqTkpBamFPZ2c5TFAvaTdraW5DaElEcSsKM2xvPQo= --001636c5a7d66db4be049b092c0d-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 16:03:01 2011 Received: (at 7940) by debbugs.gnu.org; 1 Feb 2011 21:03:01 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PkNNN-0007qK-5X for submit@debbugs.gnu.org; Tue, 01 Feb 2011 16:03:01 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PkNNK-0007q6-4h for 7940@debbugs.gnu.org; Tue, 01 Feb 2011 16:02:59 -0500 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id p11LBprZ029021; Tue, 1 Feb 2011 16:11:51 -0500 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 68B2A1300EB; Tue, 1 Feb 2011 16:11:19 -0500 (EST) From: Stefan Monnier To: PJ Weisberg Subject: Re: bug#7940: 23.2; Home and End keys don't work as expected with both pc-selection-mode and visual-line-mode enabled Message-ID: References: Date: Tue, 01 Feb 2011 16:11:19 -0500 In-Reply-To: (PJ Weisberg's message of "Sat, 29 Jan 2011 21:00:09 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3735=0 X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 7940 Cc: 7940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > 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: pj@irregularexpressions.net-20110130045542-\ > # nuvqsje84yncvflq > # target_branch: bzr://bzr.savannah.gnu.org/emacs/trunk/ > # testament_sha1: b4d2fcdcc523cadc51d5f47e1965a9610cfcb2db > # timestamp: 2011-01-29 20:56:16 -0800 > # base_revision_id: schwab@linux-m68k.org-20110130003535-\ > # 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 > 1M04C3ipM5mIQotSM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jDYGbBZJlWvjzjkzQMwIw2wA3mnwkxjFHgcZSXxhWateAUMQzC2ISSd3CqXbgQSCSBnFzCssT3v > mVs+rETwYnkV1QMSQCGQVY5ZjsK3ECfKTt2mFjiB2GazcDcDALkxG15mllixc0NQm46x6Z8MhN/i > 7kinChICF0TfAA== > # Bazaar merge directive format 2 (Bazaar 0.90) > # revision_id: pj@irregularexpressions.net-20110130033100-\ > # r8qs1ccpbbbsbg1e > # target_branch: bzr://bzr.savannah.gnu.org/emacs/trunk/ > # testament_sha1: 10ade64307d860af931f9f6fd8d3162c0b4d71e1 > # timestamp: 2011-01-29 19:42:53 -0800 > # base_revision_id: schwab@linux-m68k.org-20110130003535-\ > # 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 > ACYTBMIYAjAAlNJTyp7RNRp5TBDamgAAA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BtiaQfETadR89ZXguOh5LHyuMpk7VDG9VomU0Y2V3pMuiN0U9z3HlOh > J9hkrMC5Bkw7yZToOl9wHPSg4SmvPxzEc16+jIDcIUQOHh7xMTJZflh1AXB29YfF6rVVfb0eBlJ5 > Sjx4m/yujwOrmzPS84npnshV0P30L0mqOyMfkP3KQ5PB0dDz6PV5J7Yz5pRh0z3O16Ot4lHwpqoy > lrzqwVEoaRml6N7B+66FjjHq60tqouKbaLTaMrndNDPw+8Vhxn9JgcEvbZv6eUe6YlRHNoR9Ed56 > RhN/DLjNu2lFFQ4w2HM+Lj5xsqQ/E3xr1o3TYy64cZ1nZUj5y1k43m7tjuHI6EtJKM38m2Nt54Iy > c0ouGuQ1ji3NfyzzFVDOYSYUhsESAnSQOJ0rGcekUw7dryfpNeM0NQ06JomutReZR6KkyYXmIWiq > kS+j6QqRpxOKNN6L0vO1Mofo0piVJRUqjnWh48jSm506xch8DfODcnd41NhPeoathX8GwsXRwjfu > m2i+bDfmc4/s4i87jvw29tKOkehj/pWM0bZevlMvljNJu5fWGOo6HQnoLjv6KLFTkKLR+F5qXlNh > 1w+5RhJthn54y+GihqjBYu9bJfSSpzXaNJ3w2GgsVllUly4dlnPD6g/V1AJhNL6oait1FGLQ48Vi > hJAcYB63SEOkrM1RfIVuOFG83lhkOdamZUxvvdZheWvzwNZ8dkWkoy1Z5rtlcSyMjOGqbFZaLGrw > SzGQ3dR5w5eFijTjGZuNM1n0Si5FLptjmOtFUXzymoxmEbUrmTjJjNJAjaOgg9LP/i7kinChIDq+ > 3lo= From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 05 16:33:04 2011 Received: (at 7940) by debbugs.gnu.org; 5 Feb 2011 21:33:04 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Plpkd-000806-Mt for submit@debbugs.gnu.org; Sat, 05 Feb 2011 16:33:03 -0500 Received: from smtpauth17.prod.mesa1.secureserver.net ([64.202.165.29]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Plpkc-0007ze-Bg for 7940@debbugs.gnu.org; Sat, 05 Feb 2011 16:33:03 -0500 Received: (qmail 2112 invoked from network); 5 Feb 2011 21:21:36 -0000 Received: from unknown (209.85.161.44) by smtpauth17.prod.mesa1.secureserver.net (64.202.165.29) with ESMTP; 05 Feb 2011 21:21:36 -0000 Received: by fxm9 with SMTP id 9so3941096fxm.3 for <7940@debbugs.gnu.org>; Sat, 05 Feb 2011 13:41:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.114.65 with SMTP id d1mr13015233faq.88.1296942093875; Sat, 05 Feb 2011 13:41:33 -0800 (PST) Received: by 10.223.102.70 with HTTP; Sat, 5 Feb 2011 13:41:33 -0800 (PST) In-Reply-To: References: Date: Sat, 5 Feb 2011 13:41:33 -0800 Message-ID: Subject: Re: bug#7940: 23.2; Home and End keys don't work as expected with both pc-selection-mode and visual-line-mode enabled From: PJ Weisberg To: Stefan Monnier Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: 7940 Cc: 7940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.9 (---) On 2/1/11, Stefan Monnier wrote: > 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? I think delete-selection-mode is the only feature I notice that isn't on by default in Emacs 23. I'm not sure how you treat 'obsolete' features, but maybe you could use the less clean-looking patch on pc-select.el to fix the bug and then just not look at it ever again. ;-) -PJ From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 15:37:32 2011 Received: (at 7940-done) by debbugs.gnu.org; 8 Feb 2011 20:37:32 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PmuJW-0000Bu-PO for submit@debbugs.gnu.org; Tue, 08 Feb 2011 15:37:32 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PmuJU-0000Bh-AG for 7940-done@debbugs.gnu.org; Tue, 08 Feb 2011 15:37:29 -0500 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id p18KkjDF019768; Tue, 8 Feb 2011 15:46:45 -0500 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 316AAB4106; Tue, 8 Feb 2011 15:46:08 -0500 (EST) From: Stefan Monnier To: PJ Weisberg Subject: Re: bug#7940: 23.2; Home and End keys don't work as expected with both pc-selection-mode and visual-line-mode enabled Message-ID: References: Date: Tue, 08 Feb 2011 15:46:08 -0500 In-Reply-To: (PJ Weisberg's message of "Sat, 29 Jan 2011 21:00:09 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3735=0 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 7940-done Cc: 7940-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.7 (/) > 1) Open or create a file with logical lines longer than the width of the > window. > 2) Enable visual-line-mode and pc-selection-mode (order doesn't matter). > 3) Press the and/or keys with point on one of these long > lines. > Expected: Point moves to the beginning/end of the current visual line. > Observed: Point moves to the beginning/end of the current logical line. Thanks for your report. I've installed a different patch (see below) which removes most of pc-select's code so it relies on shift-select-mode instead, which ends up fixing your bug. Stefan === renamed file 'lisp/emulation/pc-select.el' => 'lisp/obsolete/pc-select.el' --- lisp/emulation/pc-select.el 2011-01-25 04:08:28 +0000 +++ lisp/obsolete/pc-select.el 2011-02-08 19:26:07 +0000 @@ -7,6 +7,7 @@ ;; Author: Michael Staats ;; Keywords: convenience emulations ;; Created: 26 Sep 1995 +;; Obsolete-since: 24.1 ;; This file is part of GNU Emacs. @@ -83,6 +84,9 @@ :prefix "pc-select" :group 'emulations) +(define-obsolete-variable-alias 'pc-select-override-scroll-error + 'scroll-error-top-bottom + "24.1") (defcustom pc-select-override-scroll-error t "Non-nil means don't generate error on scrolling past edge of buffer. This variable applies in PC Selection mode only. @@ -92,9 +96,6 @@ errors are suppressed." :type 'boolean :group 'pc-select) -(define-obsolete-variable-alias 'pc-select-override-scroll-error - 'scroll-error-top-bottom - "24.1") (defcustom pc-select-selection-keys-only nil "Non-nil means only bind the basic selection keys when started. @@ -132,73 +133,14 @@ (defvar pc-select-default-key-bindings nil "These key bindings always get set by PC Selection mode.") -(unless pc-select-default-key-bindings - (let ((lst - ;; This is to avoid confusion with the delete-selection-mode. - ;; On simple displays you can't see that a region is active and - ;; will be deleted on the next keypress IMHO especially for - ;; copy-region-as-kill this is confusing. - ;; The same goes for exchange-point-and-mark - '(("\M-w" . copy-region-as-kill-nomark) - ("\C-x\C-x" . exchange-point-and-mark-nomark) - ([S-right] . forward-char-mark) - ([right] . forward-char-nomark) - ([C-S-right] . forward-word-mark) - ([C-right] . forward-word-nomark) - ([S-left] . backward-char-mark) - ([left] . backward-char-nomark) - ([C-S-left] . backward-word-mark) - ([C-left] . backward-word-nomark) - ([S-down] . next-line-mark) - ([down] . next-line-nomark) - - ([S-end] . end-of-line-mark) - ([end] . end-of-line-nomark) - ([S-C-end] . end-of-buffer-mark) - ([C-end] . end-of-buffer-nomark) - ([S-M-end] . end-of-buffer-mark) - ([M-end] . end-of-buffer-nomark) - - ([S-next] . scroll-up-mark) - ([next] . scroll-up-nomark) - - ([S-up] . previous-line-mark) - ([up] . previous-line-nomark) - - ([S-home] . beginning-of-line-mark) - ([home] . beginning-of-line-nomark) - ([S-C-home] . beginning-of-buffer-mark) - ([C-home] . beginning-of-buffer-nomark) - ([S-M-home] . beginning-of-buffer-mark) - ([M-home] . beginning-of-buffer-nomark) - - ([M-S-down] . forward-line-mark) - ([M-down] . forward-line-nomark) - ([M-S-up] . backward-line-mark) - ([M-up] . backward-line-nomark) - - ([S-prior] . scroll-down-mark) - ([prior] . scroll-down-nomark) - - ;; Next four lines are from Pete Forman. - ([C-down] . forward-paragraph-nomark) ; KNextPara cDn - ([C-up] . backward-paragraph-nomark) ; KPrevPara cUp - ([S-C-down] . forward-paragraph-mark) - ([S-C-up] . backward-paragraph-mark)))) - - (setq pc-select-default-key-bindings lst))) - -(defvar pc-select-extra-key-bindings nil - "Key bindings to set only if `pc-select-selection-keys-only' is nil.") - -;; The following keybindings are for standard ISO keyboards -;; as they are used with IBM compatible PCs, IBM RS/6000, -;; MACs, many X-Stations and probably more -(unless pc-select-extra-key-bindings - (let ((lst - '(([S-insert] . yank) - ([C-insert] . copy-region-as-kill) - ([S-delete] . kill-region) +(defvar pc-select-extra-key-bindings + ;; The following keybindings are for standard ISO keyboards + ;; as they are used with IBM compatible PCs, IBM RS/6000, + ;; MACs, many X-Stations and probably more. + '(;; Commented out since it's been standard at least since Emacs-21. + ;;([S-insert] . yank) + ;;([C-insert] . copy-region-as-kill) + ;;([S-delete] . kill-region) ;; The following bindings are useful on Sun Type 3 keyboards ;; They implement the Get-Delete-Put (copy-cut-paste) @@ -218,19 +160,14 @@ ;; I only used the one that is not covered above. ([C-M-delete] . kill-sexp) ;; Next line proposed by Eli Barzilay - ([C-escape] . electric-buffer-list)))) - - (setq pc-select-extra-key-bindings lst))) + ([C-escape] . electric-buffer-list)) + "Key bindings to set only if `pc-select-selection-keys-only' is nil.") (defvar pc-select-meta-moves-sexps-key-bindings - '((([M-S-right] . forward-sexp-mark) - ([M-right] . forward-sexp-nomark) - ([M-S-left] . backward-sexp-mark) - ([M-left] . backward-sexp-nomark)) - (([M-S-right] . forward-word-mark) - ([M-right] . forward-word-nomark) - ([M-S-left] . backward-word-mark) - ([M-left] . backward-word-nomark))) + '((([M-right] . forward-sexp) + ([M-left] . backward-sexp)) + (([M-right] . forward-word) + ([M-left] . backward-word))) "The list of key bindings controlled by `pc-select-meta-moves-sexp'. The bindings in the car of this list get installed if `pc-select-meta-moves-sexp' is t, the bindings in the cadr of this @@ -259,514 +196,6 @@ (provide 'pc-select) -(defun copy-region-as-kill-nomark (beg end) - "Save the region as if killed, but don't kill it; deactivate mark. -If `interprogram-cut-function' is non-nil, also save the text for a window -system cut and paste. - -Deactivating mark is to avoid confusion with `delete-selection-mode' -and `transient-mark-mode'." - (interactive "r") - (copy-region-as-kill beg end) - (setq mark-active nil) - (message "Region saved")) - -(defun exchange-point-and-mark-nomark () - "Like `exchange-point-and-mark' but without activating the mark." - (interactive) - (exchange-point-and-mark) - (setq mark-active nil)) - -;;;; -;; non-interactive -;;;; -(defun pc-select-ensure-mark () - ;; make sure mark is active - ;; test if it is active, if it isn't, set it and activate it - (or mark-active (set-mark-command nil)) - ;; Remember who activated the mark. - (setq mark-active 'pc-select)) - -(defun pc-select-maybe-deactivate-mark () - ;; maybe switch off mark (only if *we* switched it on) - (when (eq mark-active 'pc-select) - (deactivate-mark))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;; forward and mark -;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defun forward-char-mark (&optional arg) - "Ensure mark is active; move point right ARG characters (left if ARG negative). -On reaching end of buffer, stop and signal error." - (interactive "p") - (pc-select-ensure-mark) - (forward-char arg)) - -(defun forward-word-mark (&optional arg) - "Ensure mark is active; move point right ARG words (backward if ARG is negative). -Normally returns t. -If an edge of the buffer is reached, point is left there -and nil is returned." - (interactive "p") - (pc-select-ensure-mark) - (forward-word arg)) - -(defun forward-line-mark (&optional arg) - "Ensure mark is active; move cursor vertically down ARG lines." - (interactive "p") - (pc-select-ensure-mark) - (forward-line arg) - (setq this-command 'forward-line) -) - -(defun forward-sexp-mark (&optional arg) - "Ensure mark is active; move forward across one balanced expression (sexp). -With argument, do it that many times. Negative arg -N means -move backward across N balanced expressions." - (interactive "p") - (pc-select-ensure-mark) - (forward-sexp arg)) - -(defun forward-paragraph-mark (&optional arg) - "Ensure mark is active; move forward to end of paragraph. -With arg N, do it N times; negative arg -N means move backward N paragraphs. - -A line which `paragraph-start' matches either separates paragraphs -\(if `paragraph-separate' matches it also) or is the first line of a paragraph. -A paragraph end is the beginning of a line which is not part of the paragraph -to which the end of the previous line belongs, or the end of the buffer." - (interactive "p") - (pc-select-ensure-mark) - (forward-paragraph arg)) - -(defun next-line-mark (&optional arg) - "Ensure mark is active; move cursor vertically down ARG lines. -If there is no character in the target line exactly under the current column, -the cursor is positioned after the character in that line which spans this -column, or at the end of the line if it is not long enough. -If there is no line in the buffer after this one, behavior depends on the -value of `next-line-add-newlines'. If non-nil, it inserts a newline character -to create a line, and moves the cursor to that line. Otherwise it moves the -cursor to the end of the buffer \(if already at the end of the buffer, an error -is signaled). - -The command \\[set-goal-column] can be used to create -a semipermanent goal column to which this command always moves. -Then it does not try to move vertically. This goal column is stored -in `goal-column', which is nil when there is none." - (interactive "p") - (pc-select-ensure-mark) - (with-no-warnings (next-line arg)) - (setq this-command 'next-line)) - -(defun end-of-line-mark (&optional arg) - "Ensure mark is active; move point to end of current 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-line arg) - (setq this-command 'end-of-line)) - -(defun backward-line-mark (&optional arg) - "Ensure mark is active; move cursor vertically up ARG lines." - (interactive "p") - (pc-select-ensure-mark) - (if (null arg) - (setq arg 1)) - (forward-line (- arg)) - (setq this-command 'forward-line) -) - -(defun scroll-down-mark (&optional arg) - "Ensure mark is active; scroll down ARG lines; or near full screen if no ARG. -A near full screen is `next-screen-context-lines' less than a full screen. -Negative ARG means scroll upward. -When calling from a program, supply a number as argument or nil. -Attempting to scroll past the edge of buffer does not raise an -error, unless `pc-select-override-scroll-error' is nil." - (interactive "P") - (pc-select-ensure-mark) - (cond (pc-select-override-scroll-error - (condition-case nil (scroll-down arg) - (beginning-of-buffer (goto-char (point-min))))) - (t (scroll-down arg)))) - -(defun end-of-buffer-mark (&optional arg) - "Ensure mark is active; move point to the end of the buffer. -With arg N, put point N/10 of the way from the end. - -If the buffer is narrowed, this command uses the beginning and size -of the accessible part of the buffer. - -Don't use this command in Lisp programs! -\(goto-char \(point-max)) is faster and avoids clobbering the mark." - (interactive "P") - (pc-select-ensure-mark) - (let ((size (- (point-max) (point-min)))) - (goto-char (if arg - (- (point-max) - (if (> size 10000) - ;; Avoid overflow for large buffer sizes! - (* (prefix-numeric-value arg) - (/ size 10)) - (/ (* size (prefix-numeric-value arg)) 10))) - (point-max)))) - ;; If we went to a place in the middle of the buffer, - ;; adjust it to the beginning of a line. - (if arg (forward-line 1) - ;; If the end of the buffer is not already on the screen, - ;; then scroll specially to put it near, but not at, the bottom. - (if (let ((old-point (point))) - (save-excursion - (goto-char (window-start)) - (vertical-motion (window-height)) - (< (point) old-point))) - (progn - (overlay-recenter (point)) - (recenter -3))))) - -;;;;;;;;; -;;;;; no mark -;;;;;;;;; - -(defun forward-char-nomark (&optional arg) - "Deactivate mark; move point right ARG characters \(left if ARG negative). -On reaching end of buffer, stop and signal error." - (interactive "p") - (pc-select-maybe-deactivate-mark) - (forward-char arg)) - -(defun forward-word-nomark (&optional arg) - "Deactivate mark; move point right ARG words \(backward if ARG is negative). -Normally returns t. -If an edge of the buffer is reached, point is left there -and nil is returned." - (interactive "p") - (pc-select-maybe-deactivate-mark) - (forward-word arg)) - -(defun forward-line-nomark (&optional arg) - "Deactivate mark; move cursor vertically down ARG lines." - (interactive "p") - (pc-select-maybe-deactivate-mark) - (forward-line arg) - (setq this-command 'forward-line) -) - -(defun forward-sexp-nomark (&optional arg) - "Deactivate mark; move forward across one balanced expression (sexp). -With argument, do it that many times. Negative arg -N means -move backward across N balanced expressions." - (interactive "p") - (pc-select-maybe-deactivate-mark) - (forward-sexp arg)) - -(defun forward-paragraph-nomark (&optional arg) - "Deactivate mark; move forward to end of paragraph. -With arg N, do it N times; negative arg -N means move backward N paragraphs. - -A line which `paragraph-start' matches either separates paragraphs -\(if `paragraph-separate' matches it also) or is the first line of a paragraph. -A paragraph end is the beginning of a line which is not part of the paragraph -to which the end of the previous line belongs, or the end of the buffer." - (interactive "p") - (pc-select-maybe-deactivate-mark) - (forward-paragraph arg)) - -(defun next-line-nomark (&optional arg) - "Deactivate mark; move cursor vertically down ARG lines. -If there is no character in the target line exactly under the current column, -the cursor is positioned after the character in that line which spans this -column, or at the end of the line if it is not long enough. -If there is no line in the buffer after this one, behavior depends on the -value of `next-line-add-newlines'. If non-nil, it inserts a newline character -to create a line, and moves the cursor to that line. Otherwise it moves the -cursor to the end of the buffer (if already at the end of the buffer, an error -is signaled). - -The command \\[set-goal-column] can be used to create -a semipermanent goal column to which this command always moves. -Then it does not try to move vertically. This goal column is stored -in `goal-column', which is nil when there is none." - (interactive "p") - (pc-select-maybe-deactivate-mark) - (with-no-warnings (next-line arg)) - (setq this-command 'next-line)) - -(defun end-of-line-nomark (&optional arg) - "Deactivate mark; move point to end of current 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-line arg) - (setq this-command 'end-of-line)) - -(defun backward-line-nomark (&optional arg) - "Deactivate mark; move cursor vertically up ARG lines." - (interactive "p") - (pc-select-maybe-deactivate-mark) - (if (null arg) - (setq arg 1)) - (forward-line (- arg)) - (setq this-command 'forward-line) -) - -(defun scroll-down-nomark (&optional arg) - "Deactivate mark; scroll down ARG lines; or near full screen if no ARG. -A near full screen is `next-screen-context-lines' less than a full screen. -Negative ARG means scroll upward. -When calling from a program, supply a number as argument or nil. -Attempting to scroll past the edge of buffer does not raise an -error, unless `pc-select-override-scroll-error' is nil." - (interactive "P") - (pc-select-maybe-deactivate-mark) - (cond (pc-select-override-scroll-error - (condition-case nil (scroll-down arg) - (beginning-of-buffer (goto-char (point-min))))) - (t (scroll-down arg)))) - -(defun end-of-buffer-nomark (&optional arg) - "Deactivate mark; move point to the end of the buffer. -With arg N, put point N/10 of the way from the end. - -If the buffer is narrowed, this command uses the beginning and size -of the accessible part of the buffer. - -Don't use this command in Lisp programs! -\(goto-char (point-max)) is faster and avoids clobbering the mark." - (interactive "P") - (pc-select-maybe-deactivate-mark) - (let ((size (- (point-max) (point-min)))) - (goto-char (if arg - (- (point-max) - (if (> size 10000) - ;; Avoid overflow for large buffer sizes! - (* (prefix-numeric-value arg) - (/ size 10)) - (/ (* size (prefix-numeric-value arg)) 10))) - (point-max)))) - ;; If we went to a place in the middle of the buffer, - ;; adjust it to the beginning of a line. - (if arg (forward-line 1) - ;; If the end of the buffer is not already on the screen, - ;; then scroll specially to put it near, but not at, the bottom. - (if (let ((old-point (point))) - (save-excursion - (goto-char (window-start)) - (vertical-motion (window-height)) - (< (point) old-point))) - (progn - (overlay-recenter (point)) - (recenter -3))))) - - -;;;;;;;;;;;;;;;;;;;; -;;;;;; backwards and mark -;;;;;;;;;;;;;;;;;;;; - -(defun backward-char-mark (&optional arg) - "Ensure mark is active; move point left ARG characters (right if ARG negative). -On attempt to pass beginning or end of buffer, stop and signal error." - (interactive "p") - (pc-select-ensure-mark) - (backward-char arg)) - -(defun backward-word-mark (&optional arg) - "Ensure mark is active; move backward until encountering the end of a word. -With argument, do this that many times." - (interactive "p") - (pc-select-ensure-mark) - (backward-word arg)) - -(defun backward-sexp-mark (&optional arg) - "Ensure mark is active; move backward across one balanced expression (sexp). -With argument, do it that many times. Negative arg -N means -move forward across N balanced expressions." - (interactive "p") - (pc-select-ensure-mark) - (backward-sexp arg)) - -(defun backward-paragraph-mark (&optional arg) - "Ensure mark is active; move backward to start of paragraph. -With arg N, do it N times; negative arg -N means move forward N paragraphs. - -A paragraph start is the beginning of a line which is a -`first-line-of-paragraph' or which is ordinary text and follows a -paragraph-separating line; except: if the first real line of a -paragraph is preceded by a blank line, the paragraph starts at that -blank line. - -See `forward-paragraph' for more information." - (interactive "p") - (pc-select-ensure-mark) - (backward-paragraph arg)) - -(defun previous-line-mark (&optional arg) - "Ensure mark is active; move cursor vertically up ARG lines. -If there is no character in the target line exactly over the current column, -the cursor is positioned after the character in that line which spans this -column, or at the end of the line if it is not long enough. - -The command \\[set-goal-column] can be used to create -a semipermanent goal column to which this command always moves. -Then it does not try to move vertically. - -If you are thinking of using this in a Lisp program, consider using -`forward-line' with a negative argument instead. It is usually easier -to use and more reliable (no dependence on goal column, etc.)." - (interactive "p") - (pc-select-ensure-mark) - (with-no-warnings (previous-line arg)) - (setq this-command 'previous-line)) - -(defun beginning-of-line-mark (&optional arg) - "Ensure mark is active; move point to beginning of current 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-line arg)) - - -(defun scroll-up-mark (&optional arg) - "Ensure mark is active; 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. -Negative ARG means scroll downward. -When calling from a program, supply a number as argument or nil. -Attempting to scroll past the edge of buffer does not raise an -error, unless `pc-select-override-scroll-error' is nil." - (interactive "P") - (pc-select-ensure-mark) - (cond (pc-select-override-scroll-error - (condition-case nil (scroll-up arg) - (end-of-buffer (goto-char (point-max))))) - (t (scroll-up arg)))) - -(defun beginning-of-buffer-mark (&optional arg) - "Ensure mark is active; move point to the beginning of the buffer. -With arg N, put point N/10 of the way from the beginning. - -If the buffer is narrowed, this command uses the beginning and size -of the accessible part of the buffer. - -Don't use this command in Lisp programs! -\(goto-char (point-min)) is faster and avoids clobbering the mark." - (interactive "P") - (pc-select-ensure-mark) - (let ((size (- (point-max) (point-min)))) - (goto-char (if arg - (+ (point-min) - (if (> size 10000) - ;; Avoid overflow for large buffer sizes! - (* (prefix-numeric-value arg) - (/ size 10)) - (/ (+ 10 (* size (prefix-numeric-value arg))) 10))) - (point-min)))) - (if arg (forward-line 1))) - -;;;;;;;; -;;; no mark -;;;;;;;; - -(defun backward-char-nomark (&optional arg) - "Deactivate mark; move point left ARG characters (right if ARG negative). -On attempt to pass beginning or end of buffer, stop and signal error." - (interactive "p") - (pc-select-maybe-deactivate-mark) - (backward-char arg)) - -(defun backward-word-nomark (&optional arg) - "Deactivate mark; move backward until encountering the end of a word. -With argument, do this that many times." - (interactive "p") - (pc-select-maybe-deactivate-mark) - (backward-word arg)) - -(defun backward-sexp-nomark (&optional arg) - "Deactivate mark; move backward across one balanced expression (sexp). -With argument, do it that many times. Negative arg -N means -move forward across N balanced expressions." - (interactive "p") - (pc-select-maybe-deactivate-mark) - (backward-sexp arg)) - -(defun backward-paragraph-nomark (&optional arg) - "Deactivate mark; move backward to start of paragraph. -With arg N, do it N times; negative arg -N means move forward N paragraphs. - -A paragraph start is the beginning of a line which is a -`first-line-of-paragraph' or which is ordinary text and follows a -paragraph-separating line; except: if the first real line of a -paragraph is preceded by a blank line, the paragraph starts at that -blank line. - -See `forward-paragraph' for more information." - (interactive "p") - (pc-select-maybe-deactivate-mark) - (backward-paragraph arg)) - -(defun previous-line-nomark (&optional arg) - "Deactivate mark; move cursor vertically up ARG lines. -If there is no character in the target line exactly over the current column, -the cursor is positioned after the character in that line which spans this -column, or at the end of the line if it is not long enough. - -The command \\[set-goal-column] can be used to create -a semipermanent goal column to which this command always moves. -Then it does not try to move vertically." - (interactive "p") - (pc-select-maybe-deactivate-mark) - (with-no-warnings (previous-line arg)) - (setq this-command 'previous-line)) - -(defun beginning-of-line-nomark (&optional arg) - "Deactivate mark; move point to beginning of current 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-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. -Negative ARG means scroll downward. -When calling from a program, supply a number as argument or nil. -Attempting to scroll past the edge of buffer does not raise an -error, unless `pc-select-override-scroll-error' is nil." - (interactive "P") - (pc-select-maybe-deactivate-mark) - (cond (pc-select-override-scroll-error - (condition-case nil (scroll-up arg) - (end-of-buffer (goto-char (point-max))))) - (t (scroll-up arg)))) - -(defun beginning-of-buffer-nomark (&optional arg) - "Deactivate mark; move point to the beginning of the buffer. -With arg N, put point N/10 of the way from the beginning. - -If the buffer is narrowed, this command uses the beginning and size -of the accessible part of the buffer. - -Don't use this command in Lisp programs! -\(goto-char (point-min)) is faster and avoids clobbering the mark." - (interactive "P") - (pc-select-maybe-deactivate-mark) - (let ((size (- (point-max) (point-min)))) - (goto-char (if arg - (+ (point-min) - (if (> size 10000) - ;; Avoid overflow for large buffer sizes! - (* (prefix-numeric-value arg) - (/ size 10)) - (/ (+ 10 (* size (prefix-numeric-value arg))) 10))) - (point-min)))) - (if arg (forward-line 1))) - - (defun pc-select-define-keys (alist keymap) "Make KEYMAP have the key bindings specified in ALIST." (let ((lst alist)) @@ -937,6 +366,7 @@ (pc-select-save-and-set-var highlight-nonselected-windows nil) (pc-select-save-and-set-var transient-mark-mode t) + (pc-select-save-and-set-var shift-select-mode t) (pc-select-save-and-set-var mark-even-if-inactive t) (pc-select-save-and-set-mode delete-selection-mode 1)) ;;else @@ -974,6 +404,7 @@ (pc-select-restore-var highlight-nonselected-windows) (pc-select-restore-var transient-mark-mode) + (pc-select-restore-var shift-select-mode) (pc-select-restore-var mark-even-if-inactive) (pc-select-restore-mode delete-selection-mode) (and pc-select-old-M-delete-binding @@ -981,5 +412,6 @@ pc-select-old-M-delete-binding)) (setq pc-select-key-bindings-alist nil pc-select-saved-settings-alist nil)))) +(make-obsolete 'pc-selection-mode 'delete-selection-mode "24.1") ;;; pc-select.el ends here From unknown Sun Aug 17 22:12:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 09 Mar 2011 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator