<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://www.seirios.org/seirios/dokuwiki/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>ほほほのほ</title>
        <description></description>
        <link>http://www.seirios.org/seirios/dokuwiki/</link>
        <lastBuildDate>Wed, 08 Apr 2026 12:43:22 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>http://www.seirios.org/seirios/dokuwiki/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
            <title>ほほほのほ</title>
            <link>http://www.seirios.org/seirios/dokuwiki/</link>
        </image>
        <item>
            <title>FreeBSDでNASを建てる - [ZFS poolを作成する] </title>
            <link>http://www.seirios.org/seirios/dokuwiki/doku.php?id=os:freebsd:nas</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;freebsdでnasを建てる&quot;&gt;FreeBSDでNASを建てる&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
FreeBSDでNASを作成する。
&lt;/p&gt;

&lt;p&gt;
Open Source なNASの実装には
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.freenas.org/&quot; class=&quot;urlextern&quot; title=&quot;http://www.freenas.org/&quot;&gt;FreeNAS&lt;/a&gt; FreeBSDベース&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://www.nas4free.org/&quot; class=&quot;urlextern&quot; title=&quot;https://www.nas4free.org/&quot;&gt;NAS4Free&lt;/a&gt; FreeBSDベース。FreeNAS 0.7系からFork。&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://openmediavault.org/&quot; class=&quot;urlextern&quot; title=&quot;http://openmediavault.org/&quot;&gt;OpenMediaVault&lt;/a&gt; Debian GNU Linuxベース。FreeNASからFork。&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://rockstor.com/&quot; class=&quot;urlextern&quot; title=&quot;http://rockstor.com/&quot;&gt;Rockstor&lt;/a&gt; CentOSベース。&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://www.openfiler.com/&quot; class=&quot;urlextern&quot; title=&quot;https://www.openfiler.com/&quot;&gt;OpenFiler Community Edition&lt;/a&gt; Linuxベース。&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://nexenta.com/products/downloads/download-community-edition/&quot; class=&quot;urlextern&quot; title=&quot;https://nexenta.com/products/downloads/download-community-edition/&quot;&gt;Nexenta Community Edition&lt;/a&gt; Open Solarisベース。&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
などがある。
&lt;/p&gt;

&lt;p&gt;
(参考 : &lt;a href=&quot;https://www.how2shout.com/tools/best-free-open-source-nas-software.html&quot; class=&quot;urlextern&quot; title=&quot;https://www.how2shout.com/tools/best-free-open-source-nas-software.html&quot;&gt;https://www.how2shout.com/tools/best-free-open-source-nas-software.html&lt;/a&gt;)
&lt;/p&gt;

&lt;p&gt;
NASは、その利用目的によって、考慮するべき点が異なる。筆者の主要な用途としては
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; 仮想基盤向けStorage&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; 利用したいのは、iSCSI / NFS の２Protocol。CephもGlusterも興味はあるが、個人的にはまだ実験レベル。&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; ファイル共有用&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; 利用したいのはNFS(MacでFile共有するならNFSで十分)とAFP(TimeMachine)&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
の２種類である。
&lt;/p&gt;

&lt;p&gt;
しかし、仮想基盤向けストレージとファイル共有を同一のNASとして供給するのは、
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; 管理上面倒&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; インフラとユーザーではセキュリティポリシーが異なる&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; サービス要求レベルが異なる&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; インフラはできる限り安定して動かしたい。可能な限り触らない&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; ファイル共有は、設定の変更やアカウント追加削除など、触る局面が多い&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
というように、そもそもの要求要件が異なる。
&lt;/p&gt;

&lt;p&gt;
というわけで、今回は、
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 仮想基盤用のNASはFreeBSDを生でiSCSIとNFS供給用として使う&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; ファイル共有用は、仮想基盤のVM上にNAS4Freeを投入して、設定の簡便化を図る&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; NAS上のStorageにNASのStorageをおくわけで、屋上屋を架している状態だが、レスポンスがシビアではない条件なのでよしとする。&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
という実装を行う。
&lt;/p&gt;

&lt;p&gt;
なお、NAS4Free環境の構築に関しては&lt;a href=&quot;http://www.seirios.org/seirios/dokuwiki/doku.php?id=serverapp:fileserver:nas4free&quot; class=&quot;wikilink2&quot; title=&quot;serverapp:fileserver:nas4free&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;serverapp:fileserver:nas4free&quot;&gt;nas4free&lt;/a&gt;を参照のこと
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;FreeBSD\u3067NAS\u3092\u5efa\u3066\u308b&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;freebsd\u3067nas\u3092\u5efa\u3066\u308b&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-2201&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;準備&quot;&gt;準備&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
NASを構築するには当然、十分なStorageを持つ機材が必要になる。
&lt;/p&gt;

&lt;p&gt;
まず、必要なスペックを検討する。
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u6e96\u5099&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u6e96\u5099&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;2202-2357&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit3&quot; id=&quot;要求要件検討&quot;&gt;要求要件検討&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
まず、要求要件をまとめる。
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; XCP-ngに対して、VM用のDisk Imageを保存することができるだけの容量&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; XCP-ngに対して、XCP-ngのSR(Storage Repository)として認識できるProtocolが利用できること&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; 基盤環境がGbEネットワーク(100Base-T)で構築されているので、GbEで通信できる環境&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; なお、802.3adでのTrunkに対応したSwitching HUBを利用しているので、NICに余力があれば802.3adでのTrunkも考慮に入れる&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Disk Imageを保持するために、性能が良く、比較的安定なFileSystem(FS)を組めること&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; サイズは小さくて良いので、Disk Imageを供給するためのNetwork File Systemを利用できること&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;table sectionedit4&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; SR用 &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; NFS , iSCSI , Hardware HBA , Software FCoE &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; ISO File用 &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; NFS , SMB/CIFS &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;3132-3219&amp;quot;} --&gt;
&lt;p&gt;
以上の条件であれば、Hardware要件さえ満たせれば、世に数多あるNAS Applianceを利用することで解決できる。
が、今回は、生FreeBSD上でiSCSI/NFSを供給するNASを作成することにする。
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u8981\u6c42\u8981\u4ef6\u691c\u8a0e&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u8981\u6c42\u8981\u4ef6\u691c\u8a0e&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;2358-3458&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit5&quot; id=&quot;実装仕様&quot;&gt;実装仕様&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
手元の機材の関係上、以下の環境に実装する。
&lt;/p&gt;
&lt;div class=&quot;table sectionedit6&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; CPU &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Intel Pentium G630T / 2.30GHz &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; 手元にあったので &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; Memory &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; 16GB &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; 手元にあったので &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot; rowspan=&quot;2&quot;&gt; NIC &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; RealTek 8168 &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; MotherBoardにOnboardで載っているので &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; Intel PRO/1000 &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; PCI Slotに追加した &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0&quot; rowspan=&quot;6&quot;&gt; HDD &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; HDS728080PLA380 80G &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; 起動用 &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; WD Green WD20EARX 2T &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; ada0 / 手元にあったので &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; WD Green WD20EZRX 2T &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; ada1 / 手元にあったので &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; WD Green WD20EARX 2T &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; ada2 / 手元にあったので &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; WD Green WD20EZRX 2T &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; ada3 / 手元にあったので &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; WD Green WD20EZRX 2T &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; ada4 / 手元にあったので &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;table1&amp;quot;,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;3548-4148&amp;quot;} --&gt;
&lt;p&gt;
要件と好みから、以下のように実装する
&lt;/p&gt;
&lt;div class=&quot;table sectionedit7&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;abbr title=&quot;Operating System&quot;&gt;OS&lt;/abbr&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; FreeBSD 11.1-RELEASE &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; iSCSI target &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; ctld (System Builtin) &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot; rowspan=&quot;2&quot;&gt; NFS Server &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; rpcbind/nfsd/mountd (System Builtin) &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; NFSv3を利用 &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0&quot; rowspan=&quot;2&quot;&gt; ZFS &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; RAID-Z2を利用 &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; SR用Storageはvdevにする &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;table2&amp;quot;,&amp;quot;secid&amp;quot;:7,&amp;quot;range&amp;quot;:&amp;quot;4206-4421&amp;quot;} --&gt;
&lt;p&gt;
その他、細かい諸元を以下に。
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Remoteからの制御通信はsshのみを許可する。sshの待ち受けはHigh Portに移動する&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 管理セグメントとStorageセグメント以外からの通信は全て遮断する&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; FreeBSD Updateおよびpkg updateは、手元にあるproxyを経由する&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 監視のためのSoftwareはとりあえずPendする&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u5b9f\u88c5\u4ed5\u69d8&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u5b9f\u88c5\u4ed5\u69d8&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;3459-4804&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit8&quot; id=&quot;osの初期設定&quot;&gt;OSの初期設定&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Bare MetalにOSを投入する
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;OS\u306e\u521d\u671f\u8a2d\u5b9a&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;os\u306e\u521d\u671f\u8a2d\u5b9a&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:8,&amp;quot;range&amp;quot;:&amp;quot;4805-4866&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit9&quot; id=&quot;install_freebsd&quot;&gt;Install FreeBSD&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
FreeBSDのInstaller CDからOSを導入する。
&lt;/p&gt;

&lt;p&gt;
注意点は
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; BootDiskにはそれほどの容量はいらない&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; portsやsrcは展開しない&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; 不要な32bit Libは導入しない&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; Disk割り当ては、80Gだと少し大きすぎるので、以下のようにした。&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; Boot BlockにGPTを選択&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; OS部分は別にZFSにする必要がないので、UFSを利用する&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; Partition構成は以下の通り&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; efi: 512MB (40/1048576)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; freebsd-ufs : 20G (10186/41943040)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; freebsd-swap : 2G (42991656/4194304)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; これらは、Installerから設定可能。重要なのは、&lt;strong&gt;efi&lt;/strong&gt;を設定すること&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
あとは、普通にInstallすればよい。
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Install FreeBSD&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;install_freebsd&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:9,&amp;quot;range&amp;quot;:&amp;quot;4867-5600&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit10&quot; id=&quot;configuration_of_freebsd&quot;&gt;Configuration of FreeBSD&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
最初にBootしたら、以下を行う。
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;strong&gt;rc.conf&lt;/strong&gt;関連の設定&lt;/div&gt;
&lt;ol&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;/etc/rc.conf&lt;/code&gt;を作成・編集する&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Host Information&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;hostname&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;nas-temp&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;keymap&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;jp&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;dumpdev&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;NO&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# System Configuration&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;clear_tmp_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;YES&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;zfs_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;YES&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# NIC Configuration&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;ifconfig_re0&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;inet 192.0.2.254    netmask 255.255.255.0&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;ifconfig_em1&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;inet 198.51.100.254 netmask 255.255.255.0&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Routing Configuration&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;route_private10&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot; -net 10.0.0.0/8     127.0.0.1 -blackhole&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;route_private172&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;-net 172.16.0.0/12  127.0.0.1 -blackhole&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;route_private192&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;-net 192.168.0.0/16 127.0.0.1 -blackhole&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;re2&quot;&gt;static_routes&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;private10 private172 private192&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;defaultrouter&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;192.0.2.1&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;#Network Parameters Configuration&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;icmp_bmcastecho&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;NO&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;icmp_drop_redirect&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;YES&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;icmp_log_redirect&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;YES&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;ip6addrctl_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;NO&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;ip6addrctl_policy&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;ipv4_prefer&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;ipv6_activate_all_interfaces&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;NO&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;ipv6_network_interfaces&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;NO&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# NFS Configuration&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;rpc_lockd_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;YES&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;rpc_statd_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;YES&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;rpcbind_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;YES&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;re2&quot;&gt;nfs_client_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;NO&amp;quot;&lt;/span&gt; 
&lt;span class=&quot;re2&quot;&gt;autofs_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;NO&amp;quot;&lt;/span&gt; 
&amp;nbsp;
&lt;span class=&quot;re2&quot;&gt;mountd_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;YES&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;mountd_flags&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;-lr&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;nfs_server_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;YES&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;re2&quot;&gt;nfsv4_server_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;NO&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;nfsuserd_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;NO&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;nfsuserd_flags&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;-domain localdomain&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Firewall&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;pf_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;NO&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;pf_flags&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;pflog_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;NO&amp;quot;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Userland&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;syslogd_flags&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;-ss&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;sendmail_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;NONE&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;sshd_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;YES&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;ntpd_enable&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;YES&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;ntp_leapfile_fetch_verbose&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;YES&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;ntp_leapfile_sources&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.list&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;/etc/sysctl.conf&lt;/code&gt;関連&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; /etc/sysctl.confにいくつかの設定を書き込む&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;pre class=&quot;code&quot;&gt;security.bsd.unprivileged_read_msgbuf=0
kern.randompid=5055
security.bsd.stack_guard_page=1

# ZFS use 4k sectors. (default: 9/512 byes)
vfs.zfs.min_auto_ashift=12

### NFS parameters
vfs.nfsd.server_min_nfsvers=3&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; 名前解決&lt;/div&gt;
&lt;ol&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;/etc/resolv.conf&lt;/code&gt;を作成・編集する&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;pre class=&quot;code&quot;&gt;domain management.example.org
nameserver 192.0.2.11
nameserver 192.0.2.12&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;strong&gt;sshd&lt;/strong&gt;関連の設定&lt;/div&gt;
&lt;ol&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; まず、自分のHome Directoryに&lt;code&gt;.ssh/authorized_keys&lt;/code&gt;を設定する&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; これを忘れると、次の設定後にloginできなくなる&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt;末尾に以下の設定を投入。&lt;code&gt;XXXX&lt;/code&gt;には、待ち受けるポート番号を記載すること&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;pre class=&quot;code&quot;&gt;##### Addtional
Port XXXX
UseDNS no
ChallengeResponseAuthentication no&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;service sshd restart&lt;/code&gt;をroot権限で実行し、sshdを再起動する&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;strong&gt;ntpd&lt;/strong&gt;関連の設定&lt;/div&gt;
&lt;ol&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;/etc/ntp.conf&lt;/code&gt;を編集する&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; serverを正しく設定すれば良い&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; 外部のNTPサーバーを参照するよりも、内部ネットワークに建ててあるNTPdを参照する方が望ましい&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;http://www.seirios.org/seirios/dokuwiki/doku.php?do=export_code&amp;amp;id=os:freebsd:nas&amp;amp;codeblock=4&quot; title=&quot;この部分をダウンロード&quot; class=&quot;mediafile mf_conf&quot;&gt;ntp.conf&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code bash&quot;&gt;tos minclock &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt; maxclock &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;
server 192.0.2.1 iburst
server 192.0.2.2 iburst
server 192.0.2.3 iburst
&amp;nbsp;
restrict    default limited kod nomodify notrap noquery nopeer
restrict &lt;span class=&quot;re5&quot;&gt;-6&lt;/span&gt; default limited kod nomodify notrap noquery nopeer
&amp;nbsp;
restrict 127.0.0.1
restrict &lt;span class=&quot;re5&quot;&gt;-6&lt;/span&gt; ::&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&amp;nbsp;
leapfile &lt;span class=&quot;st0&quot;&gt;&amp;quot;/var/db/ntpd.leap-seconds.list&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; Update関連の設定&lt;/div&gt;
&lt;ol&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; freebsd-updateでOSを更新する際に参照するサーバーを設定する&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;ServerName update.FreeBSD.org&lt;/code&gt; をコメントアウト&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level3 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;ServerName local-update-server&lt;/code&gt; を設定&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level4&quot;&gt;&lt;div class=&quot;li&quot;&gt; local-update-serverは内部のDNSで引けるupdateサーバーを記載すること&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; pkgでpackageを更新する際に参照するサーバーを設定する&lt;/div&gt;
&lt;ol&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;mkdir -p /usr/local/etc/pkg/repos&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;vi /usr/local/etc/pkg/repos/FreeBSD.conf&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;http://www.seirios.org/seirios/dokuwiki/doku.php?do=export_code&amp;amp;id=os:freebsd:nas&amp;amp;codeblock=5&quot; title=&quot;この部分をダウンロード&quot; class=&quot;mediafile mf_conf&quot;&gt;FreeBSD.conf&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code bash&quot;&gt;FreeBSD: &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  url: &lt;span class=&quot;st0&quot;&gt;&amp;quot;pkg+http://local-update-server/&lt;span class=&quot;es3&quot;&gt;${ABI}&lt;/span&gt;/quarterly&amp;quot;&lt;/span&gt;,
  mirror_type: &lt;span class=&quot;st0&quot;&gt;&amp;quot;srv&amp;quot;&lt;/span&gt;,
  signature_type: &lt;span class=&quot;st0&quot;&gt;&amp;quot;fingerprints&amp;quot;&lt;/span&gt;,
  fingerprints: &lt;span class=&quot;st0&quot;&gt;&amp;quot;/usr/share/keys/pkg&amp;quot;&lt;/span&gt;,
  enabled: &lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; OSおよびPackageの更新&lt;/div&gt;
&lt;ol&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;freebsd-update fetch install&lt;/code&gt;を実行&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;pkg update &amp;amp;&amp;amp; pkg upgrade&lt;/code&gt;を実行&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; 再起動する&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; 最小限のPackageを投入&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; 本システムに必要となる最小限のPackageをBinaryで投入する&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; sudo&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;pkg install sudo smartmontools&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Configuration of FreeBSD&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;configuration_of_freebsd&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:10,&amp;quot;range&amp;quot;:&amp;quot;5601-9720&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit11&quot; id=&quot;おまけ_cam&quot;&gt;(おまけ) CAM&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
FreeBSDには、CAM(Common Access Method)という仕組みがあり、これでSATAのDiskに対して(Diskだけではないが)色々な処理を行える。
この仕組みを使った様々な制御のために&lt;code&gt;camcontrol&lt;/code&gt;がある。
&lt;/p&gt;

&lt;p&gt;
たとえば、こんな感じ。
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# camcontrol devlist&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;WDC WD20EARX-00PASB0 51.0AB51&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;    at scbus0 target &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; lun &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;ada0,pass0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;WDC WD20EZRX-00DC0B0 80.00A80&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;    at scbus0 target &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; lun &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;ada1,pass1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;WDC WD20EARX-00PASB0 51.0AB51&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;    at scbus1 target &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; lun &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;ada2,pass2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;WDC WD20EZRX-00DC0B0 80.00A80&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;    at scbus1 target &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; lun &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;ada3,pass3&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;WDC WD20EZRX-00DC0B0 80.00A80&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;    at scbus2 target &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; lun &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;ada4,pass4&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;HDS728080PLA380 PF2OA60A&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;         at scbus3 target &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; lun &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;ada5,pass5&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# camcontrol identify ada5&lt;/span&gt;
pass5: &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;HDS728080PLA380 PF2OA60A&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; ATA-&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt; SATA &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.x device
pass5: 150.000MB&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;s transfers &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;SATA &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.x, UDMA5, PIO 8192bytes&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
protocol              ATA&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;ATAPI-&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt; SATA &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;.x
device model          HDS728080PLA380
firmware revision     PF2OA60A
serial number         PFDB30S2UP51ZM
WWN                   5000cca300f3e550
cylinders             &lt;span class=&quot;nu0&quot;&gt;16383&lt;/span&gt;
heads                 &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;
sectors&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;track         &lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt;
sector &lt;span class=&quot;kw2&quot;&gt;size&lt;/span&gt;           logical &lt;span class=&quot;nu0&quot;&gt;512&lt;/span&gt;, physical &lt;span class=&quot;nu0&quot;&gt;512&lt;/span&gt;, offset &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
LBA supported         &lt;span class=&quot;nu0&quot;&gt;160836480&lt;/span&gt; sectors
LBA48 supported       &lt;span class=&quot;nu0&quot;&gt;160836480&lt;/span&gt; sectors
PIO supported         PIO4
DMA supported         WDMA2 UDMA6 
&amp;nbsp;
Feature                      Support  Enabled   Value           Vendor
&lt;span class=&quot;kw3&quot;&gt;read&lt;/span&gt; ahead                     &lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;	&lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;write&lt;/span&gt; cache                    &lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;	&lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;
flush cache                    &lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;	&lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;
overlap                        no
Tagged Command Queuing &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;TCQ&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;   no	no
Native Command Queuing &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;NCQ&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;   &lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;		&lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt; tags
NCQ Queue Management           no
NCQ Streaming                  no
Receive &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt; Send FPDMA Queued    no
SMART                          &lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;	&lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;
microcode download             &lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;	&lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;
security                       &lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;	no
power management               &lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;	&lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;
advanced power management      &lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;	no	&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;0x00
automatic acoustic management  &lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;	no	&lt;span class=&quot;nu0&quot;&gt;254&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;0xFE	&lt;span class=&quot;nu0&quot;&gt;128&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;0x80
media status notification      no	no
power-up &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; Standby            &lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;	no
write-read-verify              no	no
unload                         no	no
general purpose logging        &lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;	&lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;
free-fall                      no	no
Data Set Management &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;DSM&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;TRIM&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; no
Host Protected Area &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;HPA&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;      &lt;span class=&quot;kw2&quot;&gt;yes&lt;/span&gt;      no      &lt;span class=&quot;nu0&quot;&gt;160836480&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;160836480&lt;/span&gt;
HPA - Security                 no&lt;/pre&gt;

