unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6187: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil"
@ 2010-05-14  5:30 Ryo Furue
  2010-05-21  4:18 ` Glenn Morris
  2011-08-12 13:54 ` bug#6187: Wrong type argument: number-of-marker-p, nil Christophe TROESTLER
  0 siblings, 2 replies; 17+ messages in thread
From: Ryo Furue @ 2010-05-14  5:30 UTC (permalink / raw)
  To: 6187

Copy this character "˜", open a new file (C-x C-f),
paste the character, and try to save (C-x C-s).
You can't save. "Wrong type argument: number-of-marker-p, nil"

I got this character by copying-and-pasting from
a PDF document.

Hope this helps,
Ryo

In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.18.2)
 of 2009-11-01 on raven, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10706901
configured using `configure  '--build=i486-linux-gnu' '--host=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/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

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: C
  value of $XMODIFIERS: @im=none
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  show-paren-mode: t
  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-v C-v C-v C-v C-v <escape> w C-p C-p C-p C-x C-b 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p 
<return> C-p C-p C-p C-p C-p C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-p C-p 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p 
C-p C-p C-p C-p C-p C-n C-n C-n C-n C-n C-n C-SPC C-n 
C-g C-SPC C-n C-w C-x C-b <return> C-y C-x C-s C-g 
C-p C-d C-d C-d C-d C-d C-d C-d C-d C-d C-d C-d C-d 
C-d C-d C-d C-d C-d C-f C-f C-d C-x C-s C-g C-a C-d 
C-d C-f C-d C-d C-x C-s C-b C-a C-SPC C-f C-w C-x C-f 
t m p 3 . t x t <return> C-SPC C-v C-v C-v C-v <escape> 
w C-x C-b C-n <return> C-x C-b C-p C-n <return> C-a 
C-SPC C-e C-w C-x C-b <return> C-y C-x C-s C-g C-a 
<help-echo> <down-mouse-1> <mouse-1> C-x C-c n n n 
<escape> x r e p o TAB r t - e m a TAB b TAB <return> 
C-g <switch-frame> C-g C-x C-s <down-mouse-1> <mouse-1> 
C-h C-h C-x C-s <switch-frame> W r o n g <switch-frame> 
C-x C-s <switch-frame> SPC t y p e SPC a r g u m e 
n t : SPC <switch-frame> C-x C-s <switch-frame> n u 
m b e r - o f - m a r k e r - p , SPC n i l <switch-frame> 
C-x C-s <switch-frame> C-a C-SPC C-e C-w <escape> x 
r e p o r t - e m TAB b u TAB <return> C-y C-a C-SPC 
C-e C-w <escape> x r e p o r t - e m a c s - b u g 
<return>

Recent messages:
apply: Wrong type argument: number-or-marker-p, nil
Saving file /home/amakihi/furue/tmp/tmp3.txt...
apply: Wrong type argument: number-or-marker-p, nil
Saving file /home/amakihi/furue/tmp/tmp3.txt...
apply: Wrong type argument: number-or-marker-p, nil
Saving file /home/amakihi/furue/tmp/tmp3.txt...
apply: Wrong type argument: number-or-marker-p, nil
Mark set
Quit [2 times]
Mark activated

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

* bug#6187: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil"
  2010-05-14  5:30 bug#6187: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil" Ryo Furue
@ 2010-05-21  4:18 ` Glenn Morris
  2010-05-25  3:08   ` Ryo Furue
  2011-08-12 13:54 ` bug#6187: Wrong type argument: number-of-marker-p, nil Christophe TROESTLER
  1 sibling, 1 reply; 17+ messages in thread
From: Glenn Morris @ 2010-05-21  4:18 UTC (permalink / raw)
  To: Ryo Furue; +Cc: 6187

Ryo Furue wrote:

> Copy this character "˜", open a new file (C-x C-f),
> paste the character, and try to save (C-x C-s).
> You can't save. "Wrong type argument: number-of-marker-p, nil"

It works fine for me using Debian's Emacs 23.1. I am prompted to
select a coding system, I choose the default utf-8, and the file is saved.

