[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: don't yank keymap text properties
From: |
Kim F. Storm |
Subject: |
Re: don't yank keymap text properties |
Date: |
12 Oct 2003 23:42:55 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
Alex Schroeder <address@hidden> writes:
> I can't remember whether Kim Storm implemented something like this or
> not.
RMS did the initial work, I made some extensions...
> Jorgen Schaefer <address@hidden> sent me the following patch
> to simple.el. What do you think? I think it makes sense. Having
> keymap properties yanked has bothered me on several occasions.
There is already a defcustom named `yank-excluded-properties' which
includes read-only, keymap, and local-map properties.
So I don't see why the proposed patch is needed...
>
> The patch is small, should I apply it? I don't think we need papers
> for it.
>
> Alex.
>
>
>
>
> A little patch to allow me to do
>
> (setq yank-remove-text-properties '(read-only nil
> keymap nil
> local-map nil))
>
> to get rid of all those pasted buttons :) Might even be a more
> sensible default.
>
> Greetings,
> -- Jorgen
>
> P.S. You might want to change the :version in the defcustom.
>
>
> --- simple.el.old 2003-10-11 15:31:16.000000000 +0200
> +++ simple.el 2003-10-11 15:33:36.000000000 +0200
> @@ -1881,6 +1881,12 @@
>
> ;; Yanking.
>
> +(defcustom yank-remove-text-properties '(read-only nil)
> + "*Which text properties to remove on a `yank'."
> + :group 'killing
> + :type 'plist
> + :version "21.3")
> +
> (defun yank-pop (arg)
> "Replace just-yanked stretch of killed text with a different stretch.
> This command is allowed only immediately after a `yank' or a `yank-pop'.
> @@ -1905,7 +1911,7 @@
> (let ((opoint (point)))
> (insert (current-kill arg))
> (let ((inhibit-read-only t))
> - (remove-text-properties opoint (point) '(read-only nil))))
> + (remove-text-properties opoint (point) yank-remove-text-properties)))
> (if before
> ;; This is like exchange-point-and-mark, but doesn't activate the mark.
> ;; It is cleaner to avoid activation, even though the command
> @@ -1933,7 +1939,7 @@
> ((eq arg '-) -1)
> (t (1- arg)))))
> (let ((inhibit-read-only t))
> - (remove-text-properties opoint (point) '(read-only nil))))
> + (remove-text-properties opoint (point) yank-remove-text-properties)))
> (if (consp arg)
> ;; This is like exchange-point-and-mark, but doesn't activate the mark.
> ;; It is cleaner to avoid activation, even though the command
>
>
>
> _______________________________________________
> Emacs-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/emacs-devel
>
>
--
Kim F. Storm <address@hidden> http://www.cua.dk