svn rev #23096: trunk/src/ util/
tlyu@MIT.EDU
tlyu at MIT.EDU
Fri Oct 30 17:34:20 EDT 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=23096
Commit By: tlyu
Log Message:
Tweak batch reindent some more. Limit the initial bulk reindent, and
refine the exception list somewhat.
Changed Files:
U trunk/src/Makefile.in
U trunk/src/util/krb5-batch-reindent.el
Modified: trunk/src/Makefile.in
===================================================================
--- trunk/src/Makefile.in 2009-10-30 10:49:38 UTC (rev 23095)
+++ trunk/src/Makefile.in 2009-10-30 21:34:19 UTC (rev 23096)
@@ -667,16 +667,30 @@
-l $(SRCTOP)/util/krb5-batch-reindent.el
mark-cstyle::
- $(FIND) $(SRCTOP) \( \
- -path $(SRCTOP)/appl/bsd -o \
- -path $(SRCTOP)/appl/gssftp -o \
- -path $(SRCTOP)/appl/telnet -o \
- -path $(SRCTOP)/include/gssrpc -o \
- -path $(SRCTOP)/lib/crypto/krb/yarrow -o \
- -path $(SRCTOP)/lib/rpc -o \
- -path $(SRCTOP)/plugins/kdb/db2/libdb2 -o \
- -path $(SRCTOP)/lib/krb5/unicode -o \
- -path $(SRCTOP)/windows/wintel \
+ $(FIND) \
+ $(SRCTOP)/clients \
+ $(SRCTOP)/lib/kadm5 \
+ $(SRCTOP)/lib/kdb \
+ $(SRCTOP)/lib/krb5 \
+ $(SRCTOP)/kadmin \
+ $(SRCTOP)/kdc \
+ \( \
+ -path $(SRCTOP)/kadmin/cli/strftime.c -o \
+ -path $(SRCTOP)/kadmin/server/ipropd_svc.c -o \
+ -path $(SRCTOP)/kadmin/server/kadm_rpc_svc.c -o \
+ -path $(SRCTOP)/lib/kadm5/admin_xdr.h -o \
+ -path $(SRCTOP)/lib/kadm5/client/client_rpc.c -o \
+ -path $(SRCTOP)/lib/kadm5/kadm_rpc.h -o \
+ -path $(SRCTOP)/lib/kadm5/kadm_rpc_xdr.c -o \
+ -path $(SRCTOP)/lib/kadm5/srv/adm_xdr.c -o \
+ -path $(SRCTOP)/lib/krb5/asn.1 -o \
+ -path $(SRCTOP)/lib/krb5/ccche/cc_file.c -o \
+ -path $(SRCTOP)/lib/krb5/krb/deltat.c -o \
+ -path $(SRCTOP)/lib/krb5/krb/preauth.c -o \
+ -path $(SRCTOP)/lib/krb5/krb/ser_ctx.c -o \
+ -path $(SRCTOP)/lib/krb5/krb/strftime.c -o \
+ -path $(SRCTOP)/lib/krb5/krb/strptime.c -o \
+ -path $(SRCTOP)/lib/krb5/unicode \
\) -prune -o \
-name '*.[ch]' \
-print0 | $(XARGS) -0 $(EMACS) -q -batch \
Modified: trunk/src/util/krb5-batch-reindent.el
===================================================================
--- trunk/src/util/krb5-batch-reindent.el 2009-10-30 10:49:38 UTC (rev 23095)
+++ trunk/src/util/krb5-batch-reindent.el 2009-10-30 21:34:19 UTC (rev 23096)
@@ -3,22 +3,26 @@
(error "to be used only with -batch"))
;; Avoid vc-mode interference.
(setq vc-handled-backends nil)
+
+;; for debugging
+(defun report-tabs ()
+ (let ((tab-found (search-forward "\t" nil t)))
+ (if tab-found
+ (message "Tab found @%s." tab-found)
+ (message "No tabs found."))))
+
(while command-line-args-left
(let ((filename (car command-line-args-left))
- (error nil)
- ;; No backup files?
+ ;; No backup files; we have version control.
(make-backup-files nil))
(find-file filename)
+ (message "Read %s." filename)
- ;; (goto-char (point-min))
- ;; (if (looking-at "\\s-*/\\*\\s-*-\\*-.*-\\*-\\s-*\\*/\\s-*\n")
- ;; (delete-region (match-beginning 0) (match-end 0)))
- ;; (insert "/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n")
- ;; (normal-mode)
+ (if (not indent-tabs-mode)
+ (progn
+ (message "Untabifying...")
+ (untabify (point-min) (point-max))))
- (if (eq indent-tabs-mode nil)
- (untabify (point-min) (point-max)))
-
;; Only reindent if the file C style is guessed to be "krb5".
;; Note that krb5-c-style.el already has a heuristic for setting
;; the C style if the file has "c-basic-offset: 4;
@@ -26,7 +30,22 @@
(if (equal c-indentation-style "krb5")
(c-indent-region (point-min) (point-max)))
- (whitespace-cleanup)
+ ;; Sometimes whitespace-cleanup gets its internals confused
+ ;; when whitespace-mode hasn't been activated on the buffer.
+ (let ((whitespace-indent-tabs-mode indent-tabs-mode)
+ (whitespace-style '(empty trailing)))
+ ;; Only clean up tab issues if indent-tabs-mode is explicitly
+ ;; set in the file local variables.
+ (if (assq 'indent-tabs-mode file-local-variables-alist)
+ (progn
+ (message "Enabling tab cleanups.")
+ (add-to-list 'whitespace-style 'indentation)
+ (add-to-list 'whitespace-style 'space-before-tab)
+ (add-to-list 'whitespace-style 'space-after-tab)))
+;; (message "indent-tabs-mode=%s" indent-tabs-mode)
+ (setq tab-found (search-forward "\t" nil t))
+ (message "Cleaning whitespace...")
+ (whitespace-cleanup))
(save-buffer)
(kill-buffer)
More information about the cvs-krb5
mailing list