Does it happen with `emacs -Q'?

Please do

M-x toggle-debug-on-error

produce the error again, and post the backtrace.

> In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.18.2)
>  of 2009-11-01 on raven, modified by Debian
[...]
>   value of $XMODIFIERS: @im=none





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

* bug#6187: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil"
  2010-05-21  4:18 ` Glenn Morris
@ 2010-05-25  3:08   ` Ryo Furue
  2010-05-25  6:11     ` Ryo Furue
  0 siblings, 1 reply; 17+ messages in thread
From: Ryo Furue @ 2010-05-25  3:08 UTC (permalink / raw)
  To: rgm; +Cc: 6187

Hi,

| > Copy this character "˜", open a new file (C-x C-f),
| > paste the character, and try to save (C-x C-s).
| > You can't save. "Wrong type argument: number-of-marker-p, nil"
| 
| It works fine for me using Debian's Emacs 23.1. I am prompted to
| select a coding system, I choose the default utf-8, and the file is
| saved.
| 
| Does it happen with `emacs -Q'?
| 
| Please do
| 
| M-x toggle-debug-on-error
| 
| produce the error again, and post the backtrace.

Thank you for your help.  But, I've been able to reproduce the
error only once, before taking any debug information. (Before
I submitted my original report, the problem was very reliably
reproduced.)

As soon as I received your message, I quit emacs and started
it again.  Then, I was able to reproduce the error.  So,
I switched on toggle-debug-on-error and tried again.  Then,
I was prompted to select a coding system and was able to
save the file, choosing the default utf-8.

Puzzled, I quit emacs and started it again.  But, this time,
I wasn't able to reproduce the error.  Since then, I've never
been able to reproduce it!  I've tried various things, such as
copying the problematic text from the PDF file (which was the
original cause of the problem), but to no avail.

The only guess I can make is that some changes in
the environment fixed it.  I've applied all updates
to the operating system (Debian GNU/Linux) and
restarted the X-Window system once or twice after
I submitted my initial report.

Regards,
Ryo

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

* bug#6187: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil"
  2010-05-25  3:08   ` Ryo Furue
@ 2010-05-25  6:11     ` Ryo Furue
  2010-05-25 16:04       ` Chong Yidong
  0 siblings, 1 reply; 17+ messages in thread
From: Ryo Furue @ 2010-05-25  6:11 UTC (permalink / raw)
  To: rgm; +Cc: 6187

| | > Copy this character "˜", open a new file (C-x C-f),
| | > paste the character, and try to save (C-x C-s).
| | > You can't save. "Wrong type argument: number-of-marker-p, nil"
| | 
| | It works fine for me using Debian's Emacs 23.1. I am prompted to
| | select a coding system, I choose the default utf-8, and the file is
| | saved.
| | 
| | Does it happen with `emacs -Q'?
| | 
| | Please do
| | 
| | M-x toggle-debug-on-error
| | 
| | produce the error again, and post the backtrace.
| 
| Thank you for your help.  But, I've been able to reproduce the
| error only once, before taking any debug information. (Before
| I submitted my original report, the problem was very reliably
| reproduced.)

Now, I've just reproduced it!

;>>>> BEGIN BACK TRACE >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  min(nil)
  apply(min nil)
  select-safe-coding-system-interactively(1 1362 (utf-8 adobe-standard-encoding next mac-roman gb18030 utf-7 utf-16 utf-16be-with-signature utf-16le-with-signature utf-16be utf-16le x-ctext iso-2022-7bit utf-8-auto utf-8-with-signature emacs-mule raw-text iso-2022-8bit-ss2 utf-7-imap utf-8-emacs no-conversion compound-text-with-extensions ctext-no-compositions iso-2022-7bit-lock iso-2022-7bit-ss2) (japanese-iso-8bit-unix) nil utf-8)
  select-safe-coding-system(1 1362 japanese-iso-8bit-unix nil "/home/amakihi/furue/tmp/tmp2.txt")
  write-region(nil nil "/home/amakihi/furue/tmp/tmp2.txt" nil t "~/tmp/tmp2.txt")
  basic-save-buffer-2()
  basic-save-buffer-1()
  basic-save-buffer()
  save-buffer(1)
  call-interactively(save-buffer nil nil)
;<<<< END BACK TRACE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

I'm now on a remote machine (MacOS 10.5) and ssh-ing to my
workstation (Debian); I invoked emacs over X11-forwarding to
get this error.

When I invoked emacs as

   /usr/bin/emacs23 -Q

this error didn't occur.


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

* bug#6187: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil"
  2010-05-25  6:11     ` Ryo Furue
