;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (custom-declare-group 'wcheck nil "General interface for text checkers." :group 'applications) (defconst wcheck--language-data-customize-interface '(choice :format "%[Option%] %v" (cons :tag "Program" :format "%v" (const :tag "Program" :format "%t: " program) (choice :format "%[Type%] %v" (file :tag "Filename" :format "\n %t: %v") (function :tag "Function" :format "\n %t: %v"))) (cons :tag "Arguments" :format "%v" (const :format #1="" args) (repeat :tag "Arguments" (string :format "%v"))) (cons :tag "Output parser function" :format "%v" (const :tag "Output parser" :format "%t: " parser) (choice :format "%[Parser%] %v" :value nil (const :tag "Lines" wcheck-parser-lines) (const :tag "Whitespace" wcheck-parser-whitespace) (function :tag "Custom function" :format "%t:\n %v"))) (cons :tag "Connection type" :format "%v" (const :tag "Connection: " :format "%t" connection) (choice :format "%[Type%] %v" :value nil (const :tag "pipe (nil)" nil) (const :tag "pty" :match (lambda (widget value) (or (eq value t) (eq value 'pty))) pty))) (cons :tag "Face" :format "%v" (const :tag "Face" :format "%t: " face) (symbol :format "%v")) (cons :tag "Syntax table" :format "%v" (const :tag "Syntax table" :format "%t: " syntax) (variable :format "%v")) (cons :tag "Regexp start" :format "%v" (const :tag "Regexp start" :format "%t: " regexp-start) (regexp :format "%v")) (cons :tag "Regexp body" :format "%v" (const :tag "Regexp body" :format "%t: " regexp-body) (regexp :format "%v")) (cons :tag "Regexp end" :format "%v" (const :tag "Regexp end" :format "%t: " regexp-end) (regexp :format "%v")) (cons :tag "Regexp discard" :format "%v" (const :tag "Regexp discard" :format "%t: " regexp-discard) (regexp :format "%v")) (cons :tag "Regexp case" :format "%v" (const :tag "Regexp" :format "%t: " case-fold) (choice :format "%[Case%] %v" :value nil :match (lambda (widget value) t) :value-to-internal (lambda (widget value) (if value t nil)) (const :tag "sensitive" nil) (const :tag "insensitive" t))) (cons :tag "Read or skip faces" :format "%v" (const :tag "Read or skip faces" :format "%t" read-or-skip-faces) (repeat :tag #1# (cons :format "%v" (choice :format "%[Major mode%] %v" (const :tag "All major modes" :match (lambda (widget value) (null value)) nil) (repeat :tag "Select major modes" :match (lambda (widget value) (or (symbolp value) (consp value))) :value-to-internal (lambda (widget value) (if (symbolp value) (list value) value)) :value-to-external (lambda (widget value) (if (and (consp value) (symbolp (car value)) (null (cdr value))) (car value) value)) (symbol :format "%v"))) (choice :format "%[Operation mode%] %v" (const :tag "Read everything" nil) (cons :tag "Read selected faces" :format "%v" (const :tag "Read selected faces" :format "%t" read) (repeat :tag #1# (sexp :format "%v"))) (cons :tag "Skip selected faces" :format "%v" (const :tag "Skip selected faces" :format "%t" skip) (repeat :tag #1# (sexp :format "%v"))))))) (cons :tag "Action program" :format "%v" (const :tag "Action program" :format "%t: " action-program) (choice :format "%[Type%] %v" (file :tag "Filename" :format "\n %t: %v") (function :tag "Function" :format "\n %t: %v"))) (cons :tag "Action program's arguments" :format "%v" (const :format #1# action-args) (repeat :tag "Action program's arguments" (string :format "%v"))) (cons :tag "Action parser function" :format "%v" (const :tag "Action parser" :format "%t: " action-parser) (choice :format "%[Parser%] %v" :value nil (const :tag "Ispell" wcheck-parser-ispell-suggestions) (const :tag "Lines" wcheck-parser-lines) (const :tag "Whitespace" wcheck-parser-whitespace) (function :tag "Custom function" :format "%t:\n %v"))) (cons :tag "Action autoselect mode" :format "%v" (const :tag "Action autoselect" :format "%t: " action-autoselect) (choice :format "%[Mode%] %v" :value nil :match (lambda (widget value) t) :value-to-internal (lambda (widget value) (if value t nil)) (const :tag "off" nil) (const :tag "on" t))))) (byte-code "\301\302\303\304\305DD\306\307\310\311\312\313\314\315\316\312\317\320\321\322\257\257D&\207" [wcheck--language-data-customize-interface custom-declare-variable wcheck-language-data funcall function #[0 "\300\207" [nil] 1] "Language configuration for `wcheck-mode'.\n\nThe variable is an association list (alist) and its elements are\nof the form:\n\n (LANGUAGE (KEY . VALUE) [(KEY . VALUE) ...])\n\nLANGUAGE is a name string for this particular configuration unit\nand KEY and VALUE pairs denote settings for the language.\n\nBelow is the documentation of possible KEYs and corresponding\nVALUEs. The documentation is divided in two parts: checker\noptions and action options. The first part describes all options\nrelated to checking the content of an Emacs buffer (and possibly\nmarking some of it). The second part describes options which\nconfigure actions which user can choose for a marked text on\nbuffer.\n\nNOTE: There is also variable `wcheck-language-data-defaults'\nwhich is used to define default values. The defaults are used\nwhen a language-specific option in `wcheck-language-data' does\nnot exist or is not valid.\n\n\nChecker options\n---------------\n\nThe checker options configure LANGUAGE's text-checking and\ntext-marking features. With these you can configure how buffer's\ncontent is examined, what checker engine is used and how text is\nmarked in the buffer.\n\nprogram\nargs\n `program' is either the name (a string) of an external\n executable program or an Emacs Lisp function (a symbol or a\n lambda expression). They are used as the checker engine for\n the LANGUAGE. When `program' names an external executable\n program then `args' are the command-line arguments (a list of\n strings) for the program.\n\n `wcheck-mode' collects text strings from the buffer and sends\n them to `program' to analyze. When `program' is an external\n executable program the collected strings are sent (each on a\n separate line) through the standard input stream to the\n program. The program must write to standard output stream all\n the strings which it thinks should be marked in the Emacs\n buffer. The output of the program is then parsed with\n `parser' function (see below).\n\n When `program' is an Emacs Lisp function (a symbol or a\n lambda expression) the function is called with one argument:\n a list of strings collected from the buffer. The function is\n supposed to check them and return a list of strings (or nil).\n The returned strings will be marked in the buffer.\n\n See options `regexp-start', `regexp-body' and `regexp-end'\n below for details on how text is collected from the buffer.\n\nparser\n VALUE of this option is an Emacs Lisp function which is\n responsible for parsing the output of `program'. This parser\n function is only used when `program' is an external\n executable program (not a function).\n\n The parser function is run without arguments and within the\n context of a buffer that contains all the output from the\n external program. The point is located at the beginning of\n the buffer. From that buffer the `parser' function should\n collect all the strings that are meant to be marked in the\n buffer that is being checked. The function must return them\n as a list of strings or nil if there are none to be marked.\n\n For the most common cases there are two parser functions\n already implemented:\n\n `wcheck-parser-lines' turns each line in program's output\n to a separate string. You should use this function as the\n output parser if you spell-check with Ispell-like program\n with its \"-l\" command-line option. They output each\n misspelled word on a separate line. This is the default\n output parser.\n\n `wcheck-parser-whitespace' turns each whitespace-\n separated token in the output to a separate string.\n\nconnection\n The VALUE is used to set variable `process-connection-type'\n when starting the process for LANGUAGE. If the VALUE is nil\n use a pipe for communication; if it's `pty' (or t) use a PTY.\n The default is to use a pipe (nil). (This option is ignored\n when the program is a function.)\n\nface\n A symbol referring to the face which is used to mark text with\n this LANGUAGE. The default is `wcheck-default-face'.\n\nsyntax\n VALUE is a variable (a symbol) referring to an Emacs syntax\n table. This option temporarily sets the effective syntax\n table when buffer's content is scanned with `regexp-start',\n `regexp-body', `regexp-end' and `regexp-discard' (see below)\n as well as when `program', `parser', `action-program' and\n `action-parser' functions are called. The default value is\n `text-mode-syntax-table'. This option does not affect syntax\n table settings anywhere else. See the Info node\n `(elisp)Syntax Tables' for more information on the topic.\n\nregexp-start\nregexp-body\nregexp-end\n Regular expression strings which match the start of a string\n body, characters within the body and the end of the body,\n respectively.\n\n This is how they are used in practice: `wcheck-mode' scans\n buffer's content and looks for strings that match the\n following regular expression\n\n REGEXP-START\\(REGEXP-BODY\\)REGEXP-END\n\n The regular expression back reference \\1 is used to extract\n `regexp-body' part from the matched string. That string is\n then matched against `regexp-discard' (see below) and if it\n doesn't match the string is sent to the text checker program\n or function to analyze.\n\n Strings returned from the program or function are quoted for\n regular expression special characters (with `regexp-quote'\n function) and marked in Emacs buffer using the following\n construction: `regexp-start + STRING + regexp-end'. The\n STRING part is marked with `face' (see above).\n\n You can't use grouping constructs `\\( ... \\)' in\n `regexp-start' because the back reference `\\1' is used for\n separating the `regexp-body' match string from the\n `regexp-start' and `regexp-end' match strings. You can use\n \"shy\" groups `\\(?: ... \\)' which do not record the\n matched substring. Grouping constructs `\\( ... \\)' are\n allowed in `regexp-body' and `regexp-end'. Just note that the\n first group and back reference \\1 is already taken.\n\n The default values for the regular expressions are\n\n \\=\\<\\='* (regexp-start)\n \\w+? (regexp-body)\n \\='*\\=\\> (regexp-end)\n\n Effectively they match a series of word characters defined in\n the effective syntax table. Single quotes (\\=') at the start\n and end of a word are excluded. This is probably a good thing\n when using `wcheck-mode' as a spelling checker.\n\nregexp-discard\n The string that matched `regexp-body' is then matched against\n the value of this option. If this regular expression matches,\n then the string is discarded and won't be sent to the\n text-checker program or function to analyze. You can use this\n to define exceptions to the `regexp-body' match. The default\n value is\n\n \\\\=`\\='+\\\\='\n\n which discards the body string if it consists only of single\n quotes. This was chosen as the default because the default\n syntax table `text-mode-syntax-table' defines single quote as\n a word character. It's probably not useful to mark individual\n single quotes in a buffer when `wcheck-mode' is used as a\n spelling checker.\n\n If you don't want to have any discarding rules set this\n option to empty string (\"\").\n\ncase-fold\n This boolean value is used to temporarily bind the value of\n variable `case-fold-search'. The nil value means\n case-sensitive and a non-nil means case-insensitive search.\n The default is case-sensitive (nil). This option is effective\n with `regexp-start', `regexp-body', `regexp-end' and\n `regexp-discard' as well as when `program', `parser',\n `action-program' and `action-parser' functions are called.\n\nread-or-skip-faces\n This option controls which faces `wcheck-mode' should read or\n skip when scanning buffer's content. The value must be a list\n and its items are also lists:\n\n (MAJOR-MODE [OPERATION-MODE [FACE ...]])\n\n MAJOR-MODE is a symbol or a list of symbols. Symbols refer to\n the major mode(s) which the settings are for. Use nil as the\n MAJOR-MODE to define default settings. Settings that come\n after the pseudo major-mode nil are ignored.\n\n OPERATION-MODE is symbol `read' or `skip' defining whether\n the FACEs should be read or skipped. If it's `read' then only\n the listed faces are read. If it's `skip' then the listed\n faces are skipped and all other faces are read. If there is\n no OPERATION-MODE at all (i.e., the list has just one\n element, MAJOR-MODE) then everything is read.\n\n The rest of the items are FACEs. They are typically symbols\n but some Emacs modes may use strings, property lists or cons\n cells for defining faces. For more information see Info\n node `(elisp) Special Properties'. Use nil as the face to\n refer to the normal text which does not have a face text\n property.\n\n Example:\n\n (read-or-skip-faces\n ((emacs-lisp-mode c-mode) read\n font-lock-comment-face font-lock-doc-face)\n (org-mode skip font-lock-comment-face org-link)\n (text-mode)\n (nil read nil))\n\n It says that in `emacs-lisp-mode' and `c-mode' only the text\n which have been highlighted with `font-lock-comment-face' or\n `font-lock-doc-face' is read (i.e., checked). In `org-mode'\n faces `font-lock-comment-face' and `org-link' are\n skipped (i.e., not checked) and all other faces are read. In\n `text-mode' everything is read. Finally, in all other major\n modes only the normal text (nil) is read.\n\n Most likely not all `read-or-skip-faces' settings are\n specific to a certain language so it could be more useful to\n put them in variable `wcheck-language-data-defaults' instead.\n That way they are used with all languages. Normally the\n global default is equivalent to\n\n (read-or-skip-faces\n (nil))\n\n which means that in all major modes read everything. It is\n sometimes useful to have this setting in language-specific\n options because the parsing stops right there. Therefore it\n overrides all global settings which user may have changed\n with variable `wcheck-language-data-defaults'.\n\n Note: You can use command `\\[what-cursor-position]' with a\n prefix argument to see what faces are active at the cursor\n position. Then you can use the information to configure this\n option.\n\n\nAction options\n--------------\n\n\"Actions\" are any kind of operations that can be executed for\nmarked text in an Emacs buffer. Actions are presented to user\nthrough a menu which is activated either by (1) clicking the\nright mouse button on a marked text or (2) executing interactive\ncommand `wcheck-actions' while the cursor (the point) is on a\nmarked text.\n\nIf you use `wcheck-mode' as a spelling checker then it's natural\nto configure an action menu that offers spelling suggestions for\nthe misspelled word. The action menu could also have an option to\nadd the word to spell-checker's dictionary, so that the word is\nrecognized next time.\n\naction-program\naction-args\n `action-program' is either the name (a string) of an external\n executable program or an Emacs Lisp function (a symbol or a\n lambda expression). When it's the name of an executable\n program then `action-args' are the command-line arguments (a\n list of strings) for the program.\n\n When `action-program' is an external executable program the\n marked text is sent to the program through the standard input\n stream. The program should send its feedback data (usually\n suggested substitute strings) to the standard output stream.\n The output is parsed with `action-parser' function (see\n below) and function's return value is used to construct an\n action menu for user. The format and effect of\n `action-parser' function's return value is described below.\n\n When `action-program' is an Emacs Lisp function the function\n is called with one argument: a vector returned by\n `wcheck-marked-text-at' function. The `action-program'\n function is supposed to gather some substitute suggestion\n strings or give other actions for the marked text in the\n buffer. Function's return value is used to construct an\n action menu for user. The format and effect of\n `action-program' function's return value is described below.\n\naction-parser\n VALUE of this option is an Emacs Lisp function which is\n responsible for parsing the output of `action-program'. This\n parser function is only used when `action-program' is an\n external executable program (not a function).\n\n The parser function is run with one argument: a vector\n returned by `wcheck-marked-text-at' for the marked text in\n question. The parser function is called within the context of\n a buffer that contains all the output from `action-program'.\n The point is located at the beginning of the buffer.\n\n The `action-parser' function should examine the buffer for\n interesting information (such as spelling suggestions) and\n return them in the format that is described below.\n\n For the most common cases there are three parser functions\n already implemented:\n\n `wcheck-parser-ispell-suggestions' parses substitute\n suggestions from the output of Ispell or compatible\n program, such as Enchant. Use this function as the\n `action-parser' if you get spelling suggestions from an\n Ispell-like program with its \"-a\" command-line option.\n\n `wcheck-parser-lines' function turns each line in the\n output to individual substitute suggestions.\n\n `wcheck-parser-whitespace'. Each whitespace-separated\n token in the program's output is a separate suggestion.\n\naction-autoselect\n If this option is non-nil and the action menu has only one\n menu item then the item is chosen automatically without\n actually showing the menu. If this option is nil (which is\n the default) then the menu is always shown.\n\n\nThe return value of `action-program' function and `action-parser'\nfunction must be a list. The empty list (nil) means that there\nare no actions available for the marked text. Otherwise each\nelements in the list must be either a string or a cons cell. If\nan element is a string it is an individual substitute suggestion\nstring for the original marked text. The same string is shown in\nthe actions menu. When user chooses such option from the action\nmenu the original text is substituted in the Emacs buffer.\n\nIf an element is a cons cell it must be one of\n\n (\"Menu item\" . \"substitute string\")\n (\"Menu item\" . some-function)\n\nThe \"car\" value of the cons cell must be a string. The string\nis shown in the action menu as one of the options. The \"cdr\"\nvalue of the cons cell defines the action that is taken for the\nmenu option. If the \"cdr\" value is a string then that string is\nthe substitute string. If the \"cdr\" value is a function (a\nsymbol or a lambda expression) then that function is called when\nuser chooses the menu option. The function is called with one\nargument: a vector returned by `wcheck-marked-text-at' function\nfor the marked text in question.\n\nEffectively `action-program' function or `action-program'\nexecutable program with `action-parser' function provide a\nfeature that can offer spelling suggestions for user: just return\nsuggestions as a list of strings. Alternatively they can offer\nany kind of useful actions by calling custom functions. There are\na lot of possibilities.\n\n\nFor configuration examples, see the README file in URL\n`https://github.com/tlikonen/wcheck-mode'." :group wcheck :type repeat list :format "%v" (string :tag "Language") :inline t :tag "Options"] 18) #@219 Hard-coded default language configuration for `wcheck-mode'. This constant is for Wcheck mode's internal use only. This provides useful defaults if both `wcheck-language-data' and `wcheck-language-data-defaults' fail. (defconst wcheck--language-data-defaults-hard-coded '((parser . wcheck-parser-lines) (connection) (face . wcheck-default-face) (syntax . text-mode-syntax-table) (regexp-start . "\\<'*") (regexp-body . "\\w+?") (regexp-end . "'*\\>") (regexp-discard . "\\`'+\\'") (case-fold) (read-or-skip-faces (nil)) (action-autoselect)) (#$ . 20731)) (byte-code "\301\302\303\304\305DD\306\307\310\311\312D&\210\301\313\303\304\314DD\315\311\316\307\310&\210\317\313!\210\320\321\322\323\307\310%\207" [wcheck--language-data-customize-interface custom-declare-variable wcheck-language-data-defaults funcall function #[0 "\207" [wcheck--language-data-defaults-hard-coded] 1] "Default language configuration for `wcheck-mode'.\nThese default values are used when language-specific settings\ndon't provide a valid value. `wcheck-mode' will choose some\nuseful defaults even if this variable is not (properly) set. See\nvariable `wcheck-language-data' for information about possible\nsettings.\n\nHere's an example value for the variable:\n\n ((parser . wcheck-parser-lines)\n (action-parser . wcheck-parser-ispell-suggestions)\n (connection . nil)\n (face . wcheck-default-face)\n (syntax . text-mode-syntax-table)\n (regexp-start . \"\\\\=\\<\\='*\")\n (regexp-body . \"\\\\w+?\")\n (regexp-end . \"\\='*\\\\=\\>\")\n (regexp-discard . \"\\\\\\=`\\='+\\\\\\='\")\n (case-fold . nil)\n (read-or-skip-faces\n ((emacs-lisp-mode c-mode) read\n font-lock-comment-face font-lock-doc-face)\n (message-mode read nil\n message-header-subject message-cited-text)))" :group wcheck :type repeat wcheck-language #[0 "\300\207" [#1=""] 1 #1#] "Default language for `wcheck-mode'.\n\nNormally the global value defines the language for new buffers.\nIf a buffer-local value exists it is used instead. This variable\nbecomes automatically buffer-local when `wcheck-mode' is turned\non in a buffer, so changing the global value does not affect\nbuffers which already have `wcheck-mode' turned on.\n\nUser is free to set this variable directly (e.g., in programs)\nbut in interactive use it is usually better to use the command\n`\\[wcheck-change-language]' instead. The command can change\nlanguage immediately while `wcheck-mode' is turned on, whereas\nchanging just the value of this variable takes effect only when\n`wcheck-mode' is turned on next time." (string :tag "Default language") make-variable-buffer-local custom-declare-face wcheck-default-face ((t (:underline "red"))) "Default face for marking strings in a buffer.\nThis is used when language does not define a face."] 9) (defvar wcheck-mode nil) #@27 Keymap for `wcheck-mode'. (defvar wcheck-mode-map (make-sparse-keymap) (#$ . 23602)) (defvar wcheck--timer nil) #@46 `wcheck-mode' idle timer delay (in seconds). (defvar wcheck--timer-idle 0.3 (#$ . 23720)) (defvar wcheck--timer-paint-event-count 0) #@348 Run buffer paint event this many times in a row. With too low values all data from external processes may not have arrived and window gets only partially painted. A higher value increases the probability that windows get fully painted but it also makes `wcheck-jump-forward' and `wcheck-jump-backward' slower. A suitable compromise may be 3 or 4. (defvar wcheck--timer-paint-event-count-std 3 (#$ . 23860)) #@56 Language history for command `wcheck-change-language'. (defvar wcheck--change-language-history nil (#$ . 24273)) (defvar wcheck--buffer-data nil) (defvar wcheck--jump-step 5000) #@42 (fn NAME SUPERCLASS &optional MESSAGE) (defalias 'wcheck--define-condition '(macro . #[770 "\300\301\302D\303\304\305\302D\306BB\307\302\nDDEF\301\302D\310F\302DF\207" [progn put quote 'error-conditions append get ('error-conditions) list 'error-message] 12 (#$ . 24457)])) (byte-code "\300\301\302\303#\300\207" [function-put wcheck--define-condition lisp-indent-function defun] 4) #@27 (fn KEY VAR &rest BODY) (defalias 'wcheck--loop-over-reqs-engine '(macro . #[642 "\300\301\302\303\304\305\306\307\310\311 F\312BBE\313BBED\306\314D\315BBEE\207" [dolist delq nil mapcar lambda (buffer) when wcheck--buffer-data-get :buffer buffer (buffer) ((wcheck--buffer-data-get-all :buffer)) buffer-live-p with-current-buffer] 15 (#$ . 24857)])) #@23 (fn VAR &rest BODY) (defalias 'wcheck--loop-over-read-reqs '(macro . #[385 "\300\301BBB\207" [wcheck--loop-over-reqs-engine :read-req] 6 (#$ . 25221)])) (byte-code "\300\301\302\303#\300\207" [function-put wcheck--loop-over-read-reqs lisp-indent-function 1] 4) #@23 (fn VAR &rest BODY) (defalias 'wcheck--loop-over-paint-reqs '(macro . #[385 "\300\301BBB\207" [wcheck--loop-over-reqs-engine :paint-req] 6 (#$ . 25492)])) (byte-code "\300\301\302\303#\300\207" [function-put wcheck--loop-over-paint-reqs lisp-indent-function 1] 4) #@23 (fn VAR &rest BODY) (defalias 'wcheck--loop-over-jump-reqs '(macro . #[385 "\300\301BBB\207" [wcheck--loop-over-reqs-engine :jump-req] 6 (#$ . 25766)])) (byte-code "\300\301\302\303#\300\207" [function-put wcheck--loop-over-jump-reqs lisp-indent-function 1] 4) #@37 (fn VAR-LANG BINDINGS &rest BODY) (defalias 'wcheck--with-language-data '(macro . #[642 "\300\301!\302A@D\303@\205@DC\304\305\306\307\310\311\n!\312\"\313\314%\"\"BBB\207" [make-symbol "--wck-language--" let* append mapcar make-byte-code 257 "\2119\203\211\301\300\302DED\207\211\205\"\211<\205\"\211@\301\300\302A@DED\207" vconcat vector [wcheck-query-language-data quote] 6 "\n\n(fn VAR)"] 15 (#$ . 26037)])) (byte-code "\300\301\302\303#\304\305\306\307\310\306N\305C\"#\210\304\305\311\312#\210\304\313\306\307\305\306N\313C\"#\210\304\313\311\312#\210\304\314\306\307\305\306N\314C\"#\210\304\314\311\312#\210\304\315\306\307\305\306N\315C\"#\210\304\315\311\312#\210\304\316\306\307\305\306N\316C\"#\210\304\316\311\312#\210\304\317\306\307\305\306N\317C\"#\210\304\317\311\312#\210\304\320\306\307\317\306N\320C\"#\210\304\320\311\312#\210\304\321\306\307\317\306N\321C\"#\210\304\321\311\312#\210\304\322\306\307\305\306N\322C\"#\210\304\322\311\312#\207" [function-put wcheck--with-language-data lisp-indent-function 2 put wcheck--error error-conditions append error error-message nil wcheck--language-does-not-exist-error wcheck--program-not-configured-error wcheck--not-a-list-of-strings-error wcheck--funcall-error wcheck--action-error wcheck--action-program-error wcheck--parser-function-not-configured-error wcheck--overlay-not-found-error] 7) #@261 Change language for current buffer (or globally). Change `wcheck-mode' language to LANGUAGE. The change is buffer-local but if GLOBAL is non-nil (prefix argument if called interactively) then change the global default language. (fn LANGUAGE &optional GLOBAL) (defalias 'wcheck-change-language #[513 "\3021:;\2058\211\203\303\300\"\210\2027 \2037\304!\2032\305p\"\210\306p\307\310#\210\311 \210\2027\312\313\"\2100\207\301\314!\210\315\316A\"\207" [wcheck-language wcheck-mode (wcheck--program-not-configured-error) set-default wcheck--program-configured-p wcheck--buffer-lang-proc-data-update wcheck--buffer-data-set :read-req t wcheck--remove-overlays signal wcheck--program-not-configured-error -1 message "Checker program is not configured for language \"%s\""] 6 (#$ . 27423) (byte-code "\303\304\" \203\305\302!\235\203\305\302!\202&\n\235\203 \n\202&\211@\206&\306\307\310 \2030\311\2021\312\"\313\314\313\315& D\207" [wcheck-language-data current-prefix-arg wcheck-language mapcar car default-value "" completing-read format "Global default language (%s): " "Language for the current buffer (%s): " nil t wcheck--change-language-history] 10)]) (defalias 'wcheck--mode-turn-on #[0 "p\3011]\3021N\303!\203\304\305\306\"\202I\307!\204$\304\310\"\202I\311!\2041\304\312\"\202I\313\300!\210\314!\210\315 \210\316\"\210\317 \210\320\321\322#00\202h0\323\324!\210\325\326A\"\262\202h\323\324!\210\325\327A\"\262\207" [wcheck-language (wcheck--language-does-not-exist-error) (wcheck--program-not-configured-error) minibufferp signal wcheck--error "Can't use `wcheck-mode' in a minibuffer" wcheck--language-exists-p wcheck--language-does-not-exist-error wcheck--program-configured-p wcheck--program-not-configured-error make-local-variable wcheck--add-local-hooks wcheck--add-global-hooks wcheck--buffer-lang-proc-data-update wcheck--timer-start wcheck--buffer-data-set :read-req t wcheck-mode -1 message "Checker program is not configured for language \"%s\"" "Language \"%s\" does not exist"] 6]) (defalias 'wcheck--mode-turn-off #[0 "p\300 \210\301\302\"\210\303\304!\204\305 \210\306 \210\307!\207" [wcheck--remove-overlays wcheck--buffer-lang-proc-data-update nil wcheck--buffer-data-get-all :buffer wcheck--timer-stop wcheck--remove-global-hooks wcheck--remove-local-hooks] 4]) (defalias 'wcheck--mode-line-lang #[0 "\3001*\301C\3022\303\304\305\306\307\310!\311\"\312\313%\314\315p\316#\"0\210\317\320\242\237\"\2620\207\210\321\207" [(error) nil enough mapc make-byte-code 257 "\301\302z\"\205\300\300\242B\240\210\300\242G\303Y\205\304\305\306\"\207" vconcat vector [char-equal 119 2 throw enough t] 4 "\n\n(fn C)" wcheck--buffer-data-get :buffer :language apply string ""] 8]) #@91 Non-nil if Wcheck mode is enabled. Use the command `wcheck-mode' to change this variable. (defvar wcheck-mode nil (#$ . 30192)) (make-variable-buffer-local 'wcheck-mode) #@1526 General interface for text checkers. With optional (prefix) ARG turn on the mode if ARG is positive, otherwise turn it off. If ARG is not given toggle the mode. Wcheck is a minor mode for automatically checking and marking strings in Emacs buffer. Wcheck sends (parts of) buffer's content to a text-checker back-end and, relying on its output, decides if some parts of text should be marked. Wcheck can be used with external spell-checker programs such as Ispell and Enchant, but actually any tool that can receive text stream from standard input and send text to standard output can be used. The checker back-end can also be an Emacs Lisp function. Different configuration units are called "languages". See the documentation of variables `wcheck-language-data', `wcheck-language-data-defaults' and `wcheck-language' for information on how to configure Wcheck mode. You can access and configure the variables through customize group `wcheck'. Interactive command `wcheck-change-language' is used to switch languages. Command `wcheck-actions' gives an action menu for the marked text at point (also accessible through the right-click mouse menu). Commands `wcheck-jump-forward' and `wcheck-jump-backward' move point to next/previous marked text area. A note for Emacs Lisp programmers: Emacs Lisp function `wcheck-marked-text-at' returns information about marked text at a buffer position. Function `wcheck-query-language-data' can be used for querying effective configuration data for any language. (fn &optional ARG) (defalias 'wcheck-mode #[256 "\301 \302=\203 ?\202\303!\304V\3051&\203 \306 \202\"\307 0\2021\300\310!\210\311\312A\"\262\210\313\314\203<\315\202=\316\"\210\317\320!\203a\301 \203Q\211\301 \232\203a\321\311\322\203\\\323\202]\324#\266\210\325 \210\207" [wcheck-mode current-message toggle prefix-numeric-value 0 (wcheck--error) wcheck--mode-turn-on wcheck--mode-turn-off -1 message "%s" run-hooks wcheck-mode-hook wcheck-mode-on-hook wcheck-mode-off-hook called-interactively-p any " in current buffer" "Wcheck mode %sabled%s" "en" "dis" force-mode-line-update] 7 (#$ . 30370) (byte-code "\206\301C\207" [current-prefix-arg toggle] 1)]) (defvar wcheck-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\305\306\307\310\211%\207" [wcheck-mode-map wcheck-mode-hook variable-documentation put "Hook run after entering or leaving `wcheck-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" add-minor-mode wcheck-mode (" W:" (:eval (wcheck--mode-line-lang))) nil] 6) #@61 Start `wcheck-mode' idle timer if it's not running already. (defalias 'wcheck--timer-start #[0 "?\205\f\302 \303\304#\211\207" [wcheck--timer wcheck--timer-idle run-with-idle-timer t wcheck--timer-read-event] 4 (#$ . 32991)]) #@32 Stop `wcheck-mode' idle timer. (defalias 'wcheck--timer-stop #[0 "\205 \301!\210\302\211\207" [wcheck--timer cancel-timer nil] 2 (#$ . 33226)]) #@28 (fn FUNCTION &rest ARGS) (defalias 'wcheck--funcall-after-idle #[385 "\301\302\303 \\\304%\207" [wcheck--timer-idle apply run-with-idle-timer wcheck--current-idle-time-seconds nil] 8 (#$ . 33380)]) #@24 (fn &optional COUNT) (defalias 'wcheck--timer-paint-event-run #[256 "\211\250\203\211]\301V\203\211\211\202\211\302\303!\207S\211\301V\203'\302\303!\207\304 \207" [wcheck--timer-paint-event-count 0 wcheck--funcall-after-idle wcheck--timer-paint-event wcheck--timer-jump-event] 4 (#$ . 33589)]) #@15 (fn BUFFER) (defalias 'wcheck--force-read #[257 "\300\301!\210\302\303\301#\210\304 \207" [redisplay t wcheck--buffer-data-set :read-req wcheck--timer-read-event] 5 (#$ . 33904)]) #@399 Send windows' content to checker program or function. This function is usually called by the `wcheck-mode' idle timer. The function walks through all windows which belong to buffers that have requested update. It reads windows' content and sends it checker program or function associated with the buffer's language. Finally, this function starts another idle timer for marking strings in buffers. (defalias 'wcheck--timer-read-event #[0 "\301\302\303\304\305\306!\"\"\211\203\211@\307!\203xr\211q\210\310\306\311#\204w\312\313\302#\210\312\314\302#\210\312\315\302#\210\302C\302\316\317\320\321\322\323\"\324\"\325\326%\327\330#\210\331\242!\312\315#\210\211\211\203o\211@\332\333@A#\"\262A\266\202\202U\266\334\"\266)A\266\202\202 \210\335!\207" [wcheck--timer-paint-event-count-std delq nil mapcar #[257 "\300\301\302#\205 \211\207" [wcheck--buffer-data-get :buffer :read-req] 5 "\n\n(fn BUFFER)"] wcheck--buffer-data-get-all :buffer buffer-live-p wcheck--buffer-data-get :jump-req wcheck--buffer-data-set :read-req :strings :areas walk-windows make-byte-code 257 "\300\302!=\205\301\303!\304\305\"B\301\242B\240\207" vconcat vector [window-buffer window-start window-end t] 6 "\n\n(fn WINDOW)" nomb t wcheck--combine-overlapping-areas append wcheck--read-strings wcheck--send-strings wcheck--timer-paint-event-run] 12 (#$ . 34094)]) #@217 Send STRINGS for the process that handles BUFFER. STRINGS is a list of strings to be sent as input for the external process which handles BUFFER. Each string in STRINGS is sent as separate line. (fn BUFFER STRINGS) (defalias 'wcheck--send-strings #[514 "\301\302\303#\304\305\"\304\306\"\304\307\"\3101\326\3111\305\301\302\312#\204(;\203R\313\314!\315\316\317#\317P\"\210\3201Mr\321\301\302\312#!q\210\322 )0\202\300\210\323\202\300\324!\205\300\325!\205\300rq\210\326 \327\330\331\332\333!\334\"\335$\216\3361\227\337 p\327\330\340\332\333\"\341\"\342$\216\343\344!!\210!)\266\2020\202\234\210\345\346\323\")\262\347!\203\271\211\205\275\350\351#\210\350\352\353#\202\275\345\354\323\"\262)00\202\3320\210rq\210\355\356!\210\357\360!)\202\332\210\357\361!)\207" [case-fold-search wcheck--buffer-data-get :buffer :language wcheck-query-language-data program syntax case-fold (wcheck--funcall-error) (wcheck--not-a-list-of-strings-error) :process process-send-string wcheck--start-get-process mapconcat identity "\n" (error) process-buffer erase-buffer nil functionp buffer-live-p match-data make-byte-code 0 "\301\300\302\"\207" vconcat vector [set-match-data evaporate] 3 (error) syntax-table "r\301q\210\302\300!)\207" [set-syntax-table] 2 set-syntax-table eval signal wcheck--funcall-error wcheck--list-of-strings-p wcheck--buffer-data-set :strings :paint-req t wcheck--not-a-list-of-strings-error wcheck-mode -1 message "Checker function did not return a list of strings (or nil)" "Checker function signaled an error"] 15 (#$ . 35477)]) #@69 `wcheck-mode' process output handler function. (fn PROCESS STRING) (defalias 'wcheck--receive-strings #[514 "\301\302\303#\301\302\304#\305\306\"\305\307\"\305\310\"\311!\205\274rq\210\3121\264\3131\253\314!\203\230r\315!q\210\212db\210c\210\316 \317\320\321\322\323!\324\"\325$\216\212eb\210\3261u\327 p\317\320\330\322\323\"\331\"\332$\216\333\334!!\210 )\266\2020\202z\210\335\336\337\"*\262\211\205\222\340!\205\222\341\342#\210\341\343\344#\262*\202\246\345\346!\210\335\347\350\351\352!\"\"00\202\2730\353\354!\262\202\273\353\355A\"\262))\266\203\207" [case-fold-search wcheck--buffer-data-get :process :buffer :language wcheck-query-language-data parser syntax case-fold buffer-live-p (wcheck--error) (wcheck--funcall-error) wcheck--process-running-p process-buffer match-data make-byte-code 0 "\301\300\302\"\207" vconcat vector [set-match-data evaporate] 3 (error) syntax-table "r\301q\210\302\300!)\207" [set-syntax-table] 2 set-syntax-table eval signal wcheck--funcall-error nil wcheck--list-of-strings-p wcheck--buffer-data-set :strings :paint-req t wcheck-mode -1 wcheck--error format "Process is not running for buffer \"%s\"" buffer-name message "Checker output parser function signaled an error" "%s"] 16 (#$ . 37077)]) #@167 Mark strings in windows. This is normally called by the `wcheck-mode' idle timer. This function marks (with overlays) strings in the buffers that have requested it. (defalias 'wcheck--timer-paint-event #[0 "\301\302\303\304\305\306!\"\"\211\203]\211@\307!\203Vr\211q\210\310\306\311#\204$\312 \210\313\314\302#\210\203U\310\306\315#\211\203T\211@\316@A\310\306\317#\310\306 \311#%\210A\266\202\2023\210)A\266\202\202 \210\320 \207" [wcheck-mode delq nil mapcar #[257 "\300\301\302#\205 \211\207" [wcheck--buffer-data-get :buffer :paint-req] 5 "\n\n(fn BUFFER)"] wcheck--buffer-data-get-all :buffer buffer-live-p wcheck--buffer-data-get :jump-req wcheck--remove-overlays wcheck--buffer-data-set :paint-req :areas wcheck--paint-strings :strings wcheck--timer-paint-event-run] 13 (#$ . 38364)]) (defalias 'wcheck--timer-jump-event #[0 "\301\302!\210\303\304\305\306\307\310!\"\"\211\205\211@\311!\203r\211q\210\312\310\313#\314!\315!\316!\317\313\304#\210\3201\375V\203\225\321\"\211\203w\322!\203[\323!=\203[\324\325!\"\210\202`\325!b\210\326`!\203i\327 \210\330\331\332`!\"\210\333!\202\220dW\203\214\334TT\\$\202\220\335\336\304\"\262\202\371W\203\365\337\"\211\203\327\322!\203\273\323!=\203\273\324\340!\"\210\202\300\340!b\210\326`!\203\311\327 \210\330\331\332`!\"\210\333!\202\360eV\203\354\334SSZ$\202\360\335\336\304\"\262\202\371\335\336\304\"0\202\210\330\341!\210\333!\266)A\266\202\202 \207" [wcheck--jump-step require outline delq nil mapcar #[257 "\300\301\302#\205 \211\207" [wcheck--buffer-data-get :buffer :jump-req] 5 "\n\n(fn BUFFER)"] wcheck--buffer-data-get-all :buffer buffer-live-p wcheck--buffer-data-get :jump-req wcheck--jump-req-start wcheck--jump-req-bound wcheck--jump-req-window wcheck--buffer-data-set (wcheck--overlay-not-found-error) wcheck--overlay-next window-live-p window-buffer set-window-point overlay-end invisible-p outline-show-entry message "Found from line %s" line-number-at-pos wcheck--force-read wcheck--jump-req signal wcheck--overlay-not-found-error wcheck--overlay-previous overlay-start "Found nothing"] 13]) #@15 (fn BUFFER) (defalias 'wcheck--add-local-hooks #[257 "r\211q\210\300\211\205\211@\301@A\302\303$\210A\266\202\202\262)\207" [((kill-buffer-hook . wcheck--hook-kill-buffer) (window-scroll-functions . wcheck--hook-window-scroll) (after-change-functions . wcheck--hook-after-change) (change-major-mode-hook . wcheck--hook-change-major-mode) (outline-view-change-hook . wcheck--hook-outline-view-change)) add-hook nil t] 8 (#$ . 40533)]) #@15 (fn BUFFER) (defalias 'wcheck--remove-local-hooks #[257 "r\211q\210\300\211\205\211@\301@A\302#\210A\266\202\202\262)\207" [((kill-buffer-hook . wcheck--hook-kill-buffer) (window-scroll-functions . wcheck--hook-window-scroll) (after-change-functions . wcheck--hook-after-change) (change-major-mode-hook . wcheck--hook-change-major-mode) (outline-view-change-hook . wcheck--hook-outline-view-change)) remove-hook t] 7 (#$ . 40983)]) (defalias 'wcheck--add-global-hooks #[0 "\300\211\205\211@\301@A\"\210A\266\202\202\207" [((window-size-change-functions . wcheck--hook-window-size-change) (window-configuration-change-hook . wcheck--hook-window-configuration-change)) add-hook] 5]) (defalias 'wcheck--remove-global-hooks #[0 "\300\211\205\211@\301@A\"\210A\266\202\202\207" [((window-size-change-functions . wcheck--hook-window-size-change) (window-configuration-change-hook . wcheck--hook-window-configuration-change)) remove-hook] 5]) #@131 `wcheck-mode' hook for window scroll. Request update for the buffer when its window have been scrolled. (fn WINDOW WINDOW-START) (defalias 'wcheck--hook-window-scroll #[514 "r\301!q\210\205\302p\303\304#)\207" [wcheck-mode window-buffer wcheck--buffer-data-set :read-req t] 6 (#$ . 41950)]) #@122 `wcheck-mode' hook for window size change. Request update for the buffer when its window's size has changed. (fn FRAME) (defalias 'wcheck--hook-window-size-change #[257 "\300\301\302#\207" [walk-windows #[257 "r\301!q\210\205\302p\303\304#)\207" [wcheck-mode window-buffer wcheck--buffer-data-set :read-req t] 5 "\n\n(fn WINDOW)"] nomb] 5 (#$ . 42253)]) #@128 `wcheck-mode' hook for window configuration change. Request update for the buffer when its window's configuration has changed. (defalias 'wcheck--hook-window-configuration-change #[0 "\300\301\302\303#\207" [walk-windows #[257 "r\301!q\210\205\302p\303\304#)\207" [wcheck-mode window-buffer wcheck--buffer-data-set :read-req t] 5 "\n\n(fn WINDOW)"] nomb currentframe] 4 (#$ . 42620)]) #@129 `wcheck-mode' hook for buffer content change. Request update for the buffer when its content has been edited. (fn BEG END LEN) (defalias 'wcheck--hook-after-change #[771 "\205 \301p\302\303#\207" [wcheck-mode wcheck--buffer-data-set :read-req t] 7 (#$ . 43016)]) #@110 `wcheck-mode' hook for outline view change. Request update for the buffer when its outline view has changed. (defalias 'wcheck--hook-outline-view-change #[0 "\205 \301p\302\303#\207" [wcheck-mode wcheck--buffer-data-set :read-req t] 4 (#$ . 43289)]) #@99 `wcheck-mode' hook for kill-buffer operation. Turn off `wcheck-mode' when buffer is being killed. (defalias 'wcheck--hook-kill-buffer #[0 "\300\301!\207" [wcheck-mode -1] 2 (#$ . 43547)]) #@94 `wcheck-mode' hook for major mode change. Turn off `wcheck-mode' before changing major mode. (defalias 'wcheck--hook-change-major-mode #[0 "\300\301!\207" [wcheck-mode -1] 2 (#$ . 43741)]) #@207 Start or get external process for BUFFER. Start a new process or get already existing process for BUFFER. Return the object of that particular process or nil if the operation was unsuccessful. (fn BUFFER) (defalias 'wcheck--start-get-process #[257 "\301\302\303#\206J\301\302\304#\305\306\"\305\307\"\305\310\"\311!\205G\312\313\314\315%\316\303#\210\317\320\"\210\321\322\323\324 !\325Q!\"\210\326\315\"\210\211\262)\266\203\207" [process-connection-type wcheck--buffer-data-get :buffer :process :language wcheck-query-language-data program args connection wcheck--program-executable-p apply start-process "wcheck" nil wcheck--buffer-data-set set-process-filter wcheck--receive-strings set-process-buffer generate-new-buffer " *wcheck-process <" buffer-name ">*" set-process-query-on-exit-flag] 11 (#$ . 43937)]) #@221 Update process and language data for BUFFER. Calling this function is the primary way to maintain the language and process data associated to BUFFER. If LANGUAGE is nil remove BUFFER from the list. (fn BUFFER LANGUAGE) (defalias 'wcheck--buffer-lang-proc-data-update #[514 "\300!\203~\211;\204\211\204~\301\302\303\304!\"\303\305!\211\2035\211@\306!\203*\307!\203.\310!\210A\266\202\202\210\203T\311\305\"\204E\312!\210\313\314#\210\313\304\302#\210\202X\310!\210\301\302\303\304!\"\211\203|\211@\211>\204u\315\316!!\210\317!\210A\266\202\202_\266\311\305\"\207" [bufferp remq nil wcheck--buffer-data-get-all :process :buffer buffer-live-p minibufferp wcheck--buffer-data-delete wcheck--buffer-data-get wcheck--buffer-data-create wcheck--buffer-data-set :language kill-buffer process-buffer delete-process] 9 (#$ . 44777)]) #@329 Return a list of text elements in BUFFER. Scan BUFFER between positions BEG and END and search for text elements according to buffer's language settings (see `wcheck-language-data'). If INVISIBLE is non-nil read all buffer areas, including invisible ones. Otherwise skip invisible text. (fn BUFFER BEG END &optional INVISIBLE) (defalias 'wcheck--read-strings #[1027 "\304!\205\337rq\210\212\203$\212\305\306!\203\306\202\307^]\"\210)\310\311\312#\211\313\314\"\313\315\"\313\316\"\313\317\"\313\320\"\313\321\"\322\323\260\324\n\"\325\326\325\327 p\330\326\331\332\333\"\334\"\335$\216\336\337 !!\210b\210\340 \330\326\341\332\333!\342\"\343$\216\344\345#\203\320`V\203\320\204\254\346\347\224!\203\254\350\347\224\351$b\210\202\312 \203\312 \352\232\204\303\353\n\354\347!\"\204\312\354\347!B\262`\262\202\202)\210)\266\355!)\266\205)\266\207*\207" [font-lock-mode case-fold-search major-mode search-spaces-regexp buffer-live-p fboundp font-lock-ensure font-lock-fontify-region wcheck--buffer-data-get :buffer :language wcheck-query-language-data regexp-start regexp-body regexp-end regexp-discard syntax case-fold "\\(" "\\)" wcheck--generate-face-predicate nil 0 syntax-table make-byte-code "r\301q\210\302\300!)\207" vconcat vector [set-syntax-table] 2 set-syntax-table eval match-data "\301\300\302\"\207" [set-match-data evaporate] 3 re-search-forward t invisible-p 1 next-single-char-property-change invisible "" string-match match-string-no-properties delete-dups] 25 (#$ . 45643)]) #@275 Mark strings in buffer. Mark all strings in STRINGS which are visible in BUFFER within position range from BEG to END. If INVISIBLE is non-nil paint all buffer areas, including invisible ones. Otherwise skip invisible text. (fn BUFFER BEG END STRINGS &optional INVISIBLE) (defalias 'wcheck--paint-strings #[1284 "\303!\205\363rq\210\212\304\305\306#\211\307\310\"\307\311\"\307\312\"\307\313\"\307\314\"\307\315\"\316 \"\317\320 \317\211\211\211\203Q\321\322\323#\210\321\324\325#\210\326\262\327\262\330 p\331\332\333\334\335\"\336\"\337$\216\340\341 !!\210\342 \331\332\343\334\335!\344\"\345$\216\211\205\344\211@\346\347!\350\260\262\332\262b\210\351\352#\203\335`V\203\335\204\277\353\354\224!\203\277\355\354\224\356$b\210\202\327 \203\327\357  \354\224\354\225&\210`\262\202\224A\266\202\202z\262)\262)\266\202)\266\207)\266\207*\207" [case-fold-search major-mode search-spaces-regexp buffer-live-p wcheck--buffer-data-get :buffer :language wcheck-query-language-data regexp-start regexp-end syntax case-fold face action-program wcheck--generate-face-predicate nil make-sparse-keymap define-key [down-mouse-3] wcheck--mouse-click-overlay [mouse-3] undefined highlight "mouse-3: show actions" syntax-table make-byte-code 0 "r\301q\210\302\300!)\207" vconcat vector [set-syntax-table] 2 set-syntax-table eval match-data "\301\300\302\"\207" [set-match-data evaporate] 3 "\\(" regexp-quote "\\)" re-search-forward t invisible-p 1 next-single-char-property-change invisible wcheck--make-overlay] 32 (#$ . 47211)]) #@20 (fn START BOUND) (defalias 'wcheck--overlay-next #[514 "dY?\205]\3002]\301!\211\203'\211@\302\303\"\203 \304\300\"\210A\266\202\202\210\305!\211\262\205Z\211d^W\205Z\301!\211\203V\211@\302\303\"\203O\304\300\"\210A\266\202\202=\210\202)\2620\207" [overlay overlays-at overlay-get wcheck-mode throw next-overlay-change] 8 (#$ . 48814)]) #@20 (fn START BOUND) (defalias 'wcheck--overlay-previous #[514 "eX?\205>\3002>\301!\262\302!\211\203-\211@\303\304\"\203&\305\300\"\210A\266\202\202\210\211e]X\203\f\305\300\306\"\210\202\f\207" [overlay previous-overlay-change overlays-at overlay-get wcheck-mode throw nil] 8 (#$ . 49184)]) #@12 (fn POS) (defalias 'wcheck--line-start-at #[257 "\212\211b\210\300 )\207" [line-beginning-position] 2 (#$ . 49497)]) #@12 (fn POS) (defalias 'wcheck--line-end-at #[257 "\212\211b\210\300 )\207" [line-end-position] 2 (#$ . 49622)]) #@34 (fn BUFFER WINDOW START BOUND) (defalias 'wcheck--jump-req #[1028 "U?\205Srq\210\211V\203\301\202\302!\262\303\304\305!\305!#\210\306\307\310##\210\306\311^]BC#\210\312\313^]\314$\"\210\315!)\207" [wcheck--timer-paint-event-count-std wcheck--line-end-at wcheck--line-start-at message "Searching in lines %d-%d..." line-number-at-pos wcheck--buffer-data-set :jump-req wcheck--jump-req-create :areas wcheck--send-strings wcheck--read-strings t wcheck--timer-paint-event-run] 11 (#$ . 49739)]) #@23 (fn BUFFER BEG END) (defalias 'wcheck--invisible-text-in-area-p #[771 "\30028^]\301!\203\302\300\303\"\210\304\300#\211\262\2055W\2055\301!\203\302\300\303\"\210\202\266\2020\207" [invisible invisible-p throw t next-single-char-property-change] 9 (#$ . 50273)]) #@46 Move point forward to next marked text area. (defalias 'wcheck-jump-forward #[0 "p\302 \204 \300\303!\210\205F\304\305\306#\210\307`\310\302 \311\"\"\211\2032\312`\313!#\2042\313!b\202Dm\203<\314\315!\202D\316`` \\$\262\207" [wcheck-mode wcheck--jump-step selected-window 1 wcheck--buffer-data-set :jump-req nil wcheck--overlay-next window-end t wcheck--invisible-text-in-area-p overlay-end message "End of buffer" wcheck--jump-req] 9 (#$ . 50564) nil]) #@51 Move point backward to previous marked text area. (defalias 'wcheck-jump-backward #[0 "p\302 \204 \300\303!\210\205E\304\305\306#\210\307`\310\302 !\"\211\2031\311`\312!#\2041\312!b\202Co\203;\313\314!\202C\315`` Z$\262\207" [wcheck-mode wcheck--jump-step selected-window 1 wcheck--buffer-data-set :jump-req nil wcheck--overlay-previous window-start wcheck--invisible-text-in-area-p overlay-start message "Beginning of buffer" wcheck--jump-req] 9 (#$ . 51040) nil]) #@532 Return information about marked text at POS. POS is a buffer position. The return value is a vector of five elements: (1) the marked text string, (2) buffer position at the beginning of the text, (3) position at the end of the text, (4) the overlay object which marks the text and (5) the current language as a string. The return value is nil if there are no marked text at POS. If you need more information about the current language settings use `wcheck-query-language-data' for querying effective language settings. (fn POS) (defalias 'wcheck-marked-text-at #[257 "\3002#\301!\211\205 \211@\302\303\"\203\304\300\"\210A\266\202\202\2620\211\205>\305!\306!\307\310\"\311\312p\313#%\266\202\207" [my-overlay overlays-at overlay-get wcheck-mode throw overlay-start overlay-end vector buffer-substring-no-properties wcheck--buffer-data-get :buffer :language] 13 (#$ . 51529)]) #@891 Offer actions for marked text. This function is usually called through a right mouse button event or interactively by a user. In both cases function's arguments are filled automatically. If buffer position POS is on marked text (and action program is properly configured) show a menu of actions. When this function is called interactively POS is automatically the current point position. Optional EVENT argument is a mouse event which is present if this function is called through a right mouse button click on marked text. If EVENT is non-nil use a graphic toolkit's menu (when available) for selecting actions. Otherwise use a text menu. When user chooses one of the options from the menu the related action is executed. It could mean that the original marked text is replaced with the chosen substitute. Menu options can trigger any kind of actions, though. (fn POS &optional EVENT) (defalias 'wcheck-actions #[513 "\3011\307\3021\300\3031\270\304!\206\304S!\305\204#\306\307\310\"\210\202\262\311\312H!\311\313H!\314!\211A\204D\315\316H\317\"\203D\211@A\202X\203U\320 \203U\321\"\202X\322!\211;\203\214\323!\203\214\323!\203\214r\324!q\210\203{\306\307\325\"\210\202\210|\210b\210\211c\210\211\262)\202\232\326!\203\232\211!\210\211\262\323!\203\245\305\211\223\210\323!\203\260\305\211\223\210\266\262000\20700\327\330A\"\2070\327\331A\"\207\327\332A\"\207" [buffer-read-only (wcheck--error) (wcheck--parser-function-not-configured-error) (wcheck--action-program-error) wcheck-marked-text-at nil signal wcheck--action-error "There is no marked text here" copy-marker 1 2 wcheck--get-actions wcheck-query-language-data 4 action-autoselect display-popup-menus-p wcheck--choose-action-popup wcheck--choose-action-minibuffer markerp marker-buffer "Buffer is read-only" functionp message "Action program is not configured for language \"%s\"" "Parser function is not configured for language \"%s\"" "%s"] 11 (#$ . 52435) "d"]) #@160 Get actions from external program or a function. MARKED-TEXT must be a vector such as the one returned by `wcheck-marked-text-at' function. (fn MARKED-TEXT) (defalias 'wcheck--get-actions #[257 "\211\301H\211\302\303\"\302\304\"\302\305\"\302\306\"\302\307\"\310 p\311\312\313\314\315\"\316\"\317$\216\320\321!!\210\322!\204@\323\324\"\202\327;\203Q\204Q\323\325\"\202\327;\203\253\326\327!r\211q\210\311\312\330\314\315!\331\"\317$\216 \312Hc\210\332\333ed\n\334\211\335 &\210eb\210\336\337 \311\312\340\314\315!\341\"\342$\216\3431\234\f!0\202\241\210\323\344\345\")\262!*\262\202\327\346!\205\327\336\337 \311\312\340\314\315!\347\"\342$\216\3501\316 !0\202\323\210\323\344\351\")\262!)\266\202)\207" [case-fold-search 4 wcheck-query-language-data action-program action-args action-parser case-fold syntax syntax-table make-byte-code 0 "r\301q\210\302\300!)\207" vconcat vector [set-syntax-table] 2 set-syntax-table eval wcheck--action-program-configured-p signal wcheck--action-program-error wcheck--parser-function-not-configured-error generate-new-buffer " *temp*" "\301\300!\205 \302\300!\207" [buffer-name kill-buffer] apply call-process-region t nil wcheck--clean-actions match-data "\301\300\302\"\207" [set-match-data evaporate] 3 (error) wcheck--funcall-error "Action parser function signaled an error" functionp [set-match-data evaporate] (error) "Action function signaled an error"] 19 (#$ . 54428)]) #@16 (fn ACTIONS) (defalias 'wcheck--clean-actions #[257 "\211<\205\f\300\301\302\303\"\"\207" [delete nil mapcar #[257 "\211;\203 \300!B\207\211:\205*\211@;\205*\301A!\204#\211A;\205*\300@!AB\207" [wcheck--clean-string functionp] 3 "\n\n(fn ITEM)"]] 6 (#$ . 55902)]) #@15 (fn STRING) (defalias 'wcheck--clean-string #[257 "\211\300\232\203\301\207\302\303\300#\262\304\305\"\204\306\207\302\307\300#\207" ["" "[Empty string]" replace-regexp-in-string "[^[:print:]]+" string-match "[^[:space:]]" "[Space or control chars]" "\\(?:\\` +\\| +\\'\\)"] 5 (#$ . 56185)]) #@207 Create a pop-up menu to choose an action. ACTIONS is a list of strings. EVENT is the mouse event that originated this sequence of function calls. Return user's choice (a string) or nil. (fn ACTIONS EVENT) (defalias 'wcheck--choose-action-popup #[514 "\300\301\203 \302\303\"\202\304CBD\305\"\207" ["Choose" "" mapcar #[257 "\300@!AB\207" [wcheck--clean-string] 3 "\n\n(fn ITEM)"] "[No actions]" x-popup-menu] 7 (#$ . 56494)]) #@15 (fn PROMPT) (defalias 'wcheck--read-key #[257 "\300\301!\203\n\301!\207\302!\207" [fboundp read-key read-char] 3 (#$ . 56936)]) #@135 Create a text menu to choose a substitute action. ACTIONS is a list of strings. Return user's choice (a string) or nil. (fn ACTIONS) (defalias 'wcheck--choose-action-minibuffer #[257 "\211\203\306\307\310\311\"\312C\307\313\314\"#\315\316\317!r\211q\210\320\321\322\323\324!\325\"\326$\216\327C\315\330\315\211\203\205\203\205@\262A\262\331\332\333@\"\334\335#\336\337@!\340R\262@ABB\262A\262\211c\210\203-\203-`\341 Z\342@@PG\\\343 V\203-\344\345!\210\346\347!\210\202-\266\344\345!\210eb\210\330\326\330\350\351\321\352ed\"\353 \326Z^\347#!\354\331@@\332\355\307\313\314\">\203\267\356\202\270\357\310U\203\302\360\202\367\307\361\311\">\203\322\332\362\"\202\367\312U\203\334\363\202\367\313U\203\346\364\202\367\307\365\314\">\203\366\332\366\"\202\367\357#\262=#\367p\"\210\370\330\"\210\371!\236A\206\372\373!\210\315*\266\202*\262\207\372\374!\210\315\207" [mode-line-format cursor-type truncate-lines buffer-read-only window-min-height split-window-keep-point append number-sequence 49 57 48 97 122 nil generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 "--- Choose %-" t propertize format "%c)" face bold " " wcheck--clean-string " " line-beginning-position "x) " window-width delete-char -2 newline 1 split-window-vertically - count-lines window-body-height apply "Number %s(%s):" "or letter " "" "1" 50 "1-%c" "1-9,0" "1-9,0,a" 98 "1-9,0,a-%c" set-window-buffer set-window-dedicated-p wcheck--read-key message "Abort" "No actions" minibuffer-prompt-properties] 15 (#$ . 57076)]) #@110 Parser for newline-separated output. Return current buffer's lines as a list of strings. (fn &rest IGNORED) (defalias 'wcheck-parser-lines #[128 "\300\301\302ed\"\303\304#!\207" [delete-dups split-string buffer-substring-no-properties "\n+" t] 6 (#$ . 58711)]) #@161 Parser for whitespace-separated output. Split current buffer's content to whitespace-separated tokens and return them as a list of strings. (fn &rest IGNORED) (defalias 'wcheck-parser-whitespace #[128 "\300\301\302ed\"\303\304#!\207" [delete-dups split-string buffer-substring-no-properties "[ \f \n ]+" t] 6 (#$ . 58980)]) #@82 Parser for Ispell-compatible programs' spelling suggestions. (fn &rest IGNORED) (defalias 'wcheck-parser-ispell-suggestions #[128 "\301\302\303\301\304#\205!\305\306\307!!\310\306\311!\312\304#\313\314\211GZ\"!\266\202)\207" [search-spaces-regexp nil re-search-forward "^& [^ ]+ \\([0-9]+\\) [0-9]+: \\(.+\\)$" t string-to-number match-string-no-properties 1 split-string 2 ", " delete-dups nbutlast] 8 (#$ . 59312)]) #@69 Return a list of faces between positions BEG and END. (fn BEG END) (defalias 'wcheck--collect-faces #[514 "\300\211W\203-\301\302\"\262T\262\203%<\203%\303\"\262\202B\262\202\304!\207" [nil get-text-property face append delete-dups] 8 (#$ . 59741)]) #@62 Return read/skip face settings for MODE. (fn LANGUAGE MODE) (defalias 'wcheck--major-mode-face-settings #[514 "\300\301\"\302\30329\2058\211A\262\242\262\211@\302=\2040@=\2040\211@<\203 @>\203 \304\303\"\210\202 0\207" [wcheck-query-language-data read-or-skip-faces nil answer throw] 7 (#$ . 60021)]) #@120 Return t if a symbol in USER-FACES is found from BUFFER-FACES. Both arguments are lists. (fn USER-FACES BUFFER-FACES) (defalias 'wcheck--face-found-p #[514 "\3002 \211\205\211@\211\235\203\301\300\302\"\210A\266\202\202\2620\207" [found throw t] 7 (#$ . 60347)]) #@283 Generate a face predicate function for scanning buffer. Return a predicate function that is used to decide whether `wcheck-mode' should read or paint text at the current point position with LANGUAGE and MODE. The called predicate function will return a boolean. (fn LANGUAGE MODE) (defalias 'wcheck--generate-face-predicate #[514 "\301\"\211A@AA\204\302\202;\303=\203&\304\305\306\307\310!\311\"\312$\202;\313=\203:\304\305\314\307\310!\315\"\312$\202;\316\207" [font-lock-mode wcheck--major-mode-face-settings #[0 "\300\207" [t] 1] read make-byte-code 0 "\301\300\302\303\224\303\225\"\"\207" vconcat vector [wcheck--face-found-p wcheck--collect-faces 1] 5 skip "\301\300\302\303\224\303\225\"\"?\207" [wcheck--face-found-p wcheck--collect-faces 1] #[0 "\300\207" [t] 1]] 11 (#$ . 60629)]) #@18 (fn KEY VALUE) (defalias 'wcheck--language-data-valid-p #[514 "\300=\203\301\302!\205\303!!\206\220\304=\203 \305!\206\220\306>\203+\211;\206\220\307>\203M\211;\206\220\310!\206\220\211\203M\2119\203M\311\312#\206\220\313=\203Y\314!\206\220\315=\203e\314!\206\220\316>\203}\310!\206\220\211\203}\311\317#\206\220\320>\206\220\321=\203\217\322!\206\220\323\207" [syntax syntax-table-p boundp eval face facep (regexp-start regexp-body regexp-end regexp-discard) (program action-program) functionp error "Invalid %s value: %S" args wcheck--list-of-strings-p action-args (parser action-parser) "%s not a function: %S" (connection case-fold action-autoselect) read-or-skip-faces wcheck--list-of-lists-p nil] 6 (#$ . 61442)]) #@331 Query `wcheck-mode' language data. Return LANGUAGE's value for KEY. Valid keys (symbols) are described in the documentation of user variable `wcheck-language-data'. If that variable does not define a (valid) value for the KEY then query the value from `wcheck-language-data-defaults' or use internal defaults. (fn LANGUAGE KEY) (defalias 'wcheck-query-language-data #[514 "\303!\205X\304!\205\211\305\"A\236\304 !\205 \236\304\n!\205%\n\236\306A\"\205.\306A\"\2057\306A\"\205AE\307=\203R\310\311\312\313\"\"\202V\236A\266\204\207" [wcheck-language-data wcheck-language-data-defaults wcheck--language-data-defaults-hard-coded wcheck--language-exists-p wcheck--list-of-lists-p assoc wcheck--language-data-valid-p read-or-skip-faces apply append mapcar cdr] 11 (#$ . 62218)]) #@71 Return t if LANGUAGE exists in `wcheck-language-data'. (fn LANGUAGE) (defalias 'wcheck--language-exists-p #[257 "\301!\205\211\302\303\"\235\205\211;\205\211G\304V\205\305\207" [wcheck-language-data wcheck--list-of-lists-p mapcar car 0 t] 5 (#$ . 63030)]) #@69 Return non-nil if PROGRAM is executable regular file. (fn PROGRAM) (defalias 'wcheck--program-executable-p #[257 "\211;\205\300!\211\205\301!\205\302!\262\207" [executable-find file-regular-p file-executable-p] 4 (#$ . 63303)]) #@17 (fn LANGUAGE) (defalias 'wcheck--program-configured-p #[257 "\300\301\"\302!\206 \303!\207" [wcheck-query-language-data program wcheck--program-executable-p functionp] 4 (#$ . 63548)]) #@17 (fn LANGUAGE) (defalias 'wcheck--action-program-configured-p #[257 "\300\301\"\302!\206 \303!\207" [wcheck-query-language-data action-program wcheck--program-executable-p functionp] 4 (#$ . 63745)]) #@15 (fn OBJECT) (defalias 'wcheck--list-of-strings-p #[257 "\211<\205\f\300\301\302\">?\207" [nil mapcar stringp] 5 (#$ . 63956)]) #@15 (fn OBJECT) (defalias 'wcheck--list-of-lists-p #[257 "\211<\205\f\300\301\302\">?\207" [nil mapcar listp] 5 (#$ . 64093)]) #@16 (fn PROCESS) (defalias 'wcheck--process-running-p #[257 "\300!\301=\207" [process-status run] 3 (#$ . 64226)]) #@85 Return current idle time in seconds. The returned value is a floating point number. (defalias 'wcheck--current-idle-time-seconds #[0 "\300 \206\301\211@A@\3028\303\304_\305\245#\207" [current-idle-time (0 0 0) 2 + 65536 1000000.0] 9 (#$ . 64346)]) #@298 Combine overlapping items in ALIST. ALIST is a list of (A . B) items in which A and B are integers. Each item denote a buffer position range from A to B. This function returns a new list which has items in increasing order according to A's and all overlapping A B ranges are combined. (fn ALIST) (defalias 'wcheck--combine-overlapping-areas #[257 "\300\301!\302\"\303\211\2036\211\232\204&\262\304\305@A@\"AA\"\262\202\f@B\262A\262\303\262\202\237\207" [sort copy-sequence #[514 "@@W\207" [] 4 "\n\n(fn A B)"] nil append wcheck--combine-two] 8 (#$ . 64608)]) #@12 (fn A B) (defalias 'wcheck--combine-two #[514 "@A@A\203.\203.TY\203(V\203\"\202#BC\202>D\202>\2047C\202>\300C\"\207" [append] 9 (#$ . 65197)]) #@203 Create an overlay to mark text. Create an overlay in BUFFER from range BEG to END. FACE, MOUSE-FACE, HELP-ECHO and KEYMAP are overlay's properties. (fn BUFFER FACE MOUSE-FACE HELP-ECHO KEYMAP BEG END) (defalias 'wcheck--make-overlay #[1799 "\300 #\301\302B\303B\304\305\306\307\310 B\311 B\257 \211\2052\211@\312@A#\210A\266\202\202\262\207" [make-overlay (wcheck-mode . t) face mouse-face (modification-hooks wcheck--remove-changed-overlay) (insert-in-front-hooks wcheck--remove-changed-overlay) (insert-behind-hooks wcheck--remove-changed-overlay) (evaporate . t) keymap help-echo overlay-put] 18 (#$ . 65379)]) #@186 Remove `wcheck-mode' overlays from current buffer. If optional arguments BEG and END exist remove overlays from range BEG to END. Otherwise remove all overlays. (fn &optional BEG END) (defalias 'wcheck--remove-overlays #[512 "\300\301\302$\207" [remove-overlays wcheck-mode t] 7 (#$ . 66018)]) #@92 Hook for removing overlay which is being edited. (fn OVERLAY AFTER BEG END &optional LEN) (defalias 'wcheck--remove-changed-overlay #[1284 "?\205\300!\207" [delete-overlay] 7 (#$ . 66321)]) #@122 Overlay mouse-click event. Send the mouse pointer position and mouse event to the `wcheck-actions' function. (fn EVENT) (defalias 'wcheck--mouse-click-overlay #[257 "\300\301\302!!\"\207" [wcheck-actions posn-point event-end] 5 (#$ . 66523) "e"]) (defconst wcheck--buffer-data-keys '(:buffer :process :language :read-req :paint-req :jump-req :areas :strings)) #@58 Return the index of KEY in buffer data object. (fn KEY) (defalias 'wcheck--buffer-data-key-index #[257 "\301\3022)\211\203%\211@=\203\303\302\"\210\202T\262A\266\202\202\304\2620\207" [wcheck--buffer-data-keys 0 answer throw nil] 7 (#$ . 66892)]) #@85 Create data instance for BUFFER. But only if it doesn't exist already. (fn BUFFER) (defalias 'wcheck--buffer-data-create #[257 "\302\303\"?\205\304G\305\"\211\306\303!I\210\211 B\211\262\207" [wcheck--buffer-data-keys wcheck--buffer-data wcheck--buffer-data-get :buffer make-vector nil wcheck--buffer-data-key-index] 5 (#$ . 67162)]) #@52 Delete all data associated to BUFFER. (fn BUFFER) (defalias 'wcheck--buffer-data-delete #[257 "\301\302!\303\304\305\306\307\310\311\312  \"\313\"\314\315%\"\"\211\207" [wcheck--buffer-data wcheck--buffer-data-key-index :buffer delq nil mapcar make-byte-code 257 "\300\301H=?\205\n\211\207" vconcat vector [] 4 "\n\n(fn ITEM)"] 12 (#$ . 67510)]) #@193 Query the first matching KEY VALUE pair and return TARGET-KEY. If optional TARGET-KEY is not given return all data associated with the matching KEY VALUE. (fn KEY VALUE &optional TARGET-KEY) (defalias 'wcheck--buffer-data-get #[770 "\30124\302!\211\205/\211@H\232\203(\303\301\203%\302!H\202&\"\210A\266\202\202\262\2620\207" [wcheck--buffer-data answer wcheck--buffer-data-key-index throw] 11 (#$ . 67870)]) #@102 Return every buffer's value for KEY. If KEY is nil return all buffer's all data. (fn &optional KEY) (defalias 'wcheck--buffer-data-get-all #[256 "\211\203\301!\302\303\304\305\306\307!\310\"\311\312%\"\207\207" [wcheck--buffer-data wcheck--buffer-data-key-index mapcar make-byte-code 257 "\211\300H\207" vconcat vector [] 3 "\n\n(fn ITEM)"] 9 (#$ . 68307)]) #@52 Set KEY's VALUE for BUFFER. (fn BUFFER KEY VALUE) (defalias 'wcheck--buffer-data-set #[771 "\300\301\"\211\205\211\302!I\207" [wcheck--buffer-data-get :buffer wcheck--buffer-data-key-index] 7 (#$ . 68679)]) #@27 (fn WINDOW START BOUND) (defalias 'wcheck--jump-req-create #[771 "\300!\205\300!\205\301!\205\302#\207" [number-or-marker-p windowp vector] 7 (#$ . 68898)]) #@17 (fn JUMP-REQ) (defalias 'wcheck--jump-req-window #[257 "\211\300H\207" [0] 3 (#$ . 69075)]) #@17 (fn JUMP-REQ) (defalias 'wcheck--jump-req-start #[257 "\211\300H\207" [1] 3 (#$ . 69175)]) #@17 (fn JUMP-REQ) (defalias 'wcheck--jump-req-bound #[257 "\211\300H\207" [2] 3 (#$ . 69274)]) (provide 'wcheck-mode)