[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r104647: * x-dnd.el (x-dnd-version-fr
From: |
Jan D. |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r104647: * x-dnd.el (x-dnd-version-from-flags) |
Date: |
Mon, 20 Jun 2011 22:49:12 +0200 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 104647
fixes bug(s): http://debbugs.gnu.org/8899
committer: Jan D. <address@hidden>
branch nick: trunk
timestamp: Mon 2011-06-20 22:49:12 +0200
message:
* x-dnd.el (x-dnd-version-from-flags)
(x-dnd-more-than-3-from-flags): New functions that handle long-as-cons
and long as number.
(x-dnd-handle-xdnd): Call functions above.
modified:
lisp/ChangeLog
lisp/x-dnd.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2011-06-20 20:16:20 +0000
+++ b/lisp/ChangeLog 2011-06-20 20:49:12 +0000
@@ -1,3 +1,10 @@
+2011-06-20 Jan Djärv <address@hidden>
+
+ * x-dnd.el (x-dnd-version-from-flags)
+ (x-dnd-more-than-3-from-flags): New functions that handle long-as-cons
+ and long as number (Bug#8899).
+ (x-dnd-handle-xdnd): Call functions above (Bug#8899).
+
2011-06-20 Stefan Monnier <address@hidden>
* minibuffer.el (completion-metadata): Prepend the alist with
`metadata'.
=== modified file 'lisp/x-dnd.el'
--- a/lisp/x-dnd.el 2011-04-19 13:44:55 +0000
+++ b/lisp/x-dnd.el 2011-06-20 20:49:12 +0000
@@ -433,6 +433,18 @@
(declare-function x-get-selection-internal "xselect.c"
(selection-symbol target-type &optional time-stamp))
+(defun x-dnd-version-from-flags (flags)
+ "Return the version byte from the 32 bit FLAGS in an XDndEnter message"
+ (if (consp flags) ;; Long as cons
+ (ash (car flags) -8)
+ (ash flags -24))) ;; Ordinary number
+
+(defun x-dnd-more-than-3-from-flags (flags)
+ "Return the nmore-than3 bit from the 32 bit FLAGS in an XDndEnter message"
+ (if (consp flags)
+ (logand (cdr flags) 1)
+ (logand flags 1)))
+
(defun x-dnd-handle-xdnd (event frame window message _format data)
"Receive one XDND event (client message) and send the appropriate reply.
EVENT is the client message. FRAME is where the mouse is now.
@@ -440,9 +452,10 @@
FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent."
(cond ((equal "XdndEnter" message)
(let* ((flags (aref data 1))
- (version (and (consp flags) (ash (car flags) -8)))
- (more-than-3 (and (consp flags) (cdr flags)))
+ (version (x-dnd-version-from-flags flags))
+ (more-than-3 (x-dnd-more-than-3-from-flags flags))
(dnd-source (aref data 0)))
+ (message "%s %s" version more-than-3)
(if version ;; If flags is bad, version will be nil.
(x-dnd-save-state
window nil nil
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r104647: * x-dnd.el (x-dnd-version-from-flags),
Jan D. <=