I am using the latest cedet version from bzr. My cedet configuration is given below ( Taken from Alex Ott's file ).
(setq cedet-root-path (file-name-as-directory "~/cedet"))
(load-file (concat cedet-root-path "cedet-devel-load.el"))
(add-to-list 'load-path (concat cedet-root-path "contrib"))
;; select which submodes we want to activate
(add-to-list 'semantic-default-submodes 'global-semantic-mru-bookmark-mode)
(add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-idle-scheduler-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode)
(add-to-list 'semantic-default-submodes 'global-cedet-m3-minor-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-highlight-func-mode)
(add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode)
;; Activate semantic
(semantic-mode 1)
I always get error "Wrong type argument , stringp 1" whenever I open a C source code.
Looks like (semantic-mode 1)
is causing the issue. Any help is appreciated.
I am using emacs 24, and I didn't see this issue if I use cedet that comes with emacs.
EDIT : Stack trace attached. Will send this to cedet-delevel mailing list also. .~/.semanticdb is not created yet( new laptop ).
Debugger entered--Lisp error: (wrong-type-argument stringp 1)
string-match("\n" 1 0)
split-string(1 "\n")
semantic-cpp-defs(1)
semantic-gcc-setup()
semantic-default-c-setup()
semantic-new-buffer-fcn()
semantic-mode(1)
eval-buffer(#<buffer *load*> nil "/home/sudheesh/Dropbox/cedet_new.el" nil t) ; Reading at buffer position 898
load-with-code-conversion("/home/sudheesh/Dropbox/cedet_new.el" "/home/sudheesh/Dropbox /cedet_new.el" nil nil)
load("/home/sudheesh/Dropbox/cedet_new.el" nil nil t)
load-file("~/Dropbox/cedet_new.el")
SOLVED:
This issue is solved now. I haven't installed g++ compiler. The issue is because of this. Installing g++ compiler solved this issue. Thanks to the support of David Engster from cedet-dlevel mailing list.
Related
I'm trying to add use-package to my init.el and I'm running into this error:
Error (use-package): evil-leader/:config: Invalid function: (global-evil-leader-mode)
Here's a stripped down init.el that produces that error (assumes evil and evil-leader are already installed)
(package-initialize)
(require 'use-package)
(use-package evil :ensure)
(use-package evil-leader
:ensure
:after evil
:config
((global-evil-leader-mode)
(evil-leader/set-leader ",")
(evil-leader/set-key
"b" 'buffer-menu)
; Apparently this needs to go after (global-evil-leader-mode)
; https://emacs.stackexchange.com/questions/30332/evil-leader-stops-working-when-i-eval-buffer
(evil-mode t)))
This is how it was set up without use-package working correctly:
(package-initialize)
(require 'evil)
(require 'evil-leader)
(global-evil-leader-mode)
(evil-leader/set-leader ",")
(evil-leader/set-key
"b" 'buffer-menu)
; Apparently this needs to go after (global-evil-leader-mode)
; https://emacs.stackexchange.com/questions/30332/evil-leader-stops-working-when-i-eval-buffer
(evil-mode t)
Any help identifying what I'm doing wrong would be appreciated, thank you!
I thin you should remove the parenthesis after :config
I use undo-tree 0.6.5 (from Elpa), and it works quite well most of the time. However, if I have not yet called C-x-u on a buffer, then from this buffer I can't open a new frame. If I do C-x-5-2, Emacs opens the `Backtrace buffer with this:
Debugger entered--Lisp error: (wrong-type-argument undo-tree nil)
signal(wrong-type-argument (undo-tree nil))
undo-tree-current(nil)
(undo-tree-node-previous (undo-tree-current buffer-undo-tree))
(and undo-tree-mode (not buffer-read-only) (not (eq t buffer-undo-list)) (undo-tree-node-previous (undo-tree-current buffer-undo-tree)))
x-create-frame(((visibility) (vertical-scroll-bars . left) (reverse . t)))
x-create-frame-with-faces(((vertical-scroll-bars . left) (reverse . t)))
#f(compiled-function (params) #<bytecode 0x1fdd4b1bc7bf>)(((vertical-scroll-bars . left) (reverse . t)))
apply(#f(compiled-function (params) #<bytecode 0x1fdd4b1bc7bf>) ((vertical-scroll-bars . left) (reverse . t)))
frame-creation-function(((vertical-scroll-bars . left) (reverse . t)))
make-frame()
make-frame-command()
funcall-interactively(make-frame-command)
call-interactively(make-frame-command nil nil)
command-execute(make-frame-command)
Then, I do C-x-u so the undo-tree buffer related to that buffer is created, and from then on I can create other frames.
Is there a workaround for this?
edit: it also prevents the use of menus. When I try to click on any menu item, the same message shows up.
edit: opening Emacs with this minimalistic startup file gives the same error:
(add-to-list 'load-path
"~/.emacs.d/elpa/undo-tree-0.6.5")
(require 'undo-tree)
(global-undo-tree-mode)
(setq debug-on-error t)
Okay, so I got it working. I was using the ELPA version of undo-tree, which is version 0.6.5. So a couple of days ago I noticed that the developer has a new version in his git repository, 0.6.6. I installed it locally and the problem was gone!
First, get a copy of the git repository:
$ cd ~/.emacs.d
$ git clone http://www.dr-qubit.org/git/undo-tree.git
Then add this to your Emacs config:
(load "~/.emacs.d/undo-tree/undo-tree.el")
(require 'undo-tree)
(global-undo-tree-mode)
I use emacs semantic to auto-complete C language structure, but when I tag ">" (Message->) it show error "cannot analyze buffers not supported by semantic".
Google many times and I did not find any solution.
Debug Message:
Debugger entered--Lisp error: (error "Cannot analyze buffers not supported by Semantic")
signal(error ("Cannot analyze buffers not supported by Semantic"))
error("Cannot analyze buffers not supported by Semantic")
semantic-analyze-current-context()
byte-code("\301 \210^H\203^V^#\302 \204^Q^#\303 \203^V^#\304^H\305\"\210\306\207" [semantic-current-input-throw-symbol semantic-analyze-current-c$
byte-code("\212\302\211^X\303\215)?\205^X^# \304U\205^X^#\302\211^X\305\215)?)\207" [semantic-current-input-throw-symbol arg csi (byte-code "\3$
semantic-complete-self-insert(1)
call-interactively(semantic-complete-self-insert nil nil)
Version:
CEDET Version: 1.1
Requested File Loaded
Package Version Version Version
----------------------------------------------------------
cedet: 1.1 ok ok
eieio: 1.4 ok ok
semantic: 2.1 ok ok
srecode: 1.1 ok ok
ede: 1.1 ok ok
speedbar: 1.0.4 ok ok
cogre: 1.1 ok Not Loaded
cedet-contrib: 1.1 ok Not Loaded
.emacs setting
(add-to-list 'load-path' "~/.emacs.d/company-mode"
"~/.emacs.d/cedet/common" )
(load "~/.emacs.d/cedet/common/cedet" nil t)
(autoload 'company-mode "company" nil t)
(setq company-idle-delay t)
(global-ede-mode 1)
(semantic-load-enable-code-helpers)
(global-srecode-minor-mode 1)
(add-to-list 'load-path
"~/.emacs.d/plugins")
(require 'yasnippet-bundle)
;;; semantic setup
;; (semantic-load-enable-minimum-features)
;; (semantic-load-enable-code-helpers)
;; (semantic-load-enable-gaudy-code-helpers)
(semantic-load-enable-excessive-code-helpers)
(semantic-load-enable-semantic-debugging-helpers)
(require 'eieio-opt)
;;; gcc setup
(require 'semantic-gcc)
;;; smart complitions setup
(require 'semantic-ia)
;;;
(defun my-cedet-hook()
(local-set-key [(control return)] 'semantic-ia-complete-symbol)
(local-set-key "\C-c?" 'semantic-ia-complete-symbol-menu)
(local-set-key (kbd "M-n") 'semantic-ia-complete-symbol-menu)
(local-set-key "\C-c>" 'semantic-complete-analyze-inline)
(local-set-key (kbd "M-/") 'semantic-complete-analyze-inline)
(local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle)
(local-set-key "\C-cd" 'semantic-ia-fast-jump)
(local-set-key "\C-cr" 'semantic-symref-symbol)
(local-set-key "\C-cR" 'semantic-symref)
;;; c/c++ setting
(local-set-key "." 'semantic-complete-self-insert)
(local-set-key ">" 'semantic-complete-self-insert))
(add-hook 'c-mode-common-hook 'my-cedet-hook)
Thank you!
You're using a horribly outdated CEDET.
Just update to latest Emacs, or at least to 24.3.
Then you can test with zero config:
emacs24.3 -Q ~/test.c
M-x semantic-mode. After this, semantic-ia-complete-symbol will bring up the
appropriate popup.
I am violating probably the most essential emacs package rule in my .emacs file by loading a specific path to an emacs (workgroups2) package which gets updated. So, everytime a new version is released and when I upgrade I have to edit my emacs file (this is the first line below).
The following is the relevant section of my emacs file. How can I load this without adding a specific path? Let me know what other suggestions you have and thanks!
To be clear the line we are considering is: (add-to-list 'load-path "~/.emacs.d/elpa/workgroups2-20130915.1509")
(add-to-list 'load-path "~/.emacs.d/elpa/workgroups2-20130915.1509")
(require 'workgroups2)
(setq package-enable-at-startup nil)
(package-initialize)
(desktop-save-mode nil) ; save all opened files (or disable it)
(setq wg-prefix-key (kbd "C-c w")
wg-restore-associated-buffers t ; restore all buffers opened in this WG?
wg-use-default-session-file t ; turn off for "emacs --daemon"
wg-default-session-file "~/.emacs.d/emacs_def.wg"
wg-use-faces nil
wg-morph-on nil) ; animation off
;; Keyboard shortcuts - load, save, switch
(global-set-key (kbd "<pause>") 'wg-reload-session)
(global-set-key (kbd "C-S-<pause>") 'wg-save-session)
(global-set-key (kbd "s-z") 'wg-switch-to-workgroup)
(global-set-key (kbd "s-/") 'wg-switch-to-previous-workgroup)
(workgroups-mode 1) ; Activate workgroups
EDIT: If I comment out that line, this is what the debugger gives me:
Debugger entered--Lisp error: (file-error "Cannot open load file" "workgroups2")
require(workgroups2)
eval-buffer(#<buffer *load*> nil "/home/d2b2/.emacs.d/init.el" nil t) ; Reading at buffer position 6014
load-with-code-conversion("/home/d2b2/.emacs.d/init.el" "/home/d2b2/.emacs.d/init.el" t t)
load("/home/d2b2/.emacs.d/init" t t)
#[0 "^H\205\262^# \306=\203^Q^#\307^H\310Q\202;^# \311=\204^^^#\307^H\312Q\202;^#\313\307\314\315#\203*^#\316\202;^#\313\307\314\317#\203:^#\320\nB^R\321\202;^#\316\$
command-line()
normal-top-level()
EDIT: Now commenting out both lines we have the following errors:
Debugger entered--Lisp error: (error ":END: line missing at position 186")
signal(error (":END: line missing at position 186"))
error(":END: line missing at position %s" 186)
org-flag-drawer(t)
org-cycle-hide-drawers(all)
org-set-startup-visibility()
org-mode()
desktop-restore-file-buffer("/home/d2b2/.todo" ".todo" nil)
#[nil "^H \236A\206^H^#\305\n^K\f#\207" [desktop-buffer-major-mode desktop-buffer-mode-handlers desktop-buffer-file-name desktop-buffer-name desktop-buffer-misc deskt$
desktop-create-buffer(206 "/home/d2b2/.todo" ".todo" org-mode (workgroups-mode) 1 (nil nil) nil nil ((buffer-file-coding-system . undecided-unix) (truncate-lines . t)))
eval-buffer(#<buffer *load*> nil "/home/d2b2/.emacs.desktop" nil t) ; Reading at buffer position 813
load-with-code-conversion("/home/d2b2/.emacs.desktop" "/home/d2b2/.emacs.desktop" t t)
load("/home/d2b2/.emacs.desktop" t t t)
desktop-read()
#[nil "\304\211^X \235\203^O^#\305^H \"^Q\306^R)\n\205^Z^#\307 \210\310\211^S\207" [key command-line-args desktop-save-mode inhibit-startup-screen "--no-desktop"$
run-hooks(after-init-hook)
command-line()
normal-top-level()
Make sure, that package-directory-list includes your path to elpa ~/.emacs.d/elpa.
Then package.el initializes some package, it adds name of package to
package-activated-list and pushes package directory
(e.g. ~/.emacs.d/elpa/workgroups2-20130915.1509) to load-path
automatically.
For me it works as usual, I don't add any specific pathes for packages manually.
The value of package-enable-at-startup is t in my config.
package-enable-at-startup doc:
"Whether to activate installed packages when Emacs starts...If the
value of package-enable-at-startup is nil, you can type M-x
package-initialize to activate the package system at any time."
(require 'workgroups2) is before package initialization in your config, try to move it below.
I have installed Marmalade and downloaded some interesting packages. But now, when I start Emacs I get this error:
Cannot open load file: c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/archives/-pkg
If I use --debug-init, I get:
Debugger entered--Lisp error: (file-error "Cannot open load file" "c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/archives/-pkg")
load("c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/archives/-pkg" nil t)
(if (file-directory-p pkg-dir) (load (concat pkg-dir ... "-pkg") nil t))
(let ((pkg-dir ...)) (if (file-directory-p pkg-dir) (load ... nil t)))
package-load-descriptor("c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/" "archives")
(lambda (name) (package-load-descriptor dir name))("archives")
mapc((lambda (name) (package-load-descriptor dir name)) ("anything-1.287" "anything- complete-1.86" "anything-config-0.4.1" "archive-contents" "archive-contents~" "archives" "auto-indent-mode-0.35" "builtin-packages" "builtin-packages~" "clojure-mode-1.7.1" "clojurescript-mode-0.5" "coffee-mode-0.3.0" "color-file-completion-1.0.1" "color-theme-6.6.1" "color-theme-eclipse-0.0.2" "color-theme-github-0.0.3" "color-theme-railscasts-0.0.2" "color-theme-twilight-0.1" "css-mode-1.0" "drag-stuff-0.0.3" "evernote-mode-0.41" "find-file-in-project-2.0" "flymake-coffee-0.4" "flymake-haml-0.5" "flymake-ruby-0.4" "flymake-shell-0.5" "haml-mode-3.0.14" "highlight-parentheses-1.0.1" "html-script-src-0.0.2" "inf-ruby-2.1" "js-comint-0.0.1" "js2-mode-20090814" "lua-mode-20100617" "package.el" "package.el~" "project-local-variables-0.2" "ruby-compilation-0.7" "ruby-electric-1.1" "ruby-mode-1.1" "slime-20100404" "tabbar-2.0.1" "tabbar-ruler-0.2" "yasnippet-0.6.1" "yasnippet-bundle-0.6.1" "zenburn-1.8"))
(if (file-directory-p dir) (mapc (lambda ... ...) (directory-files dir nil "^[^.]")))
(lambda (dir) (if (file-directory-p dir) (mapc ... ...)))("c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/")
mapc((lambda (dir) (if (file-directory-p dir) (mapc ... ...))) ("c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/" "/usr/share/emacs/site-lisp/elpa/"))
package-load-all-descriptors()
package-initialize()
(progn (package-initialize))
(if (load (expand-file-name "~/.emacs.d/elpa/package.el")) (progn (package-initialize)))
(when (load (expand-file-name "~/.emacs.d/elpa/package.el")) (package-initialize))
eval-buffer(#<buffer *load*> nil "c:/Documents and Settings/Carlos/Datos de programa/.emacs" nil t) ; Reading at buffer position 9019
load-with-code-conversion("c:/Documents and Settings/Carlos/Datos de programa/.emacs" "c:/Documents and Settings/Carlos/Datos de programa/.emacs" t t)
load("~/.emacs" t t)
#[nil "\205\264
This file doesn't exist. I've tried searching for this problem with Google but I didn't find anything.
Easy. For whatever reason, the package.el you're now using is the "classic" version from http://tromey.com/elpa/package.el. It's wildly incompatible with recent versions of package.el. How you managed to install Marmalade packages using that version, I don't know; you must have had a different version of package.el when you installed those packages, perhaps because you were using a newer Emacs at the time.
The fix is to use the version bundled with your Emacs (if it's new enough to have one), or to replace your ~/.emacs.d/elpa/package.el with this version instead, as described in the Marmalade instructions.
I've stumbled upon this question while trying to solve a similar problem. In my case, forcing package-initialize have solved the problem:
;; init.el
(require 'package)
(package-initialize)
Even though I did not read the source code for package.el, I believe some kind of laziness in package.el is cousing the problem. Athough this is and old question, I wanted to answer, in case someone else need some help.
For more information on Emacs start-up, see http://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html.
Adding a file, not directory, using touch ~/.emacs.d/elpa/archives/-pkg solved it for me.
I think it may just go away if you manually create a directory at:
c:/Documents and Settings/Carlos/Datos de programa/.emacs.d/elpa/archives/-pkg
In my case I had to add this directive to tell emacs where it can find the files required:
First this line
(add-to-list 'load-path "~/.emacs.d/")
And the required package ...
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))