[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-AUCTeX] 11.88; TeX-region-create uses `find-file-noselect'
From: |
Massimo Lauria |
Subject: |
Re: [Bug-AUCTeX] 11.88; TeX-region-create uses `find-file-noselect' |
Date: |
Tue, 18 Nov 2014 10:43:06 +0100 |
Hi Tassilo,
thank you for the quick reply.
The link provided in the my original message contains the discussion
from emacs.stackexchange.com I was pointed to when I told about this
problem
there.
They suggested to file a bug to AUCTeX.
I am not at all an elisp programmer, but I guess
that with-temp-buffer and with-temp-file are friends here.
E.g.
(with-temp-buffer
(insert-file-contents "hello.txt")
(setq temp (buffer-string))
(with-temp-file "hello2.txt"
(insert temp)
))
which works even if "hello2.,txt" is actually "hello.txt".
Of course I don't know exactly what it is supposed to happen in the
actual creation/manipulation of _region_.tex so this snippet may not
help you at all.
2014-11-18 9:36 GMT+01:00 Tassilo Horn <address@hidden>:
> Massimo Lauria <address@hidden> writes:
>
> Hi Massimo,
>
>> When AUCTeX creates LaTeX buffers anhd files with `TeX-region-create'
>> it uses the function `find-file-noselect', which is wrong since it
>> triggers all modes and hooks that should not be triggered in such a
>> case.
>
> What's the alternative? Since it compares the contents of the old
> region file with the new region, there's no way not to find the old
> region file.
>
> But hooks and stuff could be omitted by using the RAWFILE argument of
> `find-file-noselect'. Oh, but then the buffer is unibyte and you run
> into problems if you region contains multibyte chars...
>
> Ok, so now I disabled the major-mode search, local variables, and
> find-file hooks when finding the region file. That should hopefully
> work for you.
>
> Bye,
> Tassilo
--
Massimo Lauria
KTH Royal Institute of Technology
School of Computer Science and Communication
Osquars Backe 2, SE-100 44 Stockholm, Sweden
+46 (0) 73 8008 125 (Cell.)
httlp://www.csc.kth.se/~lauria/