boonify narrow/widen

This commit is contained in:
Jean-Philippe Bernardy 2019-05-24 09:49:20 +02:00
parent 4cc140e232
commit b1f79ab0f8
2 changed files with 9 additions and 0 deletions

View file

@ -40,6 +40,8 @@
(define-key boon-goto-map "." 'find-tag)
(define-key boon-x-map "x" 'execute-extended-command)
(define-key boon-x-map "n" 'boon-narrow)
(define-key boon-x-map "N" 'widen)
(define-key boon-select-map "@" 'boon-select-occurences)
(define-key boon-select-map "#" 'boon-select-all)

View file

@ -415,6 +415,13 @@ sequence."
(dolist (reg (boon-run-selector regs))
(comment-or-uncomment-region (boon-reg-begin reg)(boon-reg-end reg))))
(defun boon-narrow (regs)
"Narrow to the first region of REGS."
(interactive (list (boon-spec-select-top "narrow")))
(let ((reg (car (boon-run-selector regs))))
(narrow-to-region (boon-reg-begin reg) (boon-reg-end reg))))
(provide 'boon-main)
;;; boon-main.el ends here