Small feature request. In my project I divide sources and headers, so I need extend function eassist-switch-h-cpp.
I am not professional in elisp. My version is:
;; Added by Andrew P. Falaleev
(defvar eassist-search-path '("../")
"List of search paths for headers and sources")
(defun eassist-switch-h-cpp ()
"Switch header and body file according to `eassist-header-switches' var.
The current buffer's file name extention is searched in
`eassist-header-switches' variable to find out extention for file's counterpart,
for example *.hpp <--> *.cpp."
(let* ((ext (file-name-extension (buffer-file-name)))
(base-name (eassist-string-without-last (file-name-nondirectory (buffer-file-name))
(eassist-string-without-last (buffer-file-name) (length ext))
(count-ext (cdr (find-if (lambda (i) (string= (car i) ext)) eassist-header-switches))))
(loop for b in (mapcar (lambda (i) (concat base-name i)) count-ext)
when (bufferp (get-buffer b)) return (switch-to-buffer b))
;; (loop for c in (mapcar (lambda (i) (concat base-path base-name i)) count-ext)
(loop for c in (mapcar (lambda (j)
(mapcar (lambda (i)
(concat base-path i base-name j))
(loop for b in c
when (file-exists-p b) return (find-file b))))
(message "There is no corresponding pair (header or body) file.")))
(message "It is not a header or body file! See eassist-header-switches variable.")))))
May be you add my changes to the sources? This is more flexible for some situations.