From b46f79566e623474ca702622ab1f280a64ed9b8e Mon Sep 17 00:00:00 2001 From: Philippe Vaucher Date: Fri, 3 Oct 2014 14:00:53 +0200 Subject: [PATCH 1/2] Fix style issues --- mc-hide-unmatched-lines-mode.el | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/mc-hide-unmatched-lines-mode.el b/mc-hide-unmatched-lines-mode.el index 67375bf..1cc754a 100644 --- a/mc-hide-unmatched-lines-mode.el +++ b/mc-hide-unmatched-lines-mode.el @@ -29,7 +29,6 @@ ;;; Code: - (require 'multiple-cursors-core) (defvar hum/hide-unmatched-lines-mode-map (make-sparse-keymap) @@ -45,15 +44,14 @@ ;; used only in in multiple-cursors-mode-disabled-hook (defun hum/disable-hum-mode () - (mc-hide-unmatched-lines-mode 0) -) + (mc-hide-unmatched-lines-mode 0)) (define-minor-mode mc-hide-unmatched-lines-mode "Minor mode when enabled hides all lines where no cursos (and also hum/lines-to-expand below and above) To make use of this mode press \"C-'\" while multiple-cursor-mode is active. You can still edit lines while you are in mc-hide-unmatched-lines -mode. To leave this mode press or \"C-g\"" +mode. To leave this mode press or \"C-g\"" nil " hu" hum/hide-unmatched-lines-mode-map (if mc-hide-unmatched-lines-mode @@ -63,9 +61,7 @@ mode. To leave this mode press or \"C-g\"" (add-hook 'multiple-cursors-mode-disabled-hook 'hum/disable-hum-mode t t)) (progn (hum/unhide-unmatched-lines) - (remove-hook 'multiple-cursors-mode-disabled-hook 'hum/disable-hum-mode)) - ) -) + (remove-hook 'multiple-cursors-mode-disabled-hook 'hum/disable-hum-mode)))) (defconst hum/invisible-overlay-name 'hum/invisible-overlay-name) @@ -77,8 +73,7 @@ mode. To leave this mode press or \"C-g\"" (defcustom hum/placeholder "..." "Placeholder which will be placed insted of hiden text" :type '(string) - :group 'multiple-cursors -) + :group 'multiple-cursors) (defun hum/add-invisible-overlay (begin end) (let ((overlay (make-overlay begin @@ -91,10 +86,7 @@ mode. To leave this mode press or \"C-g\"" (overlay-put overlay 'invisible t) (overlay-put overlay 'intangible t) (overlay-put overlay 'evaporate t) - (overlay-put overlay 'after-string hum/placeholder) - ) - ) - + (overlay-put overlay 'after-string hum/placeholder))) (defun hum/hide-unmatched-lines () (let ((begin (point-min))) @@ -102,18 +94,12 @@ mode. To leave this mode press or \"C-g\"" (save-excursion (goto-char (mc/cursor-beg cursor)) (if (< begin (line-beginning-position (- hum/lines-to-expand))) - (hum/add-invisible-overlay begin (line-end-position (- hum/lines-to-expand))) - ) - (setq begin (line-beginning-position (+ 2 hum/lines-to-expand))) - ) - ) - (hum/add-invisible-overlay begin (point-max)) - ) - ) + (hum/add-invisible-overlay begin (line-end-position (- hum/lines-to-expand)))) + (setq begin (line-beginning-position (+ 2 hum/lines-to-expand))))) + (hum/add-invisible-overlay begin (point-max)))) (defun hum/unhide-unmatched-lines () - (remove-overlays nil nil hum/invisible-overlay-name t) - ) + (remove-overlays nil nil hum/invisible-overlay-name t)) (provide 'mc-hide-unmatched-lines-mode) (define-key mc/keymap (kbd "C-'") 'mc-hide-unmatched-lines-mode) From 912342ed856335220ab5ac635557187b21f3eee0 Mon Sep 17 00:00:00 2001 From: Philippe Vaucher Date: Fri, 3 Oct 2014 14:13:19 +0200 Subject: [PATCH 2/2] Add missing ###autoload markers --- mc-hide-unmatched-lines-mode.el | 1 + multiple-cursors-core.el | 1 + rectangular-region-mode.el | 1 + 3 files changed, 3 insertions(+) diff --git a/mc-hide-unmatched-lines-mode.el b/mc-hide-unmatched-lines-mode.el index 1cc754a..684080e 100644 --- a/mc-hide-unmatched-lines-mode.el +++ b/mc-hide-unmatched-lines-mode.el @@ -46,6 +46,7 @@ (defun hum/disable-hum-mode () (mc-hide-unmatched-lines-mode 0)) +;;;###autoload (define-minor-mode mc-hide-unmatched-lines-mode "Minor mode when enabled hides all lines where no cursos (and also hum/lines-to-expand below and above) To make use of this diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el index bc8a279..2e46183 100644 --- a/multiple-cursors-core.el +++ b/multiple-cursors-core.el @@ -459,6 +459,7 @@ They are temporarily disabled when multiple-cursors are active.") :group 'multiple-cursors) (put 'mc/mode-line 'risky-local-variable t) +;;;###autoload (define-minor-mode multiple-cursors-mode "Mode while multiple cursors are active." nil mc/mode-line mc/keymap diff --git a/rectangular-region-mode.el b/rectangular-region-mode.el index 6bd54c7..8cbe1de 100644 --- a/rectangular-region-mode.el +++ b/rectangular-region-mode.el @@ -108,6 +108,7 @@ an exceedingly quick way of adding multiple cursors to multiple lines." (when rectangular-region-mode (rrm/switch-to-multiple-cursors))) +;;;###autoload (define-minor-mode rectangular-region-mode "A mode for creating a rectangular region to edit" nil " rr" rectangular-region-mode-map