X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/bffa514a8b8c947c655b463e8073e8e5ac061bc7..56b3f3fe705e27cf2e15200f9ca8e8bbee5603e4:/lisp/rfn-eshadow.el diff --git a/lisp/rfn-eshadow.el b/lisp/rfn-eshadow.el index a9f55ced0e..cd8ea60c64 100644 --- a/lisp/rfn-eshadow.el +++ b/lisp/rfn-eshadow.el @@ -1,7 +1,7 @@ ;;; rfn-eshadow.el --- Highlight `shadowed' part of read-file-name input text ;; ;; Copyright (C) 2000, 2001, 2002, 2003, 2004, -;; 2005 Free Software Foundation, Inc. +;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. ;; ;; Author: Miles Bader ;; Keywords: convenience minibuffer @@ -10,7 +10,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -106,8 +106,8 @@ If Emacs is not running under a window system, (defcustom file-name-shadow-tty-properties '(before-string "{" after-string "} " field shadow) "Properties given to the `shadowed' part of a filename in the minibuffer. -Only used when `file-name-shadow-mode' is active and emacs -is not running under a window-system; if emacs is running under a window +Only used when `file-name-shadow-mode' is active and Emacs +is not running under a window-system; if Emacs is running under a window system, `file-name-shadow-properties' is used instead." :type file-name-shadow-properties-custom-type :group 'minibuffer @@ -119,6 +119,12 @@ system, `file-name-shadow-properties' is used instead." :group 'minibuffer :version "22.1") +(defvar rfn-eshadow-setup-minibuffer-hook nil + "Minibuffer setup functions from other packages.") + +(defvar rfn-eshadow-update-overlay-hook nil + "Customer overlay functions from other packages") + ;;; Internal variables @@ -153,7 +159,9 @@ The prompt and initial input should already have been inserted." (overlay-put rfn-eshadow-overlay 'evaporate t) ;; Add our post-command hook, and make sure can remove it later. (add-to-list 'rfn-eshadow-frobbed-minibufs (current-buffer)) - (add-hook 'post-command-hook #'rfn-eshadow-update-overlay nil t))) + (add-hook 'post-command-hook #'rfn-eshadow-update-overlay nil t) + ;; Run custom hook + (run-hooks 'rfn-eshadow-setup-minibuffer-hook))) (defsubst rfn-eshadow-sifn-equal (goal pos) (equal goal (condition-case nil @@ -193,7 +201,9 @@ been set up by `rfn-eshadow-setup-minibuffer'." (if (rfn-eshadow-sifn-equal goal mid) (setq start mid) (setq end mid))) - (move-overlay rfn-eshadow-overlay (minibuffer-prompt-end) start))) + (move-overlay rfn-eshadow-overlay (minibuffer-prompt-end) start)) + ;; Run custom hook + (run-hooks 'rfn-eshadow-update-overlay-hook)) ;; `substitute-in-file-name' can fail on partial input. (error nil)))