help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Editing Lisp and cycling through indentation levels


From: Barry OReilly
Subject: Editing Lisp and cycling through indentation levels
Date: Thu, 11 Jul 2013 15:30:05 -0400

Is there an Emacs mode that would allow me to do the following kind of
Lisp editing? Let | indicate point and comments indicate key presses.

  (defun func ()
    (let ((x 10) (y (some-func 20)))))|

  ;; RET
  (defun func ()
    (let ((x 10) (y (some-func 20)))))
  |

  ;; TAB
  (defun func ()
    (let ((x 10) (y (some-func 20))))
    |)

  ;; 4 more TAB
  (defun func ()
    (let ((x 10) (y (some-func 20
                               |)))))

  ;; 3 DEL
  (defun func ()
    (let ((x 10) (y (some-func 20)))
      |))

Another example:

  (defun func ()
    (let ((x 10) (y (some-func 20)))|
      (message "Inside func")))

  ;; RET
  (defun func ()
    (let ((x 10) (y (some-func 20)))
      |
      (message "Inside func")))

  ;; DEL
  (defun func ()
    (let ((x 10) (y (some-func 20))))
    |
    (message "Inside func"))

  ;; What should happen when TAB here is debatable

The idea is being able to cycle through indentation levels and have
the parenthesis and code automatically adjust themselves to be
consistent with the changing indentation.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]