unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: don't yank keymap text properties
Date: 12 Oct 2003 23:42:55 +0200	[thread overview]
Message-ID: <m3ismu5e00.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <87d6d2zj27.fsf@emacswiki.org>

Alex Schroeder <alex@emacswiki.org> 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 <forcer@forcix.cx> 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
> Emacs-devel@gnu.org
> http://mail.gnu.org/mailman/listinfo/emacs-devel
> 
> 

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

  reply	other threads:[~2003-10-12 21:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-12 13:23 don't yank keymap text properties Alex Schroeder
2003-10-12 21:42 ` Kim F. Storm [this message]
2003-10-13 23:06   ` Alex Schroeder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3ismu5e00.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).