bongo-patches
[Top][All Lists]
Advanced

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

[bongo-patches] Verify that `x-selection-exists-p' is defined before cal


From: Daniel Brockman
Subject: [bongo-patches] Verify that `x-selection-exists-p' is defined before calling it
Date: Tue, 06 Feb 2007 22:40:30 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.51 (gnu/linux)

Tue Feb  6 15:59:30 CET 2007  Daniel Brockman <address@hidden>

 * Verify that `x-selection-exists-p' is defined before
   calling it.

diff -rN -u old-bongo/bongo.el new-bongo/bongo.el
--- old-bongo/bongo.el  2007-02-06 22:40:08.000000000 +0100
+++ new-bongo/bongo.el  2007-02-06 22:40:08.000000000 +0100
@@ -6410,12 +6410,13 @@
 Optional argument TITLE specifies a custom title for the URI."
   (interactive
    (let* ((default-uri
-            (or (and (x-selection-exists-p)
-                     (let ((primary (x-get-selection)))
-                       (and (bongo-uri-p primary) primary)))
-                (and (x-selection-exists-p 'CLIPBOARD)
-                     (let ((clipboard (x-get-selection 'CLIPBOARD)))
-                       (and (bongo-uri-p clipboard) clipboard)))))
+            (and (fboundp 'x-selection-exists-p)
+                 (or (and (x-selection-exists-p)
+                          (let ((primary (x-get-selection)))
+                            (and (bongo-uri-p primary) primary)))
+                     (and (x-selection-exists-p 'CLIPBOARD)
+                          (let ((clipboard (x-get-selection 'CLIPBOARD)))
+                            (and (bongo-uri-p clipboard) clipboard))))))
           (uri
            (read-string (concat "Insert URI"
                                 (when default-uri
-- 
Daniel Brockman <address@hidden>

reply via email to

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