[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ELPA-diffs] ELPA branch, master, updated. 34e3d94eb31cd286c429f12c2a318
From: |
Leo Liu |
Subject: |
[ELPA-diffs] ELPA branch, master, updated. 34e3d94eb31cd286c429f12c2a318f7a79dcec4b |
Date: |
Sat, 09 Nov 2013 09:49:29 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "ELPA".
The branch, master has been updated
via 34e3d94eb31cd286c429f12c2a318f7a79dcec4b (commit)
via 1bc8b882d1c0bcab4d445aeb62ba79bb645852e7 (commit)
via f073a6527c7d8f1b27618dad547c4ff9c5595ee2 (commit)
via 2f22ea3cf5461a9c101e1b219dfb44c439a70a3f (commit)
via 9610485aa3fc283923dd2ba76691aca42102a888 (commit)
via 33390d53150a9639967bcaf07bb91b26b42f3948 (commit)
via b6c4f0005d9a2a7265a04b8c3a3963a18e753c9e (commit)
via 652be6eb536624a1c99f73a455efa970cd216270 (commit)
via dfe70c9ace883b911d04673f0658a29263d498ca (commit)
via d574dde72e705ba0c53b9bde49c4f05e060c3a41 (commit)
from 5d9f221106cd5d89361bbebbcabeb5bb4e4b1311 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 34e3d94eb31cd286c429f12c2a318f7a79dcec4b
Merge: 5d9f221 1bc8b88
Author: Leo Liu <address@hidden>
Date: Sat Nov 9 17:48:48 2013 +0800
Merge branch 'master' of github.com:leoliu/ggtags
commit 1bc8b882d1c0bcab4d445aeb62ba79bb645852e7
Author: Leo Liu <address@hidden>
Date: Sat Nov 9 17:44:13 2013 +0800
New command ggtags-find-file
diff --git a/ggtags.el b/ggtags.el
index 613b898..c14bf3a 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2013 Free Software Foundation, Inc.
;; Author: Leo Liu <address@hidden>
-;; Version: 0.7.2
+;; Version: 0.7.3
;; Keywords: tools, convenience
;; Created: 2013-01-29
;; URL: https://github.com/leoliu/ggtags
@@ -438,6 +438,7 @@ properly update `ggtags-mode-map'."
(`definition "-d")
(`reference "-r")
(`symbol "-s")
+ (`path "--path")
(`grep "--grep")
(`idutils "--idutils")))
args)))
@@ -523,7 +524,7 @@ With a prefix arg (non-nil DEFINITION) always find
definitions."
"Use `global --grep' to search for lines matching PATTERN.
Invert the match when called with a prefix arg \\[universal-argument]."
(interactive (list (ggtags-read-string (if current-prefix-arg
- "Grep inverted pattern"
+ "Inverted grep pattern"
"Grep pattern"))
current-prefix-arg))
(ggtags-find-tag 'grep (format "%s--regexp %S"
@@ -534,6 +535,16 @@ Invert the match when called with a prefix arg
\\[universal-argument]."
(interactive (list (ggtags-read-string "ID query pattern")))
(ggtags-find-tag 'idutils (format "--regexp %S" pattern)))
+(defun ggtags-find-file (pattern &optional invert-match)
+ (interactive (list (ggtags-read-string (if current-prefix-arg
+ "Inverted path pattern"
+ "Path pattern"))
+ current-prefix-arg))
+ (let ((ggtags-global-output-format 'path))
+ (ggtags-find-tag 'path (format "%s--regexp %S"
+ (if invert-match "--invert-match " "")
+ pattern))))
+
;; NOTE: Coloured output in grep requested: http://goo.gl/Y9IcX
(defun ggtags-find-tag-regexp (regexp directory)
"List tags matching REGEXP in DIRECTORY (default to project root)."
@@ -725,6 +736,10 @@ Global and Emacs."
(defun ggtags-global-filter ()
"Called from `compilation-filter-hook' (which see)."
+ ;; Get rid of line "Using config file '/PATH/TO/.globalrc'."
+ (when (re-search-backward "^ *Using config file '.*\n"
+ compilation-filter-start t)
+ (replace-match ""))
(ansi-color-apply-on-region compilation-filter-start (point)))
(defun ggtags-handle-single-match (buf _how)
@@ -976,6 +991,7 @@ Global and Emacs."
(define-key m (kbd "M-DEL") 'ggtags-delete-tag-files)
(define-key m "\M-p" 'ggtags-prev-mark)
(define-key m "\M-n" 'ggtags-next-mark)
+ (define-key m "\M-f" 'ggtags-find-file)
(define-key m "\M-o" 'ggtags-find-other-symbol)
(define-key m "\M-g" 'ggtags-grep)
(define-key m "\M-i" 'ggtags-idutils-query)
@@ -1013,7 +1029,7 @@ Global and Emacs."
'(menu-item "Delete tag files" ggtags-delete-tag-files
:enable (ggtags-find-project)))
(define-key menu [kill-buffers]
- '(menu-item "Kill buffers visiting project files"
ggtags-kill-file-buffers
+ '(menu-item "Kill project file buffers" ggtags-kill-file-buffers
:enable (ggtags-find-project)))
(define-key menu [pop-mark]
'(menu-item "Pop mark" pop-tag-mark
@@ -1023,6 +1039,8 @@ Global and Emacs."
(define-key menu [prev-mark]
'(menu-item "Previous mark" ggtags-prev-mark))
(define-key menu [sep1] menu-bar-separator)
+ (define-key menu [find-file]
+ '(menu-item "Find files" ggtags-find-file))
(define-key menu [query-replace]
'(menu-item "Query replace" ggtags-query-replace))
(define-key menu [idutils]
@@ -1031,12 +1049,12 @@ Global and Emacs."
'(menu-item "Use grep" ggtags-grep))
(define-key menu [find-symbol]
'(menu-item "Find other symbol" ggtags-find-other-symbol))
+ (define-key menu [find-tag-regexp]
+ '(menu-item "Find tag matching regexp" ggtags-find-tag-regexp))
(define-key menu [find-reference]
'(menu-item "Find reference" ggtags-find-reference))
(define-key menu [find-tag-continue]
'(menu-item "Continue find tag" tags-loop-continue))
- (define-key menu [find-tag-regexp]
- '(menu-item "Find tag matching regexp" ggtags-find-tag-regexp))
(define-key menu [find-tag]
'(menu-item "Find tag" ggtags-find-tag-dwim))
(define-key menu [update-tags]
commit f073a6527c7d8f1b27618dad547c4ff9c5595ee2
Author: Leo Liu <address@hidden>
Date: Sat Nov 9 16:05:17 2013 +0800
Fix expansion of GTAGSROOT in ggtags-process-environment
diff --git a/ggtags.el b/ggtags.el
index cd0ecde..613b898 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -239,7 +239,9 @@ properly update `ggtags-mode-map'."
(declare (debug t))
`(let ((process-environment
(append (let ((process-environment process-environment))
- (setenv "GTAGSROOT" (ggtags-current-project-root))
+ (when (ggtags-find-project)
+ (setenv "GTAGSROOT" (directory-file-name
+ (ggtags-current-project-root))))
(mapcar #'substitute-env-vars ggtags-process-environment))
process-environment
(and (ggtags-find-project)
@@ -287,11 +289,11 @@ properly update `ggtags-mode-map'."
(check-type root string)
(let* ((default-directory (file-name-as-directory root))
(rtags-size (nth 7 (file-attributes "GRTAGS")))
- (has-rtags (when rtags-size
- (or (> rtags-size (* 32 1024))
- (with-demoted-errors
- (not (equal "" (ggtags-process-string "global"
- "-crs")))))))
+ (has-rtags
+ (when rtags-size
+ (or (> rtags-size (* 32 1024))
+ (with-demoted-errors
+ (not (equal "" (ggtags-process-string "global" "-crs")))))))
(oversize-p (pcase ggtags-oversize-limit
(`nil nil)
(`t t)
@@ -362,16 +364,17 @@ properly update `ggtags-mode-map'."
(or (ggtags-find-project)
(when (or (yes-or-no-p "File GTAGS not found; run gtags? ")
(user-error "Aborted"))
- (let ((root (read-directory-name "Directory: " nil nil t)))
+ (let ((root (read-directory-name "Directory: " nil nil t))
+ (process-environment process-environment))
(and (zerop (length root)) (user-error "No directory chosen"))
+ (setenv "GTAGSROOT"
+ (directory-file-name (file-name-as-directory root)))
(ggtags-with-process-environment
- (let ((process-environment
- (if (and (not (getenv "GTAGSLABEL"))
- (yes-or-no-p "Use `ctags' backend? "))
- (cons "GTAGSLABEL=ctags" process-environment)
- process-environment))
- (default-directory (file-name-as-directory root)))
- (with-temp-message "`gtags' in progress..."
+ (and (not (getenv "GTAGSLABEL"))
+ (yes-or-no-p "Use `ctags' backend? ")
+ (setenv "GTAGSLABEL" "ctags"))
+ (with-temp-message "`gtags' in progress..."
+ (let ((default-directory (file-name-as-directory root)))
(apply #'ggtags-process-string
"gtags" (and ggtags-use-idutils '("--idutils"))))))
(message "GTAGS generated in `%s'" root)
commit 2f22ea3cf5461a9c101e1b219dfb44c439a70a3f
Author: Leo Liu <address@hidden>
Date: Sat Nov 9 10:05:45 2013 +0800
Don't keep project information in memory forever
Duration can be customised ggtags-project-duration.
diff --git a/ggtags.el b/ggtags.el
index 2a355a0..cd0ecde 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -90,13 +90,21 @@
"The over size limit for the GTAGS file.
For large source trees, running 'global -u' can be expensive.
Thus when GTAGS file is larger than this limit, ggtags
-automatically switches to 'global --single-update'."
+automatically switches to 'global --single-update'.
+
+Change is effective when a project's information is renewed.
+See also `ggtags-project-duration'."
:safe 'numberp
:type '(choice (const :tag "None" nil)
(const :tag "Always" t)
number)
:group 'ggtags)
+(defcustom ggtags-project-duration 3600
+ "Seconds to keep information of a project in memory."
+ :type 'number
+ :group 'ggtags)
+
(defcustom ggtags-process-environment nil
"Similar to `process-environment' with higher precedence.
Elements are run through `substitute-env-vars' before use.
@@ -273,7 +281,7 @@ properly update `ggtags-mode-map'."
(:copier nil)
(:type vector)
:named)
- root dirty-p has-rtags oversize-p)
+ root dirty-p has-rtags oversize-p timestamp)
(defun ggtags-make-project (root)
(check-type root string)
@@ -291,15 +299,24 @@ properly update `ggtags-mode-map'."
ggtags-oversize-limit)))))
(puthash default-directory (ggtags-project--make
:root default-directory :has-rtags has-rtags
- :oversize-p oversize-p)
+ :oversize-p oversize-p :timestamp (float-time))
ggtags-projects)))
(defvar-local ggtags-project 'unset)
+(defun ggtags-project-expired-p (project)
+ (> (- (float-time)
+ (ggtags-project-timestamp project))
+ ggtags-project-duration))
+
;;;###autoload
(defun ggtags-find-project ()
(if (ggtags-project-p ggtags-project)
- ggtags-project
+ (if (not (ggtags-project-expired-p ggtags-project))
+ ggtags-project
+ (remhash (ggtags-project-root ggtags-project) ggtags-projects)
+ (kill-local-variable 'ggtags-project)
+ (ggtags-find-project))
(let ((root (ignore-errors (file-name-as-directory
;; Resolves symbolic links
(ggtags-process-string "global" "-pr")))))
commit 9610485aa3fc283923dd2ba76691aca42102a888
Author: Leo Liu <address@hidden>
Date: Sat Nov 9 09:39:32 2013 +0800
Enhance ggtags-next/prev-mark to handle dead markers
diff --git a/ggtags.el b/ggtags.el
index dfeacde..2a355a0 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -429,9 +429,12 @@ properly update `ggtags-mode-map'."
(defvar ggtags-global-exit-status 0)
(defvar ggtags-global-match-count 0)
+(defvar ggtags-tag-ring-index nil)
+
(defun ggtags-global-save-start-marker ()
(when (markerp ggtags-global-start-marker)
(eval-and-compile (require 'etags))
+ (setq ggtags-tag-ring-index nil)
(ring-insert find-tag-marker-ring ggtags-global-start-marker)
(setq ggtags-global-start-marker t)))
@@ -599,31 +602,32 @@ Global and Emacs."
(message "Browsing %s" url))
(browse-url url)))
-(defvar ggtags-current-mark nil)
-
(defun ggtags-next-mark (&optional arg)
"Move to the next (newer) mark in the tag marker ring."
(interactive)
(and (zerop (ring-length find-tag-marker-ring))
(user-error "No %s mark" (if arg "previous" "next")))
- (let ((mark (or (and ggtags-current-mark
- ;; Note `ring-previous' gets newer item.
- (funcall (if arg #'ring-next #'ring-previous)
- find-tag-marker-ring ggtags-current-mark))
- (prog1
- (ring-ref find-tag-marker-ring (if arg 0 -1))
- (ring-insert find-tag-marker-ring (point-marker))))))
- (setq ggtags-current-mark mark)
- (let ((i (- (ring-length find-tag-marker-ring)
- (ring-member find-tag-marker-ring ggtags-current-mark)))
- (message-log-max nil))
- (message "%d%s marker" i (pcase (mod i 10)
+ (setq ggtags-tag-ring-index
+ ;; Note `ring-minus1' gets newer item.
+ (funcall (if arg #'ring-plus1 #'ring-minus1)
+ (or ggtags-tag-ring-index
+ (progn
+ (ring-insert find-tag-marker-ring (point-marker))
+ 0))
+ (ring-length find-tag-marker-ring)))
+ (let ((m (ring-ref find-tag-marker-ring ggtags-tag-ring-index))
+ (i (- (ring-length find-tag-marker-ring) ggtags-tag-ring-index))
+ (message-log-max nil))
+ (message "%d%s marker%s" i (pcase (mod i 10)
(1 "st")
(2 "nd")
(3 "rd")
- (_ "th"))))
- (switch-to-buffer (marker-buffer mark))
- (goto-char mark)))
+ (_ "th"))
+ (if (marker-buffer m) "" " (dead)"))
+ (if (not (marker-buffer m))
+ (ding)
+ (switch-to-buffer (marker-buffer m))
+ (goto-char m))))
(defun ggtags-prev-mark ()
"Move to the previous (older) mark in the tag marker ring."
@@ -825,7 +829,6 @@ Global and Emacs."
(defun ggtags-navigation-mode-done ()
(interactive)
(ggtags-navigation-mode -1)
- (setq ggtags-current-mark nil)
(setq tags-loop-scan t
tags-loop-operate '(ggtags-find-tag-continue))
(ggtags-navigation-mode-cleanup))
commit 33390d53150a9639967bcaf07bb91b26b42f3948
Author: Leo Liu <address@hidden>
Date: Fri Nov 8 19:40:07 2013 +0800
Avoid using file-truename by using relative file names
Fix ggtags-kill-file-buffers to support symbolic links.
diff --git a/ggtags.el b/ggtags.el
index da49cfb..dfeacde 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -198,6 +198,10 @@ properly update `ggtags-mode-map'."
(defvar ggtags-current-tag-name nil)
+(defvar ggtags-highlight-tag-overlay nil)
+
+(defvar ggtags-highlight-tag-timer nil)
+
;; Used by ggtags-global-mode
(defvar ggtags-global-error "match"
"Stem of message to print when no matches are found.")
@@ -273,7 +277,7 @@ properly update `ggtags-mode-map'."
(defun ggtags-make-project (root)
(check-type root string)
- (let* ((default-directory (file-truename (file-name-as-directory root)))
+ (let* ((default-directory (file-name-as-directory root))
(rtags-size (nth 7 (file-attributes "GRTAGS")))
(has-rtags (when rtags-size
(or (> rtags-size (* 32 1024))
@@ -297,9 +301,10 @@ properly update `ggtags-mode-map'."
(if (ggtags-project-p ggtags-project)
ggtags-project
(let ((root (ignore-errors (file-name-as-directory
+ ;; Resolves symbolic links
(ggtags-process-string "global" "-pr")))))
(setq ggtags-project
- (and root (or (gethash (file-truename root) ggtags-projects)
+ (and root (or (gethash root ggtags-projects)
(ggtags-make-project root)))))))
(defun ggtags-current-project-root ()
@@ -342,19 +347,18 @@ properly update `ggtags-mode-map'."
(user-error "Aborted"))
(let ((root (read-directory-name "Directory: " nil nil t)))
(and (zerop (length root)) (user-error "No directory chosen"))
- (when (ggtags-with-process-environment
- (let ((process-environment
- (if (and (not (getenv "GTAGSLABEL"))
- (yes-or-no-p "Use `ctags' backend? "))
- (cons "GTAGSLABEL=ctags" process-environment)
- process-environment))
- (default-directory (file-name-as-directory root)))
- (with-temp-message "`gtags' in progress..."
- (and (apply #'ggtags-process-string
- "gtags" (and ggtags-use-idutils
'("--idutils")))
- (ggtags-make-project root)
- t))))
- (message "GTAGS generated in `%s'" root))))))
+ (ggtags-with-process-environment
+ (let ((process-environment
+ (if (and (not (getenv "GTAGSLABEL"))
+ (yes-or-no-p "Use `ctags' backend? "))
+ (cons "GTAGSLABEL=ctags" process-environment)
+ process-environment))
+ (default-directory (file-name-as-directory root)))
+ (with-temp-message "`gtags' in progress..."
+ (apply #'ggtags-process-string
+ "gtags" (and ggtags-use-idutils '("--idutils"))))))
+ (message "GTAGS generated in `%s'" root)
+ (ggtags-find-project)))))
(defun ggtags-update-tags (&optional force)
"Update GNU Global tag database."
@@ -468,7 +472,7 @@ With a prefix arg (non-nil DEFINITION) always find
definitions."
(ggtags-find-tag (format "--from-here=%d:%s"
(line-number-at-pos)
(shell-quote-argument
- (file-truename buffer-file-name)))
+ (file-relative-name buffer-file-name)))
name)))
(defun ggtags-find-reference (name)
@@ -567,6 +571,7 @@ Global and Emacs."
(when (yes-or-no-p "Remove GNU Global tag files? ")
(mapc 'delete-file files)
(remhash (ggtags-current-project-root) ggtags-projects)
+ (delete-overlay ggtags-highlight-tag-overlay)
(kill-local-variable 'ggtags-project)))
(when (window-live-p win)
(quit-window t win)))))))
@@ -924,7 +929,10 @@ Global and Emacs."
(not (eq buf (current-buffer)))
(buffer-file-name buf))))
(when (and file (funcall some
- (apply-partially #'file-in-directory-p file)
+ (lambda (dir)
+ ;; Don't use `file-in-directory-p'
+ ;; to allow symbolic links.
+ (string-prefix-p dir file))
directories))
(and (kill-buffer buf) (incf count)))))
(and interactive
@@ -938,7 +946,7 @@ Global and Emacs."
(ggtags-project-oversize-p (ggtags-find-project)))
(ggtags-with-process-environment
(process-file "global" nil 0 nil "--single-update"
- (file-truename buffer-file-name))))))
+ (file-relative-name buffer-file-name))))))
(defvar ggtags-mode-prefix-map
(let ((m (make-sparse-keymap)))
@@ -1016,10 +1024,6 @@ Global and Emacs."
:visible (not (ggtags-find-project))))
map))
-(defvar ggtags-highlight-tag-overlay nil)
-
-(defvar ggtags-highlight-tag-timer nil)
-
;;;###autoload
(define-minor-mode ggtags-mode nil
:lighter (:eval (if ggtags-navigation-mode "" " GG"))
@@ -1095,7 +1099,7 @@ Global and Emacs."
(defun ggtags-build-imenu-index ()
"A function suitable for `imenu-create-index-function'."
(when buffer-file-name
- (let ((file (file-truename buffer-file-name)))
+ (let ((file (file-relative-name buffer-file-name)))
(with-temp-buffer
(when (with-demoted-errors
(zerop (ggtags-with-process-environment
commit b6c4f0005d9a2a7265a04b8c3a3963a18e753c9e
Author: Leo Liu <address@hidden>
Date: Fri Nov 8 17:59:12 2013 +0800
Fix three buglets
diff --git a/ggtags.el b/ggtags.el
index 285a94e..da49cfb 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -444,8 +444,8 @@ properly update `ggtags-mode-map'."
(defun ggtags-find-tag-continue ()
(interactive)
- (ggtags-navigation-mode +1)
(ggtags-ensure-global-buffer
+ (ggtags-navigation-mode +1)
(let ((split-window-preferred-function ggtags-split-window-function))
(ignore-errors (compilation-next-error 1))
(compile-goto-error))))
@@ -612,7 +612,7 @@ Global and Emacs."
(let ((i (- (ring-length find-tag-marker-ring)
(ring-member find-tag-marker-ring ggtags-current-mark)))
(message-log-max nil))
- (message "%d%s marker" i (pcase i
+ (message "%d%s marker" i (pcase (mod i 10)
(1 "st")
(2 "nd")
(3 "rd")
@@ -1070,9 +1070,10 @@ Global and Emacs."
(= (overlay-end o) (cdr bounds)))
;; Tag is already highlighted so do nothing.
nil)
- ((and bounds (test-completion
- (buffer-substring (car bounds) (cdr bounds))
- ggtags-completion-table))
+ ((and bounds (let ((completion-ignore-case nil))
+ (test-completion
+ (buffer-substring (car bounds) (cdr bounds))
+ ggtags-completion-table)))
(move-overlay o (car bounds) (cdr bounds) (current-buffer))
(overlay-put o 'category 'ggtags-active-tag))
(t (move-overlay o
commit 652be6eb536624a1c99f73a455efa970cd216270
Author: Leo Liu <address@hidden>
Date: Fri Nov 8 11:38:53 2013 +0800
Fix bug in ggtags-browse-file-as-hypertext
diff --git a/ggtags.el b/ggtags.el
index 01f2caf..285a94e 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -571,11 +571,13 @@ Global and Emacs."
(when (window-live-p win)
(quit-window t win)))))))
-(defun ggtags-browse-file-as-hypertext (file)
+(defun ggtags-browse-file-as-hypertext (file line)
"Browse FILE in hypertext (HTML) form."
- (interactive (list (if (or current-prefix-arg (not buffer-file-name))
- (read-file-name "Browse file: " nil nil t)
- buffer-file-name)))
+ (interactive (if (or current-prefix-arg (not buffer-file-name))
+ (list (read-file-name "Browse file: " nil nil t)
+ (read-number "Line: " 1))
+ (list buffer-file-name (line-number-at-pos))))
+ (check-type line integer)
(or (and file (file-exists-p file)) (error "File `%s' doesn't exist" file))
(ggtags-check-project)
(or (file-exists-p (expand-file-name "HTML" (ggtags-current-project-root)))
@@ -584,7 +586,7 @@ Global and Emacs."
(ggtags-with-process-environment (ggtags-process-string "htags")))
(user-error "Aborted")))
(let ((url (ggtags-process-string
- "gozilla" "-p" (format "+%d" (line-number-at-pos)) file)))
+ "gozilla" "-p" (format "+%d" line) file)))
(or (equal (file-name-extension
(url-filename (url-generic-parse-url url))) "html")
(user-error "No hypertext form for `%s'" file))
commit dfe70c9ace883b911d04673f0658a29263d498ca
Author: Leo Liu <address@hidden>
Date: Fri Nov 8 10:58:14 2013 +0800
Simplify detecting reference tags in ggtags-make-project
Show progress message in ggtags-ensure-project because gtags could
take a while in large projects.
diff --git a/ggtags.el b/ggtags.el
index 755af45..01f2caf 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -278,11 +278,8 @@ properly update `ggtags-mode-map'."
(has-rtags (when rtags-size
(or (> rtags-size (* 32 1024))
(with-demoted-errors
- (> (length
- (split-string
- (ggtags-process-string "gtags" "-d" "GRTAGS")
- "\n" t))
- 4)))))
+ (not (equal "" (ggtags-process-string "global"
+ "-crs")))))))
(oversize-p (pcase ggtags-oversize-limit
(`nil nil)
(`t t)
@@ -352,10 +349,11 @@ properly update `ggtags-mode-map'."
(cons "GTAGSLABEL=ctags" process-environment)
process-environment))
(default-directory (file-name-as-directory root)))
- (and (apply #'ggtags-process-string
- "gtags" (and ggtags-use-idutils '("--idutils")))
- (ggtags-make-project root)
- t)))
+ (with-temp-message "`gtags' in progress..."
+ (and (apply #'ggtags-process-string
+ "gtags" (and ggtags-use-idutils
'("--idutils")))
+ (ggtags-make-project root)
+ t))))
(message "GTAGS generated in `%s'" root))))))
(defun ggtags-update-tags (&optional force)
@@ -945,7 +943,7 @@ Global and Emacs."
(define-key m (kbd "M-DEL") 'ggtags-delete-tag-files)
(define-key m "\M-p" 'ggtags-prev-mark)
(define-key m "\M-n" 'ggtags-next-mark)
- (define-key m "\M-s" 'ggtags-find-other-symbol)
+ (define-key m "\M-o" 'ggtags-find-other-symbol)
(define-key m "\M-g" 'ggtags-grep)
(define-key m "\M-i" 'ggtags-idutils-query)
(define-key m "\M-b" 'ggtags-browse-file-as-hypertext)
commit d574dde72e705ba0c53b9bde49c4f05e060c3a41
Author: Leo Liu <address@hidden>
Date: Fri Nov 8 09:06:05 2013 +0800
Treat GTAGSROOT specially in ggtags-process-environment
to provide a way to refer to project root directory without hard
coding the absolute path.
diff --git a/ggtags.el b/ggtags.el
index f189165..755af45 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -100,8 +100,9 @@ automatically switches to 'global --single-update'."
(defcustom ggtags-process-environment nil
"Similar to `process-environment' with higher precedence.
Elements are run through `substitute-env-vars' before use.
-This is intended for project-wise ggtags-specific process
-environment settings."
+GTAGSROOT will always be expanded to current project root
+directory. This is intended for project-wise ggtags-specific
+process environment settings."
:safe 'ggtags-list-of-string-p
:type '(repeat string)
:group 'ggtags)
@@ -225,7 +226,9 @@ properly update `ggtags-mode-map'."
(defmacro ggtags-with-process-environment (&rest body)
(declare (debug t))
`(let ((process-environment
- (append (mapcar #'substitute-env-vars ggtags-process-environment)
+ (append (let ((process-environment process-environment))
+ (setenv "GTAGSROOT" (ggtags-current-project-root))
+ (mapcar #'substitute-env-vars ggtags-process-environment))
process-environment
(and (ggtags-find-project)
(not (ggtags-project-has-rtags (ggtags-find-project)))
@@ -457,7 +460,7 @@ properly update `ggtags-mode-map'."
(defun ggtags-find-tag-dwim (name &optional definition)
"Find definitions or references of tag NAME by context.
If point is at a definition tag, find references, and vice versa.
-With a prefix arg (non-nil DEFINITION) always find defintions."
+With a prefix arg (non-nil DEFINITION) always find definitions."
(interactive (list (ggtags-read-tag) current-prefix-arg))
(if (or definition
(not buffer-file-name)
@@ -475,7 +478,7 @@ With a prefix arg (non-nil DEFINITION) always find
defintions."
(ggtags-find-tag 'reference name))
(defun ggtags-find-other-symbol (name)
- "Find tag NAME wchi is a reference without a definition."
+ "Find tag NAME that is a reference without a definition."
(interactive (list (ggtags-read-tag)))
(ggtags-find-tag 'symbol name))
@@ -1048,7 +1051,7 @@ Global and Emacs."
(list (lambda (o after &rest _args)
(and (not after) (delete-overlay o)))))
(put 'ggtags-active-tag 'help-echo
- "S-down-mouse-1 for defintions\nS-down-mouse-3 for references")
+ "S-down-mouse-1 for definitions\nS-down-mouse-3 for references")
(defun ggtags-highlight-tag-at-point ()
(when (and ggtags-mode (eq ggtags-project 'unset))
-----------------------------------------------------------------------
Summary of changes:
packages/ggtags/ggtags.el | 197 ++++++++++++++++++++++++++++-----------------
1 files changed, 123 insertions(+), 74 deletions(-)
hooks/post-receive
--
ELPA
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [ELPA-diffs] ELPA branch, master, updated. 34e3d94eb31cd286c429f12c2a318f7a79dcec4b,
Leo Liu <=