* bug#20192: [PATCH] for C or C++ sources (ff-find-other-file) now has a symmetric mapping
@ 2015-03-24 19:54 Dima Kogan
2016-02-23 10:44 ` Lars Ingebrigtsen
0 siblings, 1 reply; 3+ messages in thread
From: Dima Kogan @ 2015-03-24 19:54 UTC (permalink / raw)
To: 20192
[-- Attachment #1: Type: text/plain, Size: 384 bytes --]
Hi
`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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-for-C-or-C-sources-ff-find-other-file-now-has-a-symm.patch --]
[-- Type: text/x-diff, Size: 1349 bytes --]
From 9175ffbbd0691fe2084933e47b4d6649ad243f5d Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima@secretsauce.net>
Date: Tue, 24 Mar 2015 12:53:08 -0700
Subject: [PATCH] for C or C++ sources, (ff-find-other-file) now has a
symmetric mapping
`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.
---
lisp/find-file.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/find-file.el b/lisp/find-file.el
index 97e95d2..a5d15c5 100644
--- 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"))
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#20192: [PATCH] for C or C++ sources (ff-find-other-file) now has a symmetric mapping
2015-03-24 19:54 bug#20192: [PATCH] for C or C++ sources (ff-find-other-file) now has a symmetric mapping Dima Kogan
@ 2016-02-23 10:44 ` Lars Ingebrigtsen
2017-05-21 23:25 ` npostavs
0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-23 10:44 UTC (permalink / raw)
To: Dima Kogan; +Cc: 20192
Dima Kogan <dima@secretsauce.net> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#20192: [PATCH] for C or C++ sources (ff-find-other-file) now has a symmetric mapping
2016-02-23 10:44 ` Lars Ingebrigtsen
@ 2017-05-21 23:25 ` npostavs
0 siblings, 0 replies; 3+ messages in thread
From: npostavs @ 2017-05-21 23:25 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Dima Kogan, 20192
tags 20192 fixed
close 20192 26.1
quit
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Dima Kogan <dima@secretsauce.net> 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?
Seems like a straightforward improvement, pushed to master [1: 08848e33ba].
[1: 08848e33ba]: 2017-05-21 17:43:02 -0400
Make ff-find-other-file symmetric for C++ (Bug#20192)
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=08848e33baf16d3137b171205f51839d8fcf7d06
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-21 23:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-24 19:54 bug#20192: [PATCH] for C or C++ sources (ff-find-other-file) now has a symmetric mapping Dima Kogan
2016-02-23 10:44 ` Lars Ingebrigtsen
2017-05-21 23:25 ` npostavs
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.