&lt;p&gt;
で、本命はHDDの切り離し(未試験)
&lt;/p&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:12,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_round wrap_warning plugin_wrap&quot;&gt;
&lt;p&gt;
以下正常動作していないので、試さないように
&lt;/p&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:13,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;ul&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; 参考URL&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://www.ainoniwa.net/pelican/wp/552.html&quot; class=&quot;urlextern&quot; title=&quot;https://www.ainoniwa.net/pelican/wp/552.html&quot;&gt;https://www.ainoniwa.net/pelican/wp/552.html&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://piano2nd.smb.net/~kuji/pukiwiki-1.4.7/index.php?ZFS%20HDD&quot; class=&quot;urlextern&quot; title=&quot;https://piano2nd.smb.net/~kuji/pukiwiki-1.4.7/index.php?ZFS%20HDD&quot;&gt;https://piano2nd.smb.net/~kuji/pukiwiki-1.4.7/index.php?ZFS%20HDD&lt;/a&gt;交換&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://decomo.info/wiki/blog/2017/2017-11-09&quot; class=&quot;urlextern&quot; title=&quot;http://decomo.info/wiki/blog/2017/2017-11-09&quot;&gt;http://decomo.info/wiki/blog/2017/2017-11-09&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://d.hatena.ne.jp/kamosawa/20110726/1311609509&quot; class=&quot;urlextern&quot; title=&quot;http://d.hatena.ne.jp/kamosawa/20110726/1311609509&quot;&gt;http://d.hatena.ne.jp/kamosawa/20110726/1311609509&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://d.hatena.ne.jp/flageo/20121218/p1&quot; class=&quot;urlextern&quot; title=&quot;http://d.hatena.ne.jp/flageo/20121218/p1&quot;&gt;http://d.hatena.ne.jp/flageo/20121218/p1&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code&quot;&gt;# camcontrol devlist -v
# zpool status zfstank
# camcontrol identify ada0
→ diskのシリアル番号確認
# camcontrol eject ada0
→ 失敗(これは、試験したMBもシャシーもHotswap非対応なので当然)
# zpool offline zfstank gpt/ada0
TEST時# gpart destroy -F ada0
TEST時# zpool labelclear -f ada0
TEST時# dd if=/dev/zero of=/dev/ada0 bs=1m count=10
# zpool status zfstank
# camcontrol stop ada0
→ 物理的に抜く
# camcontrol devlist
→ Diskを挿す
# camcontrol rescan all
# camcontrol devlist
→Deviceが認識されていることを確認
# gpart create -s gpt ada0
# gpart add -a 4k -t freebsd-zfs -l ada0 ada0
# zpool status zfstank
# zpool replace zfstank gpt/ada0
# zpool status zfstank&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;(\u304a\u307e\u3051) CAM&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u304a\u307e\u3051_cam&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:6,&amp;quot;secid&amp;quot;:11,&amp;quot;range&amp;quot;:&amp;quot;9721-13345&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit14&quot; id=&quot;nas環境構築&quot;&gt;NAS環境構築&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
NAS関連の作業を以下の順に実施する。
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; NAS公開用ZFS Pool/ZFS/Zvolの作成&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; iSCSI関連の設定とZvolの公開&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; NFS関連の設定とDirectoryの公開&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;NAS\u74b0\u5883\u69cb\u7bc9&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;nas\u74b0\u5883\u69cb\u7bc9&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:9,&amp;quot;secid&amp;quot;:14,&amp;quot;range&amp;quot;:&amp;quot;13346-13556&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit15&quot; id=&quot;zfs関連設定&quot;&gt;ZFS関連設定&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
ZFS関連設定を記載する。
&lt;/p&gt;

&lt;p&gt;
本構成の場合、ZFSに利用するHDDは、ada[0-4]の5台
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;ZFS\u95a2\u9023\u8a2d\u5b9a&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;zfs\u95a2\u9023\u8a2d\u5b9a&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:9,&amp;quot;secid&amp;quot;:15,&amp;quot;range&amp;quot;:&amp;quot;13557-13682&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit16&quot; id=&quot;zfs_poolを作成する&quot;&gt;ZFS poolを作成する&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;ol&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; とにかくZFSのPoolを4Kセクタで作成するための準備&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;sysctl -w vfs.zfs.min_auto_ashift=12&lt;/code&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; この設定を/etc/sysctl.confに書いておくとなおよし&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; GPTでDiskを初期化する&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;http://www.seirios.org/seirios/dokuwiki/doku.php?do=export_code&amp;amp;id=os:freebsd:nas&amp;amp;codeblock=9&quot; title=&quot;この部分をダウンロード&quot; class=&quot;mediafile mf_sh&quot;&gt;zfs_init.sh&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; i &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt;
gpart destroy &lt;span class=&quot;re5&quot;&gt;-F&lt;/span&gt; ada&lt;span class=&quot;re1&quot;&gt;$i&lt;/span&gt;
gpart create &lt;span class=&quot;re5&quot;&gt;-s&lt;/span&gt; gpt ada&lt;span class=&quot;re1&quot;&gt;$i&lt;/span&gt;
gpart add &lt;span class=&quot;re5&quot;&gt;-a&lt;/span&gt; 4k &lt;span class=&quot;re5&quot;&gt;-t&lt;/span&gt; freebsd-zfs &lt;span class=&quot;re5&quot;&gt;-l&lt;/span&gt; slot&lt;span class=&quot;re1&quot;&gt;$i&lt;/span&gt; ada&lt;span class=&quot;re1&quot;&gt;$i&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt;&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; なお、GPTが設定されていないHDDの場合、&lt;code&gt;gpart destroy -F ada$i&lt;/code&gt;の行は本質的に不要であり、&lt;code&gt;gpart: arg0 &amp;#039;ada0&amp;#039;: Invalid argument&lt;/code&gt;というエラーが表示されるが、これは気にしなくて良い。&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; ZFS Poolを作成する&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; atimeをOffに、圧縮アルゴリズムをLZ4に、Unicodeの (比較時) 正規化手法をNormalization Form D(NFD)に設定する&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;pre class=&quot;code&quot;&gt;zpool create -O atime=off -O compression=lz4 -O normalization=formD zfstank raidz2 gpt/slot0 gpt/slot1 gpt/slot2 gpt/slot3 gpt/slot4&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:17,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_round wrap_tip plugin_wrap&quot;&gt;
&lt;p&gt;
zpool createコマンドは、ZFS Poolを作成するだけでなく、同時にpoolと同名のZFSファイルシステムを作成する。
&lt;/p&gt;

&lt;p&gt;
本例で表示した atime/compression/normalization パラメータは、このファイルシステムに対するOption Propertyである。
&lt;/p&gt;

&lt;p&gt;
ZFS poolに対するOption Propertyは、-o(小文字)の後に指定することができる。詳細は &lt;code&gt;man 7 zpool-features&lt;/code&gt; を参照
&lt;/p&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:18,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:19,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_round wrap_tip plugin_wrap&quot;&gt;
&lt;p&gt;
通常、ZFS RAIDz2を利用すると、RAID6相当のパリティーを持つ構成になるため、故障に対して比較的強固になる。
今回は採用しなかったが、さらに冗長性を高めることを考えるのであれば、&lt;code&gt;-o copies=2&lt;/code&gt;もしくは&lt;code&gt;-o copies=3&lt;/code&gt;としておくと、Fileの保存時に、完全なコピーが2もしくは3個作成される。
&lt;/p&gt;

&lt;p&gt;
当然、その分だけ性能は劣化するが、必要に応じて複製が確保されるので、堅牢性が上がる。
&lt;/p&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:20,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:21,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_round wrap_tip plugin_wrap&quot;&gt;
&lt;p&gt;
ZFS poolを作成する場合、それぞれのDiskに個別のLabel(GPT label)を作成しておくことが重要になる。
&lt;/p&gt;

&lt;p&gt;
個別にLabelをつけておくことで、Disk故障などの理由でKernelがDiskを認識する順序が変化してしまった時に、故障したDiskを特定しやすくすることができる。
&lt;/p&gt;

&lt;p&gt;
当然、HDDユニット自体にもラベル名を物理的に記入することが重要になる。
&lt;/p&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:22,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:23,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_round wrap_tip plugin_wrap&quot;&gt;
&lt;p&gt;
normalizationの設定をどのようにするべきかはさんざん悩んだが、ここでは、formDを選択する。
なぜそうしたかは、以下のLinkを参照のこと。
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://b00tb00k.blogspot.jp/2013/07/zfs-on-mac-3-hfs.html&quot; class=&quot;urlextern&quot; title=&quot;http://b00tb00k.blogspot.jp/2013/07/zfs-on-mac-3-hfs.html&quot;&gt;http://b00tb00k.blogspot.jp/2013/07/zfs-on-mac-3-hfs.html&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://key2.jp/~yskhashi/wordpress/?p=427&quot; class=&quot;urlextern&quot; title=&quot;http://key2.jp/~yskhashi/wordpress/?p=427&quot;&gt;http://key2.jp/~yskhashi/wordpress/?p=427&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:24,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;
&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;ZFS pool\u3092\u4f5c\u6210\u3059\u308b&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;zfs_pool\u3092\u4f5c\u6210\u3059\u308b&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:9,&amp;quot;secid&amp;quot;:16,&amp;quot;range&amp;quot;:&amp;quot;13683-16466&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit25&quot; id=&quot;確認作業&quot;&gt;確認作業&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 4k sectorであることの確認&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code&quot;&gt;zdb -C zfstank | grep ashift
                ashift: 12&lt;/pre&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; zpoolの状態確認&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code&quot;&gt;# zpool list
NAME      SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
zfstank  9.06T  1.03M  9.06T         -     0%     0%  1.00x  ONLINE  -&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# zpool status
  pool: zfstank
 state: ONLINE
  scan: none requested
config:

	NAME          STATE     READ WRITE CKSUM
	zfstank       ONLINE       0     0     0
	  raidz2-0    ONLINE       0     0     0
	    gpt/ada0  ONLINE       0     0     0
	    gpt/ada1  ONLINE       0     0     0
	    gpt/ada2  ONLINE       0     0     0
	    gpt/ada3  ONLINE       0     0     0
	    gpt/ada4  ONLINE       0     0     0

errors: No known data errors&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# zpool get -o all all zfstank
NAME     PROPERTY                       VALUE                          SOURCE
zfstank  size                           9.06T                          -
zfstank  capacity                       0%                             -
zfstank  altroot                        -                              default
zfstank  health                         ONLINE                         -
zfstank  guid                           11297120752257816277           default
zfstank  version                        -                              default
zfstank  bootfs                         -                              default
zfstank  delegation                     on                             default
zfstank  autoreplace                    off                            default
zfstank  cachefile                      -                              default
zfstank  failmode                       wait                           default
zfstank  listsnapshots                  off                            default
zfstank  autoexpand                     off                            default
zfstank  dedupditto                     0                              default
zfstank  dedupratio                     1.00x                          -
zfstank  free                           9.06T                          -
zfstank  allocated                      1.03M                          -
zfstank  readonly                       off                            -
zfstank  comment                        -                              default
zfstank  expandsize                     -                              -
zfstank  freeing                        0                              default
zfstank  fragmentation                  0%                             -
zfstank  leaked                         0                              default
zfstank  feature@async_destroy          enabled                        local
zfstank  feature@empty_bpobj            enabled                        local
zfstank  feature@lz4_compress           active                         local
zfstank  feature@multi_vdev_crash_dump  enabled                        local
zfstank  feature@spacemap_histogram     active                         local
zfstank  feature@enabled_txg            active                         local
zfstank  feature@hole_birth             active                         local
zfstank  feature@extensible_dataset     enabled                        local
zfstank  feature@embedded_data          active                         local
zfstank  feature@bookmarks              enabled                        local
zfstank  feature@filesystem_limits      enabled                        local
zfstank  feature@large_blocks           enabled                        local
zfstank  feature@sha512                 enabled                        local
zfstank  feature@skein                  enabled                        local&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# zfs list
NAME      USED  AVAIL  REFER  MOUNTPOINT
zfstank   518K  5.20T   156K  /zfstank&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# zfs get all zfstank
NAME     PROPERTY              VALUE                  SOURCE
zfstank  type                  filesystem             -
zfstank  creation              Tue May 15 15:16 2018  -
zfstank  used                  518K                   -
zfstank  available             5.20T                  -
zfstank  referenced            156K                   -
zfstank  compressratio         1.00x                  -
zfstank  mounted               yes                    -
zfstank  quota                 none                   default
zfstank  reservation           none                   default
zfstank  recordsize            128K                   default
zfstank  mountpoint            /zfstank               default
zfstank  sharenfs              off                    default
zfstank  checksum              on                     default
zfstank  compression           lz4                    local
zfstank  atime                 off                    local
zfstank  devices               on                     default
zfstank  exec                  on                     default
zfstank  setuid                on                     default
zfstank  readonly              off                    default
zfstank  jailed                off                    default
zfstank  snapdir               hidden                 default
zfstank  aclmode               discard                default
zfstank  aclinherit            restricted             default
zfstank  canmount              on                     default
zfstank  xattr                 off                    temporary
zfstank  copies                1                      default
zfstank  version               5                      -
zfstank  utf8only              on                     -
zfstank  normalization         formD                  -
zfstank  casesensitivity       sensitive              -
zfstank  vscan                 off                    default
zfstank  nbmand                off                    default
zfstank  sharesmb              off                    default
zfstank  refquota              none                   default
zfstank  refreservation        none                   default
zfstank  primarycache          all                    default
zfstank  secondarycache        all                    default
zfstank  usedbysnapshots       0                      -
zfstank  usedbydataset         156K                   -
zfstank  usedbychildren        362K                   -
zfstank  usedbyrefreservation  0                      -
zfstank  logbias               latency                default
zfstank  dedup                 off                    default
zfstank  mlslabel                                     -
zfstank  sync                  standard               default
zfstank  refcompressratio      1.00x                  -
zfstank  written               156K                   -
zfstank  logicalused           30.5K                  -
zfstank  logicalreferenced     11.5K                  -
zfstank  volmode               default                default
zfstank  filesystem_limit      none                   default
zfstank  snapshot_limit        none                   default
zfstank  filesystem_count      none                   default
zfstank  snapshot_count        none                   default
zfstank  redundant_metadata    all                    default&lt;/pre&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:26,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_round wrap_tip plugin_wrap&quot;&gt;
&lt;p&gt;
gpartコマンドで状態を確認する
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;# gpart list -a
# gpart show -l		# labelが表示される
# gpart show		# partition tagが表示される
# gpart status		# 現在の状態が表示される&lt;/pre&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:27,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;
&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u78ba\u8a8d\u4f5c\u696d&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u78ba\u8a8d\u4f5c\u696d&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:11,&amp;quot;secid&amp;quot;:25,&amp;quot;range&amp;quot;:&amp;quot;16467-23962&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit28&quot; id=&quot;datasetとzvolを作成する&quot;&gt;datasetとzvolを作成する&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; iSCSI用のzvolを作成&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://github.com/erigones/esdc-ce/wiki/Simple-iSCSI-target-and-initiator-setup&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/erigones/esdc-ce/wiki/Simple-iSCSI-target-and-initiator-setup&quot;&gt;https://github.com/erigones/esdc-ce/wiki/Simple-iSCSI-target-and-initiator-setup&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://decomo.info/wiki/freebsd/freebsd_11_configure_iscsi_target&quot; class=&quot;urlextern&quot; title=&quot;http://decomo.info/wiki/freebsd/freebsd_11_configure_iscsi_target&quot;&gt;http://decomo.info/wiki/freebsd/freebsd_11_configure_iscsi_target&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code&quot;&gt;zfs create -o volmode=dev -V 3T zfstank/zd0v0&lt;/pre&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; NFS用のdatasetを作成&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code&quot;&gt;zfs create zfstank/iso
# Mountpointを特に指定したい場合は、-o mountpoint を指定する
zfs create -o mountpoint=/zfstank/zd0d1 zfstank/iso&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;dataset\u3068zvol\u3092\u4f5c\u6210\u3059\u308b&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;dataset\u3068zvol\u3092\u4f5c\u6210\u3059\u308b&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:18,&amp;quot;secid&amp;quot;:28,&amp;quot;range&amp;quot;:&amp;quot;23963-24444&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit29&quot; id=&quot;確認&quot;&gt;確認&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code&quot;&gt;# zfs list
NAME            USED  AVAIL  REFER  MOUNTPOINT
zfstank        3.09T  2.10T   156K  /zfstank
zfstank/zd0v0  3.09T  5.20T  99.4K  -&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# zfs get all zfstank/zd0v0
NAME           PROPERTY              VALUE                  SOURCE
zfstank/zd0v0  type                  volume                 -
zfstank/zd0v0  creation              Tue May 15 16:10 2018  -
zfstank/zd0v0  used                  3.09T                  -
zfstank/zd0v0  available             5.20T                  -
zfstank/zd0v0  referenced            99.4K                  -
zfstank/zd0v0  compressratio         1.00x                  -
zfstank/zd0v0  reservation           none                   default
zfstank/zd0v0  volsize               3T                     local
zfstank/zd0v0  volblocksize          8K                     -
zfstank/zd0v0  checksum              on                     default
zfstank/zd0v0  compression           lz4                    inherited from zfstank
zfstank/zd0v0  readonly              off                    default
zfstank/zd0v0  copies                1                      default
zfstank/zd0v0  refreservation        3.09T                  local
zfstank/zd0v0  primarycache          all                    default
zfstank/zd0v0  secondarycache        all                    default
zfstank/zd0v0  usedbysnapshots       0                      -
zfstank/zd0v0  usedbydataset         99.4K                  -
zfstank/zd0v0  usedbychildren        0                      -
zfstank/zd0v0  usedbyrefreservation  3.09T                  -
zfstank/zd0v0  logbias               latency                default
zfstank/zd0v0  dedup                 off                    default
zfstank/zd0v0  mlslabel                                     -
zfstank/zd0v0  sync                  standard               default
zfstank/zd0v0  refcompressratio      1.00x                  -
zfstank/zd0v0  written               99.4K                  -
zfstank/zd0v0  logicalused           6K                     -
zfstank/zd0v0  logicalreferenced     6K                     -
zfstank/zd0v0  volmode               dev                    local
zfstank/zd0v0  snapshot_limit        none                   default
zfstank/zd0v0  snapshot_count        none                   default
zfstank/zd0v0  redundant_metadata    all                    default&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# zfs list
NAME            USED  AVAIL  REFER  MOUNTPOINT
zfstank        3.09T  2.10T   156K  /zfstank
zfstank/iso     156K  2.10T   156K  /zfstank/iso
zfstank/zd0v0  3.09T  5.20T  99.4K  -&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# zfs get all zfstank/iso
NAME         PROPERTY              VALUE                  SOURCE
zfstank/iso  type                  filesystem             -
zfstank/iso  creation              Tue May 15 16:11 2018  -
zfstank/iso  used                  156K                   -
zfstank/iso  available             2.10T                  -
zfstank/iso  referenced            156K                   -
zfstank/iso  compressratio         1.00x                  -
zfstank/iso  mounted               yes                    -
zfstank/iso  quota                 none                   default
zfstank/iso  reservation           none                   default
zfstank/iso  recordsize            128K                   default
zfstank/iso  mountpoint            /zfstank/iso           default
zfstank/iso  sharenfs              off                    default
zfstank/iso  checksum              on                     default
zfstank/iso  compression           lz4                    inherited from zfstank
zfstank/iso  atime                 off                    inherited from zfstank
zfstank/iso  devices               on                     default
zfstank/iso  exec                  on                     default
zfstank/iso  setuid                on                     default
zfstank/iso  readonly              off                    default
zfstank/iso  jailed                off                    default
zfstank/iso  snapdir               hidden                 default
zfstank/iso  aclmode               discard                default
zfstank/iso  aclinherit            restricted             default
zfstank/iso  canmount              on                     default
zfstank/iso  xattr                 off                    temporary
zfstank/iso  copies                1                      default
zfstank/iso  version               5                      -
zfstank/iso  utf8only              on                     -
zfstank/iso  normalization         formD                  -
zfstank/iso  casesensitivity       sensitive              -
zfstank/iso  vscan                 off                    default
zfstank/iso  nbmand                off                    default
zfstank/iso  sharesmb              off                    default
zfstank/iso  refquota              none                   default
zfstank/iso  refreservation        none                   default
zfstank/iso  primarycache          all                    default
zfstank/iso  secondarycache        all                    default
zfstank/iso  usedbysnapshots       0                      -
zfstank/iso  usedbydataset         156K                   -
zfstank/iso  usedbychildren        0                      -
zfstank/iso  usedbyrefreservation  0                      -
zfstank/iso  logbias               latency                default
zfstank/iso  dedup                 off                    default
zfstank/iso  mlslabel                                     -
zfstank/iso  sync                  standard               default
zfstank/iso  refcompressratio      1.00x                  -
zfstank/iso  written               156K                   -
zfstank/iso  logicalused           11.5K                  -
zfstank/iso  logicalreferenced     11.5K                  -
zfstank/iso  volmode               default                default
zfstank/iso  filesystem_limit      none                   default
zfstank/iso  snapshot_limit        none                   default
zfstank/iso  filesystem_count      none                   default
zfstank/iso  snapshot_count        none                   default
zfstank/iso  redundant_metadata    all                    default&lt;/pre&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:30,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_round wrap_tip plugin_wrap&quot;&gt;&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; zvolの場合に、compressionがzfstankから引き継いでいることを確認&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; datasetの場合に、compression/atimeがzfstankから引き継がれ、normarizationがzfstankと同じであることを確認&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:31,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;
&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u78ba\u8a8d&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u78ba\u8a8d&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:20,&amp;quot;secid&amp;quot;:29,&amp;quot;range&amp;quot;:&amp;quot;24445-30918&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit32&quot; id=&quot;iscsi関連設定&quot;&gt;iSCSI関連設定&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
iSCSI関係の設定を行う。
&lt;/p&gt;

&lt;p&gt;
一昔前は、iSCSI targetになるためには、istgtコマンドを利用していた。
istgtはUserlandのiSCSI taeget実装であり、NetBSDやMacOS-X Leopardでも動作したため散々お世話になったが、（安定していることもあって）現在ではほぼメンテナンスされていないことと、FreeBSDのDistributionにctldが含まれ、iSCSI targetとして動作させることが可能になったため、本稿ではctldを利用するものとする。
&lt;/p&gt;

&lt;p&gt;
参考
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://github.com/erigones/esdc-ce/wiki/Simple-iSCSI-target-and-initiator-setup&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/erigones/esdc-ce/wiki/Simple-iSCSI-target-and-initiator-setup&quot;&gt;https://github.com/erigones/esdc-ce/wiki/Simple-iSCSI-target-and-initiator-setup&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://decomo.info/wiki/freebsd/freebsd_11_configure_iscsi_target&quot; class=&quot;urlextern&quot; title=&quot;http://decomo.info/wiki/freebsd/freebsd_11_configure_iscsi_target&quot;&gt;http://decomo.info/wiki/freebsd/freebsd_11_configure_iscsi_target&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;iSCSI\u95a2\u9023\u8a2d\u5b9a&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;iscsi\u95a2\u9023\u8a2d\u5b9a&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:24,&amp;quot;secid&amp;quot;:32,&amp;quot;range&amp;quot;:&amp;quot;30919-31642&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit33&quot; id=&quot;設定する&quot;&gt;設定する&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;ol&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;/etc/ctl.conf&lt;/code&gt;を作成&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;pre class=&quot;code&quot;&gt;#
# ctl.conf : FreeBSD iSCSI target configuration
#

# iSCSI portal configuration

portal-group pg0 {
    discovery-auth-group no-authentication
    listen 198.51.100.254:3260
}

# iSCSI target configuration
target iqn.2018-05.org.example:target0 {
    alias &amp;quot;nas-temp zd0v0&amp;quot;
    auth-group no-authentication
    portal-group pg0

    lun 0 {
        path /dev/zvol/zfstank/zd0v0
        blocksize 4096
        option vendor &amp;quot;FreeBSD&amp;quot;
    }
}&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;chmod 640 /etc/ctl.conf&lt;/code&gt;を実行&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;/etc/rc.conf&lt;/code&gt;でctldをenableにする&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;echo &amp;#039;ctld_enable=“YES”&amp;#039; » /etc/rc.conf&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;service ctld start&lt;/code&gt; : ctldを起動&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u8a2d\u5b9a\u3059\u308b&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u8a2d\u5b9a\u3059\u308b&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:24,&amp;quot;secid&amp;quot;:33,&amp;quot;range&amp;quot;:&amp;quot;31643-32341&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit34&quot; id=&quot;確認1&quot;&gt;確認&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;

&lt;p&gt;
筆者の環境はmacOSなので、iSCSIの試験を行うには工夫が必要。
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://qiita.com/kazutomo/items/f5b2d863d9e0729743c2&quot; class=&quot;urlextern&quot; title=&quot;https://qiita.com/kazutomo/items/f5b2d863d9e0729743c2&quot;&gt;Macで無料ツールを使ってiSCSIボリュームをマウントする&lt;/a&gt;
を参考にmacOSに&lt;a href=&quot;https://github.com/iscsi-osx/iSCSIInitiator&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/iscsi-osx/iSCSIInitiator&quot;&gt;iSCSIinitiator&lt;/a&gt;を導入する。
&lt;/p&gt;

&lt;p&gt;
なお、Binaryは&lt;a href=&quot;https://github.com/iscsi-osx/iSCSIInitiator/releases&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/iscsi-osx/iSCSIInitiator/releases&quot;&gt;ここ&lt;/a&gt;にある。
&lt;/p&gt;

&lt;p&gt;
以下、macOSからの確認
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# iscsictl add target iqn.2018-05.org.example:target0,198.51.100.254&lt;/span&gt;
The specified target has been added
&lt;span class=&quot;co0&quot;&gt;# iscsictl list targets&lt;/span&gt;
iqn.2018-05.org.example:target0 &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;inactive, static&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
	198.51.100.254 &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;inactive, port &lt;span class=&quot;nu0&quot;&gt;3260&lt;/span&gt;, interface default&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# iscsictl login iqn.2018-05.org.example:target0,198.51.100.254&lt;/span&gt;
Attached iqn.2018-05.org.example:target0 &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;scsi domain &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, target &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
	FreeBSD CTLDISK 0001
	Serial Number MYSERIAL   &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
	lun &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;: &lt;span class=&quot;kw3&quot;&gt;type&lt;/span&gt; 0x00 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Block device&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# iscsictl list targets&lt;/span&gt;
iqn.2018-05.org.example:target0 &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;active, static, sid &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, tpgt &lt;span class=&quot;nu0&quot;&gt;257&lt;/span&gt;, tsid 0xbadd&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
	198.51.100.254 &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;active, cid &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, port &lt;span class=&quot;nu0&quot;&gt;3260&lt;/span&gt;, interface default&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# iscsictl list luns&lt;/span&gt;
iqn.2018-05.org.example:target0 &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;scsi domain &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, target &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
	FreeBSD CTLDISK 0001
	Serial Number MYSERIAL   &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
	lun &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;: &lt;span class=&quot;kw3&quot;&gt;type&lt;/span&gt; 0x00 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Block device&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
		disk2: &lt;span class=&quot;nu0&quot;&gt;3.3&lt;/span&gt; TB &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;805306368&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4096&lt;/span&gt; byte blocks&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# iscsictl logout iqn.2018-05.org.example:target0,198.51.100.254&lt;/span&gt;
Detached iqn.2018-05.org.seirios.dsk:target0
&lt;span class=&quot;co0&quot;&gt;# iscsictl remove target iqn.2018-05.org.example:target0,198.51.100.254&lt;/span&gt;
The specified portal has been removed
&lt;span class=&quot;co0&quot;&gt;# &lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u78ba\u8a8d&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u78ba\u8a8d1&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:25,&amp;quot;secid&amp;quot;:34,&amp;quot;range&amp;quot;:&amp;quot;32342-33866&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit35&quot; id=&quot;nfs関連設定&quot;&gt;NFS関連設定&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; rc.conf内で、以下の設定が有効になっていることを確認&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; NFSv2およびNFSv4は利用しない&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; NFS Clientにはならない&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; XCP-ngはLinuxなので、Linuxに合わせた設定を行う必要がある&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; RPC関連の挙動が異なったりするので、RCP関連のDaemonは必須&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;pre class=&quot;code&quot;&gt;# NFS Configuration
rpc_lockd_enable=&amp;quot;YES&amp;quot;
rpc_statd_enable=&amp;quot;YES&amp;quot;
rpcbind_enable=&amp;quot;YES&amp;quot;

nfs_client_enable=&amp;quot;NO&amp;quot; 
autofs_enable=&amp;quot;NO&amp;quot; 

mountd_enable=&amp;quot;YES&amp;quot;
mountd_flags=&amp;quot;-lr&amp;quot;
nfs_server_enable=&amp;quot;YES&amp;quot;

nfsv4_server_enable=&amp;quot;NO&amp;quot;
nfsuserd_enable=&amp;quot;NO&amp;quot;
nfsuserd_flags=&amp;quot;-domain localdomain&amp;quot;&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; NFSで公開するDirectoryを指定する&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; 昔から、maproot関連は色々鬼門なので、気になる人は節末のコラムを参照のこと&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;http://www.seirios.org/seirios/dokuwiki/doku.php?do=export_code&amp;amp;id=os:freebsd:nas&amp;amp;codeblock=27&quot; title=&quot;この部分をダウンロード&quot; class=&quot;mediafile mf_&quot;&gt;exports&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code&quot;&gt;/zfstank/iso      -network 198.51.100.0/24 -maproot=root -alldirs&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;NFS\u95a2\u9023\u8a2d\u5b9a&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;nfs\u95a2\u9023\u8a2d\u5b9a&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:26,&amp;quot;secid&amp;quot;:35,&amp;quot;range&amp;quot;:&amp;quot;33867-34779&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit36&quot; id=&quot;確認2&quot;&gt;確認&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;dl class=&quot;plugin_definitionlist&quot;&gt;
&lt;dt&gt;&lt;span class=&quot;term&quot;&gt; &lt;code&gt;showmount -e&lt;/code&gt;&lt;/span&gt;&lt;/dt&gt;
&lt;dd&gt;現在公開しているDirectoryを表示する&lt;/dd&gt;
&lt;dt&gt;&lt;span class=&quot;term&quot;&gt; &lt;code&gt;showmount -a&lt;/code&gt;&lt;/span&gt;&lt;/dt&gt;
&lt;dd&gt;現在NFS mountされているDirとNFS Clientを表示する&lt;/dd&gt;
&lt;/dl&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:37,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_round wrap_tip plugin_wrap&quot;&gt;
&lt;p&gt;
mountdの再起動には、HUP Signalを送れば良い。
&lt;/p&gt;

&lt;p&gt;
&lt;code&gt;/etc/exports&lt;/code&gt;を書き換えた後などで&lt;code&gt;kill -HUP `cat /var/run/mountd.pid`&lt;/code&gt;
を実行すると良い。
&lt;/p&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:38,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:39,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_round wrap_warning plugin_wrap&quot;&gt;
&lt;p&gt;
exportsに記載するオプションとして、&lt;strong&gt;maproot&lt;/strong&gt;がある。
&lt;/p&gt;

&lt;p&gt;
NFSで供給されているファイルシステムに対してrootユーザーが書き込みを行う場合、通常であれば、ファイルのオーナーはrootになるはずである。しかし、これは、ファイルシステムを供給している&lt;strong&gt;NFSサーバー&lt;/strong&gt;および同一のファイルシステムを共有している&lt;strong&gt;他のNFS Client&lt;/strong&gt;が、そのファイルのオーナーを&lt;code&gt;root&lt;/code&gt;として認識することになる。
&lt;/p&gt;

&lt;p&gt;
書き込まれたファイルが一般ファイルであれば多くの場合は問題にならないが、実行ファイルであった場合には脆弱性を生む元凶となる場合がある。
&lt;/p&gt;
&lt;dl class=&quot;plugin_definitionlist&quot;&gt;
&lt;dt&gt;&lt;span class=&quot;term&quot;&gt; 例1&lt;/span&gt;&lt;/dt&gt;
&lt;dd&gt;ShellなどのScriptを実行可能にしておくと、多くのシステムでその実行ファイルを実行することが可能&lt;/dd&gt;
&lt;dt&gt;&lt;span class=&quot;term&quot;&gt; 例2&lt;/span&gt;&lt;/dt&gt;
&lt;dd&gt;実行ファイルにSUID Bitを立てておくと何が起こるか感がて見てください&lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;
そのため、特にroot userが書き込む場合にのみ、Fileのオーナーを別のUIDに割り当てる機能がmaprootである。
&lt;/p&gt;

&lt;p&gt;
例えば&lt;code&gt;-maproot=nobody:nogroup&lt;/code&gt;とした場合、rootがそのファイルシステムにファイルを作成すると、&lt;code&gt;Owner:Group = nobody:nogroup&lt;/code&gt;となる。
&lt;/p&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:40,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;
&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u78ba\u8a8d&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u78ba\u8a8d2&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:28,&amp;quot;secid&amp;quot;:36,&amp;quot;range&amp;quot;:&amp;quot;34780-36483&amp;quot;} --&gt;
&lt;h1 class=&quot;sectionedit41&quot; id=&quot;落ち穂拾い&quot;&gt;落ち穂拾い&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:42,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_round wrap_tip plugin_wrap&quot;&gt;
&lt;p&gt;
&lt;code&gt;/var/log/messages&lt;/code&gt; に GPT table is corrupt が出ている場合。
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;gpart recover &amp;lt;geom&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 参考: &lt;a href=&quot;http://yomemacs.hatenablog.jp/entry/2014/02/04/205509&quot; class=&quot;urlextern&quot; title=&quot;http://yomemacs.hatenablog.jp/entry/2014/02/04/205509&quot;&gt;http://yomemacs.hatenablog.jp/entry/2014/02/04/205509&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:43,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:44,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_round wrap_tip plugin_wrap&quot;&gt;
&lt;p&gt;
TimeMachineバックアップに使う場合
&lt;/p&gt;

&lt;p&gt;
TimeMachine用、DVD鑑賞用、写真バックアップ用のパーティションを afp で見えるようにすればよい。
&lt;/p&gt;

&lt;p&gt;
MacのFinderの接続あたりから &lt;code&gt;afp://xxx.xxx.xxx.xxx:5128&lt;/code&gt; とかやればOKのはず
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; netatalk3を入れる&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;pkg install netatalk3&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; 参考&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://blog.khubla.com/freebsd/timemachine-backups-on-freebsd-10&quot; class=&quot;urlextern&quot; title=&quot;http://blog.khubla.com/freebsd/timemachine-backups-on-freebsd-10&quot;&gt;http://blog.khubla.com/freebsd/timemachine-backups-on-freebsd-10&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://netatalk.sourceforge.net/3.0/htmldocs/configuration.html#idp139639143834112&quot; class=&quot;urlextern&quot; title=&quot;http://netatalk.sourceforge.net/3.0/htmldocs/configuration.html#idp139639143834112&quot;&gt;http://netatalk.sourceforge.net/3.0/htmldocs/configuration.html#idp139639143834112&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://illumos.org/msg/ZFS-8000-9P&quot; class=&quot;urlextern&quot; title=&quot;http://illumos.org/msg/ZFS-8000-9P&quot;&gt;http://illumos.org/msg/ZFS-8000-9P&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
これでMacOSからも見れるようになる。
&lt;/p&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:45,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:46,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_round wrap_tip plugin_wrap&quot;&gt;
&lt;p&gt;
参考
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://qiita.com/ryuinada/items/36535a0e7f1846d89fb6&quot; class=&quot;urlextern&quot; title=&quot;https://qiita.com/ryuinada/items/36535a0e7f1846d89fb6&quot;&gt;https://qiita.com/ryuinada/items/36535a0e7f1846d89fb6&lt;/a&gt; ZFSのRAIDZの修復とついでに拡張する&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:47,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;
&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u843d\u3061\u7a42\u62fe\u3044&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u843d\u3061\u7a42\u62fe\u3044&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:28,&amp;quot;secid&amp;quot;:41,&amp;quot;range&amp;quot;:&amp;quot;36484-&amp;quot;} --&gt;</description>
            <author>seirios@undisclosed.example.com (seirios)</author>
            <pubDate>Sat, 28 Mar 2026 07:26:28 +0000</pubDate>
        </item>
        <item>
            <title>Emacs - [macOS] </title>
            <link>http://www.seirios.org/seirios/dokuwiki/doku.php?id=userapps:emacs</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;emacs&quot;&gt;Emacs&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;div&gt;&lt;div id=&quot;nojs_indexmenu_42634880269794bd3dd7b9&quot; data-jsajax=&quot;%26sort%3Dt%26msort%3Dindexmenu_n%26group%3D1&quot; class=&quot;indexmenu_nojs&quot;&gt;
