unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "R. Diez" <rdiezmail-emacs@yahoo.de>
To: YUE Daian <sheepduke@gmail.com>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: Indenting with the tab key like everyone else
Date: Tue, 16 Jul 2019 09:23:53 +0200	[thread overview]
Message-ID: <930e1fdf-f50a-9280-b45f-2a05fd5ae7c8@yahoo.de> (raw)
In-Reply-To: <87ef3abcnk.fsf@work.i-did-not-set--mail-host-address--so-tickle-me>


> I am not sure what you really want to do exactly. There are some tips I
> thought of based on the code:
 > [...]

After much fighting with Emacs, I think I narrowed the problem down to a weird side-effect of calling (use-region-p). I have written this 
routine for test purposes. I would be interested to know if you can reproduce it on your Emacs.

   ; This routine lets you test the surprising side-effect of calling (use-region-p).
   ;
   ; Before calling this routine, select a few text lines by going to the beginning of a line
   ; (column 0) and pressing Shift + <cursor down> a few times. The lines will be highlighted.
   ;
   ; Then call this routine interactively a few times in a row. The lines will indent one character at a time.
   ; The first time, the highlighting will disappear, but the selection will somehow stay, so that
   ; further calls will still indent the same lines.
   ;
   ; After the test above, change "(if t" below to "(if (use-region-p)", and repeat the test.
   ; The first time, the text will indent one character, but the second call will not indent anymore,
   ; because the selection is completely lost.


   (defun indentation-test nil ""
     (interactive)

     (if t
     ; (if (use-region-p)
       (indent-rigidly (region-beginning) (region-end) 1)
       (message "Skipping because there is no selection.")
     )
   )

Best regards,
   rdiez



      reply	other threads:[~2019-07-16  7:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1019418503.3900238.1559510385829.ref@mail.yahoo.com>
2019-06-02 21:19 ` Indenting with the tab key like everyone else R. Diez via help-gnu-emacs
2019-06-04  1:19   ` Emanuel Berg via help-gnu-emacs
2019-06-04  4:29   ` YUE Daian
2019-06-25  8:09     ` R. Diez via help-gnu-emacs
2019-07-01  4:29       ` YUE Daian
2019-07-16  7:23         ` R. Diez [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=930e1fdf-f50a-9280-b45f-2a05fd5ae7c8@yahoo.de \
    --to=rdiezmail-emacs@yahoo.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=sheepduke@gmail.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.
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).