From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: A few questions about desktop.el Date: Fri, 22 Jul 2005 04:42:32 +0200 Message-ID: Reply-To: Juanma Barranquero NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1122000478 1877 80.91.229.2 (22 Jul 2005 02:47:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 22 Jul 2005 02:47:58 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 22 04:47:56 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DvnZn-00020Y-3b for ged-emacs-devel@m.gmane.org; Fri, 22 Jul 2005 04:47:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dvnbu-00068I-Ed for ged-emacs-devel@m.gmane.org; Thu, 21 Jul 2005 22:50:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DvnbC-0005xS-2F for emacs-devel@gnu.org; Thu, 21 Jul 2005 22:49:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dvnb1-0005r2-P4 for emacs-devel@gnu.org; Thu, 21 Jul 2005 22:49:09 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dvnb0-0005q3-IZ for emacs-devel@gnu.org; Thu, 21 Jul 2005 22:49:06 -0400 Original-Received: from [64.233.182.194] (helo=nproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DvneQ-0006IZ-UA for emacs-devel@gnu.org; Thu, 21 Jul 2005 22:52:39 -0400 Original-Received: by nproxy.gmail.com with SMTP id i2so15707nfe for ; Thu, 21 Jul 2005 19:42:32 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=dAftT2qqM5vW5OLunprhdcBnkTmuG8FeMrtwk6Hg48d184LvRo9sNrKt4YDK7Dx/MB3Kp/8H9//zwRVxTQZnAFTvjm4DxfUuCSAngFQcKjvf9hifFpHf5ycwuULedDsz0NOfF3Ju+NbXuoFAIBKw00vQfqmz53SBnR7tih48JxQ= Original-Received: by 10.48.250.9 with SMTP id x9mr77162nfh; Thu, 21 Jul 2005 19:42:32 -0700 (PDT) Original-Received: by 10.48.250.5 with HTTP; Thu, 21 Jul 2005 19:42:32 -0700 (PDT) Original-To: Emacs Devel Content-Disposition: inline X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:41117 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:41117 (These questions are mainly for Lars Hansen, who did most of the recent cleanup work on desktop.el) I'm having a few problems with highlight-changes-mode, which is a not-very-standard minor mode. I do (global-highlight-changes 'passive) on my .emacs, so most buffers have a local `highlight-changes-mode' variable with value 'passive. Logically, `highlight-changes-mode' goes to the minor-modes list in .emacs.desktop, and it gets restored by calling (highlight-changes-mode 1)... so highlight-changes-mode is active on all buffers after loading Emacs :) I can fix it with the attached patch. Is it reasonable to add to desktop.el code to deal with minor modes from the Emacs library, or should it be done in hilit-chg.el or the user's .emacs? The other question is: why does `desktop-save' save `nil' for active minor-modes which do appear in `desktop-minor-mode-table' as non-restorable? I mean, why (let ((special (assq minor-mode desktop-minor-mode-table))) (when (or special (functionp minor-mode)) (setq ret (cons (if special (cadr special) minor-mode) ret)))) instead of simply (let ((special (cadr (assq minor-mode desktop-minor-mode-table)))) (when (or special (functionp minor-mode)) (add-to-list 'ret (or special minor-mode)))) which wouldn't save nil values to the minor-mode list? --=20 /L/e/k/t/u Index: lisp/desktop.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/emacs/emacs/lisp/desktop.el,v retrieving revision 1.88 diff -u -2 -r1.88 desktop.el --- lisp/desktop.el=0921 Jul 2005 11:49:32 -0000=091.88 +++ lisp/desktop.el=0922 Jul 2005 02:27:41 -0000 @@ -229,5 +229,6 @@ change-log-default-name line-number-mode - buffer-file-coding-system) + buffer-file-coding-system + highlight-changes-mode) "List of local variables to save for each buffer. The variables are saved only when they really are local." @@ -346,5 +347,6 @@ (defcustom desktop-minor-mode-table '((auto-fill-function auto-fill-mode) - (vc-mode nil)) + (vc-mode nil) + (highlight-changes-mode nil)) "Table mapping minor mode variables to minor mode functions. Each entry has the form (NAME RESTORE-FUNCTION).