Code Monkey home page Code Monkey logo

comment-or-uncomment-sexp's Introduction

comment-or-uncomment-sexp

Emacs-lisp command for inteligently commenting and commenting the sexp under point.

For more details and visual demonstration see my blog post about it.

To make it easier to use, consider binding it:

(global-set-key (kbd "C-M-;") #'comment-or-uncomment-sexp)

comment-or-uncomment-sexp's People

Contributors

dotemacs avatar malabarba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

comment-or-uncomment-sexp's Issues

Feature Request: Don't move point upon commenting

Hi! Thanks for the package. I've been using https://gist.github.com/dsedivec/ddbcc985f32d108afab86d86b8c02519 to do comment-or-uncomment sexp for a while but your package is on melpa! In ^, when commenting, the point doesn't move so you can uncomment/comment (toggle) one right after another. It'd be cool to have a user option to not move the point upon commenting.

I have something like this now but it'd be cool for the package to bake the functionality in, I think.

  (defun j|comment-or-uncomment-sexp (f &rest args)
    "Don't move point when toggling comments."
    (interactive)
    (save-excursion
      (comment-or-uncomment-sexp)))

Thanks!

Doesn't comment at start of letter sometimes?

For something like this:

class Trie(object):

    def __init__(self):
        self.val = ""
        self.arr = [None] * 26
        self.endOfWord = False

If point is at 'c' in 'class', calling comment-or-uncomment-sexp doesn't work. Moving the point one letter to the right to 'l' in 'class' comments the whole thing as expected. Point on 'd' in 'def' also works as expected.

If I try the snippet in https://gist.github.com/dsedivec/ddbcc985f32d108afab86d86b8c02519 it works in all cases.

Thanks!

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.