ほんとのこと知りたいだけなのに。

夏休みはもうおわり。

そろそろ はてなブックマーク のタグ整理にとり組んでみる。

はてなブックマーク とか pocket に結構な件数が蓄積されてきたので、そろそろ気合を入れて整理してみる。

まくら

ブックマークサービスはタグ付けは混沌となる。

タグがキモなんだろうけど、件数が増えていくと結局わけわからんようになる。

タグの作成をしっかり設計する必要があと思う。

タグの設計:概要

以下の三種類のタグにすべきだと考えます。

No 種類 概要
1 情報の区分 大分類です。衣食住とかで分類します。
2 情報の区分内での種類 中分類です。 大分類の中での状態や種類を表現します。
3 横断的な種類 階層化されず、横断的に利用するタグです。固有名詞や商品名などを表現します。

「1.情報の区分」 と 「2.情報の区分内での種類」は階層化されます。

タグ構成のイメージは以下の様になります。

1.情報の区分
   |
   +-- 2.情報の区分内での種類(1) <---|--- 横断的な種類(a)
   |                                 |
   +-- 2.情報の区分内での種類(2) <---+
                                 <------- 横断的な種類(b)

表にすると以下の様になります。

PC ...
あとで読む BM:={商品A}, {商品B}
物欲
情報
 :
 :

タグの設計:詳細

ある程度方向性がかたまったので、実装するための詳細を詰めます。

1. 情報の区分

01:{Name} とします。

「1. 情報の区分」内でのソート性は {Name} で表現するものとします。

初期での構成は以下の通りとします。

タグ 概要
01:衣
01:食
01:住
01:遊
01:音 音楽/オーディオ関係
01:煙 パイプ煙草関連
01:MTB
01:IT
01:PC
01:学問
01:仕事
01:投資

2. 情報の区分内での種類

05:{Name} とします。

ソート性は {Name} で表現するものとします。

タグ 概要
05:あとで読む 未読のものです。既読になったものはこのタグ以外に変更します。
05:情報
05:物欲
05:資産 物欲のもので購入した場合、こちらに移動させます。

3. 3横断的な種類

88:{Name} とします。

このタグは都度追加されるものとします。

と思ったら。

はてなブックマークはタグの管理機能が無い模様。

これは Pocket でタグ管理するしかないか。

Pocket から はてなブックマーク にリンクするか。。。

おわり。

はてなブックマークってつこてないけど、コメント機能とか使うほうがエエのかねぇ。

まぁ、のちのち。

Emacs Lisp のモード関連のオペレータ

メジャーモード書いているとメジャーモードに関する情報が少なく感じる。

断片的なものは多いが、こんなオペレータ無いかな。というので探すことがるので一覧にしてみた。

22 Major and Minor Modes

22.1 Hooks

22.1.1 Running Hooks

type Statement
Function run-hook-with-args hook &rest args
Function run-hook-with-args-until-failure hook &rest args
Function run-hook-with-args-until-success hook &rest args

22.1.2 Setting Hooks

type Statement
Function add-hook hook function &optional append local
Function remove-hook hook function &optional local

22.2 Major Modes

type Statement
Command fundamental-mode
User Option major-mode

22.2.1 Major Mode Conventions

なし

22.2.2 How Emacs Chooses a Major Mode

type Statement
Command normal-mode &optional find-file
Function set-auto-mode &optional keep-mode-if-same
Function set-buffer-major-mode buffer
User Option initial-major-mode
Variable interpreter-mode-alist
Variable magic-mode-alist
Variable magic-fallback-mode-alist
Variable auto-mode-alist

22.2.3 Getting Help about a Major Mode

type Statement
Command describe-mode &optional buffer

22.2.4 Defining Derived Modes

type Statement
Macro define-derived-mode variant parent name docstring keyword-args... body...
Function derived-mode-p &rest modes

22.2.5 Basic Major Modes

type Statement
Command text-mode
Command prog-mode
Command special-mode

22.2.6 Mode Hooks

type Statement
Function run-mode-hooks &rest hookvars
Macro delay-mode-hooks body...
Variable change-major-mode-after-body-hook
Variable after-change-major-mode-hook

22.2.7 Tabulated List mode

