2015-09-28 22:39:14 +00:00
|
|
|
;;; x-dnd.el --- drag and drop support for X
|
2004-02-03 16:55:30 +00:00
|
|
|
|
2019-01-01 00:59:58 +00:00
|
|
|
;; Copyright (C) 2004-2019 Free Software Foundation, Inc.
|
2004-02-03 16:55:30 +00:00
|
|
|
|
2010-06-22 07:10:16 +00:00
|
|
|
;; Author: Jan Djärv <jan.h.d@swipnet.se>
|
2019-05-25 20:43:06 +00:00
|
|
|
;; Maintainer: emacs-devel@gnu.org
|
2004-02-03 16:55:30 +00:00
|
|
|
;; Keywords: window, drag, drop
|
2010-08-29 16:17:13 +00:00
|
|
|
;; Package: emacs
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
2008-05-06 08:06:51 +00:00
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
2004-02-03 16:55:30 +00:00
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 08:06:51 +00:00
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 22:52:52 +00:00
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;; This file provides the drop part only. Currently supported protocols
|
2004-02-15 12:30:04 +00:00
|
|
|
;; are XDND, Motif and the old KDE 1.x protocol.
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
* x-dnd.el: Require dnd.
(x-dnd-handle-uri-list, x-dnd-handle-file-name): Call
dnd-handle-one-url.
(x-dnd-types-alist, x-dnd-insert-utf8-text)
(x-dnd-insert-utf16-text, x-dnd-insert-ctext): Change x-dnd-insert-text
to dnd-insert-text.
(x-dnd-protocol-alist, x-dnd-open-file-other-window,
x-dnd-handle-one-url, x-dnd-get-local-file-uri,
x-dnd-get-local-file-name, x-dnd-open-local-file,
x-dnd-open-file, x-dnd-insert-text): Moved to dnd.el (without x-).
2005-04-11 19:25:38 +00:00
|
|
|
(require 'dnd)
|
2004-02-03 16:55:30 +00:00
|
|
|
|
* x-dnd.el: Require dnd.
(x-dnd-handle-uri-list, x-dnd-handle-file-name): Call
dnd-handle-one-url.
(x-dnd-types-alist, x-dnd-insert-utf8-text)
(x-dnd-insert-utf16-text, x-dnd-insert-ctext): Change x-dnd-insert-text
to dnd-insert-text.
(x-dnd-protocol-alist, x-dnd-open-file-other-window,
x-dnd-handle-one-url, x-dnd-get-local-file-uri,
x-dnd-get-local-file-name, x-dnd-open-local-file,
x-dnd-open-file, x-dnd-insert-text): Moved to dnd.el (without x-).
2005-04-11 19:25:38 +00:00
|
|
|
;;; Customizable variables
|
2004-02-03 16:55:30 +00:00
|
|
|
(defcustom x-dnd-test-function 'x-dnd-default-test-function
|
|
|
|
"The function drag and drop uses to determine if to accept or reject a drop.
|
2009-02-26 10:26:32 +00:00
|
|
|
The function takes three arguments, WINDOW, ACTION and TYPES.
|
2004-02-03 16:55:30 +00:00
|
|
|
WINDOW is where the mouse is when the function is called. WINDOW may be a
|
|
|
|
frame if the mouse isn't over a real window (i.e. menu bar, tool bar or
|
|
|
|
scroll bar). ACTION is the suggested action from the drag and drop source,
|
2009-02-26 10:26:32 +00:00
|
|
|
one of the symbols move, copy, link or ask. TYPES is a list of available
|
|
|
|
types for the drop.
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
The function shall return nil to reject the drop or a cons with two values,
|
|
|
|
the wanted action as car and the wanted type as cdr. The wanted action
|
|
|
|
can be copy, move, link, ask or private.
|
|
|
|
The default value for this variable is `x-dnd-default-test-function'."
|
2005-02-09 15:50:47 +00:00
|
|
|
:version "22.1"
|
2004-02-03 16:55:30 +00:00
|
|
|
:type 'symbol
|
|
|
|
:group 'x)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defcustom x-dnd-types-alist
|
2009-10-26 06:43:36 +00:00
|
|
|
`(
|
|
|
|
(,(purecopy "text/uri-list") . x-dnd-handle-uri-list)
|
|
|
|
(,(purecopy "text/x-moz-url") . x-dnd-handle-moz-url)
|
|
|
|
(,(purecopy "_NETSCAPE_URL") . x-dnd-handle-uri-list)
|
|
|
|
(,(purecopy "FILE_NAME") . x-dnd-handle-file-name)
|
|
|
|
(,(purecopy "UTF8_STRING") . x-dnd-insert-utf8-text)
|
|
|
|
(,(purecopy "text/plain;charset=UTF-8") . x-dnd-insert-utf8-text)
|
|
|
|
(,(purecopy "text/plain;charset=utf-8") . x-dnd-insert-utf8-text)
|
|
|
|
(,(purecopy "text/unicode") . x-dnd-insert-utf16-text)
|
|
|
|
(,(purecopy "text/plain") . dnd-insert-text)
|
|
|
|
(,(purecopy "COMPOUND_TEXT") . x-dnd-insert-ctext)
|
|
|
|
(,(purecopy "STRING") . dnd-insert-text)
|
|
|
|
(,(purecopy "TEXT") . dnd-insert-text)
|
2004-02-03 16:55:30 +00:00
|
|
|
)
|
|
|
|
"Which function to call to handle a drop of that type.
|
|
|
|
If the type for the drop is not present, or the function is nil,
|
|
|
|
the drop is rejected. The function takes three arguments, WINDOW, ACTION
|
2007-01-08 23:01:11 +00:00
|
|
|
and DATA. WINDOW is where the drop occurred, ACTION is the action for
|
2004-02-03 16:55:30 +00:00
|
|
|
this drop (copy, move, link, private or ask) as determined by a previous
|
|
|
|
call to `x-dnd-test-function'. DATA is the drop data.
|
2009-02-26 10:26:32 +00:00
|
|
|
The function shall return the action used (copy, move, link or private)
|
|
|
|
if drop is successful, nil if not."
|
2005-02-09 15:50:47 +00:00
|
|
|
:version "22.1"
|
2004-02-03 16:55:30 +00:00
|
|
|
:type 'alist
|
|
|
|
:group 'x)
|
|
|
|
|
2004-08-31 11:24:10 +00:00
|
|
|
(defcustom x-dnd-known-types
|
* textmodes/tex-mode.el (tex-alt-dvi-print-command)
(tex-dvi-print-command, tex-bibtex-command, tex-start-commands)
(tex-start-options, slitex-run-command, latex-run-command)
(tex-run-command, tex-directory):
* textmodes/ispell.el (ispell-html-skip-alists)
(ispell-tex-skip-alists, ispell-tex-skip-alists):
* textmodes/fill.el (adaptive-fill-first-line-regexp):
(adaptive-fill-regexp):
* textmodes/dns-mode.el (auto-mode-alist):
* progmodes/python.el (interpreter-mode-alist):
* progmodes/etags.el (tags-compression-info-list):
* progmodes/etags.el (tags-file-name):
* net/browse-url.el (browse-url-galeon-program)
(browse-url-firefox-program):
* mail/sendmail.el (mail-signature-file)
(mail-citation-prefix-regexp):
* international/mule-conf.el (eight-bit):
* international/latexenc.el (latex-inputenc-coding-alist):
* international/fontset.el (x-pixel-size-width-font-regexp):
* emacs-lisp/warnings.el (warning-type-format):
* emacs-lisp/trace.el (trace-buffer):
* emacs-lisp/lisp-mode.el (lisp-interaction-mode-map)
(emacs-lisp-mode-map):
* calendar/holidays.el (holiday-solar-holidays)
(holiday-bahai-holidays, holiday-islamic-holidays)
(holiday-christian-holidays, holiday-hebrew-holidays)
(hebrew-holidays-4, hebrew-holidays-3, hebrew-holidays-2)
(hebrew-holidays-1, holiday-oriental-holidays)
(holiday-general-holidays):
* x-dnd.el (x-dnd-known-types):
* tool-bar.el (tool-bar):
* startup.el (site-run-file):
* shell.el (shell-dumb-shell-regexp):
* rfn-eshadow.el (file-name-shadow-tty-properties)
(file-name-shadow-properties):
* paths.el (remote-shell-program, news-directory):
* mouse.el ([C-down-mouse-3]):
* menu-bar.el (menu-bar-tools-menu):
* jka-cmpr-hook.el (jka-compr-load-suffixes)
(jka-compr-mode-alist-additions, jka-compr-compression-info-list)
(jka-compr-compression-info-list):
* isearch.el (search-whitespace-regexp):
* image-file.el (image-file-name-extensions):
* find-dired.el (find-ls-option):
* files.el (directory-listing-before-filename-regexp)
(directory-free-space-args, insert-directory-program)
(list-directory-brief-switches, magic-fallback-mode-alist)
(magic-fallback-mode-alist, auto-mode-interpreter-regexp)
(automount-dir-prefix):
* faces.el (face-x-resources, x-font-regexp, x-font-regexp-head)
(x-font-regexp-slant, x-font-regexp-weight, face-x-resources)
(face-font-registry-alternatives, face-font-registry-alternatives)
(face-font-family-alternatives):
* facemenu.el (facemenu-add-new-face, facemenu-background-menu)
(facemenu-foreground-menu, facemenu-face-menu):
* epa-hook.el (epa-file-name-regexp):
* dnd.el (dnd-protocol-alist):
* textmodes/rst.el (auto-mode-alist):
* button.el (default-button): Purecopy strings.
2009-11-06 05:16:23 +00:00
|
|
|
(mapcar 'purecopy
|
2004-02-03 16:55:30 +00:00
|
|
|
'("text/uri-list"
|
|
|
|
"text/x-moz-url"
|
|
|
|
"_NETSCAPE_URL"
|
2004-02-10 17:27:26 +00:00
|
|
|
"FILE_NAME"
|
2004-02-03 16:55:30 +00:00
|
|
|
"UTF8_STRING"
|
|
|
|
"text/plain;charset=UTF-8"
|
|
|
|
"text/plain;charset=utf-8"
|
|
|
|
"text/unicode"
|
|
|
|
"text/plain"
|
2004-02-10 17:27:26 +00:00
|
|
|
"COMPOUND_TEXT"
|
2004-02-03 16:55:30 +00:00
|
|
|
"STRING"
|
|
|
|
"TEXT"
|
* textmodes/tex-mode.el (tex-alt-dvi-print-command)
(tex-dvi-print-command, tex-bibtex-command, tex-start-commands)
(tex-start-options, slitex-run-command, latex-run-command)
(tex-run-command, tex-directory):
* textmodes/ispell.el (ispell-html-skip-alists)
(ispell-tex-skip-alists, ispell-tex-skip-alists):
* textmodes/fill.el (adaptive-fill-first-line-regexp):
(adaptive-fill-regexp):
* textmodes/dns-mode.el (auto-mode-alist):
* progmodes/python.el (interpreter-mode-alist):
* progmodes/etags.el (tags-compression-info-list):
* progmodes/etags.el (tags-file-name):
* net/browse-url.el (browse-url-galeon-program)
(browse-url-firefox-program):
* mail/sendmail.el (mail-signature-file)
(mail-citation-prefix-regexp):
* international/mule-conf.el (eight-bit):
* international/latexenc.el (latex-inputenc-coding-alist):
* international/fontset.el (x-pixel-size-width-font-regexp):
* emacs-lisp/warnings.el (warning-type-format):
* emacs-lisp/trace.el (trace-buffer):
* emacs-lisp/lisp-mode.el (lisp-interaction-mode-map)
(emacs-lisp-mode-map):
* calendar/holidays.el (holiday-solar-holidays)
(holiday-bahai-holidays, holiday-islamic-holidays)
(holiday-christian-holidays, holiday-hebrew-holidays)
(hebrew-holidays-4, hebrew-holidays-3, hebrew-holidays-2)
(hebrew-holidays-1, holiday-oriental-holidays)
(holiday-general-holidays):
* x-dnd.el (x-dnd-known-types):
* tool-bar.el (tool-bar):
* startup.el (site-run-file):
* shell.el (shell-dumb-shell-regexp):
* rfn-eshadow.el (file-name-shadow-tty-properties)
(file-name-shadow-properties):
* paths.el (remote-shell-program, news-directory):
* mouse.el ([C-down-mouse-3]):
* menu-bar.el (menu-bar-tools-menu):
* jka-cmpr-hook.el (jka-compr-load-suffixes)
(jka-compr-mode-alist-additions, jka-compr-compression-info-list)
(jka-compr-compression-info-list):
* isearch.el (search-whitespace-regexp):
* image-file.el (image-file-name-extensions):
* find-dired.el (find-ls-option):
* files.el (directory-listing-before-filename-regexp)
(directory-free-space-args, insert-directory-program)
(list-directory-brief-switches, magic-fallback-mode-alist)
(magic-fallback-mode-alist, auto-mode-interpreter-regexp)
(automount-dir-prefix):
* faces.el (face-x-resources, x-font-regexp, x-font-regexp-head)
(x-font-regexp-slant, x-font-regexp-weight, face-x-resources)
(face-font-registry-alternatives, face-font-registry-alternatives)
(face-font-family-alternatives):
* facemenu.el (facemenu-add-new-face, facemenu-background-menu)
(facemenu-foreground-menu, facemenu-face-menu):
* epa-hook.el (epa-file-name-regexp):
* dnd.el (dnd-protocol-alist):
* textmodes/rst.el (auto-mode-alist):
* button.el (default-button): Purecopy strings.
2009-11-06 05:16:23 +00:00
|
|
|
))
|
2004-02-03 16:55:30 +00:00
|
|
|
"The types accepted by default for dropped data.
|
2004-08-31 11:24:10 +00:00
|
|
|
The types are chosen in the order they appear in the list."
|
2005-02-09 15:50:47 +00:00
|
|
|
:version "22.1"
|
2004-08-31 11:24:10 +00:00
|
|
|
:type '(repeat string)
|
|
|
|
:group 'x
|
|
|
|
)
|
|
|
|
|
|
|
|
;; Internal variables
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
(defvar x-dnd-current-state nil
|
|
|
|
"The current state for a drop.
|
|
|
|
This is an alist with one entry for each display. The value for each display
|
|
|
|
is a vector that contains the state for drag and drop for that display.
|
2005-02-09 15:50:47 +00:00
|
|
|
Elements in the vector are:
|
2004-02-03 16:55:30 +00:00
|
|
|
Last buffer drag was in,
|
|
|
|
last window drag was in,
|
2005-02-09 15:50:47 +00:00
|
|
|
types available for drop,
|
2004-02-03 16:55:30 +00:00
|
|
|
the action suggested by the source,
|
|
|
|
the type we want for the drop,
|
2004-02-10 17:27:26 +00:00
|
|
|
the action we want for the drop,
|
|
|
|
any protocol specific data.")
|
2004-02-03 16:55:30 +00:00
|
|
|
|
2004-02-10 17:27:26 +00:00
|
|
|
(defvar x-dnd-empty-state [nil nil nil nil nil nil nil])
|
2004-02-03 16:55:30 +00:00
|
|
|
|
2007-11-22 13:52:35 +00:00
|
|
|
(declare-function x-register-dnd-atom "xselect.c")
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
(defun x-dnd-init-frame (&optional frame)
|
|
|
|
"Setup drag and drop for FRAME (i.e. create appropriate properties)."
|
2004-02-19 02:10:05 +00:00
|
|
|
(when (eq 'x (window-system frame))
|
2006-10-14 16:56:21 +00:00
|
|
|
(x-register-dnd-atom "DndProtocol" frame)
|
|
|
|
(x-register-dnd-atom "_MOTIF_DRAG_AND_DROP_MESSAGE" frame)
|
|
|
|
(x-register-dnd-atom "XdndEnter" frame)
|
|
|
|
(x-register-dnd-atom "XdndPosition" frame)
|
|
|
|
(x-register-dnd-atom "XdndLeave" frame)
|
|
|
|
(x-register-dnd-atom "XdndDrop" frame)
|
2004-02-19 02:10:05 +00:00
|
|
|
(x-dnd-init-xdnd-for-frame frame)
|
|
|
|
(x-dnd-init-motif-for-frame frame)))
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
(defun x-dnd-get-state-cons-for-frame (frame-or-window)
|
2009-02-26 10:26:32 +00:00
|
|
|
"Return the entry in `x-dnd-current-state' for a frame or window."
|
2004-02-03 16:55:30 +00:00
|
|
|
(let* ((frame (if (framep frame-or-window) frame-or-window
|
|
|
|
(window-frame frame-or-window)))
|
|
|
|
(display (frame-parameter frame 'display)))
|
|
|
|
(if (not (assoc display x-dnd-current-state))
|
2004-02-10 17:27:26 +00:00
|
|
|
(push (cons display (copy-sequence x-dnd-empty-state))
|
|
|
|
x-dnd-current-state))
|
2004-02-03 16:55:30 +00:00
|
|
|
(assoc display x-dnd-current-state)))
|
|
|
|
|
|
|
|
(defun x-dnd-get-state-for-frame (frame-or-window)
|
2009-02-26 10:26:32 +00:00
|
|
|
"Return the state in `x-dnd-current-state' for a frame or window."
|
2004-02-03 16:55:30 +00:00
|
|
|
(cdr (x-dnd-get-state-cons-for-frame frame-or-window)))
|
|
|
|
|
2011-04-19 13:44:55 +00:00
|
|
|
(defun x-dnd-default-test-function (_window _action types)
|
2004-02-03 16:55:30 +00:00
|
|
|
"The default test function for drag and drop.
|
2009-02-26 10:26:32 +00:00
|
|
|
WINDOW is where the mouse is when this function is called. It may be
|
|
|
|
a frame if the mouse is over the menu bar, scroll bar or tool bar.
|
2004-02-03 16:55:30 +00:00
|
|
|
ACTION is the suggested action from the source, and TYPES are the
|
|
|
|
types the drop data can have. This function only accepts drops with
|
|
|
|
types in `x-dnd-known-types'. It always returns the action private."
|
|
|
|
(let ((type (x-dnd-choose-type types)))
|
|
|
|
(when type (cons 'private type))))
|
|
|
|
|
|
|
|
|
|
|
|
(defun x-dnd-current-type (frame-or-window)
|
|
|
|
"Return the type we want the DND data to be in for the current drop.
|
|
|
|
FRAME-OR-WINDOW is the frame or window that the mouse is over."
|
|
|
|
(aref (x-dnd-get-state-for-frame frame-or-window) 4))
|
|
|
|
|
|
|
|
(defun x-dnd-forget-drop (frame-or-window)
|
|
|
|
"Remove all state for the last drop.
|
|
|
|
FRAME-OR-WINDOW is the frame or window that the mouse is over."
|
2004-02-10 17:27:26 +00:00
|
|
|
(setcdr (x-dnd-get-state-cons-for-frame frame-or-window)
|
|
|
|
(copy-sequence x-dnd-empty-state)))
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
(defun x-dnd-maybe-call-test-function (window action)
|
|
|
|
"Call `x-dnd-test-function' if something has changed.
|
|
|
|
WINDOW is the window the mouse is over. ACTION is the suggested
|
|
|
|
action from the source. If nothing has changed, return the last
|
|
|
|
action and type we got from `x-dnd-test-function'."
|
2007-06-14 00:09:10 +00:00
|
|
|
(let ((buffer (when (window-live-p window)
|
2004-02-03 16:55:30 +00:00
|
|
|
(window-buffer window)))
|
|
|
|
(current-state (x-dnd-get-state-for-frame window)))
|
* x-dnd.el (x-dnd-maybe-call-test-function):
* window.el (split-window-vertically):
* whitespace.el (whitespace-help-on):
* vc-rcs.el (vc-rcs-consult-headers):
* userlock.el (ask-user-about-lock-help)
(ask-user-about-supersession-help):
* type-break.el (type-break-force-mode-line-update):
* time-stamp.el (time-stamp-conv-warn):
* terminal.el (te-set-output-log, te-more-break, te-filter)
(te-sentinel,terminal-emulator):
* term.el (make-term, term-exec, term-sentinel, term-read-input-ring)
(term-write-input-ring, term-check-source, term-start-output-log):
(term-display-buffer-line, term-dynamic-list-completions):
(term-ansi-make-term, serial-term):
* subr.el (selective-display):
* strokes.el (strokes-xpm-to-compressed-string, strokes-decode-buffer)
(strokes-encode-buffer, strokes-xpm-for-compressed-string):
* speedbar.el (speedbar-buffers-tail-notes, speedbar-buffers-item-info)
(speedbar-reconfigure-keymaps, speedbar-add-localized-speedbar-support)
(speedbar-remove-localized-speedbar-support)
(speedbar-set-mode-line-format, speedbar-create-tag-hierarchy)
(speedbar-update-special-contents, speedbar-buffer-buttons-engine)
(speedbar-buffers-line-directory):
* simple.el (shell-command-on-region, append-to-buffer)
(prepend-to-buffer):
* shadowfile.el (shadow-save-todo-file):
* scroll-bar.el (scroll-bar-set-window-start, scroll-bar-drag-1)
(scroll-bar-maybe-set-window-start):
* sb-image.el (speedbar-image-dump):
* saveplace.el (save-place-alist-to-file, save-places-to-alist)
(load-save-place-alist-from-file):
* ps-samp.el (ps-print-message-from-summary):
* ps-print.el (ps-flush-output, ps-insert-file, ps-get-boundingbox)
(ps-background-image, ps-begin-job, ps-do-despool):
* ps-bdf.el (bdf-find-file, bdf-read-font-info):
* printing.el (pr-interface, pr-ps-file-print, pr-find-buffer-visiting)
(pr-ps-message-from-summary, pr-lpr-message-from-summary):
(pr-call-process, pr-file-list, pr-interface-save):
* novice.el (disabled-command-function)
(enable-command, disable-command):
* mouse.el (mouse-buffer-menu-alist):
* mouse-copy.el (mouse-kill-preserving-secondary):
* macros.el (kbd-macro-query):
* ledit.el (ledit-go-to-lisp, ledit-go-to-liszt):
* informat.el (batch-info-validate):
* ido.el (ido-copy-current-word, ido-initiate-auto-merge):
* hippie-exp.el (try-expand-dabbrev-visible):
* help-mode.el (help-make-xrefs):
* help-fns.el (describe-variable):
* generic-x.el (bat-generic-mode-run-as-comint):
* finder.el (finder-mouse-select):
* find-dired.el (find-dired-sentinel):
* filesets.el (filesets-file-close):
* files.el (list-directory):
* faces.el (list-faces-display, describe-face):
* facemenu.el (list-colors-display):
* ezimage.el (ezimage-image-association-dump, ezimage-image-dump):
* epg.el (epg--process-filter, epg-cancel):
* epa.el (epa--marked-keys, epa--select-keys, epa-display-info)
(epa--read-signature-type):
* emerge.el (emerge-copy-as-kill-A, emerge-copy-as-kill-B)
(emerge-file-names):
* ehelp.el (electric-helpify):
* ediff.el (ediff-regions-wordwise, ediff-regions-linewise):
* ediff-vers.el (rcs-ediff-view-revision):
* ediff-util.el (ediff-setup):
* ediff-mult.el (ediff-append-custom-diff):
* ediff-diff.el (ediff-exec-process, ediff-process-sentinel)
(ediff-wordify):
* echistory.el (Electric-command-history-redo-expression):
* dos-w32.el (find-file-not-found-set-buffer-file-coding-system):
* disp-table.el (describe-display-table):
* dired.el (dired-find-buffer-nocreate):
* dired-aux.el (dired-rename-subdir, dired-dwim-target-directory):
* dabbrev.el (dabbrev--same-major-mode-p):
* chistory.el (list-command-history):
* apropos.el (apropos-documentation):
* allout.el (allout-obtain-passphrase):
(allout-copy-exposed-to-buffer):
(allout-verify-passphrase): Use with-current-buffer.
2009-11-13 22:19:45 +00:00
|
|
|
(unless (and (equal buffer (aref current-state 0))
|
|
|
|
(equal window (aref current-state 1))
|
|
|
|
(equal action (aref current-state 3)))
|
|
|
|
(save-current-buffer
|
2004-02-03 16:55:30 +00:00
|
|
|
(when buffer (set-buffer buffer))
|
|
|
|
(let* ((action-type (funcall x-dnd-test-function
|
|
|
|
window
|
|
|
|
action
|
|
|
|
(aref current-state 2)))
|
|
|
|
(handler (cdr (assoc (cdr action-type) x-dnd-types-alist))))
|
|
|
|
;; Ignore action-type if we have no handler.
|
|
|
|
(setq current-state
|
2005-02-09 15:50:47 +00:00
|
|
|
(x-dnd-save-state window
|
2004-02-03 16:55:30 +00:00
|
|
|
action
|
|
|
|
(when handler action-type)))))))
|
|
|
|
(let ((current-state (x-dnd-get-state-for-frame window)))
|
|
|
|
(cons (aref current-state 5)
|
|
|
|
(aref current-state 4))))
|
|
|
|
|
2004-02-10 17:27:26 +00:00
|
|
|
(defun x-dnd-save-state (window action action-type &optional types extra-data)
|
2004-02-03 16:55:30 +00:00
|
|
|
"Save the state of the current drag and drop.
|
|
|
|
WINDOW is the window the mouse is over. ACTION is the action suggested
|
|
|
|
by the source. ACTION-TYPE is the result of calling `x-dnd-test-function'.
|
2004-02-10 17:27:26 +00:00
|
|
|
If given, TYPES are the types for the drop data that the source supports.
|
|
|
|
EXTRA-DATA is data needed for a specific protocol."
|
2004-02-03 16:55:30 +00:00
|
|
|
(let ((current-state (x-dnd-get-state-for-frame window)))
|
|
|
|
(aset current-state 5 (car action-type))
|
|
|
|
(aset current-state 4 (cdr action-type))
|
|
|
|
(aset current-state 3 action)
|
2004-02-10 17:27:26 +00:00
|
|
|
(when types (aset current-state 2 types))
|
|
|
|
(when extra-data (aset current-state 6 extra-data))
|
2004-02-03 16:55:30 +00:00
|
|
|
(aset current-state 1 window)
|
2007-06-14 00:09:10 +00:00
|
|
|
(aset current-state 0 (and (window-live-p window) (window-buffer window)))
|
2004-02-03 16:55:30 +00:00
|
|
|
(setcdr (x-dnd-get-state-cons-for-frame window) current-state)))
|
|
|
|
|
|
|
|
|
|
|
|
(defun x-dnd-handle-moz-url (window action data)
|
|
|
|
"Handle one item of type text/x-moz-url.
|
|
|
|
WINDOW is the window where the drop happened. ACTION is ignored.
|
2009-02-26 10:26:32 +00:00
|
|
|
DATA is the moz-url, which is formatted as two strings separated by \\r\\n.
|
2004-02-03 16:55:30 +00:00
|
|
|
The first string is the URL, the second string is the title of that URL.
|
|
|
|
DATA is encoded in utf-16. Decode the URL and call `x-dnd-handle-uri-list'."
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
;; Mozilla and applications based on it use text/unicode, but it is
|
|
|
|
;; impossible to tell if it is le or be. Use what the machine Emacs
|
|
|
|
;; runs on uses. This loses if dropping between machines
|
|
|
|
;; with different endian-ness, but it is the best we can do.
|
2004-04-02 17:29:52 +00:00
|
|
|
(let* ((coding (if (eq (byteorder) ?B) 'utf-16be 'utf-16le))
|
|
|
|
(string (decode-coding-string data coding))
|
2004-02-03 16:55:30 +00:00
|
|
|
(strings (split-string string "[\r\n]" t))
|
|
|
|
;; Can one drop more than one moz-url ?? Assume not.
|
2011-04-19 13:44:55 +00:00
|
|
|
(url (car strings)))
|
2004-02-03 16:55:30 +00:00
|
|
|
(x-dnd-handle-uri-list window action url)))
|
|
|
|
|
|
|
|
(defun x-dnd-insert-utf8-text (window action text)
|
|
|
|
"Decode the UTF-8 text and insert it at point.
|
|
|
|
TEXT is the text as a string, WINDOW is the window where the drop happened."
|
* x-dnd.el: Require dnd.
(x-dnd-handle-uri-list, x-dnd-handle-file-name): Call
dnd-handle-one-url.
(x-dnd-types-alist, x-dnd-insert-utf8-text)
(x-dnd-insert-utf16-text, x-dnd-insert-ctext): Change x-dnd-insert-text
to dnd-insert-text.
(x-dnd-protocol-alist, x-dnd-open-file-other-window,
x-dnd-handle-one-url, x-dnd-get-local-file-uri,
x-dnd-get-local-file-name, x-dnd-open-local-file,
x-dnd-open-file, x-dnd-insert-text): Moved to dnd.el (without x-).
2005-04-11 19:25:38 +00:00
|
|
|
(dnd-insert-text window action (decode-coding-string text 'utf-8)))
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
(defun x-dnd-insert-utf16-text (window action text)
|
|
|
|
"Decode the UTF-16 text and insert it at point.
|
|
|
|
TEXT is the text as a string, WINDOW is the window where the drop happened."
|
2004-04-02 17:29:52 +00:00
|
|
|
;; See comment in x-dnd-handle-moz-url about coding.
|
|
|
|
(let ((coding (if (eq (byteorder) ?B) 'utf-16be 'utf-16le)))
|
* x-dnd.el: Require dnd.
(x-dnd-handle-uri-list, x-dnd-handle-file-name): Call
dnd-handle-one-url.
(x-dnd-types-alist, x-dnd-insert-utf8-text)
(x-dnd-insert-utf16-text, x-dnd-insert-ctext): Change x-dnd-insert-text
to dnd-insert-text.
(x-dnd-protocol-alist, x-dnd-open-file-other-window,
x-dnd-handle-one-url, x-dnd-get-local-file-uri,
x-dnd-get-local-file-name, x-dnd-open-local-file,
x-dnd-open-file, x-dnd-insert-text): Moved to dnd.el (without x-).
2005-04-11 19:25:38 +00:00
|
|
|
(dnd-insert-text window action (decode-coding-string text coding))))
|
2004-02-03 16:55:30 +00:00
|
|
|
|
2004-02-10 17:27:26 +00:00
|
|
|
(defun x-dnd-insert-ctext (window action text)
|
|
|
|
"Decode the compound text and insert it at point.
|
|
|
|
TEXT is the text as a string, WINDOW is the window where the drop happened."
|
* x-dnd.el: Require dnd.
(x-dnd-handle-uri-list, x-dnd-handle-file-name): Call
dnd-handle-one-url.
(x-dnd-types-alist, x-dnd-insert-utf8-text)
(x-dnd-insert-utf16-text, x-dnd-insert-ctext): Change x-dnd-insert-text
to dnd-insert-text.
(x-dnd-protocol-alist, x-dnd-open-file-other-window,
x-dnd-handle-one-url, x-dnd-get-local-file-uri,
x-dnd-get-local-file-name, x-dnd-open-local-file,
x-dnd-open-file, x-dnd-insert-text): Moved to dnd.el (without x-).
2005-04-11 19:25:38 +00:00
|
|
|
(dnd-insert-text window action
|
|
|
|
(decode-coding-string text
|
|
|
|
'compound-text-with-extensions)))
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
(defun x-dnd-handle-uri-list (window action string)
|
* x-dnd.el: Require dnd.
(x-dnd-handle-uri-list, x-dnd-handle-file-name): Call
dnd-handle-one-url.
(x-dnd-types-alist, x-dnd-insert-utf8-text)
(x-dnd-insert-utf16-text, x-dnd-insert-ctext): Change x-dnd-insert-text
to dnd-insert-text.
(x-dnd-protocol-alist, x-dnd-open-file-other-window,
x-dnd-handle-one-url, x-dnd-get-local-file-uri,
x-dnd-get-local-file-name, x-dnd-open-local-file,
x-dnd-open-file, x-dnd-insert-text): Moved to dnd.el (without x-).
2005-04-11 19:25:38 +00:00
|
|
|
"Split an uri-list into separate URIs and call `dnd-handle-one-url'.
|
2004-02-03 16:55:30 +00:00
|
|
|
WINDOW is the window where the drop happened.
|
2009-02-26 10:26:32 +00:00
|
|
|
STRING is the uri-list as a string. The URIs are separated by \\r\\n."
|
2004-02-03 16:55:30 +00:00
|
|
|
(let ((uri-list (split-string string "[\0\r\n]" t))
|
|
|
|
retval)
|
|
|
|
(dolist (bf uri-list)
|
2009-02-26 10:26:32 +00:00
|
|
|
;; If one URL is handled, treat as if the whole drop succeeded.
|
* x-dnd.el: Require dnd.
(x-dnd-handle-uri-list, x-dnd-handle-file-name): Call
dnd-handle-one-url.
(x-dnd-types-alist, x-dnd-insert-utf8-text)
(x-dnd-insert-utf16-text, x-dnd-insert-ctext): Change x-dnd-insert-text
to dnd-insert-text.
(x-dnd-protocol-alist, x-dnd-open-file-other-window,
x-dnd-handle-one-url, x-dnd-get-local-file-uri,
x-dnd-get-local-file-name, x-dnd-open-local-file,
x-dnd-open-file, x-dnd-insert-text): Moved to dnd.el (without x-).
2005-04-11 19:25:38 +00:00
|
|
|
(let ((did-action (dnd-handle-one-url window action bf)))
|
2004-02-03 16:55:30 +00:00
|
|
|
(when did-action (setq retval did-action))))
|
|
|
|
retval))
|
|
|
|
|
2004-02-10 17:27:26 +00:00
|
|
|
(defun x-dnd-handle-file-name (window action string)
|
2006-05-20 04:29:18 +00:00
|
|
|
"Convert file names to URLs and call `dnd-handle-one-url'.
|
2004-02-10 17:27:26 +00:00
|
|
|
WINDOW is the window where the drop happened.
|
|
|
|
STRING is the file names as a string, separated by nulls."
|
|
|
|
(let ((uri-list (split-string string "[\0\r\n]" t))
|
2018-01-25 18:35:13 +00:00
|
|
|
(coding (or file-name-coding-system
|
|
|
|
default-file-name-coding-system))
|
2004-02-10 17:27:26 +00:00
|
|
|
retval)
|
|
|
|
(dolist (bf uri-list)
|
2009-02-26 10:26:32 +00:00
|
|
|
;; If one URL is handled, treat as if the whole drop succeeded.
|
2006-05-20 04:29:18 +00:00
|
|
|
(if coding (setq bf (encode-coding-string bf coding)))
|
|
|
|
(let* ((file-uri (concat "file://"
|
|
|
|
(mapconcat 'url-hexify-string
|
|
|
|
(split-string bf "/") "/")))
|
* x-dnd.el: Require dnd.
(x-dnd-handle-uri-list, x-dnd-handle-file-name): Call
dnd-handle-one-url.
(x-dnd-types-alist, x-dnd-insert-utf8-text)
(x-dnd-insert-utf16-text, x-dnd-insert-ctext): Change x-dnd-insert-text
to dnd-insert-text.
(x-dnd-protocol-alist, x-dnd-open-file-other-window,
x-dnd-handle-one-url, x-dnd-get-local-file-uri,
x-dnd-get-local-file-name, x-dnd-open-local-file,
x-dnd-open-file, x-dnd-insert-text): Moved to dnd.el (without x-).
2005-04-11 19:25:38 +00:00
|
|
|
(did-action (dnd-handle-one-url window action file-uri)))
|
2004-02-10 17:27:26 +00:00
|
|
|
(when did-action (setq retval did-action))))
|
|
|
|
retval))
|
|
|
|
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
(defun x-dnd-choose-type (types &optional known-types)
|
|
|
|
"Choose which type we want to receive for the drop.
|
|
|
|
TYPES are the types the source of the drop offers, a vector of type names
|
|
|
|
as strings or symbols. Select among the types in `x-dnd-known-types' or
|
2009-02-26 10:26:32 +00:00
|
|
|
KNOWN-TYPES if given, and return that type name.
|
2004-02-03 16:55:30 +00:00
|
|
|
If no suitable type is found, return nil."
|
|
|
|
(let* ((known-list (or known-types x-dnd-known-types))
|
|
|
|
(first-known-type (car known-list))
|
|
|
|
(types-array types)
|
|
|
|
(found (when first-known-type
|
|
|
|
(catch 'done
|
|
|
|
(dotimes (i (length types-array))
|
|
|
|
(let* ((type (aref types-array i))
|
|
|
|
(typename (if (symbolp type)
|
|
|
|
(symbol-name type) type)))
|
|
|
|
(when (equal first-known-type typename)
|
|
|
|
(throw 'done first-known-type))))
|
|
|
|
nil))))
|
|
|
|
|
|
|
|
(if (and (not found) (cdr known-list))
|
|
|
|
(x-dnd-choose-type types (cdr known-list))
|
|
|
|
found)))
|
|
|
|
|
|
|
|
(defun x-dnd-drop-data (event frame window data type)
|
|
|
|
"Drop one data item onto a frame.
|
2009-02-26 10:26:32 +00:00
|
|
|
EVENT is the client message for the drop, FRAME is the frame the drop
|
|
|
|
occurred on. WINDOW is the window of FRAME where the drop happened.
|
|
|
|
DATA is the data received from the source, and type is the type for DATA,
|
|
|
|
see `x-dnd-types-alist').
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
Returns the action used (move, copy, link, private) if drop was successful,
|
|
|
|
nil if not."
|
|
|
|
(let* ((type-info (assoc type x-dnd-types-alist))
|
|
|
|
(handler (cdr type-info))
|
|
|
|
(state (x-dnd-get-state-for-frame frame))
|
|
|
|
(action (aref state 5))
|
|
|
|
(w (posn-window (event-start event))))
|
|
|
|
(when handler
|
2007-06-14 00:09:10 +00:00
|
|
|
(if (and (window-live-p w)
|
2005-10-04 20:29:50 +00:00
|
|
|
(not (window-minibuffer-p w))
|
|
|
|
(not (window-dedicated-p w)))
|
|
|
|
;; If dropping in an ordinary window which we could use,
|
|
|
|
;; let dnd-open-file-other-window specify what to do.
|
2005-10-03 19:41:49 +00:00
|
|
|
(progn
|
2006-08-22 06:14:45 +00:00
|
|
|
(when (not mouse-yank-at-point)
|
|
|
|
(goto-char (posn-point (event-start event))))
|
2004-02-03 16:55:30 +00:00
|
|
|
(funcall handler window action data))
|
2005-10-04 20:29:50 +00:00
|
|
|
;; If we can't display the file here,
|
|
|
|
;; make a new window for it.
|
|
|
|
(let ((dnd-open-file-other-window t))
|
2004-02-03 16:55:30 +00:00
|
|
|
(select-frame frame)
|
|
|
|
(funcall handler window action data))))))
|
|
|
|
|
|
|
|
(defun x-dnd-handle-drag-n-drop-event (event)
|
|
|
|
"Receive drag and drop events (X client messages).
|
2004-02-15 12:30:04 +00:00
|
|
|
Currently XDND, Motif and old KDE 1.x protocols are recognized."
|
2004-02-03 16:55:30 +00:00
|
|
|
(interactive "e")
|
|
|
|
(let* ((client-message (car (cdr (cdr event))))
|
|
|
|
(window (posn-window (event-start event)))
|
|
|
|
(message-atom (aref client-message 0))
|
|
|
|
(frame (aref client-message 1))
|
|
|
|
(format (aref client-message 2))
|
|
|
|
(data (aref client-message 3)))
|
|
|
|
|
2004-02-10 17:27:26 +00:00
|
|
|
(cond ((equal "DndProtocol" message-atom) ; Old KDE 1.x.
|
2004-02-03 16:55:30 +00:00
|
|
|
(x-dnd-handle-old-kde event frame window message-atom format data))
|
|
|
|
|
2004-02-10 17:27:26 +00:00
|
|
|
((equal "_MOTIF_DRAG_AND_DROP_MESSAGE" message-atom) ; Motif
|
|
|
|
(x-dnd-handle-motif event frame window message-atom format data))
|
|
|
|
|
|
|
|
((and (> (length message-atom) 4) ; XDND protocol.
|
2004-02-03 16:55:30 +00:00
|
|
|
(equal "Xdnd" (substring message-atom 0 4)))
|
2004-02-10 17:27:26 +00:00
|
|
|
(x-dnd-handle-xdnd event frame window message-atom format data)))))
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;;; Old KDE protocol. Only dropping of files.
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
(declare-function x-window-property "xfns.c"
|
|
|
|
(prop &optional frame type source delete-p vector-ret-p))
|
|
|
|
|
2011-04-19 13:44:55 +00:00
|
|
|
(defun x-dnd-handle-old-kde (_event frame window _message _format _data)
|
2004-02-03 16:55:30 +00:00
|
|
|
"Open the files in a KDE 1.x drop."
|
|
|
|
(let ((values (x-window-property "DndSelection" frame nil 0 t)))
|
|
|
|
(x-dnd-handle-uri-list window 'private
|
|
|
|
(replace-regexp-in-string "\0$" "" values))))
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;;; XDND protocol.
|
|
|
|
|
2009-10-26 06:43:36 +00:00
|
|
|
(defconst x-dnd-xdnd-to-action
|
2004-02-03 16:55:30 +00:00
|
|
|
'(("XdndActionPrivate" . private)
|
|
|
|
("XdndActionCopy" . copy)
|
|
|
|
("XdndActionMove" . move)
|
|
|
|
("XdndActionLink" . link)
|
|
|
|
("XdndActionAsk" . ask))
|
|
|
|
"Mapping from XDND action types to lisp symbols.")
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
(declare-function x-change-window-property "xfns.c"
|
|
|
|
(prop value &optional frame type format outer-P))
|
|
|
|
|
2004-02-03 16:55:30 +00:00
|
|
|
(defun x-dnd-init-xdnd-for-frame (frame)
|
2004-02-10 17:27:26 +00:00
|
|
|
"Set the XdndAware property for FRAME to indicate that we do XDND."
|
2004-02-03 16:55:30 +00:00
|
|
|
(x-change-window-property "XdndAware"
|
|
|
|
'(5) ;; The version of XDND we support.
|
|
|
|
frame "ATOM" 32 t))
|
|
|
|
|
|
|
|
(defun x-dnd-get-drop-width-height (frame w accept)
|
2009-02-26 10:26:32 +00:00
|
|
|
"Return the width/height to be sent in a XDndStatus message.
|
2004-02-03 16:55:30 +00:00
|
|
|
FRAME is the frame and W is the window where the drop happened.
|
|
|
|
If ACCEPT is nil return 0 (empty rectangle),
|
2009-02-26 10:26:32 +00:00
|
|
|
otherwise if W is a window, return its width/height,
|
2004-02-03 16:55:30 +00:00
|
|
|
otherwise return the frame width/height."
|
|
|
|
(if accept
|
|
|
|
(if (windowp w) ;; w is not a window if dropping on the menu bar,
|
|
|
|
;; scroll bar or tool bar.
|
|
|
|
(let ((edges (window-inside-pixel-edges w)))
|
|
|
|
(cons
|
|
|
|
(- (nth 2 edges) (nth 0 edges)) ;; right - left
|
|
|
|
(- (nth 3 edges) (nth 1 edges)))) ;; bottom - top
|
|
|
|
(cons (frame-pixel-width frame)
|
|
|
|
(frame-pixel-height frame)))
|
|
|
|
0))
|
|
|
|
|
|
|
|
(defun x-dnd-get-drop-x-y (frame w)
|
|
|
|
"Return the x/y coordinates to be sent in a XDndStatus message.
|
|
|
|
Coordinates are required to be absolute.
|
|
|
|
FRAME is the frame and W is the window where the drop happened.
|
2011-11-15 07:55:13 +00:00
|
|
|
If W is a window, return its absolute coordinates,
|
2004-02-03 16:55:30 +00:00
|
|
|
otherwise return the frame coordinates."
|
|
|
|
(let* ((frame-left (frame-parameter frame 'left))
|
|
|
|
;; If the frame is outside the display, frame-left looks like
|
|
|
|
;; '(0 -16). Extract the -16.
|
|
|
|
(frame-real-left (if (consp frame-left) (car (cdr frame-left))
|
|
|
|
frame-left))
|
|
|
|
(frame-top (frame-parameter frame 'top))
|
|
|
|
(frame-real-top (if (consp frame-top) (car (cdr frame-top))
|
|
|
|
frame-top)))
|
|
|
|
(if (windowp w)
|
|
|
|
(let ((edges (window-inside-pixel-edges w)))
|
|
|
|
(cons
|
|
|
|
(+ frame-real-left (nth 0 edges))
|
|
|
|
(+ frame-real-top (nth 1 edges))))
|
|
|
|
(cons frame-real-left frame-real-top))))
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
(declare-function x-get-atom-name "xselect.c" (value &optional frame))
|
|
|
|
(declare-function x-send-client-message "xselect.c"
|
|
|
|
(display dest from message-type format values))
|
|
|
|
(declare-function x-get-selection-internal "xselect.c"
|
2012-02-11 23:06:46 +00:00
|
|
|
(selection-symbol target-type &optional time-stamp terminal))
|
2007-11-22 13:52:35 +00:00
|
|
|
|
2011-06-20 20:49:12 +00:00
|
|
|
(defun x-dnd-version-from-flags (flags)
|
lisp/*.el: Fix typos and other trivial doc fixes
* lisp/allout-widgets.el (allout-widgets-auto-activation)
(allout-current-decorated-p):
* lisp/auth-source.el (auth-source-protocols):
* lisp/autorevert.el (auto-revert-set-timer):
* lisp/battery.el (battery-mode-line-limit):
* lisp/calc/calcalg3.el (math-map-binop):
* lisp/calendar/cal-dst.el (calendar-dst-find-startend):
* lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute):
* lisp/calendar/calendar.el (calendar-date-echo-text)
(calendar-generate-month, calendar-string-spread)
(calendar-cursor-to-date, calendar-read, calendar-read-date)
(calendar-mark-visible-date, calendar-dayname-on-or-before):
* lisp/calendar/diary-lib.el (diary-ordinal-suffix):
* lisp/cedet/ede/autoconf-edit.el (autoconf-new-program)
(autoconf-find-last-macro, autoconf-parameter-strip):
* lisp/cedet/ede/config.el (ede-target-with-config-build):
* lisp/cedet/ede/linux.el (ede-linux--detect-architecture)
(ede-linux--get-architecture):
* lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache)
(semantic-displayer-abstract, semantic-displayer-point-position):
* lisp/cedet/semantic/format.el (semantic-format-face-alist)
(semantic-format-tag-short-doc):
* lisp/cedet/semantic/fw.el (semantic-find-file-noselect):
* lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time)
(semantic-idle-breadcrumbs-display-function)
(semantic-idle-breadcrumbs-format-tag-list-function):
* lisp/cedet/semantic/lex.el (semantic-lex-map-types)
(define-lex, define-lex-block-type-analyzer):
* lisp/cedet/semantic/senator.el (senator-search-default-tag-filter):
* lisp/cedet/semantic/symref.el (semantic-symref-result)
(semantic-symref-hit-to-tag-via-db):
* lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass):
* lisp/cedet/semantic/tag.el (semantic-tag-new-variable)
(semantic-tag-new-include, semantic-tag-new-package)
(semantic-tag-set-faux, semantic-create-tag-proxy)
(semantic-tag-function-parent)
(semantic-tag-components-with-overlays):
* lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces)
(srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict):
* lisp/cedet/srecode/dictionary.el (srecode-create-dictionary)
(srecode-dictionary-add-entries, srecode-dictionary-lookup-name)
(srecode-create-dictionaries-from-tags):
* lisp/cmuscheme.el (scheme-compile-region):
* lisp/color.el (color-lab-to-lch):
* lisp/doc-view.el (doc-view-image-width)
(doc-view-set-up-single-converter):
* lisp/dynamic-setting.el (font-setting-change-default-font)
(dynamic-setting-handle-config-changed-event):
* lisp/elec-pair.el (electric-pair-text-pairs)
(electric-pair-skip-whitespace-function)
(electric-pair-string-bound-function):
* lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance)
(avl-tree-member, avl-tree-mapcar, avl-tree-iter):
* lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree):
* lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag)
(checkdoc-spellcheck-documentation-flag, checkdoc-ispell)
(checkdoc-ispell-current-buffer, checkdoc-ispell-interactive)
(checkdoc-ispell-message-interactive)
(checkdoc-ispell-message-text, checkdoc-ispell-start)
(checkdoc-ispell-continue, checkdoc-ispell-comments)
(checkdoc-ispell-defun):
* lisp/emacs-lisp/cl-generic.el (cl--generic-search-method):
* lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group):
* lisp/emacs-lisp/lisp.el (forward-sexp, up-list):
* lisp/emacs-lisp/package-x.el (package--archive-contents-from-file):
* lisp/emacs-lisp/package.el (package-desc)
(package--make-autoloads-and-stuff, package-hidden-regexps):
* lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup):
* lisp/emacs-lisp/testcover.el (testcover-nohits)
(testcover-1value):
* lisp/epg.el (epg-receive-keys, epg-start-edit-key):
* lisp/erc/erc-backend.el (erc-server-processing-p)
(erc-split-line-length, erc-server-coding-system)
(erc-server-send, erc-message):
* lisp/erc/erc-button.el (erc-button-face, erc-button-alist)
(erc-browse-emacswiki):
* lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login):
* lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation):
* lisp/erc/erc-log.el (erc-current-logfile):
* lisp/erc/erc-match.el (erc-log-match-format)
(erc-text-matched-hook):
* lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug):
* lisp/erc/erc-networks.el (erc-server-alist)
(erc-networks-alist, erc-current-network):
* lisp/erc/erc-ring.el (erc-input-ring-index):
* lisp/erc/erc-speedbar.el (erc-speedbar)
(erc-speedbar-update-channel):
* lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag):
* lisp/erc/erc-track.el (erc-track-position-in-mode-line)
(erc-track-remove-from-mode-line, erc-modified-channels-update)
(erc-track-last-non-erc-buffer, erc-track-sort-by-importance)
(erc-track-get-active-buffer):
* lisp/erc/erc.el (erc-get-channel-user-list)
(erc-echo-notice-hook, erc-echo-notice-always-hook)
(erc-wash-quit-reason, erc-format-@nick):
* lisp/ffap.el (ffap-latex-mode):
* lisp/files.el (abort-if-file-too-large)
(dir-locals--get-sort-score, buffer-stale--default-function):
* lisp/filesets.el (filesets-tree-max-level, filesets-data)
(filesets-update-pre010505):
* lisp/gnus/gnus-agent.el (gnus-agent-flush-cache):
* lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol)
(gnus-button-prefer-mid-or-mail):
* lisp/gnus/gnus-cus.el (gnus-group-parameters):
* lisp/gnus/gnus-demon.el (gnus-demon-handlers)
(gnus-demon-run-callback):
* lisp/gnus/gnus-dired.el (gnus-dired-print):
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer):
* lisp/gnus/gnus-range.el (gnus-range-normalize):
* lisp/gnus/gnus-spec.el (gnus-pad-form):
* lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud)
(gnus-server-opened, gnus-server-closed, gnus-server-denied)
(gnus-server-offline):
* lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir)
(gnus-refer-thread-limit-to-thread)
(gnus-summary-limit-include-thread, gnus-summary-refer-thread)
(gnus-summary-find-matching):
* lisp/gnus/gnus-util.el (gnus-rescale-image):
* lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server):
* lisp/gnus/mail-source.el (mail-source-incoming-file-prefix):
* lisp/gnus/message.el (message-cite-reply-position)
(message-cite-style-outlook, message-cite-style-thunderbird)
(message-cite-style-gmail, message--send-mail-maybe-partially):
* lisp/gnus/mm-extern.el (mm-inline-external-body):
* lisp/gnus/mm-partial.el (mm-inline-partial):
* lisp/gnus/mml-sec.el (mml-secure-message-sign)
(mml-secure-message-sign-encrypt, mml-secure-message-encrypt):
* lisp/gnus/mml2015.el (mml2015-epg-key-image)
(mml2015-epg-key-image-to-string):
* lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail):
* lisp/gnus/nnheader.el (nnheader-directory-files-is-safe):
* lisp/gnus/nnir.el (nnir-search-history)
(nnir-imap-search-other, nnir-artlist-length)
(nnir-artlist-article, nnir-artitem-group, nnir-artitem-number)
(nnir-artitem-rsv, nnir-article-group, nnir-article-number)
(nnir-article-rsv, nnir-article-ids, nnir-categorize)
(nnir-retrieve-headers-override-function)
(nnir-imap-default-search-key, nnir-hyrex-additional-switches)
(gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms)
(nnir-read-parm, nnir-read-server-parm, nnir-search-thread):
* lisp/gnus/nnmairix.el (nnmairix-default-group)
(nnmairix-propagate-marks):
* lisp/gnus/smime.el (smime-keys, smime-crl-check)
(smime-verify-buffer, smime-noverify-buffer):
* lisp/gnus/spam-report.el (spam-report-url-ping-mm-url):
* lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header)
(spam-spamassassin-spam-status-header, spam-sa-learn-rebuild)
(spam-classifications, spam-check-stat, spam-spamassassin-score):
* lisp/help.el (describe-minor-mode-from-symbol):
* lisp/hippie-exp.el (hippie-expand-ignore-buffers):
* lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face)
(hfy-begin-span):
* lisp/ibuf-ext.el (ibuffer-update-saved-filters-format)
(ibuffer-saved-filters, ibuffer-old-saved-filters-warning)
(ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters)
(eval, ibuffer-unary-operand, file-extension, directory):
* lisp/image-dired.el (image-dired-cmd-pngcrush-options):
* lisp/image-mode.el (image-toggle-display):
* lisp/international/ccl.el (ccl-compile-read-multibyte-character)
(ccl-compile-write-multibyte-character):
* lisp/international/kkc.el (kkc-save-init-file):
* lisp/international/latin1-disp.el (latin1-display):
* lisp/international/ogonek.el (ogonek-name-encoding-alist)
(ogonek-information, ogonek-lookup-encoding)
(ogonek-deprefixify-region):
* lisp/isearch.el (isearch-filter-predicate)
(isearch--momentary-message):
* lisp/jsonrpc.el (jsonrpc-connection-send)
(jsonrpc-process-connection, jsonrpc-shutdown)
(jsonrpc--async-request-1):
* lisp/language/tibet-util.el (tibetan-char-p):
* lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date)
(feedmail-last-chance-hook, feedmail-before-fcc-hook)
(feedmail-send-it-immediately-wrapper, feedmail-find-eoh):
* lisp/mail/hashcash.el (hashcash-generate-payment)
(hashcash-generate-payment-async, hashcash-insert-payment)
(hashcash-verify-payment):
* lisp/mail/rmail.el (rmail-movemail-variant-in-use)
(rmail-get-attr-value):
* lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime):
* lisp/mail/rmailsum.el (rmail-summary-show-message):
* lisp/mail/supercite.el (sc-raw-mode-toggle):
* lisp/man.el (Man-start-calling):
* lisp/mh-e/mh-acros.el (mh-do-at-event-location)
(mh-iterate-on-messages-in-region, mh-iterate-on-range):
* lisp/mh-e/mh-alias.el (mh-alias-system-aliases)
(mh-alias-reload, mh-alias-ali)
(mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file)
(mh-alias-add-alias):
* lisp/mouse.el (mouse-save-then-kill):
* lisp/net/browse-url.el (browse-url-default-macosx-browser):
* lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value)
(eudc-variable-server-value, eudc-update-variable)
(eudc-expand-inline):
* lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result):
* lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list):
* lisp/net/pop3.el (pop3-list):
* lisp/net/soap-client.el (soap-namespace-put)
(soap-xs-parse-sequence, soap-parse-envelope):
* lisp/net/soap-inspect.el (soap-inspect-xs-complex-type):
* lisp/nxml/rng-xsd.el (rng-xsd-date-to-days):
* lisp/org/ob-C.el (org-babel-prep-session:C)
(org-babel-load-session:C):
* lisp/org/ob-J.el (org-babel-execute:J):
* lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote):
* lisp/org/ob-awk.el (org-babel-execute:awk):
* lisp/org/ob-core.el (org-babel-process-file-name):
* lisp/org/ob-ebnf.el (org-babel-execute:ebnf):
* lisp/org/ob-forth.el (org-babel-execute:forth):
* lisp/org/ob-fortran.el (org-babel-execute:fortran)
(org-babel-prep-session:fortran, org-babel-load-session:fortran):
* lisp/org/ob-groovy.el (org-babel-execute:groovy):
* lisp/org/ob-io.el (org-babel-execute:io):
* lisp/org/ob-js.el (org-babel-execute:js):
* lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond)
(org-babel-lilypond-compile-post-tangle)
(org-babel-lilypond-display-pdf-post-tangle)
(org-babel-lilypond-tangle)
(org-babel-lilypond-execute-tangled-ly)
(org-babel-lilypond-compile-lilyfile)
(org-babel-lilypond-check-for-compile-error)
(org-babel-lilypond-process-compile-error)
(org-babel-lilypond-mark-error-line)
(org-babel-lilypond-parse-error-line)
(org-babel-lilypond-attempt-to-open-pdf)
(org-babel-lilypond-attempt-to-play-midi)
(org-babel-lilypond-switch-extension)
(org-babel-lilypond-set-header-args):
* lisp/org/ob-lua.el (org-babel-prep-session:lua):
* lisp/org/ob-picolisp.el (org-babel-execute:picolisp):
* lisp/org/ob-processing.el (org-babel-prep-session:processing):
* lisp/org/ob-python.el (org-babel-prep-session:python):
* lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message)
(org-babel-scheme-execute-with-geiser, org-babel-execute:scheme):
* lisp/org/ob-shen.el (org-babel-execute:shen):
* lisp/org/org-agenda.el (org-agenda-entry-types)
(org-agenda-move-date-from-past-immediately-to-today)
(org-agenda-time-grid, org-agenda-sorting-strategy)
(org-agenda-filter-by-category, org-agenda-forward-block):
* lisp/org/org-colview.el (org-columns--overlay-text):
* lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces):
* lisp/org/org-indent.el (org-indent-set-line-properties):
* lisp/org/org-macs.el (org-get-limited-outline-regexp):
* lisp/org/org-mobile.el (org-mobile-files):
* lisp/org/org.el (org-use-fast-todo-selection)
(org-extend-today-until, org-use-property-inheritance)
(org-refresh-effort-properties, org-open-at-point-global)
(org-track-ordered-property-with-tag, org-shiftright):
* lisp/org/ox-html.el (org-html-checkbox-type):
* lisp/org/ox-man.el (org-man-source-highlight)
(org-man-verse-block):
* lisp/org/ox-publish.el (org-publish-sitemap-default):
* lisp/outline.el (outline-head-from-level):
* lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-calc-command-indent, dcl-indent-to):
* lisp/progmodes/flymake.el (flymake-make-diagnostic)
(flymake--overlays, flymake-diagnostic-functions)
(flymake-diagnostic-types-alist, flymake--backend-state)
(flymake-is-running, flymake--collect, flymake-mode):
* lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop)
(gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer):
* lisp/progmodes/grep.el (grep-error-screen-columns):
* lisp/progmodes/gud.el (gud-prev-expr):
* lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column)
(ps-run-goto-error):
* lisp/progmodes/python.el (python-eldoc-get-doc)
(python-eldoc-function-timeout-permanent, python-eldoc-function):
* lisp/shadowfile.el (shadow-make-group):
* lisp/speedbar.el (speedbar-obj-do-check):
* lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook):
* lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib):
* lisp/textmodes/reftex-index.el (reftex-index-goto-entry)
(reftex-index-kill, reftex-index-undo):
* lisp/textmodes/reftex-parse.el (reftex-context-substring):
* lisp/textmodes/reftex.el (reftex-TeX-master-file):
* lisp/textmodes/rst.el (rst-next-hdr, rst-toc)
(rst-uncomment-region, rst-font-lock-extend-region-internal):
* lisp/thumbs.el (thumbs-mode):
* lisp/vc/ediff-util.el (ediff-restore-diff):
* lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag):
* lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p):
* lisp/wid-edit.el (widget-field-value-set, string):
* lisp/x-dnd.el (x-dnd-version-from-flags)
(x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-20 22:27:53 +00:00
|
|
|
"Return the version byte from the 32 bit FLAGS in an XDndEnter message."
|
2011-06-20 20:49:12 +00:00
|
|
|
(if (consp flags) ;; Long as cons
|
|
|
|
(ash (car flags) -8)
|
|
|
|
(ash flags -24))) ;; Ordinary number
|
|
|
|
|
|
|
|
(defun x-dnd-more-than-3-from-flags (flags)
|
lisp/*.el: Fix typos and other trivial doc fixes
* lisp/allout-widgets.el (allout-widgets-auto-activation)
(allout-current-decorated-p):
* lisp/auth-source.el (auth-source-protocols):
* lisp/autorevert.el (auto-revert-set-timer):
* lisp/battery.el (battery-mode-line-limit):
* lisp/calc/calcalg3.el (math-map-binop):
* lisp/calendar/cal-dst.el (calendar-dst-find-startend):
* lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute):
* lisp/calendar/calendar.el (calendar-date-echo-text)
(calendar-generate-month, calendar-string-spread)
(calendar-cursor-to-date, calendar-read, calendar-read-date)
(calendar-mark-visible-date, calendar-dayname-on-or-before):
* lisp/calendar/diary-lib.el (diary-ordinal-suffix):
* lisp/cedet/ede/autoconf-edit.el (autoconf-new-program)
(autoconf-find-last-macro, autoconf-parameter-strip):
* lisp/cedet/ede/config.el (ede-target-with-config-build):
* lisp/cedet/ede/linux.el (ede-linux--detect-architecture)
(ede-linux--get-architecture):
* lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache)
(semantic-displayer-abstract, semantic-displayer-point-position):
* lisp/cedet/semantic/format.el (semantic-format-face-alist)
(semantic-format-tag-short-doc):
* lisp/cedet/semantic/fw.el (semantic-find-file-noselect):
* lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time)
(semantic-idle-breadcrumbs-display-function)
(semantic-idle-breadcrumbs-format-tag-list-function):
* lisp/cedet/semantic/lex.el (semantic-lex-map-types)
(define-lex, define-lex-block-type-analyzer):
* lisp/cedet/semantic/senator.el (senator-search-default-tag-filter):
* lisp/cedet/semantic/symref.el (semantic-symref-result)
(semantic-symref-hit-to-tag-via-db):
* lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass):
* lisp/cedet/semantic/tag.el (semantic-tag-new-variable)
(semantic-tag-new-include, semantic-tag-new-package)
(semantic-tag-set-faux, semantic-create-tag-proxy)
(semantic-tag-function-parent)
(semantic-tag-components-with-overlays):
* lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces)
(srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict):
* lisp/cedet/srecode/dictionary.el (srecode-create-dictionary)
(srecode-dictionary-add-entries, srecode-dictionary-lookup-name)
(srecode-create-dictionaries-from-tags):
* lisp/cmuscheme.el (scheme-compile-region):
* lisp/color.el (color-lab-to-lch):
* lisp/doc-view.el (doc-view-image-width)
(doc-view-set-up-single-converter):
* lisp/dynamic-setting.el (font-setting-change-default-font)
(dynamic-setting-handle-config-changed-event):
* lisp/elec-pair.el (electric-pair-text-pairs)
(electric-pair-skip-whitespace-function)
(electric-pair-string-bound-function):
* lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance)
(avl-tree-member, avl-tree-mapcar, avl-tree-iter):
* lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree):
* lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag)
(checkdoc-spellcheck-documentation-flag, checkdoc-ispell)
(checkdoc-ispell-current-buffer, checkdoc-ispell-interactive)
(checkdoc-ispell-message-interactive)
(checkdoc-ispell-message-text, checkdoc-ispell-start)
(checkdoc-ispell-continue, checkdoc-ispell-comments)
(checkdoc-ispell-defun):
* lisp/emacs-lisp/cl-generic.el (cl--generic-search-method):
* lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group):
* lisp/emacs-lisp/lisp.el (forward-sexp, up-list):
* lisp/emacs-lisp/package-x.el (package--archive-contents-from-file):
* lisp/emacs-lisp/package.el (package-desc)
(package--make-autoloads-and-stuff, package-hidden-regexps):
* lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup):
* lisp/emacs-lisp/testcover.el (testcover-nohits)
(testcover-1value):
* lisp/epg.el (epg-receive-keys, epg-start-edit-key):
* lisp/erc/erc-backend.el (erc-server-processing-p)
(erc-split-line-length, erc-server-coding-system)
(erc-server-send, erc-message):
* lisp/erc/erc-button.el (erc-button-face, erc-button-alist)
(erc-browse-emacswiki):
* lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login):
* lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation):
* lisp/erc/erc-log.el (erc-current-logfile):
* lisp/erc/erc-match.el (erc-log-match-format)
(erc-text-matched-hook):
* lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug):
* lisp/erc/erc-networks.el (erc-server-alist)
(erc-networks-alist, erc-current-network):
* lisp/erc/erc-ring.el (erc-input-ring-index):
* lisp/erc/erc-speedbar.el (erc-speedbar)
(erc-speedbar-update-channel):
* lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag):
* lisp/erc/erc-track.el (erc-track-position-in-mode-line)
(erc-track-remove-from-mode-line, erc-modified-channels-update)
(erc-track-last-non-erc-buffer, erc-track-sort-by-importance)
(erc-track-get-active-buffer):
* lisp/erc/erc.el (erc-get-channel-user-list)
(erc-echo-notice-hook, erc-echo-notice-always-hook)
(erc-wash-quit-reason, erc-format-@nick):
* lisp/ffap.el (ffap-latex-mode):
* lisp/files.el (abort-if-file-too-large)
(dir-locals--get-sort-score, buffer-stale--default-function):
* lisp/filesets.el (filesets-tree-max-level, filesets-data)
(filesets-update-pre010505):
* lisp/gnus/gnus-agent.el (gnus-agent-flush-cache):
* lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol)
(gnus-button-prefer-mid-or-mail):
* lisp/gnus/gnus-cus.el (gnus-group-parameters):
* lisp/gnus/gnus-demon.el (gnus-demon-handlers)
(gnus-demon-run-callback):
* lisp/gnus/gnus-dired.el (gnus-dired-print):
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer):
* lisp/gnus/gnus-range.el (gnus-range-normalize):
* lisp/gnus/gnus-spec.el (gnus-pad-form):
* lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud)
(gnus-server-opened, gnus-server-closed, gnus-server-denied)
(gnus-server-offline):
* lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir)
(gnus-refer-thread-limit-to-thread)
(gnus-summary-limit-include-thread, gnus-summary-refer-thread)
(gnus-summary-find-matching):
* lisp/gnus/gnus-util.el (gnus-rescale-image):
* lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server):
* lisp/gnus/mail-source.el (mail-source-incoming-file-prefix):
* lisp/gnus/message.el (message-cite-reply-position)
(message-cite-style-outlook, message-cite-style-thunderbird)
(message-cite-style-gmail, message--send-mail-maybe-partially):
* lisp/gnus/mm-extern.el (mm-inline-external-body):
* lisp/gnus/mm-partial.el (mm-inline-partial):
* lisp/gnus/mml-sec.el (mml-secure-message-sign)
(mml-secure-message-sign-encrypt, mml-secure-message-encrypt):
* lisp/gnus/mml2015.el (mml2015-epg-key-image)
(mml2015-epg-key-image-to-string):
* lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail):
* lisp/gnus/nnheader.el (nnheader-directory-files-is-safe):
* lisp/gnus/nnir.el (nnir-search-history)
(nnir-imap-search-other, nnir-artlist-length)
(nnir-artlist-article, nnir-artitem-group, nnir-artitem-number)
(nnir-artitem-rsv, nnir-article-group, nnir-article-number)
(nnir-article-rsv, nnir-article-ids, nnir-categorize)
(nnir-retrieve-headers-override-function)
(nnir-imap-default-search-key, nnir-hyrex-additional-switches)
(gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms)
(nnir-read-parm, nnir-read-server-parm, nnir-search-thread):
* lisp/gnus/nnmairix.el (nnmairix-default-group)
(nnmairix-propagate-marks):
* lisp/gnus/smime.el (smime-keys, smime-crl-check)
(smime-verify-buffer, smime-noverify-buffer):
* lisp/gnus/spam-report.el (spam-report-url-ping-mm-url):
* lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header)
(spam-spamassassin-spam-status-header, spam-sa-learn-rebuild)
(spam-classifications, spam-check-stat, spam-spamassassin-score):
* lisp/help.el (describe-minor-mode-from-symbol):
* lisp/hippie-exp.el (hippie-expand-ignore-buffers):
* lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face)
(hfy-begin-span):
* lisp/ibuf-ext.el (ibuffer-update-saved-filters-format)
(ibuffer-saved-filters, ibuffer-old-saved-filters-warning)
(ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters)
(eval, ibuffer-unary-operand, file-extension, directory):
* lisp/image-dired.el (image-dired-cmd-pngcrush-options):
* lisp/image-mode.el (image-toggle-display):
* lisp/international/ccl.el (ccl-compile-read-multibyte-character)
(ccl-compile-write-multibyte-character):
* lisp/international/kkc.el (kkc-save-init-file):
* lisp/international/latin1-disp.el (latin1-display):
* lisp/international/ogonek.el (ogonek-name-encoding-alist)
(ogonek-information, ogonek-lookup-encoding)
(ogonek-deprefixify-region):
* lisp/isearch.el (isearch-filter-predicate)
(isearch--momentary-message):
* lisp/jsonrpc.el (jsonrpc-connection-send)
(jsonrpc-process-connection, jsonrpc-shutdown)
(jsonrpc--async-request-1):
* lisp/language/tibet-util.el (tibetan-char-p):
* lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date)
(feedmail-last-chance-hook, feedmail-before-fcc-hook)
(feedmail-send-it-immediately-wrapper, feedmail-find-eoh):
* lisp/mail/hashcash.el (hashcash-generate-payment)
(hashcash-generate-payment-async, hashcash-insert-payment)
(hashcash-verify-payment):
* lisp/mail/rmail.el (rmail-movemail-variant-in-use)
(rmail-get-attr-value):
* lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime):
* lisp/mail/rmailsum.el (rmail-summary-show-message):
* lisp/mail/supercite.el (sc-raw-mode-toggle):
* lisp/man.el (Man-start-calling):
* lisp/mh-e/mh-acros.el (mh-do-at-event-location)
(mh-iterate-on-messages-in-region, mh-iterate-on-range):
* lisp/mh-e/mh-alias.el (mh-alias-system-aliases)
(mh-alias-reload, mh-alias-ali)
(mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file)
(mh-alias-add-alias):
* lisp/mouse.el (mouse-save-then-kill):
* lisp/net/browse-url.el (browse-url-default-macosx-browser):
* lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value)
(eudc-variable-server-value, eudc-update-variable)
(eudc-expand-inline):
* lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result):
* lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list):
* lisp/net/pop3.el (pop3-list):
* lisp/net/soap-client.el (soap-namespace-put)
(soap-xs-parse-sequence, soap-parse-envelope):
* lisp/net/soap-inspect.el (soap-inspect-xs-complex-type):
* lisp/nxml/rng-xsd.el (rng-xsd-date-to-days):
* lisp/org/ob-C.el (org-babel-prep-session:C)
(org-babel-load-session:C):
* lisp/org/ob-J.el (org-babel-execute:J):
* lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote):
* lisp/org/ob-awk.el (org-babel-execute:awk):
* lisp/org/ob-core.el (org-babel-process-file-name):
* lisp/org/ob-ebnf.el (org-babel-execute:ebnf):
* lisp/org/ob-forth.el (org-babel-execute:forth):
* lisp/org/ob-fortran.el (org-babel-execute:fortran)
(org-babel-prep-session:fortran, org-babel-load-session:fortran):
* lisp/org/ob-groovy.el (org-babel-execute:groovy):
* lisp/org/ob-io.el (org-babel-execute:io):
* lisp/org/ob-js.el (org-babel-execute:js):
* lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond)
(org-babel-lilypond-compile-post-tangle)
(org-babel-lilypond-display-pdf-post-tangle)
(org-babel-lilypond-tangle)
(org-babel-lilypond-execute-tangled-ly)
(org-babel-lilypond-compile-lilyfile)
(org-babel-lilypond-check-for-compile-error)
(org-babel-lilypond-process-compile-error)
(org-babel-lilypond-mark-error-line)
(org-babel-lilypond-parse-error-line)
(org-babel-lilypond-attempt-to-open-pdf)
(org-babel-lilypond-attempt-to-play-midi)
(org-babel-lilypond-switch-extension)
(org-babel-lilypond-set-header-args):
* lisp/org/ob-lua.el (org-babel-prep-session:lua):
* lisp/org/ob-picolisp.el (org-babel-execute:picolisp):
* lisp/org/ob-processing.el (org-babel-prep-session:processing):
* lisp/org/ob-python.el (org-babel-prep-session:python):
* lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message)
(org-babel-scheme-execute-with-geiser, org-babel-execute:scheme):
* lisp/org/ob-shen.el (org-babel-execute:shen):
* lisp/org/org-agenda.el (org-agenda-entry-types)
(org-agenda-move-date-from-past-immediately-to-today)
(org-agenda-time-grid, org-agenda-sorting-strategy)
(org-agenda-filter-by-category, org-agenda-forward-block):
* lisp/org/org-colview.el (org-columns--overlay-text):
* lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces):
* lisp/org/org-indent.el (org-indent-set-line-properties):
* lisp/org/org-macs.el (org-get-limited-outline-regexp):
* lisp/org/org-mobile.el (org-mobile-files):
* lisp/org/org.el (org-use-fast-todo-selection)
(org-extend-today-until, org-use-property-inheritance)
(org-refresh-effort-properties, org-open-at-point-global)
(org-track-ordered-property-with-tag, org-shiftright):
* lisp/org/ox-html.el (org-html-checkbox-type):
* lisp/org/ox-man.el (org-man-source-highlight)
(org-man-verse-block):
* lisp/org/ox-publish.el (org-publish-sitemap-default):
* lisp/outline.el (outline-head-from-level):
* lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-calc-command-indent, dcl-indent-to):
* lisp/progmodes/flymake.el (flymake-make-diagnostic)
(flymake--overlays, flymake-diagnostic-functions)
(flymake-diagnostic-types-alist, flymake--backend-state)
(flymake-is-running, flymake--collect, flymake-mode):
* lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop)
(gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer):
* lisp/progmodes/grep.el (grep-error-screen-columns):
* lisp/progmodes/gud.el (gud-prev-expr):
* lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column)
(ps-run-goto-error):
* lisp/progmodes/python.el (python-eldoc-get-doc)
(python-eldoc-function-timeout-permanent, python-eldoc-function):
* lisp/shadowfile.el (shadow-make-group):
* lisp/speedbar.el (speedbar-obj-do-check):
* lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook):
* lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib):
* lisp/textmodes/reftex-index.el (reftex-index-goto-entry)
(reftex-index-kill, reftex-index-undo):
* lisp/textmodes/reftex-parse.el (reftex-context-substring):
* lisp/textmodes/reftex.el (reftex-TeX-master-file):
* lisp/textmodes/rst.el (rst-next-hdr, rst-toc)
(rst-uncomment-region, rst-font-lock-extend-region-internal):
* lisp/thumbs.el (thumbs-mode):
* lisp/vc/ediff-util.el (ediff-restore-diff):
* lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag):
* lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p):
* lisp/wid-edit.el (widget-field-value-set, string):
* lisp/x-dnd.el (x-dnd-version-from-flags)
(x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-20 22:27:53 +00:00
|
|
|
"Return the nmore-than3 bit from the 32 bit FLAGS in an XDndEnter message."
|
2011-06-20 20:49:12 +00:00
|
|
|
(if (consp flags)
|
|
|
|
(logand (cdr flags) 1)
|
|
|
|
(logand flags 1)))
|
2011-11-15 07:55:13 +00:00
|
|
|
|
2011-04-19 13:44:55 +00:00
|
|
|
(defun x-dnd-handle-xdnd (event frame window message _format data)
|
2004-02-03 16:55:30 +00:00
|
|
|
"Receive one XDND event (client message) and send the appropriate reply.
|
|
|
|
EVENT is the client message. FRAME is where the mouse is now.
|
|
|
|
WINDOW is the window within FRAME where the mouse is now.
|
|
|
|
FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent."
|
|
|
|
(cond ((equal "XdndEnter" message)
|
2005-02-05 16:53:22 +00:00
|
|
|
(let* ((flags (aref data 1))
|
2011-06-20 20:49:12 +00:00
|
|
|
(version (x-dnd-version-from-flags flags))
|
|
|
|
(more-than-3 (x-dnd-more-than-3-from-flags flags))
|
2005-02-05 16:53:22 +00:00
|
|
|
(dnd-source (aref data 0)))
|
2011-06-20 20:49:12 +00:00
|
|
|
(message "%s %s" version more-than-3)
|
2005-02-05 16:53:22 +00:00
|
|
|
(if version ;; If flags is bad, version will be nil.
|
|
|
|
(x-dnd-save-state
|
|
|
|
window nil nil
|
|
|
|
(if (> more-than-3 0)
|
|
|
|
(x-window-property "XdndTypeList"
|
|
|
|
frame "AnyPropertyType"
|
|
|
|
dnd-source nil t)
|
|
|
|
(vector (x-get-atom-name (aref data 2))
|
|
|
|
(x-get-atom-name (aref data 3))
|
|
|
|
(x-get-atom-name (aref data 4))))))))
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
((equal "XdndPosition" message)
|
2011-04-19 13:44:55 +00:00
|
|
|
(let* ((action (x-get-atom-name (aref data 4)))
|
2004-02-03 16:55:30 +00:00
|
|
|
(dnd-source (aref data 0))
|
|
|
|
(action-type (x-dnd-maybe-call-test-function
|
|
|
|
window
|
|
|
|
(cdr (assoc action x-dnd-xdnd-to-action))))
|
|
|
|
(reply-action (car (rassoc (car action-type)
|
|
|
|
x-dnd-xdnd-to-action)))
|
|
|
|
(accept ;; 1 = accept, 0 = reject
|
|
|
|
(if (and reply-action action-type) 1 0))
|
|
|
|
(list-to-send
|
|
|
|
(list (string-to-number
|
|
|
|
(frame-parameter frame 'outer-window-id))
|
|
|
|
accept ;; 1 = Accept, 0 = reject.
|
|
|
|
(x-dnd-get-drop-x-y frame window)
|
2005-02-09 15:50:47 +00:00
|
|
|
(x-dnd-get-drop-width-height
|
2004-02-03 16:55:30 +00:00
|
|
|
frame window (eq accept 1))
|
|
|
|
(or reply-action 0)
|
|
|
|
)))
|
|
|
|
(x-send-client-message
|
|
|
|
frame dnd-source frame "XdndStatus" 32 list-to-send)
|
|
|
|
))
|
|
|
|
|
|
|
|
((equal "XdndLeave" message)
|
|
|
|
(x-dnd-forget-drop window))
|
|
|
|
|
|
|
|
((equal "XdndDrop" message)
|
|
|
|
(if (windowp window) (select-window window))
|
|
|
|
(let* ((dnd-source (aref data 0))
|
|
|
|
(value (and (x-dnd-current-type window)
|
|
|
|
(x-get-selection-internal
|
|
|
|
'XdndSelection
|
|
|
|
(intern (x-dnd-current-type window)))))
|
2011-04-19 13:44:55 +00:00
|
|
|
success action)
|
2004-02-03 16:55:30 +00:00
|
|
|
|
|
|
|
(setq action (if value
|
|
|
|
(condition-case info
|
2005-02-09 15:50:47 +00:00
|
|
|
(x-dnd-drop-data event frame window value
|
2004-02-03 16:55:30 +00:00
|
|
|
(x-dnd-current-type window))
|
2005-02-09 15:50:47 +00:00
|
|
|
(error
|
2004-02-03 16:55:30 +00:00
|
|
|
(message "Error: %s" info)
|
|
|
|
nil))))
|
|
|
|
|
|
|
|
(setq success (if action 1 0))
|
|
|
|
|
|
|
|
(x-send-client-message
|
|
|
|
frame dnd-source frame "XdndFinished" 32
|
|
|
|
(list (string-to-number (frame-parameter frame 'outer-window-id))
|
|
|
|
success ;; 1 = Success, 0 = Error
|
|
|
|
(if success "XdndActionPrivate" 0)
|
|
|
|
))
|
|
|
|
(x-dnd-forget-drop window)))
|
|
|
|
|
|
|
|
(t (error "Unknown XDND message %s %s" message data))))
|
|
|
|
|
2004-02-10 17:27:26 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;;; Motif protocol.
|
|
|
|
|
|
|
|
(defun x-dnd-init-motif-for-frame (frame)
|
2009-02-26 10:26:32 +00:00
|
|
|
"Set _MOTIF_DRAG_RECEIVER_INFO for FRAME to indicate that we do Motif DND."
|
2004-02-10 17:27:26 +00:00
|
|
|
(x-change-window-property "_MOTIF_DRAG_RECEIVER_INFO"
|
|
|
|
(list
|
|
|
|
(byteorder)
|
|
|
|
0 ; The Motif DND version.
|
|
|
|
5 ; We want drag dynamic.
|
|
|
|
0 0 0 0 0 0 0
|
|
|
|
0 0 0 0 0 0) ; Property must be 16 bytes.
|
|
|
|
frame "_MOTIF_DRAG_RECEIVER_INFO" 8 t))
|
|
|
|
|
|
|
|
(defun x-dnd-get-motif-value (data offset size byteorder)
|
|
|
|
(cond ((eq size 2)
|
|
|
|
(if (eq byteorder ?l)
|
|
|
|
(+ (ash (aref data (1+ offset)) 8)
|
|
|
|
(aref data offset))
|
|
|
|
(+ (ash (aref data offset) 8)
|
|
|
|
(aref data (1+ offset)))))
|
|
|
|
|
|
|
|
((eq size 4)
|
|
|
|
(if (eq byteorder ?l)
|
|
|
|
(cons (+ (ash (aref data (+ 3 offset)) 8)
|
|
|
|
(aref data (+ 2 offset)))
|
|
|
|
(+ (ash (aref data (1+ offset)) 8)
|
|
|
|
(aref data offset)))
|
|
|
|
(cons (+ (ash (aref data offset) 8)
|
|
|
|
(aref data (1+ offset)))
|
|
|
|
(+ (ash (aref data (+ 2 offset)) 8)
|
|
|
|
(aref data (+ 3 offset))))))))
|
|
|
|
|
|
|
|
(defun x-dnd-motif-value-to-list (value size byteorder)
|
|
|
|
(let ((bytes (cond ((eq size 2)
|
Audit use of lsh and fix glitches
I audited use of lsh in the Lisp source code, and fixed the
glitches that I found. While I was at it, I replaced uses of lsh
with ash when either will do. Replacement is OK when either
argument is known to be nonnegative, or when only the low-order
bits of the result matter, and is a (minor) win since ash is a bit
more solid than lsh nowadays, and is a bit faster.
* lisp/calc/calc-ext.el (math-check-fixnum):
Prefer most-positive-fixnum to (lsh -1 -1).
* lisp/vc/vc-hg.el (vc-hg-state-fast): When testing fixnum width,
prefer (zerop (ash most-positive-fixnum -32)) to (zerop (lsh -1
32)) (Bug#32485#11).
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode):
Tighten sanity-check for bytecode overflow, by checking that the
result of (ash pc -8) is nonnegative. Formerly this check was not
needed since lsh was used and the number overflowed differently.
* lisp/net/dns.el (dns-write): Fix some obvious sign typos in
shift counts. Evidently this part of the code has never been
exercised.
* lisp/progmodes/hideif.el (hif-shiftleft, hif-shiftright):
* lisp/term/common-win.el (x-setup-function-keys):
Simplify.
* admin/unidata/unidata-gen.el, admin/unidata/uvs.el:
* doc/lispref/keymaps.texi, doc/lispref/syntax.texi:
* doc/misc/calc.texi, doc/misc/cl.texi, etc/NEWS.19:
* lisp/arc-mode.el, lisp/calc/calc-bin.el, lisp/calc/calc-comb.el:
* lisp/calc/calc-ext.el, lisp/calc/calc-math.el:
* lisp/cedet/semantic/wisent/comp.el, lisp/composite.el:
* lisp/disp-table.el, lisp/dos-fns.el, lisp/edmacro.el:
* lisp/emacs-lisp/bindat.el, lisp/emacs-lisp/byte-opt.el:
* lisp/emacs-lisp/bytecomp.el, lisp/emacs-lisp/cl-extra.el:
* lisp/erc/erc-dcc.el, lisp/facemenu.el, lisp/gnus/message.el:
* lisp/gnus/nndoc.el, lisp/gnus/nnmaildir.el, lisp/image.el:
* lisp/international/ccl.el, lisp/international/fontset.el:
* lisp/international/mule-cmds.el, lisp/international/mule.el:
* lisp/json.el, lisp/mail/binhex.el, lisp/mail/rmail.el:
* lisp/mail/uudecode.el, lisp/md4.el, lisp/net/dns.el:
* lisp/net/ntlm.el, lisp/net/sasl.el, lisp/net/socks.el:
* lisp/net/tramp.el, lisp/obsolete/levents.el:
* lisp/obsolete/pgg-parse.el, lisp/org/org.el:
* lisp/org/ox-publish.el, lisp/progmodes/cc-defs.el:
* lisp/progmodes/ebnf2ps.el, lisp/progmodes/hideif.el:
* lisp/ps-bdf.el, lisp/ps-print.el, lisp/simple.el:
* lisp/tar-mode.el, lisp/term/common-win.el:
* lisp/term/tty-colors.el, lisp/term/xterm.el, lisp/vc/vc-git.el:
* lisp/vc/vc-hg.el, lisp/x-dnd.el, test/src/data-tests.el:
Prefer ash to lsh when either will do.
2018-08-21 20:44:03 +00:00
|
|
|
(list (logand (ash value -8) ?\xff)
|
2004-02-10 17:27:26 +00:00
|
|
|
(logand value ?\xff)))
|
|
|
|
|
|
|
|
((eq size 4)
|
|
|
|
(if (consp value)
|
Audit use of lsh and fix glitches
I audited use of lsh in the Lisp source code, and fixed the
glitches that I found. While I was at it, I replaced uses of lsh
with ash when either will do. Replacement is OK when either
argument is known to be nonnegative, or when only the low-order
bits of the result matter, and is a (minor) win since ash is a bit
more solid than lsh nowadays, and is a bit faster.
* lisp/calc/calc-ext.el (math-check-fixnum):
Prefer most-positive-fixnum to (lsh -1 -1).
* lisp/vc/vc-hg.el (vc-hg-state-fast): When testing fixnum width,
prefer (zerop (ash most-positive-fixnum -32)) to (zerop (lsh -1
32)) (Bug#32485#11).
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode):
Tighten sanity-check for bytecode overflow, by checking that the
result of (ash pc -8) is nonnegative. Formerly this check was not
needed since lsh was used and the number overflowed differently.
* lisp/net/dns.el (dns-write): Fix some obvious sign typos in
shift counts. Evidently this part of the code has never been
exercised.
* lisp/progmodes/hideif.el (hif-shiftleft, hif-shiftright):
* lisp/term/common-win.el (x-setup-function-keys):
Simplify.
* admin/unidata/unidata-gen.el, admin/unidata/uvs.el:
* doc/lispref/keymaps.texi, doc/lispref/syntax.texi:
* doc/misc/calc.texi, doc/misc/cl.texi, etc/NEWS.19:
* lisp/arc-mode.el, lisp/calc/calc-bin.el, lisp/calc/calc-comb.el:
* lisp/calc/calc-ext.el, lisp/calc/calc-math.el:
* lisp/cedet/semantic/wisent/comp.el, lisp/composite.el:
* lisp/disp-table.el, lisp/dos-fns.el, lisp/edmacro.el:
* lisp/emacs-lisp/bindat.el, lisp/emacs-lisp/byte-opt.el:
* lisp/emacs-lisp/bytecomp.el, lisp/emacs-lisp/cl-extra.el:
* lisp/erc/erc-dcc.el, lisp/facemenu.el, lisp/gnus/message.el:
* lisp/gnus/nndoc.el, lisp/gnus/nnmaildir.el, lisp/image.el:
* lisp/international/ccl.el, lisp/international/fontset.el:
* lisp/international/mule-cmds.el, lisp/international/mule.el:
* lisp/json.el, lisp/mail/binhex.el, lisp/mail/rmail.el:
* lisp/mail/uudecode.el, lisp/md4.el, lisp/net/dns.el:
* lisp/net/ntlm.el, lisp/net/sasl.el, lisp/net/socks.el:
* lisp/net/tramp.el, lisp/obsolete/levents.el:
* lisp/obsolete/pgg-parse.el, lisp/org/org.el:
* lisp/org/ox-publish.el, lisp/progmodes/cc-defs.el:
* lisp/progmodes/ebnf2ps.el, lisp/progmodes/hideif.el:
* lisp/ps-bdf.el, lisp/ps-print.el, lisp/simple.el:
* lisp/tar-mode.el, lisp/term/common-win.el:
* lisp/term/tty-colors.el, lisp/term/xterm.el, lisp/vc/vc-git.el:
* lisp/vc/vc-hg.el, lisp/x-dnd.el, test/src/data-tests.el:
Prefer ash to lsh when either will do.
2018-08-21 20:44:03 +00:00
|
|
|
(list (logand (ash (car value) -8) ?\xff)
|
2004-02-10 17:27:26 +00:00
|
|
|
(logand (car value) ?\xff)
|
Audit use of lsh and fix glitches
I audited use of lsh in the Lisp source code, and fixed the
glitches that I found. While I was at it, I replaced uses of lsh
with ash when either will do. Replacement is OK when either
argument is known to be nonnegative, or when only the low-order
bits of the result matter, and is a (minor) win since ash is a bit
more solid than lsh nowadays, and is a bit faster.
* lisp/calc/calc-ext.el (math-check-fixnum):
Prefer most-positive-fixnum to (lsh -1 -1).
* lisp/vc/vc-hg.el (vc-hg-state-fast): When testing fixnum width,
prefer (zerop (ash most-positive-fixnum -32)) to (zerop (lsh -1
32)) (Bug#32485#11).
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode):
Tighten sanity-check for bytecode overflow, by checking that the
result of (ash pc -8) is nonnegative. Formerly this check was not
needed since lsh was used and the number overflowed differently.
* lisp/net/dns.el (dns-write): Fix some obvious sign typos in
shift counts. Evidently this part of the code has never been
exercised.
* lisp/progmodes/hideif.el (hif-shiftleft, hif-shiftright):
* lisp/term/common-win.el (x-setup-function-keys):
Simplify.
* admin/unidata/unidata-gen.el, admin/unidata/uvs.el:
* doc/lispref/keymaps.texi, doc/lispref/syntax.texi:
* doc/misc/calc.texi, doc/misc/cl.texi, etc/NEWS.19:
* lisp/arc-mode.el, lisp/calc/calc-bin.el, lisp/calc/calc-comb.el:
* lisp/calc/calc-ext.el, lisp/calc/calc-math.el:
* lisp/cedet/semantic/wisent/comp.el, lisp/composite.el:
* lisp/disp-table.el, lisp/dos-fns.el, lisp/edmacro.el:
* lisp/emacs-lisp/bindat.el, lisp/emacs-lisp/byte-opt.el:
* lisp/emacs-lisp/bytecomp.el, lisp/emacs-lisp/cl-extra.el:
* lisp/erc/erc-dcc.el, lisp/facemenu.el, lisp/gnus/message.el:
* lisp/gnus/nndoc.el, lisp/gnus/nnmaildir.el, lisp/image.el:
* lisp/international/ccl.el, lisp/international/fontset.el:
* lisp/international/mule-cmds.el, lisp/international/mule.el:
* lisp/json.el, lisp/mail/binhex.el, lisp/mail/rmail.el:
* lisp/mail/uudecode.el, lisp/md4.el, lisp/net/dns.el:
* lisp/net/ntlm.el, lisp/net/sasl.el, lisp/net/socks.el:
* lisp/net/tramp.el, lisp/obsolete/levents.el:
* lisp/obsolete/pgg-parse.el, lisp/org/org.el:
* lisp/org/ox-publish.el, lisp/progmodes/cc-defs.el:
* lisp/progmodes/ebnf2ps.el, lisp/progmodes/hideif.el:
* lisp/ps-bdf.el, lisp/ps-print.el, lisp/simple.el:
* lisp/tar-mode.el, lisp/term/common-win.el:
* lisp/term/tty-colors.el, lisp/term/xterm.el, lisp/vc/vc-git.el:
* lisp/vc/vc-hg.el, lisp/x-dnd.el, test/src/data-tests.el:
Prefer ash to lsh when either will do.
2018-08-21 20:44:03 +00:00
|
|
|
(logand (ash (cdr value) -8) ?\xff)
|
2004-02-10 17:27:26 +00:00
|
|
|
(logand (cdr value) ?\xff))
|
Audit use of lsh and fix glitches
I audited use of lsh in the Lisp source code, and fixed the
glitches that I found. While I was at it, I replaced uses of lsh
with ash when either will do. Replacement is OK when either
argument is known to be nonnegative, or when only the low-order
bits of the result matter, and is a (minor) win since ash is a bit
more solid than lsh nowadays, and is a bit faster.
* lisp/calc/calc-ext.el (math-check-fixnum):
Prefer most-positive-fixnum to (lsh -1 -1).
* lisp/vc/vc-hg.el (vc-hg-state-fast): When testing fixnum width,
prefer (zerop (ash most-positive-fixnum -32)) to (zerop (lsh -1
32)) (Bug#32485#11).
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode):
Tighten sanity-check for bytecode overflow, by checking that the
result of (ash pc -8) is nonnegative. Formerly this check was not
needed since lsh was used and the number overflowed differently.
* lisp/net/dns.el (dns-write): Fix some obvious sign typos in
shift counts. Evidently this part of the code has never been
exercised.
* lisp/progmodes/hideif.el (hif-shiftleft, hif-shiftright):
* lisp/term/common-win.el (x-setup-function-keys):
Simplify.
* admin/unidata/unidata-gen.el, admin/unidata/uvs.el:
* doc/lispref/keymaps.texi, doc/lispref/syntax.texi:
* doc/misc/calc.texi, doc/misc/cl.texi, etc/NEWS.19:
* lisp/arc-mode.el, lisp/calc/calc-bin.el, lisp/calc/calc-comb.el:
* lisp/calc/calc-ext.el, lisp/calc/calc-math.el:
* lisp/cedet/semantic/wisent/comp.el, lisp/composite.el:
* lisp/disp-table.el, lisp/dos-fns.el, lisp/edmacro.el:
* lisp/emacs-lisp/bindat.el, lisp/emacs-lisp/byte-opt.el:
* lisp/emacs-lisp/bytecomp.el, lisp/emacs-lisp/cl-extra.el:
* lisp/erc/erc-dcc.el, lisp/facemenu.el, lisp/gnus/message.el:
* lisp/gnus/nndoc.el, lisp/gnus/nnmaildir.el, lisp/image.el:
* lisp/international/ccl.el, lisp/international/fontset.el:
* lisp/international/mule-cmds.el, lisp/international/mule.el:
* lisp/json.el, lisp/mail/binhex.el, lisp/mail/rmail.el:
* lisp/mail/uudecode.el, lisp/md4.el, lisp/net/dns.el:
* lisp/net/ntlm.el, lisp/net/sasl.el, lisp/net/socks.el:
* lisp/net/tramp.el, lisp/obsolete/levents.el:
* lisp/obsolete/pgg-parse.el, lisp/org/org.el:
* lisp/org/ox-publish.el, lisp/progmodes/cc-defs.el:
* lisp/progmodes/ebnf2ps.el, lisp/progmodes/hideif.el:
* lisp/ps-bdf.el, lisp/ps-print.el, lisp/simple.el:
* lisp/tar-mode.el, lisp/term/common-win.el:
* lisp/term/tty-colors.el, lisp/term/xterm.el, lisp/vc/vc-git.el:
* lisp/vc/vc-hg.el, lisp/x-dnd.el, test/src/data-tests.el:
Prefer ash to lsh when either will do.
2018-08-21 20:44:03 +00:00
|
|
|
(list (logand (ash value -24) ?\xff)
|
|
|
|
(logand (ash value -16) ?\xff)
|
|
|
|
(logand (ash value -8) ?\xff)
|
2004-02-10 17:27:26 +00:00
|
|
|
(logand value ?\xff)))))))
|
|
|
|
(if (eq byteorder ?l)
|
|
|
|
(reverse bytes)
|
|
|
|
bytes)))
|
|
|
|
|
|
|
|
|
|
|
|
(defvar x-dnd-motif-message-types
|
|
|
|
'((0 . XmTOP_LEVEL_ENTER)
|
|
|
|
(1 . XmTOP_LEVEL_LEAVE)
|
|
|
|
(2 . XmDRAG_MOTION)
|
|
|
|
(3 . XmDROP_SITE_ENTER)
|
|
|
|
(4 . XmDROP_SITE_LEAVE)
|
|
|
|
(5 . XmDROP_START)
|
|
|
|
(6 . XmDROP_FINISH)
|
|
|
|
(7 . XmDRAG_DROP_FINISH)
|
|
|
|
(8 . XmOPERATION_CHANGED))
|
|
|
|
"Mapping from numbers to Motif DND message types.")
|
|
|
|
|
|
|
|
(defvar x-dnd-motif-to-action
|
|
|
|
'((1 . move)
|
|
|
|
(2 . copy)
|
|
|
|
(3 . link) ; Both 3 and 4 has been seen as link.
|
|
|
|
(4 . link)
|
|
|
|
(2 . private)) ; Motif does not have private, so use copy for private.
|
|
|
|
"Mapping from number to operation for Motif DND.")
|
|
|
|
|
2011-04-19 13:44:55 +00:00
|
|
|
(defun x-dnd-handle-motif (event frame window message-atom _format data)
|
2004-02-10 17:27:26 +00:00
|
|
|
(let* ((message-type (cdr (assoc (aref data 0) x-dnd-motif-message-types)))
|
|
|
|
(source-byteorder (aref data 1))
|
|
|
|
(my-byteorder (byteorder))
|
|
|
|
(source-flags (x-dnd-get-motif-value data 2 2 source-byteorder))
|
|
|
|
(source-action (cdr (assoc (logand ?\xF source-flags)
|
|
|
|
x-dnd-motif-to-action))))
|
|
|
|
|
|
|
|
(cond ((eq message-type 'XmTOP_LEVEL_ENTER)
|
|
|
|
(let* ((dnd-source (x-dnd-get-motif-value
|
|
|
|
data 8 4 source-byteorder))
|
|
|
|
(selection-atom (x-dnd-get-motif-value
|
|
|
|
data 12 4 source-byteorder))
|
|
|
|
(atom-name (x-get-atom-name selection-atom))
|
|
|
|
(types (when atom-name
|
|
|
|
(x-get-selection-internal (intern atom-name)
|
|
|
|
'TARGETS))))
|
|
|
|
(x-dnd-forget-drop frame)
|
|
|
|
(when types (x-dnd-save-state window nil nil
|
|
|
|
types
|
|
|
|
dnd-source))))
|
|
|
|
|
|
|
|
;; Can not forget drop here, LEAVE comes before DROP_START and
|
|
|
|
;; we need the state in DROP_START.
|
|
|
|
((eq message-type 'XmTOP_LEVEL_LEAVE)
|
|
|
|
nil)
|
|
|
|
|
|
|
|
((eq message-type 'XmDRAG_MOTION)
|
|
|
|
(let* ((state (x-dnd-get-state-for-frame frame))
|
|
|
|
(timestamp (x-dnd-motif-value-to-list
|
2005-02-09 15:50:47 +00:00
|
|
|
(x-dnd-get-motif-value data 4 4
|
2004-02-10 17:27:26 +00:00
|
|
|
source-byteorder)
|
|
|
|
4 my-byteorder))
|
|
|
|
(x (x-dnd-motif-value-to-list
|
|
|
|
(x-dnd-get-motif-value data 8 2 source-byteorder)
|
|
|
|
2 my-byteorder))
|
|
|
|
(y (x-dnd-motif-value-to-list
|
|
|
|
(x-dnd-get-motif-value data 10 2 source-byteorder)
|
|
|
|
2 my-byteorder))
|
|
|
|
(dnd-source (aref state 6))
|
|
|
|
(first-move (not (aref state 3)))
|
|
|
|
(action-type (x-dnd-maybe-call-test-function
|
|
|
|
window
|
|
|
|
source-action))
|
|
|
|
(reply-action (car (rassoc (car action-type)
|
|
|
|
x-dnd-motif-to-action)))
|
|
|
|
(reply-flags
|
|
|
|
(x-dnd-motif-value-to-list
|
|
|
|
(if reply-action
|
2005-02-09 15:50:47 +00:00
|
|
|
(+ reply-action
|
2004-02-10 17:27:26 +00:00
|
|
|
?\x30 ; 30: valid drop site
|
|
|
|
?\x700) ; 700: can do copy, move or link
|
|
|
|
?\x30) ; 30: drop site, but noop.
|
|
|
|
2 my-byteorder))
|
|
|
|
(reply (append
|
|
|
|
(list
|
|
|
|
(+ ?\x80 ; 0x80 indicates a reply.
|
|
|
|
(if first-move
|
|
|
|
3 ; First time, reply is SITE_ENTER.
|
|
|
|
2)) ; Not first time, reply is DRAG_MOTION.
|
|
|
|
my-byteorder)
|
|
|
|
reply-flags
|
|
|
|
timestamp
|
|
|
|
x
|
|
|
|
y)))
|
|
|
|
(x-send-client-message frame
|
|
|
|
dnd-source
|
|
|
|
frame
|
|
|
|
"_MOTIF_DRAG_AND_DROP_MESSAGE"
|
|
|
|
8
|
|
|
|
reply)))
|
|
|
|
|
|
|
|
((eq message-type 'XmOPERATION_CHANGED)
|
|
|
|
(let* ((state (x-dnd-get-state-for-frame frame))
|
|
|
|
(timestamp (x-dnd-motif-value-to-list
|
|
|
|
(x-dnd-get-motif-value data 4 4 source-byteorder)
|
|
|
|
4 my-byteorder))
|
|
|
|
(dnd-source (aref state 6))
|
|
|
|
(action-type (x-dnd-maybe-call-test-function
|
|
|
|
window
|
|
|
|
source-action))
|
|
|
|
(reply-action (car (rassoc (car action-type)
|
|
|
|
x-dnd-motif-to-action)))
|
|
|
|
(reply-flags
|
|
|
|
(x-dnd-motif-value-to-list
|
|
|
|
(if reply-action
|
2005-02-09 15:50:47 +00:00
|
|
|
(+ reply-action
|
2004-02-10 17:27:26 +00:00
|
|
|
?\x30 ; 30: valid drop site
|
|
|
|
?\x700) ; 700: can do copy, move or link
|
|
|
|
?\x30) ; 30: drop site, but noop
|
|
|
|
2 my-byteorder))
|
|
|
|
(reply (append
|
|
|
|
(list
|
|
|
|
(+ ?\x80 ; 0x80 indicates a reply.
|
|
|
|
8) ; 8 is OPERATION_CHANGED
|
|
|
|
my-byteorder)
|
|
|
|
reply-flags
|
|
|
|
timestamp)))
|
|
|
|
(x-send-client-message frame
|
|
|
|
dnd-source
|
|
|
|
frame
|
|
|
|
"_MOTIF_DRAG_AND_DROP_MESSAGE"
|
|
|
|
8
|
|
|
|
reply)))
|
|
|
|
|
|
|
|
((eq message-type 'XmDROP_START)
|
|
|
|
(let* ((x (x-dnd-motif-value-to-list
|
|
|
|
(x-dnd-get-motif-value data 8 2 source-byteorder)
|
|
|
|
2 my-byteorder))
|
|
|
|
(y (x-dnd-motif-value-to-list
|
|
|
|
(x-dnd-get-motif-value data 10 2 source-byteorder)
|
|
|
|
2 my-byteorder))
|
|
|
|
(selection-atom (x-dnd-get-motif-value
|
|
|
|
data 12 4 source-byteorder))
|
|
|
|
(atom-name (x-get-atom-name selection-atom))
|
|
|
|
(dnd-source (x-dnd-get-motif-value
|
|
|
|
data 16 4 source-byteorder))
|
|
|
|
(action-type (x-dnd-maybe-call-test-function
|
|
|
|
window
|
|
|
|
source-action))
|
|
|
|
(reply-action (car (rassoc (car action-type)
|
|
|
|
x-dnd-motif-to-action)))
|
|
|
|
(reply-flags
|
|
|
|
(x-dnd-motif-value-to-list
|
|
|
|
(if reply-action
|
2005-02-09 15:50:47 +00:00
|
|
|
(+ reply-action
|
2004-02-10 17:27:26 +00:00
|
|
|
?\x30 ; 30: valid drop site
|
|
|
|
?\x700) ; 700: can do copy, move or link
|
|
|
|
(+ ?\x30 ; 30: drop site, but noop.
|
|
|
|
?\x200)) ; 200: drop cancel.
|
|
|
|
2 my-byteorder))
|
|
|
|
(reply (append
|
|
|
|
(list
|
|
|
|
(+ ?\x80 ; 0x80 indicates a reply.
|
|
|
|
5) ; DROP_START.
|
|
|
|
my-byteorder)
|
|
|
|
reply-flags
|
|
|
|
x
|
|
|
|
y))
|
2005-02-09 15:50:47 +00:00
|
|
|
(timestamp (x-dnd-get-motif-value
|
2004-02-10 17:27:26 +00:00
|
|
|
data 4 4 source-byteorder))
|
|
|
|
action)
|
|
|
|
|
|
|
|
(x-send-client-message frame
|
|
|
|
dnd-source
|
|
|
|
frame
|
|
|
|
"_MOTIF_DRAG_AND_DROP_MESSAGE"
|
|
|
|
8
|
|
|
|
reply)
|
2005-02-09 15:50:47 +00:00
|
|
|
(setq action
|
2004-02-10 17:27:26 +00:00
|
|
|
(when (and reply-action atom-name)
|
|
|
|
(let* ((value (x-get-selection-internal
|
|
|
|
(intern atom-name)
|
|
|
|
(intern (x-dnd-current-type window)))))
|
|
|
|
(when value
|
|
|
|
(condition-case info
|
2005-02-09 15:50:47 +00:00
|
|
|
(x-dnd-drop-data event frame window value
|
2004-02-10 17:27:26 +00:00
|
|
|
(x-dnd-current-type window))
|
|
|
|
(error
|
|
|
|
(message "Error: %s" info)
|
|
|
|
nil))))))
|
|
|
|
(x-get-selection-internal
|
2005-02-09 15:50:47 +00:00
|
|
|
(intern atom-name)
|
2004-02-10 17:27:26 +00:00
|
|
|
(if action 'XmTRANSFER_SUCCESS 'XmTRANSFER_FAILURE)
|
|
|
|
timestamp)
|
|
|
|
(x-dnd-forget-drop frame)))
|
|
|
|
|
2004-08-31 11:24:10 +00:00
|
|
|
(t (error "Unknown Motif DND message %s %s" message-atom data)))))
|
2005-02-09 15:50:47 +00:00
|
|
|
|
2004-02-10 17:27:26 +00:00
|
|
|
|
|
|
|
;;;
|
|
|
|
|
2004-02-03 16:55:30 +00:00
|
|
|
(provide 'x-dnd)
|
|
|
|
|
|
|
|
;;; x-dnd.el ends here
|