all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Teemu Likonen <tlikonen@iki.fi>
To: Drew Adams <drew.adams@oracle.com>
Cc: 8196@debbugs.gnu.org
Subject: bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list
Date: Fri, 12 Jul 2013 23:05:00 +0300	[thread overview]
Message-ID: <87k3kv4k9f.fsf@mithlond.arda> (raw)
In-Reply-To: <2b9b23f3-8622-4a4e-847f-a2f751c2c881@default> (Drew Adams's message of "Fri, 12 Jul 2013 12:11:31 -0700 (PDT)")

Drew Adams [2013-07-12 12:11:31 -07:00] wrote:

>>> I think it would be better if "C-x TAB" (bound to indent-rigidly)
>>> advanced the indentation to the next tab stop (as in tab-stop-list)
>>> by default, instead of by 1. Similarly, if negative prefix argument
>>> were given (with "C-u -") it would change the indentation to the
>>> previous tab stop.
>
> Sorry, that does not make sense to me.

First, here's some reference where this came from:
http://lists.gnu.org/archive/html/help-gnu-emacs/2011-03/msg00243.html
The feature supersedes indent-rigidly. If filed this wishlist bug report
because Stefan Monnier suggested so:

    Indeed, it sounds like a good improvement to the behavior of C-x
    TAB. Maybe you could propose it for inclusion via M-x
    report-emacs-bug.

Here's a concrete use-case. Let's say my tab-stop-list variable is like
(4 8 12 16 20 etc.). I'm in a message-mode buffer writing some email or
news message which is about Lisp programming. I copy a piece of code
from some other buffer, like this:

(defun foo (bar)
  (setq some-variable some-value)
  (some-function-call bar)
  ...)

I want to indent it so that it stands out from my normal text. I mark
the code piece with M-h and press C-x TAB (which runs my improved
indent-rigidly). It results in this:

    (defun foo (bar)
      (setq some-variable some-value)
      (some-function-call bar)
      ...)

The lowest indentation of that paragraph is now column 4. If I had kept
repeating TAB key the code would have been indented to columns 8, 12, 16
etc. as the tab-stop-list variable defines.

The doc string of that command could be like this:


    Indent region to a tab stop column or to the specified column.

    Indent the region from BEG to END according to the command's prefix
    argument ARG. If ARG is nil (i.e., there is no prefix argument)
    indent the region to the next tab stop column in `tab-stop-list'.
    With negative prefix ARG (C-u -) indent the region to the previous
    tab stop column. If ARG is an integer indent the region by ARG
    columns (just like `indent-rigidly' command).

    If this command is invoked by a multi-character key sequence, it can
    be repeated by repeating the final character of the sequence.





  parent reply	other threads:[~2013-07-12 20:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-07 18:19 bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list Teemu Likonen
2013-07-12 17:19 ` Teemu Likonen
2013-07-12 19:11   ` Drew Adams
2013-07-12 19:18     ` Drew Adams
2013-07-12 20:05     ` Teemu Likonen [this message]
2013-07-12 21:18       ` Drew Adams
2013-07-12 22:53         ` Jambunathan K
2013-07-13  5:43           ` Teemu Likonen
2013-07-13  4:49         ` Teemu Likonen
2013-07-13  4:59           ` Drew Adams
2013-07-13 20:02 ` Stefan Monnier
2013-07-14 14:41   ` Teemu Likonen
2013-10-08  6:18     ` Stefan Monnier
2013-10-08 15:12       ` Drew Adams
2013-10-08 15:34         ` Teemu Likonen
2013-10-08 16:21           ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k3kv4k9f.fsf@mithlond.arda \
    --to=tlikonen@iki.fi \
    --cc=8196@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.