0

The following backtrace problem in being produced but cannot identify the problem correctly.

Debugger entered--Lisp error: (void-function :documentation)
  (:documentation (concat "Version and permissions of Din tools." din-about-detail))
  typex-about()
  eval-buffer(#<buffer  *load*-971358> nil "/home/bard/din-1.0/din.e..." nil t)  ; Reading at buffer position 4568
  load-with-code-conversion("/home/bard/din-1.0/din.e..." "/home/bard/din-1.0/din.e..." nil nil)
  load("din")
  eval-buffer(#<buffer  *load*> nil "/home/bard/.emacs" nil t)  ; Reading at buffer position 1963
  load-with-code-conversion("/home/bard/.emacs" "/home/bard/.emacs" t t)
  load("~/.emacs" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0x157951e1402d>) #f(compiled-function () #<bytecode 0x157951e14041>) t)
  command-line()
  normal-top-level()

This is what I am doing

(defun din-message (bufname message)
   "Inserts formatted string into the `Din' dedicated buffer.
BUFNAME  Name of buffer. 
MESSAGE  Text."

   (with-current-buffer
       (get-buffer-create bufname)
     (insert message)) )

(defvar din-bufname "*Din*"
  "TODO")

(defvar din-version-license "Din Tools for Emacs.")

(defvar din-about-detail
   "Displays version number and license conditions.")

(defun din-about ()
  (:documentation
      (concat
       "Version and permissions of Din tools."
       din-about-detail))

  (din-message din-bufname din-version-license) )

(din-about)
3
  • 1
    It says you are trying to call a function with the name :documentation, now look at your code. Hint: if you would like to dynamically create a list then use (list ...) or use backquote syntax Jul 28, 2022 at 11:13
  • Looked through but cannot figure out a solution.
    – Dilna
    Jul 28, 2022 at 11:29
  • 1
    What are you trying to do in that first form in the body of din-about? It should get printed? Or you would like it to become a docstring? Or something else? Jul 28, 2022 at 11:35

1 Answer 1

1

Whenever you see the error void-function the first thing to look for is a use of a symbol that's not defined as a function in a function-calling position.

That's the case here. Your code has this function call:

(:documentation (concat "Version and permissions of Din tools." din-about-detail)

documentation is a built-in function in Emacs. :documentation is not a predefined function in Emacs. Maybe you meant documentation? Or maybe you meant to load some library that defines a :documentation function? (We can't know what you're really trying to do.)

Searching the 18.1 Elisp manual for :documentation shows that it's used by macro cl-generic -- and that's the only occurrence of :documentation in the manual.

-- Macro: cl-defgeneric name arguments [documentation] [options-and-methods...] &rest body

This macro defines a generic function with the specified NAME and ARGUMENTS. If BODY is present, it provides the default implementation.

If DOCUMENTATION is present (it should always be), it specifies the documentation string for the generic function, in the form (:documentation DOCSTRING). The optional OPTIONS-AND-METHODS can be one of the following forms:

8
  • The intention was to insert text into the function documentation. But using C-h f din-about displays Not documented.
    – Dilna
    Jul 28, 2022 at 15:17
  • No clue what you mean by that comment. But yes, din-about has no doc string. It's not documented.
    – Drew
    Jul 28, 2022 at 17:00
  • I have seen use of :documentation attribute to set the docstring.
    – Dilna
    Jul 28, 2022 at 17:12
  • You're not using any :documentation attribute anywhere. You're trying to call a function named :documentation.
    – Drew
    Jul 28, 2022 at 17:28
  • Now you know what you're doing wrong -- calling :documentation as if it were a function. It's up to you to know what you're trying to do and find out how you want to do it.
    – Drew
    Jul 28, 2022 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.