From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: feature request: indicator of minibuffer-recursion depth Date: Thu, 16 Mar 2006 11:46:20 +0900 Message-ID: References: <85mzfsk7qq.fsf@lola.goethe.zz> <85wtewf3oq.fsf@lola.goethe.zz> Reply-To: Miles Bader NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1142477223 30286 80.91.229.2 (16 Mar 2006 02:47:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Mar 2006 02:47:03 +0000 (UTC) Cc: Drew Adams , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 16 03:47:01 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FJiVo-0004PT-Pn for ged-emacs-devel@m.gmane.org; Thu, 16 Mar 2006 03:46:53 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FJiVo-0004VQ-AR for ged-emacs-devel@m.gmane.org; Wed, 15 Mar 2006 21:46:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FJiVV-0004Sb-65 for emacs-devel@gnu.org; Wed, 15 Mar 2006 21:46:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FJiVS-0004Op-RQ for emacs-devel@gnu.org; Wed, 15 Mar 2006 21:46:32 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FJiVS-0004Oh-Lu for emacs-devel@gnu.org; Wed, 15 Mar 2006 21:46:30 -0500 Original-Received: from [203.180.232.83] (helo=mgate03.necel.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FJiZt-0008LK-S6; Wed, 15 Mar 2006 21:51:06 -0500 Original-Received: from relay11.aps.necel.com (relay11 [10.29.19.46]) by mgate03.necel.com (8.13.1/8.13.1) with ESMTP id k2G28fSY001861; Thu, 16 Mar 2006 11:46:21 +0900 (JST) Original-Received: from relay11.aps.necel.com ([10.29.19.24] [10.29.19.24]) by relay11.aps.necel.com with ESMTP; Thu, 16 Mar 2006 11:46:21 +0900 Original-Received: from dhapc248.dev.necel.com ([10.114.97.235] [10.114.97.235]) by relay11.aps.necel.com with ESMTP; Thu, 16 Mar 2006 11:46:21 +0900 Original-Received: by dhapc248.dev.necel.com (Postfix, from userid 31295) id 4EDA73ED; Thu, 16 Mar 2006 11:46:21 +0900 (JST) Original-To: David Kastrup System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: (Miles Bader's message of "Wed, 15 Mar 2006 19:15:01 +0900") Original-Lines: 12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:51691 Archived-At: --=-=-= I wrote: > Certainly not unattainable, but probably rather fiddly. Ok, or maybe not: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=minibuf-depth.el Content-Description: minibuf-depth.el ;;; minibuf-depth.el --- Indicate minibuffer-depth in prompt ;; ;; Copyright (C) 2006 Free Software Foundation, Inc. ;; ;; Author: Miles Bader ;; Keywords: convenience ;; This file is part of GNU Emacs. ;; 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) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ;; Boston, MA 02110-1301, USA. ;;; Commentary: ;; ;; Defines the mode `minibuffer-indicate-depth-mode'. ;; ;; When active, any recursive use of the minibuffer will show ;; the recursion depth in the minibuffer prompt. This is only ;; useful if `enable-recursive-minibuffers' is non-nil. ;;; Code: ;; An overlay covering the prompt. This is a buffer-local variable in ;; each affected minibuffer. ;; (defvar minibuf-depth-overlay) (make-variable-buffer-local 'minibuf-depth-overlay) ;; This function goes on minibuffer-setup-hook (defun minibuf-depth-setup-minibuffer () "Set up a minibuffer for `minibuffer-indicate-depth-mode'. The prompt should already have been inserted." (when (> (minibuffer-depth) 1) (setq minibuf-depth-overlay (make-overlay (point-min) (1+ (point-min)))) (overlay-put minibuf-depth-overlay 'before-string (format "(minibuf-depth %d) " (minibuffer-depth))) (overlay-put minibuf-depth-overlay 'evaporate t))) (define-minor-mode minibuffer-indicate-depth-mode "Toggle Minibuffer Indicate Depth mode. When active, any recursive use of the minibuffer will show the recursion depth in the minibuffer prompt. This is only useful if `enable-recursive-minibuffers' is non-nil. With prefix argument ARG, turn on if positive, otherwise off. Returns non-nil if the new state is enabled." :global t :group 'minibuffer (if minibuffer-indicate-depth-mode ;; Enable the mode (add-hook 'minibuffer-setup-hook 'minibuf-depth-setup-minibuffer) ;; Disable the mode (remove-hook 'minibuffer-setup-hook 'minibuf-depth-setup-minibuffer))) (provide 'minibuf-depth) ;;; minibuf-depth.el ends here --=-=-= -miles -- "Though they may have different meanings, the cries of 'Yeeeee-haw!' and 'Allahu akbar!' are, in spirit, not actually all that different." --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--