[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-nerd-commenter cf1f57921d 175/235: can comment html p
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-nerd-commenter cf1f57921d 175/235: can comment html paragraphs |
Date: |
Thu, 6 Jan 2022 02:59:46 -0500 (EST) |
branch: elpa/evil-nerd-commenter
commit cf1f57921dbf34bd6b42be0839b9645c20514401
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
can comment html paragraphs
---
README.org | 8 ++++++--
evil-nerd-commenter.el | 52 +++++++++++++++++++++++++++++++++++++-------------
pkg.sh | 2 +-
3 files changed, 46 insertions(+), 16 deletions(-)
diff --git a/README.org b/README.org
index fb5c1be217..09d7a57a07 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-* evil-nerd-commenter (v3.3.0)
+* evil-nerd-commenter (v3.3.1)
[[http://melpa.org/#/evil-nerd-commenter][file:http://melpa.org/packages/evil-nerd-commenter-badge.svg]]
[[http://stable.melpa.org/#/evil-nerd-commenter][file:http://stable.melpa.org/packages/evil-nerd-commenter-badge.svg]]
@@ -96,7 +96,7 @@ For example, say current line number is 497. =C-u 3 M-x
evilnc-quick-comment-or-
The hotkey is ",cl" or ",ll" in evil-mode and =C-c l= (C means Ctrl key) in
emacs normal mode.
*** evilnc-comment-or-uncomment-paragraphs
-comment/uncomment paragraphs which separated by empty lines
+comment/uncomment paragraphs which is separated by empty lines.
*** evilnc-copy-and-comment-lines
Copy and paste lines, then comment out original lines. This command supports
negative arguments.
@@ -122,6 +122,10 @@ If user manually selects region, the region could cross
multiple sibling tags an
JSX from ReactJS like ={/* ... */}= is the default comment syntax.
Customize =evilnc-html-comment-end= and =evilnc-html-comment-end= to use
different syntax.
+
+Or you can use =evilnc-comment-or-uncomment-html-paragraphs= to
comment/uncomment paragraphs containing html tags.
+
+Paragraph is text separated by empty lines.
*** evilnc-toggle-comment-empty-lines
Toggle the flag to comment/uncomment empty lines.
diff --git a/evil-nerd-commenter.el b/evil-nerd-commenter.el
index 8c5b786890..f1a129fe7f 100644
--- a/evil-nerd-commenter.el
+++ b/evil-nerd-commenter.el
@@ -4,7 +4,7 @@
;; Author: Chen Bin <chenbin.sh@gmail.com>
;; URL: http://github.com/redguardtoo/evil-nerd-commenter
-;; Version: 3.3.0
+;; Version: 3.3.1
;; Package-Requires: ((emacs "24.4"))
;; Keywords: commenter vim line evil
;;
@@ -82,6 +82,8 @@
;; "\\" 'evilnc-comment-operator)
;;
;; `evilnc-comment-or-uncomment-html-tag' comment/uncomment html tag(s).
+;; `evilnc-comment-or-uncomment-html-paragraphs' comment/uncomment paragraphs
+;; containing html tags.
;;
;; You can setup `evilnc-original-above-comment-when-copy-and-comment'
;; to decide which style to use when `evilnc-copy-and-comment-lines'
@@ -421,7 +423,7 @@ DO-COMMENT decides we comment or uncomment."
(setq line-cnt (1- line-cnt))))))
(defun evilnc--comment-or-uncomment-region (beg end)
- "Comment or uncommment region from BEG to END."
+ "Comment or uncomment region from BEG to END."
(cond
((eq major-mode 'web-mode)
;; elixir is not supported in web-mode for now
@@ -457,12 +459,8 @@ If UNITS is 16, line 16, line 116, and line 216 are good
candidates."
;; ==== below this line are public commands
-;;;###autoload
-(defun evilnc-comment-or-uncomment-paragraphs (&optional num)
- "Comment or uncomment NUM paragraph(s).
-A paragraph is a continuation non-empty lines.
-Paragraphs are separated by empty lines."
- (interactive "p")
+(defun evilnc-do-paragraphs (action num)
+ "Apply ACTION on NUM paragraphs."
(let* ((i 0)
rlt
(b (point-max))
@@ -492,8 +490,19 @@ Paragraphs are separated by empty lines."
(when (<= b e)
(save-excursion
- (evilnc--fix-buggy-major-modes)
- (evilnc--comment-or-uncomment-region b e)))))
+ (funcall action b e)))))
+
+;;;###autoload
+(defun evilnc-comment-or-uncomment-paragraphs (&optional num)
+ "Comment or uncomment NUM paragraph(s).
+A paragraph is a continuation non-empty lines.
+Paragraphs are separated by empty lines."
+ (interactive "p")
+ (evilnc-do-paragraphs
+ (lambda (b e)
+ (evilnc--fix-buggy-major-modes)
+ (evilnc--comment-or-uncomment-region b e))
+ num))
;;;###autoload
(defun evilnc-comment-or-uncomment-to-the-line (&optional LINENUM)
@@ -515,7 +524,7 @@ Paragraphs are separated by empty lines."
;;;###autoload
(defun evilnc-quick-comment-or-uncomment-to-the-line (&optional units)
"Comment/uncomment to line number by last digit(s) whose value is UNITS.
-For exmaple, you can use either \
+For example, you can use either \
\\<M-53>\\[evilnc-quick-comment-or-uncomment-to-the-line] \
or \\<M-3>\\[evilnc-quick-comment-or-uncomment-to-the-line] \
to comment to the line 6453"
@@ -677,7 +686,7 @@ Then we operate the expanded region. NUM is ignored."
(defun evilnc-version ()
"The version number."
(interactive)
- (message "3.3.0"))
+ (message "3.3.1"))
(defvar evil-normal-state-map)
(defvar evil-visual-state-map)
@@ -839,7 +848,7 @@ In this case, only one tag is selected.
If user manually selects region, the region could cross multiple sibling tags
and automatically expands to include complete tags.
-So user only need press \"v\" key in `evil-mode' to select multiple tags.
+So user only need press \"v\" key in \"evil-mode\" to select multiple tags.
JSX from ReactJS like \"{/* ... */}\" is the default comment syntax.
Customize `evilnc-html-comment-end' and `evilnc-html-comment-end' to used
@@ -877,6 +886,23 @@ different syntax."
;; the whole tags is already selected
(evilnc-html-comment-region beg end)))))
+;;;###autoload
+(defun evilnc-comment-or-uncomment-html-paragraphs (&optional num)
+ "Comment or uncomment NUM paragraphs contain html tag.
+A paragraph is a continuation non-empty lines.
+Paragraphs are separated by empty lines."
+ (interactive "p")
+ (save-excursion
+ (evilnc-do-paragraphs
+ (lambda (b e)
+ ;; {{ select region from b to e
+ (set-mark b)
+ (goto-char e)
+ (activate-mark)
+ ;; }}
+ (evilnc-comment-or-uncomment-html-tag))
+ num)))
+
;; Attempt to define the operator on first load.
;; Will only work if evil has been loaded
(eval-after-load 'evil
diff --git a/pkg.sh b/pkg.sh
index f0579adbeb..62dda91015 100755
--- a/pkg.sh
+++ b/pkg.sh
@@ -1,6 +1,6 @@
#!/bin/bash
name=evil-nerd-commenter
-version=3.3.0
+version=3.3.1
pkg=$name-$version
mkdir $pkg
cp *.el $pkg
- [nongnu] elpa/evil-nerd-commenter 9349468db8 148/235: Remove autoloads for evil text objects, (continued)
- [nongnu] elpa/evil-nerd-commenter 9349468db8 148/235: Remove autoloads for evil text objects, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter cac2f7945f 151/235: handle one line comment properly, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 96f76a67a3 153/235: evilnc-comment-text-object: doc-string fix, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 684f558931 152/235: visual-state key bindings, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter dac58399e8 158/235: select/yank text object of irregular lines, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 498ac2dbbd 154/235: Merge pull request #75 from duianto/patch-1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 0a46b91120 157/235: more precise inner comment text object, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 6a05c86bdf 164/235: Merge pull request #80 from duianto/fix-doc-string-typo-length, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 8f6fafcce9 168/235: better algorithm to extract comments in imenu, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter d1a5c9cd63 188/235: org v9.1 changed api to get language of src_block, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter cf1f57921d 175/235: can comment html paragraphs,
ELPA Syncer <=
- [nongnu] elpa/evil-nerd-commenter a4ef4ec548 176/235: document on comment paragraph, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 29990d314c 177/235: enable evil text object usage by default, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter a6d492b819 193/235: support inline comment for rust-mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 7e48e61207 197/235: Make evilnc-comment-and-copy-operator create only one undo entry, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 16561277ae 200/235: comment html tag in more web templates, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter cc8b254723 216/235: optimize performance, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 2730820b9c 224/235: fixed: evil-copy-and-comment-operator does not copy in visual-mode, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter e32519bc75 231/235: remove travis setup, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 6bc41317ba 233/235: doc, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-nerd-commenter 2133167e06 232/235: clean code, ELPA Syncer, 2022/01/06