all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Path to make desktop.el remember hi-lock-interactive-patterns
@ 2009-05-12 14:07 Lennart Borgman
  2009-05-12 14:52 ` Davis Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Lennart Borgman @ 2009-05-12 14:07 UTC (permalink / raw
  To: Emacs-Devel devel

[-- Attachment #1: Type: text/plain, Size: 10 bytes --]

Attached.

[-- Attachment #2: desktop.hi-lock.diff --]
[-- Type: application/octet-stream, Size: 1413 bytes --]

Index: desktop.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/desktop.el,v
retrieving revision 1.133
diff -u -r1.133 desktop.el
--- desktop.el	22 Mar 2009 20:09:34 -0000	1.133
+++ desktop.el	12 May 2009 14:02:53 -0000
@@ -325,7 +325,8 @@
     tab-width
     indicate-buffer-boundaries
     indicate-empty-lines
-    show-trailing-whitespace)
+    show-trailing-whitespace
+    hi-lock-interactive-patterns)
   "List of local variables to save for each buffer.
 The variables are saved only when they really are local.  Conventional minor
 modes are restored automatically; they should not be listed here."
@@ -1200,7 +1201,13 @@
               ;; an entry of the form `symbol'
               (make-local-variable this)
               (makunbound this)))
-          (setq desktop-buffer-locals (cdr desktop-buffer-locals)))))))
+          (setq desktop-buffer-locals (cdr desktop-buffer-locals)))
+        ;; Hi-lock
+        (when (and (boundp 'hi-lock-interactive-patterns)
+                   hi-lock-interactive-patterns
+                   hi-lock-mode)
+          (font-lock-add-keywords nil hi-lock-interactive-patterns t)
+          (font-lock-fontify-buffer))))))
 
 ;; ----------------------------------------------------------------------------
 ;; Backward compatibility -- update parameters to 205 standards.

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

* Re: Path to make desktop.el remember hi-lock-interactive-patterns
  2009-05-12 14:07 Path to make desktop.el remember hi-lock-interactive-patterns Lennart Borgman
@ 2009-05-12 14:52 ` Davis Herring
  2009-05-12 20:25   ` Lennart Borgman
  0 siblings, 1 reply; 3+ messages in thread
From: Davis Herring @ 2009-05-12 14:52 UTC (permalink / raw
  To: Lennart Borgman; +Cc: Emacs-Devel

> +        ;; Hi-lock
> +        (when (and (boundp 'hi-lock-interactive-patterns)
> +                   hi-lock-interactive-patterns
> +                   hi-lock-mode)
> +          (font-lock-add-keywords nil hi-lock-interactive-patterns t)
> +          (font-lock-fontify-buffer))))))

It would be cleaner to invoke some function in hi-lock.el rather than
going straight into font-lock.  Moreover, hi-lock-mode already has a
persistence mechanism; why does desktop need to additionally provide one
that lasts only as long as you don't kill the buffer?

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.




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

* Re: Path to make desktop.el remember hi-lock-interactive-patterns
  2009-05-12 14:52 ` Davis Herring
@ 2009-05-12 20:25   ` Lennart Borgman
  0 siblings, 0 replies; 3+ messages in thread
From: Lennart Borgman @ 2009-05-12 20:25 UTC (permalink / raw
  To: herring; +Cc: Emacs-Devel

On Tue, May 12, 2009 at 4:52 PM, Davis Herring <herring@lanl.gov> wrote:
>> +        ;; Hi-lock
>> +        (when (and (boundp 'hi-lock-interactive-patterns)
>> +                   hi-lock-interactive-patterns
>> +                   hi-lock-mode)
>> +          (font-lock-add-keywords nil hi-lock-interactive-patterns t)
>> +          (font-lock-fontify-buffer))))))
>
> It would be cleaner to invoke some function in hi-lock.el rather than
> going straight into font-lock.

Yes, absolutely. This was more of a reminder of what need to be done.

> Moreover, hi-lock-mode already has a
> persistence mechanism; why does desktop need to additionally provide one
> that lasts only as long as you don't kill the buffer?

Doesn't they serve very different situations? I could for example save
a desktop file for a special problem I am working on. When that is
solved I might delete that desktop file (or at least never use it any
more...)




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

end of thread, other threads:[~2009-05-12 20:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-12 14:07 Path to make desktop.el remember hi-lock-interactive-patterns Lennart Borgman
2009-05-12 14:52 ` Davis Herring
2009-05-12 20:25   ` Lennart Borgman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.