From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: How do I find out what minor modes are in effect? Date: Thu, 12 Apr 2012 09:33:28 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1334237714 2151 80.91.229.3 (12 Apr 2012 13:35:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 12 Apr 2012 13:35:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 12 15:35:14 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 1SIKB7-0007Wo-J6 for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Apr 2012 15:35:13 +0200 Original-Received: from localhost ([::1]:42173 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIKB6-0002rx-Oc for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Apr 2012 09:35:12 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe01.iad.POSTED!00000000!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) Cancel-Lock: sha1:fQmcI2okCv83mgEuO4iMzzfvrI0= Original-Lines: 15 Original-X-Complaints-To: abuse@UsenetServer.com Original-NNTP-Posting-Date: Thu, 12 Apr 2012 13:33:28 UTC X-Received-Bytes: 1302 Original-Xref: usenet.stanford.edu gnu.emacs.help:192022 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:84438 Archived-At: > The practical, first-time implementation is in place and works. > Now it's time to write the (save-mode) macro. > (Which means I suddenly have to get better at writing macros. Darn!) BTW, an alternative approach can rely on `buffer-local-variables': just stash away the value of all variables that are buffer-local, so you can re-set them later. The downside is that it won't enable the major/minor modes explicitly upon restore, so the mode hooks won't be run, and some other state may be missing (e.g. if a minor mode relies on a timer, the restore may fail to re-start the timer). Stefan