bongo-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bongo-patches] Remove all text properties from URIs grabbed from the cl


From: Daniel Brockman
Subject: [bongo-patches] Remove all text properties from URIs grabbed from the clipboard before using them
Date: Mon, 30 Apr 2007 16:33:43 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux)

Remove all text properties from URIs grabbed from the
clipboard before using them.

diff -rN -u old-bongo/bongo.el new-bongo/bongo.el
--- old-bongo/bongo.el  2007-04-30 16:33:37.000000000 +0200
+++ new-bongo/bongo.el  2007-04-30 16:33:37.000000000 +0200
@@ -7804,10 +7804,15 @@
 (defun bongo-get-x-selection-uri ()
   "Return the URI in the X Windows selection, if any.
 See `bongo-get-x-selection'."
-  (or (let ((primary (bongo-get-x-selection)))
-        (and (bongo-uri-p primary) primary))
-      (let ((clipboard (bongo-get-x-selection 'CLIPBOARD)))
-        (and (bongo-uri-p clipboard) clipboard))))
+  (let ((value (or (let ((primary (bongo-get-x-selection)))
+                     (and (bongo-uri-p primary) primary))
+                   (let ((clipboard (bongo-get-x-selection 'CLIPBOARD)))
+                     (and (bongo-uri-p clipboard) clipboard)))))
+    (prog1 value
+      (when value
+        ;; The string may have `read-only' properties on it,
+        ;; and other properties may cause problems as well.
+        (set-text-properties 0 (length value) nil value)))))
 
 (defun bongo-insert-uri (uri &optional title)
   "Insert a new track line corresponding to URI.
-- 
Daniel Brockman <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]