Mercurial > emacs
view lisp/echistory.el @ 105842:83dde921cc1b
* emacs-lisp/autoload.el (generated-autoload-feature): Remove.
(autoload-rubric): Don't use any more.
* cedet/semantic/fw.el (semantic/loaddefs):
* cedet/srecode.el (srecode/loaddefs):
* cedet/ede.el (ede/loaddefs): Load rather than require.
* lisp/cedet/ede/cpp-root.el:
* lisp/cedet/ede/emacs.el:
* lisp/cedet/ede/files.el:
* lisp/cedet/ede/linux.el:
* lisp/cedet/ede/locate.el:
* lisp/cedet/ede/make.el:
* lisp/cedet/ede/shell.el:
* lisp/cedet/ede/speedbar.el:
* lisp/cedet/ede/system.el:
* lisp/cedet/ede/util.el:
* lisp/cedet/semantic/analyze.el:
* lisp/cedet/semantic/bovine.el:
* lisp/cedet/semantic/complete.el:
* lisp/cedet/semantic/ctxt.el:
* lisp/cedet/semantic/db-file.el:
* lisp/cedet/semantic/db-find.el:
* lisp/cedet/semantic/db-global.el:
* lisp/cedet/semantic/db-mode.el:
* lisp/cedet/semantic/db-typecache.el:
* lisp/cedet/semantic/db.el:
* lisp/cedet/semantic/debug.el:
* lisp/cedet/semantic/dep.el:
* lisp/cedet/semantic/doc.el:
* lisp/cedet/semantic/edit.el:
* lisp/cedet/semantic/find.el:
* lisp/cedet/semantic/format.el:
* lisp/cedet/semantic/html.el:
* lisp/cedet/semantic/ia-sb.el:
* lisp/cedet/semantic/ia.el:
* lisp/cedet/semantic/idle.el:
* lisp/cedet/semantic/lex-spp.el:
* lisp/cedet/semantic/lex.el:
* lisp/cedet/semantic/mru-bookmark.el:
* lisp/cedet/semantic/scope.el:
* lisp/cedet/semantic/senator.el:
* lisp/cedet/semantic/sort.el:
* lisp/cedet/semantic/symref.el:
* lisp/cedet/semantic/tag-file.el:
* lisp/cedet/semantic/tag-ls.el:
* lisp/cedet/semantic/tag-write.el:
* lisp/cedet/semantic/tag.el:
* lisp/cedet/semantic/util-modes.el:
* lisp/cedet/semantic/analyze/complete.el:
* lisp/cedet/semantic/analyze/refs.el:
* lisp/cedet/semantic/bovine/c.el:
* lisp/cedet/semantic/bovine/gcc.el:
* lisp/cedet/semantic/bovine/make.el:
* lisp/cedet/semantic/bovine/scm.el:
* lisp/cedet/semantic/decorate/include.el:
* lisp/cedet/semantic/decorate/mode.el:
* lisp/cedet/semantic/symref/cscope.el:
* lisp/cedet/semantic/symref/global.el:
* lisp/cedet/semantic/symref/grep.el:
* lisp/cedet/semantic/symref/idutils.el:
* lisp/cedet/semantic/symref/list.el:
* lisp/cedet/semantic/wisent/java-tags.el:
* lisp/cedet/semantic/wisent/javascript.el:
* lisp/cedet/srecode/compile.el:
* lisp/cedet/srecode/cpp.el:
* lisp/cedet/srecode/document.el:
* lisp/cedet/srecode/el.el:
* lisp/cedet/srecode/expandproto.el:
* lisp/cedet/srecode/getset.el:
* lisp/cedet/srecode/insert.el:
* lisp/cedet/srecode/java.el:
* lisp/cedet/srecode/map.el:
* lisp/cedet/srecode/mode.el:
* lisp/cedet/srecode/template.el:
* lisp/cedet/srecode/texi.el: Remove the file-local setting of
generated-autoload-feature.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 03 Nov 2009 21:45:31 +0000 |
parents | a9dc0e7c3f2b |
children | 009383a57ce8 |
line wrap: on
line source
;;; echistory.el --- Electric Command History Mode ;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, ;; 2006, 2007, 2008, 2009 Free Software Foundation, Inc. ;; Author: K. Shane Hartman ;; Maintainer: FSF ;; 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 3 of the License, 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. If not, see <http://www.gnu.org/licenses/>. ;;; Commentary: ;;; Code: (require 'electric) ; command loop (require 'chistory) ; history lister ;;;###autoload (defun Electric-command-history-redo-expression (&optional noconfirm) "Edit current history line in minibuffer and execute result. With prefix arg NOCONFIRM, execute current line as-is without editing." (interactive "P") (let (todo) (save-excursion (set-buffer "*Command History*") (beginning-of-line) (setq todo (read (current-buffer))) (if (boundp 'electric-history-in-progress) (if todo (throw 'electric-history-quit (list noconfirm todo))))))) (defvar electric-history-map (let ((map (make-sparse-keymap))) (define-key map [t] 'Electric-history-undefined) (define-key map "\e" (make-sparse-keymap)) (define-key map [?\e t] 'Electric-history-undefined) (define-key map "\C-u" 'universal-argument) (define-key map " " 'Electric-command-history-redo-expression) (define-key map "!" 'Electric-command-history-redo-expression) (define-key map "\e\C-x" 'eval-sexp) (define-key map "\e\C-d" 'down-list) (define-key map "\e\C-u" 'backward-up-list) (define-key map "\e\C-b" 'backward-sexp) (define-key map "\e\C-f" 'forward-sexp) (define-key map "\e\C-a" 'beginning-of-defun) (define-key map "\e\C-e" 'end-of-defun) (define-key map "\e\C-n" 'forward-list) (define-key map "\e\C-p" 'backward-list) (define-key map "q" 'Electric-history-quit) (define-key map "\C-c" nil) (define-key map "\C-c\C-c" 'Electric-history-quit) (define-key map "\C-]" 'Electric-history-quit) (define-key map "\C-z" 'suspend-frame) (define-key map (char-to-string help-char) 'Helper-help) (define-key map "?" 'Helper-describe-bindings) (define-key map "\e>" 'end-of-buffer) (define-key map "\e<" 'beginning-of-buffer) (define-key map "\n" 'next-line) (define-key map "\r" 'next-line) (define-key map "\177" 'previous-line) (define-key map "\C-n" 'next-line) (define-key map "\C-p" 'previous-line) (define-key map "\ev" 'scroll-down) (define-key map "\C-v" 'scroll-up) (define-key map [home] 'beginning-of-buffer) (define-key map [down] 'next-line) (define-key map [up] 'previous-line) (define-key map [prior] 'scroll-down) (define-key map [next] 'scroll-up) (define-key map "\C-l" 'recenter) (define-key map "\e\C-v" 'scroll-other-window) map) "Keymap for Electric Command History mode.") (defvar electric-command-history-hook nil "If non-nil, its value is called by `electric-command-history'.") (defun electric-command-history () "\\<electric-history-map>Major mode for examining and redoing commands from `command-history'. This pops up a window with the Command History listing. The number of command listed is controlled by `list-command-history-max'. The command history is filtered by `list-command-history-filter' if non-nil. Combines typeout Command History list window with menu like selection of an expression from the history for re-evaluation in the *original* buffer. The history displayed is filtered by `list-command-history-filter' if non-nil. Like Emacs-Lisp mode except that characters do not insert themselves and Tab and Linefeed do not indent. Instead these commands are provided: \\{electric-history-map} Calls the value of `electric-command-history-hook' if that is non-nil. The Command History listing is recomputed each time this mode is invoked." (interactive) (let ((electric-history-in-progress t) (old-buffer (current-buffer)) (todo)) (unwind-protect (setq todo (catch 'electric-history-quit (save-window-excursion (save-window-excursion (list-command-history) (set-buffer "*Command History*") (Command-history-setup) (setq major-mode 'electric-command-history) (setq mode-name "Electric History") (use-local-map electric-history-map)) (Electric-pop-up-window "*Command History*") (run-hooks 'electric-command-history-hook) (if (eobp) (progn (ding) (message "No command history.") (throw 'electric-history-quit nil)) (let ((Helper-return-blurb "return to History")) (Electric-command-loop 'electric-history-quit "->" t)))))) (set-buffer "*Command History*") (command-history-mode) (bury-buffer (current-buffer))) (if (consp todo) (progn (set-buffer old-buffer) (if (car todo) (apply (car (car (cdr todo))) (cdr (car (cdr todo)))) (edit-and-eval-command "Redo: " (car (cdr todo)))))))) (defun Electric-history-undefined () (interactive) (ding) (message "%s" (substitute-command-keys "Type \\[Helper-help] for help, ? for commands, C-c C-c to quit, Space to execute")) (sit-for 4)) (defun Electric-history-quit () "Quit Electric Command History, restoring previous window configuration." (interactive) (if (boundp 'electric-history-in-progress) (progn (message "") (throw 'electric-history-quit nil)))) (provide 'echistory) ;; arch-tag: 1e5018fe-190f-44a7-9109-a895dcac4c50 ;;; echistory.el ends here