新人询问org-roam-server在windows10环境下的配置问题

@hjtoh,跟您一样,改了,还是不行。在win10上面的。

我的现在只能出这个丑图。点击能打开doom,但不能打开目标文件。

(add-hook 'after-init-hook 'org-roam-mode)

(require 'org-roam-protocol)

(setq org-roam-directory “D:/dailyroam/”)

(setq org-roam-buffer-width 0.3)

(setq org-roam-completion-system 'ivy)

(setq org-roam-graph-executable “C:/Program Files (x86)/Graphviz2.38/bin/dot”)

(setq org-roam-graph-viewer “C:/Program Files (x86)/Google/Chrome/Application/chrome.exe”)

(after! org-roam

    (map! :leader

        :prefix "n"

        :desc "org-roam" "l" #'org-roam

        :desc "org-roam-insert" "i" #'org-roam-insert

        :desc "org-roam-switch-to-buffer" "b" #'org-roam-switch-to-buffer

        :desc "org-roam-find-file" "f" #'org-roam-find-file

        :desc "org-roam-show-graph" "g" #'org-roam-show-graph

        :desc "org-roam-capture" "c" #'org-roam-capture))

(after! org-roam

  (setq org-roam-ref-capture-templates

        '(("r" "ref" plain (function org-roam-capture--get-point)

           "%?"

           :file-name "websites/${slug}"

           :head "#+TITLE: ${title}

#+ROAM_KEY: ${ref}

- source :: ${ref}"

           :unnarrowed t))))

(use-package org-roam-bibtex

:after org-roam

:hook (org-roam-mode . org-roam-bibtex-mode)

:bind (:map org-mode-map

     (("C-c n a" . orb-note-actions))))

(use-package org-roam-server

:after org-roam

:config

(setq org-roam-server-host “127.0.0.1”

    org-roam-server-port 8080

    org-roam-server-export-inline-images t

    org-roam-server-authenticate nil

    org-roam-server-label-truncate t

    org-roam-server-label-truncate-length 60

    org-roam-server-label-wrap-length 20)

(defun org-roam-server-open ()

"Ensure the server is active, then open the roam graph."

(interactive)

(org-roam-server-mode 1)

(browse-url-xdg-open (format "http://localhost:%d" org-roam-server-port))))

配置在上面。

注册表里注册了org-protocol,引用下载到本地的.bat 文件。 @echo off

set URL=%1

set URL=%URL:&=^&%

set URL=%URL:/?=?%

set URL=%URL:://=:///%

start “” “D:\DOOM\emacs-26.3\bin\emacsclientw.exe” -na “D:\DOOM\emacs-26.3\bin\runemacs.exe” “%URL%”

这是加入到注册表路径中的.bat 文件。 环境变量里加了emacs-server-file 路径。

bibtex 安装了org-ref 和org-roam-bibtex,没有安装helm-bibtex,试了试文献没有互相关。不知道为啥呢?

file:///C:/Users/chang/AppData/Local/Temp/graph.KCYC8H.svg 启动的是这个,没有启动http://127.0.0.1:8080/这个设置,我把dot 和chrome.exe 注释掉了也不行。

你整的好复杂呀,我给你我的截图image image ,然后我的默认浏览器是新版的edge,graphviz在环境变量的的path中,也没有.bat引导文件,只是按照我上面给的那个第一个链接写了注册表信息,然后导入就ok了,对了,emacs-server-file环境变量设置好,然后没问题了。你先按照我的方法配置好最简单的org-roam和org-roam-server,看看运行情况,然后再加自己的配置。

Zero to Emacs and Org-roam: a step-by-step guide on Windows 10

1 个赞

谢谢!解决了问题!原来我之前遇到的问题是org 9.3 对 chrome 发过来的文件链接解析不正确所致。

非常感谢,不过我这里节点无法关联是什么原因呢?如果让两个节点关联?每个节点是否表示一个文件呀? 右侧的roam buffer 也显示 No backlinks.

我使用了org-roam-insert-immediate 将关键字 machine learning 插入,但它提示我新建了一个machine learning 的文件,然后图片就像这样: 并没有关联 -----------------更新---------------------------- 刷新一下就好了,晕,当我没问

请教下,在生成graphviz的图时,能不能选择只有相关的,而不显示没有关联的文件? 借用上图 https://emacs-china.org/uploads/default/original/2X/a/a4b0cc9d608483f17ae7cd5cd6033359a8c4184b.png 只要Unicorn->roanink这一部分,其他不要显示。不要手工调整dot文件,要自动的

举例来说就是我涉及了几个课题,希望各自出现各自的网络,不希望放在一起。

image 您好!我之前还能从网页打开的,不知道怎么回事今天不行 了,看了半天没找到原因,这是什么原因呢?设置查看过,并没有改动。估计与电脑升级有关。

我不用MS windows系统,不知道什么情况。 :sweat:

在emacs里开启server。M-x server-start

1 个赞

存在问题:点击节点不能跳转已经打开的Windows Emacs,会重新开启一个Emacs窗口.

服务器开启成功,显示正常,

不知道楼主解决问题了没有,我今天终于搞定了。建议参考下面的操作方式:

https://github.com/nobiot/Zero-to-Emacs-and-Org-roam/blob/main/90.org-protocol.md

org-roam-server 网页上通过 org-protocol 中文编码变成 \223 这样的8进制,然后,emacsclient就打不开了。请问怎么解决?谢谢。

看着像编码的问题

;; UTF-8 as default encoding
(set-language-environment "UTF-8")

这步做了吗?如果做过了,那我也不知道为什么了。

找到原因了。我这里utf-8还不行,这么设置的:

(cond
 ((member system-type '(windows-nt cygwin))
  (set-clipboard-coding-system 'utf-16le)
  (set-file-name-coding-system 'gb18030)))

server和protocol工作正常了。 放张效果图: