[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 31/38: Also record ggtags-process-environment in search history
From: |
Leo Liu |
Subject: |
[elpa] 31/38: Also record ggtags-process-environment in search history |
Date: |
Mon, 24 Mar 2014 09:31:38 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit dbff63ec96754063ab5f678fe399ff5dbc24f087
Author: Leo Liu <address@hidden>
Date: Fri Mar 21 12:48:31 2014 +0800
Also record ggtags-process-environment in search history
---
ggtags.el | 40 +++++++++++++++++++++++++---------------
1 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/ggtags.el b/ggtags.el
index a61a62a..9017d4a 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -693,7 +693,8 @@ non-nil."
;; Appeared in emacs 24.4.
(fboundp 'display-buffer-no-window))
(list #'display-buffer-no-window)
- display-buffer-overriding-action)))
+ display-buffer-overriding-action))
+ (env ggtags-process-environment))
(setq ggtags-global-start-marker (point-marker))
(ggtags-navigation-mode +1)
(setq ggtags-global-exit-status 0
@@ -701,7 +702,10 @@ non-nil."
(ggtags-update-tags)
(ggtags-with-current-project
(setq ggtags-global-last-buffer
- (compilation-start command 'ggtags-global-mode)))))
+ (compilation-start command 'ggtags-global-mode)))
+ (with-current-buffer ggtags-global-last-buffer
+ (setq-local ggtags-process-environment env))
+ ggtags-global-last-buffer))
(defun ggtags-find-tag-continue ()
(interactive)
@@ -843,13 +847,24 @@ Global and Emacs."
(defun ggtags-global-search-id (cmd directory)
(sha1 (concat directory (make-string 1 0) cmd)))
+(defun ggtags-global-current-search ()
+ ;; CMD DIR ENV LINE TEXT
+ (ggtags-ensure-global-buffer
+ (list (car compilation-arguments)
+ default-directory
+ ggtags-process-environment
+ (line-number-at-pos)
+ (buffer-substring-no-properties
+ (line-beginning-position) (line-end-position)))))
+
(defun ggtags-global-rerun-search-1 (data)
(pcase data
- (`(,cmd ,dir ,line ,_text)
+ (`(,cmd ,dir ,env ,line ,_text)
(with-current-buffer (let ((ggtags-auto-jump-to-first-match nil)
;; Switch current project to DIR.
(default-directory dir)
- (ggtags-project-root dir))
+ (ggtags-project-root dir)
+ (ggtags-process-environment env))
(ggtags-global-start cmd dir))
(add-hook 'compilation-finish-functions
(lambda (buf _msg)
@@ -909,7 +924,7 @@ Global and Emacs."
(cl-labels ((prop (s) (propertize s 'face 'minibuffer-prompt))
(pp (data)
(pcase data
- (`(,_id ,cmd ,dir ,line ,text)
+ (`(,_id ,cmd ,dir ,_env ,line ,text)
(insert (prop " cmd: ") cmd "\n"
(prop " dir: ") dir "\n"
(prop "line: ") (number-to-string line) "\n"
@@ -934,14 +949,12 @@ Use \\[jump-to-register] to restore the search session."
(ggtags-ensure-global-buffer
(cl-labels ((prn (data)
(pcase data
- (`(,command ,root ,line ,_)
+ (`(,command ,root ,_env ,line ,_)
(princ (format "a ggtags search session `%s' in
directory `%s' at line %d."
command root line))))))
- (set-register r (registerv-make
- (list (car compilation-arguments) default-directory
- (line-number-at-pos) "")
- :jump-func #'ggtags-global-rerun-search-1
- :print-func #'prn)))))
+ (set-register r (registerv-make (ggtags-global-current-search)
+ :jump-func #'ggtags-global-rerun-search-1
+ :print-func #'prn)))))
(defun ggtags-delete-tag-files ()
"Delete the tag files generated by gtags."
@@ -1448,10 +1461,7 @@ Use \\[jump-to-register] to restore the search session."
(setq ggtags-global-search-history
(cl-remove id ggtags-global-search-history :test #'equal :key
#'car))
(add-to-history 'ggtags-global-search-history
- (list id (car compilation-arguments) default-directory
- (line-number-at-pos)
- (buffer-substring-no-properties
- (line-beginning-position)
(line-end-position)))))))
+ (cons id (ggtags-global-current-search))))))
(run-hooks 'ggtags-find-tag-hook))
(define-minor-mode ggtags-navigation-mode nil
- [elpa] 21/38: Add new command ggtags-save-to-register for #37, (continued)
- [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
- [elpa] 26/38: New macro ignore-errors-unless-debug and use it, Leo Liu, 2014/03/24
- [elpa] 15/38: Small fixes to last change, Leo Liu, 2014/03/24
- [elpa] 32/38: Bind ggtags-save-to-register in ggtags-global-rerun-search-map, Leo Liu, 2014/03/24
- [elpa] 28/38: New helper ggtags-forward-to-line and use it, Leo Liu, 2014/03/24
- [elpa] 27/38: Cosmetic change: Fix indentation, Leo Liu, 2014/03/24
- [elpa] 29/38: New feature ggtags-global-restore-search for #37, Leo Liu, 2014/03/24
- [elpa] 33/38: Disable ggtags-navigation-mode in ggtags-global-rerun-search, Leo Liu, 2014/03/24
- [elpa] 31/38: Also record ggtags-process-environment in search history,
Leo Liu <=
- [elpa] 30/38: Polish last change, Leo Liu, 2014/03/24
- [elpa] 34/38: Support search bookmarks as requested in #39, Leo Liu, 2014/03/24
- [elpa] 38/38: Merge branch 'master' of github.com:leoliu/ggtags, Leo Liu, 2014/03/24
- [elpa] 37/38: Rename try-complete-ggtags-tag to ggtags-try-complete-tag, Leo Liu, 2014/03/24
- [elpa] 13/38: Require cl-lib and remove macro when-let, Leo Liu, 2014/03/24
- [elpa] 36/38: Doc fix: Update README.rst and doc-strings, Leo Liu, 2014/03/24
- [elpa] 35/38: Fix #40: New user variable ggtags-supress-navigation-keys, Leo Liu, 2014/03/24