Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 100880. ------------------------------------------------------------ revno: 100880 committer: Dan Nicolaescu branch nick: trunk timestamp: Fri 2010-07-23 21:44:29 -0700 message: * src/ecrt0.c, src/unexalpha.c: Remove files, unused. diff: === removed file 'src/ecrt0.c' --- src/ecrt0.c 2010-07-06 02:22:54 +0000 +++ src/ecrt0.c 1970-01-01 00:00:00 +0000 @@ -1,95 +0,0 @@ -/* C code startup routine. - Copyright (C) 1985, 1986, 1992, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see . */ - - -/* The standard Vax 4.2 Unix crt0.c cannot be used for Emacs - because it makes `environ' an initialized variable. - It is easiest to have a special crt0.c on all machines - though I don't know whether other machines actually need it. */ - -/* On the vax and 68000, in BSD4.2 and USG5.2, - this is the data format on startup: - (vax) ap and fp are unpredictable as far as I know; don't use them. - sp -> word containing argc - word pointing to first arg string - [word pointing to next arg string]... 0 or more times - 0 -Optionally: - [word pointing to environment variable]... 1 or more times - ... - 0 -And always: - first arg string - [next arg string]... 0 or more times -*/ - -#ifdef emacs -#include -#endif - -/* ******** WARNING ******** - Do not insert any data definitions before data_start! - Since this is the first file linked, the address of the following - variable should correspond to the start of initialized data space. - On some systems this is a constant that is independent of the text - size for shared executables. On others, it is a function of the - text size. In short, this seems to be the most portable way to - discover the start of initialized data space dynamically at runtime, - for either shared or unshared executables, on either swapping or - virtual systems. It only requires that the linker allocate objects - in the order encountered, a reasonable model for most Unix systems. - Similarly, note that the address of _start() should be the start - of text space. Fred Fish, UniSoft Systems Inc. */ - -int data_start = 0; - -char **environ; - -static start1 (); - -/* Define symbol "start": here; some systems want that symbol. */ -asm(" .text "); -asm(" .globl start "); -asm(" start: "); - -_start () -{ -/* On vax, nothing is pushed here */ - start1 (); -} - -static -start1 (bogus_fp, argc, xargv) - int argc; - char *xargv; -{ - register char **argv = &xargv; - environ = argv + argc + 1; - - if ((char *)environ == xargv) - environ--; - exit (main (argc, argv, environ)); - - /* Refer to `start1' so GCC will not think it is never called - and optimize it out. */ - (void) &start1; -} - -/* arch-tag: 4025c2fb-d6b1-4d29-b1b6-8100b6bd1e74 - (do not change this comment) */ === removed file 'src/unexalpha.c' --- src/unexalpha.c 2010-07-08 04:55:07 +0000 +++ src/unexalpha.c 1970-01-01 00:00:00 +0000 @@ -1,539 +0,0 @@ -/* Unexec for DEC alpha. - - Copyright (C) 1994, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. - -Author: Rainer Schoepf - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see . */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#if !defined (__NetBSD__) && !defined (__OpenBSD__) -#include -#include -#include -#include -#ifndef __linux__ -# include -# include -#endif -#else /* __NetBSD__ or __OpenBSD__ */ -/* - * NetBSD/Alpha does not have 'normal' user-land ECOFF support because - * there's no desire to support ECOFF as the executable format in the - * long term. - */ -#include - -/* Structures, constants, etc., that NetBSD defines strangely. */ -#define filehdr ecoff_filehdr -#define aouthdr ecoff_aouthdr -#define scnhdr ecoff_scnhdr -#define HDRR struct ecoff_symhdr -#define pHDRR HDRR * -#define cbHDRR sizeof(HDRR) -#ifdef __OpenBSD__ -#define ALPHAMAGIC ECOFF_MAGIC_NATIVE_ALPHA -#else -#define ALPHAMAGIC ECOFF_MAGIC_NETBSD_ALPHA -#endif -#define ZMAGIC ECOFF_ZMAGIC - -/* Misc. constants that NetBSD doesn't define at all. */ -#define ALPHAUMAGIC 0617 -#define _MIPS_NSCNS_MAX 35 -#define STYP_TEXT 0x00000020 -#define STYP_DATA 0x00000040 -#define STYP_BSS 0x00000080 -#define STYP_RDATA 0x00000100 -#define STYP_SDATA 0x00000200 -#define STYP_SBSS 0x00000400 -#define STYP_INIT 0x80000000 -#define _TEXT ".text" -#define _DATA ".data" -#define _BSS ".bss" -#define _INIT ".init" -#define _RDATA ".rdata" -#define _SDATA ".sdata" -#define _SBSS ".sbss" -#define TEXT_START 0x120000000 -#endif /* __NetBSD__ || __OpenBSD__ */ - - -static void fatal_unexec (char *, char *); -static void mark_x (char *); - -static void update_dynamic_symbols (char *, char *, int, struct aouthdr); - -#define READ(_fd, _buffer, _size, _error_message, _error_arg) \ - errno = EEOF; \ - if (read (_fd, _buffer, _size) != _size) \ - fatal_unexec (_error_message, _error_arg); - -#define WRITE(_fd, _buffer, _size, _error_message, _error_arg) \ - if (write (_fd, _buffer, _size) != _size) \ - fatal_unexec (_error_message, _error_arg); - -#define SEEK(_fd, _position, _error_message, _error_arg) \ - errno = EEOF; \ - if (lseek (_fd, _position, L_SET) != _position) \ - fatal_unexec (_error_message, _error_arg); - -#ifdef HAVE_UNISTD_H -#include -#else -void *sbrk (); -#endif - -#define EEOF -1 - -static struct scnhdr *text_section; -static struct scnhdr *rel_dyn_section; -static struct scnhdr *dynstr_section; -static struct scnhdr *dynsym_section; -static struct scnhdr *init_section; -static struct scnhdr *finit_section; -static struct scnhdr *rdata_section; -static struct scnhdr *rconst_section; -static struct scnhdr *data_section; -static struct scnhdr *pdata_section; -static struct scnhdr *xdata_section; -static struct scnhdr *got_section; -static struct scnhdr *lit8_section; -static struct scnhdr *lit4_section; -static struct scnhdr *sdata_section; -static struct scnhdr *sbss_section; -static struct scnhdr *bss_section; - -static struct scnhdr old_data_scnhdr; - -static unsigned long Brk; - -struct headers { - struct filehdr fhdr; - struct aouthdr aout; - struct scnhdr section[_MIPS_NSCNS_MAX]; -}; - - -void -unexec (new_name, a_name, data_start, bss_start, entry_address) - char *new_name, *a_name; - unsigned long data_start, bss_start, entry_address; -{ - int new, old; - char * oldptr; - struct headers ohdr, nhdr; - struct stat stat; - long pagesize, brk; - long newsyms, symrel; - int nread; - int i; - long vaddr, scnptr; -#define BUFSIZE 8192 - char buffer[BUFSIZE]; - - if ((old = open (a_name, O_RDONLY)) < 0) - fatal_unexec ("opening %s", a_name); - - new = creat (new_name, 0666); - if (new < 0) fatal_unexec ("creating %s", new_name); - - if ((fstat (old, &stat) == -1)) - fatal_unexec ("fstat %s", a_name); - - oldptr = (char *)mmap (0, stat.st_size, PROT_READ, MAP_FILE|MAP_SHARED, old, 0); - - if (oldptr == (char *)-1) - fatal_unexec ("mmap %s", a_name); - - close (old); - - /* This is a copy of the a.out header of the original executable */ - - ohdr = (*(struct headers *)oldptr); - - /* This is where we build the new header from the in-memory copy */ - - nhdr = *((struct headers *)TEXT_START); - - /* First do some consistency checks */ - - if (nhdr.fhdr.f_magic != ALPHAMAGIC - && nhdr.fhdr.f_magic != ALPHAUMAGIC) - { - fprintf (stderr, "unexec: input file magic number is %x, not %x or %x.\n", - nhdr.fhdr.f_magic, ALPHAMAGIC, ALPHAUMAGIC); - exit (1); - } - - if (nhdr.fhdr.f_opthdr != sizeof (nhdr.aout)) - { - fprintf (stderr, "unexec: input a.out header is %d bytes, not %d.\n", - nhdr.fhdr.f_opthdr, (int)sizeof (nhdr.aout)); - exit (1); - } - if (nhdr.aout.magic != ZMAGIC) - { - fprintf (stderr, "unexec: input file a.out magic number is %o, not %o.\n", - nhdr.aout.magic, ZMAGIC); - exit (1); - } - - - /* Now check the existence of certain header section and grab - their addresses. */ - -#define CHECK_SCNHDR(ptr, name, flags) \ - ptr = NULL; \ - for (i = 0; i < nhdr.fhdr.f_nscns && !ptr; i++) \ - if (strncmp (nhdr.section[i].s_name, name, 8) == 0) \ - { \ - if (nhdr.section[i].s_flags != flags) \ - fprintf (stderr, "unexec: %x flags (%x expected) in %s section.\n", \ - nhdr.section[i].s_flags, flags, name); \ - ptr = nhdr.section + i; \ - } \ - - CHECK_SCNHDR (text_section, _TEXT, STYP_TEXT); - CHECK_SCNHDR (init_section, _INIT, STYP_INIT); -#ifdef _REL_DYN - CHECK_SCNHDR (rel_dyn_section, _REL_DYN, STYP_REL_DYN); -#endif /* _REL_DYN */ -#ifdef _DYNSYM - CHECK_SCNHDR (dynsym_section, _DYNSYM, STYP_DYNSYM); -#endif /* _REL_DYN */ -#ifdef _DYNSTR - CHECK_SCNHDR (dynstr_section, _DYNSTR, STYP_DYNSTR); -#endif /* _REL_DYN */ -#ifdef _FINI - CHECK_SCNHDR (finit_section, _FINI, STYP_FINI); -#endif /* _FINI */ - CHECK_SCNHDR (rdata_section, _RDATA, STYP_RDATA); -#ifdef _RCONST - CHECK_SCNHDR (rconst_section, _RCONST, STYP_RCONST); -#endif -#ifdef _PDATA - CHECK_SCNHDR (pdata_section, _PDATA, STYP_PDATA); -#endif /* _PDATA */ -#ifdef _GOT - CHECK_SCNHDR (got_section, _GOT, STYP_GOT); -#endif /* _GOT */ - CHECK_SCNHDR (data_section, _DATA, STYP_DATA); -#ifdef _XDATA - CHECK_SCNHDR (xdata_section, _XDATA, STYP_XDATA); -#endif /* _XDATA */ -#ifdef _LIT8 - CHECK_SCNHDR (lit8_section, _LIT8, STYP_LIT8); - CHECK_SCNHDR (lit4_section, _LIT4, STYP_LIT4); -#endif /* _LIT8 */ - CHECK_SCNHDR (sdata_section, _SDATA, STYP_SDATA); - CHECK_SCNHDR (sbss_section, _SBSS, STYP_SBSS); - CHECK_SCNHDR (bss_section, _BSS, STYP_BSS); - - - pagesize = getpagesize (); - brk = (((long) (sbrk (0))) + pagesize - 1) & (-pagesize); - - /* Remember the current break */ - - Brk = brk; - - memcpy (&old_data_scnhdr, data_section, sizeof (old_data_scnhdr)); - - nhdr.aout.dsize = brk - DATA_START; - nhdr.aout.bsize = 0; - if (entry_address == 0) - { - extern __start (); - nhdr.aout.entry = (unsigned long)__start; - } - else - nhdr.aout.entry = entry_address; - - nhdr.aout.bss_start = nhdr.aout.data_start + nhdr.aout.dsize; - - if (rdata_section != NULL) - { - rdata_section->s_size = data_start - DATA_START; - - /* Adjust start and virtual addresses of rdata_section, too. */ - rdata_section->s_vaddr = DATA_START; - rdata_section->s_paddr = DATA_START; - rdata_section->s_scnptr = text_section->s_scnptr + nhdr.aout.tsize; - } - - data_section->s_vaddr = data_start; - data_section->s_paddr = data_start; - data_section->s_size = brk - data_start; - - if (rdata_section != NULL) - { - data_section->s_scnptr = rdata_section->s_scnptr + rdata_section->s_size; - } - - vaddr = data_section->s_vaddr + data_section->s_size; - scnptr = data_section->s_scnptr + data_section->s_size; - if (lit8_section != NULL) - { - lit8_section->s_vaddr = vaddr; - lit8_section->s_paddr = vaddr; - lit8_section->s_size = 0; - lit8_section->s_scnptr = scnptr; - } - if (lit4_section != NULL) - { - lit4_section->s_vaddr = vaddr; - lit4_section->s_paddr = vaddr; - lit4_section->s_size = 0; - lit4_section->s_scnptr = scnptr; - } - if (sdata_section != NULL) - { - sdata_section->s_vaddr = vaddr; - sdata_section->s_paddr = vaddr; - sdata_section->s_size = 0; - sdata_section->s_scnptr = scnptr; - } -#ifdef _XDATA - if (xdata_section != NULL) - { - xdata_section->s_vaddr = vaddr; - xdata_section->s_paddr = vaddr; - xdata_section->s_size = 0; - xdata_section->s_scnptr = scnptr; - } -#endif -#ifdef _GOT - if (got_section != NULL) - { - memcpy (buffer, got_section, sizeof (struct scnhdr)); - - got_section->s_vaddr = vaddr; - got_section->s_paddr = vaddr; - got_section->s_size = 0; - got_section->s_scnptr = scnptr; - } -#endif /*_GOT */ - if (sbss_section != NULL) - { - sbss_section->s_vaddr = vaddr; - sbss_section->s_paddr = vaddr; - sbss_section->s_size = 0; - sbss_section->s_scnptr = scnptr; - } - if (bss_section != NULL) - { - bss_section->s_vaddr = vaddr; - bss_section->s_paddr = vaddr; - bss_section->s_size = 0; - bss_section->s_scnptr = scnptr; - } - - WRITE (new, (char *)TEXT_START, nhdr.aout.tsize, - "writing text section to %s", new_name); - WRITE (new, (char *)DATA_START, nhdr.aout.dsize, - "writing data section to %s", new_name); - -#ifdef _GOT -#define old_got_section ((struct scnhdr *)buffer) - - if (got_section != NULL) - { - SEEK (new, old_got_section->s_scnptr, - "seeking to start of got_section in %s", new_name); - WRITE (new, oldptr + old_got_section->s_scnptr, old_got_section->s_size, - "writing new got_section of %s", new_name); - SEEK (new, nhdr.aout.tsize + nhdr.aout.dsize, - "seeking to end of data section of %s", new_name); - } - -#undef old_got_section -#endif - - /* - * Construct new symbol table header - */ - - memcpy (buffer, oldptr + nhdr.fhdr.f_symptr, cbHDRR); - -#define symhdr ((pHDRR)buffer) - newsyms = nhdr.aout.tsize + nhdr.aout.dsize; - symrel = newsyms - nhdr.fhdr.f_symptr; - nhdr.fhdr.f_symptr = newsyms; - symhdr->cbLineOffset += symrel; - symhdr->cbDnOffset += symrel; - symhdr->cbPdOffset += symrel; - symhdr->cbSymOffset += symrel; - symhdr->cbOptOffset += symrel; - symhdr->cbAuxOffset += symrel; - symhdr->cbSsOffset += symrel; - symhdr->cbSsExtOffset += symrel; - symhdr->cbFdOffset += symrel; - symhdr->cbRfdOffset += symrel; - symhdr->cbExtOffset += symrel; - - WRITE (new, buffer, cbHDRR, "writing symbol table header of %s", new_name); - - /* - * Copy the symbol table and line numbers - */ - WRITE (new, oldptr + ohdr.fhdr.f_symptr + cbHDRR, - stat.st_size - ohdr.fhdr.f_symptr - cbHDRR, - "writing symbol table of %s", new_name); - -#ifdef _REL_DYN - if (rel_dyn_section) - update_dynamic_symbols (oldptr, new_name, new, nhdr.aout); -#endif - -#undef symhdr - - SEEK (new, 0, "seeking to start of header in %s", new_name); - WRITE (new, &nhdr, sizeof (nhdr), - "writing header of %s", new_name); - - close (old); - close (new); - mark_x (new_name); -} - - -static void -update_dynamic_symbols (old, new_name, new, aout) - char *old; /* Pointer to old executable */ - char *new_name; /* Name of new executable */ - int new; /* File descriptor for new executable */ - struct aouthdr aout; /* a.out info from the file header */ -{ -#if !defined (__linux__) && !defined (__NetBSD__) && !defined (__OpenBSD__) - - typedef struct dynrel_info { - char * addr; - unsigned type:8; - unsigned index:24; - unsigned info:8; - unsigned pad:8; - } dr_info; - - int nsyms = rel_dyn_section->s_size / sizeof (struct dynrel_info); - int i; - dr_info * rd_base = (dr_info *) (old + rel_dyn_section->s_scnptr); - Elf32_Sym * ds_base = (Elf32_Sym *) (old + dynsym_section->s_scnptr); - - for (i = 0; i < nsyms; i++) { - register Elf32_Sym x; - - if (rd_base[i].index == 0) - continue; - - x = ds_base[rd_base[i].index]; - -#if 0 - fprintf (stderr, "Object inspected: %s, addr = %lx, shndx = %x", - old + dynstr_section->s_scnptr + x.st_name, rd_base[i].addr, x.st_shndx); -#endif - - - if ((ELF32_ST_BIND (x.st_info) == STB_GLOBAL) - && (x.st_shndx == 0) - /* && (x.st_value == NULL) */ - ) { - /* OK, this is probably a reference to an object in a shared - library, so copy the old value. This is done in several steps: - 1. reladdr is the address of the location in question relative to - the start of the data section, - 2. oldref is the addr is the mapped in temacs executable, - 3. newref is the address of the location in question in the - undumped executable, - 4. len is the size of the object reference in bytes -- - currently only 4 (long) and 8 (quad) are supported. - */ - register unsigned long reladdr = (long)rd_base[i].addr - old_data_scnhdr.s_vaddr; - char * oldref = old + old_data_scnhdr.s_scnptr + reladdr; - unsigned long newref = aout.tsize + reladdr; - int len; - -#if 0 - fprintf (stderr, "...relocated\n"); -#endif - - if (rd_base[i].type == R_REFLONG) - len = 4; - else if (rd_base[i].type == R_REFQUAD) - len = 8; - else - fatal_unexec ("unrecognized relocation type in .dyn.rel section (symbol #%d)", (char *) i); - - SEEK (new, newref, "seeking to dynamic symbol in %s", new_name); - WRITE (new, oldref, len, "writing old dynrel info in %s", new_name); - } - -#if 0 - else - fprintf (stderr, "...not relocated\n"); -#endif - - } - -#endif /* not __linux__ and not __NetBSD__ and not __OpenBSD__ */ -} - - -/* - * mark_x - * - * After successfully building the new a.out, mark it executable - */ - -static void -mark_x (name) - char *name; -{ - struct stat sbuf; - int um = umask (777); - umask (um); - if (stat (name, &sbuf) < 0) - fatal_unexec ("getting protection on %s", name); - sbuf.st_mode |= 0111 & ~um; - if (chmod (name, sbuf.st_mode) < 0) - fatal_unexec ("setting protection on %s", name); -} - -static void -fatal_unexec (s, arg) - char *s; - char *arg; -{ - if (errno == EEOF) - fputs ("unexec: unexpected end of file, ", stderr); - else - fprintf (stderr, "unexec: %s, ", strerror (errno)); - fprintf (stderr, s, arg); - fputs (".\n", stderr); - exit (1); -} - -/* arch-tag: 46316c49-ee08-4aa3-942b-00798902f5bd - (do not change this comment) */ ------------------------------------------------------------ revno: 100879 author: Ken Brown committer: Chong Yidong branch nick: trunk timestamp: Fri 2010-07-23 21:23:07 -0400 message: * configure.in (START_FILES) [cygwin]: Set to pre-crt0.o (Bug#6715). diff: === modified file 'ChangeLog' --- ChangeLog 2010-07-20 11:13:25 +0000 +++ ChangeLog 2010-07-24 01:23:07 +0000 @@ -1,3 +1,7 @@ +2010-07-24 Ken Brown (tiny change) + + * configure.in (START_FILES) [cygwin]: Set to pre-crt0.o (Bug#6715). + 2010-07-12 Andreas Schwab * configure.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS) === modified file 'configure' --- configure 2010-07-12 14:16:38 +0000 +++ configure 2010-07-24 01:23:07 +0000 @@ -5885,7 +5885,7 @@ case $opsys in cygwin ) LIB_MATH= - START_FILES='ecrt0.o' + START_FILES='pre-crt0.o' ;; darwin ) ## Adding -lm confuses the dynamic linker, so omit it. === modified file 'configure.in' --- configure.in 2010-07-12 14:16:38 +0000 +++ configure.in 2010-07-24 01:23:07 +0000 @@ -1060,7 +1060,7 @@ case $opsys in cygwin ) LIB_MATH= - START_FILES='ecrt0.o' + START_FILES='pre-crt0.o' ;; darwin ) ## Adding -lm confuses the dynamic linker, so omit it. ------------------------------------------------------------ revno: 100878 author: Lukas Huonker committer: Stefan Monnier branch nick: trunk timestamp: Sat 2010-07-24 01:26:42 +0200 message: * lisp/play/tetris.el: Cleanup image representation and rotation. (tetris-tty-colors, tetris-x-colors, tetris-blank): Remove leading nil element, adjust values. (tetris-shapes, tetris-shape-scores): Change representation of shapes and remove some redundancy. (tetris-get-shape-cell, tetris-shape-width, tetris-draw-next-shape) (tetris-draw-shape, tetris-erase-shape, tetris-test-shape): Adjust for working with new representation of shapes. (tetris-shape-rotations): New function. (tetris-move-bottom, tetris-move-left, tetris-move-right) (tetris-rotate-prev, tetris-rotate-next): Adjust for working with the new version of tetris-test-shape. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-07-23 22:51:37 +0000 +++ lisp/ChangeLog 2010-07-23 23:26:42 +0000 @@ -1,3 +1,17 @@ +2010-07-23 Lukas Huonker + + * play/tetris.el (tetris-tty-colors, tetris-x-colors, tetris-blank): + Remove leading nil element, adjust values. + (tetris-shapes, tetris-shape-scores): + Change representation of shapes and remove some redundancy. + (tetris-get-shape-cell, tetris-shape-width, tetris-draw-next-shape) + (tetris-draw-shape, tetris-erase-shape, tetris-test-shape): + Adjust for working with new representation of shapes. + (tetris-shape-rotations): New function. + (tetris-move-bottom, tetris-move-left, tetris-move-right) + (tetris-rotate-prev, tetris-rotate-next): + Adjust for working with the new version of tetris-test-shape. + 2010-07-23 Markus Triska * progmodes/ps-mode.el: Use comint (bug#5954). === modified file 'lisp/play/tetris.el' --- lisp/play/tetris.el 2010-04-21 03:53:42 +0000 +++ lisp/play/tetris.el 2010-07-23 23:26:42 +0000 @@ -76,13 +76,12 @@ :type 'hook) (defcustom tetris-tty-colors - [nil "blue" "white" "yellow" "magenta" "cyan" "green" "red"] - "Vector of colors of the various shapes in text mode. -Element 0 is ignored." + ["blue" "white" "yellow" "magenta" "cyan" "green" "red"] + "Vector of colors of the various shapes in text mode." :group 'tetris :type (let ((names `("Shape 1" "Shape 2" "Shape 3" "Shape 4" "Shape 5" "Shape 6" "Shape 7")) - (result `(vector (const nil)))) + (result nil)) (while names (add-to-list 'result (cons 'choice @@ -96,9 +95,8 @@ result)) (defcustom tetris-x-colors - [nil [0 0 1] [0.7 0 1] [1 1 0] [1 0 1] [0 1 1] [0 1 0] [1 0 0]] - "Vector of colors of the various shapes. -Element 0 is ignored." + [[0 0 1] [0.7 0 1] [1 1 0] [1 0 1] [0 1 1] [0 1 0] [1 0 0]] + "Vector of colors of the various shapes." :group 'tetris :type 'sexp) @@ -196,51 +194,44 @@ ;; ;;;;;;;;;;;;; constants ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defconst tetris-shapes - [[[[1 1 0 0] [1 1 0 0] [1 1 0 0] [1 1 0 0]] - [[1 1 0 0] [1 1 0 0] [1 1 0 0] [1 1 0 0]] - [[0 0 0 0] [0 0 0 0] [0 0 0 0] [0 0 0 0]] - [[0 0 0 0] [0 0 0 0] [0 0 0 0] [0 0 0 0]]] - - [[[2 2 2 0] [0 2 0 0] [2 0 0 0] [2 2 0 0]] - [[0 0 2 0] [0 2 0 0] [2 2 2 0] [2 0 0 0]] - [[0 0 0 0] [2 2 0 0] [0 0 0 0] [2 0 0 0]] - [[0 0 0 0] [0 0 0 0] [0 0 0 0] [0 0 0 0]]] - - [[[3 3 3 0] [3 3 0 0] [0 0 3 0] [3 0 0 0]] - [[3 0 0 0] [0 3 0 0] [3 3 3 0] [3 0 0 0]] - [[0 0 0 0] [0 3 0 0] [0 0 0 0] [3 3 0 0]] - [[0 0 0 0] [0 0 0 0] [0 0 0 0] [0 0 0 0]]] - - [[[4 4 0 0] [0 4 0 0] [4 4 0 0] [0 4 0 0]] - [[0 4 4 0] [4 4 0 0] [0 4 4 0] [4 4 0 0]] - [[0 0 0 0] [4 0 0 0] [0 0 0 0] [4 0 0 0]] - [[0 0 0 0] [0 0 0 0] [0 0 0 0] [0 0 0 0]]] - - [[[0 5 5 0] [5 0 0 0] [0 5 5 0] [5 0 0 0]] - [[5 5 0 0] [5 5 0 0] [5 5 0 0] [5 5 0 0]] - [[0 0 0 0] [0 5 0 0] [0 0 0 0] [0 5 0 0]] - [[0 0 0 0] [0 0 0 0] [0 0 0 0] [0 0 0 0]]] - - [[[0 6 0 0] [6 0 0 0] [6 6 6 0] [0 6 0 0]] - [[6 6 6 0] [6 6 0 0] [0 6 0 0] [6 6 0 0]] - [[0 0 0 0] [6 0 0 0] [0 0 0 0] [0 6 0 0]] - [[0 0 0 0] [0 0 0 0] [0 0 0 0] [0 0 0 0]]] - - [[[7 7 7 7] [7 0 0 0] [7 7 7 7] [7 0 0 0]] - [[0 0 0 0] [7 0 0 0] [0 0 0 0] [7 0 0 0]] - [[0 0 0 0] [7 0 0 0] [0 0 0 0] [7 0 0 0]] - [[0 0 0 0] [7 0 0 0] [0 0 0 0] [7 0 0 0]]]]) + [[[[0 0] [1 0] [0 1] [1 1]]] + + [[[0 0] [1 0] [2 0] [2 1]] + [[1 -1] [1 0] [1 1] [0 1]] + [[0 -1] [0 0] [1 0] [2 0]] + [[1 -1] [2 -1] [1 0] [1 1]]] + + [[[0 0] [1 0] [2 0] [0 1]] + [[0 -1] [1 -1] [1 0] [1 1]] + [[2 -1] [0 0] [1 0] [2 0]] + [[1 -1] [1 0] [1 1] [2 1]]] + + [[[0 0] [1 0] [1 1] [2 1]] + [[1 0] [0 1] [1 1] [0 2]]] + + [[[1 0] [2 0] [0 1] [1 1]] + [[0 0] [0 1] [1 1] [1 2]]] + + [[[1 0] [0 1] [1 1] [2 1]] + [[1 0] [1 1] [2 1] [1 2]] + [[0 1] [1 1] [2 1] [1 2]] + [[1 0] [0 1] [1 1] [1 2]]] + + [[[0 0] [1 0] [2 0] [3 0]] + [[1 -1] [1 0] [1 1] [1 2]]]] + "Each shape is described by a vector that contains the coordinates of +each one of its four blocks.") ;;the scoring rules were taken from "xtetris". Blocks score differently ;;depending on their rotation (defconst tetris-shape-scores - [ [6 6 6 6] [6 7 6 7] [6 7 6 7] [6 7 6 7] [6 7 6 7] [5 5 6 5] [5 8 5 8]] ) + [[6] [6 7 6 7] [6 7 6 7] [6 7] [6 7] [5 5 6 5] [5 8]] ) (defconst tetris-shape-dimensions [[2 2] [3 2] [3 2] [3 2] [3 2] [3 2] [4 1]]) -(defconst tetris-blank 0) +(defconst tetris-blank 7) (defconst tetris-border 8) @@ -299,7 +290,7 @@ (aset options c (cond ((= c tetris-blank) tetris-blank-options) - ((and (>= c 1) (<= c 7)) + ((and (>= c 0) (<= c 6)) (append tetris-cell-options `((((glyph color-x) ,(aref tetris-x-colors c)) @@ -320,20 +311,16 @@ tetris-n-rows nil))) (and (numberp period) period)))) -(defun tetris-get-shape-cell (x y) - (aref (aref (aref (aref tetris-shapes - tetris-shape) - y) - tetris-rot) - x)) +(defun tetris-get-shape-cell (block) + (aref (aref (aref tetris-shapes + tetris-shape) tetris-rot) + block)) (defun tetris-shape-width () - (aref (aref tetris-shape-dimensions tetris-shape) - (% tetris-rot 2))) + (aref (aref tetris-shape-dimensions tetris-shape) 0)) -(defun tetris-shape-height () - (aref (aref tetris-shape-dimensions tetris-shape) - (- 1 (% tetris-rot 2)))) +(defun tetris-shape-rotations () + (length (aref tetris-shapes tetris-shape))) (defun tetris-draw-score () (let ((strings (vector (format "Shapes: %05d" tetris-n-shapes) @@ -365,52 +352,58 @@ (tetris-update-score))) (defun tetris-draw-next-shape () - (loop for y from 0 to 3 do - (loop for x from 0 to 3 do - (gamegrid-set-cell (+ tetris-next-x x) - (+ tetris-next-y y) - (let ((tetris-shape tetris-next-shape) - (tetris-rot 0)) - (tetris-get-shape-cell x y)))))) + (loop for x from 0 to 3 do + (loop for y from 0 to 3 do + (gamegrid-set-cell (+ tetris-next-x x) + (+ tetris-next-y y) + tetris-blank))) + (loop for i from 0 to 3 do + (let ((tetris-shape tetris-next-shape) + (tetris-rot 0)) + (gamegrid-set-cell (+ tetris-next-x + (aref (tetris-get-shape-cell i) 0)) + (+ tetris-next-y + (aref (tetris-get-shape-cell i) 1)) + tetris-shape)))) (defun tetris-draw-shape () - (loop for y from 0 to (1- (tetris-shape-height)) do - (loop for x from 0 to (1- (tetris-shape-width)) do - (let ((c (tetris-get-shape-cell x y))) - (if (/= c tetris-blank) - (gamegrid-set-cell (+ tetris-top-left-x - tetris-pos-x - x) - (+ tetris-top-left-y - tetris-pos-y - y) - c)))))) + (loop for i from 0 to 3 do + (let ((c (tetris-get-shape-cell i))) + (gamegrid-set-cell (+ tetris-top-left-x + tetris-pos-x + (aref c 0)) + (+ tetris-top-left-y + tetris-pos-y + (aref c 1)) + tetris-shape)))) (defun tetris-erase-shape () - (loop for y from 0 to (1- (tetris-shape-height)) do - (loop for x from 0 to (1- (tetris-shape-width)) do - (let ((c (tetris-get-shape-cell x y)) - (px (+ tetris-top-left-x tetris-pos-x x)) - (py (+ tetris-top-left-y tetris-pos-y y))) - (if (/= c tetris-blank) - (gamegrid-set-cell px py tetris-blank)))))) + (loop for i from 0 to 3 do + (let ((c (tetris-get-shape-cell i))) + (gamegrid-set-cell (+ tetris-top-left-x + tetris-pos-x + (aref c 0)) + (+ tetris-top-left-y + tetris-pos-y + (aref c 1)) + tetris-blank)))) (defun tetris-test-shape () (let ((hit nil)) - (loop for y from 0 to (1- (tetris-shape-height)) do - (loop for x from 0 to (1- (tetris-shape-width)) do - (unless hit - (setq hit - (let* ((c (tetris-get-shape-cell x y)) - (xx (+ tetris-pos-x x)) - (yy (+ tetris-pos-y y)) - (px (+ tetris-top-left-x xx)) - (py (+ tetris-top-left-y yy))) - (and (/= c tetris-blank) - (or (>= xx tetris-width) - (>= yy tetris-height) - (/= (gamegrid-get-cell px py) - tetris-blank)))))))) + (loop for i from 0 to 3 do + (unless hit + (setq hit + (let* ((c (tetris-get-shape-cell i)) + (xx (+ tetris-pos-x + (aref c 0))) + (yy (+ tetris-pos-y + (aref c 1)))) + (or (>= xx tetris-width) + (>= yy tetris-height) + (/= (gamegrid-get-cell + (+ xx tetris-top-left-x) + (+ yy tetris-top-left-y)) + tetris-blank)))))) hit)) (defun tetris-full-row (y) @@ -510,33 +503,30 @@ (defun tetris-move-bottom () "Drop the shape to the bottom of the playing area." (interactive) - (if (not tetris-paused) - (let ((hit nil)) - (tetris-erase-shape) - (while (not hit) - (setq tetris-pos-y (1+ tetris-pos-y)) - (setq hit (tetris-test-shape))) - (setq tetris-pos-y (1- tetris-pos-y)) - (tetris-draw-shape) - (tetris-shape-done)))) + (unless tetris-paused + (let ((hit nil)) + (tetris-erase-shape) + (while (not hit) + (setq tetris-pos-y (1+ tetris-pos-y)) + (setq hit (tetris-test-shape))) + (setq tetris-pos-y (1- tetris-pos-y)) + (tetris-draw-shape) + (tetris-shape-done)))) (defun tetris-move-left () "Move the shape one square to the left." (interactive) - (unless (or (= tetris-pos-x 0) - tetris-paused) + (unless tetris-paused (tetris-erase-shape) (setq tetris-pos-x (1- tetris-pos-x)) (if (tetris-test-shape) - (setq tetris-pos-x (1+ tetris-pos-x))) + (setq tetris-pos-x (1+ tetris-pos-x))) (tetris-draw-shape))) (defun tetris-move-right () "Move the shape one square to the right." (interactive) - (unless (or (= (+ tetris-pos-x (tetris-shape-width)) - tetris-width) - tetris-paused) + (unless tetris-paused (tetris-erase-shape) (setq tetris-pos-x (1+ tetris-pos-x)) (if (tetris-test-shape) @@ -546,23 +536,26 @@ (defun tetris-rotate-prev () "Rotate the shape clockwise." (interactive) - (if (not tetris-paused) - (progn (tetris-erase-shape) - (setq tetris-rot (% (+ 1 tetris-rot) 4)) - (if (tetris-test-shape) - (setq tetris-rot (% (+ 3 tetris-rot) 4))) - (tetris-draw-shape)))) + (unless tetris-paused + (tetris-erase-shape) + (setq tetris-rot (% (+ 1 tetris-rot) + (tetris-shape-rotations))) + (if (tetris-test-shape) + (setq tetris-rot (% (+ 3 tetris-rot) + (tetris-shape-rotations)))) + (tetris-draw-shape))) (defun tetris-rotate-next () "Rotate the shape anticlockwise." (interactive) - (if (not tetris-paused) - (progn + (unless tetris-paused (tetris-erase-shape) - (setq tetris-rot (% (+ 3 tetris-rot) 4)) + (setq tetris-rot (% (+ 3 tetris-rot) + (tetris-shape-rotations))) (if (tetris-test-shape) - (setq tetris-rot (% (+ 1 tetris-rot) 4))) - (tetris-draw-shape)))) + (setq tetris-rot (% (+ 1 tetris-rot) + (tetris-shape-rotations)))) + (tetris-draw-shape))) (defun tetris-end-game () "Terminate the current game." ------------------------------------------------------------ revno: 100877 author: Markus Triska committer: Stefan Monnier branch nick: trunk timestamp: Sat 2010-07-24 00:51:37 +0200 message: * lisp/progmodes/ps-mode.el: Use comint. (ps-run-mode-map): Adapt for comint-mode; omit "\r", [return].. (ps-mode-other-newline): Simplify. (ps-run-mode): Derive from comint-mode instead of fundamental-mode, yielding input history etc. (ps-run-start, ps-run-quit, ps-run-clear, ps-run-region) (ps-run-send-string): Adapt for comint-mode. (ps-run-newline): Remove now unneeded function. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-07-23 13:58:52 +0000 +++ lisp/ChangeLog 2010-07-23 22:51:37 +0000 @@ -1,3 +1,14 @@ +2010-07-23 Markus Triska + + * progmodes/ps-mode.el: Use comint (bug#5954). + (ps-run-mode-map): Adapt for comint-mode; omit "\r", [return].. + (ps-mode-other-newline): Simplify. + (ps-run-mode): Derive from comint-mode instead of + fundamental-mode, yielding input history etc. + (ps-run-start, ps-run-quit, ps-run-clear, ps-run-region) + (ps-run-send-string): Adapt for comint-mode. + (ps-run-newline): Remove now unneeded function. + 2010-07-23 Michael Albinus * net/tramp.el (tramp-methods): Move hostname to the end in all === modified file 'lisp/progmodes/ps-mode.el' --- lisp/progmodes/ps-mode.el 2010-05-25 02:11:08 +0000 +++ lisp/progmodes/ps-mode.el 2010-07-23 22:51:37 +0000 @@ -39,6 +39,7 @@ (defconst ps-mode-version "1.1h, 16 Jun 2005") (defconst ps-mode-maintainer-address "Peter Kleiweg ") +(require 'comint) (require 'easymenu) ;; Define core `PostScript' group. @@ -431,12 +432,11 @@ (unless ps-run-mode-map (setq ps-run-mode-map (make-sparse-keymap)) + (set-keymap-parent ps-run-mode-map comint-mode-map) (define-key ps-run-mode-map "\C-c\C-q" 'ps-run-quit) (define-key ps-run-mode-map "\C-c\C-k" 'ps-run-kill) (define-key ps-run-mode-map "\C-c\C-e" 'ps-run-goto-error) - (define-key ps-run-mode-map [mouse-2] 'ps-run-mouse-goto-error) - (define-key ps-run-mode-map "\r" 'ps-run-newline) - (define-key ps-run-mode-map [return] 'ps-run-newline)) + (define-key ps-run-mode-map [mouse-2] 'ps-run-mouse-goto-error)) ;; Syntax table. @@ -718,12 +718,9 @@ (blink-matching-open)) (defun ps-mode-other-newline () - "Perform newline in `*ps run*' buffer." + "Perform newline in `*ps-run*' buffer." (interactive) - (let ((buf (current-buffer))) - (set-buffer "*ps run*") - (ps-run-newline) - (set-buffer buf))) + (ps-run-send-string "")) ;; Print PostScript. @@ -980,7 +977,7 @@ ;; Interactive PostScript interpreter. -(define-derived-mode ps-run-mode fundamental-mode "Interactive PS" +(define-derived-mode ps-run-mode comint-mode "Interactive PS" "Major mode in interactive PostScript window. This mode is invoked from `ps-mode' and should not be called directly. @@ -1014,20 +1011,23 @@ (setq init-file (ps-run-make-tmp-filename)) (write-region (concat ps-run-init "\n") 0 init-file) (setq init-file (list init-file))) - (pop-to-buffer "*ps run*") + (pop-to-buffer "*ps-run*") (ps-run-mode) (when (process-status "ps-run") (delete-process "ps-run")) (erase-buffer) (setq command (append command init-file)) (insert (mapconcat 'identity command " ") "\n") - (apply 'start-process "ps-run" "*ps run*" command) + (apply 'make-comint "ps-run" (car command) nil (cdr command)) + (with-current-buffer "*ps-run*" + (use-local-map ps-run-mode-map) + (setq comint-prompt-regexp ps-run-prompt)) (select-window oldwin))) (defun ps-run-quit () "Quit interactive PostScript." (interactive) - (ps-run-send-string "quit" t) + (ps-run-send-string "quit") (ps-run-cleanup)) (defun ps-run-kill () @@ -1039,9 +1039,9 @@ (defun ps-run-clear () "Clear/reset PostScript graphics." (interactive) - (ps-run-send-string "showpage" t) + (ps-run-send-string "showpage") (sit-for 1) - (ps-run-send-string "" t)) + (ps-run-send-string "")) (defun ps-run-buffer () "Send buffer to PostScript interpreter." @@ -1056,7 +1056,7 @@ (let ((f (ps-run-make-tmp-filename))) (set-marker ps-run-mark begin) (write-region begin end f) - (ps-run-send-string (format "(%s) run" f) t))) + (ps-run-send-string (format "(%s) run" f)))) (defun ps-run-boundingbox () "View BoundingBox." @@ -1104,17 +1104,15 @@ " x1 y1 x2 y1 x2 y2 x1 y2) 0 f) - (ps-run-send-string (format "(%s) run" f) t) + (ps-run-send-string (format "(%s) run" f)) (set-buffer buf))) -(defun ps-run-send-string (string &optional echo) +(defun ps-run-send-string (string) (let ((oldwin (selected-window))) - (pop-to-buffer "*ps run*") - (goto-char (point-max)) - (when echo - (insert string "\n")) - (set-marker (process-mark (get-process "ps-run")) (point)) - (process-send-string "ps-run" (concat string "\n")) + (pop-to-buffer "*ps-run*") + (comint-goto-process-mark) + (insert string) + (comint-send-input) (select-window oldwin))) (defun ps-run-make-tmp-filename () @@ -1140,18 +1138,6 @@ (mouse-set-point event) (ps-run-goto-error)) -(defun ps-run-newline () - "Process newline in PostScript interpreter window." - (interactive) - (end-of-line) - (insert "\n") - (forward-line -1) - (when (looking-at ps-run-prompt) - (goto-char (match-end 0))) - (looking-at ".*") - (goto-char (1+ (match-end 0))) - (ps-run-send-string (buffer-substring (match-beginning 0) (match-end 0)))) - (defun ps-run-goto-error () "Jump to buffer position read as integer at point. Use line numbers if `ps-run-error-line-numbers' is not nil" ------------------------------------------------------------ revno: 100876 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2010-07-23 19:50:14 +0200 message: Remove unused static functions. * alloc.c (free_float) * font.c [ENABLE_CHECKING] (font_match_xlfd, font_check_xlfd_parse) * frame.c (delete_frame_handler) * ralloc.c (reorder_bloc) * w32menu.c (menubar_id_to_frame, add_left_right_boundary) diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-23 10:32:02 +0000 +++ src/ChangeLog 2010-07-23 17:50:14 +0000 @@ -1,5 +1,12 @@ 2010-07-23 Juanma Barranquero + * alloc.c (free_float): + * font.c [ENABLE_CHECKING] (font_match_xlfd, font_check_xlfd_parse): + * frame.c (delete_frame_handler): + * ralloc.c (reorder_bloc): + * w32menu.c (menubar_id_to_frame, add_left_right_boundary): + Remove unused static functions. + * menu.c (cleanup_popup_menu): Set inside "#ifdef HAVE_NS"; it is called only from NS code. === modified file 'src/alloc.c' --- src/alloc.c 2010-07-20 20:21:03 +0000 +++ src/alloc.c 2010-07-23 17:50:14 +0000 @@ -2538,16 +2538,6 @@ } -/* Explicitly free a float cell by putting it on the free-list. */ - -static void -free_float (struct Lisp_Float *ptr) -{ - ptr->u.chain = float_free_list; - float_free_list = ptr; -} - - /* Return a new float object with value FLOAT_VALUE. */ Lisp_Object === modified file 'src/font.c' --- src/font.c 2010-07-14 03:40:47 +0000 +++ src/font.c 2010-07-23 17:50:14 +0000 @@ -980,39 +980,6 @@ } -#ifdef ENABLE_CHECKING -/* Match a 14-field XLFD pattern against a full XLFD font name. */ -static int -font_match_xlfd (char *pattern, char *name) -{ - while (*pattern && *name) - { - if (*pattern == *name) - pattern++; - else if (*pattern == '*') - if (*name == pattern[1]) - pattern += 2; - else - ; - else - return 0; - name++; - } - return 1; -} - -/* Make sure the font object matches the XLFD font name. */ -static int -font_check_xlfd_parse (Lisp_Object font, char *name) -{ - char name_check[256]; - font_unparse_xlfd (font, 0, name_check, 255); - return font_match_xlfd (name_check, name); -} - -#endif - - /* Parse NAME (null terminated) as XLFD and store information in FONT (font-spec or font-entity). Size property of FONT is set as follows: === modified file 'src/frame.c' --- src/frame.c 2010-07-17 18:34:44 +0000 +++ src/frame.c 2010-07-23 17:50:14 +0000 @@ -1280,14 +1280,6 @@ return 1; } -/* Error handler for `delete-frame-functions'. */ -static Lisp_Object -delete_frame_handler (Lisp_Object arg) -{ - add_to_log ("Error during `delete-frame': %s", arg, Qnil); - return Qnil; -} - extern Lisp_Object Qrun_hook_with_args; /* Delete FRAME. When FORCE equals Qnoelisp, delete FRAME @@ -1299,7 +1291,7 @@ /* If we use `register' here, gcc-4.0.2 on amd64 using -DUSE_LISP_UNION_TYPE complains further down that we're getting the address of `force'. Go figure. */ - + { struct frame *f; struct frame *sf = SELECTED_FRAME (); === modified file 'src/ralloc.c' --- src/ralloc.c 2010-07-07 22:18:28 +0000 +++ src/ralloc.c 2010-07-23 17:50:14 +0000 @@ -519,35 +519,6 @@ return 1; } - -/* Reorder the bloc BLOC to go before bloc BEFORE in the doubly linked list. - This is necessary if we put the memory of space of BLOC - before that of BEFORE. */ - -static void -reorder_bloc (bloc_ptr bloc, bloc_ptr before) -{ - bloc_ptr prev, next; - - /* Splice BLOC out from where it is. */ - prev = bloc->prev; - next = bloc->next; - - if (prev) - prev->next = next; - if (next) - next->prev = prev; - - /* Splice it in before BEFORE. */ - prev = before->prev; - - if (prev) - prev->next = bloc; - bloc->prev = prev; - - before->prev = bloc; - bloc->next = before; -} /* Update the records of which heaps contain which blocs, starting with heap HEAP and bloc BLOC. */ === modified file 'src/w32menu.c' --- src/w32menu.c 2010-07-08 21:25:08 +0000 +++ src/w32menu.c 2010-07-23 17:50:14 +0000 @@ -111,30 +111,6 @@ int pending_menu_activation; - -/* Return the frame whose ->output_data.w32->menubar_widget equals - ID, or 0 if none. */ - -static struct frame * -menubar_id_to_frame (HMENU id) -{ - Lisp_Object tail, frame; - FRAME_PTR f; - - for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) - { - frame = XCAR (tail); - if (!FRAMEP (frame)) - continue; - f = XFRAME (frame); - if (!FRAME_WINDOW_P (f)) - continue; - if (f->output_data.w32->menubar_widget == id) - return f; - } - return 0; -} - #ifdef HAVE_MENUS DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0, @@ -1316,14 +1292,6 @@ return (*name == '\0' || start + 2 == name); } - -/* Indicate boundary between left and right. */ -static int -add_left_right_boundary (HMENU menu) -{ - return AppendMenu (menu, MF_MENUBARBREAK, 0, NULL); -} - /* UTF8: 0xxxxxxx, 110xxxxx 10xxxxxx, 1110xxxx, 10xxxxxx, 10xxxxxx */ static void utf8to16 (unsigned char * src, int len, WCHAR * dest) ------------------------------------------------------------ revno: 100875 committer: Michael Albinus branch nick: trunk timestamp: Fri 2010-07-23 15:58:52 +0200 message: * net/tramp.el (tramp-methods): Move hostname to the end in all plink `tramp-login-args'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-07-23 13:40:33 +0000 +++ lisp/ChangeLog 2010-07-23 13:58:52 +0000 @@ -1,5 +1,10 @@ 2010-07-23 Michael Albinus + * net/tramp.el (tramp-methods): Move hostname to the end in all + plink `tramp-login-args'. + +2010-07-23 Michael Albinus + * net/tramp.el (tramp-open-shell): New defun. (tramp-find-shell, tramp-open-connection-setup-interactive-shell): Use it. === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2010-07-23 13:40:33 +0000 +++ lisp/net/tramp.el 2010-07-23 13:58:52 +0000 @@ -599,8 +599,8 @@ (tramp-copy-keep-date nil) (tramp-password-end-of-line nil)) ("plink" (tramp-login-program "plink") - (tramp-login-args (("%h") ("-l" "%u") ("-P" "%p") - ("-ssh"))) + (tramp-login-args (("-l" "%u") ("-P" "%p") + ("-ssh") ("%h"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program nil) (tramp-copy-args nil) @@ -609,8 +609,8 @@ (tramp-default-port 22)) ("plink1" (tramp-login-program "plink") - (tramp-login-args (("%h") ("-l" "%u") ("-P" "%p") - ("-1" "-ssh"))) + (tramp-login-args (("-l" "%u") ("-P" "%p") + ("-1" "-ssh") ("%h"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program nil) (tramp-copy-args nil) @@ -633,8 +633,8 @@ (tramp-copy-keep-date nil) (tramp-password-end-of-line nil)) ("pscp" (tramp-login-program "plink") - (tramp-login-args (("%h") ("-l" "%u") ("-P" "%p") - ("-ssh"))) + (tramp-login-args (("-l" "%u") ("-P" "%p") + ("-ssh") ("%h"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "pscp") (tramp-copy-args (("-P" "%p") ("-scp") ("-p" "%k"))) @@ -642,8 +642,8 @@ (tramp-password-end-of-line "xy") ;see docstring for "xy" (tramp-default-port 22)) ("psftp" (tramp-login-program "plink") - (tramp-login-args (("%h") ("-l" "%u") ("-P" "%p") - ("-ssh"))) + (tramp-login-args (("-l" "%u") ("-P" "%p") + ("-ssh") ("%h"))) (tramp-remote-sh "/bin/sh") (tramp-copy-program "pscp") (tramp-copy-args (("-P" "%p") ("-sftp") ("-p" "%k"))) ------------------------------------------------------------ revno: 100874 committer: Michael Albinus branch nick: trunk timestamp: Fri 2010-07-23 15:40:33 +0200 message: * net/tramp.el (tramp-open-shell): New defun. (tramp-find-shell, tramp-open-connection-setup-interactive-shell): Use it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-07-23 13:31:56 +0000 +++ lisp/ChangeLog 2010-07-23 13:40:33 +0000 @@ -1,5 +1,11 @@ 2010-07-23 Michael Albinus + * net/tramp.el (tramp-open-shell): New defun. + (tramp-find-shell, tramp-open-connection-setup-interactive-shell): + Use it. + +2010-07-23 Michael Albinus + * net/tramp.el (tramp-file-name-regexp-unified) (tramp-completion-file-name-regexp-unified): On W32 systems, do not regard the volume letter as remote filename. (Bug#5447) === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2010-07-23 13:31:56 +0000 +++ lisp/net/tramp.el 2010-07-23 13:40:33 +0000 @@ -6598,7 +6598,29 @@ vec 'file-error "Couldn't find command to check if file exists")) result)) -;; CCC test ksh or bash found for tilde expansion? +(defun tramp-open-shell (vec shell) + "Opens shell SHELL." + (with-progress-reporter vec 5 (format "Opening remote shell `%s'" shell) + ;; Find arguments for this shell. + (let ((tramp-end-of-output tramp-initial-end-of-output) + (alist tramp-sh-extra-args) + item extra-args) + (while (and alist (null extra-args)) + (setq item (pop alist)) + (when (string-match (car item) shell) + (setq extra-args (cdr item)))) + (when extra-args (setq shell (concat shell " " extra-args))) + (tramp-send-command + vec (format "exec env ENV='' PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s" + (shell-quote-argument tramp-end-of-output) shell) + t)) + ;; Setting prompts. + (tramp-send-command + vec (format "PS1=%s" (shell-quote-argument tramp-end-of-output)) t) + (tramp-send-command vec "PS2=''" t) + (tramp-send-command vec "PS3=''" t) + (tramp-send-command vec "PROMPT_COMMAND=''" t))) + (defun tramp-find-shell (vec) "Opens a shell on the remote host which groks tilde expansion." (unless (tramp-get-connection-property vec "remote-shell" nil) @@ -6619,29 +6641,9 @@ (tramp-error vec 'file-error "Couldn't find a shell which groks tilde expansion")) - ;; Find arguments for this shell. - (let ((alist tramp-sh-extra-args) - item extra-args) - (while (and alist (null extra-args)) - (setq item (pop alist)) - (when (string-match (car item) shell) - (setq extra-args (cdr item)))) - (when extra-args (setq shell (concat shell " " extra-args)))) (tramp-message vec 5 "Starting remote shell `%s' for tilde expansion" shell) - (let ((tramp-end-of-output tramp-initial-end-of-output)) - (tramp-send-command - vec - (format "PROMPT_COMMAND='' PS1=%s PS2='' PS3='' exec %s" - (shell-quote-argument tramp-end-of-output) shell) - t)) - ;; Setting prompts. - (with-progress-reporter vec 5 (format "Setting remote shell prompt") - (tramp-send-command - vec (format "PS1=%s" (shell-quote-argument tramp-end-of-output)) t) - (tramp-send-command vec "PS2=''" t) - (tramp-send-command vec "PS3=''" t) - (tramp-send-command vec "PROMPT_COMMAND=''" t))) + (tramp-open-shell vec shell)) (t (tramp-message vec 5 "Remote `%s' groks tilde expansion, good" @@ -6922,14 +6924,9 @@ ;; way, we avoid the startup file clobbering $PS1. $PROMP_COMMAND ;; is another way to set the prompt in /bin/bash, it must be ;; discarded as well. - (tramp-send-command + (tramp-open-shell vec - (format - "exec env ENV='' PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s" - (shell-quote-argument tramp-end-of-output) - (tramp-get-method-parameter - (tramp-file-name-method vec) 'tramp-remote-sh)) - t) + (tramp-get-method-parameter (tramp-file-name-method vec) 'tramp-remote-sh)) ;; Disable echo. (tramp-message vec 5 "Setting up remote shell environment") @@ -7045,7 +7042,7 @@ ;; "echo $?" part if the "test" part has an error. In particular, ;; the OpenSolaris /bin/sh is a problem. There are also other ;; problems with /bin/sh of OpenSolaris, like redirection of stderr - ;; in in function declarations, or changing HISTFILE in place. + ;; in function declarations, or changing HISTFILE in place. ;; Therefore, OpenSolaris' /bin/sh is replaced by bash, when ;; detected. (tramp-find-shell vec) @@ -8890,7 +8887,6 @@ ;; likely to produce long command lines, and some shells choke on ;; long command lines. ;; * How to deal with MULE in `insert-file-contents' and `write-region'? -;; * Test remote ksh or bash for tilde expansion in `tramp-find-shell'? ;; * abbreviate-file-name ;; * Better error checking. At least whenever we see something ;; strange when doing zerop, we should kill the process and start ------------------------------------------------------------ revno: 100873 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2010-07-23 15:35:51 +0200 message: * make-docfile.c (write_c_args): Correctly handle prefixes of "defalt". diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2010-07-20 20:21:03 +0000 +++ lib-src/ChangeLog 2010-07-23 13:35:51 +0000 @@ -1,3 +1,7 @@ +2010-07-23 Juanma Barranquero + + * make-docfile.c (write_c_args): Correctly handle prefixes of "defalt". + 2010-07-20 Juanma Barranquero * emacsclient.c (get_current_dir_name, w32_get_resource) === modified file 'lib-src/make-docfile.c' --- lib-src/make-docfile.c 2010-07-09 17:00:04 +0000 +++ lib-src/make-docfile.c 2010-07-23 13:35:51 +0000 @@ -488,7 +488,7 @@ /* In C code, `default' is a reserved word, so we spell it `defalt'; unmangle that here. */ - if (strncmp (ident_start, "defalt", ident_length) == 0) + if (ident_length == 6 && strncmp (ident_start, "defalt", 6) == 0) fprintf (out, "DEFAULT"); else while (ident_length-- > 0) ------------------------------------------------------------ revno: 100872 committer: Michael Albinus branch nick: trunk timestamp: Fri 2010-07-23 15:31:56 +0200 message: * net/tramp.el (tramp-file-name-regexp-unified) (tramp-completion-file-name-regexp-unified): On W32 systems, do not regard the volume letter as remote filename. (Bug#5447) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-07-23 01:39:20 +0000 +++ lisp/ChangeLog 2010-07-23 13:31:56 +0000 @@ -1,3 +1,9 @@ +2010-07-23 Michael Albinus + + * net/tramp.el (tramp-file-name-regexp-unified) + (tramp-completion-file-name-regexp-unified): On W32 systems, do + not regard the volume letter as remote filename. (Bug#5447) + 2010-07-23 Juanma Barranquero * custom.el (custom-declare-variable): Give a clearer error message === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2010-07-21 04:40:47 +0000 +++ lisp/net/tramp.el 2010-07-23 13:31:56 +0000 @@ -1444,10 +1444,14 @@ ;;;###autoload (defconst tramp-file-name-regexp-unified - "\\`/\\([^[/:]+\\|[^/]+]\\):" + (if (memq system-type '(cygwin windows-nt)) + "\\`/\\([^[/:]\\{2,\\}\\|[^/]\\{2,\\}]\\):" + "\\`/\\([^[/:]+\\|[^/]+]\\):") "Value for `tramp-file-name-regexp' for unified remoting. Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and -Tramp. See `tramp-file-name-structure' for more explanations.") +Tramp. See `tramp-file-name-structure' for more explanations. + +On W32 systems, the volume letter must be ignored.") ;;;###autoload (defconst tramp-file-name-regexp-separate @@ -1494,10 +1498,14 @@ ;;;###autoload (defconst tramp-completion-file-name-regexp-unified - (concat tramp-root-regexp "[^/]*\\'") + (if (memq system-type '(cygwin windows-nt)) + (concat tramp-root-regexp "[^/]\\{2,\\}\\'") + (concat tramp-root-regexp "[^/]*\\'")) "Value for `tramp-completion-file-name-regexp' for unified remoting. GNU Emacs uses a unified filename syntax for Tramp and Ange-FTP. -See `tramp-file-name-structure' for more explanations.") +See `tramp-file-name-structure' for more explanations. + +On W32 systems, the volume letter must be ignored.") ;;;###autoload (defconst tramp-completion-file-name-regexp-separate @@ -8953,7 +8961,6 @@ ;; expects English? Or just to set LC_MESSAGES to "C" if Tramp ;; expects only English messages? (Juri Linkov) ;; * Make shadowfile.el grok Tramp filenames. (Bug#4526, Bug#4846) -;; * Do not handle files with drive letter as remote. (Bug#5447) ;; * Load Tramp subpackages only when needed. (Bug#1529, Bug#5448, Bug#5705) ;; * Try telnet+curl as new method. It might be useful for busybox, ;; without built-in uuencode/uudecode. ------------------------------------------------------------ revno: 100871 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2010-07-23 12:32:02 +0200 message: * menu.c (cleanup_popup_menu): Set inside "#ifdef HAVE_NS". diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-23 10:09:27 +0000 +++ src/ChangeLog 2010-07-23 10:32:02 +0000 @@ -1,5 +1,8 @@ 2010-07-23 Juanma Barranquero + * menu.c (cleanup_popup_menu): Set inside "#ifdef HAVE_NS"; + it is called only from NS code. + * w32term.c (my_set_focus): #ifdef away; it is called only from "#ifdef 0" code. === modified file 'src/menu.c' --- src/menu.c 2010-07-08 21:25:08 +0000 +++ src/menu.c 2010-07-23 10:32:02 +0000 @@ -133,12 +133,14 @@ xassert (NILP (menu_items_inuse)); } +#ifdef HAVE_NS static Lisp_Object cleanup_popup_menu (Lisp_Object arg) { discard_menu_items (); return Qnil; } +#endif /* This undoes save_menu_items, and it is called by the specpdl unwind mechanism. */ ------------------------------------------------------------ revno: 100870 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2010-07-23 12:09:27 +0200 message: * w32term.c (my_set_focus): #ifdef away; currently not used. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-23 09:52:32 +0000 +++ src/ChangeLog 2010-07-23 10:09:27 +0000 @@ -1,5 +1,8 @@ 2010-07-23 Juanma Barranquero + * w32term.c (my_set_focus): #ifdef away; it is called only from + "#ifdef 0" code. + * w32fns.c (x_edge_detection): * xfaces.c (may_use_scalable_font_p): Remove obsolete static declarations. === modified file 'src/w32term.c' --- src/w32term.c 2010-07-20 20:21:03 +0000 +++ src/w32term.c 2010-07-23 10:09:27 +0000 @@ -3366,12 +3366,14 @@ #endif } +#if 0 static void my_set_focus (struct frame * f, HWND hwnd) { SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_SETFOCUS, (WPARAM) hwnd, 0); } +#endif static void my_set_foreground_window (HWND hwnd) ------------------------------------------------------------ revno: 100869 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2010-07-23 11:52:32 +0200 message: * w32fns.c, xfaces.c: Remove obsolete static declarations. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-07-20 20:21:03 +0000 +++ src/ChangeLog 2010-07-23 09:52:32 +0000 @@ -1,3 +1,9 @@ +2010-07-23 Juanma Barranquero + + * w32fns.c (x_edge_detection): + * xfaces.c (may_use_scalable_font_p): + Remove obsolete static declarations. + 2010-07-20 Juanma Barranquero * alloc.c (emacs_blocked_free, emacs_blocked_malloc) === modified file 'src/w32fns.c' --- src/w32fns.c 2010-07-16 15:42:15 +0000 +++ src/w32fns.c 2010-07-23 09:52:32 +0000 @@ -439,8 +439,6 @@ void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object); void x_set_title (struct frame *, Lisp_Object, Lisp_Object); void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object); -static void x_edge_detection (struct frame *, struct image *, Lisp_Object, - Lisp_Object); === modified file 'src/xfaces.c' --- src/xfaces.c 2010-07-20 20:21:03 +0000 +++ src/xfaces.c 2010-07-23 09:52:32 +0000 @@ -513,7 +513,6 @@ static void map_tty_color (struct frame *, struct face *, enum lface_attribute_index, int *); static Lisp_Object resolve_face_name (Lisp_Object, int); -static int may_use_scalable_font_p (const char *); static void set_font_frame_param (Lisp_Object, Lisp_Object); static int get_lface_attributes (struct frame *, Lisp_Object, Lisp_Object *, int, struct named_merge_point *); ------------------------------------------------------------ revno: 100868 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2010-07-23 03:39:20 +0200 message: * lisp/ChangeLog: Fix typos. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-07-23 01:29:46 +0000 +++ lisp/ChangeLog 2010-07-23 01:39:20 +0000 @@ -182,7 +182,7 @@ 2010-07-14 Jan Djärv * xt-mouse.el (xterm-mouse-event-read): Fix for characters > 127 - now that unicode is used (Bug#6594). + now that Unicode is used (Bug#6594). 2010-07-14 Chong Yidong @@ -259,15 +259,15 @@ 2010-07-12 Andreas Schwab - * language/tai-viet.el ("TaiViet"): Try to fix re-encoding - bugs. (Bug#5806) + * language/tai-viet.el ("TaiViet"): Try to fix re-encoding bugs. + (Bug#5806) * language/tv-util.el (tai-viet-re): Remove format. 2010-07-12 Kenichi Handa - * language/hebrew.el: Remove no-byte-compile declaration. Change - coding: tag to utf-8. Register hebrew-shape-gstring in + * language/hebrew.el: Remove no-byte-compile declaration. + Change coding: tag to utf-8. Register hebrew-shape-gstring in composition-function-table for 3-character looking back. (hebrew-font-get-precomposed): New function. (hebrew-shape-gstring): Utilize precomposed glyphs if available. @@ -484,7 +484,7 @@ Make sure `flyspell-word' re-checks word after function run (Bug#6504). * textmodes/ispell.el (ispell-init-process): Make sure ispell and - default directories are expanded. (Bug#6143). + default directories are expanded (Bug#6143). 2010-06-24 Juri Linkov @@ -767,7 +767,7 @@ 2010-06-16 Jay Belanger - * calc/calc-poly.el: (math-accum-factors): Make sure that + * calc/calc-poly.el (math-accum-factors): Make sure that constants aren't distributed after they are factored out. 2010-06-16 Juri Linkov @@ -4604,7 +4604,7 @@ 2010-02-03 Michael Albinus * net/ange-ftp.el (ange-ftp-insert-directory): Parse directory - also in case of (and (not full) (not wildcard)). This is needed, + also in case of (and (not full) (not wildcard)). This is needed when dired is called with a list of files, which are not in `default-directory'. (Bug#5478) @@ -11093,7 +11093,7 @@ * textmodes/fill.el: Convert to utf-8 encoding. (fill-french-nobreak-p): Remove redundant » and « inherited from our - pre-unicode days. + pre-Unicode days. * add-log.el (change-log-fill-forward-paragraph): New function. (change-log-mode): Use it so fill-region DTRT.