From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dalanicolai@gmail.com Newsgroups: gmane.emacs.bugs Subject: bug#49571: 27.2; many posn event functions return wrong result Date: Thu, 15 Jul 2021 12:31:08 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40297"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.40.3 (3.40.3-1.fc34) To: 49571@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 15 12:32:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3yf4-000AHx-Vg for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Jul 2021 12:32:11 +0200 Original-Received: from localhost ([::1]:46640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3yf2-0007MC-T8 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Jul 2021 06:32:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3yex-0007M4-0l for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2021 06:32:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35361) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3yew-0005YF-PM for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2021 06:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m3yew-0001Ge-JA for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2021 06:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: dalanicolai@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Jul 2021 10:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49571 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16263450784811 (code B ref -1); Thu, 15 Jul 2021 10:32:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Jul 2021 10:31:18 +0000 Original-Received: from localhost ([127.0.0.1]:46907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3yeE-0001FW-Cb for submit@debbugs.gnu.org; Thu, 15 Jul 2021 06:31:18 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3yeC-0001FO-54 for submit@debbugs.gnu.org; Thu, 15 Jul 2021 06:31:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3yeB-0007Il-SC for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2021 06:31:15 -0400 Original-Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]:37762) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3ye8-0004wy-Qu for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2021 06:31:15 -0400 Original-Received: by mail-ej1-x636.google.com with SMTP id hc15so8478767ejc.4 for ; Thu, 15 Jul 2021 03:31:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:user-agent:mime-version :content-transfer-encoding; bh=O2h1E3YzFRMvunP3DAdWwFg7ZvV5iNY0BL4NcfPYxKA=; b=oUyIG407q/JxBvGzisfchzLk8yC2LwxyODt0uO0EACqfcWnx8slLbM8jJ5b2FnNegc uDLjqsExkbXdrptLt2mrIWd6H85eBwgIhtFS0zeQ5Qu8RltiIdwC04C8v9Imq5AM+f7D hsVQ6HkMBUh+rLx/KEGobJ1JagaeDY5f649JGri7rHISY/6lgJhAxdI+WoG8KBY3owW5 vJbfcBz/S7yBzH5lBZH0tKcpAjdb3jhrohq3bC5kWL699bFZQXY9EWhD5Te6Xxezzqb8 l/tDKjoRrSMw0owO5ZEeW2lSYks5zbhFOmCmSOO3tCIPov6Vu4ph1YEsA5Eou1fONjhj B+KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:user-agent :mime-version:content-transfer-encoding; bh=O2h1E3YzFRMvunP3DAdWwFg7ZvV5iNY0BL4NcfPYxKA=; b=MgoFsL6g54tGAM/UrilcyH+CjuCJvm5QKUd+cLuCNTQt53PwuCG0ENOSXHe15lrfKn Td6Yu30QQ6QsejD+18jIdzd6de4htY7TTMwG3d6Ut+PowddnQCRIi2MBMK7QMwsFfy3f XjficKx3XVagTsRwb9xIdhP/+P0y6EKCNzdnFQLMDqdK3kXx9YH6/UFufkiPe+WciB4+ uXylBgJ9pSfbsI3te1U28u/DkgvS4ZGt2OWWsRnhrwBvxvrDtKJFkch0KxxOT2YWZgnh J7BxvKmE4+Cp4eR0ZyIignTJbg+YZ93/s6Tcz5+bCzvjYCFxdc/QqRt1mGdvMD9+nHtC 15bA== X-Gm-Message-State: AOAM533DufKU0jGZGvQZ+XXj5ccwqIvPkXVe5Dyl1vUAlKsYVi6vfKzV 6qyiitjEHCGPG2gRTVo3i8oRLD1jI3tFdA== X-Google-Smtp-Source: ABdhPJyEWazQBbmqbI9UQZBd0VxFclWnGtV6dXu7QqUAJ5be4BkqYRusA7beGtugtfvuPo65xpbV0g== X-Received: by 2002:a17:906:4886:: with SMTP id v6mr4745214ejq.45.1626345069696; Thu, 15 Jul 2021 03:31:09 -0700 (PDT) Original-Received: from [192.168.3.11] (86-90-107-231.fixed.kpn.net. [86.90.107.231]) by smtp.gmail.com with ESMTPSA id q11sm2188203eds.60.2021.07.15.03.31.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 03:31:09 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=dalanicolai@gmail.com; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:210024 Archived-At: - Start emacs (emacs -Q) - load the following code (require 'svg) (define-minor-mode svg-draw-mode   "Draw svg images using the mouse."   nil "svg-draw-mode"   '(([drag-mouse-1] . test))) (defun svg-create-canvas (width height)   "Create canvas for drawing svg using the mouse."   (interactive "nEnter width: \nnEnter height")   (defvar svg)   (insert-image (let ((width 800)                       (height 200))                   (setq svg (svg-create width height :stroke "black"))                   (svg-rectangle svg 0 0 width height :fill "white")                   (svg-image svg)))   (svg-draw-mode)) (defun test (event)   (interactive "e")   ;; (print (format "event-start %s\n" (event-start event)))   ;; (print (format "event-end %s\n" (event-end event)))   ;; (print (format "posn-window %s\n" (posn-window event)))   ;; (print (format "posn-area %s\n" (posn-area event)))   ;; (print (format "posn-point %s\n" (posn-point event)))   ;; (print (format "posn-x-y %s\n" (posn-x-y event)))   ;; (print (format "posn-string %s\n" (posn-string event)))   (print (format "posn-image %s\n" (posn-image event)))) - Create a "svg canvas" using `M-x svg-create-canvas` (enter a width and a height) - Finally click and drag (mouse-1) within the image. I have included a list of print statements that can be commented in/out to check the different values. Most of them return wrong values (e.g. posn-image returns nil while it should return an image object. posn-point returns a window while it should return a point etc.) I have actually tried this in Emacs 27.2 and 28.0.50 In GNU Emacs 27.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.29, cairo version 1.17.4)  of 2021-06-13 built on buildvm-x86-32.iad2.fedoraproject.org Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Fedora 34 (Workstation Edition) Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... Loading /home/dalanicolai/Sync/org/svg/svg-draw-mode.el (source)...done "posn-image nil " Making completion list... user-error: End of history; no default available Configured using:  'configure --build=x86_64-redhat-linux-gnu  --host=x86_64-redhat-linux-gnu --program-prefix=  --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr  --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc  --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64  --libexecdir=/usr/libexec --localstatedir=/var  --sharedstatedir=/var/lib --mandir=/usr/share/man  --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with- png  --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3  --with-gpm=no --with-xwidgets --with-modules --with-harfbuzz  --with-cairo --with-json build_alias=x86_64-redhat-linux-gnu  host_alias=x86_64-redhat-linux-gnu CC=gcc 'CFLAGS=-DMAIL_USE_LOCKF -O2  -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches  -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2  -Wp,-D_GLIBCXX_ASSERTIONS  -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector- strong  -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic  -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'  LDFLAGS=-Wl,-z,relro  PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LIBSYSTEMD JSON PDUMPER GMP Important settings:   value of $LANG: en_US.UTF-8   value of $XMODIFIERS: @im=none   locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect:   svg-draw-mode: t   tooltip-mode: t   global-eldoc-mode: t   eldoc-mode: t   electric-indent-mode: t   mouse-wheel-mode: t   tool-bar-mode: t   menu-bar-mode: t   file-name-shadow-mode: t   global-font-lock-mode: t   font-lock-mode: t   blink-cursor-mode: t   auto-composition-mode: t   auto-encryption-mode: t   auto-compression-mode: t   line-number-mode: t   transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time- date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils thingatpt easy-mmode svg dom xml cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic 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 charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print- readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting xwidget-internal cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 46476 9688)  (symbols 48 6283 1)  (strings 32 16422 2178)  (string-bytes 1 535143)  (vectors 16 9620)  (vector-slots 8 129204 10370)  (floats 8 20 39)  (intervals 56 275 0)  (buffers 1000 12))