GNU bug report logs - #6187
23.1; can't save: "Wrong type argument: number-of-marker-p, nil"

Previous Next

Package: emacs;

Reported by: Ryo Furue <furue <at> hawaii.edu>

Date: Fri, 14 May 2010 06:22:02 UTC

Severity: normal

Merged with 5948

Found in version 23.1

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6187 in the body.
You can then email your comments to 6187 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Fri, 14 May 2010 06:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ryo Furue <furue <at> hawaii.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 14 May 2010 06:22:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ryo Furue <furue <at> hawaii.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.1; can't save: "Wrong type argument: number-of-marker-p, nil"
Date: Thu, 13 May 2010 19:30:31 -1000 (HST)
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

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Fri, 21 May 2010 04:20:03 GMT) Full text and rfc822 format available.

Message #8 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Ryo Furue <furue <at> hawaii.edu>
Cc: 6187 <at> debbugs.gnu.org
Subject: Re: bug#6187: 23.1;
	can't save: "Wrong type argument: number-of-marker-p, nil"
Date: Fri, 21 May 2010 00:18:59 -0400
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




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Tue, 25 May 2010 03:09:02 GMT) Full text and rfc822 format available.

Message #11 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Ryo Furue <furue <at> hawaii.edu>
To: rgm <at> gnu.org
Cc: 6187 <at> debbugs.gnu.org
Subject: Re: bug#6187: 23.1; can't save:
	"Wrong type argument: number-of-marker-p, nil"
Date: Mon, 24 May 2010 17:08:06 -1000 (HST)
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

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Tue, 25 May 2010 06:12:03 GMT) Full text and rfc822 format available.

Message #14 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Ryo Furue <furue <at> hawaii.edu>
To: rgm <at> gnu.org
Cc: 6187 <at> debbugs.gnu.org
Subject: Re: bug#6187: 23.1; can't save:
	"Wrong type argument: number-of-marker-p, nil"
Date: Mon, 24 May 2010 20:11:26 -1000 (HST)
| | > 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.


Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Tue, 25 May 2010 16:05:02 GMT) Full text and rfc822 format available.

Message #17 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Ryo Furue <furue <at> hawaii.edu>
Cc: rgm <at> gnu.org, 6187 <at> debbugs.gnu.org
Subject: Re: bug#6187: 23.1;
	can't save: "Wrong type argument: number-of-marker-p, nil"
Date: Tue, 25 May 2010 12:04:17 -0400
Ryo Furue <furue <at> 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.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Tue, 25 May 2010 19:12:01 GMT) Full text and rfc822 format available.

Message #20 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Ryo Furue <furue <at> hawaii.edu>
To: cyd <at> stupidchicken.com
Cc: rgm <at> gnu.org, 6187 <at> debbugs.gnu.org
Subject: Re: bug#6187: 23.1; can't save:
	"Wrong type argument: number-of-marker-p, nil"
Date: Tue, 25 May 2010 09:11:36 -1000 (HST)
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




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Thu, 17 Jun 2010 07:53:02 GMT) Full text and rfc822 format available.

Message #23 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Ryo Furue <furue <at> hawaii.edu>
Cc: cyd <at> stupidchicken.com, 6187 <at> debbugs.gnu.org
Subject: Re: bug#6187: 23.1;
	can't save: "Wrong type argument: number-of-marker-p, nil"
Date: Thu, 17 Jun 2010 03:52:07 -0400
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.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Fri, 18 Jun 2010 18:59:02 GMT) Full text and rfc822 format available.

Message #26 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Ryo Furue <furue <at> hawaii.edu>
Cc: Chong Yidong <cyd <at> stupidchicken.com>, 6187 <at> debbugs.gnu.org
Subject: Re: bug#6187: 23.1; can't save:
	"Wrong type argument: number-of-marker-p, nil"
Date: Fri, 18 Jun 2010 14:58:18 -0400
[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.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Fri, 18 Jun 2010 23:08:02 GMT) Full text and rfc822 format available.

Message #29 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Ryo Furue <furue <at> hawaii.edu>
To: rgm <at> gnu.org
Cc: cyd <at> stupidchicken.com, 6187 <at> debbugs.gnu.org
Subject: Re: bug#6187: 23.1; can't save:
	"Wrong type argument: number-of-marker-p, nil"
