Mercurial > hg > xemacs-beta
comparison lisp/electric/echistory.el @ 4:b82b59fe008d r19-15b3
Import from CVS: tag r19-15b3
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:46:56 +0200 |
parents | 376386a54a3c |
children | 131b0175ea99 |
comparison
equal
deleted
inserted
replaced
3:30df88044ec6 | 4:b82b59fe008d |
---|---|
2 | 2 |
3 ;; Copyright (C) 1985 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1985 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: K. Shane Hartman | 5 ;; Author: K. Shane Hartman |
6 ;; Maintainer: FSF | 6 ;; Maintainer: FSF |
7 ;; Keywords: extensions | |
7 | 8 |
8 ;; This file is part of XEmacs. | 9 ;; This file is part of XEmacs. |
9 | 10 |
10 ;; XEmacs is free software; you can redistribute it and/or modify it | 11 ;; XEmacs is free software; you can redistribute it and/or modify it |
11 ;; under the terms of the GNU General Public License as published by | 12 ;; under the terms of the GNU General Public License as published by |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
18 ;; General Public License for more details. | 19 ;; General Public License for more details. |
19 | 20 |
20 ;; You should have received a copy of the GNU General Public License | 21 ;; You should have received a copy of the GNU General Public License |
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free | 22 ;; along with XEmacs; see the file COPYING. If not, write to the Free |
22 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
24 ;; 02111-1307, USA. | |
23 | 25 |
24 ;;; Synched up with: FSF 19.30. | 26 ;;; Synched up with: FSF 19.34. |
25 | 27 |
26 ;;; Code: | 28 ;;; Code: |
27 | 29 |
28 (require 'electric) ; command loop | 30 (require 'electric) ; command loop |
29 (require 'chistory) ; history lister | 31 (require 'chistory) ; history lister |
30 | 32 |
31 ;;;###autoload | 33 ;;;###autoload |
32 (defun Electric-command-history-redo-expression (&optional noconfirm) | 34 (defun Electric-command-history-redo-expression (&optional noconfirm) |
33 "Edit current history line in minibuffer and execute result. | 35 "Edit current history line in minibuffer and execute result. |
34 With prefix argument NOCONFIRM, execute current line as-is without editing." | 36 With prefix arg NOCONFIRM, execute current line as-is without editing." |
35 (interactive "P") | 37 (interactive "P") |
36 (let (todo) | 38 (let (todo) |
37 (save-excursion | 39 (save-excursion |
38 (set-buffer "*Command History*") | 40 (set-buffer "*Command History*") |
39 (beginning-of-line) | 41 (beginning-of-line) |
42 (if todo (throw 'electric-history-quit (list noconfirm todo))))))) | 44 (if todo (throw 'electric-history-quit (list noconfirm todo))))))) |
43 | 45 |
44 (defvar electric-history-map ()) | 46 (defvar electric-history-map ()) |
45 (if electric-history-map | 47 (if electric-history-map |
46 () | 48 () |
49 ;; XEmacs | |
47 (setq electric-history-map (make-keymap)) | 50 (setq electric-history-map (make-keymap)) |
48 (set-keymap-name electric-history-map 'electric-history-map) | 51 (set-keymap-name electric-history-map 'electric-history-map) |
49 (set-keymap-default-binding electric-history-map 'Electric-history-undefined) | 52 (set-keymap-default-binding electric-history-map 'Electric-history-undefined) |
50 (define-key electric-history-map "\C-u" 'universal-argument) | 53 (define-key electric-history-map "\C-u" 'universal-argument) |
51 (define-key electric-history-map " " 'Electric-command-history-redo-expression) | 54 (define-key electric-history-map " " 'Electric-command-history-redo-expression) |
62 (define-key electric-history-map "q" 'Electric-history-quit) | 65 (define-key electric-history-map "q" 'Electric-history-quit) |
63 (define-key electric-history-map "\C-c" nil) | 66 (define-key electric-history-map "\C-c" nil) |
64 (define-key electric-history-map "\C-c\C-c" 'Electric-history-quit) | 67 (define-key electric-history-map "\C-c\C-c" 'Electric-history-quit) |
65 (define-key electric-history-map "\C-]" 'Electric-history-quit) | 68 (define-key electric-history-map "\C-]" 'Electric-history-quit) |
66 (define-key electric-history-map "\C-z" 'suspend-emacs) | 69 (define-key electric-history-map "\C-z" 'suspend-emacs) |
67 ;; (define-key electric-history-map "\C-h" 'Helper-help) | 70 (define-key electric-history-map (char-to-string help-char) 'Helper-help) |
68 (define-key electric-history-map '(control h) 'Helper-help) | 71 ;; XEmacs |
69 (define-key electric-history-map 'backspace 'previous-line) | 72 (define-key electric-history-map 'backspace 'previous-line) |
70 (define-key electric-history-map "?" 'Helper-describe-bindings) | 73 (define-key electric-history-map "?" 'Helper-describe-bindings) |
71 (define-key electric-history-map "\e>" 'end-of-buffer) | 74 (define-key electric-history-map "\e>" 'end-of-buffer) |
72 (define-key electric-history-map "\e<" 'beginning-of-buffer) | 75 (define-key electric-history-map "\e<" 'beginning-of-buffer) |
73 (define-key electric-history-map "\n" 'next-line) | 76 (define-key electric-history-map "\n" 'next-line) |
96 The command history is filtered by `list-command-history-filter' if non-nil. | 99 The command history is filtered by `list-command-history-filter' if non-nil. |
97 Combines typeout Command History list window with menu like selection | 100 Combines typeout Command History list window with menu like selection |
98 of an expression from the history for re-evaluation in the *original* buffer. | 101 of an expression from the history for re-evaluation in the *original* buffer. |
99 | 102 |
100 The history displayed is filtered by `list-command-history-filter' if non-nil. | 103 The history displayed is filtered by `list-command-history-filter' if non-nil. |
101 | |
102 This pops up a window with the Command History listing. If the very | |
103 next character typed is Space, the listing is killed and the previous | |
104 window configuration is restored. Otherwise, you can browse in the | |
105 Command History with Return moving down and Delete moving up, possibly | |
106 selecting an expression to be redone with Space or quitting with `Q'. | |
107 | 104 |
108 Like Emacs-Lisp mode except that characters do not insert themselves and | 105 Like Emacs-Lisp mode except that characters do not insert themselves and |
109 Tab and Linefeed do not indent. Instead these commands are provided: | 106 Tab and Linefeed do not indent. Instead these commands are provided: |
110 \\{electric-history-map} | 107 \\{electric-history-map} |
111 | 108 |
151 | 148 |
152 (defun Electric-history-quit () | 149 (defun Electric-history-quit () |
153 "Quit Electric Command History, restoring previous window configuration." | 150 "Quit Electric Command History, restoring previous window configuration." |
154 (interactive) | 151 (interactive) |
155 (if (boundp 'electric-history-in-progress) | 152 (if (boundp 'electric-history-in-progress) |
156 (progn (message nil) | 153 (progn (message "") |
157 (throw 'electric-history-quit nil)))) | 154 (throw 'electric-history-quit nil)))) |
158 | 155 |
159 ;;; echistory.el ends here | 156 ;;; echistory.el ends here |