@ 2010-05-25 16:04       ` Chong Yidong
  2010-05-25 19:11         ` Ryo Furue
  0 siblings, 1 reply; 17+ messages in thread
From: Chong Yidong @ 2010-05-25 16:04 UTC (permalink / raw)
  To: Ryo Furue; +Cc: 6187

Ryo Furue <furue@hawaii.edu> writes:

> Now, I've just reproduced it!
>
> ;>>>> BEGIN BACK TRACE >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>   min(nil)
>   apply(min nil)
>   select-safe-coding-system-interactively(1 1362 (utf-8
>     adobe-standard-encoding next mac-roman gb18030 utf-7 utf-16
>     utf-16be-with-signature utf-16le-with-signature utf-16be utf-16le
>     x-ctext iso-2022-7bit utf-8-auto utf-8-with-signature emacs-mule
>     raw-text iso-2022-8bit-ss2 utf-7-imap utf-8-emacs no-conversion
>     compound-text-with-extensions ctext-no-compositions
>     iso-2022-7bit-lock iso-2022-7bit-ss2) (japanese-iso-8bit-unix) nil
>     utf-8)

This is pretty strange.  The code in question is

  (when (and unsafe (not (stringp from)))
    (pop-to-buffer bufname)
    (goto-char (apply 'min (mapcar #'(lambda (x) (car (cadr x)))
                                   unsafe))))

If `unsafe' is an empty list, it should not have passed the `and'
conditional.





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

* bug#6187: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil"
  2010-05-25 16:04       ` Chong Yidong
@ 2010-05-25 19:11         ` Ryo Furue
  2010-06-17  7:52           ` Glenn Morris
  0 siblings, 1 reply; 17+ messages in thread
From: Ryo Furue @ 2010-05-25 19:11 UTC (permalink / raw)
  To: cyd; +Cc: 6187

Hi,

I'm writing this without understanding what is wrong, so I apologize
if this is off the point.

| > ;>>>> BEGIN BACK TRACE >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
| > Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
| >   min(nil)
| >   apply(min nil)
| >   select-safe-coding-system-interactively(1 1362 (utf-8
| >     adobe-standard-encoding next mac-roman gb18030 utf-7 utf-16
| >     utf-16be-with-signature utf-16le-with-signature utf-16be utf-16le
| >     x-ctext iso-2022-7bit utf-8-auto utf-8-with-signature emacs-mule
| >     raw-text iso-2022-8bit-ss2 utf-7-imap utf-8-emacs no-conversion
| >     compound-text-with-extensions ctext-no-compositions
| >     iso-2022-7bit-lock iso-2022-7bit-ss2) (japanese-iso-8bit-unix) nil
| >     utf-8)
| 
| This is pretty strange.  The code in question is
| 
|   (when (and unsafe (not (stringp from)))
|     (pop-to-buffer bufname)
|     (goto-char (apply 'min (mapcar #'(lambda (x) (car (cadr x)))
|                                    unsafe))))
| 
| If `unsafe' is an empty list, it should not have passed the `and'
| conditional.

Right after I got the error, I did "M-x describe-variable unsafe"
and obtained:

  unsafe's value is 
  ((japanese-iso-8bit-unix))


  Documentation:
  Not documented as a variable.

Is this of some interest?

Regards,
Ryo





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

