Mercurial > emacs
annotate lisp/mb-depth.el @ 82396:71b7e41a7415
(initialization): Change parent group from `internal'
to `environment'.
(initial-buffer-choice): New variable.
(command-line): Revert 2007-07-02 change that sets
buffer-offer-save in *scratch* and enables auto-save in it.
(fancy-splash-text): Add links to existing items. Add new items
with links for useful tasks. Move information about Control-g to
fancy-splash-head. Move "Emacs Guided Tour" to the end.
(fancy-splash-keymap): New variable.
(fancy-splash-last-input-event): Remove variable.
(fancy-splash-insert): Add processing of `:link' element.
(fancy-splash-head): Replace "Type Control-l to begin editing"
with "Type `q' to exit".
(fancy-splash-screens-1): Let-bind inhibit-read-only to t.
(fancy-splash-default-action, fancy-splash-special-event-action):
Remove functions.
(fancy-splash-quit): New function.
(fancy-splash-screens): Rename input arg from `hide-on-input' to
`static' and reverse the condition of its usage. Don't preserve
original values of `minor-mode-map-alist',
`emulation-mode-map-alists', `special-event-map'.
Rename startup-buffer from "*About GNU Emacs*" to " GNU Emacs".
Rename about-buffer from " GNU Emacs" to " About GNU Emacs".
Remove processing of special events. Use local key map
`fancy-splash-keymap'. Set buffer to read-only.
(normal-splash-screen): Rename input arg from `hide-on-input' to
`static' and reverse the condition of its usage.
Rename startup-buffer from "*About GNU Emacs*" to " GNU Emacs".
Rename about-buffer from " GNU Emacs" to " About GNU Emacs".
Add links to existing items. Add new items with links for useful
tasks. Use local key map `fancy-splash-keymap'.
(display-splash-screen): Rename input arg from `hide-on-input' to
`static'.
(about-emacs): Add alias to display-splash-screen.
(command-line-1): Use `initial-buffer-choice'.
author | Juri Linkov <juri@jurta.org> |
---|---|
date | Wed, 15 Aug 2007 23:22:43 +0000 |
parents | baed8c5b63a7 |
children | 20e6cbaf918a |
rev | line source |
---|---|
81441 | 1 ;;; mb-depth.el --- Indicate minibuffer-depth in prompt |
2 ;; | |
3 ;; Copyright (C) 2006, 2007 Free Software Foundation, Inc. | |
4 ;; | |
5 ;; Author: Miles Bader <miles@gnu.org> | |
6 ;; Keywords: convenience | |
7 | |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
82160
baed8c5b63a7
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
81452
diff
changeset
|
12 ;; the Free Software Foundation; either version 3, or (at your option) |
81441 | 13 ;; any later version. |
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 | |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
23 ;; Boston, MA 02110-1301, USA. | |
24 | |
25 ;;; Commentary: | |
26 ;; | |
27 ;; Defines the minor mode `minibuffer-indicate-depth-mode'. | |
28 ;; | |
29 ;; When active, any recursive use of the minibuffer will show | |
30 ;; the recursion depth in the minibuffer prompt. This is only | |
31 ;; useful if `enable-recursive-minibuffers' is non-nil. | |
32 | |
33 ;;; Code: | |
34 | |
35 ;; An overlay covering the prompt. This is a buffer-local variable in | |
36 ;; each affected minibuffer. | |
37 ;; | |
38 (defvar minibuf-depth-overlay) | |
39 (make-variable-buffer-local 'minibuf-depth-overlay) | |
40 | |
41 ;; This function goes on minibuffer-setup-hook | |
42 (defun minibuf-depth-setup-minibuffer () | |
43 "Set up a minibuffer for `minibuffer-indicate-depth-mode'. | |
44 The prompt should already have been inserted." | |
45 (when (> (minibuffer-depth) 1) | |
46 (setq minibuf-depth-overlay (make-overlay (point-min) (1+ (point-min)))) | |
47 (overlay-put minibuf-depth-overlay 'before-string | |
48 (propertize (format "[%d]" (minibuffer-depth)) | |
49 'face 'highlight)) | |
50 (overlay-put minibuf-depth-overlay 'evaporate t))) | |
51 | |
52 ;;;###autoload | |
53 (define-minor-mode minibuffer-indicate-depth-mode | |
54 "Toggle Minibuffer Indicate Depth mode. | |
55 When active, any recursive use of the minibuffer will show | |
56 the recursion depth in the minibuffer prompt. This is only | |
57 useful if `enable-recursive-minibuffers' is non-nil. | |
58 | |
59 With prefix argument ARG, turn on if positive, otherwise off. | |
60 Returns non-nil if the new state is enabled." | |
61 :global t | |
62 :group 'minibuffer | |
63 (if minibuffer-indicate-depth-mode | |
64 ;; Enable the mode | |
65 (add-hook 'minibuffer-setup-hook 'minibuf-depth-setup-minibuffer) | |
66 ;; Disable the mode | |
67 (remove-hook 'minibuffer-setup-hook 'minibuf-depth-setup-minibuffer))) | |
68 | |
69 (provide 'mb-depth) | |
70 | |
81452 | 71 ;; arch-tag: 50224089-5bf5-46f8-803d-18f018c5eacf |
81441 | 72 ;;; mb-depth.el ends here |