Date: Fri, 18 Jun 2010 13:07:50 -1000 (HST)
| 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




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Fri, 25 Jun 2010 21:29:01 GMT) Full text and rfc822 format available.

Message #32 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Ryo Furue <furue <at> hawaii.edu>
Cc: rgm <at> gnu.org, cyd <at> stupidchicken.com, 6187 <at> debbugs.gnu.org
Subject: Re: bug#6187: 23.1;
	can't save: "Wrong type argument: number-of-marker-p, nil"
Date: Fri, 25 Jun 2010 23:28:51 +0200
> 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





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Fri, 25 Jun 2010 21:48:02 GMT) Full text and rfc822 format available.

Message #35 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Ryo Furue <furue <at> hawaii.edu>
To: monnier <at> iro.umontreal.ca
Cc: rgm <at> gnu.org, cyd <at> stupidchicken.com, 6187 <at> debbugs.gnu.org
Subject: Re: bug#6187: 23.1; can't save:
	"Wrong type argument: number-of-marker-p, nil"
Date: Fri, 25 Jun 2010 11:47:52 -1000 (HST)
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




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Sat, 26 Jun 2010 03:03:02 GMT) Full text and rfc822 format available.

Message #38 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Ryo Furue <furue <at> hawaii.edu>
To: monnier <at> iro.umontreal.ca
Cc: rgm <at> gnu.org, cyd <at> stupidchicken.com, 6187 <at> debbugs.gnu.org
Subject: Re: bug#6187: 23.1; can't save:
	"Wrong type argument: number-of-marker-p, nil"
Date: Fri, 25 Jun 2010 17:01:47 -1000 (HST)
| 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)






Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Fri, 12 Aug 2011 15:49:03 GMT) Full text and rfc822 format available.

Message #41 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Christophe TROESTLER <Christophe.Troestler <at> umons.ac.be>
To: 6187 <at> debbugs.gnu.org
Subject: Wrong type argument: number-of-marker-p, nil
Date: Fri, 12 Aug 2011 15:54:45 +0200 (CEST)
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)




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Fri, 12 Aug 2011 22:37:01 GMT) Full text and rfc822 format available.

Message #44 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Christophe TROESTLER <Christophe.Troestler <at> umons.ac.be>
To: 6187 <at> debbugs.gnu.org
Subject: Re: Wrong type argument: number-of-marker-p, nil
Date: Sat, 13 Aug 2011 00:34:48 +0200 (CEST)
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)




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Fri, 12 Aug 2011 22:45:03 GMT) Full text and rfc822 format available.

Message #47 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Christophe TROESTLER <Christophe.Troestler <at> umons.ac.be>
To: 6187 <at> debbugs.gnu.org
Subject: Re: Wrong type argument: number-of-marker-p, nil
Date: Sat, 13 Aug 2011 00:42:56 +0200 (CEST)
[Message part 1 (text/plain, inline)]
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?
[bug.el (text/plain, inline)]
Ẽ

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

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Fri, 12 Aug 2011 23:00:02 GMT) Full text and rfc822 format available.

Message #50 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Christophe TROESTLER <Christophe.Troestler <at> umons.ac.be>
To: 6187 <at> debbugs.gnu.org
Subject: Re: Wrong type argument: number-of-marker-p, nil
Date: Sat, 13 Aug 2011 00:58:25 +0200 (CEST)
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





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6187; Package emacs. (Sat, 13 Aug 2011 00:16:02 GMT) Full text and rfc822 format available.

Message #53 received at 6187 <at> debbugs.gnu.org (full text, mbox):

From: Johan Bockgård <bojohan <at> gnu.org>
To: Christophe TROESTLER <Christophe.Troestler <at> umons.ac.be>
Cc: 6187 <at> debbugs.gnu.org
Subject: Re: bug#6187: Wrong type argument: number-of-marker-p, nil
Date: Sat, 13 Aug 2011 02:14:10 +0200
Christophe TROESTLER <Christophe.Troestler <at> 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.




Forcibly Merged 5948 6187. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 07 Oct 2012 01:11:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 04 Nov 2012 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 235 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.