diff options
| author | Chong Yidong | 2008-07-21 18:14:46 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-07-21 18:14:46 +0000 |
| commit | ad45602732ee83c99be339bac594542167b3e085 (patch) | |
| tree | 899d3c0849785c7b7d21823685b41e2a602c8b2e | |
| parent | c58140f4b04f96d7aea24f035c33f3385992c76b (diff) | |
| download | emacs-ad45602732ee83c99be339bac594542167b3e085.tar.gz emacs-ad45602732ee83c99be339bac594542167b3e085.zip | |
(menu-bar-line-wrapping-menu): Use Visual Line mode for "word wrap"
command.
| -rw-r--r-- | lisp/menu-bar.el | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index f9e43757d70..827148b2214 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -1057,30 +1057,38 @@ mail status in mode line")) | |||
| 1057 | 1057 | ||
| 1058 | (defvar menu-bar-line-wrapping-menu (make-sparse-keymap "Line Wrapping")) | 1058 | (defvar menu-bar-line-wrapping-menu (make-sparse-keymap "Line Wrapping")) |
| 1059 | 1059 | ||
| 1060 | (define-key menu-bar-line-wrapping-menu [truncate] | ||
| 1061 | '(menu-item "Truncate Long Lines" | ||
| 1062 | toggle-truncate-lines | ||
| 1063 | :help "Truncate long lines at window edge" | ||
| 1064 | :button (:radio . (or truncate-lines | ||
| 1065 | (truncated-partial-width-window-p))) | ||
| 1066 | :visible (menu-bar-menu-frame-live-and-visible-p) | ||
| 1067 | :enable (not (truncated-partial-width-window-p)))) | ||
| 1068 | |||
| 1069 | (define-key menu-bar-line-wrapping-menu [word-wrap] | 1060 | (define-key menu-bar-line-wrapping-menu [word-wrap] |
| 1070 | '(menu-item "Wrap at Word Boundaries" | 1061 | '(menu-item "Word Wrap (Visual Line mode)" |
| 1071 | (lambda () (interactive) (setq truncate-lines nil | 1062 | (lambda () |
| 1072 | word-wrap t)) | 1063 | (interactive) |
| 1064 | (unless visual-line-mode | ||
| 1065 | (visual-line-mode 1)) | ||
| 1066 | (message "Visual-Line mode enabled")) | ||
| 1073 | :help "Wrap long lines at word boundaries" | 1067 | :help "Wrap long lines at word boundaries" |
| 1074 | :button (:radio . (and (null truncate-lines) | 1068 | :button (:radio . (and (null truncate-lines) |
| 1075 | (not (truncated-partial-width-window-p)) | 1069 | (not (truncated-partial-width-window-p)) |
| 1076 | word-wrap)) | 1070 | word-wrap)) |
| 1071 | :visible (menu-bar-menu-frame-live-and-visible-p))) | ||
| 1072 | |||
| 1073 | (define-key menu-bar-line-wrapping-menu [truncate] | ||
| 1074 | '(menu-item "Truncate Long Lines" | ||
| 1075 | (lambda () | ||
| 1076 | (interactive) | ||
| 1077 | (if visual-line-mode (visual-line-mode 0)) | ||
| 1078 | (setq word-wrap nil) | ||
| 1079 | (toggle-truncate-lines 1)) | ||
| 1080 | :help "Truncate long lines at window edge" | ||
| 1081 | :button (:radio . (or truncate-lines | ||
| 1082 | (truncated-partial-width-window-p))) | ||
| 1077 | :visible (menu-bar-menu-frame-live-and-visible-p) | 1083 | :visible (menu-bar-menu-frame-live-and-visible-p) |
| 1078 | :enable (not (truncated-partial-width-window-p)))) | 1084 | :enable (not (truncated-partial-width-window-p)))) |
| 1079 | 1085 | ||
| 1080 | (define-key menu-bar-line-wrapping-menu [window-wrap] | 1086 | (define-key menu-bar-line-wrapping-menu [window-wrap] |
| 1081 | '(menu-item "Wrap at Window Edge" | 1087 | '(menu-item "Wrap at Window Edge" |
| 1082 | (lambda () (interactive) (setq truncate-lines nil | 1088 | (lambda () (interactive) |
| 1083 | word-wrap nil)) | 1089 | (if visual-line-mode (visual-line-mode 0)) |
| 1090 | (setq word-wrap nil) | ||
| 1091 | (if truncate-lines (toggle-truncate-lines -1))) | ||
| 1084 | :help "Wrap long lines at window edge" | 1092 | :help "Wrap long lines at window edge" |
| 1085 | :button (:radio . (and (null truncate-lines) | 1093 | :button (:radio . (and (null truncate-lines) |
| 1086 | (not (truncated-partial-width-window-p)) | 1094 | (not (truncated-partial-width-window-p)) |