[elpa] 09/14: Fix #60: Declutter command and highlight tag in search history

2014-06-22 Thread Leo Liu
leoliu pushed a commit to branch master
in repository elpa.

commit 63e557a6b0a0fd5da19ba3862e7d109fc78cc568
Author: Leo Liu 
Date:   Sun Jun 15 10:16:03 2014 +0800

Fix #60: Declutter command and highlight tag in search history
---
 README.rst |4 
 ggtags.el  |   32 +---
 2 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/README.rst b/README.rst
index 1c316ee..03b0da9 100644
--- a/README.rst
+++ b/README.rst
@@ -300,6 +300,10 @@ NEWS
 #. New command ``ggtags-find-tag-mouse`` for mouse support.
 #. New command ``ggtags-find-definition``.
 #. Variable ``ggtags-completing-read-function`` restored.
+#. ``ggtags-navigation-isearch-forward`` can also be invoked using
+   ``M-s s``.
+#. The output buffer from ``ggtags-global-rerun-search`` looks
+   cleaner.
 
 [2014-05-06 Tue] 0.8.4
 ++
diff --git a/ggtags.el b/ggtags.el
index 3a0a0b6..444d613 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -810,9 +810,9 @@ Do nothing if GTAGS exceeds the oversize limit unless 
FORCE."
   (and ggtags-global-treat-text "--other")
   (pcase cmd
 ((pred stringp) cmd)
-(`definition "") ;-d not supported by Global 5.7.1
-(`reference "-r")
-(`symbol "-s")
+(`definition nil) ;-d not supported by Global 5.7.1
+(`reference "--reference")
+(`symbol "--symbol")
 (`path "--path")
 (`grep "--grep")
 (`idutils "--idutils")))
@@ -1026,13 +1026,21 @@ Global and Emacs."
 (nreverse files
 (tags-query-replace from to delimited file-form)))
 
+(defun ggtags-global-normalise-command (cmd)
+  (if (string-match
+   (concat (regexp-quote (ggtags-global-build-command nil)) "\\s-*")
+   cmd)
+  (substring-no-properties cmd (match-end 0))
+cmd))
+
 (defun ggtags-global-search-id (cmd directory)
-  (sha1 (concat directory (make-string 1 0) cmd)))
+  (sha1 (concat directory (make-string 1 0)
+(ggtags-global-normalise-command cmd
 
 (defun ggtags-global-current-search ()
   ;; CMD DIR ENV LINE TEXT
   (ggtags-ensure-global-buffer
-(list (car compilation-arguments)
+(list (ggtags-global-normalise-command (car compilation-arguments))
   default-directory
   ggtags-process-environment
   (line-number-at-pos)
@@ -1047,7 +1055,8 @@ Global and Emacs."
 (default-directory dir)
 (ggtags-project-root dir)
 (ggtags-process-environment env))
-(ggtags-global-start cmd dir))
+(ggtags-global-start
+ (ggtags-global-build-command cmd) dir))
(add-hook 'compilation-finish-functions
  (lambda (buf _msg)
(with-current-buffer buf
@@ -,10 +1120,19 @@ Global and Emacs."
 (setq truncate-lines t)
 (cl-labels ((prop (s)
   (propertize s 'face 'minibuffer-prompt))
+(prop-tag (cmd)
+  (with-temp-buffer
+(insert cmd)
+(forward-sexp -1)
+(if (eobp)
+cmd
+  (put-text-property (point) (point-max)
+ 'face font-lock-constant-face)
+  (buffer-string
 (pp (data)
   (pcase data
 (`(,_id ,cmd ,dir ,_env ,line ,text)
- (insert (prop " cmd: ") cmd "\n"
+ (insert (prop " cmd: ") (prop-tag cmd) "\n"
  (prop " dir: ") dir "\n"
  (prop "line: ") (number-to-string line) "\n"
  (prop "text: ") text "\n"



[elpa] 01/14: Fix #54: New command ggtags-find-tag-mouse

2014-06-22 Thread Leo Liu
leoliu pushed a commit to branch master
in repository elpa.

commit a7a3c8102010ca9e945d2df5f29b4c88e6ce722f
Author: Leo Liu 
Date:   Wed May 7 10:35:58 2014 +0800

Fix #54: New command ggtags-find-tag-mouse
---
 README.rst |5 +
 ggtags.el  |   12 +---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/README.rst b/README.rst
index ceaf69d..60af593 100644
--- a/README.rst
+++ b/README.rst
@@ -283,6 +283,11 @@ Integration with other packages
 NEWS
 
 
+[devel] 0.8.5
++
+
+#. New command ``ggtags-find-tag-mouse`` for mouse support.
+
 [2014-05-06 Tue] 0.8.4
 ++
 
diff --git a/ggtags.el b/ggtags.el
index 52ec670..a450461 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2013-2014  Free Software Foundation, Inc.
 
 ;; Author: Leo Liu 
-;; Version: 0.8.4
+;; Version: 0.8.5
 ;; Keywords: tools, convenience
 ;; Created: 2013-01-29
 ;; URL: https://github.com/leoliu/ggtags
@@ -875,8 +875,7 @@ definition tags."
 (ggtags-find-file name))
((or (eq what 'definition)
 (not buffer-file-name)
-(and (ggtags-find-project)
- (not (ggtags-project-has-refs (ggtags-find-project
+(not (ggtags-project-has-refs (ggtags-find-project)))
 (not (ggtags-project-file-p buffer-file-name)))
 (ggtags-find-tag 'definition (shell-quote-argument name)))
(t (ggtags-find-tag (format "--from-here=%d:%s"
@@ -887,6 +886,13 @@ definition tags."
 (ggtags-project-relative-file 
buffer-file-name)))
(shell-quote-argument name)
 
+(defun ggtags-find-tag-mouse (event)
+  (interactive "e")
+  (with-selected-window (posn-window (event-start event))
+(save-excursion
+  (goto-char (posn-point (event-start event)))
+  (call-interactively #'ggtags-find-tag-dwim
+
 (defun ggtags-setup-libpath-search (type name)
   (pcase (and ggtags-global-search-libpath-for-reference
   (ggtags-get-libpath))



[elpa] 13/14: Fix ggtags-global-handle-exit to conditionally pop up window

2014-06-22 Thread Leo Liu
leoliu pushed a commit to branch master
in repository elpa.

commit 823a5dc43ad31b463b314cff1afb284d581661e2
Author: Leo Liu 
Date:   Sun Jun 22 17:34:59 2014 +0800

Fix ggtags-global-handle-exit to conditionally pop up window

A regression introduced in commit
65aba1399e51e69185b1a8bbf75821a5a7764655

"For #45: Fix popping up/down window for search with single match"
---
 README.rst |4 ++--
 ggtags.el  |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.rst b/README.rst
index c1ce7eb..f00d69b 100644
--- a/README.rst
+++ b/README.rst
@@ -294,8 +294,8 @@ Integration with other packages
 NEWS
 
 
-[devel] 0.8.5
-+
+[2014-06-22 Sun] 0.8.5
+++
 
 #. New command ``ggtags-find-tag-mouse`` for mouse support.
 #. New command ``ggtags-find-definition``.
diff --git a/ggtags.el b/ggtags.el
index 3c485f9..09e3af7 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -1569,7 +1569,7 @@ commands `next-error' and `previous-error'.
 (save-excursion (goto-char pt) (end-of-line) (point))
 'compilation-message)))
 ;; There are multiple matches so pop up the buffer.
-(ggtags-global--display-buffer)
+(and ggtags-navigation-mode (ggtags-global--display-buffer))
   ;; For the `compilation-auto-jump' in idle timer to run.
   ;; See also: http://debbugs.gnu.org/13829
   (sit-for 0)



[elpa] 05/14: Fix #59: detect missing tag files and remove project cache

2014-06-22 Thread Leo Liu
leoliu pushed a commit to branch master
in repository elpa.

commit 313a4c36932300518a4446cc68898cfbc7b49d50
Author: Leo Liu 
Date:   Wed May 21 18:37:13 2014 +0800

Fix #59: detect missing tag files and remove project cache
---
 ggtags.el |   16 +++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/ggtags.el b/ggtags.el
index b78384f..15b0b0e 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -1468,7 +1468,17 @@ commands `next-error' and `previous-error'.
   (funcall cont buf how)))
((string-prefix-p "exited abnormally" how)
 ;; If exit abnormally display the buffer for inspection.
-(ggtags-global--display-buffer))
+(ggtags-global--display-buffer)
+(when (save-excursion
+(goto-char (point-max))
+(re-search-backward
+ (eval-when-compile
+   (format "^global: %s not found.$"
+   (regexp-opt '("GTAGS" "GRTAGS" "GSYMS" "GPATH"
+ nil t))
+  (ggtags-echo "WARNING: Global tag files missing in `%s'"
+   ggtags-project-root)
+  (remhash ggtags-project-root ggtags-projects)))
(ggtags-auto-jump-to-match
 (if (pcase (compilation-next-single-property-change
 (point-min) 'compilation-message)
@@ -1497,6 +1507,10 @@ commands `next-error' and `previous-error'.
   ;; Note: Place `ggtags-global-output-format' as first element for
   ;; `ggtags-abbreviate-files'.
   (setq-local compilation-error-regexp-alist (list 
ggtags-global-output-format))
+  (when (markerp ggtags-global-start-marker)
+(setq ggtags-project-root
+  (buffer-local-value 'ggtags-project-root
+  (marker-buffer ggtags-global-start-marker
   (pcase ggtags-auto-jump-to-match
 (`history (make-local-variable 'ggtags-auto-jump-to-match-target)
   (setq-local compilation-auto-jump-to-first-error



[elpa] 08/14: Fix #64: Bind M-s s to ggtags-navigation-isearch-forward

2014-06-22 Thread Leo Liu
leoliu pushed a commit to branch master
in repository elpa.

commit b001d701c02e0502f06524056db7661f4e643e32
Author: Leo Liu 
Date:   Sat Jun 14 15:36:42 2014 +0800

Fix #64: Bind M-s s to ggtags-navigation-isearch-forward

Thanks to tuhdo for suggesting.
---
 ggtags.el |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ggtags.el b/ggtags.el
index 18f47e3..3a0a0b6 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -1554,9 +1554,12 @@ commands `next-error' and `previous-error'.
 (define-key map "\M-{" 'ggtags-navigation-previous-file)
 (define-key map "\M->" 'ggtags-navigation-last-error)
 (define-key map "\M-<" 'first-error)
-;; Note: shadows `isearch-forward-regexp' but it can be invoked
-;; with C-u C-s instead.
+;; Note: shadows `isearch-forward-regexp' but it can still be
+;; invoked with `C-u C-s'.
 (define-key map "\C-\M-s" 'ggtags-navigation-isearch-forward)
+;; Add an alternative binding because C-M-s is reported not
+;; working on some systems.
+(define-key map "\M-ss" 'ggtags-navigation-isearch-forward)
 (define-key map "\C-c\C-k"
   (lambda () (interactive)
 (ggtags-ensure-global-buffer (kill-compilation



[elpa] 04/14: New command ggtags-find-definition for #57

2014-06-22 Thread Leo Liu
leoliu pushed a commit to branch master
in repository elpa.

commit 7b196dd8982326438def26a2886cb3822c37d969
Author: Leo Liu 
Date:   Fri May 16 12:03:45 2014 +0800

New command ggtags-find-definition for #57
---
 README.rst |   16 +---
 ggtags.el  |7 ++-
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/README.rst b/README.rst
index 794e1cc..1c316ee 100644
--- a/README.rst
+++ b/README.rst
@@ -118,14 +118,23 @@ ggtags-find-tag-dwim
 
To force finding a definition tag, call it with a prefix (``C-u``).
 
-ggtags-find-reference
+ggtags-find-tag-mouse
+
+   Like ``ggtags-find-tag-dwim`` but suitable for binding to mouse
+   events.
+
+ggtags-find-definition
 
-   Find references to a tag. With ``C-u`` ask for the tag name with
+   Find definition tags. With ``C-u`` ask for the tag name with
completion.
 
+ggtags-find-reference
+
+   Find reference tags. With ``C-u`` ask for the tag name with completion.
+
 ggtags-find-other-symbol
 
-   Find a tag that has no definition. With ``C-u`` ask for the tag
+   Find tags that have no definitions. With ``C-u`` ask for the tag
name with completion.
 
 ggtags-find-tag-regexp
@@ -289,6 +298,7 @@ NEWS
 +
 
 #. New command ``ggtags-find-tag-mouse`` for mouse support.
+#. New command ``ggtags-find-definition``.
 #. Variable ``ggtags-completing-read-function`` restored.
 
 [2014-05-06 Tue] 0.8.4
diff --git a/ggtags.el b/ggtags.el
index 97ba132..b78384f 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -894,7 +894,7 @@ definition tags."
 (not buffer-file-name)
 (not (ggtags-project-has-refs (ggtags-find-project)))
 (not (ggtags-project-file-p buffer-file-name)))
-(ggtags-find-tag 'definition (shell-quote-argument name)))
+(ggtags-find-definition name))
(t (ggtags-find-tag (format "--from-here=%d:%s"
(line-number-at-pos)
(shell-quote-argument
@@ -910,6 +910,11 @@ definition tags."
   (goto-char (posn-point (event-start event)))
   (call-interactively #'ggtags-find-tag-dwim
 
+;; Another option for `M-.'.
+(defun ggtags-find-definition (name)
+  (interactive (list (ggtags-read-tag 'definition current-prefix-arg)))
+  (ggtags-find-tag 'definition (shell-quote-argument name)))
+
 (defun ggtags-setup-libpath-search (type name)
   (pcase (and ggtags-global-search-libpath-for-reference
   (ggtags-get-libpath))



[elpa] 14/14: Merge branch 'master' of github.com:leoliu/ggtags

2014-06-22 Thread Leo Liu
leoliu pushed a commit to branch master
in repository elpa.

commit 4e171a5b7e29031a2d40db14f05e7a945d8b08a5
Merge: 76cd6eb 823a5dc
Author: Leo Liu 
Date:   Sun Jun 22 17:39:19 2014 +0800

Merge branch 'master' of github.com:leoliu/ggtags

 packages/ggtags/README.rst |   43 +--
 packages/ggtags/ggtags.el  |  296 +++-
 2 files changed, 246 insertions(+), 93 deletions(-)




[elpa] 11/14: Fix #58: Search history can be manipulated with C-k and C-y

2014-06-22 Thread Leo Liu
leoliu pushed a commit to branch master
in repository elpa.

commit b42bf956931c1625b9acd54050549877409484aa
Author: Leo Liu 
Date:   Sun Jun 15 12:17:04 2014 +0800

Fix #58: Search history can be manipulated with C-k and C-y
---
 README.rst |1 +
 ggtags.el  |   38 ++
 2 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/README.rst b/README.rst
index 8e1d352..671b27e 100644
--- a/README.rst
+++ b/README.rst
@@ -306,6 +306,7 @@ NEWS
``ggtags-view-search-history``.
 #. The output buffer from ``ggtags-view-search-history`` looks
cleaner.
+#. Search history items can be re-arranged with ``C-k`` and ``C-y``.
 
 [2014-05-06 Tue] 0.8.4
 ++
diff --git a/ggtags.el b/ggtags.el
index c3c80a5..dbc9a81 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -1073,6 +1073,9 @@ Global and Emacs."
 (define-key m "\M-p" 'ggtags-view-search-history-prev)
 (define-key m "n" 'ggtags-view-search-history-next)
 (define-key m "\M-n" 'ggtags-view-search-history-next)
+(define-key m "\C-k" 'ggtags-view-search-history-kill)
+(define-key m [remap yank] (lambda (&optional arg) (interactive "P") (yank 
arg)))
+(define-key m "\C-c\C-c" 'ggtags-view-search-history-update)
 (define-key m "r" 'ggtags-save-to-register)
 (define-key m "\r" 'ggtags-view-search-history-action)
 (define-key m "q" 'kill-buffer-and-window)
@@ -1093,6 +1096,41 @@ Global and Emacs."
   (interactive "p")
   (ggtags-view-search-history-next (- (or arg 1
 
+(defun ggtags-view-search-history-kill (&optional append)
+  (interactive "P")
+  (let* ((node (or (ewoc-locate ggtags-global-search-ewoc)
+   (user-error "No node at point")))
+ (next (ewoc-next ggtags-global-search-ewoc node))
+ (text (filter-buffer-substring (ewoc-location node)
+(if next (ewoc-location next)
+  (point-max)
+(put-text-property
+ 0 (length text) 'yank-handler
+ (list (lambda (arg)
+ (if (not ggtags-global-search-ewoc)
+ (insert (car arg))
+   (let* ((inhibit-read-only t)
+  (node (unless (looking-at-p "[ \t\n]*\\'")
+  (ewoc-locate ggtags-global-search-ewoc
+ (if node
+ (ewoc-enter-before ggtags-global-search-ewoc
+node (cadr arg))
+   (ewoc-enter-last ggtags-global-search-ewoc (cadr arg))
+   (list text (ewoc-data node)))
+ text)
+(if append (kill-append text nil)
+  (kill-new text))
+(let ((inhibit-read-only t))
+  (ewoc-delete ggtags-global-search-ewoc node
+
+(defun ggtags-view-search-history-update (&optional noconfirm)
+  "Update `ggtags-global-search-history' to current buffer."
+  (interactive "P")
+  (when (or noconfirm
+(yes-or-no-p "Modify `ggtags-global-search-history'?"))
+(setq ggtags-global-search-history
+  (ewoc-collect ggtags-global-search-ewoc #'identity
+
 (defun ggtags-view-search-history-action ()
   (interactive)
   (let ((data (ewoc-data (or (ewoc-locate ggtags-global-search-ewoc)



[elpa] 07/14: Fix #65: Clear ggtags-project-root based on default-directory

2014-06-22 Thread Leo Liu
leoliu pushed a commit to branch master
in repository elpa.

commit e16006067babac5d88b778f5da4399dc60710abd
Author: Leo Liu 
Date:   Sat Jun 14 15:08:18 2014 +0800

Fix #65: Clear ggtags-project-root based on default-directory
---
 ggtags.el |   14 ++
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/ggtags.el b/ggtags.el
index a17c5b3..18f47e3 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -474,21 +474,18 @@ Value is new modtime if updated."
 (size (let ((project (or project (ggtags-find-project
 (and project (> (ggtags-project-tag-size project) size))
 
+(defvar-local ggtags-last-default-directory nil)
 (defvar-local ggtags-project-root 'unset
   "Internal variable for project root directory.")
 
-(defun ggtags-clear-project-root ()
-  (kill-local-variable 'ggtags-project-root))
-
 ;;;###autoload
 (defun ggtags-find-project ()
   ;; See https://github.com/leoliu/ggtags/issues/42
   ;;
-  ;; It is unsafe to cache `ggtags-project-root' in non-file buffers.
-  ;; But we keep the cache for a command's duration so that multiple
-  ;; calls of `ggtags-find-project' has no performance impact.
-  (unless buffer-file-name
-(add-hook 'pre-command-hook #'ggtags-clear-project-root nil t))
+  ;; It is unsafe to cache `ggtags-project-root' in non-file buffers
+  ;; whose `default-directory' can often change.
+  (unless (equal ggtags-last-default-directory default-directory)
+(kill-local-variable 'ggtags-project-root))
   (let ((project (gethash ggtags-project-root ggtags-projects)))
 (if (ggtags-project-p project)
 (if (ggtags-project-expired-p project)
@@ -496,6 +493,7 @@ Value is new modtime if updated."
   (remhash ggtags-project-root ggtags-projects)
   (ggtags-find-project))
   project)
+  (setq ggtags-last-default-directory default-directory)
   (setq ggtags-project-root
 (or (ignore-errors-unless-debug
   (file-name-as-directory



[elpa] 02/14: Update doc strings and comments

2014-06-22 Thread Leo Liu
leoliu pushed a commit to branch master
in repository elpa.

commit c1840d4c197c491b1863c706436459467340e63f
Author: Leo Liu 
Date:   Fri May 9 16:02:17 2014 +0800

Update doc strings and comments
---
 README.rst |5 +++--
 ggtags.el  |   10 --
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/README.rst b/README.rst
index 60af593..864f66e 100644
--- a/README.rst
+++ b/README.rst
@@ -32,8 +32,9 @@ Features
 #. Support `exuberant ctags `_ backend.
 #. Support all Global's output formats: ``grep``, ``ctags-x``,
``cscope`` etc.
-#. Support projects on remote hosts (e.g. via ``tramp``)
-#. Support eldoc
+#. Support projects on remote hosts (e.g. via ``tramp``).
+#. Support eldoc.
+#. Search ``GTAGSLIBPATH`` for references and symbols.
 
 Screenshot
 ~~
diff --git a/ggtags.el b/ggtags.el
index a450461..fa53843 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -122,9 +122,14 @@ REGEXP should match from the beginning of line."
   :safe 'stringp
   :group 'ggtags)
 
+;; See also: http://article.gmane.org/gmane.comp.gnu.global.bugs/1751
 (defcustom ggtags-use-project-gtagsconf t
   "Non-nil to use GTAGSCONF file found at project root.
-File .globalrc and gtags.conf are checked in order."
+File .globalrc and gtags.conf are checked in order.
+
+Note: GNU Global v6.2.13 has the feature of using gtags.conf at
+project root. Setting this variable to nil doesn't disable this
+feature."
   :safe 'booleanp
   :type 'boolean
   :group 'ggtags)
@@ -948,7 +953,8 @@ Invert the match when called with a prefix arg 
\\[universal-argument]."
 (ggtags-find-tag 'path (and invert-match "--invert-match")
  "--" (ggtags-quote-pattern pattern
 
-;; NOTE: Coloured output in grep requested: http://goo.gl/Y9IcX
+;; Note: Coloured output requested in http://goo.gl/Y9IcX and appeared
+;; in global v6.2.12.
 (defun ggtags-find-tag-regexp (regexp directory)
   "List tags matching REGEXP in DIRECTORY (default to project root).
 When called interactively with a prefix, ask for the directory."



[elpa] 10/14: Refactoring: Use a major mode for viewing search history

2014-06-22 Thread Leo Liu
leoliu pushed a commit to branch master
in repository elpa.

commit 136ac628b6a85ee9582fb6a371e221cc6de418f2
Author: Leo Liu 
Date:   Sun Jun 15 11:34:43 2014 +0800

Refactoring: Use a major mode for viewing search history

Rename command ggtags-global-rerun-search to
ggtags-view-search-history.
---
 README.rst |4 ++-
 ggtags.el  |  105 +++-
 2 files changed, 57 insertions(+), 52 deletions(-)

diff --git a/README.rst b/README.rst
index 03b0da9..8e1d352 100644
--- a/README.rst
+++ b/README.rst
@@ -302,7 +302,9 @@ NEWS
 #. Variable ``ggtags-completing-read-function`` restored.
 #. ``ggtags-navigation-isearch-forward`` can also be invoked using
``M-s s``.
-#. The output buffer from ``ggtags-global-rerun-search`` looks
+#. Command ``ggtags-global-rerun-search`` renamed to
+   ``ggtags-view-search-history``.
+#. The output buffer from ``ggtags-view-search-history`` looks
cleaner.
 
 [2014-05-06 Tue] 0.8.4
diff --git a/ggtags.el b/ggtags.el
index 444d613..c3c80a5 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -1047,7 +1047,7 @@ Global and Emacs."
   (buffer-substring-no-properties
(line-beginning-position) (line-end-position)
 
-(defun ggtags-global-rerun-search-1 (data)
+(defun ggtags-global-rerun-search (data)
   (pcase data
 (`(,cmd ,dir ,env ,line ,_text)
  (with-current-buffer (let ((ggtags-auto-jump-to-match nil)
@@ -1065,59 +1065,62 @@ Global and Emacs."
  nil t)
 
 (defvar-local ggtags-global-search-ewoc nil)
-(defvar ggtags-global-rerun-search-last nil)
-
-(defvar ggtags-global-rerun-search-map
-  (cl-labels
-  ((save ()
- (setq ggtags-global-rerun-search-last
-   (ewoc-data (ewoc-locate ggtags-global-search-ewoc
-   (next (arg)
- (interactive "p")
- (ewoc-goto-next ggtags-global-search-ewoc arg)
- (save))
-   (prev (arg)
- (interactive "p")
- (ewoc-goto-prev ggtags-global-search-ewoc arg)
- (save))
-   (quit ()
- (interactive)
- (quit-windows-on (ewoc-buffer ggtags-global-search-ewoc) t))
-   (done ()
- (interactive)
- (let ((node (ewoc-locate ggtags-global-search-ewoc)))
-   (when node
- (save)
- (quit)
- (ggtags-global-rerun-search-1 (cdr (ewoc-data node)))
-(let ((m (make-sparse-keymap)))
-  (set-keymap-parent m special-mode-map)
-  (define-key m "p"#'prev)
-  (define-key m "\M-p" #'prev)
-  (define-key m "n"#'next)
-  (define-key m "\M-n" #'next)
-  (define-key m "r"#'ggtags-save-to-register)
-  (define-key m "q"#'quit)
-  (define-key m "\r"   #'done)
-  m)))
+(defvar ggtags-view-search-history-last nil)
+
+(defvar ggtags-view-search-history-mode-map
+  (let ((m (make-sparse-keymap)))
+(define-key m "p" 'ggtags-view-search-history-prev)
+(define-key m "\M-p" 'ggtags-view-search-history-prev)
+(define-key m "n" 'ggtags-view-search-history-next)
+(define-key m "\M-n" 'ggtags-view-search-history-next)
+(define-key m "r" 'ggtags-save-to-register)
+(define-key m "\r" 'ggtags-view-search-history-action)
+(define-key m "q" 'kill-buffer-and-window)
+m))
+
+(defun ggtags-view-search-history-remember ()
+  (setq ggtags-view-search-history-last
+(ewoc-data (ewoc-locate ggtags-global-search-ewoc
+
+(defun ggtags-view-search-history-next (&optional arg)
+  (interactive "p")
+  (let ((arg (or arg 1)))
+(prog1 (funcall (if (cl-minusp arg) #'ewoc-goto-prev #'ewoc-goto-next)
+ggtags-global-search-ewoc (abs arg))
+  (ggtags-view-search-history-remember
+
+(defun ggtags-view-search-history-prev (&optional arg)
+  (interactive "p")
+  (ggtags-view-search-history-next (- (or arg 1
+
+(defun ggtags-view-search-history-action ()
+  (interactive)
+  (let ((data (ewoc-data (or (ewoc-locate ggtags-global-search-ewoc)
+ (user-error "No search at point")
+(ggtags-view-search-history-remember)
+(quit-window t)
+(ggtags-global-rerun-search (cdr data
 
 (defvar bookmark-make-record-function)
 
-(defun ggtags-global-rerun-search ()
-  "Pop up a buffer to choose a past search to re-run.
+(define-derived-mode ggtags-view-search-history-mode special-mode "SearchHist"
+  "Major mode for viewing search history."
+  :group 'ggtags
+  (setq-local ggtags-enable-navigation-keys nil)
+  (setq-local bookmark-make-record-function #'ggtags-make-bookmark-record)
+  (setq truncate-lines t))
+
+(defun ggtags-view-search-history ()
+  "Pop to a buffer to view or re-run past searches.
 
-\\{ggtags-global-rerun-search-map}"
+\\{ggtags-view-search-history-mode-map}"
   (interactive)
   (or ggtags-global-search-history (user-error "No search history"))
   (let ((split-window-preferred-function ggtags-split-window-function)
 (inhibit-read-only t))
 (pop-to-buffe

[elpa] 12/14: Replace kill-buffer-and-window with ggtags-kill-window

2014-06-22 Thread Leo Liu
leoliu pushed a commit to branch master
in repository elpa.

commit bea9f0231829438c3b68df47311adb53f62bdabc
Author: Leo Liu 
Date:   Sun Jun 15 20:52:39 2014 +0800

Replace kill-buffer-and-window with ggtags-kill-window

because the former throws an error when the window is the only one in
a frame.

Some polish to last change.
---
 README.rst |6 +++---
 ggtags.el  |   40 
 2 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/README.rst b/README.rst
index 671b27e..c1ce7eb 100644
--- a/README.rst
+++ b/README.rst
@@ -192,7 +192,7 @@ turned on to facilitate locating the right match.
 
Move to the last match.
 
-``C-M-s``
+``C-M-s`` or ``M-s s``
 
Use ``isearch`` to find the match.
 
@@ -228,9 +228,9 @@ ggtags-view-tag-history
location. ``M-n`` and ``M-p`` move to and display the next/previous
entry.
 
-ggtags-global-rerun-search
+ggtags-view-search-history
 
-   Re-run a search from search history as kept in
+   View or re-run past searches as kept in
``ggtags-global-search-history``.
 
 ggtags-kill-file-buffers
diff --git a/ggtags.el b/ggtags.el
index dbc9a81..3c485f9 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -381,6 +381,11 @@ Nil means using the value of `completing-read-function'."
 (goto-char (point-min))
 (forward-line (1- line
 
+(defun ggtags-kill-window ()
+  "Quit selected window and kill its buffer."
+  (interactive)
+  (quit-window t))
+
 (defun ggtags-program-path (name)
   (if ggtags-executable-directory
   (expand-file-name name ggtags-executable-directory)
@@ -1078,12 +1083,14 @@ Global and Emacs."
 (define-key m "\C-c\C-c" 'ggtags-view-search-history-update)
 (define-key m "r" 'ggtags-save-to-register)
 (define-key m "\r" 'ggtags-view-search-history-action)
-(define-key m "q" 'kill-buffer-and-window)
+(define-key m "q" 'ggtags-kill-window)
 m))
 
 (defun ggtags-view-search-history-remember ()
   (setq ggtags-view-search-history-last
-(ewoc-data (ewoc-locate ggtags-global-search-ewoc
+(pcase (ewoc-locate ggtags-global-search-ewoc)
+  (`nil nil)
+  (node (ewoc-data node)
 
 (defun ggtags-view-search-history-next (&optional arg)
   (interactive "p")
@@ -1115,7 +1122,8 @@ Global and Emacs."
  (if node
  (ewoc-enter-before ggtags-global-search-ewoc
 node (cadr arg))
-   (ewoc-enter-last ggtags-global-search-ewoc (cadr arg))
+   (ewoc-enter-last ggtags-global-search-ewoc (cadr arg)))
+ (setq ggtags-view-search-history-last (cadr arg)
(list text (ewoc-data node)))
  text)
 (if append (kill-append text nil)
@@ -1126,10 +1134,12 @@ Global and Emacs."
 (defun ggtags-view-search-history-update (&optional noconfirm)
   "Update `ggtags-global-search-history' to current buffer."
   (interactive "P")
-  (when (or noconfirm
-(yes-or-no-p "Modify `ggtags-global-search-history'?"))
+  (when (and (buffer-modified-p)
+ (or noconfirm
+ (yes-or-no-p "Modify `ggtags-global-search-history'?")))
 (setq ggtags-global-search-history
-  (ewoc-collect ggtags-global-search-ewoc #'identity
+  (ewoc-collect ggtags-global-search-ewoc #'identity))
+(set-buffer-modified-p nil)))
 
 (defun ggtags-view-search-history-action ()
   (interactive)
@@ -1146,7 +1156,16 @@ Global and Emacs."
   :group 'ggtags
   (setq-local ggtags-enable-navigation-keys nil)
   (setq-local bookmark-make-record-function #'ggtags-make-bookmark-record)
-  (setq truncate-lines t))
+  (setq truncate-lines t)
+  (add-hook 'kill-buffer-hook #'ggtags-view-search-history-update nil t))
+
+(defun ggtags-view-search-history-restore-last ()
+  (when ggtags-view-search-history-last
+(cl-loop for n = (ewoc-nth ggtags-global-search-ewoc 0)
+ then (ewoc-next ggtags-global-search-ewoc n)
+ while n when (eq (ewoc-data n)
+  ggtags-view-search-history-last)
+ do (progn (goto-char (ewoc-location n)) (cl-return t)
 
 (defun ggtags-view-search-history ()
   "Pop to a buffer to view or re-run past searches.
@@ -1182,10 +1201,7 @@ Global and Emacs."
 (ewoc-create #'pp "Global search history keys:  n:next  p:prev  
r:register  RET:choose\n")))
 (dolist (data ggtags-global-search-history)
   (ewoc-enter-last ggtags-global-search-ewoc data))
-(and ggtags-view-search-history-last
- (re-search-forward (cadr ggtags-view-search-history-last) nil t)
- (ewoc-goto-node ggtags-global-search-ewoc
- (ewoc-locate ggtags-global-search-ewoc)))
+(ggtags-view-search-history-restore-last)
 (set-buffer-modified-p nil)
 (fit-window-to-buffer nil (floor (frame-height) 2
 
@@ -1275,7 +1291,7 @@ Use \\[jump-to-register] to restore the search session."
   (le

[elpa] 06/14: Make ggtags-create-tags invalidate ggtags-project-root

2014-06-22 Thread Leo Liu
leoliu pushed a commit to branch master
in repository elpa.

commit 20118520c0377155f5e47bb4f7ac7261fb84fac7
Author: Leo Liu 
Date:   Sat Jun 14 12:16:22 2014 +0800

Make ggtags-create-tags invalidate ggtags-project-root

So that buffers can see the new project root.
---
 ggtags.el |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/ggtags.el b/ggtags.el
index 15b0b0e..a17c5b3 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -641,6 +641,14 @@ Value is new modtime if updated."
   (goto-char (point-min))
   (not (re-search-forward "^file not found" nil t)
 
+(defun ggtags-invalidate-buffer-project-root (root)
+  (mapc (lambda (buf)
+  (with-current-buffer buf
+(and buffer-file-truename
+ (string-prefix-p root buffer-file-truename)
+ (kill-local-variable 'ggtags-project-root
+(buffer-list)))
+
 (defun ggtags-create-tags (root)
   "Create tag files (e.g. GTAGS) in directory ROOT.
 If file .globalrc or gtags.conf exists in ROOT, it will be used
@@ -678,6 +686,7 @@ source trees. See Info node `(global)gtags' for details."
  (apply #'ggtags-process-string
 "gtags" (cl-remove "--idutils" args))
(signal (car err) (cdr err)
+(ggtags-invalidate-buffer-project-root (file-truename root))
 (message "GTAGS generated in `%s'" root)
 root))
 



[elpa] branch master updated (76cd6eb -> 4e171a5)

2014-06-22 Thread Leo Liu
leoliu pushed a change to branch master
in repository elpa.

  from  76cd6eb   * packages/nlinum/nlinum.el (nlinum--face-height): New 
function. (nlinum--setup-window): Use it.
   new  a7a3c81   Fix #54: New command ggtags-find-tag-mouse
   new  c1840d4   Update doc strings and comments
   new  9182e34   Fix #56: Restore variable ggtags-completing-read-function
   new  7b196dd   New command ggtags-find-definition for #57
   new  313a4c3   Fix #59: detect missing tag files and remove project cache
   new  2011852   Make ggtags-create-tags invalidate ggtags-project-root
   new  e160060   Fix #65: Clear ggtags-project-root based on 
default-directory
   new  b001d70   Fix #64: Bind M-s s to ggtags-navigation-isearch-forward
   new  63e557a   Fix #60: Declutter command and highlight tag in search 
history
   new  136ac62   Refactoring: Use a major mode for viewing search history
   new  b42bf95   Fix #58: Search history can be manipulated with C-k and 
C-y
   new  bea9f02   Replace kill-buffer-and-window with ggtags-kill-window
   new  823a5dc   Fix ggtags-global-handle-exit to conditionally pop up 
window
   new  4e171a5   Merge branch 'master' of github.com:leoliu/ggtags

The 14 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/ggtags/README.rst |   43 +--
 packages/ggtags/ggtags.el  |  296 +++-
 2 files changed, 246 insertions(+), 93 deletions(-)



[elpa] 03/14: Fix #56: Restore variable ggtags-completing-read-function

2014-06-22 Thread Leo Liu
leoliu pushed a commit to branch master
in repository elpa.

commit 9182e3478b7b8376f266988b6f40513838f4c102
Author: Leo Liu 
Date:   Thu May 15 11:16:07 2014 +0800

Fix #56: Restore variable ggtags-completing-read-function
---
 README.rst |4 +++-
 ggtags.el  |   24 ++--
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/README.rst b/README.rst
index 864f66e..794e1cc 100644
--- a/README.rst
+++ b/README.rst
@@ -279,7 +279,8 @@ Integration with other packages
 
 * helm
 
-  If ``helm-mode`` is enabled ``ggtags`` will use it for completion.
+  If ``helm-mode`` is enabled ``ggtags`` will use it for completion if
+  ``ggtags-completing-read-function`` is nil.
 
 NEWS
 
@@ -288,6 +289,7 @@ NEWS
 +
 
 #. New command ``ggtags-find-tag-mouse`` for mouse support.
+#. Variable ``ggtags-completing-read-function`` restored.
 
 [2014-05-06 Tue] 0.8.4
 ++
diff --git a/ggtags.el b/ggtags.el
index fa53843..97ba132 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -102,9 +102,11 @@
 
 (defcustom ggtags-oversize-limit (* 10 1024 1024)
   "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'."
+When the size of the GTAGS file is below this limit, ggtags
+always maintains up-to-date tags for the whole source tree by
+running `global -u'. For projects with GTAGS larger than this
+limit, only files edited in Ggtags mode are updated (via `global
+--single-update')."
   :safe 'numberp
   :type '(choice (const :tag "None" nil)
  (const :tag "Always" t)
@@ -286,6 +288,13 @@ properly update `ggtags-mode-map'."
   :type 'key-sequence
   :group 'ggtags)
 
+(defcustom ggtags-completing-read-function nil
+  "Ggtags specific `completing-read-function' (which see).
+Nil means using the value of `completing-read-function'."
+  :type '(choice (const :tag "Use completing-read-function" nil)
+ function)
+  :group 'ggtags)
+
 (defcustom ggtags-highlight-tag-delay 0.25
   "Time in seconds before highlighting tag at point."
   :set (lambda (sym value)
@@ -769,9 +778,12 @@ Do nothing if GTAGS exceeds the oversize limit unless 
FORCE."
 (setq ggtags-current-tag-name
   (cond (confirm
  (ggtags-update-tags)
- (completing-read
-  (format (if default "%s (default %s): " "%s: ") prompt 
default)
-  ggtags-completion-table nil require-match nil nil default))
+ (let ((completing-read-function
+(or ggtags-completing-read-function
+completing-read-function)))
+   (completing-read
+(format (if default "%s (default %s): " "%s: ") prompt 
default)
+ggtags-completion-table nil require-match nil nil 
default)))
 (default (substring-no-properties default))
 (t (ggtags-read-tag type t prompt require-match default))
 



[elpa] branch externals/chess updated (754fd7d -> 7074fb6)

2014-06-22 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  754fd7d   Update chess.info and fix a minor misunderstanding in 
chess-display-update documentation.
   new  7074fb6   Release 2.0.3.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 NEWS |8 
 chess.el |4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)



[elpa] 01/01: Release 2.0.3.

2014-06-22 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit 7074fb64c66fb84be9a1c8ee3abeb956da355fd9
Author: Mario Lang 
Date:   Mon Jun 23 01:40:04 2014 +0200

Release 2.0.3.
---
 NEWS |8 
 chess.el |4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 2054058..bc12c23 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,14 @@ This is the NEWS file for Emacs Chess, a chess client and 
analysis library
 written in Emacs Lisp.
 
 
+* Release 2.0.3:
+
+This is a bugfix release which fixes a recursive dependency between
+`chess-display' and `chess-pgn' which was accidentally missed in 2.0.2.
+
+Also included is further proof-reading of the Info manual.
+
+
 * Release 2.0.2:
 
 ** Major updates to the Info manual.
diff --git a/chess.el b/chess.el
index 00f06ac..6ed5cd1 100644
--- a/chess.el
+++ b/chess.el
@@ -4,7 +4,7 @@
 
 ;; Author: John Wiegley 
 ;; Maintainer: Mario Lang 
-;; Version: 2.0.2
+;; Version: 2.0.3
 ;; Package-Requires: ((cl-lib "0.5"))
 ;; Keywords: games
 ;; Compatibility: Emacs24
@@ -89,7 +89,7 @@
   :group 'games
   :link '(custom-manual "(chess)Top"))
 
-(defconst chess-version "2.0.2"
+(defconst chess-version "2.0.3"
   "The version of the Emacs chess program.")
 
 (defcustom chess-default-display