David Kastrup | 5 Feb 2006 15:46
Picon
Picon

Default value for LaTeX-fill-break-at-separators


Hi,

after some Usenet discussions I noticed that we still have a default
value of `nil' for LaTeX-fill-break-at-separators.  I found that
somewhat surprising.

I particular since we have tex-fold and preview-latex functionality
available by default, I think we should at least enable the open-brace
and opening-math functionality by default.

I seemed to remember we had converged on something like this, and so I
was a bit surprised to see the default value of nil.

Any input?  What do persons who are using filling often and are aware
of that option tend to use?

--

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Ralf Angeli | 5 Feb 2006 15:51
Face
Picon

Cleaning functionality

As mentioned on the general mailing list I had a little bit of code
for cleaning generated files I wanted to generalize.  Attached you can
find a patch showing what has become of it.

There are a few things which may be worth discussing:

I decided to use regular expressions for matching suffixes of files to
be deleted in order to be able to support stuff like makeinfo
splitting info files or texi2html splitting HTML files.  The resulting
customization options may not be easily understandable by users not
familiar with regular expressions.  Consequently we could provide the
option to use a list of suffixes instead of a regular expression and
use such a list in the "easy" cases like (La)TeX and ConTeXt modes as
default.

The word "Clean" in the command list shadows "Check" and "ConTeXt".
"Purge" would shadow "Print".  Any better suggestions?

Calling `TeX-clean' from `TeX-command-list' is accomplished with a
dedicated wrapper function `TeX-run-clean' similar to how we do it
with `TeX-run-ispell'.  I don't really like to introduce another
special case, so how about making it possible that the second element
of an item in `TeX-command-list' can be a function which will be
called by a hypothetical `TeX-run-function' function?  For example for
"Clean" you could have
("Clean" TeX-clean TeX-run-function nil t :help "Remove generated files")
and for "Spell"
("Spell" (lambda () (TeX-ispell-document "")) TeX-run-function nil t
 :help "Spell-check the document")
Note that this is just an idea, I still have to check if this will
(Continue reading)

Ralf Angeli | 5 Feb 2006 16:17
Picon

Re: Default value for LaTeX-fill-break-at-separators

* David Kastrup (2006-02-05) writes:

> after some Usenet discussions I noticed that we still have a default
> value of `nil' for LaTeX-fill-break-at-separators.  I found that
> somewhat surprising.
>
> I particular since we have tex-fold and preview-latex functionality
> available by default,

Folding is not really affected by overfull lines because a linebreak
is inserted into the overlay if the line became overfull.  (In case of
Emacs, that is.  XEmacs is a different story.)

> I think we should at least enable the open-brace
> and opening-math functionality by default.

I dislike my text being formatted like this.  In addition activating
`LaTeX-fill-break-at-separators' adds some overhead to filling which
may be a problem when filling whole files.  I haven't profiled this,
however.

> I seemed to remember we had converged on something like this, and so I
> was a bit surprised to see the default value of nil.
>
> Any input?  What do persons who are using filling often and are aware
> of that option tend to use?

nil

--

-- 
(Continue reading)

Reiner Steib | 5 Feb 2006 23:25
X-Face

Re: Cleaning functionality

On Sun, Feb 05 2006, Ralf Angeli wrote:

> I decided to use regular expressions for matching suffixes of files to
> be deleted in order to be able to support stuff like makeinfo
> splitting info files or texi2html splitting HTML files.  The resulting
> customization options may not be easily understandable by users not
> familiar with regular expressions.  Consequently we could provide the
> option to use a list of suffixes instead of a regular expression and
> use such a list in the "easy" cases like (La)TeX and ConTeXt modes as
> default.

A compromise might be to use a list of regexps.  Or use
`custom-split-regexp-maybe' (like in `gnus-visible-headers').

Bye, Reiner.
--

-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/
Ralf Angeli | 6 Feb 2006 09:53
Face
Picon

Re: Cleaning functionality

* Reiner Steib (2006-02-05) writes:

> On Sun, Feb 05 2006, Ralf Angeli wrote:
>
>> I decided to use regular expressions for matching suffixes of files to
>> be deleted in order to be able to support stuff like makeinfo
>> splitting info files or texi2html splitting HTML files.  The resulting
>> customization options may not be easily understandable by users not
>> familiar with regular expressions.  Consequently we could provide the
>> option to use a list of suffixes instead of a regular expression and
>> use such a list in the "easy" cases like (La)TeX and ConTeXt modes as
>> default.
>
> A compromise might be to use a list of regexps.

Hm, not a bad option.  My concerns are that you will have to write a
lot of "\."'s for the extension delimiters and "\'"'s for matching
their ends.  And if you fail to do that correctly, mismatches will
happen which would be rather fatal when it comes to deleting files.

In any case I am thinking about optionally opening a window which
displays the files to be deleted so that the user can check if there
is anything she wants to keep.

Additionally (not so much related to the above) I changed `TeX-clean'
in a way that it will delete intermediate files if being called
without argument and both intermediate and output files if being
called with a prefix argument.  Consequently, in `TeX-command-list'
there will be both a "Clean" and a "Clean All" entry.

(Continue reading)

Reiner Steib | 6 Feb 2006 11:05
X-Face

Re: Cleaning functionality

On Mon, Feb 06 2006, Ralf Angeli wrote:

