all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Rüdiger Sonderfeld" <ruediger@c-plusplus.de>
To: emacs-devel@gnu.org
Cc: Thien-Thi Nguyen <ttn@gnu.org>
Subject: Re: [PATCH 2] Add support for C++ headers to `ffap'.
Date: Tue, 01 Oct 2013 00:11:01 +0200	[thread overview]
Message-ID: <3329488.PbsQCtPhet@descartes> (raw)
In-Reply-To: <5477680.YgUupvPcjf@descartes>

*ping*

Any comment about the updated version?

Regards,
Rüdiger Sonderfeld

On Friday 20 September 2013 12:10:55 Rüdiger Sonderfeld wrote:
> This updated version also checks if GCC was configured with
> `--with-gxx-include-dir='.
> 
> --- 8< ------------------------------------------------------------- >8 ---
> 
> Using only `ffap-c-mode' does not work for C++ headers from
> libstdc++.  Those headers are usually stored in
> "/usr/include/c++/<version>/".
> 
> * lisp/ffap.el (ffap-c++-path): New variable.
> (ffap-c++-mode): New function.
> (ffap-alist): Use `ffap-c++-mode' for `c++-mode'.
> 
> Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
> ---
>  lisp/ffap.el | 24 +++++++++++++++++++++++-
>  1 file changed, 23 insertions(+), 1 deletion(-)
> 
> diff --git a/lisp/ffap.el b/lisp/ffap.el
> index 737de8b..79539a4 100644
> --- a/lisp/ffap.el
> +++ b/lisp/ffap.el
> @@ -769,7 +769,7 @@ (defvar ffap-alist
>      ;; (lisp-interaction-mode . ffap-el-mode) ; maybe
>      (finder-mode . ffap-el-mode)	; type {C-h p} and try it
>      (help-mode . ffap-el-mode)		; maybe useful
> -    (c++-mode . ffap-c-mode)		; search ffap-c-path
> +    (c++-mode . ffap-c++-mode)		; search ffap-c++-path
>      (cc-mode . ffap-c-mode)		; same
>      ("\\.\\([chCH]\\|cc\\|hh\\)\\'" . ffap-c-mode) ; stdio.h
>      (fortran-mode . ffap-fortran-mode)	; FORTRAN requested by MDB
> @@ -866,6 +866,28 @@ (defvar ffap-c-path
>  (defun ffap-c-mode (name)
>    (ffap-locate-file name t ffap-c-path))
> 
> +(defvar ffap-c++-path
> +  (let ((c++-include-dir (with-temp-buffer
> +                           (when (eq 0 (ignore-errors
> +                                         (call-process "g++" nil t nil
> "-v"))) +                             (goto-char (point-min))
> +                             (if (re-search-forward
> "--with-gxx-include-dir=\ +\\([^[:space:]]+\\)"
> +                                                      nil 'noerror)
> +                                 (match-string 1)
> +                               (when (re-search-forward "gcc version \
> +\\([[:digit:]]+.[[:digit:]]+.[[:digit:]]+\\)"
> +                                                   nil 'noerror)
> +                                 (expand-file-name (match-string 1)
> +                                                  
> "/usr/include/c++/"))))))) +    (if c++-include-dir
> +        (cons c++-include-dir ffap-c-path)
> +      ffap-c-path))
> +  "List of directories to search for include files.")
> +
> +(defun ffap-c++-mode (name)
> +  (ffap-locate-file name t ffap-c++-path))
> +
>  (defvar ffap-fortran-path '("../include" "/usr/include"))
> 
>  (defun ffap-fortran-mode (name)



      reply	other threads:[~2013-09-30 22:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-19 21:51 [PATCH] Add support for C++ headers to `ffap' Rüdiger Sonderfeld
2013-09-20  5:26 ` Thien-Thi Nguyen
2013-09-20  5:47   ` Kalle Olavi Niemitalo
2013-09-20  8:47     ` Andreas Schwab
2013-09-20  8:36   ` Rüdiger Sonderfeld
2013-10-19  2:36     ` Glenn Morris
2013-09-20 10:10 ` [PATCH 2] " Rüdiger Sonderfeld
2013-09-30 22:11   ` Rüdiger Sonderfeld [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3329488.PbsQCtPhet@descartes \
    --to=ruediger@c-plusplus.de \
    --cc=emacs-devel@gnu.org \
    --cc=ttn@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.