[Assorted-commits] SF.net SVN: assorted:[1135] configs/trunk/src
Brought to you by:
yangzhang
From: <yan...@us...> - 2009-01-19 04:52:07
|
Revision: 1135 http://assorted.svn.sourceforge.net/assorted/?rev=1135&view=rev Author: yangzhang Date: 2009-01-19 04:52:00 +0000 (Mon, 19 Jan 2009) Log Message: ----------- added some elisp functions after taking phil's emacs iap class; new fx.vim Modified Paths: -------------- configs/trunk/src/emacs/yang.el configs/trunk/src/vim/syntax/fx.vim Modified: configs/trunk/src/emacs/yang.el =================================================================== --- configs/trunk/src/emacs/yang.el 2009-01-19 04:50:37 UTC (rev 1134) +++ configs/trunk/src/emacs/yang.el 2009-01-19 04:52:00 UTC (rev 1135) @@ -115,8 +115,8 @@ ;; The following lines are always needed. Choose your own keys. (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) -(define-key global-map "\C-cl" 'org-store-link) -(define-key global-map "\C-ca" 'org-agenda) +(global-set-key "\C-cl" 'org-store-link) +(global-set-key "\C-ca" 'org-agenda) (add-hook 'org-mode-hook 'turn-on-font-lock) ; org-mode buffers only @@ -256,9 +256,9 @@ (require 'jtags) (require 'zoom-frm) -(define-key global-map (read-kbd-macro "C--") 'zoom-frm-out) -(define-key global-map (read-kbd-macro "C-=") 'zoom-frm-in) -(define-key global-map (read-kbd-macro "C-0") 'zoom-frm-unzoom) +(global-set-key (read-kbd-macro "C--") 'zoom-frm-out) +(global-set-key (read-kbd-macro "C-=") 'zoom-frm-in) +(global-set-key (read-kbd-macro "C-0") 'zoom-frm-unzoom) ;; }}} @@ -290,6 +290,20 @@ (global-set-key [f12] 'search-word-under-cursor-forward) (global-set-key [f11] 'search-word-under-cursor-backward) +;; This was written in Phil's Emacs IAP class! +(defun count-words (&optional start end) + "Print the number of words in the region or buffer." + (interactive "r") + (let ((count 0) + (start (if (use-region-p) start (point-min))) + (end (if (use-region-p) end (point-max)))) + (save-excursion + (goto-char start) + (while (and (< (point) end) + (re-search-forward "\\w+" end t)) + (setq count (+ 1 count)))) + (message "Region contains %d words" count))) + ;; TODO make this work in XEmacs (defun copy-line (n) "Copy N lines at point to the kill-ring." @@ -504,9 +518,9 @@ (add-hook 'write-file-hook 'time-stamp) ;; Flyspell is an in-line spell checker. It checks the spelling as you type. -;(dolist (hook '(text-mode-hook)) -;(add-hook hook (lambda () (refill-mode 1)))) -;(add-hook hook (lambda () (flyspell-mode 1)))) +(dolist (hook '(text-mode-hook)) +(add-hook hook (lambda () (refill-mode 1)))) +(add-hook hook (lambda () (flyspell-mode 1)))) ;; }}} Modified: configs/trunk/src/vim/syntax/fx.vim =================================================================== --- configs/trunk/src/vim/syntax/fx.vim 2009-01-19 04:50:37 UTC (rev 1134) +++ configs/trunk/src/vim/syntax/fx.vim 2009-01-19 04:52:00 UTC (rev 1135) @@ -2,7 +2,7 @@ " Language: JavaFX Script " Maintainer: Yang Zhang <com.gmail@yaaang> " URL: http://assorted.sf.net/jfx-vim -" Last Change: 2007 Jun 03 +" Last Change: 2008 Jan 18 " Quit when a syntax file was already loaded if version < 600 @@ -15,7 +15,7 @@ syn sync minlines=50 " most JFX keywords -syn keyword jfxKeyword after as before bind class else extends first for foreach from if in into last new on private protected return select switch super then trigger var where while insert delete +syn keyword jfxKeyword abstract attribute bind break class continue delete false for function if import init insert new not null package private public return super sizeof static this throw try true var while after and as before catch dur else exclusive extends finally in bound indexof into inverse lazy on or replace step with where instanceof override at then tween assert by do first from last let protected readonly typeof lazy syn keyword jfxImport import nextgroup=scalaFqn skipwhite syn match jfxFqn "\<[._$a-zA-Z0-9,*]*" contained nextgroup=jfxFqnSet This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |