all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* text modes vs. programming language modes
@ 2006-08-22 15:38 Kevin Rodgers
  2006-08-22 16:23 ` Eric Hanchrow
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Rodgers @ 2006-08-22 15:38 UTC (permalink / raw)


Is there a reliable way to determine whether the current major mode
is a text mode vs. a programming language mode?  For example, do all
text modes use a keymap that inherits from text-mode-map or a syntax
table that inherits from text-mode-syntax-table?

I suspect not, so I'm thinking of using something like:

(defun major-mode-type ()
   (let ((lisp-directory (expand-file-name "../lisp" data-directory))
	(mode-directory (directory-file-name
			 (file-name-directory
			  (symbol-file major-mode 'defun)))))
     (and (not (equal lisp-directory mode-directory))
	 (file-relative-name mode-directory lisp-directory))))

which e.g. returns nil for dired-mode and Info-mode, "textmodes" for 
text-mode and sgml-mode,  and "progmodes" for java-mode and sql-mode.

-- 
Kevin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-22 16:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-22 15:38 text modes vs. programming language modes Kevin Rodgers
2006-08-22 16:23 ` Eric Hanchrow

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.