継続は力にゃりん。毎日続けることができるのか? とばし * 文字テーブル(Char-Tables) * Control Structures :: Nonlocal Exits :: Errors * Control Structures :: Nonlocal Exits :: Cleanups * Variables::Frame-Local Variables * Customization * RRB 2章 残り * Non-ASCII(ちょっとだけ見てしまった) * Calendar * Files::ファイル名を『マジック』にする 進捗 * 2008-02-24 * 2008-01-25 Syntax Tables * 2008-01-12 Advising Functions * 2007-12-23 Debugging * 2007-12-04 Abbrevs * 2007-11-13 Documentation * 2007-10-02 Modes * 2007-08-25 Keymaps * 2007-06-15 Command Loop * 2007-06-06 Byte Compilation * 2007-04-19 Processes * 2007-02-02 Frames * 2006-11-19 Files * 2006-10-11 Backups and Auto-Saving * 2006-08-09 System Interface * 2006-05-26 Display * 2006-03-08 Windows * 2006-02-10 Searching and Matching * 2006-02-03 Non-ASCII(途中でやめ) * 2005-09-07 Text * 2005-08-17 Markers * 2005-07-14 Positions * 2005-06-07 Buffers * 2005-04-20 Minibuffers * 2005-03-25 Read and Print * 2005-02-18 RRB 2章 * 2005-02-04 Loading * 2005-01-27 Macros * 2005-01-08 Functions * 2004-12-21 Variables * 2004-12-07 Control Structures * 2004-11-29 Evaluation * 2004-11-15 Symbols * 2004-10-31 Sequences Arrays Vectors * 2004-09-29 Lists * 2004-09-05 Strings and Characters * 2004-08-24 Numbers !2007-12-31 Mon (setq debug-on-error t) => t (defun fact (n) (if (zerop n) 1 (* n (fact (1- n))))) => fact M-x edebug-defun (fact 3) でデバッグモードへ !2007-12-30 Sun (debug) M-x debug !2007-12-29 Sat 昨日の続き (cancel-debug-on-entry 'fact) => fact (fact 3) => 6 (debug-on-entry 'fact) => fact (fact 3) で、 Entering: * fact(3) eval((fact 3)) eval-last-sexp(t) eval-print-last-sexp() call-interactively(eval-print-last-sexp) recursive-edit() byte-code(" ..." [debugger-buffer buffer-read-only print-length print-escape-newlines standard-output debugger-args pop-to-buffer nil erase-buffer set-buffer-multibyte t 50 backtrace debugger-mode search-forward "\n debug(" 1 debugger-reenable (lambda debug) "Entering:\n" debug backtrace-debug 3 delete-char 42 0 exit "Return value: " prin1 10 32 error "Signaling: " "Beginning evaluation of function call form:\n" message "" recursive-edit debugger-value inhibit-trace] 3) debug(debug) !2007-12-28 Fri まんま (defun fact (n) (if (zerop n) 1 (* n (fact (1- n))))) => fact (debug-on-entry 'fact) => fact (fact 3) で、 Entering: * fact(3) eval((fact 3)) eval-last-sexp(t) eval-print-last-sexp() call-interactively(eval-print-last-sexp) (symbol-function 'fact) => (lambda (n) (debug (quote debug)) (if (zerop n) 1 (* n (fact (1- n))))) !2007-12-27 Thu debug-on-quit => nil !2007-12-26 Wed オプション `--debug-init' ふーん。 debug-on-error は nil だった。 !2007-12-25 Tue debug-on-signal => nil !2007-12-24 Mon debug-ignored-errors => (beginning-of-line ... "^no next record$") !2007-12-23 Sun debug-on-error => nil !2007-12-22 Sat global-abbrev-table => [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] local-abbrev-table => [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] fundamental-mode-abbrev-table => [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] text-mode-abbrev-table => [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] lisp-mode-abbrev-table => [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] !2007-12-21 Fri abbrev-all-caps => nil abbrev-start-location => nil abbrev-start-location-buffer => nil last-abbrev => nil last-abbrev-location => 0 last-abbrev-text => nil pre-abbrev-expand-hook => nil !2007-12-20 Thu M-x abbrev-prefix-mark !2007-12-19 Wed M-x expand-abbrev !2007-12-18 Tue (abbrev-expansion "foo") => nil (abbrev-expansion "foo" x) => "FOOFOO" !2007-12-17 Mon (abbrev-symbol "foo") => nil (setq x (make-abbrev-table)) => [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] (define-abbrev x "foo" "FOOFOO" nil) => "foo" (abbrev-symbol "foo" x) => foo !2007-12-16 Sun abbrevs-changed => nil !2007-12-15 Sat save-abbrevs => t !2007-12-14 Fri (write-abbrev-file "~/foo") => nil (quietly-read-abbrev-file "~/foo") => nil !2007-12-13 Thu (write-abbrev-file "~/foo") => nil ファイルの内容 (define-abbrev-table 'test-table '( )) (define-abbrev-table 'text-mode-abbrev-table '( )) (define-abbrev-table 'lisp-mode-abbrev-table '( )) (define-abbrev-table 'fundamental-mode-abbrev-table '( )) (define-abbrev-table 'global-abbrev-table '( )) !2007-12-12 Wed abbrev-file-name => "~/.abbrev_defs" !2007-12-11 Tue only-global-abbrevs => nil !2007-12-10 Mon (define-abbrev-table 'test-table ()) => nil (add-abbrev 'test-table "global" 1) うーん、abbrev.el も見たが良く分からない… プロンプトに文字列を入れようとすると以下のエラー Wrong type argument: vectorp, test-table !2007-12-09 Sun (define-abbrev-table 'test-table ()) => nil (insert-abbrev-table-description 'test-table) (define-abbrev-table 'test-table '( )) => nil (insert-abbrev-table-description 'test-table t) (test-table) => nil !2007-12-08 Sat abbrev-table-name-list => (pike-mode-abbrev-table idl-mode-abbrev-table java-mode-abbrev-table objc-mode-abbrev-table c++-mode-abbrev-table c-mode-abbrev-table ruby-mode-abbrev-table text-mode-abbrev-table lisp-mode-abbrev-table fundamental-mode-abbrev-table global-abbrev-table) (define-abbrev-table 'test-table ()) => nil abbrev-table-name-list => (test-table pike-mode-abbrev-table idl-mode-abbrev-table java-mode-abbrev-table objc-mode-abbrev-table c++-mode-abbrev-table c-mode-abbrev-table ruby-mode-abbrev-table text-mode-abbrev-table lisp-mode-abbrev-table fundamental-mode-abbrev-table global-abbrev-table) !2007-12-07 Fri (setq x (make-abbrev-table)) => [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] (define-abbrev x "h" "hoge" nil) => "h" x => [0 0 0 0 0 h 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] (clear-abbrev-table x) => nil x => [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] !2007-12-06 Thu (make-abbrev-table) => [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] !2007-12-05 Wed default-abbrev-mode => nil !2007-12-04 Tue abbrev-mode => nil !2007-12-03 Mon three-step-help => nil !2007-12-02 Sun grep make-help-screen /usr/share/emacs/20.7/lisp/*.el /usr/share/emacs/20.7/lisp/help-macro.el:;; This file supplies the macro make-help-screen which constructs /usr/share/emacs/20.7/lisp/help-macro.el:;;->(make-help-screen help-for-empire-redistribute-map /usr/share/emacs/20.7/lisp/help-macro.el:(defmacro make-help-screen (fname help-line help-text helped-map) /usr/share/emacs/20.7/lisp/help.el:;; Get the macro make-help-screen when this is compiled, /usr/share/emacs/20.7/lisp/help.el:(make-help-screen help-for-help 誰も使っていないってこと? !2007-12-01 Sat data-directory => "/usr/share/emacs/20.7/etc/" !2007-11-30 Fri M-x Helper-describe-bindings M-x Helper-help !2007-11-29 Thu (describe-prefix-bindings) => (describe-bindings "" #) !2007-11-28 Wed prefix-help-command => describe-prefix-bindings !2007-11-27 Tue help-form => nil !2007-11-26 Mon help-event-list => (help f1) !2007-11-25 Sun help-char => 8 !2007-11-24 Sat help-command とばし (print-help-return-message) => nil !2007-11-23 Fri help-map => (keymap (104 . view-hello-file) (67 . describe-coding-system) (73 . describe-input-method) (28 . describe-input-method) (76 . describe-language-environment) (12 . describe-language-environment) (113 . help-quit) (118 . describe-variable) (119 . where-is) (116 . help-with-tutorial) (115 . describe-syntax) (112 . finder-by-keyword) (110 . view-emacs-news) (14 . view-emacs-news) (109 . describe-mode) (108 . view-lossage) (9 . info-lookup-symbol) (11 . Info-goto-emacs-key-command-node) (6 . Info-goto-emacs-command-node) (52 keymap (105 . info-other-window)) (105 . info) (70 . view-emacs-FAQ) (102 . describe-function) (100 . describe-function) (107 . describe-key) (99 . describe-key-briefly) (98 . describe-bindings) (97 . apropos-command) (16 . describe-project) (23 . describe-no-warranty) (4 . describe-distribution) (3 . describe-copying) (63 . help-for-help) (f1 . help-for-help) (help . help-for-help) (8 . help-for-help)) !2007-11-22 Thu まんま (apropos "exec") !2007-11-21 Wed (read-kbd-macro "n") => "n" 意味なし… !2007-11-20 Tue まんま (text-char-description ?\C-c) => "^C" (text-char-description ?\M-m) => "\355" (text-char-description ?\C-\M-m) => "\215" !2007-11-19 Mon まんま (single-key-description ?\C-x) => "C-x" (key-description "\C-x \M-y \n \t \r \f123") => "C-x SPC M-y SPC C-j SPC TAB SPC RET SPC C-l 1 2 3" (single-key-description 'C-mouse-1) => "C-mouse-1" !2007-11-18 Sun まんま (substitute-command-keys "To abort recursive edit, type: \\[abort-recursive-edit]") => "To abort recursive edit, type: C-]" (substitute-command-keys "The keys that are defined for the minibuffer here are: \\{minibuffer-local-must-match-map}") => "The keys that are defined for the minibuffer here are: key binding --- ------- C-tab file-cache-minibuffer-complete prior switch-to-completions next next-history-element ESC Prefix Command down next-history-element up previous-history-element ? minibuffer-completion-help SPC minibuffer-complete-word TAB minibuffer-complete C-j minibuffer-complete-and-exit RET minibuffer-complete-and-exit C-g abort-recursive-edit ESC v switch-to-completions ESC s next-matching-history-element ESC r previous-matching-history-element ESC p previous-history-element ESC n next-history-element " (substitute-command-keys "To abort a recursive edit from the minibuffer, type\ \\\\[abort-recursive-edit].") => "To abort a recursive edit from the minibuffer, type C-g." !2007-11-17 Sat doc-directory => "/usr/share/emacs/20.7/etc/" !2007-11-16 Fri (Snarf-documentation "README") error--> Snarf-documentation can only be called in an undumped Emacs !2007-11-15 Thu (documentation 'next-line) => "Move cursor vertically down ARG lines. ... and more reliable (no dependence on goal column, etc.)." !2007-11-14 Wed まんま (documentation-property 'command-line-processed 'variable-documentation) => "Non-nil once command line has been processed" (symbol-plist 'command-line-processed) => (variable-documentation 1079565) !2007-11-13 Tue (defun foo () "document for foo" ) => foo M-x describe-function foo is a Lisp function. (foo) document for foo !2007-11-12 Mon grep make-local-hook /usr/share/emacs/20.7/lisp/*.el /usr/share/emacs/20.7/lisp/comint.el: (make-local-hook 'comint-dynamic-complete-functions) /usr/share/emacs/20.7/lisp/comint.el: (make-local-hook 'comint-input-filter-functions) /usr/share/emacs/20.7/lisp/comint.el: (make-local-hook 'pre-command-hook) /usr/share/emacs/20.7/lisp/comint.el: (make-local-hook 'comint-output-filter-functions) /usr/share/emacs/20.7/lisp/comint.el: (make-local-hook 'comint-exec-hook) /usr/share/emacs/20.7/lisp/cus-edit.el: (make-local-hook 'widget-edit-functions) /usr/share/emacs/20.7/lisp/ediff-util.el: (make-local-hook 'pre-command-hook) /usr/share/emacs/20.7/lisp/ediff-util.el: (make-local-hook 'post-command-hook) /usr/share/emacs/20.7/lisp/ediff-wind.el: (make-local-hook 'select-frame-hook) /usr/share/emacs/20.7/lisp/font-lock.el: (make-local-hook 'after-change-functions) /usr/share/emacs/20.7/lisp/hexl.el: (make-local-hook 'after-revert-hook) /usr/share/emacs/20.7/lisp/hexl.el: (make-local-hook 'change-major-mode-hook) /usr/share/emacs/20.7/lisp/hexl.el: (make-local-hook 'post-command-hook) /usr/share/emacs/20.7/lisp/hilit-chg.el: (make-local-hook 'after-change-functions) /usr/share/emacs/20.7/lisp/icomplete.el: (make-local-hook 'pre-command-hook) /usr/share/emacs/20.7/lisp/icomplete.el: (make-local-hook 'post-command-hook) /usr/share/emacs/20.7/lisp/info.el: (make-local-hook 'activate-menubar-hook) /usr/share/emacs/20.7/lisp/iswitchb.el: (make-local-hook 'pre-command-hook) /usr/share/emacs/20.7/lisp/iswitchb.el: (make-local-hook 'post-command-hook) /usr/share/emacs/20.7/lisp/lazy-lock.el: (make-local-hook 'window-scroll-functions) /usr/share/emacs/20.7/lisp/lazy-lock.el: (make-local-hook 'before-change-functions) /usr/share/emacs/20.7/lisp/lazy-lock.el: (make-local-hook 'outline-view-change-hook) /usr/share/emacs/20.7/lisp/lazy-lock.el: (make-local-hook 'hs-hide-hook) /usr/share/emacs/20.7/lisp/ps-print.el:(make-local-hook 'ps-print-hook) /usr/share/emacs/20.7/lisp/ps-print.el:(make-local-hook 'ps-print-begin-page-hook) /usr/share/emacs/20.7/lisp/ps-print.el:(make-local-hook 'ps-print-begin-column-hook) /usr/share/emacs/20.7/lisp/rlogin.el: ((fboundp 'make-local-hook) /usr/share/emacs/20.7/lisp/rlogin.el: (make-local-hook 'comint-output-filter-functions) /usr/share/emacs/20.7/lisp/rsz-mini.el: (make-local-hook 'post-command-hook) /usr/share/emacs/20.7/lisp/rsz-mini.el: (make-local-hook 'minibuffer-exit-hook) /usr/share/emacs/20.7/lisp/speedbar.el: ;; make-local-hook conventions. /usr/share/emacs/20.7/lisp/speedbar.el: (make-local-hook 'kill-buffer-hook) /usr/share/emacs/20.7/lisp/subr.el:(defun make-local-hook (hook) /usr/share/emacs/20.7/lisp/subr.el:`make-local-hook', not `make-local-variable'. /usr/share/emacs/20.7/lisp/subr.el:`make-local-hook', not `make-local-variable'." /usr/share/emacs/20.7/lisp/tmm.el: (make-local-hook 'minibuffer-exit-hook) /usr/share/emacs/20.7/lisp/vc.el: (make-local-hook 'dired-after-readin-hook) /usr/share/emacs/20.7/lisp/view.el: (make-local-hook 'change-major-mode-hook) /usr/share/emacs/20.7/lisp/wid-edit.el: (make-local-hook 'post-command-hook) /usr/share/emacs/20.7/lisp/wid-edit.el: (make-local-hook 'before-change-functions) /usr/share/emacs/20.7/lisp/wid-edit.el: (make-local-hook 'after-change-functions) /usr/share/emacs/20.7/lisp/zone-mode.el: (make-local-hook 'write-file-hooks) !2007-11-11 Sun grep remove-hook /usr/share/emacs/20.7/lisp/*.el /usr/share/emacs/20.7/lisp/arc-mode.el: (remove-hook 'write-contents-hooks 'archive-write-file t))) /usr/share/emacs/20.7/lisp/autoinsert.el: (remove-hook 'find-file-hooks 'auto-insert)) /usr/share/emacs/20.7/lisp/complete.el: (remove-hook 'find-file-not-found-hooks 'PC-look-for-include-file)) /usr/share/emacs/20.7/lisp/delsel.el: (remove-hook 'pre-command-hook 'delete-selection-pre-hook) /usr/share/emacs/20.7/lisp/ediff-merg.el: (remove-hook 'local-write-file-hooks 'ediff-set-merge-mode)) /usr/share/emacs/20.7/lisp/ediff-util.el: (progn (remove-hook pre-hook 'ediff-save-time) /usr/share/emacs/20.7/lisp/ediff-util.el: (remove-hook post-hook 'ediff-calc-command-time) /usr/share/emacs/20.7/lisp/ehelp.el: (remove-hook 'mouse-leave-buffer-hook 'electric-help-retain))) /usr/share/emacs/20.7/lisp/ehelp.el: (remove-hook 'mouse-leave-buffer-hook 'electric-help-retain) /usr/share/emacs/20.7/lisp/ehelp.el: (remove-hook 'mouse-leave-buffer-hook 'electric-help-retain) /usr/share/emacs/20.7/lisp/font-lock.el: (remove-hook 'after-change-functions 'font-lock-after-change-function t) /usr/share/emacs/20.7/lisp/font-lock.el: (remove-hook 'find-file-hooks 'turn-on-font-lock-if-enabled) /usr/share/emacs/20.7/lisp/font-lock.el: (remove-hook 'post-command-hook 'turn-on-font-lock-if-enabled) /usr/share/emacs/20.7/lisp/help.el: (remove-hook 'temp-buffer-show-hook 'resize-temp-buffer-window) /usr/share/emacs/20.7/lisp/hexl.el: (remove-hook 'write-contents-hooks 'hexl-save-buffer) /usr/share/emacs/20.7/lisp/hexl.el: (remove-hook 'after-revert-hook 'hexl-after-revert-hook t) /usr/share/emacs/20.7/lisp/hexl.el: (remove-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer t) /usr/share/emacs/20.7/lisp/hexl.el: (remove-hook 'post-command-hook 'hexl-follow-ascii-find t) /usr/share/emacs/20.7/lisp/hexl.el: (remove-hook 'write-contents-hooks 'hexl-save-buffer) /usr/share/emacs/20.7/lisp/hexl.el: (remove-hook 'post-command-hook 'hexl-follow-ascii-find t) /usr/share/emacs/20.7/lisp/hilit-chg.el:;; (remove-hook 'local-write-file-hooks 'highlight-changes-rotate-faces) /usr/share/emacs/20.7/lisp/hilit-chg.el: (remove-hook 'after-change-functions 'hilit-chg-set-face-on-change t) /usr/share/emacs/20.7/lisp/hilit-chg.el: (remove-hook 'after-change-functions 'hilit-chg-set-face-on-change t) /usr/share/emacs/20.7/lisp/hilit-chg.el: (remove-hook 'post-command-hook 'hilit-chg-post-command-hook) /usr/share/emacs/20.7/lisp/hilit-chg.el: (remove-hook 'post-command-hook 'hilit-chg-post-command-hook) /usr/share/emacs/20.7/lisp/hilit-chg.el: (remove-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook) /usr/share/emacs/20.7/lisp/hilit-chg.el: (remove-hook 'find-file-hooks 'hilit-chg-check-global) /usr/share/emacs/20.7/lisp/hilit-chg.el: (remove-hook 'post-command-hook /usr/share/emacs/20.7/lisp/hilit-chg.el: (remove-hook 'find-file-hooks 'hilit-chg-check-global) /usr/share/emacs/20.7/lisp/hscroll.el: (remove-hook 'minibuffer-setup-hook 'hscroll-minibuffer-hook) /usr/share/emacs/20.7/lisp/isearch.el: (remove-hook 'mouse-leave-buffer-hook 'isearch-done) /usr/share/emacs/20.7/lisp/lazy-lock.el: (remove-hook 'after-change-functions 'font-lock-after-change-function t) /usr/share/emacs/20.7/lisp/lazy-lock.el: (remove-hook 'window-scroll-functions 'lazy-lock-fontify-after-scroll t) /usr/share/emacs/20.7/lisp/lazy-lock.el: (remove-hook 'window-scroll-functions 'lazy-lock-defer-after-scroll t) /usr/share/emacs/20.7/lisp/lazy-lock.el: (remove-hook 'before-change-functions 'lazy-lock-arrange-before-change t) /usr/share/emacs/20.7/lisp/lazy-lock.el: (remove-hook 'after-change-functions 'lazy-lock-fontify-line-after-change t) /usr/share/emacs/20.7/lisp/lazy-lock.el: (remove-hook 'after-change-functions 'lazy-lock-fontify-rest-after-change t) /usr/share/emacs/20.7/lisp/lazy-lock.el: (remove-hook 'after-change-functions 'lazy-lock-defer-line-after-change t) /usr/share/emacs/20.7/lisp/lazy-lock.el: (remove-hook 'after-change-functions 'lazy-lock-defer-rest-after-change t) /usr/share/emacs/20.7/lisp/lazy-lock.el: (remove-hook 'outline-view-change-hook 'lazy-lock-fontify-after-visage t) /usr/share/emacs/20.7/lisp/lazy-lock.el: (remove-hook 'hs-hide-hook 'lazy-lock-fontify-after-visage t)) /usr/share/emacs/20.7/lisp/lazy-lock.el: (remove-hook 'window-scroll-functions 'lazy-lock-fontify-after-scroll t) /usr/share/emacs/20.7/lisp/lazy-lock.el: (remove-hook 'post-command-hook 'lazy-lock-fontify-after-install) /usr/share/emacs/20.7/lisp/loadhist.el: (mapcar (lambda (y) (remove-hook x y)) /usr/share/emacs/20.7/lisp/mouse-sel.el: (remove-hook 'x-lost-selection-hooks 'mouse-sel-lost-selection-hook)) /usr/share/emacs/20.7/lisp/msb.el: (remove-hook 'menu-bar-update-hook 'menu-bar-update-buffers))) /usr/share/emacs/20.7/lisp/scroll-all.el: (remove-hook 'post-command-hook 'scroll-all-check-to-scroll)))) /usr/share/emacs/20.7/lisp/skeleton.el: (remove-hook 'post-command-hook 'skeleton-abbrev-cleanup t)))) /usr/share/emacs/20.7/lisp/speedbar.el: (remove-hook 'post-command-idle-hook 'speedbar-timer-fn))) /usr/share/emacs/20.7/lisp/speedbar.el: (remove-hook 'after-revert-hook 'speedbar-reset-scanners) /usr/share/emacs/20.7/lisp/strokes.el: (remove-hook 'select-frame-hook /usr/share/emacs/20.7/lisp/subr.el:(defun remove-hook (hook function &optional local) /usr/share/emacs/20.7/lisp/time.el: (remove-hook 'rmail-after-get-new-mail-hook /usr/share/emacs/20.7/lisp/tmm.el: (remove-hook 'minibuffer-setup-hook 'tmm-add-prompt) /usr/share/emacs/20.7/lisp/tmm.el: (remove-hook 'minibuffer-setup-hook 'tmm-add-prompt) /usr/share/emacs/20.7/lisp/tmm.el: (remove-hook 'completion-setup-hook 'tmm-completion-delete-prompt)) /usr/share/emacs/20.7/lisp/tmm.el: (remove-hook 'minibuffer-exit-hook 'tmm-delete-map t) /usr/share/emacs/20.7/lisp/type-break.el: (remove-hook 'type-break-post-command-hook 'type-break-time-warning) /usr/share/emacs/20.7/lisp/type-break.el: (remove-hook 'type-break-post-command-hook 'type-break-do-query)) /usr/share/emacs/20.7/lisp/type-break.el: (remove-hook 'type-break-post-command-hook 'type-break-do-query)))) /usr/share/emacs/20.7/lisp/type-break.el: (remove-hook 'type-break-post-command-hook 'type-break-time-warning) /usr/share/emacs/20.7/lisp/type-break.el: (remove-hook 'type-break-post-command-hook /usr/share/emacs/20.7/lisp/type-break.el: (remove-hook 'type-break-post-command-hook /usr/share/emacs/20.7/lisp/type-break.el: (remove-hook 'type-break-post-command-hook /usr/share/emacs/20.7/lisp/type-break.el: (remove-hook 'type-break-post-command-hook 'type-break-keystroke-warning)) /usr/share/emacs/20.7/lisp/uniquify.el: (remove-hook 'post-command-hook /usr/share/emacs/20.7/lisp/view.el: (remove-hook 'change-major-mode-hook 'view-mode-disable t) /usr/share/emacs/20.7/lisp/which-func.el: (remove-hook 'post-command-hook 'which-func-update) /usr/share/emacs/20.7/lisp/which-func.el: (remove-hook 'post-command-hook 'which-func-update) /usr/share/emacs/20.7/lisp/wid-edit.el: (remove-hook 'post-command-hook 'widget-add-change t) /usr/share/emacs/20.7/lisp/wid-edit.el: (remove-hook 'post-command-hook 'widget-stop-mouse-tracking) /usr/share/emacs/20.7/lisp/winner.el: (remove-hook 'window-configuration-change-hook 'winner-change-fun) /usr/share/emacs/20.7/lisp/winner.el: (remove-hook 'post-command-hook 'winner-save-new-configurations) /usr/share/emacs/20.7/lisp/winner.el: (remove-hook 'post-command-hook 'winner-save-unconditionally) こんなの使わないだろうと予想したのに、いっぱい使われているや !2007-11-10 Sat grep add-hook ~/.emacs (add-hook 'ruby-mode-hook (add-hook 'shell-mode-hook (function !2007-11-09 Fri grep run-hook-with-args-until-success /usr/share/emacs/20.7/lisp/*.el /usr/share/emacs/20.7/lisp/comint.el: (run-hook-with-args-until-success 'comint-dynamic-complete-functions)) /usr/share/emacs/20.7/lisp/files.el: (or (run-hook-with-args-until-success 'find-file-not-found-hooks) /usr/share/emacs/20.7/lisp/files.el: (or (run-hook-with-args-until-success 'write-contents-hooks) /usr/share/emacs/20.7/lisp/files.el: (run-hook-with-args-until-success 'local-write-file-hooks) /usr/share/emacs/20.7/lisp/files.el: (run-hook-with-args-until-success 'write-file-hooks) !2007-11-08 Thu grep run-hook-with-args-until-failure /usr/share/emacs/20.7/lisp/*.el /usr/share/emacs/20.7/lisp/files.el: (run-hook-with-args-until-failure 'kill-emacs-query-functions) !2007-11-07 Wed grep run-hook-with-args /usr/share/emacs/20.7/lisp/*.el /usr/share/emacs/20.7/lisp/comint.el: (run-hook-with-args 'comint-input-filter-functions /usr/share/emacs/20.7/lisp/comint.el: (run-hook-with-args 'comint-output-filter-functions ""))))) /usr/share/emacs/20.7/lisp/comint.el: (run-hook-with-args 'comint-output-filter-functions string) /usr/share/emacs/20.7/lisp/comint.el: (run-hook-with-args-until-success 'comint-dynamic-complete-functions)) /usr/share/emacs/20.7/lisp/files.el: (or (run-hook-with-args-until-success 'find-file-not-found-hooks) /usr/share/emacs/20.7/lisp/files.el: (or (run-hook-with-args-until-success 'write-contents-hooks) /usr/share/emacs/20.7/lisp/files.el: (run-hook-with-args-until-success 'local-write-file-hooks) /usr/share/emacs/20.7/lisp/files.el: (run-hook-with-args-until-success 'write-file-hooks) /usr/share/emacs/20.7/lisp/files.el: (run-hook-with-args-until-failure 'kill-emacs-query-functions) /usr/share/emacs/20.7/lisp/frame.el: (run-hook-with-args 'after-make-frame-functions frame) /usr/share/emacs/20.7/lisp/speedbar.el: ((fboundp 'run-hook-with-args) /usr/share/emacs/20.7/lisp/speedbar.el: (run-hook-with-args 'temp-buffer-show-hook buffer)) /usr/share/emacs/20.7/lisp/speedbar.el: (run-hook-with-args 'speedbar-vc-path-enable-hook path) /usr/share/emacs/20.7/lisp/speedbar.el: (run-hook-with-args 'speedbar-vc-in-control-hook path name) /usr/share/emacs/20.7/lisp/wid-edit.el: (run-hook-with-args 'widget-edit-functions widget)) /usr/share/emacs/20.7/lisp/wid-edit.el: (run-hook-with-args 'widget-edit-functions widget)) /usr/share/emacs/20.7/lisp/wid-edit.el: (run-hook-with-args 'widget-edit-functions widget)) !2007-11-06 Tue (run-hooks 'emacs-lisp-mode-hook) => nil 何が分かるんだ? !2007-11-05 Mon 「(require 'font-lock)」した Emacs で、 font-lock-syntactic-keywords => nil !2007-11-04 Sun 「(require 'font-lock)」した Emacs で、 font-lock-comment-face => font-lock-comment-face font-lock-string-face => font-lock-string-face font-lock-keyword-face => font-lock-keyword-face font-lock-builtin-face => font-lock-builtin-face font-lock-function-name-face => font-lock-function-name-face font-lock-variable-name-face => font-lock-variable-name-face font-lock-type-face => font-lock-type-face font-lock-constant-face => font-lock-constant-face font-lock-warning-face => font-lock-warning-face !2007-11-03 Sat font-lock-keywords error--> Symbol's value as variable is void: font-lock-keywords font-lock-keywords-only error--> Symbol's value as variable is void: font-lock-keywords-only font-lock-keywords-case-fold-search error--> Symbol's value as variable is void: font-lock-keywords-case-fold-search font-lock-syntax-table error--> Symbol's value as variable is void: font-lock-syntax-table font-lock-beginning-of-syntax-function error--> Symbol's value as variable is void: font-lock-beginning-of-syntax-function font-lock-mark-block-function error--> Symbol's value as variable is void: font-lock-mark-block-function 「(require 'font-lock)」した Emacs だとエラーとはならなかった !2007-11-02 Fri font-lock-defaults => nil !2007-11-01 Thu imenu-index-alist error--> Symbol's value as variable is void: imenu-index-alist !2007-10-31 Wed imenu-create-index-function => imenu-default-create-index-function !2007-10-30 Tue imenu-extract-index-name-function => nil !2007-10-29 Mon imenu-prev-index-position-function => beginning-of-defun !2007-10-28 Sun imenu-syntax-alist => nil !2007-10-27 Sat imenu-case-fold-search => nil !2007-10-26 Fri imenu-generic-expression => ((nil "^\\s-*(def\\(un\\|subst\\|macro\\|advice\\|ine-skeleton\\)\\s-+\\([-A-Za-z0-9+*|:/]+\\)" 2) ("Variables" "^\\s-*(def\\(var\\|const\\|custom\\)\\s-+\\([-A-Za-z0-9+*|:/]+\\)" 2) ("Types" "^\\s-*(def\\(group\\|type\\|struct\\|class\\|ine-condition\\)\\s-+\\([-A-Za-z0-9+*|:/]+\\)" 2)) !2007-10-25 Thu vc-mode => nil !2007-10-24 Wed default-mode-line-format => ("-" mode-line-mule-info mode-line-modified mode-line-frame-identification mode-line-buffer-identification " " global-mode-string " %[(" mode-name mode-line-process minor-mode-alist "%n" ")%]--" (which-func-mode ("" which-func-format "--")) (line-number-mode "L%l--") (column-number-mode "C%c--") (-3 . "%p") "-%-") !2007-10-23 Tue mode-line-buffer-identification => ("%12b") !2007-10-22 Mon mode-line-mule-info => ("" (current-input-method ("" current-input-method-title)) "%Z") mode-line-modified => ("%1*%1+") mode-line-frame-identification => " " default-directory => "~/" global-mode-string => ((mew-biff-string mew-biff-string)) mode-line-process => nil !2007-10-21 Sun mode-name => "Lisp Interaction" minor-mode-alist => ((c-auto-hungry-string c-auto-hungry-string) (compilation-minor-mode " Compilation") (compilation-shell-minor-mode " Shell-Compile") (compilation-in-progress " Compiling") (view-mode " View") (w3m-minor-mode " w3m") (lookup-entry-overview-mode " Overview") (encoded-kbd-mode " Encoded-kbd") (vc-mode vc-mode) (abbrev-mode " Abbrev") (overwrite-mode overwrite-mode) (auto-fill-function " Fill") (defining-kbd-macro " Def") (isearch-mode isearch-mode)) !2007-10-20 Sat (force-mode-line-update) => t !2007-10-19 Fri mode-line-format => ("-" mode-line-mule-info mode-line-modified mode-line-frame-identification mode-line-buffer-identification " " global-mode-string " %[(" mode-name mode-line-process minor-mode-alist "%n" ")%]--" (which-func-mode ("" which-func-format "--")) (line-number-mode "L%l--") (column-number-mode "C%c--") (-3 . "%p") "-%-") !2007-10-18 Thu まんま (easy-mmode-define-minor-mode hungry-mode "Toggle Hungry mode. With no argument, this command toggles the mode. Non-null prefix argument turns on the mode. Null prefix argument turns off the mode. When Hungry mode is enabled, the control delete key gobbles all preceding whitespace except the last. See the command \\[hungry-electric-delete]." ;; 初期値 nil ;; モード行への表示 " Hungry" ;; マイナモードのバインディング '(("\C-\^?" . hungry-electric-delete) ("\C-\M-\^?" . (lambda () (interactive) (hungry-electric-delete t))))) => ((hungry-mode keymap (27 keymap (31 lambda nil (interactive) (hungry-electric-delete t))) ... )) hungry-mode => nil (setq hungry-mode t) => t 何が変わったかは不明… !2007-10-17 Wed minor-mode-map-alist => ((compilation-minor-mode keymap (27 keymap ... (142 . encoded-kbd-self-insert-iso2022-8bit))) !2007-10-16 Tue まんま (define-derived-mode hypertext-mode text-mode "Hypertext" "Major mode for hypertext.\\{hypertext-mode-map}" (setq case-fold-search nil)) => hypertext-mode (define-key hypertext-mode-map [down-mouse-3] 'do-hyper-link) => do-hyper-link !2007-10-15 Mon major-mode => lisp-interaction-mode !2007-10-14 Sun (describe-mode) => "Type C-x 1 to remove help window. M-C-v to scroll the help." !2007-10-13 Sat (hack-local-variables) => nil ? !2007-10-12 Fri interpreter-mode-alist => (("perl" . perl-mode) ("perl5" . perl-mode) ("miniperl" . perl-mode) ("wish" . tcl-mode) ("wishx" . tcl-mode) ("tcl" . tcl-mode) ("tclsh" . tcl-mode) ("awk" . awk-mode) ("mawk" . awk-mode) ("nawk" . awk-mode) ("gawk" . awk-mode) ("scm" . scheme-mode) ("ash" . sh-mode) ("bash" . sh-mode) ("bash2" . sh-mode) ("csh" . sh-mode) ("dtksh" . sh-mode) ("es" . sh-mode) ("itcsh" . sh-mode) ("jsh" . sh-mode) ("ksh" . sh-mode) ("oash" . sh-mode) ("pdksh" . sh-mode) ("rc" . sh-mode) ("rpm" . sh-mode) ("sh" . sh-mode) ("sh5" . sh-mode) ("tcsh" . sh-mode) ("wksh" . sh-mode) ("wsh" . sh-mode) ("zsh" . sh-mode) ("tail" . text-mode) ("more" . text-mode) ("less" . text-mode) ("pg" . text-mode)) !2007-10-11 Thu auto-mode-alist => ( ... ("\\.gz\\(~\\|\\.~[0-9]+~\\)?\\'" nil jka-compr) ... ("\\.tgz\\'" . tar-mode)) !2007-10-10 Wed initial-major-mode => lisp-interaction-mode !2007-10-09 Tue (set-buffer-major-mode "*scratch*") => nil (set-buffer-major-mode nil) => nil ? !2007-10-08 Mon default-major-mode => fundamental-mode !2007-10-07 Sun (set-auto-mode) => nil !2007-10-06 Sat enable-local-eval => maybe !2007-10-05 Fri ignored-local-variables => (enable-local-eval) !2007-10-04 Thu enable-local-variables => t !2007-10-03 Wed (normal-mode) => nil !2007-10-02 Tue (setq imenu-case-fold-search t), set-syntax-table あたりは使ったことないな (fundamental-mode) => nil !2007-10-01 Mon menu-bar-update-hook => (w3m-tab-menubar-update menu-bar-update-buffers) Menu Keymaps は、ほとんどとばしちゃったか… !2007-09-30 Sun menu-bar-final-items => (help-menu) !2007-09-29 Sat menu-prompt-more-char => 32 !2007-09-28 Fri (describe-bindings) => (describe-bindings nil #) !2007-09-27 Thu まんま (where-is-internal 'describe-function) => ([f1 102] [f1 100] [menu-bar help-menu describe describe-function]) !2007-09-26 Wed まんま (accessible-keymaps (current-local-map)) => (([] keymap (10 . eval-print-last-sexp) (27 keymap (9 . lisp-complete-symbol) (24 . eval-defun) keymap (17 . indent-sexp)) keymap (127 . backward-delete-char-untabify) (27 keymap (17 . indent-sexp))) ([27] keymap (9 . lisp-complete-symbol) (24 . eval-defun) keymap (17 . indent-sexp)) ([27] keymap (17 . indent-sexp))) !2007-09-25 Tue (local-key-binding "\C-j") => eval-print-last-sexp (local-unset-key "\C-j") => nil (local-key-binding "\C-j")M-x eval-print-last-sexp => nil !2007-09-24 Mon まんま (key-binding "\C-l") => hilit-recenter (global-unset-key "\C-l") => nil (key-binding "\C-l") => nil (global-set-key "\C-l\C-l" 'redraw-display) => redraw-display (key-binding "\C-l\C-l") => redraw-display !2007-09-23 Sun まんま (global-set-key "\C-x\C-\\" 'next-line) => next-line (global-set-key [?\C-x ?\C-\\] 'next-line) => next-line (global-set-key [(control ?x) (control ?\\)] 'next-line) => next-line (global-set-key [M-mouse-1] 'mouse-set-point) => mouse-set-point !2007-09-22 Sat まんま (setq dired-mode-map (make-keymap)) => (keymap #^[t ... nil keymap]) (suppress-keymap dired-mode-map) => nil dired-mode-map => (keymap #^[t ... nil undefined ... nil keymap]) (define-key dired-mode-map "r" 'dired-rename-file) => dired-rename-file !2007-09-21 Fri まんま (substitute-key-definition 'find-file 'find-file-read-only (current-global-map)) => nil !2007-09-20 Thu まんま (setq map (make-sparse-keymap)) => (keymap) (define-key map "\C-f" 'forward-char) => forward-char map => (keymap (6 . forward-char)) (define-key map "\C-xf" 'forward-word) => forward-word map => (keymap (24 keymap (102 . forward-word)) (6 . forward-char)) (define-key map "\C-p" ctl-x-map) => (keymap #^[t ... nil keymap] (67108896 . pop-global-mark)) (define-key map "\C-p\C-f" 'foo) => foo map => (keymap (16 keymap #^[t ... nil keymap] (67108896 . pop-global-mark)) (24 keymap (102 . forward-word)) (6 . forward-char)) !2007-09-19 Wed まんま meta-prefix-char => 27 (key-binding "\M-b") => backward-word ?\C-x => 24 (setq meta-prefix-char 24) => 24 (key-binding "\M-b") => switch-to-buffer (setq meta-prefix-char 27) => 27 !2007-09-18 Tue (minor-mode-key-binding "\C-x\C-f") => nil !2007-09-17 Mon (global-key-binding "\C-x\C-f") => find-file (global-key-binding "\C-j") => newline-and-indent !2007-09-16 Sun (local-key-binding "\C-x\C-f") => 1 (local-key-binding "\C-j") => eval-print-last-sexp !2007-09-15 Sat (key-binding "\C-x\C-f") => find-file (key-binding "\C-x\C-f\C-f") => nil !2007-09-14 Fri (undefined) => nil ? !2007-09-13 Thu まんま (lookup-key (current-global-map) "\C-x\C-f") => find-file (lookup-key (current-global-map) "\C-x\C-f12345") => 2 (lookup-key (current-global-map) "\M-f") => forward-word (lookup-key (current-global-map) "\ef") => forward-word !2007-09-12 Wed special-event-map => (keymap (make-frame-visible . ignore-event) (iconify-frame . ignore-event) (delete-frame . handle-delete-frame)) !2007-09-11 Tue overriding-local-map-menu-flag => nil !2007-09-10 Mon overriding-local-map => nil overriding-terminal-local-map => nil !2007-09-09 Sun minor-mode-overriding-map-alist => ((egg-conversion-mode . egg-conversion-map) (its-fence-mode . its-mode-map) (egg-modefull-mode . egg-modefull-map) (egg-modeless-mode . egg-modeless-map)) !2007-09-08 Sat use-global-map, use-local-map とばし minor-mode-map-alist => ((lookup-entry-overview-mode keymap (112 . previous-line) ...)) !2007-09-07 Fri (current-minor-mode-maps) => ((keymap (255 . encoded-kbd-self-insert-iso2022-8bit) ... )) !2007-09-06 Thu (current-local-map) => (keymap (10 . eval-print-last-sexp) (27 keymap (9 . lisp-complete-symbol) (24 . eval-defun) keymap (17 . indent-sexp)) keymap (127 . backward-delete-char-untabify) (27 keymap (17 . indent-sexp))) !2007-09-05 Wed (current-global-map) => (keymap #^[t nil set-mark-command ... nil keymap] (33554444 . hilit-repaint-command) ...) !2007-09-04 Tue global-map => (keymap #^[t nil set-mark-command ... nil keymap] (33554444 . hilit-repaint-command) ...) !2007-09-03 Mon define-prefix-command とばし overriding-local-map => nil !2007-09-02 Sun まんま (use-local-map (make-sparse-keymap)) => nil (local-set-key "\C-p" ctl-x-map)M-x eval-print-last-sexp => (keymap #^[t nil ... nil keymap] (67108896 . pop-global-mark)) (key-binding "\C-p\C-f")M-x eval-print-last-sexp => find-file (key-binding "\C-p6")M-x eval-print-last-sexp => 2C-command * 「*scratc*」で C-j が効かなくなったので、M-x eval-print-last-sexp で評価 * key-binding すりゃ良かったか… !2007-09-01 Sat esc-map => (keymap #^[t nil mark-sexp ... nil keymap] (67108901 . query-replace-regexp) (67108910 . find-tag-regexp) (67108911 . dabbrev-completion) (33554454 . scroll-other-window-down) (67108896 . mark-sexp) (67108909 . negative-argument) (67108921 . digit-argument) (67108920 . digit-argument) (67108919 . digit-argument) (67108918 . digit-argument) (67108917 . digit-argument) (67108916 . digit-argument) (67108915 . digit-argument) (67108914 . digit-argument) (67108913 . digit-argument) (67108912 . digit-argument)) help-map => (keymap (104 . view-hello-file) (67 . describe-coding-system) (73 . describe-input-method) (28 . describe-input-method) (76 . describe-language-environment) (12 . describe-language-environment) (113 . help-quit) (118 . describe-variable) (119 . where-is) (116 . help-with-tutorial) (115 . describe-syntax) (112 . finder-by-keyword) (110 . view-emacs-news) (14 . view-emacs-news) (109 . describe-mode) (108 . view-lossage) (9 . info-lookup-symbol) (11 . Info-goto-emacs-key-command-node) (6 . Info-goto-emacs-command-node) (52 keymap (105 . info-other-window)) (105 . info) (70 . view-emacs-FAQ) (102 . describe-function) (100 . describe-function) (107 . describe-key) (99 . describe-key-briefly) (98 . describe-bindings) (97 . apropos-command) (16 . describe-project) (23 . describe-no-warranty) (4 . describe-distribution) (3 . describe-copying) (63 . help-for-help) (f1 . help-for-help) (help . help-for-help) (8 . help-for-help)) mode-specific-map => (keymap (87 . sdic-describe-word-at-point) (119 . sdic-describe-word) (114 . mew) (8 . help-command)) ctl-x-map => (keymap #^[t nil pop-global-mark ... nil keymap] (67108896 . pop-global-mark)) mule-keymap => (keymap (108 . set-language-environment) (99 . universal-coding-system-argument) (28 . set-input-method) (88 . set-next-selection-coding-system) (120 . set-selection-coding-system) (112 . set-buffer-process-coding-system) (107 . set-keyboard-coding-system) (116 . set-terminal-coding-system) (102 . set-buffer-file-coding-system)) ctl-x-4-map => (keymap (48 . kill-buffer-and-window) (46 . find-tag-other-window) (100 . dired-other-window) (97 . add-change-log-entry-other-window) (15 . display-buffer) (98 . switch-to-buffer-other-window) (6 . find-file-other-window) (114 . find-file-read-only-other-window) (102 . find-file-other-window) (109 . compose-mail-other-window)) ctl-x-5-map => (keymap (111 . other-frame) (48 . delete-frame) (50 . make-frame-command) (46 . find-tag-other-frame) (100 . dired-other-frame) (114 . find-file-read-only-other-frame) (6 . find-file-other-frame) (102 . find-file-other-frame) (98 . switch-to-buffer-other-frame) (109 . compose-mail-other-frame)) 2C-mode-map error--> Symbol's value as variable is void: 2C-mode-map vc-prefix-map => (keymap (126 . vc-version-other-window) (61 . vc-diff) (118 . vc-next-action) (117 . vc-revert-buffer) (115 . vc-create-snapshot) (114 . vc-retrieve-snapshot) (109 . vc-merge) (108 . vc-print-log) (105 . vc-register) (104 . vc-insert-headers) (103 . vc-annotate) (100 . vc-directory) (99 . vc-cancel-version) (97 . vc-update-change-log)) facemenu-keymap => (keymap (100 "default" . facemenu-set-default) (98 "bold" . facemenu-set-bold) (105 "italic" . facemenu-set-italic) (108 "bold-italic" . facemenu-set-bold-italic) (117 "underline" . facemenu-set-underline) (111 "Other..." . facemenu-set-face) "Set face") !2007-08-31 Fri まんま (let ((map (make-sparse-keymap))) (set-keymap-parent map text-mode-map) map) => (keymap keymap (9 . indent-relative) (27 keymap (83 . center-paragraph) (115 . center-line) (9 . ispell-complete-word))) !2007-08-30 Thu (keymap-parent (current-local-map)) => (keymap (127 . backward-delete-char-untabify) (27 keymap (17 . indent-sexp))) !2007-08-29 Wed (copy-keymap (current-local-map)) => (keymap (10 . eval-print-last-sexp) (27 keymap (9 . lisp-complete-symbol) (24 . eval-defun) keymap (17 . indent-sexp)) keymap (127 . backward-delete-char-untabify) (27 keymap (17 . indent-sexp))) !2007-08-28 Tue (make-sparse-keymap) => (keymap) !2007-08-27 Mon (make-keymap) => (keymap #^[t nil nil ... nil keymap]) !2007-08-26 Sun (keymapp '(keymap)) => t (keymapp (current-global-map)) => t !2007-08-25 Sat lisp-mode-map => (keymap (3 keymap (26 . run-lisp)) (27 keymap (24 . lisp-eval-defun) keymap (17 . indent-sexp)) keymap (127 . backward-delete-char-untabify) (27 keymap (17 . indent-sexp))) !2007-08-24 Fri last-kbd-macro => "" !2007-08-23 Thu defining-kbd-macro => nil 「キーボードマクロを定義中かどうか」というのは、定義している最中って意味か !2007-08-22 Wed executing-macro => nil !2007-08-21 Tue (execute-kbd-macro "") => nil !2007-08-20 Mon command-history => ((switch-to-buffer "*scratch*") (kill-buffer ".emacs.el") ... ) !2007-08-19 Sun disabled-command-hook => nil !2007-08-18 Sat (disable-command 'upcase-region) => nil .emacs に書き込みが行なわれた? (enable-command 'upcase-region) => nil .emacs に書き込みが行なわれた? !2007-08-17 Fri (put 'upcase-region 'disabled t) => t (put 'upcase-region 'enable t) => t 元に戻らないのだけど? と思ったら、スペルミス。こうだった (put 'upcase-region 'enabled t) => t narrowing の警告はこの機能で出ているのかな? !2007-08-16 Thu universal-argument, digit-argument, negative-argument とばし まんま (defun simple-rec () (forward-word 1) (message "Recursive edit in progress") (recursive-edit) (forward-word 1)) (simple-rec) ? 理解できていない… あと、再帰編集とばし !2007-08-15 Wed last-prefix-arg => nil !2007-08-14 Tue prefix-arg => nil (defun foo (x) (interactive "n") (message (format "%s" prefix-arg))) => foo C-u M-x foo 4 => nil !2007-08-13 Mon current-prefix-arg => nil (defun foo (x) (interactive "n") (message (format "%s" current-prefix-arg))) => foo C-u M-x foo 4 => (4) ? !2007-08-12 Sun (prefix-numeric-value nil) => 1 (prefix-numeric-value t) => 1 (prefix-numeric-value 3) => 3 (prefix-numeric-value '(1 2 3)) => 1 (prefix-numeric-value 'foo) => 1 !2007-08-11 Sat (keyboard-quit) !2007-08-10 Fri inhibit-quit => nil !2007-08-09 Thu quit-flag => nil !2007-08-08 Wed (sleep-for 1) => nil (sleep-for 1.2) => nil !2007-08-07 Tue (sit-for 2) => t (sit-for 1.2) => t !2007-08-06 Mon (discard-input) => nil !2007-08-05 Sun last-input-char => 10 !2007-08-04 Sat last-input-event => 10 !2007-08-03 Fri (input-pending-p) => nil !2007-08-02 Thu unread-command-char => -1 !2007-08-01 Wed unread-command-events => nil (listify-key-sequence 97) => (57 55) unread-command-events => nil !2007-07-31 Tue unread-command-events => nil !2007-07-30 Mon (read-quoted-char) 「12 」を入力で、 => 10 !2007-07-29 Sun input-method-function => nil !2007-07-28 Sat (read-char) => 97 (read-char) 「→」を入力で、 error--> Non-character input-event !2007-07-27 Fri cursor-in-echo-area => nil !2007-07-26 Thu (read-event) => right (read-event) => 97 (read-event "*") => 98 !2007-07-25 Wed num-nonmacro-input-events => 20489 !2007-07-24 Tue num-input-keys => 19686 !2007-07-23 Mon (read-key-sequence-vector "*") => [97] ↑は「a」を入力で !2007-07-22 Sun (read-key-sequence "*") => "a" (read-key-sequence "") => [mode-line (down-mouse-1 (# (mode-line) (89 . 609) 107667477))] !2007-07-21 Sat (scroll-bar-scale '(0.5 . 1) 100) => 50 !2007-07-20 Fri (scroll-bar-event-ratio (read-event)) ? !2007-07-19 Thu (posn-timestamp (event-start (read-event))) マウスクリックで => -29997133 !2007-07-18 Wed (posn-col-row (event-start (read-event))) マウスクリックで *Messages* に (65 . 9) !2007-07-17 Tue (posn-x-y (event-start (read-event))) マウスクリックで *Messages* に (297 . 209) !2007-07-16 Mon (posn-point (event-start (read-event))) マウスクリックで *Messages* に 2915 !2007-07-15 Sun (posn-window (event-start (read-event))) マウスクリックで *Messages* に # !2007-07-14 Sat (event-end (read-event)) マウスクリックで *Messages* に (# 2911 (273 . 225) 73106804) !2007-07-13 Fri (event-start (read-event)) マウスクリックで *Messages* に (# 2859 (169 . 209) 73042279) !2007-07-12 Thu まんま (event-convert-list '(control ?a)) => 1 (event-convert-list '(control meta ?a)) => -134217727 (event-convert-list '(control super f1)) => C-s-f1 !2007-07-11 Wed (mouse-movement-p nil) => nil どうやって試したら? !2007-07-10 Tue まんま (event-basic-type ?a) => 97 (event-basic-type ?A) => 97 (event-basic-type ?\C-a) => 97 (event-basic-type ?\C-\S-a) => 97 (event-basic-type 'f5) => nil (event-basic-type 's-f5) => nil (event-basic-type 'M-S-f5) => nil (event-basic-type 'down-mouse-1) => mouse-1 !2007-07-09 Mon まんま (event-modifiers ?a) => nil (event-modifiers ?\C-a) => (control) (event-modifiers ?\C-%) => (control) (event-modifiers ?\C-\S-a) => (shift control) (event-modifiers 'f5) => nil (event-modifiers 's-f5) => nil (event-modifiers 'M-S-f5) => nil (event-modifiers 'mouse-1) => (click) (event-modifiers 'down-mouse-1) => (down) !2007-07-08 Sun (event-modifiers (read-event)) マウスクリック *Messages* に (down) (event-modifiers (read-event)) 「C-x」 *Messages* に (control) !2007-07-07 Sat double-click-time => 500 !2007-07-06 Fri (event-click-count (read-event)) => 1 マウスクリックで ダブルクリックできるの? !2007-07-05 Thu (eventp t) => (t) (eventp nil) => (nil) (eventp 1) => t (eventp "foo") => nil (eventp (read-event)) *Messages* に (mouse-1 down) (eventp ?a) => t !2007-07-04 Wed last-event-frame => # !2007-07-03 Tue last-command-char => 10 !2007-07-02 Mon last-command-event => 10 !2007-07-01 Sun last-nonmenu-event => 10 !2007-06-30 Sat (this-command-keys-vector) => [10] (this-command-keys-vector) C-x C-e で評価 *Messages* に [24 5] !2007-06-29 Fri (this-command-keys) => " " (this-command-keys) C-x C-e で評価 *Messages* に "^X^E" !2007-06-28 Thu this-command => eval-print-last-sexp !2007-06-27 Wed real-last-command => hilit-yank !2007-06-26 Tue last-command => yank !2007-06-25 Mon (defun foo (x) (interactive-p)) => foo (defun foo () (interactive) (interactive-p)) => foo (defun foo () (interactive) (message (format "%S"(interactive-p)))) => t !2007-06-24 Sun (execute-extended-command 1) 1 M-x の状態になる !2007-06-23 Sat (command-execute (lambda (x) (interactive "nfoo:"))) => nil 関数が起動された !2007-06-22 Fri (call-interactively (lambda (x) (interactive "nfoo:"))) => nil 関数が起動された command-history => ((switch-to-buffer "*scratch*") ... (call-interactively (lambda (x) (interactive "nfoo:")) t) => nil command-history => (((lambda (x) (interactive "nfoo:")) 2) ... !2007-06-21 Thu うげ、「'n'」は、 もし前置引数があってもそれは使わない という仕様だったらしい。 「'N'」でなく、「'n'」使ってたような気がする (commandp t) => nil (commandp (lambda (x) (interactive "nfoo:"))) => (interactive "nfoo:") (commandp (lambda (x) t)) => nil ふーむ、t 返っていないから意図した通りになっていないのか? defun した関数名ってどう与えるの? !2007-06-20 Wed (defun foo (x y) (interactive "nfoo\nnbar%s")) => foo 一度目に入れた値が bar の後につくようだ !2007-06-19 Tue (defun foo (x y) (interactive "nfoo\nnbar")) => foo M-x foo (defun foo (x) (interactive "nfoo\nn")) => foo M-x foo error--> Wrong number of arguments: (lambda (x) (interactive "nfoo n")), 2 !2007-06-18 Mon 引数ARG-DESCRIPTORの以下の説明 * 省略するか`nil'. この場合, コマンドは引数なしで呼ばれる. コマンド が1つ以上の引数を必要とする場合, これはただちにエラーになる. 理解できず (defun foo (x) (interactive)) => foo (foo 1) => nil ? M-x foo error--> Wrong number of arguments: (lambda (x) (interactive)), 0 C-u M-x foo error--> Wrong number of arguments: (lambda (x) (interactive)), 0 こう言う意味なのか??? !2007-06-17 Sun 「サブルーチン」は「サブルーティン」として訳されているようだ… (interactive) => nil 無意味なはず !2007-06-16 Sat post-command-hook => nil !2007-06-15 Fri pre-command-hook => nil !2007-06-14 Thu (defun factorial (integer) "Compute factorial of an integer." (if (= 1 integer) 1 (* integer (factorial (1- integer))))) => factorial (disassemble 'factorial) => nil で、 byte code for factorial: doc: Compute factorial of an integer. args: (integer) 0 varref integer 1 constant 1 2 eqlsign 3 goto-if-nil 1 6 constant 1 7 return 8:1 varref integer 9 constant factorial 10 varref integer 11 sub1 12 call 1 13 mult 14 return うへへ〜 !2007-06-13 Wed fetch-bytecode とばし eval-and-compile, eval-when-compile とばし BODY って関数のことだっけ? let とかで囲ったのも含まれるの??? (make-byte-code) error--> Wrong number of arguments: #, 0 うーむ、マニュアルとは違う??? 「&rest」って省略できないのかも??? !2007-06-12 Tue byte-compile-dynamic => nil !2007-06-11 Mon byte-compile-dynamic-docstrings => t !2007-06-10 Sun byte-code この関数を読者自身で呼び出さないこと だそうな !2007-06-09 Sat batch-byte-compile M-x batch-byte-compile とは、できなかった。コマンドラインから % emacs -batch -f batch-byte-compile *.el と使うらしい。多分やったことあると思う。 !2007-06-08 Fri M-x byte-compile-file byte-recompile-directory とばし !2007-06-07 Thu M-x compile-defun 関数定義の数行前にカーソルのある状態で実行したが、 コンパイルされたような感じ !2007-06-06 Wed まんま (defun silly-loop (n) "Return time before and after N iterations of a loop." (let ((t1 (current-time-string))) (while (> (setq n (1- n)) 0)) (list t1 (current-time-string)))) => silly-loop (silly-loop 100000) => ("Tue Jun 19 12:20:27 2007" "Tue Jun 19 12:20:28 2007") (byte-compile 'silly-loop) => #[(n) ... "Return time before and after N iterations of a loop."] (silly-loop 100000) => ("Tue Jun 19 12:20:31 2007" "Tue Jun 19 12:20:31 2007") ループ回数を増やさないと分からない??? ループ回数を10倍してやり直し (silly-loop 1000000) => ("Tue Jun 19 12:24:54 2007" "Tue Jun 19 12:24:58 2007") (byte-compile 'silly-loop) => #[(n) ... ] (silly-loop 1000000) => ("Tue Jun 19 12:25:03 2007" "Tue Jun 19 12:25:04 2007") !2007-06-05 Tue 「*foo*」バッファを作った上で、 (open-network-stream "hoge" "*foo*" "localhost" 80) => # (open-network-stream "hoge" "*bar*" "localhost" 80) => #> 「*bar*」バッファ作ってなくても良かったようだ !2007-06-04 Mon tq-enqueue とばし。トランザクションキュー分かってないし… M-x shell (setq x (tq-create (get-process "shell"))) => (nil # . #) (tq-close x) => t !2007-06-03 Sun M-x shell (tq-create (get-process "shell")) => (nil # . #) !2007-06-02 Sat M-x shell (waiting-for-user-input-p) => nil !2007-06-01 Fri M-x shell (process-sentinel (get-process "shell")) => nil (defun msg-me (process event) (princ (format "Process: %s had the event `%s'" process event))) => msg-me (set-process-sentinel (get-process "shell") 'msg-me) => msg-me (process-sentinel (get-process "shell")) => msg-me !2007-05-31 Thu まんま M-x shell (defun msg-me (process event) (princ (format "Process: %s had the event `%s'" process event))) => msg-me (set-process-sentinel (get-process "shell") 'msg-me) => msg-me (kill-process (get-process "shell")) => # メッセージバッファ Process: shell had the event `... !2007-05-30 Wed M-x shell (accept-process-output (get-process "shell")) * 凍りついちゃった??? * *shell* バッファの挙動も変わっちゃった??? !2007-05-29 Tue まんま M-x shell (defun keep-output (process output) (setq kept (cons output kept))) => keep-output (setq kept nil) => nil (set-process-filter (get-process "shell") 'keep-output) => keep-output (process-send-string "shell" "ls ~/.emacs\n") => nil kept => ("[nori@machine nori]$ " "/home/nori/.emacs ") !2007-05-28 Mon M-x shell (process-filter (get-process "shell")) => comint-output-filter これはどんなもの? M-x describe-function comint-output-filter comint-output-filter is a compiled Lisp function in `comint'. (comint-output-filter PROCESS STRING) not documented !2007-05-27 Sun M-x shell (get-buffer-process "*shell*") => # (get-buffer-process "shell") => nil (get-buffer-process (get-process "shell")) Debugger entered--Lisp error: (wrong-type-argument stringp #) (get-buffer-process (get-process "*shell*")) => nil (get-buffer-process (get-buffer "shell")) => nil (get-buffer-process (get-buffer "*shell*")) => # 「バッファに複数のプロセスが対応付けられている」こともあるらしい。 良くないようだが。 !2007-05-26 Sat M-x shell 「*shell2*」というバッファを作った後で、 (set-process-buffer (get-process "shell") (get-buffer "*shell2*")) => # 「*shell*」で操作ができなくなった (文字入力はできるが、リターンを押しても実行されない) !2007-05-25 Fri M-x shell (process-mark (get-process "shell")) => # リターンで行替えした後だと、 (process-mark (get-process "shell")) => # !2007-05-24 Thu M-x shell (process-buffer (get-process "shell")) => # !2007-05-23 Wed $ ps uxwww ... nori 9534 2.3 0.3 7992 3324 pts/6 S 21:59 0:00 irb (signal-process 9534) Debugger entered--Lisp error: (wrong-number-of-arguments # 1) (signal-process 9534 'SIGKILL) => 0 irb 死 $ irb irb(main):001:0> 強制終了 !2007-05-22 Tue M-x shell (continue-process "shell") => "shell" !2007-05-21 Mon M-x shell (stop-process "shell") => "shell" 何も変わらない気がするが… !2007-05-20 Sun (quit-process "shell") => "shell" 何も起きていない??? !2007-05-19 Sat M-x shell (kill-process "shell") => "shell" !2007-05-18 Fri M-x shell (interrupt-process "shell") => "shell" 何も起きていないようだ。 *shell* でコマンドを実行すると最初の文字が欠ける??? !2007-05-17 Thu (process-send-eof "shell") => "shell" *shell* は $ exit Process shell finished "shell" を省略して *scratch* で以下をやると、 (process-send-eof) Debugger entered--Lisp error: (error "Buffer *scratch* has no process") !2007-05-16 Wed バッファの先頭に ls を書いた上で、 (process-send-region "shell" 1 4) => nil *shell* に ls の値が表示された模様 !2007-05-15 Tue M-x shell (process-send-string "shell" "ls\n")w => nil * *shell* に ls の値が表示された模様 * "\n" がないと、何も実行されないのかな?というか、貯まっているようだ。再度 process-send-string で送ったら send されたようだ !2007-05-14 Mon (set-process-coding-system (get-process "shell") '(euc-jp . euc-jp)) Debugger entered--Lisp error: (wrong-type-argument symbolp (euc-jp . euc-jp)) (set-process-coding-system (get-process "shell") 'euc-jp 'euc-jp) => nil (process-coding-system (get-process "shell")) => (euc-jp . euc-jp) !2007-05-13 Sun (process-coding-system (get-process "server")) => (raw-text . raw-text) (process-coding-system (get-process "shell")) => (euc-jp-dos . euc-jp) !2007-05-12 Sat (process-tty-name (get-process "server")) => nil M-x shell (process-tty-name (get-process "shell")) => "/dev/pts/2" !2007-05-11 Fri (start-process "my-process" "*foo*" "ls" "-l" ".") => # (process-exit-status (get-process "my-process")) Debugger entered--Lisp error: (wrong-type-argument processp nil) (start-process "my-process" "*foo*" "sleep" "100") => # (process-exit-status (get-process "my-process")) => 0 (process-kill-without-query (get-process "my-process")) => t (process-exit-status (get-process "my-process")) => 0 (process-status (get-process "my-process")) => run ? !2007-05-10 Thu (process-status (get-process "server")) => run (start-process "my-process" "*foo*" "ls" "-l" ".") => # (process-status (get-process "my-process")) Debugger entered--Lisp error: (error "Buffer *scratch* has no process") (start-process "my-process" "foo" "sleep" "100") => # (process-status (get-process "my-process")) => run (process-status (get-process "my-process")) (process-status "my-process") => run (process-status "foo") => nil (process-status "*foo*") => nil いまいち良く分からないな〜 (process-status (get-buffer "*shell*")) Debugger entered--Lisp error: (error "Buffer *scratch* has no process") M-x shell実行後 (process-status (get-buffer "*shell*")) => run (process-status "*shell*") => nil バッファ名(文字列)で良いと書いてあるのに… !2007-05-09 Wed (process-contact (get-process "server")) => t !2007-05-08 Tue (process-name (get-process "server")) => "server" !2007-05-07 Mon (process-id (get-process "server")) => 1337 !2007-05-06 Sun (process-command (get-process "server")) => ("/usr/lib/emacs/21.3/i686-pc-linux-gnu/emacsserver") !2007-05-05 Sat (get-process "shell") => nil (get-process "server") => # !2007-05-04 Fri (process-list) => (#> #> #> # #) なんか list-processes と process-list なんて名前を作るとは、、、 !2007-05-03 Thu (list-processes) => nil で、 Proc Status Buffer Tty Command ---- ------ ------ --- ------- ndeb<3> run (none) /dev/pts/4 eblook -q -e euc-jp /usr/local/share/dic/sanseido ndeb<2> run (none) /dev/pts/3 eblook -q -e euc-jp /usr/local/share/dic/chujiten ndeb<1> run (none) /dev/pts/2 eblook -q -e euc-jp /usr/local/share/dic/waeijiro ndeb run (none) /dev/pts/1 eblook -q -e euc-jp /usr/local/share/dic/eijiro server run (none) (none) /usr/lib/emacs/21.3/i686-pc-linux-gnu/emacsserver !2007-05-02 Wed (start-process "my-process" "foo" "sleep" "100") => # (process-kill-without-query (get-process "my-process")) => t (process-kill-without-query (get-process "my-process") t) だと終了時に問い合わせが来るようだ。 gdb mode とかはこうやっているのか??それとも *shell* と関係があるのか??? !2007-05-01 Tue (setq x (start-process "my-process" "foo" "sleep" "100")) => # (processp x) => t (delete-process "foo") => nil (processp x) => t 間違えたか (setq x (start-process "my-process" "foo" "sleep" "100")) => #> (processp x) => t (delete-process "my-process") => nil (processp x) => t やっぱり関係ないか !2007-04-30 Mon delete-exited-processes => t !2007-04-29 Sun process-connection-type => t !2007-04-28 Sat (start-process "my-process" "*foo*" "ls" "-l" ".emacs*") => # で、バッファ *foo* は /bin/ls: .emacs*: そのようなファイルやディレクトリはありません Process my-process exited abnormally with code 1 (start-process-shell-command "my-process" "*foo*" "ls" "-l" ".emacs*") => # で、バッファ *foo* は -rw-r--r-- 1 nori users 863 Mar 27 2005 .emacs -rw-r--r-- 1 nori users 6647 Mar 27 2005 .emacs-color.el -rw-r--r-- 1 nori users 2077 Mar 27 2005 .emacs-faces.el -rw-r--r-- 1 nori users 7470 Mar 27 2005 .emacs-fontset.el -rw-r--r-- 1 nori users 24705 Sep 10 2006 .emacs.el -rw-r--r-- 1 nori users 24705 Jul 9 2006 .emacs.el~ -rw-r--r-- 1 nori users 2180 Jan 1 2006 .emacs.my.el -rw-r--r-- 1 nori users 1969 Dec 20 2005 .emacs.my.el~ .emacs.d: 合計 4 drwxr-xr-x 2 nori users 4096 May 6 10:36 auto-save-list Process my-process finished !2007-04-27 Fri (start-process "my-process" "*foo*" "ls" "-l" ".emacs") => # バッファ *foo* は -rw-r--r-- 1 nori users 863 Mar 27 2005 .emacs Process my-process finished !2007-04-26 Thu (shell-command-to-string "pwd") => "/home/nori " !2007-04-25 Wed バッファ foo 以下を Eval (call-process-region 1 4 "cat" t t) バッファは以下のように foo !2007-04-24 Tue バッファ foo 以下を Eval (call-process-region 1 4 "cat" nil t) バッファは以下のように foofoo !2007-04-23 Mon (call-process "date") => 0 (call-process "pwd" nil t) /home/nori => 0 (call-process "pwd" nil nil) => 0 (call-process "pwd" nil 0) => nil (call-process "ls" nil t nil ".emacs") .emacs => 0 !2007-04-22 Sun まんま (shell-quote-argument "foo > bar") => "foo\\ \\>\\ bar" !2007-04-21 Sat exec-directory => "/usr/local/libexec/emacs/20.7/sparc-sun-solaris2.6/" !2007-04-20 Fri exec-path => ("/home/machine/nnakamur/bin" ... "/usr/local/libexec/emacs/20.7/sparc-sun-solaris2.6") !2007-04-19 Thu (processp t) => nil (start-process "my-process" "foo" "ls" "-l" ".") => # (processp (start-process "my-process" "foo" "ls" "-l" ".")) => t !2007-04-18 Wed (x-display-color-cells) => 32 !2007-04-17 Tue (x-display-color-p) => t !2007-04-16 Mon (x-display-grayscale-p) => t !2007-04-15 Sun (x-display-visual-class) => true-color !2007-04-14 Sat (x-display-planes) => 5 !2007-04-13 Fri (x-display-save-under) => nil !2007-04-12 Thu (x-display-backing-store) => not-useful !2007-04-11 Wed (x-display-mm-width) => 401 !2007-04-10 Tue (x-display-pixel-width) => 1152 !2007-04-09 Mon (x-display-mm-height) => 300 !2007-04-08 Sun (x-display-pixel-height) => 768 !2007-04-07 Sat (x-server-vendor) => "The XFree86 Project, Inc" !2007-04-06 Fri (x-server-version) => (11 0 40300001) !2007-04-05 Thu (x-display-screens) => 1 !2007-04-04 Wed x-resource-class => "Emacs" !2007-04-03 Tue (x-get-resource "geometry" "Geometry") => nil (x-get-resource "fontSetList" "FontSetList") => nil (x-get-resource "backgroundToolBarColor" "BackgroundToolBarColor") => nil (x-get-resource "backgroundToolBarColor" "Font") => "fontset-standard" !2007-04-02 Mon まんま (x-color-values "black") => (0 0 0) (x-color-values "white") => (65535 65535 65535) (x-color-values "red") => (65535 0 0) (x-color-values "pink") => (65535 49344 52171) (x-color-values "hungry") => nil !2007-04-01 Sun create-fontset-from-fontset-spec とばし。 (x-color-defined-p "blue") => t (x-color-defined-p 'blue) error--> Wrong type argument: stringp, blue (x-color-defined-p "foo") => nil !2007-03-31 Sat x-list-font でなく、x-list-fonts みたい (x-list-fonts "16") => nil (x-list-fonts "*16*") => ("-daewoo-gothic-medium-r-normal--16- ... !2007-03-30 Fri selection-coding-system => compound-text !2007-03-29 Thu (x-get-cut-buffer 0) => "(x-get-cut-buffer 0) " (x-set-cut-buffer "foo") => "foo" (x-get-cut-buffer 0) => "foo" !2007-03-28 Wed (x-get-cut-buffer 0) => "the" (x-get-cut-buffer 1) => "enter" (x-get-cut-buffer 2) => "then" !2007-03-27 Tue x-set-selection とばし。 (x-get-selection) => "x-get-selection" !2007-03-26 Mon x-sensitive-text-pointer-shape => nil !2007-03-25 Sun x-pointer-shape => nil 「lisp/term/x-win.el」とかに使えるポインタ一覧があるらしい !2007-03-24 Sat (x-popup-dialog t '("title" "foo" "bar")) 選択できない (x-popup-dialog t '("title" ("foo" . "foo") ("bar" . "bar"))) 選択できる !2007-03-23 Fri (x-popup-menu t '("title" ("foo" ("line" . "item1")) ("bar" ("line" . "item2")) )) ちゃんとサンプル書いてよ〜。 マニュアルを読んだだけでは良く分からなかったぞ !2007-03-22 Thu (set-mouse-pixel-position (selected-frame) 10 10) => nil !2007-03-21 Wed (mouse-pixel-position) => (# 85 . 329) (mouse-position) => (# 10 . 20) !2007-03-20 Tue (set-mouse-position (selected-frame) 10 10) => nil (set-mouse-position (selected-frame) 10 20) => nil !2007-03-19 Mon set-frame-configuration, track-mouse とばし (mouse-position) => (# nil) 値が返っていない? nil ってこと? (mouse-position) => (# 38 . 21) nil のときは Window の外にマウスがあったようだ !2007-03-18 Sun (current-frame-configuration) => (frame-configuration (# ((parent-id . 10735824) (display . "localhost:11.0") (visibility . t) (icon-name) (outer-window-id . "48234519") (window-id . "48234521") (top . 41) (left . 362) (buffer-list # # #) (unsplittable) (minibuffer . #) (modeline . t) (width . 80) (height . 40) (name . "emacs@machine.xxx.xx.xxx.xx.jp") (background-mode . light) (display-type . color) (cursor-type . box) (auto-lower) (auto-raise) (icon-type) (icon-top . unbound) (icon-left . unbound) (title) (buffer-predicate) (scroll-bar-width) (menu-bar-lines . 1) (border-color . "black") (cursor-color . "black") (mouse-color . "black") (background-color . "white") (foreground-color . "black") (vertical-scroll-bars) (internal-border-width . 1) (border-width . 2) (font . "-*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard")) #)) !2007-03-17 Sat minibuffer-auto-raise => nil !2007-03-16 Fri (setq x (make-frame)) => # (lower-frame x) => nil !2007-03-15 Thu (setq x (make-frame)) => # (raise-frame x) => nil ウィンドウマネージャーに指令を出しているのだろうか??? !2007-03-14 Wed (setq x (make-frame)) => # (frame-visible-p x) => t (make-frame-invisible x) => nil (frame-visible-p x) => nil (make-frame-visible x) => # !2007-03-13 Tue (setq x (make-frame)) => # (iconify-frame x) => nil !2007-03-12 Mon (setq x (make-frame)) => # (make-frame-invisible x) => nil (make-frame-visible x) => # !2007-03-11 Sun (make-frame-visible) => # !2007-03-10 Sat redirect-frame-focus とばし。 focus-follows-mouse => t !2007-03-09 Fri (handle-switch-frame (selected-frame)) => # !2007-03-08 Thu (select-frame (selected-frame)) => # !2007-03-07 Wed (selected-frame) => # !2007-03-06 Tue default-minibuffer-frame => # !2007-03-05 Mon frame-top-window ない??? (frame-selected-window (window-frame (selected-window))) => # !2007-03-04 Sun (window-frame (selected-window)) => # !2007-03-03 Sat (next-frame) => # (previous-frame) => # !2007-03-02 Fri (visible-frame-list) => (#) (make-frame) => # (visible-frame-list) => (# #) !2007-03-01 Thu (frame-list) => (#) (make-frame) => # (frame-list) => (# #) !2007-02-28 Wed (frame-live-p (window-frame (selected-window))) => x (setq x (make-frame)) => # (delete-frame x) => nil (frame-live-p x) => nil !2007-02-27 Tue (delete-frame) !2007-02-26 Mon multiple-frames => nil 他のフレームを作成後 multiple-frames => t !2007-02-25 Sun icon-title-format => (multiple-frames "%b" ("" invocation-name "@" system-name)) !2007-02-24 Sat frame-title-format => (multiple-frames "%b" ("" invocation-name "@" system-name)) !2007-02-23 Fri まんま (x-parse-geometry "35x70+0-0") => ((height . 70) (width . 35) (top - 0) (left . 0)) !2007-02-22 Thu (set-frame-width (window-frame (selected-window)) 30) => nil !2007-02-21 Wed (set-frame-height (window-frame (selected-window)) 30) => nil !2007-02-20 Tue (set-frame-size (window-frame (selected-window)) 100 40) => nil (set-frame-size (window-frame (selected-window)) 80 40) => nil !2007-02-19 Mon (frame-char-height) => 16 (frame-char-width) => 8 !2007-02-18 Sun (frame-pixel-height) => 666 (frame-pixel-width) => 642 !2007-02-17 Sat (screen-height) => 40 (screen-width) => 80 !2007-02-16 Fri (frame-width) => 80 !2007-02-15 Thu (frame-height) => 40 !2007-02-14 Wed (set-frame-position (window-frame (selected-window)) 100 50) => t Window が移動 !2007-02-13 Tue (assoc 'display (frame-parameters (window-frame (selected-window)))) => (display . "localhost:11.0") (assoc 'title (frame-parameters (window-frame (selected-window)))) => (title) (assoc 'name (frame-parameters (window-frame (selected-window)))) => (name . "emacs@machine.xxx.xx.xxx.co.jp") (assoc 'left (frame-parameters (window-frame (selected-window)))) => (left . 292) (assoc 'top (frame-parameters (window-frame (selected-window)))) => (top . 41) (assoc 'icon-left (frame-parameters (window-frame (selected-window)))) => (icon-left . unbound) (assoc 'icon-top (frame-parameters (window-frame (selected-window)))) => (icon-top . unbound) (assoc 'user-position (frame-parameters (window-frame (selected-window)))) => nil (assoc 'height (frame-parameters (window-frame (selected-window)))) => (height . 40) (assoc 'width (frame-parameters (window-frame (selected-window)))) => (width . 80) 以下略 !2007-02-12 Mon default-frame-alist => ((vertical-scroll-bars) (menu-bar-lines . 1)) !2007-02-11 Sun minibuffer-frame-alist => ((width . 80) (height . 2)) !2007-02-10 Sat initial-frame-alist => nil !2007-02-09 Fri (modify-frame-parameters (window-frame (selected-window)) '((height . 39))) => nil (modify-frame-parameters (window-frame (selected-window)) '((height . 40))) => nil !2007-02-08 Thu x-close-connection とばし (frame-parameters (window-frame (selected-window))) => ((parent-id . 12089710) (display . "localhost:11.0") (visibility . t) (icon-name) (outer-window-id . "41943063") (window-id . "41943065") (top . 70) (left . 79) (buffer-list # # # ... #) (unsplittable) (minibuffer . #) (modeline . t) (width . 80) (height . 40) (name . "emacs@machine.xxx.xx.xxx.xx.jp") (background-mode . light) (display-type . color) (cursor-type . box) (auto-lower) (auto-raise) (icon-type) (icon-top . unbound) (icon-left . unbound) (title) (buffer-predicate) (scroll-bar-width) (menu-bar-lines . 1) (border-color . "black") (cursor-color . "black") (mouse-color . "black") (background-color . "white") (foreground-color . "black") (vertical-scroll-bars) (internal-border-width . 1) (border-width . 2) (font . "-*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard")) !2007-02-07 Wed (x-open-connection "localhost:11.0") => nil !2007-02-06 Tue make-frame-on-display とばし (x-display-list) => ("localhost:11.0") !2007-02-05 Mon after-make-frame-hook error--> Symbol's value as variable is void: after-make-frame-hook ? !2007-02-04 Sun before-make-frame-hook => nil !2007-02-03 Sat (make-frame) => # !2007-02-02 Fri (framep t) => nil (framep (selected-window)) => nil (framep (window-frame (selected-window))) => x t じゃないの? !2007-02-01 Thu format-write-file, format-find-file, format-insert-file とばし。 auto-save-file-format => t !2007-01-31 Wed buffer-file-format => nil !2007-01-30 Tue format-alist => ((text/enriched "Extended MIME text/enriched format." "Content-[Tt]ype:[ ]*text/enriched" enriched-decode enriched-encode t enriched-mode) (plain "ISO 8859-1 standard format, no text properties." nil nil nil nil nil) (ibm "IBM Code Page 850 (DOS)" nil "recode -f ibm-pc:latin1" "recode -f latin1:ibm-pc" t nil) (mac "Apple Macintosh" nil "recode -f mac:latin1" "recode -f latin1:mac" t nil) (hp "HP Roman8" nil "recode -f roman8:latin1" "recode -f latin1:roman8" t nil) (TeX "TeX (encoding)" nil iso-tex2iso iso-iso2tex t nil) (gtex "German TeX (encoding)" nil iso-gtex2iso iso-iso2gtex t nil) (html "HTML (encoding)" nil "recode -f html:latin1" "recode -f latin1:html" t nil) (rot13 "rot13" nil "tr a-mn-z n-za-m" "tr a-mn-z n-za-m" t nil) (duden "Duden Ersatzdarstellung" nil "diac" iso-iso2duden t nil) (de646 "German ASCII (ISO 646)" nil "recode -f iso646-ge:latin1" "recode -f latin1:iso646-ge" t nil) (denet "net German" nil iso-german iso-cvt-read-only t nil) (esnet "net Spanish" nil iso-spanish iso-cvt-read-only t nil)) !2007-01-29 Mon inhibit-file-name-operation => nil !2007-01-28 Sun inhibit-file-name-handlers => nil !2007-01-27 Sat (make-directory "hoge") => nil (make-directory "hoge") error--> Creating directory: file exists, /home/machine/nnakamur/hoge (delete-directory "hoge") nil (delete-directory "hoge") error--> Removing directory: no such file or directory, /home/machine/nnakamur/hoge !2007-01-26 Fri insert-directory-program => "ls" !2007-01-25 Thu file-name-all-versions そんなのある? (insert-directory "." "-1") => #*scratch*#61558a# ... !2007-01-24 Wed (directory-files "~") => ("#*scratch*#61558a#" "." ".." ... (directory-files "~" t) => ("/home/machine/nnakamur/#*scratch*#61558a#" ... (directory-files "~" nil ".*emacs.*") => (".emacs" ".emacs-19.el" ".emacs-faces.el" ".emacs-fontset.el" ".emacs.el" ".emacs.el~") !2007-01-23 Tue まんま (convert-standard-filename "~/.completions") => "~/.completions" !2007-01-22 Mon completion-ignored-extensions => (".o" "~" ".bin" ".lbin" ".fasl" ".a" ".ln" ".blg" ".bbl" ".elc" ".lof" ".glo" ".idx" ".lot" ".dvi" ".fmt" ".class" ".fas" ".lib" ".x86f" ".toc" ".log" ".aux" ".cp" ".fn" ".ky" ".pg" ".tp" ".vr" ".cps" ".fns" ".kys" ".pgs" ".tps" ".vrs") なぜこんなにいっぱい? !2007-01-21 Sun (file-name-completion ".ema" "") => ".emacs" (file-name-completion ".emacs" "") => ".emacs" (file-name-completion ".emacs-" "") => ".emacs-" (file-name-completion ".emacs-fontset" "") => ".emacs-fontset.el" (file-name-completion ".emacs-fontset.el" "") => t (file-name-completion ".emacs-fontset.ell" "") => nil !2007-01-20 Sat (file-name-all-completions ".emacs" "") => (".emacs.el~" ".emacs.el" ".emacs-fontset.el" ".emacs-faces.el" ".emacs-19.el" ".emacs") !2007-01-19 Fri temporary-file-directory => "/tmp/" !2007-01-18 Thu まんま (make-temp-name "/tmp/foo") => "/tmp/foo3077PNM" !2007-01-17 Wed まんま (substitute-in-file-name "$HOME/foo") => "/home/machine/nnakamur/foo" (substitute-in-file-name "bar/~/foo") => "~/foo" (substitute-in-file-name "/usr/local/$HOME/foo") => "/home/machine/nnakamur/foo" !2007-01-16 Tue default-directory => "~/" !2007-01-15 Mon まんま+ (file-relative-name "/foo/bar" "/foo/") => "bar" (file-relative-name "/foo/bar" "/hack/") => "../foo/bar" (file-relative-name "/foo/bar" "..") => "../../foo/bar" (file-relative-name "foo/bar" "..") => "nnakamur/foo/bar" あまり良く分からないや〜 !2007-01-14 Sun (expand-file-name "hoge") => "/home/machine/nnakamur/hoge" (expand-file-name "../hoge") => "/home/machine/hoge" (expand-file-name "hoge" "/foo/") => "/foo/hoge" (expand-file-name "hoge" "/foo") => "/foo/hoge" (expand-file-name "~hoge") => "/home/machine/nnakamur/~hoge" (expand-file-name "~/hoge") => "/home/machine/nnakamur/hoge" !2007-01-13 Sat まんま (file-name-absolute-p "~rms/foo") => t (file-name-absolute-p "rms/foo") => nil (file-name-absolute-p "/user/rms/foo") => t !2007-01-12 Fri (abbreviate-file-name "hoge") => "hoge" (setq directory-abbrev-alist '(("hoge" . "HOGE"))) => (("hoge" . "HOGE")) (abbreviate-file-name "hoge") => "HOGE" !2007-01-11 Thu directory-abbrev-alist => nil !2007-01-10 Wed (directory-file-name "foo") => "foo" (directory-file-name "foo/") => "foo" (directory-file-name "foo//") => "foo/" !2007-01-09 Tue (file-name-as-directory "foo") => "foo/" (file-name-as-directory "foo/") => "foo/" (file-name-as-directory "foo//") => "foo//" (file-name-as-directory ".") => "./" (file-name-as-directory "~~~") => "~~~/" !2007-01-08 Mon まんま (file-name-sans-extension "foo.lose.c") => "foo.lose" (file-name-sans-extension "big.hack/foo") => "big.hack/foo" !2007-01-07 Sun まんま (file-name-sans-versions "~rms/foo.~1~") => "~rms/foo" (file-name-sans-versions "~rms/foo~") => "~rms/foo" (file-name-sans-versions "~rms/foo") => "~rms/foo" !2007-01-06 Sat まんま (file-name-nondirectory "lewis/foo") => "foo" (file-name-nondirectory "foo") => "foo" !2007-01-05 Fri ほぼ、まんま (file-name-directory "lewis/foo") => "lewis/" (file-name-directory "foo") => nil (file-name-directory "foo/") => "foo/" !2007-01-04 Thu set-default-file-modes とばし (default-file-modes) => 493 >> "%o" % 493 => "755" !2007-01-03 Wed (set-file-modes ".emacs" 438) => nil -rw-rw-rw- (set-file-modes ".emacs" 420) => nil -rw-r--r-- !2007-01-02 Tue (make-symbolic-link ".emacs" ".emacs-slink") => nil !2007-01-01 Mon (copy-file ".emacs" ".emacs-copy") => nil (delete-file ".emacs-copy") => nil (delete-file ".emacs-copy") error--> Debugger entered--Lisp error: (file-error "Removing old name" "\xd23d\xd24e\xd268\xd226\xd24a\xd2d5\xd2a1\xd2a4\xd2eb\xd264\xd2c7\xd2a3\xd2ec\xd2af\xd2c8\xd2ea\xd24f\xd222\xd26a\xd25e\xd23b\xd273" "/home/nori/.emacs-copy") 引数にリストが取れても面白いかと持ったが、これだけそういう仕様にすると混乱のもとか !2006-12-31 Sun (copy-file ".emacs" ".emacs-copy") => nil (copy-file ".emacs" ".emacs-copy") error--> Debugger entered--Lisp error: (file-already-exists "File already exists" "/home/nori/.emacs-copy") (copy-file ".emacs" ".emacs-copy" t) => nil (copy-file ".emacs" ".emacs-copy" t t) => nil !2006-12-30 Sat (rename-file ".emacs" ".emacs-new") => nil (rename-file ".emacs" ".emacs-new") error--> Debugger entered--Lisp error: (file-already-exists "File already exists" "/home/nori/.emacs-new") !2006-12-29 Fri (add-name-to-file ".emacs" ".emacs-link") => nil (add-name-to-file ".emacs" ".emacs-link") error--> Debugger entered--Lisp error: (file-already-exists "File already exists" "/home/nori/.emacs-link") (add-name-to-file ".emacs" ".emacs-link" t) => nil 自宅の環境だとなんか Backtrace が走るみたい !2006-12-28 Thu (file-attributes ".emacs") => (nil 1 3062 100 (17800 42984) (15589 39414) (16685 32440) 195 "-rw-r--r--" nil 13355487 8388854) !2006-12-27 Wed (file-nlinks ".") => 58 (file-nlinks ".emacs") => 1 (file-nlinks "hoge") => nil !2006-12-26 Tue (file-modes ".emacs") => 420 (file-modes ".") => 493 (format "%o" (file-modes ".emacs")) => "644" (format "%o" (file-modes ".")) => "755" !2006-12-25 Mon (file-truename ".") => "/home/nnakamur" !2006-12-24 Sun (file-regular-p ".emacs") => t (file-regular-p "tmp") => nil !2006-12-23 Sat (file-directory-p "tmp") => t (file-directory-p ".emacs") => nil !2006-12-22 Fri (file-symlink-p "/vmlinuz") => "boot/vmlinuz-2.2.19" (file-symlink-p ".emacs") => nil !2006-12-21 Thu (file-newer-than-file-p ".emacs.el" ".emacs.el") => nil (file-newer-than-file-p ".emacs.el" ".emacs.el~") => t (file-newer-than-file-p ".emacs.el" "hogehoge") => t !2006-12-20 Wed (file-ownership-preserved-p ".emacs~") => t (file-ownership-preserved-p ".emacs.el~") => t !2006-12-19 Tue (access-file ".emacs" "hoge") => nil (access-file "hoge" "hoge") error--> hoge: no such file or directory, hoge !2006-12-18 Mon (file-accessible-directory-p "tmp") => t (file-accessible-directory-p "foo") => nil (file-accessible-directory-p "/lost+found") => nil !2006-12-17 Sun (file-writable-p ".emacs") => t (file-writable-p "..") => nil !2006-12-16 Sat (file-executable-p "tmp") => t (file-executable-p ".emacs") => nil !2006-12-15 Fri (file-readable-p ".emacs") => t (file-readable-p "hoge") => nil (file-exists-p "/lost+found") => t (file-readable-p "/lost+found") => nil !2006-12-14 Thu ask-user-about-lock とばし。 (file-exists-p "~/.emacs") => t (file-exists-p "hoge") => nil !2006-12-13 Wed (unlock-buffer) => nil !2006-12-12 Tue (lock-buffer) => nil !2006-12-11 Mon (file-locked-p "foo") => nil !2006-12-10 Sun (with-temp-file "~/foo" (insert "foo\n") (insert "bar\n") ) => nil !2006-12-09 Sat (write-region (point-min) (point-max) "~/foo") => nil (write-region (point-min) (point-max) "~/foo") => nil 保存文字コードを尋ねられた。 あらかじめ指定できないのかな??? CONFIRM というオプションがあるけど、これはちょっと違う機能??? !2006-12-08 Fri (append-to-file (point-min) (point-max) "~/foo") => nil (append-to-file (point-min) (point-max) "~/foo") => nil 保存文字コードを尋ねられた !2006-12-07 Thu (insert-file-contents-literally "~/.emacs") => ("/home/cadadm1/nnakamur/.emacs" 195) !2006-12-06 Wed (insert-file-contents "~/.emacs") !2006-12-05 Tue require-final-newline => nil !2006-12-04 Mon file-precious-flag => nil !2006-12-03 Sun after-save-hook => ((lambda nil (save-restriction (widen) (and (string= "#!" (buffer-substring 1 (min 3 (point-max)))) (let* ((name (buffer-file-name)) (mode (file-modes name))) (set-file-modes name (logior mode (logand (/ mode 4) 73))) (message (concat "Wrote " name " (+x)"))))))) !2006-12-02 Sat local-write-file-hooks => nil !2006-12-01 Fri write-file-hooks => nil !2006-11-30 Thu M-x write-file (write-file "foo") !2006-11-29 Wed (save-some-buffers) => "(No files need saving)" !2006-11-28 Tue (save-buffer) !2006-11-27 Mon (after-find-file) error--> Wrong type argument: stringp, nil あれ? !2006-11-26 Sun (create-file-buffer "foo") => # (create-file-buffer "foo") => #> !2006-11-25 Sat find-file-not-found-hooks => (vc-file-not-found-hook) !2006-11-24 Fri find-file-hooks => (vc-find-file-hook hilit-find-file-hook) !2006-11-23 Thu (view-file "~/.emacs") => "Type C-c C-h for help, h for commands, q to quit." !2006-11-22 Wed (find-file-read-only "~/.emacs") => # !2006-11-21 Tue (find-file-other-window "~/.emacs") => # !2006-11-20 Mon (find-file-noselect "~/.emacs") => # 画面は変わらない !2006-11-19 Sun (find-file "~/.emacs") => # !2006-11-18 Sat after-revert-hook => nil !2006-11-17 Fri before-revert-hook => nil !2006-11-16 Thu revert-buffer-insert-file-contents-function => nil !2006-11-15 Wed revert-buffer-function => nil !2006-11-14 Tue revert-without-query => nil !2006-11-13 Mon M-x revert-buffer error--> Buffer does not seem to be associated with any file !2006-11-12 Sun auto-save-list-file-name => "/home/*/nnakamur/.saves-615-*.*.*.*.co.jp~" !2006-11-11 Sat buffer-saved-size => 0 !2006-11-10 Fri (rename-auto-save-file) => nil !2006-11-09 Thu delete-auto-save-files => t !2006-11-08 Wed (delete-auto-save-file-if-necessary) => nil !2006-11-07 Tue M-x do-auto-save !2006-11-06 Mon auto-save-default => t !2006-11-05 Sun auto-save-hook => nil !2006-11-04 Sat auto-save-timeout => 30 !2006-11-03 Fri auto-save-interval => 300 !2006-11-02 Thu (recent-auto-save-p) => nil (set-buffer-auto-saved) => nil (recent-auto-save-p) => t !2006-11-01 Wed (recent-auto-save-p) => nil !2006-10-31 Tue auto-save-visited-file-name => nil !2006-10-30 Mon (make-auto-save-file-name) => "/home/xxx/nnakamur/#*scratch*#20823bST#" !2006-10-29 Sun (auto-save-file-name-p "foo") => nil (auto-save-file-name-p "foo~") => nil (auto-save-file-name-p "#foo#") => 0 !2006-10-28 Sat M-x auto-save-mode M-x auto-save-mode !2006-10-27 Fri buffer-auto-save-file-name => nil !2006-10-26 Thu (file-newest-backup "foo") => nil (file-newest-backup ".emacs.el") => "/home/****/nnakamur/.emacs.el~" !2006-10-25 Wed (find-backup-file-name "foo") error--> Wrong type argument: stringp, nil (find-backup-file-name "~rms/foo") => ("~rms/foo~") ? !2006-10-24 Tue (make-backup-file-name "foo") => "foo~" !2006-10-23 Mon まんま (backup-file-name-p "foo") => nil (backup-file-name-p "foo~") => 3 !2006-10-22 Sun dired-kept-versions => 2 !2006-10-21 Sat delete-old-versions => nil !2006-10-20 Fri kept-old-versions => 2 !2006-10-19 Thu kept-new-versions => 2 !2006-10-18 Wed version-control => nil !2006-10-17 Tue backup-by-copying-when-mismatch => nil !2006-10-16 Mon backup-by-copying-when-linked => nil !2006-10-15 Sun backup-by-copying => nil !2006-10-14 Sat backup-inhibited => nil !2006-10-13 Fri backup-enable-predicate => (lambda (name) (or (< (length name) 5) (not (string-equal "/tmp/" (substring name 0 5))))) !2006-10-12 Thu make-backup-files => t !2006-10-11 Wed backup-buffer とばし buffer-backed-up => nil !2006-10-10 Tue enable-flow-control とばし。 enable-flow-control-on とばし。 noninteractive => nil !2006-10-09 Mon open-termscript とばし。 こんなのがあったのか。 X でも有効なのか? system-key-alist => ((65280 . remove)) !2006-10-08 Sun (send-string-to-terminal "a") => nil 起動元の端末に a が表示された !2006-10-07 Sat (baud-rate) => 19200 !2006-10-06 Fri baud-rate => 19200 値を変える(小さくすると)と出力が変わるのかな? !2006-10-05 Thu M-x open-dribble-file (open-dribble-file nil) => nil 止めないと、ずーと出力してしまうようだ !2006-10-04 Wed (recent-keys) => [16 5 16 16 16 16 12 67108896 25 escape 120 escape 112 return 50 return 24 19 5 16 16 16 16 16 13 24 19 12 24 50 24 111 escape 62 24 48 12 16 16 16 16 16 16 12 14 14 14 14 14 14 24 98 return 25 10 16 32 32 61 62 32 1 16 67108896 14 14 23 24 98 return 67108896 25 escape 120 escape 112 return 50 return 24 19 5 16 16 16 16 16 13 24 19 12 24 98 return 40 41 2 25 5 10] !2006-10-03 Tue key-translation-map => (keymap (24 keymap (56 . iso-transl-ctl-x-8-map))) !2006-10-02 Mon function-key-map => (keymap (iso-lefttab . [backtab]) (M-escape . [-134217701]) (M-return . [-134217715]) (M-clear . [-134217716]) (M-linefeed . [-134217718]) (M-tab . [-134217719]) (M-delete . [-134217601]) (M-backspace . [-134217601]) (escape . [27]) (return . [13]) (clear . [12]) (linefeed . [10]) (tab . [9]) (delete . [127]) (backspace . [127]) (kp-equal . [61]) (kp-divide . [47]) (kp-decimal . [46]) (kp-subtract . [45]) (kp-separator . [44]) (kp-add . [43]) (kp-multiply . [42]) (kp-enter . [13]) (kp-tab . [9]) (kp-space . [32]) (kp-9 . [57]) (kp-8 . [56]) (kp-7 . [55]) (kp-6 . [54]) (kp-5 . [53]) (kp-4 . [52]) (kp-3 . [51]) (kp-2 . [50]) (kp-1 . [49]) (kp-0 . [48]) (24 keymap (64 keymap (99 . event-apply-control-modifier) (83 . event-apply-shift-modifier) (97 . event-apply-alt-modifier) (109 . event-apply-meta-modifier) (115 . event-apply-super-modifier) (104 . event-apply-hyper-modifier))) (kp-delete . [delete]) (kp-insert . [insert]) (kp-begin . [begin]) (kp-end . [end]) (M-kp-next . [M-next]) (kp-next . [next]) (kp-prior . [prior]) (kp-down . [down]) (kp-right . [right]) (kp-up . [up]) (kp-left . [left]) (kp-home . [home])) !2006-10-01 Sun (keyboard-translate ?\034 ?\^s) => 19 keyboard-translate-table の中身が変わるようだ !2006-09-30 Sat keyboard-translate-table => nil !2006-09-29 Fri extra-keyboard-modifiers => 0 !2006-09-28 Thu (current-input-mode) => (nil nil 0 7) !2006-09-27 Wed (set-input-mode nil nil 1 nil) => nil 意味なし… !2006-09-26 Tue (setq timer (run-with-idle-timer 2 5 (message "foo"))) => [t 0 2 0 5 "foo" nil t] (cancel-timer timer) => nil 変数 t に入れようとして怒られてしまった… !2006-09-25 Mon (run-with-idle-timer 2 nil (message "foo")) => [t 0 2 0 nil "foo" nil t] foo は出力されるけど、2秒待っている気がしないのだが? !2006-09-24 Sun (with-timeout (1 (message "foo")) (sit-for 2)) => "foo" !2006-09-23 Sat (run-at-time "1 min" nil (message "foo")) => [nil 17683 21758 719295 nil "foo" nil nil] 動いた??? !2006-09-22 Fri (current-time-string (current-time)) => "Fri Sep 22 12:11:03 2006" (current-time-string (encode-time 0 0 12 22 9 2006)) => "Fri Sep 22 12:00:00 2006" !2006-09-21 Thu (decode-time (current-time)) => (2 1 12 21 9 2006 4 nil 32400) !2006-09-20 Wed (format-time-string "%y-%m-%d" (current-time)) => "06-09-20" !2006-09-19 Tue (current-time-zone) => (32400 "JST") !2006-09-18 Mon (current-time) => (17679 23950 497834) !2006-09-17 Sun (current-time-string) => "Tue Sep 19 12:01:00 2006" !2006-09-16 Sat (user-uid) => 3062 !2006-09-15 Fri (user-real-uid) => 3062 !2006-09-14 Thu (user-full-name) => "Noritsugu Nakamura" !2006-09-13 Wed user-real-login-name => "nnakamur" !2006-09-12 Tue (user-login-name) => "nnakamur" !2006-09-11 Mon user-mail-address => "hogehoge@machine.***.xx.yyy.zz.jp" !2006-09-10 Sun setprv とばし init-file-user => "" !2006-09-09 Sat tty-erase-char => nil !2006-09-08 Fri (emacs-pid) => 20823 !2006-09-07 Thu (load-average) => (19 21 25) (load-average t) => (0.19921875 0.20703125 0.25390625) こんなのあるんだ〜 !2006-09-06 Wed installation-directory => nil !2006-09-05 Tue invocation-directory => "/usr/local/bin/" !2006-09-04 Mon invocation-name => "emacs" !2006-09-03 Sun path-separator => ":" !2006-09-02 Sat setenv とばし process-environment => (... "USER=nnakamur") !2006-09-01 Fri (getenv "USER") => "nnakamur" !2006-08-31 Thu mail-host-address => nil !2006-08-30 Wed system-name => "hogege.xxx.xx.xxx.co.jp" !2006-08-29 Tue system-type => usg-unix-v !2006-08-28 Mon system-configuration => "sparc-sun-solaris2.6" !2006-08-27 Sun suspend-resume-hook => nil !2006-08-26 Sat suspend-hook => (x-win-suspend-error) !2006-08-25 Fri (suspend-emacs nil) error--> Suspending an emacs running under X makes no sense emacs -nw で起動して、 (suspend-emacs nil) suspend された !2006-08-24 Thu kill-emacs-hook => (lookup-exit w3m-arrived-shutdown browse-url-delete-temp-file-list egg-kill-emacs-function mew-net-clean-up mew-addrbook-clean-up mew-refile-clean-up mew-folder-clean-up mew-sinfo-clean-up mew-temp-dir-clean-up (lambda nil (and (featurep (quote bookmark)) bookmark-alist (bookmark-time-to-save-p t) (bookmark-save)))) !2006-08-23 Wed kill-emacs-query-functions => nil !2006-08-22 Tue (kill-emacs) ばいばいきーん !2006-08-21 Mon command-line-functions => nil !2006-08-20 Sun command-line-args => ("emacs") !2006-08-19 Sat command-switch-alist => nil !2006-08-18 Fri command-line-processed => t !2006-08-17 Thu (command-line) なんか知らないが、終了しちゃったようだ !2006-08-16 Wed term-setup-hook => nil !2006-08-15 Tue term-file-prefix => "term/" !2006-08-14 Mon after-init-hook => nil !2006-08-13 Sun before-init-hook => nil !2006-08-12 Sat inhibit-default-init => nil !2006-08-11 Fri site-run-file => "site-start" !2006-08-10 Thu inhibit-startup-echo-area-message => nil !2006-08-09 Wed inhibit-startup-message => nil !2006-08-08 Tue window-setup-hook => nil !2006-08-07 Mon window-system => x !2006-08-06 Sun ring-bell-function => nil !2006-08-05 Sat visible-bell => t !2006-08-04 Fri (ding) => nil (beep) => nil !2006-08-03 Thu glyph-table => nil !2006-08-02 Wed standard-display-table => #^[t nil nil ... nil display-table nil nil nil nil nil nil] !2006-08-01 Tue buffer-display-table => nil !2006-07-31 Mon (window-display-table (selected-window)) => nil (set-window-display-table (selected-window) (make-display-table)) => #^[t nil nil ... nil display-table nil nil nil nil nil nil] (window-display-table (selected-window)) => #^[t nil nil ... nil display-table nil nil nil nil nil nil] !2006-07-30 Sun (setq foo (make-display-table)) (display-table-slot foo 0) => nil (set-display-table-slot foo 0 1) => 1 (display-table-slot foo 0) => 1 (display-table-slot foo 'wrap) => nil (set-display-table-slot foo 'wrap 10) => 10 (display-table-slot foo 'wrap) => 10 「追加スロット」って何なんだろうね? !2006-07-29 Sat (make-display-table) #^[t nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil display-table nil nil nil nil nil nil] !2006-07-28 Fri tab-width => 4 !2006-07-27 Thu default-ctl-arrow => t !2006-07-26 Wed ctl-arrow => t !2006-07-25 Tue mode-line-inverse-video => t !2006-07-24 Mon blink-matching-open とばし。 inverse-video => nil !2006-07-23 Sun blink-matching-delay => 1 !2006-07-22 Sat blink-matching-paren-distance => 25600 !2006-07-21 Fri blink-matching-paren => t !2006-07-20 Thu blink-paren-function => blink-matching-open !2006-07-19 Wed (frame-update-face-colors (window-frame (selected-window))) => nil !2006-07-18 Tue region-face => 6 !2006-07-17 Mon (face-differs-from-default-p 'default) => nil (face-differs-from-default-p 'highlight) => t !2006-07-16 Sun (face-equal 'default 'default) => t (face-equal 'default 'foo) error--> Wrong type argument: internal-facep, foo (copy-face 'default 'foo) => foo (face-equal 'default 'foo) => t !2006-07-15 Sat (face-documentation 'default) => "Used for text not covered by other faces." (face-documentation 'region) => "Used for displaying the region." !2006-07-14 Fri (face-id 'default) => 0 (face-id 'modeline) => 1 (face-id 'region) => 6 (face-id 'secondary-selection) => 7 (face-id 'highlight) => 2 (face-id 'underline) => 8 (face-id 'bold) => 3 (face-id 'italic) => 4 (face-id 'bold-italic) => 5 !2006-07-13 Thu (face-underline-p 'default) => nil (face-underline-p 'underline) => t !2006-07-12 Wed (face-italic-p 'default) => nil (face-italic-p 'bold) => nil (face-italic-p 'italic) => t (face-italic-p 'bold-italic) => t !2006-07-11 Tue (face-bold-p 'default) => nil (face-bold-p 'bold) => t (face-bold-p 'italic) => nil (face-bold-p 'bold-italic) => t !2006-07-10 Mon (face-font 'default) => nil !2006-07-09 Sun (face-stipple 'default) => nil !2006-07-08 Sat set-face-*, invert-face とばし。 (face-foreground 'default) => nil (face-foreground 'region) => nil (face-foreground 'highlight) => nil (face-background 'default) => nil (face-background 'region) => "gray" (face-background 'highlight) => "darkseagreen2" !2006-07-07 Fri (facep 'foo) => nil (copy-face 'default 'foo) => foo (facep 'foo) => t !2006-07-06 Thu (face-list) => (purple ForestGreen-bold RoyalBlue blue-bold grey40 firebrick-italic scratch-face show-paren-mismatch-face show-paren-match-face underline secondary-selection region bold-italic italic bold highlight modeline default) (make-face 'foo) => foo (face-list) => (foo purple ForestGreen-bold RoyalBlue blue-bold grey40 firebrick-italic scratch-face show-paren-mismatch-face show-paren-match-face underline secondary-selection region bold-italic italic bold highlight modeline default) !2006-07-05 Wed (make-face 'default) => default (facep 'foo) => nil (make-face 'foo) => foo (facep 'foo) => t !2006-07-04 Tue frame-background-mode => nil !2006-07-03 Mon ほぼ、まんま (facep 'my-region) => nil (defface my-region ((((class color) (background dark)) (:background "blue")) (t (:background "gray"))) "Used for displaying the region.") error--> Invalid function: (((class color) (background dark)) (:background "blue")) ふむ? (defface my-region '((((class color) (background dark)) (:background "blue")) (t (:background "gray"))) "Used for displaying the region.") => my-region (facep 'my-region) => t Info のミスか(最新版では直っているのかもしれないが)。 !2006-07-02 Sun (facep 1) => nil (facep (text-properties-at (point-min))) => nil (facep 'default) => t !2006-07-01 Sat (truncate-string-to-width "abcdef" 3) => "abc" (truncate-string-to-width "あいうえお" 3) => "あ" (truncate-string-to-width "abcdef" 3 1) => "bc" (truncate-string-to-width "abcdef" 10 0 ? ) => "abcdef " (truncate-string-to-width "abcdef" 10 3 ? ) => "def " !2006-06-30 Fri (string-width "abc") => 3 (string-width "あいう") => 6 !2006-06-29 Thu (char-width ?a) => 1 (char-width ?あ) => 2 !2006-06-28 Wed (previous-overlay-change 1) => 1 何これ? !2006-06-27 Tue (next-overlay-change 1) => 183 何これ? !2006-06-26 Mon (overlays-in 0 1) => nil (make-overlay (point-min) (point-max)) => # (overlays-in 0 1) => nil (overlays-in 0 10) => (#) (overlays-in 0 2) => (#) (overlays-in 1 2) => (#) !2006-06-25 Sun move-overlay とばし。 (overlays-at 1) => nil (make-overlay (point-min) (point-max)) => # (overlays-at 1) => (#) (make-overlay (point-min) (point-max)) => # (overlays-at 1) => (# #) !2006-06-24 Sat (delete-overlay (make-overlay (point-min) (point-max))) => nil !2006-06-23 Fri (overlay-buffer (make-overlay (point-min) (point-max))) => # !2006-06-22 Thu (overlay-end (make-overlay (point-min) (point-max))) => 804 !2006-06-21 Wed overlay-put とばし。 (overlay-start (make-overlay (point-min) (point-max))) => 1 !2006-06-20 Tue (overlay-get (make-overlay (point-min) (point-max)) 'priority) => nil (overlay-get (make-overlay (point-min) (point-max)) 'window) => nil (overlay-get (make-overlay (point-min) (point-max)) 'face) => nil (overlay-get (make-overlay (point-min) (point-max)) 'local-map) => nil (overlay-get (make-overlay (point-min) (point-max)) 'invisible) => nil !2006-06-19 Mon まんま (momentary-string-display "**** Important Message! ****" (point) ?\r "Type RET when done reading") !2006-06-18 Sun temp-buffer-show-hook => (help-mode-finish) !2006-06-17 Sat temp-buffer-show-function => nil (setq temp-buffer-show-function (lambda (b) (setq x 1))) => (lambda (b) (setq x 1)) (with-output-to-temp-buffer "*foo*" (print 20) (print standard-output)) => # x => 1 !2006-06-16 Fri まんま (with-output-to-temp-buffer "*foo*" (print 20) (print standard-output)) => # !2006-06-15 Thu overlay-arrow-position => nil !2006-06-14 Wed overlay-arrow-string => nil gdb の動作バッファでは、 overlay-arrow-string => "=>" !2006-06-13 Tue selective-display-ellipses => t !2006-06-12 Mon selective-display => nil 以下のバッファ 0foo 1foo 2foo 3foo で、 (setq selective-display 2) を評価すると、 0foo 1foo... という表示になった。 !2006-06-11 Sun まんま (add-to-invisibility-spec '(my-symbol . t)) => ((my-symbol . t)) buffer-invisibility-spec => ((my-symbol . t)) (add-to-invisibility-spec 'my-symbol) => (my-symbol (my-symbol . t)) buffer-invisibility-spec => (my-symbol (my-symbol . t)) (overlay-put (make-overlay (point-min) (point-max)) 'invisible 'my-symbol) => 文字が消えた 以下を eval すると、文字表示復活 (remove-from-invisibility-spec '(my-symbol . t)) (remove-from-invisibility-spec 'my-symbol) !2006-06-10 Sat buffer-invisibility-spec => t !2006-06-09 Fri echo-keystrokes => 1 !2006-06-08 Thu message-log-max => 50 !2006-06-07 Wed echo-area-clear-hook => nil !2006-06-06 Tue cursor-in-echo-area => nil !2006-06-05 Mon (current-message) => nil !2006-06-04 Sun (message-box "foo") => "foo" ほっほ〜 !2006-06-03 Sat (message-or-box "foo") => "foo" マウス系のコマンドから呼ばないと変化が出ないらしい !2006-06-02 Fri (message "foo") => "foo" (message "%d %f" 2 1.2) => "2 1.200000" えっ、書式指定できたのか〜 !2006-06-01 Thu cache-long-line-scans => nil !2006-05-31 Wed truncate-partial-width-windows => t !2006-05-30 Tue default-truncate-lines => nil !2006-05-29 Mon truncate-lines => nil !2006-05-28 Sun no-redraw-on-reenter => nil !2006-05-27 Sat M-x redraw-display !2006-05-26 Fri (redraw-frame (window-frame (selected-window))) => nil !2006-05-25 Thu window-configuration-change-hook => nil !2006-05-24 Wed set-window-redisplay-end-trigger とばし (window-redisplay-end-trigger (selected-window)) => nil !2006-05-23 Tue redisplay-end-trigger-functions error--> Symbol's value as variable is void: redisplay-end-trigger-functions !2006-05-22 Mon window-size-change-functions => nil !2006-05-21 Sun window-scroll-functions => nil !2006-05-20 Sat (compare-window-configurations (current-window-configuration) (current-window-configuration)) => t (compare-window-configurations (current-window-configuration) (progn (split-window-vertically) (current-window-configuration))) => nil !2006-05-19 Fri (window-configuration-p (current-window-configuration)) => t (window-configuration-p t) => nil !2006-05-18 Thu (save-window-excursion (shrink-window 5)) => nil !2006-05-17 Wed (setq x (current-window-configuration)) => # (set-window-configuration x) => t !2006-05-16 Tue (current-window-configuration) => # !2006-05-15 Mon (coordinates-in-window-p '(10 . 10) (selected-window)) => (10 . 10) (coordinates-in-window-p '(100 . 100) (selected-window)) => nil !2006-05-14 Sun (window-at 1 1) => # (window-at 50 50) => nil (window-at 20 20) => # !2006-05-13 Sat window-min-width => 10 !2006-05-12 Fri window-min-height => 4 !2006-05-11 Thu M-x shrink-window-if-larger-than-buffer (shrink-window-if-larger-than-buffer) ふむ? !2006-05-10 Wed M-x shrink-window-horizontally (shrink-window-horizontally 1) !2006-05-09 Tue M-x shrink-window (shrink-window 5) (shrink-window 5 t) !2006-05-08 Mon M-x enlarge-window-horizontally (enlarge-window-horizontally 1) !2006-05-07 Sun M-x enlarge-window C-u 4 M-x enlarge-window (enlarge-window 4) !2006-05-06 Sat (window-edges) => (0 0 80 39) (split-window-vertically) => # (window-edges) => (0 0 80 19) M-x other-window (window-edges) => (0 19 80 39) !2006-05-05 Fri (window-width) => 80 !2006-05-04 Thu (window-height) => 39 (frame-height) => 40 (split-window-vertically) => # (window-height) => 19 !2006-05-03 Wed (set-window-hscroll (selected-window) 10) => 10 M-x scroll-right !2006-05-02 Tue (window-hscroll) => 0 (scroll-left 1) => 1 (window-hscroll) => 1 !2006-05-01 Mon (scroll-left) (scroll-right) (scroll-left 1) (scroll-right) M-x scroll-left M-x scroll-right こいつか、悪さをするのは! !2006-04-30 Sun (recenter) (recenter 1) M-x recenter !2006-04-29 Sat next-screen-context-lines => 2 !2006-04-28 Fri scroll-preserve-screen-position => nil !2006-04-27 Thu scroll-step => 0 !2006-04-26 Wed scroll-conservatively => 0 !2006-04-25 Tue scroll-margin => 0 !2006-04-24 Mon scroll-down とばし。 (scroll-other-window) (scroll-other-window 1) M-x scroll-other-window other-window-scroll-buffer => nil (let ((other-window-scroll-buffer "+inbox")) (scroll-other-window)) !2006-04-23 Sun (scroll-up) (scroll-up 1) M-x scroll-up !2006-04-22 Sat set-window-start とばし。 (pos-visible-in-window-p) => t !2006-04-21 Fri (window-end) => 260 !2006-04-20 Thu set-window-point とばし。 (window-start) => 1 !2006-04-19 Wed set-window-dedicated-p とばし。 (window-point (get-buffer-window "*scratch*")) => 230 !2006-04-18 Tue (window-dedicated-p (get-buffer-window "*scratch*")) => nil !2006-04-17 Mon display-buffer-function => nil !2006-04-16 Sun same-window-regexps => ("\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)" "\\*telnet-.*\\*\\(\\|<[0-9]+>\\)" "^\\*rlogin-.*\\*\\(\\|<[0-9]+>\\)" "\\*gud-.*\\*\\(\\|<[0-9]+>\\)" "\\`\\*Customiz.*\\*\\'") !2006-04-15 Sat same-window-buffer-names => ("*shell*" "*mail*" "*info*" "*inferior-lisp*" "*ielm*" "*scheme*") !2006-04-14 Fri special-display-frame-alist => ((height . 14) (width . 80) (unsplittable . t)) !2006-04-13 Thu (special-display-popup-frame (get-buffer "*scratch*")) => # ? !2006-04-12 Wed special-display-function => special-display-popup-frame !2006-04-11 Tue special-display-regexps => nil !2006-04-10 Mon special-display-buffer-names => nil !2006-04-09 Sun pop-up-frame-alist => nil !2006-04-08 Sat pop-up-frame-function => #[nil "\301!\207" [pop-up-frame-alist make-frame] 2] !2006-04-07 Fri pop-up-frames => nil !2006-04-06 Thu split-height-threshold => 500 !2006-04-05 Wed pop-up-windows => t !2006-04-04 Tue (display-buffer "*info*") => # ↓の通りになっていない気もするが??? そのウィンドウを選択しないので当該バッファもカレントバッファにならない !2006-04-03 Mon (replace-buffer-in-windows (get-buffer "*info*")) => nil current を *info* に置き換えるのかと勘違いしてしまった。 !2006-04-02 Sun (pop-to-buffer "*info*") => # !2006-04-01 Sat (switch-to-buffer-other-window "*info*") => # !2006-03-31 Fri (switch-to-buffer "*info*") => # !2006-03-30 Thu buffer-display-time => (17451 7875 910056) !2006-03-29 Wed (get-buffer-window-list "*scratch*") => (#) Window 2分割で、 (get-buffer-window-list "*scratch*") => (# #) !2006-03-28 Tue (get-buffer-window "*scratch*") => # (get-buffer-window "hogehoge") => nil !2006-03-27 Mon (window-buffer) => # (window-buffer (selected-window)) => # !2006-03-26 Sun (set-window-buffer (selected-window) "foo") error--> Wrong type argument: bufferp, nil ? (current-window) は、なかったか〜。 !2006-03-25 Sat (walk-windows (lambda (x) (message (buffer-name)))) (walk-windows (lambda (x) (insert (format "%S" (window-edges x))))) => (0 0 80 19)(0 19 80 39)nil !2006-03-24 Fri M-x other-window C-u 2 M-x other-window !2006-03-23 Thu (previous-window) => # !2006-03-22 Wed (next-window) => # !2006-03-21 Tue (get-largest-window) => # !2006-03-20 Mon (get-lru-window) => # !2006-03-19 Sun (save-selected-window (next-window) ) => # !2006-03-18 Sat (select-window (next-window)) => # !2006-03-17 Fri (selected-window) => # !2006-03-16 Thu (delete-windows-on (get-buffer "*hoge*")) => nil (delete-windows-on (get-buffer "*hogehoge*")) => nil (delete-windows-on "*hoge*") => nil !2006-03-15 Wed M-x delete-other-windows !2006-03-14 Tue (progn (split-window) (delete-window)) => nil M-x delete-window !2006-03-13 Mon (window-live-p (selected-window)) => t (window-live-p t) => nil !2006-03-12 Sun (one-window-p) => t (one-window-p) => nil !2006-03-11 Sat (split-window-horizontally 10) => # M-x split-window-horizontally !2006-03-10 Fri (split-window-vertically 20) => # M-x split-window-vertically !2006-03-09 Thu (split-window (selected-window)) => # (split-window) => # (split-window (selected-window) 20) => # (split-window (selected-window) 80) error--> Window height -41 too small (after splitting) (split-window (selected-window) 30) => # (split-window (selected-window) nil t) => # (window-edges) => (0 0 80 19) (window-edges) => (0 0 80 39) !2006-03-08 Wed (windowp t) => nil (windowp (selected-window)) => t !2006-03-07 Tue sentence-end => "[.?!][]\"')}]*\\($\\| $\\| \\| \\)[ ]*\\|[。?!]" !2006-03-06 Mon paragraph-start => "^ \\|$" !2006-03-05 Sun paragraph-separate => "^ \\|$" !2006-03-04 Sat page-delimiter => "^ " !2006-03-03 Fri default-case-fold-search => t !2006-03-02 Thu case-fold-search => t This buffer is for notes you don't want to save, and for Lisp evaluation. の先頭で、 (let ((case-fold-search nil)) (looking-at "this")) => nil !2006-03-01 Wed This buffer is for notes you don't want to save, and for Lisp evaluation. の先頭で、 (looking-at "This") を評価後、 (let ((case-replace nil)) (replace-match "zzz")) を評価 Zzz is for notes you don't want to save, and for Lisp evaluation. む? !2006-02-28 Tue case-replace => t !2006-02-27 Mon save-match-data save-excursion ではここらへんのデータは保存されないのかな??? (string-match "quick" "The quick brown fox jumped quickly.") => 4 (match-end 0) => 9 (string-match "ZZZ" "The quick brown fox jumped quickly. ZZZ") => 36 (match-end 0) => 39 (string-match "quick" "The quick brown fox jumped quickly.") => 4 (save-match-data (string-match "ZZZ" "The quick brown fox jumped quickly. ZZZ")) => 36 (match-end 0) => 9 (string-match "quick" "The quick brown fox jumped quickly.") => 4 (save-excursion (string-match "ZZZ" "The quick brown fox jumped quickly. ZZZ")) => 36 (match-end 0) => 39 !2006-02-26 Sun set-match-data 保存しておいて後で使うため(にグローバル変数に設定)? `store-match-data'はほぼ廃れている`set-match-data'の別名である. ということは、set-match-data は「ほぼ廃れている」という理解で良いんだよね? !2006-02-25 Sat (string-match "quick" "The quick brown fox jumped quickly.") => 4 (match-data) => (4 9) !2006-02-24 Fri まんま (string-match "\\(qu\\)\\(ick\\)" "The quick fox jumped quickly.") => 4 (match-string 0 "The quick fox jumped quickly.") => "quick" (match-string 1 "The quick fox jumped quickly.") => "qu" (match-string 2 "The quick fox jumped quickly.") => "ick" (match-beginning 1) => 4 (match-beginning 2) => 6 (match-end 1) => 6 (match-end 2) => 9 !2006-02-23 Thu (set-text-properties (point-min) (+ (point-min) 3) '(face highlight)) => t を実行 This is for notes you don't want to save, and for Lisp evaluation. の先頭が highlight されている。その先頭で、 (looking-at "This") を評価後、 (match-string 0) => #("This" 0 3 (face highlight) 3 4 nil) (match-string-no-properties 0) => "This" !2006-02-22 Wed (string-match "quick" "The quick brown fox jumped quickly.") => 4 (match-string 0) => "" (match-string 1) => nil (setq x "The quick brown fox jumped quickly.") => "The quick brown fox jumped quickly." (string-match "\\(The\\|A\\) \\([a-z]+\\)" x) => 0 (match-string 0 x) => "The quick" (match-string 1 x) => "The" (match-string 2 x) => "quick" (substring x (match-beginning 0) (match-end 0)) => "The quick" (substring x (match-beginning 1) (match-end 1)) => "The" れれれ、もしかして match-string 便利だったり? !2006-02-21 Tue This buffer is for notes you don't want to save, and for Lisp evaluation. の先頭で、 (looking-at "This") を評価後、 (replace-match "ZZZ") を評価 ZZZ is for notes you don't want to save, and for Lisp evaluation. うーむ、やはりグローバルに状態を保持していた方が便利なのかな? プログラム的に考えると気持ち悪いけど、エディタ的には普通か。 !2006-02-20 Mon (setq x "The quick brown fox jumped quickly.") => "The quick brown fox jumped quickly." (string-match "quick" x) => 4 (replace-match "ZZZ" t nil x) => "The ZZZ brown fox jumped quickly." x => "The quick brown fox jumped quickly." !2006-02-19 Sun query-replace-map => (keymap (escape . exit-prefix) (27 . exit-prefix) (29 . quit) (7 . quit) (63 . help) (help . help) (f1 . help) (8 . help) (94 . backup) (33 . automatic) (12 . recenter) (23 . delete-and-edit) (18 . edit) (46 . act-and-exit) (return . exit) (13 . exit) (113 . exit) (44 . act-and-show) (78 . skip) (89 . act) (110 . skip) (121 . act) (backspace . skip) (delete . skip) (127 . skip) (32 . act)) !2006-02-18 Sat posix-search-forward, posix-search-backward, posix-looking-at, posix-string-match とばし。 良い例思い浮かばないし。 This buffer is for notes you don't want to save, and for Lisp evaluation. の先頭で、 (perform-replace "This" "That" nil nil nil) を実行すると、 That buffer is for notes you don't want to save, and for Lisp evaluation. (perform-replace "This" "That" t nil nil) を実行すると、置換するか聞いてくる (perform-replace "[A-Z]" "Z" nil t nil) を実行すると、 Zhis buffer is for notes you don't want to save, and for Zisp evaluation. (perform-replace "is" "IS" nil nil nil) を実行すると、 ThIS buffer IS for notes you don't want to save, and for LISp evaluation. (perform-replace "is" "IS" nil nil t) を実行すると、 This buffer IS for notes you don't want to save, and for Lisp evaluation. !2006-02-17 Fri This buffer is for notes you don't want to save, and for Lisp evaluation. の先頭で、 (looking-at "This") を実行すると、 => t (looking-at "[0-9]+") を実行すると、 => nil !2006-02-16 Thu re-search-forward, re-search-backward とばし。 まんま (string-match "quick" "The quick brown fox jumped quickly.") => 4 (string-match "quick" "The quick brown fox jumped quickly." 8) => 27 (match-end 0) => 32 !2006-02-15 Wed sentence-end => "[.?!][]\"')}]*\\($\\| $\\| \\| \\)[ ]*\\|[。?!]" !2006-02-14 Tue (regexp-opt-depth "foo") => 0 (regexp-opt-depth "\\([0-9]\\)\\([a-z]\\)") => 2 !2006-02-13 Mon (regexp-opt '("a" "b")) => "[ab]" (regexp-opt '("a" "A")) => "[Aa]" (regexp-opt '("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")) => "[0-9]" (regexp-opt '("foo" "bar")) => "bar\\|foo" !2006-02-12 Sun word-search-backward とばし。 (regexp-quote ".+") => "\\.\\+" !2006-02-11 Sat search-backward とばし。 This buffer is for notes you don't want to save, and for Lisp evaluation. の先頭で、 (word-search-forward "is") を実行すると、is の後にカーソルが移動 M-x word-search-forward !2006-02-10 Fri (search-forward "and") => 53 M-x search-forward !2006-02-09 Thu (string-make-multibyte "a") => "a" !2006-02-08 Wed (string-make-unibyte "a") => "a" (string-make-unibyte "あ") => "\242" !2006-02-07 Tue nonascii-translation-table => nil !2006-02-06 Mon nonascii-insert-offset => 0 !2006-02-05 Sun (multibyte-string-p "あ") => t (multibyte-string-p "i") => nil !2006-02-04 Sat default-enable-multibyte-characters => t !2006-02-03 Fri enable-multibyte-characters => t !2006-02-02 Thu first-change-hook => nil !2006-02-01 Wed combine-after-change-calls とばし。 before-change-function => nil after-change-function => nil 「この廃れた変数」というのは、もう使うなってこと? !2006-01-31 Tue after-change-functions => nil !2006-01-30 Mon before-change-functions => nil どのモードだと設定されているんだろうか? !2006-01-29 Sun (get-register x) error--> Symbol's value as variable is void: x (setq x 10) => 10 (get-register x) => nil (set-register x 10) => 10 (get-register x) => 10 (view-register x) => 10 (insert-register x) => nil 10 !2006-01-28 Sat register-alist => nil !2006-01-27 Fri translate-region とばし。TABLE の構造と作り方が分からないので…。 (transpose-regions (goto-char (point-min)) (save-excursion (end-of-line) (point)) (save-excursion (forward-line 1) (point)) (save-excursion (forward-line 1) (end-of-line) (point))) で、 This buffer is for notes you don't want to save, and for Lisp evaluation. If you want to create a file, visit that file with C-x C-f, が、 If you want to create a file, visit that file with C-x C-f, This buffer is for notes you don't want to save, and for Lisp evaluation. に !2006-01-26 Thu 「テキスト属性が範囲でない理由」何だか、ほぼ素通り…。 (subst-char-in-region 1 20 ?i ?X) => nil で、 This buffer is for notes you don't want to save, and for Lisp evaluation. ↓ ThXs buffer Xs for notes you don't want to save, and for Lisp evaluation. !2006-01-25 Wed (put-text-property (point-min) (+ (point-min) 3) 'mouse-face 'highlight) (defun foo (event) (interactive "e") (message "mouse click!")) => foo (let ((map (make-sparse-keymap))) (define-key map [mouse-1] 'foo) (put-text-property (point-min) (+ (point-min) 3) 'local-map map)) => nil おっ、クリックで表示された。 マニュアルの define-key-binding はないみたい。 define-key を使っておいた。 !2006-01-24 Tue (put-text-property (point-min) (+ (point-min) 3) 'mouse-face 'highlight) => nil マウスとテキスト上に重ねると、highlight される !2006-01-23 Mon buffer-access-fontified-property => nil !2006-01-22 Sun buffer-access-fontify-functions => nil !2006-01-21 Sat after-insert-file-functions => (after-insert-file-set-buffer-file-coding-system) !2006-01-20 Fri write-region-annotate-functions => nil !2006-01-19 Thu (progn (set-text-properties (point) (+ (point) 1) '(face highlight)) (insert-before-markers-and-inherit "foo")) foonil !2006-01-18 Wed (progn (set-text-properties (point) (+ (point) 1) '(face highlight)) (insert-and-inherit "foo")) foonil !2006-01-17 Tue inhibit-point-motion-hooks => nil !2006-01-16 Mon (progn (switch-to-buffer (get-buffer "*Mew message*0")) (text-property-not-all (point-min) (point-max) 'face 'mew-highlight-header-face-subject)) => 1 (progn (switch-to-buffer (get-buffer "+inbox")) (text-property-not-all (point-min) (point-max) 'face 'mew-highlight-header-face-subject)) => 1 !2006-01-15 Sun previous-char-property-change とばし。 (progn (switch-to-buffer (get-buffer "*Mew message*0")) (text-property-any (point-min) (point-max) 'face 'mew-highlight-header-face-subject)) => 1064 (progn (switch-to-buffer (get-buffer "+inbox")) (text-property-any (point-min) (point-max) 'face 'mew-highlight-header-face-subject)) => nil !2006-01-14 Sat (let ((x (next-char-property-change (progn (switch-to-buffer (get-buffer "*Mew message*0")) (point))))) (buffer-substring x (+ x 1))) => #("[" 0 1 (mew-noncontents t mew-visible t face mew-highlight-header-face-subject)) !2006-01-13 Fri (let ((x (next-property-change (point-min) (get-buffer "*Mew message*0")))) (buffer-substring x (+ x 10))) => "s for note" Object が指定できててもダメだ〜。 Object が指定できる substring はないのか??? !2006-01-12 Thu (let ((x (previous-single-property-change (progn (switch-to-buffer (get-buffer "*Mew message*0")) (- (point) 1)) 'face))) (buffer-substring x (+ x 1))) => #("5" 0 1 (mew-visible nil face mew-highlight-header-face-marginal)) !2006-01-11 Wed (let ((x (previous-property-change (progn (switch-to-buffer (get-buffer "*Mew message*0")) (point))))) (buffer-substring x (+ x 1))) => #(" " 0 1 (rear-nonsticky t front-sticky nil read-only t)) !2006-01-10 Tue (let ((x (next-single-property-change (progn (switch-to-buffer (get-buffer "*Mew message*0")) (point)) 'face))) (buffer-substring x (+ x 1))) => #("[" 0 1 (mew-noncontents t mew-visible t face mew-highlight-header-face-subject)) (next-single-property-change (progn (switch-to-buffer (get-buffer "*Mew message*0")) (point)) 'foo) => nil !2006-01-09 Mon (let ((x (next-property-change (progn (switch-to-buffer (get-buffer "*Mew message*0")) (point))))) (buffer-substring x (+ x 1))) => #("[" 0 1 (mew-noncontents t mew-visible t face mew-highlight-header-face-subject)) !2006-01-08 Sun (set-text-properties (point-min) (+ (point-min) 3) '(face highlight)) => t (set-text-properties (point-min) (+ (point-min) 3) nil) => t !2006-01-07 Sat (add-text-properties (point-min) (+ (point-min) 3) '(face highlight)) => t (remove-text-properties (point-min) (+ (point-min) 3) '(face highlight)) => t なぜ、属性値は使わないのに属性リストで渡すんだろう? !2006-01-06 Fri (add-text-properties (point-min) (+ (point-min) 3) 'face) => t (add-text-properties (point-min) (+ (point-min) 3) 'face) => nil これは、間違いか。 こう使うらしい (add-text-properties (point-min) (+ (point-min) 3) '(face highlight)) => t (add-text-properties (point-min) (+ (point-min) 3) '(face highlight)) => nil (add-text-properties (point-min) (+ (point-min) 3) '(face highlight)) => nil !2006-01-05 Thu (put-text-property (point-min) (+ (point-min) 3) 'face 'mew-highlight-header-face-subject) 色がついた !2006-01-04 Wed (text-properties-at (progn (switch-to-buffer (get-buffer "*Mew message*0")) (point))) => (mew-noncontents t mew-visible t face mew-highlight-header-face-important) (get-char-property (progn (switch-to-buffer (get-buffer "*Mew message*0")) (point)) 'face) => mew-highlight-header-face-important (get-char-property (progn (switch-to-buffer (get-buffer "*Mew message*0")) (end-of-line) (backward-char 1) (point)) 'face) => mew-highlight-header-face-subject (get-char-property (progn (switch-to-buffer (get-buffer "*Mew message*0")) (forward-line 1) (end-of-line) (backward-char 1) (point)) 'face) => mew-highlight-header-face-from !2006-01-03 Tue default-text-properties => nil !2006-01-02 Mon (text-properties-at (point-min)) => (face font-lock-comment-face fontified t) !2006-01-01 Sun (get-char-property (point-min) 'face) => font-lock-comment-face !2005-12-31 Sat (get-text-property (point-min) 'face) => font-lock-comment-face !2005-12-30 Fri aaa bbb が、 M-x capitalize-word で、 Aaa bbb aaa bbb が、 C-u 2 M-x capitalize-word で、 Aaa Bbb downcase-word, upcase-word とばし。 !2005-12-29 Thu aaa bbb が、 M-x upcase-region で、 AAA BBB !2005-12-28 Wed AAA BBB が、 M-x downcase-region で、 aaa bbb なぜか、実行前に確認のメッセージが出力された !2005-12-27 Tue aaa bbb が、 M-x capitalize-region で、 Aaa Bbb !2005-12-26 Mon M-x backward-to-indentation M-x forward-to-indentation あまり良く分からないな !2005-12-25 Sun M-x back-to-indentation M-m が割り当たっているらしい !2005-12-24 Sat aaa が M-x tab-to-tab-stop で、 aaa !2005-12-23 Fri indent-relative* とばし。 tab-stop-list => (8 16 24 32 40 48 56 64 72 80 88 96 ...) !2005-12-22 Thu ; aaa bbb を C-u 2 M-x indent-rigidly だと、 ; aaa bbb 一方、 ; aaa bbb を C-u 2 M-x indent-code-rigidly だと、 ; aaa bbb む? 「文字列やコメントで始まる行」の判定はどこで? !2005-12-21 Wed aaa bbb を C-u 2 M-x indent-region だと、 aaa bbb 一方、 aaa bbb を C-u 2 M-x indent-rigidly だと、 aaa bbb !2005-12-20 Tue indent-region-function => lisp-indent-region !2005-12-19 Mon aaa bbb ccc が M-x indent-region で、変わらず。 aaa bbb ccc が C-u 2 M-x indent-region で、 aaa bbb ccc !2005-12-18 Sun aaa bbb ccc が (indent-region (point) (mark) 2) で、 error--> # れれれ? (mark) はミニバッファのマークを見ようとするのか??? !2005-12-17 Sat (setq x '(1 2 3)) が、'(1 2 3) の ) の後ろにカーソルのある状態で (reindent-then-newline-and-indent) とすると、 (setq x '(1 2 3) ) に !2005-12-16 Fri indent-for-tab-command とばし。 (setq x '(1 2 3)) が (newline-and-indent) で、 (setq x '(1 2 3)) に !2005-12-15 Thu (setq x '(1 2 3)) が M-x indent-according-to-mode で、 (setq x '(1 2 3)) に !2005-12-14 Wed indent-line-function => lisp-indent-line !2005-12-13 Tue indent-tabs-mode => nil 確かに、 (setq indent-tabs-mode t) して、 (indent-to 10) とかすると、タブも挿入されるようだ。 !2005-12-12 Mon aaa が、 M-x indent-to 2 で、 aaa に aaa が、 (indent-to 2) で、 aaa に aaa が、 (indent-to 2) で、 aaa に !2005-12-11 Sun (current-indentation) => 0 タブは位置で見ているようだ。 !2005-12-10 Sat (move-to-column 1) C-u 10 M-x move-to-column (move-to-column -1) error--> Wrong type argument: wholenump, -1 COLUMNが負であると, ポイントを行頭へ移動する. って書いてあるのにな。 !2005-12-09 Fri (current-column) => 0 !2005-12-08 Thu sort.el は EmacsLisp の勉強に良さそうだ。 (sort-columns nil) error--> Wrong type argument: number-or-marker-p, nil ふに? !2005-12-07 Wed a 10 a 9 a 8 a 7 a 1 が、 (sort-numeric-fields 2 (point-min) (point-max)) で、 a 1 a 7 a 8 a 9 a 10 !2005-12-06 Tue a 10 a 9 a 8 a 7 a 1 が、 (sort-fields 2 (point-min) (point-max)) で、 a 1 a 10 a 7 a 8 a 9 !2005-12-05 Mon sort-pages とばし。page って何? a a a c a d a g a f が、 (sort-fields 2 (point-min) (point-max)) で、 a a a c a d a f a g * フィールドは 1 から始まるんだと。なぜ? * 負も使えるんだと !2005-12-04 Sun aaa. fff. ggg. bbb.ccc. ddd.eee. が、 (sort-paragraphs nil (point-min) (point-max)) で、 aaa. bbb.ccc. ddd.eee. fff. ggg. paragraph ってなんだっけ? !2005-12-03 Sat sort-regexp-fields とばし。 abc foo bar が、 (sort-lines nil (point-min) (point-max)) で、 abc bar foo !2005-12-02 Fri sort-fold-case => nil abc foo BAR が、先頭にカーソルを置いた状態で、 (sort-subr nil 'forward-line 'end-of-line) で、 BAR abc foo に !2005-12-01 Thu abc foo bar が、先頭にカーソルを置いた状態で、 (sort-subr t 'forward-line 'end-of-line) で、 foo bar abc に !2005-11-30 Wed abc foo bar が、先頭にカーソルを置いた状態で、 (sort-subr nil 'forward-line 'end-of-line) で、 abc bar foo に !2005-11-29 Tue normal-auto-fill-function => lisp-mode-auto-fill !2005-11-28 Mon auto-fill-function => nil M-x auto-fill-mode auto-fill-function => do-auto-fill !2005-11-27 Sun adaptive-fill-function => nil !2005-11-26 Sat adaptive-fill-first-line-regexp => "\\`[ ]*\\'" !2005-11-25 Fri fill-context-prefix とばし。 adaptive-fill-regexp => "[ ]*\\([-|#;>*]+ *\\|(?[0-9]+[.)] *\\)*" 「User Option」というカテゴリもあるのか。 !2005-11-24 Thu adaptive-fill-mode => nil デフォルトでは`t'である. というのはどういう意味なんだろう? auto-fill 使用時にということ??? !2005-11-23 Wed fill-nobreak-predicate => nil !2005-11-22 Tue left-margin => 0 !2005-11-21 Mon aaa に (indent-to-left-margin) とやったら、 aaa !2005-11-20 Sun マニュアルは、 -- Function: delete-to-left-margin FROM TO となっているが、 (delete-to-left-margin &optional FROM TO) みたい。 Args FROM and TO are optional; default is the whole buffer. となっているが、 abc に対して、 (delete-to-left-margin) とやっても # というメッセージが出るだけで何も起きなかった。 !2005-11-19 Sat M-x move-to-left-margin 左端に移動したな !2005-11-18 Fri (current-fill-column) => 20 !2005-11-17 Thu set-left-margin, set-right-margin とばし。 (current-left-margin) => 0 !2005-11-16 Wed default-fill-column => 70 (default-value 'fill-column) => 70 !2005-11-15 Tue fill-column => 70 !2005-11-14 Mon fill-prefix => nil !2005-11-13 Sun use-hard-newlines => nil !2005-11-12 Sat fill-paragraph-function => lisp-fill-paragraph !2005-11-11 Fri sentence-end-double-space => t !2005-11-10 Thu (current-justification) => left !2005-11-09 Wed default-justification => left !2005-11-08 Tue (setq fill-column 20) => 20 hoge is hoge. を M-x justify-current-line で、 hoge is hoge. マニュアルでは、 justify-current-line HOW EOP NOSQUEEZE だけど、 justify-current-line &optional HOW EOP NOSQUEEZE か? !2005-11-07 Mon (setq fill-column 20) => 20 hoge is hoge. hoge is hoge. hoge is hoge. foo is foo. foo is foo. foo is foo. を (fill-region-as-paragraph 183 261) で、 hoge is hoge. hoge is hoge. hoge is hoge. foo is foo. foo is foo. foo is foo. 一方、 (fill-individual-paragraphs 183 261) だと、 hoge is hoge. hoge is hoge. hoge is hoge. foo is foo. foo is foo. foo is foo. !2005-11-06 Sun fill-individual-varying-indent => nil !2005-11-05 Sat (setq fill-column 20) => 20 hoge is hoge. hoge is hoge. hoge is hoge. を (fill-individual-paragraphs 183 227) で、 hoge is hoge. hoge is hoge. hoge is hoge. !2005-11-04 Fri (setq fill-column 20) => 20 hoge is hoge. hoge is hoge. hoge is hoge. を (fill-individual-paragraphs 183 224) で、 hoge is hoge. hoge is hoge. hoge is hoge. !2005-11-03 Thu (setq fill-column 20) => 20 hoge is hoge. hoge is hoge. hoge is hoge. を (fill-individual-paragraphs 183 224) で、 hoge is hoge. hoge is hoge. hoge is hoge. !2005-11-02 Wed (setq fill-column 20) => 20 hoge is hoge. hoge is hoge. hoge is hoge. を (fill-region 183 224 'center) で、 hoge is hoge. hoge is hoge. hoge is hoge. !2005-11-01 Tue (setq fill-column 20) => 20 hoge is hoge. hoge is hoge. hoge is hoge. を (fill-region 183 224 'right) で、 hoge is hoge. hoge is hoge. hoge is hoge. !2005-10-31 Mon (setq fill-column 20) => 20 hoge is hoge. hoge is hoge. hoge is hoge. を (fill-region 183 224 'left) で、 hoge is hoge. hoge is hoge. hoge is hoge. !2005-10-30 Sun (setq fill-column 20) => 20 hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. を (fill-region 254 351) で、 hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. !2005-10-29 Sat hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. を M-x fill-paragraph で、 hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. hoge is hoge. !2005-10-28 Fri fill-column => 70 !2005-10-27 Thu undo-strong-limit => 30000 !2005-10-26 Wed undo-limit => 20000 !2005-10-25 Tue buffer-undo-list => ずらずら M-x buffer-disable-undo (buffer-disable-undo) buffer-undo-list => t !2005-10-24 Mon primitive-undo とばし。 M-x buffer-enable-undo (buffer-enable-undo) => nil !2005-10-23 Sun (undo-boundary) => nil なんのことやら !2005-10-22 Sat buffer-undo-list うへへへ、何かたくさん出てきたぞぃ !2005-10-21 Fri kill-ring と kill-ring-yank-pointer の違いって? kill-ring-max => 60 !2005-10-20 Thu interprogram-cut-function => x-select-text !2005-10-19 Wed interprogram-paste-function => x-cut-buffer-or-selection-value !2005-10-18 Tue (setq kill-ring nil) => nil (kill-new "foo") => "foo" kill-ring => ("foo") (kill-append "bar" nil) => "foobar" kill-ring => ("foobar") (kill-append "baz" nil) => "foobarbaz" kill-ring => ("foobarbaz") (setq kill-ring nil) => nil (kill-new "foo") => "foo" kill-ring => ("foo") (kill-append "bar" t) => "barfoo" kill-ring => ("barfoo") nil のところに kill-append できないようだ。 私のイメージした append とは動作が違うな。 どういうシチュエーションで使用するもの? !2005-10-17 Mon (setq kill-ring nil) => nil (kill-new "foo") => "foo" M-x yank foo (setq kill-ring nil) => nil (kill-new "foo") => "foo" kill-ring => ("foo") (kill-new "bar") => "bar" kill-ring => ("bar" "foo") !2005-10-16 Sun (current-kill 1) => ... !2005-10-15 Sat M-x yank M-x yank-pop とやったが、 Previous command was not a yank と言われてしまう… !2005-10-14 Fri M-x yank (yank) !2005-10-13 Thu kill-ring => nil M-x copy-region-as-kill kill-ring => ("aaa") !2005-10-12 Wed kill-read-only-ok => nil !2005-10-11 Tue M-x kill-region (kill-region (point) (1+ (point))) !2005-10-10 Mon kill-ring-max => 60 !2005-10-09 Sun M-x delete-blank-lines !2005-10-08 Sat M-x just-one-space 文字列にも同じような関数あるのかな? バッファに対する操作と文字列に対する操作に隔たりがあるのが、 どうも面倒くさいことがある。 !2005-10-07 Fri M-x fixup-whitespace ところで、今さらながら、「コマンド」と「Function」には、何の違いが? !2005-10-06 Thu M-x delete-indentation !2005-10-05 Wed M-x delete-horizontal-space !2005-10-04 Tue M-x backward-delete-char-untabify-method !2005-10-03 Mon M-x backward-delete-char-untabify !2005-10-02 Sun (delete-backward-char 1) (delete-backward-char -1) * delete-char があったらいらない気が * delete-char でなくて delete-forward-char の方が統一的な気が * 良く使うから短く? !2005-10-01 Sat (delete-char 1) (delete-char -1) !2005-09-30 Fri (delete-region (point-min) (point-max)) !2005-09-29 Thu (erase-buffer) M-x erase-buffer !2005-09-28 Wed overwrite-mode => nil !2005-09-27 Tue (split-line) M-x split-line で、 foo bar ↓ foo bar !2005-09-26 Mon (newline) (newline 4) M-x newline こんなのがあったか。 !2005-09-25 Sun (self-insert-command 2) M-x self-insert-command 適当にやり過ごす… !2005-09-24 Sat (insert-buffer "*scratch*") nil This buffer is for notes you don't want to save, and for Lisp evaluation. ... M-x insert-buffer !2005-09-23 Fri (insert-buffer-substring "*scratch*" 1 2) => Tnil !2005-09-22 Thu (insert-char ?a) error--> Wrong number of arguments: #, 1 私の見ている版は、 Function: insert-char CHARACTER &optional COUNT INHERIT となっていた。間違えのようだ。仕様が変わった??? (insert-char ?a 2) => aanil !2005-09-21 Wed (insert-before-markers "foo") foonil !2005-09-20 Tue (insert) => nil (insert "foo") => foonil (insert "foo" "bar") => foobarnil なんで、引数なしがあるんだろうか? !2005-09-19 Mon (compare-buffer-substrings (get-buffer "*scratch*") 1 2 (get-buffer "*scratch*") 1 2) => 0 (compare-buffer-substrings (get-buffer "*scratch*") 1 2 (get-buffer "*scratch*") 1 3) => -2 (compare-buffer-substrings (get-buffer "*scratch*") 1 3 (get-buffer "*scratch*") 1 2) => 2 (compare-buffer-substrings "*scratch*" 1 2 "*scratch*" 1 2) => 0 !2005-09-18 Sun (thing-at-point 'word) => nil (thing-at-point 'line) => " " (thing-at-point 'whitespace) => " " !2005-09-17 Sat (buffer-string) => "This buffer is for notes you don't want to save, and for Lisp evaluation. ... (buffer-string) " !2005-09-16 Fri (buffer-substring-no-properties 1 1) => "" (buffer-substring-no-properties 1 2) => "T" (buffer-substring-no-properties 1 3) => "Th" (buffer-substring-no-properties 3 1) => "Th" プロパティーをコピーしたいと思って buffer-substring を 使っているわけではないんだけどなあ。 !2005-09-15 Thu (buffer-substring 0 0) error--> Args out of range: 0, 0 (buffer-substring 0 1) error--> Args out of range: 0, 1 (buffer-substring 1 1) => "" (buffer-substring 1 2) => "T" (buffer-substring 1 3) => "Th" (buffer-substring 3 1) => "Th" !2005-09-14 Wed (eolp) => t !2005-09-13 Tue (bolp) => t !2005-09-12 Mon (eobp) => t !2005-09-11 Sun (bobp) => nil !2005-09-10 Sat (preceding-char) => 10 !2005-09-09 Fri (following-char) => 10 !2005-09-08 Thu (char-before) => 10 (char-before 0) => nil (char-before 1) => nil (char-before 2) => 84 !2005-09-07 Wed (char-after) => nil (char-after) => 99 (char-after 0) => nil (char-after 1) => 84 (char-to-string (char-after 1)) => "T" !2005-09-06 Tue (region-beginning) => 184 (region-end) => 224 !2005-09-05 Mon deactivate-mark とばし mark-active => t activate-mark-hook, deactivate-mark-hook とばし mark-ring-max => 16 !2005-09-04 Sun transient-mark-mode => nil mark-even-if-inactive => nil deactivate-mark => t !2005-09-03 Sat (pop-mark) => (# # # # # # # # # # # # # #) 戻り値に意味はない. なら返さなければ良いのに… !2005-09-02 Fri (push-mark) => nil mark-ring => (# # # # # # # # # #) (push-mark 10) => nil mark-ring => (# # # # # # # # # # #) !2005-09-01 Thu (set-mark 1) => # !2005-08-31 Wed まんま (setq m (mark-marker)) => # (set-marker m 100) => # (mark-marker) => # !2005-08-30 Tue (mark) => 1047 !2005-08-29 Mon まんま (setq m (point-marker)) => # (set-marker m 55) => # (setq b (get-buffer "*info*")) => # (set-marker m 0 b) => # !2005-08-28 Sun (marker-insertion-type (make-marker)) => nil (setq m (make-marker)) => # (set-marker-insertion-type m t) => t (marker-insertion-type m) => t !2005-08-27 Sat まんま (setq m (make-marker)) => # (marker-position m) => nil (marker-buffer m) => nil (set-marker m 3770 (current-buffer)) => # (marker-buffer m) => # (marker-position m) => 1271 !2005-08-26 Fri (marker-position (point-min-marker)) => 1 (marker-position (point-max-marker)) => 1130 !2005-08-25 Thu まんま (copy-marker 0) => # (copy-marker 20000) => # (setq p (point-marker)) => # (setq q (copy-marker p)) => # (eq p q) => nil (equal p q) => t !2005-08-24 Wed まんま (point-min-marker) => # (point-max-marker) => # (narrow-to-region 100 200) => nil (point-min-marker) => # (point-max-marker) => # !2005-08-23 Tue (point-max-marker) => # !2005-08-22 Mon (point-min-marker) => # !2005-08-21 Sun (point-marker) => # !2005-08-20 Sat (number-or-marker-p 1) => t (number-or-marker-p (make-marker)) => t (number-or-marker-p 1.0) => t (number-or-marker-p t) => nil !2005-08-19 Fri (integer-or-marker-p 1) => t (integer-or-marker-p (make-marker)) => t (integer-or-marker-p 1.0) => nil (integer-or-marker-p t) => nil !2005-08-18 Thu (markerp 1) => nil (markerp (make-marker)) => t !2005-08-17 Wed まんま (setq m1 (make-marker)) => # (set-marker m1 100) => # (progn (goto-char (point-min)) (insert "Q")) m1 => # (setq m2 (copy-marker m1)) => # (eq m1 m2) => nil (equal m1 m2) => t (set-marker m1 nil) => # !2005-08-16 Tue widen とばし。 save-restriction は narrowing、 save-excursion はポイント・マークなどって感じで良い? unwind-protect って何だっけ? !2005-08-15 Mon (excursion, 周遊) へぇ〜 save-excursion とばし。 EmacsのLispソースでは4000回以上も使われている. へぇ〜。ってどうでもいいじゃん。 narrow-to-region とばし。 narrow-to-page 不明。 !2005-08-14 Sun (skip-chars-backward "a-zA-Z ") !2005-08-13 Sat まんま (skip-chars-forward "a-zA-Z ") (skip-chars-forward "a-zA-Z " 2) !2005-08-12 Fri defun-prompt-regexp => nil !2005-08-11 Thu (end-of-defun) M-x end-of-defun !2005-08-10 Wed (beginning-of-defun) M-x beginning-of-defun !2005-08-09 Tue (backward-sexp) M-x backward-sexp !2005-08-08 Mon (forward-sexp) M-x forward-sexp !2005-08-07 Sun M-x down-list (down-list) 怒られる 挙動が良く分からないな。 !2005-08-06 Sat M-x up-list (up-list) 怒られる !2005-08-05 Fri (backward-list) M-x backward-list !2005-08-04 Thu compute-motion とばし。 (forward-list) M-x forward-list !2005-08-03 Wed (move-to-window-line 1) M-x move-to-window-line C-u 4 M-x move-to-window-line !2005-08-02 Tue (vertical-motion 1) &optional WINDOW の WINDOW ってなんだったっけ? !2005-08-01 Mon (count-lines (point-min) (point-max)) => 5 (count-lines (point) (point)) => 0 (count-lines (point) (1- (point))) => 1 !2005-07-31 Sun (forward-line) (forward-line -1) M-x forward-line !2005-07-30 Sat (end-of-line) (end-of-line 1) (end-of-line 2) (end-of-line -1) M-x end-of-line !2005-07-29 Fri (beginning-of-line) (beginning-of-line 1) (beginning-of-line 2) (beginning-of-line -1) M-x beginning-of-line !2005-07-28 Thu (goto-line 0) (goto-line 1) (goto-line 2) (goto-line -1) (goto-line 300) M-x goto-line !2005-07-27 Wed (end-of-buffer) M-x end-of-buffer !2005-07-26 Tue (beginning-of-buffer) (beginning-of-buffer t) (beginning-of-buffer 10) M-x beginning-of-buffer あれ? *警告:*` 'Lispプログラムではこの関数を使わないこと! だとさ。マークを設定しちゃったりするから??? !2005-07-25 Mon まんま (goto-char (point-min)) (goto-char (point-max)) !2005-07-24 Sun words-include-escapes => nil !2005-07-23 Sat (backward-word 1) (backward-word -1) M-x backward-word !2005-07-22 Fri (forward-word 1) (forward-word -1) M-x forward-word !2005-07-21 Thu (backward-char) (backward-char 1) (backward-char -1) M-x backward-char !2005-07-20 Wed (forward-char) (forward-char 1) (forward-char -1) M-x forward-char !2005-07-19 Tue (goto-char 1) (goto-char -1) (goto-char 999) !2005-07-18 Mon (buffer-size) => 196 ナローイングしていない場合は、(point-max) より 1少ないんだと。 ナローイングでも (buffer-size) は変わらないという意味なのか??? !2005-07-17 Sun (buffer-end 0) => 1 (buffer-end 1) => 308 !2005-07-16 Sat (point-max) => 286 !2005-07-15 Fri (point-min) => 1 !2005-07-14 Thu (point) => 212 !2005-07-13 Wed M-x make-indirect-buffer で、*bar* という名前の *scratch* の間接バッファ作成済。 (buffer-base-buffer (get-buffer "*scratch*")) => nil (buffer-base-buffer (get-buffer "*bar*")) => # !2005-07-12 Tue kill-buffer-hook とばし。 buffer-offer-save とばし。何なの?何に使うの? M-x make-indirect-buffer 確かに、別名の同一内容バッファが作成できた。 こんな機能あったんだ。 !2005-07-11 Mon kill-buffer-query-functions => nil (setq kill-buffer-query-functions '((lambda () (message "foo")))) => ((lambda nil (message "foo"))) (setq b (generate-new-buffer "bar")) => # (kill-buffer b) => t どうもこの辺りはマニュアルに例が載っていないなあ〜 !2005-07-10 Sun (kill-buffer "bar") error--> No buffer named bar 「削除済みのバッファを削除してもなんの効果もない.」 という記述と矛盾していないか? と、思ったが、↓なので、良いのか (setq b (generate-new-buffer "bar")) => # (kill-buffer b) => t (kill-buffer b) => nil (kill-buffer b) => nil b => # !2005-07-09 Sat (get-buffer "bar") => nil (generate-new-buffer "bar") => # (kill-buffer "bar") => t !2005-07-08 Fri (get-buffer "bar") => nil (setq b (generate-new-buffer "bar")) => # (kill-buffer b) => t (buffer-name b) => nil !2005-07-07 Thu まんま (generate-new-buffer "bar") => # (generate-new-buffer "bar") => #> (generate-new-buffer "bar") => #> !2005-07-06 Wed (get-buffer-create "foo") => # !2005-07-05 Tue M-x bury-buffer (bury-buffer) (bury-buffer "+inbox") (bury-buffer "foo") error--> No buffer named foo !2005-07-04 Mon (other-buffer) => # (other-buffer) => # (other-buffer nil t) => # !2005-07-03 Sun (buffer-list) => (# # # # # # ... #) !2005-07-02 Sat (barf-if-buffer-read-only) => nil ; +inbox で実行 (barf-if-buffer-read-only) Buffer is read-only: # !2005-07-01 Fri M-x toggle-read-only C-x C-q と同じか?と思ったが、ちょっと違うのか? C-x C-q runs the command vc-toggle-read-only !2005-06-30 Thu inhibit-read-only => nil +inbox で評価すると、nil !2005-06-29 Wed buffer-read-only => nil +inbox で評価すると、t !2005-06-28 Tue * ファイル foo を作って、読み込む * touch foo を実行 (ask-user-about-supersession-threat "foo") とやると、 foo changed on disk; really edit the buffer? (y, n, r or C-h) と聞かれる !2005-06-27 Mon (visited-file-modtime) => (17087 . 27883) (set-visited-file-modtime '(17087 . 27800)) (visited-file-modtime) => (17087 . 27800) !2005-06-26 Sun (visited-file-modtime) => 0 .emacs をカレントにして eval (visited-file-modtime) => (14924 . 16438) !2005-06-25 Sat (clear-visited-file-modtime) => nil !2005-06-24 Fri (verify-visited-file-modtime (get-buffer "+inbox")) => t !2005-06-23 Thu (buffer-modified-tick) => 532 (buffer-modified-tick (get-buffer "+inbox")) => 1540 !2005-06-22 Wed M-x not-modified !2005-06-21 Tue (set-buffer-modified-p t) => t (set-buffer-modified-p nil) => nil !2005-06-20 Mon (buffer-modified-p) => t !2005-06-19 Sun list-buffers-directory => nil ? !2005-06-18 Sat (set-visited-file-name nil) => nil (set-visited-file-name "foo") => nil ; foo にバッファ名が変わった (set-visited-file-name "*scracth*") => nil ; 元に戻しておく ; 元に戻ったわけではないようだ !2005-06-17 Fri (get-file-buffer "foo") => nil (get-file-buffer ".emacs") => # !2005-06-16 Thu buffer-file-number => nil buffer-file-number's value is (13355487 8388854) !2005-06-15 Wed buffer-file-truename => nil buffer-file-truename's value is "~/.emacs" buffer-file-name's value is "/home/hogehgoe/nnakamur/.emacs" !2005-06-14 Tue buffer-file-name => nil 同名の Variable と Function か。 !2005-06-13 Mon (buffer-file-name) => nil (buffer-file-name (get-buffer ".emacs")) => "/home/hogehoge/nnakamur/.emacs" !2005-06-12 Sun get-buffer とばし。もう使っているから。 引数は BUFFER-OR-NAME なのか。 (generate-new-buffer-name "foo") => "foo" (generate-new-buffer-name "foo") => "foo" (generate-new-buffer-name "+inbox") => "+inbox<2>" !2005-06-11 Sat (rename-buffer "*scratch*") => "*scratch*" (rename-buffer "*scratch2*") => "*scratch2*" なんで、カレントバッファ対象なんだろう? そんなに良く使う? !2005-06-10 Fri ほぼ、まんま (buffer-name) => "*scratch*" (setq foo (get-buffer "temp")) => nil (buffer-name foo) => "*scratch*" (buffer-name nil) => "*scratch*" (setq foo (get-buffer "+inbox")) => # temp バッファを作成後 (setq foo (get-buffer "temp")) => # (kill-buffer foo) => t (buffer-name foo) => nil foo => # !2005-06-09 Thu (with-temp-buffer (insert "foo") (buffer-string)) => "foo" !2005-06-08 Wed set-buffer とばし。私が使う範囲では、使ったことがある模様。 save-current-buffer とばし。使ったことないな。 (with-current-buffer (set-buffer (get-buffer "+inbox")) (forward-line -10)) 「とばし」と言いつつ使ったか…。 !2005-06-07 Tue (bufferp t) => nil (bufferp (current-buffer)) => t !2005-06-06 Mon enable-recursive-minibuffers => nil !2005-06-05 Sun (minibuffer-depth) => 0 !2005-06-04 Sat minibuffer-scroll-window => # !2005-06-03 Fri (minibuffer-window-active-p (minibuffer-window)) => nil !2005-06-02 Thu (window-minibuffer-p (minibuffer-window)) => t 説明の意味が良く分からない… !2005-06-01 Wed (minibuffer-window) => # !2005-05-31 Tue (active-minibuffer-window) => nil !2005-05-30 Mon minibuffer-help-form => nil !2005-05-29 Sun minibuffer-exit-hook => nil !2005-05-28 Sat minibuffer-setup-hook => (minibuffer-history-initialize) !2005-05-27 Fri (minibuffer-prompt-width) => 0 !2005-05-26 Thu (minibuffer-prompt) => nil !2005-05-25 Wed map-y-or-n-p とばし。 (read-passwd "password?") => "aaa" (read-passwd "password?" t) => "aaa" 二度 聞かれる !2005-05-24 Tue まんま (yes-or-no-p "Do you really want to remove everything? ") => t !2005-05-23 Mon (y-or-n-p-with-timeout "Do you need a lift? " 3 "default value") => "default value" !2005-05-22 Sun まんま (y-or-n-p "Do you need a lift? ") => t (y-or-n-p "Do you need a lift? ") => nil !2005-05-21 Sat insert-default-directory => t まんま (let ((insert-default-directory t)) (read-file-name "The file is ")) (let ((insert-default-directory nil)) (read-file-name "The file is ")) !2005-05-20 Fri まんま (read-file-name "The file is ") => "~/.emacs" !2005-05-19 Thu まんま (read-variable "Variable name? ") => fill-prefix !2005-05-18 Wed まんま (read-command "Command name? ") => forward-char !2005-05-17 Tue read-buffer-function => nil !2005-05-16 Mon まんま (read-buffer "Buffer name? " "foo" t) !2005-05-15 Sun display-completion-list とばし completion-auto-help => t !2005-05-14 Sat minibuffer-completion-confirm => nil !2005-05-13 Fri minibuffer-completion-table => nil minibuffer-completion-predicate => nil なんで、こんなグローバル変数必要なの? !2005-05-12 Thu minibuffer-local-completion-map は既に見たので、とばし minibuffer-local-must-match-map => (keymap (menu-bar keymap (minibuf "Minibuf" keymap (return "Enter" . exit-minibuffer) (quit "Quit" . keyboard-escape-quit) (tab "Complete" . minibuffer-complete) (space "Complete Word" . minibuffer-complete-word) (63 "List Completions" . minibuffer-completion-help) "Minibuf")) (C-tab . file-cache-minibuffer-complete) (prior . switch-to-completions) (next . next-history-element) (27 keymap (118 . switch-to-completions) (115 . next-matching-history-element) (114 . previous-matching-history-element) (112 . previous-history-element) (110 . next-history-element)) (down . next-history-element) (up . previous-history-element) (63 . minibuffer-completion-help) (32 . minibuffer-complete-word) (9 . minibuffer-complete) (10 . minibuffer-complete-and-exit) (13 . minibuffer-complete-and-exit) (7 . abort-recursive-edit)) デフォルトだと minibuffer-local-completion-map と同じ内容か? 良く見ると微妙に違うか (10 . minibuffer-complete-and-exit) (13 . minibuffer-complete-and-exit) (10 . exit-minibuffer) (13 . exit-minibuffer) !2005-05-11 Wed まんま (completing-read "Complete a foo: " '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4)) nil t "fo") => "barfoo" !2005-05-10 Tue completion-ignore-case => nil !2005-05-09 Mon まんま (defun test (s) (> (length (car s)) 6)) (all-completions "foo" '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4)) 'test) => ("foobar1" "foobar2") !2005-05-08 Sun まんま (try-completion "foo" '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4))) => "fooba" (try-completion "foo" '(("barfoo" 2) ("foo" 3))) => t (try-completion "forw" obarray) => "forward" (defun test (s) (> (length (car s)) 6)) (try-completion "foo" '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4)) 'test) => "foobar" !2005-05-07 Sat read-expression-history => nil ふにゃ? !2005-05-06 Fri shell-command-history => ("file foo.tar.gz.gpg" "gpg -e -r foo@bar.org foo.tar.gz") !2005-05-05 Thu extended-command-history => ("indent-code" ... "format-books-list") !2005-05-04 Wed regexp-history => nil なんだろう? !2005-05-03 Tue buffer-name-history => ("*scratch*" "*info*" ... "+inbox") !2005-05-02 Mon file-name-history => ("~/.signature" "~" ...) !2005-05-01 Sun query-replace-history => nil nil を t に変換してみた query-replace-history ("t" "nil") !2005-04-30 Sat minibuffer-history => ("(+ 1 2)" "+ 1 2" "aaa" "4" "2" "4" "2" ... "600") !2005-04-29 Fri まんま (edit-and-eval-command "Please edit: " '(forward-word 1)) => nil で、何が嬉しいんだっけ? !2005-04-28 Thu (eval-minibuffer "???") => 3 (+ 1 2) を入力 !2005-04-27 Wed (read-minibuffer "???") => aaa !2005-04-26 Tue minibuffer-local-ns-map => (keymap (menu-bar keymap (minibuf "Minibuf" keymap (return "Enter" . exit-minibuffer) (quit "Quit" . keyboard-escape-quit) "Minibuf")) (prior . previous-history-element) (next . next-history-element) (27 keymap (115 . next-matching-history-element) (114 . previous-matching-history-element) (112 . previous-history-element) (110 . next-history-element)) (down . next-history-element) (up . previous-history-element) (63 . self-insert-and-exit) (9 . exit-minibuffer) (32 . exit-minibuffer) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . abort-recursive-edit)) minibuffer-local-map に比べると、 * C-tab がない * 9, 32 がある 2005-04-20 Wed にも minibuffer-local-ns-map 見てるな… !2005-04-25 Mon (read-no-blanks-input "???") => "" どこで使っているんだろうか? !2005-04-24 Sun minibuffer-local-map => (keymap (menu-bar keymap (minibuf "Minibuf" keymap (return "Enter" . exit-minibuffer) (quit "Quit" . keyboard-escape-quit) "Minibuf")) (C-tab . file-cache-minibuffer-complete) (prior . previous-history-element) (next . next-history-element) (27 keymap (115 . next-matching-history-element) (114 . previous-matching-history-element) (112 . previous-history-element) (110 . next-history-element)) (down . next-history-element) (up . previous-history-element) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . abort-recursive-edit)) !2005-04-23 Sat minibuffer-allow-text-properties => nil !2005-04-22 Fri (read-string "???") => "aaa" !2005-04-21 Thu (read-from-minibuffer "???") => "aaa" (read-from-minibuffer "???" "bbb") => "bbb" !2005-04-20 Wed enable-recursive-minibuffers => nil minibuffer-local-map => (keymap (menu-bar keymap (minibuf "Minibuf" keymap (return "Enter" . exit-minibuffer) (quit "Quit" . keyboard-escape-quit) "Minibuf")) (C-tab . file-cache-minibuffer-complete) (prior . previous-history-element) (next . next-history-element) (27 keymap (115 . next-matching-history-element) (114 . previous-matching-history-element) (112 . previous-history-element) (110 . next-history-element)) (down . next-history-element) (up . previous-history-element) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . abort-recursive-edit)) minibuffer-local-ns-map => (keymap (menu-bar keymap (minibuf "Minibuf" keymap (return "Enter" . exit-minibuffer) (quit "Quit" . keyboard-escape-quit) "Minibuf")) (prior . previous-history-element) (next . next-history-element) (27 keymap (115 . next-matching-history-element) (114 . previous-matching-history-element) (112 . previous-history-element) (110 . next-history-element)) (down . next-history-element) (up . previous-history-element) (63 . self-insert-and-exit) (9 . exit-minibuffer) (32 . exit-minibuffer) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . abort-recursive-edit)) minibuffer-local-completion-map => (keymap (menu-bar keymap (minibuf "Minibuf" keymap (return "Enter" . exit-minibuffer) (quit "Quit" . keyboard-escape-quit) (tab "Complete" . minibuffer-complete) (space "Complete Word" . minibuffer-complete-word) (63 "List Completions" . minibuffer-completion-help) "Minibuf")) (C-tab . file-cache-minibuffer-complete) (prior . switch-to-completions) (next . next-history-element) (27 keymap (118 . switch-to-completions) (115 . next-matching-history-element) (114 . previous-matching-history-element) (112 . previous-history-element) (110 . next-history-element)) (down . next-history-element) (up . previous-history-element) (63 . minibuffer-completion-help) (32 . minibuffer-complete-word) (9 . minibuffer-complete) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . abort-recursive-edit)) minibuffer-local-completion-map => (keymap (menu-bar keymap (minibuf "Minibuf" keymap (return "Enter" . exit-minibuffer) (quit "Quit" . keyboard-escape-quit) (tab "Complete" . minibuffer-complete) (space "Complete Word" . minibuffer-complete-word) (63 "List Completions" . minibuffer-completion-help) "Minibuf")) (C-tab . file-cache-minibuffer-complete) (prior . switch-to-completions) (next . next-history-element) (27 keymap (118 . switch-to-completions) (115 . next-matching-history-element) (114 . previous-matching-history-element) (112 . previous-history-element) (110 . next-history-element)) (down . next-history-element) (up . previous-history-element) (63 . minibuffer-completion-help) (32 . minibuffer-complete-word) (9 . minibuffer-complete) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . abort-recursive-edit)) !2005-04-19 Tue print-level => nil (let ((print-level 1)) (print '((a b c)))) -| (...) => ((a b c)) (let ((print-level 2)) (print '((a b c)))) -| ((a b c)) => ((a b c)) !2005-04-18 Mon print-length => nil まんま (setq print-length 2) => 2 (print '(1 2 3 4 5)) -| (1 2 ... . (3 4 ... . (5))) => (1 2 ... . (3 4 ... . (5))) !2005-04-17 Sun print-escape-multibyte => nil !2005-04-16 Sat print-escape-nonascii => nil 「ユニバイト非ASCII文字」が良く分からないや !2005-04-15 Fri print-escape-newlines => nil (prin1 "a\nb") "a b""a b" (let ((print-escape-newlines t)) (prin1 "a\nb")) "a\nb""a b" !2005-04-14 Thu standard-output => # !2005-04-13 Wed まんま (with-output-to-string (princ "The buffer is ") (princ (buffer-name))) => "The buffer is *scratch*" !2005-04-12 Tue まんま (prin1-to-string "foo") => "\"foo\"" (prin1-to-string "foo" t) => "foo" !2005-04-11 Mon まんま (prin1-to-string 'foo) => "foo" (prin1-to-string (mark-marker)) => "#" !2005-04-10 Sun (write-char ?a) => a97 !2005-04-09 Sat (terpri) => t !2005-04-08 Fri まんま (progn (princ 'The\ cat) (princ " in the \"hat\"")) => The cat in the "hat"" in the \"hat\"" まにゅあるだと、-| と => で書いてあるな。なぜ? !2005-04-07 Thu まんま (progn (prin1 'The\ cat\ in) (prin1 "the hat") (prin1 " came back")) => The\ cat\ in"the hat"" came back"" came back" !2005-04-06 Wed まんま (progn (print 'The\ cat\ in) (print "the hat") (print " came back")) -| The\ cat\ in -| -| "the hat" -| -| " came back" => " came back" !2005-04-05 Tue まんま (setq foo (list nil)) => (nil) (setcar foo foo) => (#0) !2005-04-04 Mon まんま (setq last-output nil) => nil (defun eat-output (c) (setq last-output (cons c last-output))) => eat-output (print "This is the output" 'eat-output) => "This is the output" last-output => (10 34 116 117 112 116 117 111 32 101 104 116 32 115 105 32 115 105 104 84 34 10) (concat (nreverse last-output)) => " \"This is the output\" " !2005-04-03 Sun まんま (print "Echo Area output" t) => "Echo Area output" -| "Echo Area output" !2005-04-02 Sat ほぼまんま (setq m (copy-marker 2)) => # (print "More output for foo." m) => "More output for foo." ---------- Buffer: *scratch* ---------- T "More output for foo." ... ---------- Buffer: *scratch* ---------- !2005-04-01 Fri まんま (print "This is the output" (get-buffer "*foo*")) => "This is the output" ---------- Buffer: *foo* ---------- "This is the output" ---------- Buffer: *foo* ---------- !2005-03-31 Thu standard-input => t !2005-03-30 Wed まんま (read-from-string "(setq x 55) (setq y 5)") => ((setq x 55) . 11) (read-from-string "\"A short string\"") => ("A short string" . 16) (read-from-string "(list 112)" 0) => ((list 112) . 10) (read-from-string "(list 112)" 1) => (list . 5) (read-from-string "(list 112)" 6 8) => (11 . 8) !2005-03-29 Tue (read) => aaa !2005-03-28 Mon まんま (setq useless-list (append "XY()" nil)) => (88 89 40 41) (defun useless-stream (&optional unread) (if unread (setq useless-list (cons unread useless-list)) (prog1 (car useless-list) (setq useless-list (cdr useless-list))))) => useless-stream (read 'useless-stream) => XY useless-list => (40 41) (read 'useless-stream) => nil !2005-03-27 Sun まんま (read t) => abc !2005-03-26 Sat バッファからの read がマニュアル通りにはできない まんま (read "(When in) the course") => (When in) !2005-03-25 Fri RRB は一休み 1 => 1 01 => 1 !2005-03-24 Thu 途中だけど、あきらめて RRB 054 文字列の一部を取り除く ; 正規表現にマッチした部分を取り除く ; RRB 052 の string-sub, string-gsub を使って (string-sub "\t今日の昼食\nうに \n" "\\(\\s \\|\n\\|\r\\)" "") => "今日の昼食 うに " (string-gsub "\t今日の昼食\nうに \n" "\\(\\s \\|\n\\|\r\\)" "") => "今日の昼食うに" ; 特定の文字を取り除く ; RRB 052 の string-sub, string-gsub を使って (defun string-delete-char (str char) (string-gsub str char "")) (defun string-delete (str delete-str) (defun string-delete-ary (str ary) (if (null ary) str (string-delete-ary (string-delete-char str (car ary)) (cdr ary)))) (string-delete-ary str (split-string delete-str ""))) (string-delete "gooooooooooooogle" "o") => "ggle" (string-delete "gooooooooooooogle" "go") => "le" ^ - などに対応していない もしかして↓で良い? (defun string-delete (str delete-str) (string-gsub str (concat "[" delete-str "]+") "")) (string-delete "gooooooooooooogle" "o") => "ggle" (string-delete "gooooooooooooogle" "go") => "le" (string-delete "gooooooooooooogle" "^o") => "ooooooooooooo" (string-delete "123456789" "2-8") => "19" (defun string-squeeze-char (str char) (string-gsub str (concat char "+") char)) (defun string-squeeze (str sstr) (defun string-squeeze-ary (str ary) (if (null ary) str (string-squeeze-ary (string-squeeze-char str (car ary)) (cdr ary)))) (string-squeeze-ary str (split-string sstr ""))) (string-squeeze-char "gggooogle" "g") => "gooogle" (string-squeeze "gggooogle" "g") => "gooogle" (string-squeeze "gggooogle" "go") => "gogle" ^ - などに対応していない ; 文字列先頭・末尾の文字を取り除く (defun string-chop (str) (let ((len (length str))) (if (= len 0) str (substring str 0 (1- len))))) (string-chop "aaax") => "aaa" (string-chop "aaa\n") => "aaa" (defun string-chomp (str) (if (string-match "\\(\r\\|\n\\)$" str) (substring str 0 (match-beginning 0)) str)) (string-chomp "aaa") => "aaa" (string-chomp "aaa\n") => "aaa" (string-chomp "aaa\r\n") => "aaa" (string-chomp "aaa\r") => "aaa" (string-chomp "") => "" * $ で良いのかな??? * + が不要なのも、なぜだっけ? ; インデックスを指定して取り除く できていない! !2005-03-23 Wed 途中だけど、あきらめて RRB 052 文字列の一部を置換する (defun string-sub (str regex replace-str) (let ((case-fold-search nil)) (if (string-match regex str) (replace-match replace-str nil nil str) str))) (string-sub "あいあいあい" "あい" "愛") => "愛あいあい" (defun string-gsub (str regex replace-str) (if (string-match regex str) (concat (substring str 0 (match-beginning 0)) replace-str (string-gsub (substring str (match-end 0)) regex replace-str)) str)) (string-gsub "あいあいあい" "あい" "愛") => "愛愛愛" (defun string-sub-proc (str regex proc) (if (string-match regex str) (concat (substring str 0 (match-beginning 0)) (funcall proc (substring str (match-beginning 0) (match-end 0))) (substring str (match-end 0))) str)) (setq queue '("愛" "哀" "相")) (string-sub-proc "あいあいあい" "あい" (lambda (x) (let ((c (car queue))) (setq queue (cdr queue)) c))) => "愛あいあい" (defun string-gsub-proc (str regex proc) (if (string-match regex str) (concat (substring str 0 (match-beginning 0)) (funcall proc (substring str (match-beginning 0) (match-end 0))) (string-gsub-proc (substring str (match-end 0)) regex proc)) str)) (setq queue '("愛" "哀" "相")) (string-gsub-proc "あいあいあい" "あい" (lambda (x) (let ((c (car queue))) (setq queue (cdr queue)) c))) => "愛哀相" ; 特定の文字を置換する ; RRB 040 の string-tr を使うと (string-tr "-rv1.8.1" "." "_") => "-rv1_8_1" (string-tr "abcdefg" "acg" "ACG") => "AbCdefG" ; 範囲を指定して置換する できていない! !2005-03-22 Tue RRB 037 数値を表す文字列か調べる (defun integer-stringp (str) (let ((match-str)) (if (string-match "[-+]?[0-9]+" str) (progn (setq match-str (substring str (match-beginning 0) (match-end 0))) (string= match-str str)) nil))) (integer-stringp "123") => t (integer-stringp "-123") => t (integer-stringp "+123") => t (integer-stringp "+123.0") => nil (integer-stringp "abc") => nil (integer-stringp "12abc") => nil (integer-stringp "123 ") => nil (defun float-stringp (str) (let ((match-str)) (if (string-match "[-+]?[0-9]+\\(\\.[0-9]*\\)?" str) (progn (setq match-str (substring str (match-beginning 0) (match-end 0))) (string= match-str str)) nil))) (float-stringp "123") => t (float-stringp "-123") => t (float-stringp "+123") => t (float-stringp "+123.0") => t (float-stringp "123.") => t (float-stringp "123.2") => t (float-stringp "abc") => nil (float-stringp "12abc") => nil (float-stringp "123 ") => nil 上記仕様は、空白類の扱いが ruby とは違う !2005-03-21 Mon RRB 027 正規表現が文字列の先頭・末尾にマッチするか調べる ^ と \A は違うんじゃいとのことだが、良く分からないので、^ を使っておく (string-match "^a" "aiueo") => 0 (string-match "^o" "aiueo") => nil (string-match "^あ" "あいうえお") => 0 (string-match "..$" "abc\ndef\nghi\n") => 1 (substring "abc\ndef\nghi\n" (match-beginning 0) (match-end 0)) => "bc" \Z, \z に相当するものもないんじゃないか? ; /..\Z/ 相当? ; RRB 042 で作った string-match-all-string を使って、 (string-match-all-string "abc\ndef\nghi\n" "..$") => ("bc" "ef" "hi") (setq x (string-match-all-string "abc\ndef\nghi\n" "..$")) => ("bc" "ef" "hi") (nth (- (length x) 1) x) => "hi" ; /..\z/ 相当? (string-rindex "abc\ndef\nghi\n" "..") => 9 (substring "abc\ndef\nghi\n" 9) => "hi " (string-rindex "abc\ndef\nghi\n" "\\(.\\|\n\\)\\(.\\|\n\\)") => 10 (substring "abc\ndef\nghi\n" 10) => "i " !2005-03-20 Sun RRB 068 文字列の一部を特定の文字で埋める ; RRB 052 の string-gsub-proc を変形して使う ; RRB 024 の string-times も使う (defun string-gsub-proc2 (str regex proc) (if (string-match regex str) (concat (substring str 0 (match-beginning 0)) (funcall proc (substring str (match-beginning 1) (match-end 1)) (substring str (match-beginning 2) (match-end 2))) (string-gsub-proc2 (substring str (match-end 0)) regex proc)) str)) (defun hide-password (str) (string-gsub-proc2 str "\\(Password:\\)\\(.*\\)" (lambda (x y) (concat x (string-times "*" (length y)))))) (hide-password "Password:foo") => "Password:***" (hide-password "Password:foo\nPassword:bar") => "Password:*** Password:***" !2005-03-19 Sat RRB 070 文字列が正規表現として正しいか調べる (defun valid-regexp (regex) (condition-case nil (string-match regex "") (error 'regex-error))) (valid-regexp "\\s+") => nil (valid-regexp "\\s") => regex-error (valid-regexp "[]") => regex-error !2005-03-18 Fri RRB 056 文字列の先頭・末尾から空白を取り除く ; 文字列先頭・末尾の空白類文字を取り除く ; RRB 055 の string-rstrip と下の string-lstrip を使って (defun string-strip (str) (string-rstrip (string-lstrip str))) (string-strip "\t キュッと \r\n") => "キュッと" (defun string-lstrip (str) (if (string-match "^\\s *" str) (substring str (match-end 0)) str)) (string-lstrip "\t キュッと \r\n") => "キュッと " string-rstrip は RRB 055 で既出 ; 文字列先頭・末尾の全角空白文字を取り除く (defun string-jlstrip (str) (if (string-match "^\\(\\s \\| \\)*" str) (substring str (match-end 0)) str)) (defun string-jrstrip (str) (if (string-match "\\(\\s \\| \\|\r\\|\n\\)*$" str) (substring str 0 (match-beginning 0)) str)) (defun string-jstrip (str) (string-jrstrip (string-jlstrip str))) (string-jlstrip "\t キュッと\r \n") => "キュッと  " (string-jrstrip "\t キュッと\r \n") => "  キュッと" (string-jstrip "\t キュッと\r \n") => "キュッと" !2005-03-17 Thu RRB 047 文字列を単語に分ける (split-string " 111\t222\n333 " "[ \t\n]") => ("" "" "111" "222" "333") (split-string " 111\t222\n333 ") => ("111" "222" "333") (split-string "def foo(n) n * 3 end") => ("def" "foo(n)" "n" "*" "3" "end") ; RRB 028 で定義した string-scan を使用 (string-scan "def foo(n) n * 3 end" "\\w+") => ("def" "foo" "n" "n" "3" "end") (string-scan "def foo(n) n * 3 end" "\\(\\w+\\|[^\\s \\w]\\)") => ("def" "foo" "(" "n" ")" "n" "*" "3" "end") ; グルーピングは (?: ) 相当の動きになる (string-scan "abc aBC abc" "a\\(bc\\|BC\\)") => ("abc" "aBC" "abc") ; 単語の種類などを調べて分ける (defun string-scanner (str n len regex) (let ((case-fold-search nil)) (if (>= n len) nil (if (and (string-match regex str n) (= (match-beginning 0) n)) (cons (match-end 0) (substring str (match-beginning 0) (match-end 0))) nil)))) (setq s "def foo(n) n * 3 end") (setq pos 0) (setq len (length s)) (while (< pos len) (cond ((setq cons (string-scanner s pos len "\\w+")) (insert (message ":WORD %s\n" (cdr cons))) (setq pos (car cons))) ((setq cons (string-scanner s pos len "\\s +")) (setq pos (car cons))) (t (insert (message ":CHAR %s\n" (substring s pos (1+ pos)))) (setq pos (1+ pos))))) -| :WORD def -| :WORD foo -| :CHAR ( -| :WORD n -| :CHAR ) -| :WORD n -| :CHAR * -| :WORD 3 -| :WORD end => nil !2005-03-16 Wed RRB 045 文字列を段落に分ける ; 日本語ルール (split-string "ああ\nいい\nうう\n" "\n") ("ああ" "いい" "うう") ; 英語ルール (split-string "This is a pen.\nThat is a pen.\n\nIt is a pen, too.\n" "\n\n") => ("This is a pen. That is a pen." "It is a pen, too. ") (split-string "This is a pen.\nThat is a pen.\n \nIt is a pen, too.\n" "\n[ \t\r\f]*\n") => ("This is a pen. That is a pen." "It is a pen, too. ") !2005-03-15 Tue RRB 040 文字を大文字・小文字に変換する (upcase "aBcDeFg-->") => "ABCDEFG-->" (downcase "aBcDeFg-->") =>"abcdefg-->" ; RRB 052 の string-gsub を使うと、 (defun string-tr (str search replace) (let ((s-ary (split-string search "")) (r-ary (split-string replace ""))) (defun string-tr-ary (str s-ary r-ary) (if (null s-ary) str (string-tr-ary (string-sub str (car s-ary) (car r-ary)) (cdr s-ary) (cdr r-ary)))) (string-tr-ary str s-ary r-ary))) (string-tr "abcdefghijklmnopqrstuvwxyz" "aiueo" "AIUEO") => "AbcdEfghIjklmnOpqrstUvwxyz" (string-tr "abcdefghijklmnopqrstuvwxyz.+?*" ".+?*" "ABCD") => "Abcdefghijklmnopqrstuvwxyz.BCD" * 範囲の "-" とか ^ とかは未対応 * search と replace の長さも同じじゃなきゃダメ * search と replace に同じ要素があるとダメ… * search に正規表現が来た場合の挙動が変か… こう↓してみた(効率悪そう…)。 (defun string-tr (str search replace) (defun string-tr-char (char replace-alist) (let ((ch (assoc char replace-alist))) (if ch (cdr ch) char))) (defun string-tr-ary (str-ary replace-alist) (if (null str-ary) "" (concat (string-tr-char (car str-ary) replace-alist) (string-tr-ary (cdr str-ary) replace-alist)))) (defun string-tr-make-alist (ary1 ary2) (if (null ary1) nil (cons (cons (car ary1) (car ary2)) (string-tr-make-alist (cdr ary1) (cdr ary2))))) (let* ((str-ary (split-string str "")) (s-ary (split-string search "")) (r-ary (split-string replace "")) (replace-alist (string-tr-make-alist s-ary r-ary))) (string-tr-ary str-ary replace-alist))) (string-tr "abABcC" "abAB" "ABab") => "ABabcC" ; 先頭文字だけを大文字・小文字に変換する (capitalize "this is a pen") => "This Is A Pen" (defun canonical_header_name (str) (defun list-map (ary proc) (if (null ary) nil (cons (funcall proc (car ary)) (list-map (cdr ary) proc)))) (mapconcat (lambda (x) x) (list-map (split-string str "-") (lambda (x) (capitalize x))) "-")) (canonical_header_name "content-type") => "Content-Type" (canonical_header_name "Content-Type") => "Content-Type" (canonical_header_name "coNTEnt-tyPE") => "Content-Type" ; 大文字と小文字を入れ替える ; 2番目の string-tr を使って (defun string-swapcase (str) (string-tr str "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")) (string-swapcase "aBcDeFg-->") => "AbCdEfG-->" ; 全角文字の大文字小文字を変換する ; RRB 052 の string-gsub-proc を使って (string-gsub-proc "abcdefghi" "[aiueo]" (lambda (x) (let ((ch (assoc x '(("a" . "A") ("i" . "I") ("u" . "U") ("e" . "E") ("o" . "O"))))) (if ch (cdr ch) "")))) => "AbcdEfghI" !2005-03-14 Mon RRB 071 正規表現のメタ文字をエスケープする 当然挙動は違うけど、regexp-quote が相当するかな (regexp-quote "*.txt") => "\\*\\.txt" (regexp-quote "what?") => "what\\?" (regexp-quote "[a-z]") => "\\[a-z\\]" (regexp-quote "{a,b}") => "{a,b}" (regexp-quote "..") => "\\.\\." (string-match "\\.\\." "..") => 0 (string-match "\\.\\." "xx") => nil !2005-03-13 Sun RRB 055 行末の改行文字を取り除く ; 行末の改行文字を取り除く ; RRB 054 の string-chomp を使うと (string-chomp "line\n") => "line" (string-chomp "line\r\n") => "line" (string-chomp "line\r") => "line" (string-chomp "line\t \n") => "line " (string-chomp "line") => "line" ; 行末の改行と空白類文字を取り除く (defun string-rstrip (str) (if (string-match "\\(\\s \\|\r\\|\n\\)*$" str) (substring str 0 (match-beginning 0)) str)) (string-rstrip "line\n") => "line" (string-rstrip "line\r\n") => "line" (string-rstrip "line\r") => "line" (string-rstrip "line\t \n") => "line" (string-rstrip "line") => "line" !2005-03-12 Sat RRB 033 文字の出現頻度を調べる (defun char-stat (str) (defun char-list-stat (char-list stat) (let (c cons-cell) (if (null char-list) stat (setq c (car char-list)) (setq cons-cell (assoc c stat)) (if cons-cell (setcdr cons-cell (1+ (cdr cons-cell))) (setq stat (append stat (list (cons c 1))))) (char-list-stat (cdr char-list) stat)))) (sort (char-list-stat (split-string str "") ()) (lambda (x y) (> (cdr x) (cdr y))))) (char-stat "3.14159265357919") => (("1" . 3) ("5" . 3) ("9" . 3) ("3" . 2) ("." . 1) ("4" . 1) ("2" . 1) ("6" . 1) ("7" . 1)) (list-each (char-stat "3.14159265357919") (lambda (x) (insert (format "%s: %d\n" (car x) (cdr x))))) -| 1: 3 -| 5: 3 -| 9: 3 -| 3: 2 -| .: 1 -| 4: 1 -| 2: 1 -| 6: 1 -| 7: 1 => nil ; 割合 (setq str "3.14159265357919") (list-each (char-stat str) (lambda (x) (insert (format "%s: %f\n" (car x) (/ (float (cdr x)) (length str)))))) -| 1: 0.187500 -| 5: 0.187500 -| 9: 0.187500 -| 3: 0.125000 -| .: 0.062500 -| 4: 0.062500 -| 2: 0.062500 -| 6: 0.062500 -| 7: 0.062500 => nil !2005-03-11 Fri RRB 031 前回マッチした部分の続きからマッチさせる (setq str "abc def ghi jkl") => "abc def ghi jkl" (string-match "\\w+" str) => 0 (string-match "\\w+" str) (substring str (match-beginning 0) (match-end 0)) => "abc" (string-match "\\w+" str (match-end 0)) => 4 (substring str (match-beginning 0) (match-end 0)) => "def" ; RRB 028 で定義した string-scan を使用すると、 (string-scan "abc def ghi jkl" "\\w+") => ("abc" "def" "ghi" "jkl") ; RRB 028 で定義した string-scan を使用すると、 (string-scan "abc def ghi jkl" "\\(\\w+\\|\\W+\\)") => ("abc" " " "def" " " "ghi" " " "jkl") !2005-03-10 Thu RRB 042 正規表現にマッチした部分を取り出す ; 最初にマッチした部分を取り出す (defun string-match-string (str regex) (if (string-match regex str) (substring str (match-beginning 0) (match-end 0)))) (string-match-string "xxxabcfffpat" "a..") => "abc" (string-match-string "xxx" "a..") => nil (funcall (lambda (str regex) (if (string-match regex str) (substring str (match-beginning 0) (match-end 0)))) "xxxabcfffpat" "a..") => "abc" ; マッチした部分を全て取り出す (defun string-match-all-string (str regex) (let ((pos 0) (ret ()) match-str) (while (setq pos (string-match regex str pos)) (setq match-str (substring str (match-beginning 0) (match-end 0))) (setq pos (1+ (match-end 0))) (setq ret (append ret (list match-str)))) ret)) (string-match-all-string "static int fact(int n){...}" "[a-z]+") => ("static" "int" "fact" "int" "n") ; RRB 028 で定義した string-scan を使用すると、 (string-scan "static int fact(int n){...}" "\\w+") => ("static" "int" "fact" "int" "n") ; 正規表現の () にマッチした部分を取り出す (defun string-slice (str regex n) (if (string-match regex str) (if (>= n (/ (length (match-data)) 2)) nil (substring str (match-beginning n) (match-end n))) nil)) (string-slice " def print(str)" "\\s *def\\s +\\([^ (]+\\)" 1) => "print" (string-slice " def print(str)" "\\s *def\\s +\\([^ (]+\\)" 2) => nil (defun string-match-captures (str regex) (defun string-match-captures-iter (str ary) (if (null ary) nil (cons (substring str (car ary) (cadr ary)) (string-match-captures-iter str (cddr ary))))) (if (string-match regex str) (string-match-captures-iter str (cddr (match-data))) nil)) (string-match-captures "xxxabcfffpatxxx" "\\(abc\\)\\(f+\\)\\([a-z][a-z][a-z]\\)") => ("abc" "fff" "pat") (setq m (string-match-captures "xxxabcfffpatxxx" "\\(abc\\)\\(f+\\)\\([a-z][a-z][a-z]\\)")) => ("abc" "fff" "pat") (nth 0 m) => "abc" (nth 1 m) => "fff" (nth 2 m) => "pat" !2005-03-09 Wed RRB 036 文字列が空行か調べる 単純に「^$」だと Ruby と挙動が違うみたい (string-match "^$" "a\n") => 2 (string-match "^$" "\n") => 0 (string-match "^$" "a") => nil (string-match "^$" "") => 0 (string-match "^$" "\t\n") => 2 (string-match "^$" "aaa\n\nbbb") => 4 こんな感じか? * もっと、すっきりしたい("" 削除、 "\n" -> "\n*" で OK?) * \r は? (defun string-empty-linep (str) (if (string= "" str) 0 (if (string-match "[^\n]" str) (if (string-match "\n\n" str) (1+ (string-match "\n\n" str)) nil) (string-match "\n" str)))) (string-empty-linep "a\n") => nil (string-empty-linep "\n") => 0 (string-empty-linep "a") => nil (string-empty-linep "") => 0 (string-empty-linep "\t\n") => nil (string-empty-linep "aaa\n\nbbb") => 4 (string-empty-linep " ") => nil 空白などが入っていても空行とみなすには、 (defun string-empty-linep (str) (if (string-match "[^\f\t\n\r ]" str) (if (string-match "\n[\f\t\n\r ]*\n" str) (1+ (match-beginning 0)) nil) (if (string-match "[\f\t\n\r ]*\n*" str) (string-match "[\f\t\n\r ]*\n*" str) nil))) (string-empty-linep "a\n") => nil (string-empty-linep "\n") => 0 (string-empty-linep "a") => nil (string-empty-linep "") => 0 (string-empty-linep "\t\n") => 0 (string-empty-linep "aaa\n\nbbb") => 4 (string-empty-linep " ") => 0 ; RRB 052 の string-gsub を使うと、 (string-empty-linep (string-gsub "a\n" "[\f\t ]" "")) => nil (string-empty-linep (string-gsub "\n" "[\f\t ]" "")) => 0 (string-empty-linep (string-gsub "a" "[\f\t ]" "")) => nil (string-empty-linep (string-gsub "" "[\f\t ]" "")) => 0 (string-empty-linep (string-gsub "\t\n" "[\f\t ]" "")) => 0 (string-empty-linep (string-gsub "aaa\n\nbbb" "[\f\t ]" "")) => 4 (string-empty-linep (string-gsub " " "[\f\t ]" "")) => 0 RRB の line.strip.empty? だと "aaa\n\n" が false になるよな !2005-03-08 Tue RRB 066 文字列を最大n文字に切り詰める (defun string-take-nchars (str n) (if (< n (length str)) (substring str 0 n) str)) (string-take-nchars "abcdefgh" 5) => "abcde" (string-take-nchars "あいうえおかき" 5) => "あいうえお" (string-take-nchars "abc" 5) => "abc" (string-take-nchars "ab\n\ncde" 5) => "ab c" (string-take-nchars "" 5) => "" !2005-03-07 Mon RRB 064 文字列をn文字ずつに分割する (defun string-split-nchars (str n) (let ((pos 0) (len (length str))) (if (>= (+ pos n) len) (list (substring str pos)) (cons (substring str pos (+ pos n)) (string-split-nchars (substring str (+ pos n)) n))))) (string-split-nchars "123456789" 4) => ("1234" "5678" "9") (string-split-nchars "あいうえおかきく" 4) => ("あいうえ" "おかきく") (string-split-nchars "あいうえかきくけ" 4) => ("あいうえ" "かきくけ") (string-split-nchars "あいうえか" 4) => ("あいうえ" "か") (string-split-nchars "あいう" 4) => ("あいう") * 効率悪そう… * n に 0 は指定しちゃダメ!(チェックしろよー) (defun string-split-nchars (str n) (if (<= n 0) str (let ((pos 0) (len (length str)) (ret ())) (while (< pos len) (if (>= (+ pos n) len) (setq ret (append ret (list (substring str pos)))) (setq ret (append ret (list (substring str pos (+ pos n)))))) (setq pos (+ pos n))) ret))) どっちもどっち? これでどうだ! (defun string-split-nchars (str n) (defun iter (str n pos len) (if (< pos len) (if (< (+ pos n) len) (cons (substring str pos (+ pos n)) (iter str n (+ pos n) len)) (list (substring str pos))) nil)) (if (<= n 0) str (iter str n 0 (length str)))) !2005-03-06 Sun RRB 051 文字列を連結する (concat "いやよいや" "よもすきのうち") => "いやよいやよもすきのうち" (concat "long long long long long long long long long string 1" "long long long long long long long long long string 2" "long long long long long long long long long string 3") => "long long long long long long long long long string 1long long long long long long long long long string 2long long long long long long long long long string 3" !2005-03-05 Sat RRB 049 文字列を文字ごとに処理する ; 分割 (split-string "あいうえお" "") => ("あ" "い" "う" "え" "お") (defun string-each-char (str proc) (defun list-each (ary proc) (if (null ary) nil (funcall proc (car ary)) (list-each (cdr ary) proc))) (list-each (split-string str "") proc)) (string-each-char "あいうえお" (lambda (x) (insert (format "%s\n" x)))) -| あ -| い -| う -| え -| お => nil !2005-03-04 Fri RRB 044 特定の文字を含む部分の長さを調べる ; RRB 028 で定義した string-scan を使用 (defun matching-length (str regex) (defun matching-length-iter (ary) (if (null ary) 0 (+ (length (car ary)) (matching-length-iter (cdr ary))))) (matching-length-iter (string-scan str regex))) (matching-length "abc d eee ff\n" "\\(\\s \\|\n\\|\r\\)") => 4 (matching-length "" "\\(\\s \\|\n\\|\r\\)") => 0 (matching-length " \n" "\\(\\s \\|\n\\|\r\\)") => 13 (matching-length "すももももももももものうち" "も+") => 9 (defun unmatching-length (str regex) (- (length str) (matching-length str regex))) (unmatching-length "abc d eee ff\n" "\\(\\s \\|\n\\|\r\\)") => 9 (unmatching-length "" "\\(\\s \\|\n\\|\r\\)") => 0 (unmatching-length " \n" "\\(\\s \\|\n\\|\r\\)") => 0 !2005-03-03 Thu RRB 048 正規表現で文字列を分割する (split-string "2003,11,21,大根,150円" ",") => ("2003" "11" "21" "大根" "150円") ; 最大いくつに区切るかの指定 (defun string-split (str regex &optional limit-num) (defun iter (split-list n limit-num) (if (null (cdr split-list)) split-list (if (< n (- limit-num 1)) (cons (car split-list) (iter (cdr split-list) (+ n 1) limit-num)) (cons (mapconcat (lambda (x) x) split-list ",") nil)))) (let ((split-list (split-string str regex))) (if (null limit-num) (split-string str regex) (iter split-list 0 limit-num)))) (string-split "2003,11,21,大根,150円" "," 3) => ("2003" "11" "21,大根,150円") (string-split "2003,11,21,大根,150円" ",") => ("2003" "11" "21" "大根" "150円") もっと簡単にならんのか? !2005-03-02 Wed RRB 046 文字列を行に分ける (split-string "aaa\nbbb\nccc\n" "\n") => ("aaa" "bbb" "ccc") (split-string "aaa\nbbb\nccc\n") => ("aaa" "bbb" "ccc") "\n" がなくなっちゃうな。 あと、空行も無視されてしまう。 ; RRB 028 で定義した string-scan を使用 (string-scan "aaa\nbbb\nccc\n\nfoo" "[^\n]*\\(\n\\|\\>\\)") => ("aaa " "bbb " "ccc " " " "foo") (string-scan "aaa\nbbb\nccc\n\nfoo" "[^\n]*\\(\n\\|$\\)") => ("aaa " "bbb " "ccc " " " "foo") こんな感じ? (defun string-split-line (str) (string-scan str "[^\n]*\\(\n\\|$\\)")) ; 行ごとに繰り返し処理を行う (defun string-each (str proc) (defun list-each (ary proc) (if (null ary) nil (funcall proc (car ary)) (list-each (cdr ary) proc))) (list-each (string-split-line str) proc)) (string-each "aaa\nbbb\nccc\n" (lambda (x) (insert (format "%s" x)))) -| aaa -| bbb -| ccc => nil (defun string-collect (str proc) (defun list-map (ary proc) (if (null ary) nil (cons (funcall proc (car ary)) (list-map (cdr ary) proc)))) (list-map (string-split-line str) proc)) (string-collect "aaa\nbbb\nccc\n" 'upcase) => ("AAA " "BBB " "CCC ") (defun string-select (str proc) (defun list-find-all (ary proc) (if (null ary) nil (if (funcall proc (car ary)) (cons (car ary) (list-find-all (cdr ary) proc)) (list-find-all (cdr ary) proc)))) (list-find-all (string-split-line str) proc)) (string-select "aaa\nbbb\nccc\nDa-\nDaDa-n\n" (lambda (x) (if (string-match "^D" x) x))) => ("Da- " "DaDa-n ") !2005-03-01 Tue RRB 043 正規表現にマッチした部分の前後の文字列を取り出す ; マッチしたところの前を取り出す (defun string-pre-match (str regex) (if (string-match regex str) (substring str 0 (match-beginning 0)))) (string-pre-match "この先生きのこるには" "生きのこる") => "この先" ; マッチしたところの後ろを取り出す (defun string-post-match (str regex) (if (string-match regex str) (substring str (match-end 0)))) (string-post-match "この先生きのこるには" "生きのこる") => "には" !2005-02-28 Mon RRB 039 文字が大文字か小文字かを調べる (defun lowerp (str) (let ((case-fold-search nil)) (not (null (string-match "[a-z]" str))))) (defun upperp (str) (let ((case-fold-search nil)) (not (null (string-match "[A-Z]" str))))) (lowerp "a") => t (lowerp "B") => nil (upperp "B") => t (upperp "a") => nil 何の目的で使用するのか主旨を理解していないので、 はじめに載っていたコードと等価なものに変換 !2005-02-27 Sun RRB 038 文字列を数値に変換する (string-to-number "1") => 1 (string-to-number "1.2") => 1.2 (string-to-number "a") => 0 (string-to-int "1") => 1 (string-to-int "1.2") => 1.2 (string-to-int "a") => 0 (string-to-number "10" 16) => 16 (string-to-number "ff" 16) => 255 (string-to-number "FF" 16) => 255 (string-to-number "0xCAFEBABE" 16) => 0 ? (string-to-number "CAFEBABE" 16) => -83969346 ? (string-to-number "10" 8) => 8 (string-to-number "01" 8) => 1 (string-to-number "177ELF" 8) => 127 (string-to-number "10101010101010" 2) => 10922 !2005-02-26 Sat RRB 035 空白にマッチさせる (string-match " " "a a") => 1 (string-match "\\s " "a a") => 1 (string-match "\\s " "\t") => 0 (string-match "\\s " "\n") => nil (string-match "\\s " "\r") => nil (string-match "\\s " "\f") => 0 (string-match "\\s-" "a a") => 1 (string-match "\\s-" "\t") => 0 (string-match "\\s-" "\n") => nil (string-match "\\s-" "\r") => nil (string-match "\\s-" "\f") => 0 ; Ruby の \s と同じようにするには、 (string-match "\\(\\s \\|\n\\|\r\\)" "a a") => 1 (string-match "\\(\\s \\|\n\\|\r\\)" "\t") => 0 (string-match "\\(\\s \\|\n\\|\r\\)" "\n") => 0 (string-match "\\(\\s \\|\n\\|\r\\)" "\r") => 0 (string-match "\\(\\s \\|\n\\|\r\\)" "\f") => 0 !2005-02-25 Fri RRB 034 文字列を比較する (string= "蛙の子" "蛙の子") => t (string= "蛙の子" "蛙") => nil (string= (downcase "Content") (downcase "CONTENT")) => t (string< "abc" "xyz") => t (string> "abc" "xyz") error--> Symbol's function definition is void: string> (string< "1.8.0" "1.8.1") => t (string< "1.8.0" "1.8.0") => nil (setq version "1.8.0") => "1.8.0" (or (string= "1.8.0" version) (string< "1.8.0" version)) => t (setq version "1.8.2") => "1.8.2" (or (string= "1.8.0" version) (string< "1.8.0" version)) => t (setq version "1.6.8") => "1.6.8" (or (string= "1.8.0" version) (string< "1.8.0" version)) => nil !2005-02-24 Thu RRB 026 文字列を検索する ; パタンが含まれるかどうかを調べる (string-match "[\t ]" "a c") => 1 (string-match "[\t ]" "abc") => nil ; パタンが最初に出現するバイト位置を調べる(バイト位置ではない) (string-match "abc" "xxxabcabcabcxxx") => 3 (string-match "." "xxxabcabcabcxxx") => 0 (string-match "\\." "xxxabcabcabcxxx") => nil (string-match "\\." "xxx.........xxx") => 3 ; パタンが最後に出現するバイト位置を調べる(バイト位置ではない) (defun string-rindex (str regex) (let ((i (- (length str) 1))) (if (catch 'found (while (>= i 0) (if (string-match regex str i) (throw 'found t) (setq i (- i 1))))) (match-beginning 0) nil))) (string-rindex "xxxabcabcabcxxx" "abc") => 9 (string-rindex "xxxabcabcabcxxx" ".") => 14 (string-rindex "xxxabcabcabcxxx" "\\.") => nil (string-rindex "xxx.........xxx" "\\.") => 11 ; マッチの詳しい情報を得る (string-match "abc" "xxxabcabcabcxxx") => 3 (match-beginning 0) => 3 (match-end 0) => 6 (substring "xxxabcabcabcxxx" (match-beginning 0) (match-end 0)) => "abc" (substring "xxxabcabcabcxxx" (match-end 0)) => "abcabcxxx" ; 文字列中に複数マッチする (defun list-each (ary proc) (if (null ary) nil (funcall proc (car ary)) (list-each (cdr ary) proc))) ; RRB 028 で定義した string-scan を使用 (list-each (string-scan "あ\n aadかきe\ne さ0\n0aた\n iiな\n" "[あ-ん]+") (lambda (x) (insert (format "%s\n" x)))) -| あ -| かき -| さ -| た -| な ; パターンを含む行のみを処理する (defun list-grep-string (ary regex) (if (null ary) nil (if (string-match regex (car ary)) (cons (car ary) (list-grep-string (cdr ary) regex)) (list-grep-string (cdr ary) regex)))) (list-each (list-grep-string (split-string "あ\n aadかきe\ne さ0\n0aた\n iiな\n" "\n") "[あた]") (lambda (x) (insert (format "%s\n" x)))) -| あ -| 0aた !2005-02-23 Wed RRB 032 特定の文字・文字列の出現回数を調べる 関数あるのかな? (defun string-count (str regex) (let ((pos 0) (num 0) (len (length str))) (while (and (< pos len) (string-match regex str pos)) (setq pos (match-end 0)) (setq num (1+ num))) num)) ; 別解 (defun string-count (str regex) (defun iter (str regex pos len num) (if (and (< pos len) (string-match regex str pos)) (iter str regex (match-end 0) len (1+ num)) num)) (iter str regex 0 (length str) 0)) ; 文字の数を調べる (string-count "a\nb\nccc\nd\n" "\n") => 4 ; マルチバイトも大丈夫 (string-count "あああいいううええお" "[いう]") => 4 ; 文字列のカウント (string-count "あああいいううええお" "うえ") => 1 !2005-02-22 Tue RRB 028 単語にマッチさせる ; 単語を含むかどうか調べる (string-match "\\bspec\\b" "Ruby spec") => 5 (string-match "\\bspec\\b" "Ruby specification") => nil (string-match "あいう\\b" "あいうabc") => 0 (string-match "あいう\\b" "あいうえabc") => nil ; 単語にマッチさせる (defun string-scan (str regex) (if (string-match regex str) (cons (substring str (match-beginning 0) (match-end 0)) (string-scan (substring str (match-end 0)) regex)) nil)) 次の方が(効率が)良いか? (defun string-scan (str regex) (defun iter (str regex len pos) (if (< pos len) (if (string-match regex str pos) (cons (substring str (match-beginning 0) (match-end 0)) (iter str regex len (match-end 0))) nil) nil)) (iter str regex (length str) 0)) ; (1) に相当? (string-scan "This is\ta 2pen." "\\w+") => ("This" "is" "a" "2pen") ; (2) に相当? (string-scan "This is\ta 2pen." "[a-z]+") => ("This" "is" "a" "pen") ; (3) に相当? (split-string "This is\ta 2pen.") => ("This" "is" "a" "2pen.") !2005-02-21 Mon RRB 030 正規表現「.」に\nをマッチさせる (string-match "\\([\n]\\|.\\)" "\n") => 0 (string-match "." "\n") => nil !2005-02-20 Sun RRB 025 文字列の長さを得る ; バイト数 ; 文字数 (length "This is a string") => 16 (length "あかさたな") => 5 バイト数の方は、不明 !2005-02-19 Sat RRB 024 文字列を反復する (defun string-times (str n) (if (> n 0) (concat str (string-times str (- n 1))) "")) (string-times "foo" 5) => "foofoofoofoofoo" (string-times "foo" 0) => "" (string-times "鬱" 3) => "鬱鬱鬱" !2005-02-18 Fri RRB 023 文字列を複製する (setq str "This is a string") => "This is a string" (setq str2 (format "%s" str)) => "This is a string" (store-substring str 0 "t") => "this is a string" str => "this is a string" str2 => "This is a string" うーん、本当かい こうか? (setq str "This is a string") => "This is a string" (setq str2 (substring str 0)) => "This is a string" (store-substring str 0 "t") => "this is a string" str => "this is a string" str2 => "This is a string" うーん !2005-02-17 Thu after-load-alist => (("foo.el" "loading foo") ("foo" "loading foo") ("ffap" ... ("mew" (require (quote mew-nmz)))) !2005-02-16 Wed loadhist-special-hooks とばし (eval-after-load "foo.el" (message "loading foo")) => "loading foo" (load-file "foo.el") => t (eval-after-load "foo.el" (message "loading foo")) !2005-02-15 Tue load-history => (("loadhist" feature-symbols ...) !2005-02-14 Mon (provide 'foo) => foo (featurep 'foo) => t (unload-feature 'foo) => (("loadhist" ...)) (featurep 'foo) => t (unload-feature 'foo t) => (("loadhist" ...)) (featurep 'foo) => t ? !2005-02-13 Sun (featurep 'foo) => t (featurep 'bar) => nil !2005-02-12 Sat features => (info view ... x-toolkit) (provide 'foo) => foo features => (foo info view ... x-toolkit) !2005-02-11 Fri `provide' と `require' `autoload'の代替手段 <- ? 初期化とかのときにロードしておくか?本当に必要なときにロードするかの違い??? !2005-02-10 Thu ロードの繰り返し * 再ロードで何度もデータが登録されないように * add-to-list * すでにロードしたか調べる方法 !2005-02-09 Wed autoload 自体はいいや。 『マジック』コメントなぞというのがあるらしい。ふむふむ。 !2005-02-08 Tue EMACSLOADPATH なんてのは気がつかなかったな。 (locate-library "mew.el") => "/home/ ... /share/emacs/site-lisp/Mew-1.94.2/mew.el" !2005-02-07 Mon load-path => ("~/share/emacs/site-lisp" ... "/usr/local/share/emacs/20.7/lisp/calendar") !2005-02-06 Sun load-read-function => nil !2005-02-05 Sat load-in-progress => nil どうやって使うんだろう? !2005-02-04 Fri load とばし。 load-file は、 `load-path'を使わず, 接尾辞も付加しない だとさ。 !2005-02-03 Thu あー、理解してねー。まんま (defmacro foo (a) (list 'setq (eval a) t)) => foo (setq x 'b) => b (foo x) => t (setq a 'c) => c (foo a) => t a => t b => t c error--> Symbol's value as variable is void: c !2005-02-02 Wed あー、理解してねー。まんま ダメなやつ (defmacro for (var from init to final do &rest body) "Execute a simple for loop: (for i from 1 to 10 do (print i))." `(let ((,var ,init) (max ,final)) (while (<= ,var max) ,@body (inc ,var)))) => for (for i from 1 to 3 do (setq square (* i i)) (princ (format "\n%d %d" i square))) 1 1 2 4 3 9nil (let ((max 0)) (for x from 0 to 10 do (let ((this (frob x))) (if (< max this) (setq max this))))) error--> Symbol's function definition is void: frob 良いやつ (defmacro for (var from init to final do &rest body) "Execute a simple for loop: (for i from 1 to 10 do (print i))." (let ((tempvar (make-symbol "max"))) `(let ((,var ,init) (,tempvar ,final)) (while (<= ,var ,tempvar) ,@body (inc ,var))))) => for (for i from 1 to 3 do (setq square (* i i)) (princ (format "\n%d %d" i square))) 1 1 2 4 3 9nil defmacro ってちゃんと上書きされている? !2005-02-01 Tue あー、理解してねー。まんま (defmacro inc (var) (list 'setq var (list '1+ var))) => inc (let ((i 1) (max 3)) (while (<= i max) (setq square (* i i)) (princ (format "%d %d" i square)) (inc i))) => 1 12 43 9nil (defmacro for (var from init to final do &rest body) "Execute a simple for loop: (for i from 1 to 10 do (print i))." `(let ((,var ,init) (max ,final)) (while (<= ,var max) ,@body (inc ,var)))) => for (for i from 1 to 3 do (setq square (* i i)) (princ (format "\n%d %d" i square))) 1 1 2 4 3 9nil !2005-01-31 Mon まんま (defmacro for (var from init to final do &rest body) "Execute a simple \"for\" loop. For example, (for i from 1 to 10 do (print i))." (list 'let (list (list var init)) (cons 'while (cons (list '<= var final) (append body (list (list 'inc var))))))) => for (defmacro inc (var) (list 'setq var (list '1+ var))) => inc (for i from 1 to 3 do (setq square (* i i)) (princ (format "\n%d %d" i square))) 1 1 2 4 3 9nil (defmacro for (var from init to final do &rest body) "Execute a simple \"for\" loop. For example, (for i from 1 to 10 do (print i))." `(let ((,var ,init)) (while (<= ,var ,final) ,@body (inc ,var)))) => for (for i from 1 to 3 do (setq square (* i i)) (princ (format "\n%d %d" i square))) 1 1 2 4 3 9nil !2005-01-30 Sun ほぼ、まんま (setq some-list '(2 3)) => (2 3) (cons 1 (append some-list '(4) some-list)) => (1 2 3 4 2 3) `(1 ,@some-list 4 ,@some-list) => (1 2 3 4 2 3) `(1 ,some-list 4 ,@some-list) => (1 (2 3) 4 2 3) (setq list '(hack foo bar)) => (hack foo bar) (cons 'use (cons 'the (cons 'words (append (cdr list) '(as elements))))) => (use the words foo bar as elements) `(use the words ,@(cdr list) as elements) => (use the words foo bar as elements) !2005-01-29 Sat ? (macro lambda ARGUMENT-LIST . BODY-FORMS) まんま `(a list of (+ 2 3) elements) => (a list of (+ 2 3) elements) '(a list of (+ 2 3) elements) => (a list of (+ 2 3) elements) (list 'a 'list 'of (+ 2 3) 'elements) => (a list of 5 elements) `(a list of ,(+ 2 3) elements) => (a list of 5 elements) (list 'a 'list 'of ,(+ 2 3) 'elements) error--> Symbol's value as variable is void: \, (defmacro t-becomes-nil (variable) `(if (eq ,variable t) (setq ,variable nil))) => t-becomes-nil (setq foo t) => t (t-becomes-nil foo) => nil (setq foo 1) => 1 (t-becomes-nil foo) => nil !2005-01-28 Fri まんま (defmacro inc (var) (list 'setq var (list '1+ var))) => inc (macroexpand '(inc r)) => (setq r (1+ r)) (defmacro inc2 (var1 var2) (list 'progn (list 'inc var1) (list 'inc var2))) => inc2 (macroexpand '(inc2 r s)) => (progn (inc r) (inc s)) !2005-01-27 Thu まんま (defmacro inc (var) (list 'setq var (list '1+ var))) => inc (setq x 1) => 1 (inc x) => 2 x => 2 !2005-01-26 Wed だいたい、まんま (defun add2 (x y) (+ x y)) => add2 (add2 1 2) => 3 (defun add2 (x y) (+ x y 1)) => add2 (add2 1 2) => 4 (defsubst add2 (x y) (+ x y)) => add2 (add2 1 2) => 3 (defsubst add2 (x y) (+ x y 1)) => add2 (add2 1 2) => 4 コンパイルしていなければ、動作は変わらないのかな? !2005-01-25 Tue まんま (fset 'xfirst 'car) => car (xfirst '(1 2 3)) => 1 (symbol-function 'xfirst) => car (symbol-function (symbol-function 'xfirst)) => # (fset 'kill-two-lines "\^u2\^k") => "2 " !2005-01-24 Mon まんま (defun foo (x) x) => foo (foo 1) => 1 (fmakunbound 'foo) => foo (foo 1) error--> Symbol's function definition is void: foo !2005-01-23 Sun (fboundp 'car) => t (fboundp 'foo) => nil !2005-01-22 Sat まんま (defun bar (n) (+ n 2)) => bar (symbol-function 'bar) => (lambda (n) (+ n 2)) (fset 'baz 'bar) => bar (symbol-function 'baz) => bar (symbol-function 'car) => # !2005-01-21 Fri #'(lambda (x) (* x x)) => (lambda (x) (* x x)) (#'(lambda (x) (* x x)) 2) error--> Invalid function: (function (lambda (x) (* x x))) (funcall (#'(lambda (x) (* x x)) 2)) error--> Invalid function: (function (lambda (x) (* x x))) (funcall #'(lambda (x) (* x x)) 2) => 4 !2005-01-20 Thu まんま (setq silly (append '(lambda (x)) (list (list '+ (* 3 4) 'x)))) => (lambda (x) (+ 12 x)) (funcall silly 1) => 13 !2005-01-19 Wed まんま (mapconcat 'symbol-name '(The cat in the hat) " ") => "The cat in the hat" (mapconcat (function (lambda (x) (format "%c" (1+ x)))) "HAL-8000" "") => "IBM.9111" !2005-01-18 Tue まんま (mapcar 'car '((a b) (c d) (e f))) => (a c e) (mapcar '1+ [1 2 3]) => (2 3 4) (mapcar 'char-to-string "abc") => ("a" "b" "c") !2005-01-17 Mon (ignore) => nil (ignore 1) => nil (ignore '(1 2 3)) => nil !2005-01-16 Sun (identity 1) => 1 (identity 'foo) => foo あれ?もしかして、join ってこれで良いか? (mapconcat 'identity '("a" "b" "c") ":") => "a:b:c" !2005-01-15 Sat まんま (setq f 'list) => list (apply f 'x 'y 'z) error--> Wrong type argument: listp, z (apply '+ 1 2 '(3 4)) => 10 (apply '+ '(1 2 3 4)) => 10 (apply 'append '((a b c) nil (x y z) nil)) => (a b c x y z) !2005-01-14 Fri defalias とばし。 まんま (setq f 'list) => list (funcall f 'x 'y 'z) => (x y z) (funcall f 'x 'y '(z)) => (x y (z)) (funcall 'and t nil) error--> Invalid function: # (apply 'and t nil) error--> Invalid function: # !2005-01-13 Thu まんま (defun foo () 5) => foo (foo) => 5 (defun bar (a &optional b &rest c) (list a b c)) => bar (bar 1 2 3 4 5) => (1 2 (3 4 5)) (bar 1) => (1 nil nil) (bar) error--> Wrong number of arguments: !2005-01-12 Wed まんま ((lambda (n) (1+ n)) 1) => 2 ((lambda (n &optional n1) (if n1 (+ n n1) (1+ n))) 1 2) => 3 ((lambda (n &rest ns) (+ n (apply '+ ns))) 1 2 3 4 5) => 15 !2005-01-11 Tue まんま (lambda (a b c) (+ a b c)) => (lambda (a b c) (+ a b c)) ((lambda (a b c) (+ a b c)) 1 2 3) => 6 ((lambda (a b c) (+ a b c)) 1 (* 2 3) (- 5 4)) => 8 !2005-01-10 Mon 最初、まんま (byte-code-function-p (symbol-function 'next-line)) => t (byte-code-function-p (symbol-function 'car)) => nil !2005-01-09 Sun 途中まで、まんま (subrp 'message) => nil (subrp (symbol-function 'message)) => t (subrp 'mew) => nil (subrp 't) => nil !2005-01-08 Sat (functionp 'car) => t (functionp t) => nil (functionp 'if) => t !2005-01-07 Fri setq-default の例、まだ、ちゃんと理解できず… まんま (set-default 'a 23) => 23 (default-value 'a) => 23 !2005-01-06 Thu (default-boundp 'foo) => nil (default-boundp 'tab-width) => t !2005-01-05 Wed kill-all-local-variables, change-major-mode-hook とばし (default-value 'tab-width) => 4 (symbol-value 'tab-width) => 4 !2005-01-04 Tue (make-local-variable 'x) => x (setq x 'foo) => foo x => foo (kill-local-variable 'x) => x x => Symbol's value as variable is void: x !2005-01-03 Mon (buffer-local-variables) => ... (foo . 6)) !2005-01-02 Sun (local-variable-p 'foo) => t (save-excursion (set-buffer "+inbox") (local-variable-p 'foo)) => nil !2005-01-01 Sat ほぼ、まんま (setq foo 5) => 5 (make-local-variable 'foo) => foo foo => 5 (setq foo 6) => 6 foo => 6 (save-excursion (set-buffer "+inbox") foo) => 5 make-local-variable, make-variable-buffer-local の違い?(ちゃんと読めよ!) !2004-12-31 Fri ほぼ、まんま (defun make-add (n) (function (lambda (m) (+ n m)))) => make-add (fset 'add2 (make-add 2)) => (lambda (m) (+ n m)) (add2 4) => Symbol's value as variable is void: n ((make-add 2) 4) => Invalid function: (make-add 2) !2004-12-30 Thu まんま (setq foo '(a b)) => (a b) (add-to-list 'foo 'c) => (c a b) (add-to-list 'foo 'b) => (c a b) はじめて知ったなこんなの !2004-12-29 Wed (setq x 10 y (1+ x) z) => nil z => nil !2004-12-28 Tue まんま (let ((abracadabra 'foo)) (symbol-value 'abracadabra)) => foo 前も説明なかった? !2004-12-27 Mon (user-variable-p 'max-specpdl-size) => t !2004-12-26 Sun まんま (defconst pi 3.1415 "Pi to five places.") => pi (setq pi 3) => 3 pi => 3 !2004-12-25 Sat まんま (boundp 'abracadabra) => nil (let ((abracadabra 5)) (boundp 'abracadabra)) => t (boundp 'abracadabra) => nil !2004-12-24 Fri まんま (makunbound 'x) => x x => Symbol's value as variable is void: x !2004-12-23 Thu max-specpdl-size => 600 !2004-12-22 Wed keyword-symbols-constant-flag => t !2004-12-21 Tue やっと復帰(2005-01-03 Mon) まんま nil => nil 'nil => nil (setq nil 500) => Attempt to set a constant symbol: nil !2004-12-20 Mon まんま (signal 'wrong-number-of-arguments '(x y)) => Wrong number of arguments: x, y (signal 'no-such-error '("My unknown error condition")) => peculiar error: "My unknown error condition" !2004-12-19 Sun まんま (error "That is an error -- try something else") error--> That is an error -- try something else (error "You have committed %d errors" 10) error--> You have committed 10 errors (error "%s%s") => Not enough arguments for format string (error "%s" "%s%s") => %s%s !2004-12-18 Sat ちょい改(付け加え) (defun foo (x y) (+ x y)) (defun search-foo () (catch 'loop (let ((i 0)) (while (< i 10) (let ((j 0)) (while (< j 10) (if (foo i j) (throw 'loop (list i j))) (setq j (1+ j)))) (setq i (1+ i)))))) (search-foo) => (0 0) (defun foo (x y) (cond ((= x 0) nil) (t t))) (search-foo) => (1 0) うまく改造できないな… !2004-12-17 Fri だいたい、まんま (defun foo-outer () (catch 'foo (foo-inner)) (insert " foo")) (defun foo-inner () (insert " bar") (if t (throw 'foo t)) (insert " baz")) (foo-outer) => bar foonil !2004-12-16 Thu or とばし まんま (setq num 0) => 0 (while (< num 4) (princ (format "Iteration %d." num)) (setq num (1+ num))) => Iteration 0.Iteration 1.Iteration 2.Iteration 3.nil !2004-12-15 Wed まんま (and (print 1) (print 2) nil (print 3)) 1 2 => nil !2004-12-14 Tue (not nil) => t (not t) => nil (not '()) => t (null nil) => t (null t) => nil !2004-12-13 Mon ちょい改 (let ((a 'foo)) (cond ((eq a 'hack) 'foo) (t "default"))) => "default" (let ((a 'hack)) (cond ((eq a 'hack) 'foo) (t "default"))) => foo !2004-12-12 Sun (unless nil 'foo 'bar) => bar !2004-12-11 Sat (when t 'foo 'bar 'baz) => baz (when t 'foo 'bar) => bar (when nil 'foo 'bar) => nil !2004-12-10 Fri まんま (if nil (print 'true) 'very-false) => very-false !2004-12-09 Thu まんま (prog2 (print "The first form") (print "The second form") (print "The third form")) "The first form" "The second form" "The third form" => "The second form" !2004-12-08 Wed まんま (prog1 (print "The first form") (print "The second form") (print "The third form")) "The first form" "The second form" "The third form" => "The first form" !2004-12-07 Tue まんま (progn (print "The first form") (print "The second form") (print "The third form")) "The first form" "The second form" "The third form" => "The third form" !2004-12-06 Mon (setq x 1) => 1 (list 'A (1+ 2) auto-save-default) => (A 3 t) values => nil ? !2004-12-05 Sun (message "foo") M-x eval-region => foo ちゃんとした例が… !2004-12-04 Sat まんま (setq foo 'bar) => bar (setq bar 'baz) => baz (eval 'foo) => bar (eval foo) => baz max-lisp-eval-depth => 300 !2004-12-03 Fri まんま(はぶいた) (quote (+ 1 2)) => (+ 1 2) '(quote foo) => (quote foo) ['foo] => [(quote foo)] ? "foo => (quote foo) ならない !2004-12-02 Thu (indirect-function 'car) => # (fset 'first 'car) => car (indirect-function 'first) => # !2004-12-01 Wed ほぼ、まんま (symbol-function 'car) => # (fset 'first 'car) => car (symbol-function 'first) => car (fset 'erste 'first) => first (symbol-function 'erste) => first (erste '(1 2 3)) => 1 !2004-11-30 Tue ほぼ、まんま (setq a 123) => 123 (eval 'a) => 123 a => 123 nil => nil t => t :foo => :foo !2004-11-29 Mon まんま '123 => 123 123 => 123 (eval '123) => 123 (eval (eval '123)) => 123 !2004-11-28 Sun まんま (setq my-plist '(bar t foo 4)) => (bar t foo 4) (setq my-plist (plist-put my-plist 'foo 69)) => (bar t foo 69) (setq my-plist (plist-put my-plist 'quux '(a))) => (bar t foo 69 quux (a)) !2004-11-27 Sat まんま (plist-get '(foo 4) 'foo) => 4 !2004-11-26 Fri まんま (put 'fly 'verb 'transitive) => transitive (put 'fly 'noun '(a buzzing little bug)) => (a buzzing little bug) (get 'fly 'verb) => transitive (symbol-plist 'fly) => (verb transitive noun (a buzzing little bug)) !2004-11-25 Thu まんま (setplist 'foo '(a 1 b (2 3) c nil)) => (a 1 b (2 3) c nil) (symbol-plist 'foo) => (a 1 b (2 3) c nil) !2004-11-24 Wed (symbol-plist 'foo) => nil (symbol-plist 'w3m-prin1) => nil !2004-11-23 Tue (unintern 'foo) => t (unintern 'bar) => t (unintern 'bar) => t (unintern "bar") => nil 'foo した瞬間に OBARRAY に登録されちゃっていたりする??? !2004-11-22 Mon まんま (setq count 0) => 0 (defun count-syms (s) (setq count (1+ count))) => count-syms (mapatoms 'count-syms) => nil count => 14562 はっ? !2004-11-21 Sun まんま obarray => [w3m-time-parse-string ... w3m-pop-up-frames] !2004-11-22 Sat まんま (intern-soft "frazzle") => nil (make-symbol "frazzle") => frazzle (intern-soft "frazzle") => nil (setq sym (intern "frazzle")) => frazzle (intern-soft "frazzle") => frazzle (eq sym 'frazzle) => t !2004-11-19 Fri まんま (setq sym (intern "foo")) => foo (eq sym 'foo) => t intern NAME &optional OBARRAY optional の方の作り方が分からない… !2004-11-18 Thu まんま (setq sym (make-symbol "foo")) => foo (eq sym 'foo) => nil !2004-11-17 Wed まんま (symbol-name 'foo) => "foo" !2004-11-16 Tue まんま (symbol-name 'buffer-file-name) => "buffer-file-name" (symbol-value 'buffer-file-name) => nil (symbol-plist 'buffer-file-name) => (risky-local-variable t variable-documentation 165478) (symbol-function 'buffer-file-name) => # !2004-11-15 Mon (symbolp :foo) t (symbolp 'foo) t (symbolp 1) nil !2004-11-14 Sun (make-bool-vector 2 nil) => #&2" " (bool-vector-p (make-bool-vector 2 nil)) => t (bool-vector-p 'foo) 使うのかな? !2004-11-13 Sat ほぼ、まんま (setq avector [1 two (quote (three)) "four" [five]]) => [1 two (quote (three)) "four" [five]] (append avector nil) => (1 two (quote (three)) "four" [five]) (append avector) => [1 two (quote (three)) "four" [five]] !2004-11-12 Fri ほぼ、まんま (setq a (vconcat '(A B C) '(D E F))) => [A B C D E F] (eq a (vconcat a)) => nil (vconcat) => [] (vconcat [A B C] "aa" '(foo (6 7))) => [A B C 97 97 foo (6 7)] (vconcat 1 2) => [49 50] 使うな! !2004-11-11 Thu まんま (setq sleepy (make-vector 9 'Z)) => [Z Z Z Z Z Z Z Z Z] !2004-11-10 Wed まんま (vector 'foo 23 [bar baz] "rats") => [foo 23 [bar baz] "rats"] (vector) => [] !2004-11-09 Tue まんま (vectorp [a]) => t (vectorp "asdf") => nil !2004-11-08 Mon まんま (setq avector [1 two '(three) "four" [five]]) => [1 two (quote (three)) "four" [five]] (eval avector) => [1 two (quote (three)) "four" [five]] (eq avector (eval avector)) => t !2004-11-07 Sun まんま (setq a [a b c d e f g]) => [a b c d e f g] (fillarray a 0) => [0 0 0 0 0 0 0] a => [0 0 0 0 0 0 0] (setq s "When in the course") => "When in the course" (fillarray s ?-) => "------------------" !2004-11-06 Sat ほぼ、まんま (setq w [foo bar baz]) => [foo bar baz] (aset w 0 'fu) => fu w => [fu bar baz] (setq x "asdfasfd") => "asdfasfd" (aset x 3 ?Z) => 90 x => "asdZasfd" (setq x "あa") => "あa" (aset x 0 ?Z) => Attempt to change byte length of a string !2004-11-05 Fri まんま (setq primes [2 3 5 7 11 13]) => [2 3 5 7 11 13] (aref primes 4) => 11 (aref "abcdefg" 1) => 98 !2004-11-04 Thu ほぼ、まんま (arrayp [a]) => t (arrayp "asdf") => t (arrayp (syntax-table)) => t (arrayp 'foo) => nil !2004-11-03 Wed まんま (setq bar '(1 2)) => (1 2) (setq x (vector 'foo bar)) => [foo (1 2)] (setq y (copy-sequence x)) => [foo (1 2)] (eq x y) => nil (equal x y) => t (eq (elt x 1) (elt y 1)) => t !2004-11-02 Tue まんま (elt [1 2 3 4] 2) => 3 (elt '(1 2 3 4) 2) => 3 (elt [1 2 3 4] 4) => Args out of range: [1 2 3 4], 4 !2004-11-01 Mon まんま (length '(1 2 3)) => 3 (length ()) => 0 (length "foobar") => 6 (length [1 2 3]) => 3 (length (make-bool-vector 5 nil)) => 5 !2004-10-31 Sun (sequencep nil) => t (sequencep '(1 2 3)) => t (sequencep "a") => t (sequencep 1) => nil !2004-10-31 Sat まんま (setq needles-per-cluster '((2 . ("Austrian Pine" "Red Pine")) (3 . ("Pitch Pine")) (5 . ("White Pine")))) => ((2 "Austrian Pine" "Red Pine") (3 "Pitch Pine") (5 "White Pine")) (setq copy (copy-alist needles-per-cluster)) => ((2 "Austrian Pine" "Red Pine") (3 "Pitch Pine") (5 "White Pine")) (eq needles-per-cluster copy) => nil (equal needles-per-cluster copy) => t (eq (car needles-per-cluster) (car copy)) => nil (cdr (car (cdr needles-per-cluster))) => ("Pitch Pine") (eq (cdr (car (cdr needles-per-cluster))) (cdr (car (cdr copy)))) => t !2004-10-29 Fri rassq とばし (assoc-default 'pine '((pine . cones) (oak . acorns) (maple . seeds)) 'eq 'boo) cones (assoc-default 'pine '((pine cones) (oak acorns) (maple seeds)) 'eq 'boo) (cones) (assoc-default 'pine '(pine oak maple) 'eq 'boo) boo (assoc-default 'oak '(pine oak maple) 'eq 'boo) boo (assoc-default 'foo '(pine oak maple) 'eq 'boo) nil 使い道と仕様がいまいち??? !2004-10-28 Thu (setq trees '((pine . cones) (oak . acorns) (maple . seeds))) => ((pine . cones) (oak . acorns) (maple . seeds)) (assq 'pine trees) => (pine . cones) (setq leaves '(("simple leaves" . oak) ("compound leaves" . horsechestnut))) => (("simple leaves" . oak) ("compound leaves" . horsechestnut)) (assq "simple leaves" leaves) => nil (assoc "simple leaves" leaves) => ("simple leaves" . oak) !2004-10-27 Wed (rassoc 'red '((rose . red) (lily . white) (buttercup . yellow))) => (rose . red) !2004-10-26 Tue まんま (setq needles-per-cluster '((2 "Austrian Pine" "Red Pine") (3 "Pitch Pine") (5 "White Pine"))) => ((2 "Austrian Pine" "Red Pine") (3 "Pitch Pine") (5 "White Pine")) (cdr (assoc 3 needles-per-cluster)) => ("Pitch Pine") (cdr (assoc 2 needles-per-cluster)) => ("Austrian Pine" "Red Pine") !2004-10-25 Mon まんま (setq trees '((pine . cones) (oak . acorns) (maple . seeds))) => ((pine . cones) (oak . acorns) (maple . seeds)) (assoc 'oak trees) => (oak . acorns) (cdr (assoc 'oak trees)) => acorns (assoc 'birch trees) => nil !2004-10-24 Sun まんま (delete '(2) '((2) (1) (2))) => ((1)) !2004-10-23 Sat まんま (member '(2) '((1) (2))) => ((2)) (memq '(2) '((1) (2))) => nil (member "foo" '("foo" "bar")) => ("foo" "bar") !2004-10-22 Fri まんま (delq 'a '(a b c)) => (b c) !2004-10-21 Thu ほぼ、まんま (memq 'b '(a b c b a)) => (b c b a) (memq '(2) '((1) (2))) => nil (memq 'd '(a b c b a)) => nil !2004-10-20 Wed (sort '(1 3 2 6 5 4 0) '<) => (0 1 2 3 4 5 6) (sort '(1 3 2 6 5 4 0) '>) => (6 5 4 3 2 1 0) (sort '(1 3 2 6 5 4 0) (lambda (x y) (> x y))) => (6 5 4 3 2 1 0) (sort '(("foo" . 1) ("bar" . 2)) (lambda (x y) (> (cdr x) (cdr y)))) => (("bar" . 2) ("foo" . 1)) !2004-10-19 Tue まんま (setq x '(1 2 3 4)) => (1 2 3 4) (nreverse x) => (4 3 2 1) x => (1) で、何に使うの? !2004-10-18 Mon まんま (setq x '(1 2 3)) => (1 2 3) (nconc x '(4 5)) => (1 2 3 4 5) x => (1 2 3 4 5) !2004-10-17 Sun まんま (setq x '(1 2 3)) => (1 2 3) (setcdr x '(4)) => (4) x => (1 4) !2004-10-16 Sat まんま (setq x '(1 2)) => (1 2) (setcar x 4) => 4 x => (4 2) !2004-10-15 Fri まんま (setq x '(1 2 3 4)) => (1 2 3 4) (reverse x) => (4 3 2 1) x => (1 2 3 4) !2004-10-14 Thu (append) => nil (append '(1 2 3 4)) => (1 2 3 4) (append 1 '(1 2 3 4)) => (49 1 2 3 4) ? (append ?A '(1 2 3 4)) => (54 53 1 2 3 4) ほ、 (append "ABC" '(1 2 3 4)) => (65 66 67 1 2 3 4) ほほ、 (append '(1 2 3 4) 1) => (1 2 3 4 . 1) (append '(1 2 3 4) '(1 2 3 4)) => (1 2 3 4 1 2 3 4) (apply 'append '((a b c) nil (x y z) nil)) => (a b c x y z) !2004-10-13 Wed ほぼ、まんま (make-list 3 'pigs) => (pigs pigs pigs) (make-list 0 'pigs) => nil (make-list -1 'pigs) => Wrong type argument: wholenump, -1 !2004-10-12 Tue まんま (list 1 2 3 4 5) => (1 2 3 4 5) (list 1 2 '(3 4 5) 'foo) => (1 2 (3 4 5) foo) (list) => nil !2004-10-11 Mon caar, cadr, cdar, cddr とばし まんま (cons 1 '(2)) => (1 2) (cons 1 '()) => (1) (cons 1 2) => (1 . 2) !2004-10-10 Sun (safe-length 1) => 0 (safe-length '(1 . 2)) => 1 (length '(1 . 2)) => Wrong type argument: listp, 2 !2004-10-09 Sat ほぼ、まんま (nthcdr 1 '(1 2 3 4)) => (2 3 4) (nthcdr 10 '(1 2 3 4)) => nil (nthcdr -3 '(1 2 3 4)) => (1 2 3 4) (nthcdr -1 '(1 2 3 4)) => (1 2 3 4) !2004-10-08 Fri ほぼ、まんま (nth 2 '(1 2 3 4)) => 3 (nth 10 '(1 2 3 4)) => nil (nth -3 '(1 2 3 4)) => 1 (nth -1 '(1 2 3 4)) => 1 !2004-10-07 Thu (cdr-safe 1) => nil (cdr 1) => Wrong type argument: listp, 1 !2004-10-06 Wed (car-safe '(1 2)) => 1 (car-safe 1) => nil (car 1) => Wrong type argument: listp, 1 !2004-10-05 Tue まんま (cdr '(a b c)) => (b c) (cdr '()) => nil !2004-10-04 Mon まんま (car '(a b c)) => a (car '()) => nil !2004-10-03 Sun (null '()) => t (null nil) => t (null t) => nil !2004-10-02 Sat (nlistp nil) => nil !2004-10-01 Fri (listp nil) => t (listp '(1)) => t (listp '(1 . 2)) => t (listp t) => nil !2004-09-30 Thu (atom nil) => t (atom t) => t (atom 1) => t (atom "foo") => t (atom '()) => t (atom '(1 2)) => nil (atom '(1 . 2)) => nil !2004-09-29 Wed 「大文字小文字テーブル」とばし (consp '()) => nil (consp '(1 . 2)) => t (consp '(1 2)) => t (consp t) => nil (consp 1) => nil !2004-09-28 Tue (upcase-initials "foo bar baz") => "Foo Bar Baz" !2004-09-27 Mon (capitalize "foo") => "Foo" (capitalize "FOO") => "Foo" !2004-09-26 Sun (upcase "foo") => "FOO" (upcase ?a) => 65 ?A => 65 !2004-09-25 Sat (downcase "FOO") => "foo" (downcase ?A) => 97 ?a => 97 !2004-09-24 Fri (format "%s" "foo") => "foo" (format "%S" "foo") => "\"foo\"" !2004-09-23 Thu 最初、まんま (string-to-number "256") => 256 (string-to-number "25 is a perfect square.") => 25 (string-to-number "X256") => 0 (string-to-number "-4.5") -4.5 => -4.5 (string-to-number "-4.5e-1") => -0.45 (string-to-number "-.5") => -0.5 !2004-09-22 Wed まんま (number-to-string 256) => "256" (number-to-string -23) => "-23" (number-to-string -23.5) => "-23.5" `int-to-string'は, この関数のほぼ廃れている別名. かわいそ〜 !2004-09-21 Tue (string-to-char "abc") => 97 (string-to-char "") => 0 (string-to-char "\000") => 0 !2004-09-20 Mon (char-to-string ?a) => "a" (string ?a) => "a" !2004-09-19 Sun (assoc-ignore-representation "abc" '(("abc" . 1))) => ("abc" . 1) (assoc-ignore-representation "abc" '(("ABC" . 1))) => nil (assoc-ignore-representation "abc" '(("abc" . 1) ("ABC" . 10))) => ("abc" . 1) !2004-09-18 Sat (assoc-ignore-case "abc" '(("abc" . 1))) => ("abc" . 1) (assoc-ignore-case "abc" '(("ABC" . 1))) => ("ABC" . 1) (assoc-ignore-case "abc" '(("abc" . 1) ("ABC" . 10))) => ("abc" . 1) !2004-09-17 Fri (compare-strings "abc" 0 2 "abc" 0 2) => t (compare-strings "abc" 0 2 "abcd" 0 2) => t (compare-strings "abc" 0 2 "abcd" 0 3) => -3 (compare-strings "abc" 0 3 "abcd" 0 2) => 3 (compare-strings "abc" 0 2 "aabc" 0 2) => 2 (compare-strings "abc" 0 2 "aabc" 1 3) => t (compare-strings "abc" 0 2 "ABC" 0 2) => 1 (compare-strings "abc" 0 2 "ABC" 0 2 t) => t !2004-09-16 Thu (string-lessp "abc" "abd") => t `string-lessp'は`string<'の別名. !2004-09-15 Wed まんま (string< "abc" "abd") => t (string< "abd" "abc") => nil (string< "123" "abc") => t (string< "" "abc") => t (string< "ab" "abc") => t (string< "abc" "") => nil (string< "abc" "ab") => nil (string< "" "") => nil !2004-09-14 Tue (string-equal "abc" "abc") => t `string-equal'は`string='の別名. !2004-09-13 Mon (string= "abc" "abc") => t (string= "abc" 'abc) => t (eq "abc" 'abc) => nil (string= "abc" "ABC") => nil !2004-09-12 Sun (char-equal ?x ?x) => t (let ((case-fold-search nil)) (char-equal ?x ?X)) => nil !2004-09-11 Sat (store-substring "abc" 0 "A") => "Abc" (store-substring "abc" 1 "A") => "aAc" (store-substring "abc" 1 "ABCD") => Args out of range: "aAB", 3 !2004-09-10 Fri split あったのか。今まで気がつかなかった… (split-string "foo bar baz") => ("foo" "bar" "baz") (split-string "foo:bar:baz" ":") => ("foo" "bar" "baz") (split-string "foo : bar : baz" ":") => ("foo " " bar " " baz") (split-string " : foo : bar : baz : " ":") => (" " " foo " " bar " " baz " " ") (split-string " : foo : bar : baz : " ":+") => (" " " foo " " bar " " baz " " ") (split-string " :foo : bar : baz: " ":+") => (" " "foo " " bar " " baz" " ") (split-string "out to moo" "o+") => ("ut t" " m") (split-string "foo bar baz") => ("foo" "bar" "baz") (split-string " foo bar baz ") => ("foo" "bar" "baz") !2004-09-09 Thu 今日は、途中以外、まんま (concat "abc" "-def") => "abc-def" (concat "abc" (list 120 121) [122]) => "abcxyz" (concat "abc" nil "-def") => "abc-def" (concat "The " "quick brown " "fox.") => "The quick brown fox." (concat) => "" (setq x (concat "abc" "def")) => "abcdef" (setq y (concat "abc" "def")) => "abcdef" (eq x y) => nil (equal x y) => t (concat 137) => "137" (concat 54 321) => "54321" <- 使うな!だそうな !2004-09-08 Wed (substring "abcdefg" 1) => "bcdefg" (substring "abcdefg" 0 3) => "abc" (substring "abcdefg" -1) => "g" (substring "abcdefg" -3 -1) => "ef" (substring "abcdefg" -3 nil) => "efg" (substring "abcdefg" -3) => "efg" (substring "abcdefg" 10) => Args out of range: "abcdefg", 10, 7 (substring "abcdefg" 0.2) => Wrong type argument: integerp, 0.2 (substring [a b (c) "d"] 1 3) => [b (c)] !2004-09-07 Tue (string ?a ?b ?c) => "abc" (concat ?a ?b ?c) => "979899" (concat "a" "b" "c") => "abc" !2004-09-06 Mon (make-string 5 ?x) => "xxxxx" (make-string 0 ?x) => "" (make-string -1 ?x) => Wrong type argument: wholenump, -1 (make-string 1.2 ?x) => Wrong type argument: wholenump, 1.2 !2004-09-05 Sun (stringp "foo") => t (stringp 'foo) => nil (char-or-string-p "foo") => t (char-or-string-p 97) => t (char-or-string-p 10000000) => t (char-or-string-p -1) => t (char-or-string-p t) => nil !2004-09-04 Sat (aref "foo" 0) => 102 (setq x "foo") => "foo" (aset x 0 98) => 98 x => "boo" !2004-09-03 Fri sin, cos, tan, asin, acos, atan, exp log, log10, expt, sqrt とばし (random) => -68566595 (random) => -125132542 (random 10) => 8 (random 1.0) => 74162110 (random 2) => 1 (random t) => 61943382 (random -1) => 49946852 !2004-09-02 Thu (logand) => -1 (logand 5 3) => 1 (logior) => 0 (logior 5 3) => 7 (logxor) => 0 (logxor 5 3) => 6 (lognot) => Wrong number of arguments: #, 0 (lognot 1) => -2 !2004-09-01 Wed (ash 2 1) => 4 (ash 2 -1) => 1 (ash -1 1) => -2 (ash -1 -1) => -1 !2004-08-31 Tue (lsh 2 1) => 4 (lsh 2 -1) => 1 (lsh -1 1) => -2 (lsh -1 -1) => 134217727 !2004-08-30 Mon (fceiling 1.1) => 2.0 (fceiling 1.9) => 2.0 (fceiling 1) => 1.0 (fceiling -1.1) => -1.0 (ftruncate 1.1) => 1.0 (ftruncate -1.1) => -1.0 (fround 1.1) => 1.0 (fround 1.5) => 2.0 (fround -1.1) => -1.0 (fround -1.5) => -2.0 !2004-08-29 Sun (ffloor 1.1) => 1.0 (ffloor -1.1) => -2.0 (ffloor 1) => 1.0 !2004-08-28 Sat (1+ 1) => 2 (1- 1) => 0 (+) => 0 (*) => 1 <-- Gauche とは挙動が違う (-) => 0 <-- Gauche とは挙動が違う (/) => Wrong number of arguments: #, 0 (/ 10 3) => 3 (/ -10 3) => -3 (/ 1.0 0) => 1.0e+INF (% -10 3) => -1 (% -10 0) => Arithmetic error (mod 10 3) => 1 (mod 3.1 3) => 0.10000000000000009 !2004-08-27 Fri (float 1) => 1.0 (float "1") => Wrong type argument: numberp, "1" (truncate 1.1) => 1 (truncate -1.1) => -1 (floor 1.1) => 1 (floor -1.1) => -2 (floor 1.1 2) => 0 (floor 3.1 2) => 1 (ceiling 1.1) => 2 (ceiling -1.1) => -1 (round 1.1) => 1 (round 1.5) => 2 (round 1.9) => 2 (round -1.1) => -1 (round -1.9) => -2 (round -1.5) => -2 !2004-08-26 Thu (= 1 1) => t (= 1 2) => nil (eq 1 1) => t (eq 1 2) => nil (setq x 1) => 1 (setq y 1) => 1 (= x y) => t (eq x y) => t (eq 'foo 1) => nil (= 'foo 1) => Wrong type argument: number-or-marker-p, foo (= 1 'foo) => Wrong type argument: number-or-marker-p, foo (= 1 1.0) => t (eq 1 1.0) => nil (equal 1 1.0) => nil (= 1.1 1.1) => t (/= 1 1) => nil (/= 1 2) => t <, >, <= >= は省略 (max 1 2 3) => 3 (min 1 2 3) => 1 (abs -1) => 1 !2004-08-25 Wed (floatp 1) => nil (floatp 1.0) => t (floatp 'foo) => nil (integerp 1) => t (integerp 'foo) => nil (numberp 1) => t (numberp 'foo) => nil (wholenump 1) => t (wholenump 0) => t (wholenump -1) => nil (wholenump 1.0) => nil (zerop 0) => t (zerop 0.0) => t (zerop 1) => nil (zerop 'foo) => Wrong type argument: numberp, foo !2004-08-24 Tue 1.0e+INF => 1.0e+INF -1.0e+INF => -1.0e+INF 0.0e+NaN => 0.0e+NaN (logb 10) => 3 (logb 10.0e20) => 69 !2004-08-23 Mon まんま (equal 'foo 'foo) => t (equal 456 456) => t (equal "asdf" "asdf") => t (equal '(1 (2 (3))) '(1 (2 (3)))) => t (equal (make-symbol "foo") 'foo) => nil ありゃ? (make-symbol "foo") => foo !2004-08-22 Sun まんま (eq 'foo 'foo) => t (eq 456 456) => t (eq "asdf" "asdf") => nil (eq '(1 (2 (3))) '(1 (2 (3)))) => nil (eq (make-symbol "foo") 'foo) => nil !2004-08-21 Sat ほぼ、まんま (type-of 1) => integer (type-of nil) => symbol (type-of '()) => symbol (type-of ()) => symbol (type-of '(x)) => cons !2004-08-20 Fri (+ 2 'a) => Wrong type argument: number-or-marker-p, a (atom 1) => t (atom t) => t (atom '(1 2)) => nil (char-or-string-p "foo") => t (char-or-string-p 1) => t (char-or-string-p ?a) => t (consp '(1 2)) => t (consp 1) => nil (floatp 1.0) => t (floatp 1) => nil (functionp 1) => nil (functionp car) => Symbol's value as variable is void: car (integer-or-marker-p 1) => t (integer-or-marker-p 1.0) => nil (integerp 1) => t (integerp 1.0) => nil (listp '(1 2)) => t (listp 1) => nil (numberp 1) => t (numberp 1.0) => t (numberp "foo") => nil (stringp "foo") => t (stringp 1) => nil (symbolp nil) => t (symbolp 1) => nil !2004-08-19 Thu (current-buffer) => # (point-marker) => # (selected-window) => # (selected-frame) => # (process-list) => (# #) !2004-08-18 Wed (symbol-function 'car) => # (subrp (symbol-function 'car)) => t !2004-08-17 Tue [1 "two" (three)] => [1 "two" (three)] !2004-08-16 Mon "aaa bbb" => "aaa bbb" "aaa\ bbb" => "aaabbb" !2004-08-15 Sun (setq alist-of-colors '((rose . red) (lily . white) (buttercup . yellow))) => ((rose . red) (lily . white) (buttercup . yellow)) !2004-08-14 Sat (setq \+1 1) \+1 => 1 (setq \(*\ 1\ 2\) 1) (message "%d" \(*\ 1\ 2\)) => "1" !2004-08-13 Fri ?\x41 => 65 !2004-08-12 Thu ?\M-A => -134217663 ?\M-\101 => -134217663 ?\M-\C-b => -134217726 ?\C-\M-b => -134217726 ?\M-\002 => -134217726 printf "%x", -134217663 # => ..f8000041 printf "%x", -134217726 # => ..f8000002 printf "%x", 65 # => 41 !2004-08-11 Wed ?\^I => 9 ?\C-I => 9 ?\^? => 127 ?\C-? => 127 !2004-08-10 Tue ?\t => t "?\t" => "? " ? !2004-08-09 Mon ?A => 65 ?B => 66 !2004-08-08 Sun 1500.0 => 1500.0 15e2 => 1500.0 15.0e2 => 1500.0 1.5e3 => 1500.0 .15e4 => 1500.0 !2004-08-07 Sat 1. => 1 268435457 => 1 printf "%x", 268435457 # => 10000001 !2004-08-06 Fri emacs-version => "20.6.3" emacs-major-version => 20 emacs-minor-version => 6 !2004-08-05 Thu emacs-build-time => (14531 48289 369875) !2004-08-04 Wed (emacs-version) => "GNU Emacs 20.6.3 (i686-pc-linux-gnu, X toolkit) of Mon Mar 6 2000 on server" !2004-08-03 Tue t ; => t 'nil ; => nil 't ; => t !2004-08-02 Mon (cons 'foo ()) ; => (foo) (not nil) ; => t !2004-08-01 Sun nil ; => nil () ; => nil '() ; => nil