bongo-patches
[Top][All Lists]
Advanced

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

[bongo-patches] Adapt `bongo-uri-p' and `bongo-insert-uri' for W32 compa


From: Daniel Brockman
Subject: [bongo-patches] Adapt `bongo-uri-p' and `bongo-insert-uri' for W32 compatibility (reported by Dieter Deyke, patch by Daniel Jensen)
Date: Sat, 03 Feb 2007 19:17:42 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.51 (gnu/linux)

Sat Feb  3 19:23:06 CET 2007  Daniel Brockman <address@hidden>

 * Adapt `bongo-uri-p' and `bongo-insert-uri' for W32
   compatibility (reported by Dieter Deyke, patch by Daniel
   Jensen).

diff -rN -u old-bongo/bongo.el new-bongo/bongo.el
--- old-bongo/bongo.el  2007-02-03 19:15:30.000000000 +0100
+++ new-bongo/bongo.el  2007-02-03 19:15:30.000000000 +0100
@@ -1771,8 +1771,9 @@
     (match-string 1 file-name)))
 
 (defun bongo-uri-p (file-name)
-  "Return non-nil if FILE-NAME is a URI."
-  (not (null (bongo-uri-scheme file-name))))
+  "Return non-nil if FILE-NAME is a URI.
+As a special case, return nil if FILE-NAME is nil."
+  (and file-name (not (null (bongo-uri-scheme file-name)))))
 
 (defun bongo-unescape-uri (uri)
   "Replace all occurences of `%HH' in URI by the character HH."
@@ -6192,7 +6193,9 @@
                      (let ((primary (x-get-selection)))
                        (and (bongo-uri-p primary) primary)))
                 (and (x-selection-exists-p 'CLIPBOARD)
-                     (let ((clipboard (x-get-clipboard)))
+                     (let ((clipboard (if (fboundp 'x-get-clipboard)
+                                          (x-get-clipboard)
+                                        (x-get-selection 'CLIPBOARD))))
                        (and (bongo-uri-p clipboard) clipboard)))))
           (uri
            (read-string (concat "Insert URI"
-- 
Daniel Brockman <address@hidden>

reply via email to

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