Open semgilo opened 7 years ago
Thanks for your reporting, but your bug report is too simplified. M-x toggle-debug-on-error
and try again, post the full error message.
And please write in English because not everyone understand it.
thanks i type "test" when show url tips showing
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
file-name-nondirectory(nil)
file-name-sans-extension(nil)
(concat (file-name-sans-extension created-md-file-path) ".org")
(let* ((stdout (shell-command-to-string (format "%s new '%s'" hexo-command (hexo--new-read-url-from-user)))) (created-md-file-path (progn (string-match "Created: \\(.+\\)$" stdout) (match-string 1 stdout))) (created-org-file-path (concat (file-name-sans-extension created-md-file-path) ".org"))) (cond ((eq hexo-new-format (quote org)) (rename-file created-md-file-path created-org-file-path) (find-file created-org-file-path) (goto-char 0) (replace-regexp "date:.*" (concat "#+DATE: " (format-time-string "<%Y-%m-%d %a %H:%M>"))) (goto-char 0) (replace-regexp "^ *tags: *" "#+TAGS: ") (goto-char 0) (flush-lines "---") (goto-char (point-max)) (insert "#+LAYOUT: \n#+CATEGORIES: \n") (goto-char 0) (replace-regexp "title: .+$" (format "#+TITLE: \"%s\"" (read-from-minibuffer "Article Title: " (car minibuffer-history))))) (t (find-file created-md-file-path) (goto-char 0) (replace-regexp "title: .+$" (format "title: \"%s\"" (read-from-minibuffer "Article Title: " (car minibuffer-history)))))) (save-buffer))
hexo--new-interactively("/Users/semgilo/Documents/Github/hexo/node_modules/hexo/bin/hexo")
(cond ((not (hexo-find-root-dir)) (message "You should run this command under a Hexo repo, or in a hexo-mode buffer")) ((null hexo-command) (message "Not found hexo command in your node_modules/ nor $PATH,")) (t (hexo--new-interactively hexo-command)))
(let ((hexo-command (hexo-find-command))) (cond ((not (hexo-find-root-dir)) (message "You should run this command under a Hexo repo, or in a hexo-mode buffer")) ((null hexo-command) (message "Not found hexo command in your node_modules/ nor $PATH,")) (t (hexo--new-interactively hexo-command))))
hexo-new()
funcall-interactively(hexo-new)
call-interactively(hexo-new nil nil)
command-execute(hexo-new)
Hmm... It seems hexo new
command was not executed correctly.
hexo
been installed in your system or ~/your/hexo/repo/dir/node_modules/
?I had installed it at ~/Documents/Github/hexo I can execute the command in Terminal ![Uploading Screen Shot 2017-04-02 at 8.17.41 AM.png…]()
hexo-cli: 1.0.2
os: Darwin 15.6.0 darwin x64
http_parser: 2.7.0
node: 7.7.4
v8: 5.5.372.42
uv: 1.11.0
zlib: 1.2.11
ares: 1.10.1-DEV
modules: 51
openssl: 1.0.2k
icu: 58.2
unicode: 9.0
cldr: 30.0.3
tz: 2016j
I can use "R" to rename "D" to delete and other "RTN" to open
I still don't know what hexo version is you're using. This is mine, runs hexo 3.2.2.
$ ./node_modules/hexo/bin/hexo version (04-02 09:34)
hexo: 3.2.2
hexo-cli: 1.0.2
os: Darwin 15.6.0 darwin x64
http_parser: 2.7.0
node: 7.5.0
v8: 5.4.500.48
uv: 1.10.2
zlib: 1.2.8
ares: 1.10.1-DEV
modules: 51
openssl: 1.0.2k
icu: 58.2
unicode: 9.0
cldr: 30.0.3
tz: 2016j
sorry, Cut the less
hexo: 3.2.2
hexo-cli: 1.0.2
os: Darwin 15.6.0 darwin x64
http_parser: 2.7.0
node: 7.7.4
v8: 5.5.372.42
uv: 1.11.0
zlib: 1.2.11
ares: 1.10.1-DEV
modules: 51
openssl: 1.0.2k
icu: 58.2
unicode: 9.0
cldr: 30.0.3
tz: 2016j
What is returned after you run (in terminal) hexo new "hello-word"
?
INFO Created: ~/Documents/Github/www.lanhuzi.com/source/_posts/hello-word.md
Sounds quite unreasonable... From the *Backtrace*
message you've provided, the problem should be hexo.el
doesn't really find & execute hexo new
command. Can you see any newly created files after you M-x hexo-new
and get error message?
None be created, just output "wrong type argument strings nil"
Ok, ultimate debug method: create a file ~/Documents/Github/www.lanhuzi.com/source/.posts/test
then paste:
(message (shell-command-to-string (format "%s new '%s'"
(hexo-find-command)
"testttttt")))
Then M-x eval-buffer
, see what returned
~/Documents/Github/www.lanhuzi.com/source/.posts/test
the ".post" or "_post"?
sorry, _post
. Whatever, as long as the file is under your hexo-blog-repository-directory
Debugger entered--Lisp error: (void-variable post)
eval-buffer() ; Reading at buffer position 8
funcall-interactively(eval-buffer)
call-interactively(eval-buffer record nil)
command-execute(eval-buffer record)
execute-extended-command(nil "eval-buffer" "eval-buffer")
funcall-interactively(execute-extended-command nil "eval-buffer" "eval-buffer")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
Oh my... Don't paste other thing into the file. The file can contain only:
(message (shell-command-to-string (format "%s new '%s'"
(hexo-find-command)
"testttttt")))
Then M-x eval-buffer
in this file's buffer.
I mean M-x eval-buffer
in this file's buffer, instead of *Hexo*
buffer.
sorry, i am newer for emacs
How about (message (hexo-find-command))
?
eval-buffer
(message (format "%s new '%s'" (hexo-find-command) "testttttt"))
I guess I know where the problem is. hexo.el
execute hexo
command, which is actually the file YOUR_HEXO_REPO/node_modules/hexo/bin/hexo
, whose the content is:
#!/usr/bin/env node
'use strict';
require('hexo-cli')();
Now you can know why your Emacs returned env: node: No such file or directory
,and in fact, hasn't really executed hexo at all.
In Unix-like system, this is ok; but in Windows, I don't know what's the behavior and how to execute it. If you can tell me how to execute it under Windows then I may can fix this problem.
but i use mac, i don't know windows how to execute it
Oops, sorry, I mixed you up with another bug (happened only in Windows) which I just fixed in tldr.el
today....
Hmmm, you use Mac, I cannot understand why you still encounter this problem...
Can you execute YOUR_HEXO_REPO/node_modules/hexo/bin/hexo
correctly in Emacs? (e.g. M-! /PATH/TO/YOUR/HEXO/REPO/node_modules/hexo/bin/hexo
)
i can execute command in Terminal but it can't be found in emacs shell command , it seems diff env, I echo $PATH both in Terminal and shell command. so i "setenv PATH" and modify permissions, and try again, it work ok now
now, I can new file,but it is markdown format, I had created .dir-locals.el in my blog root dir
Have you made variable hexo-new-format
safe?
how to do it ?
For Mac install package exec-path-from-shell
Make Emacs use the $PATH set up by the user's shell
@Develle thanks
Is this issue still existing?
hexo-new-format can't be changed by user, now i modify hexo-new-format equal org default
hexo-new type url display error message: wrong-type-argument stringp nil