annotate lisp/emacs-lisp/copyright.el @ 30408:e3e2c9051c5f

Got rid of all byte-compiler warnings on Emacs. Add to the menu when the file is loaded, not in ada-mode-hook. Add -toolbar to the default ddd command Switches moved from ada-prj-default-comp-cmd and ada-prj-default-make-cmd to ada-prj-default-comp-opt (ada-add-ada-menu): Remove the map and name parameters Add the Ada Reference Manual to the menu (ada-check-current): rewritten as a call to ada-compile-current (ada-compile): Removed. (ada-compile-application, ada-compile-current, ada-check-current): Set the compilation-search-path so that compile.el automatically finds the sources in src_dir. Automatic scrollong of the compilation buffer. C-uC-cC-c asks for confirmation before compiling (ada-compile-current): New parameter, prj-field (ada-complete-identifier): Load the .ali file before doing processing (ada-find-ali-file-in-dir): prepend build_dir to obj_dir to conform to gnatmake's behavior. (ada-find-file-in-dir): New function (ada-find-references): Set the environment variables for gnatfind (ada-find-src-file-in-dir): New function. (ada-first-non-nil): Removed (ada-gdb-application): Add support for jdb, the java debugger. (ada-get-ada-file-name): Load the original-file first if not done yet. (ada-get-all-references): Handles the new ali syntax (parent types are found between <>). (ada-initialize-runtime-library): New function (ada-mode-hook): Always load a project file when a file is opened, so that the casing exceptions are correctly read. (ada-operator-re): Add all missing operators ("abs", "rem", "**"). (ada-parse-prj-file): Use find-file-noselect instead of find-file to open the project file, since the latter does not work with speedbar Get default values before loading the prj file, or the default executable file name is wrong. Use the absolute value of src_dir to initialize ada-search-directories and compilation-search-path,... Add the standard runtime library to the search path for find-file. (ada-prj-default-debugger): Was missing an opening '{' (ada-prj-default-bind-opt, ada-prj-default-link-opt): New variables. (ada-prj-default-gnatmake-opt): New variable (ada-prj-find-prj-file): Handles non-file buffers For non-Ada buffers, the project file is the default one Save the windows configuration before displaying the menu. (ada-prj-src-dir, ada-prj-obj-dir, ada-prj-comp-opt,...): Removed (ada-read-identifier): Fix xrefs on operators (for "mod", "and", ...) regexp-quote identifiers names to support operators +, -,... in regexps. (ada-remote): New function. (ada-run-application): Erase the output buffer before starting the run Support remote execution of the application. Use call-process, or the arguments are incorrectly parsed (ada-set-default-project-file): Reread the content of the active project file, not the one from the current buffer When a project file is set as the default project, all directories are automatically associated with it. (ada-set-environment): New function (ada-treat-cmd-string): New special variable ${current} (ada-treat-cmd-string): Revised. The substitution is now done for any ${...} substring (ada-xref-current): If no body was found, compiles the spec instead. Setup ADA_{SOURCE,OBJECTS}_PATH before running the compiler to get rid of command line length limitations. (ada-xref-get-project-field): New function (ada-xref-project-files): New variable (ada-xref-runtime-library-specs-path) (ada-xref-runtime-library-ali-path): New variables (ada-xref-set-default-prj-values): Default run command now does a cd to the build directory. New field: main_unit Provide a default file name even if the current buffer has no prj file.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 24 Jul 2000 11:13:11 +0000
parents 04373d2778b2
children 9f38c893ea39
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
1 ;;; copyright.el --- update the copyright notice in current buffer
657
fec3f9a1e3e5 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 611
diff changeset
2
21647
9b009b58225f Update copyright years.
Richard M. Stallman <rms@gnu.org>
parents: 21328
diff changeset
3 ;; Copyright (C) 1991, 92, 93, 94, 95, 1998 Free Software Foundation, Inc.
841
2cdce064065f entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 814
diff changeset
4
23869
8d2bb5d1416a Update comment.
Karl Heuer <kwzh@gnu.org>
parents: 22580
diff changeset
5 ;; Author: Daniel Pfeiffer <occitan@esperanto.org>
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
6 ;; Keywords: maint, tools
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
7
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
8 ;; This file is part of GNU Emacs.
773
9c89fd7ddd41 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 718
diff changeset
9
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
13 ;; any later version.
841
2cdce064065f entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 814
diff changeset
14
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
18 ;; GNU General Public License for more details.
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
19
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
20 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
23 ;; Boston, MA 02111-1307, USA.
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
24
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
25 ;;; Commentary:
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
26
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
27 ;; Allows updating the copyright year and above mentioned GPL version manually
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
28 ;; or when saving a file. Do (add-hook 'write-file-hooks 'copyright-update).
288
5c0f837c0287 Initial revision
Roland McGrath <roland@gnu.org>
parents:
diff changeset
29
773
9c89fd7ddd41 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 718
diff changeset
30 ;;; Code:
9c89fd7ddd41 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 718
diff changeset
31
21328
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
32 (defgroup copyright nil
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
33 "Update the copyright notice in current buffer."
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
34 :group 'tools)
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
35
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
36 (defcustom copyright-limit 2000
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
37 "*Don't try to update copyright beyond this position unless interactive.
21328
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
38 `nil' means to search whole buffer."
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
39 :group 'copyright
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
40 :type '(choice (integer :tag "Limit")
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
41 (const :tag "No limit")))
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
42
27229
fdaa887d0f8f Tag as emacs-mule coding.
Dave Love <fx@gnu.org>
parents: 23869
diff changeset
43 ;; Cleaner to specify Latin-1 coding for this file, and not use both
fdaa887d0f8f Tag as emacs-mule coding.
Dave Love <fx@gnu.org>
parents: 23869
diff changeset
44 ;; unibyte and multibyte copyright symbol characters?
21328
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
45 (defcustom copyright-regexp
21754
14ad51433254 (copyright-regexp): Put \251 before the multibyte copyright symbol.
Richard M. Stallman <rms@gnu.org>
parents: 21647
diff changeset
46 "\\([\251]\\|@copyright{}\\|[Cc]opyright\\s *:?\\s *(C)\
14ad51433254 (copyright-regexp): Put \251 before the multibyte copyright symbol.
Richard M. Stallman <rms@gnu.org>
parents: 21647
diff changeset
47 \\|[Cc]opyright\\s *:?\\s *[\251]\\)\
27329
04373d2778b2 (copyright-update): Removed the
Gerd Moellmann <gerd@gnu.org>
parents: 27229
diff changeset
48 \\s *\\([1-9][-0-9, ']*[0-9]+\\)"
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
49 "*What your copyright notice looks like.
21328
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
50 The second \\( \\) construct must match the years."
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
51 :group 'copyright
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
52 :type 'regexp)
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
53
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
54
21328
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
55 (defcustom copyright-query 'function
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
56 "*If non-`nil', ask user before changing copyright.
21328
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
57 When this is `function', only ask when called non-interactively."
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
58 :group 'copyright
d5ffccfcea21 Customized.
Andreas Schwab <schwab@suse.de>
parents: 19108
diff changeset
59 :type '(choice (const :tag "Do not ask")
22580
a191ee97be00 (copyright-query): Use `other' widget
Andreas Schwab <schwab@suse.de>
parents: 21754
diff changeset
60 (const :tag "Ask unless interactive" function)
a191ee97be00 (copyright-query): Use `other' widget
Andreas Schwab <schwab@suse.de>
parents: 21754
diff changeset
61 (other :tag "Ask" t)))
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
62
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
63
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
64 (defconst copyright-current-year (substring (current-time-string) -4)
288
5c0f837c0287 Initial revision
Roland McGrath <roland@gnu.org>
parents:
diff changeset
65 "String representing the current year.")
5c0f837c0287 Initial revision
Roland McGrath <roland@gnu.org>
parents:
diff changeset
66
5c0f837c0287 Initial revision
Roland McGrath <roland@gnu.org>
parents:
diff changeset
67
14040
187735b53d52 Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 13684
diff changeset
68 ;; when modifying this, also modify the comment generated by autoinsert.el
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
69 (defconst copyright-current-gpl-version "2"
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
70 "String representing the current version of the GPL or `nil'.")
288
5c0f837c0287 Initial revision
Roland McGrath <roland@gnu.org>
parents:
diff changeset
71
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
72 (defvar copyright-update t)
718
2011f5e67975 *** empty log message ***
Roland McGrath <roland@gnu.org>
parents: 657
diff changeset
73
288
5c0f837c0287 Initial revision
Roland McGrath <roland@gnu.org>
parents:
diff changeset
74 ;;;###autoload
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
75 (defun copyright-update (&optional arg)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
76 "Update the copyright notice at the beginning of the buffer to indicate
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
77 the current year. If optional prefix ARG is given replace the years in the
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
78 notice rather than adding the current year after them. If necessary and
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
79 `copyright-current-gpl-version' is set, the copying permissions following the
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
80 copyright, if any, are updated as well."
288
5c0f837c0287 Initial revision
Roland McGrath <roland@gnu.org>
parents:
diff changeset
81 (interactive "*P")
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
82 (if copyright-update
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
83 (save-excursion
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
84 (save-restriction
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
85 (widen)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
86 (goto-char (point-min))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
87 (if (re-search-forward copyright-regexp copyright-limit t)
13684
0263e1d2888e (copyright-regexp): Recognize ISO copyright symbol.
Karl Heuer <kwzh@gnu.org>
parents: 12518
diff changeset
88 (if (string= (buffer-substring (- (match-end 2) 2) (match-end 2))
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
89 (substring copyright-current-year -2))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
90 ()
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
91 (if (or (not copyright-query)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
92 (and (eq copyright-query 'function)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
93 (eq this-command 'copyright-update))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
94 (y-or-n-p (if arg
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
95 (concat "Replace copyright year(s) by "
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
96 copyright-current-year "? ")
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
97 (concat "Add " copyright-current-year
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
98 " to copyright? "))))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
99 (if arg
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
100 (progn
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
101 (delete-region (match-beginning 1) (match-end 1))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
102 (insert copyright-current-year))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
103 (setq arg (save-excursion (skip-chars-backward "0-9")))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
104 (if (and (eq (% (- (string-to-number
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
105 copyright-current-year)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
106 (string-to-number (buffer-substring
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
107 (+ (point) arg)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
108 (point))))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
109 100)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
110 1)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
111 (or (eq (char-after (+ (point) arg -1)) ?-)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
112 (eq (char-after (+ (point) arg -2)) ?-)))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
113 (delete-char arg)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
114 (insert ", ")
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
115 (if (eq (char-after (+ (point) arg -3)) ?')
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
116 (insert ?')))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
117 (insert (substring copyright-current-year arg))))))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
118 (goto-char (point-min))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
119 (and copyright-current-gpl-version
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
120 ;; match the GPL version comment in .el files, including the
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
121 ;; bilingual Esperanto one in two-column, and in texinfo.tex
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
122 (re-search-forward "\\(the Free Software Foundation; either \\|; a\\^u eldono \\([0-9]+\\)a, ? a\\^u (la\\^u via \\)version \\([0-9]+\\), or (at"
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
123 copyright-limit t)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
124 (not (string= (buffer-substring (match-beginning 3) (match-end 3))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
125 copyright-current-gpl-version))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
126 (or (not copyright-query)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
127 (and (eq copyright-query 'function)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
128 (eq this-command 'copyright-update))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
129 (y-or-n-p (concat "Replace GPL version by "
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
130 copyright-current-gpl-version "? ")))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
131 (progn
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
132 (if (match-end 2)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
133 ;; Esperanto bilingual comment in two-column.el
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
134 (progn
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
135 (delete-region (match-beginning 2) (match-end 2))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
136 (goto-char (match-beginning 2))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
137 (insert copyright-current-gpl-version)))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
138 (delete-region (match-beginning 3) (match-end 3))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
139 (goto-char (match-beginning 3))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
140 (insert copyright-current-gpl-version))))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
141 (set (make-local-variable 'copyright-update) nil)))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
142 ;; If a write-file-hook returns non-nil, the file is presumed to be written.
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
143 nil)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
144
581
e7dd969ff98b *** empty log message ***
Roland McGrath <roland@gnu.org>
parents: 291
diff changeset
145
e7dd969ff98b *** empty log message ***
Roland McGrath <roland@gnu.org>
parents: 291
diff changeset
146 ;;;###autoload
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
147 (define-skeleton copyright
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
148 "Insert a copyright by $ORGANIZATION notice at cursor."
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
149 "Company: "
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
150 comment-start
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
151 "Copyright (C) " copyright-current-year " by "
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
152 (or (getenv "ORGANIZATION")
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
153 str)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
154 '(if (> (point) copyright-limit)
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
155 (message "Copyright extends beyond `copyright-limit' and won't be updated automatically."))
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
156 comment-end)
288
5c0f837c0287 Initial revision
Roland McGrath <roland@gnu.org>
parents:
diff changeset
157
18383
11218164bc54 Add provide call.
Richard M. Stallman <rms@gnu.org>
parents: 17977
diff changeset
158 (provide 'copyright)
11218164bc54 Add provide call.
Richard M. Stallman <rms@gnu.org>
parents: 17977
diff changeset
159
27229
fdaa887d0f8f Tag as emacs-mule coding.
Dave Love <fx@gnu.org>
parents: 23869
diff changeset
160 ;; For the copyright sign:
fdaa887d0f8f Tag as emacs-mule coding.
Dave Love <fx@gnu.org>
parents: 23869
diff changeset
161 ;; Local Variables:
fdaa887d0f8f Tag as emacs-mule coding.
Dave Love <fx@gnu.org>
parents: 23869
diff changeset
162 ;; coding: emacs-mule
fdaa887d0f8f Tag as emacs-mule coding.
Dave Love <fx@gnu.org>
parents: 23869
diff changeset
163 ;; End:
fdaa887d0f8f Tag as emacs-mule coding.
Dave Love <fx@gnu.org>
parents: 23869
diff changeset
164
12503
f77164f5bc6b New name for generalized upd-copyr.el
Karl Heuer <kwzh@gnu.org>
parents: 10510
diff changeset
165 ;; copyright.el ends here