* bug#6187: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil"
  2010-05-25 19:11         ` Ryo Furue
@ 2010-06-17  7:52           ` Glenn Morris
       [not found]             ` <20100616.224611.65962251.furue@hawaii.edu>
  0 siblings, 1 reply; 17+ messages in thread
From: Glenn Morris @ 2010-06-17  7:52 UTC (permalink / raw)
  To: Ryo Furue; +Cc: cyd, 6187

Ryo Furue wrote:

>   apply(min nil)
>   select-safe-coding-system-interactively(1 1362 (utf-8
>     adobe-standard-encoding next mac-roman gb18030 utf-7 utf-16
>     utf-16be-with-signature utf-16le-with-signature utf-16be utf-16le
>     x-ctext iso-2022-7bit utf-8-auto utf-8-with-signature emacs-mule
>     raw-text iso-2022-8bit-ss2 utf-7-imap utf-8-emacs no-conversion
>     compound-text-with-extensions ctext-no-compositions
>     iso-2022-7bit-lock iso-2022-7bit-ss2) (japanese-iso-8bit-unix) nil
>     utf-8)

So:

select-safe-coding-system-interactively is called with

UNSAFE = (japanese-iso-8bit-unix)

This is presumably because it does not appear in the list of codings
returned by the call to find-coding-systems-region in
select-safe-coding-system (passed to
select-safe-coding-system-interactively as 3rd argument above).

Yet when select-safe-coding-system-interactively calls
unencodable-char-position with coding == japanese-iso-8bit-unix, it
returns nil, meaning it can encode the region.

So apparently it both can and cannot encode the region.

One could paper over this by excluding non-numeric elements in

    (goto-char (apply 'min (mapcar #'(lambda (x) (car (cadr x)))
                                  unsafe))))

But I guess the real bug is that find-coding-systems-region and
unencodable-char-position somehow manage to disagree.


An example of a file that triggers the problem would probably be
very helpful.





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

* bug#6187: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil"
       [not found]             ` <20100616.224611.65962251.furue@hawaii.edu>
@ 2010-06-18 18:58               ` Glenn Morris
  2010-06-18 23:07                 ` Ryo Furue
  0 siblings, 1 reply; 17+ messages in thread
From: Glenn Morris @ 2010-06-18 18:58 UTC (permalink / raw)
  To: Ryo Furue; +Cc: Chong Yidong, 6187


[replying to off-list message]

Ryo Furue wrote (on Wed, 16 Jun 2010 at 22:46 -1000):

> 1. Open a new, empty file in your emacs on X Window;
> 2. Open the attached PDF file in Adobe Reader or something;
> 3. Select and copy the phrase "La Niña" on the first page of
>    the PDF file into your clipboard;
> 4. Paste it onto the emacs window; and
> 5. Try to save the file.
> 
> I've just reproduced the same error.  I'm on a Mac OS 10.5 (Leopard);
> my emacs is running on a remote Debian machine through X11-forwarding
> of SSH; I did steps 1--5 using the local Preview, a PDF viewer that
> comes with Mac OS.
> 
> I remember that this error didn't occur with "emacs -Q".  So,
> I'm attaching my emacs configuration files (.emacs just loads
> .emacs23.el).

Thanks, but I still cannot reproduce it.

Your .emacs loads several other files that I don't have.
To be honest, I don't really want to debug your .emacs.
It might be helpful if you could narrow down the minimum settings that
cause this to happen. The coding and language related ones are obvious
places to start. It is possible that this is not a useful thing for
you to do though. Maybe someone who knows about coding systems issues
(not me) could say more.

On the other hand maybe it is somehow Mac specific.





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

* bug#6187: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil"
  2010-06-18 18:58               ` Glenn Morris
@ 2010-06-18 23:07                 ` Ryo Furue
  2010-06-25 21:28                   ` Stefan Monnier
  0 siblings, 1 reply; 17+ messages in thread
From: Ryo Furue @ 2010-06-18 23:07 UTC (permalink / raw)
  To: rgm; +Cc: cyd, 6187

| Your .emacs loads several other files that I don't have.
| To be honest, I don't really want to debug your .emacs.
| It might be helpful if you could narrow down the minimum settings that
| cause this to happen. The coding and language related ones are obvious
| places to start. It is possible that this is not a useful thing for
| you to do though. Maybe someone who knows about coding systems issues
| (not me) could say more.
| 
| On the other hand maybe it is somehow Mac specific.

Thanks for your response.  I'd like to add some bits of information,
although I'm not sure if they are helpful at all.
 
1) It's not Mac specific.  I can now reproduce the problem
on a local Debian box (i.e., without sending any windows over
the network).

2) This problem seems to be even harder than you describe.
On this very emacs process (an emacsclient connecting to
a long-time running emacs daemon) on which I'm writing this
message, the problem has been 100% reproducible so far.
But, when I invoke a separate emacs process by /usr/bin/emacs23,
it's not.  Last time I reported (see one of my previous messages),
at one point I couldn't even reproduce the problem by launching
a fresh emacs daemon and then an emacsclient.  That means,
I can't conduct such a systematic test (removing bits
from my .emacs one by one) as you suggest.

Cheers,
Ryo





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

* bug#6187: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil"
  2010-06-18 23:07                 ` Ryo Furue
