1 The following is a list of ideas of functionality which would be nice
2 to have in `rst.el`. In the examples a ``@`` stands for the cursor.
7 * Convert the region to an HTML id
9 * For instance "Eine Überschrift" to "eine-berschrift"
11 * According the same rules as reST does this
13 Jump to internal target
14 =======================
16 * A command to jump to the internal target the point is on
22 * Footnotes / citations
24 * Inline internal targets
26 * Hyperlink target definition
28 * Substitution definition
30 * See hunk #26 in `rst_el-emacs_V23_1_patch1_1_2` vs. `emacs_V23_1`
33 Completion for directive options
34 ================================
41 with the cursor at the asterisk
43 * There should be a command which offers all the possible options for
44 this particular directive as completion
46 * May be `skeleton.el` can also be useful
48 Completion for directives
49 =========================
55 * There should be a command which offers all directives as completion
57 * May be this should work for other keywords as well
59 * May be this could work even at the beginning of the line
61 * Completion must be bound to M-TAB
63 * Already existing binding must be chained
65 * May be `expand.el` can help (look in package finder)?
67 * May be `hippie` is good here
69 * Check `(info)autotype`
71 Completion for user-defined elements
72 ====================================
86 * There should be a command which offers all defined substitutions /
87 footnotes / links as completion
89 Insertion of link alias
90 =======================
97 This is about the `aspect of something`_@
99 * There should be a command which asks you for an alias for the link,
100 add the alias and change the link ::
102 .. _aspects of something:
107 This is about the `aspects of something`_@
109 Smart use of `iimage-mode`
110 ==========================
112 * There is `iimage-mode` which shows ``.. image::``\s in Emacs
114 * May be we can add a binding to toggle it
119 * If the TOC is displayed in the speedbar this could be used for
122 * Probably `imenu` functionality can be used for this
124 * See `imenu` documentation and `speedbar-use-imenu-flag`
128 toc-mode without markup
129 =======================
131 * The markup which may be contained in a section title is not useful
132 in toc-mode and should be suppressed
134 Sophisticated navigation in sections
135 ====================================
137 * Navigation in sections similar to navigation in other structured data
145 * C-M-f / C-M-b für Forward / Backward
147 Display of current location
148 ===========================
150 * Display the "section path" to the current point
152 * Like in XML: In which element is the point?
154 toc-mode only to a certain level
155 ================================
157 * If a TOC buffer is created a prefix argument should limit the depth
158 of the listing to the given level
160 Imenu support or similar
161 ========================
163 * Imenu could be supported
167 * `etags` could be supported
169 * See `(emacs)Tags` and `etags.el`
171 * May be this can be used for generating HTML local tags somehow?
173 * As requested by `Convert to id`_
175 * Could use `complete-tag`
180 * Support for `outline-mode` / `allout-mode` would be nice
182 * Should consider section titles
184 * May be item lists can also be included
186 * Using `allout-mode` is difficult
188 * It's not customizable enough for the complex syntax of
191 * However, some commands make sense
197 * Some alteration commands
199 * Should be reimplemented
201 * Key bindings need to be reused
203 * However, care must be taken if a file uses `allout-mode` for
204 instance by comment strings
206 * In this case key bindings must not be overridden
208 * A command adding / updating `allout-mode` tags could be a solution
210 Sophisticated filling
211 =====================
213 * These things must be filled special:
219 * VeryLongWordSuchAsAnURLVeryLongWordSuchAsAnURLVeryLongWordSuchAsAnURLVeryLongWordSuchAsAnURLVeryLongWordSuchAsAnURL
221 should work as expected by *not* breaking the line
223 * May be `fill-nobreak-predicate` can help here
225 * These things may not be filled at all
233 * May be `fill-nobreak-predicate` can help here, too
235 * May be defining an own `auto-fill-function` may be useful
237 * Might prevent auto-filling of literal text
239 * Filling of a re-indented item doesn't work as expected::
241 * Something just indented once more by the user
242 though continuation line is not indented already
244 * Alternatively indentation could indent the whole item
246 * See `Sophisticated indentation`_
248 * See also `Filling of section headers`_
250 Sophisticated indentation
251 =========================
253 * It should be generally possible to shift one more to the right
255 * This makes indentation for quotes possible
257 * But not for literal blocks
259 * For item lists the best tab should be on the same level as the last
266 * The second best tab should be where text starts::
272 * <backtab> should be used to indent in the other direction
274 * Or may be C-u <tab> but this has a different meaning
276 * <tab> could obsolete C-c C-r <tab>
278 * For this the indentation needs to be determined at the start
281 * <tab> over list works::
290 * <tab> over list doesn't work::
299 * An indenting tab on the head of a list item should indent the whole
300 list item instead of only the first line
302 * Alternatively `fill-paragraph` could do so
304 * See `Sophisticated filling`_
306 * May be `refill-mode` can be useful
311 * A command would be nice which
313 * transforms the first level of a nested list in a region into a
316 * removes one level of indentation from the rest of the list
318 Change section level by more than one step
319 ==========================================
321 * It would be nice if <C-h> `rst-adjust` could rotate a section
322 adornment more than one level
324 * A modification of the semantic of the prefix arguments could do this
326 * Non-zero numeric prefix arg n rotates n step in the given direction
328 * Prefix arg 0 toggles overline / underline
330 * This would be different from current setup
332 Compiling for syntax check
333 ==========================
335 * Compiling with results going to `/dev/null` would be useful
337 * This would just do a syntax check with no files lying around
339 * Toolset choice for <C-c C-c C-c> `rst-compile` must be by
340 customizable if at all necessary
342 * Customization group must be used
344 Renumber an exisiting enumeration
345 =================================
347 * Renumbering an exisiting enumeration is not possible yet
349 Command to move across blocks
350 =============================
352 * A command moving forward / backward across the content blocks of the
353 current block would be nice
355 * For instance: Move across all blocks contained in an item or field
357 * This would move to the start of the sibling of the current block
359 * Would allow to jump to the next item on the same level in a list
361 * <C-M-f> `forward-sexp` could be a nice binding
363 rst-toc-insert features
364 =======================
366 * The `contents::` options could be parsed to figure out how deep to
367 render the inserted TOC
369 * On load, detect any existing TOCs and set the properties for links
371 * TOC insertion should have an option to add empty lines
373 * TOC insertion should deal with multiple lines
375 * Automatically detect if we have a `section-numbering::` in the
376 corresponding section, to render the toc.
378 Automatic handling of `.txt` files
379 ==================================
381 It would be nice to differentiate between text files using
382 reStructuredText and other general text files. If we had a function to
383 automatically guess whether a `.txt` file is following the
384 reStructuredText conventions, we could trigger `rst-mode` without
385 having to hard-code this in every text file, nor forcing the user to
386 add a local mode variable at the top of the file. We could perform
387 this guessing by searching for a valid adornment at the top of the
388 document or searching for reStructuredText directives further on.
390 Entry level for rst-straighten-adornments
391 =========================================
393 * `rst-straighten-adornments` should have an entry level to start at a
394 lower than the top level
396 * I for one prefer a verbose style for top level titles which is not
397 appropriate for documents without titles
399 * Should be done by a prefix argument
404 * `ispell` may skip certain things
406 * Using `ispell-skip-region-alist`
408 * ``Code`` should be skipped
410 * Literal text after ``::`` should be skipped
412 * A customization should switch this on so users are not surprised
414 Marriage with `forms-mode`
415 ==========================
417 * Like I married `forms-mode` with `sdf-mode`
419 * Would allow editing a number of records with a fixed layout
421 * The base reStructuredText file should be either
423 * a list consisting of field lists
425 * The separator needs to be defined, however
427 * A section header or transition may be a useful separator
433 * That would call for a general support for CSV support for forms
435 * May be `orgtbl-to-csv` in `org/org-table.el` could be useful for
438 Marriage with `org-mode`
439 ========================
441 * May be Org mode can be utilized instead of `forms-mode`
445 * See `orgstruct-mode`
447 * Though this looks more like `allout-mode`
449 Intelligent quote insertion
450 ===========================
452 * Use or develop something like `insert-pair`
454 * Main use for forgotten quoting
456 * Thus may rather quote preceding word than following one
458 * If `forward-sexp` could be overridden `insert-pair` might me
461 * Also add something like `delete-pair`
463 Sophisticated alignment
464 =======================
466 * May be aligning can be used to get results like this
470 :Longer name: Aligned
472 :Even longer name: More aligned
479 * At the moment there can only be globally one TOC
481 * A TOC could be separate for each buffer
483 toc-mode could generate reST
484 ============================
486 * The format of the generated TOC could be reStructuredText
488 * For instance as a bullet list
490 * So it could be copied and basted into a reStructuredText document
492 * Conversion could be done in toc-mode buffer
494 * An alternative could be that `rst-bullet-list-region` handles
495 indented text properly
497 Improvements for comments
498 =========================
500 * `comment-use-syntax` should be set to nil locally
502 * `comment-forward` should work so `comment-dwim` recognizes a
505 * Then it could uncomment it automatically and use of prefix
506 argument is no longer neccessary
508 Context sensitive M-q
509 =====================
511 * M-q / `fill-paragraph` should check whether point is in section
512 header and call `rst-adjust` in this case
514 * This would unify handling of changes in section headers and normal
517 Switch to using `cl-lib`
518 ========================
520 * Options to use `cl-lib`
522 There are various options, and you'll have to judge for yourself which
523 is best for your particular case:
524 - live with the warnings.
525 - switch to cl-lib and ask users of older Emacsen to install cl-lib
526 (available in GNU ELPA).
527 - add things like (unless (fboundp 'cl-letf) (defalias 'cl-letf 'letf)).
528 - change the code to use something else (e.g. for flet, you can switch
529 to using either defadvice or (let ((f1 (lambda ..))) ...).
534 * Remove own implementations then
536 Filling of section headers
537 ==========================
539 * Filling should recognize section headers and adjust the adornment
541 * Then a fill operation for a region wouldn't break the section
544 * In addition a fill operation could be used instead of adjusting a
547 Cursor after adjusting adornment
548 ================================
550 * Adjusting a section header should move the cursor to the end of the
553 * Then a following C-j / Return opens a new line instead of breaking
554 the adornment just created
556 Copying literal blocks
557 ======================
559 * Copying literal blocks should eat up the block indentation
561 * This way code fragments can be copied without removing the block
564 Structural operations for toc-mode
565 ==================================
567 * Structrual operations for toc-mode
569 * Raise or lower sections
571 * Move sections around
573 Inhibit auto-fill in literal blocks
574 ===================================
576 * In a literal block a space should not do auto-fill
578 * May be variable `normal-auto-fill-function` can be set mode
581 * Is normally `do-auto-fill`
583 toc-mode should leave mark
584 ==========================
586 * When you jump to a different point in the document by using toc-mode
587 the mark should be set at the point of departure
589 * This aligns with the semantic of other far jumps in the document
590 such as `beginning-of-buffer`
592 Remembering last location per section
593 =====================================
595 * Remembering the last location per section would make it possible to
596 jump back to this location
598 * This is useful if several sections are worked on in parallel
600 * The jump into the section could happen from toc-mode
602 * Instead of to the section header
604 * May be by a special key
606 * Other section based jump commands could do similar
608 * For instance navigating by sections
610 * This calls for a general modifier for jumps
612 Multiple steps for `rst-adjust`
613 ===============================
615 * Sometimes it's useful to adjust more than one step in the given
618 * For instance to follow a 2= title by 1= normal header skipping the
621 * Therefore using a counter may be useful
623 Enhance compilation support
624 ===========================
626 * Compilation to ODT should be supported
628 * Arbitrary compilations should be supported using customization
630 * Key must be configurable
632 * Command must be configurable
634 * May be the whole toolset stuff needs to be replaced?
636 Support for longlines mode
637 ==========================
639 * `longlines-mode` should use correct indentation for broken lines
641 * This is actually an enhancement of `longlines-mode`
643 * `longlines-mode` modifies the buffer
645 * This is needed to use all the standard functionality like
648 * Using property `display` for inserting indentation does not work
649 properly because of this
651 * Indentation must be inserted in the buffer
653 * However, it needs to have the property `intangible` so it can
656 * See `Emacs Lisp => 32.19 Text Properties => Special
659 * It would be nice to also have a visible indication for being
662 * Such indentation must be removed by `longlines-encode-*`
664 * Probably it should be marked by a special property such as
665 `longlines-indentation`
667 * `longlines-wrap-line` needs a hook called after replacing the
668 blank by a soft newline
670 * May be `longlines-*search-*` needs to be adapted as well?