Code Monkey home page Code Monkey logo

copy-as-format's Issues

Add a Reddit option

Reddit confuses people a lot, because its current default front-end supports code formatting options which are not supported by the old front-end (and reddit has shown no interest in fixing this long-standing problem). Consequently people using the default front-end have no idea that the code they paste is liable to look incredibly broken for many of their readers, unless someone points it out to them.

The single formatting technique which is compatible between the old and the new is to indent everything by 4 spaces. If copy-as-format had a reddit option which did that, that would help to reduce the number of broken posts seen at https://old.reddit.com/r/emacs

better api for programmatic use

right now the only api is the copy-as-format function which inspects the prefix argument and relies on the region being active.

it would be nice to have a public function that would take two positions (begin and end) and a format argument (string, t to prompt for format, nil for default format) that would copy the text in between those two positions using the specified format.

something like this:

(defun copy-as-format-positions (beg end &optional format)
  ...)

this would allow for better use in custom commands, and also for better integration with evil-mode, which has its own concepts to define various regions (e.g. with text objects).

even better, there should be an option to not copy but only return the formatted text, which would mean it can be used in other functions.

what do you think about this? i could come up with a pr if you agree this makes sense to have.

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.