X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/f7ff1b0f0792f1f870778404531e68e77832c4a1..ed571ccb1d14abc788a29c3b3bbf08aa4b951ab8:/lisp/ffap.el diff --git a/lisp/ffap.el b/lisp/ffap.el index 97105ed422..52ffc9905e 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1,6 +1,6 @@ ;;; ffap.el --- find file (or url) at point -;; Copyright (C) 1995-1997, 2000-2011 Free Software Foundation, Inc. +;; Copyright (C) 1995-1997, 2000-2012 Free Software Foundation, Inc. ;; Author: Michelangelo Grigni ;; Maintainer: FSF @@ -523,7 +523,7 @@ The optional NOMODIFY argument suppresses the extra search." ;; (ffap-file-remote-p "/ffap.el:80") (or (and ffap-ftp-regexp (string-match ffap-ftp-regexp filename) - ;; Convert "/host.com://dir" to "/host:/dir", to handle a dieing + ;; Convert "/host.com://dir" to "/host:/dir", to handle a dying ;; practice of advertising ftp files as "host.dom://filename". (if (string-match "//" filename) ;; (replace-match "/" nil nil filename) @@ -850,9 +850,24 @@ URL, or nil. If nil, search the alist for further matches.") (and (not (string-match "\\.el\\'" name)) (ffap-locate-file name '(".el") load-path))) +;; FIXME this duplicates the logic of Man-header-file-path. +;; There should be a single central variable or function for this. +;; See also (bug#10702): +;; cc-search-directories, semantic-c-dependency-system-include-path, +;; semantic-gcc-setup (defvar ffap-c-path - ;; Need smarter defaults here! Suggestions welcome. - '("/usr/include" "/usr/local/include")) + (let ((arch (with-temp-buffer + (when (eq 0 (ignore-errors + (call-process "gcc" nil '(t nil) nil + "-print-multiarch"))) + (goto-char (point-min)) + (buffer-substring (point) (line-end-position))))) + (base '("/usr/include" "/usr/local/include"))) + (if (zerop (length arch)) + base + (append base (list (expand-file-name arch "/usr/include"))))) + "List of directories to search for include files.") + (defun ffap-c-mode (name) (ffap-locate-file name t ffap-c-path)) @@ -1457,7 +1472,7 @@ and the functions `ffap-file-at-point' and `ffap-url-at-point'." ;;; Menu support (`ffap-menu'): (defvar ffap-menu-regexp nil - "*If non-nil, overrides `ffap-next-regexp' during `ffap-menu'. + "If non-nil, overrides `ffap-next-regexp' during `ffap-menu'. Make this more restrictive for faster menu building. For example, try \":/\" for URL (and some ftp) references.")