[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#10424: list-dynamic-libraries: show absolute filename of loaded libr
From: |
Juanma Barranquero |
Subject: |
bug#10424: 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@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;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#10424: list-dynamic-libraries: show absolute filename of loaded libraries,
Juanma Barranquero <=