3 Dec 2010 11:58

### [Reftex] 2 patches to let users customize reftex-view-crossref for citations

Dear AUCTEX developers,

[mail already sent to the user mailing list]

I wrote two very simple patches to let users customize
reftex-view-crossref for citations. They replace the hard-coded regexp
string "\\\\\\cite\\|cite\\*?\\'\\|bibentry" by a new customizable
variable reftex-view-crossref-cite-macros.

This patch is useful for me because I use macros such as \cauthor{XXX}
and \ccauthor{XXX} to display the names of the authors along with the
reference number.

reftex-vars.patch also contains a typo fix (word 'with' was written
twice consecutively).

Regards,

--

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry

Attachment (reftex-dcr.patch): application/octet-stream, 531 bytes
Attachment (reftex-vars.patch): application/octet-stream, 1751 bytes
_______________________________________________
auctex-devel mailing list


4 Dec 2010 17:18

### Re: Unfillable paragraph with AUCTeX 11.86

* Ralf Angeli (2010-11-23) writes:

> But I am not yet convinced this is the right thing to do because it will
> mess with the syntax of characters between the braces.

I've now checked another change into CVS but I cannot test if it gets
rid of the filling problem because I cannot reproduce the bug here.  It
would be interesting to know if it helps in your case.

--

--
Ralf

5 Dec 2010 18:55

### Re: Unfillable paragraph with AUCTeX 11.86

On Saturday 04 December 2010 17:18:16 Ralf Angeli wrote:
> * Ralf Angeli (2010-11-23) writes:
>
> > But I am not yet convinced this is the right thing to do because it will
> > mess with the syntax of characters between the braces.
>
> I've now checked another change into CVS but I cannot test if it gets
> rid of the filling problem because I cannot reproduce the bug here.  It
> would be interesting to know if it helps in your case.

Could you please send me a patch against 11.86?  That would ease testing
for me.

Thanks,
Tassilo

5 Dec 2010 22:44

### Re: Unfillable paragraph with AUCTeX 11.86

* Tassilo Horn (2010-12-05) writes:

> On Saturday 04 December 2010 17:18:16 Ralf Angeli wrote:
>>
>> I've now checked another change into CVS but I cannot test if it gets
>> rid of the filling problem because I cannot reproduce the bug here.  It
>> would be interesting to know if it helps in your case.
>
> Could you please send me a patch against 11.86?  That would ease testing
> for me.

Here it is:

