------------------------------------------------------------ revno: 115240 committer: Andreas Schwab branch nick: emacs timestamp: Tue 2013-11-26 10:00:32 +0100 message: * .gdbinit (xgettype): Add cast. diff: === modified file 'src/.gdbinit' --- src/.gdbinit 2013-06-03 09:01:53 +0000 +++ src/.gdbinit 2013-11-26 09:00:32 +0000 @@ -67,7 +67,7 @@ else set $bugfix = $arg0 end - set $type = (enum Lisp_Type) (USE_LSB_TAG ? $bugfix & (1 << GCTYPEBITS) - 1 : $bugfix >> VALBITS) + set $type = (enum Lisp_Type) (USE_LSB_TAG ? $bugfix & (1 << GCTYPEBITS) - 1 : (EMACS_UINT) $bugfix >> VALBITS) end # Set up something to print out s-expressions. === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-26 01:06:23 +0000 +++ src/ChangeLog 2013-11-26 09:00:32 +0000 @@ -1,3 +1,7 @@ +2013-11-26 Andreas Schwab + + * .gdbinit (xgettype): Add cast. + 2013-11-26 Glenn Morris Preload leim-list.el. ------------------------------------------------------------ revno: 115239 fixes bug: http://debbugs.gnu.org/15975 committer: Glenn Morris branch nick: trunk timestamp: Mon 2013-11-25 22:15:49 -0500 message: * lisp/progmodes/python.el (python-indent-guess-indent-offset): Avoid corner-case error. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-26 01:06:23 +0000 +++ lisp/ChangeLog 2013-11-26 03:15:49 +0000 @@ -1,5 +1,8 @@ 2013-11-26 Glenn Morris + * progmodes/python.el (python-indent-guess-indent-offset): + Avoid corner-case error. (Bug#15975) + Preload leim-list.el. (Bug#4789) * loadup.el: Load leim-list.el when found. * startup.el (normal-top-level): Skip re-loading leim/leim-list.el. === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2013-11-23 19:39:50 +0000 +++ lisp/progmodes/python.el 2013-11-26 03:15:49 +0000 @@ -676,7 +676,7 @@ (goto-char block-end) (python-util-forward-comment) (current-indentation)))) - (if indentation + (if (and indentation (not (zerop indentation))) (set (make-local-variable 'python-indent-offset) indentation) (message "Can't guess python-indent-offset, using defaults: %s" python-indent-offset))))))) ------------------------------------------------------------ revno: 115238 committer: Glenn Morris branch nick: trunk timestamp: Mon 2013-11-25 21:58:51 -0500 message: * doc/lispref/os.texi (Startup Summary): Update for leim-list being preloaded. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-11-23 19:07:34 +0000 +++ doc/lispref/ChangeLog 2013-11-26 02:58:51 +0000 @@ -1,3 +1,7 @@ +2013-11-26 Glenn Morris + + * os.texi (Startup Summary): Update for leim-list being preloaded. + 2013-11-23 Brian Jenkins (tiny change) * frames.texi (Input Focus): === modified file 'doc/lispref/os.texi' --- doc/lispref/os.texi 2013-11-19 09:47:02 +0000 +++ doc/lispref/os.texi 2013-11-26 02:58:51 +0000 @@ -71,11 +71,14 @@ automatically when Emacs is installed. @item -If the library @file{leim-list.el} exists, Emacs loads it. This -optional library is intended for registering input methods; Emacs -looks for it in @code{load-path} (@pxref{Library Search}), skipping -those directories containing the standard Emacs libraries (since -@file{leim-list.el} should not exist in those directories). +It loads any @file{leim-list.el} that it finds in the @code{load-path} +directories. This file is intended for registering input methods. +The search is only for any personal @file{leim-list.el} files that you +may have created; so it skips the directories containing the standard Emacs +libraries (for efficiency, since @file{leim-list.el} should not exist +in those directories), as well as the @file{leim} directory that is +part of the distribution (since the @file{leim-list.el} file in this +directory is compiled into the Emacs executable). @vindex before-init-time @item ------------------------------------------------------------ revno: 115237 fixes bug: http://debbugs.gnu.org/4789 committer: Glenn Morris branch nick: trunk timestamp: Mon 2013-11-25 20:06:23 -0500 message: Preload leim-list.el * Makefile.in (abs_builddir): New, set by configure. (buildlisppath): Add leim/. (epaths-force-w32): Set BLD. * lisp/loadup.el: Load leim-list.el when found. * lisp/startup.el (normal-top-level): Skip re-loading leim/leim-list.el. * nt/epaths.nt (PATH_DUMPLOADSEARCH): Add leim/. * src/callproc.c (init_callproc): Don't assume PATH_DUMPLOADSEARCH is a single directory. * src/epaths.in (PATH_DUMPLOADSEARCH): Add leim/. diff: === modified file 'ChangeLog' --- ChangeLog 2013-11-21 17:26:55 +0000 +++ ChangeLog 2013-11-26 01:06:23 +0000 @@ -1,3 +1,10 @@ +2013-11-26 Glenn Morris + + Preload leim-list.el. + * Makefile.in (abs_builddir): New, set by configure. + (buildlisppath): Add leim/. + (epaths-force-w32): Set BLD. + 2013-11-21 Paul Eggert Fix some dependency problems that cause unnecessary recompiles. === modified file 'Makefile.in' --- Makefile.in 2013-11-25 01:36:14 +0000 +++ Makefile.in 2013-11-26 01:06:23 +0000 @@ -164,6 +164,7 @@ # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH. srcdir=@srcdir@ abs_srcdir=@abs_srcdir@ +abs_builddir=@abs_builddir@ # MinGW CPPFLAGS may use this. abs_top_srcdir=@abs_top_srcdir@ @@ -213,13 +214,16 @@ # The default is ${locallisppath}:${standardlisppath}. lisppath=@lisppath@ -# Where Emacs will search for its lisp files while -# building. This is only used during the process of -# compiling Emacs, to help Emacs find its lisp files -# before they've been installed in their final location. +# Where Emacs will search for its lisp files while building. +# This is only used during the process of compiling Emacs, +# to help Emacs find its lisp files before they've been installed +# in their final location. # This should be a colon-separated list of directories. -# Normally it points to the lisp/ directory in the sources. -buildlisppath=${abs_srcdir}/lisp +# Normally it points to the lisp/ directory in the sources and +# the leim/ directory in the build tree. +# NB lread.c relies on lisp/ being first here. +# TODO generate leim in srcdir also, prebuild in tarfiles. +buildlisppath=${abs_srcdir}/lisp:${abs_builddir}/leim # Where to install the other architecture-independent # data files distributed with Emacs (like the tutorial, @@ -337,6 +341,7 @@ # '/foo/bar'). epaths-force-w32: FRC @(w32srcdir=`${srcdir}/build-aux/msys-to-w32 "${srcdir}"`; \ + w32blddir=`${srcdir}/build-aux/msys-to-w32 .`; \ w32prefix=`${srcdir}/build-aux/msys-to-w32 "${prefix}" N`; \ w32prefixpattern=`echo "${w32prefix}" | ${msys_sed_sh_escape}` ; \ w32locallisppath=`${srcdir}/build-aux/msys-to-w32 "${locallisppath}" N ":" "\\;" | ${msys_w32prefix_subst}` ; \ @@ -344,6 +349,7 @@ -e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "'"$${w32locallisppath}"'";' \ -e '/^.*#/s/@VER@/${version}/g' \ -e '/^.*#/s/@CFG@/${configuration}/g' \ + -e '/^.*#/s|@BLD@|$${w32blddir}|g' \ -e "/^.*#/s|@SRC@|$${w32srcdir}|g") && \ ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-25 19:04:50 +0000 +++ lisp/ChangeLog 2013-11-26 01:06:23 +0000 @@ -1,3 +1,9 @@ +2013-11-26 Glenn Morris + + Preload leim-list.el. (Bug#4789) + * loadup.el: Load leim-list.el when found. + * startup.el (normal-top-level): Skip re-loading leim/leim-list.el. + 2013-11-25 Bozhidar Batsov * emacs-lisp/bytecomp.el (byte-compile-form): Fix a typo. === modified file 'lisp/loadup.el' --- lisp/loadup.el 2013-11-04 17:30:33 +0000 +++ lisp/loadup.el 2013-11-26 01:06:23 +0000 @@ -1,7 +1,7 @@ ;;; loadup.el --- load up standardly loaded Lisp files for Emacs -;; Copyright (C) 1985-1986, 1992, 1994, 2001-2013 Free Software -;; Foundation, Inc. +;; Copyright (C) 1985-1986, 1992, 1994, 2001-2013 +;; Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: internal @@ -98,6 +98,8 @@ (load "env") (load "format") (load "bindings") +;; This sets temporary-file-directory, used by eg +;; auto-save-file-name-transforms in files.el. (load "cus-start") (load "window") ; Needed here for `replace-buffer-in-windows'. (setq load-source-file-function 'load-with-code-conversion) @@ -278,12 +280,16 @@ (load "vc/ediff-hook") (if (not (eq system-type 'ms-dos)) (load "tooltip")) -;If you want additional libraries to be preloaded and their -;doc strings kept in the DOC file rather than in core, -;you may load them with a "site-load.el" file. -;But you must also cause them to be scanned when the DOC file -;is generated. -;For other systems, you must edit ../src/Makefile.in. +;; This file doesn't exist when building a development version of Emacs +;; from the repository. It is generated just after temacs is built. +(load "leim-list.el" t) + +;; If you want additional libraries to be preloaded and their +;; doc strings kept in the DOC file rather than in core, +;; you may load them with a "site-load.el" file. +;; But you must also cause them to be scanned when the DOC file +;; is generated. +;; For other systems, you must edit ../src/Makefile.in. (load "site-load" t) ;; Make sure default-directory is unibyte when dumping. This is === modified file 'lisp/startup.el' --- lisp/startup.el 2013-11-21 00:21:50 +0000 +++ lisp/startup.el 2013-11-26 01:06:23 +0000 @@ -499,18 +499,23 @@ ;; available input methods. (let ((tail load-path) (lispdir (expand-file-name "../lisp" data-directory)) - ;; For out-of-tree builds, leim-list is generated in the build dir. -;;; (leimdir (expand-file-name "../leim" doc-directory)) + ;; For out-of-tree builds, leim-list is generated in the build dir. + (leimdir (expand-file-name "../leim" doc-directory)) dir) (while tail (setq dir (car tail)) (let ((default-directory dir)) (load (expand-file-name "subdirs.el") t t t)) - ;; Do not scan standard directories that won't contain a leim-list.el. - ;; http://lists.gnu.org/archive/html/emacs-devel/2009-10/msg00502.html - (or (string-match (concat "\\`" lispdir) dir) - (let ((default-directory dir)) - (load (expand-file-name "leim-list.el") t t t))) + ;; Do not scan standard directories that won't contain a leim-list.el. + ;; http://lists.gnu.org/archive/html/emacs-devel/2009-10/msg00502.html + ;; Also skip leim/leim-list.el, since we preloaded that one. + (or (string-prefix-p lispdir dir) + ;; Not supposed to be subdirs.el in leim, but someone + ;; might have added one and be keeping their own leim-list + ;; files in subdirs of leim. + (string-equal leimdir dir) + (let ((default-directory dir)) + (load (expand-file-name "leim-list.el") t t t))) ;; We don't use a dolist loop and we put this "setq-cdr" command at ;; the end, because the subdirs.el files may add elements to the end ;; of load-path and we want to take it into account. === modified file 'nt/ChangeLog' --- nt/ChangeLog 2013-11-12 02:50:28 +0000 +++ nt/ChangeLog 2013-11-26 01:06:23 +0000 @@ -1,3 +1,7 @@ +2013-11-26 Glenn Morris + + * epaths.nt (PATH_DUMPLOADSEARCH): Add leim/. + 2013-11-12 Dani Moncayo * msysconfig.sh: Remove. === modified file 'nt/epaths.nt' --- nt/epaths.nt 2013-06-07 08:08:29 +0000 +++ nt/epaths.nt 2013-11-26 01:06:23 +0000 @@ -12,8 +12,7 @@ the host system (e.g., i686-pc-mingw32), and @SRC@ by the root of the Emacs source tree used to build Emacs. */ /* -Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software -Foundation, Inc. +Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -51,10 +50,11 @@ #define PATH_SITELOADSEARCH "%emacs_dir%/share/emacs/@VER@/site-lisp;%emacs_dir%/share/emacs/site-lisp" /* Like PATH_LOADSEARCH, but used only during the build process - when Emacs is dumping. Configure (using "make epaths-force") sets - this to $buildlisppath, which normally has the value: /lisp. + when Emacs is dumping. Configure (using "make epaths-force-w32") sets + this to $buildlisppath, which normally has the value: + /lisp;/leim. */ -#define PATH_DUMPLOADSEARCH "@SRC@/lisp" +#define PATH_DUMPLOADSEARCH "@SRC@/lisp;@BLD@/leim" /* The extra search path for programs to invoke. This is appended to whatever the PATH environment variable says to set the Lisp === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-25 23:25:04 +0000 +++ src/ChangeLog 2013-11-26 01:06:23 +0000 @@ -1,3 +1,10 @@ +2013-11-26 Glenn Morris + + Preload leim-list.el. + * epaths.in (PATH_DUMPLOADSEARCH): Add leim/. + * callproc.c (init_callproc): Don't assume PATH_DUMPLOADSEARCH + is a single directory. + 2013-11-25 Paul Eggert bool-vector-subsetp is now the normal direction (Bug#15912). === modified file 'src/callproc.c' --- src/callproc.c 2013-11-23 01:55:16 +0000 +++ src/callproc.c 2013-11-26 01:06:23 +0000 @@ -1607,16 +1607,16 @@ if (data_dir == 0) { Lisp_Object tem, tem1, srcdir; - - srcdir = Fexpand_file_name (build_string ("../src/"), - build_unibyte_string (PATH_DUMPLOADSEARCH)); + Lisp_Object lispdir = Fcar (decode_env_path (0, PATH_DUMPLOADSEARCH, 0)); + + srcdir = Fexpand_file_name (build_string ("../src/"), lispdir); + tem = Fexpand_file_name (build_string ("GNU"), Vdata_directory); tem1 = Ffile_exists_p (tem); if (!NILP (Fequal (srcdir, Vinvocation_directory)) || NILP (tem1)) { Lisp_Object newdir; - newdir = Fexpand_file_name (build_string ("../etc/"), - build_unibyte_string (PATH_DUMPLOADSEARCH)); + newdir = Fexpand_file_name (build_string ("../etc/"), lispdir); tem = Fexpand_file_name (build_string ("GNU"), newdir); tem1 = Ffile_exists_p (tem); if (!NILP (tem1)) === modified file 'src/epaths.in' --- src/epaths.in 2013-06-07 08:08:29 +0000 +++ src/epaths.in 2013-11-26 01:06:23 +0000 @@ -1,7 +1,6 @@ /* Hey Emacs, this is -*- C -*- code! */ /* -Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software -Foundation, Inc. +Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -42,9 +41,10 @@ /* Like PATH_LOADSEARCH, but used only during the build process when Emacs is dumping. Configure (using "make epaths-force") sets - this to $buildlisppath, which normally has the value: /lisp. + this to $buildlisppath, which normally has the value: + /lisp:/leim. */ -#define PATH_DUMPLOADSEARCH "../lisp" +#define PATH_DUMPLOADSEARCH "../lisp:../leim" /* The extra search path for programs to invoke. This is appended to whatever the PATH environment variable says to set the Lisp ------------------------------------------------------------ revno: 115236 fixes bug: http://debbugs.gnu.org/15912 committer: Paul Eggert branch nick: trunk timestamp: Mon 2013-11-25 15:25:04 -0800 message: bool-vector-subsetp is now the normal direction. * data.c (Fbool_vector_subsetp): Test whether the first argument is a subset of the second one, not the reverse. Add doc string. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-25 17:30:09 +0000 +++ src/ChangeLog 2013-11-25 23:25:04 +0000 @@ -1,5 +1,9 @@ 2013-11-25 Paul Eggert + bool-vector-subsetp is now the normal direction (Bug#15912). + * data.c (Fbool_vector_subsetp): Test whether the first argument + is a subset of the second one, not the reverse. Add doc string. + Fix minor problems found by static checking. * lread.c (load_path_default): Now static. * textprop.c (text_property_stickiness): Be consistent about the === modified file 'src/data.c' --- src/data.c 2013-11-24 18:20:18 +0000 +++ src/data.c 2013-11-25 23:25:04 +0000 @@ -3242,11 +3242,11 @@ DEFUN ("bool-vector-subsetp", Fbool_vector_subsetp, Sbool_vector_subsetp, 2, 2, 0, - doc: ) + doc: /* Return t if every t value in A is also t in B, nil otherwise. +A and B must be bool vectors of the same length. */) (Lisp_Object a, Lisp_Object b) { - /* Like bool_vector_union, but doesn't modify b. */ - return bool_vector_binop_driver (b, a, b, bool_vector_subsetp); + return bool_vector_binop_driver (a, b, b, bool_vector_subsetp); } DEFUN ("bool-vector-not", Fbool_vector_not, ------------------------------------------------------------ revno: 115235 committer: Bozhidar Batsov branch nick: emacs-bzr timestamp: Mon 2013-11-25 21:04:50 +0200 message: * lisp/emacs-lisp/helpers.el (string-join): New function. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-11-25 17:16:32 +0000 +++ etc/NEWS 2013-11-25 19:04:50 +0000 @@ -775,6 +775,7 @@ ** New library helpers.el for misc helper functions *** `hash-table-keys' *** `hash-table-values' +*** `string-join` *** `string-trim-left' *** `string-trim-right' *** `string-trim' === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-25 18:48:33 +0000 +++ lisp/ChangeLog 2013-11-25 19:04:50 +0000 @@ -1,7 +1,9 @@ -2013-11-25 Bozhidar Batsov +2013-11-25 Bozhidar Batsov * emacs-lisp/bytecomp.el (byte-compile-form): Fix a typo. + * emacs-lisp/helpers.el (string-join): New function. + 2013-11-25 Sebastian Wiesner * emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions): === modified file 'lisp/emacs-lisp/helpers.el' --- lisp/emacs-lisp/helpers.el 2013-11-24 09:31:51 +0000 +++ lisp/emacs-lisp/helpers.el 2013-11-25 19:04:50 +0000 @@ -37,6 +37,10 @@ (maphash (lambda (_k v) (push v values)) hash-table) values)) +(defsubst string-join (strings &optional separator) + "Join all STRINGS using SEPARATOR." + (mapconcat 'identity strings separator)) + (defsubst string-trim-left (string) "Remove leading whitespace from STRING." (if (string-match "\\`[ \t\n\r]+" string) ------------------------------------------------------------ revno: 115234 committer: Bozhidar Batsov branch nick: emacs-bzr timestamp: Mon 2013-11-25 20:48:33 +0200 message: Fix a email address. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-25 18:45:34 +0000 +++ lisp/ChangeLog 2013-11-25 18:48:33 +0000 @@ -1,4 +1,4 @@ -2013-11-25 Bozhidar Batsov +2013-11-25 Bozhidar Batsov * emacs-lisp/bytecomp.el (byte-compile-form): Fix a typo. ------------------------------------------------------------ revno: 115233 committer: Bozhidar Batsov branch nick: emacs-bzr timestamp: Mon 2013-11-25 20:45:34 +0200 message: * lisp/emacs-lisp/bytecomp.el (byte-compile-form): Fix a typo. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-25 17:22:17 +0000 +++ lisp/ChangeLog 2013-11-25 18:45:34 +0000 @@ -1,3 +1,7 @@ +2013-11-25 Bozhidar Batsov + + * emacs-lisp/bytecomp.el (byte-compile-form): Fix a typo. + 2013-11-25 Sebastian Wiesner * emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions): === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2013-11-25 17:16:32 +0000 +++ lisp/emacs-lisp/bytecomp.el 2013-11-25 18:45:34 +0000 @@ -2930,7 +2930,7 @@ ((symbolp (car form)) (let* ((fn (car form)) (handler (get fn 'byte-compile)) - (interactive-onaly (or (get fn 'interactive-only) + (interactive-only (or (get fn 'interactive-only) (memq fn byte-compile-interactive-only-functions)))) (when (macroexp--const-symbol-p fn) (byte-compile-warn "`%s' called as a function" fn)) ------------------------------------------------------------ revno: 115232 committer: Paul Eggert branch nick: trunk timestamp: Mon 2013-11-25 09:30:09 -0800 message: Fix minor problems found by static checking. * lread.c (load_path_default): Now static. * textprop.c (text_property_stickiness): Be consistent about the test used when deciding whether to consider the previous character. This simplifies the code a bit. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-25 15:42:06 +0000 +++ src/ChangeLog 2013-11-25 17:30:09 +0000 @@ -1,3 +1,11 @@ +2013-11-25 Paul Eggert + + Fix minor problems found by static checking. + * lread.c (load_path_default): Now static. + * textprop.c (text_property_stickiness): Be consistent about the + test used when deciding whether to consider the previous character. + This simplifies the code a bit. + 2013-11-25 Stefan Monnier * textprop.c (text_property_stickiness): Fix front-stickiness at BOB. === modified file 'src/lread.c' --- src/lread.c 2013-11-25 03:10:54 +0000 +++ src/lread.c 2013-11-25 17:30:09 +0000 @@ -4164,9 +4164,9 @@ out-of-tree build) AND install-dir/src/Makefile exists BUT install-dir/src/Makefile.in does NOT exist (this is a sanity check), then repeat the above steps for source-dir/lisp, - leim and site-lisp. -*/ -Lisp_Object + leim and site-lisp. */ + +static Lisp_Object load_path_default (bool changed) { Lisp_Object lpath = Qnil; === modified file 'src/textprop.c' --- src/textprop.c 2013-11-25 15:42:06 +0000 +++ src/textprop.c 2013-11-25 17:30:09 +0000 @@ -1819,23 +1819,23 @@ int text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer) { - Lisp_Object prev_pos, front_sticky; + bool ignore_previous_character; + Lisp_Object prev_pos = make_number (XINT (pos) - 1); + Lisp_Object front_sticky; bool is_rear_sticky = true, is_front_sticky = false; /* defaults */ Lisp_Object defalt = Fassq (prop, Vtext_property_default_nonsticky); if (NILP (buffer)) XSETBUFFER (buffer, current_buffer); - if (CONSP (defalt) && !NILP (XCDR (defalt))) - is_rear_sticky = 0; + ignore_previous_character = XINT (pos) <= BUF_BEGV (XBUFFER (buffer)); - if (XINT (pos) > BUF_BEGV (XBUFFER (buffer))) - /* Consider previous character. */ + if (ignore_previous_character || (CONSP (defalt) && !NILP (XCDR (defalt)))) + is_rear_sticky = false; + else { - Lisp_Object rear_non_sticky; - - prev_pos = make_number (XINT (pos) - 1); - rear_non_sticky = Fget_text_property (prev_pos, Qrear_nonsticky, buffer); + Lisp_Object rear_non_sticky + = Fget_text_property (prev_pos, Qrear_nonsticky, buffer); if (!NILP (CONSP (rear_non_sticky) ? Fmemq (prop, rear_non_sticky) @@ -1843,8 +1843,6 @@ /* PROP is rear-non-sticky. */ is_rear_sticky = false; } - else - is_rear_sticky = false; /* Consider following character. */ /* This signals an arg-out-of-range error if pos is outside the @@ -1869,7 +1867,7 @@ disambiguate. Basically, rear-sticky wins, _except_ if the property that would be inherited has a value of nil, in which case front-sticky wins. */ - if (XINT (pos) == BUF_BEGV (XBUFFER (buffer)) + if (ignore_previous_character || NILP (Fget_text_property (prev_pos, prop, buffer))) return 1; else ------------------------------------------------------------ revno: 115231 committer: Bozhidar Batsov branch nick: master timestamp: Mon 2013-11-25 19:22:17 +0200 message: Fix a typo diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-25 17:16:32 +0000 +++ lisp/ChangeLog 2013-11-25 17:22:17 +0000 @@ -1,4 +1,4 @@ -2013-11-25 Sebastian Wiesner (lunaryorn@gmail.com) +2013-11-25 Sebastian Wiesner * emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions): Mark as obsolete and replace it with a symbol property. ------------------------------------------------------------ revno: 115230 committer: Bozhidar Batsov branch nick: master timestamp: Mon 2013-11-25 19:16:32 +0200 message: * lisp/emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions): Mark as obsolete and replace it with a symbol property. (byte-compile-form): Use new 'interactive-only property. * lisp/comint.el, lisp/files.el, lisp/replace.el, lisp/simple.el: Apply new 'interactive-only properly. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-11-24 21:23:47 +0000 +++ etc/NEWS 2013-11-25 17:16:32 +0000 @@ -795,6 +795,9 @@ *** `completion-in-region-function' obsoletes `completion-in-region-functions'. *** `filter-buffer-substring-function' obsoletes `filter-buffer-substring-functions'. +** `byte-compile-interactive-only-functions' is now obsolete. +It has been replaced by the symbol property 'interactive-only. + ** `split-string' now takes an optional argument TRIM. The value, if non-nil, is a regexp that specifies what to trim from the start and end of each substring. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-25 16:30:01 +0000 +++ lisp/ChangeLog 2013-11-25 17:16:32 +0000 @@ -1,3 +1,11 @@ +2013-11-25 Sebastian Wiesner (lunaryorn@gmail.com) + + * emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions): + Mark as obsolete and replace it with a symbol property. + (byte-compile-form): Use new 'interactive-only property. + * comint.el, files.el, replace.el, simple.el: + Apply new 'interactive-only properly. + 2013-11-25 Martin Rudalics * window.el (display-buffer-at-bottom): Make sure that === modified file 'lisp/comint.el' --- lisp/comint.el 2013-10-29 16:11:50 +0000 +++ lisp/comint.el 2013-11-25 17:16:32 +0000 @@ -752,6 +752,7 @@ (let ((name (file-name-nondirectory program))) (switch-to-buffer (make-comint name program)) (run-hooks (intern-soft (concat "comint-" name "-hook"))))) +(put 'comint-run 'interactive-only "Use `make-comint' instead") (defun comint-exec (buffer name command startfile switches) "Start up a process named NAME in buffer BUFFER for Comint modes. === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2013-10-30 02:45:53 +0000 +++ lisp/emacs-lisp/bytecomp.el 2013-11-25 17:16:32 +0000 @@ -353,11 +353,11 @@ (t (append byte-compile-warnings (list warning))))))) -(defvar byte-compile-interactive-only-functions - '(beginning-of-buffer end-of-buffer replace-string replace-regexp - insert-file insert-buffer insert-file-literally previous-line next-line - goto-line comint-run delete-backward-char) +(defvar byte-compile-interactive-only-functions nil "List of commands that are not meant to be called from Lisp.") +(make-obsolete-variable 'byte-compile-interactive-only-functions + "use the `interactive-only' symbol property instead" + "24.4") (defvar byte-compile-not-obsolete-vars nil "List of variables that shouldn't be reported as obsolete.") @@ -2929,13 +2929,19 @@ (byte-compile-variable-ref form)))) ((symbolp (car form)) (let* ((fn (car form)) - (handler (get fn 'byte-compile))) + (handler (get fn 'byte-compile)) + (interactive-onaly (or (get fn 'interactive-only) + (memq fn byte-compile-interactive-only-functions)))) (when (macroexp--const-symbol-p fn) (byte-compile-warn "`%s' called as a function" fn)) - (and (byte-compile-warning-enabled-p 'interactive-only) - (memq fn byte-compile-interactive-only-functions) - (byte-compile-warn "`%s' used from Lisp code\n\ -That command is designed for interactive use only" fn)) + (when (and (byte-compile-warning-enabled-p 'interactive-only) + interactive-only) + (byte-compile-warn "`%s' used from Lisp code\n\ +That command is designed for interactive use only.\n%s" + fn + (if (stringp interactive-only) + interactive-only + "Consult the documentation for an alternative"))) (if (and (fboundp (car form)) (eq (car-safe (symbol-function (car form))) 'macro)) (byte-compile-log-warning @@ -3598,7 +3604,7 @@ (byte-compile-constant (if (eq 'lambda (car-safe f)) (byte-compile-lambda f) f)))) - + (defun byte-compile-indent-to (form) (let ((len (length form))) (cond ((= len 2) === modified file 'lisp/files.el' --- lisp/files.el 2013-10-30 02:14:16 +0000 +++ lisp/files.el 2013-11-25 17:16:32 +0000 @@ -2085,6 +2085,8 @@ \(Its calling sequence is different; see its documentation)." (interactive "*fInsert file literally: ") (insert-file-1 filename #'insert-file-contents-literally)) +(put 'insert-file-literally 'interactive-only + "Use `insert-file-contents-literally' instead") (defvar find-file-literally nil "Non-nil if this buffer was made by `find-file-literally' or equivalent. @@ -5007,6 +5009,7 @@ \(Its calling sequence is different; see its documentation)." (interactive "*fInsert file: ") (insert-file-1 filename #'insert-file-contents)) +(put 'insert-file 'interactive-only "Use `insert-file-contents' instead.") (defun append-to-file (start end filename) "Append the contents of the region to the end of file FILENAME. === modified file 'lisp/replace.el' --- lisp/replace.el 2013-11-13 20:48:35 +0000 +++ lisp/replace.el 2013-11-25 17:16:32 +0000 @@ -523,6 +523,8 @@ (if (and transient-mark-mode mark-active) (region-end))))) (perform-replace from-string to-string nil nil delimited nil nil start end)) +(put 'replace-string 'interactive-only + "Use `search-forward' and `replace-match' instead.") (defun replace-regexp (regexp to-string &optional delimited start end) "Replace things after point matching REGEXP with TO-STRING. @@ -590,6 +592,8 @@ (if (and transient-mark-mode mark-active) (region-end))))) (perform-replace regexp to-string nil t delimited nil nil start end)) +(put 'replace-regexp 'interactive-only + "Use `re-search-forward' and `replace-match' instead.") (defvar regexp-history nil === modified file 'lisp/simple.el' --- lisp/simple.el 2013-10-30 02:45:53 +0000 +++ lisp/simple.el 2013-11-25 17:16:32 +0000 @@ -888,6 +888,7 @@ (/ (+ 10 (* size (prefix-numeric-value arg))) 10))) (point-min)))) (if (and arg (not (consp arg))) (forward-line 1))) +(put 'beginning-of-buffer 'interactive-only "Use (goto-char (point-min)) instead") (defun end-of-buffer (&optional arg) "Move point to the end of the buffer. @@ -920,6 +921,7 @@ ;; then scroll specially to put it near, but not at, the bottom. (overlay-recenter (point)) (recenter -3)))) +(put 'end-of-buffer 'interactive-only "Use (goto-char (point-max)) instead") (defcustom delete-active-region t "Whether single-char deletion commands delete an active region. @@ -982,6 +984,7 @@ (insert-char ?\s (- ocol (current-column)) nil)))) ;; Otherwise, do simple deletion. (t (delete-char (- n) killflag)))) +(put 'delete-backward-char 'interactive-only "Use `delete-char' instead") (defun delete-forward-char (n &optional killflag) "Delete the following N characters (previous if N is negative). @@ -1079,6 +1082,7 @@ (if (eq selective-display t) (re-search-forward "[\n\C-m]" nil 'end (1- line)) (forward-line (1- line))))) +(put 'goto-line 'interactive-only "Use `forward-line' instead") (defun count-words-region (start end &optional arg) "Count the number of words in the region. @@ -4165,6 +4169,7 @@ (insert-buffer-substring (get-buffer buffer)) (point))) nil) +(put 'insert-buffer 'interactive-only "Use `insert-buffer-substring' instead") (defun append-to-buffer (buffer start end) "Append to specified buffer the text of the region. @@ -4763,6 +4768,7 @@ (signal (car err) (cdr err)))) (line-move arg nil nil try-vscroll))) nil) +(put 'next-line 'interactive-only "Use `forward-line' instead") (defun previous-line (&optional arg try-vscroll) "Move cursor vertically up ARG lines. @@ -4802,6 +4808,8 @@ (signal (car err) (cdr err)))) (line-move (- arg) nil nil try-vscroll)) nil) +(put 'previous-line 'interactive-only + "Use `forward-line' with negative argument instead") (defcustom track-eol nil "Non-nil means vertical motion starting at end of line keeps to ends of lines. ------------------------------------------------------------ revno: 115229 committer: martin rudalics branch nick: trunk timestamp: Mon 2013-11-25 17:30:01 +0100 message: Have display-buffer-at-bottom always create new window on bottom (Bug#15961). * window.el (display-buffer-at-bottom): Make sure that split-window-sensibly creates the new window on bottom (Bug#15961). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-25 15:40:31 +0000 +++ lisp/ChangeLog 2013-11-25 16:30:01 +0000 @@ -1,3 +1,9 @@ +2013-11-25 Martin Rudalics + + * window.el (display-buffer-at-bottom): Make sure that + split-window-sensibly creates the new window on bottom + (Bug#15961). + 2013-11-23 David Kastrup * vc/smerge-mode.el (smerge-ediff): Choose default buffer names based === modified file 'lisp/window.el' --- lisp/window.el 2013-11-20 02:44:38 +0000 +++ lisp/window.el 2013-11-25 16:30:01 +0000 @@ -5728,7 +5728,8 @@ (walk-window-tree (lambda (window) (setq bottom-window window)) nil nil 'nomini) (or (and (not (frame-parameter nil 'unsplittable)) - (setq window (window--try-to-split-window bottom-window alist)) + (let (split-width-threshold) + (setq window (window--try-to-split-window bottom-window alist))) (window--display-buffer buffer window 'window alist display-buffer-mark-dedicated)) (and (not (frame-parameter nil 'unsplittable)) ------------------------------------------------------------ revno: 115228 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2013-11-25 10:42:06 -0500 message: * src/textprop.c (text_property_stickiness): Fix front-stickiness at BOB. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-25 02:41:02 +0000 +++ src/ChangeLog 2013-11-25 15:42:06 +0000 @@ -1,5 +1,7 @@ 2013-11-25 Stefan Monnier + * textprop.c (text_property_stickiness): Fix front-stickiness at BOB. + * frame.c (Fhandle_focus_in, Fhandle_focus_out): Move to frame.el. (syms_of_frame): Don't defsubr them. === modified file 'src/textprop.c' --- src/textprop.c 2013-08-06 05:30:18 +0000 +++ src/textprop.c 2013-11-25 15:42:06 +0000 @@ -1820,7 +1820,7 @@ text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer) { Lisp_Object prev_pos, front_sticky; - bool is_rear_sticky = 1, is_front_sticky = 0; /* defaults */ + bool is_rear_sticky = true, is_front_sticky = false; /* defaults */ Lisp_Object defalt = Fassq (prop, Vtext_property_default_nonsticky); if (NILP (buffer)) @@ -1841,10 +1841,10 @@ ? Fmemq (prop, rear_non_sticky) : rear_non_sticky)) /* PROP is rear-non-sticky. */ - is_rear_sticky = 0; + is_rear_sticky = false; } else - return 0; + is_rear_sticky = false; /* Consider following character. */ /* This signals an arg-out-of-range error if pos is outside the @@ -1855,7 +1855,7 @@ || (CONSP (front_sticky) && !NILP (Fmemq (prop, front_sticky)))) /* PROP is inherited from after. */ - is_front_sticky = 1; + is_front_sticky = true; /* Simple cases, where the properties are consistent. */ if (is_rear_sticky && !is_front_sticky) ------------------------------------------------------------ revno: 115227 author: David Kastrup committer: Stefan Monnier branch nick: trunk timestamp: Mon 2013-11-25 10:40:31 -0500 message: * lisp/vc/smerge-mode.el (smerge-ediff): Choose default buffer names based on the conflict markers when available. (smerge--get-marker): New function. (smerge-end-re, smerge-base-re): Add subgroup. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-25 15:05:25 +0000 +++ lisp/ChangeLog 2013-11-25 15:40:31 +0000 @@ -1,3 +1,10 @@ +2013-11-23 David Kastrup + + * vc/smerge-mode.el (smerge-ediff): Choose default buffer names based + on the conflict markers when available. + (smerge--get-marker): New function. + (smerge-end-re, smerge-base-re): Add subgroup. + 2013-11-25 Stefan Monnier * frame.el (handle-focus-in, handle-focus-out): Add missing === modified file 'lisp/vc/smerge-mode.el' --- lisp/vc/smerge-mode.el 2013-08-28 19:26:18 +0000 +++ lisp/vc/smerge-mode.el 2013-11-25 15:40:31 +0000 @@ -243,8 +243,8 @@ "Font lock patterns for `smerge-mode'.") (defconst smerge-begin-re "^<<<<<<< \\(.*\\)\n") -(defconst smerge-end-re "^>>>>>>> .*\n") -(defconst smerge-base-re "^||||||| .*\n") +(defconst smerge-end-re "^>>>>>>> \\(.*\\)\n") +(defconst smerge-base-re "^||||||| \\(.*\\)\n") (defconst smerge-other-re "^=======\n") (defvar smerge-conflict-style nil @@ -1182,6 +1182,14 @@ (defvar ediff-quit-hook) (declare-function ediff-cleanup-mess "ediff-util" nil) +(defun smerge--get-marker (regexp default) + (save-excursion + (goto-char (point-min)) + (if (and (search-forward-regexp regexp nil t) + (> (match-end 1) (match-beginning 1))) + (concat default "=" (match-string-no-properties 1)) + default))) + ;;;###autoload (defun smerge-ediff (&optional name-mine name-other name-base) "Invoke ediff to resolve the conflicts. @@ -1192,11 +1200,17 @@ (mode major-mode) ;;(ediff-default-variant 'default-B) (config (current-window-configuration)) - (filename (file-name-nondirectory buffer-file-name)) + (filename (file-name-nondirectory (or buffer-file-name "-"))) (mine (generate-new-buffer - (or name-mine (concat "*" filename " MINE*")))) + (or name-mine + (concat "*" filename " " + (smerge--get-marker smerge-begin-re "MINE") + "*")))) (other (generate-new-buffer - (or name-other (concat "*" filename " OTHER*")))) + (or name-other + (concat "*" filename " " + (smerge--get-marker smerge-end-re "OTHER") + "*")))) base) (with-current-buffer mine (buffer-disable-undo) @@ -1221,7 +1235,10 @@ (when base (setq base (generate-new-buffer - (or name-base (concat "*" filename " BASE*")))) + (or name-base + (concat "*" filename " " + (smerge--get-marker smerge-base-re "BASE") + "*")))) (with-current-buffer base (buffer-disable-undo) (insert-buffer-substring buf) ------------------------------------------------------------ revno: 115226 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2013-11-25 10:05:25 -0500 message: * lisp/frame.el (handle-focus-in, handle-focus-out): Add missing interactive spec. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-25 14:51:34 +0000 +++ lisp/ChangeLog 2013-11-25 15:05:25 +0000 @@ -1,3 +1,8 @@ +2013-11-25 Stefan Monnier + + * frame.el (handle-focus-in, handle-focus-out): Add missing + interactive spec. + 2013-11-25 Michael Albinus * net/tramp-cmds.el (tramp-cleanup-connection): Clean up === modified file 'lisp/frame.el' --- lisp/frame.el 2013-11-25 02:41:02 +0000 +++ lisp/frame.el 2013-11-25 15:05:25 +0000 @@ -127,6 +127,7 @@ Focus-in events occur when a frame has focus, but a switch-frame event is not generated. This function runs the hook `focus-in-hook'." + (interactive "e") (run-hooks 'focus-in-hook)) (defun handle-focus-out (_event) @@ -134,6 +135,7 @@ Focus-out events are usually bound to this function. Focus-out events occur when no frame has focus. This function runs the hook `focus-out-hook'." + (interactive "e") (run-hooks 'focus-out-hook)) ;;;; Arrangement of frames at startup ------------------------------------------------------------ revno: 115225 committer: Michael Albinus branch nick: trunk timestamp: Mon 2013-11-25 15:51:34 +0100 message: * net/tramp-cmds.el (tramp-cleanup-connection): Clean up `tramp-current-connection' only when KEEP-PASSWORD is non-nil. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-25 14:31:04 +0000 +++ lisp/ChangeLog 2013-11-25 14:51:34 +0000 @@ -1,3 +1,8 @@ +2013-11-25 Michael Albinus + + * net/tramp-cmds.el (tramp-cleanup-connection): Clean up + `tramp-current-connection' only when KEEP-PASSWORD is non-nil. + 2013-11-25 Stefan Monnier * play/gomoku.el: Don't use intangible property. Use lexical-binding. === modified file 'lisp/net/tramp-cmds.el' --- lisp/net/tramp-cmds.el 2013-11-16 11:37:45 +0000 +++ lisp/net/tramp-cmds.el 2013-11-25 14:51:34 +0000 @@ -85,13 +85,14 @@ ;; Nothing to do. (message "No Tramp connection found.") - ;; Cleanup `tramp-current-connection'. Otherwise, we would be - ;; suppressed in the test suite. - (setq tramp-current-connection nil) - ;; Flush password cache. (unless keep-password (tramp-clear-passwd vec)) + ;; Cleanup `tramp-current-connection'. Otherwise, we would be + ;; suppressed in the test suite. We use `keep-password' as + ;; indicator; it is not worth to add a new argument. + (when keep-password (setq tramp-current-connection nil)) + ;; Flush file cache. (tramp-flush-directory-property vec "") ------------------------------------------------------------ revno: 115224 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2013-11-25 09:31:04 -0500 message: * lisp/play/gomoku.el: Don't use intangible property. Use lexical-binding. (gomoku--last-pos): New var. (gomoku--intangible-chars): New const. (gomoku--intangible): New function. (gomoku-mode): Use it. Derive from special-mode. (gomoku-move-up): Adjust line count. (gomoku-click, gomoku-point-y, gomoku-point-square, gomoku-goto-xy) (gomoku-plot-square, gomoku-init-display, gomoku-cross-qtuple): Simplify accordingly. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-25 02:41:02 +0000 +++ lisp/ChangeLog 2013-11-25 14:31:04 +0000 @@ -1,5 +1,15 @@ 2013-11-25 Stefan Monnier + * play/gomoku.el: Don't use intangible property. Use lexical-binding. + (gomoku--last-pos): New var. + (gomoku--intangible-chars): New const. + (gomoku--intangible): New function. + (gomoku-mode): Use it. Derive from special-mode. + (gomoku-move-up): Adjust line count. + (gomoku-click, gomoku-point-y, gomoku-point-square, gomoku-goto-xy) + (gomoku-plot-square, gomoku-init-display, gomoku-cross-qtuple): + Simplify accordingly. + * frame.el (handle-focus-in, handle-focus-out): Move from frame.c. Remove blink-cursor code. (blink-cursor-timer-function, blink-cursor-suspend): === modified file 'lisp/play/gomoku.el' --- lisp/play/gomoku.el 2013-08-05 14:26:57 +0000 +++ lisp/play/gomoku.el 2013-11-25 14:31:04 +0000 @@ -1,4 +1,4 @@ -;;; gomoku.el --- Gomoku game between you and Emacs +;;; gomoku.el --- Gomoku game between you and Emacs -*- lexical-binding:t -*- ;; Copyright (C) 1988, 1994, 1996, 2001-2013 Free Software Foundation, ;; Inc. @@ -176,14 +176,9 @@ ("[-|/\\]" 0 (if gomoku-emacs-won 'gomoku-O 'gomoku-X))) "Font lock rules for Gomoku.") -(put 'gomoku-mode 'front-sticky - (put 'gomoku-mode 'rear-nonsticky '(intangible))) -(put 'gomoku-mode 'intangible 1) ;; This one is for when they set view-read-only to t: Gomoku cannot ;; allow View Mode to be activated in its buffer. -(put 'gomoku-mode 'mode-class 'special) - -(define-derived-mode gomoku-mode nil "Gomoku" +(define-derived-mode gomoku-mode special-mode "Gomoku" "Major mode for playing Gomoku against Emacs. You and Emacs play in turn by marking a free square. You mark it with X and Emacs marks it with O. The winner is the first to get five contiguous @@ -196,7 +191,8 @@ (gomoku-display-statistics) (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(gomoku-font-lock-keywords t) - buffer-read-only t)) + buffer-read-only t) + (add-hook 'post-command-hook #'gomoku--intangible nil t)) ;;; ;;; THE BOARD. @@ -836,8 +832,7 @@ (min (max (/ (+ (- (cdr click) gomoku-y-offset 1) - (let ((inhibit-point-motion-hooks t)) - (count-lines 1 (window-start))) + (count-lines (point-min) (window-start)) gomoku-square-height (% gomoku-square-height 2) (/ gomoku-square-height 2)) @@ -961,16 +956,15 @@ (defun gomoku-point-y () "Return the board row where point is." - (let ((inhibit-point-motion-hooks t)) - (1+ (/ (- (count-lines 1 (point)) gomoku-y-offset (if (bolp) 0 1)) - gomoku-square-height)))) + (1+ (/ (- (count-lines (point-min) (point)) + gomoku-y-offset (if (bolp) 0 1)) + gomoku-square-height))) (defun gomoku-point-square () "Return the index of the square point is on." - (let ((inhibit-point-motion-hooks t)) - (gomoku-xy-to-index (1+ (/ (- (current-column) gomoku-x-offset) - gomoku-square-width)) - (gomoku-point-y)))) + (gomoku-xy-to-index (1+ (/ (- (current-column) gomoku-x-offset) + gomoku-square-width)) + (gomoku-point-y))) (defun gomoku-goto-square (index) "Move point to square number INDEX." @@ -978,20 +972,18 @@ (defun gomoku-goto-xy (x y) "Move point to square at X, Y coords." - (let ((inhibit-point-motion-hooks t)) - (goto-char (point-min)) - (forward-line (+ gomoku-y-offset (* gomoku-square-height (1- y))))) + (goto-char (point-min)) + (forward-line (+ gomoku-y-offset (* gomoku-square-height (1- y)))) (move-to-column (+ gomoku-x-offset (* gomoku-square-width (1- x))))) (defun gomoku-plot-square (square value) "Draw 'X', 'O' or '.' on SQUARE depending on VALUE, leave point there." (or (= value 1) (gomoku-goto-square square)) - (let ((inhibit-read-only t) - (inhibit-point-motion-hooks t)) - (insert-and-inherit (cond ((= value 1) ?X) - ((= value 6) ?O) - (?.))) + (let ((inhibit-read-only t)) + (insert (cond ((= value 1) ?X) + ((= value 6) ?O) + (?.))) (and (zerop value) (add-text-properties (1- (point)) (point) @@ -1004,8 +996,7 @@ "Display an N by M Gomoku board." (buffer-disable-undo (current-buffer)) (let ((inhibit-read-only t) - (point 1) opoint - (intangible t) + (point (point-min)) opoint (i m) j x) ;; Try to minimize number of chars (because of text properties) (setq tab-width @@ -1014,17 +1005,15 @@ (max (/ (+ (% gomoku-x-offset gomoku-square-width) gomoku-square-width 1) 2) 2))) (erase-buffer) - (newline gomoku-y-offset) + (insert-char ?\n gomoku-y-offset) (while (progn (setq j n x (- gomoku-x-offset gomoku-square-width)) (while (>= (setq j (1- j)) 0) - (insert-char ?\t (/ (- (setq x (+ x gomoku-square-width)) - (current-column)) - tab-width)) - (insert-char ? (- x (current-column))) - (if (setq intangible (not intangible)) - (put-text-property point (point) 'intangible 2)) + (insert-char ?\t (/ (- (setq x (+ x gomoku-square-width)) + (current-column)) + tab-width)) + (insert-char ?\s (- x (current-column))) (and (zerop j) (= i (- m 2)) (progn @@ -1042,16 +1031,9 @@ (if (= i (1- m)) (setq opoint point)) (insert-char ?\n gomoku-square-height)) - (or (eq (char-after 1) ?.) - (put-text-property 1 2 'point-entered - (lambda (_x _y) (if (bobp) (forward-char))))) - (or intangible - (put-text-property point (point) 'intangible 2)) - (put-text-property point (point) 'point-entered - (lambda (_x _y) (if (eobp) (backward-char)))) - (put-text-property (point-min) (point) 'category 'gomoku-mode)) + (insert-char ?\n)) (gomoku-goto-xy (/ (1+ n) 2) (/ (1+ m) 2)) ; center of the board - (sit-for 0)) ; Display NOW + (sit-for 0)) ; Display NOW (defun gomoku-display-statistics () "Obnoxiously display some statistics about previous games in mode line." @@ -1114,8 +1096,7 @@ "Cross every square between SQUARE1 and SQUARE2 in the DX, DY direction." (save-excursion ; Not moving point from last square (let ((depl (gomoku-xy-to-index dx dy)) - (inhibit-read-only t) - (inhibit-point-motion-hooks t)) + (inhibit-read-only t)) ;; WARNING: this function assumes DEPL > 0 and SQUARE2 > SQUARE1 (while (/= square1 square2) (gomoku-goto-square square1) @@ -1134,36 +1115,57 @@ (setq n (1+ n)) (forward-line 1) (indent-to column) - (insert-and-inherit ?|)))) + (insert ?|)))) ((= dx -1) ; 1st Diagonal (indent-to (prog1 (- (current-column) (/ gomoku-square-width 2)) (forward-line (/ gomoku-square-height 2)))) - (insert-and-inherit ?/)) + (insert ?/)) (t ; 2nd Diagonal (indent-to (prog1 (+ (current-column) (/ gomoku-square-width 2)) (forward-line (/ gomoku-square-height 2)))) - (insert-and-inherit ?\\)))))) + (insert ?\\)))))) (sit-for 0)) ; Display NOW ;;; ;;; CURSOR MOTION. ;;; + +(defvar-local gomoku--last-pos 0) + +(defconst gomoku--intangible-chars "- \t\n|/\\\\") + +(defun gomoku--intangible () + (when (or (eobp) + (save-excursion + (not (zerop (skip-chars-forward gomoku--intangible-chars))))) + (if (<= gomoku--last-pos (point)) ;Moving forward. + (progn + (skip-chars-forward gomoku--intangible-chars) + (when (eobp) + (skip-chars-backward gomoku--intangible-chars) + (forward-char -1))) + (skip-chars-backward gomoku--intangible-chars) + (if (bobp) + (skip-chars-forward gomoku--intangible-chars) + (forward-char -1)))) + (setq gomoku--last-pos (point))) + ;; previous-line and next-line don't work right with intangible newlines (defun gomoku-move-down () "Move point down one row on the Gomoku board." (interactive) - (if (< (gomoku-point-y) gomoku-board-height) - (let ((column (current-column))) - (forward-line gomoku-square-height) - (move-to-column column)))) + (when (< (gomoku-point-y) gomoku-board-height) + (let ((column (current-column))) + (forward-line gomoku-square-height) + (move-to-column column)))) (defun gomoku-move-up () "Move point up one row on the Gomoku board." (interactive) - (if (> (gomoku-point-y) 1) - (let ((column (current-column))) - (forward-line (- 1 gomoku-square-height)) - (move-to-column column)))) + (when (> (gomoku-point-y) 1) + (let ((column (current-column))) + (forward-line (- gomoku-square-height)) + (move-to-column column)))) (defun gomoku-move-ne () "Move point North East on the Gomoku board." ------------------------------------------------------------ revno: 115223 fixes bug: http://debbugs.gnu.org/15969 committer: Glenn Morris branch nick: trunk timestamp: Sun 2013-11-24 19:25:13 -0800 message: * erc/erc-button.el (erc-nick-popup): Make `nick' available in the eval environment. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2013-11-04 19:35:37 +0000 +++ lisp/erc/ChangeLog 2013-11-25 03:25:13 +0000 @@ -1,3 +1,8 @@ +2013-11-25 Glenn Morris + + * erc-button.el (erc-nick-popup): Make `nick' available in the + eval environment. (Bug#15969) + 2013-11-04 Stefan Monnier * erc-pcomplete.el (erc-pcomplete): Set this-command. === modified file 'lisp/erc/erc-button.el' --- lisp/erc/erc-button.el 2013-09-19 02:21:31 +0000 +++ lisp/erc/erc-button.el 2013-11-25 03:25:13 +0000 @@ -514,7 +514,7 @@ (code (cdr (assoc action erc-nick-popup-alist)))) (when code (erc-set-active-buffer (current-buffer)) - (eval code)))) + (eval code `((nick . ,nick)))))) ;;; Callback functions (defun erc-button-describe-symbol (symbol-name)