"Miguel V. S. Frasson" <[EMAIL PROTECTED]> writes:

> Observing that I no longer have revealed the contents of a preview, I
> customized group Preview Appearance, and found option
> preview-auto-reveal.  There I read:
>
>  Preview Auto Reveal: Hide Value Value Menu Function call:
>  Function: preview-arrived-via
>  Argument list:
>  Repeat:
>  INS DEL Lisp expression: backward-char
>  INS DEL Lisp expression: forward-char
>  INS
>     State: CHANGED outside Customize; operating on it here may be unreliable.
>
> Well, it says "CHANGED outside Customize; operating on it here may be
> unreliable."  Actually I never customized this option, and in the file
> where my customizations are saved, that option is not present.
> Furthermore, I use `pc-selection-mode', and my arrow keys are bound to
> `backward-char-nomark' and `forward-char-nomark'.
>
> Then I "erased customization". I obtained
>
> Preview Auto Reveal: Hide Value Value Menu Function call:
> Function: preview-arrived-via
> Argument list:
> Repeat:
> INS DEL Lisp expression: backward-char-nomark
> INS DEL Lisp expression: forward-char-nomark
> INS
>   State: STANDARD.
>
> Now this value looks ok for my settings. I did a dummy edit, saved and
> now it is working fine.  But I observe that before customize, the
> value was changed outside custom, to a value not useful for me.

The problem could resurface.  The problem is that the value is
determined by the keybindings at the time preview.el gets loaded.
This is not really a good idea, though efficient.  It appears to me
that the testing function is not called all too often.  So it should
be possible to do the test in question based on the keybindings at the
time of call.  In order to stay backwards-compatible at this time, I
would like to avoid changing the API.  One possibility would be the
following patch:

--- preview.el	18 Oct 2006 19:45:01 +0200	1.277
+++ preview.el	23 Oct 2006 18:34:16 +0200	
@@ -1456,9 +1456,9 @@
 Fallback to :inherit and 'default implemented."
   :group 'preview-appearance)
 
-(defcustom preview-auto-reveal `(preview-arrived-via
-				 ,(key-binding [left])
-				 ,(key-binding [right]))
+(defcustom preview-auto-reveal '(eval (preview-arrived-via
+				       (key-binding [left])
+				       (key-binding [right])))
   "*Cause previews to open automatically when entered.
 Possibilities are:
 T autoopens,
@@ -1471,13 +1471,13 @@
 point and current buffer point to the position in question.
 All of the options show reasonable defaults."
   :group 'preview-appearance
-  :type `(choice (const :tag "Off" nil)
+  :type '(choice (const :tag "Off" nil)
 		 (const :tag "On" t)
 		 (symbol :tag "Indirect variable" :value reveal-mode)
 		 (cons :tag "Function call"
-		       :value (preview-arrived-via
-			       ,(key-binding [left])
-			       ,(key-binding [right]))
+		       :value (eval (preview-arrived-via
+				     (key-binding [left])
+				     (key-binding [right])))
 		       function (list :tag "Argument list"
 				      (repeat :inline t sexp)))))
   
If nobody complains, I'll likely check it in soon.  It certainly is
less than wonderful, but I don't have a better idea.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
_______________________________________________
bug-auctex mailing list
bug-auctex@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-auctex

Reply via email to