Mercurial > emacs
changeset 109846:dce0738d09ef
* lisp/simple.el (prog-mode-map): New var.
(prog-indent-sexp): New command.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 19 Aug 2010 01:25:36 +0200 |
parents | 350a910f00bf |
children | 80192451ba34 6e14b22d0a49 |
files | lisp/ChangeLog lisp/simple.el |
diffstat | 2 files changed, 16 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Wed Aug 18 22:06:11 2010 +0300 +++ b/lisp/ChangeLog Thu Aug 19 01:25:36 2010 +0200 @@ -1,5 +1,8 @@ 2010-08-18 Stefan Monnier <monnier@iro.umontreal.ca> + * simple.el (prog-mode-map): New var. + (prog-indent-sexp): New command. + * progmodes/octave-mod.el (octave-mode-menu): Make toggle buttons. * progmodes/prolog.el (smie): Require.
--- a/lisp/simple.el Wed Aug 18 22:06:11 2010 +0300 +++ b/lisp/simple.el Thu Aug 19 01:25:36 2010 +0200 @@ -424,6 +424,19 @@ ;; Major mode meant to be the parent of programming modes. +(defvar prog-mode-map + (let ((map (make-sparse-keymap))) + (define-key map [?\C-\M-q] 'prog-indent-sexp) + map) + "Keymap used for programming modes.") + +(defun prog-indent-sexp () + "Indent the expression after point." + (interactive) + (let ((start (point)) + (end (save-excursion (forward-sexp 1) (point)))) + (indent-region start end nil))) + (define-derived-mode prog-mode fundamental-mode "Prog" "Major mode for editing programming language source code." (set (make-local-variable 'require-final-newline) mode-require-final-newline)