[COMMIT] Preserve match buffer information in #'comint-word
14 years, 3 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
xemacs-packages/xemacs-base/ChangeLog addition:
2010-08-28 Aidan Kehoe <kehoea(a)parhasard.net>
* comint.el (comint-word):
Preserve match buffer information in this function, avoiding
problems in #'comint-match-partial-file-name described in
http://mid.gmane.org/4C728493.70107@gmail.com . Thank you for the
bug report, Raymond Toy!
XEmacs Packages source patch:
Diff command: cvs -q diff -Nu
Files affected: xemacs-packages/xemacs-base/comint.el
Index: xemacs-packages/xemacs-base/comint.el
===================================================================
RCS file: /cvsroot/xemacs/XEmacs/packages/xemacs-packages/xemacs-base/comint.el,v
retrieving revision 1.22
diff -u -r1.22 comint.el
--- xemacs-packages/xemacs-base/comint.el 21 May 2007 18:05:36 -0000 1.22
+++ xemacs-packages/xemacs-base/comint.el 28 Aug 2010 12:05:12 -0000
@@ -2145,7 +2145,8 @@
Word constituents are considered to be those in WORD-CHARS, which is like the
inside of a \"[...]\" (see `skip-chars-forward')."
(save-excursion
- (let ((non-word-chars (concat "[^\\\\" word-chars "]")) (here (point)))
+ (let ((non-word-chars (concat "[^\\\\" word-chars "]"))
+ (here (point-marker)))
(while (and (re-search-backward non-word-chars nil 'move)
;(memq (char-after (point)) shell-file-name-quote-list)
(eq (preceding-char) ?\\))
@@ -2155,7 +2156,7 @@
(forward-char 1))
;; Set match-data to match the entire string.
(if (< (point) here)
- (progn (store-match-data (list (point) here))
+ (progn (store-match-data (list (point-marker) here))
(match-string 0))))))
(defun comint-substitute-in-file-name (filename)
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghe, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-patches
[AC21.5] Fix for GIF crash
14 years, 4 months
Vin Shelton
Here is Adam Sjøgren's patch to fix the crashes associated with issue
713. I will apply this patch tonight after I flee my corporate
firewall.
- Vin
--- src/ChangeLog~ 2010-08-22 20:05:51.000000000 -0400
+++ src/ChangeLog 2010-08-26 12:12:58.984375000 -0400
@@ -0,0 +1,6 @@
+2010-08-26 Adam Sjøgren <asjo(a)koldfront.dk>
+
+ * glyphs-eimage.c (gif_instantiate): Try harder to find an
+ appropriate GIF colormap and then flag an error if one can't be
+ found.
+
--- src/glyphs-eimage.c~ 2010-03-30 19:08:09.000000000 -0400
+++ src/glyphs-eimage.c 2010-08-26 11:44:15.328125000 -0400
@@ -694,7 +694,7 @@
/* 3. Now create the EImage(s) */
{
- ColorMapObject *cmo = unwind.giffile->SColorMap;
+ ColorMapObject *cmo = (unwind.giffile->Image.ColorMap ?
unwind.giffile->Image.ColorMap: unwind.giffile->SColorMap);
int i, j, row, pass, interlace, slice;
UINT_64_BIT pixels_sq;
Binbyte *eip;
@@ -703,6 +703,9 @@
static int InterlacedOffset[] = { 0, 4, 2, 1 };
static int InterlacedJumps[] = { 8, 8, 4, 2 };
+ if (cmo == NULL)
+ signal_image_error ("GIF image has no color map", instantiator);
+
height = unwind.giffile->SHeight;
width = unwind.giffile->SWidth;
pixels_sq = (UINT_64_BIT) width * (UINT_64_BIT) height;
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-patches
commit: Apply GIF colormap fix from Adam Sjogren for issues 150 and 713
14 years, 4 months
Vin Shelton
changeset: 5250:db84c9d41437
tag: tip
user: Vin Shelton <acs(a)xemacs.org>
date: Thu Aug 26 22:45:58 2010 -0400
files: src/ChangeLog src/glyphs-eimage.c
description:
Apply GIF colormap fix from Adam Sjogren for issues 150 and 713
diff -r d4fae3ebf26a -r db84c9d41437 src/ChangeLog
--- a/src/ChangeLog Fri Aug 20 13:04:54 2010 +0200
+++ b/src/ChangeLog Thu Aug 26 22:45:58 2010 -0400
@@ -1,3 +1,9 @@
+2010-08-26 Adam Sjøgren <asjo(a)koldfront.dk>
+
+ * glyphs-eimage.c (gif_instantiate): Try harder to find an
+ appropriate GIF colormap and then flag an error if one can't be
+ found.
+
2010-08-21 Aidan Kehoe <kehoea(a)parhasard.net>
* lread.c (read_escape):
diff -r d4fae3ebf26a -r db84c9d41437 src/glyphs-eimage.c
--- a/src/glyphs-eimage.c Fri Aug 20 13:04:54 2010 +0200
+++ b/src/glyphs-eimage.c Thu Aug 26 22:45:58 2010 -0400
@@ -694,7 +694,7 @@
/* 3. Now create the EImage(s) */
{
- ColorMapObject *cmo = unwind.giffile->SColorMap;
+ ColorMapObject *cmo = (unwind.giffile->Image.ColorMap ? unwind.giffile->Image.ColorMap : unwind.giffile->SColorMap);
int i, j, row, pass, interlace, slice;
UINT_64_BIT pixels_sq;
Binbyte *eip;
@@ -702,6 +702,9 @@
0, 8, 16, ..., 4, 12, 20, ..., 2, 6, 10, ..., 1, 3, 5, ... */
static int InterlacedOffset[] = { 0, 4, 2, 1 };
static int InterlacedJumps[] = { 8, 8, 4, 2 };
+
+ if (cmo == NULL)
+ signal_image_error ("GIF image has no color map", instantiator);
height = unwind.giffile->SHeight;
width = unwind.giffile->SWidth;
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-patches
Re: xemacs winclient improvements
14 years, 4 months
Reini Urban
2009/6/24 Reini Urban <rurban(a)x-ray.at>:
> So I have several improvements.
> Patches inlined because gmail uploader fails on my proxy
Forget the previous attempt. It double-freed an arg.
This patch works now fine.
2009-06-30 Reini Urban <rurban(a)x-ray.at>
* lib-src/winclient.c: adapt to cygwin paths, add more startup sleep to
let xemacs init the DDE server.
diff -u xemacs-21.5.28/lib-src/winclient.c.orig
xemacs-21.5.28/lib-src/winclient.c
--- xemacs-21.5.28/lib-src/winclient.c.orig 2009-06-24 09:30:22.234375000 +0200
+++ xemacs-21.5.28/lib-src/winclient.c 2009-06-30 08:28:29.046875000 +0200
@@ -1,5 +1,6 @@
/* DDE client for XEmacs.
Copyright (C) 2002 Alastair J. Houghton
+ Copyright (C) 2009 Reini Urban
This file is part of XEmacs.
@@ -31,6 +32,9 @@
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
+#ifdef __CYGWIN__
+#include <sys/cygwin.h>
+#endif
static void error (const char* s1, const char* s2);
static void fatal (const char *s1, const char *s2);
@@ -40,6 +44,8 @@
/* -- Post-Include Defines
-------------------------------------------------- */
/* Timeouts & delays */
+#define STARTUP_DELAY 3000 /* ms */
+#define CONNECT_RETRIES 10
#define CONNECT_DELAY 500 /* ms */
#define TRANSACTION_TIMEOUT 5000 /* ms */
#define MAX_INPUT_IDLE_WAIT INFINITE /* ms */
@@ -205,12 +211,15 @@
/* Wait for the process to enter an idle state */
WaitForInputIdle (pi.hProcess, MAX_INPUT_IDLE_WAIT);
+ /* Wait longer to let the process init the GUI and initialize
the DDE server */
+ Sleep (STARTUP_DELAY);
+
/* Close the handles */
CloseHandle (pi.hThread);
CloseHandle (pi.hProcess);
- /* Try to connect */
- for (n = 0; n < 5; n++)
+ /* Try to connect. Process startup and XEmacs init might be slow */
+ for (n = 0; n < CONNECT_RETRIES; n++)
{
Sleep (CONNECT_DELAY);
@@ -272,6 +281,24 @@
char *buf = NULL;
unsigned len;
+ /* On Cygwin convert the path - first part - back to POSIX */
+#ifdef __CYGWIN__
+ int err;
+ int pathlen;
+ char *fullpath;
+
+ pathlen = strlen(lpszFileName1) + 260 + 1001;
+ fullpath = (char *) xmalloc (pathlen);
+ err = cygwin_conv_path(CCP_WIN_A_TO_POSIX | CCP_RELATIVE,
+ lpszFileName1, fullpath, pathlen);
+# ifdef DEBUG
+ fprintf(stderr, "DEBUG doFile(hConv, \"%s\", \"%s\")\n",
lpszFileName1, lpszFileName2);
+ fprintf(stderr, "DEBUG W2P \"%s\" => \"%s\" err=%d\n",
lpszFileName1, fullpath, err);
+# endif
+ if (!err)
+ strcpy(lpszFileName1, fullpath);
+#endif
+
/* Calculate the buffer length */
len = strlen (lpszFileName1) + strlen (lpszFileName2)
+ strlen (COMMAND_FORMAT);
@@ -296,6 +323,13 @@
DdeClientTransaction (buf, len, hConv, NULL,
0, XTYP_EXECUTE, TRANSACTION_TIMEOUT, NULL);
+#ifdef __CYGWIN__
+# ifdef DEBUG
+ fprintf(stderr, "DEBUG DDE => %s\n", buf);
+# endif
+ if (!err)
+ free (fullpath);
+#endif
free (buf);
return 0;
@@ -404,13 +438,20 @@
int ret = 0;
HANDLE hFindFile = NULL;
WIN32_FIND_DATA wfd;
+#ifdef __CYGWIN__
+ int err;
+#endif
/* Retrieve arguments */
while ((arg = getNextArg ((const char**)&lpszCommandLine, &len)) != NULL)
{
/* First find the canonical path name */
fullpath = filepart = NULL;
+#ifdef __CYGWIN__
+ pathlen = len + 260 + 1001;
+#else
pathlen = GetFullPathName (arg, 0, fullpath, &filepart);
+#endif
fullpath = (char *) xmalloc (pathlen);
@@ -425,6 +466,17 @@
break;
}
+#ifdef __CYGWIN__
+ err = cygwin_conv_path(CCP_POSIX_TO_WIN_A | CCP_RELATIVE, arg,
fullpath, pathlen);
+# ifdef DEBUG
+ fprintf(stderr, "DEBUG P2W \"%s\" => \"%s\" err=%d\n", arg,
fullpath, err);
+# endif
+ if (err)
+ ret = doFile (hConv, "", arg);
+ else
+ arg = fullpath;
+#endif
+
GetFullPathName (arg, pathlen, fullpath, &filepart);
/* Find the first matching file */
@@ -454,7 +506,10 @@
/* Release the path name buffers */
free (fullpath);
- free (arg);
+#ifdef __CYGWIN__
+ if (err)
+ free (arg);
+#endif
if (ret)
break;
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Add `save-some-buffers-action-alist'.
14 years, 4 months
Michael Sperber
changeset: 5249:d4fae3ebf26a
tag: tip
user: Mike Sperber <sperber(a)deinprogramm.de>
date: Fri Aug 20 13:04:54 2010 +0200
files: lisp/ChangeLog lisp/files.el
description:
Add `save-some-buffers-action-alist'.
2010-08-20 Mike Sperber <mike(a)xemacs.org>
* files.el (save-some-buffers-action-alist): Add.
(save-some-buffers-1): Use (synching with (GPLv2) FSF Emacs.
diff -r 9d8aaa5ac16e -r d4fae3ebf26a lisp/ChangeLog
--- a/lisp/ChangeLog Sat Aug 21 19:03:15 2010 +0100
+++ b/lisp/ChangeLog Fri Aug 20 13:04:54 2010 +0200
@@ -1,3 +1,8 @@
+2010-08-20 Mike Sperber <mike(a)xemacs.org>
+
+ * files.el (save-some-buffers-action-alist): Add.
+ (save-some-buffers-1): Use (synching with (GPLv2) FSF Emacs.
+
2010-08-18 Mike Sperber <mike(a)xemacs.org>
* files.el (diff-files-for-recover): Abstract this out out
diff -r 9d8aaa5ac16e -r d4fae3ebf26a lisp/files.el
--- a/lisp/files.el Sat Aug 21 19:03:15 2010 +0100
+++ b/lisp/files.el Fri Aug 20 13:04:54 2010 +0200
@@ -3086,6 +3086,45 @@
;; over to the next unsaved buffer when calling `d'.
nil)
+(defvar save-some-buffers-action-alist
+ ;;instead of this we just say "yes all", "no all", etc.
+ ;;"save all the rest"
+ ;;"save only this buffer" "save no more buffers")
+ ;; this is rather bogus. --ben
+ ;; (it makes the dialog box too big, and you get an error
+ ;; "wrong type argument: framep, nil" when you hit q after
+ ;; choosing the option from the dialog box)
+
+ ;; We should fix the dialog box rather than disabling
+ ;; this! --hniksic
+ (list (list ?\C-r (lambda (buf)
+ ;; #### FSF has an EXIT-ACTION argument
+ ;; to `view-buffer'.
+ (view-buffer buf
+; (function
+; (lambda (ignore)
+; (exit-recursive-edit))))
+ )
+ (with-boundp 'view-exit-action
+ (setq view-exit-action
+ (lambda (ignore)
+ (exit-recursive-edit))))
+ (recursive-edit)
+ ;; Return nil to ask about BUF again.
+ nil)
+ "%_Display Buffer")
+ (list ?d (lambda (buf)
+ (save-window-excursion (diff-buffer-with-file buf))
+ (view-buffer (get-buffer-create "*File Diff*") t)
+ (with-boundp 'view-exit-action
+ (setq view-exit-action
+ (lambda (ignore)
+ (exit-recursive-edit))))
+ (recursive-edit)
+ ;; Return nil to ask about BUF again.
+ nil)
+ "View %_Changes in Buffer")))
+
(defun diff-files-for-recover (purpose file-1 file-2
failed-file-1 failed-file-2
coding-system)
@@ -3215,32 +3254,7 @@
(error nil)))
(buffer-list)
'("buffer" "buffers" "save")
- ;;instead of this we just say "yes all", "no all", etc.
- ;;"save all the rest"
- ;;"save only this buffer" "save no more buffers")
- ;; this is rather bogus. --ben
- ;; (it makes the dialog box too big, and you get an error
- ;; "wrong type argument: framep, nil" when you hit q after
- ;; choosing the option from the dialog box)
-
- ;; We should fix the dialog box rather than disabling
- ;; this! --hniksic
- (list (list ?\C-r (lambda (buf)
- ;; #### FSF has an EXIT-ACTION argument
- ;; to `view-buffer'.
- (view-buffer buf
-; (function
-; (lambda (ignore)
-; (exit-recursive-edit))))
- )
- (with-boundp 'view-exit-action
- (setq view-exit-action
- (lambda (ignore)
- (exit-recursive-edit))))
- (recursive-edit)
- ;; Return nil to ask about BUF again.
- nil)
- "%_Display Buffer"))))
+ save-some-buffers-action-alist))
(abbrevs-done
(and save-abbrevs abbrevs-changed
(progn
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-patches
[COMMIT] Make Lisp reader errors more informative with over-long hex, octal characters
14 years, 4 months
Aidan Kehoe
After some discussion with kevinfish in IRC, IMO the below will make things
easier for people to follow what exactly the relevant error messages mean.
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1282413764 -3600
# Node ID 02d875ebd1ea4da4214e733f9a459dd508ddfc9d
# Parent 04811a268716dbb77524e2ab2364a243a1c5c29c
Make Lisp reader errors more informative with over-long hex, octal characters
src/ChangeLog addition:
2010-08-21 Aidan Kehoe <kehoea(a)parhasard.net>
* lread.c (read_escape):
Make error messages better reflect the text that was encountered,
when overlong hex character escapes or non-Latin-1 octal character
escapes are encountered.
man/ChangeLog addition:
2010-08-21 Aidan Kehoe <kehoea(a)parhasard.net>
* lispref/objects.texi (Character Type):
Go into more detail here on the specific type of error provoked on
overlong hex character escapes and non-Latin-1 octal character
escapes; give details of why the latter may be encountered, and
what to do with such code.
diff -r 04811a268716 -r 02d875ebd1ea man/ChangeLog
--- a/man/ChangeLog Sun Aug 15 15:42:45 2010 +0100
+++ b/man/ChangeLog Sat Aug 21 19:02:44 2010 +0100
@@ -1,3 +1,11 @@
+2010-08-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * lispref/objects.texi (Character Type):
+ Go into more detail here on the specific type of error provoked on
+ overlong hex character escapes and non-Latin-1 octal character
+ escapes; give details of why the latter may be encountered, and
+ what to do with such code.
+
2010-06-13 Stephen J. Turnbull <stephen(a)xemacs.org>
* external-widget.texi: Correct FSF address in permission notice.
diff -r 04811a268716 -r 02d875ebd1ea man/lispref/objects.texi
--- a/man/lispref/objects.texi Sun Aug 15 15:42:45 2010 +0100
+++ b/man/lispref/objects.texi Sat Aug 21 19:02:44 2010 +0100
@@ -623,6 +623,8 @@
@cindex backslash in character constant
@cindex octal character code
@cindex hexadecimal character code
+@cindex Overlong hex character escape
+@cindex Non-ISO-8859-1 octal character escape
Finally, there are two read syntaxes involving character codes.
It is not possible to represent multibyte or wide characters in this
@@ -643,14 +645,21 @@
@samp{?\001} for the character @kbd{C-a}, and @code{?\002} for the
character @kbd{C-b}. The reader will finalize the character and start
reading the next token when a non-octal-digit is encountered or three
-octal digits are read.
+octal digits are read. When a given character code is above
+@code{#o377}, the Lisp reader signals an @code{invalid-read-syntax}
+error. Such errors are typically provoked by code written for older
+versions of GNU Emacs, where the absence of the #o octal syntax for
+integers made the character syntax convenient for non-character
+values. Those older versions of GNU Emacs are long obsolete, so
+changing the code to use the #o integer escape is the best
+solution. @pxref{Numbers}.
The second consists of a question mark followed by a backslash, the
character @samp{x}, and the character code in hexadecimal (up to two
hexadecimal digits); thus, @samp{?\x41} for the character @kbd{A},
@samp{?\x1} for the character @kbd{C-a}, and @code{?\x2} for the
character @kbd{C-b}. If more than two hexadecimal codes are given, the
-reader signals an error.
+reader signals an @code{invalid-read-syntax} error.
@example
@group
diff -r 04811a268716 -r 02d875ebd1ea src/ChangeLog
--- a/src/ChangeLog Sun Aug 15 15:42:45 2010 +0100
+++ b/src/ChangeLog Sat Aug 21 19:02:44 2010 +0100
@@ -1,3 +1,10 @@
+2010-08-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * lread.c (read_escape):
+ Make error messages better reflect the text that was encountered,
+ when overlong hex character escapes or non-Latin-1 octal character
+ escapes are encountered.
+
2010-08-15 Aidan Kehoe <kehoea(a)parhasard.net>
* print.c (print_symbol):
diff -r 04811a268716 -r 02d875ebd1ea src/lread.c
--- a/src/lread.c Sun Aug 15 15:42:45 2010 +0100
+++ b/src/lread.c Sat Aug 21 19:02:44 2010 +0100
@@ -1818,8 +1818,12 @@
}
}
if (i >= 0400)
- syntax_error ("Non-ISO-8859-1 character specified with octal escape",
- make_int (i));
+ {
+ read_syntax_error ((Ascbyte *) emacs_sprintf_malloc
+ (NULL,
+ "Non-ISO-8859-1 octal character escape, "
+ "?\\%.3o", i));
+ }
return i;
}
@@ -1827,13 +1831,23 @@
/* A hex escape, as in ANSI C, except that we only allow latin-1
characters to be read this way. What is "\x4e03" supposed to
mean, anyways, if the internal representation is hidden?
- This is also consistent with the treatment of octal escapes. */
+ This is also consistent with the treatment of octal escapes.
+
+ Note that we don't accept ?\XAB as specifying the character with
+ numeric value 171; it must be ?\xAB. */
{
+#define OVERLONG_INFO "Overlong hex character escape, ?\\x"
+
REGISTER Ichar i = 0;
REGISTER int count = 0;
+ Ascbyte seen[] = OVERLONG_INFO "\0\0\0\0\0";
+ REGISTER Ascbyte *seenp = seen + sizeof (OVERLONG_INFO) - 1;
+
+#undef OVERLONG_INFO
+
while (++count <= 2)
{
- c = readchar (readcharfun);
+ c = readchar (readcharfun), *seenp = c, ++seenp;
/* Remember, can't use isdigit(), isalpha() etc. on Ichars */
if (c >= '0' && c <= '9') i = (i << 4) + (c - '0');
else if (c >= 'a' && c <= 'f') i = (i << 4) + (c - 'a') + 10;
@@ -1847,21 +1861,12 @@
if (count == 3)
{
- c = readchar (readcharfun);
+ c = readchar (readcharfun), *seenp = c, ++seenp;
if ((c >= '0' && c <= '9') ||
(c >= 'a' && c <= 'f') ||
(c >= 'A' && c <= 'F'))
{
- Lisp_Object args[2];
-
- if (c >= '0' && c <= '9') i = (i << 4) + (c - '0');
- else if (c >= 'a' && c <= 'f') i = (i << 4) + (c - 'a') + 10;
- else if (c >= 'A' && c <= 'F') i = (i << 4) + (c - 'A') + 10;
-
- args[0] = build_ascstring ("?\\x%x");
- args[1] = make_int (i);
- syntax_error ("Overlong hex character escape",
- Fformat (2, args));
+ read_syntax_error (seen);
}
unreadchar (readcharfun, c);
}
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-patches
commit: Make Lisp reader errors more informative with over-long hex, octal characters
14 years, 4 months
Aidan Kehoe
changeset: 5247:02d875ebd1ea
parent: 5244:04811a268716
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sat Aug 21 19:02:44 2010 +0100
files: man/ChangeLog man/lispref/objects.texi src/ChangeLog src/lread.c
description:
Make Lisp reader errors more informative with over-long hex, octal characters
src/ChangeLog addition:
2010-08-21 Aidan Kehoe <kehoea(a)parhasard.net>
* lread.c (read_escape):
Make error messages better reflect the text that was encountered,
when overlong hex character escapes or non-Latin-1 octal character
escapes are encountered.
man/ChangeLog addition:
2010-08-21 Aidan Kehoe <kehoea(a)parhasard.net>
* lispref/objects.texi (Character Type):
Go into more detail here on the specific type of error provoked on
overlong hex character escapes and non-Latin-1 octal character
escapes; give details of why the latter may be encountered, and
what to do with such code.
diff -r 04811a268716 -r 02d875ebd1ea man/ChangeLog
--- a/man/ChangeLog Sun Aug 15 15:42:45 2010 +0100
+++ b/man/ChangeLog Sat Aug 21 19:02:44 2010 +0100
@@ -1,3 +1,11 @@
+2010-08-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * lispref/objects.texi (Character Type):
+ Go into more detail here on the specific type of error provoked on
+ overlong hex character escapes and non-Latin-1 octal character
+ escapes; give details of why the latter may be encountered, and
+ what to do with such code.
+
2010-06-13 Stephen J. Turnbull <stephen(a)xemacs.org>
* external-widget.texi: Correct FSF address in permission notice.
diff -r 04811a268716 -r 02d875ebd1ea man/lispref/objects.texi
--- a/man/lispref/objects.texi Sun Aug 15 15:42:45 2010 +0100
+++ b/man/lispref/objects.texi Sat Aug 21 19:02:44 2010 +0100
@@ -623,6 +623,8 @@
@cindex backslash in character constant
@cindex octal character code
@cindex hexadecimal character code
+@cindex Overlong hex character escape
+@cindex Non-ISO-8859-1 octal character escape
Finally, there are two read syntaxes involving character codes.
It is not possible to represent multibyte or wide characters in this
@@ -643,14 +645,21 @@
@samp{?\001} for the character @kbd{C-a}, and @code{?\002} for the
character @kbd{C-b}. The reader will finalize the character and start
reading the next token when a non-octal-digit is encountered or three
-octal digits are read.
+octal digits are read. When a given character code is above
+@code{#o377}, the Lisp reader signals an @code{invalid-read-syntax}
+error. Such errors are typically provoked by code written for older
+versions of GNU Emacs, where the absence of the #o octal syntax for
+integers made the character syntax convenient for non-character
+values. Those older versions of GNU Emacs are long obsolete, so
+changing the code to use the #o integer escape is the best
+solution. @pxref{Numbers}.
The second consists of a question mark followed by a backslash, the
character @samp{x}, and the character code in hexadecimal (up to two
hexadecimal digits); thus, @samp{?\x41} for the character @kbd{A},
@samp{?\x1} for the character @kbd{C-a}, and @code{?\x2} for the
character @kbd{C-b}. If more than two hexadecimal codes are given, the
-reader signals an error.
+reader signals an @code{invalid-read-syntax} error.
@example
@group
diff -r 04811a268716 -r 02d875ebd1ea src/ChangeLog
--- a/src/ChangeLog Sun Aug 15 15:42:45 2010 +0100
+++ b/src/ChangeLog Sat Aug 21 19:02:44 2010 +0100
@@ -1,3 +1,10 @@
+2010-08-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * lread.c (read_escape):
+ Make error messages better reflect the text that was encountered,
+ when overlong hex character escapes or non-Latin-1 octal character
+ escapes are encountered.
+
2010-08-15 Aidan Kehoe <kehoea(a)parhasard.net>
* print.c (print_symbol):
diff -r 04811a268716 -r 02d875ebd1ea src/lread.c
--- a/src/lread.c Sun Aug 15 15:42:45 2010 +0100
+++ b/src/lread.c Sat Aug 21 19:02:44 2010 +0100
@@ -1818,8 +1818,12 @@
}
}
if (i >= 0400)
- syntax_error ("Non-ISO-8859-1 character specified with octal escape",
- make_int (i));
+ {
+ read_syntax_error ((Ascbyte *) emacs_sprintf_malloc
+ (NULL,
+ "Non-ISO-8859-1 octal character escape, "
+ "?\\%.3o", i));
+ }
return i;
}
@@ -1827,13 +1831,23 @@
/* A hex escape, as in ANSI C, except that we only allow latin-1
characters to be read this way. What is "\x4e03" supposed to
mean, anyways, if the internal representation is hidden?
- This is also consistent with the treatment of octal escapes. */
+ This is also consistent with the treatment of octal escapes.
+
+ Note that we don't accept ?\XAB as specifying the character with
+ numeric value 171; it must be ?\xAB. */
{
+#define OVERLONG_INFO "Overlong hex character escape, ?\\x"
+
REGISTER Ichar i = 0;
REGISTER int count = 0;
+ Ascbyte seen[] = OVERLONG_INFO "\0\0\0\0\0";
+ REGISTER Ascbyte *seenp = seen + sizeof (OVERLONG_INFO) - 1;
+
+#undef OVERLONG_INFO
+
while (++count <= 2)
{
- c = readchar (readcharfun);
+ c = readchar (readcharfun), *seenp = c, ++seenp;
/* Remember, can't use isdigit(), isalpha() etc. on Ichars */
if (c >= '0' && c <= '9') i = (i << 4) + (c - '0');
else if (c >= 'a' && c <= 'f') i = (i << 4) + (c - 'a') + 10;
@@ -1847,21 +1861,12 @@
if (count == 3)
{
- c = readchar (readcharfun);
+ c = readchar (readcharfun), *seenp = c, ++seenp;
if ((c >= '0' && c <= '9') ||
(c >= 'a' && c <= 'f') ||
(c >= 'A' && c <= 'F'))
{
- Lisp_Object args[2];
-
- if (c >= '0' && c <= '9') i = (i << 4) + (c - '0');
- else if (c >= 'a' && c <= 'f') i = (i << 4) + (c - 'a') + 10;
- else if (c >= 'A' && c <= 'F') i = (i << 4) + (c - 'A') + 10;
-
- args[0] = build_ascstring ("?\\x%x");
- args[1] = make_int (i);
- syntax_error ("Overlong hex character escape",
- Fformat (2, args));
+ read_syntax_error (seen);
}
unreadchar (readcharfun, c);
}
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-patches
Add `save-some-buffers-alist'
14 years, 4 months
Michael Sperber
This is a follow-up patch to the previous one.
2010-08-20 Mike Sperber <mike(a)xemacs.org>
* files.el (save-some-buffers-action-alist): Add.
(save-some-buffers-1): Use (synching with (GPLv2) FSF Emacs.
Will apply on Sunday or so if nobody objects.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
diff --git a/lisp/files.el b/lisp/files.el
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3086,6 +3086,45 @@
;; over to the next unsaved buffer when calling `d'.
nil)
+(defvar save-some-buffers-action-alist
+ ;;instead of this we just say "yes all", "no all", etc.
+ ;;"save all the rest"
+ ;;"save only this buffer" "save no more buffers")
+ ;; this is rather bogus. --ben
+ ;; (it makes the dialog box too big, and you get an error
+ ;; "wrong type argument: framep, nil" when you hit q after
+ ;; choosing the option from the dialog box)
+
+ ;; We should fix the dialog box rather than disabling
+ ;; this! --hniksic
+ (list (list ?\C-r (lambda (buf)
+ ;; #### FSF has an EXIT-ACTION argument
+ ;; to `view-buffer'.
+ (view-buffer buf
+; (function
+; (lambda (ignore)
+; (exit-recursive-edit))))
+ )
+ (with-boundp 'view-exit-action
+ (setq view-exit-action
+ (lambda (ignore)
+ (exit-recursive-edit))))
+ (recursive-edit)
+ ;; Return nil to ask about BUF again.
+ nil)
+ "%_Display Buffer")
+ (list ?d (lambda (buf)
+ (save-window-excursion (diff-buffer-with-file buf))
+ (view-buffer (get-buffer-create "*File Diff*") t)
+ (with-boundp 'view-exit-action
+ (setq view-exit-action
+ (lambda (ignore)
+ (exit-recursive-edit))))
+ (recursive-edit)
+ ;; Return nil to ask about BUF again.
+ nil)
+ "View %_Changes in Buffer")))
+
(defun diff-files-for-recover (purpose file-1 file-2
failed-file-1 failed-file-2
coding-system)
@@ -3215,32 +3254,7 @@
(error nil)))
(buffer-list)
'("buffer" "buffers" "save")
- ;;instead of this we just say "yes all", "no all", etc.
- ;;"save all the rest"
- ;;"save only this buffer" "save no more buffers")
- ;; this is rather bogus. --ben
- ;; (it makes the dialog box too big, and you get an error
- ;; "wrong type argument: framep, nil" when you hit q after
- ;; choosing the option from the dialog box)
-
- ;; We should fix the dialog box rather than disabling
- ;; this! --hniksic
- (list (list ?\C-r (lambda (buf)
- ;; #### FSF has an EXIT-ACTION argument
- ;; to `view-buffer'.
- (view-buffer buf
-; (function
-; (lambda (ignore)
-; (exit-recursive-edit))))
- )
- (with-boundp 'view-exit-action
- (setq view-exit-action
- (lambda (ignore)
- (exit-recursive-edit))))
- (recursive-edit)
- ;; Return nil to ask about BUF again.
- nil)
- "%_Display Buffer"))))
+ save-some-buffers-action-alist))
(abbrevs-done
(and save-abbrevs abbrevs-changed
(progn
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-patches
commit: Recover from merge SNAFU.
14 years, 4 months
Michael Sperber
changeset: 5246:bf93bff989d8
tag: tip
user: Mike Sperber <sperber(a)deinprogramm.de>
date: Fri Aug 20 11:35:58 2010 +0200
files: lisp/ChangeLog
description:
Recover from merge SNAFU.
diff -r 0d71bcf96ffd -r bf93bff989d8 lisp/ChangeLog
--- a/lisp/ChangeLog Wed Aug 18 17:44:24 2010 +0200
+++ b/lisp/ChangeLog Fri Aug 20 11:35:58 2010 +0200
@@ -1,24 +1,19 @@
-<<<<<<< local
+2010-08-18 Mike Sperber <mike(a)xemacs.org>
+
+ * files.el (diff-files-for-recover): Abstract this out out
+ `recover-file'.
+ (diff-buffer-with-file): Add from (GPLv2) FSF Emacs.
+ (recover-file): Use `diff-files-for-recover'.
+
2010-08-15 Aidan Kehoe <kehoea(a)parhasard.net>
-=======
-2010-08-18 Mike Sperber <mike(a)xemacs.org>
->>>>>>> other
-
-<<<<<<< local
+
* specifier.el (canonicalize-inst-pair, canonicalize-spec):
If a specifier tag set is correct, but an instantiator is not in
an accepted format, don't error with the message "Invalid
specifier tag set".
Also, when we error, use error-symbols, for better structured
error handling and more ease when testing.
-=======
- * files.el (diff-files-for-recover): Abstract this out out
- `recover-file'.
- (diff-buffer-with-file): Add from (GPLv2) FSF Emacs.
- (recover-file): Use `diff-files-for-recover'.
->>>>>>> other
-
-<<<<<<< local
+
2010-07-24 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-extra.el (concatenate):
@@ -28,8 +23,6 @@
If TYPE is constant, don't inline #'concatenate, replace it by a
call to the appropriate C functions.
-=======
->>>>>>> other
2010-06-13 Stephen J. Turnbull <stephen(a)xemacs.org>
* gnome.el:
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-patches