> (defun codesearch-mode-to-lang (mode)
> "map emacs mode to variable in Code Search querystring (list is
> far from complete)."
[...]
How 'bout something like:
(require 'cl)
(defun codesearch-mode-to-lang (mode)
"Map Emacs mode to variable in Code Search querystring.
\(list is far from complete)."
(case
((emacs-lisp-mode lisp-interaction-mode) "lisp")
(objc-mode "objectivec")
(sh-mode "shell")
(t
(let ((mode-name (symbol-name mode)))
(if (string-match "-mode\\'" mode-name)
(substring mode 0 (match-beginning 0))
(error "Don't know how to guess the language name for %s" mode))))))
-- Stefan
_______________________________________________
gnu-emacs-sources mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources