Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global: only name char is allowed with -c option. #191

Open
sergeyklay opened this issue Apr 4, 2019 · 5 comments
Open

global: only name char is allowed with -c option. #191

sergeyklay opened this issue Apr 4, 2019 · 5 comments

Comments

@sergeyklay
Copy link

sergeyklay commented Apr 4, 2019

Hello,

Just catched this error:

Debugger entered--Lisp error: (error "‘global’ non-zero exit: global: only name char is allowed with -c option.")
  signal(error ("‘global’ non-zero exit: global: only name char is allowed with -c option."))
  error("`%s' non-zero exit: %s" "global" "global: only name char is allowed with -c option.")
  ggtags-process-string("global" "-c" "?-")
  apply(ggtags-process-string "global" ("-c" "?-"))
  #f(compiled-function (prefix) #<bytecode 0xf912a9>)("?-")
  #f(compiled-function (string pred action) #<bytecode 0xfdc4e9>)("?-" nil lambda)
  test-completion("?-" #f(compiled-function (string pred action) #<bytecode 0xfdc4e9>))
  ggtags-highlight-tag-at-point()
  apply(ggtags-highlight-tag-at-point nil)
  timer-event-handler([t 0 0 250000 t ggtags-highlight-tag-at-point nil idle 0])

My cursor was here (between ? and -)

(while (and (> (length line-txt) 0) (= (aref line-txt 0) ?- ) )
;;                                                        ^
;;                                                        |
;; -------------------------------------------------------┘
$ ctags --version
Exuberant Ctags 5.9~svn20110310, Copyright (C) 1996-2009 Darren Hiebert
  Addresses: <[email protected]>, http://ctags.sourceforge.net
  Optional compiled features: +wildcards, +regex
$ emacs --version
GNU Emacs 26.1
Copyright (C) 2018 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
$ global --version
global (GNU GLOBAL) 6.6.3
Powered by Berkeley DB 1.85.
Copyright (c) 1996-2018 Tama Communications Corporation
License GPLv3+: GNU GPL version 3 or later <http://www.gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Configuration:

(when (executable-find "global")
  (use-package ggtags
    :delight " gg"
    :bind
    (:map ggtags-mode-map
          ("C-c g s" . 'ggtags-find-other-symbol)
          ("C-c g h" . 'ggtags-view-tag-history)
          ("C-c g r" . 'ggtags-find-reference)
          ("C-c g f" . 'ggtags-find-file)
          ("C-c g c" . 'ggtags-create-tags)
          ("C-c g u" . 'ggtags-update-tags)
          ("M-."     . 'ggtags-find-tag-dwim)
          ("M-,"     . 'pop-tag-mark)
          ("M-]"     . nil)
          ("C-c <"   . 'ggtags-prev-mark)
          ("C-c >"   . 'ggtags-next-mark))
    :config
    (progn
      (dolist (hook '(php-mode-hook
                      sh-mode-hook
                      c-mode-hook
                      c++-mode-hook
                      makefile-mode-hook
                      emacs-lisp-mode-hook))
        (add-hook hook #'ggtags-mode)))))

ggtags version 20190320.2208 (MELPA)

sergeyklay added a commit to sergeyklay/.emacs.d that referenced this issue Apr 4, 2019
@leoliu
Copy link
Owner

leoliu commented Apr 5, 2019

Basically gnu global -c only accepts chars that are not regex meta chars. Thus ignore-errors-unless-debug is used to turn such error into a message instead.

@sergeyklay
Copy link
Author

I don't want to hide or ignore errors and don't consider this as an acceptable approach in software development. In addition, I need the debug mode for my other tasks.

@leoliu
Copy link
Owner

leoliu commented Apr 8, 2019

The real bug is in GNU global. Kindly raise the issue there and with some luck someone may fix it the next day. It seems to me there is no reason for -c to consider regexp meta chars.

@sergeyklay
Copy link
Author

I would like to ask you to do this for the reason that you are a much more experienced GNU global user and know more precisely how to reproduce the error and possible workarounds.

@nverno
Copy link

nverno commented Mar 7, 2020

+1 bump, just stumbled across this issue with "$N" variables in awk-mode as well. Simple fix is just to (modify-syntax-entry ?$ "'" awk-mode-syntax-table) or provide a custom ggtags-bounds-of-tag-function. $ probably shouldn't be a symbol in most languages, but it's common enough as a prefix that it might be worth handling. I'll try to file a bug in global, unless someone already has

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants