auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Re: Insertion of leading new line with C-c C-s


From: Ralf Angeli
Subject: Re: [AUCTeX-devel] Re: Insertion of leading new line with C-c C-s
Date: Wed, 06 Apr 2005 09:10:03 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux)

* Christian Schlauer (2005-04-05) writes:

> Ralf Angeli <address@hidden> writes:
>
>> Here is a version using `skip-chars-backward' which dos not fail:
>>
>>   (unless (and (eq (save-excursion
>>                   (skip-chars-backward " \t\n\f" (line-end-position -1))
>>                   (point))
>>                 (line-end-position -1))
>>             (save-excursion
>>               (re-search-backward
>>                (concat "^\\s-*" (regexp-quote TeX-esc) "begin")
>>                (line-beginning-position 0) t)))
>>     (LaTeX-newline))
>
> But that code does the thing I am trying to get rid of: inserting a
> new line in this case:

Hmpf, it should work if `or' instead of `and' is used.

> You get an additional new line although there is a blank line before
> point. But I solved the problem that you found in my code with an
> extra `\=' in the regexp. I think it is okay now.
>
> The ChangeLog entry got a little longer, I corrected small typos that
> I stumbled across.

Okay, I applied the patches.  I don't intend to use the solution with
`skip-chars-backward' because yours seems to work on both Emacs and
XEmacs.  It is just that I am a bit suspicious regarding multi-line
regexps.  I seem to recall that they are not working all the time but
cannot give an example where this actually is true.  Maybe this was
formerly the case and now is fixed.  Whatever.

Thanks for the contribution.

BTW, in case you are intending to continue contributing to AUCTeX you
should consider asking David for CVS access.  It will make the whole
process of applying patches, testing etc. much easier.  (At least for
me. (c;)

-- 
Ralf



reply via email to

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