aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-02-22 00:34:02 -0800
committerGlenn Morris2012-02-22 00:34:02 -0800
commitac2eceeee1884be2a4187f5daa3b186cbd6f5a15 (patch)
tree7ce08f35766b87b47cbc692a36a12c3bfde53e7a
parent40ace058dc04202e2e21e4754b7ed8fe08b124c3 (diff)
downloademacs-ac2eceeee1884be2a4187f5daa3b186cbd6f5a15.tar.gz
emacs-ac2eceeee1884be2a4187f5daa3b186cbd6f5a15.zip
Fixes related to /usr/include path on multiarch systems
* lisp/ffap.el (ffap-c-path): * lisp/man.el (Man-header-file-path): Handle multiarch. Fixes: debbugs:10702
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/ffap.el19
-rw-r--r--lisp/man.el13
3 files changed, 34 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c91a900dfe1..4f025f3051e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-02-22 Glenn Morris <rgm@gnu.org>
2
3 * ffap.el (ffap-c-path):
4 * man.el (Man-header-file-path): Handle multiarch. (Bug#10702)
5
12012-02-22 Chong Yidong <cyd@gnu.org> 62012-02-22 Chong Yidong <cyd@gnu.org>
2 7
3 * custom.el (load-theme): Doc fix. 8 * custom.el (load-theme): Doc fix.
diff --git a/lisp/ffap.el b/lisp/ffap.el
index c3797536f19..99017d27490 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -850,9 +850,24 @@ URL, or nil. If nil, search the alist for further matches.")
850 (and (not (string-match "\\.el\\'" name)) 850 (and (not (string-match "\\.el\\'" name))
851 (ffap-locate-file name '(".el") load-path))) 851 (ffap-locate-file name '(".el") load-path)))
852 852
853;; FIXME this duplicates the logic of Man-header-file-path.
854;; There should be a single central variable or function for this.
855;; See also (bug#10702):
856;; cc-search-directories, semantic-c-dependency-system-include-path,
857;; semantic-gcc-setup
853(defvar ffap-c-path 858(defvar ffap-c-path
854 ;; Need smarter defaults here! Suggestions welcome. 859 (let ((arch (with-temp-buffer
855 '("/usr/include" "/usr/local/include")) 860 (when (eq 0 (ignore-errors
861 (call-process "gcc" nil '(t nil) nil
862 "-print-multiarch")))
863 (goto-char (point-min))
864 (buffer-substring (point) (line-end-position)))))
865 (base '("/usr/include" "/usr/local/include")))
866 (if (zerop (length arch))
867 base
868 (append base (list (expand-file-name arch "/usr/include")))))
869 "List of directories to search for include files.")
870
856(defun ffap-c-mode (name) 871(defun ffap-c-mode (name)
857 (ffap-locate-file name t ffap-c-path)) 872 (ffap-locate-file name t ffap-c-path))
858 873
diff --git a/lisp/man.el b/lisp/man.el
index 7698cc255b7..0a7b831ca8e 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -215,9 +215,20 @@ the associated section number."
215 (string :tag "Real Section"))) 215 (string :tag "Real Section")))
216 :group 'man) 216 :group 'man)
217 217
218;; FIXME see comments at ffap-c-path.
218(defcustom Man-header-file-path 219(defcustom Man-header-file-path
219 '("/usr/include" "/usr/local/include") 220 (let ((arch (with-temp-buffer
221 (when (eq 0 (ignore-errors
222 (call-process "gcc" nil '(t nil) nil
223 "-print-multiarch")))
224 (goto-char (point-min))
225 (buffer-substring (point) (line-end-position)))))
226 (base '("/usr/include" "/usr/local/include")))
227 (if (zerop (length arch))
228 base
229 (append base (list (expand-file-name arch "/usr/include")))))
220 "C Header file search path used in Man." 230 "C Header file search path used in Man."
231 :version "24.1" ; add multiarch
221 :type '(repeat string) 232 :type '(repeat string)
222 :group 'man) 233 :group 'man)
223 234