@ 2010-06-25 21:28                   ` Stefan Monnier
  2010-06-25 21:47                     ` Ryo Furue
  0 siblings, 1 reply; 17+ messages in thread
From: Stefan Monnier @ 2010-06-25 21:28 UTC (permalink / raw)
  To: Ryo Furue; +Cc: cyd, 6187

> a fresh emacs daemon and then an emacsclient.  That means,
> I can't conduct such a systematic test (removing bits
> from my .emacs one by one) as you suggest.

Make sure you have debug-on-error set to a non-nil value (e.g. via the
menu entry "Options => Enter Debugger on Error"), so that (hopefully
you'll then get a backtrace which will help us figure out what's the
problem).


        Stefan






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

* bug#6187: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil"
  2010-06-25 21:28                   ` Stefan Monnier
@ 2010-06-25 21:47                     ` Ryo Furue
  2010-06-26  3:01                       ` Ryo Furue
  0 siblings, 1 reply; 17+ messages in thread
From: Ryo Furue @ 2010-06-25 21:47 UTC (permalink / raw)
  To: monnier; +Cc: cyd, 6187

Hi Stefan,

| > a fresh emacs daemon and then an emacsclient.  That means,
| > I can't conduct such a systematic test (removing bits
| > from my .emacs one by one) as you suggest.
| 
| Make sure you have debug-on-error set to a non-nil value (e.g. via the
| menu entry "Options => Enter Debugger on Error"), so that (hopefully
| you'll then get a backtrace which will help us figure out what's the
| problem).

OK, I've included "(setq debug-on-error t)" in my .emacs, killed the
emacs daemon, and started a fresh one.  As I feared, the same error
doesn't occur right now.  Eventually it may appear again, and then
I'll send you the backtrace.  But, does that mean you expect
that we may see a different backtrace from the one I sent
you before?

Regards,
Ryo





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

* bug#6187: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil"
  2010-06-25 21:47                     ` Ryo Furue
@ 2010-06-26  3:01                       ` Ryo Furue
  0 siblings, 0 replies; 17+ messages in thread
From: Ryo Furue @ 2010-06-26  3:01 UTC (permalink / raw)
  To: monnier; +Cc: cyd, 6187

| OK, I've included "(setq debug-on-error t)" in my .emacs, killed the
| emacs daemon, and started a fresh one.  As I feared, the same error
| doesn't occur right now.  Eventually it may appear again, and then
| I'll send you the backtrace.  But, does that mean you expect
| that we may see a different backtrace from the one I sent
| you before?

It seems that this error eventually starts as you continue to use an
emacs daemon:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  min(nil)
  apply(min nil)
  select-safe-coding-system-interactively(1 11 (utf-8 windows-1258 windows-1255 adobe-standard-encoding hp-roman8 next mac-roman windows-1254 windows-1252 gb18030 utf-7 utf-16 utf-16be-with-signature utf-16le-with-signature utf-16be utf-16le x-ctext iso-2022-7bit utf-8-auto utf-8-with-signature emacs-mule raw-text iso-2022-8bit-ss2 georgian-academy georgian-ps utf-7-imap utf-8-emacs no-conversion compound-text-with-extensions ctext-no-compositions iso-2022-7bit-lock iso-2022-7bit-ss2) (japanese-iso-8bit-unix) nil utf-8)
  select-safe-coding-system(1 11 japanese-iso-8bit-unix nil "/home/amakihi/furue/tmp/tmp.txt")
  write-region(nil nil "/home/amakihi/furue/tmp/tmp.txt" nil t "~/tmp/tmp.txt")
  basic-save-buffer-2()
  basic-save-buffer-1()
  basic-save-buffer()
  save-buffer(1)
  call-interactively(save-buffer nil nil)







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

* bug#6187: Wrong type argument: number-of-marker-p, nil
  2010-05-14  5:30 bug#6187: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil" Ryo Furue
  2010-05-21  4:18 ` Glenn Morris
