Subject: bug#20192: [PATCH] for C or C++ sources (ff-find-other-file) now has a symmetric mapping

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 23 Feb 2016 21:44:43 +1100

Dima Kogan <[email-masked]> writes:

> `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.  This patch updates the mappings to always contain symmetric
> pairs so that repeated invocations of (ff-find-other-file) can toggle
> between all pairs of sources/headers.

I think this sounds like a reasonable addition, but that's not a
function I've ever used, so I can't really say.  Does anybody object to
this change?

--- a/lisp/find-file.el
+++ b/lisp/find-file.el
@@ -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"))

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no