LoginSignup
1
0

More than 5 years have passed since last update.

Gentooでredpen

Last updated at Posted at 2016-11-20

genntooにredpenをインストールするebuildを作った。

/opt/redpen/bin/redpen

でコマンドラインから使えるようになる。

なおやっている処理はarclinuxのredpenパッケージと同じ
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=redpen

emacsの設定は以下のようにした.
(一応は動いているが自信はあまりない)

redpen-paragraph-conf.el
(require 'redpen-paragraph)
(defvar redpen-commands
   '("/opt/redpen/bin/redpen -r json -c /opt/redpen/conf/redpen-conf-en.xml %s 2>/dev/null"
     "/opt/redpen/bin/redpen -r json -c /opt/redpen/conf/redpen-conf-ja.xml %s 2>/dev/null"))

(add-to-list
 'redpen-paragraph-alist
 `(LaTeX-mode
   . ,(lambda () "get visible string on current paragraph."
        (let ((end (if (use-region-p)
                       (region-end)
                       (point-max)))
              (begin (if (use-region-p)
                         (region-beginning)
                         (point-min))))
            (apply 'string
                   (cl-loop
                    for pos from begin to end
                    when (not (get-text-property pos 'invisible))
                    collect (char-after pos))))))

  `(markdown-mode
   . ,(lambda () "get visible string on current paragraph."
        (let ((end (if (use-region-p)
                       (region-end)
                       (point-max)))
              (begin (if (use-region-p)
                         (region-beginning)
                         (point-min))))
            (apply 'string
                   (cl-loop
                    for pos from begin to end
                    when (not (get-text-property pos 'invisible))
                    collect (char-after pos))))))
 )


;;(define-key global-map (kbd "C-c C-r") 'redpen-paragraph)

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0