unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Editing Lisp and cycling through indentation levels
@ 2013-07-11 19:30 Barry OReilly
  0 siblings, 0 replies; 2+ messages in thread
From: Barry OReilly @ 2013-07-11 19:30 UTC (permalink / raw)
  To: help-gnu-emacs

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Editing Lisp and cycling through indentation levels
       [not found] <mailman.870.1373571013.12400.help-gnu-emacs@gnu.org>
@ 2013-07-11 20:44 ` Pascal J. Bourguignon
  0 siblings, 0 replies; 2+ messages in thread
From: Pascal J. Bourguignon @ 2013-07-11 20:44 UTC (permalink / raw)
  To: help-gnu-emacs

Barry OReilly <gundaetiapo@gmail.com> writes:

> 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.
> 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.

paredit

Perhaps not precisely as you specified it, but it is very nice to edit
sexps.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.  
You know you've been lisping too long when you see a recent picture of George 
Lucas and think "Wait, I thought John McCarthy was dead!" -- Dalek_Baldwin


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-11 20:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.870.1373571013.12400.help-gnu-emacs@gnu.org>
2013-07-11 20:44 ` Editing Lisp and cycling through indentation levels Pascal J. Bourguignon
2013-07-11 19:30 Barry OReilly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).