emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/whitespace.el [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/whitespace.el [lexbind]
Date: Tue, 14 Oct 2003 19:52:39 -0400

Index: emacs/lisp/whitespace.el
diff -c emacs/lisp/whitespace.el:1.19.4.1 emacs/lisp/whitespace.el:1.19.4.2
*** emacs/lisp/whitespace.el:1.19.4.1   Fri Apr  4 01:20:12 2003
--- emacs/lisp/whitespace.el    Tue Oct 14 19:51:28 2003
***************
*** 5,11 ****
  ;; Author: Rajesh Vaidheeswarran <address@hidden>
  ;; Keywords: convenience
  
! ;; $Id: whitespace.el,v 1.19.4.1 2003/04/04 06:20:12 miles Exp $
  ;; This file is part of GNU Emacs.
  
  ;; GNU Emacs is free software; you can redistribute it and/or modify
--- 5,11 ----
  ;; Author: Rajesh Vaidheeswarran <address@hidden>
  ;; Keywords: convenience
  
! ;; $Id: whitespace.el,v 1.19.4.2 2003/10/14 23:51:28 miles Exp $
  ;; This file is part of GNU Emacs.
  
  ;; GNU Emacs is free software; you can redistribute it and/or modify
***************
*** 24,65 ****
  ;; Boston, MA 02111-1307, USA.
  
  ;;; Commentary:
! 
! ;; Whitespace.el URL: http://www.dsmit.com/lisp/
! 
  ;; The whitespace library is intended to find and help fix five different 
types
  ;; of whitespace problems that commonly exist in source code.
! 
  ;; 1. Leading space (empty lines at the top of a file).
  ;; 2. Trailing space (empty lines at the end of a file).
  ;; 3. Indentation space (8 or more spaces at beginning of line, that should be
! ;;                  replaced with TABS).
  ;; 4. Spaces followed by a TAB.  (Almost always, we never want that).
  ;; 5. Spaces or TABS at the end of a line.
! 
  ;; Whitespace errors are reported in a buffer, and on the modeline.
! 
  ;; Modeline will show a W:<x>!<y> to denote a particular type of whitespace,
  ;; where `x' and `y' can be one (or more) of:
! 
  ;; e - End-of-Line whitespace.
  ;; i - Indentation whitespace.
  ;; l - Leading whitespace.
  ;; s - Space followed by Tab.
  ;; t - Trailing whitespace.
! 
  ;; If any of the whitespace checks is turned off, the modeline will display a
  ;; !<y>.
! 
  ;;     (since (3) is the most controversial one, here is the rationale: Most
  ;;     terminal drivers and printer drivers have TAB configured or even
  ;;     hardcoded to be 8 spaces.  (Some of them allow configuration, but 
almost
  ;;     always they default to 8.)
! 
  ;;     Changing `tab-width' to other than 8 and editing will cause your code 
to
  ;;     look different from within Emacs, and say, if you cat it or more it, or
  ;;     even print it.
! 
  ;;     Almost all the popular programming modes let you define an offset (like
  ;;     c-basic-offset or perl-indent-level) to configure the offset, so you
  ;;     should never have to set your `tab-width' to be other than 8 in all
--- 24,65 ----
  ;; Boston, MA 02111-1307, USA.
  
  ;;; Commentary:
! ;;
! ;; URL: http://www.dsmit.com/lisp/
! ;;
  ;; The whitespace library is intended to find and help fix five different 
types
  ;; of whitespace problems that commonly exist in source code.
! ;;
  ;; 1. Leading space (empty lines at the top of a file).
  ;; 2. Trailing space (empty lines at the end of a file).
  ;; 3. Indentation space (8 or more spaces at beginning of line, that should be
! ;;                  replaced with TABS).
  ;; 4. Spaces followed by a TAB.  (Almost always, we never want that).
  ;; 5. Spaces or TABS at the end of a line.
! ;;
  ;; Whitespace errors are reported in a buffer, and on the modeline.
! ;;
  ;; Modeline will show a W:<x>!<y> to denote a particular type of whitespace,
  ;; where `x' and `y' can be one (or more) of:
! ;;
  ;; e - End-of-Line whitespace.
  ;; i - Indentation whitespace.
  ;; l - Leading whitespace.
  ;; s - Space followed by Tab.
  ;; t - Trailing whitespace.
! ;;
  ;; If any of the whitespace checks is turned off, the modeline will display a
  ;; !<y>.
! ;;
  ;;     (since (3) is the most controversial one, here is the rationale: Most
  ;;     terminal drivers and printer drivers have TAB configured or even
  ;;     hardcoded to be 8 spaces.  (Some of them allow configuration, but 
almost
  ;;     always they default to 8.)
! ;;
  ;;     Changing `tab-width' to other than 8 and editing will cause your code 
to
  ;;     look different from within Emacs, and say, if you cat it or more it, or
  ;;     even print it.
! ;;
  ;;     Almost all the popular programming modes let you define an offset (like
  ;;     c-basic-offset or perl-indent-level) to configure the offset, so you
  ;;     should never have to set your `tab-width' to be other than 8 in all
***************
*** 68,83 ****
  ;;     your office complain, tell them to use vim, which distinguishes between
  ;;     tabstop and shiftwidth (vi equivalent of our offsets), and also ask 
them
  ;;     to set smarttab.)
! 
  ;; All the above have caused (and will cause) unwanted codeline integration 
and
  ;; merge problems.
! 
  ;; whitespace.el will complain if it detects whitespaces on opening a file, 
and
  ;; warn you on closing a file also (in case you had inserted any
  ;; whitespaces during the process of your editing).
! 
  ;; Exported functions:
! 
  ;; `whitespace-buffer' - To check the current buffer for whitespace problems.
  ;; `whitespace-cleanup' - To cleanup all whitespaces in the current buffer.
  ;; `whitespace-region' - To check between point and mark for whitespace
--- 68,83 ----
  ;;     your office complain, tell them to use vim, which distinguishes between
  ;;     tabstop and shiftwidth (vi equivalent of our offsets), and also ask 
them
  ;;     to set smarttab.)
! ;;
  ;; All the above have caused (and will cause) unwanted codeline integration 
and
  ;; merge problems.
! ;;
  ;; whitespace.el will complain if it detects whitespaces on opening a file, 
and
  ;; warn you on closing a file also (in case you had inserted any
  ;; whitespaces during the process of your editing).
! ;;
  ;; Exported functions:
! ;;
  ;; `whitespace-buffer' - To check the current buffer for whitespace problems.
  ;; `whitespace-cleanup' - To cleanup all whitespaces in the current buffer.
  ;; `whitespace-region' - To check between point and mark for whitespace
***************
*** 87,93 ****
  
  ;;; Code:
  
! (defvar whitespace-version "3.2" "Version of the whitespace library.")
  
  (defvar whitespace-all-buffer-files nil
    "An associated list of buffers and files checked for whitespace cleanliness.
--- 87,93 ----
  
  ;;; Code:
  
! (defvar whitespace-version "3.4" "Version of the whitespace library.")
  
  (defvar whitespace-all-buffer-files nil
    "An associated list of buffers and files checked for whitespace cleanliness.
***************
*** 172,181 ****
--- 172,183 ----
    "Check for and fix five different types of whitespaces in source code."
    ;; Since XEmacs doesn't have a 'convenience group, use the next best group
    ;; which is 'editing?
+   :link '(emacs-commentary-link "whitespace.el")
    :group 'editing)
  (defgroup whitespace nil
    "Check for and fix five different types of whitespaces in source code."
    :version "21.1"
+   :link '(emacs-commentary-link "whitespace.el")
    :group 'convenience))
  
  (defcustom whitespace-check-leading-whitespace t
***************
*** 234,239 ****
--- 236,247 ----
    :type 'string
    :group 'whitespace)
  
+ (defcustom whitespace-clean-msg "clean."
+   "If non-nil, this message will be displayed after a whitespace check
+ determines a file to be clean."
+   :type 'string
+   :group 'whitespace)
+ 
  (defcustom whitespace-abort-on-error nil
    "While writing a file, abort if the file is unclean. If
  `whitespace-auto-cleanup' is set, that takes precedence over this
***************
*** 501,508 ****
                                         (concat "!" whitespace-unchecked)
                                       ""))
                                   whitespace-filename)))
!                 (if (not quiet)
!                     (message "%s clean" whitespace-filename))))))))
      (if whitespace-error
        t
        nil)))
--- 509,517 ----
                                         (concat "!" whitespace-unchecked)
                                       ""))
                                   whitespace-filename)))
!                 (if (and (not quiet) (not (equal whitespace-clean-msg "")))
!                     (message "%s %s" whitespace-filename
!                              whitespace-clean-msg))))))))
      (if whitespace-error
        t
        nil)))
***************
*** 568,574 ****
        (if whitespace-any
            (whitespace-cleanup)
          (progn
!           (message "%s clean" buffer-file-name)
            (whitespace-update-modeline)))
        (setq tab-width whitespace-tabwith-saved))))
  
--- 577,584 ----
        (if whitespace-any
            (whitespace-cleanup)
          (progn
!           (if (not whitespace-silent)
!               (message "%s clean" buffer-file-name))
            (whitespace-update-modeline)))
        (setq tab-width whitespace-tabwith-saved))))
  
***************
*** 813,823 ****
  ;;;###autoload
  (define-minor-mode whitespace-global-mode
    "Toggle using Whitespace mode in new buffers.
! With ARG, turn the mode on if and only iff ARG is positive.
  
  When this mode is active, `whitespace-buffer' is added to
  `find-file-hook' and `kill-buffer-hook'."
!   :global t :group 'whitespace
    (if whitespace-global-mode
        (progn
        (add-hook 'find-file-hook 'whitespace-buffer)
--- 823,834 ----
  ;;;###autoload
  (define-minor-mode whitespace-global-mode
    "Toggle using Whitespace mode in new buffers.
! With ARG, turn the mode on iff ARG is positive.
  
  When this mode is active, `whitespace-buffer' is added to
  `find-file-hook' and `kill-buffer-hook'."
!   :global t
!   :group 'whitespace
    (if whitespace-global-mode
        (progn
        (add-hook 'find-file-hook 'whitespace-buffer)
***************
*** 847,850 ****
--- 858,863 ----
    (remove-hook 'kill-buffer-hook 'whitespace-buffer))
  
  (provide 'whitespace)
+ 
+ ;;; arch-tag: 4ff44e87-b63c-402d-95a6-15e51e58bd0c
  ;;; whitespace.el ends here




reply via email to

[Prev in Thread] Current Thread [Next in Thread]