LoginSignup
27
10

More than 5 years have passed since last update.

週刊Emacs News 2016年11月14日

Last updated at Posted at 2016-11-20

emacs-tangentsメーリングリストにまとめられたEmacs界隈のニュースに@tadsanが雑にコメントつけつつ紹介していくよ ヾ(〃><)ノ゙☆

注意

この記事の出典: 2016-11-14 Emacs News

見出し以外の文章は出典には存在せず、本文および掲載コードの責任は @tadsan にあります。

ナビゲーション

Edit file as another user in Emacs

ほかのユーザーとしてファイルを編集するやつ。sudoあること前提。

When a bookmark is a directory, do find-file from there…

ブックマーク先がディレクトリだったら、そこからfind-fileするやつ。

Emacsのブックマーク機能についてはEmacsのブックマーク機能 - tototoshi の日記とかGNU Emacsマニュアル: 13.8 ブックマークあたりを読んでみてください。

1st Plugin! Search youtube from in emacs. Play in browser/tool of choice (Reddit) Small library for Helm

Emacs上でYouTubeを検索して、さらに絞りこむやつ。べんり!

Neotree - yanking full path of note at point

「Neotreeでカーソル位置にあるファイルのフルパスをコピペするのはどうすりゃええの?」って質問。

NeoTreeは折り畳み式のファイルツリーを表示するべんりなやつだよ(VimのNERDTreeに影響を受けてる)。

まあまとめると、こんな感じに表示するといいんじゃないですかねって設定例。

init.el
(defun my/neotree-kill-filename-at-point ()
  "Kill full path of note at point."
  (interactive)
  (message "Copy %s"
           (kill-new (neo-buffer--get-filename-current-line))))

