;ELC ;;; Compiled ;;; in Emacs version 27.1 ;;; with all optimizations. ;;; This file contains utf-8 non-ASCII characters, ;;; and so cannot be loaded into Emacs 22 or earlier. (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (string-lessp emacs-version "23") (error "`%s' was compiled for Emacs 23 or later" #$)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301\302\303\304\305%\210\306\307\310\311\304\301\312\313&\210\306\314\302\315\304\301\312\316\317\320& \210\306\321\322\323\304\301\312\324&\210\306\325\326\327\304\301\312\324&\210\306\330\331\332\304\301\312\324&\210\306\333\302\334\304\301\312\316\317\335& \210\306\336\337\340\304\301\312\341&\207" [custom-declare-group copyright nil "Update the copyright notice in current buffer." :group tools custom-declare-variable copyright-limit 2000 "Don't try to update copyright beyond this position unless interactive.\nA value of nil means to search whole buffer." :type (choice (integer :tag "Limit") (const :tag "No limit")) copyright-at-end-flag "Non-nil means to search backwards from the end of the buffer for copyright.\nThis is useful for ChangeLogs." boolean :version "23.1" copyright-regexp "\\(©\\|@copyright{}\\|[Cc]opyright\\s *:?\\s *\\(?:(C)\\)?\\|[Cc]opyright\\s *:?\\s *©\\)\\s *[^0-9\n]*\\s *\\([1-9]\\([-0-9, ';/*%#\n ]\\|\\s<\\|\\s>\\)*[0-9]+\\)" "What your copyright notice looks like.\nThe second \\( \\) construct must match the years." regexp copyright-names-regexp "" "Regexp matching the names which correspond to the user.\nOnly copyright lines where the name matches this regexp will be updated.\nThis allows you to avoid adding years to a copyright notice belonging to\nsomeone else or to a group for which you do not work." copyright-years-regexp "\\(\\s *\\)\\([1-9]\\([-0-9, ';/*%#\n ]\\|\\s<\\|\\s>\\)*[0-9]+\\)" "Match additional copyright notice years.\nThe second \\( \\) construct must match the years." copyright-year-ranges "Non-nil if individual consecutive years should be replaced with a range.\nFor example: 2005, 2006, 2007, 2008 might be replaced with 2005-2008.\nIf you use ranges, you should add an explanatory note in a README file.\nThe function `copyright-fix-years' respects this variable." "24.1" copyright-query 'function "If non-nil, ask user before changing copyright.\nWhen this is `function', only ask when called non-interactively." (choice (const :tag "Do not ask") (const :tag "Ask unless interactive" function) (other :tag "Ask" t))] 10) #@60 String representing the current version of the GPL or nil. (defconst copyright-current-gpl-version "3" (#$ . 2530)) #@75 The function `copyright-update' sets this to nil after updating a buffer. (defvar copyright-update t (#$ . 2652)) #@39 String representing the current year. (defvar copyright-current-year (format-time-string "%Y") (#$ . 2772)) (defalias 'copyright-limit #[nil "\205 \203\f`Z\207`\\\207" [copyright-limit copyright-at-end-flag] 2]) (put 'copyright-limit 'byte-optimizer 'byte-compile-inline-expand) #@69 Re-search forward or backward depending on `copyright-at-end-flag'. (defalias 'copyright-re-search #[(regexp &optional bound noerror count) "\203 \305 \n \f$\207\306 \n \f$\207" [copyright-at-end-flag regexp bound noerror count re-search-backward re-search-forward] 5 (#$ . 3063)]) #@70 Return point-min or point-max, depending on `copyright-at-end-flag'. (defalias 'copyright-start-point #[nil "\203d\207e\207" [copyright-at-end-flag] 1 (#$ . 3353)]) #@65 Return non-nil if point is too far from the edge of the buffer. (defalias 'copyright-offset-too-large-p #[nil "\205 \203`dZW\207`e\\V\207" [copyright-limit copyright-at-end-flag] 3 (#$ . 3527)]) #@218 Return non-nil if a copyright header suitable for updating is found. The header must match `copyright-regexp' and `copyright-names-regexp', if set. This function sets the match-data that `copyright-update-year' uses. (defalias 'copyright-find-copyright #[nil "~\210\305 b\210\3061'\307\310\311 \312\260\n\205# \203 `\nZ\202#`\n\\\313#0\207\314\315\f\"\210)\316\207" [copyright-regexp copyright-names-regexp copyright-limit copyright-at-end-flag #1=#:err copyright-start-point (debug error) copyright-re-search "\\(" "\\)\\([ ]*\n\\)?.*\\(?:" "\\)" t message "Can't update copyright: %s" nil] 6 (#$ . 3736)]) #@175 Possibly adjust the search performed by `copyright-find-copyright'. If the years continue onto multiple lines that are marked as comments, skips to the end of all the years. (defalias 'copyright-find-end #[nil "\212g\304=\2054\305u\210\306\307w\210l\2054\2054\310 \311\216\305y\210\312!\205'\313\225b*\2054\n\314\312!)\262)\205I\305y\210\315!\210\315\316\317\n\"!\210\202\207" [comment-start-skip save-match-data-internal copyright-years-regexp inhibit-changing-match-data 44 1 " " nil match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] looking-at 0 t re-search-forward format "\\(%s\\)"] 4 (#$ . 4359)]) (defalias 'copyright-update-year #[(replace noquery) "\305\225b\210\306 \210\307\310!\311\225\312Z\311\225{\313\314\"\230?\205\247 \204>\315 \316\216\212\317p!\210\320 \2035\321\322Q\2029\323\324Q!+\205\247 \203J\325\326\211\327\311%\207\212\330\327x)\331!\331`\f\\`{!Z\332\246\305=\203\333`\f\334#f\335=\204x\333`\f\314#f\335=\203\336\f!\210\202\241\212\337\340\341 \326#\203\217\342\305!\202\220\343)c\210\333`\f\344#f\345=\203\241\345c\210\313\f\"c)\207" [copyright-current-year noquery #1=#:wconfig replace size 1 copyright-find-end format-time-string "%Y" 3 2 substring -2 current-window-configuration #[nil "\301!\207" [#1# set-window-configuration] 2] switch-to-buffer y-or-n-p "Replace copyright year(s) by " "? " "Add " " to copyright? " replace-match t nil "0-9" string-to-number 100 + -1 45 delete-char re-search-backward "[0-9]\\( *, *\\)[0-9]" line-beginning-position match-string ", " -3 39] 6]) #@369 Update copyright notice to indicate the current year. With prefix ARG, replace the years in the notice rather than adding the current year after them. If necessary, and `copyright-current-gpl-version' is set, any copying permissions following the copyright are updated as well. If non-nil, INTERACTIVEP tells the function to behave as when it's called interactively. (defalias 'copyright-update #[(&optional arg interactivep) "\204 \205\207\n?\206\n\306=\205 \212\214\307 \203~\310\f \"\210\311 b\210 \203~\312\313\205@\203<`Z\202@`\\\314#\203~\315\316\317!!\315 !W\203~ \204v\320 \321\216\317\225b\210\322 \323\216\324p!\210\325\326\327\330\317! #!,\203~\331 \314\211\332\317%\210)\333\300!\210\332*\332\207" [copyright-update interactivep copyright-query noquery arg copyright-current-gpl-version function copyright-find-copyright copyright-update-year copyright-start-point copyright-re-search "the Free Software Foundation[,;\n].*either version \\([0-9]+\\)\\(?: of the License\\)?, or[ \n].*any later version" t string-to-number match-string 1 match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] current-window-configuration #[nil "\301!\207" [#1=#:wconfig set-window-configuration] 2] switch-to-buffer y-or-n-p format "Replace GPL version %s with version %s? " match-string-no-properties replace-match nil make-local-variable copyright-limit copyright-at-end-flag save-match-data-internal #1#] 6 (#$ . 5961) "*P\nd"]) #@208 Convert 2 digit years to 4 digit years. Uses heuristic: year >= 50 means 19xx, < 50 means 20xx. If `copyright-year-ranges' (which see) is non-nil, also independently replaces consecutive years with a range. (defalias 'copyright-fix-years #[nil "\306 \203 \307\224\310 \311\224\312\211\211\211\211\211\211\211\"#$%&\313\225b\210\314 \210\315\307\225T!#&b\210\316\317#\320#\203\331%`\312\223\210\311\224b\210\321\322\311!!`Sf\211\203f z\323U\204f \324U\204f\325c\210\f\326W\203\207\f\327Y\203v\330\202w\331c\210\f\211\327Y\203\204\332\202\205\333\\%b\210'\203\320 \324=\203\235\312\211\202\320 \203\255\f TU\203\255`\202\320\n\203\314 \203\314 \nV\203\314b\210 |\210\334\335 \"c\210%b\210\f`\f%\"\2025\"\203'\203\376\n\203\376 \203\376 \nV\203\376b\210 |\210\334\335 \"c\210\"b\210\336\312x\210\214$`}\210\337ed\"\210)#\312\211\223\210%\312\211\223. \207\340\341!\207" [range-end range-start first-year prev-year year sep copyright-find-copyright 3 make-marker 0 nil 1 copyright-find-end copy-marker re-search-forward "[0-9]+" t string-to-number match-string 32 45 " " 100 50 "19" "20" 1900 2000 format "-%d" " " fill-region message "No copyright message" last e copystart p s copyright-year-ranges] 12 (#$ . 7463) nil]) (put 'copyright 'no-self-insert t) #@558 Insert a copyright by $ORGANIZATION notice at cursor. This is a skeleton command (see `skeleton-insert'). Normally the skeleton text is inserted at point, with nothing "inside". If there is a highlighted region, the skeleton text is wrapped around the region text. A prefix argument ARG says to wrap the skeleton around the next ARG words. A prefix argument of -1 says to wrap around region, even if not highlighted. A prefix argument of zero says to wrap around zero words---that is, nothing. This is a way of overriding the use of a highlighted region. (defalias 'copyright #[(&optional str arg) "\302\303 #\207" [str arg skeleton-proxy-new ("Company: " comment-start "Copyright (C) " `(format-time-string "%Y") " by " (or (getenv "ORGANIZATION") str) '(if (copyright-offset-too-large-p) (message "Copyright extends beyond `copyright-limit' and won't be updated automatically.")) comment-end n)] 4 (#$ . 8790) "*P\nP"]) #@122 Update copyright notice for all files in DIRECTORY matching MATCH. If FIX is non-nil, run `copyright-fix-years' instead. (defalias 'copyright-update-directory #[(directory match &optional fix) "\306\307 \310$\310\211\205E @\311\n!\204=\312\313\n\"\210\314\310\315\n!\210*\307\2032\316 \210\2025\317 \210)\320 \210\321p!\210 A\211\204 \310*\207" [directory match file --dolist-tail-- enable-local-eval enable-local-variables directory-files t nil file-directory-p message "Updating file `%s'" :safe find-file copyright-fix-years copyright-update save-buffer kill-buffer inhibit-read-only fix] 6 (#$ . 9722) "DDirectory: \nMFilenames matching (regexp): "]) (provide 'copyright)