diff options
| author | Juanma Barranquero | 2009-02-26 10:26:32 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2009-02-26 10:26:32 +0000 |
| commit | cd07aa70afc54d890adb646f628542a21fc68768 (patch) | |
| tree | d836d7078ccadcf269be078f00f67f36120bfde6 | |
| parent | 1a0de25cadc376f946e31accef07f83570b314ab (diff) | |
| download | emacs-cd07aa70afc54d890adb646f628542a21fc68768.tar.gz emacs-cd07aa70afc54d890adb646f628542a21fc68768.zip | |
* x-dnd.el (x-dnd-test-function, x-dnd-get-state-cons-for-frame)
(x-dnd-get-state-for-frame, x-dnd-handle-moz-url)
(x-dnd-handle-uri-list, x-dnd-choose-type, x-dnd-get-drop-width-height)
(x-dnd-init-motif-for-frame): Fix typos in docstrings.
(x-dnd-drop-data, x-dnd-types-alist, x-dnd-default-test-function):
Reflow docstrings.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/x-dnd.el | 42 |
2 files changed, 30 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1d442c5ccb4..850cb0961f7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2009-02-26 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * x-dnd.el (x-dnd-test-function, x-dnd-get-state-cons-for-frame) | ||
| 4 | (x-dnd-get-state-for-frame, x-dnd-handle-moz-url) | ||
| 5 | (x-dnd-handle-uri-list, x-dnd-choose-type, x-dnd-get-drop-width-height) | ||
| 6 | (x-dnd-init-motif-for-frame): Fix typos in docstrings. | ||
| 7 | (x-dnd-drop-data, x-dnd-types-alist, x-dnd-default-test-function): | ||
| 8 | Reflow docstrings. | ||
| 9 | |||
| 1 | 2009-02-26 Glenn Morris <rgm@gnu.org> | 10 | 2009-02-26 Glenn Morris <rgm@gnu.org> |
| 2 | 11 | ||
| 3 | * mail/rmailsum.el (rmail-summary-rmail-update): | 12 | * mail/rmailsum.el (rmail-summary-rmail-update): |
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el index 45e2e1677d8..74c6321c815 100644 --- a/lisp/x-dnd.el +++ b/lisp/x-dnd.el | |||
| @@ -33,12 +33,12 @@ | |||
| 33 | ;;; Customizable variables | 33 | ;;; Customizable variables |
| 34 | (defcustom x-dnd-test-function 'x-dnd-default-test-function | 34 | (defcustom x-dnd-test-function 'x-dnd-default-test-function |
| 35 | "The function drag and drop uses to determine if to accept or reject a drop. | 35 | "The function drag and drop uses to determine if to accept or reject a drop. |
| 36 | The function takes three arguments, WINDOW ACTION and TYPES. | 36 | The function takes three arguments, WINDOW, ACTION and TYPES. |
| 37 | WINDOW is where the mouse is when the function is called. WINDOW may be a | 37 | WINDOW is where the mouse is when the function is called. WINDOW may be a |
| 38 | frame if the mouse isn't over a real window (i.e. menu bar, tool bar or | 38 | frame if the mouse isn't over a real window (i.e. menu bar, tool bar or |
| 39 | scroll bar). ACTION is the suggested action from the drag and drop source, | 39 | scroll bar). ACTION is the suggested action from the drag and drop source, |
| 40 | one of the symbols move, copy link or ask. TYPES is a list of available types | 40 | one of the symbols move, copy, link or ask. TYPES is a list of available |
| 41 | for the drop. | 41 | types for the drop. |
| 42 | 42 | ||
| 43 | The function shall return nil to reject the drop or a cons with two values, | 43 | The function shall return nil to reject the drop or a cons with two values, |
| 44 | the wanted action as car and the wanted type as cdr. The wanted action | 44 | the wanted action as car and the wanted type as cdr. The wanted action |
| @@ -71,8 +71,8 @@ the drop is rejected. The function takes three arguments, WINDOW, ACTION | |||
| 71 | and DATA. WINDOW is where the drop occurred, ACTION is the action for | 71 | and DATA. WINDOW is where the drop occurred, ACTION is the action for |
| 72 | this drop (copy, move, link, private or ask) as determined by a previous | 72 | this drop (copy, move, link, private or ask) as determined by a previous |
| 73 | call to `x-dnd-test-function'. DATA is the drop data. | 73 | call to `x-dnd-test-function'. DATA is the drop data. |
| 74 | The function shall return the action used (copy, move, link or private) if drop | 74 | The function shall return the action used (copy, move, link or private) |
| 75 | is successful, nil if not." | 75 | if drop is successful, nil if not." |
| 76 | :version "22.1" | 76 | :version "22.1" |
| 77 | :type 'alist | 77 | :type 'alist |
| 78 | :group 'x) | 78 | :group 'x) |
| @@ -130,7 +130,7 @@ any protocol specific data.") | |||
| 130 | (x-dnd-init-motif-for-frame frame))) | 130 | (x-dnd-init-motif-for-frame frame))) |
| 131 | 131 | ||
| 132 | (defun x-dnd-get-state-cons-for-frame (frame-or-window) | 132 | (defun x-dnd-get-state-cons-for-frame (frame-or-window) |
| 133 | "Return the entry in x-dnd-current-state for a frame or window." | 133 | "Return the entry in `x-dnd-current-state' for a frame or window." |
| 134 | (let* ((frame (if (framep frame-or-window) frame-or-window | 134 | (let* ((frame (if (framep frame-or-window) frame-or-window |
| 135 | (window-frame frame-or-window))) | 135 | (window-frame frame-or-window))) |
| 136 | (display (frame-parameter frame 'display))) | 136 | (display (frame-parameter frame 'display))) |
| @@ -140,13 +140,13 @@ any protocol specific data.") | |||
| 140 | (assoc display x-dnd-current-state))) | 140 | (assoc display x-dnd-current-state))) |
| 141 | 141 | ||
| 142 | (defun x-dnd-get-state-for-frame (frame-or-window) | 142 | (defun x-dnd-get-state-for-frame (frame-or-window) |
| 143 | "Return the state in x-dnd-current-state for a frame or window." | 143 | "Return the state in `x-dnd-current-state' for a frame or window." |
| 144 | (cdr (x-dnd-get-state-cons-for-frame frame-or-window))) | 144 | (cdr (x-dnd-get-state-cons-for-frame frame-or-window))) |
| 145 | 145 | ||
| 146 | (defun x-dnd-default-test-function (window action types) | 146 | (defun x-dnd-default-test-function (window action types) |
| 147 | "The default test function for drag and drop. | 147 | "The default test function for drag and drop. |
| 148 | WINDOW is where the mouse is when this function is called. It may be a frame | 148 | WINDOW is where the mouse is when this function is called. It may be |
| 149 | if the mouse is over the menu bar, scroll bar or tool bar. | 149 | a frame if the mouse is over the menu bar, scroll bar or tool bar. |
| 150 | ACTION is the suggested action from the source, and TYPES are the | 150 | ACTION is the suggested action from the source, and TYPES are the |
| 151 | types the drop data can have. This function only accepts drops with | 151 | types the drop data can have. This function only accepts drops with |
| 152 | types in `x-dnd-known-types'. It always returns the action private." | 152 | types in `x-dnd-known-types'. It always returns the action private." |
| @@ -212,7 +212,7 @@ EXTRA-DATA is data needed for a specific protocol." | |||
| 212 | (defun x-dnd-handle-moz-url (window action data) | 212 | (defun x-dnd-handle-moz-url (window action data) |
| 213 | "Handle one item of type text/x-moz-url. | 213 | "Handle one item of type text/x-moz-url. |
| 214 | WINDOW is the window where the drop happened. ACTION is ignored. | 214 | WINDOW is the window where the drop happened. ACTION is ignored. |
| 215 | DATA is the moz-url, which is formatted as two strings separated by \r\n. | 215 | DATA is the moz-url, which is formatted as two strings separated by \\r\\n. |
| 216 | The first string is the URL, the second string is the title of that URL. | 216 | The first string is the URL, the second string is the title of that URL. |
| 217 | DATA is encoded in utf-16. Decode the URL and call `x-dnd-handle-uri-list'." | 217 | DATA is encoded in utf-16. Decode the URL and call `x-dnd-handle-uri-list'." |
| 218 | ;; Mozilla and applications based on it (Galeon for example) uses | 218 | ;; Mozilla and applications based on it (Galeon for example) uses |
| @@ -249,11 +249,11 @@ TEXT is the text as a string, WINDOW is the window where the drop happened." | |||
| 249 | (defun x-dnd-handle-uri-list (window action string) | 249 | (defun x-dnd-handle-uri-list (window action string) |
| 250 | "Split an uri-list into separate URIs and call `dnd-handle-one-url'. | 250 | "Split an uri-list into separate URIs and call `dnd-handle-one-url'. |
| 251 | WINDOW is the window where the drop happened. | 251 | WINDOW is the window where the drop happened. |
| 252 | STRING is the uri-list as a string. The URIs are separated by \r\n." | 252 | STRING is the uri-list as a string. The URIs are separated by \\r\\n." |
| 253 | (let ((uri-list (split-string string "[\0\r\n]" t)) | 253 | (let ((uri-list (split-string string "[\0\r\n]" t)) |
| 254 | retval) | 254 | retval) |
| 255 | (dolist (bf uri-list) | 255 | (dolist (bf uri-list) |
| 256 | ;; If one URL is handeled, treat as if the whole drop succeeded. | 256 | ;; If one URL is handled, treat as if the whole drop succeeded. |
| 257 | (let ((did-action (dnd-handle-one-url window action bf))) | 257 | (let ((did-action (dnd-handle-one-url window action bf))) |
| 258 | (when did-action (setq retval did-action)))) | 258 | (when did-action (setq retval did-action)))) |
| 259 | retval)) | 259 | retval)) |
| @@ -268,7 +268,7 @@ STRING is the file names as a string, separated by nulls." | |||
| 268 | default-file-name-coding-system))) | 268 | default-file-name-coding-system))) |
| 269 | retval) | 269 | retval) |
| 270 | (dolist (bf uri-list) | 270 | (dolist (bf uri-list) |
| 271 | ;; If one URL is handeled, treat as if the whole drop succeeded. | 271 | ;; If one URL is handled, treat as if the whole drop succeeded. |
| 272 | (if coding (setq bf (encode-coding-string bf coding))) | 272 | (if coding (setq bf (encode-coding-string bf coding))) |
| 273 | (let* ((file-uri (concat "file://" | 273 | (let* ((file-uri (concat "file://" |
| 274 | (mapconcat 'url-hexify-string | 274 | (mapconcat 'url-hexify-string |
| @@ -282,7 +282,7 @@ STRING is the file names as a string, separated by nulls." | |||
| 282 | "Choose which type we want to receive for the drop. | 282 | "Choose which type we want to receive for the drop. |
| 283 | TYPES are the types the source of the drop offers, a vector of type names | 283 | TYPES are the types the source of the drop offers, a vector of type names |
| 284 | as strings or symbols. Select among the types in `x-dnd-known-types' or | 284 | as strings or symbols. Select among the types in `x-dnd-known-types' or |
| 285 | KNOWN-TYPES if given, and return that type name. | 285 | KNOWN-TYPES if given, and return that type name. |
| 286 | If no suitable type is found, return nil." | 286 | If no suitable type is found, return nil." |
| 287 | (let* ((known-list (or known-types x-dnd-known-types)) | 287 | (let* ((known-list (or known-types x-dnd-known-types)) |
| 288 | (first-known-type (car known-list)) | 288 | (first-known-type (car known-list)) |
| @@ -303,10 +303,10 @@ If no suitable type is found, return nil." | |||
| 303 | 303 | ||
| 304 | (defun x-dnd-drop-data (event frame window data type) | 304 | (defun x-dnd-drop-data (event frame window data type) |
| 305 | "Drop one data item onto a frame. | 305 | "Drop one data item onto a frame. |
| 306 | EVENT is the client message for the drop, FRAME is the frame the drop occurred | 306 | EVENT is the client message for the drop, FRAME is the frame the drop |
| 307 | on. WINDOW is the window of FRAME where the drop happened. DATA is the data | 307 | occurred on. WINDOW is the window of FRAME where the drop happened. |
| 308 | received from the source, and type is the type for DATA, see | 308 | DATA is the data received from the source, and type is the type for DATA, |
| 309 | `x-dnd-types-alist'). | 309 | see `x-dnd-types-alist'). |
| 310 | 310 | ||
| 311 | Returns the action used (move, copy, link, private) if drop was successful, | 311 | Returns the action used (move, copy, link, private) if drop was successful, |
| 312 | nil if not." | 312 | nil if not." |
| @@ -389,10 +389,10 @@ Currently XDND, Motif and old KDE 1.x protocols are recognized." | |||
| 389 | frame "ATOM" 32 t)) | 389 | frame "ATOM" 32 t)) |
| 390 | 390 | ||
| 391 | (defun x-dnd-get-drop-width-height (frame w accept) | 391 | (defun x-dnd-get-drop-width-height (frame w accept) |
| 392 | "Return the widht/height to be sent in a XDndStatus message. | 392 | "Return the width/height to be sent in a XDndStatus message. |
| 393 | FRAME is the frame and W is the window where the drop happened. | 393 | FRAME is the frame and W is the window where the drop happened. |
| 394 | If ACCEPT is nil return 0 (empty rectangle), | 394 | If ACCEPT is nil return 0 (empty rectangle), |
| 395 | otherwise if W is a window, return its widht/height, | 395 | otherwise if W is a window, return its width/height, |
| 396 | otherwise return the frame width/height." | 396 | otherwise return the frame width/height." |
| 397 | (if accept | 397 | (if accept |
| 398 | (if (windowp w) ;; w is not a window if dropping on the menu bar, | 398 | (if (windowp w) ;; w is not a window if dropping on the menu bar, |
| @@ -520,7 +520,7 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent." | |||
| 520 | ;;; Motif protocol. | 520 | ;;; Motif protocol. |
| 521 | 521 | ||
| 522 | (defun x-dnd-init-motif-for-frame (frame) | 522 | (defun x-dnd-init-motif-for-frame (frame) |
| 523 | "Set _MOTIF_DRAG_RECEIVER_INFO for FRAME to indicate that we do Motif DND." | 523 | "Set _MOTIF_DRAG_RECEIVER_INFO for FRAME to indicate that we do Motif DND." |
| 524 | (x-change-window-property "_MOTIF_DRAG_RECEIVER_INFO" | 524 | (x-change-window-property "_MOTIF_DRAG_RECEIVER_INFO" |
| 525 | (list | 525 | (list |
| 526 | (byteorder) | 526 | (byteorder) |