现在,我正在使用“Emacs”23, 视线-mode, 转而进行文字编辑,但把M-q的点击 out(增加了硬线......)。 我想知道,是否有办法为视线-阳性转轨的模式添加一个可分解的填充段(或取消对M-q的约束力)的条件,但对于我仍在使用自动填埋场的人来说,还是可以重新使用。 感谢!
内容:视线和填充
原标题:emacs: visual-line-mode and fill-paragraph
最佳回答
(defun maybe-fill-paragraph (&optional justify region)
"Fill paragraph at or after point (see `fill-paragraph ).
Does nothing if `visual-line-mode is on."
(interactive (progn
(barf-if-buffer-read-only)
(list (if current-prefix-arg full) t)))
(or visual-line-mode
(fill-paragraph justify region)))
;; Replace M-q with new binding:
(global-set-key "M-q" maybe-fill-paragraph)
您不能使用<条码>全球关键条码>,也可仅以特定方式重新组合<条码>M-q条码>。 (一般而言,你可以改变全球约束力,然后将<代码>M-q重新编号为 填满-第
的具体方式。) 请注意,许多模式已自动卸载,因此,在模式启动之前,其关键图不得界定。 为了规定一种针对具体模式的约束力,我通常使用这样的职能:
(add-hook text-mode-hook
(defun cjm-fix-text-mode ()
(define-key text-mode-map "M-q" maybe-fill-paragraph)
(remove-hook text-mode-hook cjm-fix-text-mode)))
(remove-hook
isn tompulsory necessary, but the function only need toî one.)
问题回答
您可以为此提供咨询意见。
阁下:
(defadvice fill-paragraph (around disable-for-visual-line-mode activate)
(unless visual-line-mode
ad-do-it))
这将改变填充部分,在视线上行时不做任何事。 如果你更愿意,你也会增加一个错误。
视线-地形有自己的关键地图: 视线-mode-map
。 我只在这个关键地图上建议重新具有约束力的M-q。
这份地图被定义为启动的一部分,因此,你不需要后载。 以这种方式使约束力失去意义:
(define-key visual-line-mode-map [remap fill-paragraph] ignore)
相关问题
热门标签
- winforms
- combobox
- fogbugz
- java
- date
- internationalization
- asp.net
- iis
- url-rewriting
- urlrewriter
- c#
- enums
- ocaml
- haxe
- algorithm
- string
- viewstate
- .net
- c++
- c
- symbol-table
- mysql
- database
- postgresql
- licensing
- migration
- vb.net
- vb6
- declaration
- vb6-migration
- python
- psycopg2
- backup
- vmware
- virtualization
- gnu-screen
- authentication
- desktop
- excel
- xll
- cultureinfo
- regioninfo
- oracle
- client
- session
- download
- html
- virtual
- constructor
- scenarios
- perl
- full-text-search
- javascript
- ajax
- testing
- oop
- inheritance
- vim
- encapsulation
- information-hiding