type Statement
Variable tabulated-list-format
Variable tabulated-list-entries
Variable tabulated-list-revert-hook
Variable tabulated-list-printer
Variable tabulated-list-sort-key
Function tabulated-list-init-header
Function tabulated-list-print &optional remember-pos update

22.2.8 Generic Modes

type Statement
Macro define-generic-mode mode comment-list keyword-list font-lock-list auto-mode-list function-list &optional docstring

22.2.9 Major Mode Examples

なし

22.3 Minor Modes

type Statement
Variable minor-mode-list

22.3.1 Conventions for Writing Minor Modes

なし

22.3.2 Keymaps and Minor Modes

なし

22.3.3 Defining Minor Modes

type Statement
Macro define-minor-mode mode doc [init-value [lighter [keymap]]] keyword-args... body...
Macro define-globalized-minor-mode global-mode mode turn-on keyword-args...

22.4 Mode Line Format

なし

22.4.1 Mode Line Basics

type Statement
Function force-mode-line-update &optional all

22.4.2 The Data Structure of the Mode Line

なし

22.4.3 The Top Level of Mode Line Control

type Statement
User Option mode-line-format

22.4.4 Variables Used in the Mode Line

type Statement
Variable mode-line-mule-info
Variable mode-line-modified
Variable mode-line-frame-identification
Variable mode-line-buffer-identification
Variable mode-line-position
Variable vc-mode
Variable mode-line-modes
Variable mode-line-remote
Variable mode-line-client
Variable mode-name
Variable mode-line-process
Variable mode-line-front-space
Variable mode-line-end-spaces
Variable mode-line-misc-info
Variable minor-mode-alist
Variable global-mode-string

22.4.5 %-Constructs in the Mode Line

なし

22.4.6 Properties in the Mode Line

なし

22.4.7 Window Header Lines

type Statement
Variable header-line-format
Function window-header-line-height &optional window

22.4.8 Emulating Mode Line Formatting

type Statement
Function format-mode-line format &optional face window buffer

22.5 Imenu

type Statement
Command imenu-add-to-menubar name
Variable imenu-generic-expression
Variable imenu-case-fold-search
Variable imenu-syntax-alist
Variable imenu-prev-index-position-function
Variable imenu-extract-index-name-function
Variable imenu-extract-index-name-function
Variable imenu-create-index-function

22.6 Font Lock Mode

22.6.1 Font Lock Basics

type Statement
Variable font-lock-defaults

22.6.2 Search-based Fontification

type Statement
Variable font-lock-keywords
Variable font-lock-keywords-case-fold-search

22.6.3 Customizing Search-Based Fontification

type Statement
Function font-lock-add-keywords mode keywords &optional how
Function font-lock-remove-keywords mode keywords

22.6.4 Other Font Lock Variables

type Statement
Variable font-lock-mark-block-function
Variable font-lock-extra-managed-props
Variable font-lock-fontify-buffer-function
Variable font-lock-unfontify-buffer-function
Variable font-lock-fontify-region-function
Variable font-lock-unfontify-region-function
Variable font-lock-flush-function
Variable font-lock-ensure-function
Function jit-lock-register function &optional contextual
Function jit-lock-unregister function

22.6.5 Levels of Font Lock

なし

22.6.6 Precalculated Fontification

なし

22.6.7 Faces for Font Lock

なし

22.6.8 Syntactic Font Lock

type Statement
Variable font-lock-keywords-only
Variable font-lock-syntax-table
Variable font-lock-syntactic-face-function

22.6.9 Multiline Font Lock Constructs

22.6.9.1 Font Lock Multiline
type Statement
Variable font-lock-multiline
22.6.9.2 Region to Fontify after a Buffer Change
type Statement
Variable font-lock-extend-after-change-region-function

22.7 Automatic Indentation of code

22.7.1 Simple Minded Indentation Engine

22.7.1.1 SMIE Setup and Features
type Statement
Function smie-setup grammar rules-function &rest keywords
Command smie-close-block
Command smie-down-list &optional arg
22.7.1.2 Operator Precedence Grammars
type Statement
Function smie-prec2->grammar table
Function smie-merge-prec2s &rest tables
Function smie-precs->prec2 precs
Function smie-bnf->prec2 bnf &rest resolvers
22.7.1.3 Defining the Grammar of a Language

