config

Personal configuration.
git clone git://code.dwrz.net/config
Log | Files | Refs

lsp-tex.el (2256B)


      1 ;;; lsp-tex.el --- description -*- lexical-binding: t; -*-
      2 
      3 ;; Copyright (C) 2020 emacs-lsp maintainers
      4 
      5 ;; Author: emacs-lsp maintainers
      6 ;; Keywords: lsp, tex
      7 
      8 ;; This program is free software; you can redistribute it and/or modify
      9 ;; it under the terms of the GNU General Public License as published by
     10 ;; the Free Software Foundation, either version 3 of the License, or
     11 ;; (at your option) any later version.
     12 
     13 ;; This program is distributed in the hope that it will be useful,
     14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
     15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16 ;; GNU General Public License for more details.
     17 
     18 ;; You should have received a copy of the GNU General Public License
     19 ;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
     20 
     21 ;;; Commentary:
     22 
     23 ;; LSP Clients for the Tex Typesetting Language.
     24 
     25 ;;; Code:
     26 
     27 (require 'lsp-mode)
     28 
     29 (defgroup lsp-tex nil
     30   "LSP support for TeX and friends, using Digestif and texlab."
     31   :group 'lsp-mode
     32   :link '(url-link "https://github.com/astoff/digestif/")
     33   :link '(url-link "https://github.com/latex-lsp/texlab"))
     34 
     35 (defcustom lsp-tex-server 'texlab
     36   "Choose LSP tex server."
     37   :type '(choice (const :tag "texlab" texlab)
     38                  (const :tag "digestif" digestif))
     39   :group 'lsp-tex)
     40 
     41 (defcustom lsp-clients-digestif-executable "digestif"
     42   "Command to start the Digestif language server."
     43   :group 'lsp-tex
     44   :risky t
     45   :type 'file)
     46 
     47 (lsp-register-client
     48  (make-lsp-client :new-connection (lsp-stdio-connection lsp-clients-digestif-executable)
     49                   :major-modes '(plain-tex-mode latex-mode context-mode texinfo-mode)
     50                   :priority (if (eq lsp-tex-server 'digestif) 1 -1)
     51                   :server-id 'digestif))
     52 
     53 (defcustom lsp-clients-texlab-executable "texlab"
     54   "Command to start the texlab language server."
     55   :group 'lsp-tex
     56   :risky t
     57   :type 'file)
     58 
     59 (lsp-register-client
     60  (make-lsp-client :new-connection (lsp-stdio-connection lsp-clients-texlab-executable)
     61                   :major-modes '(plain-tex-mode latex-mode)
     62                   :priority (if (eq lsp-tex-server 'texlab) 1 -1)
     63                   :server-id 'texlab))
     64 
     65 (lsp-consistency-check lsp-tex)
     66 
     67 (provide 'lsp-tex)
     68 ;;; lsp-tex.el ends here