mirror of https://github.com/Chizi123/.emacs.d.git

Chizi123
2018-11-18 c655eea759be1db69c5e6b45c228139d8390122a
commit | author | age
5cb5f7 1 ;ELC
C 2 ;;; Compiled
3 ;;; in Emacs version 26.1
4 ;;; with all optimizations.
5
6 ;;; This file uses dynamic docstrings, first added in Emacs 19.29.
7
8 ;;; This file does not contain utf-8 non-ASCII characters,
9 ;;; and so can be loaded in Emacs versions earlier than 23.
10
11 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13
14
15 (byte-code "\301\302!\210\301\303!\210\301\304!\210\301\305\306\307#\203*\310\311\300!\205>\203*\312\313!\203*\313\314!\210\315\316\306\317\320\321\320\303&\207" [async-bytecomp-allowed-packages require cl-lib server shell async-bytecomp nil t magit boundp fboundp async-bytecomp-package-mode 1 custom-declare-group with-editor "Use the Emacsclient as $EDITOR." :group external] 8)
16 #@47 Search for a suitable Emacsclient executable.
17 (defalias 'with-editor-locate-emacsclient #[0 "\301\302 \303\304\"G\"\206\305\306\307\310\"\210\207" [emacs-version with-editor-locate-emacsclient-1 with-editor-emacsclient-path split-string "\\." nil 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."] 5 (#$ . 797)])
18 #@19 
19
20 (fn PATH DEPTH)
21 (defalias 'with-editor-locate-emacsclient-1 #[514 "\303\304\305\"\306#\307\310\311\305#P\312    \227\313\232\203\314\202\315\316\317\320\302!\205*\321\322\n\"C\323\324\325\n!\"\244\326\327\330E\244\"\331\332\333\334\335    !\336\"\337\340%$\206T\341V\205T\342S\"\207" [emacs-version invocation-name debian-emacs-flavor cl-subseq split-string "\\." 0 "^" mapconcat identity locate-file-internal "remacs" "remacsclient" "emacsclient" cl-mapcan #[257 "\301\302\303\304\305\306!\307\"\310\311%\"\207" [exec-suffixes cl-mapcar make-byte-code 257 "\300P\207" vconcat vector [] 3 "\n\n(fn E)"] 8 "\n\n(fn V)"] boundp format ".%s" cl-mapcon #[257 "\300\301\302!\303#\262\211\304P\305PE\207" [mapconcat identity reverse "." "-" ".emacs"] 5 "\n\n(fn V)"] reverse "" "-snapshot" ".emacs-snapshot" make-byte-code 257 "\3021\300\303!\304\305\306#)\266\2030\207\210\304\207" vconcat vector [inhibit-changing-match-data (error) with-editor-emacsclient-version nil t string-match] 8 "\n\n(fn EXEC)" 1 with-editor-locate-emacsclient-1] 14 (#$ . 1312)])
22 #@13 
23
24 (fn EXEC)
25 (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 (#$ . 2397)])
26 (defalias 'with-editor-emacsclient-path #[0 "    \203Z\305    !B\262\306\n    \"\307!\211\232\204\"\305\310!!B\262\266 \311=\203Z\306\312    \"\313!\2039\211B\262\210\314    \315\316\317#)\266\203\203Z\306\320    \"\313!\203Y\211B\262\210\321\322\323#\207" [exec-path invocation-directory invocation-name system-type inhibit-changing-match-data directory-file-name expand-file-name file-chase-links file-name-directory darwin "bin" file-directory-p "Cellar" nil t string-match "../../../bin" cl-remove-duplicates :test equal] 8])
27 (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] "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" [#1="sh -c 'echo \"WITH-EDITOR: $$ OPEN $0 IN $(pwd)\"; 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 \\\"WITH-EDITOR: $$ OPEN $0 IN $(pwd)\\\"; \\\n  trap \\\"exit 0\\\" USR1; \\\n  trap \\\"exit 1\" USR2; \\\n  while true; do sleep 1; done'\"\n\nNote that the unit seperator character () right after the file\nname ($0) is required.\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] "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] "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" [#2=" WE"] 1 #2#] "The mode-line lighter of the With-Editor mode." (choice (const :tag "No lighter" "") string)] 10)
28 #@364 Alist of filename patterns vs corresponding `server-window'.
29
30 Each element looks like (REGEXP . FUNCTION).  Files matching
31 REGEXP are selected using FUNCTION instead of the default in
32 `server-window'.
33
34 Note that when a package adds an entry here then it probably
35 has a reason to disrespect `server-window' and it likely is
36 not a good idea to change such entries.
37 (defvar with-editor-server-window-alist nil (#$ . 6911))
38 #@241 List of regexps for filenames `server-visit' should not remember.
39 When a filename matches any of the regexps, then `server-visit'
40 does not add it to the variable `file-name-history', which is
41 used when reading a filename in the minibuffer.
42 (defvar with-editor-file-name-history-exclude nil (#$ . 7338))
43 (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-shell-command-async' 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 a long 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)
44 (defvar with-editor-pre-finish-hook nil)
45 (defvar with-editor-pre-cancel-hook nil)
46 (defvar with-editor-post-finish-hook nil)
47 (defvar with-editor-post-finish-hook-1 nil)
48 (defvar with-editor-post-cancel-hook nil)
49 (defvar with-editor-post-cancel-hook-1 nil)
50 (defvar with-editor-cancel-alist nil)
51 (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)
52 (defvar with-editor-show-usage t)
53 (defvar with-editor-cancel-message nil)
54 (defvar with-editor-previous-winconf nil)
55 (byte-code "\300\301!\210\300\302!\210\300\303!\210\304\302\305\306#\210\304\303\305\306#\207" [make-variable-buffer-local with-editor-show-usage with-editor-cancel-message with-editor-previous-winconf put permanent-local t] 4)
56 #@19 For internal use.
57 (defvar with-editor--pid nil (#$ . 9929))
58 (byte-code "\300\301!\210\302\301\303\304#\207" [make-variable-buffer-local with-editor--pid put permanent-local t] 4)
59 #@46 Finish the current edit session.
60
61 (fn FORCE)
62 (defalias 'with-editor-finish #[257 "\303\304\"\205P\305\301!\205    \n\306\307!\210\310\311!\210\312\311\313\"\210\314\315!r\211q\210\316\317\320\321\322!\323\"\324$\216\325\300!\210\305\301!\203H    \203H\325\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*" make-byte-code 0 "\301\300!\205    \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 make-local-variable] 11 (#$ . 10114) "P"])
63 #@46 Cancel the current edit session.
64
65 (fn FORCE)
66 (defalias 'with-editor-cancel #[257 "\304\305\"\205Q\306!\203\211 \262    \307\n\310\311!\210\312\313!\210\314\307\315\"\210\316\317!r\211q\210\320\321\322\323\324!\325\"\326$\216\327\301!\210\310\301!\210*\210)\266\330\206N\331!\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-byte-code 0 "\301\300!\205    \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 make-local-variable message "Canceled by user"] 12 (#$ . 10823) "P"])
67 #@15 
68
69 (fn CANCEL)
70 (defalias 'with-editor-return #[257 "    \n \305\306\307\310#\210\203R\311 \210\203<\211\2038\211@\3121(\313\314\"0\202,\210\202-\210\315!\210A\266\202\202\210\202b\3161G\317\f!0\202K\210\202L\210\320 \210\202b\311 \210\203_\321 \210\202b\320 \210\211\203~\322\323\324\211\211\325\n\203w\326\202x\327&\210)\205\216\330!\331 =\205\216\332!\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 (error) server-send-string "-error Canceled by user" delete-process (error) delete-file kill-buffer server-done process-file "kill" nil "-s" "USR2" "USR1" window-configuration-frame selected-frame set-window-configuration] 13 (#$ . 11586)])
71 (defvar with-editor-mode-map (byte-code "\300 \301\302\303#\210\301\304\303#\210\301\305\303#\210\301\306\303#\210\301\307\310#\210\301\311\310#\210\301\312\310#\210\301\313\310#\210\301\314\310#\210\211\207" [make-sparse-keymap define-key "" with-editor-finish [remap server-edit] [remap evil-save-and-close] [remap evil-save-modified-and-close] " " with-editor-cancel [remap kill-buffer] [remap ido-kill-buffer] [remap iswitchb-kill-buffer] [remap evil-quit]] 5))
72 #@101 Non-nil if With-Editor mode is enabled.
73 Use the command `with-editor-mode' to change this variable.
74 (defvar with-editor-mode nil (#$ . 12891))
75 (make-variable-buffer-local 'with-editor-mode)
76 #@72 Edit a file as the $EDITOR of an external process.
77
78 (fn &optional ARG)
79 (defalias 'with-editor-mode #[256 "\302 \303=\203 ?\202\304!\305V\211\204\306\307!\210\310\311\312\313\314$\210    \203)\315 \210\316\317\2033\320\2024\321\"\210\322\323!\203X\302 \203H\211\302 \232\203X\324\325\326\203S\327\202T\330#\266\210\331 \210\207" [with-editor-mode with-editor-show-usage current-message toggle prefix-numeric-value 0 user-error "With-Editor mode cannot be turned off" add-hook kill-buffer-query-functions with-editor-kill-buffer-noop nil t with-editor-usage-message run-hooks with-editor-mode-hook with-editor-mode-on-hook with-editor-mode-off-hook called-interactively-p any " in current buffer" message "With-Editor mode %sabled%s" "en" "dis" force-mode-line-update] 8 (#$ . 13087) (byte-code "\206\301C\207" [current-prefix-arg toggle] 1)])
80 (defvar with-editor-mode-hook nil)
81 (byte-code "\301\302N\204\f\303\301\302\304#\210\305\306\307\310\300!\205\311\211%\210\303\306\312\313#\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.)" add-minor-mode with-editor-mode with-editor-mode-lighter boundp nil permanent-local t] 6)
82 (defalias 'with-editor-kill-buffer-noop #[0 "\300\301\302!!\207" [user-error substitute-command-keys "Don't kill this buffer.  Instead cancel using \\[with-editor-cancel]"] 3])
83 (defalias 'with-editor-usage-message #[0 "\300\301\302\303\302\304p\305BBE#\207" [run-with-timer 0.01 nil lambda with-current-buffer ((message (substitute-command-keys "Type \\[with-editor-finish] to finish, or \\[with-editor-cancel] to cancel")))] 8])
84 #@19 For internal use.
85 (defvar with-editor--envvar nil (#$ . 14880))
86 #@279 Use the Emacsclient as $EDITOR while evaluating BODY.
87 Modify the `process-environment' for processes started in BODY,
88 instructing them to use the Emacsclient as $EDITOR.  If optional
89 ENVVAR is a literal string then bind that environment variable
90 instead.
91
92 (fn [ENVVAR] BODY...)
93 (defalias 'with-editor '(macro . #[128 "\300\301@;\203\211A\262\242\202\302D\303B\304BBB\207" [let with-editor--envvar (or with-editor--envvar "EDITOR") ((process-environment process-environment)) (with-editor--setup)] 5 (#$ . 14951)]))
94 (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)
95 #@288 Use the Emacsclient as the editor while evaluating BODY.
96 Modify the `process-environment' for processes started in BODY,
97 instructing them to use the Emacsclient as editor.  ENVVAR is the
98 environment variable that is exported to do so, it is evaluated
99 at run-time.
100
101 (fn [ENVVAR] BODY...)
102 (defalias 'with-editor* '(macro . #[385 "\300\301D\302B\303BBB\207" [let with-editor--envvar ((process-environment process-environment)) (with-editor--setup)] 6 (#$ . 15618)]))
103 (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)
104 (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! ?\205T\324\323\325\"!PR\fB \203g\326\325\"P\fB\327 P\fB\211\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 " --socket-name=" expand-file-name "EMACS_SERVER_FILE=" "ALTERNATE_EDITOR=" server-process server-name server-socket-dir server-auth-dir] 8])
105 (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@\302\303\304#)\207" [buffer-file-name inhibit-changing-match-data nil t string-match] 8 "\n\n(fn CONS)"]] 3])
106 #@104 Honor `with-editor-server-window-alist' (which see).
107
108 (fn FN &optional NEXT-BUFFER KILLED-ONE FILEPOS)
109 (defalias 'server-switch-buffer--with-editor-server-window-alist #[1025 "r\206pq\210\203\303 \304 )#)\207" [with-editor-mode with-editor-previous-winconf server-window current-window-configuration with-editor-server-window] 8 (#$ . 17238)])
110 (advice-add 'server-switch-buffer :around 'server-switch-buffer--with-editor-server-window-alist)
111 #@523 When called inside a `with-editor' form and the Emacsclient
112 cannot be used, then give the process the filter function
113 `with-editor-process-filter'.  To avoid overriding the filter
114 being added here you should use `with-editor-set-process-filter'
115 instead of `set-process-filter' inside `with-editor' forms.
116
117 When the `default-directory' is located on a remote machine,
118 then also manipulate PROGRAM and PROGRAM-ARGS in order to set
119 the appropriate editor environment variable.
120
121 (fn FN NAME BUFFER PROGRAM &rest PROGRAM-ARGS)
122 (defalias 'start-file-process--with-editor-process-filter #[1156 "\204\f\303%\207\304    !\203(\305\232\204 B\262\305\262\306\nQB\262\303%\307\310\"\210\311\312    #\210\211\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 (#$ . 17699)])
123 (advice-add 'start-file-process :around 'start-file-process--with-editor-process-filter)
124 #@474 Like `set-process-filter' but keep `with-editor-process-filter'.
125 Give PROCESS the new FILTER but keep `with-editor-process-filter'
126 if that was added earlier by the adviced `start-file-process'.
127
128 Do so by wrapping the two filter functions using a lambda, which
129 becomes the actual filter.  It calls `with-editor-process-filter'
130 first, passing t as NO-STANDARD-FILTER.  Then it calls FILTER,
131 which may or may not insert the text into the PROCESS' buffer.
132
133 (fn PROCESS FILTER)
134 (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 (#$ . 18700)])
135 (defvar with-editor-filter-visit-hook nil)
136 #@15 
137
138 (fn STRING)
139 (defalias 'with-editor-output-filter #[257 "\302 \303\304\305\306\307!\310\"\311$\216\312\313\"\203\\\314\315\"\314\316\"\314\311\"\317!\204-\320\"\262\2038\321!P\262r\322!q\210\323\315!\210\324\325!\210\326 \206N\327p!\210\330\331!\210)\332\266\203\202])\207" [default-directory with-editor--pid match-data make-byte-code 0 "\301\300\302\"\207" vconcat vector [set-match-data evaporate] 3 string-match "^WITH-EDITOR: \\([0-9]+\\) OPEN \\([^]+?\\)\\(?: IN \\([^ ]+?\\)\\)? ?$" match-string 1 2 file-name-absolute-p expand-file-name file-remote-p find-file-noselect with-editor-mode run-hooks with-editor-filter-visit-hook with-editor-server-window switch-to-buffer kill-local-variable server-window nil] 8 (#$ . 19480)])
140 #@95 Listen for edit requests by child processes.
141
142 (fn PROCESS STRING &optional NO-DEFAULT-FILTER)
143 (defalias 'with-editor-process-filter #[770 "\301\302\"\303!\210)\211?\205\304\"\207" [default-directory process-get default-dir with-editor-output-filter internal-default-process-filter] 6 (#$ . 20245)])
144 (advice-add 'server-visit-files :after 'server-visit-files--with-editor-file-name-history-exclude)
145 #@36 
146
147 (fn FILES PROC &optional NOWAIT)
148 (defalias 'server-visit-files--with-editor-file-name-history-exclude #[770 "\211\205+\211@\211@\211\302\303\304\305\306\307!\310\"\311\312%\"\203\"\313    \"\266A\266\202\202\207" [with-editor-file-name-history-exclude file-name-history cl-find-if make-byte-code 257 "\211\300\302\303\304#)\207" vconcat vector [inhibit-changing-match-data nil t string-match] 8 "\n\n(fn REGEXP)" delete] 14 (#$ . 20656)])
149 #@339 Teach subsequent commands to use current Emacs instance as editor.
150
151 Set and export the environment variable ENVVAR, by default
152 "EDITOR".  The value is automatically generated to teach
153 commands to use the current Emacs instance as "the editor".
154
155 This works in `shell-mode', `term-mode' and `eshell-mode'.
156
157 (fn &optional (ENVVAR "EDITOR"))
158 (defalias 'with-editor-export-editor #[128 "\211\203 \211A\262\242\202\301\203\302\303\304GTD\"\210\305\306\307\"\203U\310p!\311!b\210\312\313\314\315!#\"\210\316\317\"\2045\305\307!\203J\320\321\"\210\202Q\322\323\324\325\326$\210\210\202l\305\327!\203h\330\331\324\"\210\332\"\210\202l\333\334!\210\335\336\"\207" [with-editor-sleeping-editor "EDITOR" signal wrong-number-of-arguments with-editor-export-editor 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 0.1 with-editor-set-process-filter with-editor-emulate-terminal add-hook comint-output-filter-functions with-editor-output-filter nil t eshell-mode add-to-list eshell-preoutput-filter-functions setenv error "Cannot export environment variables in this buffer" message "Successfully exported %s"] 10 (#$ . 21117) (byte-code "\300 C\207" [with-editor-read-envvar] 1)])
159 #@64 Like `with-editor-export-editor' but always set `$GIT_EDITOR'.
160 (defalias 'with-editor-export-git-editor #[0 "\300\301!\207" [with-editor-export-editor "GIT_EDITOR"] 2 (#$ . 22423) nil])
161 #@63 Like `with-editor-export-editor' but always set `$HG_EDITOR'.
162 (defalias 'with-editor-export-hg-editor #[0 "\300\301!\207" [with-editor-export-editor "HG_EDITOR"] 2 (#$ . 22615) nil])
163 #@82 Like `term-emulate-terminal' but also handle edit requests.
164
165 (fn PROCESS STRING)
166 (defalias 'with-editor-emulate-terminal #[514 "\300!\205\n\301\"\207" [with-editor-output-filter term-emulate-terminal] 5 (#$ . 22804)])
167 (defvar with-editor-envvars '("EDITOR" "GIT_EDITOR" "HG_EDITOR"))
168 #@73 
169
170 (fn &optional (PROMPT "Set environment variable") (DEFAULT "EDITOR"))
171 (defalias 'with-editor-read-envvar #[128 "\211\203 \211A\262\242\202\301\203\211A\262\242\202\302\203+\303\304\305\306G\\D\"\210\307\2038\310\311#\202;\312P\313\211\211\211&\211\314\230\203P\315\316!\202Q\211\262\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 (#$ . 23098)])
172 (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315& \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 :group shell-command-with-editor :type boolean] 12)
173 #@708 Teach `shell-command' to use current Emacs instance as editor.
174
175 Teach `shell-command', and all commands that ultimately call that
176 command, to use the current Emacs instance as editor by executing
177 "EDITOR=CLIENT COMMAND&" instead of just "COMMAND&".
178
179 CLIENT is automatically generated; EDITOR=CLIENT instructs
180 COMMAND to use to the current Emacs instance as "the editor",
181 assuming no other variable overrides the effect of "$EDITOR".
182 CLIENT may be the path to an appropriate emacsclient executable
183 with arguments, or a script which also works over Tramp.
184
185 Alternatively you can use the `with-editor-async-shell-command',
186 which also allows the use of another variable instead of
187 "EDITOR".
188
189 (fn &optional ARG)
190 (defalias 'shell-command-with-editor-mode #[256 "\300 \301\302\303=\203\304\302!?\202\305!\306V\"\210\307\310\304\302!\203$\311\202%\312\"\210\313\314!\203O\315\302!\210\300 \203=\211\300 \232\203O\316\317\320\304\302!\203J\321\202K\322#\266\210\323 \210\304\302!\207" [current-message set-default shell-command-with-editor-mode toggle default-value prefix-numeric-value 0 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 "Shell-Command-With-Editor mode %sabled%s" "en" "dis" force-mode-line-update] 7 (#$ . 24073) (byte-code "\206\301C\207" [current-prefix-arg toggle] 1)])
191 (defvar shell-command-with-editor-mode-hook nil)
192 (byte-code "\301\302N\204\f\303\301\302\304#\210\305\306\307\310\300!\205\307\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.)" add-minor-mode shell-command-with-editor-mode nil boundp] 6)
193 #@743 Like `async-shell-command' but with `$EDITOR' set.
194
195 Execute string "ENVVAR=CLIENT COMMAND" in an inferior shell;
196 display output, if any.  With a prefix argument prompt for an
197 environment variable, otherwise the default "EDITOR" variable
198 is used.  With a negative prefix argument additionally insert
199 the COMMAND's output at point.
200
201 CLIENT is automatically generated; ENVVAR=CLIENT instructs
202 COMMAND to use to the current Emacs instance as "the editor",
203 assuming it respects ENVVAR as an "EDITOR"-like variable.
204 CLIENT may be the path to an appropriate emacsclient executable
205 with arguments, or a script which also works over Tramp.
206
207 Also see `async-shell-command' and `shell-command'.
208
209 (fn COMMAND &optional OUTPUT-BUFFER ERROR-BUFFER ENVVAR)
210 (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 (#$ . 26015) (with-editor-shell-command-read-args "Async shell command: " t)])
211 #@189 Like `shell-command' or `with-editor-async-shell-command'.
212 If COMMAND ends with "&" behave like the latter,
213 else like the former.
214
215 (fn COMMAND &optional OUTPUT-BUFFER ERROR-BUFFER ENVVAR)
216 (defalias 'with-editor-shell-command #[1025 "\300\301\"\203\302$\207\303#\207" [string-match "&[     ]*\\'" with-editor-async-shell-command shell-command] 9 (#$ . 27032) (with-editor-shell-command-read-args "Shell command: ")])
217 #@31 
218
219 (fn PROMPT &optional ASYNC)
220 (defalias 'with-editor-shell-command-read-args #[513 "\305\306\211\206    \307=\205\310\306\311\"\211\205\312!\262$\211\2044\313\306\311\314#)\266\203\211\262\203<\315 !\316W\202= \f\205H \205H\317 F\207" [buffer-file-name major-mode inhibit-changing-match-data 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] 11 (#$ . 27461)])
221 #@56 
222
223 (fn FN COMMAND &optional OUTPUT-BUFFER ERROR-BUFFER)
224 (defalias 'shell-command--shell-command-with-editor-mode #[1026 "\306\307\"    \204 \n\203\310\311\312\313#)\266\203\204%#\202y\f\203J \203J\314!\204J    \2069\315\316 \210#*\202y\317\320\321    \206S\315\322!$$\210\3231w\324\206j\325\326!!\327\330\"\210\211\2620\202y\210\311)\207" [shell-mode-hook with-editor--envvar shell-command-with-editor-mode inhibit-changing-match-data with-editor-shell-command-use-emacsclient with-editor-emacsclient-executable remove with-editor-export-editor "&\\'" nil t string-match file-remote-p "EDITOR" with-editor--setup apply format "%s=%s %s" shell-quote-argument (error) get-buffer-process get-buffer "*Async Shell Command*" set-process-filter #[514 "\300\"\210\301\302#\207" [comint-output-filter with-editor-process-filter t] 6 "\n\n(fn PROC STR)"] default-directory process-environment with-editor-sleeping-editor] 11 (#$ . 27998)])
225 (advice-add 'shell-command :around 'shell-command--shell-command-with-editor-mode)
226 #@86 Debug configuration issues.
227 See info node `(with-editor)Debugging' for instructions.
228 (defalias 'with-editor-debug #[0 "r\306\307!q\210\310p!\210\311 \210\3121 \206\313    \314 *0\202$\210\202%\210\315\316\317\320!\"\315\321\322\n \"\f#\323\315\324 \"\315\325=\"\315\326>\"\327\315\330\331 \"\315\332?\"\315\333@\"\315\334A\"\315\335B\"\261\f\210B\203\210\336B!\203\210\337B\340\341#\211\203\204\211@\315\342\"c\210A\266\202\202q\210\202\227\315\343@\203\223\344\202\224\345\"c\210\315\346C\"c\210\336C!\203\302\337C\340\341#\211\203\276\211@\315\342\"c\210A\266\202\202\253\210\202\321\315\343@\203\315\345\202\316\344\"c\210(\347\350!\351\211DE\352 *\353\315\354\211\205\353\355!#\315\356\211\205\367\355!#\315\357\211\205\355!#\261\266\360\315\361\362\363!\"\315\364F\"\261\210\315\365!c\210\366 \211\205W\211@\315\367\370!@#c\210\371!\203P\337\372\373#\211\203O\211@\315\374\355!#c\210A\266\202\2029\210A\266\202\202\262)\207" [with-editor--envvar process-environment invocation-name invocation-directory emacs-version system-type 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" 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]\\|\\'\\)" "      %s (%s)\n" 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] 14 (#$ . 29058) nil])
229 (defconst with-editor-font-lock-keywords '(("(\\(with-\\(?:git-\\)?editor\\)\\_>" (1 'font-lock-keyword-face))))
230 (byte-code "\301\302\"\210\303\304!\207" [with-editor-font-lock-keywords font-lock-add-keywords emacs-lisp-mode provide with-editor] 3)