aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2005-04-08 14:40:57 +0000
committerStefan Monnier2005-04-08 14:40:57 +0000
commitc22c3db00e9345869817da8ebf441647c1ae35f3 (patch)
treee3545d646c88678761007bbf435759aaff26c352
parentea81d57ec51f81205135e3ce340345a159f9269f (diff)
downloademacs-c22c3db00e9345869817da8ebf441647c1ae35f3.tar.gz
emacs-c22c3db00e9345869817da8ebf441647c1ae35f3.zip
(whitespace-highlight-the-space): Put the same overlay
in the buffer and in whitespace-highlighted-space. (whitespace-unhighlight-the-space): Simplify. (whitespace-buffer): Simplify.
-rw-r--r--lisp/ChangeLog49
-rw-r--r--lisp/whitespace.el32
2 files changed, 39 insertions, 42 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 656c03c7d32..4d94a867bbb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12005-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * whitespace.el (whitespace-highlight-the-space): Put the same overlay
4 in the buffer and in whitespace-highlighted-space.
5 (whitespace-unhighlight-the-space): Simplify.
6 (whitespace-buffer): Simplify.
7
12005-04-08 Dan Nicolaescu <dann@ics.uci.edu> 82005-04-08 Dan Nicolaescu <dann@ics.uci.edu>
2 9
3 * textmodes/table.el (table-cell-face): Add special case for 10 * textmodes/table.el (table-cell-face): Add special case for
@@ -7,35 +14,35 @@
7 (vhdl-speedbar-architecture-face) 14 (vhdl-speedbar-architecture-face)
8 (vhdl-speedbar-instantiation-face) 15 (vhdl-speedbar-instantiation-face)
9 (vhdl-speedbar-architecture-selected-face) 16 (vhdl-speedbar-architecture-selected-face)
10 (vhdl-speedbar-instantiation-selected-face): Likewise. 17 (vhdl-speedbar-instantiation-selected-face): Likewise.
11 * progmodes/sh-script.el (sh-heredoc-face): Likewise. 18 * progmodes/sh-script.el (sh-heredoc-face): Likewise.
12 * progmodes/idlw-help.el (idlwave-help-link-face): Likewise. 19 * progmodes/idlw-help.el (idlwave-help-link-face): Likewise.
13 * progmodes/ebrowse.el (ebrowse-tree-mark-face) 20 * progmodes/ebrowse.el (ebrowse-tree-mark-face)
14 (ebrowse-root-class-face, ebrowse-member-attribute-face) 21 (ebrowse-root-class-face, ebrowse-member-attribute-face)
15 (ebrowse-progress-face): Likewise. 22 (ebrowse-progress-face): Likewise.
16 * progmodes/compile.el (compilation-info-face): Likewise. 23 * progmodes/compile.el (compilation-info-face): Likewise.
17 * progmodes/cc-fonts.el (c-invalid-face): Likewise. 24 * progmodes/cc-fonts.el (c-invalid-face): Likewise.
18 * emacs-lisp/re-builder.el (reb-match-3): Likewise. 25 * emacs-lisp/re-builder.el (reb-match-3): Likewise.
19 * calendar/calendar.el (diary-face): Likewise. 26 * calendar/calendar.el (diary-face): Likewise.
20 * woman.el (woman-italic-face, woman-bold-face) 27 * woman.el (woman-italic-face, woman-bold-face)
21 (woman-unknown-face): Likewise. 28 (woman-unknown-face): Likewise.
22 * wid-edit.el (widget-button-pressed-face): Likewise. 29 * wid-edit.el (widget-button-pressed-face): Likewise.
23 * whitespace.el (whitespace-highlight-face): Likewise. 30 * whitespace.el (whitespace-highlight-face): Likewise.
24 * smerge-mode.el (smerge-mine-face, smerge-base-face): Likewise. 31 * smerge-mode.el (smerge-mine-face, smerge-base-face): Likewise.
25 * pcvs-info.el (cvs-marked-face): Likewise. 32 * pcvs-info.el (cvs-marked-face): Likewise.
26 * info.el (info-xref): Likewise. 33 * info.el (info-xref): Likewise.
27 * ido.el (ido-subdir-face, ido-indicator-face): Likewise. 34 * ido.el (ido-subdir-face, ido-indicator-face): Likewise.
28 * hilit-chg.el (highlight-changes-face) 35 * hilit-chg.el (highlight-changes-face)
29 (highlight-changes-delete-face): Likewise. 36 (highlight-changes-delete-face): Likewise.
30 * hi-lock.el (hi-yellow, hi-green, hi-blue-b, hi-green-b) 37 * hi-lock.el (hi-yellow, hi-green, hi-blue-b, hi-green-b)
31 (hi-red-b): Likewise. 38 (hi-red-b): Likewise.
32 * generic-x.el (show-tabs-tab-face, show-tabs-space-face): Likewise. 39 * generic-x.el (show-tabs-tab-face, show-tabs-space-face): Likewise.
33 * font-lock.el (font-lock-keyword-face) 40 * font-lock.el (font-lock-keyword-face)
34 (font-lock-function-name-face, font-lock-warning-face): Likewise. 41 (font-lock-function-name-face, font-lock-warning-face): Likewise.
35 * cus-edit.el (custom-invalid-face, custom-modified-face) 42 * cus-edit.el (custom-invalid-face, custom-modified-face)
36 (custom-set-face, custom-changed-face, custom-variable-tag-face) 43 (custom-set-face, custom-changed-face, custom-variable-tag-face)
37 (custom-group-tag-face-1, custom-group-tag-face): Likewise. 44 (custom-group-tag-face-1, custom-group-tag-face): Likewise.
38 * comint.el (comint-highlight-prompt): Likewise. 45 * comint.el (comint-highlight-prompt): Likewise.
39 46
402005-04-08 Lute Kamstra <lute@gnu.org> 472005-04-08 Lute Kamstra <lute@gnu.org>
41 48
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 81a0aec9100..4406a0615ee 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -489,16 +489,14 @@ and:
489 (if whitespace-spacetab "s") 489 (if whitespace-spacetab "s")
490 (if whitespace-trailing "t"))))) 490 (if whitespace-trailing "t")))))
491 (whitespace-update-modeline whitespace-this-modeline) 491 (whitespace-update-modeline whitespace-this-modeline)
492 (save-excursion 492 (if (get-buffer whitespace-errbuf)
493 (get-buffer-create whitespace-errbuf) 493 (kill-buffer whitespace-errbuf))
494 (kill-buffer whitespace-errbuf) 494 (with-current-buffer (get-buffer-create whitespace-errbuf)
495 (get-buffer-create whitespace-errbuf)
496 (set-buffer whitespace-errbuf)
497 (if whitespace-errmsg 495 (if whitespace-errmsg
498 (progn 496 (progn
499 (insert whitespace-errmsg) 497 (insert whitespace-errmsg)
500 (if (not (or quiet whitespace-silent)) 498 (if (not (or quiet whitespace-silent))
501 (display-buffer whitespace-errbuf t)) 499 (display-buffer (current-buffer) t))
502 (if (not quiet) 500 (if (not quiet)
503 (message "Whitespaces: [%s%s] in %s" 501 (message "Whitespaces: [%s%s] in %s"
504 whitespace-this-modeline 502 whitespace-this-modeline
@@ -511,9 +509,7 @@ and:
511 (if (and (not quiet) (not (equal whitespace-clean-msg ""))) 509 (if (and (not quiet) (not (equal whitespace-clean-msg "")))
512 (message "%s %s" whitespace-filename 510 (message "%s %s" whitespace-filename
513 whitespace-clean-msg)))))))) 511 whitespace-clean-msg))))))))
514 (if whitespace-error 512 whitespace-error))
515 t
516 nil)))
517 513
518;;;###autoload 514;;;###autoload
519(defun whitespace-region (s e) 515(defun whitespace-region (s e)
@@ -736,23 +732,17 @@ Also with whitespaces whose testing has been turned off."
736(defun whitespace-highlight-the-space (b e) 732(defun whitespace-highlight-the-space (b e)
737 "Highlight the current line, unhighlighting a previously jumped to line." 733 "Highlight the current line, unhighlighting a previously jumped to line."
738 (if whitespace-display-spaces-in-color 734 (if whitespace-display-spaces-in-color
739 (progn 735 (let ((ol (whitespace-make-overlay b e)))
740 (whitespace-unhighlight-the-space) 736 (whitespace-unhighlight-the-space)
741 (add-to-list 'whitespace-highlighted-space 737 (push ol whitespace-highlighted-space)
742 (whitespace-make-overlay b e)) 738 (whitespace-overlay-put ol 'face 'whitespace-highlight-face))))
743 (whitespace-overlay-put (whitespace-make-overlay b e) 'face
744 'whitespace-highlight-face))))
745;; (add-hook 'pre-command-hook 'whitespace-unhighlight-the-space)) 739;; (add-hook 'pre-command-hook 'whitespace-unhighlight-the-space))
746 740
747(defun whitespace-unhighlight-the-space () 741(defun whitespace-unhighlight-the-space ()
748 "Unhighlight the currently highlight line." 742 "Unhighlight the currently highlight line."
749 (if (and whitespace-display-spaces-in-color whitespace-highlighted-space) 743 (if (and whitespace-display-spaces-in-color whitespace-highlighted-space)
750 (let ((whitespace-this-space nil)) 744 (progn
751 (while whitespace-highlighted-space 745 (mapc 'whitespace-delete-overlay whitespace-highlighted-space)
752 (setq whitespace-this-space (car whitespace-highlighted-space))
753 (setq whitespace-highlighted-space
754 (cdr whitespace-highlighted-space))
755 (whitespace-delete-overlay whitespace-this-space))
756 (setq whitespace-highlighted-space nil)) 746 (setq whitespace-highlighted-space nil))
757 (remove-hook 'pre-command-hook 'whitespace-unhighlight-the-space))) 747 (remove-hook 'pre-command-hook 'whitespace-unhighlight-the-space)))
758 748
@@ -863,5 +853,5 @@ This is meant to be added buffer-locally to `write-file-functions'."
863 853
864(provide 'whitespace) 854(provide 'whitespace)
865 855
866;;; arch-tag: 4ff44e87-b63c-402d-95a6-15e51e58bd0c 856;; arch-tag: 4ff44e87-b63c-402d-95a6-15e51e58bd0c
867;;; whitespace.el ends here 857;;; whitespace.el ends here