commit e2fd20683ad6c771912958058985c9696a1fc063 (HEAD, refs/remotes/origin/master) Author: Mark Oteiza Date: Thu Oct 27 11:32:28 2016 -0400 Fix avl-tree alias docstrings * lisp/emacs-lisp/avl-tree.el (avl-tree--node-branch): (avl-tree-stack-p, avl-tree-create): (avl-tree-compare-function): Add calling convention to docstrings. diff --git a/lisp/emacs-lisp/avl-tree.el b/lisp/emacs-lisp/avl-tree.el index 74d8e59..707d1cb 100644 --- a/lisp/emacs-lisp/avl-tree.el +++ b/lisp/emacs-lisp/avl-tree.el @@ -98,7 +98,8 @@ ;; avl-tree-right avl-tree-data] branch) node) "Get value of a branch of a node. NODE is the node, and BRANCH is the branch. -0 for left pointer, 1 for right pointer and 2 for the data.") +0 for left pointer, 1 for right pointer and 2 for the data. +\n(fn BRANCH NODE)") ;; The funcall/aref trick wouldn't work for the setf method, unless we @@ -400,7 +401,8 @@ itself." reverse store) (defalias 'avl-tree-stack-p #'avl-tree--stack-p - "Return t if argument is an avl-tree-stack, nil otherwise.") + "Return t if OBJ is an avl-tree-stack, nil otherwise. +\n(fn OBJ)") (defun avl-tree--stack-repopulate (stack) ;; Recursively push children of the node at the head of STACK onto the @@ -419,12 +421,12 @@ itself." (defalias 'avl-tree-create #'avl-tree--create "Create an empty AVL tree. COMPARE-FUNCTION is a function which takes two arguments, A and B, -and returns non-nil if A is less than B, and nil otherwise.") +and returns non-nil if A is less than B, and nil otherwise. +\n(fn COMPARE-FUNCTION)") (defalias 'avl-tree-compare-function #'avl-tree--cmpfun "Return the comparison function for the AVL tree TREE. - -\(fn TREE)") +\n(fn TREE)") (defun avl-tree-empty (tree) "Return t if AVL tree TREE is empty, otherwise return nil." commit 63eebff30e91f4a29d2870d42cab859e7fef628b Author: Paul Eggert Date: Thu Oct 27 08:27:13 2016 -0700 Update from gnulib This incorporates: 2016-10-16 qsort_r: Fix macrology for platforms that lack the function. 2016-10-13 stdint: port SIZE_MAX to glibc s390 2016-10-11 maint: remove stray space after "." in AC_DEFINE comment. * lib/gnulib.mk: Regenerate. * lib/stdlib.in.h, m4/st_dm_mode.m4, m4/stdint.m4, m4/stdlib_h.m4: * m4/utimes.m4: Copy from gnulib. diff --git a/lib/gnulib.mk b/lib/gnulib.mk index a691a0b..56c2109 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk @@ -1258,6 +1258,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ + -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \ -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index 70dc88d..db3253b 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -521,6 +521,9 @@ _GL_CXXALIASWARN (putenv); #endif #if @GNULIB_QSORT_R@ +/* Sort an array of NMEMB elements, starting at address BASE, each element + occupying SIZE bytes, in ascending order according to the comparison + function COMPARE. */ # if @REPLACE_QSORT_R@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef qsort_r @@ -535,12 +538,24 @@ _GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, void *), void *arg)); # else +# if !@HAVE_QSORT_R@ +_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, + int (*compare) (void const *, void const *, + void *), + void *arg) _GL_ARG_NONNULL ((1, 4))); +# endif _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, int (*compare) (void const *, void const *, void *), void *arg)); # endif _GL_CXXALIASWARN (qsort_r); +#elif defined GNULIB_POSIXCHECK +# undef qsort_r +# if HAVE_RAW_DECL_QSORT_R +_GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - " + "use gnulib module qsort_r for portability"); +# endif #endif diff --git a/m4/st_dm_mode.m4 b/m4/st_dm_mode.m4 index 1cfe68e..debd753 100644 --- a/m4/st_dm_mode.m4 +++ b/m4/st_dm_mode.m4 @@ -17,7 +17,7 @@ AC_DEFUN([AC_STRUCT_ST_DM_MODE], if test $ac_cv_struct_st_dm_mode = yes; then AC_DEFINE([HAVE_ST_DM_MODE], [1], - [Define if struct stat has an st_dm_mode member. ]) + [Define if struct stat has an st_dm_mode member.]) fi ] ) diff --git a/m4/stdint.m4 b/m4/stdint.m4 index fa6f103..05b6ab7 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 @@ -1,4 +1,4 @@ -# stdint.m4 serial 47 +# stdint.m4 serial 48 dnl Copyright (C) 2001-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -154,6 +154,15 @@ uintptr_t h = UINTPTR_MAX; intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; +/* Check that SIZE_MAX has the correct type, if possible. */ +#if 201112 <= __STDC_VERSION__ +int k = _Generic (SIZE_MAX, size_t: 0); +#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +extern size_t k; +extern __typeof__ (SIZE_MAX) k; +#endif + #include /* for CHAR_BIT */ #define TYPE_MINIMUM(t) \ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index 19107c4..3999068 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 @@ -1,4 +1,4 @@ -# stdlib_h.m4 serial 42 +# stdlib_h.m4 serial 43 dnl Copyright (C) 2007-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -21,7 +21,7 @@ AC_DEFUN([gl_STDLIB_H], #endif ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps - posix_openpt ptsname ptsname_r random random_r realpath rpmatch + posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv]) ]) @@ -85,6 +85,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT]) HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME]) HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R]) + HAVE_QSORT_R=1; AC_SUBST([HAVE_QSORT_R]) HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM]) HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H]) HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) diff --git a/m4/utimes.m4 b/m4/utimes.m4 index 1876bec..0778185 100644 --- a/m4/utimes.m4 +++ b/m4/utimes.m4 @@ -145,6 +145,6 @@ main () [gl_cv_func_working_utimes=no])]) if test $gl_cv_func_working_utimes = yes; then - AC_DEFINE([HAVE_WORKING_UTIMES], [1], [Define if utimes works properly. ]) + AC_DEFINE([HAVE_WORKING_UTIMES], [1], [Define if utimes works properly.]) fi ]) commit 354c4a9885db314a4bd8a11cd6f11badef7b07f3 Author: Paul Eggert Date: Thu Oct 27 08:05:24 2016 -0700 electric-quote-chars fixups * lisp/electric.el (electric-quote-chars): Check types and safety more carefully. (electric-quote-post-self-insert-function): Use more-mnemonic locals. Omit no-longer-necessary runtime error diagnostic. diff --git a/lisp/electric.el b/lisp/electric.el index 19cded2..3e48737 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -427,10 +427,16 @@ The variable `electric-layout-rules' says when and how to insert newlines." (defcustom electric-quote-chars '(?‘ ?’ ?“ ?”) "Curved quote characters for `electric-quote-mode'. -The items correspond to the left single quote, the right single -quote, the left double quote, and the right double quote, respectively." - :version "25.1" - :type 'list :safe 'listp :group 'electricity) +This list's members correspond to left single quote, right single +quote, left double quote, and right double quote, respectively." + :version "26.1" + :type '(list character character character character) + :safe #'(lambda (x) + (pcase x + (`(,(pred characterp) ,(pred characterp) + ,(pred characterp) ,(pred characterp)) + t))) + :group 'electricity) (defcustom electric-quote-paragraph t "Non-nil means to use electric quoting in text paragraphs." @@ -459,28 +465,27 @@ This requotes when a quoting key is typed." (or (eq last-command-event ?\`) (save-excursion (backward-paragraph) (point))))))) (pcase electric-quote-chars - (`(,q1 ,q2 ,q3 ,q4) + (`(,q< ,q> ,q<< ,q>>) (when start (save-excursion (if (eq last-command-event ?\`) - (cond ((search-backward (string q1 ?`) (- (point) 2) t) - (replace-match (string q3)) + (cond ((search-backward (string q< ?`) (- (point) 2) t) + (replace-match (string q<<)) (when (and electric-pair-mode (eq (cdr-safe - (assq q1 electric-pair-text-pairs)) + (assq q< electric-pair-text-pairs)) (char-after))) (delete-char 1)) - (setq last-command-event q3)) + (setq last-command-event q<<)) ((search-backward "`" (1- (point)) t) - (replace-match (string q1)) - (setq last-command-event q1))) - (cond ((search-backward (string q2 ?') (- (point) 2) t) - (replace-match (string q4)) - (setq last-command-event q4)) + (replace-match (string q<)) + (setq last-command-event q<))) + (cond ((search-backward (string q> ?') (- (point) 2) t) + (replace-match (string q>>)) + (setq last-command-event q>>)) ((search-backward "'" (1- (point)) t) - (replace-match (string q2)) - (setq last-command-event q2))))))) - (_ (error "‘electric-quote-chars’ must contain exactly 4 characters.")))))) + (replace-match (string q>)) + (setq last-command-event q>))))))))))) (put 'electric-quote-post-self-insert-function 'priority 10) @@ -497,8 +502,8 @@ and text paragraphs, and these are selectively controlled with `electric-quote-comment', `electric-quote-string', and `electric-quote-paragraph'. -Customize `electric-quote-chars' in order to use quote chars -other than the ones listed here. +Customize `electric-quote-chars' to use characters other than the +ones listed here. This is a global minor mode. To toggle the mode in a single buffer, use `electric-quote-local-mode'." commit 11d380a029640eeb99badfa31976e9c47f53b002 Author: Göktuğ Kayaalp Date: Thu Oct 27 08:05:24 2016 -0700 New user variable 'electric-quote-chars' * doc/emacs/text.texi (Quotation Marks), etc/NEWS: Document this. * lisp/electric.el (electric-quote-chars): New defcustom. (electric-quote-post-self-insert-function): Use it. diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index 7fa0804..4c6a1ff 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -412,6 +412,7 @@ beginning of a line. @cindex mode, Electric Quote @cindex curly quotes @cindex curved quotes +@cindex guillemets @findex electric-quote-mode One common way to quote is the typewriter convention, which quotes using straight apostrophes @t{'like this'} or double-quotes @t{"like @@ -420,9 +421,15 @@ left and right single or double quotation marks @t{‘like this’} or @t{“like this”}. In text files, typewriter quotes are simple and portable; curved quotes are less ambiguous and typically look nicer. +@vindex electric-quote-chars Electric Quote mode makes it easier to type curved quotes. As you type characters it optionally converts @t{`} to @t{‘}, @t{'} to @t{’}, -@t{``} to @t{“}, and @t{''} to @t{”}. +@t{``} to @t{“}, and @t{''} to @t{”}. It's possible to change the +default quotes listed above, by customizing the variable +@code{electric-quote-chars}, a list of four characters, where the +items correspond to the left single quote, the right single quote, the +left double quote and the right double quote, respectively, whose +default value is @code{'(?‘ ?’ ?“ ?”)}. @vindex electric-quote-paragraph @vindex electric-quote-comment @@ -443,7 +450,10 @@ type @kbd{C-q `} or @kbd{C-q '} instead of @kbd{`} or @kbd{'}. To insert a curved quote even when Electric Quote is disabled or inactive, you can type @kbd{C-x 8 [} for @t{‘}, @kbd{C-x 8 ]} for @t{’}, @kbd{C-x 8 @{} for @t{“}, and @kbd{C-x 8 @}} for @t{”}. -@xref{Inserting Text}. +@xref{Inserting Text}. Note that the value of +@code{electric-quote-chars} does not affect these keybindings, they +are not keybindings of @code{electric-quote-mode} but bound in +@code{global-map}. @node Filling @section Filling Text diff --git a/etc/NEWS b/etc/NEWS index a160f81..addd056 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -61,6 +61,11 @@ affected by this, as SGI stopped supporting IRIX in December 2013. * Changes in Emacs 26.1 ++++ +** The new user variable 'electric-quote-chars' provides a list +of curved quotes for 'electric-quote-mode', allowing user to choose +the types of quotes to be used. + --- The group 'wp', whose label was "text", is now deprecated. Use the new group 'text', which inherits from 'wp', instead. diff --git a/lisp/electric.el b/lisp/electric.el index f35f8b9..19cded2 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -425,6 +425,13 @@ The variable `electric-layout-rules' says when and how to insert newlines." :version "25.1" :type 'boolean :safe 'booleanp :group 'electricity) +(defcustom electric-quote-chars '(?‘ ?’ ?“ ?”) + "Curved quote characters for `electric-quote-mode'. +The items correspond to the left single quote, the right single +quote, the left double quote, and the right double quote, respectively." + :version "25.1" + :type 'list :safe 'listp :group 'electricity) + (defcustom electric-quote-paragraph t "Non-nil means to use electric quoting in text paragraphs." :version "25.1" @@ -451,26 +458,29 @@ This requotes when a quoting key is typed." (derived-mode-p 'text-mode) (or (eq last-command-event ?\`) (save-excursion (backward-paragraph) (point))))))) - (when start - (save-excursion - (if (eq last-command-event ?\`) - (cond ((search-backward "‘`" (- (point) 2) t) - (replace-match "“") - (when (and electric-pair-mode - (eq (cdr-safe - (assq ?‘ electric-pair-text-pairs)) - (char-after))) - (delete-char 1)) - (setq last-command-event ?“)) - ((search-backward "`" (1- (point)) t) - (replace-match "‘") - (setq last-command-event ?‘))) - (cond ((search-backward "’'" (- (point) 2) t) - (replace-match "”") - (setq last-command-event ?”)) - ((search-backward "'" (1- (point)) t) - (replace-match "’") - (setq last-command-event ?’))))))))) + (pcase electric-quote-chars + (`(,q1 ,q2 ,q3 ,q4) + (when start + (save-excursion + (if (eq last-command-event ?\`) + (cond ((search-backward (string q1 ?`) (- (point) 2) t) + (replace-match (string q3)) + (when (and electric-pair-mode + (eq (cdr-safe + (assq q1 electric-pair-text-pairs)) + (char-after))) + (delete-char 1)) + (setq last-command-event q3)) + ((search-backward "`" (1- (point)) t) + (replace-match (string q1)) + (setq last-command-event q1))) + (cond ((search-backward (string q2 ?') (- (point) 2) t) + (replace-match (string q4)) + (setq last-command-event q4)) + ((search-backward "'" (1- (point)) t) + (replace-match (string q2)) + (setq last-command-event q2))))))) + (_ (error "‘electric-quote-chars’ must contain exactly 4 characters.")))))) (put 'electric-quote-post-self-insert-function 'priority 10) @@ -487,6 +497,9 @@ and text paragraphs, and these are selectively controlled with `electric-quote-comment', `electric-quote-string', and `electric-quote-paragraph'. +Customize `electric-quote-chars' in order to use quote chars +other than the ones listed here. + This is a global minor mode. To toggle the mode in a single buffer, use `electric-quote-local-mode'." :global t :group 'electricity commit 53a0562b2c69d7598c51c03417d8daab46f375c9 Author: Paul Eggert Date: Thu Oct 27 08:04:28 2016 -0700 ; Spelling fix diff --git a/src/xwidget.c b/src/xwidget.c index 0be2845..e97d963 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -722,7 +722,7 @@ argument procedure FUN.*/) // procedure that retrieves the return value. webkit_web_view_run_javascript (WEBKIT_WEB_VIEW (xw->widget_osr), SSDATA (script), - NULL, /*cancellable*/ + NULL, /* cancelable */ callback, (gpointer) fun); return Qnil; commit 0465bf511521ea780a61f1a0eb67731280e689a5 Author: Tino Calancha Date: Thu Oct 27 18:06:54 2016 +0900 Add more tests for Bug#24627 * test/lisp/thingatpt-tests.el (thing-at-point-bug24627): Add tests for 'list-at-point'. diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el index 2b8e067..71d2c88 100644 --- a/test/lisp/thingatpt-tests.el +++ b/test/lisp/thingatpt-tests.el @@ -84,12 +84,26 @@ position to retrieve THING.") (goto-char (nth 1 test)) (should (equal (thing-at-point (nth 2 test)) (nth 3 test)))))) +;; These tests reflect the actual behaviour of +;; `thing-at-point-bounds-of-list-at-point'. (ert-deftest thing-at-point-bug24627 () "Test for http://debbugs.gnu.org/24627 ." :expected-result :failed - (let ((file + (let ((string-result '(("(a \"b\" c)" . (a "b" c)) + (";(a \"b\" c)") + ("(a \"b\" c\n)" . (a "b" c)) + ("\"(a b c)\"") + ("(a ;(b c d)\ne)" . (a e)) + ("(foo\n(a ;(b c d)\ne) bar)" . (a e)) + ("(foo\na ;(b c d)\ne bar)" . (foo a e bar)) + ("(foo\n(a \"(b c d)\"\ne) bar)" . (a "(b c d)" e)) + ("(b\n(a ;(foo c d)\ne) bar)" . (a e)) + ("(princ \"(a b c)\")" . (princ "(a b c)")) + ("(defun foo ()\n \"Test function.\"\n ;;(a b)\n nil)" . (defun foo nil "Test function." nil)))) + (file (expand-file-name "lisp/thingatpt.el" source-directory)) buf) + ;; Test for `thing-at-point'. (when (file-exists-p file) (unwind-protect (progn @@ -97,6 +111,14 @@ position to retrieve THING.") (goto-char (point-max)) (forward-line -1) (should-not (thing-at-point 'list))) - (kill-buffer buf))))) + (kill-buffer buf))) + ;; Tests for `list-at-point'. + (dolist (str-res string-result) + (with-temp-buffer + (emacs-lisp-mode) + (insert (car str-res)) + (re-search-backward "\\((a\\|^a\\)") + (should (equal (list-at-point) + (cdr str-res))))))) ;;; thingatpt.el ends here