X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/ba3189039adc8ec5eba5ed3e21d42019a4616b7c..32a2c91658bd02c4e761030f93eb5f0415524104:/lisp/progmodes/cc-align.el diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el index 05d796c470..4db310d4ee 100644 --- a/lisp/progmodes/cc-align.el +++ b/lisp/progmodes/cc-align.el @@ -1,6 +1,6 @@ ;;; cc-align.el --- custom indentation functions for CC Mode -;; Copyright (C) 1985, 1987, 1992-2014 Free Software Foundation, Inc. +;; Copyright (C) 1985, 1987, 1992-2015 Free Software Foundation, Inc. ;; Authors: 2004- Alan Mackenzie ;; 1998- Martin Stjernholm @@ -1229,6 +1229,18 @@ Works with: Any syntactic symbol." (back-to-indentation) (vector (current-column)))) +(defun c-lineup-respect-col-0 (langelem) + "If the current line starts at column 0, return [0]. Otherwise return nil. + +This can be used for comments (in conjunction with, say, +`c-lineup-comment'), to keep comments already at column 0 +anchored there, but reindent other comments." + (save-excursion + (back-to-indentation) + (if (eq (current-column) 0) + [0] + nil))) + (defun c-snug-do-while (syntax pos) "Dynamically calculate brace hanginess for do-while statements. @@ -1333,4 +1345,8 @@ For other semicolon contexts, no determination is made." (cc-provide 'cc-align) +;;; Local Variables: +;;; indent-tabs-mode: t +;;; tab-width: 8 +;;; End: ;;; cc-align.el ends here