I'm a light-to-middleweight emacs 25.1 user. I have been using org-mode with few difficulties until I wanted to export to HTML or latex. Then it fails with "Debugger entered--Lisp error: (wrong-type-argument stringp |)"
Backtrace gives this:
Debugger entered--Lisp error: (wrong-type-argument stringp |)
string-match("^\\(.*?\\)\\(?:(\\([^!#/]\\)?.*?)\\)?$" |)
org-set-regexps-and-options()
org-mode()
set-auto-mode-0(org-mode nil)
set-auto-mode()
normal-mode(t)
after-find-file(nil t)
find-file-noselect-1(#<buffer outlines.org> "c:/Users/***/outlines.org" nil nil "c:/Users/****/outlines.org" (19984723346758628 3399104098))
find-file-noselect("c:/Users/****/outlines.org" nil nil nil)
find-file("c:/Users/****/outlines.org")
dired-find-file()
funcall-interactively(dired-find-file)
call-interactively(dired-find-file nil nil)
command-execute(dired-find-file)
I re-installed org mode using the package system to no avail. I have basic familiarity with lisp, but I'm a librarian by trade, not a programmer. I can edit .el files if I know what to look for. Thanks!
Juancho had it exactly right in his comment. I had a defective line in my .emacs. I missed the quotes around the pipe symbol in my custom list of TODO keywords:
'((sequence "TODO" "FOLLOWUP" | "DONE")))
should have been:
'((sequence "TODO" "FOLLOWUP" "|" "DONE")))
When I fixed that all was well. Thanks!
Related
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.
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!!
I have upgraded to Fedora 20 and suddenly latex-mode/auctex is broken. I receive an error whenever trying to go into latex mode:
command-execute: Symbol's value as variable is void: latex-mode
Using toggle-debug-on-error I see:
Debugger entered--Lisp error: (void-variable latex-mode)
byte-code("\301\302\303\304\305\306\307\310\307\311& \210\312\313\303\314\315\316\307\302&\210\312\317\303\320\315\316\307\302&\210\312\321\303\322\315\316\307\302&\210\312\323\324\325\315\316\307\302&\210\312\326\303\327\315\330\307\310&\210\331!\210\332\333\334\"\207" [latex-mode custom-declare-group LaTeX-macro nil "Special support for LaTeX macros in AUCTeX." :prefix "TeX-" :group LaTeX TeX-macro custom-declare-variable TeX-arg-cite-note-p "*If non-nil, ask for optional note in citations." :type boolean TeX-arg-footnote-number-p "*If non-nil, ask for optional number in footnotes." TeX-arg-item-label-p "*If non-nil, always ask for optional label in items.\nOtherwise, only ask in description environments." TeX-arg-right-insert-p t "*If non-nil, always insert automatically the corresponding \\right.\nThis happens when \\left is inserted." LaTeX-mode-hook "A hook run in LaTeX mode buffers." hook TeX-abbrev-mode-setup add-to-list auto-mode-alist ("\\.drv\\'" . latex-mode)] 10)
command-execute(latex-mode record)
execute-extended-command(nil "latex-mode")
call-interactively(execute-extended-command nil nil)
Help please!What broke my LaTeX mode and how can I fix it?
Running
GNU Emacs 24.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.9.10) of 2013-08-14 on buildvm-17.phx2.fedoraproject.org
Following https://github.com/bbatsov/prelude/issues/407 I re-installed AucTex. That seems to have done the trick. I used list-packages and then deleted AuxTex then reinstalled. I can now use LaTeX mode.
I have been searching for an answer/solution to this problem. I am not sure how it happened or what I did (if anything), but when I hit F3 to run a batch file for SAS in ESS[SAS] mode, it doesn't work. I have been using it all day and it suddenly just doesn't work anymore... If I call M-x ess-sas-global-unix-keys while in SAS-mode I can use the F3-F6 buttons, but having (setq ess-sas-global-unix-keys t) in my init.d file upon opening a .sas file doesn't bind F3-F6 to the necessary commands.
Also, when I now open a .sas file, I get the message "File mode specification error: (void-variable ess-ac-sources)" and the F3-F6 key-bindings no longer work in SAS-mode.
I checked to make sure I have everything up-to-date (everything appears to be: i.e. auto-complete, ess), I debugged using M-x toggle-debug-on-error, but I can't find what is wrong (not that I would necessarily know what I am looking for, I am still new to Emacs).
In my init.el file, the only reference I have to ESS is the ess-sas-global-unix-keys. I feel like the specification error is having an effect on the ESS[SAS] keybindings, but I don't know how to fix it. I am also at a loss as to why it just started happening, even though I had been using it all day long. What can I do?
EDIT:
As per the comments, I will be sending an email to the ESS-help mailing list as well as listing out the backtrace list from the debug-on-error.
Debugger entered--Lisp error: (void-variable ess-ac-sources)
ess-load-extras()
ess-mode(((ess-local-customize-alist quote SAS-customize-alist) (ess-language . "SAS") (ess-dialect . "SAS") (ess-mode-editing-alist . SAS-editing-alist) (ess-mode-syntax-table . SAS-syntax-table) (inferior-ess-program . inferior-SAS-program-name) (ess-help-sec-regex . "^[A-Z. ---]+:$") (ess-help-sec-keys-alist . " ") (ess-object-name-db-file . "ess-sas-namedb.el") (inferior-ess-objects-command . "objects(%d)") (inferior-ess-help-command . "help(\"%s\",pager=\"cat\",window=F)\n") (inferior-ess-exit-command . "endsas;\n") (ess-loop-timeout . 500000) (inferior-ess-primary-prompt . "^") (inferior-ess-secondary-prompt . "^") (comint-use-prompt-regexp . t) (inferior-ess-start-file) (inferior-ess-start-args . inferior-SAS-args-temp) (inferior-ess-font-lock-defaults . SAS-mode-font-lock-defaults)) nil)
SAS-mode()
set-auto-mode-0(SAS-mode nil)
set-auto-mode()
normal-mode(t)
after-find-file(nil t)
find-file-noselect-1(#<buffer cleaning-0yr.sas> "~/Documents/datasets/PROMISE/data/scripts/cleaning-0yr.sas" nil nil "~/Documents/datasets/PROMISE/data/scripts/cleaning-0yr.sas" (5673145 2049))
find-file-noselect("~/Documents/datasets/PROMISE/data/scripts/cleaning-0yr.sas" nil nil t)
find-file("~/Documents/datasets/PROMISE/data/scripts/cleaning-0yr.sas" t)
call-interactively(find-file nil nil)
Not sure what happened since I had tried this before, but today I again replaced (setq ess-sas-global-unix-keys t) with simply (ess-sas-global-unix-keys) (at the suggestion from the ESS-help mailing list) and the F3-F6 buttons now work in ESS[SAS] mode. I did get an update to emacs this morning, so that may have contributed to the fix. I still get the "File mode specification error..." though.
EDIT
As per #wvxvw comment, including (defvar ess-ac-sources nil) into the init.el (or .emacs) file prevented the "File mode..." error from occurring.
Following this pdf document I added the following to my ~/.emacs file:
(load "auctex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq TeX-PDF-mode t) ;; .pdf statt .dvi per default:
;;Zeilenumbruch
;;(add-hook ’LaTeX-mode-hook ’turn-on-auto-fill)
;;Syntax Higlight
(add-hook ’LaTeX-mode-hook ’turn-on-font-lock)
;; Mathe Modus
(add-hook ’LaTeX-mode-hook ’LaTeX-math-mode)
;; Reftex einflechten und laden
(setq reftex-plug-into-AUCTeX t)
(add-hook ’LaTeX-mode-hook ’turn-on-reftex)
;; Satzende ". " statt ". ". " fuer M-k: loeschen bis Satzende usw.
;;(setq sentence-end "[.?!][]\"’)}]*\\($\\| \\| \\)[
;;]*") ;; Da ist ein "Newline in der Zeile!"
;;(setq sentence-end-double-space nil)
;;direkte Rechtschreib Korrektur:
;;(add-hook ’LaTeX-mode-hook ’flyspell-mode)
;; Nur benutzen falls Auctex > 11.81 mit preview-latex:
(load "preview-latex.el" nil t t)
;; aspell ist besser als ispell.
;; Zeile kommentieren, falls nicht installiert:
(setq-default ispell-program-name "aspell")
;; Deutsche Rechtschreibung falls \usepackage{ngerman}
;; oder german benutzt wird
(add-hook ’TeX-language-de-hook
(function (lambda () (ispell-change-dictionary "german8"))))
Unfortunately emacs doesn't start now, instead it gives the error
Warning (initialization): An error occurred while loading `/home/../.emacs':
Symbol's value as variable is void: ’LaTeX-mode-hook
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the `--debug-init' option to view a complete error backtrace.
When starting with --debug-init it gives the following information
Debugger entered--Lisp error: (void-variable ’LaTeX-mode-hook)
(add-hook ’LaTeX-mode-hook ’turn-on-font-lock)
eval-buffer(#<buffer *load*> nil "/home/../.emacs" nil t) ; Reading at buffer position 812
load-with-code-conversion("/home/../.emacs" "/home/../.emacs" t t)
load("~/.emacs" t t)
...
I tried using latex-mode-hook instead. I searched for a solution, but I seem to be the only one having exactly this problem.
I'm using Ubuntu 12.04 with the latest Emacs and Auctex. If required I'll post version information, but I rather think that something has to be added into the configuration or any package has to be installed instead.
How can I get emacs work with that configuration?
Are you using the wrong single quote character? it seems to be some kind of a backward quote instead of a plain single quote. Try
'LaTeX-mode-hook
instead of
’LaTeX-mode-hook
(and likewise for all other occurrences of that character).
As Thomas also said, the back quote is not the character you want to use there, it should be the single straight quote. But, in general, if you get "symbol's value as variable is void" error, it means the same as NPE (null pointer exception) in other languages. The way to check what went wrong is like so:
Move point to the variable that gives the problem and C-h v (or M-x describe-variable [name of the variable without quote]). You can use TAB to complete the variable name as you type to see if you by chance didn't mistype it.
Once you see the buffer that describes the variable - you know you've fixed the error.
Now, if you have LaTeX mode set through auctex.el, then latex-mode-hook must exist. However, you need to make sure that auctex.el actually loads and requires latex-mode. The way it does so isn't an idiomatic way for Emacs to do it, most of the time you add the source files for the mode to the load-path variable and then (require 'mode-name) or load the mode conditionally once Emacs opens the type of the file associated with it (makes startup time for Emacs shorter) through autoload as described here: Emacs: Best-practice for lazy loading modes in .emacs? .
However, whenever you see a variable called [something]-mode-hook it means that this is a list of functions you want to call when [something] mode loads up. If the [something] mode at all exists, there's a 99.99% chance that variable exists too (can't be void). So, if it is void - you need to make sure that the mode it belongs to at all loads.