unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Emacs Bug Tracker <submit@emacsbugs.donarmstrong.com>
Subject: bug#10424: list-dynamic-libraries: show absolute filename of loaded libraries
Date: Tue, 3 Jan 2012 00:56:25 +0100	[thread overview]
Message-ID: <CAAeL0SQpvPSSxFyJbSEFCqBN4hTeuJr=uex7SNQ6Kb2OGjojPQ@mail.gmail.com> (raw)

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;
               }
           }





             reply	other threads:[~2012-01-02 23:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-02 23:56 Juanma Barranquero [this message]
2012-04-10 14:23 ` bug#10424: list-dynamic-libraries: show absolute filename of loaded libraries Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAeL0SQpvPSSxFyJbSEFCqBN4hTeuJr=uex7SNQ6Kb2OGjojPQ@mail.gmail.com' \
    --to=lekktu@gmail.com \
    --cc=submit@emacsbugs.donarmstrong.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).