summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-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 @@
+2012-02-22 Glenn Morris <rgm@gnu.org>
+
+ * ffap.el (ffap-c-path):
+ * man.el (Man-header-file-path): Handle multiarch. (Bug#10702)
+
2012-02-22 Chong Yidong <cyd@gnu.org>
* 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.")
(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))
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."
(string :tag "Real Section")))
:group 'man)
+;; FIXME see comments at ffap-c-path.
(defcustom Man-header-file-path
- '("/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")))))
"C Header file search path used in Man."
+ :version "24.1" ; add multiarch
:type '(repeat string)
:group 'man)