> * Reiner Steib (2006-02-05) writes:
>> On Sun, Feb 05 2006, Ralf Angeli wrote:
[...]
>>> The resulting customization options may not be easily
>>> understandable by users not familiar with regular expressions.
>>> Consequently we could provide the option to use a list of suffixes
>>> instead of a regular expression and use such a list in the "easy"
>>> cases like (La)TeX and ConTeXt modes as default.
>>
>> A compromise might be to use a list of regexps.
>
> Hm, not a bad option.  My concerns are that you will have to write a
> lot of "\."'s for the extension delimiters and "\'"'s for matching
> their ends.  And if you fail to do that correctly, mismatches will
> happen which would be rather fatal when it comes to deleting files.

We could prepend «\.» and append «\'» automatically unless the entry
starts with «\.» (and «-» or «_» for ConTeXt or texinfo).  It might
sound like too much DWIM, but if it's explicitly documented and the
user already can see examples, it should be okay.

> In any case I am thinking about optionally opening a window which
> displays the files to be deleted so that the user can check if there
> is anything she wants to keep.

Maybe a variable `TeX-confirm-clean' with values like nil (don't ask),
t (ask for every file) and 'once (ask only once for each call of
TeX-clean; maybe combined a listing of the files) should be added.
(Continue reading)

David Kastrup | 6 Feb 2006 12:35
Picon
Picon

Re: Re: Cleaning functionality

Reiner Steib <reinersteib+gmane <at> imap.cc> writes:

> On Mon, Feb 06 2006, Ralf Angeli wrote:
>
>> * Reiner Steib (2006-02-05) writes:
>>> On Sun, Feb 05 2006, Ralf Angeli wrote:
> [...]
>>>> The resulting customization options may not be easily
>>>> understandable by users not familiar with regular expressions.
>>>> Consequently we could provide the option to use a list of suffixes
>>>> instead of a regular expression and use such a list in the "easy"
>>>> cases like (La)TeX and ConTeXt modes as default.
>>>
>>> A compromise might be to use a list of regexps.
>>
>> Hm, not a bad option.  My concerns are that you will have to write a
>> lot of "\."'s for the extension delimiters and "\'"'s for matching
>> their ends.  And if you fail to do that correctly, mismatches will
>> happen which would be rather fatal when it comes to deleting files.
>
> We could prepend «\.» and append «\'» automatically unless the entry
> starts with «\.» (and «-» or «_» for ConTeXt or texinfo).  It might
> sound like too much DWIM, but if it's explicitly documented and the
> user already can see examples, it should be okay.

I don't like this.  One could use a list of strings, and instead of a
string you can also use '(regexp . "\\.sty\\'") or so.  I think I have
seen some convention like that somewhere within Emacs, don't remember
whether this was a normal or dotted list.

(Continue reading)

Ralf Angeli | 6 Feb 2006 13:01
Picon

Re: Re: Cleaning functionality

* Reiner Steib (2006-02-06) writes:

> On Mon, Feb 06 2006, Ralf Angeli wrote:
>
>> * Reiner Steib (2006-02-05) writes:
>>>
>>> A compromise might be to use a list of regexps.
>>
>> Hm, not a bad option.  My concerns are that you will have to write a
>> lot of "\."'s for the extension delimiters and "\'"'s for matching
>> their ends.  And if you fail to do that correctly, mismatches will
>> happen which would be rather fatal when it comes to deleting files.
>
> We could prepend «\.» and append «\'» automatically unless the entry
> starts with «\.» (and «-» or «_» for ConTeXt or texinfo).  It might
> sound like too much DWIM, but if it's explicitly documented and the
> user already can see examples, it should be okay.

Appending "\'" would be okay, I guess.  At least it still seems to
work if somebody had the idea to specify it herself:

ELISP> (string-match "foo\\'\\'" "foo")
0

I am not really fond of prepending stuff.  What if some crazy tool
used a different separator we did not think of behorehand?

>> In any case I am thinking about optionally opening a window which
>> displays the files to be deleted so that the user can check if there
>> is anything she wants to keep.
(Continue reading)

Ralf Angeli | 6 Feb 2006 13:31
Picon

Re: Re: Cleaning functionality

* David Kastrup (2006-02-06) writes:

> I don't like this.  One could use a list of strings, and instead of a
> string you can also use '(regexp . "\\.sty\\'") or so.  I think I have
> seen some convention like that somewhere within Emacs, don't remember
> whether this was a normal or dotted list.

I've never seen such a convention and searching through the Emacs Lisp
manual didn't reveal anything either.  Do you think you can dig up
where you saw it?

Besides it does not lead to very clean customization buffers:

(defcustom foo '("string" (regexp "regexp"))
  "foo option"
  :type '(repeat (choice string (group :tag "Regexp" (const regexp) regexp))))

--

-- 
Ralf
David Kastrup | 6 Feb 2006 14:07
Picon
Picon

Re: Re: Cleaning functionality

Ralf Angeli <angeli <at> iwi.uni-sb.de> writes:

> * Reiner Steib (2006-02-06) writes:
>>
>> Maybe a variable `TeX-confirm-clean' with values like nil (don't
>> ask), t (ask for every file)
>
> This would annoy the hell out of me. (c:  Do you think that anybody
> would actually use this option?  In my opinion such a behavior would
> only be asked for in very special situations which means it's probably
> not worth the hassle implementing it.

Prefix-argument?

>> and 'once (ask only once for each call of
>> TeX-clean; maybe combined a listing of the files) should be added.
>
> Yep.

Well, one can see how "x" in dired asks for confirmation.

--

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

Gmane