Skip to content

Commit

Permalink
texi-docstring-magic.el: Fix regression in last change
Browse files Browse the repository at this point in the history
* doc/PG-adapting.texi: Re-build.

* lib/texi-docstring-magic.el (texi-docstring-magic-splice-sep):
Delete function.
(texi-docstring-magic-texi): Use `mapconcat` instead.
(texi-docstring-magic-texi-for): Don't use obsolete `face-doc-string`.
Follow aliasing indirections and autoload the function if needed to
get its argument list.
  • Loading branch information
monnier committed Mar 28, 2024
1 parent a63a9b1 commit f620526
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 36 deletions.
46 changes: 23 additions & 23 deletions doc/PG-adapting.texi
Original file line number Diff line number Diff line change
Expand Up @@ -3022,12 +3022,12 @@ To set the default value for these settings in prover-specific cases,
you should use the special @code{defpgdefault} macro:

@c TEXI DOCSTRING MAGIC: defpgdefault
@deffn Macro defpgdefault
@deffn Macro defpgdefault sym value
Set default for the proof assistant specific variable <PA>@var{-sym} to @var{value}.@*
This should be used in prover-specific code to alter the default values
for prover specific settings.

Usage: (defpgdefault SYM @var{value})
Usage: (defpgdefault @var{sym} @var{value})
@end deffn

In your prover-specific code you can simply use the setting
Expand Down Expand Up @@ -3121,11 +3121,11 @@ Any other %-prefixed character inserts itself.
@end defun

@c TEXI DOCSTRING MAGIC: proof-defshortcut
@deffn Macro proof-defshortcut
Define shortcut function FN to insert @var{string}, optional keydef KEY.@*
@deffn Macro proof-defshortcut fn string &optional key
Define shortcut function @var{fn} to insert @var{string}, optional keydef @var{key}.@*
This is intended for defining proof assistant specific functions.
@var{string} is inserted using @samp{@code{proof-insert}}, which see.
KEY is added onto proof assistant map.
@var{key} is added onto proof assistant map.
@end deffn
The function @code{proof-shell-invisible-command} is a useful utility
for sending a single command to the process. You should use this to
Expand Down Expand Up @@ -3160,23 +3160,23 @@ There are several handy macros to help you define functions
which invoke @code{proof-shell-invisible-command}.

@c TEXI DOCSTRING MAGIC: proof-definvisible
@deffn Macro proof-definvisible
Define function FN to send @var{string} to proof assistant, optional keydef KEY.@*
@deffn Macro proof-definvisible fn string &optional key
Define function @var{fn} to send @var{string} to proof assistant, optional keydef @var{key}.@*
This is intended for defining proof assistant specific functions.
@var{string} is sent using @samp{@code{proof-shell-invisible-command}}, which see.
@var{string} may be a string or a function which returns a string.
KEY is added onto proof assistant map.
@var{key} is added onto proof assistant map.
@end deffn

@c TEXI DOCSTRING MAGIC: proof-define-assistant-command
@deffn Macro proof-define-assistant-command
Define FN (docstring DOC): check if @var{cmdvar} is set, then send @var{body} to prover.@*
@deffn Macro proof-define-assistant-command fn doc cmdvar &optional body
Define @var{fn} (docstring @var{doc}): check if @var{cmdvar} is set, then send @var{body} to prover.@*
@var{body} defaults to @var{cmdvar}, a variable.
@end deffn

@c TEXI DOCSTRING MAGIC: proof-define-assistant-command-witharg
@deffn Macro proof-define-assistant-command-witharg
Define FN (arg) with DOC: check @var{cmdvar} is set, @var{prompt} a string and eval @var{body}.@*
@deffn Macro proof-define-assistant-command-witharg fn doc cmdvar prompt &rest body
Define @var{fn} (arg) with @var{doc}: check @var{cmdvar} is set, @var{prompt} a string and eval @var{body}.@*
The @var{body} can contain occurrences of arg.
@var{cmdvar} is a variable holding a function or string. Automatically has history.
@end deffn
Expand Down Expand Up @@ -3356,7 +3356,7 @@ same way as @code{defcustom}, except that the symbol declared will
automatically be prefixed by the current proof assistant symbol.

@c TEXI DOCSTRING MAGIC: defpgcustom
@deffn Macro defpgcustom
@deffn Macro defpgcustom sym &rest args
Define a new customization variable <PA>@var{-sym} for the current proof assistant.@*
This is intended for defining settings which are useful for any prover,
but which the user may require different values of across provers.
Expand All @@ -3373,12 +3373,12 @@ In specific instances of Proof General, the macro @code{defpgdefault}
can be used to give a default value for a generic setting.

