auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] \verb like macro allowing input on more than one line


From: jfbu
Subject: Re: [AUCTeX] \verb like macro allowing input on more than one line
Date: Thu, 16 Oct 2014 16:12:53 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

Le 16/10/2014 14:06, Tassilo Horn a écrit :
Hi Jean-Francois,

yes, I've forgotten a `regex-opt' there:

--8<---------------cut here---------------start------------->8---
(defvar fjbu/LaTeX-verbatim-macros-with-delims-local
   '("everb"))

(defun fjbu/LaTeX-activate-font-lock-for-multiline-verb-macros ()
   (add-to-list 'font-latex-syntactic-keywords
               `(,(concat "\\\\\\(?:" (regexp-opt 
fjbu/LaTeX-verbatim-macros-with-delims-local) "\\)"
                          "\\(address@hidden)\\(?:\n\\|.\\)*?"
                          "\\(" (regexp-quote TeX-esc) "*\\)\\(\\1\\)")
                 (1 "\"") (2 ".") (3 "\""))))

(add-hook 'LaTeX-mode-hook
          #'fjbu/LaTeX-activate-font-lock-for-multiline-verb-macros)
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo


Hi Tassilo,

your help is greatly appreciated, thanks,

I only had the problem that I did not see at first that you had
dropped "-multiline-" from the variable name compared to
your earlier defun var fjbu/...

Although  an elisp quasi illiterate I went through the daring step
of replacing fjbu by jfbu throughout your code... and it worked ;-)

I only have now to find why doctex-mode does not react, only
latex-mode, (if I open my .dtx, it defaults to DocTeX mode,
where for some reason the hook above is not executed, I have
to do M-x latex-mode. If I open in a buffer a .tex file, no
problem)

I add background on my motivation:

I sometimes need to use \verb with arguments containing spaces.

However, then very often fill-paragraph or similar M-q or whatever
is bound to my F11 key would split the \verb argument across two
lines, and error on next latex compilation.

I got horripiled by this enough that I decided to configure my
own \verb which would not obey spaces nor lines, and not complain
if it found a line ending.

This is was the starting point but my story now turns
very confused, because the \everb I was referring
to is not that evolution of \verb but another truly
multiline verbatim thing which I found some advantages
not to code as environment.

Anyway, thanks again for the solution you have brought to my query

best,
Jean-François







reply via email to

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