Re: image.el doesn't associate image-mode with .JPG files

2006-12-15 Thread Jason Rumney

Richard Stallman wrote:
 Perhaps this can be solved by first doing a case-sensitive scan through 
 auto-mode-alist, then if that fails to find a match do a 
 case-insensitive scan.


Brilliant!

It would handle that one case, but it would still produce false
matches.
  
It would only produce false matches for cases where Emacs would have 
defaulted to Fundamental mode. Is that so bad, or am I missing something?




___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: image.el doesn't associate image-mode with .JPG files

2006-12-15 Thread Kim F. Storm
Jason Rumney [EMAIL PROTECTED] writes:

 Richard Stallman wrote:
  Perhaps this can be solved by first doing a case-sensitive
 scan through  auto-mode-alist, then if that fails to find a
 match do a  case-insensitive scan.

 Brilliant!

 It would handle that one case, but it would still produce false
 matches.
   
 It would only produce false matches for cases where Emacs would have
 defaulted to Fundamental mode. Is that so bad, or am I missing
 something?

I don't see the problem either.

It would make Emacs DTRT in a lot more cases, at the expense of
_potentially_ doing TWT in a few obscure cases, such as
entering changelog-mode for a file named cHANGElOG.

I'm 100% in favour of your proposal (and consequently in 100%
disagreement with RMS -- on this issue).

-- 
Kim F. Storm [EMAIL PROTECTED] http://www.cua.dk



___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Emacsclient/server filename quoting error

2006-12-15 Thread Juanma Barranquero

On 12/10/06, Francis Wright [EMAIL PROTECTED] wrote:


I execute all the following commands from a cmd command
prompt (outside of Emacs).

emacsclient -n -a runemacs TO DO.txt

works correctly if Emacs IS already running, but if it is not
already running then Emacs does not see the filename correctly;
the quotes do not appear to be passed on to runemacs.


The following patch addresses the issue by allocating quoted copies of
any argument containing spaces before calling execvp.

Any objections to install this fix? As it stands, it affects also
non-Windows builds. Is requoting args the right behavior in these
environments?

   /L/e/k/t/u



