auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] problem fill LaTeX-fill-environment kills %%


From: Uwe Brauer
Subject: Re: [AUCTeX-devel] problem fill LaTeX-fill-environment kills %%
Date: Sat, 04 Mar 2017 13:14:29 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

    > Uwe Brauer <address@hidden> writes:

    > Hi Uwe,

    > I put the cursor in several places in your example above and hit `C-c
    > C-q C-e'.  I can't reproduce what you describe.

Ok, I have to debug this, then,... Found it is some private setting of
mine, some code in the internet which does some cool formatting in
paragraph. Every new sentence starts with a new line, which comes in
handy for version control.
Namely the following code
(defadvice LaTeX-fill-region-as-paragraph (around LaTeX-sentence-filling)
  "Start each sentence on a new line."
  (let ((from (ad-get-arg 0))
        (to-marker (set-marker (make-marker) (ad-get-arg 1)))
        tmp-end)
    (while (< from (marker-position to-marker))
      (forward-sentence)
      ;; might have gone beyond to-marker---use whichever is smaller:
      (ad-set-arg 1 (setq tmp-end (min (point) (marker-position to-marker))))
      ad-do-it
      (ad-set-arg 0 (setq from (point)))
      (unless (or (looking-back "^\\s *")
                  (looking-at "\\s *$"))
        (LaTeX-newline)))
    (set-marker to-marker nil)))

;; Ingo Lohmar
;; Modified from 
http://pleasefindattached.blogspot.com/2011/12/emacsauctex-sentence-fill-greatly.html

I asked some time ago to include that code o provide a similar
functionality but it seems that not very many users want such a feature.

    > BTW, LaTeX has also an array environment; you could write your code like
    > this:

    > \begin{equation*}
    >   \begin{array}{c|cccccc}
    >     X & 15 & 20 & 30 & 40 & 50 & 60\\
    >     \hline
    >     Y & 6.5 & 5.6 & 5.4 & 6 & 4.6 & 1.4
    >   \end{array}
    > \end{equation*}

Yes I know, this is old code from a colleague, which reminds me that I
should do some cleanup of the files, sigh. 



reply via email to

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