emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A few questions about desktop.el


From: Juanma Barranquero
Subject: A few questions about desktop.el
Date: Fri, 22 Jul 2005 04:42:32 +0200

(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?

-- 
                    /L/e/k/t/u


Index: lisp/desktop.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/desktop.el,v
retrieving revision 1.88
diff -u -2 -r1.88 desktop.el
--- lisp/desktop.el     21 Jul 2005 11:49:32 -0000      1.88
+++ lisp/desktop.el     22 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).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]