unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / 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

* Re: text modes vs. programming language modes
  2006-08-22 15:38 text modes vs. programming language modes Kevin Rodgers
@ 2006-08-22 16:23 ` Eric Hanchrow
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Hanchrow @ 2006-08-22 16:23 UTC (permalink / raw)


>>>>> "Kevin" == Kevin Rodgers <ihs_4664@yahoo.com> writes:

    Kevin> Is there a reliable way to determine whether the current
    Kevin> major mode is a text mode vs. a programming language mode?

I wouldn't think so, if for no other reason than that the terms aren't
well defined.

-- 
In the movie Ghostbusters, there's a sign in the background of
one scene that says, "Danger! 10,000 Ohms!" I cannot explain to
laymen why people like me think that is uproariously funny.
        -- Steven den Beste

^ 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).