X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/fec99105e2cb5ff47aa3c71c55eda771dc9c5eb2..56b3f3fe705e27cf2e15200f9ca8e8bbee5603e4:/lisp/rfn-eshadow.el diff --git a/lisp/rfn-eshadow.el b/lisp/rfn-eshadow.el index 6798b0f873..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, 2006, 2007 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, @@ -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)))