I got a weird issue in Emacs Backtrace - emacs

I'm using Emacs 24.3.1
I'm editing .emacs file, but something comes up, when I try to byte-compile it, the Message buffer says:
Load: symbols's value as variale is void:


Note the end of line, NOTHING, there is no variable such as custom-theme-load-path, is pretty weird.
Then in Terminal: emacs --debug-init, the Backtrace shows:
Debugger entered--Lisp error: (void-variable )
eval-buffer(#<buffer *load*> nil "/home/chz.emacs" nil t) ; Reading at buffer position 35761
load-with-code-cinversion...
...long lines comtaining my plugins...
command-line()
normal-top-level()
But when I M-x goto-char 35761, that line is a comment line, pretty weird...
When I added the cebet config in .emacs, the error came up, the configuration detail is in http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html
What should I do to get rid of the error??? Please Help!!

Related

org-bibtex-yank fails with Wrong type argument: stringp, nil

Org 8.2.10
Emacs 24.4.1
I have a bibtex entry in the scratch buffer, then M-w the entry.
It's in the kill-ring
I then swap to an org-mode buffer and try
M org-bibtex-yank
I receive an error: Wrong type argument: stringp, nil
I've toggled-debug-on-error and the backtrace is below. I have checked that the entry is on the kill-ring - I can yank it to a scratch buffer.
I've set debug-on-entry for org-bibtex-yank, and went a long way down the rabbit hole! I can see the entry in some steps of the debugger, but got lost!
I'd be grateful for any pointers on either the problem, or getting more information that might help.
thanks
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
looking-at(nil)
bibtex-parse-entry()
org-bibtex-read()
org-bibtex-yank()
call-interactively(org-bibtex-yank record nil)
command-execute(org-bibtex-yank record)
execute-extended-command(nil "org-bibtex-yank")
smex-read-and-run(("toggle-debug-on-error" "org-bibtex-yank" "debug-on-entry" "describe-function" "apropos" "set-variable" "package-list-packages" "load-theme" "describe-variable" "bibtex-yank" "eshell" "package-refresh-contents" "yank" "org-mode" "org-bibtex" "flyspell-mode" "server-force-delete" "org-bibtex-read-buffer" "R" "S" "S+" "cd" "dm" "5x5" "S+3" "S+6" "SAS" "arp" "dbx" "dig" "erc" "ert" "eww" "ftp" "gdb" "irc" "jdb" "man" "mpc" "pdb" "pwd" "rsh" "sdb" "xdb" "Sqpe" "calc" "diff" "dirs" "ffap" "gnus" ...))
smex()
call-interactively(smex nil nil)
command-execute(smex)
I know this issue "org-bibtex-yank fails with Wrong type argument: stringp, nil". Especially I can't paste an bibtex-entry from the web and paste it to an Org file via org-bibtex-yank.
My current work around:
Open in Emacs buffer for the bibtex mode. May be you use a dummy.bib
In bibtex-mode buffer call
M-x bibtex-set-dialect
Choose either bibtex or biblatex
Now I paste the bibtex-entry to the bib-file and check the behavior:
- Mark and copy via M-w a bibentry in the bibtex-mode buffer
- Change to your Org file
- Use there
M-x org-bibtex-yank.
Typically now it works.
The issue seems to be that bibtex-parse-entry requires that bibtex-set-dialect is called before calling it.
Unfortunately you can't do a (simple) file variable in a bibtex file.
M-x add-file-local-variable
for variable bibtex and value either bibtex or biblatex won't work.
As bibtex.el does not support this.
Try in Org file
# Local Variables:
# eval: (bibtex-set-dialect 'biblatex)
# End:
Try in bibtex file
M-x add-file-local-variable
and replace the line
bibtex: biblatex
by
eval: (bibtex-set-dialect 'biblatex)
Or read:
https://tex.stackexchange.com/questions/78455/does-emacs-support-editing-bibliography-files-for-biblatex

emacs auctex 11.88: Symbol's value as variable is void: LaTeX-dialect

I have a problem in using auctex 11.88 with emacs:
Whenever I try to open a .tex-File the following error message appears:
Loading /home/schmidt/.emacs.d/elpa/auctex-11.88.2/style/wrapfig.elc...
load: Symbol's value as variable is void: LaTeX-dialect
When I try to load the file a second time, everything works. It seems to me that latex.el where this variable is set, does not work correctly when opening the file for the first time.
This is how I initialize auctex in my .emacs file:
(load "tex-site.el" nil t t)
(load "auctex.el" nil t t)
Any ideas what I am doing wrong?
In my case I could fix this problem by removing the line
(tool-bar-mode -1)
from my .emacs.

how to find syntax error in elisp

if this is a duplicate please delete.
I was just editing my .emacs file and after i had my changes done. I
restarted emacs. But whet it comes up again it claims that the config
file has some errors. And i should start with "--debug-init" thats what
i also have done. But it did not helped me to solve nor find the syntax error.
So is there a way to find the lines which have syntaxerror. Or even better if
there would be something like a (e)lisp lint like you have for e.g xml, json, js
and so on. Thanks in advance
Edit
Managed to get the dump:
Debugger entered--Lisp error: (void-variable whitespace-mode)
redisplay_internal\ \(C\ function\)()
delete-process(#<process server-client-test>)
Someunicodefoo" [("server") server-use-tcp server-auth-dir server-socket-dir generate-new-buffer " *temp*" funcall make-byte-code 0 "Someunicodefoo" vconcat vector [buffer-name kill-buffer] 2 "\n\n(fn)" insert-file-contents-literally expand-file-name looking-at "127\\.0\\.0\\.1:[0-9]+ \\([0-9]+\\)" comm process-attributes string-to-number match-string 1 t :other delete-process make-network-process :name "server-client-test" :family local :server nil :noquery :service] 14 "\n\n(fn)"])
server-running-p("server")
byte-code("Someunicodefoo" [load-file-name buffer-file-name recentf-menu-before user-emacs-directory recentf-save-file server-name add-to-list load-path file-name-directory "../packages" tool-bar-mode 0 load "ergoemacs-keybindings/ergoemacs-mode" ergoemacs-mode 1 "init_load_packages" "init_version" "init_functions" "init_settings" "init_aliases" "init_abbrevs-lisp-mode" "init_keybinding" "init_mouse" "init_clean_menus" require recentf "Close" ".recentf" recentf-mode server server-running-p t server-start] 4)
load("/home/dirk/.emacs.d/ergoemacs_1.9.3.1/site-lisp/../ergoemacs/init")
eval-buffer(#<buffer *load*-842275> nil "/home/dirk/.emacs.d/ergoemacs_1.9.3.1/site-lisp/site-start.el" nil t) ; Reading at buffer position 1432
load-with-code-conversion("/home/dirk/.emacs.d/ergoemacs_1.9.3.1/site-lisp/site-start.el" "/home/dirk/.emacs.d/ergoemacs_1.9.3.1/site-lisp/site-start.el" nil nil)
load("/home/dirk/.emacs.d/ergoemacs_1.9.3.1/site-lisp/site-start.el" nil nil t)
load-file("~/.emacs.d/ergoemacs_1.9.3.1/site-lisp/site-start.el")
eval-buffer(#<buffer *load*> nil "/home/dirk/.emacs" nil t) ; Reading at buffer position 2883
load-with-code-conversion("/home/dirk/.emacs" "/home/dirk/.emacs" t t)
load("~/.emacs" t t)
command-line()
normal-top-level()
One way to do it is to open the file and mark the first half of it and apply eval-region. If an error is reported, mark half of it and repeat. If an error isn't reported, apply it to the other half.
This way you could narrow down the problem and once you have found it you can hopefully figure out the problem.
Another technique I use to find incorrect parentheses is to add an extra parenthesis to the beginning and end of the file, respectively and run C-M-f and C-M-b from the beginning and end, respectively. If there are incorrect parentheses, they will match the newly added ones, and the point will move to the incorrect ones.
EDIT: You can use M-x check-parens to check for unmatched parentheses.
For "lint"-like checking, there's elint.el, but more importantly, there's the byte-compiler: M-x byte-compile-file RET lets you byte-compile a file and will give you all kinds of warnings about syntax and style.
But your backtrace indicates that the problem is probably not one of syntax. Most like there's a whitespace-mode that appears somewhere in a menu (i.e. in an :enable property of a menu entry), and that signals an error because the whitespace-mode variable happens not to be defined yet. So as Phils suggests, loading whitespace would probably work around the problem.

How to show Backtrace for emacs?

I encounter an error:
scala-block-indentation: Wrong type argument: number-or-marker-p, nil
Whenever I click tab for indent in scala-mode.
I don't know where goes wrong in the code but want to fix it. However, I can only see this error in *Message* buffer without details. I tried to see this error in Backtrace but didn't know how. I tried (1) -debug-init to launch emacs (2) debug-on-entry command for scala-block-indentation but neither of them works.
Does anyone have ideas about how to enable BackTrace/Debugger for this function?
I have not used scala under emacs to tell if this can help you. But try (setq debug-on-error t) in your .emacs, or simply do M-: (setq debug-on-error t) to try for the current emacs session only.

Inserting citation with reftex-citation breaks Emacs buffer

I am trying to get started with RefTeX in Emacs 24.1.50.3, built --without-x. Running
(reftex-citation)
seems to work at first. I can enter a regex and get a list of matching citations in my bibliography. However, selecting an entry makes the buffer stops working. Attempting to navigate gives the following error
Debugger entered--Lisp error: (error "Marker does not point anywhere")
posn-at-point()
line-move-visual(1 nil)
line-move(1 nil nil 1)
byte-code("\302\303\211 $\207" [arg try-vscroll line-move nil] 5)
next-line(1 1)
call-interactively(next-line nil nil)
This should not be caused by my init.el, because it occurs even when I launch emacs with --no-site-files and enter (reftex-mode) manually.
Actually, --no-site-file does not inhibit your init.el file.
See C-hig (emacs) Initial Options RET
Start emacs -Q to be sure this is not being caused by non-standard libraries.
If so, then it sounds like a bug, in which case:
M-x report-emacs-bug RET