-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 \
(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 (eq indent-tabs-mode nil)
- (untabify (point-min) (point-max)))
+ (if (not indent-tabs-mode)
+ (progn
+ (message "Untabifying...")
+ (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
(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)