Commit 08848e33 authored by Dima Kogan's avatar Dima Kogan Committed by Noam Postavsky

Make ff-find-other-file symmetric for C++ (Bug#20192)

`cc-other-file-alist' has a mapping of file extensions to switch
between headers and sources, but the mappings weren't completely
symmetric.  In particular .cpp would map to .hh, but .hh would NOT map
to .cpp.

* lisp/find-file.el (cc-other-file-alist): Map ".hh" and ".h" to all
C++ extensions to make them symmetric with the C++ extensions that map
to them.  This lets repeated invocations of `ff-find-other-file'
toggle between all pairs of sources/headers.
parent 32f80eb6
......@@ -242,11 +242,11 @@ the preceding slash. The star represents all the subdirectories except
(defcustom cc-other-file-alist
'(("\\.cc\\'" (".hh" ".h"))
("\\.hh\\'" (".cc" ".C"))
("\\.hh\\'" (".cc" ".C" ".CC" ".cxx" ".cpp" ".c++"))
("\\.c\\'" (".h"))
("\\.m\\'" (".h"))
("\\.h\\'" (".c" ".cc" ".C" ".CC" ".cxx" ".cpp" ".m"))
("\\.h\\'" (".c" ".cc" ".C" ".CC" ".cxx" ".cpp" ".c++" ".m"))
("\\.C\\'" (".H" ".hh" ".h"))
("\\.H\\'" (".C" ".CC"))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment