Differences between revisions 29 and 33 (spanning 4 versions)
Revision 29 as of 2005-06-14 03:07:45
Size: 5659
Editor: thinfrog
Comment:
Revision 33 as of 2005-10-24 15:39:25
Size: 6913
Editor: nickcheng
Comment:
Deletions are marked like this. Additions are marked like this.
Line 17: Line 17:
请在[http://www.gnu.org/software/emacs/ 官方主页] 的第5项和第6项中操作!  *请在[http://www.gnu.org/software/emacs/ 官方主页] 的第5项和第6项中操作!
 *[http://learn.tsinghua.edu.cn/homepage/2004211031/emacs/emacs-cvs-unicode-20050823-win32.zip 编译好的Unicode的版本]
Line 27: Line 28:
  * Emacs有Unicode分支, 不过还是处于开发状态, 但是基本已经可用, 而且使用汉字是没问题的! 这是最爽的! -- Nickcheng
Line 49: Line 50:
         {{{#!lisp
(setq load-path (cons "c:/emacs/python_mode" load-path))
(setq auto-mode-alist
      (cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist
      (cons '("python" . python-mode)
     interpreter-mode-alist))
;;(setq python-mode-hook
;; '(lambda() (progn
;; (set-variable 'py-indent-offset 4)
;; (set-variable 'py-smart-indentation nil)
;; (set-variable 'indent-tabs-mode nil) )))
(defconst py-python-command "c:/python24/python.exe")
(autoload 'python-mode "python-mode" "Python editing mode." t)
;;---------------------------------------------
;; add my customization
(add-hook 'python-mode-hook 'my-python-hook)
;; this gets called by outline to deteremine the level. Just use the length of the whitespace
(defun py-outline-level ()
  (let (buffer-invisibility-spec)
    (save-excursion
      (skip-chars-forward "\t ")
      (current-column))))
;; this get called after python mode is enabled
(defun my-python-hook ()
  ;; outline uses this regexp to find headers. I match lines with no indent and indented "class"
  ;; and "def" lines.
  (setq outline-regexp "[^ \t]\\|[ \t]*\\(def\\|class\\) ")
  ;; enable our level computation
  (setq outline-level 'py-outline-level)
  ;; do not use their \C-c@ prefix, too hard to type. Note this overides some python mode bindings
  (setq outline-minor-mode-prefix "\C-c")
  ;; turn on outline mode
  (outline-minor-mode t)
  ;; initially hide all but the headers
  (hide-body)
  ;; I use CUA mode on the PC so I rebind these to make the more accessible
  (local-set-key [?\C-\t] 'py-shift-region-right)
  (local-set-key [?\C-\S-\t] 'py-shift-region-left)
  ;; make paren matches visible
  (show-paren-mode 1)
)
Line 50: Line 93:
         (setq load-path (cons "c:/emacs/python_mode" load-path)) ;;这里设置你的python mode的路径 ;;----------------------------------
(custom-set-variables
  ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 '(case-fold-search t)
 '(current-language-environment "English")
 '(default-input-method "latin-1-prefix")
 '(global-font-lock-mode t nil (font-lock)))
(custom-set-faces
  ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 )
Line 52: Line 106:

         (setq auto-mode=alist
          (cons '(".py$" . python-mode) auto-mode-alist))


         (setq interpreter-mode-alist
          (cons '("python" . python-mode)
    interpreter-mode-alist))


         (setq python-mode-hook

          '(lambda() (progn

    (set-variable 'py-indent-offset 4)

    (set-variable 'py-smart-indentation nil)

    (set-variable 'indent-tabs-mode nil) )))


         (defconst py-python-command "c:/python24/python.exe") ;;这里设置你自己的 python.exe路径

         (autoload 'python-mode "python-mode" "Python editing mode." t)

         (custom-set-variables

          ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!

          ;; Your init file should contain only one such instance.

          '(case-fold-search t)

          '(current-language-environment "English")

          '(default-input-method "latin-1-prefix")

          '(global-font-lock-mode t nil (font-lock)))


         (custom-set-faces

          ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!

          ;; Your init file should contain only one such instance.

         )
}}}
Line 100: Line 108:
         ;;使用的时候 M-x (alt + x ) ,然后输入 python-mode 就可以启动了。--瘦青蛙          使用的时候 M-x (alt + x ) ,然后输入 python-mode 就可以启动了。         --瘦青蛙

Emacs

-- dreamingk [DateTime(2004-12-05T04:18:18Z)] TableOfContents

Emacs

中文化指南

[http://zhdotemacs.sourceforge.net/emacs/index.html]

官方主页

[http://www.gnu.org/software/emacs/]

程序及文档下载

使用反馈

  • 我想在 Win 环境中使用! Lisp 的控制可以管理到M$ 系统的方方面面? -- ZoomQuiet

  • 我在win下用的,配置我还不太懂,好象不太容易配置,还有不支持win系统自带的输入法,python的编程插件倒是可以正常工作,其他问题问询hoxide,他好象清楚一些,我在学习中 :) -- Dreamingk
  • 不支持win自带的输入法吗? 不是吧, 我一直都在用啊? 输入的时候可能看到乱码, 用Ctrl+L刷新一下屏幕就好了.
    • Emacs里面的编码选择蛮复杂的, 关于中文的编码太多了, 在保存文件时他还会猜测编码, 要看准哦. -- hoxide
  • 这样嘛。我一看输入的都是乱码,我还以为不支持win自带的输入法呢。 -- Dreamingk
  • 因为现在的版本还不是unicode编码,因此汉字都按半个字符来处理。我就是因为汉字问题不爽才不再学了。庞大的软件要想做系统级调整就会这样。它出现得太早了。 -- Limodou
    • Emacs有Unicode分支, 不过还是处于开发状态, 但是基本已经可用, 而且使用汉字是没问题的! 这是最爽的! -- Nickcheng
  • 配置文件写好,汉字不是半个字符。windows下的优点就是可以用win的输入法。linux下我还没调出来,只能用emacs自带的输入法。vim我只用最基本的功能,稍微高级的需求都用emacs解决。emacs的pythonmode是不是成熟度不够?只能实现idle的功能,连folding都没有。所以我还是用leo。leo真不错。一个万能工具。by tomz


  • 咦咦咦?!??!Leo!! 唉呀呀!! tomz 是怎么使用的?开始文章化编程了? 我仅仅用它来进行信息管理,可以自个儿加菜单什么的进去? -- Zoomq
    • 可以叫文学化编程吧,我理解文学化编程是一种更好的fold,并能部分代替uml。我现在用leo管理我的代码。感觉非常棒。再也不为代码多而烦恼了。它有多文件管理功能,自动同步文件,能够同步链接两个代码部分。都很有用。leo可以叫做项目管理工具吧。在debian的安装中也包括文学编程,看来文学编程是一个主流编程工具,并不是冷僻的工具。by tomz
      • 谢谢!!请汇聚是也乎!
      • LiterateProgramming -- 文章化编程! 早就想系统的学习了,只是总感觉无从下手!

  • 能不能给个配置文件看看?我的配置过了,但是好象没有什么效果 -- Dreamingk
    • 我这个电脑没emacs,就是上面的链接emacs中文化指南中找吧。或者王垠的主页上有。需要什么效果?就是将汉字识别为一个字。并能输入中文吧。另外,xemacs的win版不行。by tomz
    • 编辑c盘根目录下的“.emacs”文件。这样应该起作用。by tomz
  • 我只用python-mode来编辑python程序, 代替idle? 没试过. -- hoxide
    • 代替idle的意思是,它只能有基本的编辑功能,并能调出shell来运行。没有其他功能。 by tomz
    • 还要什么功能? 调试环境? 类和模块的树形显示? 我好像从来不用的啊~~~ -- hoxide
      • 函数以及函数中的函数的fold功能,就是说pythonmode不支持outline,最基本的功能,pdb和emacs的结合也不好用。自动完成和文档提示可能也没有。我用leo就是为了fold。 by tomz
        • 哦, 这么回事, leo 我试试~~~ -- hoxide
        • emacs中可以通过folding mode来支持folding
        • 没有python-mode的folding 。by tomz
        • http://www.chrislott.org/geek/emacs/n2n_folding_mode.php 去这里看看把,规则可以定制的。 by eddyxu

        • http://www.cs.unc.edu/~gb/Software.html 这里有python的folding脚本,可以试一下。 by flyaflya

        • 问一下,python-model和这个folding脚本该怎么安装?(刚开始用emacs) by flyaflya
          • 我用的windows,安装python-mode如下:创建一个 .emacs 文件放到你的 c:/ 下,.emacs内容如下:
            • (setq load-path (cons "c:/emacs/python_mode" load-path))
              (setq auto-mode-alist
                    (cons '("\\.py$" . python-mode) auto-mode-alist))
              (setq interpreter-mode-alist
                    (cons '("python" . python-mode)
                          interpreter-mode-alist))
              ;;(setq python-mode-hook
              ;;      '(lambda() (progn
              ;;                 (set-variable 'py-indent-offset 4)
              ;;                 (set-variable 'py-smart-indentation nil)
              ;;                 (set-variable 'indent-tabs-mode nil) )))
              (defconst py-python-command "c:/python24/python.exe")
              (autoload 'python-mode "python-mode" "Python editing mode." t)
              ;;---------------------------------------------
              ;; add my customization
              (add-hook 'python-mode-hook 'my-python-hook)
              ;; this gets called by outline to deteremine the level. Just use the length of the whitespace
              (defun py-outline-level ()
                (let (buffer-invisibility-spec)
                  (save-excursion
                    (skip-chars-forward "\t ")
                    (current-column))))
              ;; this get called after python mode is enabled
              (defun my-python-hook ()
                ;; outline uses this regexp to find headers. I match lines with no indent and indented "class"
                ;; and "def" lines.
                (setq outline-regexp "[^ \t]\\|[ \t]*\\(def\\|class\\) ")
                ;; enable our level computation
                (setq outline-level 'py-outline-level)
                ;; do not use their \C-c@ prefix, too hard to type. Note this overides some python mode bindings
                (setq outline-minor-mode-prefix "\C-c")
                ;; turn on outline mode
                (outline-minor-mode t)
                ;; initially hide all but the headers
                (hide-body)
                ;; I use CUA mode on the PC so I rebind these to make the more accessible
                (local-set-key [?\C-\t] 'py-shift-region-right)
                (local-set-key [?\C-\S-\t] 'py-shift-region-left)
                ;; make paren matches visible
                (show-paren-mode 1)
              )
              
              ;;----------------------------------
              (custom-set-variables
                ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
                ;; Your init file should contain only one such instance.
               '(case-fold-search t)
               '(current-language-environment "English")
               '(default-input-method "latin-1-prefix")
               '(global-font-lock-mode t nil (font-lock)))
              (custom-set-faces
                ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
                ;; Your init file should contain only one such instance.
               )
              使用的时候 M-x (alt + x ) ,然后输入 python-mode 就可以启动了。 --瘦青蛙

Emacs (last edited 2009-12-25 07:17:01 by localhost)