1

I'm quite new to Emacs and I've encountered with a problem. I want to set a register to a variable, my code is here:

(defvar org-file-location "")
(defvar system-name-as-string (prin1-to-string system-name))

(cond ((string-match "WIN-WORK" system-name-as-string)
           (setq org-file-location "~/../My Documents/Google Drive/Org"))
          )

(set-register ?o '(file . org-file-location))

But when I try jump to register by a key sequence C-X r j o, I get a error: find-file-noselect: Wrong type argument: stringp, org-file-location. Does anyone know, there the problem is ? I would appreciate any help. Thanks in advance.

4

1 回答 1

1

您将寄存器设置为包含符号的值org-file-location,但您希望将其值作为变量。

尝试这个:

(set-register ?o (cons 'file org-file-location))

或者,使用反引号语法插入值:

(set-register ?o `(file . ,org-file-location))
于 2013-07-01T09:28:15.903 回答