abo-abo / lispy

Short and sweet LISP editing
http://oremacs.com/lispy/
1.21k stars 133 forks source link

Some strange behaviours of `lispy-comment` #302

Open Yevgnen opened 8 years ago

Yevgnen commented 8 years ago

Hi,

I find that lispy-comment behaves strange in some situations.

  1. Got an inline comment in a setq:

1 but need to press space before lispy-comment to get an inline comment in a let: 2 6

  1. Cannot comment out a line that has already got a single semicolon comment in a setq: 3
  2. Can this be avoided ? 5

My question is they designed to act like these ? Thanks !

Minimum test settings are

(require 'package)

(setq package-archives '(("marmalade" . "http://marmalade-repo.org/packages/")
                         ("gnu" . "http://elpa.gnu.org/packages/")
                         ("melpa" . "https://melpa.org/packages/")
                         ("org" . "http://orgmode.org/elpa/")))

(package-initialize)

(unless (and (file-exists-p (expand-file-name "elpa/archives/marmalade" user-emacs-directory))
             (file-exists-p (expand-file-name "elpa/archives/gnu" user-emacs-directory))
             (file-exists-p (expand-file-name "elpa/archives/melpa" user-emacs-directory))
             (file-exists-p (expand-file-name "elpa/archives/org" user-emacs-directory)))
  (package-refresh-contents))

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

(setq use-package-verbose t)
(require 'use-package)

(use-package lispy
  :ensure t
  :config (add-hook 'emacs-lisp-mode-hook #'lispy-mode))
abo-abo commented 8 years ago

My question is they designed to act like these ? Thanks !

The style of comments that I prefer matches "^ *;; ". The other type of comments make the code look inconsistent, in my opinion. I'm not crazy about multiple variables in setq either, those are harder to debug and manipulate.

But there's a setting that might be useful for you: lispy-comment-use-single-semicolon.