GNU bug report logs - #10424
list-dynamic-libraries: show absolute filename of loaded libraries

Previous Next

Packages: w32, emacs;

Reported by: Juanma Barranquero <lekktu <at> gmail.com>

Date: Tue, 3 Jan 2012 00:01:01 UTC

Severity: wishlist

Tags: patch

Found in version 24.2

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10424 in the body.
You can then email your comments to 10424 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#10424; Package emacs,w32. (Tue, 03 Jan 2012 00:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juanma Barranquero <lekktu <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 03 Jan 2012 00:01:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Emacs Bug Tracker <submit <at> emacsbugs.donarmstrong.com>
Subject: list-dynamic-libraries: show absolute filename of loaded libraries
Date: Tue, 3 Jan 2012 00:56:25 +0100
Package: emacs,w32
Severity: wishlist
Version: 24.2
Tags: patch

A patch to make w32_delayed_load to record the absolute filename of
the library loaded, and list-dynamic-libraries to display it.


2012-01-02  Juanma Barranquero  <lekktu <at> gmail.com>

	* misc.el (list-dynamic-libraries): Display absolute filename.
	Suggested by Eli Zaretskii <eliz <at> gnu.org>.
	(list-dynamic-libraries--loaded): New function.
	(list-dynamic-libraries--refresh): Use it.


2012-01-02  Juanma Barranquero  <lekktu <at> gmail.com>

	* w32.c (w32_delayed_load): Record also the full path of the
	library being loaded.



=== modified file 'lisp/misc.el'
--- lisp/misc.el	2011-06-21 10:04:28 +0000
+++ lisp/misc.el	2012-01-02 23:02:50 +0000
@@ -138,6 +138,19 @@
 (defvar list-dynamic-libraries--loaded-only-p)
 (make-variable-buffer-local 'list-dynamic-libraries--loaded-only-p)

+(defun list-dynamic-libraries--loaded (from)
+  "Compute the \"Loaded from\" column.
+Internal use only."
+  (if from
+      (let ((name (car from))
+            (path (or (cdr from) "<unknown>")))
+        ;; This is a roundabout way to change the tooltip without
+        ;; having to replace the default printer function
+        (propertize name
+                    'display (propertize name
+                                         'help-echo (concat "Loaded
from: " path))))
+    ""))
+
 (defun list-dynamic-libraries--refresh ()
   "Recompute the list of dynamic libraries.
 Internal use only."
@@ -159,7 +172,7 @@
       (when (or from
                 (not list-dynamic-libraries--loaded-only-p))
         (push (list id (vector (symbol-name id)
-                               (or from "")
+                               (list-dynamic-libraries--loaded from)
                                (mapconcat 'identity (cdr lib) ", ")))
               tabulated-list-entries)))))


=== modified file 'src/w32.c'
--- src/w32.c	2011-12-07 23:14:13 +0000
+++ src/w32.c	2012-01-02 23:02:47 +0000
@@ -5783,7 +5783,15 @@
             CHECK_STRING_CAR (dlls);
             if ((library_dll = LoadLibrary (SDATA (XCAR (dlls)))))
               {
-                found = XCAR (dlls);
+                char name[MAX_PATH];
+                DWORD len;
+
+                len = GetModuleFileNameA (library_dll, name, sizeof (name));
+                found = Fcons (XCAR (dlls),
+                               (len > 0)
+                               /* Possibly truncated */
+                               ? make_specified_string (name, -1, len, 1)
+                               : Qnil);
                 break;
               }
           }




Reply sent to Juanma Barranquero <lekktu <at> gmail.com>:
You have taken responsibility. (Tue, 10 Apr 2012 14:26:02 GMT) Full text and rfc822 format available.

Notification sent to Juanma Barranquero <lekktu <at> gmail.com>:
bug acknowledged by developer. (Tue, 10 Apr 2012 14:26:02 GMT) Full text and rfc822 format available.

Message #10 received at 10424-done <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: 10424-done <at> debbugs.gnu.org
Cc: Chong Yidong <cyd <at> gnu.org>
Subject: Re: bug#10424: list-dynamic-libraries: show absolute filename of
	loaded libraries
Date: Tue, 10 Apr 2012 16:23:44 +0200
> A patch to make w32_delayed_load to record the absolute filename of
> the library loaded, and list-dynamic-libraries to display it.

Committed as revno:107841.

Still, this

> +        ;; This is a roundabout way to change the tooltip without
> +        ;; having to replace the default printer function
> +        (propertize name
> +                    'display (propertize name
> +                                         'help-echo (concat "Loaded  from: " path))))

suggests that tabulated-list-mode would perhaps benefit from some
additional customization facilities.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 09 May 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 362 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.