unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#1723: 23.0.60; Odd behaviour with #'check-coding-systems-region
@ 2008-12-28 17:20 Aidan Kehoe
  0 siblings, 0 replies; 3+ messages in thread
From: Aidan Kehoe @ 2008-12-28 17:20 UTC (permalink / raw)
  To: emacs-pretest-bug


Hi!

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

The check-coding-systems-region docstring says this: 

  (check-coding-systems-region start end coding-system-list)
  
  Check if the region is encodable by coding systems.
  
  start and end are buffer positions specifying the region.
  coding-system-list is a list of coding systems to check.
  
  The value is an alist ((CODING-SYSTEM POS0 POS1 ...) ...), where
  CODING-SYSTEM is a member of coding-system-list and can't encode the
  whole region, POS0, POS1, ... are buffer positions where non-encodable
  characters are found.
  
  If all coding systems in coding-system-list can encode the region, the
  value is nil.

  [...]

It is unclear to me what "value" means there. My provisional
assumption was that it meant "return value", but that doesn't reflect
the behaviour of the function:

  (with-temp-buffer (insert "a") (check-coding-systems-region (point-min) (point-max) '(iso-8859-1)))
  => t

  ;; That would have been nil, not t, were my assumption correct. 
  
  (with-temp-buffer (insert "\u20ac") (check-coding-systems-region (point-min) (point-max) '(iso-8859-1)))
  => ((iso-8859-1 1))

Is the docstring wrong? Is the behaviour wrong? Is my understanding of the
docstring wrong? Whichever way, something needs to be fixed, I am a
generally- and technically-literate native speaker of English and if I have
misunderstood it, other people will too. 

A pre-emptive happy New Year to you all, 

Aidan

In GNU Emacs 23.0.60.1 (i386-apple-darwin8.11.1, NS apple-appkit-824.48)
 of 2008-12-27 on bonbon
Windowing system distributor `Apple', version 97.112.112.108.101.45.97.112.112.107.105.116.45.56.50.52.46.52.56
configured using `configure  '--with-ns' '--enable-asserts' '--enable-maintainer-mode' '--enable-cocoa-experimental-ctrl-g' '--with-xpm' '--with-jpeg' '--with-tiff' '--with-png' 'LDFLAGS=-L/opt/local/lib -L/usr/X11R6/lib -L/usr/local/lib' 'CPPFLAGS=-I/opt/local/include -I/usr/X11R6/include -I/usr/local/include''

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: de_DE.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-e C-j C-p C-p C-e C-b C-b C-p <return> <return> C-p 
M-4 SPC C-a C-k ? \ u 2 0 a c C-a C-d " C-e " C-j C-n 
C-e C-b C-b C-b C-k ( i s o - 8 8 5 9 - 1 ) ) C-j C-p 
C-p C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f 
C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f 
C-f C-f C-f C-f C-d C-d C-d C-d C-d C-d C-d C-d C-d 
C-d C-d C-d SPC C-b C-p C-a C-p C-k C-n C-n C-e C-b 
C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b 
C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b 
C-b SPC C-y C-e C-j <down-mouse-1> <mouse-1> C-x o 
C-x b f d a s f d s a f d a s <return> <escape> : C-g 
M-4 SPC <backspace> <backspace> <backspace> <backspace> 
C-x o C-p C-p C-p C-p C-p C-p C-e C-n C-e C-j C-p C-d 
C-e <backspace> C-a C-k C-x o C-y C-x o C-n C-n C-n 
C-n C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f 
C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f 
C-f C-f C-f C-f C-d C-d C-d C-d ( p o i n t - m i o 
n <backspace> <backspace> n ) C-a C-k C-x o <escape> 
: C-y <return> <help-echo> <down-mouse-1> <mouse-1> 
C-b C-u C-x = C-x C-o C-x o <down-mouse-1> <mouse-1> 
C-x 1 C-r f o n t C-s C-s C-r C-r C-p C-p C-p C-p C-p 
C-p C-p C-x b * s c <tab> <return> <escape> x r e p 
o r t - e m a c s - b u g <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Type C-x 1 to delete the help window, C-M-v to scroll help.
Mark set
Quit
Mark set
((iso-8859-1 1))
Type C-x 4 C-o RET to restore the other window.
Char: € (8364, #o20254, #x20ac, file ...) point=1 of 1 (0%) column=0
Mark saved where search started

-- 
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#1723: 23.0.60; Odd behaviour with #'check-coding-systems-region
@ 2009-01-15 14:16 Chong Yidong
  2009-02-16 11:56 ` Kenichi Handa
  0 siblings, 1 reply; 3+ messages in thread
From: Chong Yidong @ 2009-01-15 14:16 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: Aidan Kehoe, 1723

It appears that check-coding-systems-region can return t under some
circumstances, but this is not documented in the docstring, nor in the
elisp manual.  Could you update the documentation?  Or, you can explain
the circumstances under which this happens so that someone else can do
the updating.

Thanks.

Aidan Kehoe <kehoea@parhasard.net> wrote:

> The check-coding-systems-region docstring says this: 
>
>   (check-coding-systems-region start end coding-system-list)
>  
>   Check if the region is encodable by coding systems.
>  
>   The value is an alist ((CODING-SYSTEM POS0 POS1 ...) ...), where
>   CODING-SYSTEM is a member of coding-system-list and can't encode the
>   whole region, POS0, POS1, ... are buffer positions where non-encodable
>   characters are found.
>  
>   If all coding systems in coding-system-list can encode the region, the
>   value is nil.
>   [...]
>
> It is unclear to me what "value" means there. My provisional
> assumption was that it meant "return value", but that doesn't reflect
> the behaviour of the function:

>   (with-temp-buffer (insert "a") (check-coding-systems-region
>   (point-min) (point-max) '(iso-8859-1)))
>   => t






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#1723: 23.0.60; Odd behaviour with #'check-coding-systems-region
  2009-01-15 14:16 bug#1723: 23.0.60; Odd behaviour with #'check-coding-systems-region Chong Yidong
@ 2009-02-16 11:56 ` Kenichi Handa
  0 siblings, 0 replies; 3+ messages in thread
From: Kenichi Handa @ 2009-02-16 11:56 UTC (permalink / raw)
  To: Chong Yidong; +Cc: kehoea, 1723

In article <87wscwmz6t.fsf@cyd.mit.edu>, Chong Yidong <cyd@stupidchicken.com> writes:

> It appears that check-coding-systems-region can return t under some
> circumstances, but this is not documented in the docstring, nor in the
> elisp manual.  Could you update the documentation?  Or, you can explain
> the circumstances under which this happens so that someone else can do
> the updating.

It seems that returning t is just a bug (of typo).  I've
just fixed it.

---
Kenichi Handa
handa@m17n.org






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-16 11:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-15 14:16 bug#1723: 23.0.60; Odd behaviour with #'check-coding-systems-region Chong Yidong
2009-02-16 11:56 ` Kenichi Handa
  -- strict thread matches above, loose matches on Subject: below --
2008-12-28 17:20 Aidan Kehoe

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).