;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304\305\306#\210\307\310\311\312\313DD\314\315\316\317\320\321\322& \210\307\323\311\312\324DD\325\315\316\317\326\321\327& \207" [require ess-custom ess-inf flymake project nil t custom-declare-variable ess-r-flymake-linters funcall function #[0 "\300\207" [("closed_curly_linter = NULL" "commas_linter = NULL" "commented_code_linter = NULL" "infix_spaces_linter = NULL" "line_length_linter = NULL" "object_length_linter = NULL" "object_name_linter = NULL" "object_usage_linter = NULL" "open_curly_linter = NULL" "pipe_continuation_linter = NULL" "single_quotes_linter = NULL" "spaces_inside_linter = NULL" "spaces_left_parentheses_linter = NULL" "trailing_blank_lines_linter = NULL" "trailing_whitespace_linter = NULL")] 1] "Default linters to use.\nCan be either a string with R expression to be used as\nis (e.g. 'lintr::default_linters'). Or a list of strings where\neach element is passed as argument to 'lintr::with_defaults'." :group ess-R :type (choice string (repeat string)) :package-version (ess . "18.10") ess-r-flymake-lintr-cache #[0 "\300\207" [t] 1] "If non-nil, cache lintr results." boolean (ess . "18.10")] 10) (defvar ess-r--flymake-proc nil nil) (make-variable-buffer-local 'ess-r--flymake-proc) #@46 Location of the .lintr file for this buffer. (defvar ess-r--lintr-file nil (#$ . 1362)) (make-variable-buffer-local 'ess-r--lintr-file) (defvar ess-r--flymake-def-linter (replace-regexp-in-string "[\n ]+" " " "esslint <- function(str, ...) {\n if (!suppressWarnings(require(lintr, quietly=T))) {\n cat('@@error: @@`lintr` package not installed')\n } else {\n if (packageVersion('lintr') <= '1.0.2') {\n cat('@@error: @@Need `lintr` version > v1.0.2')\n } else {\n tryCatch(lintr::lint(commandArgs(TRUE), ...),\n error = function(e) {\n cat('@@warning: @@', e)\n })\n }\n }\n};")) #@183 Return the absolute path to the .lintr file. Check first the current directory, then the project root, then the user's home directory. Return nil if we couldn't find a .lintr file. (defalias 'ess-r--find-lintr-file #[0 "\301\302\303\"!\203\302\303\"\207\304\305!\203 \305 \203 \302\303\305 A\"\207\304\306!\203;\307 \203;\306\307 !\203;\302\303\306\307 !@\"\207\301\302\303\310\311!\"!\205L\302\303\310\311!\"\207" [default-directory file-readable-p expand-file-name ".lintr" fboundp ess-r-package-project project-roots project-current getenv "HOME"] 5 (#$ . 2069)]) #@114 If `ess-r-flymake-linters' is a string, use that. Otherwise, construct a string to pass to lintr::with_defaults. (defalias 'ess-r--flymake-linters #[0 "\301\302\303;\203\f\202\304\305\306\307#\310Q#\207" [ess-r-flymake-linters replace-regexp-in-string "[\n ]+" " " "lintr::with_defaults(" mapconcat identity ", " ")"] 8 (#$ . 2654)]) #@41 Transform STR into log level. (fn STR) (defalias 'ess-r--flymake-msg-type #[257 "\211\300\230\203\301\207\211\302\230\203\303\207\211\304\230\203\305\207\306\307\"\207" ["error: " :error "warning: " :warning "style: " :note error "Invalid msg type %s"] 4 (#$ . 3001)]) #@64 Check for critical errors and return non-nil if such occurred. (defalias 'ess-r--flymake-check-errors #[0 "eb\210\300\301\302\303#\205 \304\305\306!!\307\310\225d\"\311\312#\210\313=\266\202\207" [re-search-forward "@@\\(\\(error\\|warning\\): \\)@@" nil t ess-r--flymake-msg-type match-string 1 buffer-substring-no-properties 0 flymake--log-1 ess-r-flymake :error] 6 (#$ . 3284)]) #@193 Parse the content of MSG-BUFFER for lint locations. SRC-BUFFER is the original source buffer. Collect all messages into a list and call REPORT-FN on it. (fn MSG-BUFFER SRC-BUFFER REPORT-FN) (defalias 'ess-r--flymake-parse-output #[771 "rq\210\300 \203rq\210\301\302\303\304#)\202meb\210\305\211\211\211\211\211\306\307\305\304#\203f\310\311!\262\312\310\313!!\312\310\314!!\315\n#\266\202\262\211A\262\242\262\316\310\317!!\262\320  %C\244\262\305\262\202!\266\305)\207" [ess-r--flymake-check-errors remove-hook flymake-diagnostic-functions ess-r-flymake t nil search-forward-regexp "^:\\(?1:[[:digit:]]+\\):\\(?2:[[:digit:]]+\\): \\(?3:\\(?:\\(?:error\\|style\\|warning\\): \\)\\)\\(?4:.+\\)$" match-string 4 string-to-number 1 2 flymake-diag-region ess-r--flymake-msg-type 3 flymake-make-diagnostic] 16 (#$ . 3677)]) #@135 A Flymake backend for ESS-R modes. Relies on the lintr package. REPORT-FN is flymake's callback function. (fn REPORT-FN &rest ARGS) (defalias 'ess-r-flymake #[385 "\306!\204 \307\310\"\210\311 !\203\312 !\210\n\313=\203*\314 \204*\315!\210\316\317\320 \"\207p\321\322\323\324\325\326\327\330\331\332!\333 \334\335\336\337\340\341\f\205F\342\f\343Q \344\f?\205Q\345\346 P.\205W\347\350\260\351\352ed\"\257\n\353\354\355#&\f\211\207" [inferior-ess-r-program ess-r--flymake-proc ess-use-flymake inferior-R-program ess-r--lintr-file ess-r--flymake-def-linter executable-find error "Cannot find program '%s'" process-live-p kill-process process ess-process-live-p nil mapc delete-overlay flymake--overlays make-process :name "ess-r-flymake" :noquery t :connection-type pipe :buffer generate-new-buffer " *ess-r-flymake*" :command "--no-save" "--no-restore" "--no-site-file" "--no-init-file" "--slave" "-e" "options(lintr.linter_file = \"" "\");" "esslint(commandArgs(TRUE)" ", linters = " ess-r--flymake-linters ", cache = TRUE" ")" "--args" buffer-substring-no-properties :sentinel make-closure #[514 "\302!\303=\203(\304\305\"\216\306\307\301\"=\203 \310\311!\301\300#\202&\312\313\314\315$)\207\302!\316=?\2056\317\311!!\207" [V0 V1 process-status exit make-closure #[0 "\301\302\300!!\207" [V0 kill-buffer process-buffer] 3] buffer-local-value ess-r--flymake-proc ess-r--flymake-parse-output process-buffer flymake--log-1 :warning ess-r-flymake "Canceling obsolete check %s" run kill-buffer] 7 "\n\n(fn PROC EVENT)"] ess-r-flymake-lintr-cache] 26 (#$ . 4543)]) #@79 Setup flymake for ESS. Activate flymake only if `ess-use-flymake' is non-nil. (defalias 'ess-r-setup-flymake #[0 "\205+ \305W\203\306\307!\210\n\310\230\205+\311 \312\313\314\315\316$\210\317\304!\205%\f?\205+\320 \207" [ess-use-flymake emacs-major-version ess-dialect ess-r--lintr-file flycheck-mode 26 error "ESS-flymake requires Emacs version 26 or later" "R" ess-r--find-lintr-file add-hook flymake-diagnostic-functions ess-r-flymake nil t boundp flymake-mode] 5 (#$ . 6140)]) (byte-code "\301X\203 \302\303\304\"\210\305\306!\207" [emacs-major-version 26 add-hook ess-mode-hook ess-r-setup-flymake provide ess-r-flymake] 3)