[CEDET-devel] Enhancement of the eassist-switch-h-cpp
Brought to you by:
zappo
From: Kiwon Um <um....@gm...> - 2010-01-30 13:22:30
|
Dear cedet devel team: This is for an enhancement of the eassist-switch-h-cpp function in eassist.el. When one switches between header and source file, the corresponding file (or buffer) might be already visible on other window. So I modified the function such that if the header/source file is already visible, switch to that buffer. The patch is as follows: *************** *** 143,149 **** (unless (or (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 (count-ext) (concat base-path count-ext)) count-ext) when (file-exists-p c) return (find-file c))) (message "There is no corresponding pair (header or body) file."))) --- 143,151 ---- (unless (or (loop for b in (mapcar (lambda (i) (concat base-name i)) count-ext) ! when (bufferp (get-buffer b)) return (if (get-buffer-window b) ! (switch-to-buffer-other-window b) ! (switch-to-buffer b))) (loop for c in (mapcar (lambda (count-ext) (concat base-path count-ext)) count-ext) when (file-exists-p c) return (find-file c))) (message "There is no corresponding pair (header or body) file."))) Please check this if it's valuable. Kiwon Um |