[Top][All Lists]

[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 
    >          (let* ((dir (substring style (match-beginning 1) (match-end 1)))
    >                 (style (substring style (match-beginning 2) (match-end 
    >                 (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 
    >                                         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) 
    >          ;; 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!


reply via email to

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