emacs/var/elfeed/db/data/b4/b46f6adafdc9f79b7d09d8e0d33668eec040050b
2022-01-03 12:49:32 -06:00

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, &quot;what changes since then?&quot; ...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>(&quot;b&quot; &quot;Books&quot; entry (file &quot;~/.emacs.d/OrgFiles/books.org&quot;</code></p> <p><code>&quot;* %(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 #&#39;org-books-format 1 details)))&quot;)</code></p> <p>&#x200B;</p> <p>Now here is the output I am getting once select/press &quot;b&quot; from capture menu ...in the capture buffer it is showing this :</p> <p><code>%![Error: (void-function org-books-get-details)]</code> </p> <p>&#x200B;</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>&quot;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.&quot;</code></p> <p><code>(let ((output &#39;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 &#39;no-match)</code></p> <p><code>(error (format &quot;Url %s not understood&quot; url))</code></p> <p><code>output)))</code></p> <p>&#x200B;</p> <p>What is going wrong...I am not able to figure it out. I am sure , that I haven&#39;t change the file to something else.</p> <p>Shed some light.</p> </div><!-- SC_ON --> &#32; submitted by &#32; <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> &#32; <span><a href="https://www.reddit.com/r/emacs/comments/ppan1g/well_book_capture_template_code_not_working_it/">[comments]</a></span>