[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pxref

From: Robert J. Chassell
Subject: Re: pxref
Date: Mon, 24 Oct 2005 20:17:01 +0000 (UTC)

       Now I understand what is your complaint.  Yes, I agree that the
       sentence produced by an @xref should begin with a capitalized "See".

   Isn't that how they actually begin, in the Info file?

That is the bug:  sentences stopped beginning that way in the default.

(Using today's CVS snapshot.)  There are two reasons that I discovered
in emacs/lisp/info.el in `Info-fontify-node':

  * First, the previous line of text, before a blank line, ended with a
    colon.  (You can see that here.)  A colon followed by a blank line
    should not force lower case when a blank line intervenes.

    To fix, move the colon from the conditional that always produces a
    lower case `see' and to the conditional that produces an upper
    case `See' and add a colon to the conditional involving a blank

  * Second, the `Info-fontify-node' function used `looking-at' rather than
    `looking-back' which meant never checking backwards.

    To fix, replace `looking-at' with `looking-back'.

I think these two changes fix all the problems; but I do not use the
default except for tests and would appreciate your trying this
yourself.  Thank you.

Here is the diff:

diff -c2p /usr/local/src/emacs/lisp/info.el.\~1.453.\~ 
*** /usr/local/src/emacs/lisp/info.el.~1.453.~  Mon Oct 24 19:22:40 2005
--- /usr/local/src/emacs/lisp/info.el   Mon Oct 24 20:10:24 2005
*************** the variable `Info-file-list-for-emacs'.
*** 3738,3744 ****
                    (skip-syntax-backward " ")
                    (setq other-tag
!                         (cond ((memq (char-before) '(nil ?\. ?! ??))
                                 "See ")
!                               ((memq (char-before) '(?\, ?\; ?\: ?-))
                                 "see ")
                                ((memq (char-before) '(?\( ?\[ ?\{))
--- 3738,3744 ----
                    (skip-syntax-backward " ")
                    (setq other-tag
!                         (cond ((memq (char-before) '(nil ?\. ?! ?\: ??))
                                 "See ")
!                               ((memq (char-before) '(?\, ?\; ?-))
                                 "see ")
                                ((memq (char-before) '(?\( ?\[ ?\{))
*************** the variable `Info-file-list-for-emacs'.
*** 3746,3753 ****
                                 ;; an end of sentence
                                 (skip-syntax-backward " (")
!                                (if (memq (char-before) '(nil ?\. ?! ??))
                                     "See "
                                   "see "))
!                               ((save-match-data (looking-at "\n\n"))
                                 "See "))))
                  (goto-char next)
--- 3746,3753 ----
                                 ;; an end of sentence
                                 (skip-syntax-backward " (")
!                                (if (memq (char-before) '(nil ?\. ?! ?\: ??))
                                     "See "
                                   "see "))
!                               ((save-match-data (looking-back "\n\n"))
                                 "See "))))
                  (goto-char next)

Here is a test Texinfo file that you can convert to Info:

\input texinfo.tex                             @c -*-texinfo-*-
@comment %**start of header
@setfilename foo.info
@settitle Texinfo Test
@comment %**end of header


 ## Summary of shell commands to create various output formats:

    pushd /u/texinfo/

    ## Info output
    makeinfo --force --fill-column=70 --no-split --paragraph-indent=0 \
    --verbose foo.texi

    ## ;; (kill-buffer "*info*")
    ## ;; (info "/u/texinfo/foo.info" nil)

    ## DVI output
    texi2dvi foo.texi

    ## View DVI output
    ##     xdvi foo.dvi &

    ## HTML output
    makeinfo --no-split --html foo.texi

    ## Plain text output
    makeinfo --fill-column=70 --no-split --paragraph-indent=0 \
    --verbose --no-headers --output=foo.txt  \

    ## DocBook output
    makeinfo --docbook --no-split --paragraph-indent=0 \
    --verbose foo.texi

    ## XML output
    makeinfo --xml --no-split --paragraph-indent=0 \
    --verbose foo.texi


@end ignore

@sp 6
@address@hidden @titlefont{Test document}
@sp 4
@center by Robert J. Chassell

@vskip 0pt plus 1filll
@end titlepage


@node Top, Chapter One, (dir), (dir)
@top Test Top
@end ifnottex

* Chapter One::
* Musings on fossil fuels::
@end menu

@node Chapter One, Musings on fossil fuels, Top, Top
@chapter Chapter One

Contents of chapter 1.

which is intended as a description of `what is'
@dots{} not the `what is' that most often concern citizens,
politicians, and political scientists, but a `what is' that reflects
the current world and of `what can be done'.

    Here is an @@pxref (@pxref{Musings on fossil fuels}) in a sentence.

    Here is a standalone xref within parentheses:

    (@xref{Musings on fossil fuels}.)

    Here is another @@xref, no parentheses; this ends with a colon and
    is followed by a blank line:

    @xref{Musings on fossil fuels}.

    Here is another @@xref, no parentheses; this ends with a period and
    is followed by a blank line.

    @xref{Musings on fossil fuels}.

More contents of chapter 1.

@node Musings on fossil fuels,  , Chapter One, Top
@chapter Musings on Fossil Fuels

More than three decades ago, some modern people I knew tried to
replace fossil fuels with alternate sources of energy.


    Robert J. Chassell                         
    address@hidden                         GnuPG Key ID: 004B4AC8
    http://www.rattlesnake.com                  http://www.teak.cc

reply via email to

[Prev in Thread] Current Thread [Next in Thread]