From: Tak Ota <Takaaki.Ota@am.sony.com>
Subject: keymap in yank-excluded-properties
Date: Thu, 22 Aug 2002 17:31:29 -0700 (PDT) [thread overview]
Message-ID: <20020822.173129.01368056.Takaaki.Ota@am.sony.com> (raw)
Since the following change was made to yank's underpinning, a table
created by `table.el' becomes dead after copying because keymap text
property is stripped off at yank.
2002-04-29 Kim F. Storm <storm@cua.dk>
* subr.el (remove-yank-excluded-properties): New helper function.
(insert-for-yank, insert-buffer-substring-as-yank): Use it.
* simple.el (yank-excluded-properties): Added help-echo to list.
Is it generally a good idea not to copy keymap text property? If
majority of you agree that yank normally should not copy keymap
property, is the following modification to the function
`remove-yank-excluded-properties' acceptable? The idea is if a
special text property `yank-preserve-all-properties' exists in the
region and its value is non-nil then yank will not strip any text
properties off.
-Tak
*** ../../pure/emacs-21.3.50/lisp/subr.el Fri Aug 2 21:26:30 2002
--- subr.el Thu Aug 22 15:59:53 2002
***************
*** 1415,1441 ****
(defun remove-yank-excluded-properties (start end)
"Remove `yank-excluded-properties' between START and END positions.
Replaces `category' properties with their defined properties."
! (let ((inhibit-read-only t))
! ;; Replace any `category' property with the properties it stands for.
! (unless (memq yank-excluded-properties '(t nil))
! (save-excursion
! (goto-char start)
! (while (< (point) end)
! (let ((cat (get-text-property (point) 'category))
! run-end)
! (when cat
(setq run-end
(next-single-property-change (point) 'category nil end))
! (remove-list-of-text-properties (point) run-end '(category))
! (add-text-properties (point) run-end (symbol-plist cat))
! (goto-char (or run-end end)))
! (setq run-end
! (next-single-property-change (point) 'category nil end))
! (goto-char (or run-end end))))))
! (if (eq yank-excluded-properties t)
! (set-text-properties start end nil)
! (remove-list-of-text-properties start end
! yank-excluded-properties))))
(defun insert-for-yank (&rest strings)
"Insert STRINGS at point, stripping some text properties.
--- 1415,1442 ----
(defun remove-yank-excluded-properties (start end)
"Remove `yank-excluded-properties' between START and END positions.
Replaces `category' properties with their defined properties."
! (unless (text-property-any start end 'yank-preserve-all-properties t)
! (let ((inhibit-read-only t))
! ;; Replace any `category' property with the properties it stands for.
! (unless (memq yank-excluded-properties '(t nil))
! (save-excursion
! (goto-char start)
! (while (< (point) end)
! (let ((cat (get-text-property (point) 'category))
! run-end)
! (when cat
! (setq run-end
! (next-single-property-change (point) 'category nil end))
! (remove-list-of-text-properties (point) run-end '(category))
! (add-text-properties (point) run-end (symbol-plist cat))
! (goto-char (or run-end end)))
(setq run-end
(next-single-property-change (point) 'category nil end))
! (goto-char (or run-end end))))))
! (if (eq yank-excluded-properties t)
! (set-text-properties start end nil)
! (remove-list-of-text-properties start end
! yank-excluded-properties)))))
(defun insert-for-yank (&rest strings)
"Insert STRINGS at point, stripping some text properties.
next reply other threads:[~2002-08-23 0:31 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-23 0:31 Tak Ota [this message]
2002-08-23 1:55 ` keymap in yank-excluded-properties Miles Bader
2002-08-23 22:21 ` Tak Ota
2002-08-23 22:29 ` Stefan Monnier
2002-08-23 23:04 ` Tak Ota
2002-08-23 9:52 ` Kim F. Storm
2002-08-25 5:25 ` Richard Stallman
2002-08-25 22:49 ` Kim F. Storm
2002-08-30 19:43 ` Tak Ota
2002-09-01 13:14 ` Richard Stallman
2002-09-02 15:02 ` Kim F. Storm
2002-09-03 13:26 ` Richard Stallman
2002-09-03 20:36 ` Tak Ota
2002-10-23 13:53 ` Kim F. Storm
2002-10-24 20:27 ` Tak Ota
2002-09-04 1:11 ` Miles Bader
2002-09-04 6:32 ` Juanma Barranquero
2002-09-04 8:45 ` Kim F. Storm
2002-09-04 8:02 ` Miles Bader
2002-09-04 8:50 ` Juanma Barranquero
2002-09-04 8:49 ` Juanma Barranquero
2002-09-04 12:48 ` Kim F. Storm
2002-09-04 14:10 ` Juanma Barranquero
2002-09-04 10:34 ` Per Abrahamsen
2002-09-04 12:35 ` Kim F. Storm
2002-09-05 1:10 ` Miles Bader
2002-09-05 13:18 ` Robert J. Chassell
2002-09-05 15:00 ` Kim F. Storm
2002-09-05 14:34 ` Per Abrahamsen
2002-09-05 15:15 ` Robert J. Chassell
2002-09-06 1:09 ` Miles Bader
2002-09-05 2:46 ` Richard Stallman
2002-09-05 14:48 ` Robert J. Chassell
2002-09-06 1:05 ` Miles Bader
2002-09-06 11:30 ` Andreas Schwab
2002-09-06 11:57 ` Modes: major, minor, context specific Robert J. Chassell
2002-09-06 20:03 ` keymap in yank-excluded-properties Richard Stallman
2002-09-01 13:15 ` Richard Stallman
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=20020822.173129.01368056.Takaaki.Ota@am.sony.com \
--to=takaaki.ota@am.sony.com \
/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).