[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 14/38: Display project root directory name on mode-line
From: |
Leo Liu |
Subject: |
[elpa] 14/38: Display project root directory name on mode-line |
Date: |
Mon, 24 Mar 2014 09:31:34 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit 5e12575cd6856a929a3ca464eda13b44b0176e38
Author: Leo Liu <address@hidden>
Date: Fri Mar 7 14:49:51 2014 +0800
Display project root directory name on mode-line
---
ggtags.el | 26 +++++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/ggtags.el b/ggtags.el
index c2f09e1..24a0085 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -1473,6 +1473,23 @@ When finished invoke CALLBACK in BUFFER with process
exit status."
:visible (not (ggtags-find-project))))
map))
+(defvar ggtags-mode-line-project-keymap
+ (let ((map (make-sparse-keymap)))
+ (define-key map [mode-line mouse-1] 'ggtags-visit-project-root)
+ map))
+
+(put 'ggtags-mode-line-project-name 'risky-local-variable t)
+(defvar ggtags-mode-line-project-name
+ '("[" (:eval (when (stringp ggtags-project-root)
+ (let ((name (file-name-nondirectory
+ (directory-file-name ggtags-project-root))))
+ (propertize name 'face compilation-info-face
+ 'help-echo (concat "mouse-1 to visit "
+ ggtags-project-root)
+ 'mouse-face 'mode-line-highlight
+ 'keymap ggtags-mode-line-project-keymap))))
+ "]"))
+
;;;###autoload
(define-minor-mode ggtags-mode nil
:lighter (:eval (if ggtags-navigation-mode "" " GG"))
@@ -1485,9 +1502,16 @@ When finished invoke CALLBACK in BUFFER with process
exit status."
(add-hook 'after-save-hook 'ggtags-after-save-function nil t)
;; Append to serve as a fallback method.
(add-hook 'completion-at-point-functions
- #'ggtags-completion-at-point t t))
+ #'ggtags-completion-at-point t t)
+ (unless (memq 'ggtags-mode-line-project-name
+ mode-line-buffer-identification)
+ (setq mode-line-buffer-identification
+ (append mode-line-buffer-identification
+ '(ggtags-mode-line-project-name)))))
(remove-hook 'after-save-hook 'ggtags-after-save-function t)
(remove-hook 'completion-at-point-functions #'ggtags-completion-at-point t)
+ (setq mode-line-buffer-identification
+ (delq 'ggtags-mode-line-project-name
mode-line-buffer-identification))
(and (overlayp ggtags-highlight-tag-overlay)
(delete-overlay ggtags-highlight-tag-overlay))
(setq ggtags-highlight-tag-overlay nil)))
- [elpa] 08/38: Call ggtags-show-definition-function in the original buffer, (continued)
- [elpa] 08/38: Call ggtags-show-definition-function in the original buffer, Leo Liu, 2014/03/24
- [elpa] 03/38: Don't display buffer if ggtags-navigation-mode is exited, Leo Liu, 2014/03/24
- [elpa] 07/38: Fix some errors in ggtags-global-output, Leo Liu, 2014/03/24
- [elpa] 04/38: Combine ggtags-global-column and tag name search, Leo Liu, 2014/03/24
- [elpa] 06/38: Fix #34: New variable ggtags-global-always-update, Leo Liu, 2014/03/24
- [elpa] 09/38: Replace ignore-errors with condition-case-unless-debug, Leo Liu, 2014/03/24
- [elpa] 10/38: Automatically use GTAGSCONF file at project root, Leo Liu, 2014/03/24
- [elpa] 05/38: Improve completion support for all tag types, Leo Liu, 2014/03/24
- [elpa] 11/38: Make last change acutally work, Leo Liu, 2014/03/24
- [elpa] 12/38: Fix compatibility for locate-dominating-file, Leo Liu, 2014/03/24
- [elpa] 14/38: Display project root directory name on mode-line,
Leo Liu <=
- [elpa] 22/38: New command ggtags-navigation-isearch-forward, Leo Liu, 2014/03/24
- [elpa] 17/38: Fix ggtags-with-current-project to include GTAGSCONF, Leo Liu, 2014/03/24
- [elpa] 19/38: Use read-only-mode in ggtags-toggle-project-read-only, Leo Liu, 2014/03/24
- [elpa] 18/38: Fix #36: Allow customising path to global's exectuables, Leo Liu, 2014/03/24
- [elpa] 20/38: Teach ggtags-find-tag-dwim to detect #include files, Leo Liu, 2014/03/24
- [elpa] 25/38: Fix ggtags-find-project to check on the GTAGS file, Leo Liu, 2014/03/24
- [elpa] 23/38: Simplify ggtags-save-to-register by always re-do the search, Leo Liu, 2014/03/24
- [elpa] 21/38: Add new command ggtags-save-to-register for #37, Leo Liu, 2014/03/24
- [elpa] 16/38: Fix ggtags-show-definition to run in current project, Leo Liu, 2014/03/24
- [elpa] 24/38: Fix thinko in "Don't display buffer if ggtags-navigation-mode is exited", Leo Liu, 2014/03/24