;ELC   
;;; Compiled
;;; in Emacs version 29.3
;;; with all optimizations.



(byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\210\307\310\311\312\313\314\313\305&\207" [require cl-lib compat cond-let llama server shell custom-declare-group with-editor nil "Use the Emacsclient as $EDITOR." :group external] 8)#@47 Search for a suitable Emacsclient executable.
(defalias 'with-editor-locate-emacsclient #[0 "\301\302 \303\304\"G\"\206 \305\306\307\"\210\310\207" [emacs-version with-editor-locate-emacsclient-1 with-editor-emacsclient-path split-string "\\." display-warning with-editor "Cannot determine a suitable Emacsclient\n\nDetermining an Emacsclient executable suitable for the\ncurrent Emacs instance failed.  For more information\nplease see https://github.com/magit/magit/wiki/Emacsclient." nil] 5 (#$ . 355)])#@74 Suffixes to append to append when looking for a Emacsclient executables.
(defvar with-editor-emacsclient-program-suffixes (list "-snapshot" ".emacs-snapshot") (#$ . 869))#@19 

(fn PATH DEPTH)
(defalias 'with-editor-locate-emacsclient-1 #[514 "\305\306\307\"\310#\311\307\312\313#\266\202P\314	\227\315\232\203 \316\202* \317\302!\203) \n\206* \320\321\322\317\303!\2058 \323\324\"C\325\326\327\n!\"\244\330\fB\244\"\331\332\"$\206Y \333V\205Y \334S\"\207" [emacs-version invocation-name emacsclient-program-name debian-emacs-flavor with-editor-emacsclient-program-suffixes cl-subseq split-string "\\." 0 "^" mapconcat identity locate-file "remacs" "remacsclient" boundp "emacsclient" mapcan #[257 "\301\302\303\"\"\207" [exec-suffixes mapcar make-closure #[257 "\300P\207" [V0] 3 "\n\n(fn %)"]] 5 "\n\n(fn SUFFIX)"] format ".%s" cl-mapcon #[257 "\300!\301\302\303#\266\202\262\211\304P\305PE\207" [reverse "." mapconcat identity "-" ".emacs"] 7 "\n\n(fn VER)"] reverse "" make-closure #[257 "\3011 \300\302!\303\304\305$\266\2030\207\210\303\207" [V0 (error) with-editor-emacsclient-version nil string-match t] 9 "\n\n(fn EXEC)"] 1 with-editor-locate-emacsclient-1] 14 (#$ . 1045)])#@13 

(fn EXEC)
(defalias 'with-editor-emacsclient-version #[257 "\301!\3021 \303\304\305\"@!A@0\202 \210\306)\207" [default-directory file-name-directory (error) split-string process-lines "--version" nil] 5 (#$ . 2087)])
(defalias 'with-editor-emacsclient-path #[0 "	\203k \304	!B\262\305\n	\"\306!\211\232\204\" \304\307!!B\262\266\310=\203k \305\311	\"\312!\2039 \211B\262\210\313\314	\"\203T \305\315	\"\312!\203P \211B\262\210\202k \313\316	\"\203k \305\317	\"\312!\203j \211B\262\210\320\321\322#\207" [exec-path invocation-directory invocation-name system-type directory-file-name expand-file-name file-chase-links file-name-directory darwin "bin" file-directory-p string-search "Cellar" "../../../bin" "Emacs.app" "../../../../bin" cl-remove-duplicates :test equal] 6])
(byte-code "\300\301\302\303\304DD\305\306\307\310\311&\210\300\312\302\303\313DD\314\315\316\306\307\310\317&	\210\300\320\302\303\321DD\322\306\307\310\323&\210\324\320\325\326#\210\300\327\302\303\330DD\331\306\307\310\323&\210\324\327\325\326#\210\300\332\302\303\333DD\334\306\307\310\335&\207" [custom-declare-variable with-editor-emacsclient-executable funcall function #[0 "\300 \207" [with-editor-locate-emacsclient] 1 #1=""] "The Emacsclient executable used by the `with-editor' macro." :group with-editor :type (choice (string :tag "Executable") (const :tag "Don't use Emacsclient" nil)) with-editor-sleeping-editor #[0 "\300\207" ["sh -c 'printf \"\\nWITH-EDITOR: $$ OPEN $0\\037$1\\037 IN $(pwd)\\n\"; sleep 604800 & sleep=$!; trap \"kill $sleep; exit 0\" USR1; trap \"kill $sleep; exit 1\" USR2; wait $sleep'"] 1 #1#] "The sleeping editor, used when the Emacsclient cannot be used.\n\nThis fallback is used for asynchronous processes started inside\nthe macro `with-editor', when the process runs on a remote machine\nor for local processes when `with-editor-emacsclient-executable'\nis nil (i.e., when no suitable Emacsclient was found, or the user\ndecided not to use it).\n\nWhere the latter uses a socket to communicate with Emacs' server,\nthis substitute prints edit requests to its standard output on\nwhich a process filter listens for such requests.  As such it is\nnot a complete substitute for a proper Emacsclient, it can only\nbe used as $EDITOR of child process of the current Emacs instance.\n\nSome shells do not execute traps immediately when waiting for a\nchild process, but by default we do use such a blocking child\nprocess.\n\nIf you use such a shell (e.g., `csh' on FreeBSD, but not Debian),\nthen you have to edit this option.  You can either replace \"sh\"\nwith \"bash\" (and install that), or you can use the older, less\nperformant implementation:\n\n  \"sh -c '\\\n  echo -e \\\"\\nWITH-EDITOR: $$ OPEN $0$1 IN $(pwd)\\n\\\"; \\\n  trap \\\"exit 0\\\" USR1; \\\n  trap \\\"exit 1\" USR2; \\\n  while true; do sleep 1; done'\"\n\nNote that the two unit separator characters () right after $0\nand $1 are required.  Normally $0 is the file name and $1 is\nmissing or else gets ignored.  But if $0 has the form \"+N[:N]\",\nthen it is treated as a position in the file and $1 is expected\nto be the file.\n\nAlso note that using this alternative implementation leads to a\ndelay of up to a second.  The delay can be shortened by replacing\n\"sleep 1\" with \"sleep 0.01\", or if your implementation does\nnot support floats, then by using \"nanosleep\" instead." :package-version (with-editor . "2.8.0") string with-editor-finish-query-functions #[0 "\300\207" [nil] 1 #1#] "List of functions called to query before finishing session.\n\nThe buffer in question is current while the functions are called.\nIf any of them returns nil, then the session is not finished and\nthe buffer is not killed.  The user should then fix the issue and\ntry again.  The functions are called with one argument.  If it is\nnon-nil then that indicates that the user used a prefix argument\nto force finishing the session despite issues.  Functions should\nusually honor that and return non-nil." hook put permanent-local t with-editor-cancel-query-functions #[0 "\300\207" [nil] 1 #1#] "List of functions called to query before canceling session.\n\nThe buffer in question is current while the functions are called.\nIf any of them returns nil, then the session is not canceled and\nthe buffer is not killed.  The user should then fix the issue and\ntry again.  The functions are called with one argument.  If it is\nnon-nil then that indicates that the user used a prefix argument\nto force canceling the session despite issues.  Functions should\nusually honor that and return non-nil." with-editor-mode-lighter #[0 "\300\207" [" WE"] 1 #1#] "The mode-line lighter of the With-Editor mode." (choice (const :tag "No lighter" #1#) string)] 10)#@364 Alist of filename patterns vs corresponding `server-window'.

Each element looks like (REGEXP . FUNCTION).  Files matching
REGEXP are selected using FUNCTION instead of the default in
`server-window'.

Note that when a package adds an entry here then it probably
has a reason to disrespect `server-window' and it likely is
not a good idea to change such entries.
(defvar with-editor-server-window-alist nil (#$ . 6866))#@241 List of regexps for filenames `server-visit' should not remember.
When a filename matches any of the regexps, then `server-visit'
does not add it to the variable `file-name-history', which is
used when reading a filename in the minibuffer.
(defvar with-editor-file-name-history-exclude nil (#$ . 7292))
(byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313&	\207" [custom-declare-variable with-editor-shell-command-use-emacsclient funcall function #[0 "\300\207" [t] 1 ""] "Whether to use the emacsclient when running shell commands.\n\nThis affects `with-editor-async-shell-command' and, if the input\nends with \"&\" `with-editor-shell-command' .\n\nIf `shell-command-with-editor-mode' is enabled, then it also\naffects `shell-command-async' and, if the input ends with \"&\"\n`shell-command'.\n\nThis is a temporary kludge that lets you choose between two\npossible defects, the ones described in the issues #23 and #40.\n\nWhen t, then use the emacsclient.  This has the disadvantage that\n`with-editor-mode' won't be enabled because we don't know whether\nthis package was involved at all in the call to the emacsclient,\nand when it is not, then we really should.  The problem is that\nthe emacsclient doesn't pass along any environment variables to\nthe server.  This will hopefully be fixed in Emacs eventually.\n\nWhen nil, then use the sleeping editor.  Because in this case we\nknow that this package is involved, we can enable the mode.  But\nthis makes it necessary that you invoke $EDITOR in shell scripts\nlike so:\n\n  eval \"$EDITOR\" file\n\nAnd some tools that do not handle $EDITOR properly also break." :package-version (with-editor . "2.7.1") :group with-editor :type boolean] 10)
(defvar with-editor-pre-finish-hook nil)
(defvar with-editor-pre-cancel-hook nil)
(defvar with-editor-post-finish-hook nil)
(defvar with-editor-post-finish-hook-1 nil)
(defvar with-editor-post-cancel-hook nil)
(defvar with-editor-post-cancel-hook-1 nil)
(defvar with-editor-cancel-alist nil)
(byte-code "\300\301\302\303#\210\300\304\302\303#\210\300\305\302\303#\210\300\306\302\303#\207" [put with-editor-pre-finish-hook permanent-local t with-editor-pre-cancel-hook with-editor-post-finish-hook with-editor-post-cancel-hook] 4)
(defvar with-editor-show-usage t nil)
(make-variable-buffer-local 'with-editor-show-usage)
(defvar with-editor-cancel-message nil nil)
(make-variable-buffer-local 'with-editor-cancel-message)
(defvar with-editor-previous-winconf nil nil)
(byte-code "\300\301!\210\302\303\304\305#\210\302\301\304\305#\207" [make-variable-buffer-local with-editor-previous-winconf put with-editor-cancel-message permanent-local t] 4)#@19 For internal use.
(defvar with-editor--pid nil (#$ . 9957))
(byte-code "\300\301!\210\302\301\303\304#\207" [make-variable-buffer-local with-editor--pid put permanent-local t] 4)#@46 Finish the current edit session.

(fn FORCE)
(defalias 'with-editor-finish #[257 "\303\304\"\205D \305\301!\205 	\n\306\307!\210\310\311!\210\312\311\313\"\210\314\315\316\"r\211q\210\317\320\"\216\321\300!\210\203< \321\301!\210\306\300!*\262\266\203\207" [with-editor-post-finish-hook git-commit-post-finish-hook default-directory run-hook-with-args-until-failure with-editor-finish-query-functions boundp run-hooks with-editor-pre-finish-hook with-editor-return nil accept-process-output 0.1 generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] make-local-variable] 8 (#$ . 10141) "P"])#@46 Cancel the current edit session.

(fn FORCE)
(defalias 'with-editor-cancel #[257 "\304\305\"\205H \306!\203 \211 \262	\307\n\310\311!\210\312\313!\210\314\307\315\"\210\316\317\313\"r\211q\210\320\321\"\216\322\301!\210\310\301!+\266\323\206E \324!\262\207" [with-editor-cancel-message with-editor-post-cancel-hook default-directory with-editor-cancel-alist run-hook-with-args-until-failure with-editor-cancel-query-functions functionp nil run-hooks with-editor-pre-cancel-hook with-editor-return t accept-process-output 0.1 generate-new-buffer " *temp*" make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] make-local-variable message "Canceled by user"] 9 (#$ . 10807) "P"])#@15 

(fn CANCEL)
(defalias 'with-editor-return #[257 "	\n\305\306\307\310#\210\203] \311 \210\203J p\211\203; \211@\312\313\"\210\3141/ \315\316\"0\210\2020 \210\317!\210A\266\202\202 \210\320!\203F \321!\210\210\202m \3221V \323\f!0\210\202W \210\321 \210\202m \311 \210\203j \324 \210\202m \321 \210\211\203\211 \325\326\327\211\211\330\n\203\202 \331\202\203 \332&)\210\205\231 \333!\334 =\205\231 \335!\207" [with-editor-previous-winconf server-buffer-clients default-directory with-editor--pid buffer-file-name remove-hook kill-buffer-query-functions with-editor-kill-buffer-noop t save-buffer message "client %S" (error) server-send-string "-error Canceled by user\n" delete-process buffer-live-p kill-buffer (error) delete-file server-done process-file "kill" nil "-s" "USR2" "USR1" window-configuration-frame selected-frame set-window-configuration] 13 (#$ . 11531)])
(defvar with-editor-mode-map (define-keymap "C-c C-c" 'with-editor-finish "<remap> <server-edit>" 'with-editor-finish "<remap> <evil-save-and-close>" 'with-editor-finish "<remap> <evil-save-modified-and-close>" 'with-editor-finish "C-c C-k" 'with-editor-cancel "<remap> <kill-buffer>" 'with-editor-cancel "<remap> <ido-kill-buffer>" 'with-editor-cancel "<remap> <iswitchb-kill-buffer>" 'with-editor-cancel "<remap> <evil-quit>" 'with-editor-cancel))#@101 Non-nil if With-Editor mode is enabled.
Use the command `with-editor-mode' to change this variable.
(defvar with-editor-mode nil (#$ . 12882))
(make-variable-buffer-local 'with-editor-mode)#@608 Edit a file as the $EDITOR of an external process.

This is a minor mode.  If called interactively, toggle the
`With-Editor mode' mode.  If the prefix argument is positive,
enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is `toggle'.  Enable
the mode if ARG is nil, omitted, or is a positive number.
Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer,
evaluate `with-editor-mode'.

The mode's hook is called both when the mode is enabled and when
it is disabled.

(fn &optional ARG)
(defalias 'with-editor-mode #[256 "\303 \304=\203 ?\202 \247\203 \305W\203 \306\202 \307\310\301!\2031 \311\300	\"\2031 \300	B\312\313!\203> ?\314\315!\210\316\317\320\306\307$\210\n\203L \321 \210\322\323\203V \324\202W \325\"\210\312\313!\203z \303 \203k \211\303 \232\203z \326\327\330\203v \331\202w \332\333$\210\210\334 \210\207" [with-editor-mode local-minor-modes with-editor-show-usage current-message toggle 1 nil t boundp delq called-interactively-p any user-error "With-Editor mode is not intended for interactive use" add-hook kill-buffer-query-functions with-editor-kill-buffer-noop with-editor-usage-message run-hooks with-editor-mode-hook with-editor-mode-on-hook with-editor-mode-off-hook message "%s %sabled%s" "With-Editor mode" "en" "dis" " in current buffer" force-mode-line-update] 7 (#$ . 13078)])
(defvar with-editor-mode-hook nil)
(byte-code "\301\302N\204\f \303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\313\314\300!\205# \310\211%\210\303\312\315\316#\207" [with-editor-mode-map with-editor-mode-hook variable-documentation put "Hook run after entering or leaving `with-editor-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it.  (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode with-editor-mode with-editor-mode-lighter boundp permanent-local t] 6)
(defalias 'with-editor-kill-buffer-noop #[0 "\300\301\302\303p\"!!\207" [user-error substitute-command-keys format "Don't kill this buffer %S.  Instead cancel using \\[with-editor-cancel]"] 5])
(defvar with-editor-usage-message "Type \\[with-editor-finish] to finish, or \\[with-editor-cancel] to cancel" nil)
(make-variable-buffer-local 'with-editor-usage-message)
(defalias 'with-editor-usage-message #[0 "p\300\301\302\303\304\"#\207" [run-with-timer 0.05 nil make-closure #[0 "r\300q\210\302\303	!!)\207" [V0 with-editor-usage-message message substitute-command-keys] 3]] 7])#@19 For internal use.
(defvar with-editor--envvar nil (#$ . 15678))#@279 Use the Emacsclient as $EDITOR while evaluating BODY.
Modify the `process-environment' for processes started in BODY,
instructing them to use the Emacsclient as $EDITOR.  If optional
ENVVAR is a literal string then bind that environment variable
instead.

(fn [ENVVAR] BODY...)
(defalias 'with-editor '(macro . #[128 "\300\301@;\203 \211A\262\242\202 \302D\303B\304BBB\207" [let with-editor--envvar (or with-editor--envvar "EDITOR") ((process-environment process-environment)) (with-editor--setup)] 5 (#$ . 15748)]))
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put with-editor lisp-indent-function defun put edebug-form-spec (body)] 5)#@286 Use the Emacsclient as the editor while evaluating BODY.
Modify the `process-environment' for processes started in BODY,
instructing them to use the Emacsclient as editor.  ENVVAR is the
environment variable that is exported to do so, it is evaluated
at run-time.

(fn ENVVAR BODY...)
(defalias 'with-editor* '(macro . #[385 "\300\301D\302B\303BBB\207" [let with-editor--envvar ((process-environment process-environment)) (with-editor--setup)] 6 (#$ . 16414)]))
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put with-editor* lisp-indent-function defun put edebug-form-spec (sexp body)] 5)
(defalias 'with-editor--setup #[0 "\203\n \306	!\203 \n\307Q\fB\211\207\310\311\312\"\204 \313\314!!\204@ \315\"!\203= \316\317\320 \"\"\315\"!\203= \321\"!\210\322 \210\n\307\323\324\325\"\203U \326\325!\327\330OP\202V !?\205f \331\323\326\"#\"!PR\fB\203y \332\326\"$\"P\fB\333P\fB\334\335!\336\235\205\213 \337\335\340\"\207" [with-editor-emacsclient-executable default-directory with-editor--envvar with-editor-sleeping-editor process-environment server-use-tcp file-remote-p "=" featurep make-network-process (:family local) t process-live-p server-running-p format "server%s" emacs-pid server-force-delete server-start shell-quote-argument string-prefix-p "~" expand-file-name 1 nil " --socket-name=" "EMACS_SERVER_FILE=" "ALTERNATE_EDITOR=" getenv "TERM" (nil "") setenv "dumb" server-process server-name server-socket-dir server-auth-dir] 8])
(defalias 'with-editor-server-window #[0 "\203\f \303\304	\"A\206 \n\207" [buffer-file-name with-editor-server-window-alist server-window cl-find-if #[257 "\211@\301\302\303$\207" [buffer-file-name nil string-match t] 9 "\n\n(fn %)"]] 3])#@96 Honor `with-editor-server-window-alist' (which see).

(fn FN &optional NEXT-BUFFER &rest ARGS)
(defalias 'server-switch-buffer@with-editor-server-window-alist #[641 "r\206 pq\210\203 \303 \304 )\305#)\207" [with-editor-mode with-editor-previous-winconf server-window current-window-configuration with-editor-server-window apply] 7 (#$ . 18145)])
(advice-add 'server-switch-buffer :around 'server-switch-buffer@with-editor-server-window-alist)#@523 When called inside a `with-editor' form and the Emacsclient
cannot be used, then give the process the filter function
`with-editor-process-filter'.  To avoid overriding the filter
being added here you should use `with-editor-set-process-filter'
instead of `set-process-filter' inside `with-editor' forms.

When the `default-directory' is located on a remote machine,
then also manipulate PROGRAM and PROGRAM-ARGS in order to set
the appropriate editor environment variable.

(fn FN NAME BUFFER PROGRAM &rest PROGRAM-ARGS)
(defalias 'start-file-process@with-editor-process-filter #[1156 "\204\f \303%\207\304	!\203( \305\232\204  B\262\305\262\306\nQB\262\303%\307\310\"\210\311\312	#\210\207" [with-editor--envvar default-directory with-editor-sleeping-editor apply file-remote-p "env" "=" set-process-filter with-editor-process-filter process-put default-dir] 11 (#$ . 18603)])
(byte-code "\300\301\302\303#\210\300\304\302\305#\207" [advice-add start-file-process :around start-file-process@with-editor-process-filter make-process make-process@with-editor-process-filter] 4)#@621 When called inside a `with-editor' form and the Emacsclient
cannot be used, then give the process the filter function
`with-editor-process-filter'.  To avoid overriding the filter
being added here you should use `with-editor-set-process-filter'
instead of `set-process-filter' inside `with-editor' forms.

When the `default-directory' is located on a remote machine and
FILE-HANDLER is non-nil, then also manipulate COMMAND in order
to set the appropriate editor environment variable.

(fn FN &rest KEYS &key NAME BUFFER COMMAND CODING NOQUERY STOP CONNECTION-TYPE FILTER SENTINEL STDERR FILE-HANDLER &allow-other-keys)
(defalias 'make-process@with-editor-process-filter #[385 "\303\304\"A@\303\305\"A@\303\306\"A@\303\307\"A@\303\310\"A@\303\311\"A@\303\312\"A@\303\313\"A@\303	\314\"A@\303\n\315\"A@\303\316\"A@\211\203P \204W \317\"\207\320	!\203y @\321\232\204k \321	B\262	\322\nQ	AB\241\266\203\204 \323\324\"\202\205 \325\304\305\306\307\310\311\312\313\314\315\316&\326\327	#\210\207" [with-editor--envvar default-directory with-editor-sleeping-editor plist-member :name :buffer :command :coding :noquery :stop :connection-type :filter :sentinel :stderr :file-handler apply file-remote-p "env" "=" make-closure #[514 "\300\"\210\301\302#\207" [V0 with-editor-process-filter t] 6 "\n\n(fn PROCESS OUTPUT)"] with-editor-process-filter process-put default-dir] 37 (#$ . 19707)])#@475 Like `set-process-filter' but keep `with-editor-process-filter'.
Give PROCESS the new FILTER but keep `with-editor-process-filter'
if that was added earlier by the advised `start-file-process'.

Do so by wrapping the two filter functions using a lambda, which
becomes the actual filter.  It calls FILTER first, which may or
may not insert the text into the PROCESS's buffer.  Then it calls
`with-editor-process-filter', passing t as NO-STANDARD-FILTER.

(fn PROCESS FILTER)
(defalias 'with-editor-set-process-filter #[514 "\300\301!\302=\203 \303\304\305B\306BBB\202 \"\207" [set-process-filter process-filter with-editor-process-filter lambda (proc str) (proc str) ((with-editor-process-filter proc str t))] 8 (#$ . 21157)])
(defvar with-editor-filter-visit-hook nil)
(defconst with-editor-sleeping-editor-regexp "^WITH-EDITOR: \\([0-9]+\\) OPEN \\([^]+?\\)\\(?:\\([^]*\\)\\)?\\(?: IN \\([^]+?\\)\\)??$")
(defvar with-editor--max-incomplete-length 1000)#@23 

(fn PROCESS STRING)
(defalias 'with-editor-sleeping-editor-filter #[514 "\205 \306\307\"\211\203 \211P\262\210\310 \311\312\"\216\203? \313\314\"\204? G\211V\2034 Z\315O\262\210\316\307#\210\315\202\377 \317	\"\203\376 \203P \316\307\315#\210\320\321\"\320\322\"\320\323\"\320\324\"\315\211\211\317\325\"\203\213 \262\326\320\321\"!\262\320\322\"\262\211\205\206 \326!\262\202\216 \262\327!\204\232 \330\"\262\n\203\245 \331\n!P\262r\332!q\210\333\321!\210\334 \203\347 \212\214eb\210Sy\210\211\203\312 \335!\210`*deZ\336 U\204\343 \203\343 \337ed#\204\343 ~\210\211b\266\340\341!\210\342 \206\361 \343p!\210\344\345!)\266\315\202\377 )\207" [with-editor--max-incomplete-length with-editor-sleeping-editor-regexp default-directory with-editor--pid with-editor-previous-winconf widen-automatically process-get incomplete match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data t] 3] string-suffix-p "\n" nil process-put string-match match-string 1 2 3 4 "\\`\\+\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?\\'" string-to-number file-name-absolute-p expand-file-name file-remote-p find-file-noselect with-editor-mode current-window-configuration move-to-column buffer-size <= run-hooks with-editor-filter-visit-hook with-editor-server-window switch-to-buffer kill-local-variable server-window] 15 (#$ . 22129)])#@95 Listen for edit requests by child processes.

(fn PROCESS STRING &optional NO-DEFAULT-FILTER)
(defalias 'with-editor-process-filter #[770 "\301\302\"\303\")\210\211?\205 \304\"\207" [default-directory process-get default-dir with-editor-sleeping-editor-filter internal-default-process-filter] 6 (#$ . 23505)])#@210 Prevent certain files from being added to `file-name-history'.
Files matching a regexp in `with-editor-file-name-history-exclude'
are prevented from being added to that list.

(fn FILES PROC &optional NOWAIT)
(defalias 'server-visit-files@with-editor-file-name-history-exclude #[770 "\211\205$ \211@\211\242\211\302\303\304\"\"\203 \305\306!	\"\266A\266\202\202 \207" [with-editor-file-name-history-exclude file-name-history cl-find-if make-closure #[257 "\211\300\301\302\303$\207" [V0 nil string-match t] 9 "\n\n(fn %)"] delete abbreviate-file-name] 11 (#$ . 23828)])
(advice-add 'server-visit-files :after 'server-visit-files@with-editor-file-name-history-exclude)#@589 Teach subsequent commands to use current Emacs instance as editor.

Set and export the environment variable ENVVAR, by default "EDITOR".
The value is automatically generated to teach commands to use the
current Emacs instance as "the editor".

PROCESS is only intended for use by `eat-exec-hook'.  When invoked
interactively, INTERACTIVE is non-nil, which supresses the call to
"clear" (only relevant in `vterm-mode' and `eat-mode').

This command can be used in `shell-mode', `term-mode', `eshell-mode',
`vterm-mode' and `eat-mode'.

(fn &optional (ENVVAR "EDITOR") PROCESS INTERACTIVE)
(defalias 'with-editor-export-editor #[128 "\211\203 \211A\262\242\202 \306\211A\262\242\211A\262\242\203) \307\310\311\312G\\D\"\210\313\314\315\"\203k \316p!\211\203g \317!b\210\320\321\322\323!#\"\210\324\325\326\327$\204H \313\315!\203` \330\331\"\266\202{\332\333\334\326\327$\210\210\202{\313\335!\203\210 \334	>\203| 	\210\202\200 \334	B\336\"\210\202{\n\204\241 \313\337\340\"\203\232 \341\342!\210\202{\341\343!\210\202{\313\337!\203\370 \344\345!\203\370 \344\346!\203\370 \347 \210\324\325\326\327$\204\272 \350!\211\203\326 \346\321\351#!\210\345 \210\210\350\352!\211\203\350 \346\321\353\"!\210\345 \210\210\211\204\364 \346\354!\210\345 \210*\202{\313\340!\203{\344\355!\203{\344\356!\203{\344\357!\203{\360!\203\306\262\202.\360!\203)\202.\3566\361\"\347 \210\324\325\326\327$\2043\350!\211\203S\3576\321\351#\"\210\355\325\362\"\210\210\350\352!\211\203i\3576\321\353\"\"\210\355\325\362\"\210\210\204y\3576\363\"\210\355\325\362\"\210*\210\364\365\"\207" [with-editor-sleeping-editor eshell-preoutput-filter-functions with-editor-emacsclient-executable process-environment with-editor--envvar vterm--process "EDITOR" signal wrong-number-of-arguments with-editor-export-editor 3 derived-mode-p comint-mode term-mode get-buffer-process process-mark process-send-string format " export %s=%s\n" shell-quote-argument accept-process-output 1 nil t with-editor-set-process-filter with-editor-emulate-terminal add-hook comint-output-filter-functions with-editor-output-filter eshell-mode setenv vterm-mode eat-mode error "Cannot use sleeping editor in this buffer" "Cannot export environment variables in this buffer" fboundp vterm-send-return vterm-send-string with-editor--setup getenv " export %s=%S" "EMACS_SERVER_FILE" " export EMACS_SERVER_FILE=%S" " clear" eat-self-input eat-term-parameter eat-term-send-string processp eat--process return "clear" message "Successfully exported %s" eat-terminal] 12 (#$ . 24514) (byte-code "\300 \301\302E\207" [with-editor-read-envvar nil t] 3)])#@244 Like `with-editor-export-editor' but always set `$GIT_EDITOR'.

PROCESS is only intended for use by `eat-exec-hook'.  When invoked
interactively, INTERACTIVE is non-nil, which supresses the call to
"clear".

(fn &optional PROCESS INTERACTIVE)
(defalias 'with-editor-export-git-editor #[512 "\300\301#\207" [with-editor-export-editor "GIT_EDITOR"] 6 (#$ . 27181) (list nil t)])#@243 Like `with-editor-export-editor' but always set `$HG_EDITOR'.

PROCESS is only intended for use by `eat-exec-hook'.  When invoked
interactively, INTERACTIVE is non-nil, which supresses the call to
"clear".

(fn &optional PROCESS INTERACTIVE)
(defalias 'with-editor-export-hg-editor #[512 "\300\301#\207" [with-editor-export-editor "HG_EDITOR"] 6 (#$ . 27566) (list nil t)])#@81 Handle edit requests on behalf of `comint-mode' and `eshell-mode'.

(fn STRING)
(defalias 'with-editor-output-filter #[257 "\300\301\"\207" [with-editor-sleeping-editor-filter nil] 4 (#$ . 27947)])#@82 Like `term-emulate-terminal' but also handle edit requests.

(fn PROCESS STRING)
(defalias 'with-editor-emulate-terminal #[514 "\301\302O\303\")\210\304\"\207" [with-editor-sleeping-editor-regexp 1 nil with-editor-sleeping-editor-filter term-emulate-terminal] 5 (#$ . 28151)])
(defvar with-editor-envvars '("EDITOR" "GIT_EDITOR" "HG_EDITOR"))#@73 

(fn &optional (PROMPT "Set environment variable") (DEFAULT "EDITOR"))
(defalias 'with-editor-read-envvar #[128 "\211\203 \211A\262\242\202 \301\203 \211A\262\242\202 \302\203+ \303\304\305\306G\\D\"\210\307\2038 \310\311#\202; \312P\313\211\211\211&\211\314\230\203N \315\316!\207\207" [with-editor-envvars "Set environment variable" "EDITOR" signal wrong-number-of-arguments with-editor-read-envvar 2 completing-read format "%s (%s): " ": " nil "" user-error "Nothing selected"] 11 (#$ . 28505)])
(byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313&	\207" [custom-declare-variable shell-command-with-editor-mode funcall function #[0 "\300\207" [nil] 1 ""] "Non-nil if Shell-Command-With-Editor mode is enabled.\nSee the `shell-command-with-editor-mode' command\nfor a description of this minor mode." :set custom-set-minor-mode :initialize custom-initialize-default :type boolean] 10)#@1298 Teach `shell-command' to use current Emacs instance as editor.

Teach `shell-command', and all commands that ultimately call that
command, to use the current Emacs instance as editor by executing
"EDITOR=CLIENT COMMAND&" instead of just "COMMAND&".

CLIENT is automatically generated; EDITOR=CLIENT instructs
COMMAND to use to the current Emacs instance as "the editor",
assuming no other variable overrides the effect of "$EDITOR".
CLIENT may be the path to an appropriate emacsclient executable
with arguments, or a script which also works over Tramp.

Alternatively you can use the `with-editor-async-shell-command',
which also allows the use of another variable instead of
"EDITOR".

This is a global minor mode.  If called interactively, toggle the
`Shell-Command-With-Editor mode' mode.  If the prefix argument is
positive, enable the mode, and if it is zero or negative, disable
the mode.

If called from Lisp, toggle the mode if ARG is `toggle'.  Enable
the mode if ARG is nil, omitted, or is a positive number.
Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer,
evaluate `(default-value \='shell-command-with-editor-mode)'.

The mode's hook is called both when the mode is enabled and when
it is disabled.

(fn &optional ARG)
(defalias 'shell-command-with-editor-mode #[256 "\301 \302\303\304=\203 \305\303!?\202! \247\203  \306W\203  \307\202! \310\"\210\311\300!\2038 \312\303\"\305\303!\2038 \303B\313\314\305\303!\203D \315\202E \316\"\210\317\320!\203n \321\303!\210\301 \203] \211\301 \232\203n \322\323\324\305\303!\203j \325\202k \326\327$\210\210\330 \210\305\303!\207" [global-minor-modes current-message set-default shell-command-with-editor-mode toggle default-value 1 nil t boundp delq run-hooks shell-command-with-editor-mode-hook shell-command-with-editor-mode-on-hook shell-command-with-editor-mode-off-hook called-interactively-p any customize-mark-as-set message "%s %sabled%s" "Shell-Command-With-Editor mode" "en" "dis" "" force-mode-line-update] 7 (#$ . 29431) (byte-code "\203\n \301!\202 \302C\207" [current-prefix-arg prefix-numeric-value toggle] 2)])
(defvar shell-command-with-editor-mode-hook nil)
(byte-code "\301\302N\204\f \303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\310\313\300!\205# \310\211%\207" [shell-command-with-editor-mode-map shell-command-with-editor-mode-hook variable-documentation put "Hook run after entering or leaving `shell-command-with-editor-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it.  (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode shell-command-with-editor-mode boundp] 6)#@743 Like `async-shell-command' but with `$EDITOR' set.

Execute string "ENVVAR=CLIENT COMMAND" in an inferior shell;
display output, if any.  With a prefix argument prompt for an
environment variable, otherwise the default "EDITOR" variable
is used.  With a negative prefix argument additionally insert
the COMMAND's output at point.

CLIENT is automatically generated; ENVVAR=CLIENT instructs
COMMAND to use to the current Emacs instance as "the editor",
assuming it respects ENVVAR as an "EDITOR"-like variable.
CLIENT may be the path to an appropriate emacsclient executable
with arguments, or a script which also works over Tramp.

Also see `async-shell-command' and `shell-command'.

(fn COMMAND &optional OUTPUT-BUFFER ERROR-BUFFER ENVVAR)
(defalias 'with-editor-async-shell-command #[1025 "\211\211\206 \302	\303 \210\304#+\207" [with-editor--envvar process-environment "EDITOR" with-editor--setup async-shell-command] 8 (#$ . 32169) (with-editor-shell-command-read-args "Async shell command: " t)])#@189 Like `shell-command' or `with-editor-async-shell-command'.
If COMMAND ends with "&" behave like the latter,
else like the former.

(fn COMMAND &optional OUTPUT-BUFFER ERROR-BUFFER ENVVAR)
(defalias 'with-editor-shell-command #[1025 "\300\301\"\203 \302$\207\303#\207" [string-match "&[ 	]*\\'" with-editor-async-shell-command shell-command] 9 (#$ . 33185) (with-editor-shell-command-read-args "Shell command: ")])#@31 

(fn PROMPT &optional ASYNC)
(defalias 'with-editor-shell-command-read-args #[513 "\304\305\211\206 	\306=\205 \307\305\310\"\211\205 \311!\262$\211\2042 \312\305\313\310$\266\203\211\262\203: \314\n!\315W\202; \n\205F \n\205F \316 F\207" [buffer-file-name major-mode current-prefix-arg shell-command-default-error-buffer read-shell-command nil dired-mode dired-get-filename t file-relative-name "&[ 	]*\\'" string-match prefix-numeric-value 0 with-editor-read-envvar] 12 (#$ . 33613)])#@186 Set editor envvar, if `shell-command-with-editor-mode' is enabled.
Also take care of that for `with-editor-[async-]shell-command'.

(fn FN COMMAND &optional OUTPUT-BUFFER ERROR-BUFFER)
(defalias 'shell-command@shell-command-with-editor-mode #[1026 "\304\305\"\306\307\"\203X 	\204 \n\203X 	\203! #\210\2023 	\206& \310\311 \210#*\210\312\206; \313\314!!\211\205S \211\315\316\317\320\"\317\321\"B\262\322\323$\210\262\202] #)\207" [shell-mode-hook with-editor--envvar shell-command-with-editor-mode process-environment remove with-editor-export-editor string-suffix-p "&" "EDITOR" with-editor--setup get-buffer-process get-buffer "*Async Shell Command*" advice--add-function :after make-closure #[0 "\301\300!\207" [V0 process-filter] 2] #[257 "\301\300\"\207" [V0 set-process-filter] 4 "\n\n(fn GV--VAL)"] #[514 "\300\301#\207" [with-editor-process-filter t] 6 "\n\n(fn PROC STR)"] nil] 13 (#$ . 34122)])
(advice-add 'shell-command :around 'shell-command@shell-command-with-editor-mode)#@86 Debug configuration issues.
See info node `(with-editor)Debugging' for instructions.
(defalias 'with-editor-debug #[0 "\306\307!\210r\310\311!q\210\312p!\210\313 \210\3141% \206 \315	\316 *0\210\202& \210\317\320\321\322!\"\317\323\324\n\"\f#\325\317\326\"\317\327@\"\317\330A\"\331\317\332\333 \"\317\334B\"\317\335C\"\317\336D\"\317\337E\"\261\f\210E\203\211 \340E!\203\211 \341E\342\343#\211\203\205 \211@\317\344\"c\210A\266\202\202r \210\202\230 \317\345C\203\224 \346\202\225 \347\"c\210\317\350F\"c\210\340F!\203\303 \341F\342\343#\211\203\277 \211@\317\344\"c\210A\266\202\202\254 \210\202\322 \317\345C\203\316 \347\202\317 \346\"c\210*\351\352!\353\211GH\354 *\355\317\356\211\205\354 \357!#\317\360\211\205\370 \357!#\317\361\211\205\357!#\261\266\362\317\363\364\365\366!\367\"\"\317\370I\"\261\210\317\371!c\210\372 \211\205]\211@\317\373\374!@#c\210\375!\203V\341\376\377#\211\203U\211@\317\201J \357!#c\210A\266\202\202=\210A\266\202\202\")\207" [with-editor--envvar process-environment invocation-name invocation-directory emacs-version system-type require warnings get-buffer-create "*with-editor-debug*" pop-to-buffer erase-buffer (error) "EDITOR" with-editor--setup format "with-editor: %s\n" locate-library "with-editor.el" "emacs: %s (%s)\n" expand-file-name "system:\n" "  system-type: %s\n" "  system-configuration: %s\n" "  system-configuration-options: %s\n" "server:\n" "  server-running-p: %s\n" server-running-p "  server-process: %S\n" "  server-use-tcp: %s\n" "  server-name: %s\n" "  server-socket-dir: %s\n" file-accessible-directory-p directory-files nil "^[^.]" "    %s\n" "    %s: not an accessible directory\n" "WARNING" "ERROR" "  server-auth-dir: %s\n" default-value with-editor-emacsclient-executable :error with-editor-locate-emacsclient "with-editor-emacsclient-executable:\n" " value:   %s (%s)\n" with-editor-emacsclient-version " default: %s (%s)\n" " funcall: %s (%s)\n" "path:\n" "  $PATH:     %s\n" split-string getenv "PATH" ":" "  exec-path: %s\n" "  with-editor-emacsclient-path:\n" with-editor-emacsclient-path "    %s (%s)\n" file-attributes file-directory-p t "emacsclient\\(?:[^w]\\|\\'\\)" system-configuration system-configuration-options server-process server-use-tcp server-name server-socket-dir server-auth-dir warning-minimum-log-level warning-minimum-level exec-path "      %s (%s)\n"] 14 (#$ . 35143) nil])
(defconst with-editor-font-lock-keywords '(("(\\(with-\\(?:git-\\)?editor\\)\\_>" (1 'font-lock-keyword-face))))
(byte-code "\301\302\"\210\303\304!\207" [with-editor-font-lock-keywords font-lock-add-keywords emacs-lisp-mode provide with-editor] 3)
