From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.help Subject: Re: How do I find out what minor modes are in effect? Date: Wed, 11 Apr 2012 19:28:54 +0530 Message-ID: <81fwcacqu9.fsf@gmail.com> References: <495248DFDEA08C469BBDED2D4AA6C614425608@DAKIYA1.pegasus.local> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1334152794 5182 80.91.229.3 (11 Apr 2012 13:59:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Apr 2012 13:59:54 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: Doug Lewan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 11 15:59:53 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SHy5Q-0007PR-Bp for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Apr 2012 15:59:52 +0200 Original-Received: from localhost ([::1]:38269 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHy5P-0000t1-OB for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Apr 2012 09:59:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHy57-0000lC-O0 for help-gnu-emacs@gnu.org; Wed, 11 Apr 2012 09:59:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHy4m-0003uN-63 for help-gnu-emacs@gnu.org; Wed, 11 Apr 2012 09:59:33 -0400 Original-Received: from mail-pz0-f52.google.com ([209.85.210.52]:43065) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHy4l-0003qM-TH for help-gnu-emacs@gnu.org; Wed, 11 Apr 2012 09:59:12 -0400 Original-Received: by dake40 with SMTP id e40so1145445dak.39 for ; Wed, 11 Apr 2012 06:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=sgO26p+C/qFCYiFy/IvEDOLCOyE500mHoF/A0cAvHbg=; b=yGrEHi3icXalajGjbPzn4yPwopB4qO5h7GsGQReDwFes3zUOzW52RifURTmP++fsiE CXR/shDqKGokdWzJCqNxChXiGjqS4TroxDdnPgD3nxBldssgWNp8fKlBfRp1DrvvZ9Nc 5gN5ATLzQHH2e0CZqhxoOOuMhojab4ndLN3WbYfPeElOUPzzBBDcS60I/yjQJ4xavt3I 90/+2BD3f1lslkZJUyg0j3IuDNwYcdE7s34YJEi8NvNpoMN2i2f6llbigyJpxgwaXexa l48EIiYPMdK4nGBWygleFOY58ugv88iIIH2Ky+b2uYLbgJSaMrFssUkcuqzNhKRZXW7J gWkg== Original-Received: by 10.68.125.226 with SMTP id mt2mr38198842pbb.38.1334152749720; Wed, 11 Apr 2012 06:59:09 -0700 (PDT) Original-Received: from JAMBU-NETBOOK ([115.242.254.219]) by mx.google.com with ESMTPS id d3sm2974720pbq.9.2012.04.11.06.59.05 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Apr 2012 06:59:08 -0700 (PDT) In-Reply-To: <495248DFDEA08C469BBDED2D4AA6C614425608@DAKIYA1.pegasus.local> (Doug Lewan's message of "Wed, 11 Apr 2012 13:49:22 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (windows-nt) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.52 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84425 Archived-At: Doug Lewan writes: > I'm writing a function that needs to change the major mode to do its stuff properly. > That can turn off minor modes too. > The obvious polite thing to do is turn them all back on when I'm done. > > Resetting the major mode is easy: > (defun vertical-text (text) > (let ((mode-to-restore major-mode) > (picture-mode) > ... > (funcall mode-to-restore))) > > How do I find out what minor modes are in effect? > And in what order they were invoked? > (They can stomp on each other and > I'd rather not introduce bugs > that are different from what the user already expects. > > (Ultimately, I think this might be generally useful, > so a function like (save-mode) might emerge.) When in "message-mode" (the buffer I am composing this message in) and I do C-h m I see the following at the top of the resulting "Help" buffer. ,---- C-h m | Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption | Auto-Fill Column-Number File-Name-Shadow Font-Lock Footnote | Global-Font-Lock Gnus-Message-Citation Ido-Everywhere Iswitchb | Line-Number Mml Mouse-Wheel Shell-Dirtrack Tooltip Transient-Mark | Which-Function `---- This suggests that you can steal some code from the C-h k C-h m . M-x find-function RET describe-mode RET > ,Douglas > Douglas Lewan > Shubert Ticketing > (201) 489-8600 ext 224 > > > > --