[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX-devel] Small patch for subfiles.el
From: |
Uwe Brauer |
Subject: |
Re: [AUCTeX-devel] Small patch for subfiles.el |
Date: |
Mon, 20 Feb 2017 13:32:23 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
Hi Arash,
> Hi Mosè,
> Mosè Giordano <address@hidden> writes:
[...]
> @Uwe: Can you try copy/paste this into you one of your sub files and
> eval them?
> \begin{verbatim}
> (defun TeX-load-style (style)
> "Search for and load each definition for STYLE in `TeX-style-path'."
> (cond ((assoc style TeX-style-hook-list)) ; We already found it
> ((string-match "\\`\\(.+[/\\]\\)\\([^/\\]*\\)\\'" style) ;Complex
path
> (let* ((dir (substring style (match-beginning 1) (match-end 1)))
> (style (substring style (match-beginning 2) (match-end
2)))
> (master-dir (if (stringp TeX-master)
> (file-name-directory
> (file-relative-name TeX-master))
> "./"))
> (TeX-style-path (append (list (expand-file-name
> TeX-auto-local dir)
> (expand-file-name
> TeX-auto-local master-dir)
> (expand-file-name
> TeX-style-local dir)
> (expand-file-name
> TeX-style-local
master-dir))
> TeX-style-path)))
> ;; (TeX-load-style style)
> ;; start possible fix
> (dolist (name TeX-style-path)
> (TeX-load-style-file (expand-file-name style name)))
> ;; end possible fix
> ))
> (t ;Relative path
> ;; Insert empty list to mark the fact that we have searched.
> (setq TeX-style-hook-list (cons (list style)
TeX-style-hook-list))
> ;; Now check each element of the path
> (dolist (name TeX-style-path)
> (TeX-load-style-file (expand-file-name style name))))))
> (TeX-run-style-hooks
> (file-name-sans-extension
> (cadr (assoc "subfiles" LaTeX-provided-class-options))))
> \end{verbatim}
I just did. I restarted emacs, entered a subfiles with that path
structure, the style subfiles.el was not loaded.
I evaluated your lisp code and voila: it works like charm, subfiles.el
is loaded and supports the editing as it should.
Thanks very much
This is indeed great!
Uwe
Re: [AUCTeX-devel] Small patch for subfiles.el, Mosè Giordano, 2017/02/18
Re: [AUCTeX-devel] Small patch for subfiles.el, Ikumi Keita, 2017/02/20
Re: [AUCTeX-devel] Small patch for subfiles.el, Mosè Giordano, 2017/02/20
Re: [AUCTeX-devel] Small patch for subfiles.el, Arash Esbati, 2017/02/20
Re: [AUCTeX-devel] Small patch for subfiles.el, Mosè Giordano, 2017/02/20
Re: [AUCTeX-devel] Small patch for subfiles.el, Arash Esbati, 2017/02/20