unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10424: list-dynamic-libraries: show absolute filename of loaded libraries
@ 2012-01-02 23:56 Juanma Barranquero
  2012-04-10 14:23 ` Juanma Barranquero
  0 siblings, 1 reply; 2+ messages in thread
From: Juanma Barranquero @ 2012-01-02 23:56 UTC (permalink / raw)
  To: Emacs Bug Tracker

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@gmail.com>

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


2012-01-02  Juanma Barranquero  <lekktu@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;
               }
           }





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#10424: list-dynamic-libraries: show absolute filename of loaded libraries
  2012-01-02 23:56 bug#10424: list-dynamic-libraries: show absolute filename of loaded libraries Juanma Barranquero
@ 2012-04-10 14:23 ` Juanma Barranquero
  0 siblings, 0 replies; 2+ messages in thread
From: Juanma Barranquero @ 2012-04-10 14:23 UTC (permalink / raw)
  To: 10424-done; +Cc: Chong Yidong

> 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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-10 14:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-02 23:56 bug#10424: list-dynamic-libraries: show absolute filename of loaded libraries Juanma Barranquero
2012-04-10 14:23 ` Juanma Barranquero

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).