@ 2011-08-12 13:54 ` Christophe TROESTLER
  2011-08-12 22:34   ` Christophe TROESTLER
  2011-08-12 22:42   ` Christophe TROESTLER
  1 sibling, 2 replies; 17+ messages in thread
From: Christophe TROESTLER @ 2011-08-12 13:54 UTC (permalink / raw)
  To: 6187

I've got the same error when I try to save a buffer for which I 
changed the coding system and that contains characters that cannot be 
encoded with the new encoding.

Here is my specific backtrace :

   min(nil)
   apply(min nil)
   select-safe-coding-system-interactively(1 3 (utf-8 viscii gb18030 
utf-7 utf-16 utf-16be-with-signature utf-16le-with-signature utf-16be 
utf-16le x-ctext iso-2022-7bit utf-8-auto utf-8-with-signature 
emacs-mule raw-text iso-2022-8bit-ss2 iso-2022-7bit-lock 
vietnamese-tcvn vietnamese-viqr vietnamese-vscii utf-7-imap 
utf-8-emacs no-conversion compound-text-with-extensions 
ctext-no-compositions iso-2022-7bit-ss2) (iso-latin-1-unix) nil utf-8)
   select-safe-coding-system(1 3 iso-latin-1-unix nil "/tmp/a.txt")
   write-region(nil nil "/tmp/a.txt" nil t "/tmp/a.txt")
   basic-save-buffer-2()
   basic-save-buffer-1()
   basic-save-buffer()
   save-buffer(1)
   call-interactively(save-buffer nil nil)





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

* bug#6187: Wrong type argument: number-of-marker-p, nil
  2011-08-12 13:54 ` bug#6187: Wrong type argument: number-of-marker-p, nil Christophe TROESTLER
@ 2011-08-12 22:34   ` Christophe TROESTLER
  2011-08-12 22:42   ` Christophe TROESTLER
  1 sibling, 0 replies; 17+ messages in thread
From: Christophe TROESTLER @ 2011-08-12 22:34 UTC (permalink / raw)
  To: 6187

I redefined select-safe-coding-system-interactively to try to track
the bug and it confirms that the variable `unsafe', AFTER the “(setq
unsafe …”, has value ((iso-latin-1-unix)) ― which then returns (nil)
when processed with

    (mapcar #'(lambda (x) (car (cadr x))) unsafe)

The correct value for `unsafe' is (iso-latin-1-unix (1 . 7868))

Note that the bug is not present when Emacs starts, it only shows up
after some time.  My wild guess is that somehow regions are processed
incorrectly ― I have some region issues with other Emacs packages too.

The backtrace :

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  min(nil)
  apply(min nil)
  (goto-char (apply (quote min) (mapcar ... unsafe)))
  (progn (pop-to-buffer bufname) (goto-char (apply ... ...)))
  (if (and unsafe (not ...)) (progn (pop-to-buffer bufname) (goto-char ...)))
  (when (and unsafe (not ...)) (pop-to-buffer bufname) (goto-char (apply ... ...)))
  (save-excursion (when (and unsafe ...) (pop-to-buffer bufname) (goto-char ...)) (with-output-to-temp-buffer "*Warning*" (with-current-buffer standard-output ... ... ...)) (setq coding-system (read-coding-system ... default)) (setq last-coding-system-specified coding-system))
  (let ((window-configuration ...) (bufname ...) coding-system) (save-excursion (when ... ... ...) (with-output-to-temp-buffer "*Warning*" ...) (setq coding-system ...) (setq last-coding-system-specified coding-system)) (kill-buffer "*Warning*") (set-window-configuration window-configuration) coding-system)
  select-safe-coding-system-interactively(1 3 (utf-8 viscii gb18030 utf-7 utf-16 utf-16be-with-signature utf-16le-with-signature utf-16be utf-16le x-ctext iso-2022-7bit utf-8-auto utf-8-with-signature emacs-mule raw-text iso-2022-8bit-ss2 iso-2022-7bit-lock vietnamese-tcvn vietnamese-viqr vietnamese-vscii utf-7-imap utf-8-emacs no-conversion compound-text-with-extensions ctext-no-compositions iso-2022-7bit-ss2) (iso-latin-1-unix) nil utf-8)
  select-safe-coding-system(1 3 iso-latin-1-unix nil "/tmp/a.txt")
  write-region(nil nil "/tmp/a.txt" nil t "/tmp/a.txt")
  basic-save-buffer-2()
  basic-save-buffer-1()
  basic-save-buffer()
  save-buffer(1)
  call-interactively(save-buffer nil nil)





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