;; use-packageつかってる場合
(use-package neotree :defer t
  :config
  (bind-key "M-w" 'my/neotree-kill-filename-at-point neotree-mode-map))

;; use-packageなしの場合
(with-eval-after-load 'neotree
  (define-key neotree-mode-map (kbd "M-w") 'my/neotree-kill-filename-at-point))

Adding a custom "watch" icon to the modeline?

ファイルの変更を監視してコンパイルするようなプロセス(コマンド)を実行してるんだけど、非同期にコンパイルしてくれればよくて、いつもはコマンドの実行結果をわざわざ見る必要はない。でもたまーには実行結果を見たい。そんなときどうすればいい? みたいな質問。

で、こんなん作ったんよとmallt/cmd-to-echo: Show the output of long-running commands in the emacs echo areaの紹介。だいたいこれでいいんじゃね?

Date-sorted interactive recursive search with ivy, counsel and ag (Reddit)

Note-taking strategy early 2016 – cpbotha.net(2016年のノート取り戦略)に従ってノート取ってるんだけど、Ivy/Counselを使って日付順に並べて検索したいお、って話。

Persistent highlighting in Emacs

Emacsの画面上に表示された強調表示をそのまま永続化——ここではHTMLとして出力——したい。そんなときはHtmlizeだよ! …って話。

微妙に変形してみて、こんな感じではどうですか… なんだけど、(htmlize-buffer)がちょっと微妙に不安定っぽさを感じる。いまのところあまり依存しない方がいいかも。

my-htmlize.el
(defun my/display-htmlize-current-buffer ()
  "Display HTMLized buffer from current buffer."
  (interactive)
  (display-buffer (htmlize-buffer)))

(defun my/kill-htmlize-current-buffer ()
  "Kill HTMLized content from current buffer."
  (interactive)
  (let ((buf (htmlize-buffer)))
    (kill-new (with-current-buffer buf
                (buffer-substring-no-properties (point-min) (point-max))))
    (kill-buffer buf)))

Org Mode

Counting words in org-mode (hat-tip to Irreal for the link and a note about customization)

org-modeで文字数カウントするならこうすればいいよ! って話。wc-modeがすごいべんりっぽかった。Org Modeの項目に並んでるけど、別にorg-modeには依存してないのでなんでも大丈夫。

ちなみにEmacsのメジャーモードには継承の概念があって、文章編集系のモード(org-modeとかmarkdown-modeとか)はtext-modeを、プログラミング言語のコーディング用のモードはprog-modeを継承するお作法があるので、text-mode-hookとかprog-mode-hookとかに登録すれば、いろんなモードをいっぺんに設定できますよ。

;; org-modeだけならこう書く
(add-hook 'org-mode-hook 'wc-mode)

;; Markdownでも有効化してみる
(add-hook 'markdown-mode-hook 'wc-mode)

;; テキスト系のモードすべて有効化
(add-hook 'text-mode-hook 'wc-mode)

Instantly insert org todo via AutoHotKey (Windows) while emacs is closed

WindowsでAHK(AutoHotkey/日本語 AutoHotkey Wiki)を使って、Emacsを開いてなくてもすぐにorg-modeでToDoできるようにする設定。

Styling exported Agenda HTML.

org-modeのアジェンダ機能(参考:Emacs org-modeを使ってみる: (6) アジェンダ表示 - 屯遁のパズルとプログラミングの日記)で外部CSSを埋め込みたいんだけど、どうすりゃいいのん? って質問。

#+HTML_HEADにHTMLを直接書いて読み込む方法で質問者は満足したらしい。そーなのかー。

My Emacs Writing Setup

Emacsでの執筆環境構築について。

この記事を書いてるTony BallantyneはWikipedia英語版にも記事がある商業SF作家のようだ。

Emacs Lisp:

debug-on-entry - how to find out what's calling a function

非同期処理を伴ったコードはデバッグしにくいけど、debug-on-entryでどうやって関数が呼ばれたかインタラクティブに追っていけるよ、みたいな話(たぶん)

Displaying nonexistent text in Emacs buffers

テキストプロパティを変更して編集中のバッファの中身を見せかけだけ変更する(保存するテキストには影響しない)、みたいな話(たぶん)

How to write a function to transform a function to ivy action ?

「どうやったら(Emacs Lispの)函数をIvyのアクションとして登録できるの?」って質問。oantolinがFrom helm, to ivy, a user perspectiveについて記入したコメントを読めと言ってる。

GitHub - atomontage/xterm-color: ANSI -> xterm-256 color text property translator for Emacs (Reddit)

結構前からあったよね? と思ったけどRedditに投稿されたからニュースとして上がってるようだ。Emacs標準で持ってるansi-color.elよりも良いやつ。

コーディング

A persistent scratch buffer

*scratch*バッファの中身を自動的にファイルにバックアップして、Emacsを再起動したときに復元できるやつ。作者はrainbow-delimitersが有名なFanaelたん

るびきちさんも紹介してる。 persistent-scratch.el : *scratch*バッファを永続化・自動保存・復元する

Growing playlist of Emacs videos I make for the clojure community: CIDER, paredit and Magit up to now

「生産的なEmacs」と称してClojureコミニュティに向けたEmacsの操作説明の動画っぽい。

ParEditについては、ClojureのみならずLisp系の言語を使ってるひとにはおすすめ。Daregadaさんの訳したParEdit チュートリアルもある。最近はPerEditの競合としてlispyってのもあるよ。

Installing Emacs from Source: Avoid the Conflict of ctags (Reddit)

Emacsをインストールするときに作られるctagsってコマンド名はExuberant CtagsとかUniversal Ctagsとかで衝突しちゃってるんだけど、Emacsのビルド時に別名をつけて衝突しないようにする方法。

../configure --program-transform-name='s/^ctags$/ctags.emacs/'してやれば良いらしい……?

How to set up Emacs for Rust Language using Spacemacs (4:30)

SpacemacsRust言語の補完ができる開発環境のセットアップを説明する動画。

Magit

Magit: Git in Emacs - Grumpy Gits SG (55:23)

Productive Emacs: Magit (18:05)

Emacs本体開発

Connection-local variables

リモート接続(SSHとかでログイン)単位でローカル変数を設定できるようになるっぽい。

Include a systemd user init file

ユーザー単位のsystemd設定でEmacsデーモンを起動できる、らしい。

New function file-name-case-insensitive-p, case sensitivity check when renaming files

大文字小文字が違ってもファイルが存在するかチェックできる。

Discussion of prefix arguments for filling text

テキストのフィル機能でコマンド実行時にfill-columnを設定できるようにしようって提案。でもさ、その数引数の渡しかたって変じゃね? みたいな話がちょっと続いてた。

Discussion of performance issues with Emacs 25.1 Windows build

Windowsでのビルド遅すぎね? まあちゃんと原因調べて改善していこうぜ、みたいな話。

Patches for url-auth

Digest認証の改善っぽい。

Long philosophical discussion about lldb, Emacs, and GNU

結局、LLDBのサポート機能はコード書いたら取り込んでくれんの? LLVM/Clangも自由ソフトウェアなんだからサポートしてもいいんじゃね? <!-- GNUにはGDBがあるんだからLLVMに肩入れしたらGNUの損失になるだろ常考、おいおいLinuxGNU Hurdだって競合してるじゃんかよ、いやいやGDBよりも優れた自由ソフトウェア実装があるなら移行すれば開発リソース有効活用できるだろ、自由と無料はちゃうねん—— --> などなど。めんどくさい種類の議論。

Long discussion regarding support for Windows 9X

Windowsの32ビットサポートどうすんのよ、いやそもそもWindows9x系のサポートはどうすんのよ、Windows MEがメジャーだったことなんか一度もないだろ、みたいな話。

From: Richard Stallman
Subject:  Re: Windows emacs-25.1 i686 vs x86_64?
Date: Mon, 07 Nov 2016 09:43:23 -0500

In GNU projects, we typically stop worrying about an underlying platform when its original supplier stops supporting it. For example, Emacs no longer worries about IRIX because SGI stopped supporting IRIX in 2013.

In the GNU Project, the question that matters, for a system version of no particular importance to us (such as any version of Windows), is whether users care about that version enough to maintain support for it. If they do that, we may as well not delete their code unless it is getting in the way rather badly.

If we have no direct evidence about whether users care about a certain version, by default we can suppose that they won't care about a version that is no longer being maintained. But that's not the criterion, just a default way to guess.

Given that Windows is so widely used, and that so many users stick to old versions of it, it is plausible to me that millions of people still use Windows 98. Maybe tens or hundreds of millions.

That number may still be growing. ISTR that even a few years ago people were still installing unauthorized copies of Windows 98 on PCs, because Microsoft made it harder to install subsequent Windows versions. It would not surprise me if Windows 98 was installed on millions of new PCs this year.

(Re: Windows emacs-25.1 i686 vs x86_64? より抜萃)

.。o( いまだにWindows 98を使ってるひとがEmacs最新版を使ったりするのかな… )

そのほか

Using Emacs - 20 - yanking

ヤンク(貼り付け)機能について。Counselcounsel-yank-popがべんりだよ、などなど。

nice looking light on dark theme (Reddit)

Birds of Paradise Light on Dark Sublime Text, Xcode Color Theme | Joe Bergantineの移植。

What would make Emacs News better?

どうやったらEmacsの最新情報をいい感じにまとめられるかな? って話。

Using Emacs - 19 - moving to a live config (Reddit)

メールアドレスとか個人情報設定みたいなやつの管理はどうしたらいいの? って話。

My first emacs package! Detect conflicted copies of files in your Dropbox on open (Reddit)

Dropboxでファイルの衝突を検出できるEmacs Lisp書いたよー \(^o^)/ って話。

Emacs Lisp Animations

Emacsで図形を描画したりアニメーションさせるテクニックについて。ジェネラティブアートの入門的な文脈らしい。

新作パッケージ

all-the-icons-dired: Shows icons for each file in dired mode

いままでありそでなかった、ファイルの種類ごとにアイコンを表示するやつ。

画像ではなくフォント依存なので、all-the-icons.el/fonts at master · domtronn/all-the-icons.elから各種フォントをインストールの必要あり。

counsel-bbdb: Quick search&input email from BBDB based on ivy

BBDBから検索したり、入力補完してくれるやつ(のIvy/Counsel版)。

csv: Functions for reading and parsing CSV files.

CSVパーサ実装。先頭をヘッダとして解釈し、各行の要素を連想リストで取得できる。

dante: Development mode for Haskell

Intero for Emacsから派生したそうな。

darkane-theme: A dark theme with strong colors

andre-richter/emacs-lush-theme: A dark theme with strong colors for Emacs24の派生。

emlib: A Machine Learning library for Emacs

ニューラルネットワークのEmacs Lisp実装。…………おう、なるほど。

fluxus-mode: Major mode for interfacing with Fluxus

Fluxusは3Dゲームエンジンらしい。

flycheck-demjsonlint: Flychecker for json-mode using jsonlint from demjson

Pythonのdemjsonを使ってJSONを検証するチェッカー。

flycheck-title: show flycheck errors in the frame title

Flycheckの通知をタイトルバーに出して、エコーエリア(画面下部のメッセージが出てくる場所)を別の機能のために空けてくれる。

helm-bbdb: Helm interface for bbdb

BBDBから検索したり、入力補完してくれるやつ(のHelm版)。

helm-youtube: Query YouTube and play videos in your browser

EmacsからYouTube動画の検索と絞り込みができる。

projectile-git-autofetch: automatically fetch git repositories

自動的にGitリポジトリをfetchしてくれるようにするやつ。

sudoku: Simple sudoku game, can download puzzles

数独(あるいはナンプレ)の実装。

web-mode-edit-element: Helper-functions for attribute- and element-handling

ParEditなどに触発されて、Web-modeを拡張するパッケージ。カーソル移動などは良いんだけど、編集機能はまだまだ検証が足りてなさげ。

whizzml-mode: Programming mode for editing WhizzML files

WhizzMLは機械学習用のDSLらしい。

27
10
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
27
10