Dieter Deyke <[EMAIL PROTECTED]> writes: DD> I am trying to use bongo-insert-uri on my emacs running natively on DD> Windows XP, but do get a missing function error for x-get-selection. DD> Could it be that the code using it is X windows specific?
Daniel Jensen <[EMAIL PROTECTED]> writes: DJ> I think I found the bug, but I cannot test it myself. On MS Windows, DJ> x-get-selection is redefined, but x-get-clipboard is not. Does this DJ> patch fix the problem for you? DJ> DJ> --- bongo-old/bongo.el 2007-01-15 14:15:44.000000000 +0100 DJ> +++ bongo-new/bongo.el 2007-02-03 11:53:21.000000000 +0100 DJ> @@ -6171,7 +6171,7 @@ DJ> (let ((primary (x-get-selection))) DJ> (and (bongo-uri-p primary) primary))) DJ> (and (x-selection-exists-p 'CLIPBOARD) DJ> - (let ((clipboard (x-get-clipboard))) DJ> + (let ((clipboard (x-get-selection 'CLIPBOARD))) DJ> (and (bongo-uri-p clipboard) clipboard))))) DJ> (uri DJ> (read-string (concat "Insert URI" DJ> Daniel Brockman <[EMAIL PROTECTED]> writes: DB> Thank you. I have installed the following patch: DB> DB> diff -rN -u old-bongo/bongo.el new-bongo/bongo.el DB> --- old-bongo/bongo.el 2007-02-03 19:15:30.000000000 +0100 DB> +++ new-bongo/bongo.el 2007-02-03 19:15:30.000000000 +0100 DB> @@ -1771,8 +1771,9 @@ DB> (match-string 1 file-name))) DB> DB> (defun bongo-uri-p (file-name) DB> - "Return non-nil if FILE-NAME is a URI." DB> - (not (null (bongo-uri-scheme file-name)))) DB> + "Return non-nil if FILE-NAME is a URI. DB> +As a special case, return nil if FILE-NAME is nil." DB> + (and file-name (not (null (bongo-uri-scheme file-name))))) DB> DB> (defun bongo-unescape-uri (uri) DB> "Replace all occurences of `%HH' in URI by the character HH." DB> @@ -6192,7 +6193,9 @@ DB> (let ((primary (x-get-selection))) DB> (and (bongo-uri-p primary) primary))) DB> (and (x-selection-exists-p 'CLIPBOARD) DB> - (let ((clipboard (x-get-clipboard))) DB> + (let ((clipboard (if (fboundp 'x-get-clipboard) DB> + (x-get-clipboard) DB> + (x-get-selection 'CLIPBOARD)))) DB> (and (bongo-uri-p clipboard) clipboard))))) DB> (uri DB> (read-string (concat "Insert URI" DB> DB> Please verify that this fixes your problem. Dieter Deyke <[EMAIL PROTECTED]> writes: DD> Sorry, but this patch results in showing the original error: DD> DD> Debugger entered--Lisp error: (void-function x-get-selection-internal) DD> x-get-selection-internal(CLIPBOARD STRING) DD> x-get-clipboard() [...] DD> x-get-clipboard is defined in select.el as: DD> DD> (defun x-get-clipboard () DD> "Return text pasted to the clipboard." DD> (x-get-selection-internal 'CLIPBOARD 'STRING)) DD> DD> but I cannot find a definition of x-get-selection-internal. This DD> might be an emacs error, not a bongo error, but I do not know how to DD> reproduce it without bongo. I'm sorry. Daniel Jensen was on the right track with his patch but I managed to screw it up with the one I applied. I mistook the problem as being that `x-get-selection' didn't exist on W32 (in fact, `x-get-selection-internal' appears to be the function that doesn't exist). So I have applied a new patch. Please try it. -- Daniel Brockman <[EMAIL PROTECTED]> _______________________________________________ bongo-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/bongo-devel
