Skip to content

Commit

Permalink
fix compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Jan 31, 2025
1 parent 9843512 commit fc394cf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
9 changes: 7 additions & 2 deletions Eask
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@
(source "melpa")
(source "jcs-elpa")

(depends-on "emacs" "26.1")
(depends-on "emacs" "27.1")
(depends-on "lsp-mode")
(depends-on "github-tags")
(depends-on "github-tags") ; TODO: Move to `development' scope?

(development
(depends-on "markdown-mode"))

(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432

(add-hook 'eask-before-compile-hook
(lambda ()
(setq byte-compile-error-on-warn t
byte-compile-docstring-max-column 1000)))
37 changes: 19 additions & 18 deletions lsp-ltex.el
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ https://github.com/valentjn/ltex-ls"
(defcustom lsp-ltex-active-modes
'( text-mode
bibtex-mode context-mode
latex-mode LaTeX-mode ;; AUCTeX 14+ has renamed latex-mode to LaTeX-mode
latex-mode LaTeX-mode ; AUCTeX 14+ has renamed latex-mode to LaTeX-mode
markdown-mode gfm-mode
org-mode
rst-mode)
"List of major mode that work with LTEX Language Server."
:type 'list
:type '(list symbol)
:group 'lsp-ltex)

(defvar lsp-ltex--filename nil "File base name.")
Expand All @@ -80,8 +80,9 @@ https://github.com/valentjn/ltex-ls"

(defcustom lsp-ltex-enabled nil
"Controls whether the extension is enabled."
:type '(choice (const :tag "None" nil)
list)
:type '(choice (const :tag "false" nil)
(const :tag "true" t)
(vector string))
:group 'lsp-ltex)

(defcustom lsp-ltex-language "en-US"
Expand All @@ -91,45 +92,45 @@ https://github.com/valentjn/ltex-ls"

(defcustom lsp-ltex-dictionary nil
"Lists of additional words that should not be counted as spelling errors."
:type 'list
:type 'string
:group 'lsp-ltex)

(defcustom lsp-ltex-disabled-rules nil
"Lists of rules that should be disabled (if enabled by default by
LanguageTool)."
:type 'list
:type 'string
:group 'lsp-ltex)

(defcustom lsp-ltex-enabled-rules nil
"Lists of rules that should be enabled (if disabled by default by
LanguageTool)."
:type 'list
:type 'string
:group 'lsp-ltex)

(defcustom lsp-ltex-hidden-false-positives nil
"Lists of false-positive diagnostics to hide."
:type 'list
:type 'string
:group 'lsp-ltex)

(defcustom lsp-ltex-bibtex-fields nil
"List of BibTEX fields whose values are to be checked in BibTEX files."
:type 'list
:type 'string
:group 'lsp-ltex)

(defcustom lsp-ltex-latex-commands nil
"List of LATEX commands to be handled by the LATEX parser, listed together
with empty arguments."
:type 'list
:type 'string
:group 'lsp-ltex)

(defcustom lsp-ltex-latex-environments nil
"List of names of LATEX environments to be handled by the LATEX parser."
:type 'list
:type 'string
:group 'lsp-ltex)

(defcustom lsp-ltex-markdown-nodes nil
"List of Markdown node types to be handled by the Markdown parser."
:type 'list
:type 'string
:group 'lsp-ltex)

(defcustom lsp-ltex-additional-rules-enable-picky-rules nil
Expand Down Expand Up @@ -287,10 +288,10 @@ The editor need to send a completion request."
"Return non-nil if CMD executed succesfully with ARGS."
(save-window-excursion
(lsp-ltex--mute-apply
(= 0 (shell-command (concat cmd " "
(mapconcat #'shell-quote-argument
(cl-remove-if #'null args)
" ")))))))
(= 0 (shell-command (concat cmd " "
(mapconcat #'shell-quote-argument
(cl-remove-if #'null args)
" ")))))))

(defun lsp-ltex--plist-keys (plist)
"Return the keys of PLIST."
Expand Down Expand Up @@ -343,7 +344,7 @@ Return the deserialized object, or nil if the SYM.el file dont exist."
(set rules-plist (list lang [])))
(plist-put (eval rules-plist) lang
(vconcat (list rule) (plist-get (eval rules-plist) lang)))
(when-let (out-file (lsp-ltex--serialize-symbol rules-plist lsp-ltex-user-rules-path))
(when-let* ((out-file (lsp-ltex--serialize-symbol rules-plist lsp-ltex-user-rules-path)))
(lsp-message "[INFO] Rule for language %s saved to file \"%s\"" (symbol-name lang) out-file)))

(defun lsp-ltex-combine-plists (&rest plists)
Expand Down Expand Up @@ -392,7 +393,7 @@ This is use to active language server and check if language server's existence."
(defun lsp-ltex--latest-version ()
"Return the latest version from remote repository."
(when (featurep 'github-tags)
(when-let ((response (ignore-errors (github-tags lsp-ltex-repo-path))))
(when-let* ((response (ignore-errors (github-tags lsp-ltex-repo-path))))
(let ((names (plist-get (cdr response) :names))
(index 0) version ver)
;; Loop through tag name and fine the stable version
Expand Down

0 comments on commit fc394cf

Please sign in to comment.