1 line
2.3 KiB
Plaintext
1 line
2.3 KiB
Plaintext
<!-- SC_OFF --><div class="md"><p>Okay , it used to work falwlessly ...but now throwing an error while invoking... I understand , you will say, "what changes since then?" ...a lot ..not sure which one is bugging this ...but the code and output text are below ...take a peek :</p> <p><strong>capture template code:</strong></p> <p>.........</p> <p><code>("b" "Books" entry (file "~/.emacs.d/OrgFiles/books.org"</code></p> <p><code>"* %(let* ((url (substring-no-properties (current-kill 0)))</code></p> <p><code>(details (org-books-get-details url)))</code></p> <p><code>(when details (apply #'org-books-format 1 details)))")</code></p> <p>​</p> <p>Now here is the output I am getting once select/press "b" from capture menu ...in the capture buffer it is showing this :</p> <p><code>%![Error: (void-function org-books-get-details)]</code> </p> <p>​</p> <p>Now, here is the actual code in the <strong>org-books.el :</strong></p> <p><code>(defun org-books-get-details (url)</code></p> <p><code>"Fetch book details from given URL.Return a list of three items: title (string), author (string) andan alist of properties to be applied to the org entry. If the url is not supported, throw an error."</code></p> <p><code>(let ((output 'no-match)</code></p> <p><code>(url-host-string (url-host (url-generic-parse-url url))))</code></p> <p><code>(cl-dolist (pattern-fn-pair org-books-url-pattern-dispatches)</code></p> <p><code>(when (s-matches? (car pattern-fn-pair) url-host-string)</code></p> <p><code>(setq output (funcall (cdr pattern-fn-pair) url))</code></p> <p><code>(cl-return)))</code></p> <p><code>(if (eq output 'no-match)</code></p> <p><code>(error (format "Url %s not understood" url))</code></p> <p><code>output)))</code></p> <p>​</p> <p>What is going wrong...I am not able to figure it out. I am sure , that I haven't change the file to something else.</p> <p>Shed some light.</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/unixbhaskar"> /u/unixbhaskar </a> <br/> <span><a href="https://www.reddit.com/r/emacs/comments/ppan1g/well_book_capture_template_code_not_working_it/">[link]</a></span>   <span><a href="https://www.reddit.com/r/emacs/comments/ppan1g/well_book_capture_template_code_not_working_it/">[comments]</a></span> |