Lisp Error Wrong-type-argument Stringp T
Contents |
For example, the + function expects the values of its arguments to be numbers. As an experiment we can pass it the quoted symbol hello instead of a number. emacs wrong type argument number-or-marker-p nil Position the cursor after the following expression and type C-x C-e: (+ 2 'hello) emacs stringp When you do this you will generate an error message. What has happened is that + has tried to add
Emacs Wrong Type Argument Listp
the 2 to the value returned by 'hello, but the value returned by 'hello is the symbol hello, not a number. Only numbers can be added. So + could not carry out its
Wrong Type Argument Integer Or Marker P Nil
addition. You will create and enter a *Backtrace* buffer that says: ---------- Buffer: *Backtrace* ---------- Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p hello) +(2 hello) eval((+ 2 (quote hello))) eval-last-sexp-1(nil) eval-last-sexp(nil) call-interactively(eval-last-sexp) ---------- Buffer: *Backtrace* ---------- As usual, the error message tries to be helpful and makes sense after you learn how to read it.3 The first part of the error message is straightforward; it says ‘wrong type emacs lisp debugger argument’. Next comes the mysterious jargon word ‘number-or-marker-p’. This word is trying to tell you what kind of argument the + expected. The symbol number-or-marker-p says that the Lisp interpreter is trying to determine whether the information presented it (the value of the argument) is a number or a marker (a special object representing a buffer position). What it does is test to see whether the + is being given numbers to add. It also tests to see whether the argument is something called a marker, which is a specific feature of Emacs Lisp. (In Emacs, locations in a buffer are recorded as markers. When the mark is set with the C-@ or C-SPC command, its position is kept as a marker. The mark can be considered a number—the number of characters the location is from the beginning of the buffer.) In Emacs Lisp, + can be used to add the numeric value of marker positions as numbers. The ‘p’ of number-or-marker-p is the embodiment of a practice started in the early days of Lisp programming. The ‘p’ stands for “predicate”. In the jargon used by the early Lisp researchers, a predicate refers to a function to
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more
Wrong Type Argument Stringp Nil Emacs
about Stack Overflow the company Business Learn more about hiring developers or posting ads emacs wrong type argument commandp with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow emacs wrong type argument arrayp nil is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Wrong type argument: stringp, nil error up vote 5 down vote favorite https://www.gnu.org/software/emacs/manual/html_node/eintr/Wrong-Type-of-Argument.html I need to use update-directory-autoloads function in a little el-script. When I'm trying to call this function with an argument that is a name of a directory I receive this error: Wrong type argument: stringp, nil. Call looks like this: (update-directory-autoloads "~/test") emacs elisp share|improve this question edited Feb 7 '13 at 22:31 Jesus Ramos 18.1k53971 asked Feb 7 '13 at 22:14 Jauhien Piatlicki 153111 add a comment| 2 http://stackoverflow.com/questions/14762036/wrong-type-argument-stringp-nil-error Answers 2 active oldest votes up vote 5 down vote accepted Generating autoload files is poorly documented. You're experiencing the problem that arises because you haven't set the variable generated-autoload-file. Try the following: (let ((generated-autoload-file "~/test/loaddefs.el")) (update-directory-autoloads "~/test")) Update the generated-autoloads-file binding to be the location where you want the loaddefs.el file to live. share|improve this answer answered Feb 7 '13 at 22:41 Trey Jackson 60k8150190 Thank you. The problem really was in generated-autoload-file undefined. –Jauhien Piatlicki Feb 7 '13 at 23:59 add a comment| up vote 9 down vote When you get Wrong type argument: foo, bar., you should M-: (setq debug-on-error t) RET and then reproduce the error so as to get a backtrace. Actually, you can set debug-on-error like that in your .emacs and Emacs usually stays perfectly useable. share|improve this answer answered Feb 8 '13 at 2:40 Stefan 19.8k12049 6 M-x toggle-debug-on-error is a bit nicer for the interactive case. –phils Feb 8 '13 at 5:45 Indeed. Or even "Options => Enter Debugger on Error" in the menu. –Stefan Nov 5 '13 at 12:28 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook
Sign in Pricing Blog Support Search GitHub This repository Watch 451 Star 9,368 Fork 2,473 syl20bnr/spacemacs Code Issues 878 Pull https://github.com/syl20bnr/spacemacs/issues/3652 requests 169 Projects 4 Wiki Pulse Graphs New issue Wrong type argument: stringp, nil #3652 Open sumyuga opened this Issue Nov 3, 2015 · 24 comments Projects None yet Labels - Forum - Docker Documentation ✏ FAQ Hacktoberfest Ready for work Milestone No milestone Assignees No one assigned 9 participants sumyuga commented wrong type Nov 3, 2015 My host system is OS X and docker with Debian used to development. I have emacs 24.4.1 on Debian installed. After emacs starts I get this: Warning (initialization): An error occurred while loading '/root/.emacs.d/init.el' Wrong type argument: stringp, nil As a result it's not working powerline with key bindings But on my host wrong type argument system is all great. Collaborator TheBB commented Nov 3, 2015 Do --debug-init to see where the error comes from. sumyuga commented Nov 3, 2015 after this command starts emacs shows "Entering debugger..." and it is frozen – no any reaction Owner syl20bnr commented Nov 3, 2015 Is it with a vanilla .spacemacs ? sumyuga commented Nov 3, 2015 Of course. I have copied from template file ~/.emacs.d/core/templates/.spacemacs.template Collaborator TheBB commented Nov 4, 2015 You can work around this error by opening .emacs.d/elpa/archives/melpa/archive-contents and deleting the nil at the end of the list. I'm not sure why that happens in the first place. sumyuga commented Nov 4, 2015 No, it doesn't work StreakyCobra added to be reproduced <=(- UBO -)=> labels Nov 6, 2015 autosquid commented Jan 5, 2016 It looks like the same thing happened to me, and solution from @TheBB works. StreakyCobra added Fixed in develop Fixed in current release-x.x and removed Fixed in develop labels Jan 5, 2016 StreakyCobra commented Jan 5, 2016 @T