Function: org-texinfo--massage-key-item
org-texinfo--massage-key-item is a byte-compiled function defined in
ox-texinfo.el.gz.
Signature
(org-texinfo--massage-key-item PLAIN-LIST ITEM ARGS INFO)
Documentation
In PLAIN-LIST modify ITEM based on ARGS.
Reformat ITEM's tag property and determine the arguments for the
@findex and @kindex commands for ITEM and store them in ITEM
using the :findex and :kindex properties.
If PLAIN-LIST is a description list whose :compact attribute is
non-nil and ITEM has no content but is followed by another item,
then store the @findex and @kindex values in the next item.
If the previous item stored its respective values in this item,
then move them to the next item.
INFO is a plist used as a communication channel.
Source Code
;; Defined in /usr/src/emacs/lisp/org/ox-texinfo.el.gz
(defun org-texinfo--massage-key-item (plain-list item args info)
"In PLAIN-LIST modify ITEM based on ARGS.
Reformat ITEM's tag property and determine the arguments for the
`@findex' and `@kindex' commands for ITEM and store them in ITEM
using the `:findex' and `:kindex' properties.
If PLAIN-LIST is a description list whose `:compact' attribute is
non-nil and ITEM has no content but is followed by another item,
then store the `@findex' and `@kindex' values in the next item.
If the previous item stored its respective values in this item,
then move them to the next item.
INFO is a plist used as a communication channel."
(let ((key nil)
(cmd nil))
(if (string-match (rx (+ " ")
"(" (group (+ (not (any "()")))) ")"
(* " ")
eos)
args)
(setq key (substring args 0 (match-beginning 0))
cmd (match-string 1 args))
(setq key args))
(org-element-put-property
item :tag
(cons (org-export-raw-string (org-texinfo-kbd-macro key t))
(and cmd `(" (" (code (:value ,cmd :post-blank 0)) ")"))))
(let ((findex (org-element-property :findex item))
(kindex (org-element-property :kindex item))
(next-item (org-export-get-next-element item nil))
(mx (string-prefix-p "M-x " key)))
(when (and (not cmd) mx)
(setq cmd (substring key 4)))
(when (and cmd (not (member cmd findex)))
(setq findex (nconc findex (list cmd))))
(unless mx
(setq kindex (nconc kindex (list key))))
(cond
((and next-item
(or (plist-get info :texinfo-compact-itemx)
(org-not-nil
(org-export-read-attribute :attr_texinfo plain-list :compact)))
(not (org-element-contents item))
(eq 1 (org-element-post-blank item)))
(org-element-put-property next-item :findex findex)
(org-element-put-property next-item :kindex kindex)
(org-element-put-property item :findex nil)
(org-element-put-property item :kindex nil))
(t
(org-element-set-contents
item
(nconc (mapcar (lambda (key) `(keyword (:key "KINDEX" :value ,key))) kindex)
(mapcar (lambda (cmd) `(keyword (:key "FINDEX" :value ,cmd))) findex)
(org-element-contents item))))))))