all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Various simple.el patches
@ 2003-05-13 20:31 Stefan Monnier
  2003-05-14 11:44 ` Kai Großjohann
                   ` (2 more replies)
  0 siblings, 3 replies; 58+ messages in thread
From: Stefan Monnier @ 2003-05-13 20:31 UTC (permalink / raw)



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

^ permalink raw reply	[flat|nested] 58+ messages in thread

end of thread, other threads:[~2003-05-30  0:50 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-13 20:31 Various simple.el patches Stefan Monnier
2003-05-14 11:44 ` Kai Großjohann
2003-05-14 12:42   ` Miles Bader
2003-05-14 13:58     ` Kai Großjohann
2003-05-14 14:48       ` Miles Bader
2003-05-14 15:54         ` Kai Großjohann
2003-05-16  3:51           ` Richard Stallman
2003-05-16  5:54             ` Kai Großjohann
2003-05-17 13:49               ` Richard Stallman
2003-05-18 15:38                 ` Kai Großjohann
2003-05-19  2:11                   ` Luc Teirlinck
2003-05-19  7:42                     ` Kai Großjohann
2003-05-19 14:22                       ` Luc Teirlinck
2003-05-21  3:12                       ` Luc Teirlinck
2003-05-21 14:07                         ` Luc Teirlinck
2003-05-21 18:06                           ` Tak Ota
2003-05-21 18:16                             ` Luc Teirlinck
2003-05-21 18:33                             ` Luc Teirlinck
2003-05-21 18:44                             ` Luc Teirlinck
2003-05-22  2:52                           ` Luc Teirlinck
2003-05-23  3:52                             ` Luc Teirlinck
2003-05-23  6:57                               ` Kai Großjohann
2003-05-23 18:27                                 ` Luc Teirlinck
2003-05-23 19:04                                   ` Kai Großjohann
2003-05-23 19:45                                     ` Luc Teirlinck
2003-05-28  4:32                                     ` Luc Teirlinck
2003-05-28 18:46                                       ` Kai Großjohann
2003-05-28 19:47                                         ` Luc Teirlinck
2003-05-28 20:11                                           ` Kai Großjohann
2003-05-30  0:50                                         ` Richard Stallman
2003-05-24 10:00                                   ` Eli Zaretskii
2003-05-25  2:42                                     ` Luc Teirlinck
2003-05-25  3:33                                       ` Eli Zaretskii
2003-05-25  4:43                                         ` Luc Teirlinck
2003-05-25  5:00                                           ` Luc Teirlinck
2003-05-26 13:48                                             ` Richard Stallman
2003-05-25 17:08                                           ` Eli Zaretskii
2003-05-25 15:06                                         ` Stefan Monnier
2003-05-25 15:04                                       ` Stefan Monnier
2003-05-23 18:47                                 ` Luc Teirlinck
2003-05-23 13:51                               ` Stefan Monnier
2003-05-23 17:06                                 ` Luc Teirlinck
2003-05-23 19:07                                   ` Kai Großjohann
2003-05-23 19:24                               ` Kai Großjohann
2003-05-23 19:39                                 ` Luc Teirlinck
2003-05-24 23:20                                 ` Richard Stallman
2003-05-27 17:43                                   ` Kevin Rodgers
2003-05-28 23:58                                     ` Richard Stallman
2003-05-14 16:38         ` Ami Fischman
2003-05-14 17:38           ` Stefan Monnier
2003-05-16  3:51         ` Richard Stallman
2003-05-15 15:40 ` Jan Nieuwenhuizen
2003-05-15 15:45   ` Stefan Monnier
2003-05-16 15:47 ` Richard Stallman
2003-05-16 18:18   ` Stefan Monnier
2003-05-18 12:22     ` Richard Stallman
2003-05-18 15:13       ` Kai Großjohann
2003-05-19 14:53         ` Richard Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.