• R/O
  • SSH

multi-project: Commit

Multi-project simplifies working with different projects in Emacs by providing support for creating, deleting, and searching with projects. Multi-project
supports interactively finding a file within a project by using a TAGS file.


Commit MetaInfo

Revision5a077a6431dedafc82ba3255e6e6ae0c54bbb1d9 (tree)
Zeit2019-01-13 04:53:47
AutorShawn Ellis <shawn.ellis17@gmai...>
CommiterShawn Ellis

Log Message

Fixed the menu and initial location within a project directory.

Ändern Zusammenfassung

Diff

diff -r 2f03ef533b85 -r 5a077a6431de multi-project.el
--- a/multi-project.el Sun Dec 30 17:51:21 2018 -0200
+++ b/multi-project.el Sat Jan 12 17:53:47 2019 -0200
@@ -1,9 +1,9 @@
11 ;;; multi-project.el --- Find files, compile, and search for multiple projects.
22
3-;; Copyright (C) 2010 - 2018
3+;; Copyright (C) 2010 - 2019
44
55 ;; Author: Shawn Ellis <shawn.ellis17@gmail.com>
6-;; Version: 0.0.28
6+;; Version: 0.0.29
77 ;; Package-Requires: ((emacs "25"))
88 ;; URL: https://bitbucket.org/ellisvelo/multi-project/overview
99 ;; Keywords: convenience project management
@@ -67,7 +67,7 @@
6767 ;; N - Add new project Prompts for project information
6868 ;; q - Quit
6969 ;; u - Unmark a project Removes the mark for a project
70-;; x - Executes actions Executes the deletions
70+;; x - Executes actions Executes the selected operations
7171
7272 ;;
7373 ;; The multi-project-compilation-command variable can be set to a function
@@ -164,9 +164,23 @@
164164 (define-key map (kbd "C-x pv") 'multi-project-visit-project)
165165 (define-key map (kbd "C-x pf") 'multi-project-find-file)
166166 (define-key map (kbd "C-x pn") 'multi-project-add-project)
167+ (define-key map (kbd "C-x pp") 'multi-project-present-project)
167168 (define-key map (kbd "C-x pg") 'multi-project-interactive-grep)
168169 (define-key map (kbd "C-x ps") 'multi-project-shell)
169170 (define-key map (kbd "C-x pt") 'multi-project-recreate-tags)
171+
172+ (easy-menu-define multi-project-mode-menu map "'multi-project-mode' menu"
173+ '("MP"
174+ ["Jump to a project" multi-project-display-projects t]
175+ ["Jump to the project root" multi-project-root t]
176+ ["Compile..." multi-project-compile t]
177+ ["Find file..." multi-project-find-file t]
178+ ["Grep project ..." multi-project-interactive-grep t]
179+ ["Add project..." multi-project-add-project t]
180+ ["Anchor project" multi-project-anchor t]
181+ ["Reset anchor" multi-project-reset-anchor t]
182+ ["Last project" multi-project-last t]))
183+
170184 map)
171185 "Global keymap for multi-project.")
172186
@@ -208,21 +222,19 @@
208222 map)
209223 "Keymap for multi-project-minibuffer.")
210224
211-(defun multi-project-dired (projectdir directory &optional searchdirectory
225+(defun multi-project-dired (projectdir directory &optional location
212226 otherwindow)
213227 "Run `dired` on a particular project.
214-The PROJECTDIR argument specifies the directory and the DIRECTORY
215-argument is used to place the cursor on a directory within
216-PROJECTDIR. The SEARCHDIRECTORY argument specifies a different
217-directory for the cursor instead of DIRECTORY. Optional argument
218-OTHERWINDOW if non-nil, then open up a buffer in a different
219-windows."
228+The PROJECTDIR specifies the project directory and the location
229+argument is used to place the cursor on a file or directory
230+within PROJECTDIR. Optional argument OTHERWINDOW if non-nil, then
231+open up a buffer in a different windows."
220232 (if projectdir
221233 (let ((directorypath projectdir)
222234 (dir directory))
223235
224- (if searchdirectory
225- (setq dir searchdirectory))
236+ (if location
237+ (setq dir location))
226238
227239 (when directorypath
228240 (if otherwindow
@@ -230,15 +242,15 @@
230242 (dired directorypath))
231243 (goto-char (point-min))
232244 (when dir
233- (if (re-search-forward (concat "[0-9]+:[0-9]+ " "\\(" dir "\\)")
234- nil t)
235- (goto-char (match-beginning 1))))))))
245+ (if (re-search-forward dir nil t)
246+ (goto-char (match-beginning 0))))))))
236247
237-(defun multi-project-dired-project (solutionlist &optional searchdirectory otherwindow)
248+(defun multi-project-dired-project (solutionlist &optional location otherwindow)
238249 "Open up a dired window based upon the project.
239-Argument SOLUTIONLIST Optional argument SEARCHDIRECTORY Optional
250+Argument SOLUTIONLIST Optional argument LOCATION Optional
240251 argument OTHERWINDOW open another window."
241- (multi-project-dired (nth 1 solutionlist) (nth 2 solutionlist) searchdirectory otherwindow))
252+ (multi-project-dired (nth 1 solutionlist) (nth 2 solutionlist) location
253+ otherwindow))
242254
243255 (defun multi-project-filter-name (project lst)
244256 "Filter based upon the the PROJECT name of the LST."
@@ -976,6 +988,15 @@
976988 (setq result (multi-project-current)))
977989 result))
978990
991+;;;###autoload
992+(defun multi-project-present-project ()
993+ "Jumps to the present project."
994+ (interactive)
995+ (let ((projectlist (multi-project-current)))
996+ (multi-project-dired-project projectlist)))
997+
998+
999+;;;###autoload
9791000 (defun multi-project-visit-project ()
9801001 "Makes a new frame with the list of projects to visit."
9811002 (interactive)
@@ -1015,6 +1036,7 @@
10151036 (+ 55 (length exclusion)))
10161037 grep-find-command)))
10171038
1039+;;;###autoload
10181040 (defun multi-project-interactive-grep ()
10191041 "Run ‘grep-find’ interactively."
10201042 (interactive)
@@ -1340,20 +1362,6 @@
13401362 (goto-char pos)
13411363 (multi-project-display-select))))
13421364
1343-(easy-menu-define multi-project-mode-menu multi-project-map
1344- "'multi-project-mode' menu"
1345- '("MP"
1346- ["Jump to a project" multi-project-display-projects t]
1347- ["Jump to the project root" multi-project-root t]
1348- ["Compile..." multi-project-compile t]
1349- ["Find file..." multi-project-find-file t]
1350- ["Grep project ..." multi-project-interactive-grep t]
1351- ["Add project..." multi-project-add-project t]
1352- ["Anchor project" multi-project-anchor t]
1353- ["Reset anchor" multi-project-reset-anchor t]
1354- ["Last project" multi-project-last t]
1355- ))
1356-
13571365 (defun multi-project-insert-path ()
13581366 "Insert the directory path of the current project."
13591367 (interactive)
Show on old repository browser