From 5ffcd5ff2b2c06dc01b3293fc4e3a33acd475828 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Mon, 13 Jun 2005 01:13:08 +0000 Subject: [PATCH] Minor code cleanup to address elint issues. * Makefile (test): Don't build README files during this rule. Remove spurious "make clean" statement. * muse-colors.el (muse-colors-tags): Make sure that this appears in the `muse-colors' group, and give it a proper type. * muse-mode.el: Wrap condition-case around `eval-when-compile'. * examples/johnw/muse-johnw.el (muse-my-html-insert-contents, muse-my-journal-find-entries): Replace `string-to-int' with `string-to-number'. * muse-html.el (muse-html-insert-contents): Ditto. * muse-journal.el (muse-journal-html-munge-buffer, muse-journal-latex-munge-buffer): Ditto. * muse-journal.el (muse-journal-rss-munge-buffer): Ditto. * muse-publish.el (muse-publish-markup-footnote, muse-publish-contents-tag): Ditto. * muse-regexps.el (muse-extreg-usable-p): Ditto. git-archimport-id: mwolson@gnu.org--2005/muse--main--1.0--patch-53 --- ChangeLog | 37 +++++++++++++++++++++++++++++++++++++ Makefile | 3 +-- examples/johnw/muse-johnw.el | 8 ++++---- muse-colors.el | 7 ++++++- muse-html.el | 2 +- muse-journal.el | 18 +++++++++--------- muse-mode.el | 7 ++++--- muse-publish.el | 4 ++-- muse-regexps.el | 2 +- 9 files changed, 65 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index b66a8b2..7850aaa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,43 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2005/muse--main--1.0 # +2005-06-13 01:13:08 GMT Michael Olson patch-53 + + Summary: + Minor code cleanup to address elint issues. + Revision: + muse--main--1.0--patch-53 + + * Makefile (test): Don't build README files during this rule. Remove + spurious "make clean" statement. + + * muse-colors.el (muse-colors-tags): Make sure that this appears in the + `muse-colors' group, and give it a proper type. + + * muse-mode.el: Wrap condition-case around `eval-when-compile'. + + * examples/johnw/muse-johnw.el (muse-my-html-insert-contents, + muse-my-journal-find-entries): Replace `string-to-int' with + `string-to-number'. + + * muse-html.el (muse-html-insert-contents): Ditto. + + * muse-journal.el (muse-journal-html-munge-buffer, + muse-journal-latex-munge-buffer): Ditto. + + * muse-journal.el (muse-journal-rss-munge-buffer): Ditto. + + * muse-publish.el (muse-publish-markup-footnote, + muse-publish-contents-tag): Ditto. + + * muse-regexps.el (muse-extreg-usable-p): Ditto. + + modified files: + ChangeLog Makefile examples/johnw/muse-johnw.el muse-colors.el + muse-html.el muse-journal.el muse-mode.el muse-publish.el + muse-regexps.el + + 2005-06-13 00:41:10 GMT Michael Olson patch-52 Summary: diff --git a/Makefile b/Makefile index c94ffa3..16d61d8 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,7 @@ clean: realclean distclean fullclean: clean -rm -f README.* missfont.log -test: fullclean $(TARGETS) $(ELC) - make clean +test: fullclean $(ELC) emacs -q -batch -L . -l scripts/muse-build.el \ -f muse-elint-files muse-*.el diff --git a/examples/johnw/muse-johnw.el b/examples/johnw/muse-johnw.el index 4556274..379d421 100644 --- a/examples/johnw/muse-johnw.el +++ b/examples/johnw/muse-johnw.el @@ -215,7 +215,7 @@ (catch 'done (while (re-search-forward "^\\(.+?\\)" nil t) (unless (get-text-property (point) 'read-only) - (setq l (1- (string-to-int (match-string 1)))) + (setq l (1- (string-to-number (match-string 1)))) (if (null base) (setq base l) (if (< l base) @@ -262,9 +262,9 @@ (concat "\\([1-9][0-9][0-9][0-9]\\)[./]?" "\\([0-1][0-9]\\)[./]?\\([0-3][0-9]\\)") date)) (setq date (encode-time 0 0 0 - (string-to-int (match-string 3 date)) - (string-to-int (match-string 2 date)) - (string-to-int (match-string 1 date)) + (string-to-number (match-string 3 date)) + (string-to-number (match-string 2 date)) + (string-to-number (match-string 1 date)) (current-time-zone))))) (when title (while (string-match "\\*" title) diff --git a/muse-colors.el b/muse-colors.el index c82365e..0cb9d1c 100644 --- a/muse-colors.el +++ b/muse-colors.el @@ -349,7 +349,12 @@ allowed, they are passed as a third argument in the form of an alist. The `end' argument to the function is the last character of the enclosed tag or region. -Functions should not modify the contents of the buffer.") +Functions should not modify the contents of the buffer." + :type '(repeat (list (string :tag "Markup tag") + (boolean :tag "Expect closing tag" :value t) + (boolean :tag "Parse attributes" :value nil) + function)) + :group 'muse-colors) (defsubst muse-colors-tag-info (tagname &rest args) (assoc tagname muse-colors-tags)) diff --git a/muse-html.el b/muse-html.el index c3303f7..9be0a4d 100644 --- a/muse-html.el +++ b/muse-html.el @@ -488,7 +488,7 @@ if not escaped." (catch 'done (while (re-search-forward "^\\(.+?\\)" nil t) (unless (get-text-property (point) 'read-only) - (setq l (1- (string-to-int (match-string 1)))) + (setq l (1- (string-to-number (match-string 1)))) (if (null base) (setq base l) (if (< l base) diff --git a/muse-journal.el b/muse-journal.el index 9b7c4f4..845ba6b 100644 --- a/muse-journal.el +++ b/muse-journal.el @@ -370,9 +370,9 @@ For more on the structure of this list, see (setq datestamp (encode-time 0 0 0 - (string-to-int (match-string 3 date)) - (string-to-int (match-string 2 date)) - (string-to-int (match-string 1 date)) + (string-to-number (match-string 3 date)) + (string-to-number (match-string 2 date)) + (string-to-number (match-string 1 date)) (current-time-zone)) date (concat (format-time-string muse-journal-date-format datestamp) @@ -461,9 +461,9 @@ For more on the structure of this list, see "\\([0-1][0-9]\\)[./]?\\([0-3][0-9]\\)") date)) (setq date (encode-time 0 0 0 - (string-to-int (match-string 3 date)) - (string-to-int (match-string 2 date)) - (string-to-int (match-string 1 date)) + (string-to-number (match-string 3 date)) + (string-to-number (match-string 2 date)) + (string-to-number (match-string 1 date)) (current-time-zone)) date (format-time-string muse-journal-date-format date)))) @@ -515,9 +515,9 @@ For more on the structure of this list, see (concat "\\([1-9][0-9][0-9][0-9]\\)[./]?" "\\([0-1][0-9]\\)[./]?\\([0-3][0-9]\\)") date)) (setq date (encode-time 0 0 0 - (string-to-int (match-string 3 date)) - (string-to-int (match-string 2 date)) - (string-to-int (match-string 1 date)) + (string-to-number (match-string 3 date)) + (string-to-number (match-string 2 date)) + (string-to-number (match-string 1 date)) (current-time-zone)) date (format-time-string (muse-style-element :date-format) date)))) diff --git a/muse-mode.el b/muse-mode.el index 494db9c..f9d2a54 100644 --- a/muse-mode.el +++ b/muse-mode.el @@ -46,9 +46,10 @@ (autoload 'muse-use-font-lock "muse-colors") (require 'derived) -(condition-case nil - (require 'pcomplete) ; load if available - (error nil)) +(eval-when-compile + (condition-case nil + (require 'pcomplete) ; load if available + (error nil))) ;;; Options: diff --git a/muse-publish.el b/muse-publish.el index 9facdda..93780b7 100644 --- a/muse-publish.el +++ b/muse-publish.el @@ -700,7 +700,7 @@ the file is published no matter what." (if (= (line-beginning-position) (match-beginning 0)) "" (let ((footnote (save-match-data - (string-to-int (match-string 1)))) + (string-to-number (match-string 1)))) footnotemark) (delete-region (match-beginning 0) (match-end 0)) (save-excursion @@ -920,7 +920,7 @@ like read-only from being inadvertently deleted." (set (make-local-variable 'muse-publish-generate-contents) (cons (copy-marker (point) t) (let ((depth (cdr (assoc "depth" attrs)))) - (or (and depth (string-to-int depth)) 2))))) + (or (and depth (string-to-number depth)) 2))))) (defun muse-publish-verse-tag (beg end) (save-excursion diff --git a/muse-regexps.el b/muse-regexps.el index e9c4302..0fe1650 100644 --- a/muse-regexps.el +++ b/muse-regexps.el @@ -50,7 +50,7 @@ options." ;; don't use if version is of format 21.x ((null (match-string 1 emacs-version)) nil) ;; don't trust the 21.3.1 release or its predecessors - ((> (string-to-int (match-string 1 emacs-version)) 1) t) + ((> (string-to-number (match-string 1 emacs-version)) 1) t) (t nil)))) (defgroup muse-regexp nil -- 2.11.4.GIT