help-gnu-emacs
[Top][All Lists]
Advanced

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

How to declare a recursive customization type?


From: David Kastrup
Subject: How to declare a recursive customization type?
Date: 16 Dec 2002 13:17:37 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Hello, I have a certain recursive data structure which I want to
define as a custom type.  Currently I use the following contraption

(defconst preview-expandable-string
  ((lambda (f) (funcall f (funcall f 'sexp)))
   (lambda (x)
     `(choice
       string
       (cons :tag "List with separators"
        (string :tag "Separator")
             (choice (symbol :tag "Variable to concatenate.")
                     (repeat :tag "Explicit elements" ,x)))
       (symbol :tag "Indirect variable"))))
  "Type to be used for `preview-string-expand'.
Recursive definitions are not popular with Emacs,
so we define this type just two levels deep.  This
kind of strings can either be just a string, or a
cons cell with a separator string in the CAR, and either
an explicit list of elements in the CDR, or a symbol to
be consulted recursively.")

which is going to be used just as
:type preview-expandable-string
in a defcustom.  However, this sort of broken-off recursion is not
satisfactory.

One should probably define preview-expandable-string as a proper type
to be used as
:type 'preview-expandable-string
in a defcuston, and then it will probably be able to refer to itself
cleanly.

But how does one achieve that?  I digged through what I could find
about both customize, widget, and wid-edit, and have again to admit
that I am too stupid to find how to do what must be a simple thing,
really.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
>From help-gnu-emacs-bounces@gnu.org  Mon Dec 16 08:40:28 2002
Path: 
shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.icl.net!newsfeed.fjserv.net!lnewspeer00.lnd.ops.eu.uu.net!bnewspeer00.bru.ops.eu.uu.net!emea.uu.net!uucp.muenster.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail
From: David Kastrup <David.Kastrup@t-online.de>
Newsgroups: gnu.emacs.help
Date: 16 Dec 2002 13:20:50 +0100
Organization: T-Online
Lines: 27
Sender: dak@lola.goethe.zz
Message-ID: <x5isxutasd.fsf@lola.goethe.zz>
References: <3dfdc3a6$0$47399$edfadb0f@dtext01.news.tele.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.t-online.com 1040041251 06 6718 HoX1E+oSSZa613 021216 12:20:51
X-Complaints-To: abuse@t-online.com
X-Sender: 520018396234-0001@t-dialin.net
X-Face: 2FEFf>]>q>2iw=B6,xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl
        \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN;i";
        /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^
        Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50
Xref: shelby.stanford.edu gnu.emacs.help:108164
To: help-gnu-emacs@gnu.org
Subject: Re: Problem with Reftex
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Mon, 16 Dec 2002 13:40:28 -0000

"Jens-Peter Vraa Jensen" <no@no.no> writes:

> I'm using Emacs 21.2.1 under Windows XP. I'm currently working on a
> latex document with one main document (main.tex). Each chapter is
> kept in a seperate file and included in main.tex using the
> \include{} command.
> 
> From the main document (main.tex) reftex is working fine when
> pressing C-c =: The TOC is shown, and I can switch to any section in
> any chapter. When I'm working in a chapter (= a file included in
> main.tex) and pressing C-c =, the TOC shown only contains entries
> from the current chapter (= current .tex file). What I want is the
> "full TOC" from the entire document - just as it is shown from the
> main.tex file.
> 
> I have tried the same under Linux (the emacs version may be different), and
> the TOC always contains all entries.
> 
> Is this a bug or did I miss something?

Are you using AUCTeX or not?  Is main.tex properly known as a master
document of your chapter to Emacs (that is, will its preamble and
stuff get used when you TeX the document from within your chapter's
buffer?).

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
>From help-gnu-emacs-bounces@gnu.org  Mon Dec 16 08:40:29 2002
Path: 
shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!news.tele.dk!not-for-mail
From: "Jens-Peter Vraa Jensen" <no@no.no>
Newsgroups: gnu.emacs.help
References: <3dfdc3a6$0$47399$edfadb0f@dtext01.news.tele.dk>
        <x5isxutasd.fsf@lola.goethe.zz>
Date: Mon, 16 Dec 2002 13:43:13 +0100
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Lines: 44
Message-ID: <3dfdca62$0$47405$edfadb0f@dtext01.news.tele.dk>
Organization: TDC Internet
NNTP-Posting-Host: 80.63.191.72
X-Trace: 1040042594 dtext01.news.tele.dk 47405 80.63.191.72
X-Complaints-To: abuse@post.tele.dk
Xref: shelby.stanford.edu gnu.emacs.help:108165
To: help-gnu-emacs@gnu.org
Subject: Re: Problem with Reftex
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
X-List-Received-Date: Mon, 16 Dec 2002 13:40:29 -0000

> Are you using AUCTeX or not?

I'm using AUCTeX 10.0g.

I have added a bit of my .emacs file below.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; LaTeX setup

; AUC TeX
(add-to-list 'load-path "W:/emacs
21.2/emacs-21.2-fullbin-i386/emacs-21.2/lisp/auctex-10.0g/")
(add-to-list 'Info-default-directory-list "W:/emacs
21.2/emacs-21.2-fullbin-i386/emacs-21.2/lisp/auctex-10.0g/doc/")
(require 'tex-site)

; Reftex (følger med Emacs 21.1)
(autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
(autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
(autoload 'reftex-citation "reftex-cite" "Make citation" nil)
(autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
(add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode

; (setq reftex-enable-partial-scans t)
; (setq reftex-save-parse-info t)
; (setq reftex-use-multiple-selection-buffers t)
(setq reftex-plug-into-AUCTeX t)


> Is main.tex properly known as a master
> document of your chapter to Emacs (that is, will its preamble and
> stuff get used when you TeX the document from within your chapter's
> buffer?).
>

I would love to anser your question, but at the present time I have no idea
what to say :-) How to I check/enable main.tex as my master document?

Thanks for your reply!

JP



reply via email to

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