* bug#6187: Wrong type argument: number-of-marker-p, nil
  2011-08-12 13:54 ` bug#6187: Wrong type argument: number-of-marker-p, nil Christophe TROESTLER
  2011-08-12 22:34   ` Christophe TROESTLER
@ 2011-08-12 22:42   ` Christophe TROESTLER
  2011-08-12 22:58     ` Christophe TROESTLER
  1 sibling, 1 reply; 17+ messages in thread
From: Christophe TROESTLER @ 2011-08-12 22:42 UTC (permalink / raw)
  To: 6187

[-- Attachment #1: Type: Text/Plain, Size: 364 bytes --]


When this bug is triggered, executing the line

  (unencodable-char-position 1 3 'latin-1 11)

in the attached file returns “nil” while it should return “(1)”.
describe-function confirms that

  unencodable-char-position is a built-in function in `C source code'.

I guess the bug is deeper than expected!

What can we to to help now?

[-- Attachment #2: bug.el --]
[-- Type: Text/Plain, Size: 50 bytes --]

Ẽ

(unencodable-char-position 1 3 'latin-1 11)

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

* bug#6187: Wrong type argument: number-of-marker-p, nil
  2011-08-12 22:42   ` Christophe TROESTLER
@ 2011-08-12 22:58     ` Christophe TROESTLER
  2011-08-13  0:14       ` Johan Bockgård
  0 siblings, 1 reply; 17+ messages in thread
From: Christophe TROESTLER @ 2011-08-12 22:58 UTC (permalink / raw)
  To: 6187

The same goes for (unencodable-char-position 0 2 'latin-1 1 " Ẽ ")
— it returns “nil” instead of “(1)”.

We are not the only ones to encounter this bug :
http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00608.html






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

* bug#6187: Wrong type argument: number-of-marker-p, nil
  2011-08-12 22:58     ` Christophe TROESTLER
@ 2011-08-13  0:14       ` Johan Bockgård
  0 siblings, 0 replies; 17+ messages in thread
From: Johan Bockgård @ 2011-08-13  0:14 UTC (permalink / raw)
  To: Christophe TROESTLER; +Cc: 6187

Christophe TROESTLER <Christophe.Troestler@umons.ac.be> writes:

> The same goes for (unencodable-char-position 0 2 'latin-1 1 " Ẽ ")
> — it returns “nil” instead of “(1)”.
>
> We are not the only ones to encounter this bug :
> http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00608.html

That's bug #5948. It has been fixed in trunk.





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

end of thread, other threads:[~2011-08-13  0:14 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-14  5:30 bug#6187: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil" Ryo Furue
2010-05-21  4:18 ` Glenn Morris
2010-05-25  3:08   ` Ryo Furue
2010-05-25  6:11     ` Ryo Furue
2010-05-25 16:04       ` Chong Yidong
2010-05-25 19:11         ` Ryo Furue
2010-06-17  7:52           ` Glenn Morris
     [not found]             ` <20100616.224611.65962251.furue@hawaii.edu>
2010-06-18 18:58               ` Glenn Morris
2010-06-18 23:07                 ` Ryo Furue
2010-06-25 21:28                   ` Stefan Monnier
2010-06-25 21:47                     ` Ryo Furue
2010-06-26  3:01                       ` Ryo Furue
2011-08-12 13:54 ` bug#6187: Wrong type argument: number-of-marker-p, nil Christophe TROESTLER
2011-08-12 22:34   ` Christophe TROESTLER
2011-08-12 22:42   ` Christophe TROESTLER
2011-08-12 22:58     ` Christophe TROESTLER
2011-08-13  0:14       ` Johan Bockgård

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).