From: ueno Date: Mon, 4 Aug 2003 02:26:11 +0000 (+0000) Subject: Synch up with riece-0.0.4. X-Git-Tag: strict-naming-mergepoint~2 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b5b0cb445f9f36a17647717bbbdddec9811acbf;p=elisp%2Friece.git Synch up with riece-0.0.4. --- diff --git a/ChangeLog b/ChangeLog index 5f6b083..48b9cd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-08-03 Daiki Ueno + + * Riece: Version 0.0.4 released. + * configure.ac: Bump up version to 0.0.4. + 2003-06-02 Daiki Ueno * Riece: Version 0.0.3 released. diff --git a/configure.ac b/configure.ac index d2e406f..4e43dc3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_INIT(configure.ac) AC_PREREQ(2.50) -AM_INIT_AUTOMAKE(riece, 0.0.3) +AM_INIT_AUTOMAKE(riece, 0.0.4) AC_ISC_POSIX AC_PROG_INSTALL diff --git a/doc/ptexinfmt.el b/doc/ptexinfmt.el index 919dbae..66a507f 100644 --- a/doc/ptexinfmt.el +++ b/doc/ptexinfmt.el @@ -7,6 +7,7 @@ ;; Author: TAKAHASHI Kaoru ;; Yoshiki Hayashi +;; Katsumi Yamaoka ;; Maintainer: TAKAHASHI Kaoru ;; Created: 7 Jul 2000 ;; Keywords: maint, tex, docs, emulation, compatibility @@ -33,29 +34,81 @@ ;; Support texinfmt.el 2.32 or later. +;; Modified by Yamaoka not to use APEL functions. + ;;; Code: + +(require 'backquote) (require 'texinfmt) -(require 'poe) -(require 'broken) ;;; Broken (defvar ptexinfmt-disable-broken-notice-flag t - "If non-nil disable notice, when call `broken-facility'. -This is NO-NOTICE argument in `broken-facility'.") + "If non-nil disable notice, when call `ptexinfmt-broken-facility'. +This is last argument in `ptexinfmt-broken-facility'.") + +(put 'ptexinfmt-broken-facility 'lisp-indent-function 'defun) +(defmacro ptexinfmt-broken-facility (facility docstring assertion + &optional dummy) + "Declare a symbol FACILITY is broken if ASSERTION is nil. +DOCSTRING will be printed if ASSERTION is nil and +`ptexinfmt-disable-broken-notice-flag' is nil." + (` (let ((facility '(, facility)) + (docstring (, docstring)) + (assertion (eval '(, assertion)))) + (put facility 'broken (not assertion)) + (if assertion + nil + (put facility 'broken-docstring docstring) + (if ptexinfmt-disable-broken-notice-flag + nil + (message "BROKEN FACILITY DETECTED: %s" docstring)))))) + +(put 'ptexinfmt-defun-if-broken 'lisp-indent-function 'defun) +(defmacro ptexinfmt-defun-if-broken (&rest args) + "Redefine a function just like `defun' if it is considered broken." + (let ((name (list 'quote (car args)))) + (setq args (cdr args)) + (` (prog1 + (, name) + (if (get (, name) 'broken) + (defalias (, name) + (function (lambda (,@ args))))))))) + +(put 'ptexinfmt-defun-if-void 'lisp-indent-function 'defun) +(defmacro ptexinfmt-defun-if-void (&rest args) + "Define a function just like `defun' unless it is already defined." + (let ((name (list 'quote (car args)))) + (setq args (cdr args)) + (` (prog1 + (, name) + (if (fboundp (, name)) + nil + (defalias (, name) + (function (lambda (,@ args))))))))) + +(put 'ptexinfmt-defvar-if-void 'lisp-indent-function 'defun) +(defmacro ptexinfmt-defvar-if-void (&rest args) + "Define a variable just like `defvar' unless it is already defined." + (let ((name (car args))) + (setq args (cdr args)) + (` (prog1 + (defvar (, name)) + (if (boundp '(, name)) + nil + (defvar (, name) (,@ args))))))) ;; sort -fd -(broken-facility texinfo-format-printindex +(ptexinfmt-broken-facility texinfo-format-printindex "Can't sort on Mule for Windows." (if (and (memq system-type '(windows-nt ms-dos)) ;;; I don't know version threshold. ;;; (string< texinfmt-version "2.37 of 24 May 1997") (boundp 'MULE) (not (featurep 'meadow))) ; Mule for Windows nil - t) - ptexinfmt-disable-broken-notice-flag) + t)) ;; @var -(broken-facility texinfo-format-var +(ptexinfmt-broken-facility texinfo-format-var "Don't perse @var argument." (condition-case nil (with-temp-buffer @@ -64,11 +117,10 @@ This is NO-NOTICE argument in `broken-facility'.") (insert "@var{@asis{foo}}\n") (texinfo-format-expand-region (point-min) (point-max)) t)) - (error nil)) - ptexinfmt-disable-broken-notice-flag) + (error nil))) ;; @xref -(broken-facility texinfo-format-xref +(ptexinfmt-broken-facility texinfo-format-xref "Can't format @xref, 1st argument is empty." (condition-case nil (with-temp-buffer @@ -77,24 +129,22 @@ This is NO-NOTICE argument in `broken-facility'.") (insert "@xref{, xref, , file}\n") (texinfo-format-expand-region (point-min) (point-max)) t)) - (error nil)) - ptexinfmt-disable-broken-notice-flag) + (error nil))) ;; @uref -(broken-facility texinfo-format-uref +(ptexinfmt-broken-facility texinfo-format-uref "Parse twice @uref argument." (condition-case nil (with-temp-buffer (let (texinfo-enclosure-list texinfo-alias-list) (texinfo-mode) - (insert "@uref{mailto:foo@@bar.com}\n") + (insert "@uref{mailto:foo@@noncommand.example.com}\n") (texinfo-format-expand-region (point-min) (point-max)) t)) - (error nil)) - ptexinfmt-disable-broken-notice-flag) + (error nil))) ;; @multitable -(broken-facility texinfo-multitable-widths +(ptexinfmt-broken-facility texinfo-multitable-widths "`texinfo-multitable-widths' unsupport wide-char." (if (fboundp 'texinfo-multitable-widths) (with-temp-buffer @@ -106,13 +156,11 @@ This is NO-NOTICE argument in `broken-facility'.") nil t))) ;; function definition is void - t) - ptexinfmt-disable-broken-notice-flag) + t)) -(broken-facility texinfo-multitable-item +(ptexinfmt-broken-facility texinfo-multitable-item "`texinfo-multitable-item' unsupport wide-char." - (if-broken texinfo-multitable-widths nil t) - ptexinfmt-disable-broken-notice-flag) + (not (get 'texinfo-multitable-widths 'broken))) ;;; Hardcopy and HTML (discard) @@ -152,12 +200,17 @@ This is NO-NOTICE argument in `broken-facility'.") (put 'page 'texinfo-format 'texinfo-discard-line) (put 'hyphenation 'texinfo-format 'texinfo-discard-command-and-arg) +;; @tie{} (makeinfo 4.3 or later) +(put 'tie 'texinfo-format 'texinfo-format-tie) +(ptexinfmt-defun-if-void texinfo-format-tie () + (texinfo-parse-arg-discard) + (insert " ")) ;;; Directory File ;; @direcategory (put 'dircategory 'texinfo-format 'texinfo-format-dircategory) -(defun-maybe texinfo-format-dircategory () +(ptexinfmt-defun-if-void texinfo-format-dircategory () (let ((str (texinfo-parse-arg-discard))) (delete-region (point) (progn @@ -167,13 +220,13 @@ This is NO-NOTICE argument in `broken-facility'.") ;; @direntry (put 'direntry 'texinfo-format 'texinfo-format-direntry) -(defun-maybe texinfo-format-direntry () +(ptexinfmt-defun-if-void texinfo-format-direntry () (texinfo-push-stack 'direntry nil) (texinfo-discard-line) (insert "START-INFO-DIR-ENTRY\n")) (put 'direntry 'texinfo-end 'texinfo-end-direntry) -(defun-maybe texinfo-end-direntry () +(ptexinfmt-defun-if-void texinfo-end-direntry () (texinfo-discard-command) (insert "END-INFO-DIR-ENTRY\n\n") (texinfo-pop-stack 'direntry)) @@ -213,14 +266,14 @@ This is NO-NOTICE argument in `broken-facility'.") ;; @ifnotinfo ... @end ifnotinfo (makeinfo 3.11 or later) (put 'ifnotinfo 'texinfo-format 'texinfo-format-ifnotinfo) -(defun-maybe texinfo-format-ifnotinfo () +(ptexinfmt-defun-if-void texinfo-format-ifnotinfo () (delete-region texinfo-command-start (progn (re-search-forward "@end ifnotinfo[ \t]*\n") (point)))) ;; @html ... @end html (makeinfo 3.11 or later) (put 'html 'texinfo-format 'texinfo-format-html) -(defun-maybe texinfo-format-html () +(ptexinfmt-defun-if-void texinfo-format-html () (delete-region texinfo-command-start (progn (re-search-forward "@end html[ \t]*\n") (point)))) @@ -234,7 +287,7 @@ This is NO-NOTICE argument in `broken-facility'.") ;; @ifplaintext ... @end ifplaintext (makeinfo 4.2 or later) (put 'ifplaintext 'texinfo-format 'texinfo-format-ifplaintext) -(defun-maybe texinfo-format-ifplaintext () +(ptexinfmt-defun-if-void texinfo-format-ifplaintext () (delete-region texinfo-command-start (progn (re-search-forward "@end ifplaintext[ \t]*\n") (point)))) @@ -250,26 +303,24 @@ This is NO-NOTICE argument in `broken-facility'.") ;; @acronym (put 'acronym 'texinfo-format 'texinfo-format-var) -(when-broken texinfo-format-var - (fmakunbound 'texinfo-format-var)) -(defun-maybe texinfo-format-var () +(ptexinfmt-defun-if-broken texinfo-format-var () (let ((arg (texinfo-parse-expanded-arg))) (texinfo-discard-command) (insert (upcase arg)))) ;; @key (put 'key 'texinfo-format 'texinfo-format-key) -(defun-maybe texinfo-format-key () +(ptexinfmt-defun-if-void texinfo-format-key () (insert (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @email{EMAIL-ADDRESS[, DISPLAYED-TEXT]} (put 'email 'texinfo-format 'texinfo-format-email) -(defun-maybe texinfo-format-email () +(ptexinfmt-defun-if-void texinfo-format-email () "Format EMAIL-ADDRESS and optional DISPLAYED-TXT. Insert < ... > around EMAIL-ADDRESS." (let ((args (texinfo-format-parse-args))) - (texinfo-discard-command) + (texinfo-discard-command) ;; if displayed-text (if (nth 1 args) (insert (nth 1 args) " <" (nth 0 args) ">") @@ -277,7 +328,7 @@ Insert < ... > around EMAIL-ADDRESS." ;; @option (put 'option 'texinfo-format 'texinfo-format-option) -(defun texinfo-format-option () +(ptexinfmt-defun-if-void texinfo-format-option () "Insert ` ... ' around arg unless inside a table; in that case, no quotes." ;; `looking-at-backward' not available in v. 18.57, 20.2 ;; searched-for character is a control-H @@ -288,168 +339,193 @@ Insert < ... > around EMAIL-ADDRESS." (insert (texinfo-parse-arg-discard))) (goto-char texinfo-command-start)) +;; @verb{TEXT} (makeinfo 4.1 or later) +(put 'verb 'texinfo-format 'texinfo-format-verb) +(ptexinfmt-defun-if-void texinfo-format-verb () + "Format text between non-quoted unique delimiter characters verbatim. +Enclose the verbatim text, including the delimiters, in braces. Print +text exactly as written (but not the delimiters) in a fixed-width. + +For example, @verb\{|@|\} results in @ and +@verb\{+@'e?`!`+} results in @'e?`!`." + + (let ((delimiter (buffer-substring-no-properties + (1+ texinfo-command-end) (+ 2 texinfo-command-end)))) + (unless (looking-at "{") + (error "Not found: @verb start brace")) + (delete-region texinfo-command-start (+ 2 texinfo-command-end)) + (search-forward delimiter)) + (delete-backward-char 1) + (unless (looking-at "}") + (error "Not found: @verb end brace")) + (delete-char 1)) ;;; Accents and Special characters ;; @pounds{} ==> # Pounds Sterling (put 'pounds 'texinfo-format 'texinfo-format-pounds) -(defun-maybe texinfo-format-pounds () +(ptexinfmt-defun-if-void texinfo-format-pounds () (texinfo-parse-arg-discard) (insert "#")) ;; @OE{} ==> OE French-OE-ligature (put 'OE 'texinfo-format 'texinfo-format-French-OE-ligature) -(defun-maybe texinfo-format-French-OE-ligature () +(ptexinfmt-defun-if-void texinfo-format-French-OE-ligature () (insert "OE" (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @oe{} ==> oe (put 'oe 'texinfo-format 'texinfo-format-French-oe-ligature) -(defun-maybe texinfo-format-French-oe-ligature () ; lower case +(ptexinfmt-defun-if-void texinfo-format-French-oe-ligature () ; lower case (insert "oe" (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @AA{} ==> AA Scandinavian-A-with-circle (put 'AA 'texinfo-format 'texinfo-format-Scandinavian-A-with-circle) -(defun-maybe texinfo-format-Scandinavian-A-with-circle () +(ptexinfmt-defun-if-void texinfo-format-Scandinavian-A-with-circle () (insert "AA" (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @aa{} ==> aa (put 'aa 'texinfo-format 'texinfo-format-Scandinavian-a-with-circle) -(defun-maybe texinfo-format-Scandinavian-a-with-circle () ; lower case +(ptexinfmt-defun-if-void texinfo-format-Scandinavian-a-with-circle () ; lower case (insert "aa" (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @AE{} ==> AE Latin-Scandinavian-AE (put 'AE 'texinfo-format 'texinfo-format-Latin-Scandinavian-AE) -(defun-maybe texinfo-format-Latin-Scandinavian-AE () +(ptexinfmt-defun-if-void texinfo-format-Latin-Scandinavian-AE () (insert "AE" (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @ae{} ==> ae (put 'ae 'texinfo-format 'texinfo-format-Latin-Scandinavian-ae) -(defun-maybe texinfo-format-Latin-Scandinavian-ae () ; lower case +(ptexinfmt-defun-if-void texinfo-format-Latin-Scandinavian-ae () ; lower case (insert "ae" (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @ss{} ==> ss German-sharp-S (put 'ss 'texinfo-format 'texinfo-format-German-sharp-S) -(defun-maybe texinfo-format-German-sharp-S () +(ptexinfmt-defun-if-void texinfo-format-German-sharp-S () (insert "ss" (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @questiondown{} ==> ? upside-down-question-mark (put 'questiondown 'texinfo-format 'texinfo-format-upside-down-question-mark) -(defun-maybe texinfo-format-upside-down-question-mark () +(ptexinfmt-defun-if-void texinfo-format-upside-down-question-mark () (insert "?" (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @exclamdown{} ==> ! upside-down-exclamation-mark (put 'exclamdown 'texinfo-format 'texinfo-format-upside-down-exclamation-mark) -(defun-maybe texinfo-format-upside-down-exclamation-mark () +(ptexinfmt-defun-if-void texinfo-format-upside-down-exclamation-mark () (insert "!" (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @L{} ==> L/ Polish suppressed-L (Lslash) (put 'L 'texinfo-format 'texinfo-format-Polish-suppressed-L) -(defun-maybe texinfo-format-Polish-suppressed-L () +(ptexinfmt-defun-if-void texinfo-format-Polish-suppressed-L () (insert (texinfo-parse-arg-discard) "/L") (goto-char texinfo-command-start)) ;; @l{} ==> l/ Polish suppressed-L (Lslash) (lower case) (put 'l 'texinfo-format 'texinfo-format-Polish-suppressed-l-lower-case) -(defun-maybe texinfo-format-Polish-suppressed-l-lower-case () +(ptexinfmt-defun-if-void texinfo-format-Polish-suppressed-l-lower-case () (insert (texinfo-parse-arg-discard) "/l") (goto-char texinfo-command-start)) ;; @O{} ==> O/ Scandinavian O-with-slash (put 'O 'texinfo-format 'texinfo-format-Scandinavian-O-with-slash) -(defun-maybe texinfo-format-Scandinavian-O-with-slash () +(ptexinfmt-defun-if-void texinfo-format-Scandinavian-O-with-slash () (insert (texinfo-parse-arg-discard) "O/") (goto-char texinfo-command-start)) ;; @o{} ==> o/ Scandinavian O-with-slash (lower case) (put 'o 'texinfo-format 'texinfo-format-Scandinavian-o-with-slash-lower-case) -(defun-maybe texinfo-format-Scandinavian-o-with-slash-lower-case () +(ptexinfmt-defun-if-void texinfo-format-Scandinavian-o-with-slash-lower-case () (insert (texinfo-parse-arg-discard) "o/") (goto-char texinfo-command-start)) ;; @,{c} ==> c, cedilla accent (put ', 'texinfo-format 'texinfo-format-cedilla-accent) -(defun-maybe texinfo-format-cedilla-accent () +(ptexinfmt-defun-if-void texinfo-format-cedilla-accent () (insert (texinfo-parse-arg-discard) ",") (goto-char texinfo-command-start)) ;; @dotaccent{o} ==> .o overdot-accent (put 'dotaccent 'texinfo-format 'texinfo-format-overdot-accent) -(defun-maybe texinfo-format-overdot-accent () +(ptexinfmt-defun-if-void texinfo-format-overdot-accent () (insert "." (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @ubaraccent{o} ==> _o underbar-accent (put 'ubaraccent 'texinfo-format 'texinfo-format-underbar-accent) -(defun-maybe texinfo-format-underbar-accent () +(ptexinfmt-defun-if-void texinfo-format-underbar-accent () (insert "_" (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @udotaccent{o} ==> o-. underdot-accent (put 'udotaccent 'texinfo-format 'texinfo-format-underdot-accent) -(defun-maybe texinfo-format-underdot-accent () +(ptexinfmt-defun-if-void texinfo-format-underdot-accent () (insert (texinfo-parse-arg-discard) "-.") (goto-char texinfo-command-start)) ;; @H{o} ==> ""o long Hungarian umlaut (put 'H 'texinfo-format 'texinfo-format-long-Hungarian-umlaut) -(defun-maybe texinfo-format-long-Hungarian-umlaut () +(ptexinfmt-defun-if-void texinfo-format-long-Hungarian-umlaut () (insert "\"\"" (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @ringaccent{o} ==> *o ring accent (put 'ringaccent 'texinfo-format 'texinfo-format-ring-accent) -(defun-maybe texinfo-format-ring-accent () +(ptexinfmt-defun-if-void texinfo-format-ring-accent () (insert "*" (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @tieaccent{oo} ==> [oo tie after accent (put 'tieaccent 'texinfo-format 'texinfo-format-tie-after-accent) -(defun-maybe texinfo-format-tie-after-accent () +(ptexinfmt-defun-if-void texinfo-format-tie-after-accent () (insert "[" (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @u{o} ==> (o breve accent (put 'u 'texinfo-format 'texinfo-format-breve-accent) -(defun-maybe texinfo-format-breve-accent () +(ptexinfmt-defun-if-void texinfo-format-breve-accent () (insert "(" (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @v{o} ==> i dotless i and dotless j (put 'dotless 'texinfo-format 'texinfo-format-dotless) -(defun-maybe texinfo-format-dotless () +(ptexinfmt-defun-if-void texinfo-format-dotless () (insert (texinfo-parse-arg-discard)) (goto-char texinfo-command-start)) ;; @. (put '\. 'texinfo-format 'texinfo-format-\.) -(defun-maybe texinfo-format-\. () +(ptexinfmt-defun-if-void texinfo-format-\. () (texinfo-discard-command) (insert ".")) ;; @: (put '\: 'texinfo-format 'texinfo-format-\:) -(defun-maybe texinfo-format-\: () +(ptexinfmt-defun-if-void texinfo-format-\: () (texinfo-discard-command)) ;; @- (put '\- 'texinfo-format 'texinfo-format-soft-hyphen) -(defun-maybe texinfo-format-soft-hyphen () +(ptexinfmt-defun-if-void texinfo-format-soft-hyphen () + (texinfo-discard-command)) + +;; @/ +(put '\/ 'texinfo-format 'texinfo-format-\/) +(ptexinfmt-defun-if-void texinfo-format-\/ () (texinfo-discard-command)) @@ -457,9 +533,7 @@ Insert < ... > around EMAIL-ADDRESS." ;; @ref, @xref (put 'ref 'texinfo-format 'texinfo-format-xref) -(when-broken texinfo-format-xref - (fmakunbound 'texinfo-format-xref)) -(defun-maybe texinfo-format-xref () +(ptexinfmt-defun-if-broken texinfo-format-xref () (let ((args (texinfo-format-parse-args))) (texinfo-discard-command) (insert "*Note ") @@ -472,11 +546,9 @@ Insert < ... > around EMAIL-ADDRESS." (unless (null (nth 0 args)) (insert (nth 0 args))))))) -;; @uref +;; @uref{URL [,TEXT] [,REPLACEMENT]} (put 'uref 'texinfo-format 'texinfo-format-uref) -(when-broken texinfo-format-uref - (fmakunbound 'texinfo-format-uref)) -(defun-maybe texinfo-format-uref () +(ptexinfmt-defun-if-broken texinfo-format-uref () "Format URL and optional URL-TITLE. Insert ` ... ' around URL if no URL-TITLE argument; otherwise, insert URL-TITLE followed by URL in parentheses." @@ -489,7 +561,7 @@ otherwise, insert URL-TITLE followed by URL in parentheses." ;; @inforef (put 'inforef 'texinfo-format 'texinfo-format-inforef) -(defun-maybe texinfo-format-inforef () +(ptexinfmt-defun-if-void texinfo-format-inforef () (let ((args (texinfo-format-parse-args))) (texinfo-discard-command) (if (nth 1 args) @@ -510,7 +582,7 @@ otherwise, insert URL-TITLE followed by URL in parentheses." ;;; New command definition ;; @alias NEW=EXISTING (put 'alias 'texinfo-format 'texinfo-alias) -(defun-maybe texinfo-alias () +(ptexinfmt-defun-if-void texinfo-alias () (let ((start (1- (point))) args) (skip-chars-forward " ") @@ -526,10 +598,21 @@ otherwise, insert URL-TITLE followed by URL in parentheses." (texinfo-discard-command)))) +;;; Indent +;; @exampleindent INDENT (makeinfo 4.0 or later) + +;; @paragraphindent INDENT (makeinfo 4.0 or later) +;; INDENT: asis, 0, n + +;; @firstparagraphindent WORD (makeinfo 4.6 or later) +;; WORD: none, insert + + + ;;; Special -;; @image{FILENAME, [WIDTH], [HEIGHT]} +;; @image{FILENAME [, WIDTH] [, HEIGHT]} (put 'image 'texinfo-format 'texinfo-format-image) -(defun-maybe texinfo-format-image () +(ptexinfmt-defun-if-void texinfo-format-image () ;; I don't know makeinfo parse FILENAME. (let ((args (texinfo-format-parse-args)) filename) @@ -545,24 +628,22 @@ otherwise, insert URL-TITLE followed by URL in parentheses." ;; @hyphenation command discards an argument within braces (put 'hyphenation 'texinfo-format 'texinfo-discard-command-and-arg) -(defun-maybe texinfo-discard-command-and-arg () +(ptexinfmt-defun-if-void texinfo-discard-command-and-arg () "Discard both @-command and its argument in braces." (goto-char texinfo-command-end) (forward-list 1) (setq texinfo-command-end (point)) (delete-region texinfo-command-start texinfo-command-end)) - -;; @exampleindent - - ;;; @multitable ... @end multitable -(defvar-maybe texinfo-extra-inter-column-width 0 +(ptexinfmt-defvar-if-void texinfo-extra-inter-column-width 0 "*Number of extra spaces between entries (columns) in @multitable.") -(defvar-maybe texinfo-multitable-buffer-name "*multitable-temporary-buffer*") -(defvar-maybe texinfo-multitable-rectangle-name "texinfo-multitable-temp-") +(ptexinfmt-defvar-if-void texinfo-multitable-buffer-name + "*multitable-temporary-buffer*") +(ptexinfmt-defvar-if-void texinfo-multitable-rectangle-name + "texinfo-multitable-temp-") ;; These commands are defined in texinfo.tex for printed output. (put 'multitableparskip 'texinfo-format 'texinfo-discard-line-with-args) @@ -572,7 +653,7 @@ otherwise, insert URL-TITLE followed by URL in parentheses." (put 'multitable 'texinfo-format 'texinfo-multitable) -(defun-maybe texinfo-multitable () +(ptexinfmt-defun-if-void texinfo-multitable () "Produce multi-column tables." ;; This function pushes information onto the `texinfo-stack'. @@ -589,15 +670,12 @@ otherwise, insert URL-TITLE followed by URL in parentheses." (texinfo-discard-line-with-args)) (put 'multitable 'texinfo-end 'texinfo-end-multitable) -(defun-maybe texinfo-end-multitable () +(ptexinfmt-defun-if-void texinfo-end-multitable () "Discard the @end multitable line and pop the stack of multitable." (texinfo-discard-command) (texinfo-pop-stack 'multitable)) -(when-broken texinfo-multitable-widths - (fmakunbound 'texinfo-multitable-widths)) - -(defun-maybe texinfo-multitable-widths () +(ptexinfmt-defun-if-broken texinfo-multitable-widths () "Return list of widths of each column in a multi-column table." (let (texinfo-multitable-width-list) ;; Fractions format: @@ -632,16 +710,19 @@ otherwise, insert URL-TITLE followed by URL in parentheses." ;; forward-sexp works with braces in Texinfo mode (progn (forward-sexp 1) (1- (point))))) (setq texinfo-multitable-width-list - (cons (- (progn (goto-char end-of-template) (current-column)) - (progn (goto-char start-of-template) (current-column))) + (cons (- (progn + (goto-char end-of-template) + (current-column)) + (progn + (goto-char start-of-template) + (current-column))) texinfo-multitable-width-list)) ;; Remove carriage return from within a template, if any. ;; This helps those those who want to use more than ;; one line's worth of words in @multitable line. (narrow-to-region start-of-template end-of-template) (goto-char (point-min)) - (while (search-forward " -" nil t) + (while (search-forward "\n" nil t) (delete-char -1)) (goto-char (point-max)) (widen) @@ -649,8 +730,8 @@ otherwise, insert URL-TITLE followed by URL in parentheses." ;; ;; Case 3: Trouble (t - (error - "You probably need to specify column widths for @multitable correctly"))) + (error "\ +You probably need to specify column widths for @multitable correctly"))) ;; Check whether columns fit on page. (let ((desired-columns (+ @@ -661,14 +742,13 @@ otherwise, insert URL-TITLE followed by URL in parentheses." ;; sum of spaces for each entry (apply '+ texinfo-multitable-width-list)))) (if (> desired-columns fill-column) - (error - (format - "Multi-column table width, %d chars, is greater than page width, %d chars." - desired-columns fill-column)))) + (error (format "\ +Multi-column table width, %d chars, is greater than page width, %d chars." + desired-columns fill-column)))) texinfo-multitable-width-list)) ;; @item A1 @tab A2 @tab A3 -(defun-maybe texinfo-multitable-extract-row () +(ptexinfmt-defun-if-void texinfo-multitable-extract-row () "Return multitable row, as a string. End of row is beginning of next @item or beginning of @end. Cells within rows are separated by @tab." @@ -685,11 +765,8 @@ Cells within rows are separated by @tab." (delete-region texinfo-command-start end) row)) -(when-broken texinfo-multitable-item - (fmakunbound 'texinfo-multitable-item)) - (put 'multitable 'texinfo-item 'texinfo-multitable-item) -(defun-maybe texinfo-multitable-item () +(ptexinfmt-defun-if-void texinfo-multitable-item () "Format a row within a multicolumn table. Cells in row are separated by @tab. Widths of cells are specified by the arguments in the @multitable line. @@ -711,7 +788,7 @@ This command is executed when texinfmt sees @item inside @multitable." (insert unformated-row) (goto-char (point-min)) ;; 1. Check for correct number of @tab in line. - (let ((tab-number 1)) ; one @tab between two columns + (let ((tab-number 1)) ;; one @tab between two columns (while (search-forward "@tab" nil t) (setq tab-number (1+ tab-number))) (if (/= tab-number (length table-widths)) @@ -744,21 +821,23 @@ This command is executed when texinfmt sees @item inside @multitable." (delete-region (point) (save-excursion (end-of-line) (point))) ;; Temorarily set texinfo-stack to nil so texinfo-format-scan ;; does not see an unterminated @multitable. - (let (texinfo-stack) ; nil + (let (texinfo-stack) ;; nil (texinfo-format-scan)) - (let (fill-prefix) ; no fill prefix + (let (fill-prefix) ;; no fill prefix (fill-region (point-min) (point-max))) (setq table-entry-height (max table-entry-height (count-lines (point-min) (point-max)))) ;; 3. Move point to end of bottom line, and pad that line to fill column. (goto-char (point-min)) (forward-line (1- table-entry-height)) - (let* ((beg (point)) ; beginning of line + (let* ((beg (point)) ;; beginning of line ;; add one more space for inter-column spacing (needed-whitespace (1+ (- fill-column - (progn (end-of-line) (current-column)))))) ; end of existing line + (progn + (end-of-line) + (current-column)))))) ;; end of existing line (insert (make-string (if (> needed-whitespace 0) needed-whitespace 1) ? ))) @@ -795,10 +874,7 @@ This command is executed when texinfmt sees @item inside @multitable." (setq fill-column existing-fill-column))) -(when-broken texinfo-format-printindex - (fmakunbound 'texinfo-format-printindex)) - -(defun-maybe texinfo-format-printindex () +(ptexinfmt-defun-if-broken texinfo-format-printindex () (let ((indexelts (symbol-value (cdr (assoc (texinfo-parse-arg-discard) texinfo-indexvar-alist)))) diff --git a/doc/riece-ja.texi b/doc/riece-ja.texi index 4984f86..0ade1d6 100644 --- a/doc/riece-ja.texi +++ b/doc/riece-ja.texi @@ -3,7 +3,7 @@ @setfilename riece-ja.info @settitle Riece -- An IRC client for Emacsen -- @c %**end of header -@set VERSION 0.0.3 +@set VERSION 0.0.4 @c @documentlanguage ja @dircategory GNU Emacs Lisp @@ -491,6 +491,14 @@ CTCP (Client To Client Protocol) 発言のあったチャンネルに@samp{!}マークをつける @item riece-rdcc DCC (Direct Client to Client protocol) によるファイル転送 +(Ruby による実装) +@item riece-ndcc +DCC (Direct Client to Client protocol) によるファイル転送 +(Emacs 21.3 の make-network-process による実装) +@item riece-mini +ミニバッファのみで IRC をする +@item riece-log +会話のログの収集 @end table これらのうち、@samp{riece-highlight} と @samp{riece-ctcp} はデフォルトで @@ -502,7 +510,7 @@ DCC (Direct Client to Client protocol) によるファイル転送 @vindex riece-addons @example -(add-to-list 'riece-addons 'riece-url t) +(add-to-list 'riece-addons 'riece-url) @end example @node Writing add-ons, Handler hooks, Add-ons, Advanced usage diff --git a/lisp/COMPILE b/lisp/COMPILE index 60afb3d..d5473c2 100644 --- a/lisp/COMPILE +++ b/lisp/COMPILE @@ -41,6 +41,8 @@ ;; add-ons riece-ctcp riece-highlight + riece-log + riece-mini riece-rdcc riece-url riece-unread diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c920dd3..df490d0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2003-08-04 Daiki Ueno + * riece-mini.el (riece-mini-send-message): Use + riece-completing-read-identity; don't use riece-own-channel-message. + * riece-identity.el: Require 'riece-compat. (riece-identity-prefix-case-table): New variable. (riece-abbrev-identity-string-function): New variable. @@ -20,6 +23,16 @@ * riece-xemacs.el (riece-set-case-syntax-pair): New alias. * riece-identity.el (riece-identity-canonicalize-prefix): Simplified. +2003-08-03 Daiki Ueno + + * Riece: Version 0.0.4 released. + * riece-version.el (riece-version-number): Bump up to 0.0.4. + +2003-06-24 OHASHI Akira + + * riece-unread.el (riece-unread-display-message-function): Don't check + `selected-window'. It doesn't work as expected. + 2003-06-23 Daiki Ueno * riece-misc.el (riece-channel-p): Moved from riece-channel.el. @@ -64,6 +77,13 @@ buffer local. (riece-user-list-mode): Ditto. +2003-06-22 Yoichi NAKAYAMA + + * riece-log.el, riece-mini.el, riece-unread.el, riece-url.el: + Fix example setting, don't use 3rd arg of add-to-list. + + * riece-coding.el (riece-default-coding-system): Fix default value. + 2003-06-22 Daiki Ueno * riece-display.el (riece-inhibit-update-buffers): New variable. @@ -84,6 +104,23 @@ * riece-identity.el (riece-completing-read-identity): Remove nil from riece-current-channels before converting it to an alist. +2003-06-17 OHASHI Akira + + * riece-unread.el (riece-unread-display-message-function): Check a + `selected-window'. + + * riece-mini.el: New add-on. + * COMPILE (riece-modules): Add `riece-mini'. + * Makefile.am (EXTRA_DIST): Add `riece-mini.el'. + + * riece-display.el (riece-channel-buffer-create): Add new hook. + * riece-log.el: New add-on for saving irc logs. + * COMPILE (riece-modules): Add `riece-log'. + * Makefile.am (EXTRA_DIST): Add `riece-log.el'. + + * riece-commands.el (riece-command-join): Use `let*' instead of `let'. + (riece-command-part): Ditto. + 2003-06-12 Daiki Ueno * riece-naming.el (riece-naming-assert-join): Call diff --git a/lisp/Makefile.am b/lisp/Makefile.am index 534813a..8439371 100644 --- a/lisp/Makefile.am +++ b/lisp/Makefile.am @@ -7,7 +7,8 @@ EXTRA_DIST = COMPILE ChangeLog ChangeLog.Liece \ riece-options.el riece-server.el riece-user.el riece-version.el \ riece-xemacs.el riece.el \ riece-ctcp.el riece-url.el riece-unread.el \ - riece-ndcc.el riece-rdcc.el riece-doctor.el riece-alias.el + riece-ndcc.el riece-rdcc.el riece-log.el riece-mini.el \ + riece-doctor.el riece-alias.el CLEANFILES = auto-autoloads.el custom-load.el *.elc FLAGS ?= -batch -q -no-site-file diff --git a/lisp/riece-coding.el b/lisp/riece-coding.el index 9d14be1..6b0fa35 100644 --- a/lisp/riece-coding.el +++ b/lisp/riece-coding.el @@ -33,8 +33,7 @@ :group 'riece) (defcustom riece-default-coding-system - (if (and (or (featurep 'mule) - (featurep 'file-coding))) + (if (featurep 'mule) (cons 'ctext 'iso-2022-jp-2)) "Coding system for process I/O. The value is a coding system, or a cons cell (DECODING . ENCODING) diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index 6123263..2c8cb1a 100644 --- a/lisp/riece-commands.el +++ b/lisp/riece-commands.el @@ -410,11 +410,11 @@ (defun riece-command-join (target &optional key) (interactive - (let ((completion-ignore-case t) - (target - (riece-completing-read-identity - "Channel/User: " riece-current-channels)) - key) + (let* ((completion-ignore-case t) + (target + (riece-completing-read-identity + "Channel/User: " riece-current-channels)) + key) (if (and current-prefix-arg (riece-channel-p target)) (setq key @@ -442,7 +442,7 @@ (defun riece-command-part (target &optional message) (interactive - (let ((completion-ignore-case t) + (let* ((completion-ignore-case t) (target (riece-completing-read-identity "Channel/User: " riece-current-channels nil nil diff --git a/lisp/riece-display.el b/lisp/riece-display.el index f3358a8..64ac02b 100644 --- a/lisp/riece-display.el +++ b/lisp/riece-display.el @@ -249,7 +249,8 @@ Local to the buffers.") (concat "Created on " (funcall riece-format-time-function (current-time)) - "\n")))) + "\n")) + (run-hook-with-args 'riece-channel-buffer-create-functions identity))) (current-buffer))) (defun riece-switch-to-channel (identity) diff --git a/lisp/riece-mini.el b/lisp/riece-mini.el index f44db0c..e57393d 100644 --- a/lisp/riece-mini.el +++ b/lisp/riece-mini.el @@ -79,8 +79,8 @@ If twice (C-u C-u), then ask the channel." (target (cond ((equal arg '(16)) - (completing-read "Channel/User: " - (mapcar #'list riece-current-channels) nil t)) + (riece-completing-read-identity + "Channel/User: " riece-current-channels nil t)) (arg (or riece-mini-last-channel riece-current-channel)) (t riece-current-channel))) (message (read-string (format "Message to %s: " target)))) @@ -90,7 +90,9 @@ If twice (C-u C-u), then ask the channel." (format "PRIVMSG %s :%s\r\n" (riece-identity-prefix target) message)) - (riece-own-channel-message message target)))) + (riece-display-message + (riece-make-message (riece-current-nickname) target + message nil t))))) (defun riece-mini-insinuate () (add-hook 'riece-after-display-message-functions diff --git a/lisp/riece-unread.el b/lisp/riece-unread.el index cb7670d..d03024d 100644 --- a/lisp/riece-unread.el +++ b/lisp/riece-unread.el @@ -27,7 +27,7 @@ ;; "unread messages". ;; To use, add the following line to your ~/.riece/init.el: -;; (add-to-list 'riece-addons 'riece-unread t) +;; (add-to-list 'riece-addons 'riece-unread) ;;; Code: @@ -51,21 +51,23 @@ (riece-unread-update-channel-list-buffer)) (defun riece-unread-update-channel-list-buffer () - (save-excursion - (set-buffer riece-channel-list-buffer) - (let ((inhibit-read-only t) - buffer-read-only) - (goto-char (point-min)) - (while (not (eobp)) - (if (looking-at "\\( ?[0-9]+:\\)[ !]") - (let ((channel (get-text-property (match-end 0) 'riece-identity))) - (replace-match - (concat "\\1" - (if (member channel riece-unread-channels) - "!" - " "))))) - (forward-line))))) - + (if riece-channel-list-buffer-mode + (save-excursion + (set-buffer riece-channel-list-buffer) + (let ((inhibit-read-only t) + buffer-read-only) + (goto-char (point-min)) + (while (not (eobp)) + (if (looking-at "\\( ?[0-9]+:\\)\\([ !]\\)\\(.+\\)") + (let ((channel (match-string 3))) + (replace-match + (concat "\\1" + (if (member channel riece-unread-channels) + "!" + " ") + "\\3")))) + (forward-line)))))) + (defun riece-unread-switch-to-channel () (interactive) (if (car riece-unread-channels) diff --git a/lisp/riece-url.el b/lisp/riece-url.el index 9a694f5..8a62c18 100644 --- a/lisp/riece-url.el +++ b/lisp/riece-url.el @@ -25,7 +25,7 @@ ;;; Commentary: ;; To use, add the following line to your ~/.riece/init.el: -;; (add-to-list 'riece-addons 'riece-url t) +;; (add-to-list 'riece-addons 'riece-url) ;;; Code: diff --git a/lisp/riece-version.el b/lisp/riece-version.el index 2bf3fa3..5cd7a89 100644 --- a/lisp/riece-version.el +++ b/lisp/riece-version.el @@ -48,7 +48,7 @@ string, be sure to use a valid format, see RFC 2616." (defconst riece-product-name "Riece") -(defconst riece-version-number "0.0.3" +(defconst riece-version-number "0.0.4" "Version number for this version of Riece.") (defconst riece-version (format "Riece v%s" riece-version-number)