From 2a7d23b8dcbcac0a030736579780b56cb367f473 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 31 Oct 2019 17:09:46 +0100 Subject: [PATCH] update ggtags --- bba.org | 2 +- elpa/ggtags-20181221.238/ggtags-pkg.el | 2 -- .../ggtags-autoloads.el | 10 ++----- elpa/ggtags-20190320.2208/ggtags-pkg.el | 2 ++ .../ggtags.el | 29 +++++++++++-------- 5 files changed, 22 insertions(+), 23 deletions(-) delete mode 100644 elpa/ggtags-20181221.238/ggtags-pkg.el rename elpa/{ggtags-20181221.238 => ggtags-20190320.2208}/ggtags-autoloads.el (80%) create mode 100644 elpa/ggtags-20190320.2208/ggtags-pkg.el rename elpa/{ggtags-20181221.238 => ggtags-20190320.2208}/ggtags.el (99%) diff --git a/bba.org b/bba.org index a5a0493f..cb4d1e19 100644 --- a/bba.org +++ b/bba.org @@ -3364,7 +3364,7 @@ If you are new to tags check [[http://tuhdo.github.io/c-ide.html][this]]. #+BEGIN_SRC emacs-lisp :tangle yes (if (>= emacs-major-version 24) (progn - (add-to-list 'load-path "~/.emacs.d/elpa/ggtags-20181221.238" t) + (add-to-list 'load-path "~/.emacs.d/elpa/ggtags-20190320.2208" t) (require 'ggtags) (add-to-list 'load-path "~/.emacs.d/elpa/helm-gtags-20170116.529" t) (require 'helm-gtags) diff --git a/elpa/ggtags-20181221.238/ggtags-pkg.el b/elpa/ggtags-20181221.238/ggtags-pkg.el deleted file mode 100644 index 53d560b1..00000000 --- a/elpa/ggtags-20181221.238/ggtags-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "ggtags" "20181221.238" "emacs frontend to GNU Global source code tagging system" '((emacs "25")) :commit "2f538aa15c60ad8365b7240579f67a90f600c1d1" :keywords '("tools" "convenience") :authors '(("Leo Liu" . "sdl.web@gmail.com")) :maintainer '("Leo Liu" . "sdl.web@gmail.com") :url "https://github.com/leoliu/ggtags") diff --git a/elpa/ggtags-20181221.238/ggtags-autoloads.el b/elpa/ggtags-20190320.2208/ggtags-autoloads.el similarity index 80% rename from elpa/ggtags-20181221.238/ggtags-autoloads.el rename to elpa/ggtags-20190320.2208/ggtags-autoloads.el index 49629440..4781b8c7 100644 --- a/elpa/ggtags-20181221.238/ggtags-autoloads.el +++ b/elpa/ggtags-20190320.2208/ggtags-autoloads.el @@ -1,12 +1,9 @@ ;;; ggtags-autoloads.el --- automatically extracted autoloads ;; ;;; Code: - -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) - +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) -;;;### (autoloads nil "ggtags" "ggtags.el" (0 0 0 0)) +;;;### (autoloads nil "ggtags" "ggtags.el" (23994 42601 852819 813000)) ;;; Generated autoloads from ggtags.el (autoload 'ggtags-find-project "ggtags" "\ @@ -44,14 +41,11 @@ A function suitable for `hippie-expand-try-functions-list'. \(fn OLD)" nil nil) -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ggtags" '("ggtags-"))) - ;;;*** ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 ;; End: ;;; ggtags-autoloads.el ends here diff --git a/elpa/ggtags-20190320.2208/ggtags-pkg.el b/elpa/ggtags-20190320.2208/ggtags-pkg.el new file mode 100644 index 00000000..43e632ab --- /dev/null +++ b/elpa/ggtags-20190320.2208/ggtags-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "ggtags" "20190320.2208" "emacs frontend to GNU Global source code tagging system" '((emacs "25")) :commit "4d9000034d352cd983ae6626f560e434d0b3e9ca" :keywords '("tools" "convenience") :authors '(("Leo Liu" . "sdl.web@gmail.com")) :maintainer '("Leo Liu" . "sdl.web@gmail.com") :url "https://github.com/leoliu/ggtags") diff --git a/elpa/ggtags-20181221.238/ggtags.el b/elpa/ggtags-20190320.2208/ggtags.el similarity index 99% rename from elpa/ggtags-20181221.238/ggtags.el rename to elpa/ggtags-20190320.2208/ggtags.el index c170c492..bc476af1 100644 --- a/elpa/ggtags-20181221.238/ggtags.el +++ b/elpa/ggtags-20190320.2208/ggtags.el @@ -1,10 +1,10 @@ ;;; ggtags.el --- emacs frontend to GNU Global source code tagging system -*- lexical-binding: t; -*- -;; Copyright (C) 2013-2018 Free Software Foundation, Inc. +;; Copyright (C) 2013-2019 Free Software Foundation, Inc. ;; Author: Leo Liu ;; Version: 0.9.0 -;; Package-Version: 20181221.238 +;; Package-Version: 20190320.2208 ;; Keywords: tools, convenience ;; Created: 2013-01-29 ;; URL: https://github.com/leoliu/ggtags @@ -864,9 +864,11 @@ blocking emacs." (default (substring-no-properties default)) (t (ggtags-read-tag type t prompt require-match default)))))) -(defun ggtags-sort-by-nearness-p () +(defun ggtags-sort-by-nearness-p (&optional start-location) (and ggtags-sort-by-nearness - (ggtags-process-succeed-p "global" "--nearness=." "--help"))) + (ggtags-process-succeed-p "global" "--nearness=." "--help") + (concat "--nearness=" + (or start-location buffer-file-name default-directory)))) (defun ggtags-global-build-command (cmd &rest args) ;; CMD can be definition, reference, symbol, grep, idutils @@ -878,7 +880,6 @@ blocking emacs." (ggtags-find-project) (ggtags-project-has-color (ggtags-find-project)) "--color=always") - (and (ggtags-sort-by-nearness-p) "--nearness=.") (and (ggtags-find-project) (ggtags-project-has-path-style (ggtags-find-project)) "--path-style=shorter") @@ -941,7 +942,11 @@ blocking emacs." (defun ggtags-find-tag (cmd &rest args) (ggtags-check-project) - (ggtags-global-start (apply #'ggtags-global-build-command cmd args))) + (let ((nearness (ggtags-sort-by-nearness-p + (ggtags-project-relative-file + (or buffer-file-name default-directory))))) + (ggtags-global-start + (apply #'ggtags-global-build-command cmd nearness args)))) (defun ggtags-include-file () "Calculate the include file based on `ggtags-include-pattern'." @@ -2038,7 +2043,10 @@ If SYNC is non-nil, synchronously run CMDS and call CALLBACK." (let* ((re (cadr (assq 'grep ggtags-global-error-regexp-alist-alist))) (current (current-buffer)) (buffer (get-buffer-create " *ggtags-definition*")) - (args (list "--result=grep" "--path-style=absolute" name)) + ;; `.' works here because ggtags-global-output doesn't set + ;; default-directory to project root. + (args (delq nil (list (ggtags-sort-by-nearness-p ".") + "--result=grep" "--path-style=absolute" name))) ;; Need these bindings so that let-binding ;; `ggtags-print-definition-function' can work see ;; `ggtags-eldoc-function'. @@ -2057,11 +2065,8 @@ If SYNC is non-nil, synchronously run CMDS and call CALLBACK." (with-current-buffer current (funcall print-fn (funcall get-fn defs))))))) (ggtags-with-current-project - (ggtags-global-output - buffer - (cons (ggtags-program-path "global") - (if (ggtags-sort-by-nearness-p) (cons "--nearness=." args) args)) - show 100)))) + (ggtags-global-output buffer (cons (ggtags-program-path "global") args) + show 100)))) (defvar ggtags-mode-prefix-map (let ((m (make-sparse-keymap))) -- 2.47.3