unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to save minor mode in Desktop?
@ 2005-04-30  3:32 heriberaht
  2005-05-02 15:09 ` Kevin Rodgers
       [not found] ` <mailman.248.1115046900.2819.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: heriberaht @ 2005-04-30  3:32 UTC (permalink / raw)



  I use desktop.el to save emacs sessions, but minor-mode is lost after
restart. how to correct this? The two minor mode I want to keep is
setnu-mode and matlab-eei-minor-mode.

  Looking forward to all of your valuable advices, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to save minor mode in Desktop?
  2005-04-30  3:32 How to save minor mode in Desktop? heriberaht
@ 2005-05-02 15:09 ` Kevin Rodgers
       [not found] ` <mailman.248.1115046900.2819.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2005-05-02 15:09 UTC (permalink / raw)


heriberaht wrote:
>   I use desktop.el to save emacs sessions, but minor-mode is lost after
> restart. how to correct this? The two minor mode I want to keep is
> setnu-mode and matlab-eei-minor-mode.
> 
>   Looking forward to all of your valuable advices, thanks.

desktop.el itself seems to suggest that you should frob 
desktop-minor-mode-table:

;; Some words on minor modes: Most minor modes are controlled by
;; buffer-local variables, which have a standard save / restore
;; mechanism.  To handle all minor modes, we take the following
;; approach: (1) check whether the variable name from
;; `minor-mode-alist' is also a function; and (2) use translation
;; table `desktop-minor-mode-table' in the case where the two names
;; are not the same.

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to save minor mode in Desktop?
       [not found] ` <mailman.248.1115046900.2819.help-gnu-emacs@gnu.org>
@ 2005-05-03 11:59   ` heriberaht
  2005-05-04 16:58     ` Kevin Rodgers
       [not found]     ` <mailman.3270.1115227292.2819.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: heriberaht @ 2005-05-03 11:59 UTC (permalink / raw)



  I have read these comments, but can't figure out how to set
correctly. Later I adde the minor-mode to matlab-mode-hook and solved
it in a not so clever way.

(defun my-matlab-mode-hook ()
  (setq fill-column 76) ;
  (setnu-mode 1)
  (load "matlab-eei")
  (matlab-eei-minor-mode 1)
  (define-key matlab-eei-mode-map (kbd "C-c C-d C-c")
'matlab-eei-clear-breakpoints)
  (define-key matlab-eei-mode-map (kbd "C-c C-d C-q")
'matlab-eei-exit-debug)
  (setq matlab-comment-region-s "% ")
  )

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to save minor mode in Desktop?
  2005-05-03 11:59   ` heriberaht
@ 2005-05-04 16:58     ` Kevin Rodgers
       [not found]     ` <mailman.3270.1115227292.2819.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2005-05-04 16:58 UTC (permalink / raw)


heriberaht wrote:
>   I have read these comments, but can't figure out how to set
> correctly.

Are there (VARIABLE STRING) entries for setnu-mode and
matlab-eei-minor-mode in minor-mode-alist?  If not, I think you're out
of luck.  But if there are, is the variable the same name as the mode
function?  If yes, it should work with no customization; if not, then
you'd need to add (VARIABLE setnu-mode) and/or (VARIABLE
matlab-eei-minor-mode) entries to desktop-minor-mode-table.

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to save minor mode in Desktop?
       [not found]     ` <mailman.3270.1115227292.2819.help-gnu-emacs@gnu.org>
@ 2005-05-05  2:53       ` heriberaht
  0 siblings, 0 replies; 5+ messages in thread
From: heriberaht @ 2005-05-05  2:53 UTC (permalink / raw)


when in setnu-mode and matlab-eei-minor-mode, C-h v : minor-mode-alist
and get the value:

((matlab-eei-minor-mode " EEI")
 (outline-minor-mode " Outl")
 (dired-omit-mode
  (:eval
   (if
       (eq major-mode 'dired-mode)
       " Omit" "")))
 (table-fixed-mode-indicator " Fixed-Table")
 (table-mode-indicator " Table")
 (server-buffer-clients " Server")
 (view-mode
  #(" View" 0 5
    (local-map
     (keymap
      (header-line keymap
                   (down-mouse-3 . mode-line-mode-menu-1))
      (mode-line keymap
                 (down-mouse-3 . mode-line-mode-menu-1)
                 (mouse-2 . mode-line-minor-mode-help)))
     help-echo "mouse-3: minor mode menu")))
 (visible-mode " Vis")
 (next-error-follow-minor-mode " Fol")
 (flyspell-mode flyspell-mode-line-string)
 (flymake-mode flymake-mode-line)
 (abbrev-mode " Abbrev")
 (overwrite-mode overwrite-mode)
 (auto-fill-function " Fill")
 (defining-kbd-macro " Def")
 (isearch-mode isearch-mode))

It seems that the matlab-eei-minor-mode needn't be customized, butI
have to set the setnu-mode by other methods.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-05-05  2:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-30  3:32 How to save minor mode in Desktop? heriberaht
2005-05-02 15:09 ` Kevin Rodgers
     [not found] ` <mailman.248.1115046900.2819.help-gnu-emacs@gnu.org>
2005-05-03 11:59   ` heriberaht
2005-05-04 16:58     ` Kevin Rodgers
     [not found]     ` <mailman.3270.1115227292.2819.help-gnu-emacs@gnu.org>
2005-05-05  2:53       ` heriberaht

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).