all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Ryde <user42@zip.com.au>
To: 12639@debbugs.gnu.org
Subject: bug#12639: 24.1; woman.el points vs pica scaling
Date: Sun, 14 Oct 2012 11:11:03 +1100	[thread overview]
Message-ID: <87pq4lvroo.fsf@blah.blah> (raw)

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]

The file picapoints.1 viewed with

    M-x woman-find-file picapoints.1

gives

    12 point spacing                      xxx
    12 picas spacing                      xxx

where I expected that "12p" points would be much less than "12P" picas,
something like maybe

     12 point spacing    xxx
     12 picas spacing                      xxx

It looks like case-fold-search is true in woman-parse-numeric-value
causing "p" points and "P" picas not to be distinguished.

I can't tell if that's meant to be so.  There seems to be duelling
`let's of case significance.  Ensuring it where it matters per diff
below might be a good idea.

2012-10-14  Kevin Ryde  <user42@zip.com.au>

	* woman.el (woman-parse-numeric-value): case-fold-search nil to ensure
	"p" points and "P" picas scaling are distinguished as intended.


I struck this on output from recent perl pod2man where there's some
spacing to make "C++" look good, per cplusplus.1 below.  It's meant for
troff, but when woman wrongly takes it as 1 pica instead of 1 point the
movement forward and back doesn't add up and a space after the construct
is lost, so giving

    Blah C^++blah.

With case-significance fixed it becomes the intended

    Blah C^++ blah.


[-- Attachment #2: picapoints.1 --]
[-- Type: text/plain, Size: 80 bytes --]

.TH FOO 1
.SH NAME
12 point spacing \h'12p' xxx
.P
12 picas spacing \h'12P' xxx

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: woman.el.picas.diff --]
[-- Type: text/x-diff, Size: 1179 bytes --]

--- woman.el.orig	2012-10-14 10:41:57.000000000 +1100
+++ woman.el	2012-10-14 10:56:45.000000000 +1100
@@ -3627,16 +3627,17 @@
 	(goto-char (match-end 0))
 	;; Check for scale factor:
 	(if
-	    (cond
-	     ((looking-at "\\s ") nil)	; stay put!
-	     ((looking-at "[mnuv]"))	; ignore for now
-	     ((looking-at "i") (setq n (* n 10))) ; inch
-	     ((looking-at "c") (setq n (* n 3.9))) ; cm
-	     ((looking-at "P") (setq n (* n 1.7))) ; Pica
-	     ((looking-at "p") (setq n (* n 0.14))) ; point
-	     ;; NB: May be immediately followed by + or -, etc.,
-	     ;; in which case do nothing and return nil.
-	     )
+	    (let ((case-fold-search nil))
+	      (cond
+	       ((looking-at "\\s ") nil)	; stay put!
+	       ((looking-at "[mnuv]"))	; ignore for now
+	       ((looking-at "i") (setq n (* n 10))) ; inch
+	       ((looking-at "c") (setq n (* n 3.9))) ; cm
+	       ((looking-at "P") (setq n (* n 1.7))) ; Pica
+	       ((looking-at "p") (setq n (* n 0.14))) ; point
+	       ;; NB: May be immediately followed by + or -, etc.,
+	       ;; in which case do nothing and return nil.
+	       ))
 	    (goto-char (match-end 0)))
 	(if (numberp n) (round n) n)))))
 

[-- Attachment #4: cplusplus.1 --]
[-- Type: text/plain, Size: 90 bytes --]

.TH FOO 1
.SH NAME
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
Blah \*(C+ blah.

[-- Attachment #5: Type: text/plain, Size: 1162 bytes --]




In GNU Emacs 24.1.1 (i486-pc-linux-gnu, GTK+ Version 2.24.8)
 of 2012-08-07 on blah.blah, modified by Debian
Configured using:
 `configure '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.1/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/i386-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars'
 'build_alias=i486-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_AU
  value of $XMODIFIERS: nil
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: t

             reply	other threads:[~2012-10-14  0:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-14  0:11 Kevin Ryde [this message]
2012-10-29 10:31 ` bug#12639: 24.1; woman.el points vs pica scaling Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pq4lvroo.fsf@blah.blah \
    --to=user42@zip.com.au \
    --cc=12639@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.