English 中文(简体)
在座各位中,我是否有一套用于规范的线性治疗环境,一个用于文本?
原标题:In emacs, can I have one set of line-wrap settings for code and one for text?

在进行了大量试验之后,我认为我喜欢:

(setq truncate-lines nil)
(setq word-wrap t)

案文编辑,但

(setq truncate-lines t)
(setq word-wrap nil)

方案规划。

在各种模式中,我谨:

(setq fill-column 80)

因此,我可以使用<代码>M-q和C-u M-q,将案文传送至80栏,但我也发现,我不喜欢<代码>auto-liver<>/code>,也永远不喜欢。

页: 1 (或至少为t word-wrap的参照标准)

我是否可以在我的<编码>.emacs档案中看到一些可令我高兴的can?

我高兴的是:我所想的只是做的,我永远不需要再考虑这一点。

最佳回答

使用<代码>prog-mode-hook<>/code>和text-mode-hook,以确立这些变量:

(add-hook  text-mode-hook  (lambda ()
    (setq truncate-lines nil
          word-wrap t)))

以及

(add-hook  prog-mode-hook  (lambda ()
    (setq truncate-lines t
          word-wrap nil)))
问题回答

在我的回答中不提供源代码,但我可以向您保证,你所铭记的构造是可能的。 这只取决于你对“方案拟订模式”的定义。 大多数模式都有所谓的“ h-功能”(见。 这些基本职能是在装满方式时履行的。 这样一来,就可以调整你所铭记的环境。

(q truncate-lines t) 仍然没有发挥作用?

没收可能是另一种方式。 视线-地形是地雷(全球视像线-地形),因此,我不得不将消散功能置于 h之下:

(add-hook  neotree-mode-hook
       (lambda ()
         (visual-line-mode -1)
         (setq truncate-lines t)))




相关问题
suppress additional braces in emacs electric mode

I started using ruby-electric-mode. I like it except that I am used to closing open brackets myself (the other pairing are still useful to me). How can I make emacs suppress additional brackets when ...

Setting up an emacs environment in windows?

I am currently constrained to a windows dev box and I want to migrate my projects from eclipse to emacs. What are some good references on setting up an emacs dev environment for windows? Anything ...

Emacs Setting which-function-mode

I would like to have which-function-mode on by default when I open up Emacs. I ve added the following lines to my .emacs file. (setq which-func-mode t) (setq which-function-mode t) When I open ...

Enabling go mode for emacs

I don t seem to be able to enable a go mode for emacs. C mode doesn t work without semicolons. The best I have found is the JavaScript mode by Karl Landstrom, since JavaScript also doesn t require ...

Custom Emacs key bindings are not working

The key bindings I ve defined in my .emacs file aren t working. Here s the file: ;init modes (menu-bar-mode 0) (tool-bar-mode 0) (cua-mode) (column-number-mode) (fset perl-mode cperl-mode) (cperl-...

eval during emacs lisp macro expansion

How can I fix the simple macro foo in (elisp)Eval During Expansion? None of the followings work: (defmacro foo1 (a) `(setq (eval ,a) t)) (defmacro foo2 (a) `(setq ,(eval a) t)) (defmacro foo3 (...

Get local cvs comment history when committing file/s in emacs

I often commit files with similar cvs comment but not in a single operation. I would like to able to bring up previous comments I ve used in a previous commit when I am in the process of writing a ...

热门标签