Skip to content

Commit

Permalink
>>> merge git branch
Browse files Browse the repository at this point in the history
commit 240a8a0
Author: Daniel Hackney <[email protected]>
Date:   Wed Apr 25 21:13:31 2012 -0400

    Untabify all elisp.

    Many elisp files had tabs in comments or headers which was not removed by
    `indent-region'. This patch runs `untabify' on all elisp files.

    Once again, this can be applied to all elisp files with:

        (require 'cl)

        (defun recursive-files (dir func)
          (loop with before-save-hook
                for (file is-dir)
                  in (directory-files-and-attributes dir t "^[^.]")
                if is-dir
                  do (recursive-files file func)
                else
                  if (string-match ".*\.el$" file)
                    do (with-current-buffer (find-file-noselect file)
                         (funcall func)
                         (basic-save-buffer)
                         (kill-buffer))))

        (recursive-files "/path/to/ess" #'(lambda () (untabify (point-min) (point-max))))

    This should be applied on top of my reindentation patch.

commit ad6d16e
Author: Daniel Hackney <[email protected]>
Date:   Wed Apr 25 21:02:54 2012 -0400

    Reindent all elisp files.

    Now that whitespace style and line-ending conventions are established, reindent
    all elisp files accordingly.

    This is accomplished by the following code

        (require 'cl)

        (defun recursive-files (dir func)
          (loop with before-save-hook
                for (file is-dir)
                  in (directory-files-and-attributes dir t "^[^.]")
                if is-dir
                  do (recursive-files file func)
                else
                  if (string-match ".*\.el$" file)
                    do (with-current-buffer (find-file-noselect file)
                         (funcall func)
                         (basic-save-buffer)
                         (kill-buffer))))

        (recursive-files "/path/to/ess" #'(lambda ()
                                            (whitespace-cleanup)
                                            (indent-region (point-min) (point-max))))

    This will walk through all elisp files under "/path/to/ess" and clean up
    whitespace and re-indent the file. The `whitespace-cleanup' in the `lambda' is
    necessary because `indent-region' will not replace tabs with spaces if a line is
    already indented to the correct column using tabs. Running `whitespace-cleanup'
    first ensures that the file is indented strictly with spaces.

    A stricter version of this would be:

        (recursive-files "~/work/ESS" #'(lambda ()
                                          (while (re-search-forward "\t" nil t)
                                            (replace-match " "))
                                          (indent-region (point-min) (point-max))))

    Which would remove all tab characters from all elisp files. This patch only runs
    `whitespace-cleanup' to remove leading tabs.

git-svn-id: https://svn.r-project.org/ESS/trunk@4813 0bbaf3bd-34e0-0310-bf65-c717079852d4
  • Loading branch information
vspinu committed Apr 27, 2012
1 parent c90cdaf commit 4439de3
Show file tree
Hide file tree
Showing 66 changed files with 4,142 additions and 4,142 deletions.
40 changes: 20 additions & 20 deletions doc/useR-2006-ESS/Lab1/auto/cph-1-lab.el
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
(TeX-add-style-hook "cph-1-lab"
(function
(lambda ()
(LaTeX-add-labels
"sec:emacs"
"sec:commandline"
"sec:cutpaste"
"sec:cutpaste:eff1"
"sec:cutpaste:eff2"
"sec:edit"
"sec:example"
"start"
"sec:using-sas"
"sec:emacs:uwbiostat")
(TeX-run-style-hooks
"html"
"palatino"
"hyperref"
"latex2e"
"art10"
"article"))))
(function
(lambda ()
(LaTeX-add-labels
"sec:emacs"
"sec:commandline"
"sec:cutpaste"
"sec:cutpaste:eff1"
"sec:cutpaste:eff2"
"sec:edit"
"sec:example"
"start"
"sec:using-sas"
"sec:emacs:uwbiostat")
(TeX-run-style-hooks
"html"
"palatino"
"hyperref"
"latex2e"
"art10"
"article"))))
48 changes: 24 additions & 24 deletions doc/useR-2006-ESS/Lab2/auto/Sweave-Example.el
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
(TeX-add-style-hook "Sweave-Example"
(function
(lambda ()
(LaTeX-add-labels
"CHA:tables"
"CHA:figures"
"fig:control")
(TeX-run-style-hooks
"graphicx"
"natbib"
"authoryear"
"round"
"url"
"hyperref"
"dvips"
"graphicx"
"dvips"
"hyperref"
"pdftex"
"graphicx"
"pdftex"
"latex2e"
"rep12"
"report"
"12pt"))))
(function
(lambda ()
(LaTeX-add-labels
"CHA:tables"
"CHA:figures"
"fig:control")
(TeX-run-style-hooks
"graphicx"
"natbib"
"authoryear"
"round"
"url"
"hyperref"
"dvips"
"graphicx"
"dvips"
"hyperref"
"pdftex"
"graphicx"
"pdftex"
"latex2e"
"rep12"
"report"
"12pt"))))
Loading

0 comments on commit 4439de3

Please sign in to comment.