auctex-devel
[Top][All Lists]
Advanced

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

[AUCTeX-devel] Re: Unfillable paragraph with AUCTeX 11.86


From: Ralf Angeli
Subject: [AUCTeX-devel] Re: Unfillable paragraph with AUCTeX 11.86
Date: Sun, 05 Dec 2010 22:44:09 +0100

* 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
@@ -2041,10 +2041,22 @@
                   (/= (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
+                          macro-end (1+ macro-end))))
+         ;; Heuristic: If an opening brace is encountered, search for
+         ;; both the opening and the closing brace as an end marker.
+         ;; Like that the function should work for \verb|...| as well
+         ;; as for \url{...}.
+         (when (string= delimiter TeX-grop)
+           (setq delimiter (concat delimiter TeX-grcl)))
+         (goto-char (1+ macro-end))
+         (skip-chars-forward (concat "^" delimiter))
          (when (<= orig (point))
            (cons beg (1+ (point)))))))))
 

-- 
Ralf



reply via email to

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