[PATCH] Update man page for init file, one nroff format error
17 years, 3 months
Shyamal Prasad
etc/ChangeLog addition:
2004-12-03 Shyamal Prasad <shyamal(a)member.fsf.org>
* xemacs.1: Now describe $HOME/.xemacs/init.el as the
preferred init file. Fixed excessive space insertion
in the description of the '-vanilla' option
XEmacs source patch:
Diff command: cvs -q diff -u
Files affected: etc/xemacs.1
Index: etc/xemacs.1
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/etc/xemacs.1,v
retrieving …
[View More]revision 1.13
diff -u -r1.13 xemacs.1
--- etc/xemacs.1 2001/04/12 18:20:52 1.13
+++ etc/xemacs.1 2004/12/04 01:33:45
@@ -147,12 +147,7 @@
.TP
.B \-vanilla
Load no extra files at startup. Equivalent to the combination of
-.B \-q
-,
-.B \-no-site-file
-, and
-.B \-no-early-packages
-\.
+.BR \-q ", " \-no-site-file ", and " \-no-early-packages .
.TP
.BI \-u " user, " \-user " user"
Load
@@ -628,7 +623,8 @@
META-left Make a rectangular selection.
.SH FILES
Lisp code is read at startup from the user's init file,
-\fB$HOME/.emacs\fP.
+\fB$HOME/.xemacs/init.el\fP. If this file does not exist then
+\fB$HOME/.emacs\fP will be read if it is present.
/usr/local/info - files for the Info documentation browser
(a subsystem of
[View Less]
[PATCH] Synch up format-time-string % specifiers with Emacs 21.3.1
17 years, 3 months
Shyamal Prasad
This patch adds % specifiers to format-time-string that are missing in
XEmacs but supported by Emacs 21.3.1
src/ChangeLog addition:
2004-12-08 Shyamal Prasad <shyamal(a)member.fsf.org>
* editfns.c:
* editfns.c (Fformat_time_string):
Added documentation for %z, %g, %G and %V specifiers. This synchs
up the set of % specifiers for format-time-string with Emacs
21.3.1. Make copy of static buffer returned by localtime().
* strftime.c:
* strftime.c (strftime):
Implemented %z, %g,…
[View More] %G and %V in a style similar to existing
implementation of other specifiers.
XEmacs source patch:
Diff command: cvs -q diff -u
Files affected: src/strftime.c src/editfns.c
Index: src/editfns.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/editfns.c,v
retrieving revision 1.51
diff -u -r1.51 editfns.c
--- src/editfns.c 2004/12/06 03:52:03 1.51
+++ src/editfns.c 2004/12/09 02:40:17
@@ -1015,6 +1015,8 @@
%d is replaced by the day of month, zero-padded.
%D is a synonym for "%m/%d/%y".
%e is replaced by the day of month, blank-padded.
+%G is replaced by the year containing the ISO 8601 week
+%g is replaced by the year of the ISO 8601 week within the century (00-99)
%h is a synonym for "%b".
%H is replaced by the hour (00-23).
%I is replaced by the hour (00-12).
@@ -1033,12 +1035,14 @@
%t is a synonym for "\\t".
%T is a synonym for "%H:%M:%S".
%U is replaced by the week of the year (00-53), first day of week is Sunday.
+%V is replaced by the ISO 8601 week number
%w is replaced by the day of week (0-6), Sunday is day 0.
%W is replaced by the week of the year (00-53), first day of week is Monday.
%x is a locale-specific synonym, which defaults to "%D" in the C locale.
%X is a locale-specific synonym, which defaults to "%T" in the C locale.
%y is replaced by the year without century (00-99).
%Y is replaced by the year with century.
+%z is replaced by the time zone as a numeric offset (e.g +0530, -0800 etc.)
%Z is replaced by the time zone abbreviation.
The number of options reflects the `strftime' function.
@@ -1063,13 +1067,15 @@
{
Extbyte *buf = alloca_extbytes (size);
Extbyte *formext;
+ /* make a copy of the static buffer returned by localtime() */
+ struct tm tm = * localtime(&value);
+
*buf = 1;
/* !!#### this use of external here is not totally safe, and
potentially data lossy. */
LISP_STRING_TO_EXTERNAL (format_string, formext, Qnative);
- if (emacs_strftime (buf, size, formext,
- localtime (&value))
+ if (emacs_strftime (buf, size, formext, &tm)
|| !*buf)
return build_ext_string (buf, Qnative);
/* If buffer was too small, make it bigger. */
Index: src/strftime.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/strftime.c,v
retrieving revision 1.6
diff -u -r1.6 strftime.c
--- src/strftime.c 2002/03/29 04:48:37 1.6
+++ src/strftime.c 2004/12/09 02:40:18
@@ -58,6 +58,7 @@
%S second (00..61)
%T time, 24-hour (hh:mm:ss)
%X locale's time representation (%H:%M:%S)
+ %z time zone offset (e.g. +0530, -0800 etc)
%Z time zone (EDT), or nothing if no time zone is determinable
Date fields:
@@ -70,10 +71,13 @@
%d day of month (01..31)
%e day of month ( 1..31)
%D date (mm/dd/yy)
+ %G year corresponding to the ISO 8601 week
+ %g Year of the ISO 8601 week within century (00 - 99)
%h same as %b
%j day of year (001..366)
%m month (01..12)
%U week number of year with Sunday as first day of week (00..53)
+ %V ISO 8601 week number (first week is the earliest one with Thu)
%w day of week (0..6)
%W week number of year with Monday as first day of week (00..53)
%x locale's date representation (mm/dd/yy)
@@ -235,6 +239,30 @@
return dl <= 0 ? 0 : dl / 7 + (dl % 7 != 0);
}
+#ifndef __isleap
+/* Nonzero if YEAR is a leap year (every 4 years,
+ except every 100th isn't, and every 400th is). */
+# define __isleap(year) \
+ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
+#endif
+
+/* The number of days from the first day of the first ISO week of this
+ year to the year day YDAY with week day WDAY. ISO weeks start on
+ Monday; the first ISO week has the year's first Thursday. YDAY may
+ be as small as YDAY_MINIMUM. */
+#define ISO_WEEK_START_WDAY 1 /* Monday */
+#define ISO_WEEK1_WDAY 4 /* Thursday */
+#define YDAY_MINIMUM (-366)
+static int
+iso_week_days (int yday, int wday)
+{
+ /* Add enough to the first operand of % to make it nonnegative. */
+ int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7;
+ return (yday
+ - (yday - wday + ISO_WEEK1_WDAY + big_enough_multiple_of_7) % 7
+ + ISO_WEEK1_WDAY - ISO_WEEK_START_WDAY);
+}
+
#if !defined(HAVE_TM_ZONE) && !defined(HAVE_TZNAME)
char *zone_name (const struct tm *tp);
char *
@@ -362,10 +390,125 @@
length +=
strftime (&string[length], max - length, "%H:%M:%S", tm);
break;
+
+ case 'V':
+ case 'g':
+ case 'G':
+ {
+ int year = tm->tm_year + 1900;
+ int days = iso_week_days (tm->tm_yday, tm->tm_wday);
+
+ if (days < 0)
+ {
+ /* This ISO week belongs to the previous year. */
+ year--;
+ days =
+ iso_week_days (tm->tm_yday + (365 + __isleap (year)),
+ tm->tm_wday);
+ }
+ else
+ {
+ int d =
+ iso_week_days (tm->tm_yday - (365 + __isleap (year)),
+ tm->tm_wday);
+ if (0 <= d)
+ {
+ /* This ISO week belongs to the next year. */
+ year++;
+ days = d;
+ }
+ }
+
+ switch (*format)
+ {
+ /*
+ #### FIXME
+ We really can't assume 1000 <= year <= 9999
+ once time_t gets beyond 32 bits, but it's true
+ of the rest of the code here so get with the
+ program
+ */
+ case 'g':
+ length +=
+ add_num2 (&string[length], year % 100,
+ max - length, pad);
+ break;
+
+ case 'G':
+ add_char (year / 1000 + '0');
+ length += add_num3 (&string[length], year % 1000,
+ max - length, zero);
+ break;
+
+ default:
+ length +=
+ add_num2 (&string[length], days / 7 + 1,
+ max - length, pad);
+ break;
+ }
+ }
+ break;
case 'X':
length +=
strftime (&string[length], max - length, "%H:%M:%S", tm);
break;
+ case 'z':
+ {
+ /*
+ #### FIXME: could use tm->tm_gmtoff if present. Since
+ the other code in xemacs does not do so we follow the
+ leaders (and don't add a autoconf macro to detect
+ its presence).
+ */
+ long int offset;
+ long int minutes;
+ struct tm lt, *ut;
+ time_t utc;
+
+ lt = *tm;
+ utc = mktime(<);
+ ut = gmtime(&utc);
+ /* assume that tm is valid so the others will be too! */
+ assert( utc != (time_t) -1 && ut != NULL );
+
+ /* tm diff code below is based on mktime.c, glibc 2.3.2 */
+ {
+ int lt4, ut4, lt100, ut100, lt400, ut400;
+ int intervening_leap_days, years, days;
+
+ lt4 = (lt.tm_year >> 2) + (1900 >> 2) -
+ ! (lt.tm_year & 3);
+ ut4 = (ut->tm_year >> 2) + (1900 >> 2) -
+ ! (ut->tm_year & 3);
+ lt100 = lt4 / 25 - (lt4 % 25 < 0);
+ ut100 = ut4 / 25 - (ut4 % 25 < 0);
+ lt400 = lt100 >> 2;
+ ut400 = ut100 >> 2;
+ intervening_leap_days =
+ (lt4 - ut4) - (lt100 - ut100) + (lt400 - ut400);
+ years = lt.tm_year - ut->tm_year;
+ days = (365 * years + intervening_leap_days
+ + (lt.tm_yday - ut->tm_yday));
+ offset = (60 * (60 * (24 * days + (lt.tm_hour - ut->tm_hour))
+ + (lt.tm_min - ut->tm_min))
+ + (lt.tm_sec - ut->tm_sec));
+ }
+
+ minutes = offset / ( offset < 0 ? -60 : 60 );
+
+ add_char ((offset < 0 ? '-' : '+'));
+
+ if ( minutes / 600 != 0 )
+ add_char (minutes / 600 + '0');
+ else if ( pad != none )
+ add_char ((pad == zero ? '0' : ' '));
+
+ length +=
+ add_num3 (&string[length],
+ ((minutes / 60 ) % 10) * 100 + (minutes % 60),
+ max - length, pad);
+ break;
+ }
case 'Z':
#ifdef HAVE_TM_ZONE
length += add_str (&string[length], tm->tm_zone, max - length);
[View Less]
[PATCH] with-timeout does not return the result of TIMEOUT-FORMS
18 years, 5 months
Daiki Ueno
The docstring of with-timeout says that
If we give up, we run the TIMEOUT-FORMS and return the value of the last one.
The call should look like:
(with-timeout (SECONDS TIMEOUT-FORMS...) BODY...)
However, it just throws away the result of TIMEOUT-FORMS
(with-timeout (0.1 t) (sleep-for 10) nil)
=> nil
Here is a patch to fix this.
2006-07-25 Daiki Ueno <ueno(a)unixuser.org>
* timer-funcs.el (with-timeout): Return the result of
TIMEOUT-FORMS if the timeout expires.
xemacs-…
[View More]packages source patch:
Diff command: cvs -q diff -u
Files affected: xemacs-packages/xemacs-base/timer-funcs.el
Index: xemacs-packages/xemacs-base/timer-funcs.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xemacs-base/timer-funcs.el,v
retrieving revision 1.2
diff -u -r1.2 timer-funcs.el
--- xemacs-packages/xemacs-base/timer-funcs.el 11 Oct 2005 11:21:41 -0000 1.2
+++ xemacs-packages/xemacs-base/timer-funcs.el 25 Jul 2006 08:45:26 -0000
@@ -182,14 +182,14 @@
`(let ((with-timeout-tag (cons nil nil))
with-timeout-value with-timeout-timer)
(unwind-protect
- (when (catch with-timeout-tag
+ (if (catch with-timeout-tag
(progn
(setq with-timeout-timer
(start-itimer "with-timeout" #'with-timeout-handler
,seconds nil nil t with-timeout-tag))
(setq with-timeout-value (progn ,@body))
nil))
- ,@timeout-forms
+ ,@timeout-forms
with-timeout-value)
(delete-itimer with-timeout-timer)))))
--
Daiki Ueno
[View Less]
[PATCH] Handle Latin-1 in syntax.c; make guillemets string delimiters
18 years, 5 months
Aidan Kehoe
The FSF are coming gently to the conclusion, again, that the guillemets are
not parentheses. I implemented that insight in the various non-Latin-1
charsets a while ago, but never got around to doing it in the editor.
lisp/ChangeLog addition:
2006-07-29 Aidan Kehoe <kehoea(a)parhasard.net>
* iso8859-1.el:
Move the symbol table modification to three lines at the end of
syntax.c.
src/ChangeLog addition:
2006-07-29 Aidan Kehoe <kehoea(a)parhasard.net>
* syntax.c (…
[View More]Fsyntax_table_p):
Make the docstring better reflect the code.
* syntax.c (define_standard_syntax):
Take a const UExtbyte * as the first argument, not a const char *
* syntax.c (complex_vars_of_syntax):
Use a macro instead of repeating code; don't redundantly set set
the syntax of the alphanumeric characters to ?w; define syntax for
Latin 1 characters here instead of in Lisp; guillemets are string
delimiters, not parentheses.
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: src/syntax.c lisp/iso8859-1.el
Index: lisp/iso8859-1.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/iso8859-1.el,v
retrieving revision 1.3
diff -u -u -r1.3 iso8859-1.el
--- lisp/iso8859-1.el 2001/04/12 18:21:28 1.3
+++ lisp/iso8859-1.el 2006/07/29 11:29:54
@@ -1,6 +1,6 @@
-;;; iso8859-1.el --- Set case and syntax tables for Latin 1
+;;; iso8859-1.el --- Set syntax table for Latin 1
-;; Copyright (C) 1992, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1997, 2006 Free Software Foundation, Inc.
;; Author: Jamie Zawinski <jwz(a)jwz.org>
;; Created: 19-aug-92
@@ -24,124 +24,16 @@
;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
;; 02111-1307, USA.
-;;; Synched up with: Not synched
+;;; Synched up with: Not in FSF.
;;; Commentary:
;; created by jwz, 19-aug-92.
-;; Sets the case and syntax tables for the ISO-8859/1 character set.
+;; Sets the case table for the ISO-8859/1 character set.
+;; Used to set the syntax table.
;;; Code:
-(let ((table (standard-syntax-table)))
- ;;
- ;; The symbol characters
- ;;
- (modify-syntax-entry ?\240 "_" table) ; nobreakspace
- (modify-syntax-entry ?\241 "." table) ; exclamdown
- (modify-syntax-entry ?\242 "_" table) ; cent
- (modify-syntax-entry ?\243 "_" table) ; sterling
- (modify-syntax-entry ?\244 "_" table) ; currency
- (modify-syntax-entry ?\245 "_" table) ; yen
- (modify-syntax-entry ?\246 "_" table) ; brokenbar
- (modify-syntax-entry ?\247 "_" table) ; section
- (modify-syntax-entry ?\250 "_" table) ; diaeresis
- (modify-syntax-entry ?\251 "_" table) ; copyright
- (modify-syntax-entry ?\252 "_" table) ; ordfeminine
- (modify-syntax-entry ?\253 "(\273" table) ; guillemotleft
- (modify-syntax-entry ?\254 "_" table) ; notsign
- (modify-syntax-entry ?\255 "_" table) ; hyphen
- (modify-syntax-entry ?\256 "_" table) ; registered
- (modify-syntax-entry ?\257 "_" table) ; macron
- (modify-syntax-entry ?\260 "_" table) ; degree
- (modify-syntax-entry ?\261 "_" table) ; plusminus
- (modify-syntax-entry ?\262 "_" table) ; twosuperior
- (modify-syntax-entry ?\263 "_" table) ; threesuperior
- (modify-syntax-entry ?\264 "_" table) ; acute
- (modify-syntax-entry ?\265 "_" table) ; mu
- (modify-syntax-entry ?\266 "_" table) ; paragraph
- (modify-syntax-entry ?\267 "_" table) ; periodcentered
- (modify-syntax-entry ?\270 "_" table) ; cedilla
- (modify-syntax-entry ?\271 "_" table) ; onesuperior
- (modify-syntax-entry ?\272 "_" table) ; masculine
- (modify-syntax-entry ?\273 ")\253" table) ; guillemotright
- (modify-syntax-entry ?\274 "_" table) ; onequarter
- (modify-syntax-entry ?\275 "_" table) ; onehalf
- (modify-syntax-entry ?\276 "_" table) ; threequarters
- (modify-syntax-entry ?\277 "_" table) ; questiondown
- ;;
- ;; the upper-case characters (plus "multiply" and "ssharp")
- ;;
- (modify-syntax-entry ?\300 "w" table) ; Agrave
- (modify-syntax-entry ?\301 "w" table) ; Aacute
- (modify-syntax-entry ?\302 "w" table) ; Acircumflex
- (modify-syntax-entry ?\303 "w" table) ; Atilde
- (modify-syntax-entry ?\304 "w" table) ; Adiaeresis
- (modify-syntax-entry ?\305 "w" table) ; Aring
- (modify-syntax-entry ?\306 "w" table) ; AE
- (modify-syntax-entry ?\307 "w" table) ; Ccedilla
- (modify-syntax-entry ?\310 "w" table) ; Egrave
- (modify-syntax-entry ?\311 "w" table) ; Eacute
- (modify-syntax-entry ?\312 "w" table) ; Ecircumflex
- (modify-syntax-entry ?\313 "w" table) ; Ediaeresis
- (modify-syntax-entry ?\314 "w" table) ; Igrave
- (modify-syntax-entry ?\315 "w" table) ; Iacute
- (modify-syntax-entry ?\316 "w" table) ; Icircumflex
- (modify-syntax-entry ?\317 "w" table) ; Idiaeresis
- (modify-syntax-entry ?\320 "w" table) ; ETH
- (modify-syntax-entry ?\321 "w" table) ; Ntilde
- (modify-syntax-entry ?\322 "w" table) ; Ograve
- (modify-syntax-entry ?\323 "w" table) ; Oacute
- (modify-syntax-entry ?\324 "w" table) ; Ocircumflex
- (modify-syntax-entry ?\325 "w" table) ; Otilde
- (modify-syntax-entry ?\326 "w" table) ; Odiaeresis
- (modify-syntax-entry ?\327 "_" table) ; multiply
- (modify-syntax-entry ?\330 "w" table) ; Ooblique
- (modify-syntax-entry ?\331 "w" table) ; Ugrave
- (modify-syntax-entry ?\332 "w" table) ; Uacute
- (modify-syntax-entry ?\333 "w" table) ; Ucircumflex
- (modify-syntax-entry ?\334 "w" table) ; Udiaeresis
- (modify-syntax-entry ?\335 "w" table) ; Yacute
- (modify-syntax-entry ?\336 "w" table) ; THORN
- (modify-syntax-entry ?\337 "w" table) ; ssharp
- ;;
- ;; the lower-case characters (plus "division" and "ydiaeresis")
- ;;
- (modify-syntax-entry ?\340 "w" table) ; agrave
- (modify-syntax-entry ?\341 "w" table) ; aacute
- (modify-syntax-entry ?\342 "w" table) ; acircumflex
- (modify-syntax-entry ?\343 "w" table) ; atilde
- (modify-syntax-entry ?\344 "w" table) ; adiaeresis
- (modify-syntax-entry ?\345 "w" table) ; aring
- (modify-syntax-entry ?\346 "w" table) ; ae
- (modify-syntax-entry ?\347 "w" table) ; ccedilla
- (modify-syntax-entry ?\350 "w" table) ; egrave
- (modify-syntax-entry ?\351 "w" table) ; eacute
- (modify-syntax-entry ?\352 "w" table) ; ecircumflex
- (modify-syntax-entry ?\353 "w" table) ; ediaeresis
- (modify-syntax-entry ?\354 "w" table) ; igrave
- (modify-syntax-entry ?\355 "w" table) ; iacute
- (modify-syntax-entry ?\356 "w" table) ; icircumflex
- (modify-syntax-entry ?\357 "w" table) ; idiaeresis
- (modify-syntax-entry ?\360 "w" table) ; eth
- (modify-syntax-entry ?\361 "w" table) ; ntilde
- (modify-syntax-entry ?\362 "w" table) ; ograve
- (modify-syntax-entry ?\363 "w" table) ; oacute
- (modify-syntax-entry ?\364 "w" table) ; ocircumflex
- (modify-syntax-entry ?\365 "w" table) ; otilde
- (modify-syntax-entry ?\366 "w" table) ; odiaeresis
- (modify-syntax-entry ?\367 "_" table) ; division
- (modify-syntax-entry ?\370 "w" table) ; ooblique
- (modify-syntax-entry ?\371 "w" table) ; ugrave
- (modify-syntax-entry ?\372 "w" table) ; uacute
- (modify-syntax-entry ?\373 "w" table) ; ucircumflex
- (modify-syntax-entry ?\374 "w" table) ; udiaeresis
- (modify-syntax-entry ?\375 "w" table) ; yacute
- (modify-syntax-entry ?\376 "w" table) ; thorn
- (modify-syntax-entry ?\377 "w" table) ; ydiaeresis
- )
-
-
(defconst iso8859/1-case-table nil
"The case table for ISO-8859/1 characters.")
Index: src/syntax.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/syntax.c,v
retrieving revision 1.28
diff -u -u -r1.28 syntax.c
--- src/syntax.c 2006/02/22 03:30:08 1.28
+++ src/syntax.c 2006/07/29 11:29:58
@@ -146,7 +146,6 @@
DEFUN ("syntax-table-p", Fsyntax_table_p, 1, 1, 0, /*
Return t if OBJECT is a syntax table.
-Any vector of 256 elements will do.
*/
(object))
{
@@ -2451,7 +2450,7 @@
}
static void
-define_standard_syntax (const char *p, enum syntaxcode syn)
+define_standard_syntax (const UExtbyte *p, enum syntaxcode syn)
{
for (; *p; p++)
Fput_char_table (make_char (*p), make_int (syn), Vstandard_syntax_table);
@@ -2461,10 +2460,19 @@
complex_vars_of_syntax (void)
{
Ichar i;
- const char *p;
- /* Set this now, so first buffer creation can refer to it. */
- /* Make it nil before calling copy-syntax-table
- so that copy-syntax-table will know not to try to copy from garbage */
+ const UExtbyte *p; /* Latin-1, not internal format. */
+
+#define SET_RANGE_SYNTAX(start, end, syntax) \
+ do { \
+ for (i = start; i <= end; i++) \
+ Fput_char_table(make_char(i), make_int(syntax), \
+ Vstandard_syntax_table); \
+ } while (0)
+
+ /* Set this now, so first buffer creation can refer to it.
+
+ Make it nil before calling copy-syntax-table so that copy-syntax-table
+ will know not to try to copy from garbage */
Vstandard_syntax_table = Qnil;
Vstandard_syntax_table = Fcopy_syntax_table (Qnil);
staticpro (&Vstandard_syntax_table);
@@ -2476,19 +2484,18 @@
Smax);
staticpro (&Vsyntax_designator_chars_string);
+ /* Default character syntax is word. */
set_char_table_default (Vstandard_syntax_table, make_int (Sword));
+
+ /* Control 0; treat as punctuation */
+ SET_RANGE_SYNTAX(0, 32, Spunct);
- for (i = 0; i <= 32; i++) /* Control 0 plus SPACE */
- Fput_char_table (make_char (i), make_int (Swhitespace),
- Vstandard_syntax_table);
- for (i = 127; i <= 159; i++) /* DEL plus Control 1 */
- Fput_char_table (make_char (i), make_int (Swhitespace),
- Vstandard_syntax_table);
-
- define_standard_syntax ("abcdefghijklmnopqrstuvwxyz"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "0123456789"
- "$%", Sword);
+ /* The whitespace--overwriting some of the above changes. */
+ define_standard_syntax(" \t\015\014", Swhitespace);
+
+ /* DEL plus Control 1 */
+ SET_RANGE_SYNTAX(127, 159, Spunct);
+
define_standard_syntax ("\"", Sstring);
define_standard_syntax ("\\", Sescape);
define_standard_syntax ("_-+*/&|<>=", Ssymbol);
@@ -2503,4 +2510,18 @@
Fcons (make_int (Sclose), make_char (p[0])),
Vstandard_syntax_table);
}
+
+ /* Latin 1 "symbols." This contrasts with the FSF, where they're word
+ constituents. */
+ SET_RANGE_SYNTAX(0240, 0277, Ssymbol);
+
+ /* The guillemets. These are not parentheses, in contrast to what the old
+ code did. */
+ define_standard_syntax("\253\273", Sstring);
+
+ /* The inverted exclamation mark, and the multiplication and division
+ signs. */
+ define_standard_syntax("\241\327\367", Spunct);
+
+#undef SET_RANGE_SYNTAX
}
--
Santa Maradona, priez pour moi!
[View Less]
[PATCH] Raw strings, from Python via SXEmacs
18 years, 5 months
Aidan Kehoe
This patch integrates Martin Kuehl’s raw strings into XEmacs 21.5, extending
it to optionally handle Unicode escapes as does Python, and fixing a problem
that arose in lisp-interaction-mode, where raw strings were parsed as normal
strings if you did a C-j after them, becase forward-sexp couldn’t handle
them.
lisp/ChangeLog addition:
2006-07-16 Aidan Kehoe <kehoea(a)parhasard.net>
* lisp.el (forward-sexp):
Handle raw strings specially just as we do structures. Fixes
problems …
[View More]evaluating them in *scratch*.
man/ChangeLog addition:
2006-07-16 Aidan Kehoe <kehoea(a)parhasard.net>
* lispref/objects.texi (String Type):
Give details of the raw string syntax, taken from SXEmacs and
Python.
src/ChangeLog addition:
2006-07-16 Aidan Kehoe <kehoea(a)parhasard.net>
Martin Kuehl's raw string syntax, from Python via SXEmacs.
* lread.c (read_unicode_escape):
Refactor this code out from read_escape, since it's now called
from read_string as well.
* lread.c (read_escape):
Call read_unicode_escape instead of using inline code,
* lread.c (read_string):
Refactor out from read1, provide raw and honor_unicode options.
* lread.c (read_raw_string):
Added, a function that calls read_string with the correct
arguments for a raw string.
* lread.c (read1):
Pass raw strings to read_raw_string; pass strings to read_string.
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: src/lread.c man/lispref/objects.texi lisp/lisp.el
Index: lisp/lisp.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/lisp.el,v
retrieving revision 1.5
diff -u -u -r1.5 lisp.el
--- lisp/lisp.el 2001/04/12 18:21:29 1.5
+++ lisp/lisp.el 2006/07/16 17:56:06
@@ -60,19 +60,20 @@
(interactive "_p")
(or arg (setq arg 1))
;; XEmacs: evil hack! The other half of the evil hack below.
- (if (and (> arg 0) (looking-at "#s("))
- (goto-char (+ (point) 2)))
+ (if (and (> arg 0) (looking-at "#s(\\|#r[uU]\\{0,1\\}\""))
+ (goto-char (1+ (- (point) (- (match-end 0) (match-beginning 0))))))
(goto-char (or (scan-sexps (point) arg) (buffer-end arg)))
- (if (< arg 0) (backward-prefix-chars))
- ;; XEmacs: evil hack! Skip back over #s so that structures are read
- ;; properly. the current cheesified syntax tables just aren't up to
- ;; this.
- (if (and (< arg 0)
- (eq (char-after (point)) ?\()
- (>= (- (point) (point-min)) 2)
- (eq (char-after (- (point) 1)) ?s)
- (eq (char-after (- (point) 2)) ?#))
- (goto-char (- (point) 2))))
+ (when (< arg 0)
+ (backward-prefix-chars)
+ ;; XEmacs: evil hack! Skip back over #[sr] so that structures and raw
+ ;; strings are read properly. the current cheesified syntax tables just
+ ;; aren't up to this.
+ (let* ((diff (- (point) (point-min)))
+ (subject (buffer-substring (- (point) (min diff 3))
+ (1+ (point))))
+ (matched (string-match "#s(\\|#r[uU]\\{0,1\\}\"" subject)))
+ (if matched
+ (goto-char (1+ (- (point) (- (length subject) matched))))))))
(defun backward-sexp (&optional arg)
"Move backward across one balanced expression (sexp).
Index: man/lispref/objects.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/man/lispref/objects.texi,v
retrieving revision 1.8
diff -u -u -r1.8 objects.texi
--- man/lispref/objects.texi 2006/04/29 14:36:54 1.8
+++ man/lispref/objects.texi 2006/07/16 17:56:11
@@ -1079,6 +1079,16 @@
escape any backslash or double-quote characters in the string with a
backslash, like this: @code{"this \" is an embedded quote"}.
+ An alternative syntax allows insertion of raw backslashes into a
+string, like this: @code{#r"this \ is an embedded backslash"}. In such
+a string, each character following a backslash is included literally in
+the string, and all backslashes are left in the string. This means that
+@code{#r"\""} is a valid string literal with two characters, a backslash and a
+double-quote. It also means that a string with this syntax @emph{cannot end
+in a single backslash}. As with Python, from where this syntax was
+taken, you can specify @code{u} or @code{U} after the @code{#r} to
+specify that interpretation of Unicode escapes should be done.
+
The newline character is not special in the read syntax for strings;
if you write a new line between the double-quotes, it becomes a
character in the string. But an escaped newline---one that is preceded
Index: src/lread.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lread.c,v
retrieving revision 1.78
diff -u -u -r1.78 lread.c
--- src/lread.c 2006/06/03 17:50:54 1.78
+++ src/lread.c 2006/07/16 17:56:12
@@ -1670,15 +1670,56 @@
return val;
}
+
+/* A Unicode escape, as in C# (though we only permit them in strings
+ and characters, not arbitrarily in the source code.) */
+static Ichar
+read_unicode_escape (Lisp_Object readcharfun, int unicode_hex_count)
+{
+ REGISTER Ichar i = 0, c;
+ REGISTER int count = 0;
+ Lisp_Object lisp_char;
+ while (++count <= unicode_hex_count)
+ {
+ c = readchar (readcharfun);
+ /* 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;
+ else if (c >= 'A' && c <= 'F') i = (i << 4) + (c - 'A') + 10;
+ else
+ {
+ syntax_error ("Non-hex digit used for Unicode escape",
+ make_char (c));
+ break;
+ }
+ }
+
+ lisp_char = Funicode_to_char(make_int(i), Qnil);
+
+ if (EQ(Qnil, lisp_char))
+ {
+ /* This is ugly and horrible and trashes the user's data, but
+ it's what unicode.c does. In the future, unicode-to-char
+ should not return nil. */
+#ifdef MULE
+ i = make_ichar (Vcharset_japanese_jisx0208, 34 + 128, 46 + 128);
+#else
+ i = '~';
+#endif
+ return i;
+ }
+ else
+ {
+ return XCHAR(lisp_char);
+ }
+}
+
static Ichar
read_escape (Lisp_Object readcharfun)
{
/* This function can GC */
Ichar c = readchar (readcharfun);
- /* \u allows up to four hex digits, \U up to eight. Default to the
- behaviour for \u, and change this value in the case that \U is seen. */
- int unicode_hex_count = 4;
if (c < 0)
signal_error (Qend_of_file, 0, READCHARFUN_MAYBE (readcharfun));
@@ -1797,50 +1838,11 @@
}
case 'U':
/* Post-Unicode-2.0: Up to eight hex chars */
- unicode_hex_count = 8;
+ return read_unicode_escape(readcharfun, 8);
case 'u':
+ /* Unicode-2.0 and before; four hex chars. */
+ return read_unicode_escape(readcharfun, 4);
- /* A Unicode escape, as in C# (though we only permit them in strings
- and characters, not arbitrarily in the source code.) */
- {
- REGISTER Ichar i = 0;
- REGISTER int count = 0;
- Lisp_Object lisp_char;
- while (++count <= unicode_hex_count)
- {
- c = readchar (readcharfun);
- /* 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;
- else if (c >= 'A' && c <= 'F') i = (i << 4) + (c - 'A') + 10;
- else
- {
- syntax_error ("Non-hex digit used for Unicode escape",
- make_char (c));
- break;
- }
- }
-
- lisp_char = Funicode_to_char(make_int(i), Qnil);
-
- if (EQ(Qnil, lisp_char))
- {
- /* This is ugly and horrible and trashes the user's data, but
- it's what unicode.c does. In the future, unicode-to-char
- should not return nil. */
-#ifdef MULE
- i = make_ichar (Vcharset_japanese_jisx0208, 34 + 128, 46 + 128);
-#else
- i = '~';
-#endif
- return i;
- }
- else
- {
- return XCHAR(lisp_char);
- }
- }
-
default:
return c;
}
@@ -2270,6 +2272,113 @@
}
#endif
+static Lisp_Object
+read_string (Lisp_Object readcharfun, Ichar delim, int raw,
+ int honor_unicode)
+{
+#ifdef I18N3
+ /* #### If the input stream is translating, then the string
+ should be marked as translatable by setting its
+ `string-translatable' property to t. .el and .elc files
+ normally are translating input streams. See Fgettext()
+ and print_internal(). */
+#endif
+ Ichar c;
+ int cancel = 0;
+
+ Lstream_rewind(XLSTREAM(Vread_buffer_stream));
+ while ((c = readchar(readcharfun)) >= 0 && c != delim)
+ {
+ if (c == '\\')
+ {
+ if (raw)
+ {
+ c = readchar(readcharfun);
+ if (honor_unicode && ('u' == c || 'U' == c))
+ {
+ c = read_unicode_escape(readcharfun,
+ 'U' == c ? 8 : 4);
+ }
+ else
+ {
+ /* For raw strings, insert the
+ backslash and the next char, */
+ Lstream_put_ichar(XLSTREAM
+ (Vread_buffer_stream),
+ '\\');
+ }
+ }
+ else
+ /* otherwise, backslash escapes the next char. */
+ c = read_escape(readcharfun);
+ }
+ /* c is -1 if \ newline has just been seen */
+ if (c == -1)
+ {
+ if (Lstream_byte_count
+ (XLSTREAM(Vread_buffer_stream)) ==
+ 0)
+ cancel = 1;
+ }
+ else
+ Lstream_put_ichar(XLSTREAM
+ (Vread_buffer_stream),
+ c);
+ QUIT;
+ }
+ if (c < 0)
+ return Fsignal(Qend_of_file,
+ list1(READCHARFUN_MAYBE(readcharfun)));
+
+ /* If purifying, and string starts with \ newline,
+ return zero instead. This is for doc strings
+ that we are really going to find in lib-src/DOC.nn.nn */
+ if (purify_flag && NILP(Vinternal_doc_file_name)
+ && cancel)
+ return Qzero;
+
+ Lstream_flush(XLSTREAM(Vread_buffer_stream));
+ return make_string(resizing_buffer_stream_ptr
+ (XLSTREAM(Vread_buffer_stream)),
+ Lstream_byte_count(XLSTREAM(Vread_buffer_stream)));
+}
+
+static Lisp_Object
+read_raw_string (Lisp_Object readcharfun)
+{
+ Ichar c;
+ Ichar permit_unicode = 0;
+
+ do {
+ c = reader_nextchar(readcharfun);
+ switch (c) {
+ /* #r:engine"my sexy raw string" -- raw string w/ flags*/
+ /* case ':': */
+ /* #ru"Hi there\u20AC \U000020AC" -- raw string, honouring Unicode. */
+ case 'u':
+ case 'U':
+ permit_unicode = c;
+ continue;
+
+ /* #r"my raw string" -- raw string */
+ case '\"':
+ return read_string(readcharfun, '\"', 1, permit_unicode);
+ /* invalid syntax */
+ default:
+ {
+ if (permit_unicode)
+ {
+ unreadchar(readcharfun, permit_unicode);
+ }
+ unreadchar(readcharfun, c);
+ return Fsignal(Qinvalid_read_syntax,
+ list1(build_string
+ ("unrecognized raw string syntax")));
+ }
+ }
+ } while (1);
+}
+
/* Read the next Lisp object from the stream READCHARFUN and return it.
If the return value is a cons whose car is Qunbound, then read1()
encountered a misplaced token (e.g. a right bracket, right paren,
@@ -2509,6 +2618,8 @@
case 'x': return read_integer (readcharfun, 16);
/* #b010 => 2 -- binary constant syntax */
case 'b': return read_integer (readcharfun, 2);
+ /* #r"raw\stringt" -- raw string syntax */
+ case 'r': return read_raw_string(readcharfun);
/* #s(foobar key1 val1 key2 val2) -- structure syntax */
case 's': return read_structure (readcharfun);
case '<':
@@ -2654,48 +2765,8 @@
}
case '\"':
- {
- /* String */
-#ifdef I18N3
- /* #### If the input stream is translating, then the string
- should be marked as translatable by setting its
- `string-translatable' property to t. .el and .elc files
- normally are translating input streams. See Fgettext()
- and print_internal(). */
-#endif
- int cancel = 0;
-
- Lstream_rewind (XLSTREAM (Vread_buffer_stream));
- while ((c = readchar (readcharfun)) >= 0
- && c != '\"')
- {
- if (c == '\\')
- c = read_escape (readcharfun);
- /* c is -1 if \ newline has just been seen */
- if (c == -1)
- {
- if (Lstream_byte_count (XLSTREAM (Vread_buffer_stream)) == 0)
- cancel = 1;
- }
- else
- Lstream_put_ichar (XLSTREAM (Vread_buffer_stream), c);
- QUIT;
- }
- if (c < 0)
- return Fsignal (Qend_of_file, list1 (READCHARFUN_MAYBE (readcharfun)));
-
- /* If purifying, and string starts with \ newline,
- return zero instead. This is for doc strings
- that we are really going to find in lib-src/DOC.nn.nn */
- if (purify_flag && NILP (Vinternal_doc_file_name) && cancel)
- return Qzero;
-
- Lstream_flush (XLSTREAM (Vread_buffer_stream));
- return
- make_string
- (resizing_buffer_stream_ptr (XLSTREAM (Vread_buffer_stream)),
- Lstream_byte_count (XLSTREAM (Vread_buffer_stream)));
- }
+ /* String */
+ return read_string(readcharfun, '\"', 0, 1);
default:
{
--
Santa Maradona, priez pour moi!
[View Less]
[PATCH] Check dispatch_event_queue on the TTY, too.
18 years, 5 months
Aidan Kehoe
Ar an t-ochtú lá déag de mí Iúil, scríobh Stephen J. Turnbull:
> Do you mean XEmacs is running on Linux, or that the TTY is on Linux? I
> can't reproduce with XEmacs running on Linux but displaying to a Mac OS X
> Terminal.
I’ll bet your binary is built with X11 support, and Jerry’s isn’t. I can
reproduce the problem locally when I build without X11 support, so it’s not
Linux-specific; the issue is that drain_tty_devices in event-unixoid.c adds
events to dispatch_event_queue …
[View More]on a just-TTY-support build, but nothing
reads from dispatch_event_queue. Which then goes and leaks--I hope this is
the memory leak I’ve been seeing on the TTY.
src/ChangeLog addition:
2006-07-18 Aidan Kehoe <kehoea(a)parhasard.net>
* event-tty.c (emacs_tty_next_event):
Check dispatch_event_queue for pending events, since we add to
that in drain_tty_devices(). Fixes dropped key sequences on TTY
builds.
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: src/event-tty.c
Index: src/event-tty.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-tty.c,v
retrieving revision 1.16
diff -u -u -r1.16 event-tty.c
--- src/event-tty.c 2004/11/04 23:06:27 1.16
+++ src/event-tty.c 2006/07/18 18:39:23
@@ -113,6 +113,16 @@
EMACS_TIME time_to_block;
EMACS_SELECT_TIME select_time_to_block, *pointer_to_this;
+ if (!NILP (dispatch_event_queue))
+ {
+ Lisp_Object event, event2;
+ event2 = wrap_event (emacs_event);
+ event = dequeue_dispatch_event ();
+ Fcopy_event (event, event2);
+ Fdeallocate_event (event);
+ return;
+ }
+
if (!get_low_level_timeout_interval (tty_timer_queue, &time_to_block))
/* no timer events; block indefinitely */
pointer_to_this = 0;
--
Santa Maradona, priez pour moi!
[View Less]
[PACKAGES (calendar)] Remove fsf-compat dependency
18 years, 5 months
Steve Youngs
This patch removes calendar's dependence on the fsf-compat package.
Always a good thing. :-)
BTW, Jeff, I think you mentioned something about not knowing how to
get patcher to include new files...
(setq patcher-default-diff-command "cvs -q diff -uN %f")
It's all in the `N'.
calendar patch:
ChangeLog files diff command: cvs -q diff -U 0
Files affected: ChangeLog
Source files diff command: cvs -q diff -uN
Files affected: timeclock.el Makefile
Index: ChangeLog
…
[View More]===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/ChangeLog,v
retrieving revision 1.31
diff -u -p -U0 -r1.31 ChangeLog
--- ChangeLog 31 Jul 2006 02:38:09 -0000 1.31
+++ ChangeLog 31 Jul 2006 06:55:25 -0000
@@ -0,0 +1,8 @@
+2006-07-31 Steve Youngs <steve(a)sxemacs.org>
+
+ * Makefile (REQUIRES): Remove fsf-compat.
+
+ * timeclock.el (timeclock-cancel-timer): In XEmacs this is
+ `delete-itimer', in GNU/Emacs it is `cancel-timer'.
+ (timeclock-modeline-display): Use it.
+
Index: Makefile
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/Makefile,v
retrieving revision 1.30
diff -u -p -u -r1.30 Makefile
--- Makefile 31 Jul 2006 02:15:22 -0000 1.30
+++ Makefile 31 Jul 2006 06:55:16 -0000
@@ -22,7 +22,7 @@ AUTHOR_VERSION =
MAINTAINER = Jeff Miller <jeff.miller(a)xemacs.org>
PACKAGE = calendar
PKG_TYPE = regular
-REQUIRES = xemacs-base ibuffer fsf-compat
+REQUIRES = xemacs-base ibuffer
CATEGORY = standard
include ../../Local.rules.inc
Index: timeclock.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/timeclock.el,v
retrieving revision 1.1
diff -u -p -u -r1.1 timeclock.el
--- timeclock.el 31 Jul 2006 02:15:24 -0000 1.1
+++ timeclock.el 31 Jul 2006 06:55:16 -0000
@@ -77,7 +77,9 @@
;;; Code:
-(require 'timer)
+(if (featurep 'xemacs)
+ (defalias 'timeclock-cancel-timer 'delete-itimer)
+ (defalias 'timeclock-cancel-timer 'cancel-timer))
(defgroup timeclock nil
"Keeping track time of the time that gets spent."
@@ -285,7 +287,7 @@ positive. Returns the new status of tim
(unless (memq 'timeclock-update-modeline timeclock-event-hook)
(add-hook 'timeclock-event-hook 'timeclock-update-modeline))
(when timeclock-update-timer
- (cancel-timer timeclock-update-timer)
+ (timeclock-cancel-timer timeclock-update-timer)
(setq timeclock-update-timer nil))
(if (boundp 'display-time-hook)
(remove-hook 'display-time-hook 'timeclock-update-modeline))
@@ -300,7 +302,7 @@ positive. Returns the new status of tim
(remove-hook 'display-time-hook
'timeclock-update-modeline))
(when timeclock-update-timer
- (cancel-timer timeclock-update-timer)
+ (timeclock-cancel-timer timeclock-update-timer)
(setq timeclock-update-timer nil)))
(force-mode-line-update)
on-p))
--
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
| I am Dyslexic of Borg. |
| Fusistance is retile. Your arse will be laminated. |
|------------------------------------<steve(a)sxemacs.org>---|
[View Less]
[PATCH (pkgs)] More comint fixes
18 years, 5 months
Jerry James
PATCH packges
This patch fixes all the remaining comint.el bugs that have been
reported to me. Please give it a try and see if it works for you.
xemacs-packages/xemacs-base/ChangeLog addition:
2006-07-25 Jerry James <james(a)xemacs.org>
* comint.el (comint-inhibit-carriage-motion): default to t to
avoid surprises.
* comint.el (comint-snapshot-last-prompt): this function is
redundant with code in comint-output-filter. Gut it, but leave it
for now for Emacs compatibility.
* …
[View More]comint.el (comint-output-filter): Move the narrow-to-region call
above the execution of the comint-output-filter-functions hooks
like it used to be to placate current callers. Note that this is
different from the order in which Emacs does it, though, so watch
out for incompatibilities. Also, remove now useless code checking
for trouble with comint-last-prompt-extent that will never happen.
packages source patch:
Diff command: cvs -q diff -uN
Files affected: xemacs-packages/xemacs-base/comint.el
Index: xemacs-packages/xemacs-base/comint.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xemacs-base/comint.el,v
retrieving revision 1.18
diff -d -u -r1.18 comint.el
--- xemacs-packages/xemacs-base/comint.el 2006/07/11 23:45:46 1.18
+++ xemacs-packages/xemacs-base/comint.el 2006/07/25 20:44:37
@@ -1689,7 +1689,8 @@
You can use `add-hook' to add functions to this list
either globally or locally.")
-(defvar comint-inhibit-carriage-motion nil
+;; XEmacs change: don't interpret carriage control characters by default
+(defvar comint-inhibit-carriage-motion t
"If nil, Comint will interpret `carriage control' characters in output.
See `comint-carriage-motion' for details.")
@@ -1701,11 +1702,8 @@
"`snapshot' any current `comint-last-prompt-extent'.
Freeze its attributes in place, even when more input comes along
and moves the prompt extent."
- (when comint-last-prompt-extent
- (let ((inhibit-read-only t))
- (add-text-properties (extent-start-position comint-last-prompt-extent)
- (extent-end-position comint-last-prompt-extent)
- (extent-properties comint-last-prompt-extent)))))
+ ;; XEmacs change: we do this in comint-output-filter
+ t)
(defun comint-carriage-motion (start end)
"Interpret carriage control characters in the region from START to END.
@@ -1761,6 +1759,7 @@
(setq functions (cdr functions))))
;; Insert STRING
+ ;; XEmacs change: this code diverges wildly from the Emacs version
(let* ((inhibit-read-only t)
(opoint (point))
(obeg (point-min))
@@ -1795,6 +1794,7 @@
(comint-carriage-motion comint-last-output-start (point)))
;; Run these hooks with point where the user had it.
+ (narrow-to-region obeg oend)
(goto-char opoint)
(run-hook-with-args 'comint-output-filter-functions string)
(setq opoint (point))
@@ -1821,14 +1821,6 @@
prompt-start (point)
'(read-only t end-open t start-open (read-only))))
- ;; XEmacs change: if the existing prompt extent is for a
- ;; different buffer, kill it
- (unless (or (null comint-last-prompt-extent)
- (eq (extent-object comint-last-prompt-extent)
- oprocbuf))
- (delete-extent comint-last-prompt-extent)
- (setq comint-last-prompt-extent nil))
-
(unless (and (bolp) (null comint-last-prompt-extent))
;; Need to create or move the prompt extent (in the case
;; where there is no prompt ((bolp) == t), we still do
@@ -1845,7 +1837,6 @@
'font-lock-face 'comint-highlight-prompt))))
;; Put point back where the user left it
- (narrow-to-region obeg oend)
(goto-char opoint))))))
;; XEmacs: Use a variable for this so that new commands can be added easily.
--
Jerry James, Assistant Professor james(a)xemacs.org
Computer Science Department http://www.cs.usu.edu/~jerry/
Utah State University
[View Less]
Calendar fix for view other diary entries
18 years, 5 months
Jeff Miller
This patch applies on top of the 21.4 sync patch I sent in earlier
this week.
Jeff
2006-07-06 Jeff Miller <jmiller(a)cablespeed.com
* cal-menu.el (calendar-mouse-view-other-diary-entries): Fix name
of file in header of menu. Showed name of diary file, not
other diary file. Fixed typo in "from".
--- calendar/cal-xemacs.el~ 2006-06-10 22:30:20.000000000 -0400
+++ calendar/cal-xemacs.el 2006-07-20 22:48:44.000000000 -0400
@@ -337,16 +337,21 @@
(interactive)
(…
[View More]save-excursion
(let* ((date (calendar-event-to-date))
+ (diary-list-include-blanks nil)
+ (diary-display-hook 'ignore)
+ (diary-file (read-file-name
+ "Enter diary file name: "
+ default-directory nil t))
+ ; The following doesn't really do the right thing. The problem is
+ ; that a newline in the diary entry does not give a newline in a
+ ; pop-up menu; for that you need a separate list item. When the (car
+ ; (cdr x)) contains newlines, the item should be split into a list of
+ ; items. Too minor and messy to worry about.
(l (mapcar '(lambda (x) (concat (car (cdr x)) ""))
- (let ((diary-list-include-blanks nil)
- (diary-display-hook 'ignore)
- (diary-file (read-file-name
- "Enter diary file name: "
- default-directory nil t)))
- (list-diary-entries date 1))))
+ (list-diary-entries date 1)))
(menu
(cons
- (format "Diary Entries form %s for %s"
+ (format "Diary Entries from %s for %s"
diary-file
(calendar-date-string date))
(if l l '("None")))))
[View Less]