Coder Social home page Coder Social logo

poly-rst's Introduction

License GPL 3 MELPA

Polymode Logo

Polymode is a framework for multiple major modes (MMM) inside a single Emacs buffer. It is fast and has a simple but flexible object oriented design. Creating new polymodes normally takes a few lines of code.

Installation instructions and the full documentation are available at https://polymode.github.io/.

poly-rst's People

Contributors

petermosmans avatar vspinu avatar wyuenho avatar xaldew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

poly-rst's Issues

weird cursor behavior

Hi there,

It seems sometimes poly-rst introduces some unwanted cursor behavior.

Since it's a bit complicated to explain faithfully, here is a demo: https://asciinema.org/a/zbDx85g6BoQqvzbgMZDFjPqbX

There are two small issues (the links point to specific parts of the demo for easier understanding/comparison):

The issue.bash script used is as follow (be careful, the first line is destructive, the rest setups an Emacs configuration in /tmp/trash so feel free to execute):

rm -rf /tmp/trash && mkdir -p /tmp/trash

cat > /tmp/trash/config.el << EOF
(setq user-emacs-directory "/tmp/trash")

(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)

(use-package command-log-mode
  :straight (:host github :repo "lewang/command-log-mode")
  :hook ((rst-mode . command-log-mode))
  :config
  (setq command-log-mode-auto-show t
        command-log-mode-window-size 80
        clm/log-command-exceptions* '()))

EOF

cat > /tmp/trash/example.rst << EOF
.. code-block::
EOF

emacs -Q -l /tmp/trash/config.el /tmp/trash/example.rst

cat >> /tmp/trash/config.el << EOF
(use-package poly-rst
  :straight (:host github :repo "polymode/poly-rst"))
EOF

exec emacs -Q -l /tmp/trash/config.el /tmp/trash/example.rst

Hope it helps, polymode seems nice otherwise.

On a kinda unrelated note, is the 3 spaces indentation removed while using the Python major mode? I get some linter errors telling me there is too much spaces.

Regards.

Open new line after head moves point back to the beginning of head

Reproduction:

  1. visit a new buffer called ~/test.rst
  2. type .. code-block:: python
  3. RET
  4. See point now jumped back to the beginning of the head, instead of at the beginning of the new line.

Expectation:

poly-rst-mode should allow me to open a new line after the head without moving my point. It should treat the newline as part of the head because reStructuredText requires 3 newlines and an indentation to the column of the beginning of the directive (i.e. before the c of code-block) to go into code block parsing state.

In essence, in a restructured text file:

Lorum Ipsum

.. code-block: python

   print("hello")
   print("world")

Lorum Ipsum

I expect the string .. code-block: python\n\n\n to be the head, and poly-rst-mode should under no circumstances be interfering with how the host mode indents when I'm still typing the head.

Why is polymode overriding the host mode's indent-line-function and indent-region-function anyway?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.