From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 24 21:13:56 2014 Received: (at submit) by debbugs.gnu.org; 25 Apr 2014 01:13:57 +0000 Received: from localhost ([127.0.0.1]:57588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WdUiB-0003SB-Tv for submit@debbugs.gnu.org; Thu, 24 Apr 2014 21:13:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53486) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WdUi9-0003S0-An for submit@debbugs.gnu.org; Thu, 24 Apr 2014 21:13:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WdUh9-0001Gy-38 for submit@debbugs.gnu.org; Thu, 24 Apr 2014 21:13:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:38133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdUh8-0001Gp-Vc for submit@debbugs.gnu.org; Thu, 24 Apr 2014 21:12:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdUgQ-0000UI-9g for bug-gnu-emacs@gnu.org; Thu, 24 Apr 2014 21:12:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WdM9I-0007g3-VK for bug-gnu-emacs@gnu.org; Thu, 24 Apr 2014 12:05:30 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:20223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdM9I-0007fK-Lk for bug-gnu-emacs@gnu.org; Thu, 24 Apr 2014 12:05:20 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s3OG5IL4009161 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 24 Apr 2014 16:05:19 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s3OG5HL0011388 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 24 Apr 2014 16:05:18 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s3OG5H5b020985 for ; Thu, 24 Apr 2014 16:05:17 GMT MIME-Version: 1.0 Message-ID: <6fff687a-bdb0-45a3-8994-552d677e24f4@default> Date: Thu, 24 Apr 2014 09:05:17 -0700 (PDT) From: Drew Adams To: bug-gnu-emacs@gnu.org Subject: 24.4.50; function value for `help-echo': mouseover & frame X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) emacs -Q 1. Set things up so that image-dired can work. On Windows, I load library cygwin-mount.el and then setup-cygwin.el (both on Emacs Wiki). 2. Evaluate this code. It makes it so that a mouseover on an image file name in Dired shows a thumbnail of the image in a tooltip. (require 'image-dired) (tooltip-mode 1) ;; Like `image-dired-create-thumb', but single file & returns thumbnail. (defun diredp-image-dired-create-thumb (&optional arg) "Create thumbnail image file for this file. With a prefix arg, replace any existing thumbnail for the file. Return the name of the thumbnail image file, or nil if none." (interactive "P") (let* ((curr-file (dired-get-filename)) (thumb-name (image-dired-thumb-name curr-file))) (when arg (clear-image-cache)) (when (or arg (not (file-exists-p thumb-name))) (unless (zerop (image-dired-create-thumb curr-file (image-dired-thumb-name curr-file))) (error "Thumbnail image file could not be created"))) (and (file-exists-p thumb-name) thumb-name))) ;; REPLACE ORIGINAL in `dired.el'. ;; 1. Put `mouse-face' on whole line, not just file name. ;; 2. Add text property `dired-filename' to only the file name. ;; 3. Show image-file preview on mouseover, if `tooltip-mode'. ;; ;; #3 is what is important for this bug report. ;; (defun dired-insert-set-properties (beg end) "Add various text properties to the lines in the region. Highlight entire line upon mouseover. Add text property `dired-filename' to the file name. Handle `dired-hide-details-mode' invisibility spec (Emacs 24.4+)." (let ((inhibit-field-text-motion t)) ; Just in case. (save-excursion (goto-char beg) (while (< (point) end) (condition-case nil (cond ((dired-move-to-filename) (add-text-properties (line-beginning-position) (line-end-position) '(mouse-face highlight help-echo diredp-mouseover-help)) ; <=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D (put-text-property (point) (save-excursion (dired-move-to-end-of-filename) (point)) 'dired-filename t) (put-text-property (+ (line-beginning-position) 1) (1- (point)) 'invisible 'dired-hide-details-detail) (dired-move-to-end-of-filename) (when (< (+ (point) 4) (line-end-position)) (put-text-property (+ (point) 4) (line-end-position) 'invisible 'dired-hide-details-link))) (t (unless (or (looking-at-p "^$") (looking-at-p dired-subdir-regexp)) (put-text-property (line-beginning-position) (1+ (line-end-position)) 'invisible 'dired-hide-details-information)))) (error nil)) (forward-line 1))))) (defun diredp-mouseover-help (window buffer pos) "`help-echo' function for Dired." (let (file) (if (and tooltip-mode (with-selected-frame (window-frame window) ;; (with-selected-window window ;; (select-frame-set-input-focus (window-frame window)) (with-current-buffer buffer (goto-char pos) (string-match-p (image-file-name-regexp) (setq file (dired-get-filename nil 'NO-ERROR)))))) (let ((img-file (diredp-image-dired-create-thumb file))) (propertize " " 'display (create-image img-file))) "mouse-2: visit this file in another window"))) 3. `C-x 5 b *Messages*', so you can see redisplay error messages. 4. `C-x 5 d' to a directory that has some image files. Move the mouse over these file names. No problem: a thumbnail tooltip is shown for each file you mouseover. 5. `C-x 5 o', to select another frame, or just click another frame's title bar. This takes input focus away from the Dired frame. 6. Now mouseover the same files in the Dired frame, without first clicking its title bar or otherwise selecting it (giving it focus). You will see *lots* of error messages such as this in buffer *Messages*: Error during redisplay: (diredp-mouseover-help # # 426) signaled (error "No file on this line") (The code could be wrapped in `ignore-errors', but that's not the point here.) 7. The `help-echo' function is correctly passed the WINDOW, BUFFER, and POSition. The problem seems to be that (a) mouseover is active, even though the frame is not selected (for some meaning of selected, probably including focus), and (b) when the `help-echo' function is invoked, the frame is not selected/focused, or the wrong buffer is used somehow (?). IOW, mouseover is activated and passed the correct WINDOW, BUFFER, and POSition, but the code above is apparently not sufficient to make Emacs actually use these arguments as I would expect it to. 8. I tried wrapping the `with-current-buffer' with `(with-selected-window WINDOW...)'. That didn't help. I tried wrapping it with `(with-selected-frame (window-frame WINDOW)...' (as shown above). That didn't help. I tried `(select-frame-set-input-focus (window-frame WINDOW))', but that didn't help either. Am I missing something? Should I add something else here, to make the mouseover use WINDOW and BUFFER as I have been expecting? Or is it a bug that mouseover is active at all when the frame is not selected? FWIW: Other Window apps seem to behave the same way wrt focus and mouseover: mouseover is active even if the "frame" is not selected for input focus (e.g., by clicking its title bar). So I don't imagine that Emacs is doing anything wrong in that regard. I cannot tell whether I am seeing a bug or I'm just missing knowing the proper code to use to get the `help-echo' function to temporarily make the WINDOW and BUFFER and WINDOW's frame current/selected/focused. A guess would be that I need to give the frame the input focus (temporarily), but using `select-frame-set-input-focus' did not seem to help. In GNU Emacs 24.4.50.1 (i686-pc-mingw32) of 2014-04-21 on ODIEONE Bzr revision: 117005 dancol@dancol.org-20140421180019-po4wdeg7gqvvlh5d Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D/c/Devel/emacs/snapshot/trunk --enable-checking=3Dyes,glyphs 'CFLAGS=3D-O0 -g3' LDFLAGS=3D-Lc:/Devel/emacs/lib 'CPPFLAGS=3D-DGC_MCHECK=3D1 -Ic:/Devel/emacs/include'' From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 24 22:08:27 2014 Received: (at control) by debbugs.gnu.org; 25 Apr 2014 02:08:28 +0000 Received: from localhost ([127.0.0.1]:57699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WdVYx-00059I-GU for submit@debbugs.gnu.org; Thu, 24 Apr 2014 22:08:27 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:18468) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WdVYu-000599-NT for control@debbugs.gnu.org; Thu, 24 Apr 2014 22:08:25 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s3P28MZS027187 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 25 Apr 2014 02:08:23 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s3P28KHm000458 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 25 Apr 2014 02:08:21 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s3P28Ku8006071 for ; Fri, 25 Apr 2014 02:08:20 GMT MIME-Version: 1.0 Message-ID: Date: Thu, 24 Apr 2014 19:08:20 -0700 (PDT) From: Drew Adams To: control@debbugs.gnu.org Subject: close 17335 X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.0 (---) close 17335 thanks From unknown Sun Aug 10 07:32:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 23 May 2014 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator