{"id":3028,"date":"2025-11-05T22:43:10","date_gmt":"2025-11-05T13:43:10","guid":{"rendered":"https:\/\/blog.id774.net\/entry\/?p=3028"},"modified":"2026-05-04T02:14:11","modified_gmt":"2026-05-03T17:14:11","slug":"%e3%82%b9%e3%82%af%e3%83%aa%e3%83%97%e3%83%88%e3%81%ae%e5%ae%9f%e8%a3%85%e3%83%9d%e3%83%aa%e3%82%b7%e3%83%bc%e3%81%a8-emacs-lisp-%e3%81%ae%e3%82%ac%e3%82%a4%e3%83%89%e3%83%a9%e3%82%a4%e3%83%b3","status":"publish","type":"post","link":"https:\/\/harpuia.id774.net\/entry\/2025\/11\/05\/3028\/","title":{"rendered":"\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u88c5\u30dd\u30ea\u30b7\u30fc\u3068 Emacs Lisp \u306e\u30ac\u30a4\u30c9\u30e9\u30a4\u30f3\u3092\u7b56\u5b9a\u3057\u305f"},"content":{"rendered":"<p><a href=\"https:\/\/github.com\/id774\">\u30ea\u30dd\u30b8\u30c8\u30ea<\/a>\u5168\u4f53\u3067\u9577\u671f\u904b\u7528\u3092\u898b\u636e\u3048\u305f\u8a2d\u8a08\u57fa\u6e96\u3092\u660e\u78ba\u5316\u3059\u308b\u305f\u3081\u3001Shell Script, Python, Ruby \u306e <a href=\"https:\/\/github.com\/id774\/scripts\">3 \u8a00\u8a9e<\/a>\u306b\u3064\u3044\u3066\u5171\u901a\u306e\u5b9f\u88c5<a href=\"https:\/\/github.com\/id774\/scripts\/blob\/master\/doc\/POLICY\">\u30dd\u30ea\u30b7\u30fc<\/a>\uff08Implementation Policy\uff09\u3092\u5b9a\u7fa9\u3057\u305f\u3002\u52a0\u3048\u3066\u3001<a href=\"https:\/\/github.com\/id774\/dot_emacs\">Emacs Lisp<\/a> \u306b\u3064\u3044\u3066\u306f\u7279\u6709\u306e\u4e92\u63db\u6027\u554f\u984c\u306b\u5bfe\u5fdc\u3059\u308b\u305f\u3081\u306e\u8a2d\u8a08<a href=\"https:\/\/github.com\/id774\/dot_emacs\/blob\/master\/doc\/GUIDELINES\">\u30ac\u30a4\u30c9\u30e9\u30a4\u30f3<\/a>\uff08Design Guidelines\uff09\u3092\u7b56\u5b9a\u3057\u305f\u3002\u3044\u305a\u308c\u3082\u9577\u671f\u9593\u306e\u4fdd\u5b88\u3001\u660e\u793a\u7684\u306a\u30a8\u30e9\u30fc\u5236\u5fa1\u3001\u53ef\u8aad\u6027\u306e\u4e00\u8cab\u6027\u3092\u8ef8\u306b\u3057\u3066\u3044\u308b\u3002<\/p>\n<hr>\n<h2>\u5b9f\u88c5\u30dd\u30ea\u30b7\u30fc\u7b56\u5b9a\u306e\u80cc\u666f<\/h2>\n<p>\u8907\u6570\u8a00\u8a9e\u3067\u66f8\u304b\u308c\u305f<a href=\"https:\/\/github.com\/id774\/scripts\">\u30b9\u30af\u30ea\u30d7\u30c8<\/a>\u7fa4\u3092\u9577\u5e74\u904b\u7528\u3057\u3066\u304d\u305f\u7d50\u679c\u3001POSIX \u3068 Bash \u69cb\u6587\u306e\u6df7\u5728\u3001Python \u306b\u304a\u3051\u308b\u623b\u308a\u5024\u3084\u4f8b\u5916\u51e6\u7406\u306e\u4e0d\u7d71\u4e00\u3001Ruby \u306e\u8a18\u8ff0\u30b9\u30bf\u30a4\u30eb\u306e\u3070\u3089\u3064\u304d\u304c\u9855\u5728\u5316\u3059\u308b\u3053\u3068\u304c\u3042\u3063\u305f\u3002\u4eca\u56de\u306e\u7b56\u5b9a\u3067\u306f<strong>\u3069\u306e\u8a00\u8a9e\u3067\u3082\u540c\u3058\u69cb\u9020\u3068\u5224\u65ad\u57fa\u6e96\u3067\u66f8\u3051\u308b<\/strong>\u3053\u3068\u3092\u76ee\u7684\u3068\u3057\u3001\u30ed\u30b0\u5f62\u5f0f\u3001\u7d42\u4e86\u30b3\u30fc\u30c9\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u69cb\u6210\u3001\u30c6\u30b9\u30c8\u547d\u540d\u898f\u5247\u306a\u3069\u3092\u7d71\u4e00\u3057\u305f\u3002<\/p>\n<h3>Shell Script Implementation Policy<\/h3>\n<ul>\n<li>POSIX\uff08<span>#!\/bin\/sh<\/span>\uff09\u6e96\u62e0\u3002Bash \u56fa\u6709\u69cb\u6587\u3084 <span>local<\/span> \u306f\u4f7f\u7528\u3057\u306a\u3044\u3002<\/li>\n<li><span>set -e<\/span> \u306b\u4f9d\u5b58\u305b\u305a\u3001\u660e\u793a\u7684\u306b\u30a8\u30e9\u30fc\u3092\u691c\u51fa\u30fb\u51e6\u7406\u3059\u308b\u3002\u6b63\u5e38\u7cfb\u306f\u95a2\u6570\u3067 <span><a href=\"https:\/\/blog.id774.net\/entry\/2025\/10\/19\/3016\/\">return<\/a><\/span>\u3001\u7570\u5e38\u6642\u306e\u307f <span>exit<\/span>\u3002<\/li>\n<li>\u30ed\u30b0\u306f <span>[INFO]<\/span>\u3001<span>[WARN]<\/span>\u3001<span>[ERROR]<\/span> \u306b\u7d71\u4e00\u3002\u30a8\u30e9\u30fc\u306f\u6a19\u6e96\u30a8\u30e9\u30fc\u51fa\u529b\u3002<\/li>\n<li>\u7d42\u4e86\u30b3\u30fc\u30c9\uff1a0=\u6210\u529f\u30011=\u5931\u6557\u30012=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5230\u9054\u4e0d\u53ef\u30013=\u524d\u63d0\u4e0d\u8db3\u3001126\/127=\u5b9f\u884c\u4e0d\u80fd\/\u672a\u767a\u898b\u3002<\/li>\n<li>cron \u5b9f\u884c\u6642\u306e\u4ef6\u540d\u306f <span>[admin][cron][delivery] FILENAME<\/span>\u3002<\/li>\n<li>\u5b9f\u884c\u524d\u30c1\u30a7\u30c3\u30af\u3092\u5fb9\u5e95\uff08\u5fc5\u8981\u30b3\u30de\u30f3\u30c9\u3001\u74b0\u5883\u5909\u6570\u3001\u5230\u9054\u6027\uff09\u3002\u7834\u58ca\u7684\u64cd\u4f5c\u306f\u4e8b\u524d\u691c\u8a3c\u3002<\/li>\n<li>\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u9806\u5e8f\u306f <span>Description \u2192 Requirements \u2192 Usage \u2192 Options \u2192 Test Cases \u2192 Version History<\/span>\u3002<\/li>\n<\/ul>\n<h3>Python Implementation Policy<\/h3>\n<ul>\n<li>\u5bfe\u8c61\u306f Python 3.2 \u4ee5\u4e0a\uff08\u63a8\u5968 3.4+\uff09\u3002\u4e92\u63db\u6027\u3092\u91cd\u8996\u3002<\/li>\n<li><span>sys.exit()<\/span> \u306f\u7570\u5e38\u7cfb\u5c02\u7528\u3002\u901a\u5e38\u306f <span>main()<\/span> \u304c\u6574\u6570\u3092\u8fd4\u3057 <span>sys.exit(main())<\/span> \u3067\u7d42\u4e86\u3002<\/li>\n<li>\u4f8b\u5916\u306f\u5fc5\u305a\u6355\u6349\u3057\u3001\u539f\u56e0\u3068\u5bfe\u8c61\u3092\u30ed\u30b0\u306b\u51fa\u3059\u3002\u30ed\u30b0\u30bf\u30b0\u3068\u51fa\u529b\u5148\uff08stdout\/stderr\uff09\u306f Shell Script \u3068\u7d71\u4e00\u3002<\/li>\n<li>\u5916\u90e8\u4f9d\u5b58\u306e\u6392\u9664\u3002\u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c\u306f UTF-8 \u3092\u660e\u793a\u3002\u30d1\u30b9\u64cd\u4f5c\u306f\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u5b89\u5168\u306b\u6271\u3046\u3002<\/li>\n<li>\u4e92\u63db\u6027\u691c\u67fb\u306f <span><a href=\"https:\/\/github.com\/id774\/scripts\/blob\/master\/find_pycompat.py\">find_pycompat.py<\/a><\/span> \u3092\u4f7f\u3046\uff08f-string \u3084 async \u7b49\u306e\u691c\u51fa\uff09\u3002<\/li>\n<li>\u30c6\u30b9\u30c8\u306f <span>test\/FILENAME_test.py<\/span> \u306b\u7d71\u4e00\u3057\u3001CI \u3067\u3082\u6574\u5408\u6027\u691c\u8a3c\u3092\u884c\u3046\u3002<\/li>\n<\/ul>\n<h3>Ruby Implementation Policy<\/h3>\n<ul>\n<li>\u5bfe\u8c61\u306f Ruby 3.0 \u4ee5\u964d\u3092\u63a8\u5968\u3002\u7121\u7406\u306a\u4e0b\u4f4d\u4e92\u63db\u3088\u308a\u3082\u4fdd\u5b88\u6027\u3068\u660e\u793a\u6027\u3092\u512a\u5148\u3002<\/li>\n<li>\u5916\u90e8\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u306f <span>Open3.capture3<\/span> \u3084 <span>system<\/span> \u3092\u7528\u3044\u3001\u623b\u308a\u5024\u3068\u51fa\u529b\u3092\u660e\u793a\u7684\u306b\u691c\u67fb\u3002<\/li>\n<li>\u30d5\u30a1\u30a4\u30eb\u8d70\u67fb\u306f <span>File.foreach<\/span> \u3084 <span>Dir.glob<\/span> \u3092\u4f7f\u7528\u3002I\/O \u306f UTF-8 \u3092\u660e\u793a\u3002<\/li>\n<li>\u30ed\u30b0\u30bf\u30b0\u3068\u7d42\u4e86\u30b3\u30fc\u30c9\u898f\u7d04\u306f\u4ed6\u8a00\u8a9e\u65b9\u91dd\u3068\u5171\u901a\u5316\u3002<\/li>\n<li>\u30c6\u30b9\u30c8\u306f RSpec \u3092\u63a1\u7528\u3057\u3001\u914d\u7f6e\u306f <span>test\/<\/span>\u3001\u547d\u540d\u306f <span>FILENAME_test.rb<\/span>\u3002<\/li>\n<\/ul>\n<p>\u5168\u6587\u306f<a href=\"https:\/\/github.com\/id774\/scripts\/blob\/master\/doc\/POLICY\">\u3053\u3061\u3089<\/a>\u3002<\/p>\n<hr>\n<h2>Emacs Lisp Design Guidelines<\/h2>\n<p><a href=\"https:\/\/github.com\/id774\/dot_emacs\">Emacs Lisp<\/a> \u306f\u5f37\u5236\u898f\u7bc4\u3067\u306f\u306a\u304f\u8a2d\u8a08\u6307\u91dd\uff08Guidelines\uff09\u3068\u3057\u3066\u6574\u7406\u3057\u305f\u3002\u7406\u7531\u306f\u3001Emacs \u672c\u4f53\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u5dee\u3084 API \u306e\u975e\u4e92\u63db\u3001\u74b0\u5883\u4f9d\u5b58\u304c\u5927\u304d\u304f\u3001\u4e00\u5f8b\u306e\u30dd\u30ea\u30b7\u30fc\u5316\u304c\u73fe\u5b9f\u7684\u3067\u306a\u3044\u305f\u3081\u3067\u3042\u308b\u3002\u57fa\u672c\u65b9\u91dd\u306f\u6b21\u306e\u3068\u304a\u308a\u3002<\/p>\n<ul>\n<li>\u5b58\u5728\u78ba\u8a8d\u306e\u5fb9\u5e95\uff1a<span>fboundp<\/span>\u3001<span>boundp<\/span>\u3001<span>featurep<\/span> \u306b\u3088\u308b\u5b89\u5168\u306a\u547c\u3073\u51fa\u3057\u3002<\/li>\n<li>\u6bb5\u968e\u7684\u62e1\u5f35\uff1a\u65e7\u74b0\u5883\u3067\u3082\u52d5\u4f5c\u3059\u308b\u30b3\u30a2\u3092\u7dad\u6301\u3057\u3001\u65b0\u3057\u3044 Emacs \u3067\u306f Tree-sitter \u3084 JSON \u51e6\u7406\u306a\u3069\u3092\u6761\u4ef6\u4ed8\u304d\u3067\u6709\u52b9\u5316\u3002<\/li>\n<li>\u63a8\u5968\u8a18\u8ff0\uff1a<span>lexical-binding<\/span> \u306e\u660e\u793a\u3001<span>cl-lib<\/span> \u306e\u5229\u7528\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u5dee\u7570\u306e\u30de\u30af\u30ed\u5438\u53ce\u3001UI \u3068\u30ed\u30b8\u30c3\u30af\u306e\u5206\u96e2\u3002<\/li>\n<li>\u4f9d\u5b58\u95a2\u4fc2\u306f\u7de9\u3084\u304b\u306b\u3057\u3001\u6b20\u843d\u6642\u306f\u6a5f\u80fd\u4f4e\u4e0b\u306b\u3068\u3069\u3081\u308b\u3002<\/li>\n<\/ul>\n<p>\u5168\u6587\u306f<a href=\"https:\/\/github.com\/id774\/dot_emacs\/blob\/master\/doc\/GUIDELINES\">\u3053\u3061\u3089<\/a>\u3002<\/p>\n<p>\u5f8c\u65e5 Emacs Lisp \u306e\u8a2d\u8a08\u6307\u91dd\u3092<a href=\"https:\/\/blog.id774.net\/entry\/2026\/03\/17\/4042\/\">\u6539\u5b9a\u3057\u305f<\/a>\u3002<\/p>\n<hr>\n<h2>\u7dcf\u62ec<\/h2>\n<p>\u5b9f\u88c5\u30dd\u30ea\u30b7\u30fc\u306f\u300c\u5fc5\u305a\u5b88\u308b\u898f\u7bc4\u300d\u3001\u30ac\u30a4\u30c9\u30e9\u30a4\u30f3\u306f\u300c\u9577\u671f\u4e92\u63db\u6027\u3092\u4fdd\u3064\u305f\u3081\u306e\u63a8\u5968\u4e8b\u9805\u300d\u3067\u3042\u308b\u3002\u4e21\u8005\u3092\u660e\u78ba\u306b\u5206\u3051\u308b\u3053\u3068\u3067\u3001\u7d71\u4e00\u6027\u3068\u67d4\u8edf\u6027\u306e\u4e21\u7acb\u304c\u53ef\u80fd\u306b\u306a\u3063\u305f\u3002\u4eca\u5f8c\u3001\u4ed6\u8a00\u8a9e\u3092\u8ffd\u52a0\u3059\u308b\u969b\u3082\u540c\u69d8\u306e\u5f62\u5f0f\u3067\u65b9\u91dd\u3092\u5b9a\u3081\u3066\u3044\u304f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u5168\u4f53\u3067\u9577\u671f\u904b\u7528\u3092\u898b\u636e\u3048\u305f\u8a2d\u8a08\u57fa\u6e96\u3092\u660e\u78ba\u5316\u3059\u308b\u305f\u3081\u3001Shell Script, Python, Ruby \u306e 3 \u8a00\u8a9e\u306b\u3064\u3044\u3066\u5171\u901a\u306e\u5b9f\u88c5\u30dd\u30ea\u30b7\u30fc\uff08Implementation Policy\uff09\u3092\u5b9a\u7fa9\u3057\u305f\u3002\u52a0\u3048\u3066\u3001E &#8230; <a title=\"\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u88c5\u30dd\u30ea\u30b7\u30fc\u3068 Emacs Lisp \u306e\u30ac\u30a4\u30c9\u30e9\u30a4\u30f3\u3092\u7b56\u5b9a\u3057\u305f\" class=\"read-more\" href=\"https:\/\/harpuia.id774.net\/entry\/2025\/11\/05\/3028\/\" aria-label=\"\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u88c5\u30dd\u30ea\u30b7\u30fc\u3068 Emacs Lisp \u306e\u30ac\u30a4\u30c9\u30e9\u30a4\u30f3\u3092\u7b56\u5b9a\u3057\u305f \u306b\u3064\u3044\u3066\u3055\u3089\u306b\u8aad\u3080\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,14],"tags":[],"class_list":["post-3028","post","type-post","status-publish","format-standard","hentry","category-diary","category-tech"],"_links":{"self":[{"href":"https:\/\/harpuia.id774.net\/entry\/wp-json\/wp\/v2\/posts\/3028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/harpuia.id774.net\/entry\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/harpuia.id774.net\/entry\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/harpuia.id774.net\/entry\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/harpuia.id774.net\/entry\/wp-json\/wp\/v2\/comments?post=3028"}],"version-history":[{"count":2,"href":"https:\/\/harpuia.id774.net\/entry\/wp-json\/wp\/v2\/posts\/3028\/revisions"}],"predecessor-version":[{"id":4390,"href":"https:\/\/harpuia.id774.net\/entry\/wp-json\/wp\/v2\/posts\/3028\/revisions\/4390"}],"wp:attachment":[{"href":"https:\/\/harpuia.id774.net\/entry\/wp-json\/wp\/v2\/media?parent=3028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/harpuia.id774.net\/entry\/wp-json\/wp\/v2\/categories?post=3028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/harpuia.id774.net\/entry\/wp-json\/wp\/v2\/tags?post=3028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}