Changeset 460 for lang/elisp
- Timestamp:
- 10/11/07 22:15:40 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/elisp/simple-hatena-mode/simple-hatena-mode.el
r448 r460 38 38 ;;;; * ヴァージョン 39 39 40 (defconst simple-hatena-version "0.0 4"40 (defconst simple-hatena-version "0.05" 41 41 "simple-hatena-mode.elのヴァージョン。") 42 42 … … 69 69 このidを変更するには、simple-hatena-change-default-idを実行する。") 70 70 71 (defcustom simple-hatena-use-timestamp-permalink-flag t 72 "はてなダイアリーライターのパーマリンクに、タイムスタンプを使う 73 かどうかを指定するフラグ。") 74 75 (defcustom simple-hatena-time-offset nil 76 "日付を計算する際に用いるオフセット。 77 6 に設定すると午前6時まで前日の日付として扱われる" 78 :type 'integer 79 :group 'simple-hatena) 80 71 81 ;; はてダラにわたすオプション 72 82 (defcustom simple-hatena-option-useragent (simple-hatena-version) 73 83 "はてなダイアリーライターのユーザエージェントオプションを指定す 74 る。実行時に、-aオプションとして使われる。") 84 る。 85 86 実行時に、-aオプションとして使われる。") 75 87 76 88 (defcustom simple-hatena-option-debug-flag nil 77 "はてなダイアリーライターを、デバッグモードで実行するか否かを 示78 すフラグ。89 "はてなダイアリーライターを、デバッグモードで実行するか否かを指 90 定するフラグ。 79 91 80 92 はてなダイアリーライター実行時に、-dオプションとしてわたされ、また、 … … 85 97 86 98 (defcustom simple-hatena-option-timeout "30" 87 "はてなダイアリーライターのタイムアウトを指定する。実行時に、-T 88 オプションとして使われる。") 99 "はてなダイアリーライターのタイムアウトを指定する。 100 101 実行時に、-Tオプションとして使われる。") 89 102 90 103 (defcustom simple-hatena-option-cookie-flag t 91 104 "はてなダイアリーライターのログインに、cookieを利用するかどうか 92 を指定するフラグ。実行時に、-cオプションとして使われる。") 105 を指定するフラグ。 106 107 実行時に、-cオプションとして使われる。") 93 108 94 109 ;; キーバインド … … 105 120 (define-key simple-hatena-mode-map (kbd "C-c C-d") 'simple-hatena-toggle-debug-mode) 106 121 (define-key simple-hatena-mode-map (kbd "C-c C-e") 'simple-hatena-exit) 122 123 ;; simple-hatena-use-timestamp-permalink-flagがtなら、*に 124 ;; simple-hatena-electric-asteriskを割り当てる。 125 (when simple-hatena-use-timestamp-permalink-flag 126 (define-key simple-hatena-mode-map "*" 'simple-hatena-electric-asterisk)) 107 127 108 128 ;; フック … … 355 375 (message "simple-hatena-mode has been exited")) 356 376 377 (defun simple-hatena-electric-asterisk (arg) 378 "*(アスタリスク)押下により、タイムスタンプ付き小見出しを挿入する。 379 380 ポイントが行頭にある場合のみ、タイムスタンプを挿入し、その他の場合 381 は、通常通りアスタリスクを挿入する。" 382 (interactive "*p") 383 (if (zerop (current-column)) 384 (simple-hatena-timestamp) 385 (self-insert-command arg))) 386 357 387 ;;;; * 内部関数 358 388 … … 376 406 (if date 377 407 (append '(0 0 0) date) 378 (decode-time)))) 408 (apply (lambda (s min h d mon y &rest rest) 409 (list s min (- h (or simple-hatena-time-offset 0)) d mon y)) 410 (decode-time))))) 379 411 380 412 (defun simple-hatena-internal-go-for (i)
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)