Mercurial > emacs
annotate lisp/mb-depth.el @ 96303:ddedcecb18ef
* unexnext.c:
* m/ews4800.h:
* m/hp9000s300.h:
* m/ibm370aix.h:
* m/mips-siemens.h:
* m/ncr386.h:
* m/next.h:
* m/pmax.h:
* m/powerpcle.h:
* m/tandem-s2.h:
* s/386bsd.h:
* s/bsd386.h:
* s/bsd4-1.h:
* s/bsd4-2.h:
* s/bsdos2-1.h:
* s/bsdos2.h:
* s/bsdos3.h:
* s/bsdos4.h:
* s/nextstep.h:
* s/ultrix4-3.h:
* s/usg5-0.h:
* s/usg5-2-2.h:
* s/usg5-2.h:
* s/usg5-4-3.h:
* s/ux4800.h:
* s/uxpds.h:
* s/uxpv.h: Remove support for obsolete systems.
* s/hpux.h, s/hpux10.h, s/hpux8.h, s/hpux9.h, s/hpux9shr.h:
Remove, insert contents in s/hpux-10.20.h
* s/aix3-1.h, s/aix3-2-5.h, s/aix3-2.h, s/aix4-1.h, s/aix4.h:
Remove, insert contents in s/aix-4.2.h
* s/usg5-3.h: Remove, insert contents in s/usg5-4.h.
* s/bsd4-3.h: Rename to ..
* s/bsd-common.h: ... this.
* src/data.c:
* src/doc.c:
* src/ecrt0.c:
* src/emacs.c:
* src/fileio.c:
* src/floatfns.c:
* src/keyboard.c:
* src/mem-limits.h:
* src/print.c:
* src/process.c:
* src/sysdep.c:
* src/syssignal.h:
* src/systty.h:
* src/syswait.h:
* src/term.c:
* src/unexec.c:
* src/unexelf.c:
* src/unexhp9k800.c:
* src/m/hp800.h:
* src/m/ibmrs6000.h:
* src/m/mips.h:
* src/m/vax.h:
* src/s/darwin.h:
* src/s/freebsd.h:
* src/s/gnu.h:
* src/s/ms-w32.h:
* src/s/msdos.h:
* src/s/netbsd.h:
* src/s/template.h: Remove references to obsolete variables.
* Makefile.in: Add dependencies for all unexec files.
(admindir): Remove unused variable.
(UNEXEC_SRC): Remove references.
* config.nt: Remove reference to UNEXEC_SRC.
* lwlib.c: Remove references to obsolete variables.
* fakemail.c: Remove references to obsolete variables.
* os.texi: Remove references to obsolete systems.
* configure.in:
* configure: Remove references to obsolete systems.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Thu, 26 Jun 2008 04:24:54 +0000 |
parents | ee5932bf781d |
children | 5e1a3afd2217 |
rev | line source |
---|---|
81441 | 1 ;;; mb-depth.el --- Indicate minibuffer-depth in prompt |
2 ;; | |
87665 | 3 ;; Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. |
81441 | 4 ;; |
5 ;; Author: Miles Bader <miles@gnu.org> | |
6 ;; Keywords: convenience | |
7 | |
8 ;; This file is part of GNU Emacs. | |
9 | |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87665
diff
changeset
|
10 ;; GNU Emacs is free software: you can redistribute it and/or modify |
81441 | 11 ;; it under the terms of the GNU General Public License as published by |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87665
diff
changeset
|
12 ;; the Free Software Foundation, either version 3 of the License, or |
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87665
diff
changeset
|
13 ;; (at your option) any later version. |
81441 | 14 |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87665
diff
changeset
|
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
81441 | 22 |
23 ;;; Commentary: | |
24 ;; | |
25 ;; Defines the minor mode `minibuffer-indicate-depth-mode'. | |
26 ;; | |
27 ;; When active, any recursive use of the minibuffer will show | |
28 ;; the recursion depth in the minibuffer prompt. This is only | |
29 ;; useful if `enable-recursive-minibuffers' is non-nil. | |
30 | |
31 ;;; Code: | |
32 | |
85085
20e6cbaf918a
(minibuf-depth-indicator-function): New variable.
Juanma Barranquero <lekktu@gmail.com>
parents:
82160
diff
changeset
|
33 (defvar minibuf-depth-indicator-function nil |
20e6cbaf918a
(minibuf-depth-indicator-function): New variable.
Juanma Barranquero <lekktu@gmail.com>
parents:
82160
diff
changeset
|
34 "If non-nil, function to set up the minibuffer depth indicator. |
20e6cbaf918a
(minibuf-depth-indicator-function): New variable.
Juanma Barranquero <lekktu@gmail.com>
parents:
82160
diff
changeset
|
35 It is called with one argument, the minibuffer depth, |
20e6cbaf918a
(minibuf-depth-indicator-function): New variable.
Juanma Barranquero <lekktu@gmail.com>
parents:
82160
diff
changeset
|
36 and must return a string.") |
20e6cbaf918a
(minibuf-depth-indicator-function): New variable.
Juanma Barranquero <lekktu@gmail.com>
parents:
82160
diff
changeset
|
37 |
81441 | 38 ;; An overlay covering the prompt. This is a buffer-local variable in |
39 ;; each affected minibuffer. | |
40 ;; | |
41 (defvar minibuf-depth-overlay) | |
42 (make-variable-buffer-local 'minibuf-depth-overlay) | |
43 | |
44 ;; This function goes on minibuffer-setup-hook | |
45 (defun minibuf-depth-setup-minibuffer () | |
46 "Set up a minibuffer for `minibuffer-indicate-depth-mode'. | |
47 The prompt should already have been inserted." | |
48 (when (> (minibuffer-depth) 1) | |
49 (setq minibuf-depth-overlay (make-overlay (point-min) (1+ (point-min)))) | |
50 (overlay-put minibuf-depth-overlay 'before-string | |
85085
20e6cbaf918a
(minibuf-depth-indicator-function): New variable.
Juanma Barranquero <lekktu@gmail.com>
parents:
82160
diff
changeset
|
51 (if minibuf-depth-indicator-function |
20e6cbaf918a
(minibuf-depth-indicator-function): New variable.
Juanma Barranquero <lekktu@gmail.com>
parents:
82160
diff
changeset
|
52 (funcall minibuf-depth-indicator-function (minibuffer-depth)) |
20e6cbaf918a
(minibuf-depth-indicator-function): New variable.
Juanma Barranquero <lekktu@gmail.com>
parents:
82160
diff
changeset
|
53 (propertize (format "[%d]" (minibuffer-depth)) 'face 'highlight))) |
81441 | 54 (overlay-put minibuf-depth-overlay 'evaporate t))) |
55 | |
56 ;;;###autoload | |
57 (define-minor-mode minibuffer-indicate-depth-mode | |
58 "Toggle Minibuffer Indicate Depth mode. | |
59 When active, any recursive use of the minibuffer will show | |
60 the recursion depth in the minibuffer prompt. This is only | |
61 useful if `enable-recursive-minibuffers' is non-nil. | |
62 | |
63 With prefix argument ARG, turn on if positive, otherwise off. | |
64 Returns non-nil if the new state is enabled." | |
65 :global t | |
66 :group 'minibuffer | |
67 (if minibuffer-indicate-depth-mode | |
68 ;; Enable the mode | |
69 (add-hook 'minibuffer-setup-hook 'minibuf-depth-setup-minibuffer) | |
70 ;; Disable the mode | |
71 (remove-hook 'minibuffer-setup-hook 'minibuf-depth-setup-minibuffer))) | |
72 | |
73 (provide 'mb-depth) | |
74 | |
81452 | 75 ;; arch-tag: 50224089-5bf5-46f8-803d-18f018c5eacf |
81441 | 76 ;;; mb-depth.el ends here |