@c TEXI DOCSTRING MAGIC: defpgdefault
@deffn Macro defpgdefault
@deffn Macro defpgdefault sym value
Set default for the proof assistant specific variable <PA>@var{-sym} to @var{value}.@*
This should be used in prover-specific code to alter the default values
for prover specific settings.

Usage: (defpgdefault SYM @var{value})
Usage: (defpgdefault @var{sym} @var{value})
@end deffn

All new instantiation variables are best declared using the
Expand All @@ -3392,18 +3392,18 @@ To access the generic settings, the following four functions and
macros are useful.

@c TEXI DOCSTRING MAGIC: proof-ass
@deffn Macro proof-ass
Return the value for SYM for the current prover.@*
@deffn Macro proof-ass sym
Return the value for @var{sym} for the current prover.@*
This macro should only be invoked once a specific prover is engaged.
@end deffn
@c TEXI DOCSTRING MAGIC: proof-ass-sym
@deffn Macro proof-ass-sym
Return the symbol for SYM for the current prover. SYM not evaluated.@*
@deffn Macro proof-ass-sym sym
Return the symbol for @var{sym} for the current prover. @var{sym} not evaluated.@*
This macro should only be called once a specific prover is known.
@end deffn
@c TEXI DOCSTRING MAGIC: proof-ass-symv
@deffn Macro proof-ass-symv
Return the symbol for SYM for the current prover. SYM evaluated.@*
@deffn Macro proof-ass-symv sym
Return the symbol for @var{sym} for the current prover. @var{sym} evaluated.@*
This macro should only be invoked once a specific prover is engaged.
@end deffn

Expand Down Expand Up @@ -3450,8 +3450,8 @@ approximation we test whether proof-config is fully-loaded yet.
@end defun

@c TEXI DOCSTRING MAGIC: proof-deftoggle
@deffn Macro proof-deftoggle
Define a function VAR-toggle for toggling a boolean customize setting VAR.@*
@deffn Macro proof-deftoggle var &optional othername
Define a function VAR-toggle for toggling a boolean customize setting @var{var}.@*
The toggle function uses @samp{@code{customize-set-variable}} to change the variable.
@var{othername} gives an alternative name than the default <VAR>-toggle.
The name of the defined function is returned.
Expand Down
18 changes: 5 additions & 13 deletions lib/texi-docstring-magic.el
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,6 @@ Compatibility between FSF Emacs and XEmacs."
(or (facep face)
(and (fboundp 'find-face) (find-face face))))

(defun texi-docstring-magic-splice-sep (strings sep)
"Return concatenation of STRINGS spliced together with separator SEP."
(let (str)
(while strings
(setq str (concat str (car strings)))
(if (cdr strings)
(setq str (concat str sep)))
(setq strings (cdr strings)))
str))

(defvar texi-docstring--args)
(defvar texi-docstring--in-quoted-region)

Expand Down Expand Up @@ -269,7 +259,7 @@ including any whitespace included to delimit matches.")
"Make a texi def environment ENV for entity NAME with DOCSTRING."
(concat "@def" env (if grp (concat " " grp) "") " " name
" "
(texi-docstring-magic-splice-sep args " ")
(mapconcat #'identity args " ")
;; " "
;; (texi-docstring-magic-splice-sep extras " ")
"\n"
Expand Down Expand Up @@ -301,7 +291,7 @@ Markup as @code{stuff} or @lisp stuff @end Lisp."
(let*
((face symbol)
(name (symbol-name face))
(docstring (or (face-doc-string face)
(docstring (or (face-documentation face)
"Not documented."))
(useropt (eq ?* (string-to-char docstring))))
;; Chop off user option setting
Expand Down Expand Up @@ -334,7 +324,9 @@ Markup as @code{stuff} or @lisp stuff @end Lisp."
(name (symbol-name function))
(docstring (or (documentation function)
"Not documented."))
(def (symbol-function function))
(def (indirect-function function))
(def (if (not (autoloadp def)) def
(autoload-do-load def function)))
(macrop (eq 'macro (car-safe def)))
(argsyms (help-function-arglist def 'preserve-names))
(args (mapcar #'symbol-name argsyms)))
Expand Down

0 comments on commit f620526

Please sign in to comment.