[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Insert character pairs
From: |
Johan Bockgård |
Subject: |
Re: Insert character pairs |
Date: |
Tue, 04 May 2004 17:57:21 +0200 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.2 (usg-unix-v) |
Juri Linkov <address@hidden> writes:
> And while on this topic, another suggestion is to add a prefix
> argument to the command C-M-q (`indent-sexp') which currently has no
> prefix argument. This can be similar to M-q (`fill-paragraph') whose
> prefix argument adds a special meaning to justify paragraphs. C-M-q
> without prefix will work exactly as it currently works, but with a
> prefix will pretty-print the list after point. This is relevant only
> for emacs-lisp-mode and buffers in lisp-interaction-mode like the
> *scratch* buffer.
[...]
> +(defun indent-or-pp-sexp (&optional arg)
> + "Indent each line of the list or, with argument, pretty-printify the list."
> + (interactive "P")
> + (if arg
> + (let* (p (str (pp-to-string (save-excursion
> + (prog1 (read (current-buffer))
^
But this would also lead to all comments being removed , right?
> + (setq p (point)))))))
> + (delete-region (point) p)
> + (save-excursion (insert str)))
> + (indent-sexp)))
--
Johan Bockgård
- Re: Insert character pairs, Juri Linkov, 2004/05/01
- Re: Insert character pairs, Juri Linkov, 2004/05/02
- Re: Insert character pairs, Richard Stallman, 2004/05/03
- Re: Insert character pairs,
Johan Bockgård <=
- Re: Insert character pairs, Juri Linkov, 2004/05/04
- Re: Insert character pairs, Richard Stallman, 2004/05/05
- Re: Insert character pairs, Juri Linkov, 2004/05/06
- Re: Insert character pairs, Stefan Monnier, 2004/05/06
- Re: Insert character pairs, Juri Linkov, 2004/05/08
Re: Insert character pairs, Kevin Rodgers, 2004/05/03