Function: rst-straighten-sections
rst-straighten-sections is an interactive and byte-compiled function
defined in rst.el.gz.
Signature
(rst-straighten-sections)
Documentation
Redo the adornments of all section titles in the current buffer.
This is done using the preferred set of adornments. This can be used, for example, when using somebody else's copy of a document, in order to adapt it to our preferred style.
Key Bindings
Aliases
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/rst.el.gz
;; FIXME: Should accept an argument giving the hierarchy level to start with
;; instead of the top of the hierarchy.
(defun rst-straighten-sections ()
;; testcover: ok.
"Redo the adornments of all section titles in the current buffer.
This is done using the preferred set of adornments. This can be
used, for example, when using somebody else's copy of a document,
in order to adapt it to our preferred style."
(interactive)
(rst-reset-section-caches)
(save-excursion
(rst-destructuring-dolist
((marker &rest level)
(mapcar
(cl-function
(lambda ((ttl &rest level))
;; Use markers so edits don't disturb the position.
(cons (copy-marker (rst-Ttl-get-title-beginning ttl)) level)))
(rst-all-ttls-with-level)))
(set-marker
(goto-char marker) nil)
(rst-update-section (nth level (rst-Hdr-preferred-adornments))))))