comparison lisp/electric/echistory.el @ 70:131b0175ea99 r20-0b30

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