help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reversing lines chunks at a time


From: Rupert Swarbrick
Subject: Re: Reversing lines chunks at a time
Date: Wed, 17 Sep 2008 19:54:05 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

harven <harven@free.fr> writes:
> You could hack the syntax-table in TeX-mode for the transpose-words
> command only. e.g.
>
> (setq my-wacky-syntax-table (copy-syntax-table))
> (dolist (char '(?^ ?\ ?* ?_ ?$))
>  (modify-syntax-entry char "w" my-wacky-syntax-table))
>
> (add-hook 'TeX-mode-hook (lambda ()
> (define-key TeX-mode-map "\M-t"
>   '(lambda ()  (interactive)
>      (with-syntax-table my-wacky-syntax-table (transpose-words 1)))))

Ah thanks, that's a good point - although I don't always have spaces in
helpful places. I don't think I made it very clear, but I was after
something that you could "just tell" what to move, since the syntax
was variable enough that it wouldn't be reasonable to expect anything to
guess right. For example, in the string of characters below,

A_\alpha^\beta\times_{\mathrm{t}}B^n

I wouldn't expect a mode to realise that the partition I was thinking of
was

A_\alpha^\beta | \times_{\mathrm{t}} | B^n

even if it is "obvious" once the latex is rendered!

Anyway, I think that the anchored-transpose.el rgb pointed me to looks
like it does what I want, although I have some ideas for adding to
it... :)

Rupert

Attachment: pgpgfTvHnKxiT.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]