Subject: bug#72003: 29.3; Drag and drop in Emacs 29 on macOS

From: Giah de Barag <[email-masked]>
Date: Mon, 8 Jul 2024 18:32:02 -0400

* SUMMARY

Drag and drop does not work in Emacs version 29 on macOS.

* DESCRIPTION

- Drag and drop does NOT work on Emacs 29 on macOS. (Drag
  and drop DOES work in Emacs < 28. Upgrading to v29 makes
  drag and drop stop working.)

- If we do M-x describe-key then drag and drop a file on the
  text area of the window, we get
  - nothing -- in Emacs 29
  - a spurious message -- in Emacs 28
  - a normal message -- in Emacs 26

* USE CASE 1

- App: Emacs 29.x
  1. emacs -Q
  2. drag and drop a file from macOS Finder to Emacs

** EXPECTED BEHAVIOR

  3. file should open in Emacs

** ACTUAL BEHAVIOR

  3. NOTHING HAPPENS

  |-------+---------------------|
  | Emacs | Drag-n-Drop         |
  |-------+---------------------|
  |  29.3 | NOTHING HAPPENS     |
  |  28.2 | drag-and-drop works |
  |  26.3 | drag-and-drop works |
  |-------+---------------------|

* USE CASE 2

  1. M-x describe-key
  2. Drag and drop a file from Finder to Emacs

** EXPECTED BEHAVIOR

  3. should receive an informative message like
     “<drag-n-drop> ... runs ... ns-drag-n-drop ...”

** ACTUAL BEHAVIOR

  3. Results below. Regarding v28, even though drag-and-drop
     itself works fine in v28, we get this spurious
     “position not in text area” message. It is spurious
     because we indeed drag and drop the file into the text
     area.

  |-------+---------------------------------------------|
  | Emacs | ACTUAL BEHAVIOR                             |
  |-------+---------------------------------------------|
  |  26.3 | “<drag-n-drop> ... runs ... ns-drag-n-drop” |
  |  28.2 | “Position not in text area of window”       |
  |  29.3 | NOTHING HAPPENS                             |
  |-------+---------------------------------------------|

--
In GNU Emacs 29.3 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60
Version 10.14.6 (Build 18G9323)) of 2024-03-24 built on
builder10-14.lan
Windowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.7.5

Configured using:
'configure --with-ns '--enable-locallisppath=/Library/Application
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp' --with-modules 'CFLAGS=-DFD_SETSIZE=10000
-DDARWIN_UNLIMITED_SELECT' --with-x-toolkit=no'

Configured features:
ACL GLIB GMP GNUTLS JPEG JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER
PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER ZLIB

Important settings:
value of $LC_ALL: en_US.UTF-8
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix

Major mode: Org

Minor modes in effect:
ruler-mode: t
windmove-mode: t
moom-mode: t
display-time-mode: t
electric-pair-mode: t
global-auto-revert-mode: t
delete-selection-mode: t
adaptive-wrap-prefix-mode: t
smart-quotes-mode: t
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
size-indication-mode: t
column-number-mode: t
line-number-mode: t
global-visual-line-mode: t
visual-line-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t

Load-path shadows:
/Applications/Emacs.app/Contents/Resources/lisp/progmodes/csharp-mode hides /Volumes/Data/Share/Users/Telfeyan/roland/.emacs.d/lisp/csharp-mode/csharp-mode

Features:
(macros misearch multi-isearch ruler-mode mhtml-mode css-mode smie color
js c-ts-common treesit imenu cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs sgml-mode facemenu ox-odt
rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse
nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar org-agenda
ox-html table ox-ascii ox-publish ox shortdoc help-fns radix-tree
dired-aux display-line-numbers vc-git diff-mode vc-dispatcher vc-svn
org-element org-persist org-id org-refile avl-tree generator oc-basic
ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus
nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig
gnus-sum shr pixel-fill kinsoku url-file svg dom browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util url-parse auth-source eieio
eieio-core json map url-vars gnus-group gnus-undo gnus-start gnus-dbus
dbus xml gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time
gnus-spec gnus-int gnus-range gnus-win gnus nnheader range ol-docview
doc-view jka-compr image-mode exif ol-bibtex bibtex iso8601 ol-bbdb
ol-w3m ol-doi org-link-doi org ob ob-tangle ob-ref ob-lob ob-table
ob-exp org-macro org-src ob-comint org-pcomplete pcomplete comint
ansi-osc ansi-color ring org-list org-footnote org-faces org-entities
noutline outline ob-emacs-lisp ob-core ob-eval org-cycle org-table ol
org-fold org-fold-core org-keys oc org-loaddefs find-func cal-menu
calendar cal-loaddefs org-version org-compat org-macs format-spec
windmove thingatpt shadow sort mail-extr emacsbug message mailcap
yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache
epa derived epg rfc6068 epg-config gnus-util text-property-search
time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils rx kmacro moom moom-font server cus-edit
pp cus-load icons wid-edit wheatgrass-theme sqlite-mode time elec-pair
autorevert filenotify delsel byte-opt aggressive-indent lisp-mnt cl-macs
cl-extra help-mode cl-seq use-package-core bytecomp byte-compile
adaptive-wrap smart-quotes autopair advice cl-loaddefs cl-lib
sync-window easy-mmode gv pcase rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads kqueue cocoa ns multi-tty
make-network-process emacs)

Memory information:
((conses 16 338938 56281)
(symbols 48 29248 4)
(strings 32 106691 6366)
(string-bytes 1 3439476)
(vectors 16 60208)
(vector-slots 8 1414280 148312)
(floats 8 482 287)
(intervals 56 6438 1265)
(buffers 984 16))