Move deprecated gschem options from libgeda to gschem
[geda-gaf.git] / libgeda / scheme / geda-deprecated-config.scm
blob15b500dd3b531ea9b7e25bd5ebfed4b03d267e20
1 ;; gEDA - GPL Electronic Design Automation
2 ;; gschem - gEDA Schematic Capture - Scheme API
3 ;; Copyright (C) 2012 Peter Brett <peter@peter-b.co.uk>
4 ;;
5 ;; This program is free software; you can redistribute it and/or modify
6 ;; it under the terms of the GNU General Public License as published by
7 ;; the Free Software Foundation; either version 2 of the License, or
8 ;; (at your option) any later version.
9 ;;
10 ;; This program is distributed in the hope that it will be useful,
11 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ;; GNU General Public License for more details.
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with this program; if not, write to the Free Software
17 ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
20 ;; This file contains deprecated configuration functions for RC files.
21 ;; The use gEDA RC files for configuration is being replaced by the
22 ;; use of key-value files that are parsed rather than executed. This
23 ;; will allow configuration to be safely written back to disk, and
24 ;; will have security benefits.  The functions defined in this file
25 ;; are intended for use in legacy RC files during the transition
26 ;; process.
28 (or (defined? 'define-syntax)
29     (use-modules (ice-9 syncase)))
31 ;; ===================================================================
32 ;; Utility functions and macros
33 ;; ===================================================================
35 ;; Returns an RC function closure to replace the legacy configuration
36 ;; function OLD-ID.  The returned closure takes an arbitrary number of
37 ;; arguments, and does nothing other than print a deprecation message
38 ;; the first time it is called.
39 (define (rc-dead-config old-id)
40   ;; FIXME more helpful error message with link to documentation.
41   (define (deprecation-warning)
42     (format (current-error-port)
43 "WARNING: The RC file function '~A' is deprecated and does nothing.
45 " old-id))
46   (let ((warned? #f))
47     (lambda args
48       (or warned? (begin (deprecation-warning) (set! warned? #t))))))
50 ;; Convenience macro for using rc-dead-config.
52 ;;   define-rc-dead-config OLD-ID
54 ;; Creates a dead rc configuration function called OLD-ID.
55 (define-syntax define-rc-dead-config
56   (syntax-rules ()
57     ((_ old-id)
58      (define old-id (rc-dead-config (quote old-id))))))
60 ;; ===================================================================
61 ;; Deprecated libgeda configuration functions
62 ;; ===================================================================
64 (define-rc-dead-config postscript-prolog)
66 ;; ===================================================================
67 ;; Deprecated gschem configuration functions
68 ;; ===================================================================
70 (define-rc-dead-config output-capstyle)
71 (define-rc-dead-config output-color)
72 (define-rc-dead-config output-orientation)
73 (define-rc-dead-config output-type)
74 (define-rc-dead-config paper-size)
75 (define-rc-dead-config paper-sizes)
76 (define-rc-dead-config print-command)
77 (define-rc-dead-config setpagedevice-orientation)
78 (define-rc-dead-config setpagedevice-pagesize)
80 (define-rc-dead-config net-style)
81 (define-rc-dead-config bus-style)
82 (define-rc-dead-config pin-style)
83 (define-rc-dead-config line-style)
84 (define-rc-dead-config net-endpoint-mode)
85 (define-rc-dead-config net-midpoint-mode)
86 (define-rc-dead-config object-clipping)
87 (define-rc-dead-config text-origin-marker)
88 (define-rc-dead-config text-display-zoomfactor)
89 (define-rc-dead-config text-feedback)
91 (define (untitled-name arg)
92   (format (current-error-port)
93 "WARNING: The RC file function 'untitled-name' should only be used in gschemrc.
95 "))
97 (define-rc-dead-config scrollbar-update)