X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/c71a0d48f3c880248a7f7f25e92ddbcbad5ef0e7..d0dc74a3a8bc59df3ca88810710d1234a9a08920:/lisp/misc.el diff --git a/lisp/misc.el b/lisp/misc.el index e50b5b38c7..5fc3e7d0fa 100644 --- a/lisp/misc.el +++ b/lisp/misc.el @@ -1,8 +1,8 @@ ;;; misc.el --- some nonstandard editing and utility commands for Emacs -;; Copyright (C) 1989, 2001-2011 Free Software Foundation, Inc. +;; Copyright (C) 1989, 2001-2016 Free Software Foundation, Inc. -;; Maintainer: FSF +;; Maintainer: emacs-devel@gnu.org ;; Keywords: convenience ;; Package: emacs @@ -99,14 +99,14 @@ Ignores CHAR at point." (defun forward-to-word (arg) "Move forward until encountering the beginning of a word. With argument, do this that many times." - (interactive "p") + (interactive "^p") (or (re-search-forward (if (> arg 0) "\\W\\b" "\\b\\W") nil t arg) (goto-char (if (> arg 0) (point-max) (point-min))))) (defun backward-to-word (arg) "Move backward until encountering the end of a word. With argument, do this that many times." - (interactive "p") + (interactive "^p") (forward-to-word (- arg))) ;;;###autoload @@ -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) ""))) + ;; 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." @@ -151,6 +164,7 @@ Internal use only." (vector (list "Library" (1+ max-id-len) t) (list "Loaded from" (1+ max-name-len) t) (list "Candidate names" 0 t)))) + (tabulated-list-init-header) (setq tabulated-list-entries nil) (dolist (lib dynamic-library-alist) (let* ((id (car lib)) @@ -158,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))))) @@ -178,7 +192,6 @@ The return value is always nil." (tabulated-list-mode) (setq tabulated-list-sort-key (cons "Library" nil)) (add-hook 'tabulated-list-revert-hook 'list-dynamic-libraries--refresh nil t) - (tabulated-list-init-header) (setq list-dynamic-libraries--loaded-only-p loaded-only-p) (list-dynamic-libraries--refresh) (tabulated-list-print))