Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
dac6f673
Commit
dac6f673
authored
Aug 07, 1995
by
Richard M. Stallman
Browse files
(byte-compile-output-docform): Check
byte-compile-dynamic-docstrings in input buffer, not output buffer.
parent
af7bd34e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
66 deletions
+69
-66
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/bytecomp.el
+69
-66
No files found.
lisp/emacs-lisp/bytecomp.el
View file @
dac6f673
...
...
@@ -1437,72 +1437,75 @@ With argument, insert value in current buffer after the form."
nil
)))
(
defun
byte-compile-output-docform
(
preface
name
info
form
specindex
quoted
)
;; Print a form with a doc string. INFO is (prefix doc-index postfix).
;; If PREFACE and NAME are non-nil, print them too,
;; before INFO and the FORM but after the doc string itself.
;; If SPECINDEX is non-nil, it is the index in FORM
;; of the function bytecode string. In that case,
;; we output that argument and the following argument (the constants vector)
;; together, for lazy loading.
;; QUOTED says that we have to put a quote before the
;; list that represents a doc string reference.
;; `autoload' needs that.
(
set-buffer
(
prog1
(
current-buffer
)
(
set-buffer
outbuffer
)
(
let
(
position
)
;; Insert the doc string, and make it a comment with #@LENGTH.
(
and
(
>=
(
nth
1
info
)
0
)
byte-compile-dynamic-docstrings
(
progn
;; Make the doc string start at beginning of line
;; for make-docfile's sake.
(
insert
"\n"
)
(
setq
position
(
byte-compile-output-as-comment
(
nth
(
nth
1
info
)
form
)
nil
))
;; If the doc string starts with * (a user variable),
;; negate POSITION.
(
if
(
and
(
stringp
(
nth
(
nth
1
info
)
form
))
(
>
(
length
(
nth
(
nth
1
info
)
form
))
0
)
(
eq
(
aref
(
nth
(
nth
1
info
)
form
)
0
)
?*
))
(
setq
position
(
-
position
)))))
(
if
preface
(
progn
(
insert
preface
)
(
prin1
name
outbuffer
)))
(
insert
(
car
info
))
(
let
((
print-escape-newlines
t
)
(
print-readably
t
)
; print #[] for bytecode, 'x for (quote x)
(
print-gensym
nil
)
; this is too dangerous for now
(
index
0
))
(
prin1
(
car
form
)
outbuffer
)
(
while
(
setq
form
(
cdr
form
))
(
setq
index
(
1+
index
))
(
insert
" "
)
(
cond
((
and
(
numberp
specindex
)
(
=
index
specindex
))
(
let
((
position
(
byte-compile-output-as-comment
(
cons
(
car
form
)
(
nth
1
form
))
t
)))
(
princ
(
format
"(#$ . %d) nil"
position
)
outbuffer
)
(
setq
form
(
cdr
form
))
(
setq
index
(
1+
index
))))
((
=
index
(
nth
1
info
))
(
if
position
(
princ
(
format
(
if
quoted
"'(#$ . %d)"
"(#$ . %d)"
)
position
)
outbuffer
)
(
let
((
print-escape-newlines
nil
))
(
goto-char
(
prog1
(
1+
(
point
))
(
prin1
(
car
form
)
outbuffer
)))
(
insert
"\\\n"
)
(
goto-char
(
point-max
)))))
(
t
(
prin1
(
car
form
)
outbuffer
)))))
(
insert
(
nth
2
info
)))))
"Print a form with a doc string. INFO is (prefix doc-index postfix).
If PREFACE and NAME are non-nil, print them too,
before INFO and the FORM but after the doc string itself.
If SPECINDEX is non-nil, it is the index in FORM
of the function bytecode string. In that case,
we output that argument and the following argument (the constants vector)
together, for lazy loading.
QUOTED says that we have to put a quote before the
list that represents a doc string reference.
`autoload' needs that."
;; We need to examine byte-compile-dynamic-docstrings
;; in the input buffer (now current), not in the output buffer.
(
let
((
dynamic-docstrings
byte-compile-dynamic-docstrings
))
(
set-buffer
(
prog1
(
current-buffer
)
(
set-buffer
outbuffer
)
(
let
(
position
)
;; Insert the doc string, and make it a comment with #@LENGTH.
(
and
(
>=
(
nth
1
info
)
0
)
dynamic-docstrings
(
progn
;; Make the doc string start at beginning of line
;; for make-docfile's sake.
(
insert
"\n"
)
(
setq
position
(
byte-compile-output-as-comment
(
nth
(
nth
1
info
)
form
)
nil
))
;; If the doc string starts with * (a user variable),
;; negate POSITION.
(
if
(
and
(
stringp
(
nth
(
nth
1
info
)
form
))
(
>
(
length
(
nth
(
nth
1
info
)
form
))
0
)
(
eq
(
aref
(
nth
(
nth
1
info
)
form
)
0
)
?*
))
(
setq
position
(
-
position
)))))
(
if
preface
(
progn
(
insert
preface
)
(
prin1
name
outbuffer
)))
(
insert
(
car
info
))
(
let
((
print-escape-newlines
t
)
(
print-readably
t
)
; print #[] for bytecode, 'x for (quote x)
(
print-gensym
nil
)
; this is too dangerous for now
(
index
0
))
(
prin1
(
car
form
)
outbuffer
)
(
while
(
setq
form
(
cdr
form
))
(
setq
index
(
1+
index
))
(
insert
" "
)
(
cond
((
and
(
numberp
specindex
)
(
=
index
specindex
))
(
let
((
position
(
byte-compile-output-as-comment
(
cons
(
car
form
)
(
nth
1
form
))
t
)))
(
princ
(
format
"(#$ . %d) nil"
position
)
outbuffer
)
(
setq
form
(
cdr
form
))
(
setq
index
(
1+
index
))))
((
=
index
(
nth
1
info
))
(
if
position
(
princ
(
format
(
if
quoted
"'(#$ . %d)"
"(#$ . %d)"
)
position
)
outbuffer
)
(
let
((
print-escape-newlines
nil
))
(
goto-char
(
prog1
(
1+
(
point
))
(
prin1
(
car
form
)
outbuffer
)))
(
insert
"\\\n"
)
(
goto-char
(
point-max
)))))
(
t
(
prin1
(
car
form
)
outbuffer
)))))
(
insert
(
nth
2
info
))))))
nil
)
(
defun
byte-compile-keep-pending
(
form
&optional
handler
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment