[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Insert character pairs
From: |
Kevin Rodgers |
Subject: |
Re: Insert character pairs |
Date: |
Mon, 03 May 2004 13:48:57 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
Juri Linkov wrote:
> BTW, I didn't find anywhere in Emacs a command that promotes
> a list up in the tree. It would be useful to add this command
> to `emacs-lisp/lisp.el':
>
> (defun promote-list (&optional arg)
> "Promote expressions higher up the tree."
> (interactive "p")
> (let ((str (if (and transient-mark-mode mark-active)
> (buffer-substring (region-beginning) (region-end))
> (buffer-substring
> (point)
> (save-excursion (forward-sexp arg) (point))))))
> (backward-up-list 1)
> (delete-region (point) (save-excursion (forward-sexp 1) (point)))
> (save-excursion (insert str))))
>
> Maybe, a better name is `move-up-list' (however, not good since
> the word `move' often means `move the point') or `lift-up-list'?
Yes, "move" would be misleading.
> The command `promote-list' is basically opposite to `insert-parentheses',
> so another possible name is `remove-parentheses', but it is misleading,
> because it removes more than only enclosing parentheses.
I don't find "delete" or "remove" misleading at all.
--
Kevin Rodgers
- 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, 2004/05/04
- 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 <=