なし

22.7.1.4 Defining Tokens

なし

22.7.1.5 Living With a Weak Parser

なし

22.7.1.6 Specifying Indentation Rules

なし

22.7.1.7 Helper Functions for Indentation Rules
type Statement
Function smie-rule-bolp
Function smie-rule-hanging-p
Function smie-rule-next-p &rest tokens
Function smie-rule-prev-p &rest tokens
Function smie-rule-parent-p &rest parents
Function smie-rule-sibling-p
Function smie-rule-parent &optional offset
Function smie-rule-separator method
22.7.1.8 Sample Indentation Rules

なし

22.7.1.9 Customizing Indentation
type Statement
User Option smie-config
Command smie-config-guess
Command smie-config-save
Command smie-config-show-indent &optional move
Command smie-config-set-indent
Function smie-config-local rules

22.8 Desktop Save Mode

type Statement
Variable desktop-save-buffer
Variable desktop-buffer-mode-handlers

おわり

ここも結構多いことがわかる。

それだれ複雑かつ中心の機能ということなんでしょうね。

Emacs Lisp のポジション関連のオペレータ

ナローイングに興味が出たのでオペレータの一覧を作成してみた。

29 Positions

29.1 Point

Type Statement
Function point
Function point-min
Function point-max
Function buffer-end flag
Function buffer-size &optional buffer

29.2 Motion

29.2.1 Motion by Characters

Type Statement
Command goto-char position
Command forward-char &optional count
Command backward-char &optional count

29.2.2 Motion by Words

Type Statement
Command forward-word &optional count
Command backward-word &optional count
User Option words-include-escapes
Variable inhibit-field-text-motion
Variable find-word-boundary-function-table
Function forward-word-strictly &optional count
Function backward-word-strictly &optional count

29.2.3 Motion to an End of the Buffer

Type Statement
Command beginning-of-buffer &optional n
Command end-of-buffer &optional n

29.2.4 Motion by Text Lines

Type Statement
Command beginning-of-line &optional count
Function line-beginning-position &optional count
Command end-of-line &optional count
Function line-end-position &optional count
Command forward-line &optional count
Function count-lines start end
Command count-words start end
Function line-number-at-pos &optional pos

29.2.5 Motion by Screen Lines

Type Statement
Function vertical-motion count &optional window cur-col
Function count-screen-lines &optional beg end count-final-newline window
Command move-to-window-line count
Function move-to-window-group-line count
Function compute-motion from frompos to topos width offsets window

29.2.6 Moving over Balanced Expressions

Type Statement
Command forward-list &optional arg
Command backward-list &optional arg
Command up-list &optional arg escape-strings no-syntax-crossing
Command backward-up-list &optional arg escape-strings no-syntax-crossing
Command down-list &optional arg
Command forward-sexp &optional arg
Command backward-sexp &optional arg
Command beginning-of-defun &optional arg
Command end-of-defun &optional arg
User Option defun-prompt-regexp
User Option open-paren-in-column-0-is-defun-start
Variable beginning-of-defun-function
Variable end-of-defun-function

29.2.7 Skipping Characters

Type Statement
Function skip-chars-forward character-set &optional limit
Function skip-chars-backward character-set &optional limit

29.2.6 Moving over Balanced Expressions

Type Statement
Command backward-list &optional arg
Command up-list &optional arg escape-strings no-syntax-crossing
Command backward-up-list &optional arg escape-strings no-syntax-crossing
Command down-list &optional arg
Command forward-sexp &optional arg
Command backward-sexp &optional arg
Command beginning-of-defun &optional arg
Command end-of-defun &optional arg
User Option defun-prompt-regexp
User Option open-paren-in-column-0-is-defun-start
Variable beginning-of-defun-function
Variable end-of-defun-function

29.2.7 Skipping Characters

Type Statement
Function skip-chars-forward character-set &optional limit
Function skip-chars-backward character-set &optional limit

29.3 Excursions

Type Statement
Special Form save-excursion body...
Macro save-mark-and-excursion body...

29.4 Narrowing

Type Statement
Command narrow-to-region start end
Command narrow-to-page &optional move-count
Command widen
Function buffer-narrowed-p
Special Form save-restriction body...

おわり

しかし「ポジション」ってなんやろ。