;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. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310\311\312&\207" [require cl-generic seq custom-declare-group project nil "Operations on the current project." :version "28.1" :group tools] 8) #@451 Special hook to find the project containing a given directory. Each functions on this hook is called in turn with one argument, the directory in which to look, and should return either nil to mean that it is not applicable, or a project instance. The exact form of the project instance is up to each respective function; the only practical limitation is to use values that `cl-defmethod' can dispatch on, like a cons cell, or a list, or a CL struct. (defvar project-find-functions (list 'project-try-vc) (#$ . 614)) #@58 Non-nil to skip prompting the user in `project-current'. (defvar project-current-inhibit-prompt nil (#$ . 1136)) #@712 Return the project instance in DIRECTORY, defaulting to `default-directory'. When no project is found in that directory, the result depends on the value of MAYBE-PROMPT: if it is nil or omitted, return nil, else ask the user for a directory in which to look for the project, and if no project is found there, return a "transient" project instance. The "transient" project instance is a special kind of value which denotes a project rooted in that directory and includes all the files under the directory except for those that should be ignored (per `project-ignores'). See the doc string of `project-find-functions' for the general form of the project instance object. (fn &optional MAYBE-PROMPT DIRECTORY) (defalias 'project-current #[512 "\211\204\262\302!\211\204 \204\203\303 \262\302!\262\2038\211\203.\304!\210\2028\305\306\"\210\307B\262\211\207" [default-directory project-current-inhibit-prompt project--find-in-directory project-prompt-project-dir project-remember-project project--remove-from-project-list "Project `%s' not found; removed from list" transient] 6 (#$ . 1256)]) #@12 (fn DIR) (defalias 'project--find-in-directory #[257 "\300\301\"\207" [run-hook-with-args-until-success project-find-functions] 4 (#$ . 2377)]) (defvar project--within-roots-fallback nil) (byte-code "\300\301\302\301\303\304#\305#\210\306\301\304\307\304\310%\210\300\311\302\311\312\304#\313#\210\306\311\304\312\304\314%\210\315\311\301\316#\210\300\317\302\317\320\304#\321#\210\306\317\304\320\304\322%\210\300\323\302\323\324\304#\325#\210\306\323\304\324\304\326%\207" [defalias project-root cl-generic-define (project) nil "Return root directory of the current project.\n\nIt usually contains the main build file, dependencies\nconfiguration file, etc. Though neither is mandatory.\n\nThe directory name must be absolute.\n\n(fn PROJECT)" cl-generic-define-method (project &context (project--within-roots-fallback (eql nil))) #[257 "\300!@\207" [project-roots] 3 "\n\n(fn PROJECT)"] project-roots (project) "Return the list containing the current project root.\n\nThe function is obsolete, all projects have one main root anyway,\nand the rest should be possible to express through\n`project-external-roots'.\n\n(fn PROJECT)" #[257 "\301\302!)C\207" [project--within-roots-fallback t project-root] 3 "\n\n(fn PROJECT)"] make-obsolete "0.3.0" project-external-roots (_project) "Return the list of external roots for PROJECT.\n\nIt's the list of directories outside of the project that are\nstill related to it. If the project deals with source code then,\ndepending on the languages used, this list should include the\nheaders search path, load path, class path, and so on.\n\n(fn PROJECT)" #[257 "\300\207" [nil] 2 "\n\n(fn PROJECT)"] project-ignores (_project _dir) "Return the list of glob patterns to ignore inside DIR.\nPatterns can match both regular files and directories.\nTo root an entry, start it with `./'. To match directories only,\nend it with `/'. DIR must be either `project-root' or one of\n`project-external-roots'.\n\n(fn PROJECT DIR)" #[514 "\302\303!\210\304\305\" \244\207" [vc-directory-exclusion-list grep-find-ignored-files require grep mapcar #[257 "\211\300P\207" ["/"] 3 "\n\n(fn DIR)"]] 5 "\n\n(fn PROJECT DIR)"]] 6) #@18 (fn ALL-FILES) (defalias 'project--file-completion-table #[257 "\300\301\302\303\304!\305\"\306\307%\207" [make-byte-code 771 "\211\301=\203\302\207\303\300$\207" vconcat vector [metadata (metadata (category . project-file)) complete-with-action] 8 "\n\n(fn STRING PRED ACTION)"] 7 (#$ . 4546)]) (byte-code "\300\301\302\303\302\304%\210\305\306\307\306\310\302#\311#\210\300\306\302\310\302\312%\207" [cl-generic-define-method project-root nil ((project (head transient))) #[257 "\211A\207" [] 2 "\n\n(fn PROJECT)"] defalias project-files cl-generic-define (project &optional dirs) "Return a list of files in directories DIRS in PROJECT.\nDIRS is a list of absolute directories; it should be some\nsubset of the project root and external roots.\n\nThe default implementation uses `find-program'. PROJECT is used\nto find the list of ignores for each directory.\n\n(fn PROJECT &optional DIRS)" #[513 "\300\301\302\303\304\305!\306\"\307\310%\206\311!C\"\207" [mapcan make-byte-code 257 "\301\302\300\"\"\207" vconcat vector [project--files-in-directory project--dir-ignores] 6 "\n\n(fn DIR)" project-root] 9 "\n\n(fn PROJECT &optional DIRS)"]] 6) #@36 (fn DIR IGNORES &optional FILES) (defalias 'project--files-in-directory #[770 "\304\305!\210\304\306!\210\307\310!!\307!\211\311\312\307!\"\262\203/\211G\313U\203)\314\202-\211\313\315O\262\316!P\266\202\317\320 \321!\322\"\203a\323\324!\325\n\325\326\323\327 !\330\n\325Q#\325\323\331!\260\202b\332%\333\334\335!!\336\216 r q\210\337\315\340#\211\341U\204\202\342\343\344 \"\210\210*r q\210\344 +\345\346\327\347\340#\350\"!)\207" [default-directory find-program find-name-arg standard-output require find-dired xref file-local-name expand-file-name string-prefix-p "/:" 2 "/" nil file-remote-p format "%s %s %s -type f %s -print0" file-name-as-directory xref--find-ignores-arguments shell-quote-argument "(" " " mapconcat split-string " -o " ")" "" get-buffer-create generate-new-buffer-name " *string-output*" #[0 "\301!\207" [standard-output kill-buffer] 2] process-file-shell-command t 0 error "File listing failed: %s" buffer-string project--remote-file-names sort "" string<] 19 (#$ . 5716)]) #@149 Return LOCAL-FILES as if they were on the system of `default-directory'. Also quote LOCAL-FILES if `default-directory' is quoted. (fn LOCAL-FILES) (defalias 'project--remote-file-names #[257 "\301!\211\204\302\303\304!\"\262\203\305\306\"\202.\202.\305\307\310\311\312\313!\314\"\315\316%\"\207" [default-directory file-remote-p string-prefix-p "/:" file-local-name mapcar file-name-quote make-byte-code 257 "\300P\207" vconcat vector [] 3 "\n\n(fn FILE)"] 9 (#$ . 6755)]) (byte-code "\300\301\302\303\304\305\306\307&\210\310\311\312\313\314DD\315\316\317\320\321&\210\310\322\312\313\323DD\324\316\325\304\326\327\330\320\331& \207" [custom-declare-group project-vc nil "Project implementation based on the VC package." :version "25.1" :group project custom-declare-variable project-vc-ignores funcall function #[0 "\300\207" [nil] 1] "List of patterns to add to `project-ignores'." :type (repeat string) :safe listp project-vc-merge-submodules #[0 "\300\207" [t] 1] "Non-nil to consider submodules part of the parent project.\n\nAfter changing this variable (using Customize or .dir-locals.el)\nyou might have to restart Emacs to see the effect." boolean "28.1" :package-version (project . "0.2.0") booleanp] 12) #@267 Function that returns a list of external roots. It should return a list of directory roots that contain source files related to the current buffer. The directory names should be absolute. Used in the VC project backend implementation of `project-external-roots'. (defvar project-vc-external-roots-function #[0 "\207" [tags-table-list] 1] (#$ . 7997)) #@12 (fn DIR) (defalias 'project-try-vc #[257 "\3001 \301!0\202 \210\302\211\303=\203E\304\305\"\206\\\306\307#\310\305\311!\203>\312!\203>\313\314!!\306\307#\262\202?#\262\202\\\211\204M\302\202\\\3151Z\306\307#0\202\\\210\302\211\205c\316B\207" [(error) vc-responsible-backend nil Git vc-file-getprop project-git-root vc-call-backend root vc-file-setprop project--vc-merge-submodules-p project--submodule-p file-name-directory directory-file-name (error) vc] 11 (#$ . 8358)]) #@13 (fn ROOT) (defalias 'project--submodule-p #[257 "\300\301\"\302!\203\303\2026\304\305!r\211q\210\306\307\310\311\312!\313\"\314$\216\315!\210eb\210\316\317!*\262\2035\320\2026\303\207" [expand-file-name ".git" file-directory-p nil generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 insert-file-contents looking-at "gitdir: [./]+/\\.git/modules/" t] 9 (#$ . 8869)]) (byte-code "\300\301\302\303\302\304%\210\300\305\302\306\302\307%\210\300\310\302\311\302\312%\207" [cl-generic-define-method project-root nil ((project (head vc))) #[257 "\211A\207" [] 2 "\n\n(fn PROJECT)"] project-external-roots ((project (head vc))) #[257 "\301\302\303\304 \"!\305!C\"\207" [project-vc-external-roots-function project-subtract-directories project-combine-directories mapcar file-name-as-directory project-root] 6 "\n\n(fn PROJECT)"] project-files ((project (head vc)) &optional dirs) #[513 "\300\301\302\303\304\305!\306\"\307\310%\206\311!C\"\207" [mapcan make-byte-code 257 "\301\302\"\303\304\300A\"\2036\305!\211\262\2036\211\306=\204.\211\307=\2036\203.\310\311\312 \"\2036\313#\202>\314\315\300\"\"\207" vconcat vector [project--value-in-dir project-vc-ignores nil file-equal-p vc-responsible-backend Hg Git version<= "1.9" vc-git--program-version project--vc-list-files project--files-in-directory project--dir-ignores] 8 "\n\n(fn DIR)" project-root] 9 "\n\n(fn PROJECT &optional DIRS)"]] 6) #@34 (fn DIR BACKEND EXTRA-IGNORES) (defalias 'project--vc-list-files #[771 "\301=\203[\302\303!!\304\305\306\307\"\262\203%\306\310\311\312\"B\"\262\311\313\314\315\316\305\317$\320\321#\"\262\322!\203V\323 \311\324\325\326\327\330  \"\331\"\332\333%\"\315\334#\266\203\335!)\207\336=\203\246\302\303!!\305\211\337\244\262\203z\211\340\341\"\244\262\342\343!r\211q\210\324\344\345\327\330!\346\"\347$\216\315\350\321\344\351\352&\210\311\353\314\354 \320\321#\"*\262)\207\305\207" [default-directory Git expand-file-name file-name-as-directory ("-z") nil append ("-c" "-o" "--exclude-standard") "--" mapcar #[257 "\300\301\302\303\"\203 \202/\302\304\"\203\305\306O\262\202.\307P\262\302\310\"\203.\311P\262\"\207" [format ":(exclude,glob,top)%s" string-match "\\*\\*" "\\./" 2 nil "**/" "/\\'" "**"] 6 "\n\n(fn I)"] #[257 "P\207" [default-directory] 3 "\n\n(fn FILE)"] split-string apply vc-git--run-command-string "ls-files" "" t project--vc-merge-submodules-p project--git-submodules make-byte-code 257 "\303!\205 \304\nP\300\301#\207" vconcat vector [default-directory file-directory-p project--vc-list-files] 5 "\n\n(fn MODULE)" nconc delete-consecutive-dups Hg ("-mcardu" "--no-status" "-0") mapcan #[257 "\300D\207" ["--exclude"] 3 "\n\n(fn I)"] generate-new-buffer " *temp*" 0 "\301\300!\205 \302\300!\207" [buffer-name kill-buffer] 2 vc-hg-command "." "status" #[257 "P\207" [default-directory] 3 "\n\n(fn S)"] buffer-string] 15 (#$ . 10368)]) #@12 (fn DIR) (defalias 'project--vc-merge-submodules-p #[257 "\300\301\"\207" [project--value-in-dir project-vc-merge-submodules] 4 (#$ . 11891)]) (defalias 'project--git-submodules #[0 "\3001:\301\302!r\211q\210\303\304\305\306\307!\310\"\311$\216\312\313!\210\314eb\210\315\316\314\317#\2031\320\321!B\262\202\211\237\262*\2620\207\210\314\207" [(file-missing) generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 insert-file-contents ".gitmodules" nil re-search-forward "path *= *\\(.+\\)" t match-string 1] 7]) (cl-generic-define-method 'project-ignores nil '((project (head vc)) dir) nil #[514 "A\301\302\303\"\205\304!\262\305\301\306\307\310\311 #\"\"\312\313\"\306\314\"#\207" [vc-directory-exclusion-list nil append file-equal-p vc-responsible-backend delq mapcar #[257 "\211\300H\301=\203\n\302\207\303\304\"\203$\300\224\300U\203 \305\306\307\211\310%\207\306P\207\207" [0 33 nil string-match "\\(/\\)[^/]" replace-match "./" t 1] 7 "\n\n(fn ENTRY)"] vc-call-backend ignore-completion-table project--value-in-dir project-vc-ignores #[257 "\211\300P\207" ["/"] 3 "\n\n(fn DIR)"]] 13 "\n\n(fn PROJECT DIR)"]) #@226 Return a sorted and culled list of directory names. Appends the elements of LISTS-OF-DIRS together, removes non-existing directories, as well as directories a parent of whose is already in the list. (fn &rest LISTS-OF-DIRS) (defalias 'project-combine-directories #[128 "\300\301\302\303\304\"\"\305\"\211\211A\203*\306@A@\"\203#\211AA\241\210\202 \211A\262\202 \307\310\"\207" [sort mapcar #[257 "\300\301!!\207" [file-name-as-directory expand-file-name] 4 "\n\n(fn DIR)"] apply append string< string-prefix-p cl-delete-if-not file-exists-p] 7 (#$ . 13110)]) #@116 Return a list of elements from FILES that are outside of DIRS. DIRS must contain directory names. (fn FILES DIRS) (defalias 'project-subtract-directories #[514 "\300\301\302$\207" [cl-set-difference :test file-in-directory-p] 7 (#$ . 13688)]) #@16 (fn VAR DIR) (defalias 'project--value-in-dir #[514 "\302\303!r\211q\210\304\305\306\307\310!\311\"\312$\216\313\314 \210)J*\207" [default-directory enable-local-variables generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 :all hack-dir-local-variables-non-file-buffer] 9 (#$ . 13940)]) #@30 Keymap for project commands. (defvar project-prefix-map (byte-code "\300 \301\302\303#\210\301\304\305#\210\301\306\307#\210\301\310\311#\210\301\312\313#\210\301\314\315#\210\301\316\317#\210\301\320\321#\210\301\322\323#\210\301\324\325#\210\301\326\327#\210\301\330\331#\210\301\332\333#\210\301\334\335#\210\301\336\337#\210\301\340\341#\210\211\207" [make-sparse-keymap define-key "!" project-shell-command "&" project-async-shell-command "f" project-find-file "F" project-or-external-find-file "b" project-switch-to-buffer "s" project-shell "d" project-dired "v" project-vc-dir "c" project-compile "e" project-eshell "k" project-kill-buffers "p" project-switch-project "g" project-find-regexp "G" project-or-external-find-regexp "r" project-query-replace-regexp "x" project-execute-extended-command] 5) (#$ . 14310)) #@68 Keymap for project commands that display buffers in other windows. (defvar project-other-window-map (byte-code "\300 \301\302\303#\210\211\207" [make-sparse-keymap define-key "" project-display-buffer] 5) (#$ . 15155)) #@67 Keymap for project commands that display buffers in other frames. (defvar project-other-frame-map (byte-code "\300 \301\302\303#\210\211\207" [make-sparse-keymap define-key "" project-display-buffer-other-frame] 5) (#$ . 15382)) #@29 (fn ACTION &optional MAP) (defalias 'project--other-place-command #[513 "\302\303\304\"\305\"\305\"\304?\205\206\211\203#\306!\202*\307\310\311!\"\262)\207" [project-prefix-map display-buffer-overriding-action read-key-sequence-vector nil t lookup-key call-interactively user-error "%s is undefined" key-description] 11 (#$ . 15619)]) #@159 Run project command, displaying resultant buffer in another window. The following commands are available: \{project-prefix-map} \{project-other-window-map} (defalias 'project-other-window-command #[0 "\301\302\"\207" [project-other-window-map project--other-place-command ((display-buffer-pop-up-window) (inhibit-same-window . t))] 3 (#$ . 15982) nil]) #@157 Run project command, displaying resultant buffer in another frame. The following commands are available: \{project-prefix-map} \{project-other-frame-map} (defalias 'project-other-frame-command #[0 "\301\302\"\207" [project-other-frame-map project--other-place-command ((display-buffer-pop-up-frame))] 3 (#$ . 16345) nil]) #@126 Run project command, displaying resultant buffer in a new tab. The following commands are available: \{project-prefix-map} (defalias 'project-other-tab-command #[0 "\300\301!\207" [project--other-place-command ((display-buffer-in-new-tab))] 2 (#$ . 16677) nil]) (byte-code "\301\300!\203\203\302\303\304#\210\301\207" [tab-prefix-map boundp define-key "p" project-other-tab-command] 4) #@431 Find all matches for REGEXP in the current project's roots. With \[universal-argument] prefix, you can specify the directory to search in, and the file name pattern to search for. The pattern may use abbreviations defined in `grep-files-aliases', e.g. entering `ch' is equivalent to `*.[ch]'. As whitespace triggers completion when entering a pattern, including it requires quoting, e.g. `\[quoted-insert]'. (fn REGEXP) (defalias 'project-find-regexp #[257 "\302\303!\210\302\304!\210\305\306!\307! \204\310!\202*\311\312\313\306$\314\313\315!#\262\316\317\320#\313\")\207" [default-directory current-prefix-arg require xref grep project-current t project-root project-files read-directory-name "Base directory: " nil project--files-in-directory grep-read-files xref--show-xrefs apply-partially project--find-regexp-in-files] 9 (#$ . 17078) (byte-code "\300 C\207" [project--read-regexp] 1)]) #@20 (fn PROJECT DIR) (defalias 'project--dir-ignores #[514 "\300!\301\"\204\302\303\211\"\202&\302\"\304\"\203 \211\202$\305\306\"\262\207" [project-root file-in-directory-p project-ignores nil file-equal-p cl-delete-if #[257 "\300\301\"\207" [string-prefix-p "./"] 4 "\n\n(fn STR)"]] 7 (#$ . 18002)]) #@170 Find all matches for REGEXP in the project roots or external roots. With \[universal-argument] prefix, you can specify the file name pattern to search for. (fn REGEXP) (defalias 'project-or-external-find-regexp #[257 "\301\302!\210\303\304!\305!\306\305!\307!B\"\310\311\312#\313\")\207" [default-directory require xref project-current t project-root project-files project-external-roots xref--show-xrefs apply-partially project--find-regexp-in-files nil] 8 (#$ . 18324) (byte-code "\300 C\207" [project--read-regexp] 1)]) #@21 (fn REGEXP FILES) (defalias 'project--find-regexp-in-files #[514 "\211\204\300\301!\210\302\"\211\204\300\303\"\210\211\207" [user-error "Empty file list" xref-matches-in-files "No matches for: %s"] 6 (#$ . 18861)]) (defvar project-regexp-history-variable 'grep-regexp-history) (defalias 'project--read-regexp #[0 "\301\302\303\"\304\305\205 \306!#\207" [project-regexp-history-variable thing-at-point symbol t read-regexp "Find regexp" regexp-quote] 5]) #@172 Visit a file (with completion) in the current project. The completion default is the filename at point, determined by `thing-at-point' (whether such file exists or not). (defalias 'project-find-file #[0 "\300\301!\302!C\303\304\305!#\207" [project-current t project-root project-find-file-in thing-at-point filename] 6 (#$ . 19336) nil]) #@190 Visit a file (with completion) in the current project or external roots. The completion default is the filename at point, determined by `thing-at-point' (whether such file exists or not). (defalias 'project-or-external-find-file #[0 "\300\301!\302!\303!B\304\305\306!#\207" [project-current t project-root project-external-roots project-find-file-in thing-at-point filename] 6 (#$ . 19685) nil]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313& \207" [custom-declare-variable project-read-file-name-function funcall function #[0 "\300\207" [project--read-file-cpd-relative] 1] "Function to call to read a file name from a list.\nFor the arguments list, see `project--read-file-cpd-relative'." :type (choice (const :tag "Read with completion from relative names" project--read-file-cpd-relative) (const :tag "Read with completion from absolute names" project--read-file-absolute) (function :tag "Custom function" nil)) :group project :version "27.1"] 10) #@229 Read a file name, prompting with PROMPT. ALL-FILES is a list of possible file name completions. PREDICATE, HIST, and DEFAULT have the same meaning as in `completing-read'. (fn PROMPT ALL-FILES &optional PREDICATE HIST DEFAULT) (defalias 'project--read-file-cpd-relative #[1282 "\300\301\"\211G\302V\205\303!\262\211G\211\302U\203\202$\304\305\"P\306\307\310\311\312\313!\314\"\315\316%\"\317!\320\n\n\n%P\207" [try-completion "" 0 file-name-directory format " in %s" mapcar make-byte-code 257 "\211\300\301O\207" vconcat vector [nil] 4 "\n\n(fn S)" project--file-completion-table project--completing-read-strict] 16 (#$ . 20666)]) #@58 (fn PROMPT ALL-FILES &optional PREDICATE HIST DEFAULT) (defalias 'project--read-file-absolute #[1282 "\300\301!%\207" [project--completing-read-strict project--file-completion-table] 11 (#$ . 21329)]) #@88 Complete FILENAME in DIRS in PROJECT and visit the result. (fn FILENAME DIRS PROJECT) (defalias 'project-find-file-in #[771 "\303\"\n\304\305\211%\211\306\230\203\307\310!\202\311!)\207" [read-file-name-completion-ignore-case completion-ignore-case project-read-file-name-function project-files "Find file" nil "" user-error "You didn't specify the file" find-file] 10 (#$ . 21544)]) #@59 (fn PROMPT COLLECTION &optional PREDICATE HIST DEFAULT) (defalias 'project--completing-read-strict #[1282 "\211\203\211\300\230\204\301\302#\202\301\303\"\304\305\306&\211\232\203I\307#\204I\304\301\303 \"\305 \306&\262\207" ["" format "%s (default %s): " "%s: " completing-read t nil test-completion] 15 (#$ . 21947)]) #@44 Start Dired in the current project's root. (defalias 'project-dired #[0 "\300\301\302\303!!!\207" [dired project-root project-current t] 4 (#$ . 22313) nil]) #@43 Run VC-Dir in the current project's root. (defalias 'project-vc-dir #[0 "\300\301\302\303!!!\207" [vc-dir project-root project-current t] 4 (#$ . 22477) nil]) #@291 Start an inferior shell in the current project's root directory. If a buffer already exists for running a shell in the project's root, switch to it. Otherwise, create a new shell buffer. With \[universal-argument] prefix arg, create a new inferior shell buffer even if one already exists. (defalias 'project-shell #[0 "\302\303\304!!\305\306!\307!\211\203 \204\310!\202\311\312!!)\207" [default-directory current-prefix-arg project-root project-current t project-prefixed-buffer-name "shell" get-buffer pop-to-buffer-same-window shell generate-new-buffer-name] 5 (#$ . 22643) nil]) #@272 Start Eshell in the current project's root directory. If a buffer already exists for running Eshell in the project's root, switch to it. Otherwise, create a new Eshell buffer. With \[universal-argument] prefix arg, create a new Eshell buffer even if one already exists. (defalias 'project-eshell #[0 "\303\304\305!!\306\307!\310 !\211\203\n\204\311!\202\312\305!*\207" [default-directory eshell-buffer-name current-prefix-arg project-root project-current t project-prefixed-buffer-name "eshell" get-buffer pop-to-buffer-same-window eshell] 3 (#$ . 23243) nil]) #@68 Run `async-shell-command' in the current project's root directory. (defalias 'project-async-shell-command #[0 "\301\302\303!!\304\305!)\207" [default-directory project-root project-current t call-interactively async-shell-command] 3 (#$ . 23820) nil]) (byte-code "\300\301\302\303#\300\207" [function-put project-async-shell-command interactive-only async-shell-command] 4) #@62 Run `shell-command' in the current project's root directory. (defalias 'project-shell-command #[0 "\301\302\303!!\304\305!)\207" [default-directory project-root project-current t call-interactively shell-command] 3 (#$ . 24201) nil]) (byte-code "\300\301\302\303#\300\207" [function-put project-shell-command interactive-only shell-command] 4) #@174 Search for REGEXP in all the files of the project. Stops when a match is found. To continue searching for the next match, use the command \[fileloop-continue]. (fn REGEXP) (defalias 'project-search #[257 "\300\301\302\303!!\304#\210\305 \207" [fileloop-initialize-search project-files project-current t default fileloop-continue] 6 (#$ . 24553) "sSearch (regexp): "]) #@253 Query-replace REGEXP in all the files of the project. Stops when a match is found and prompts for whether to replace it. If you exit the query-replace, you can later continue the query-replace loop using the command \[fileloop-continue]. (fn FROM TO) (defalias 'project-query-replace-regexp #[514 "\300\301\302\303!!\304$\210\305 \207" [fileloop-initialize-replace project-files project-current t default fileloop-continue] 8 (#$ . 24930) (byte-code "\300\301\302\211#\211@A\211@A\211D\266\202\207" [query-replace-read-args "Query replace (regexp)" t] 9)]) #@13 (fn MODE) (defalias 'project-prefixed-buffer-name #[257 "\301\302\303!!\304\227\301\260\207" [default-directory "*" file-name-nondirectory directory-file-name "-"] 6 (#$ . 25501)]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313& \207" [custom-declare-variable project-compilation-buffer-name-function funcall function #[0 "\300\207" [nil] 1] "Function to compute the name of a project compilation buffer.\nIf non-nil, it overrides `compilation-buffer-name-function' for\n`project-compile'." :version "28.1" :group project :type (choice (const :tag "Default" nil) (const :tag "Prefixed with root directory name" project-prefixed-buffer-name) (function :tag "Custom function"))] 10) #@36 Run `compile' in the project root. (defalias 'project-compile #[0 "\303\304\305!!\206\n \306\307!*\207" [project-compilation-buffer-name-function compilation-buffer-name-function default-directory project-root project-current t call-interactively compile] 3 (#$ . 26209) nil]) (byte-code "\300\301\302\303#\300\207" [function-put project-compile interactive-only compile] 4) (defalias 'project--read-project-buffer #[0 "\300\301!p\302!\303!\304\305\306\307\310!\311\"\312\313%\314\315B!\205#\316$\207" [project-current t other-buffer buffer-name make-byte-code 257 "\211A\205\300rAq\210\301 )\232\207" vconcat vector [project-current] 3 "\n\n(fn BUFFER)" read-buffer "Switch to buffer: " nil] 10]) #@290 Display buffer BUFFER-OR-NAME in the selected window. When called interactively, prompts for a buffer belonging to the current project. Two buffers belong to the same project if their project instances, as reported by `project-current' in each buffer, are identical. (fn BUFFER-OR-NAME) (defalias 'project-switch-to-buffer #[257 "\300!\207" [switch-to-buffer] 3 (#$ . 26932) (byte-code "\300 C\207" [project--read-project-buffer] 1)]) #@422 Display BUFFER-OR-NAME in some window, without selecting it. When called interactively, prompts for a buffer belonging to the current project. Two buffers belong to the same project if their project instances, as reported by `project-current' in each buffer, are identical. This function uses `display-buffer' as a subroutine, which see for how it is determined where the buffer will be displayed. (fn BUFFER-OR-NAME) (defalias 'project-display-buffer #[257 "\300!\207" [display-buffer] 3 (#$ . 27377) (byte-code "\300 C\207" [project--read-project-buffer] 1)]) #@425 Display BUFFER-OR-NAME preferably in another frame. When called interactively, prompts for a buffer belonging to the current project. Two buffers belong to the same project if their project instances, as reported by `project-current' in each buffer, are identical. This function uses `display-buffer-other-frame' as a subroutine, which see for how it is determined where the buffer will be displayed. (fn BUFFER-OR-NAME) (defalias 'project-display-buffer-other-frame #[257 "\300!\207" [display-buffer-other-frame] 3 (#$ . 27950) (byte-code "\300 C\207" [project--read-project-buffer] 1)]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315& \207" [custom-declare-variable project-kill-buffer-conditions funcall function #[0 "\300\207" [(buffer-file-name (major-mode . fundamental-mode) (and (derived-mode . special-mode) (not (major-mode . help-mode))) (derived-mode . compilation-mode) (derived-mode . dired-mode) (derived-mode . diff-mode))] 1] "List of conditions to kill buffers related to a project.\nThis list is used by `project-kill-buffers'.\nEach condition is either:\n- a regular expression, to match a buffer name,\n- a predicate function that takes a buffer object as argument\n and returns non-nil if the buffer should be killed,\n- a cons-cell, where the car describes how to interpret the cdr.\n The car can be one of the following:\n * `major-mode': the buffer is killed if the buffer's major\n mode is eq to the cons-cell's cdr\n * `derived-mode': the buffer is killed if the buffer's major\n mode is derived from the major mode denoted by the cons-cell's\n cdr\n * `not': the cdr is interpreted as a negation of a condition.\n * `and': the cdr is a list of recursive conditions, that all have\n to be met.\n * `or': the cdr is a list of recursive conditions, of which at\n least one has to be met.\n\nIf any of these conditions are satisfied for a buffer in the\ncurrent project, it will be killed." :type (repeat (choice regexp function symbol (cons :tag "Major mode" (const major-mode) symbol) (cons :tag "Derived mode" (const derived-mode) symbol) (cons :tag "Negation" (const not) sexp) (cons :tag "Conjunction" (const and) sexp) (cons :tag "Disjunction" (const or) sexp))) :version "28.1" :group project :package-version (project . "0.6.0")] 12) #@56 Return the list of all buffers in project PR. (fn PR) (defalias 'project--buffer-list #[257 "\300\301 \211\203!\211@rq\210\302 )\232\203\211B\262A\266\202\202\210\211\237\207" [nil buffer-list project-current] 6 (#$ . 30272)]) #@167 Check if buffer BUF matches any element of the list CONDITIONS. See `project-kill-buffer-conditions' for more details on the form of CONDITIONS. (fn BUF CONDITIONS) (defalias 'project--kill-buffer-check #[514 "\3012\225\211\211\205\222\211@\211;\203\"\211\302!\303\304\305#)\266\203\202\203\2119\203-\211!\202\203\211\242\306=\203>\307\306\"A=\202\203\211\242\310=\203Q\311\307\306\"A\"\202\203\211\242\312=\203a\313A\"?\202\203\211\242\314=\203p\313A\"\202\203\211\242\315=\203\213\316\317\313\"\320\321A\"\"\203\213\322\301\304\"\210A\266\202\202\2620\207" [inhibit-changing-match-data kill buffer-name nil t string-match major-mode buffer-local-value derived-mode provided-mode-derived-p not project--kill-buffer-check or and seq-every-p apply-partially mapcar list throw] 11 (#$ . 30517)]) #@150 Return list of buffers in project PR to kill. What buffers should or should not be killed is described in `project-kill-buffer-conditions'. (fn PR) (defalias 'project--buffers-to-kill #[257 "\301\302!\211\203\211@\303\"\203\211B\262A\266\202\202\210\211\207" [project-kill-buffer-conditions nil project--buffer-list project--kill-buffer-check] 7 (#$ . 31357)]) #@450 Kill the buffers belonging to the current project. Two buffers belong to the same project if their project instances, as reported by `project-current' in each buffer, are identical. Only the buffers that match a condition in `project-kill-buffer-conditions' will be killed. If NO-CONFIRM is non-nil, the command will not ask the user for confirmation. NO-CONFIRM is always nil when the command is invoked interactively. (fn &optional NO-CONFIRM) (defalias 'project-kill-buffers #[256 "\300\301!\302!\203\303\304\"\202-\211\204\305\306!\202-\307\310\311G\312!#!\205-\303\304\"\207" [project-current t project--buffers-to-kill mapc kill-buffer message "No buffers to kill" yes-or-no-p format "Kill %d buffers in %s? " project-root] 9 (#$ . 31738) nil]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313& \207" [custom-declare-variable project-list-file funcall function #[0 "\300\301!\207" [locate-user-emacs-file "projects"] 2] "File in which to save the list of known projects." :type file :version "28.1" :group project] 10) #@108 List structure containing root directories of known projects. With some possible metadata (to be decided). (defvar project--list 'unset (#$ . 32801)) #@67 Initialize `project--list' using contents of `project-list-file'. (defalias 'project--read-project-list #[0 "\302!\205$\303\304!r\211q\210\305\306\307\310\311!\312\"\313$\216\314!\210\315p!*\262\316\317 \"?\2055\320\321\"\210\322\211\207" [project-list-file project--list file-exists-p generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 insert-file-contents read seq-every-p #[257 "\211\242;\207" [] 2 "\n\n(fn ELT)"] warn "Contents of %s are in wrong format, resetting" nil] 8 (#$ . 32957)]) #@61 Initialize `project--list' if it isn't already initialized. (defalias 'project--ensure-read-project-list #[0 "\301=\205\302 \207" [project--list unset project--read-project-list] 2 (#$ . 33536)]) #@46 Save `project--list' in `project-list-file'. (defalias 'project--write-project-list #[0 "\304\305!r\211q\210\306\307\310\311\312!\313\"\314$\216\315c\210\316\211\317 p\"\210*\320\316\211\316\321%*\262\207" [project-list-file print-level print-length project--list generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 ";;; -*- lisp-data -*-\n" nil pp write-region silent] 8 (#$ . 33741)]) #@135 Add project PR to the front of the project list. Save the result in `project-list-file' if the list of projects has changed. (fn PR) (defalias 'project-remember-project #[257 "\301 \210\302!@@\232?\2051\211\203)\211@@\232\203\"\303\"A\266\202\202\210\211CB\304 \207" [project--list project--ensure-read-project-list project-root delq project--write-project-list] 7 (#$ . 34210)]) #@338 Remove directory PROJECT-ROOT of a missing project from the project list. If the directory was in the list before the removal, save the result in `project-list-file'. Announce the project's removal from the list using REPORT-MESSAGE, which is a format string passed to `message' as its first argument. (fn PROJECT-ROOT REPORT-MESSAGE) (defalias 'project--remove-from-project-list #[514 "\301 \210\302\"\211\205\303\"\304\"\210\305 \207" [project--list project--ensure-read-project-list assoc delq message project--write-project-list] 6 (#$ . 34615)]) #@155 Remove directory PROJECT-ROOT from the project list. PROJECT-ROOT is the root directory of a known project listed in the project list. (fn PROJECT-ROOT) (defalias 'project-remove-known-project #[257 "\300\301\"\207" [project--remove-from-project-list "Project `%s' removed from known projects"] 4 (#$ . 35184) (byte-code "\300 C\207" [project-prompt-project-dir] 1)]) #@232 Prompt the user for a directory that is one of the known project roots. The project is chosen among projects known from the project list, see `project-list-file'. It's also possible to enter an arbitrary directory not in the list. (defalias 'project-prompt-project-dir #[0 "\302 \210\303\304\305C\"!\306\307\310\311$\211\232\203 \312\313 \310\311$\202!\211\207" [project--list default-directory project--ensure-read-project-list "... (choose a dir)" project--file-completion-table append completing-read "Select project: " nil t read-directory-name "Select directory: "] 8 (#$ . 35561)]) #@60 Return the list of root directories of all known projects. (defalias 'project-known-project-roots #[0 "\301 \210\302\303\"\207" [project--list project--ensure-read-project-list mapcar car] 3 (#$ . 36161)]) #@46 Execute an extended command in project root. (defalias 'project-execute-extended-command #[0 "\301\302\303!!\304\305!)\207" [default-directory project-root project-current t call-interactively execute-extended-command] 3 (#$ . 36374) nil]) (byte-code "\300\301\302\303#\304\305\306\307\310DD\311\312\313\314\315\316\317\320\321& \210\304\322\306\307\323DD\324\320\325\314\315\312\313& \207" [function-put project-execute-extended-command interactive-only command-execute custom-declare-variable project-switch-commands funcall function #[0 "\300\207" [((project-find-file "Find file") (project-find-regexp "Find regexp") (project-dired "Dired") (project-vc-dir "VC-Dir") (project-eshell "Eshell"))] 1] "Alist mapping commands to descriptions.\nUsed by `project-switch-project' to construct a dispatch menu of\ncommands available upon \"switching\" to another project.\n\nEach element is of the form (COMMAND LABEL &optional KEY) where\nCOMMAND is the command to run when KEY is pressed. LABEL is used\nto distinguish the menu entries in the dispatch menu. If KEY is\nabsent, COMMAND must be bound in `project-prefix-map', and the\nkey is looked up in that map." :version "28.1" :group project :package-version (project . "0.6.0") :type (repeat (list (symbol :tag "Command") (string :tag "Label") (choice :tag "Key to press" (const :tag "Infer from the keymap" nil) (character :tag "Explicit key")))) project-switch-use-entire-map #[0 "\300\207" [nil] 1] "Make `project-switch-project' use entire `project-prefix-map'.\nIf nil, `project-switch-project' will only recognize commands\nlisted in `project-switch-commands' and signal an error when\nothers are invoked. Otherwise, all keys in `project-prefix-map'\nare legal even if they aren't listed in the dispatch menu." boolean] 13) #@58 Return a prompt for the project switching dispatch menu. (defalias 'project--keymap-prompt #[0 "\301\302\303#\207" [project-switch-commands mapconcat #[257 "\211@A\211@A\211@A\301!\203\211\262\262\203&\302!\202,\303C\304#\305\306\307\310!\311\312##\262\266\203\207" [project-prefix-map characterp vector where-is-internal t format "[%s] %s" propertize key-description face bold] 17 "\n\n(fn ARG0)"] " "] 4 (#$ . 38166)]) #@244 "Switch" to another project by running an Emacs command. The available commands are presented as a dispatch menu made from `project-switch-commands'. When called in a program, it will use the project corresponding to directory DIR. (fn DIR) (defalias 'project-switch-project #[257 "\306\307\"\310 \311 \"\210\211\2030\211@\211@\211\205\3128\211\203'\313\314!#\210\266A\266\202\202\f\262\262\315\211\204n\316\317 !\320\"\211\262\203X \204X\236\204X\315\262\320\321 \"\211\322>\203g\323!\210\210)\266\2026\324\323!*\207" [project-switch-commands project-prefix-map overriding-local-map project-switch-use-entire-map project-current-inhibit-prompt default-directory mapcar #[257 "\300@!\203 \301!\207\207" [characterp reverse] 3 "\n\n(fn ROW)"] make-sparse-keymap set-keymap-parent 2 define-key vector nil read-key-sequence project--keymap-prompt lookup-key current-global-map (keyboard-quit keyboard-escape-quit) call-interactively t] 11 (#$ . 38618) (byte-code "\300 C\207" [project-prompt-project-dir] 1)]) (provide 'project)