Index: lib-src/emacsclient.c
===
RCS file: /cvsroot/emacs/emacs/lib-src/emacsclient.c,v
retrieving revision 1.98
diff -u -2 -r1.98 emacsclient.c
--- lib-src/emacsclient.c   30 Nov 2006 22:49:38 -  1.98
+++ lib-src/emacsclient.c   15 Dec 2006 10:19:44 -
@@ -310,8 +310,20 @@
  if (alternate_editor)
{
-  int i = optind - 1;
+  int j, i = optind - 1;
+
#ifdef WINDOWSNT
-  argv[i] = (char *)alternate_editor;
+  argv[i] = (char *) alternate_editor;
#endif
+
+  /* Arguments with spaces have been dequoted, so we
+have to requote them before calling execvp.  */
+  for (j = i; argv[j]; j++)
+   if (strchr (argv[j], ' '))
+ {
+   char *quoted = alloca (strlen (argv[j]) + 3);
+   sprintf (quoted, \%s\, argv[j]);
+   argv[j] = quoted;
+ }
+
  execvp (alternate_editor, argv + i);
  message (TRUE, %s: error executing alternate editor \%s\\n,


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: gnus queries all mail folders on startup

2006-12-15 Thread Chris Moore
 From: Michael Welsh Duggan md5i at cs.cmu.edu
 Newsgroups: gmane.emacs.devel
 Date: 2006-12-14 07:15:03 GMT (18 hours and 20 minutes ago)
 
 From: Chris Moore dooglus at gmail.com
 To: emacs-pretest-bug at gnu.org
 Date: Thu, 07 Dec 2006 16:18:08 +0100

 I'm using nnimap in gnus to read my email.

 Each time I start gnus, it polls every one of my hundreds of mail
 folders, which takes quite a long time.

 I've set gnus-activate-level to 5, and unsubscribed from the folders I
 don't want it to scan.  I've checked, and those folders now have a
 rank of 6, and so they shouldn't be scanned by default.
 
 Since nobody seems to have followed up on this...
 
 Chris, what is the value of `gnus-read-active-file'?  According to the
 documentation, it should be `some' by default.  If it is t, try
 setting it to some to see if that solves the problem.
 
 (Gnus node: The Active File)

Hi Michael.  I'm amazed I saw your message.  I reported this bug on
emacs-pretest-bugs and don't read emacs-devel.  I just happened to
notice my name while looking through the archives for a Windows Emacs
pretest binary.

Please, anyone, when replying to messages forwarded from a different
list, either reply to the original list or the original author.
Otherwise your reply could well go unseen by the person you're
attempting to address.


To answer your question:

  gnus-read-active-file is a variable defined in `gnus-start.el'.
  Its value is some

Chris.


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Emacsclient/server filename quoting error

2006-12-15 Thread Eli Zaretskii
 Date: Fri, 15 Dec 2006 11:31:18 +0100
 From: Juanma Barranquero [EMAIL PROTECTED]
 Cc: emacs-pretest-bug@gnu.org, Emacs Devel emacs-devel@gnu.org
 
  I execute all the following commands from a cmd command
  prompt (outside of Emacs).
 
  emacsclient -n -a runemacs TO DO.txt
 
  works correctly if Emacs IS already running, but if it is not
  already running then Emacs does not see the filename correctly;
  the quotes do not appear to be passed on to runemacs.
 
 The following patch addresses the issue by allocating quoted copies of
 any argument containing spaces before calling execvp.
 
 Any objections to install this fix? As it stands, it affects also
 non-Windows builds. Is requoting args the right behavior in these
 environments?

Quoting arguments passed to execvp is _definitely_ the wrong thing for
Posix platforms.  The fact that we need to do that for Windows is due
to the broken implementation of exec* routines in the Microsoft
libraries: they concatenate the arguments together without quoting
special characters, and pass the result to CreateProcess, with
predictably bad results.

By contrast, Posix execvp passes the arguments directly into the
argv[] array of the child process.

So please make this change conditioned on WINDOWSNT.

Actually, a cleaner way of fixing this would be to have a
WINDOWSNT-only wrapper for execvp, called, say w32_execvp, that does
TRT with quoting the arguments.  Then you could say

  #ifdef WINDOWSNT
  #define execvp w32_execvp
  #endif

in emacsclient.c, and leave the mainline code intact.


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Emacsclient/server filename quoting error

2006-12-15 Thread Juanma Barranquero

On 12/15/06, Eli Zaretskii [EMAIL PROTECTED] wrote:


Actually, a cleaner way of fixing this would be to have a
WINDOWSNT-only wrapper for execvp, called, say w32_execvp, that does
TRT with quoting the arguments.


You like this one better, then?

   /L/e/k/t/u


Index: lib-src/emacsclient.c
===
RCS file: /cvsroot/emacs/emacs/lib-src/emacsclient.c,v
retrieving revision 1.98
diff -u -2 -r1.98 emacsclient.c
--- lib-src/emacsclient.c   30 Nov 2006 22:49:38 -  1.98
+++ lib-src/emacsclient.c   15 Dec 2006 11:49:57 -
@@ -299,4 +299,35 @@


+#ifdef WINDOWSNT
+
+/*
+  execvp() wrapper for Windows.
+  Quotes arguments with embedded spaces.
+*/
+int
+w32_execvp (path, argv)
+ char *path;
+ char **argv;
+{
+  int i;
+
+  argv[0] = (char *) alternate_editor;
+
+  for (i = 0; argv[i]; i++)
+if (strchr (argv[i], ' '))
+  {
+   char *quoted = alloca (strlen (argv[i]) + 3);
+   sprintf (quoted, \%s\, argv[i]);
+   argv[i] = quoted;
+  }
+
+  return execvp (path, argv);
+}
+
+#undef execvp
+#define execvp w32_execvp
+
+#endif /* WINDOWSNT */
+
/*
  Try to run a different command, or --if no alternate editor is
@@ -311,7 +342,5 @@
{
  int i = optind - 1;
-#ifdef WINDOWSNT
-  argv[i] = (char *)alternate_editor;
-#endif
+
  execvp (alternate_editor, argv + i);
  message (TRUE, %s: error executing alternate editor \%s\\n,
___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


text.texi typos

2006-12-15 Thread Zhang Wei

cvs diff -u -- text.texi (in directory D:\download\emacs-gbk\man\)
Index: text.texi
===
RCS file: /cvsroot/cvs.savannah.gnu.org/emacs/emacs/man/text.texi,v
retrieving revision 1.73
diff -u -r1.73 text.texi
--- text.texi   6 Dec 2006 01:29:49 -   1.73
+++ text.texi   15 Dec 2006 13:23:32 -
@@ -1844,7 +1844,7 @@
 Run a shell command (which you must specify) to validate the current
 buffer as SGML (@code{sgml-validate}).
 
[EMAIL PROTECTED] C-x TAB
[EMAIL PROTECTED] C-c TAB
 @kindex C-c TAB @r{(SGML mode)}
 @findex sgml-tags-invisible
 Toggle the visibility of existing tags in the buffer.  This can be

* CVS exited normally with code 1 *


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: text.texi typos

2006-12-15 Thread Eli Zaretskii
 From: Zhang Wei [EMAIL PROTECTED]
 Date: Fri, 15 Dec 2006 21:27:34 +0800
 
 cvs diff -u -- text.texi (in directory D:\download\emacs-gbk\man\)
 Index: text.texi
 ===
 RCS file: /cvsroot/cvs.savannah.gnu.org/emacs/emacs/man/text.texi,v
 retrieving revision 1.73
 diff -u -r1.73 text.texi
 --- text.texi 6 Dec 2006 01:29:49 -   1.73
 +++ text.texi 15 Dec 2006 13:23:32 -
 @@ -1844,7 +1844,7 @@
  Run a shell command (which you must specify) to validate the current
  buffer as SGML (@code{sgml-validate}).
  
 [EMAIL PROTECTED] C-x TAB
 [EMAIL PROTECTED] C-c TAB
  @kindex C-c TAB @r{(SGML mode)}
  @findex sgml-tags-invisible
  Toggle the visibility of existing tags in the buffer.  This can be

Thanks, I installed this.


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Emacsclient/server filename quoting error

2006-12-15 Thread Eli Zaretskii
 Date: Fri, 15 Dec 2006 13:07:01 +0100
 From: Juanma Barranquero [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED], emacs-pretest-bug@gnu.org, emacs-devel@gnu.org
 
 On 12/15/06, Eli Zaretskii [EMAIL PROTECTED] wrote:
 
  Actually, a cleaner way of fixing this would be to have a
  WINDOWSNT-only wrapper for execvp, called, say w32_execvp, that does
  TRT with quoting the arguments.
 
 You like this one better, then?

Yes, thanks.

However, please mention the Windows bug with execvp in the comment to
w32_execvp, otherwise it is not clear to the uninitiated why it is
needed, and why we quote the arguments we pass to the real execvp.


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Emacsclient/server filename quoting error

2006-12-15 Thread Juanma Barranquero

On 12/15/06, Werner LEMBERG [EMAIL PROTECTED] wrote:


Since those issues are full of subtleties I suggest that you have a
look at the gnulib CVS (at savannah.gnu.org), inspecting the files
`execute.c' and `pipe.c':


Thanks, but I think I'll wait for people to test the current
implementation. I don't think Windows users will have very
sophisticate or uncommon alternate editor setups and if they do, they
must be prepared for the possibility of it not working ;)

   /L/e/k/t/u


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Emacsclient/server filename quoting error

2006-12-15 Thread Juanma Barranquero

On 12/15/06, Eli Zaretskii [EMAIL PROTECTED] wrote:


However, please mention the Windows bug with execvp in the comment to
w32_execvp


I've shamelessly stolen your comment from a previous message.

Thanks,

   /L/e/k/t/u


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Emacsclient/server filename quoting error

2006-12-15 Thread Eli Zaretskii
 Date: Fri, 15 Dec 2006 16:42:57 +0100
 From: Juanma Barranquero [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED], emacs-devel@gnu.org, emacs-pretest-bug@gnu.org
 
 I've shamelessly stolen your comment from a previous message.

That's okay, since I have a copyright assignment on file with the FSF.


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Emacsclient/server filename quoting error

2006-12-15 Thread Eli Zaretskii
 Date: Fri, 15 Dec 2006 16:14:38 +0100 (CET)
 Cc: [EMAIL PROTECTED], [EMAIL PROTECTED], emacs-devel@gnu.org,
  emacs-pretest-bug@gnu.org
 From: Werner LEMBERG [EMAIL PROTECTED]
 
 Since those issues are full of subtleties I suggest that you have a
 look at the gnulib CVS (at savannah.gnu.org), inspecting the files
 `execute.c' and `pipe.c':
 
   
 http://cvs.savannah.gnu.org/viewcvs/gnulib/lib/execute.c?rev=1.7root=gnulibview=log
   
 http://cvs.savannah.gnu.org/viewcvs/gnulib/lib/pipe.c?rev=1.6root=gnulibview=log

Thanks, but I see nothing in these source files that could shed any
light on the case in point.

 Similar code is used in groff too.

Groff builds a pipe of several programs and then runs that pipe.  By
contrast, emacsclient needs to run a single program, and doesn't need
to read/write its standard streams.  So the complexity of the above
URLs is not needed.



___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: image.el doesn't associate image-mode with .JPG files

2006-12-15 Thread Richard Stallman
 It would handle that one case, but it would still produce false
 matches.
   
It would only produce false matches for cases where Emacs would have 
defaulted to Fundamental mode.

Yes, and that is a mistaken outcome.  There is no reason to make such
mistakes happen.  When an entry should match more than one case
pattern, we write it to do so.  That's a small amount of work, and it
gives 100% correct results.

Please drop this idea.



___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: TRAMP password caching

2006-12-15 Thread Stefan Monnier
*if* (!hwnd)
   *return* FALSE;
*else*
   *return* TRUE;

aka return !!hwnd;


Stefan by eta-reduction


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Mysterious fontification/C++ context issue

2006-12-15 Thread Stefan Monnier
  In the time Emacs 22 is the current release, a typical new PC will come to
  be around 20 GHz, and this slowness will not matter.
 
 Actually, recent trends indicate that this is not true.  We'll probably
 see typical new PCs with 4-16 CPUs, each one running at 4-5GHz, but that
 won't help Emacs much.
 
 Hmmm.  One processor for foreground editing, another for doing garbage
 collection, yet another four or five for background font-locking and
 syntactic cacheing, and so on.

 That could be quite a fast system.

I'm anxiously awaiting your patch to Emacs's C code base to make such
concurrency possible.


Stefan


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: scroll-other-window scrolls wrong window for vc-revert-buffer

2006-12-15 Thread Kim F. Storm
Kim F. Storm [EMAIL PROTECTED] writes:

 emacs -Q
 C-x C-f some vc-controlled file with many uncommitted change RET
 C-x v u

 emacs frame spits into two with the diffs in the lower window

 Prompt is Discard changes? (yes or no)

 I would like to review the changes, so I try to scroll the diffs

 C-M-v

 But this scrolls the source window rather than the diffs window.
 Not very useful...


Did anybody look at this?


 But it gets worse:

 I don't like the yes or no prompts, so I have this in my .emacs:

 (defalias 'yes-or-no-p 'y-or-n-p)

 Now, C-M-v doesn't work at all --- it just beeps.

I looked into this ... and it is because yes-or-no-p uses
read-from-minibuffer, and thus obeys all key bindings.

In contrast, y-or-n-p does the reading itself, and looks up the
bindings ONLY in query-replace-map (which obviously don't tell how to
scroll-other-window.

I don't see an easy fix for this...

-- 
Kim F. Storm [EMAIL PROTECTED] http://www.cua.dk



___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: try-completion crashes on non-obarray vector

2006-12-15 Thread Juanma Barranquero

On 12/8/06, Johan Bockgård [EMAIL PROTECTED] wrote:


(try-completion  [])

=

Program received signal SIGSEGV, Segmentation fault.
0x004d7e67 in Ftry_completion (string=10456851, alist=9781604,
predicate=9337233) at minibuf.c:1315
1315  if (XSYMBOL (bucket)-next)


Fixed.

Thanks,
   /L/e/k/t/u
___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: ido.el reports possible completions wrongly

2006-12-15 Thread Kim F. Storm
Chris Moore [EMAIL PROTECTED] writes:

 Chris Moore [EMAIL PROTECTED] writes:

 [EMAIL PROTECTED] (Kim F. Storm) writes:

 Look at ido-max-directory-size.
 In this case C-a is your friend.

 The bug is that the message says:

   There are no possible completions of what you have typed

 when in fact there are possible completions of what I have typed.

I just fixed this, so it will actually load the directory (despite it
is [too big] and show you the possible completions.


 I just noticed also, that if I immediately type a 2nd '?':

   C-x C-f / u s r / b i n / g n u p l o ? ?

 then I see a giant list of 'possible completions':

This is what you would normally get once you have scrolled through the
list of possible matches the first time (i.e. all directory entries).

So since the first ? (and subsequent ?'es to scroll the completion
buffer) now works correctly, this also works ok now.

-- 
Kim F. Storm [EMAIL PROTECTED] http://www.cua.dk



___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: image.el doesn't associate image-mode with .JPG files

2006-12-15 Thread Juanma Barranquero

On 12/14/06, Richard Stallman [EMAIL PROTECTED] wrote:


That seems like a valid reason.  Would someone please install that change?
It would be useful to recognize PNG and GIF as well this way.


image.el already defines `image-type-header-regexps' and
`image-type-from-buffer', so it seems wasteful to recreate that. It
would be better IMHO to simply use `image-type-from-buffer' from
`set-auto-mode'. Other than changes to docstrings and info files, the
path is as simple as this, and works quite well.

   /L/e/k/t/u


Index: lisp/files.el
===
RCS file: /cvsroot/emacs/emacs/lisp/files.el,v
retrieving revision 1.868
diff -c -r1.868 files.el
*** lisp/files.el   11 Dec 2006 04:40:41 -  1.868
--- lisp/files.el   16 Dec 2006 02:51:21 -
***
*** ,2230 
 (narrow-to-region (point-min)
   (min (point-max)
(+ (point-min) 
magic-mode-regexp-match-limit)))
!(assoc-default nil magic-mode-alist
!   (lambda (re dummy)
! (looking-at re))
  (set-auto-mode-0 done keep-mode-if-same)
;; Compare the filename against the entries in auto-mode-alist.
(if buffer-file-name
--- ,2232 
 (narrow-to-region (point-min)
   (min (point-max)
(+ (point-min) 
magic-mode-regexp-match-limit)))
!(if (image-type-from-buffer)
!'image-mode
!  (assoc-default nil magic-mode-alist
! (lambda (re dummy)
!   (looking-at re)))
  (set-auto-mode-0 done keep-mode-if-same)
;; Compare the filename against the entries in auto-mode-alist.
(if buffer-file-name


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: image.el doesn't associate image-mode with .JPG files

2006-12-15 Thread Juanma Barranquero

On 12/16/06, Juanma Barranquero [EMAIL PROTECTED] wrote:


path is as simple as this, and works quite well.


s/path/patch/  sleep

   /L/e/k/t/u


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug