Skip to content

Commit

Permalink
revert(ltex): remove server commands
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed May 23, 2023
1 parent faec1c5 commit f02b0a7
Showing 1 changed file with 9 additions and 30 deletions.
39 changes: 9 additions & 30 deletions modules/extras/me-eglot-ltex.el
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,18 @@

;;; Code:

(defvar-local eglot-ltex-language "auto")
(defvar eglot-ltex-user-rules-path (concat minemacs-local-dir "eglot/ltex/"))
(defgroup minemacs-eglot-ltex nil
"LTeX-LS related settings."
:group 'minemacs)

(defvar ltex-ls-command "ltex-ls")
(defvar ltex-ls-server-port 40001)
(defvar ltex-ls-server-process-name "ltex-ls-server")
(defvar ltex-ls--process nil)
(defvar-local eglot-ltex-language "auto")

;;;###autoload
(defun ltex-ls-start ()
"Start LTeX-LS as a TCP server at port `ltex-ls-server-port' on \"localhost\"."
(interactive)
(if (eq (process-status ltex-ls-server-process-name) 'run)
(message "LTeX-LS server already running!")
(if (executable-find ltex-ls-command)
(setq ltex-ls--process
(make-process
:name ltex-ls-server-process-name
:buffer (format " *%s*" ltex-ls-server-process-name)
:command (list ltex-ls-command "--server-type=TcpSocket" (format "--port=%d" ltex-ls-server-port))))
(user-error "LTeX-LS command \"%s\" not found." ltex-ls-command))
(if (process-live-p ltex-ls--process)
(message "Started LTeX-LS TCP server successfuly.")
(user-error "Cannot start LTeX-LS TCP server."))))

(defun ltex-ls-stop ()
"Stop LTeX-LS server if running."
(interactive)
(if (not (process-live-p ltex-ls--process))
(message "No running instance of LTeX-LS server!")
(delete-process ltex-ls--process)
(message "LTeX-LS server stopped.")))
(defcustom eglot-ltex-user-rules-path (concat minemacs-local-dir "eglot/ltex/")
"Path to save user rules."
:group 'minemacs-eglot-ltex
:type 'directory)

;; Load serialized rules
(defvar eglot-ltex-dictionary
(+deserialize-sym 'eglot-ltex-dictionary eglot-ltex-user-rules-path))

Expand Down

0 comments on commit f02b0a7

Please sign in to comment.