aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorJuanma Barranquero2014-03-16 04:47:31 +0100
committerJuanma Barranquero2014-03-16 04:47:31 +0100
commit57348c4d22dda72bf630fe02c679c6acdbe9c85d (patch)
tree0fe4b508c0e2c8180a03ea69f5a1a11ddc0a7a5e /lisp/textmodes
parent7ea9a62b8e563b5bbc5b8fa3d2fedab9f2a35030 (diff)
downloademacs-57348c4d22dda72bf630fe02c679c6acdbe9c85d.tar.gz
emacs-57348c4d22dda72bf630fe02c679c6acdbe9c85d.zip
lisp/textmodes/rst.el: Implement missing but documented functionality.
(rst-arabic-to-roman, rst-roman-to-arabic): Implement inserting into current buffer, documented in their docstrings. (rst-define-key, rst-compare-adornments, rst-insert-list-new-item) (rst-section-tree-point, rst-forward-section, rst-indent) (rst-compute-tabs, rst-font-lock-find-unindented-line-end) (rst-font-lock-find-unindented-line-limit, rst-adornment-level) (rst-font-lock-handle-adornment-pre-match-form) (rst-repeat-last-character): Reflow docstrings. (rst-preferred-adornments, rst-update-section, rst-find-title-line) (rst-adjust-adornment-work, rst-initial-items, rst-insert-list) (rst-toc-insert-style, rst-toc-insert-node, rst-goto-section) (rst-compile, rst-imenu-convert-cell, rst-imenu-create-index): Fix docstring typos. (rst-all-sections, rst-section-hierarchy, rst-adjust): Doc fixes. (rst-uncomment-region, rst-font-lock-find-unindented-line-match) (rst-font-lock-handle-adornment-matcher): Mark unused arguments.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/rst.el146
1 files changed, 69 insertions, 77 deletions
diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el
index 516431006f6..d4a3438ce97 100644
--- a/lisp/textmodes/rst.el
+++ b/lisp/textmodes/rst.el
@@ -608,8 +608,8 @@ After interpretation of ARGS the results are concatenated as for
608(defun rst-define-key (keymap key def &rest deprecated) 608(defun rst-define-key (keymap key def &rest deprecated)
609 "Bind like `define-key' but add deprecated key definitions. 609 "Bind like `define-key' but add deprecated key definitions.
610KEYMAP, KEY, and DEF are as in `define-key'. DEPRECATED key 610KEYMAP, KEY, and DEF are as in `define-key'. DEPRECATED key
611definitions should be in vector notation. These are defined as 611definitions should be in vector notation. These are defined
612well but give an additional message." 612as well but give an additional message."
613 (define-key keymap key def) 613 (define-key keymap key def)
614 (when deprecated 614 (when deprecated
615 (let* ((command-name (symbol-name def)) 615 (let* ((command-name (symbol-name def))
@@ -994,10 +994,10 @@ for modes derived from Text mode, like Mail mode."
994 994
995A list consisting of lists of the form (CHARACTER STYLE INDENT). 995A list consisting of lists of the form (CHARACTER STYLE INDENT).
996CHARACTER is the character used. STYLE is one of the symbols 996CHARACTER is the character used. STYLE is one of the symbols
997OVER-AND-UNDER or SIMPLE. INDENT is an integer giving the wanted 997`over-and-under' or `simple'. INDENT is an integer giving the
998indentation for STYLE OVER-AND-UNDER. CHARACTER and STYLE are 998wanted indentation for STYLE `over-and-under'. CHARACTER and
999always used when a section adornment is described. In other 999STYLE are always used when a section adornment is described.
1000places t instead of a list stands for a transition. 1000In other places, t instead of a list stands for a transition.
1001 1001
1002This sequence is consulted to offer a new adornment suggestion 1002This sequence is consulted to offer a new adornment suggestion
1003when we rotate the underlines at the end of the existing 1003when we rotate the underlines at the end of the existing
@@ -1034,8 +1034,8 @@ style."
1034(defun rst-compare-adornments (ado1 ado2) 1034(defun rst-compare-adornments (ado1 ado2)
1035 "Compare adornments. 1035 "Compare adornments.
1036Return true if both ADO1 and ADO2 adornments are equal, 1036Return true if both ADO1 and ADO2 adornments are equal,
1037according to restructured text semantics (only the character and 1037according to restructured text semantics (only the character
1038the style are compared, the indentation does not matter)." 1038and the style are compared, the indentation does not matter)."
1039 (and (eq (car ado1) (car ado2)) 1039 (and (eq (car ado1) (car ado2))
1040 (eq (cadr ado1) (cadr ado2)))) 1040 (eq (cadr ado1) (cadr ado2))))
1041 1041
@@ -1091,9 +1091,9 @@ better match."
1091(defun rst-update-section (char style &optional indent) 1091(defun rst-update-section (char style &optional indent)
1092 "Unconditionally update the style of a section adornment. 1092 "Unconditionally update the style of a section adornment.
1093 1093
1094Do this using the given character CHAR, with STYLE 'simple 1094Do this using the given character CHAR, with STYLE `simple'
1095or 'over-and-under, and with indent INDENT. If the STYLE 1095or `over-and-under', and with indent INDENT. If the STYLE
1096is 'simple, whitespace before the title is removed (indent 1096is `simple', whitespace before the title is removed (indent
1097is always assumed to be 0). 1097is always assumed to be 0).
1098 1098
1099If there are existing overline and/or underline from the 1099If there are existing overline and/or underline from the
@@ -1270,8 +1270,8 @@ point is on a suitable title line use it.
1270If no title line is found return nil. 1270If no title line is found return nil.
1271 1271
1272Otherwise return as `rst-classify-adornment' does. However, if 1272Otherwise return as `rst-classify-adornment' does. However, if
1273the title line has no syntactically valid adornment STYLE is nil 1273the title line has no syntactically valid adornment, STYLE is nil
1274in the first element. If there is no adornment around the title 1274in the first element. If there is no adornment around the title,
1275CHARACTER is also nil and match groups for overline and underline 1275CHARACTER is also nil and match groups for overline and underline
1276are nil." 1276are nil."
1277 (save-excursion 1277 (save-excursion
@@ -1325,15 +1325,15 @@ are nil."
1325 1325
1326(defvar rst-all-sections nil 1326(defvar rst-all-sections nil
1327 "All section adornments in the buffer as found by `rst-find-all-adornments'. 1327 "All section adornments in the buffer as found by `rst-find-all-adornments'.
1328t when no section adornments were found.") 1328Set to t when no section adornments were found.")
1329(make-variable-buffer-local 'rst-all-sections) 1329(make-variable-buffer-local 'rst-all-sections)
1330 1330
1331;; FIXME: If this variable is set to a different value font-locking of section 1331;; FIXME: If this variable is set to a different value font-locking of section
1332;; headers is wrong. 1332;; headers is wrong.
1333(defvar rst-section-hierarchy nil 1333(defvar rst-section-hierarchy nil
1334 "Section hierarchy in the buffer as determined by `rst-get-hierarchy'. 1334 "Section hierarchy in the buffer as determined by `rst-get-hierarchy'.
1335t when no section adornments were found. Value depends on 1335Set to t when no section adornments were found.
1336`rst-all-sections'.") 1336Value depends on `rst-all-sections'.")
1337(make-variable-buffer-local 'rst-section-hierarchy) 1337(make-variable-buffer-local 'rst-section-hierarchy)
1338 1338
1339(rst-testcover-add-1value 'rst-reset-section-caches) 1339(rst-testcover-add-1value 'rst-reset-section-caches)
@@ -1502,8 +1502,8 @@ REVERSE-DIRECTION is used to reverse the cycling order."
1502 1502
1503Adjust/rotate the section adornment for the section title around 1503Adjust/rotate the section adornment for the section title around
1504point or promote/demote the adornments inside the region, 1504point or promote/demote the adornments inside the region,
1505depending on if the region is active. This function is meant to 1505depending on whether the region is active. This function is meant
1506be invoked possibly multiple times, and can vary its behavior 1506to be invoked possibly multiple times, and can vary its behavior
1507with a positive PFXARG (toggle style), or with a negative 1507with a positive PFXARG (toggle style), or with a negative
1508PFXARG (alternate behavior). 1508PFXARG (alternate behavior).
1509 1509
@@ -1609,7 +1609,7 @@ The adornments consist in
1609 1609
16101. a CHARACTER 16101. a CHARACTER
1611 1611
16122. a STYLE which can be either of 'simple' or 'over-and-under'. 16122. a STYLE which can be either `simple' or `over-and-under'.
1613 1613
16143. an INDENT (meaningful for the over-and-under style only) 16143. an INDENT (meaningful for the over-and-under style only)
1615 which determines how many characters and over-and-under 1615 which determines how many characters and over-and-under
@@ -1652,8 +1652,8 @@ Case 2: Incomplete Adornment
1652 1652
1653If the current line does have an existing adornment, but the 1653If the current line does have an existing adornment, but the
1654adornment is incomplete, that is, the underline/overline does 1654adornment is incomplete, that is, the underline/overline does
1655not extend to exactly the end of the title line (it is either too 1655not extend to exactly the end of the title line (it is either
1656short or too long), we simply extend the length of the 1656too short or too long), we simply extend the length of the
1657underlines/overlines to fit exactly the section title. 1657underlines/overlines to fit exactly the section title.
1658 1658
1659If TOGGLE-STYLE we toggle the style of the adornment as well. 1659If TOGGLE-STYLE we toggle the style of the adornment as well.
@@ -1922,7 +1922,7 @@ in order to adapt it to our preferred style."
1922Obviously, NUM must be greater than zero. Don't blame me, blame the 1922Obviously, NUM must be greater than zero. Don't blame me, blame the
1923Romans, I mean \"what have the Romans ever _done_ for /us/?\" (with 1923Romans, I mean \"what have the Romans ever _done_ for /us/?\" (with
1924apologies to Monty Python). 1924apologies to Monty Python).
1925If optional prefix ARG is non-nil, insert in current buffer." 1925If optional ARG is non-nil, insert in current buffer."
1926 (let ((map rst-arabic-to-roman) 1926 (let ((map rst-arabic-to-roman)
1927 res) 1927 res)
1928 (while (and map (> num 0)) 1928 (while (and map (> num 0))
@@ -1931,13 +1931,13 @@ If optional prefix ARG is non-nil, insert in current buffer."
1931 (setq res (concat res (cdar map)) 1931 (setq res (concat res (cdar map))
1932 num (- num (caar map))) 1932 num (- num (caar map)))
1933 (setq map (cdr map)))) 1933 (setq map (cdr map))))
1934 res)) 1934 (if arg (insert (or res "")) res)))
1935 1935
1936(defun rst-roman-to-arabic (string &optional arg) 1936(defun rst-roman-to-arabic (string &optional arg)
1937 "Convert STRING of Roman numerals to an Arabic number. 1937 "Convert STRING of Roman numerals to an Arabic number.
1938 1938
1939If STRING contains a letter which isn't a valid Roman numeral, the rest 1939If STRING contains a letter which isn't a valid Roman numeral,
1940of the string from that point onwards is ignored. 1940the rest of the string from that point onwards is ignored.
1941 1941
1942Hence: 1942Hence:
1943MMD == 2500 1943MMD == 2500
@@ -1951,7 +1951,7 @@ If optional ARG is non-nil, insert in current buffer."
1951 (setq res (+ res (caar map)) 1951 (setq res (+ res (caar map))
1952 string (replace-match "" nil t string)) 1952 string (replace-match "" nil t string))
1953 (setq map (cdr map)))) 1953 (setq map (cdr map))))
1954 res)) 1954 (if arg (insert res) res)))
1955;================================================= 1955;=================================================
1956 1956
1957(defun rst-find-pfx-in-region (beg end pfx-re) 1957(defun rst-find-pfx-in-region (beg end pfx-re)
@@ -2020,20 +2020,20 @@ Other situations are just ignored and left to users themselves."
2020;; FIXME: Isn't this a `defconst'? 2020;; FIXME: Isn't this a `defconst'?
2021(defvar rst-initial-items 2021(defvar rst-initial-items
2022 (append (mapcar 'char-to-string rst-bullets) rst-initial-enums) 2022 (append (mapcar 'char-to-string rst-bullets) rst-initial-enums)
2023 "List of initial items. It's collection of bullets and enumerations.") 2023 "List of initial items. It's a collection of bullets and enumerations.")
2024 2024
2025(defun rst-insert-list-new-item () 2025(defun rst-insert-list-new-item ()
2026 "Insert a new list item. 2026 "Insert a new list item.
2027 2027
2028User is asked to select the item style first, for example (a), i), +. Use TAB 2028User is asked to select the item style first, for example (a), i), +.
2029for completion and choices. 2029Use TAB for completion and choices.
2030 2030
2031If user selects bullets or #, it's just added with position arranged by 2031If user selects bullets or #, it's just added with position arranged by
2032`rst-insert-list-pos'. 2032`rst-insert-list-pos'.
2033 2033
2034If user selects enumerations, a further prompt is given. User need to input a 2034If user selects enumerations, a further prompt is given. User need to
2035starting item, for example 'e' for 'A)' style. The position is also arranged by 2035input a starting item, for example 'e' for 'A)' style. The position is
2036`rst-insert-list-pos'." 2036also arranged by `rst-insert-list-pos'."
2037 (interactive) 2037 (interactive)
2038 ;; FIXME: Make this comply to `interactive' standards. 2038 ;; FIXME: Make this comply to `interactive' standards.
2039 (let* ((itemstyle (completing-read 2039 (let* ((itemstyle (completing-read
@@ -2140,7 +2140,7 @@ for completion and choices.
2140The position of the new list is arranged according to whether or not the 2140The position of the new list is arranged according to whether or not the
2141current line and the previous line are blank lines. 2141current line and the previous line are blank lines.
2142 2142
21432. When continuing a list, one thing need to be noticed: 21432. When continuing a list, one thing needs to be noticed:
2144 2144
2145List style alphabetical list, such as 'a.', and roman numerical list, such as 2145List style alphabetical list, such as 'a.', and roman numerical list, such as
2146'i.', have some overlapping items, for example 'v.' The function can deal with 2146'i.', have some overlapping items, for example 'v.' The function can deal with
@@ -2271,13 +2271,11 @@ without UNPROCESSED."
2271 "Return section containing POINT by returning the closest node in TREE. 2271 "Return section containing POINT by returning the closest node in TREE.
2272TREE is a section tree as returned by `rst-section-tree' 2272TREE is a section tree as returned by `rst-section-tree'
2273consisting of (NODE CHILD...) entries. POINT defaults to the 2273consisting of (NODE CHILD...) entries. POINT defaults to the
2274current point. A NODE must have the structure (IGNORED MARKER 2274current point. A NODE must have the structure (IGNORED MARKER...).
2275...).
2276 2275
2277Return (PATH NODE CHILD...). NODE is the node where POINT is in 2276Return (PATH NODE CHILD...). NODE is the node where POINT is in
2278if any. PATH is a list of nodes from the top of the tree down to 2277if any. PATH is a list of nodes from the top of the tree down to
2279and including NODE. List of CHILD are the children of NODE if 2278and including NODE. List of CHILD are the children of NODE if any."
2280any."
2281 (setq point (or point (point))) 2279 (setq point (or point (point)))
2282 (let ((cur (car tree)) 2280 (let ((cur (car tree))
2283 (children (cdr tree))) 2281 (children (cdr tree)))
@@ -2318,10 +2316,10 @@ Also used for formatting insertion, when numbering is disabled."
2318 "Insertion style for table-of-contents. 2316 "Insertion style for table-of-contents.
2319Set this to one of the following values to determine numbering and 2317Set this to one of the following values to determine numbering and
2320indentation style: 2318indentation style:
2321- plain: no numbering (fixed indentation) 2319- `plain': no numbering (fixed indentation)
2322- fixed: numbering, but fixed indentation 2320- `fixed': numbering, but fixed indentation
2323- aligned: numbering, titles aligned under each other 2321- `aligned': numbering, titles aligned under each other
2324- listed: numbering, with dashes like list items (EXPERIMENTAL)" 2322- `listed': numbering, with dashes like list items (EXPERIMENTAL)"
2325 :type '(choice (const plain) 2323 :type '(choice (const plain)
2326 (const fixed) 2324 (const fixed)
2327 (const aligned) 2325 (const aligned)
@@ -2384,7 +2382,7 @@ The TOC is inserted indented at the current column."
2384 2382
2385(defun rst-toc-insert-node (node level indent pfx) 2383(defun rst-toc-insert-node (node level indent pfx)
2386 "Insert tree node NODE in table-of-contents. 2384 "Insert tree node NODE in table-of-contents.
2387Recursive function that does printing of the inserted toc. 2385Recursive function that does printing of the inserted TOC.
2388LEVEL is the depth level of the sections in the tree. 2386LEVEL is the depth level of the sections in the tree.
2389INDENT is the indentation string. PFX is the prefix numbering, 2387INDENT is the indentation string. PFX is the prefix numbering,
2390that includes the alignment necessary for all the children of 2388that includes the alignment necessary for all the children of
@@ -2611,7 +2609,7 @@ brings the cursor in that section."
2611;; paragraph. 2609;; paragraph.
2612(defun rst-goto-section (&optional kill) 2610(defun rst-goto-section (&optional kill)
2613 "Go to the section the current line describes. 2611 "Go to the section the current line describes.
2614If KILL a toc buffer is destroyed." 2612If KILL a TOC buffer is destroyed."
2615 (interactive) 2613 (interactive)
2616 (let ((pos (rst-toc-mode-find-section))) 2614 (let ((pos (rst-toc-mode-find-section)))
2617 (when kill 2615 (when kill
@@ -2682,8 +2680,8 @@ EVENT is the input event."
2682 2680
2683(defun rst-forward-section (&optional offset) 2681(defun rst-forward-section (&optional offset)
2684 "Skip to the next reStructuredText section title. 2682 "Skip to the next reStructuredText section title.
2685OFFSET specifies how many titles to skip. Use a negative OFFSET to move 2683OFFSET specifies how many titles to skip. Use a negative OFFSET
2686backwards in the file (default is to use 1)." 2684to move backwards in the file (default is to use 1)."
2687 (interactive) 2685 (interactive)
2688 (rst-reset-section-caches) 2686 (rst-reset-section-caches)
2689 (let* (;; Default value for offset. 2687 (let* (;; Default value for offset.
@@ -2848,10 +2846,9 @@ first of a paragraph."
2848(defgroup rst-indent nil "Settings for indentation in reStructuredText. 2846(defgroup rst-indent nil "Settings for indentation in reStructuredText.
2849 2847
2850In reStructuredText indentation points are usually determined by 2848In reStructuredText indentation points are usually determined by
2851preceding lines. Sometimes the syntax allows arbitrary 2849preceding lines. Sometimes the syntax allows arbitrary indentation
2852indentation points such as where to start the first line 2850points such as where to start the first line following a directive.
2853following a directive. These indentation widths can be customized 2851These indentation widths can be customized here."
2854here."
2855 :group 'rst 2852 :group 'rst
2856 :package-version '(rst . "1.1.0")) 2853 :package-version '(rst . "1.1.0"))
2857 2854
@@ -2957,11 +2954,11 @@ and not from inner alignment points."
2957 2954
2958(defun rst-compute-tabs (pt) 2955(defun rst-compute-tabs (pt)
2959 "Build the list of possible tabs for all lines above. 2956 "Build the list of possible tabs for all lines above.
2960Search backwards from point PT to build the list of possible 2957Search backwards from point PT to build the list of possible tabs.
2961tabs. Return a list of tabs sorted by likeliness to continue 2958Return a list of tabs sorted by likeliness to continue writing
2962writing like `rst-line-tabs'. Nearer lines have generally a 2959like `rst-line-tabs'. Nearer lines have generally a higher
2963higher likeliness than farther lines. Return nil if no tab is found 2960likeliness than farther lines. Return nil if no tab is found in
2964in the text above." 2961the text above."
2965 (save-excursion 2962 (save-excursion
2966 (goto-char pt) 2963 (goto-char pt)
2967 (let (leftmost ; Leftmost column found so far. 2964 (let (leftmost ; Leftmost column found so far.
@@ -3136,7 +3133,7 @@ Region is from from BEG to END. Uncomment if ARG."
3136 (indent-line-to ind) 3133 (indent-line-to ind)
3137 (insert (comment-string-strip comment-start t t)))))) 3134 (insert (comment-string-strip comment-start t t))))))
3138 3135
3139(defun rst-uncomment-region (beg end &optional arg) 3136(defun rst-uncomment-region (beg end &optional _arg)
3140 "Uncomment the current region. 3137 "Uncomment the current region.
3141Region is from BEG to END. ARG is ignored" 3138Region is from BEG to END. ARG is ignored"
3142 (save-excursion 3139 (save-excursion
@@ -3774,8 +3771,7 @@ point is not moved."
3774 3771
3775(defvar rst-font-lock-find-unindented-line-end nil 3772(defvar rst-font-lock-find-unindented-line-end nil
3776 "End of the match as determined by `rst-font-lock-find-unindented-line-limit'. 3773 "End of the match as determined by `rst-font-lock-find-unindented-line-limit'.
3777Also used as a trigger for 3774Also used as a trigger for `rst-font-lock-find-unindented-line-match'.")
3778`rst-font-lock-find-unindented-line-match'.")
3779 3775
3780(defun rst-font-lock-find-unindented-line-limit (ind-pnt) 3776(defun rst-font-lock-find-unindented-line-limit (ind-pnt)
3781 "Find the next unindented line relative to indentation at IND-PNT. 3777 "Find the next unindented line relative to indentation at IND-PNT.
@@ -3783,8 +3779,7 @@ Return this point, the end of the buffer or nil if nothing found.
3783If IND-PNT is `next' take the indentation from the next line if 3779If IND-PNT is `next' take the indentation from the next line if
3784this is not empty and indented more than the current one. If 3780this is not empty and indented more than the current one. If
3785IND-PNT is non-nil but not a number take the indentation from the 3781IND-PNT is non-nil but not a number take the indentation from the
3786next non-empty line if this is indented more than the current 3782next non-empty line if this is indented more than the current one."
3787one."
3788 (setq rst-font-lock-find-unindented-line-begin ind-pnt) 3783 (setq rst-font-lock-find-unindented-line-begin ind-pnt)
3789 (setq rst-font-lock-find-unindented-line-end 3784 (setq rst-font-lock-find-unindented-line-end
3790 (save-excursion 3785 (save-excursion
@@ -3824,12 +3819,11 @@ one."
3824 (or (rst-forward-indented-block nil (point-max)) 3819 (or (rst-forward-indented-block nil (point-max))
3825 (point-max)))))) 3820 (point-max))))))
3826 3821
3827(defun rst-font-lock-find-unindented-line-match (limit) 3822(defun rst-font-lock-find-unindented-line-match (_limit)
3828 "Set the match found earlier if match were found. 3823 "Set the match found earlier if match were found.
3829Match has been found by 3824Match has been found by `rst-font-lock-find-unindented-line-limit'
3830`rst-font-lock-find-unindented-line-limit' the first time called 3825the first time called or no match is found. Return non-nil if
3831or no match is found. Return non-nil if match was found. LIMIT 3826match was found. LIMIT is not used but mandated by the caller."
3832is not used but mandated by the caller."
3833 (when rst-font-lock-find-unindented-line-end 3827 (when rst-font-lock-find-unindented-line-end
3834 (set-match-data 3828 (set-match-data
3835 (list rst-font-lock-find-unindented-line-begin 3829 (list rst-font-lock-find-unindented-line-begin
@@ -3850,10 +3844,9 @@ Either section level of the current adornment or t for a transition.")
3850 3844
3851(defun rst-adornment-level (key) 3845(defun rst-adornment-level (key)
3852 "Return section level for adornment KEY. 3846 "Return section level for adornment KEY.
3853KEY is the first element of the return list of 3847KEY is the first element of the return list of `rst-classify-adornment'.
3854`rst-classify-adornment'. If KEY is not a cons return it. If KEY is found 3848If KEY is not a cons return it. If KEY is found in the hierarchy return
3855in the hierarchy return its level. Otherwise return a level one 3849its level. Otherwise return a level one beyond the existing hierarchy."
3856beyond the existing hierarchy."
3857 (if (not (consp key)) 3850 (if (not (consp key))
3858 key 3851 key
3859 (let* ((hier (rst-get-hierarchy)) 3852 (let* ((hier (rst-get-hierarchy))
@@ -3875,9 +3868,8 @@ as a trigger for `rst-font-lock-handle-adornment-matcher'.")
3875(defun rst-font-lock-handle-adornment-pre-match-form (ado ado-end) 3868(defun rst-font-lock-handle-adornment-pre-match-form (ado ado-end)
3876 "Determine limit for adornments. 3869 "Determine limit for adornments.
3877Determine all things necessary for font-locking section titles 3870Determine all things necessary for font-locking section titles
3878and transitions and put the result to 3871and transitions and put the result to `rst-font-lock-adornment-match'
3879`rst-font-lock-adornment-match' and 3872and `rst-font-lock-adornment-level'. ADO is the complete adornment
3880`rst-font-lock-adornment-level'. ADO is the complete adornment
3881matched. ADO-END is the point where ADO ends. Return the point 3873matched. ADO-END is the point where ADO ends. Return the point
3882where the whole adorned construct ends. 3874where the whole adorned construct ends.
3883 3875
@@ -3892,7 +3884,7 @@ Called as a PRE-MATCH-FORM in the sense of `font-lock-keywords'."
3892 (goto-char (nth 1 ado-data)) ; Beginning of construct. 3884 (goto-char (nth 1 ado-data)) ; Beginning of construct.
3893 (nth 2 ado-data)))) ; End of construct. 3885 (nth 2 ado-data)))) ; End of construct.
3894 3886
3895(defun rst-font-lock-handle-adornment-matcher (limit) 3887(defun rst-font-lock-handle-adornment-matcher (_limit)
3896 "Set the match found earlier if match were found. 3888 "Set the match found earlier if match were found.
3897Match has been found by 3889Match has been found by
3898`rst-font-lock-handle-adornment-pre-match-form' the first time 3890`rst-font-lock-handle-adornment-pre-match-form' the first time
@@ -3989,7 +3981,7 @@ string)) to be used for converting the document."
3989(defun rst-compile (&optional use-alt) 3981(defun rst-compile (&optional use-alt)
3990 "Compile command to convert reST document into some output file. 3982 "Compile command to convert reST document into some output file.
3991Attempts to find configuration file, if it can, overrides the 3983Attempts to find configuration file, if it can, overrides the
3992options. There are two commands to choose from, with USE-ALT, 3984options. There are two commands to choose from; with USE-ALT,
3993select the alternative tool-set." 3985select the alternative tool-set."
3994 (interactive "P") 3986 (interactive "P")
3995 ;; Note: maybe we want to check if there is a Makefile too and not do anything 3987 ;; Note: maybe we want to check if there is a Makefile too and not do anything
@@ -4094,7 +4086,7 @@ buffer, if the region is not selected."
4094 a)) 4086 a))
4095 4087
4096(defun rst-imenu-convert-cell (elt adornments) 4088(defun rst-imenu-convert-cell (elt adornments)
4097 "Convert a cell ELT in a tree returned from `rst-section-tree' to imenu index. 4089 "Convert a cell ELT in a tree returned from `rst-section-tree' to Imenu index.
4098ADORNMENTS is used as hint information for conversion." 4090ADORNMENTS is used as hint information for conversion."
4099 (let* ((kar (car elt)) 4091 (let* ((kar (car elt))
4100 (kdr (cdr elt)) 4092 (kdr (cdr elt))
@@ -4128,7 +4120,7 @@ ADORNMENTS is used as hint information for conversion."
4128;; FIXME: Document title and subtitle need to be handled properly. They should 4120;; FIXME: Document title and subtitle need to be handled properly. They should
4129;; get an own "Document" top level entry. 4121;; get an own "Document" top level entry.
4130(defun rst-imenu-create-index () 4122(defun rst-imenu-create-index ()
4131 "Create index for imenu. 4123 "Create index for Imenu.
4132Return as described for `imenu--index-alist'." 4124Return as described for `imenu--index-alist'."
4133 (rst-reset-section-caches) 4125 (rst-reset-section-caches)
4134 (let ((tree (rst-section-tree)) 4126 (let ((tree (rst-section-tree))
@@ -4190,8 +4182,8 @@ This is useful for filling list item paragraphs."
4190;; be useful for creating separators. 4182;; be useful for creating separators.
4191(defun rst-repeat-last-character (use-next) 4183(defun rst-repeat-last-character (use-next)
4192 "Fill the current line using the last character on the current line. 4184 "Fill the current line using the last character on the current line.
4193Fill up to the length of the preceding line or up to 4185Fill up to the length of the preceding line or up to `fill-column' if preceding
4194`fill-column' if preceding line is empty. 4186line is empty.
4195 4187
4196If USE-NEXT, use the next line rather than the preceding line. 4188If USE-NEXT, use the next line rather than the preceding line.
4197 4189