--- latex.el	2009-10-31 18:03:28.000000000 +0100
+++ latex.new.el	2010-12-05 22:41:06.000000000 +0100
<at>  <at>  -2041,10 +2041,22  <at>  <at>
(/= (point) (line-beginning-position))))))
;; Search forward for the macro end, unless we failed to find a start
(unless (bolp)
-	(let ((beg (1- (point))))
-	  (goto-char (1+ (match-end 0)))
-	  (skip-chars-forward (concat "^" (buffer-substring-no-properties
-					   (1- (point)) (point))))
+	(let* ((beg (1- (point)))
+	       (macro-end (match-end 0))
+	       ;; XXX: Here we assume we are dealing with \verb which
+	       ;; expects the delimiter right behind the command.
+	       ;; However, \lstinline can also cope with whitespace as
+	       ;; well as an optional argument after the command.
+	       (delimiter (buffer-substring-no-properties


6 Dec 2010 08:48

### Re: Unfillable paragraph with AUCTeX 11.86

On Sunday 05 December 2010 22:44:09 Ralf Angeli wrote:

Hi Ralf,

> >> I've now checked another change into CVS but I cannot test if it
> >> gets rid of the filling problem because I cannot reproduce the bug
> >> here.  It would be interesting to know if it helps in your case.
> >
> > Could you please send me a patch against 11.86?  That would ease
> > testing for me.
>
> Here it is:

Thanks.  Although it didn't want to apply, I was able to merge the
changes manually.  So now, I'll use it in my day-to-day work and report
back if it helps with the filling issue.

But in the meantime, I've also paid heed to your advice to put all
lstlisting options on one line, which subjectively reduced the issue
quite a lot for me.

Bye,
Tassilo

11 Dec 2010 13:09

### [PATCH] C-c C-c compiles either the buffer or the master depending on variable

Hi,

I attach a patch I've just written.

Use case:

C-c C-c is encoded in your brain to compile your document. When you
work on a big document (e.g., a thesis or book) you often want to
compile just the current buffer. However, your fingers always press
C-c C-c when you'd prefer them to type C-c C-b to compile the buffer
only (and C-c C-c is easier to type). This results in a long time to
compile the whole document when you'd prefer to have the result
immediately.

Solution:

Use C-c C-c to compile either the whole document or the current buffer
depending on a variable.

My patch contains:

- a new boolean variable TeX-master-compilation to store the choice
which defaults to t (= current behavior)
- a new function TeX-toggle-master-compilation to toggle this variable
- a new shortcut to call the function C-c C-t C-m (m = master)
- an adaptation of the TeX-command-master (C-c C-c) function to
compile either the document or the buffer depending on the variable

Backward compatibility:



12 Dec 2010 16:20

### Re: [Reftex] 2 patches to let users customize reftex-view-crossref for citations

* Damien Cassou (2010-12-03) writes:

> [mail already sent to the user mailing list]

It's better to send patches to the development list.

Anyway, sorry for the late reply.  I wanted to take the time to look
thoroughly into the patch and what it is supposed to achieve.

> I wrote two very simple patches to let users customize
> reftex-view-crossref for citations. They replace the hard-coded regexp
> string "\\\\\\cite\\|cite\\*?\\'\\|bibentry" by a new customizable
> variable reftex-view-crossref-cite-macros.

If this is done for citation macros, one could ask why it is not done
for the other options covered in reftex-view-crossref'.

> This patch is useful for me because I use macros such as \cauthor{XXX}
> and \ccauthor{XXX} to display the names of the authors along with the
> reference number.

Does RefTeX know about these macros?  That means, have you added them to
reftex-cite-format' or the like?  Because if RefTeX already knows the
macros, perhaps we could use this information to create the regexp above
without having to introduce a new variable.

--

--
Ralf

12 Dec 2010 16:26

### Re: Unfillable paragraph with AUCTeX 11.86

* Tassilo Horn (2010-12-06) writes:

> But in the meantime, I've also paid heed to your advice to put all
> lstlisting options on one line, which subjectively reduced the issue
> quite a lot for me.

Yeah, the verbatim support in AUCTeX works under the assumption that all
verbatim-like environments work like, well, the verbatim environment.
So AUCTeX is not able to cope with the optional argument of lstlisting,
especially if it spans multiple lines.

--

--
Ralf

13 Dec 2010 09:31

### Re: Unfillable paragraph with AUCTeX 11.86

Ralf Angeli <angeli <at> caeruleus.net> writes:

Hi Ralf,

>> But in the meantime, I've also paid heed to your advice to put all
>> lstlisting options on one line, which subjectively reduced the issue
>> quite a lot for me.
>
> Yeah, the verbatim support in AUCTeX works under the assumption that
> all verbatim-like environments work like, well, the verbatim
> environment.  So AUCTeX is not able to cope with the optional argument
> of lstlisting, especially if it spans multiple lines.

Ok, after working a more than a week with your patch applied, it seems
to work as expected.  I had one wrongly filled paragraph, but that
turned out to be caused by another listing with options spanning several
lines.  After putting them in one line, filling was correct again.

Thank a lot,
Tassilo

14 Dec 2010 18:05

### Re: [Reftex] 2 patches to let users customize reftex-view-crossref for citations

Hi Ralf,

On Sun, Dec 12, 2010 at 4:20 PM, Ralf Angeli <angeli <at> caeruleus.net> wrote:
>> I wrote two very simple patches to let users customize
>> reftex-view-crossref for citations. They replace the hard-coded regexp
>> string "\\\\\\cite\\|cite\\*?\\'\\|bibentry" by a new customizable
>> variable reftex-view-crossref-cite-macros.
>
> If this is done for citation macros, one could ask why it is not done
> for the other options covered in reftex-view-crossref'.
>
>> This patch is useful for me because I use macros such as \cauthor{XXX}
>> and \ccauthor{XXX} to display the names of the authors along with the
>> reference number.
>
> Does RefTeX know about these macros?  That means, have you added them to
> reftex-cite-format' or the like?  Because if RefTeX already knows the
> macros, perhaps we could use this information to create the regexp above
> without having to introduce a new variable.

I didn't change these variables because I didn't know about them .
Do you prefer me to implement the same functionality using these

--

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry
`