&lt;ul class=&quot;idx&quot;&gt;
&lt;li class=&quot;level1&quot; &gt;&lt;div class=&quot;li&quot;&gt;&lt;a href=&quot;http://www.seirios.org/seirios/dokuwiki/doku.php?id=userapps:emacs:go-translate&quot; class=&quot;wikilink1&quot; title=&quot;userapps:emacs:go-translate&quot; data-wiki-id=&quot;userapps:emacs:go-translate&quot;&gt;go-translate&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;level1&quot; &gt;&lt;div class=&quot;li&quot;&gt;&lt;a href=&quot;http://www.seirios.org/seirios/dokuwiki/doku.php?id=userapps:emacs:mu4e&quot; class=&quot;wikilink1&quot; title=&quot;userapps:emacs:mu4e&quot; data-wiki-id=&quot;userapps:emacs:mu4e&quot;&gt;mu4e&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;/div&gt;&lt;script type=&#039;text/javascript&#039;&gt;
&lt;!--//--&gt;&lt;![CDATA[//&gt;&lt;!--
var indexmenu_42634880269794bd3dd7b9 = new dTree(&#039;indexmenu_42634880269794bd3dd7b9&#039;,&#039;bj-tango.png&#039;);
indexmenu_42634880269794bd3dd7b9.config.urlbase=&#039;/seirios/dokuwiki/doku.php?id=&#039;;
indexmenu_42634880269794bd3dd7b9.config.sepchar=&#039;:&#039;;
indexmenu_42634880269794bd3dd7b9.config.useCookies=false;
indexmenu_42634880269794bd3dd7b9.config.jsajax=&#039;%26sort%3Dt%26msort%3Dindexmenu_n%26group%3D1&#039;;
indexmenu_42634880269794bd3dd7b9.add(&#039;userapps:emacs&#039;,0,-1,&quot;Emacs&quot;,&#039;userapps:emacs&#039;);
indexmenu_42634880269794bd3dd7b9.add(&#039;userapps:emacs:go-translate&#039;,1,0,&quot;go-translate&quot;,0,0,0);
indexmenu_42634880269794bd3dd7b9.add(&#039;userapps:emacs:mu4e&#039;,2,0,&quot;mu4e&quot;,0,0,0);
document.write(indexmenu_42634880269794bd3dd7b9);
jQuery(function(){indexmenu_42634880269794bd3dd7b9.init(0,1,&quot;&quot;,1,0);});
//--&gt;&lt;!]]&gt;
&lt;/script&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Emacs&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;emacs&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-107&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;まくら&quot;&gt;まくら　&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Emacsはとても古いEditor実装である。自分がEmacsを利用し始めたのは、高校生の時代にX68000を使っていた頃のはず。PC8801-mk2SRの次に入手したのがX68000だったとおもう。
&lt;/p&gt;

&lt;p&gt;
それまでもPCは使っていた。88の頃は主にゲームばかり。X68000を手に入れてパソコン通信のChatにはまり、PC9801LVを入手してBBSサーバーにしたりはしていたが、普段使いのComputerはX68000だったと思う。
&lt;/p&gt;

&lt;p&gt;
プログラムを書くようになって最初に手に馴染んだEditorはμEmacsだった。X68000でmicro Emacsを使い始めたのが最初だったと思う。そこからNEmacsに移り、Muleに移り、icam版GNU Emacsに移っていった。当時、TeXにがっつりハマり、pTeX(pLaTeXではない)で縦書き３段組の同人誌を作ったりもしていた。EmacsでTeX modeが非常に便利だったことを覚えている。
&lt;/p&gt;

&lt;p&gt;
それ以来EditorといえばEmacs系のものを利用している。浪人時代に、中古で買ったSony NEWS(NEWS 1250, NEWS830, NEWS 3860)でThin EthernetでNetworkを組み、X68000をSerial Terminal にしてみたり、大学でSun MicrosystemsのSPARCstation 5, 10, IPC, IPX あたりを利用していたが、その時もEditorは常にEmacsだった。
&lt;/p&gt;

&lt;p&gt;
大学時代から、Unix System管理者としては、当然にed, ex, viを「最小限」使っていた。「viはEmacsをCompileするためのpatch適用のためのEditorでしょ」なんてイキがっていたこともあった。要するに、EmacsのKey Bindingsに体が馴染んでおり、他のEditorに引っ越すことができなかっただけだろう。当然、秀丸、Vzなど様々なEditorを触ってきたし、なんとなれば EcripsやVisualStudioなどのIDEも利用したことはあるが、やはりEmacsに戻ってきてしまった。
&lt;/p&gt;

&lt;p&gt;
社会人になっても、Reportや提出書類の大半はTeXを利用していた(WYSIWYGなんて面倒で不便と思っていた。今でもそう思うことは多い)ので、2000年代前半まではEmacs/TeXでほとんどの文書を処理していたし、WordやExcelを使わざるを得ない場合は、同僚のPCで処理させてもらうという悪逆非道なことをしていた。しかし、仕事の関係でどうしてもExcelやPowerPoint/KeyNoteを利用することがメインになったため、しばらく(15年くらい)ほとんどEmacsを利用していなかった。
&lt;/p&gt;

&lt;p&gt;
最近またEmacsに戻ってきたので、備忘録も兼ねてEmacsの設定などを記載することにした。
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;マクラが長い。しかも割と黒歴史だったorz...&lt;/pre&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_info wrap_round plugin_wrap&quot;&gt;&lt;ul&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; 2024/11/07&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; Updated for emacs-plus@31&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; Remove poll(Removed from emacs-plus because poll causes problem&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; install after commandline, add sign.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;
&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u307e\u304f\u3089\u3000&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u307e\u304f\u3089&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;108-3007&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit5&quot; id=&quot;環境とinstall&quot;&gt;環境とInstall&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
2024年現在、メイン端末はMacBookProで、管理しているサーバーは大半がFreeBSD(一部NetBSD, OpenBSD, AlmaLinux, Debian GNU Linux, Ubuntu, Windows11がある)である。したがって、最も利用する端末であるMacBookProにEmacsを導入しており、その他の環境では原則としてvi系のSystem標準Editorを利用している。
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u74b0\u5883\u3068Install&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u74b0\u5883\u3068install&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;3008-3411&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit6&quot; id=&quot;環境&quot;&gt;環境&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;div class=&quot;table sectionedit7&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;thead&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; 年代 &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; 端末 &lt;/th&gt;&lt;th class=&quot;col2&quot;&gt; CPU &lt;/th&gt;&lt;th class=&quot;col3&quot;&gt; Memory &lt;/th&gt;&lt;th class=&quot;col4&quot;&gt; &lt;abbr title=&quot;Operating System&quot;&gt;OS&lt;/abbr&gt; &lt;/th&gt;
	&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; 2024年 &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; MacBookPro 16“ 2019 &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Intel Core-i9 &lt;/td&gt;&lt;td class=&quot;col3&quot;&gt; 64G &lt;/td&gt;&lt;td class=&quot;col4&quot;&gt; macOS Sonoma/14.6.1 &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; 2024年 &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; VM(XCP-ng) &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; AMD Ryzen7 3700X &lt;/td&gt;&lt;td class=&quot;col3&quot;&gt; 4G &lt;/td&gt;&lt;td class=&quot;col4&quot;&gt; FreeBSD 14.1 &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;secid&amp;quot;:7,&amp;quot;range&amp;quot;:&amp;quot;3430-3611&amp;quot;} --&gt;
&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u74b0\u5883&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u74b0\u5883&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;3412-3612&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit8&quot; id=&quot;install&quot;&gt;Install&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
昔はSource Codeを持ってきてCompileしていたが現在では流石にBinary Packageを利用している。
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Install&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;install&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:8,&amp;quot;range&amp;quot;:&amp;quot;3613-3749&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit9&quot; id=&quot;macos&quot;&gt;macOS&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;

&lt;p&gt;
MacOSの場合、IMEのInline patchを当てないとMetaコマンド系を入力する際に&lt;code&gt;M-あ&lt;/code&gt;などとなって少し（というかだいぶ）不便なので、patchを適用する。
そのため、少し面倒な対応が必要になる。
&lt;/p&gt;

&lt;p&gt;
[参考]
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://qiita.com/wakamenod/items/db3ca7d16df37f4768b7&quot; class=&quot;urlextern&quot; title=&quot;https://qiita.com/wakamenod/items/db3ca7d16df37f4768b7&quot;&gt;Macに日本語インラインパッチをあててEmacs30をインストールする&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;https://github.com/takaxp/ns-inline-patch&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/takaxp/ns-inline-patch&quot;&gt;An enhanced inline patch for GNU Emacs&lt;/a&gt; Mac用IME Patch&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
macOSに &lt;a href=&quot;https://brew.sh&quot; class=&quot;urlextern&quot; title=&quot;https://brew.sh&quot;&gt;HomeBrew&lt;/a&gt; を導入し、以下の一連の流れでInstallした。
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;$ mkdir ~/.config/emacs-plus
$ vi ~/.config/emacs-plus/build.yml
icon: modern-pen
patches:
  - aggressive-read-buffering
  - frame-transparency
  - mac-font-use-typo-metrics
$ brew tap d12frosted/emacs-plus	# Emacs-plusのtapを追加 brew tapで取り込んでいるTapを確認できる
$ brew edit emacs-plus@31		# Emacs-plus@30 (2024年8月現在のHead) のConfigを修正
.... configuration ....
  #
  # Patches
  #

  opoo &amp;quot;The option --with-imagemagick is deprecated and will be removed in a future version. Modern Emacs has native support for most image formats (SVG via librsvg, WebP, PNG, JPEG, GIF). If you rely on ImageMagick, please open an issue describing your use case.&amp;quot; if build.with? &amp;quot;imagemagick&amp;quot;
  local_patch &amp;quot;system-appearance&amp;quot;, sha: &amp;quot;53283503db5ed2887e9d733baaaf80f2c810e668e782e988bda5855a0b1ebeb4&amp;quot;
  local_patch &amp;quot;round-undecorated-frame&amp;quot;, sha: &amp;quot;26947b6724fc29fadd44889808c5cf0b4ce6278cf04f46086a21df50c8c4151d&amp;quot;
  # Added by seirios
  patch do
    url &amp;quot;https://raw.githubusercontent.com/takaxp/ns-inline-patch/master/emacs-head-inline.patch&amp;quot;
  end

  #
  # Install
  #
.... configuration ....
$ brew install --formula d12frosted/emacs-plus/emacs-plus@31 --with-mailutils
$ osascript -e &amp;#039;tell application &amp;quot;Finder&amp;quot; to make alias file to posix file &amp;quot;/opt/homebrew/opt/emacs-plus@31/Emacs.app&amp;quot; at POSIX file &amp;quot;/Applications&amp;quot; with properties {name:&amp;quot;Emacs.app&amp;quot;}&amp;#039;
$ sudo codesign --force --deep --sign - /opt/homebrew/opt/emacs-plus@31/Emacs.app
$ brew services start d12frosted/emacs-plus/emacs-plus@31&lt;/pre&gt;

&lt;p&gt;
ここまでを実行すると、
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; /Applications FolderにEmacs.appが作成される&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; LaunchPad にEmacsアイコンが追加され、&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 起動項目にemacsが追加され、&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; BackgroundでEmacsが起動&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
される。一応 Inline-patch を確認するために、一度Emacsを起動し、
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;M-x mac-ime-toggle&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;M-x mac-ime-activate&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;M-x mac-ime-deactivate&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
が動作するかを確認しておく。
&lt;/p&gt;

&lt;p&gt;
なお、自明だが、ImageMagickやDBUSを利用する場合には、&lt;code&gt;brew install imagemagick dbus&lt;/code&gt;を実行しておくこと。
&lt;/p&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:10,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_info wrap_round plugin_wrap&quot;&gt;
&lt;p&gt;
このIME用 Inline-Patchを適用した場合、init.elに以下のelisp codeを追加しておくと良い。
&lt;/p&gt;
&lt;pre class=&quot;code lisp&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;memq window-system &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;ns &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
           &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;fboundp &#039;mac-get-current-input-source&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;version&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;27.0&amp;quot;&lt;/span&gt; emacs-version&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;;; Required for some cases when auto detection is failed or the locale is &amp;quot;en&amp;quot;.&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;custom-set-variables
     &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;mac-default-input-source &lt;span class=&quot;st0&quot;&gt;&amp;quot;com.google.inputmethod.Japanese.base&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;mac-input-method-mode &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:11,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:12,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_alert wrap_round plugin_wrap&quot;&gt;
&lt;p&gt;
Emacs install時の引数に &lt;code&gt;–with-x11&lt;/code&gt; を追加すると、Compileに失敗した(@2024/08/15)
&lt;/p&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:13,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:14,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_info wrap_round plugin_wrap&quot;&gt;
&lt;p&gt;
&lt;code&gt;–with-imagemagick&lt;/code&gt;をつけてCompile/Installすると、mu4eを利用している時に画像などが綺麗に出力されるので、余裕があるなら入れておくほうが良い。&lt;br/&gt;

&lt;del&gt;&lt;code&gt;–with-dbus&lt;/code&gt;をつけてCompile/Installすると、Process間通信のMessage BUSとしてDBUSを利用する。&lt;/del&gt;　Obsolate.
&lt;/p&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:15,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:16,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_alert wrap_round plugin_wrap&quot;&gt;
&lt;p&gt;
&lt;a href=&quot;https://github.com/d12frosted/homebrew-emacs-plus/issues/742&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/d12frosted/homebrew-emacs-plus/issues/742&quot;&gt;https://github.com/d12frosted/homebrew-emacs-plus/issues/742&lt;/a&gt;&lt;br/&gt;

ここにあるように、macOS Sequoiaにおいて、Xcode commandline tools を最新にすると、Emacs.appを実行できない。&lt;br/&gt;

sudo codesign –force –deep –sign - /usr/local/opt/emacs-plus@31/Emacs.app&lt;br/&gt;

によってApp FileをSignすると実行できるようになる。注意すること
&lt;/p&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:17,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:18,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_alert wrap_round plugin_wrap&quot;&gt;
&lt;p&gt;
Reading directory: Operation not permitted エラーが出て、Emacsからフォルダが開けない場合&lt;br/&gt;

macOS SequoiaでEmacsをInstallした後、どうしてもDesktop FolderをEmacsから開けなかった。&lt;br/&gt;

こういう時は、一度フルディスクアクセス設定を削除したのち、もう一度フルディスクアクセス設定を行うことで回避できる可能性がある。&lt;br/&gt;

Commandlineから sudo tccutil reset All org.gnu.Emacs を実行し、システム環境設定からセキュリティ→フルディスクアクセスに移動し、左下の「＋」からEmacs.appを追加。その後、Emacs.appを再度起動すると、Desktopフォルダにアクセスできるようになった。
&lt;/p&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:19,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;
&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;macOS&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;macos&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:9,&amp;quot;range&amp;quot;:&amp;quot;3750-8652&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit20&quot; id=&quot;freebsd&quot;&gt;FreeBSD&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;

&lt;p&gt;
自分はFreeBSDをサーバーとして利用しており、GUIを利用していない。そのため、EmacsをX11経由ではなくConsoleから利用している。ほとんどの接続がssh経由だからこれでよい。
&lt;/p&gt;

&lt;p&gt;
したがって、EmacsのInstallは
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co4&quot;&gt;$ &lt;/span&gt;doas pkg &lt;span class=&quot;kw2&quot;&gt;install&lt;/span&gt; emacs-nox		&lt;span class=&quot;co0&quot;&gt;# sudoでもよい&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
で終わりである。
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;FreeBSD&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;freebsd&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:20,&amp;quot;range&amp;quot;:&amp;quot;8653-9033&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit21&quot; id=&quot;初期設定&quot;&gt;初期設定&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Emacsはそれ単体では最小限のことしかできない。しかし、Emacs-Lispを組み込み、設定を行うことで色々なことができるようになる。これを称して、昔は、「EmacsはEditorではない。Environmentである」などとも言われていた。
&lt;/p&gt;

&lt;p&gt;
以下、個人の設定。 (2024/08/26)
&lt;/p&gt;

&lt;p&gt;
ここで、Packageごとの設定など、細かいことを説明すればいいんだろうけど、かなり面倒なので、コメントで勘弁して。
&lt;/p&gt;

&lt;p&gt;
このinit.elは、byte-compileするとgo-translate関連の変数が未定義扱いになる。
本来は&lt;code&gt;:custom&lt;/code&gt;で設定すべきなんだろうと思うがうまく行かなかったので、とりあえずは&lt;code&gt;:config&lt;/code&gt;で逃げてある。
&lt;/p&gt;
&lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;http://www.seirios.org/seirios/dokuwiki/doku.php?do=export_code&amp;amp;id=userapps:emacs&amp;amp;codeblock=3&quot; title=&quot;この部分をダウンロード&quot; class=&quot;mediafile mf_el&quot;&gt;early-init.el&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code lisp&quot;&gt;&lt;span class=&quot;co1&quot;&gt;;;; -*- lexical-binding: t; -*-&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; ~/.config/emacs/early-init.el --- Early initialization&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; last updated: 2026/01/02&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; Author: HEO SeonMeyong &amp;lt;seirios@seirios.org&amp;gt;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; log&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; 2026/01/02	Refactoring by Microsoft Copilot.&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;; 起動直後は GC を後ろ倒し（起動後に元へ戻す）&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; gc-cons-threshold most-positive-fixnum&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;add-hook &#039;emacs-startup-hook &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;lambda&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; gc-cons-threshold &lt;span class=&quot;nu0&quot;&gt;134217728&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;; package.el は自動では有効化しない（init.el側で initialize）&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; package-enable-at-startup &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;; フレームの暗黙のリサイズ抑制（ちらつき防止）&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; frame-inhibit-implied-resize t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;; 早期に不要なUIをオフ&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;push &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;tool-bar-lines &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;   default-frame-alist&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;push &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;menu-bar-lines &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;   default-frame-alist&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;push &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;vertical-scroll-bars&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; default-frame-alist&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;provide &#039;early-init&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; early-init.el ends here&lt;/span&gt;&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;
&lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;http://www.seirios.org/seirios/dokuwiki/doku.php?do=export_code&amp;amp;id=userapps:emacs&amp;amp;codeblock=4&quot; title=&quot;この部分をダウンロード&quot; class=&quot;mediafile mf_el&quot;&gt;init.el&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code lisp&quot;&gt;&lt;span class=&quot;co1&quot;&gt;;;; -*- lexical-binding: t; -*-&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; ~/.config/emacs/init.el --- Refactored init.el (Intel macOS)&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; last updated: 2026/01/02&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; Author: HEO SeonMeyong &amp;lt;seirios@seirios.org&amp;gt;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; Tips&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; emacs -nw -q --batch --eval &#039;(message system-configuration-options)&#039;	; Emacs compile option(Commandline)&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; emacs --batch -f batch-byte-compile init.el				; init.elの文法チェック(init.elcは削除すること)&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; Prefix keys memo&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; C-? : Control+?&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; M-? : Meta(ESC)+?&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; s-? : Super(command)+?&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; S-? : Shift+?	(本当？)&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; コメント定義&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; セミコロン 3 つは段落コメント&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; セミコロン 2 つはコードブロックコメント&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; セミコロン 1 つは、行コメント&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; Reference site&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; https://emacs-jp.github.io						; 日本のEmacsユーザーのためのハブサイト&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;   https://emacs-jp.github.io/tips/emacs-in-2020			; * 2020年代のEmacs入門&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; https://qiita.com/conao3/items/347d7e472afd0c58fbd7			; * Emacs入門から始めるleaf.el入門&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; https://qiita.com/conao3/items/dc88bdadb0523ef95878			; * leaf.elで「init.el」をクリーンにする&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; https://uwabami.github.io/cc-env/Emacs.html				; Emacs の設定&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; https://zenn.dev/zenwerk/scraps/b1280f66c8d11a			; Emacs設定記 2021&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html	; Emacs Manual&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; https://github.com/purcell/exec-path-from-shell			; Macでshellから環境変数を取り込む&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; log&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; 2026/01/02	Refactoring by Microsoft Copilot.&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; Path &amp;amp; package bootstrap&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;; 追加の elisp を load-path に加える（存在チェック付き）&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;extra-paths &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;/usr/local/share/emacs/site-lisp&amp;quot;&lt;/span&gt;
                     &lt;span class=&quot;st0&quot;&gt;&amp;quot;~/.config/emacs/elisp/&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;dolist&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;p extra-paths&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;abs&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;expand-file-name p&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;file-directory-p &lt;span class=&quot;kw1&quot;&gt;abs&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;add-to-list &#039;load-path &lt;span class=&quot;kw1&quot;&gt;abs&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;; Info の追加ディレクトリ（Homebrew等）&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;dolist&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;info-dir &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;/usr/local/share/info/&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;file-directory-p info-dir&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;add-to-list &#039;Info-default-directory-list info-dir&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;; package.el の初期化（early-init.el で package-enable-at-startup を nil にしている前提）&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;require &#039;package&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;custom-set-variables
 &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;package-archives &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;gnu&amp;quot;&lt;/span&gt;   &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;https://elpa.gnu.org/packages/&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;melpa&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;https://melpa.org/packages/&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;org&amp;quot;&lt;/span&gt;   &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;https://orgmode.org/elpa/&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
 &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;package-gnupghome-dir &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;expand-file-name &lt;span class=&quot;st0&quot;&gt;&amp;quot;.gnupg&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;getenv &lt;span class=&quot;st0&quot;&gt;&amp;quot;HOME&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;package-initialize&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;; leaf を未導入なら取得&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;unless &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;package-installed-p &#039;leaf&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;package-refresh-contents&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;package-install &#039;leaf&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf leaf-keywords
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;ensure&lt;/span&gt; t
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;config&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf-keywords-init&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;; customize の書き込み先を分離&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; custom-file &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;expand-file-name &lt;span class=&quot;st0&quot;&gt;&amp;quot;~/.config/emacs/custom.el&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;file-exists-p custom-file&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;load custom-file&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; macOS: シェルの環境変数を取り込む（GUI起動でも PATH 等を揃える）&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf exec-path-from-shell
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;ensure&lt;/span&gt; t
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;require&lt;/span&gt; t
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;memq window-system &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;mac ns x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;config&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;dolist&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;var &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;PATH&amp;quot;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;MANPATH&amp;quot;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;LD_LIBRARY_PATH&amp;quot;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;LIBRARY_PATH&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;add-to-list &#039;exec-path-from-shell-variables var&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;exec-path-from-shell-initialize&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; 基本設定（UI/操作系）&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf cus-start
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;doc&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Builtins のカスタマイズをまとめる&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;bind&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;M-%&amp;quot;&lt;/span&gt;      &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; replace-regexp&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-c M-%&amp;quot;&lt;/span&gt;  &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; query-replace-regexp&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-%&amp;quot;&lt;/span&gt;      &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; replace-string&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-c C-%&amp;quot;&lt;/span&gt;  &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; query-replace&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-z&amp;quot;&lt;/span&gt;      &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; undo&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-x c&amp;quot;&lt;/span&gt;    &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; browse-url-at-point&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-h&amp;quot;&lt;/span&gt;      &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; delete-backward-char&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-c C-l&amp;quot;&lt;/span&gt;  &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; toggle-truncate-lines&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-c /&amp;quot;&lt;/span&gt;    &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; comment-or-uncomment-region&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-c l&amp;quot;&lt;/span&gt;    &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; display-line-numbers-mode&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-s&amp;quot;&lt;/span&gt;      &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; isearch-forward&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;co1&quot;&gt;;; mu4e ランチャー&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-x m&amp;quot;&lt;/span&gt;    &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; mu4e&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;co1&quot;&gt;;; Tab-bar 操作（mac風）&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;s-}&amp;quot;&lt;/span&gt;      &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; tab-bar-switch-to-next-tab&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;s-{&amp;quot;&lt;/span&gt;      &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; tab-bar-switch-to-prev-tab&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;s-T&amp;quot;&lt;/span&gt;      &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; tab-new&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;s-w&amp;quot;&lt;/span&gt;      &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; tab-close&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;hook&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;minibuffer-setup-hook &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; shrink-window-if-larger-than-buffer&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;custom&lt;/span&gt; &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;create-lockfiles &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;                 &lt;span class=&quot;co1&quot;&gt;; lockfile を作らない&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;debug-on-error &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;                     &lt;span class=&quot;co1&quot;&gt;; エラー時 backtrace&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;frame-resize-pixelwise &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;enable-recursive-minibuffers &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;history-length &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;history-delete-duplicates &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;scroll-preserve-screen-position &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;scroll-conservatively &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10000&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;scroll-step &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;scroll-margin &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;visible-bell &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;text-quoting-style &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &#039;straight&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;truncate-lines &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;                   &lt;span class=&quot;co1&quot;&gt;; 折り返し表示&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;tab-width &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;line-number-display-limit-width &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10000&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;resize-mini-windows &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;max-mini-window-height &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;indicate-empty-lines &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;indicate-buffer-boundaries &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &#039;left&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gc-cons-percentage &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0.2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gc-cons-threshold &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;134217728&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;         &lt;span class=&quot;co1&quot;&gt;; 128MB&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;menu-bar-mode &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;tool-bar-mode &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;scroll-bar-mode &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;indent-tabs-mode &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;transient-mark-mode &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;tab-bar-mode &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;config&lt;/span&gt;
  &lt;span class=&quot;co1&quot;&gt;;; yes-or-no を y/n に短縮&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;defalias &#039;yes-or-no-p &#039;y-or-n-p&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;co1&quot;&gt;;; 改行のバックスラッシュを非表示&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-display-table-slot standard-display-table &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; ?\ &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-display-table-slot standard-display-table &#039;wrap ?\ &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;co1&quot;&gt;;; macOS 固有&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf cus-start-mac
    &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;eq&lt;/span&gt; system-type &#039;darwin&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;custom&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;ns-alternate-modifier &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &#039;meta&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
             &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;ns-use-srgb-colorspace &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
             &lt;span class=&quot;co1&quot;&gt;;; Frame Transparency (for emacs-plus@31)&lt;/span&gt;
             &lt;span class=&quot;co1&quot;&gt;;; (set-frame-parameter nil &#039;ns-alpha-elements nil)	; Not use Transparency&lt;/span&gt;
             &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-frame-parameter &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt; &#039;ns-alpha-elements &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;ns-alpha-all&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
             &lt;span class=&quot;co1&quot;&gt;;; Choose elements:&lt;/span&gt;
             &lt;span class=&quot;co1&quot;&gt;;; - Full list: ns-alpha-default (default face/background)&lt;/span&gt;
             &lt;span class=&quot;co1&quot;&gt;;;              ns-alpha-fringe (fringes + internal border clears)&lt;/span&gt;
             &lt;span class=&quot;co1&quot;&gt;;;              ns-alpha-box (boxed face outlines)&lt;/span&gt;
             &lt;span class=&quot;co1&quot;&gt;;;              ns-alpha-stipple (stipple mask background clears)&lt;/span&gt;
             &lt;span class=&quot;co1&quot;&gt;;;              ns-alpha-relief (3D relief/shadow lines)&lt;/span&gt;
             &lt;span class=&quot;co1&quot;&gt;;;              ns-alpha-glyphs (glyph background fills like hl-line/region)&lt;/span&gt;
             &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-frame-parameter &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt; &#039;ns-alpha-elements
                 &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;ns-alpha-default ns-alpha-fringe ns-alpha-glyphs&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
             &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-frame-parameter &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt; &#039;alpha-background &lt;span class=&quot;nu0&quot;&gt;0.8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
             &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-frame-parameter &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt; &#039;ns-background-blur &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;; dired のショートカット&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf dired &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;bind&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;dired-mode-map&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;u&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; dired-up-directory&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; 多言語環境（mule）&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf mule
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;config&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-language-environment &#039;Japanese&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-terminal-coding-system &#039;utf-&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-keyboard-coding-system &#039;utf-&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-buffer-file-coding-system &#039;utf-&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-file-name-coding-system &#039;utf-&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-clipboard-coding-system &#039;utf-&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;prefer-coding-system &#039;utf-&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-default-coding-systems &#039;utf-&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;eq&lt;/span&gt; system-type &#039;darwin&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;customize-set-variable &#039;default-input-method &lt;span class=&quot;st0&quot;&gt;&amp;quot;macOS&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; GUI/フォント&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;memq window-system &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x mac ns&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;defvar my-frame-parameters
    &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;height &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;45&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;width &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;188&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;top &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;left &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;line-spacing &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;left-fringe &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;right-fringe &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;cursor-type &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; box&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;alpha &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;95&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;foreground-color &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;#F2F2F2&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;background-color &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;#000040&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;cursor-color &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;#C0C000&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;mouse-color &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;#8D8D8D&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; default-frame-alist my-frame-parameters&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; frame-title-format &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;multiple-frames &lt;span class=&quot;st0&quot;&gt;&amp;quot;%b&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt; invocation-name&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; blink-cursor-mode t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; frame-inherited-parameters &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;font tool-bar-lines&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; ns-pop-up-frames &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;co1&quot;&gt;;; mac/ns フォント&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;memq window-system &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;mac ns&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;global-set-key &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;s-mouse-&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &#039;browse-url-at-mouse&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;let&lt;/span&gt;* &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;size &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
           &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;jpfont &lt;span class=&quot;st0&quot;&gt;&amp;quot;PlemolJP&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
           &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;asciifont &lt;span class=&quot;st0&quot;&gt;&amp;quot;PlemolJP&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
           &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;h &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;* size &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-face-attribute &#039;default &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;family&lt;/span&gt; asciifont &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;height&lt;/span&gt; h&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-fontset-font t &#039;katakana-jisx0201 jpfont&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-fontset-font t &#039;japanese-jisx0208 jpfont&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-fontset-font t &#039;japanese-jisx0212 jpfont&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-fontset-font t &#039;japanese-jisx0213-&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; jpfont&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-fontset-font t &#039;japanese-jisx0213-&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; jpfont&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-fontset-font t &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;#x0080 &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; #x024F&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; asciifont&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; face-font-rescale-alist
          &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;^-apple-hiragino.*&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1.2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;.*-Hiragino Maru Gothic ProN-.*&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1.2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;.*osaka-bold.*&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1.2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;.*osaka-medium.*&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1.2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;.*courier-bold-.*-mac-roman&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1.0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;.*monaco cy-bold-.*-mac-cyrillic&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0.9&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;.*monaco-bold-.*-mac-roman&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0.9&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;-cdac$&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1.3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;co1&quot;&gt;;; マウス設定&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; mouse-drag-copy-region t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; mouse-wheel-scroll-amount &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;shift&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;control&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; mouse-wheel-progressive-speed &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; Builtins: modeline/time 等&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf which-function &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;custom&lt;/span&gt; &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;which-function-mode &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf time
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;hook&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;emacs-startup-hook &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; display-time-mode&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;custom&lt;/span&gt; &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;display-time-interval &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;display-time-string-forms &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;format &lt;span class=&quot;st0&quot;&gt;&amp;quot;%s:%s:%s&amp;quot;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;24&lt;/span&gt;-hours minutes seconds&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;display-time-day-and-date &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf browse-url
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;custom&lt;/span&gt; &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;browse-url-browser-function &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &#039;browse-url-generic&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;config&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;eq&lt;/span&gt; system-type &#039;darwin&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;customize-set-variable &#039;browse-url-generic-program &lt;span class=&quot;st0&quot;&gt;&amp;quot;open&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf time-stamp
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;hook&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;before-save-hook &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; time-stamp&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;custom&lt;/span&gt; &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;time-stamp-active &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;time-stamp-start &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;last updated: &amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;time-stamp-format &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;%Y/%02m/%02d&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;time-stamp-end &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot; &lt;span class=&quot;es0&quot;&gt;\n&lt;/span&gt;$&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; 表示/編集補助&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;setq-default display-line-numbers &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;			&lt;span class=&quot;co1&quot;&gt;;; 行番号は基本オフ（必要なら C-c l で局所的にトグル）&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;global-display-line-numbers-mode -&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;			&lt;span class=&quot;co1&quot;&gt;;; ← nil ではなく -1 で確実に OFF&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; column-number-mode t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; size-indication-mode t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf whitespace
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;require&lt;/span&gt; t
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;hook&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;find-file-hook &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;lambda&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;whitespace-mode &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;config&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; whitespace-style &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;face trailing tabs empty spaces&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;;; 全角スペースのみ可視化&lt;/span&gt;
        whitespace-space-regexp &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es0&quot;&gt;\\&lt;/span&gt;(&lt;span class=&quot;es0&quot;&gt;\\&lt;/span&gt;u3000+&lt;span class=&quot;es0&quot;&gt;\\&lt;/span&gt;)&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;co1&quot;&gt;;; フェイスは一度だけ設定&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-face-attribute &#039;whitespace-trailing &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;foreground&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;DeepPink&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;background&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Purple4&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;underline&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-face-attribute &#039;whitespace-tab &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;foreground&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;RoyalBlue4&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;background&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;gray20&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;underline&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-face-attribute &#039;whitespace-space &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;background&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;blue3&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;foreground&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;GreenYellow&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;weight&lt;/span&gt; &#039;bold &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;underline&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;set-face-attribute &#039;whitespace-empty &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;
    &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;foreground&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;MediumPurple4&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;background&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;thistle4&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;underline&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;global-whitespace-mode t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf paren
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;hook&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;emacs-startup-hook &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; show-paren-mode&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;custom&lt;/span&gt; &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;show-paren-delay &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;show-paren-style &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &#039;mixed&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf simple
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;custom&lt;/span&gt; &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;kill-ring-max &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;kill-read-only-ok &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;kill-whole-line &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;eval-expression-print-length &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;eval-expression-print-level &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;indent-tabs-mode &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;mail-user-agent &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &#039;mu4e-user-agent&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf files
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;custom&lt;/span&gt; &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;make-backup-files &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;backup-by-copying &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;version-control &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;kept-new-versions &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;kept-old-versions &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;delete-old-versions &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;auto-save-timeout &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;auto-save-interval &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;delete-auto-save-files &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf startup
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;config&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; init-file-debug t
        auto-save-list-file-prefix &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;locate-user-emacs-file &lt;span class=&quot;st0&quot;&gt;&amp;quot;backup/.saves-&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        inhibit-startup-screen t
        inhibit-startup-message t
        inhibit-startup-echo-area-message t
        initial-scratch-message &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; 補完: company&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf company
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;ensure&lt;/span&gt; t
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;bind&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-M-i&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; company-complete&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;company-active-map&lt;/span&gt;
          &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-n&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; company-select-next&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
          &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-p&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; company-select-previous&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
          &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-s&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; company-filter-candidates&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
          &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-h&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
          &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-S-h&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; company-show-doc-buffer&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
          &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;lt;tab&amp;gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; company-complete-common&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;company-search-map&lt;/span&gt;
          &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-n&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; company-select-next&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
          &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-p&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; company-select-previous&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;custom&lt;/span&gt; &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;company-idle-delay &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0.3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;company-minimum-prefix-length &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;company-transformers &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;company-sort-by-backend-importance&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;company-auto-expand &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;company-selection-wrap-around &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;completion-ignore-case &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;company-dabbrev-downcase &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;company-show-numbers &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; 言語モード&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf lua-mode
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;ensure&lt;/span&gt; t
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;mode&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es0&quot;&gt;\\&lt;/span&gt;.lua&lt;span class=&quot;es0&quot;&gt;\\&lt;/span&gt;&#039;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; lua-mode&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;interpreter&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;lua&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; lua-mode&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;custom&lt;/span&gt; &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lua-indent-level &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lua-indent-string-contents &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lua-indent-nested-block-content-align &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lua-indent-close-paren-align &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lua-default-application &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;/usr/local/bin/lua&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lua-default-command-switches &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;-i&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lua-always-show &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;config&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;add-hook &#039;lua-mode-hook #&#039;company-mode&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf caddyfile-mode
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;ensure&lt;/span&gt; t
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;mode&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;Caddyfile&lt;span class=&quot;es0&quot;&gt;\\&lt;/span&gt;&#039;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; caddyfile-mode&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;caddy&lt;span class=&quot;es0&quot;&gt;\\&lt;/span&gt;.conf&lt;span class=&quot;es0&quot;&gt;\\&lt;/span&gt;&#039;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; caddyfile-mode&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;hook&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;caddyfile-mode-hook &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;lambda&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;setq-local tab-width &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;
                                                     indent-tabs-mode &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf nginx-mode
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;ensure&lt;/span&gt; t
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;mode&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;nginx&lt;span class=&quot;es0&quot;&gt;\\&lt;/span&gt;.conf&lt;span class=&quot;es0&quot;&gt;\\&lt;/span&gt;&#039;&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; nginx-mode&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;hook&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;nginx-mode-hook &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; company-mode&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf w3m
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;ensure&lt;/span&gt; t
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;custom&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;w3m-command &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;/usr/local/bin/w3m&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf vc-fossil
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;ensure&lt;/span&gt; t
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;init&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;add-to-list &#039;vc-handled-backends &#039;Fossil t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; 翻訳: go-translate (鍵は環境変数/認証ストアから取得推奨)&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf go-translate
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;ensure&lt;/span&gt; t
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;bind&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;C-c t&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; gt-do-translate&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;custom&lt;/span&gt; &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gt-langs &lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt; &#039;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;en ja&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;config&lt;/span&gt;
  &lt;span class=&quot;co1&quot;&gt;;; DeepL API キーは環境変数 DEEPL_API_KEY から取得。未設定なら DeepL を使わず Google/Bing へフォールバック。&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;deepl-key &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;getenv &lt;span class=&quot;st0&quot;&gt;&amp;quot;DEEPL_API_KEY&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; gt-default-translator
          &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gt-translator
           &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;taker&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gt-taker &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;text&lt;/span&gt; &#039;buffer &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;pick&lt;/span&gt; &#039;paragraph&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
           &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;engines&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;delq &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gt-deepl-engine &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;d7b2482e-9a53-43a5-885d-bc511b7b0aad:fx&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;pro&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                                    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gt-google-engine&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                                    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gt-bing-engine&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
           &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;render&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gt-buffer-render&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; EasyPG (GPG)&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;leaf epa-file
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;require&lt;/span&gt; t
  &lt;span class=&quot;sy0&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;config&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;epa-file-enable&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
  &lt;span class=&quot;co1&quot;&gt;;; pinentry-mode は epg-config の変数&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;with-eval-after-load &#039;epg-config
    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;setq&lt;/span&gt; epg-pinentry-mode &#039;loopback&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; mu4e 設定を分離ロード&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;load &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;expand-file-name &lt;span class=&quot;st0&quot;&gt;&amp;quot;~/.config/emacs/mu4e-init.el&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; t&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;provide &#039;init&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;;;; init.el ends here&lt;/span&gt;&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u521d\u671f\u8a2d\u5b9a&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u521d\u671f\u8a2d\u5b9a&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:21,&amp;quot;range&amp;quot;:&amp;quot;9034-&amp;quot;} --&gt;</description>
            <author>seirios@undisclosed.example.com (seirios)</author>
            <pubDate>Tue, 27 Jan 2026 23:31:02 +0000</pubDate>
        </item>
        <item>
            <title>mu4e - [mu4e] </title>
            <link>http://www.seirios.org/seirios/dokuwiki/doku.php?id=userapps:emacs:mu4e</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;mu4e&quot;&gt;mu4e&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;mu4e&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;mu4e&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-20&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;まくら&quot;&gt;まくら&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
元々は家でゲームがしたい（小学生のことTAITOのSpace Invaderが大ブームになった）という理由で始めたコンピューターとの付き合いが、いつの間にか人とのCommunicationの手段になったのは、明らかにパソコン通信のせいで、参加していたBBSのChat roomに入り浸るようになってからだったように思う。
&lt;/p&gt;

&lt;p&gt;
Unixを触るようになり、UUCPで自宅に居ながらにして電子メールが使えるようになって以来、数年前までは間違いなくE-Mailこそが他者とのCommunicationの中心にあった。
したがって、筆者の場合、E-Mailの読み書きを簡単にできるようなApplicationが最も重要なツールであった時代が長い。
&lt;/p&gt;

&lt;p&gt;
そのため、メールクライアントは色々使ってきた。それなりの期間（最低でも半年以上）利用したツールは
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; rmail       (Emacs)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Gnus        (Emacs)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; mew         (Emacs) おそらく、これが一番長い&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Bekky       (Windows)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; WinBiff     (Windows)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Apple Mail  (macOS)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Thunderbird (macOS/Windows/FreeBSD)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Shylpheed	(macOS)&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
と、幾つもあった。しかし、個人的な要件を満たすMail Readerはあまりなかった。動作するPlatformが限られていたり、表示が望み通りにならなかったり、EoLになったり…
&lt;/p&gt;

&lt;p&gt;
というわけで、Sylpheedを卒業して次のMail Readerに移行することにした。
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u307e\u304f\u3089&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u307e\u304f\u3089&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;21-1529&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit3&quot; id=&quot;準備&quot;&gt;準備&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
今回の選択はmu4eである。
mu4eはmuコマンドを利用したメールの検索機能を利用して、Emacs上でMailの読み書きを行うためのツールである。
&lt;/p&gt;

&lt;p&gt;
mu4eを利用してMailを処理するためにはいくつかの方法があるが、今回は以下の構成で行くことにした。
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; IMAPを利用して手元にメールを同期するsoftware → mbsync(isync)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; smtpを利用してメールを送信するsoftware      → msmtp&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Emacs                                  → GNU Emacs 30&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; メール処理                               → mu, mu4e&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u6e96\u5099&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u6e96\u5099&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;1530-2149&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit4&quot; id=&quot;mbsync&quot;&gt;mbsync&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
mbsyncは、RemoteのMDA(IMAP Server)からメールを手元に持ってくるツールである。
Mailboxの同期をEmacs上で行わないのでメールの取得とメールの処理を独立して行えるのがメリットである。
なお、mu4eはメールボックスがありさえすれば良いので、mbsyncである必要はない。imapsyncなどいくつかのツールがあるので、好みのものを選べば良いだろう。
&lt;/p&gt;

&lt;p&gt;
今回は、複数のアカウントをまとめて管理する前提で設定を行う。
設定の詳細は、man mbsyncなどしてman pageを見ること。
ここでは、うちで動作した設定を改変して記述してある。
名前付け替えなどいくつかトリッキーなことをしているので、わからなければManualを読むべきである。
&lt;/p&gt;

&lt;p&gt;
なお、本記事においては、動作確認なども兼ねているためpasswordをrawで記載しているが、これはGPGなどを利用して暗号化するべきである。
暗号化の方法などはGoogleで検索すれば大量に出てくるので、そちらを参照のこと。
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;#
# .mbsyncrc	- configuration for mbsync.
#

##### General Configuration
Create		Both
Expunge		Both
CopyArrivalDate	yes
Sync		All
SyncState	*

##### sample@example.com (Dovecot)
IMAPAccount	sample_example
Host		dovecot.example.com
Port		993
User		sample@example.com
Pass		Ultra-Secret
SSLType		IMAPS

### IMAP Store configuration
IMAPStore	mls_seirios-remote
Account		mls_seirios

### Maildir Store configuration
MaildirStore	sample_example-local
SubFolders	Verbatim
Path		~/Maildir/sample_example/
Inbox		~/Maildir/sample_example/Inbox

### Channel Configuration
Channel		sample_example-local
Far		:sample_example-remote:
Near		:sample_example-local:
Patterns	*

##### sample@icloud.com (Apple Mail)
IMAPAccount	sample_icloud
Host		imap.mail.me.com
Port		993
User		sample@icloud.com
Pass		Apple-Application-password-set-at-Apple
SSLType		IMAPS
AuthMechs	PLAIN

### IMAP Store configuration
IMAPStore	sample_icloud-remote
Account		sample_icloud

### Maildir Store configuration
MaildirStore	sample_icloud-local
SubFolders	Verbatim
Path		~/Maildir/sample_icloud/
Inbox		~/Maildir/sample_icloud/Inbox

### Channel Configuration
Channel		sample_icloud-base
Far		:sample_icloud-remote:
Near		:sample_icloud-local:
Patterns	* !Sent !&amp;quot;Sent Messages&amp;quot; !Spam !&amp;quot;Junk&amp;quot; !Trash !&amp;quot;Deleted Messages&amp;quot;

Channel		sample_icloud-base-sent
Far		:sample_icloud-remote:&amp;quot;Sent Messages&amp;quot;
Near		:sample_icloud-local:Sent

Channel		sample_icloud-base-spam
Far		:sample_icloud-remote:&amp;quot;Junk&amp;quot;
Near		:sample_icloud-local:Spam

Channel		sample_icloud-base-trash
Far		:sample_icloud-remote:&amp;quot;Deleted Messages&amp;quot;
Near		:sample_icloud-local:Trash

Group		sample_icloud
Channel		sample_icloud-base
Channel		sample_icloud-sent
Channel		sample_icloud-spam
Channel		sample_icloud-trash

##### sample@gmail.com (Gmail)
##### もし、GmailのIMAP Folderが日本語だった場合、Gmailから表示を英語モードにしておくこと。日本語だとうまくいかないことがある
IMAPAccount	sample_gmail
Host		imap.gmail.com
Port		993
User		sample@gmail.com
Pass		Gmail-Application-password-set-at-Gmail
SSLType		IMAPS
AuthMechs	PLAIN

### IMAP Store configuration
IMAPStore	sample_gmail-remote
Account		sample_gmail

### Maildir Store configuration
MaildirStore	sample_gmail-local
SubFolders	Verbatim
Path		~/Maildir/sample_gmail/
Inbox		~/Maildir/sample_gmail/Inbox

### Channel Configuration
Channel		sample_gmail-base
Far		:sample_gmail-remote:
Near		:sample_gmail-local:
Patterns	* !&amp;quot;[Gmail]*&amp;quot; !Sent !Spam !Trash

Channel		sample_gmail-sent
Far		:sample_gmail-remote:&amp;quot;[Gmail]/Sent Mail&amp;quot;
Near		:sample_gmail-local:Sent

Channel		sample_gmail-spam
Far		:sample_gmail-remote:&amp;quot;[Gmail]/Spam&amp;quot;
Near		:sample_gmail-local:Spam

Channel		sample_gmail-trash
Far		:sample_gmail-remote:&amp;quot;[Gmail]/Trash&amp;quot;
Near		:sample_gmail-local:Trash

Group		sample_gmail
Channel		sample_gmail-base
Channel		sample_gmail-sent
Channel		sample_gmail-spam
Channel		sample_gmail-trash

##### sheo0147@yahoo.co.jp (Yahoo! Japan)
IMAPAccount	sample_yahoo
Host		imap.mail.yahoo.co.jp
Port		993
User		sample@yahoo.co.jp
Pass		Ultra-Secret
SSLType		IMAPS

### IMAP Store configuration
IMAPStore	sample_yahoo-remote
Account		sample_yahoo

### Maildir Store configuration
MaildirStore	sample_yahoo-local
SubFolders	Verbatim
Path		~/Maildir/sample_yahoo/
Inbox		~/Maildir/sample_yahoo/Inbox

### Channel Configuration
Channel		sample_yahoo-base
Far		:sample_yahoo-remote:
Near		:sample_yahoo-local:

Channel		sample_yahoo-spam
Far		:sample_yahoo-remote:&amp;quot;Bulk Mail&amp;quot;
Near		:sample_yahoo-local:Spam

Group		sheo0147_yahoo
Channel		sample_yahoo-base
Channel		sample_yahoo-spam&lt;/pre&gt;

&lt;p&gt;
ここまで設定したら、Directoryを作成し、mbsync -aを実行する
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;$ &lt;span class=&quot;kw2&quot;&gt;mkdir&lt;/span&gt; ~&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;Maildir
$ &lt;span class=&quot;kw2&quot;&gt;mkdir&lt;/span&gt; ~&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;Maildir&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;sample_example ~&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;Maildir&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;sample_icloud ~&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;Maildir&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;sample_gmail ~&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;Maildir&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;sample_yahoo
$ mbsync &lt;span class=&quot;re5&quot;&gt;-a&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
これで、手元にMailが来たはず
&lt;/p&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_info wrap_round plugin_wrap&quot;&gt;&lt;ul&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; yahooの設定の際にPatternsを削除しているのは意図的である。&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; 原因はよくわかっていないが、Yahooの場合だけ、Patternsを登録しているとInboxの同期に失敗する&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; とりあえずPatternsを設定しなければうまく行くという不思議なことが起きているので、現時点では外す&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;
&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;mbsync&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;mbsync&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;2150-7586&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit7&quot; id=&quot;muの初期化&quot;&gt;muの初期化&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;

&lt;p&gt;
Mailを取得したら、muでメールのIndexを作成する。
muはXapianを利用している。Xapianは原則としてヨーロッパ系言語の検索が主眼なので、日本語検索は厳しいかと思っていたが、FLAG_NGRAMS=“1”を設定することでそれなりに対応できることがわかったので、以下を設定してmuでDBを初期化する
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;$ &lt;span class=&quot;kw3&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;re2&quot;&gt;XAPIAN_CJK_NGRAM&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;t&amp;quot;&lt;/span&gt;
$ &lt;span class=&quot;kw3&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;re2&quot;&gt;FLAG_NGRAMS&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;t&amp;quot;&lt;/span&gt;
$ mbsync &lt;span class=&quot;re5&quot;&gt;-a&lt;/span&gt;
$ mu init &lt;span class=&quot;re5&quot;&gt;--maildir&lt;/span&gt;=~&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;Maildir \
  &lt;span class=&quot;re5&quot;&gt;--my-address&lt;/span&gt;=sample&lt;span class=&quot;sy0&quot;&gt;@&lt;/span&gt;example.com \
  &lt;span class=&quot;re5&quot;&gt;--my-address&lt;/span&gt;=sample&lt;span class=&quot;sy0&quot;&gt;@&lt;/span&gt;icloud.com \
  &lt;span class=&quot;re5&quot;&gt;--my-address&lt;/span&gt;=sample&lt;span class=&quot;sy0&quot;&gt;@&lt;/span&gt;gmail.com \
  &lt;span class=&quot;re5&quot;&gt;--my-address&lt;/span&gt;=sample&lt;span class=&quot;sy0&quot;&gt;@&lt;/span&gt;yahoo.co.jp
$ mu index
$ mu info store
....&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;mu\u306e\u521d\u671f\u5316&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;mu\u306e\u521d\u671f\u5316&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:7,&amp;quot;range&amp;quot;:&amp;quot;7587-8280&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit8&quot; id=&quot;msmtp&quot;&gt;msmtp&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
msmtpはSMTP Clientで、メールを送信する際に利用できる。
&lt;/p&gt;

&lt;p&gt;
近年では、UCE/SPAMのような単なる迷惑メールだけでなく、Cyber攻撃の道具としてもメールが利用されているため、メールを送信するための制限が厳しくなっている。
電子メールの送信にあたっては、送信用のSMTPサーバー(MTA)がそのメールを送付する資格があるかどうかを確認(SPF, DKIM, DMARCを利用する)され、大量のメールを送信する(MailingListを運営している場合など)場合には、更なる検査(ARCを利用)をされる。
例えば sample@example.com がFromとなるメールを送信することができるMXを限定し、そこ以外から送られたものは迷惑メールもしくは攻撃メールの可能性が高いと判断する、などができるようになっている。
&lt;/p&gt;

&lt;p&gt;
したがって、自分のように「複数のメールアカウントを持って」おり、「それぞれを必要に応じて使い分ける」ような使い方をしている場合、メールを送付する際にどのMTAを利用すれば良いかいちいち判断し、適切なMTAからメールを送る必要がある。これを行うためのツールがmsmtpである。
&lt;/p&gt;

&lt;p&gt;
なお、mbsyncと同様、メール送信系をmsmtpにするべき強い理由はない。単にmsmtpの例が非常に多いから利用しているだけである。
また、本記事の設定は動作確認なども兼ねているためpasswordをrawで記載している。しかし、生パスワードを設定ファイルに記載することはSecurity上の重大なリスクになる可能性が高い。したがって、これはGPGなどを利用して暗号化するべきである。 暗号化の方法などはman msmtpするなり、検索するなりすれば大量に出てくるので、そちらを参照のこと。
&lt;/p&gt;

&lt;p&gt;
以下設定。上記mbsyncと合わせてある。
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;#
# .msmtprc	- configuration for msmtp.
#

defaults
logfile ~/Maildir/.log/msmtp.log

##### sample@example.com
account sample_example
auth on
host smtp.example.com
port 465
protocol smtp
from sample@example.com
user sample@example.com
password Ultra_secret
tls on
tls_starttls off

##### sample@icloud.com
# *** WARNING *** Must need STARTTLS. This site doesn&amp;#039;t use SMTPs.
account sample_icloud
auth on
host smtp.mail.me.com
port 587
protocol smtp
from sample@icloud.com
user sample@icloud.com
password Apple-Application-password-set-at-Apple
tls on
tls_starttls on

##### sample@gmail.com
account sample_gmail
auth on
host smtp.gmail.com
port 465
protocol smtp
from sample@gmail.com
user sample@gmail.com
password Gmail-Application-password-set-at-Gmail
tls on
tls_starttls off

##### sample@yahoo.co.jp
account sample_yahoo
auth on
host smtp.mail.yahoo.co.jp
port 465
protocol smtp
from sample@yahoo.co.jp
user sample@yahoo.co.jp
password Ultra-Secret
tls on
tls_starttls off

account default : sample_example&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;msmtp&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;msmtp&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:8,&amp;quot;range&amp;quot;:&amp;quot;8281-11306&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit9&quot; id=&quot;mu4e1&quot;&gt;mu4e&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
mu4eの設定は、以下の理由で巨大になっています。こんなに難しいことしなくてもいい気はするんだけど…
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; MultiAccount対応&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Mailの取り扱いはAccountに関係なくシームレスに行える&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; どこのINBOXに来たメールでも、別のサーバーにrefileできるようにしてある&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; refile ruleを大きく書き換えて、正規表現も込みにしたruleをかけるようにした&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 送信サーバーは、メールのFromフィールドを見て自動で決定するようにした&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
まぁ、色々なところから色々設定持ってきたり、PerplexityやMS copilotのお世話になったりしてます。
難しいcodeは書いてないから、コメント見ながら読めばわかると思いたい。
というかわかるということにします。
&lt;/p&gt;
&lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;http://www.seirios.org/seirios/dokuwiki/doku.php?do=export_code&amp;amp;id=userapps:emacs:mu4e&amp;amp;codeblock=4&quot; title=&quot;この部分をダウンロード&quot; class=&quot;mediafile mf_el&quot;&gt;mu4e-init.el&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code&quot;&gt;;;; -*- lexical-binding: t; -*-
;;; ~/.config/emacs/mu4e-init.el
;;;
;;; last updated: 2026/01/02
;;; Author: HEO SeonMeyong &amp;lt;seirios@seirios.org&amp;gt;
;;;         Microsoft Copilot (Rewrite and support leaf)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Tips
;;; * Create new refile folder
;;;   $ mkdir -p ~/Maildir/[Mailbox]/some/where/{new,cur/tmp}
;;;   $ chmod -R 700 ~/Maildir/[Mailbox]/some/where/{new,cur/tmp}
;;;   $ mbsync -a
;;;   $ mu index
;;;   * 要するに、正しいpermissionで正しくFolder(Directory)を作成してmbsyncで同期してindexを張ればOK
;;;   * 逆に削除はDirectoryごと全部削除すればよさそう

;;; Informations(Links)
;;; * https://www.djcbsoftware.nl/code/mu/mu4e/HV-Custom-headers.html

;;; 定義・機能一覧:
;;;  - my/which: Homebrew と環境 PATH の両方で実行ファイルを探索するヘルパー
;;;  - my-mu4e-update-mail-and-index-async: 非同期 mbsync + mu index
;;;  - my/mu4e-start-background-update: タイマーで定期バックグラウンド更新開始
;;;  - my/mu4e-stop-background-update: タイマー停止
;;;  - キーバインド: U → 非同期更新 (mu4e メインビュー/ヘッダビュー)
;;;  - ポリシー: 起動時自動更新は無効・インデックス更新は常にバックグラウンド
;;;
;;; よく調整するパラメータ (本ファイル内のコメントを検索してください):
;;;  * 定期更新間隔分: (my/mu4e-start-background-update 30)  ; 30分
;;;  * mbsync/mu/msmtp のパス探索候補: my/which の引数リスト
;;;  * mu4e-context-policy / mu4e-compose-context-policy:
;;;     &amp;#039;pick-first / &amp;#039;ask / &amp;#039;ask-if-none / nil
;;;  * mu4e-headers-results-limit: ヘッダの最大取得件数 (性能/読みやすさのトレードオフ)
;;;  * display-buffer-alist: 本文ビューを右側へ固定表示するウィンドウ設定
;;; ----------------------------------------------------------------------

;;; 小さなユーティリティ（実行ファイル探索と簡易コンテキスト生成）
(defun my/which (&amp;amp;rest candidates)
  &amp;quot;CANDIDATES のうち、最初に見つかった実行ファイルの絶対パスを返す。ない場合は nil。
候補は、絶対パス文字列とコマンド名の混在でよい。
- 絶対パスが渡された場合: 実行可能ならそのパスを返す
- コマンド名が渡された場合: `executable-find` で PATH 上を探索する

例:
 (my/which \&amp;quot;/usr/local/bin/mbsync\&amp;quot; \&amp;quot;/opt/homebrew/bin/mbsync\&amp;quot; \&amp;quot;mbsync\&amp;quot;)&amp;quot;
  (seq-some (lambda (c)
              (cond
               ((file-name-absolute-p c) (and (file-executable-p c) c))
               (t (executable-find c))))
            candidates))

(defun my/mk-context (name maildir-prefix email &amp;amp;optional signature)
  &amp;quot;mu4e 用コンテキストを簡潔に生成する。
NAME は識別名、MAILDIR-PREFIX は \&amp;quot;/XXXX\&amp;quot; 形式、EMAIL は送信元。
SIGNATURE を与えると `message-signature` を設定する。

例:
 (my/mk-context \&amp;quot;1seirios_seirios\&amp;quot; \&amp;quot;/seirios_seirios\&amp;quot; \&amp;quot;seirios@seirios.org\&amp;quot; \&amp;quot;=====\nHEO ...\&amp;quot;)&amp;quot;
  (make-mu4e-context
   :name name
   :enter-func (lambda () (mu4e-message (format &amp;quot;Enter %s context&amp;quot; email)))
   :leave-func (lambda () (mu4e-message (format &amp;quot;Leave %s context&amp;quot; email)))
   :match-func (lambda (msg)
                 (when msg
                   (string-prefix-p maildir-prefix
                                    (mu4e-message-field msg :maildir))))
   :vars (append
          `((user-mail-address . ,email)
            (user-full-name   . &amp;quot;HEO SeonMeyong&amp;quot;)
            (mu4e-drafts-folder . ,(concat maildir-prefix &amp;quot;/Drafts&amp;quot;))
            (mu4e-sent-folder   . ,(concat maildir-prefix &amp;quot;/Sent&amp;quot;))
            (mu4e-trash-folder  . ,(concat maildir-prefix &amp;quot;/Trash&amp;quot;)))
          (when signature
            `((message-signature . ,signature))))))


;;;; mu4e のロードパスを動的に追加（Intel / Apple Silicon 両対応）
(dolist (cand &amp;#039;(&amp;quot;/usr/local/share/emacs/site-lisp/mu/mu4e/&amp;quot;
                &amp;quot;/opt/homebrew/share/emacs/site-lisp/mu/mu4e/&amp;quot;))
  (when (file-directory-p cand)
    (add-to-list &amp;#039;load-path cand)))

;;;; 起動時の自動更新を制御するトグル
;; Toggle for legacy mu4e auto-update (built-in interval &amp;amp; startup hook)
;;  - When t: mu4e の定期更新 (`mu4e-update-interval`) を使う
;;  - When nil: 組み込みの auto update は無効にして、代わりに自作タイマーを使う
(defvar my/mu4e-auto-update t
  &amp;quot;mu4eの組み込み自動更新を使うなら t。nil なら起動時/定期更新とも無効。&amp;quot;)

(leaf mu4e
  :load-path &amp;quot;/usr/local/share/emacs/site-lisp/mu/mu4e/&amp;quot; ; Homebrew の mu4e パス
  :require t
  :preface
  ;; MIMEのHTML等を抑止（ロード前定義でOK）
  ;; これにより本文表示は極力 text/plain を優先する。
  (with-eval-after-load &amp;quot;mm-decode&amp;quot;
    (add-to-list &amp;#039;mm-discouraged-alternatives &amp;quot;text/html&amp;quot;)
    (add-to-list &amp;#039;mm-discouraged-alternatives &amp;quot;text/richtext&amp;quot;))

  :custom
  ;; ---- 全体動作/UI系をまとめて :custom で設定 ----
  ;; インデックス更新は常にバックグラウンドで（UIフリーズを避ける）
  ((mu4e-index-update-in-background . t)  ; Run mu index update asynchronously to avoid UI blocking
   ;; Maildir と添付保存先
   (mu4e-maildir . &amp;quot;~/Maildir&amp;quot;)
   (mu4e-attachment-dir . &amp;quot;~/Desktop&amp;quot;)
   ;; mbsync でメール移動時、ファイル名を変更（重複衝突などを回避）
   (mu4e-change-filenames-when-moving . t)
   ;; 終了確認やモードライン表示
   (mu4e-confirm-quit . nil)
   (mu4e-modeline-show-global . t)
   (mu4e-modeline-max-width . 100)
   ;; 表示：本文ビューを右側へ固定（display-buffer-alist 併用）
   (mu4e-split-view . &amp;quot;vertical&amp;quot;)
   ;; ミニバッファに出る「Retrieving…」などの雑音を極力隠す
   (mu4e-hide-index-messages . t)
   ;; コンテキストの選択ポリシー（起動時は最初を採用）
   (mu4e-context-policy . &amp;#039;pick-first)
   ;; ヘッダ表示系（関連メッセージ非表示、結果上限、スレッド表示等）
   (mu4e-headers-include-related . nil)
   (mu4e-headers-results-limit . 5000)
   (mu4e-headers-show-threads . t)
   (mu4e-headers-date-format . &amp;quot;%Y-%m-%dT%H:%M:%S&amp;quot;)
   (mu4e-headers-fields
    . &amp;#039;((:date . 20) (:flags . 6) (:from . 16) (:to . 16) (:subject . nil)))
   ;; 本文ビューのフィールド
   (mu4e-view-date-format . &amp;quot;%Y-%m-%dT%H:%M:%S&amp;quot;)
   (mu4e-view-fields
    . &amp;#039;(:from :to :cc :subject :flags :date :maildir :mailing-list
              :tags :attachments :signature :decryption :message-id
              :path :user-agent))
   ;; Compose 時のコンテキスト選択ポリシー（マッチしなければ確認）
   (mu4e-compose-context-policy . &amp;#039;ask-if-none)
   ;; 署名の自動挿入は無効（コンテキストで signature を持つもののみ）
   (mu4e-compose-signature-auto-include . nil)
   ;; 送信系（mu4e を使い、sendmail 経由で送る）
   (mail-user-agent . &amp;#039;mu4e-user-agent)
   (send-mail-function . &amp;#039;sendmail-send-it)
   (message-send-mail-function . &amp;#039;message-send-mail-with-sendmail)
   (message-kill-buffer-on-exit . t)
   (message-sendmail-envelope-from . &amp;#039;header)
   ;; 既定ブックマーク（InboxやSPAMなどショートカット検索）
   (mu4e-bookmarks
    . &amp;#039;((:name &amp;quot;Unread messages&amp;quot;  :query &amp;quot;flag:unread AND NOT flag:trashed&amp;quot; :favorite t :key ?u)
        (:name &amp;quot;seirios.seirios&amp;quot;  :query &amp;quot;maildir:/seirios_seirios/Inbox&amp;quot;   :favorite t :key ?1)
        (:name &amp;quot;sheo.seirios&amp;quot;     :query &amp;quot;maildir:/sheo_seirios/Inbox&amp;quot;      :favorite t :key ?2)
        (:name &amp;quot;mls.seirios&amp;quot;      :query &amp;quot;maildir:/mls_seirios/Inbox&amp;quot;       :favorite t :key ?3)
        (:name &amp;quot;seirios.icloud&amp;quot;   :query &amp;quot;maildir:/seirios_icloud/Inbox&amp;quot;    :favorite t :key ?4)
        (:name &amp;quot;sheo0147.yahoo&amp;quot;   :query &amp;quot;maildir:/sheo0147_yahoo/Inbox&amp;quot;    :favorite t :key ?5)
        (:name &amp;quot;seirios.RRcom&amp;quot;    :query &amp;quot;maildir:/seirios_RRcom/Inbox&amp;quot;     :favorite t :key ?6)
        (:name &amp;quot;seirios.RRnet&amp;quot;    :query &amp;quot;maildir:/seirios_RRnet/Inbox&amp;quot;     :favorite t :key ?7)
        (:name &amp;quot;sheo0147.gmail&amp;quot;   :query &amp;quot;maildir:/sheo0147_gmail/Inbox&amp;quot;    :favorite t :key ?8)
        (:name &amp;quot;seirios.wm.gmail&amp;quot; :query &amp;quot;maildir:/seirios.wm_gmail/Inbox&amp;quot;  :favorite t :key ?9)
        (:name &amp;quot;seirios.silanui&amp;quot;  :query &amp;quot;maildir:/seirios_silanui/Inbox&amp;quot;   :favorite t :key ?0)
        (:name &amp;quot;SPAM/UCE&amp;quot;
         :query &amp;quot;maildir:/seirios_seirios/Spam OR maildir:/sheo_seirios/Spam OR maildir:/mls_seirios/Spam OR maildir:/seirios_icloud/Spam OR maildir:/sheo0147_yahoo/Spam OR maildir:/seirios_RRcom/Spam OR maildir:/seirios_RRnet/Spam OR maildir:/sheo0147_gmail/Spam OR maildir:/seirios.wm_gmail/Spam OR maildir:/seirios_silanui/Spam&amp;quot;
                                                                           :favorite t :key ?s)
        (:name &amp;quot;Trash&amp;quot;
         :query &amp;quot;maildir:/seirios_seirios/Trash OR maildir:/sheo_seirios/Trash OR maildir:/mls_seirios/Trash OR maildir:/seirios_icloud/Trash OR maildir:/sheo0147_yahoo/Trash OR maildir:/sheo0147_gmail/Trash OR maildir:/seirios_RRnet/Trash OR maildir:/seirios_RRcom/Trash OR maildir:/seirios.wm_gmail/Trash OR maildir:/seirios_silanui/Trash&amp;quot;
                                                                           :favorite t :key ?t)))
   ;; Maildir ショートカット（ジャンプキー）
   (mu4e-maildir-shortcuts
    . &amp;#039;(
        (:maildir &amp;quot;/seirios_seirios/UT&amp;quot;                       :name &amp;quot;UT&amp;quot;       :key ?u)
        (:maildir &amp;quot;/seirios_seirios/ISII&amp;quot;                     :name &amp;quot;ISII&amp;quot;     :key ?i)
        (:maildir &amp;quot;/seirios_seirios/silanui&amp;quot;                  :name &amp;quot;しらぬい&amp;quot; :key ?s)
        (:maildir &amp;quot;/seirios_seirios/NCom&amp;quot;                     :name &amp;quot;NCom&amp;quot;     :key ?n)
        (:maildir &amp;quot;/seirios_seirios/NTT-MM&amp;quot;                   :name &amp;quot;N-MM&amp;quot;     :key ?m)
        (:maildir &amp;quot;/seirios_RRnet/Rookie&amp;quot;                     :name &amp;quot;Rookie&amp;quot;   :key ?r)

        (:maildir &amp;quot;/seirios_seirios/Finance&amp;quot;                  :name &amp;quot;Fin&amp;quot;      :key ?F)
        (:maildir &amp;quot;/seirios_seirios/WIDE&amp;quot;                     :name &amp;quot;WIDE&amp;quot;     :key ?W)
        (:maildir &amp;quot;/seirios_seirios/Logs&amp;quot;                     :name &amp;quot;Logs&amp;quot;     :key ?L)
        (:maildir &amp;quot;/seirios_seirios/Logs/ShadowServer&amp;quot;        :name &amp;quot;影鯖&amp;quot;     :key ?S)
        (:maildir &amp;quot;/seirios_seirios/Logs/DMARC&amp;quot;               :name &amp;quot;DMARC&amp;quot;    :key ?D)

        (:maildir &amp;quot;/seirios_seirios/Individual/Personal&amp;quot;      :name &amp;quot;個人&amp;quot;     :key ?P)
        (:maildir &amp;quot;/seirios_seirios/Individual/Family&amp;quot;        :name &amp;quot;家族&amp;quot;     :key ?f)
        (:maildir &amp;quot;/seirios_seirios/Individual/Game&amp;quot;          :name &amp;quot;Game&amp;quot;     :key ?G)
        (:maildir &amp;quot;/seirios_seirios/Individual/Services&amp;quot;      :name &amp;quot;Service&amp;quot;  :key ?P)
        (:maildir &amp;quot;/seirios_seirios/Activity/JNSA&amp;quot;            :name &amp;quot;JNSA&amp;quot;     :key ?J)
        (:maildir &amp;quot;/seirios_seirios/Activity/ISC2&amp;quot;            :name &amp;quot;ISC&amp;quot;      :key ?I)
        (:maildir &amp;quot;/seirios_seirios/Activity/GitHub&amp;quot;          :name &amp;quot;GHUB&amp;quot;     :key ?g)
        (:maildir &amp;quot;/seirios_seirios/Activity/ISOG-J&amp;quot;          :name &amp;quot;ISOG&amp;quot;     :key ?j)
        ;; 以下は「一覧に見せるため」の要素。:key がないものはジャンプキー無し。
        (:maildir &amp;quot;/seirios_seirios/ISII/GA&amp;quot;)
        (:maildir &amp;quot;/seirios_seirios/Individual&amp;quot;)
        (:maildir &amp;quot;/seirios_seirios/Individual/Tech&amp;quot;)
        (:maildir &amp;quot;/seirios_seirios/Individual/UnivD2&amp;quot;)
        (:maildir &amp;quot;/seirios_seirios/Activity&amp;quot;)
        (:maildir &amp;quot;/seirios_seirios/Activity/ISACA&amp;quot;)
        (:maildir &amp;quot;/seirios_seirios/Olds&amp;quot;)
        (:maildir &amp;quot;/seirios_RRnet/Olds&amp;quot;)
        (:maildir &amp;quot;/seirios_seirios/Trash&amp;quot;)
        (:maildir &amp;quot;/seirios_icloud/Trash&amp;quot;)
        (:maildir &amp;quot;/sheo0147_yahoo/Trash&amp;quot;)
        (:maildir &amp;quot;/sheo0147_gmail/Trash&amp;quot;)
        (:maildir &amp;quot;/seirios_RRnet/Trash&amp;quot;)
        (:maildir &amp;quot;/sheo_seirios/Trash&amp;quot;)
        (:maildir &amp;quot;/seirios_RRcom/Trash&amp;quot;)
        (:maildir &amp;quot;/seirios_silanui/Trash&amp;quot;)
        (:maildir &amp;quot;/seirios.wm_gmail/Trash&amp;quot;)
        (:maildir &amp;quot;/mls_seirios/Trash&amp;quot;))))

  :config
  ;; ---- 実行ファイルの場所を自動検出（Homebrew/Path両対応）----
  ;; mu/msmtp の実行パスは GUI 起動時（PATHが引き継がれないケース）でも見つかるよう、
  ;; 絶対パス候補 → PATH の順に探索します。
  (setq mu4e-mu-binary   (my/which &amp;quot;/usr/local/bin/mu&amp;quot;     &amp;quot;/opt/homebrew/bin/mu&amp;quot;     &amp;quot;mu&amp;quot;))
  (setq sendmail-program (my/which &amp;quot;/usr/local/bin/msmtp&amp;quot;  &amp;quot;/opt/homebrew/bin/msmtp&amp;quot;  &amp;quot;msmtp&amp;quot;))

  ;; メールを取得するための設定
  (with-eval-after-load &amp;#039;mu4e
    ;; U（取得）で使うコマンドは常に設定しておく（スマートラッパーを使わない場面向け互換）
    (let ((mbsync (my/which &amp;quot;/usr/local/bin/mbsync&amp;quot; &amp;quot;/opt/homebrew/bin/mbsync&amp;quot; &amp;quot;mbsync&amp;quot;)))
      (setq mu4e-get-mail-command (and mbsync (concat mbsync &amp;quot; -a&amp;quot;))))  ; Keep string form for compatibility (some commands read this variable)

    ;; 起動時/定期の自動を使うかはトグルで制御
    (if my/mu4e-auto-update
        (progn
          ;; 自動更新ON: mu4e の built-in interval を有効化（起動時フックも既定動作）
          (setq mu4e-update-interval (* 10 60))  ; 10分（任意で変更）
          ;; 既定の起動時更新フックは mu4e が勝手に登録するため、ここでは何もしない
          )
      ;; 自動更新OFF: built-in interval を止め、起動時の更新フックも外す
      (setq mu4e-update-interval nil)
      (remove-hook &amp;#039;mu4e-main-mode-hook #&amp;#039;mu4e-update-mail-and-index)
      ;; U で取得したいので mu4e-get-mail-command は nil にしない（上で保持）
      )

    ;; ビューの分割（本文は右側へ表示）
    (add-to-list &amp;#039;display-buffer-alist
                 `(,(regexp-quote mu4e-view-buffer-name)
                   display-buffer-in-side-window
                   (side . right) (window-width . 0.5)))

    ;; モードライン名の微調整（ヘッダ検索中は短く）
    (setq mode-name &amp;quot;mu4e-headers&amp;quot;)
    (add-hook &amp;#039;mu4e-headers-search-hook (lambda (_q) (setq mode-name &amp;quot;mu4e&amp;quot;)))

    ;; ---- コンテキスト（簡潔化）----
    ;; 複数アカウント構成（各 :vars で Drafts/Sent/Trash を設定）
    (setq mu4e-contexts
          (list
           (my/mk-context &amp;quot;1seirios_seirios&amp;quot;  &amp;quot;/seirios_seirios&amp;quot;  &amp;quot;seirios@seirios.org&amp;quot;
                          (concat &amp;quot;=====\n&amp;quot; &amp;quot;HEO SeonMeyong&amp;quot;))
           (my/mk-context &amp;quot;2sheo_seirios&amp;quot;     &amp;quot;/sheo_seirios&amp;quot;     &amp;quot;sheo@seirios.org&amp;quot;)
           (my/mk-context &amp;quot;3mls_seirios&amp;quot;      &amp;quot;/mls_seirios&amp;quot;      &amp;quot;mls@seirios.org&amp;quot;)
           (my/mk-context &amp;quot;4seirios_icloud&amp;quot;   &amp;quot;/seirios_icloud&amp;quot;   &amp;quot;seirios@mac.com&amp;quot;)
           (my/mk-context &amp;quot;5sheo0147_yahoo&amp;quot;   &amp;quot;/sheo0147_yahoo&amp;quot;   &amp;quot;sheo0147@yahoo.co.jp&amp;quot;)
           (my/mk-context &amp;quot;6seirios_RRcom&amp;quot;    &amp;quot;/seirios_RRcom&amp;quot;    &amp;quot;seirios@rusty-raven.com&amp;quot;)
           (my/mk-context &amp;quot;7seirios_RRnet&amp;quot;    &amp;quot;/seirios_RRnet&amp;quot;    &amp;quot;seirios@rusty-raven.net&amp;quot;)
           (my/mk-context &amp;quot;8sheo0147_gmail&amp;quot;   &amp;quot;/sheo0147_gmail&amp;quot;   &amp;quot;sheo0147@gmail.com&amp;quot;)
           (my/mk-context &amp;quot;9seirios.wm_gmail&amp;quot; &amp;quot;/seirios.wm_gmail&amp;quot; &amp;quot;seirios.wm@gmail.com&amp;quot;)
           (my/mk-context &amp;quot;0seirios_silanui&amp;quot;  &amp;quot;/seirios_silanui&amp;quot;  &amp;quot;seirios@silanui.com&amp;quot;)))

    ;; ---- Refile ルール（データ駆動）----
    ;; ルールは (FOLDER FIELD REGEX) のリスト。
    ;; FIELD は &amp;#039;to&amp;#039;/&amp;#039;cc&amp;#039;/&amp;#039;bcc&amp;#039;/&amp;#039;rcpt&amp;#039;/&amp;#039;from&amp;#039;/&amp;#039;subj&amp;#039;/&amp;#039;msgid&amp;#039;/&amp;#039;list&amp;#039;/&amp;#039;any&amp;#039; が指定可能。
    ;; `my-mu4e-refile-message` は、MSG に適用して最初にマッチした folder を返す。
    (defvar my-mu4e-refile-rules
      &amp;#039;((&amp;quot;/seirios_seirios/ISII&amp;quot;                &amp;quot;rcpt&amp;quot; &amp;quot;redmine@interlink\\.or\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Olds/NTT-Myanmar&amp;quot;    &amp;quot;rcpt&amp;quot; &amp;quot;cnip@ml\\.ntt\\.com&amp;quot;)
        (&amp;quot;/seirios_seirios/Olds/KDS&amp;quot;            &amp;quot;rcpt&amp;quot; &amp;quot;support@zscaler\\.com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Olds/KDS&amp;quot;            &amp;quot;rcpt&amp;quot; &amp;quot;zsc-support@kddi-dsec\\.com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Olds/KDS&amp;quot;            &amp;quot;from&amp;quot; &amp;quot;do-not-reply@kds\\.seirios\\.org$&amp;quot;)
        (&amp;quot;/seirios_seirios/Olds/KDS&amp;quot;            &amp;quot;rcpt&amp;quot; &amp;quot;zsc-support@k-evolva\\.com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Activity/GitHub&amp;quot;     &amp;quot;to&amp;quot;   &amp;quot;seirios\\+gh@seirios\\.org&amp;quot;)
        (&amp;quot;/seirios_seirios/Logs/DMARC&amp;quot;          &amp;quot;from&amp;quot; &amp;quot;noreply-dmarc-support@google\\.com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Logs/DMARC&amp;quot;          &amp;quot;from&amp;quot; &amp;quot;dmarcreport@microsoft\\.com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Logs/DMARC&amp;quot;          &amp;quot;from&amp;quot; &amp;quot;reporting@dmarc25\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Logs/DMARC&amp;quot;          &amp;quot;from&amp;quot; &amp;quot;noreply@dmarc\\.yahoo\\.com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Logs/DMARC&amp;quot;          &amp;quot;from&amp;quot; &amp;quot;dmarc_support@corp\\.mail\\.ru$&amp;quot;)
        (&amp;quot;/seirios_seirios/Logs/DMARC&amp;quot;          &amp;quot;from&amp;quot; &amp;quot;dmarc-reports@lolipop\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Logs/ShadowServer&amp;quot;   &amp;quot;from&amp;quot; &amp;quot;@shadowserver\\.org$&amp;quot;)
        (&amp;quot;/seirios_seirios/Logs&amp;quot;                &amp;quot;to&amp;quot;   &amp;quot;mgmt\\.seirios\\.org$&amp;quot;)
        (&amp;quot;/seirios_seirios/Logs&amp;quot;                &amp;quot;to&amp;quot;   &amp;quot;mgmt\\.rookie-inc\\.com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Logs&amp;quot;                &amp;quot;from&amp;quot; &amp;quot;^root@&amp;quot;)
        (&amp;quot;/seirios_seirios/Logs&amp;quot;                &amp;quot;from&amp;quot; &amp;quot;^www@bbf-wb&amp;quot;)
        (&amp;quot;/seirios_seirios/Logs&amp;quot;                &amp;quot;subj&amp;quot; &amp;quot;^Cron&amp;quot;)
        (&amp;quot;/seirios_seirios/Logs&amp;quot;                &amp;quot;subj&amp;quot; &amp;quot;run\\.output$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Game&amp;quot;     &amp;quot;from&amp;quot; &amp;quot;nintendo\\.(com|net|co\\.jp)$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Game&amp;quot;     &amp;quot;from&amp;quot; &amp;quot;fortnite@mail\\.epicgames\\.com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Game&amp;quot;     &amp;quot;from&amp;quot; &amp;quot;familysafety@microsoft\\.com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Finance&amp;quot;             &amp;quot;from&amp;quot; &amp;quot;smbc\\.co\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Finance&amp;quot;             &amp;quot;from&amp;quot; &amp;quot;tokyostarbank\\.co\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Finance&amp;quot;             &amp;quot;from&amp;quot; &amp;quot;surugabank\\.co\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Finance&amp;quot;             &amp;quot;from&amp;quot; &amp;quot;mizuhobank\\.co\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Finance&amp;quot;             &amp;quot;from&amp;quot; &amp;quot;japannetbank\\.co\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Finance&amp;quot;             &amp;quot;from&amp;quot; &amp;quot;paypay-bank\\.co\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Finance&amp;quot;             &amp;quot;from&amp;quot; &amp;quot;sevenbank\\.co\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Finance&amp;quot;             &amp;quot;from&amp;quot; &amp;quot;nicos\\.co\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Finance&amp;quot;             &amp;quot;from&amp;quot; &amp;quot;jaccs\\.co\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Finance&amp;quot;             &amp;quot;from&amp;quot; &amp;quot;viewsnet\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Finance&amp;quot;             &amp;quot;from&amp;quot; &amp;quot;jrepoint\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Finance&amp;quot;             &amp;quot;from&amp;quot; &amp;quot;vpass\\.ne\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Finance&amp;quot;             &amp;quot;from&amp;quot; &amp;quot;paypal\\.com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Finance&amp;quot;             &amp;quot;from&amp;quot; &amp;quot;credit\\.orix\\.co\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;amazon\\..co\\..jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;uqmobile\\..jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;auction-master@mail\\..yahoo\\..co\\..jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;payment-master@mail\\..yahoo\\..co\\..jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;ana\\..co\\..jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;member@point\\..recruit\\..co\\..jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;iijmio\\..jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;booking\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;Apple\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;banggood\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;lambdanote\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;community_cycle_info@docomo-cycle\\..jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;connpass\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;dropbox\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;ebay\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;evernote\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;fiberjp\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;gandi\\..net$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;icloud\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;sakura\\..ad\\..jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;mydocomo\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;suicainternetservice\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;@interlink\\..or\\..jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;flets\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;itunes\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;makuake\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;macdvdripperpro\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;omnigroup\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;eki-net\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;cloudsign\\..jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;biccamera\\..com$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;morisawa\\..co\\..jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Individual/Services&amp;quot; &amp;quot;from&amp;quot; &amp;quot;kuronekoyamato\\..co\\..jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/WIDE&amp;quot;                &amp;quot;msgid&amp;quot; &amp;quot;wide\\.ad\\.jp&amp;quot;)
        (&amp;quot;/seirios_seirios/WIDE&amp;quot;                &amp;quot;subj&amp;quot; &amp;quot;^\\[(wide|two-core|two|ixp-ops|irc-wg|dns) &amp;quot;)
        (&amp;quot;/seirios_seirios/WIDE&amp;quot;                &amp;quot;rcpt&amp;quot; &amp;quot;as2500@nspixp\\.wide\\.ad\\.jp&amp;quot;)
        (&amp;quot;/seirios_seirios/WIDE&amp;quot;                &amp;quot;rcpt&amp;quot; &amp;quot;(ixp|lens-wg)@wide\\.ad\\.jp&amp;quot;)
        (&amp;quot;/seirios_seirios/Activity/ISC2&amp;quot;       &amp;quot;from&amp;quot; &amp;quot;/@isc2\\.org$&amp;quot;)
        (&amp;quot;/seirios_seirios/Activity/JNSA&amp;quot;       &amp;quot;list&amp;quot; &amp;quot;jnsa\\.org$&amp;quot;)
        (&amp;quot;/seirios_seirios/Activity/ISOG-J&amp;quot;     &amp;quot;list&amp;quot; &amp;quot;member\\.isog-j\\.org$&amp;quot;)
        (&amp;quot;/seirios_seirios/Activity/ISC2&amp;quot;       &amp;quot;from&amp;quot; &amp;quot;isc2\\.org$&amp;quot;)
        (&amp;quot;/seirios_seirios/Activity/ISC2&amp;quot;       &amp;quot;from&amp;quot; &amp;quot;isc2chapter\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Spam&amp;quot;                &amp;quot;from&amp;quot; &amp;quot;nikkeibp\\.(co\\.jp|com)$&amp;quot;)
        (&amp;quot;/seirios_seirios/Spam&amp;quot;                &amp;quot;from&amp;quot; &amp;quot;itmedia\\.jp$&amp;quot;)
        (&amp;quot;/seirios_seirios/Spam&amp;quot;                &amp;quot;from&amp;quot; &amp;quot;info@twitter\\.com&amp;quot;)))
    (defun my-mu4e-refile-message (msg)
      &amp;quot;ルールに基づき MSG のリファイル先を返す。未マッチなら nil。
- &amp;#039;any は to/cc/bcc/from の全てに対して正規表現判定を行う
- &amp;#039;rcpt は to/cc/bcc の受信側集合で判定&amp;quot;
      (cl-loop for (folder field regex) in my-mu4e-refile-rules
               for addresses = (pcase field
                                 (&amp;quot;any&amp;quot;  (append (mu4e-message-field msg :to)
                                                 (mu4e-message-field msg :cc)
                                                 (mu4e-message-field msg :bcc)
                                                 (mu4e-message-field msg :from)))
                                 (&amp;quot;rcpt&amp;quot; (append (mu4e-message-field msg :to)
                                                 (mu4e-message-field msg :cc)
                                                 (mu4e-message-field msg :bcc)))
                                 (&amp;quot;subj&amp;quot;  (list  (mu4e-message-field msg :subject)))
                                 (&amp;quot;msgid&amp;quot; (list  (mu4e-message-field msg :msgid)))
                                 (&amp;quot;list&amp;quot;  (list  (mu4e-message-field msg :list)))
                                 (_      (mu4e-message-field msg (intern (concat &amp;quot;:&amp;quot; field)))))
               when (seq-some (lambda (addr)
                                (and addr (string-match-p regex
                                                          (downcase (if (listp addr)
                                                                        (or (plist-get addr :email) &amp;quot;&amp;quot;)
                                                                      addr)))))
                              addresses)
               return folder
               finally return nil))

    ;; mu4e が参照するリファイル先決定関数。ルールマッチしなければ現在フォルダ。
    (setq mu4e-refile-folder
          (lambda (msg)
            (or (my-mu4e-refile-message msg)
                (mu4e-message-field msg :maildir))))

    ;; ヘッダビュー内で「自動的にrefileマークを付ける」補助コマンド
    (defun my-mu4e-auto-refile-process (msg)
      (let ((target (funcall mu4e-refile-folder msg)))
        (when (and target
                   (not (string= target (mu4e-message-field msg :maildir))))
          (mu4e-mark-set &amp;#039;refile target))))
    (defun my-mu4e-auto-refile ()
      &amp;quot;現在フォルダの新着/未読を検索し、ルールに基づき refile マークを付ける。&amp;quot;
      (interactive)
      (let* ((current (mu4e-message-field (mu4e-message-at-point) :maildir))
             (query (concat &amp;quot;maildir:&amp;quot; current &amp;quot; AND (flag:new OR flag:unread) AND NOT flag:trashed&amp;quot;)))
        (mu4e-headers-search query)
        (add-hook &amp;#039;mu4e-headers-found-hook #&amp;#039;my-mu4e-auto-refile-hook)))
    (defun my-mu4e-auto-refile-hook ()
      (remove-hook &amp;#039;mu4e-headers-found-hook #&amp;#039;my-mu4e-auto-refile-hook)
      (goto-char (point-min))
      (while (not (eobp))
        (let ((msg (mu4e-message-at-point)))
          (my-mu4e-auto-refile-process msg))
        (forward-line))
      ;; マーク後、次の未読へ移動
      (mu4e-headers-next nil))
    (keymap-set mu4e-headers-mode-map &amp;quot;e&amp;quot; #&amp;#039;my-mu4e-auto-refile)

    ;; ---- 送信補助（msmtp選択/Cc/Bcc/件名空確認）----
    ;; Fromヘッダと msmtp アカウントの対応表（追加・変更はここへ）
    (defvar my/msmtp-accounts
      &amp;#039;((&amp;quot;seirios@seirios.org&amp;quot;     . &amp;quot;seirios_seirios&amp;quot;)
        (&amp;quot;sheo@seirios.org&amp;quot;        . &amp;quot;sheo_seirios&amp;quot;)
        (&amp;quot;mls@seirios.org&amp;quot;         . &amp;quot;mls_seirios&amp;quot;)
        (&amp;quot;seirios@mac.com&amp;quot;         . &amp;quot;seirios_icloud&amp;quot;)
        (&amp;quot;sheo0147@yahoo.co.jp&amp;quot;    . &amp;quot;sheo0147_yahoo&amp;quot;)
        (&amp;quot;seirios@rusty-raven.com&amp;quot; . &amp;quot;seirios_RRcom&amp;quot;)
        (&amp;quot;seirios@rusty-raven.net&amp;quot; . &amp;quot;seirios_RRnet&amp;quot;)
        (&amp;quot;sheo0147@gmail.com&amp;quot;      . &amp;quot;sheo0147_gmail&amp;quot;)
        (&amp;quot;seirios.wm@gmail.com&amp;quot;    . &amp;quot;seirios.wm_gmail&amp;quot;)
        (&amp;quot;seirios@silanui.com&amp;quot;     . &amp;quot;seirios_silanui&amp;quot;)))
    (defun my-mu4e-set-msmtp-account ()
      &amp;quot;From ヘッダに基づき msmtp アカウントを自動選択する。
- ヘッダから送信者アドレスを取り出し、`my/msmtp-accounts` で最初に一致したものを採用
- 一致がない場合は何もしない（ユーザ手動選択に委ねる）&amp;quot;
      (when (message-mail-p)
        (save-excursion
          (let* ((from (save-restriction
                         (message-narrow-to-headers)
                         (or (message-fetch-field &amp;quot;from&amp;quot;) &amp;quot;&amp;quot;)))
                 (acct (seq-some (lambda (pair)
                                   (and (string-match (regexp-quote (car pair)) from)
                                        (cdr pair)))
                                 my/msmtp-accounts)))
            (when acct
              (message &amp;quot;Using msmtp account: %s&amp;quot; acct)
              (setq message-sendmail-extra-arguments (list &amp;quot;-a&amp;quot; acct)))))))
    (add-hook &amp;#039;message-send-hook #&amp;#039;my-mu4e-set-msmtp-account)

    (defun my-add-cc-and-bcc ()
      &amp;quot;Compose 中に Cc に自アドレスがなければ追記し、Bcc を空で付与する。
- Cc 行が存在しない場合は新規に付与
- 既に自アドレスが含まれていれば何もしない&amp;quot;
      (save-excursion
        (goto-char (point-min))
        (if (re-search-forward &amp;quot;^Cc:&amp;quot; nil t)
            (unless (re-search-forward (concat (regexp-quote user-mail-address))
                                       (line-end-position) t)
              (end-of-line)
              (insert (if (looking-back &amp;quot;[, \t]&amp;quot; (max (point-min) (1- (point))))
                          user-mail-address
                        (concat &amp;quot;, &amp;quot; user-mail-address))))
          (message-add-header (format &amp;quot;Cc: %s\n&amp;quot; user-mail-address))))
      (save-excursion (message-add-header &amp;quot;Bcc: \n&amp;quot;)))
    (add-hook &amp;#039;mu4e-compose-mode-hook #&amp;#039;my-add-cc-and-bcc)

    (defun confirm-empty-subject ()
      &amp;quot;件名が空なら送信前に確認ダイアログを出す。
誤送信防止のための軽量ガード。&amp;quot;
      (let ((sub (message-field-value &amp;quot;Subject&amp;quot;)))
        (or (and sub (not (string-match &amp;quot;\\`[ \t]*\\&amp;#039;&amp;quot; sub)))
            (yes-or-no-p &amp;quot;Really send without Subject? &amp;quot;)
            (keyboard-quit))))
    (add-hook &amp;#039;message-send-hook #&amp;#039;confirm-empty-subject)

    ;; === ヘッダ表示のページング（N＝残り全件を一気に追記） ===
    (defun my/mu4e--headers-last-message-id ()
      &amp;quot;ヘッダバッファ末尾のメッセージID（:message-id）を返す。なければ nil。&amp;quot;
      (when (mu4e-current-buffer-type-p &amp;#039;headers)
        (save-excursion
          (goto-char (point-max))
          (forward-line -1)
          (plist-get (mu4e-message-at-point) :message-id))))

    (defun my-mu4e-append-all-remaining ()
      &amp;quot;現在クエリの『末尾からさらに先（残り全件）』を一気に追記する。
この呼び出し中のみ `mu4e-search-full` を t にして上限を外す。&amp;quot;
      (interactive)
      (when (mu4e-current-buffer-type-p &amp;#039;headers)
        (let* ((mu4e-search-full t)                ;; ★ この関数の間だけ全件モード
               (mu4e-search-sort-field &amp;#039;date)
               (mu4e-search-sort-direction &amp;#039;descending)
               ;; 念のため「ほぼ無限」上限もローカルに設定（古いmu4eへの互換）
               (mu4e-headers-results-limit most-positive-fixnum)
               (last-msg (my/mu4e--headers-last-message-id)))
          (when-let ((query (mu4e-last-query)))
            (message &amp;quot;[mu4e] append all remaining headers ...&amp;quot;)
            ;; append=t で結果を追記。last-msg をアンカーに、それより古い側を取得。
            (mu4e-search query nil nil t last-msg)
            ;; 視認性のため末尾へ移動
            (goto-char (point-max))
            (forward-line -1)
            ;; スレッド折りたたみを使っている場合は全畳みで見通しを確保
            (when (bound-and-true-p mu4e-thread-folding-mode)
              (mu4e-headers-fold-all))
            (message &amp;quot;[mu4e] all remaining headers appended.&amp;quot;)))))

    ;; キーバインドの差し替え（N）
    (keymap-set mu4e-headers-mode-map &amp;quot;N&amp;quot; #&amp;#039;my-mu4e-append-all-remaining)

    ;; === 非同期取得＋インデックス更新（背景実行）と定期バックグラウンド更新 ===
    ;; Parameters:
    ;;  - mbsync path resolution: my/which tries /usr/local/bin, /opt/homebrew/bin, then PATH
    ;;  - Timer interval: call (my/mu4e-start-background-update MINUTES) to change
    ;;  - Log buffer: &amp;quot; *mu4e-mbsync*&amp;quot; stores stdout/stderr of mbsync for diagnostics
    ;; Behavior:
    ;;  - U: triggers async mbsync followed by mu4e-index-update when exit-code=0
    ;;  - Startup: built-in mu4e auto update disabled; we rely on custom timer
    ;;  - Index updates run with mu4e-index-update-in-background=t to avoid blocking
    (setq mu4e-index-update-in-background t)

    (defun my-mu4e-update-mail-and-index-async ()
      &amp;quot;Run mbsync asynchronously and, upon success, trigger mu4e index update in background.
ENV/PATH NOTES:
  - GUI起動のEmacsでは Homebrew の PATH が見えないことがある。必要なら exec-path-from-shell を併用。
LOGGING:
  - mbsync の標準出力/エラーはバッファ \&amp;quot; *mu4e-mbsync*\&amp;quot; に格納。
ERROR HANDLING:
  - 非ゼロ終了コードの場合はバッファを表示して詳細を確認できる。&amp;quot;
      (interactive)
      (let* ((mbsync (my/which &amp;quot;/usr/local/bin/mbsync&amp;quot; &amp;quot;/opt/homebrew/bin/mbsync&amp;quot; &amp;quot;mbsync&amp;quot;))
             (args   &amp;#039;(&amp;quot;-a&amp;quot;)))
        (unless mbsync
          (user-error &amp;quot;mbsync が見つかりません。PATHやインストールを確認してください。&amp;quot;))
        (let ((buf (get-buffer-create &amp;quot; *mu4e-mbsync*&amp;quot;)))
          (with-current-buffer buf (erase-buffer))
          (message &amp;quot;[mu4e] start mbsync -a (background)&amp;quot;)
          (let ((proc (apply #&amp;#039;start-process &amp;quot;mu4e-mbsync&amp;quot; buf mbsync args)))
            (set-process-query-on-exit-flag proc nil)
            (set-process-sentinel
             proc
             (lambda (p event)
               (when (eq (process-status p) &amp;#039;exit)
                 (let ((code (process-exit-status p)))
                   (if (= code 0)
                       (progn
                         (message &amp;quot;[mu4e] mbsync done. start mu index (background)&amp;quot;)
                         (mu4e-update-index)) ; 非同期インデックス更新（UI非ブロッキング）
                     (progn
                       (message &amp;quot;[mu4e] mbsync failed (exit=%d). バッファ %s を確認&amp;quot;
                                code (buffer-name (process-buffer p)))
                       (display-buffer (process-buffer p))))))))))))

    ;; Uキーを非同期版に差し替え（メイン/ヘッダ両方）
    (define-key mu4e-main-mode-map    (kbd &amp;quot;U&amp;quot;)  ; U = async mbsync + mu index (non-blocking)
      #&amp;#039;my-mu4e-update-mail-and-index-async)
    (define-key mu4e-headers-mode-map (kbd &amp;quot;U&amp;quot;)  ; U = async mbsync + mu index (non-blocking)
      #&amp;#039;my-mu4e-update-mail-and-index-async)

    ;; mu4e 自体の同期更新コマンドを使う場面へ互換のため文字列版も保持
    (let ((mbsync (my/which &amp;quot;/usr/local/bin/mbsync&amp;quot; &amp;quot;/opt/homebrew/bin/mbsync&amp;quot; &amp;quot;mbsync&amp;quot;)))
      (setq mu4e-get-mail-command (and mbsync (concat mbsync &amp;quot; -a&amp;quot;)))) ; Keep string form for compatibility

    ;; --- 定期バックグラウンド更新（独自タイマー） ---
    (defvar my/mu4e-background-timer nil
      &amp;quot;バックグラウンド更新用のタイマー。nil なら未稼働。&amp;quot;)

    (defun my/mu4e-start-background-update (minutes)
      &amp;quot;MINUTES 分間隔で非同期取得＋インデックス更新を開始する。

Parameters:
  MINUTES  整数。間隔（分）を指定（例: 10）
Behavior:
  - 既存タイマーがあればキャンセル。
  - 最初の実行は 10 秒後、その後 MINUTES ごとに繰り返し。
  - 非同期関数 my-mu4e-update-mail-and-index-async を使用。
Tuning:
  - 初回遅延 10 秒は必要に応じて変更可能（run-at-time の第一引数）。&amp;quot;
      (when my/mu4e-background-timer
        (cancel-timer my/mu4e-background-timer))
      (setq my/mu4e-background-timer
            (run-at-time 30 (* minutes 60) #&amp;#039;my-mu4e-update-mail-and-index-async))
      (message &amp;quot;[mu4e] background update every %d minutes&amp;quot; minutes))

    (defun my/mu4e-stop-background-update ()
      &amp;quot;バックグラウンド更新タイマーを停止する。
従量制ネットワークや一時的に負荷を避けたい場合に使用。&amp;quot;
      (interactive)
      (when my/mu4e-background-timer
        (cancel-timer my/mu4e-background-timer)
        (setq my/mu4e-background-timer nil)
        (message &amp;quot;[mu4e] background update stopped&amp;quot;)))

    ;; 既定では 10 分間隔で開始（好みに合わせて値を変更）
    (my/mu4e-start-background-update 30)))

;;; 追加: スレッド折りたたみ（見通しを良くするUI拡張）
(leaf mu4e-thread-folding
  :vc (:url &amp;quot;https://github.com/rougier/mu4e-thread-folding&amp;quot;)
  :require t
  :config
  (define-key mu4e-headers-mode-map (kbd &amp;quot;&amp;lt;tab&amp;gt;&amp;quot;)     #&amp;#039;mu4e-headers-toggle-at-point)
  (define-key mu4e-headers-mode-map (kbd &amp;quot;&amp;lt;S-tab&amp;gt;&amp;quot;)   #&amp;#039;mu4e-headers-toggle-fold-all)
  (define-key mu4e-headers-mode-map (kbd &amp;quot;&amp;lt;left&amp;gt;&amp;quot;)    #&amp;#039;mu4e-headers-fold-at-point)
  (define-key mu4e-headers-mode-map (kbd &amp;quot;&amp;lt;S-left&amp;gt;&amp;quot;)  #&amp;#039;mu4e-headers-fold-all)
  (define-key mu4e-headers-mode-map (kbd &amp;quot;&amp;lt;right&amp;gt;&amp;quot;)   #&amp;#039;mu4e-headers-unfold-at-point)
  (define-key mu4e-headers-mode-map (kbd &amp;quot;&amp;lt;S-right&amp;gt;&amp;quot;) #&amp;#039;mu4e-headers-unfold-all)
  (add-hook &amp;#039;mu4e-headers-mode-hook #&amp;#039;mu4e-thread-folding-mode))

;;; 必要なら明示ロード（smtpmail は組み込みだが、leaf で明示しておくと見通しが良い）
(leaf smtpmail :require t)&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;mu4e&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;mu4e1&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:9,&amp;quot;range&amp;quot;:&amp;quot;11307-&amp;quot;} --&gt;</description>
            <author>seirios@undisclosed.example.com (seirios)</author>
            <pubDate>Mon, 05 Jan 2026 19:05:10 +0000</pubDate>
        </item>
        <item>
            <title>古いメモ(FreeBSD NFS) - 作成</title>
            <link>http://www.seirios.org/seirios/dokuwiki/doku.php?id=tweet:2025:0213_01</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;古いメモ_freebsd_nfs&quot;&gt;古いメモ(FreeBSD NFS)&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u53e4\u3044\u30e1\u30e2(FreeBSD NFS)&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u53e4\u3044\u30e1\u30e2_freebsd_nfs&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-41&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;sysctlconf&quot;&gt;sysctl.conf&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
vfs.nfsd.server_min_nfsvers=3
&lt;/p&gt;

&lt;p&gt;
ＮＦＳのチューニング（未検証）
&lt;/p&gt;

&lt;p&gt;
vfs.nfsd.issue_delegations=1
vfs.nfsd.enable_locallocks=1
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;sysctl.conf&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;sysctlconf&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;42-202&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit3&quot; id=&quot;vfsnfsdissue_delegations&quot;&gt;vfs.nfsd.issue_delegations&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;

&lt;p&gt;
ＮＦＳサーバーでデリゲーション機能の提供をする（1）かしない（0）かを決める。
この「デリゲーション」（委任）機能は、クライアントの操作を一部サーバー側で代替するというもの。
どの程度委任できるかは不明だけど、ＮＦＳクライアントも対応している必要がある。
しかし、調べた範囲だと、ＮＦＳクライアントでの使用が「明言されていない」というか確認できなかっ たので、とりあえずオフっておく。
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;vfs.nfsd.issue_delegations&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;vfsnfsdissue_delegations&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;203-803&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit4&quot; id=&quot;vfsnfsdenable_locallocks&quot;&gt;vfs.nfsd.enable_locallocks&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;

&lt;p&gt;
ロックについて、ＮＦＳサーバーとＮＦＳクライアント間でのロック共有ができるようになる。
しかし、以下の組み合わせで、できたりできなかったりする。
ＮＦＳクライアント（CentOS 6.8）→ＮＦＳサーバー（FreeBSD 10.3-R）の順でロックすると問題無くロックできる。
ＮＦＳサーバー（FreeBSD 10.3-R）→ＮＦＳクライアント（CentOS 6.8）の順でロックするとＮＦＳクライアント側でロックされずにエラーになる。
この問題について調査が足りてないので、とりあえずオフっておく。
もちろんこの設定があろうが、なかろうが、ＮＦＳｖ４の売り文句であるところの、ＮＦＳクライアント （内の複数のプロセス）でのロック取得について問題無し。
また、この話とは別に、ＮＦＳクライアント間のロック共有が可能かは未検証。
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;vfs.nfsd.enable_locallocks&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;vfsnfsdenable_locallocks&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;804-1819&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit5&quot; id=&quot;exports&quot;&gt;exports&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
/etc/exports
&lt;/p&gt;

&lt;p&gt;
V4: /export -network ネットワークアドレス -mask ネットマスク
とりあえず、/export がＮＦＳｖ４共有できるようになる。ただし、/export 自体は sharenfs=off なの で、どこからからもマウントできない（厳密にはできるけどアクセスできない）。
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;exports&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;exports&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;1820-2170&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit6&quot; id=&quot;rcconf&quot;&gt;rc.conf&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
rpcbind_flags=“-h 公開するＮＦＳサーバーのＩＰアドレス”
nfsuserd_flags=“-domain アカウント識別用ドメイン”
mountd_flags=“-l -h 公開するＮＦＳサーバーのＩＰアドレス”
nfs_server_flags=“-t -h 公開するＮＦＳサーバーのＩＰアドレス”
&lt;/p&gt;

&lt;p&gt;
このうち、nfsuserd_flags で指定する「ドメイン」の指定が重要となる。 ＮＦＳｖ４では、ＮＦＳサー バーとＮＦＳクライアント間のユーザー識別子を「ユーザー@ドメイン」で識別するため、合わせておく必要がある。
&lt;/p&gt;

&lt;p&gt;
これはＮＦＳ共有するようなサーバー群では、同じドメインである場合、本設定を省略しても良い。
&lt;/p&gt;

&lt;p&gt;
しかし、ホスティング環境でのバックアップサーバー提供のような、ＮＦＳクライアントのサーバーのド メインが統一できないような場合、サービス提供者側として、別途決め打ちする必要がある。
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;rc.conf&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;rcconf&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;2171-3183&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit7&quot; id=&quot;共有領域設定&quot;&gt;共有領域設定&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
一つの領域を複数のＮＦＳクライアント間で共有するなら、/etc/exports に集約するのが良いと思われ（未実験）。
&lt;/p&gt;

&lt;p&gt;
zfs create -o sharenfs=“-maproot=root ClientIPAddress” export/NFSclient
でZFS領域を作成した場合、NFS clientからは、“/NFSclient” でmountする。
→ これは要するに、exportというZFS rootはClientからは見えないことを意味する
&lt;/p&gt;

&lt;p&gt;
結論: exportsに直接書くのが吉
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u5171\u6709\u9818\u57df\u8a2d\u5b9a&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u5171\u6709\u9818\u57df\u8a2d\u5b9a&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:7,&amp;quot;range&amp;quot;:&amp;quot;3184-&amp;quot;} --&gt;</description>
            <author>seirios@undisclosed.example.com (seirios)</author>
            <pubDate>Thu, 13 Feb 2025 08:58:32 +0000</pubDate>
        </item>
    </channel>
</rss>
