all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* What should the prefix to prog-indent-sexp do?
@ 2013-05-14  3:33 Leo Liu
  2013-05-14  4:04 ` Josh
  2013-05-15  9:36 ` Andreas Röhler
  0 siblings, 2 replies; 7+ messages in thread
From: Leo Liu @ 2013-05-14  3:33 UTC (permalink / raw)
  To: emacs-devel

Hi there,

If you care please respond ASAP.

My proposal is to make C-u C-M-q do some sort of indent defun as shown
in this patch:
http://thread.gmane.org/gmane.emacs.diffs/120483/focus=120499

Thanks,
Leo




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

* Re: What should the prefix to prog-indent-sexp do?
  2013-05-14  3:33 What should the prefix to prog-indent-sexp do? Leo Liu
@ 2013-05-14  4:04 ` Josh
  2013-05-15  7:54   ` Leo Liu
  2013-05-15  9:36 ` Andreas Röhler
  1 sibling, 1 reply; 7+ messages in thread
From: Josh @ 2013-05-14  4:04 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 477 bytes --]

On Mon, May 13, 2013 at 8:33 PM, Leo Liu <sdl.web@gmail.com> wrote:

> Hi there,
>
> If you care please respond ASAP.
>
> My proposal is to make C-u C-M-q do some sort of indent defun as shown
> in this patch:
> http://thread.gmane.org/gmane.emacs.diffs/120483/focus=120499


 It looks like this functionality amounts to C-M-h C-M-\, i.e. mark-defun
followed by indent-region, which is both more general and quicker to type
(assuming no release of modifiers between commands).

[-- Attachment #2: Type: text/html, Size: 909 bytes --]

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

* Re: What should the prefix to prog-indent-sexp do?
  2013-05-14  4:04 ` Josh
@ 2013-05-15  7:54   ` Leo Liu
  0 siblings, 0 replies; 7+ messages in thread
From: Leo Liu @ 2013-05-15  7:54 UTC (permalink / raw)
  To: Josh; +Cc: emacs-devel

On 2013-05-14 12:04 +0800, Josh wrote:
>  It looks like this functionality amounts to C-M-h C-M-\, i.e. mark-defun
> followed by indent-region, which is both more general and quicker to type
> (assuming no release of modifiers between commands).

The only reason that modes provide indent-defun commands is not having
to move point first. So no, it is not the same.

Leo



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

* Re: What should the prefix to prog-indent-sexp do?
  2013-05-14  3:33 What should the prefix to prog-indent-sexp do? Leo Liu
  2013-05-14  4:04 ` Josh
@ 2013-05-15  9:36 ` Andreas Röhler
  2013-05-15 11:57   ` Leo Liu
  1 sibling, 1 reply; 7+ messages in thread
From: Andreas Röhler @ 2013-05-15  9:36 UTC (permalink / raw)
  To: emacs-devel

Am 14.05.2013 05:33, schrieb Leo Liu:
> Hi there,
>
> If you care please respond ASAP.
>
> My proposal is to make C-u C-M-q do some sort of indent defun as shown
> in this patch:
> http://thread.gmane.org/gmane.emacs.diffs/120483/focus=120499
>
> Thanks,
> Leo
>
>
>

IMO a good idea.

What about to use the arg as indent of top-level-form?
I.e. use syntax-ppss, not reg-exp jumping.
That would indent defuns, but also loops, defvars etc.

Andreas





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

* Re: What should the prefix to prog-indent-sexp do?
  2013-05-15  9:36 ` Andreas Röhler
@ 2013-05-15 11:57   ` Leo Liu
  2013-05-15 13:07     ` Andreas Röhler
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Liu @ 2013-05-15 11:57 UTC (permalink / raw)
  To: emacs-devel

On 2013-05-15 17:36 +0800, Andreas Röhler wrote:
> What about to use the arg as indent of top-level-form?
> I.e. use syntax-ppss, not reg-exp jumping.
> That would indent defuns, but also loops, defvars etc.

Should work for these cases already.

Leo




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

* Re: What should the prefix to prog-indent-sexp do?
  2013-05-15 11:57   ` Leo Liu
@ 2013-05-15 13:07     ` Andreas Röhler
  2013-05-16  3:35       ` Leo Liu
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Röhler @ 2013-05-15 13:07 UTC (permalink / raw)
  To: emacs-devel

Am 15.05.2013 13:57, schrieb Leo Liu:
> On 2013-05-15 17:36 +0800, Andreas Röhler wrote:
>> What about to use the arg as indent of top-level-form?
>> I.e. use syntax-ppss, not reg-exp jumping.
>> That would indent defuns, but also loops, defvars etc.
>
> Should work for these cases already.
>
> Leo
>
>
>

In most cases it works, in some it fails, for example from behind a badly indented

(defvar a nil "make
(beginning-more more visible
")

Whilst syntax-ppss wouldn't be irritated.



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

* Re: What should the prefix to prog-indent-sexp do?
  2013-05-15 13:07     ` Andreas Röhler
@ 2013-05-16  3:35       ` Leo Liu
  0 siblings, 0 replies; 7+ messages in thread
From: Leo Liu @ 2013-05-16  3:35 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: emacs-devel

On 2013-05-15 21:07 +0800, Andreas Röhler wrote:
> In most cases it works, in some it fails, for example from behind a badly indented
>
> (defvar a nil "make
> (beginning-more more visible
> ")
>
> Whilst syntax-ppss wouldn't be irritated.

I see but this is a bug that should be fixed in lisp's
beginning-of-defun not in prog-indent-sexp.

Leo



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

end of thread, other threads:[~2013-05-16  3:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-14  3:33 What should the prefix to prog-indent-sexp do? Leo Liu
2013-05-14  4:04 ` Josh
2013-05-15  7:54   ` Leo Liu
2013-05-15  9:36 ` Andreas Röhler
2013-05-15 11:57   ` Leo Liu
2013-05-15 13:07     ` Andreas Röhler
2013-05-16  3:35       ` Leo Liu

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.