Subject: bug#55830: closed (bug#55830: `byte-compile` drops doc string)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 08 Jun 2022 08:30:02 +0000

Your bug report

#55830: `byte-compile` drops doc string

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
55830: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55830
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: bug#55830: `byte-compile` drops doc string
From: Mattias Engdegård <[email-masked]>
To: [email-masked]
Date: Wed, 8 Jun 2022 10:29:03 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> Shouldn't that function also deal with :documentation? What about declare forms? 

No, :documentation and declare forms are dealt with during macro-expansion. Only a literal doc string is left once the compiler gets to look at the code again.

Fixed on master.

Subject: `byte-compile` drops doc string
From: Mattias Engdegård <[email-masked]>
To: [email-masked]
Date: Tue, 7 Jun 2022 13:19:58 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

A function with doc string and interactive spec:

(defun hello ()
  "my function"
  (interactive)
  (message "hello"))

Then:

(byte-compile 'hello)

results in the doc string being lost.
This probably happens in byte-compile--reify-function where the doc string and interactive spec are swapped around.

Shouldn't that function also deal with :documentation? What about declare forms?