diff options
| author | Dan Nicolaescu | 2009-01-10 17:21:04 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2009-01-10 17:21:04 +0000 |
| commit | ac7020b35ea1ebb4d979fb956465c03ede2ca4ae (patch) | |
| tree | 613321db800a3e36eb72b2b13cc2a3c6556ea68a | |
| parent | 2833b3fffd6e3cef1cb472ef11eb611772521caa (diff) | |
| download | emacs-ac7020b35ea1ebb4d979fb956465c03ede2ca4ae.tar.gz emacs-ac7020b35ea1ebb4d979fb956465c03ede2ca4ae.zip | |
(diff-show-trailing-whitespaces): Remove function.
Move setting up whitepace-mode ...
(diff-mode): ... here.
(diff-mode-menu): Add a menu entry for showing trailing whitespace.
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/diff-mode.el | 16 |
3 files changed, 18 insertions, 9 deletions
| @@ -781,8 +781,8 @@ diff-auto-refine-mode. It is bound to `C-c C-b'. | |||
| 781 | buffer and tries to create ChangeLog entries for each change. | 781 | buffer and tries to create ChangeLog entries for each change. |
| 782 | It is bound to `C-x 4 A'. | 782 | It is bound to `C-x 4 A'. |
| 783 | +++ | 783 | +++ |
| 784 | *** The new function `diff-show-trailing-whitespaces' shows | 784 | *** Turning on `whitespace-mode' in a diff buffer will show trailing |
| 785 | trailing whitespace problems in the modified lines of a diff buffer. | 785 | whitespace problems in the modified lines. |
| 786 | 786 | ||
| 787 | ** Dired | 787 | ** Dired |
| 788 | +++ | 788 | +++ |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7e07d87f753..a94006499ad 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2009-01-10 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * diff-mode.el (diff-show-trailing-whitespaces): Remove function. | ||
| 4 | Move setting up whitepace-mode ... | ||
| 5 | (diff-mode): ... here. | ||
| 6 | (diff-mode-menu): Add a menu entry for showing trailing whitespace. | ||
| 7 | |||
| 1 | 2009-01-10 Chong Yidong <cyd@stupidchicken.com> | 8 | 2009-01-10 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 9 | ||
| 3 | * faces.el (x-font-family-list): Remove entirely. | 10 | * faces.el (x-font-family-list): Remove entirely. |
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index cbd1aaf48b2..7eddf3b37e7 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el | |||
| @@ -183,6 +183,9 @@ when editing big diffs)." | |||
| 183 | ["Unified -> Context" diff-unified->context | 183 | ["Unified -> Context" diff-unified->context |
| 184 | :help "Convert unified diffs to context diffs"] | 184 | :help "Convert unified diffs to context diffs"] |
| 185 | ;;["Fixup Headers" diff-fixup-modifs (not buffer-read-only)] | 185 | ;;["Fixup Headers" diff-fixup-modifs (not buffer-read-only)] |
| 186 | ["Show trailing whitespace" whitespace-mode | ||
| 187 | :style toggle :selected whitespace-mode | ||
| 188 | :help "Show trailing whitespace in modified lines"] | ||
| 186 | "-----" | 189 | "-----" |
| 187 | ["Split hunk" diff-split-hunk | 190 | ["Split hunk" diff-split-hunk |
| 188 | :active (diff-splittable-p) | 191 | :active (diff-splittable-p) |
| @@ -1264,6 +1267,12 @@ a diff with \\[diff-reverse-direction]. | |||
| 1264 | (set (make-local-variable 'end-of-defun-function) | 1267 | (set (make-local-variable 'end-of-defun-function) |
| 1265 | 'diff-end-of-file) | 1268 | 'diff-end-of-file) |
| 1266 | 1269 | ||
| 1270 | ;; Set up `whitespace-mode' so that turning it on will show trailing | ||
| 1271 | ;; whitespace problems on the modified lines of the diff. | ||
| 1272 | (set (make-local-variable 'whitespace-style) '(trailing)) | ||
| 1273 | (set (make-local-variable 'whitespace-trailing-regexp) | ||
| 1274 | "^[-\+!<>].*?\\([\t ]+\\)$") | ||
| 1275 | |||
| 1267 | (setq buffer-read-only diff-default-read-only) | 1276 | (setq buffer-read-only diff-default-read-only) |
| 1268 | ;; setup change hooks | 1277 | ;; setup change hooks |
| 1269 | (if (not diff-update-on-the-fly) | 1278 | (if (not diff-update-on-the-fly) |
| @@ -1885,13 +1894,6 @@ I.e. like `add-change-log-entry-other-window' but applied to all hunks." | |||
| 1885 | ;; When there's no more hunks, diff-hunk-next signals an error. | 1894 | ;; When there's no more hunks, diff-hunk-next signals an error. |
| 1886 | (error nil))))) | 1895 | (error nil))))) |
| 1887 | 1896 | ||
| 1888 | (defun diff-show-trailing-whitespaces () | ||
| 1889 | "Show trailing whitespaces in modified lines for diff-mode." | ||
| 1890 | (interactive) | ||
| 1891 | (let ((whitespace-style '(trailing)) | ||
| 1892 | (whitespace-trailing-regexp "^[-+!<>].*?\\([\t ]+\\)$")) | ||
| 1893 | (whitespace-mode 1))) ; display trailing whitespace in diff buffer | ||
| 1894 | |||
| 1895 | ;; provide the package | 1897 | ;; provide the package |
| 1896 | (provide 'diff-mode) | 1898 | (provide 'diff-mode) |
| 1897 | 1899 | ||