summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2012-04-10 16:16:05 +0200
committerJuanma Barranquero <lekktu@gmail.com>2012-04-10 16:16:05 +0200
commit2a8ce227d040e564ea6e7b4aecf1dcad5ca6e9c7 (patch)
treea522ea953610f470909f0dff44cdf94c1dc81d71
parent8f33b5f8734810e2feb0036bd9b0b34f51f7bc17 (diff)
downloademacs-2a8ce227d040e564ea6e7b4aecf1dcad5ca6e9c7.tar.gz
Record and display absolute path of DLLs loaded (bug#10424).
* lisp/misc.el (list-dynamic-libraries--loaded): New function. (list-dynamic-libraries--refresh): Use it. * src/w32.c (w32_delayed_load): Record the full path of the library being loaded.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/misc.el15
-rw-r--r--src/ChangeLog5
-rw-r--r--src/w32.c10
4 files changed, 34 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fee5e34942c..9d019be9796 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2012-04-10 Juanma Barranquero <lekktu@gmail.com>
+
+ * misc.el: Display absolute path of loaded DLLs (bug#10424).
+ (list-dynamic-libraries--loaded): New function.
+ (list-dynamic-libraries--refresh): Use it.
+
2012-04-10 Nathan Weizenbaum <nweiz@google.com>
* progmodes/python.el (python-fill-paragraph): Make
diff --git a/lisp/misc.el b/lisp/misc.el
index 4706c918db3..cb52ecbd36e 100644
--- a/lisp/misc.el
+++ b/lisp/misc.el
@@ -138,6 +138,19 @@ variation of `C-x M-c M-butterfly' from url `http://xkcd.com/378/'."
(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 @@ Internal use only."
(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)))))
diff --git a/src/ChangeLog b/src/ChangeLog
index 18a3d4545e3..76a8353b853 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2012-04-10 Juanma Barranquero <lekktu@gmail.com>
+
+ * w32.c (w32_delayed_load): Record the full path of the library
+ being loaded (bug#10424).
+
2012-04-09 Glenn Morris <rgm@gnu.org>
* doc.c (Fsnarf_documentation): Check variables, functions are bound,
diff --git a/src/w32.c b/src/w32.c
index 3d3d33453c6..248a91463e8 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -5816,7 +5816,15 @@ w32_delayed_load (Lisp_Object libraries, Lisp_Object library_id)
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;
}
}