Automatically detect whether .h file is C or C++
* lisp/progmodes/cc-mode.el (c-or-c++-mode): A new function which
- analyses contents of the buffer to determine whether it looks like C++
+ analyzes contents of the buffer to determine whether it looks like C++
source code and based on that enables c-mode or c++-mode.
(c-or-c++-mode--regexp): Regular expression which, when matches
a buffer, signals file is C++.
---
*** Opening a .h file will turn C or C++ mode depending on language used.
-This is done with the help of 'c-or-c++-mode' function which analyses
-contents of the buffer to determine whether it's a C or C++ source
-file.
+This is done with the help of the 'c-or-c++-mode' function, which
+analyzes buffer contents to infer whether it's a C or C++ source file.
---
** New option 'cpp-message-min-time-interval' to allow user control
(setq short rel))))
short))
-(defun help-fns--analyse-function (function)
+(defun help-fns--analyze-function (function)
;; FIXME: Document/explain the differences between FUNCTION,
;; REAL-FUNCTION, DEF, and REAL-DEF.
"Return information about FUNCTION.
(defun help-fns-function-description-header (function)
"Print a line describing FUNCTION to `standard-output'."
(pcase-let* ((`(,_real-function ,def ,aliased ,real-def)
- (help-fns--analyse-function function))
+ (help-fns--analyze-function function))
(file-name (find-lisp-object-file-name function (if aliased 'defun
def)))
(beg (if (and (or (byte-code-function-p def)
(terpri)(terpri)
(pcase-let* ((`(,real-function ,def ,_aliased ,real-def)
- (help-fns--analyse-function function))
+ (help-fns--analyze-function function))
(doc-raw (condition-case nil
;; FIXME: Maybe `documentation' should return nil
;; for invalid functions i.s.o. signaling an error.
;;;###autoload
(defun c-or-c++-mode ()
- "Analyse buffer and enable either C or C++ mode.
+ "Analyze buffer and enable either C or C++ mode.
Some people and projects use .h extension for C++ header files
which is also the one used for C header files. This makes