From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Various simple.el patches Date: Tue, 13 May 2003 16:31:51 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200305132031.h4DKVp58013718@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1052858015 2894 80.91.224.249 (13 May 2003 20:33:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 13 May 2003 20:33:35 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue May 13 22:33:33 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19FgR3-0000bB-00 for ; Tue, 13 May 2003 22:31:41 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19FgY6-0008SU-00 for ; Tue, 13 May 2003 22:38:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19FgSM-00058x-03 for emacs-devel@quimby.gnus.org; Tue, 13 May 2003 16:33:02 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19FgS1-000579-00 for emacs-devel@gnu.org; Tue, 13 May 2003 16:32:41 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19FgRE-0004bR-00 for emacs-devel@gnu.org; Tue, 13 May 2003 16:31:58 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19FgRE-0004bM-00 for emacs-devel@gnu.org; Tue, 13 May 2003 16:31:52 -0400 Original-Received: from rum.cs.yale.edu (localhost [127.0.0.1]) by rum.cs.yale.edu (8.12.8/8.12.8) with ESMTP id h4DKVpx6013720 for ; Tue, 13 May 2003 16:31:51 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.12.8/8.12.8/Submit) id h4DKVp58013718; Tue, 13 May 2003 16:31:51 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13839 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13839 1 - When killing the same thing over and over again, don't fill the kill-ring unnecessarily. @@ -1810,6 +1859,7 @@ argument is not used by `insert-for-yank'. However, since Lisp code may access and use elements from the kill-ring directly, the STRING argument should still be a \"useful\" string for such uses." + (when (equal string (car kill-ring)) (setq replace t)) (if (> (length string) 0) (if yank-handler (put-text-property 0 1 'yank-handler yank-handler string) 2a - When yanking with an active region, do `delete-selection'. 2b - And if the yanked text is the same as the current region, then yank the previous text. This way you can mouse-select one piece of text (which pushes it on the kill-ring), then mouse-select another, then `yank' which replaces the second piece of text with the first one. @@ -2067,7 +2117,11 @@ ;; If we don't get all the way thru, make last-command indicate that ;; for the following command. (setq this-command t) - (push-mark (point)) + (if (and transient-mark-mode mark-active) + (let ((old (delete-and-extract-region (region-beginning) (region-end)))) + (if (and (listp arg) (string= old (current-kill 0))) + (rotate-yank-pointer 1))) + (push-mark (point))) (insert-for-yank (current-kill (cond ((listp arg) 0) ((eq arg '-) -1) 3 - Make C-k at EOB kill the last line. This is mostly useful for the minibuffer and maybe it should only do so in the minibuffer. @@ -2196,7 +2250,13 @@ (if arg (forward-visible-line (prefix-numeric-value arg)) (if (eobp) - (signal 'end-of-buffer nil)) + ;; Make C-k at end of minibuf do C-a C-k. + (if (eq last-command this-command) + ;; Don't do it repeatedly: the user might + ;; stupidly be pressing C-k to delete-to-eob (he + ;; should do M-> C-w instead, of course). + (signal 'end-of-buffer nil) + (beginning-of-line))) (let ((end (save-excursion (end-of-visible-line) (point)))) -- Stefan