------------------------------------------------------------ revno: 117154 [merge] committer: Glenn Morris branch nick: trunk timestamp: Sun 2014-05-25 19:28:09 -0700 message: Merge from emacs-24; up to r117155 diff: === modified file 'ChangeLog' --- ChangeLog 2014-05-19 04:56:03 +0000 +++ ChangeLog 2014-05-26 02:28:09 +0000 @@ -1,3 +1,9 @@ +2014-05-26 Paul Eggert + + Fix port to 32-bit AIX (Bug#17540). + * configure.ac (opsys): On Power Architecture, treat release 7 of + AIX like releases 5 and 6. + 2014-05-19 Paul Eggert Remove dependencies on getdelim and getline. === modified file 'admin/ChangeLog' --- admin/ChangeLog 2014-05-25 13:44:14 +0000 +++ admin/ChangeLog 2014-05-26 02:28:09 +0000 @@ -1,7 +1,6 @@ -2014-05-25 Jan Djärv +2014-05-25 YAMAMOTO Mitsuharu - * mac/uvs.el: New file from Mac port. src/macuvs.h is generated - by it. + * mac/uvs.el: New file from Mac port. Generates src/macuvs.h. 2014-05-17 Paul Eggert === modified file 'configure.ac' --- configure.ac 2014-05-19 04:56:03 +0000 +++ configure.ac 2014-05-26 02:28:09 +0000 @@ -547,7 +547,7 @@ rs6000-ibm-aix[56]* ) opsys=aix4-2 ;; - powerpc-ibm-aix[56]* ) + powerpc-ibm-aix[5-9]* | powerpc-ibm-aix[1-9][0-9]* ) opsys=aix4-2 ;; @@ -999,6 +999,15 @@ LN_S="/bin/ln" fi +dnl On some Debian versions, "install-info" prints irritating messages +dnl "This is not dpkg install-info anymore, but GNU install-info" +dnl if called via an absolute file name. +dnl Use the entirely-identical-but-quieter ginstall-info instead if present. +dnl Sadly some people may have an old ginstall-info installed on +dnl non-Debian systems, so we can't use this. +dnl AC_PATH_PROGS(INSTALL_INFO, [ginstall-info install-info], :, +dnl $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin) + AC_PATH_PROG(INSTALL_INFO, install-info, :, $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin) dnl Don't use GZIP, which is used by gzip for additional parameters. === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2014-05-14 17:01:29 +0000 +++ doc/emacs/ChangeLog 2014-05-26 02:28:09 +0000 @@ -1,3 +1,9 @@ +2014-05-26 Eli Zaretskii + + * frames.texi (Fonts): Clarify which frames are affected by + setting font from the menu and in default-frame-alist. + (Bug#17532) + 2014-05-14 Eli Zaretskii * mule.texi (Language Environments): Remove unused @anchor. (Bug#17479) === modified file 'doc/emacs/frames.texi' --- doc/emacs/frames.texi 2014-04-29 14:45:24 +0000 +++ doc/emacs/frames.texi 2014-05-21 16:35:31 +0000 @@ -494,13 +494,14 @@ @cindex fonts By default, Emacs displays text on graphical displays using a -12-point monospace font. There are several different ways to specify +10-point monospace font. There are several different ways to specify a different font: @itemize @item -Click on @samp{Set Default Font} in the @samp{Options} menu. To save -this for future sessions, click on @samp{Save Options} in the +Click on @samp{Set Default Font} in the @samp{Options} menu. This +makes the selected font the default on all existing graphical frames. +To save this for future sessions, click on @samp{Save Options} in the @samp{Options} menu. @item @@ -513,6 +514,10 @@ '(font . "DejaVu Sans Mono-10")) @end example +@noindent +This makes the font the default on all graphical frames created after +restarting Emacs with that init file. + @cindex X defaults file @cindex X resources file @item === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-05-22 04:30:48 +0000 +++ doc/lispref/ChangeLog 2014-05-26 02:28:09 +0000 @@ -1,3 +1,8 @@ +2014-05-26 Eli Zaretskii + + * display.texi (Invisible Text): Clarify the description of + line-move-ignore-invisible. (Bug#17511) + 2014-05-22 Leo Liu * sequences.texi (Sequence Functions): Don't mention when and how === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2014-04-15 13:21:18 +0000 +++ doc/lispref/display.texi 2014-05-17 08:58:17 +0000 @@ -930,12 +930,14 @@ @vindex line-move-ignore-invisible Ordinarily, functions that operate on text or move point do not care -whether the text is invisible. The user-level line motion commands -ignore invisible newlines if @code{line-move-ignore-invisible} is -non-@code{nil} (the default), but only because they are explicitly -programmed to do so. +whether the text is invisible, they process invisible characters and +visible characters alike. The user-level line motion commands, +such as @code{next-line}, @code{previous-line}, ignore invisible +newlines if @code{line-move-ignore-invisible} is non-@code{nil} (the +default), i.e., behave like these invisible newlines didn't exist in +the buffer, but only because they are explicitly programmed to do so. - However, if a command ends with point inside or at the boundary of + If a command ends with point inside or at the boundary of invisible text, the main editing loop relocates point to one of the two ends of the invisible text. Emacs chooses the direction of relocation so that it is the same as the overall movement direction of @@ -952,6 +954,10 @@ to the first visible character that follows the invisible text and then forward one more character. + These @dfn{adjustments} of point that ended up in the middle of +invisible text can be disabled by setting @code{disable-point-adjustment} +to a non-@code{nil} value. @xref{Adjusting Point}. + Incremental search can make invisible overlays visible temporarily and/or permanently when a match includes invisible text. To enable this, the overlay should have a non-@code{nil} === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-05-20 00:59:36 +0000 +++ doc/misc/ChangeLog 2014-05-26 02:28:09 +0000 @@ -1,3 +1,16 @@ +2014-05-26 Paul Eggert + + Specify coding if Latin-1 Emacs would misinterpret (Bug#17575). + * htmlfontify.texi, org.texi: Add "coding: utf-8". + +2014-05-26 Stephen Berman + + * todo-mode.texi: Update in light of changes due to bug#17482. + Replace numerous mistaken uses of literal quotes with proper + Texinfo markup. + (Todo Mode Entry Points): Comment out reference to using find-file + or Dired to visit Todo files, since this has been disabled (bug#17482). + 2014-05-20 Leo Liu * cl.texi (List Functions, Efficiency Concerns): Update cl-endp. === modified file 'doc/misc/htmlfontify.texi' --- doc/misc/htmlfontify.texi 2014-05-07 17:34:53 +0000 +++ doc/misc/htmlfontify.texi 2014-05-24 22:23:47 +0000 @@ -1589,3 +1589,7 @@ @setchapternewpage odd @bye + +@c Local Variables: +@c coding: utf-8 +@c End: === modified file 'doc/misc/org.texi' --- doc/misc/org.texi 2014-05-07 17:34:53 +0000 +++ doc/misc/org.texi 2014-05-24 22:23:47 +0000 @@ -18208,6 +18208,7 @@ @bye @c Local variables: +@c coding: utf-8 @c fill-column: 77 @c indent-tabs-mode: nil @c paragraph-start: "\\|^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|\f\\|[ ]*$" === modified file 'doc/misc/todo-mode.texi' --- doc/misc/todo-mode.texi 2014-05-07 17:34:53 +0000 +++ doc/misc/todo-mode.texi 2014-05-23 16:54:35 +0000 @@ -258,15 +258,15 @@ @code{todo-insert-item}, since these commands are bound to @kbd{t}, @kbd{j} and @kbd{i}, respectively, in Todo mode. -You can also visit a Todo file via @code{find-file} or Dired, like any -other file, and since Emacs recognizes it, the buffer will automatically -be in the appropriate Todo mode. Moreover, as long as the command you -use to visit the file is listed in the option -@code{todo-visit-files-commands} (which by default contains -@code{find-file} and @code{dired-find-file}), it will also correctly -display the file's first category on first visiting the file (otherwise -you have to use one of the commands for navigating between categories in -order to get a proper display). +@c You can also visit a Todo file via @code{find-file} or Dired, like any +@c other file, and since Emacs recognizes it, the buffer will automatically +@c be in the appropriate Todo mode. Moreover, as long as the command you +@c use to visit the file is listed in the option +@c @code{todo-visit-files-commands} (which by default contains +@c @code{find-file} and @code{dired-find-file}), it will also correctly +@c display the file's first category on first visiting the file (otherwise +@c you have to use one of the commands for navigating between categories in +@c order to get a proper display). You can leave Todo mode by typing @kbd{q} (@code{todo-quit}), which buries the current todo file buffer. Doing this also saves any changes @@ -295,7 +295,7 @@ number key. The predefined key bindings in Todo are more or less mnemonic. As a -rule, key sequences beginning with @kbd{C} (capital `C', not the +rule, key sequences beginning with @kbd{C} (capital @samp{C}, not the control key) are bound to commands applying to categories, sequences beginning with @kbd{F} apply to (non-archive) file-level commands, and those beginning with @kbd{A} apply to archives (a special type of Todo @@ -669,9 +669,9 @@ @samp{region} (@kbd{r}): Use the text of the selected region as the text of the new item, and insert this in accordance with the item insertion options and other parameters passed. If the option -`todo-use-only-highlighted-region' is non-nil, then use the region -only when it is highlighted; otherwise, use the region regardless of -highlighting. +@code{todo-use-only-highlighted-region} is non-nil, then use the +region only when it is highlighted; otherwise, use the region +regardless of highlighting. @end enumerate Note that the parameters are divided into five numbered groups; within @@ -715,9 +715,9 @@ @noindent Notice that the pair @samp{k=>nonmarking} is now absent, since it belongs to the same group as the selected pair @samp{y=>diary}, hence is no longer available for this sequence. Since @kbd{y} is a -continuation key, it is still available, but now the string ":GO!" is -appended to the pair to remind you that pressing this key again will -complete the sequence. +continuation key, it is still available, but now the string +@samp{:GO!} is appended to the pair to remind you that pressing this +key again will complete the sequence. @@ -821,10 +821,10 @@ @noindent Editing the text of a lengthy item in the minibuffer can be -inconvenient; therefore, if you type `e e' or `e h' on an item whose -text contains more than one logical line, the effect is the same as if -you had typed `e m', that is, you switch a special buffer in Todo Edit -mode. +inconvenient; therefore, if you type @kbd{e e} or @kbd{e h} on an item +whose text contains more than one logical line, the effect is the same +as if you had typed @kbd{e m}, that is, you switch a special buffer in +Todo Edit mode. When you pass any of the parameters of the preceding group, except for the @samp{date} parameter, this completes the item editing invocation @@ -916,10 +916,10 @@ Press a key (so far `e d'): f=>full c=>calendar a=>today n=>dayname y=>year m=>month d=>daynum @end example -In addition to the item-level invocations `e y', to change the current -item's diary inclusion status, and `e k', to change the current item's -calendar marking status, Todo mode also has two related category-level -commands: +In addition to the item-level invocations @kbd{e y}, to change the +current item's diary inclusion status, and @kbd{e k}, to change the +current item's calendar marking status, Todo mode also has two related +category-level commands: @table @kbd @@ -932,7 +932,7 @@ @end table @noindent -Like `e k', `C e k' automatically removes @code{todo-nondiary-marker} +Like @kbd{e k}, @kbd{C e k} automatically removes @code{todo-nondiary-marker} from all items it is present on, since only diary items can bear @code{diary-nonmarking-symbol}. @@ -944,7 +944,7 @@ category, and take a prefix argument to reverse the effect. (If you really want to toggle the diary-inclusion and calendar-marking status of all items in the category, you can do this by marking all the items -and then invoking `e y' or `e k', @pxref{Marked Items}). +and then invoking @kbd{e y} or @kbd{e k}, @pxref{Marked Items}). @node Relocating and Removing Items, , Editing Item Headers and Text, Item Editing @subsection Relocating and Removing Items @@ -1050,14 +1050,15 @@ @anchor{todo-item-done} @item d -This command (@code{todo-item-done}) removes the todo item at point from -the todo list, appends to the original header a header consisting of -@code{todo-done-string} (by default ``DONE '') and the current date, and -if @code{todo-always-add-time-string} is enabled, also the current time, -and adds the resulting done item to the top of the done items section of -the category. Invoked with a prefix argument, it also prompts you to -enter a comment, which is appended to the end of the done item, prefixed -with @code{todo-comment-string} (by default ``COMMENT: ''). +This command (@code{todo-item-done}) removes the todo item at point +from the todo list, appends to the original header a header consisting +of @code{todo-done-string} (by default @samp{DONE }) and the current +date, and if @code{todo-always-add-time-string} is enabled, also the +current time, and adds the resulting done item to the top of the done +items section of the category. Invoked with a prefix argument, it +also prompts you to enter a comment, which is appended to the end of +the done item, prefixed with @code{todo-comment-string} (by default +@samp{COMMENT: }). @end table A category's done items section is located below the last todo (i.e., @@ -1255,7 +1256,7 @@ Since it is natural to visit an archive from the corresponding todo file, it would be convenient to easily return to the todo file when you -have finished browsing the archive. If you type `q' to quit Todo +have finished browsing the archive. If you type @kbd{q} to quit Todo Archive mode, this switches to the corresponding todo file and shows the todo category corresponding to the archive category you were just visiting. @@ -1396,13 +1397,13 @@ Each row of the table is also buttonized; pressing one of these exits the buffer (killing it), returns to the buffer of the file from which -you had invoked `F c', and displays the category that was named in the -row button you pressed (i.e., pressing this button jumps to that -category). However, if the category named in the row is in a todo file -and all of its items have been archived, and you have enabled the option -@code{todo-skip-archived-categories}, then pressing the button jumps to -the archive category instead of the empty todo category. You can -recognize such categories by their items counts in the table---all +you had invoked @kbd{F c}, and displays the category that was named in +the row button you pressed (i.e., pressing this button jumps to that +category). However, if the category named in the row is in a todo +file and all of its items have been archived, and you have enabled the +option @code{todo-skip-archived-categories}, then pressing the button +jumps to the archive category instead of the empty todo category. You +can recognize such categories by their items counts in the table---all columns but the archived one have counts of zero---and in addition, their lines in the table are also distinguished from the others by a different face (@pxref{Faces}). @@ -1586,7 +1587,7 @@ current category. To exclude a category or file from filtering by @kbd{F t t} and @kbd{F t m}, set the number to @samp{0}. @item -You can invoke `F t t' and `F t m' with a numeric prefix argument, +You can invoke @kbd{F t t} and @kbd{F t m} with a numeric prefix argument, which specifies the number of top priorities in each category just for this invocation, overriding both @code{todo-top-priorities-overrides} and @code{todo-top-priorities}. @@ -1681,7 +1682,7 @@ Aside from explicitly invoking an item filtering command to display a saved list of items filtered by a given method from given todo files, there are two other ways to visit a saved file of filtered items. You -can invoke a command similar to `find-file': +can invoke a command similar to @code{find-file}: @table @kbd @item F f === modified file 'etc/ChangeLog' --- etc/ChangeLog 2014-05-17 08:11:31 +0000 +++ etc/ChangeLog 2014-05-26 02:28:09 +0000 @@ -1,3 +1,8 @@ +2014-05-26 Paul Eggert + + Specify coding if Latin-1 Emacs would misinterpret (Bug#17575). + * ETAGS.EBNF, NEWS, ORG-NEWS: Add "coding: utf-8". + 2014-05-17 Paul Eggert * NEWS: Assume C99 or later (Bug#17487). === modified file 'etc/ETAGS.EBNF' --- etc/ETAGS.EBNF 2014-01-16 06:24:06 +0000 +++ etc/ETAGS.EBNF 2014-05-24 22:23:47 +0000 @@ -1,4 +1,4 @@ --*- indented-text -*- +-*- mode: indented-text; coding: utf-8 -*- See the end of this file for copyright information. === modified file 'etc/NEWS' --- etc/NEWS 2014-05-25 01:18:16 +0000 +++ etc/NEWS 2014-05-26 02:28:09 +0000 @@ -1476,7 +1476,6 @@ *** `generic-make-keywords-list' *** `get-upcase-table' (use `case-table-get-table' instead). -+++ ** `with-wrapper-hook' is obsoleted by `add-function'. The few hooks that used with-wrapper-hook are replaced as follows: *** `abbrev-expand-function' obsoletes `abbrev-expand-functions'. @@ -4187,6 +4186,7 @@ Local variables: +coding: utf-8 mode: outline paragraph-separate: "[ ]*$" end: === modified file 'etc/ORG-NEWS' --- etc/ORG-NEWS 2014-01-10 07:10:37 +0000 +++ etc/ORG-NEWS 2014-05-24 22:23:47 +0000 @@ -1,4 +1,4 @@ -ORG NEWS -- history of user-visible changes. -*- org -*- +ORG NEWS -- history of user-visible changes. -*- mode: org; coding: utf-8 -*- #+LINK: doc http://orgmode.org/worg/doc.html#%s #+LINK: git http://orgmode.org/w/?p=org-mode.git;a=commit;h=%s === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2014-05-19 04:56:03 +0000 +++ lib-src/ChangeLog 2014-05-26 02:28:09 +0000 @@ -1,3 +1,13 @@ +2014-05-26 Paul Eggert + + Fix rcs2log problems with CVS. + Problem reported by Glenn Morris in + . + Plus, fix some security and filename quoting problems. + * rcs2log (logdir): Prefer mktemp if available. + (logdir, llogdir): Work even if TMPDIR begins with '-' or has spaces. + (output_authors, main awk script): Parse more-recent CVS output format. + 2014-05-19 Paul Eggert Remove dependencies on getline and getdelim. === modified file 'lib-src/rcs2log' --- lib-src/rcs2log 2014-01-01 08:31:29 +0000 +++ lib-src/rcs2log 2014-05-20 07:59:28 +0000 @@ -205,11 +205,19 @@ m[9]="Oct"; m[10]="Nov"; m[11]="Dec" ' -logdir=$TMPDIR/rcs2log$$ +if type mktemp >/dev/null 2>&1; then + logdir=`mktemp -d` +else + logdir=$TMPDIR/rcs2log$$ + (umask 077 && mkdir "$logdir") +fi || exit +case $logdir in +-*) logdir=./$logdir;; +esac +trap exit 1 2 13 15 +trap "rm -fr \"$logdir\" 2>/dev/null" 0 + llogout=$logdir/l -trap exit 1 2 13 15 -trap "rm -fr $logdir 2>/dev/null" 0 -(umask 077 && exec mkdir $logdir) || exit # If no rlog-format log file is given, generate one into $rlogfile. case $rlogfile in @@ -417,10 +425,10 @@ ?*) case $loginFullnameMailaddrs in *\"* | *\\*) - sed 's/["\\]/\\&/g' >$llogout <"$llogout" <$llogout || exit +esac >"$llogout" || exit output_authors='/^date: / { - if ($2 ~ /^[0-9]*[-\/][0-9][0-9][-\/][0-9][0-9]$/ && $3 ~ /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9][-+0-9:]*;$/ && $4 == "author:" && $5 ~ /^[^;]*;$/) { - print substr($5, 1, length($5)-1) + cvsformat = $5 == "author:" + if ($2 ~ /^[0-9]*[-\/][0-9][0-9][-\/][0-9][0-9]$/ && (cvsformat ? $3 ~ /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/ && $4 ~ /^[-+][0-9:]*;$/ : $3 ~ /^[0-9][0-9]:[0-9][0-9]:[0-9][0-9][-+0-9:]*;$/)) { + author = $(5 + cvsformat) + if ($(4 + cvsformat) == "author:" && author ~ /^[^;]*;$/) { + print substr(author, 1, length(author)-1) + } } }' authors=` - $AWK "$output_authors" <"$rlogfile" | sort -u | comm -23 - $llogout + $AWK "$output_authors" <"$rlogfile" | sort -u | comm -23 - "$llogout" ` case $authors in ?*) - cat >$llogout <"$llogout" < + + * cus-face.el (custom-face-attributes): Add :distant-foreground. + +2014-05-26 Martin Rudalics + + * window.el (window--dump-frame): Remove interactive specification. + +2014-05-26 Glenn Morris + + * hippie-exp.el (he-line-search-regexp): + Handle comint-prompt-regexp containing subgroups. (Bug#17529) + +2014-05-26 Stephen Berman + + * calendar/todo-mode.el: Remove dependence on auto-mode-alist, + to avoid errors when trying to create or visit a file foo.todo + located outside to todo-directory, and to allow having such files + without them being tied to Todo mode (bug#17482). + (todo-show, todo-move-category, todo-merge-category, todo-find-archive) + (todo-archive-done-item, todo-find-filtered-items-file) + (todo-filter-items, todo-find-item, todo-diary-goto-entry) + (todo-category-completions, todo-read-category): When visiting a + Todo file, make sure we're in the right mode and the buffer local + variables are set. + (todo-make-categories-list, todo-reset-nondiary-marker) + (todo-reset-done-string, todo-reset-comment-string): After + processing all Todo files, kill the buffers of those files that + weren't being visited before the processing. + (todo-display-as-todo-file, todo-add-to-buffer-list) + (todo-visit-files-commands): Comment out. + (todo-modes-set-3, todo-mode): Comment out additions to find-file-hook. + (auto-mode-alist): Remove add-to-list calls making Todo file + extensions unrestrictedly tied to Todo modes. + +2014-05-26 Stefan Monnier + + * emacs-lisp/nadvice.el (advice--member-p): Change second arg. + (advice-function-member-p): Tell it to check both names and functions + (bug#17531). + (advice--add-function): Adjust call accordingly. + +2014-05-26 Stephen Berman + + * calendar/todo-mode.el: Miscellaneous bug fixes. + (todo-delete-file): When deleting an archive but not its todo + file, make sure to update the todo file's category sexp. + (todo-move-category): Keep the moved category's name unless the + file moved to already has a category with that name. If the + numerically last category of the source file was moved, make the + first category current to avoid selecting a nonexisting category. + (todo-merge-category): Fix implementation to make merging to a + category in another file work as documented. Eliminate now + insufficient and unnecessary renaming of archive category, correct + document string accordingly, and clarify it. If the numerically + last category of the source file was merged, make the first + category current to avoid selecting a nonexisting category. + (todo-archive-done-item): When there are marked items and point + happens to be on an unmarked item, ignore the latter. Don't leave + point below last item after archiving marked items. + (todo-unarchive-items): Fix logic to ensure unarchiving an item + from an archive with only one category deletes the archive only + when the category is empty after unarchiving. Make sure the todo + file's category sexp is updated. + (todo-read-file-name): Allow an existing file name even when it is + not required (todo-move-category needs this to work as documented). + (todo-add-file): Call todo-validate-name to reject the name of an + existing todo file (needed due to fix in todo-read-file-name). + (todo-reset-nondiary-marker): Also reset in filtered items files. + (todo-reset-done-string, todo-reset-comment-string): Also reset in + regexp filtered items files. + (todo-reset-highlight-item): Also reset in filtered items files. + Fix incorrect variable reference in document string. + +2014-05-26 Glenn Morris + + * window.el (window--dump-frame): Avoid error in --without-x builds. + +2014-05-26 Glenn Morris + + * nxml/nxml-mode.el (xml-mode): Only define this alias once. + +2014-05-26 Eli Zaretskii + + * frame.el (set-frame-font): Doc fix. + + * menu-bar.el (menu-set-font): Doc fix. (Bug#17532) + +2014-05-26 Dmitry Gutov + + * emacs-lisp/package.el (package--download-one-archive): Use + `write-region' instead of `save-buffer' to avoid running various + hooks. (Bug#17155) + (describe-package-1): Same. Insert newline at the end of the + buffer if appropriate. + +2014-05-26 Juri Linkov + + * avoid.el (mouse-avoidance-set-mouse-position): Don't raise frame. + (mouse-avoidance-ignore-p): Remove `switch-frame', add `focus-out'. + Add more modifiers: meta, control, shift, hyper, super, alt. + (Bug#17439) + + * avoid.el (mouse-avoidance-banish-position): Fix defcustom :options + to allow changing its value with `set-variable'. + +2014-05-26 Stefan Monnier + + * progmodes/scheme.el (scheme-mode-syntax-table): Remove hack for + #; comments. + (scheme-syntax-propertize, scheme-syntax-propertize-sexp-comment): + New functions. + (scheme-mode-variables): Set syntax-propertize-function instead of + font-lock-syntactic-face-function. + (scheme-font-lock-syntactic-face-function): Delete. + + * emacs-lisp/lisp.el (end-of-defun): Ensure we move (bug#17274). + + * emacs-lisp/timer.el (timer-event-handler): Don't run if canceled + (bug#17392). + +2014-05-26 Michael Albinus + + * net/tramp-sh.el (tramp-find-inline-encoding): Do not match "%%t" + for a temporary file name. + +2014-05-26 Eli Zaretskii + + * simple.el (line-move-ignore-invisible): Doc fix. (Bug#17511) + +2014-05-26 Michael Albinus + + * net/dbus.el (dbus-init-bus, dbus-call-method) + (dbus-call-method-asynchronously, dbus-send-signal) + (dbus-method-return-internal, dbus-method-error-internal): + Check, whether Emacs has been compiled with D-Bus support. (Bug#17508) + +2014-05-26 Nicolas Richard + + * emacs-lisp/eieio-opt.el (eieio-help-class): Correctly deal with + methods which do not have a doc string. (Bug#17490) + 2014-05-25 Tassilo Horn * textmodes/reftex-ref.el (reftex-format-special): Make it work === modified file 'lisp/avoid.el' --- lisp/avoid.el 2014-01-01 07:43:34 +0000 +++ lisp/avoid.el 2014-05-20 21:20:36 +0000 @@ -52,9 +52,6 @@ ;; ;; - Using this code does slow Emacs down. "banish" mode shouldn't ;; be too bad, and on my workstation even "animate" is reasonable. -;; -;; - It ought to find out where any overlapping frames are and avoid them, -;; rather than always raising the frame. ;; Credits: ;; This code was helped by all those who contributed suggestions, @@ -129,9 +126,9 @@ TOP-OR-BOTTOM-POS: Distance from top or bottom edge of frame or window." :group 'avoid :version "24.3" - :type '(alist :key-type symbol :value-type symbol) - :options '(frame-or-window side (side-pos integer) - top-or-bottom (top-or-bottom-pos integer))) + :type '(alist :key-type symbol :value-type (choice symbol integer)) + :options '((frame-or-window symbol) (side symbol) (side-pos integer) + (top-or-bottom symbol) (top-or-bottom-pos integer))) ;; Internal variables (defvar mouse-avoidance-state nil) @@ -172,12 +169,8 @@ (defun mouse-avoidance-set-mouse-position (pos) ;; Carefully set mouse position to given position (X . Y) - ;; Ideally, should check if X,Y is in the current frame, and if not, - ;; leave the mouse where it was. However, this is currently - ;; difficult to do, so we just raise the frame to avoid frame switches. ;; Returns t if it moved the mouse. (let ((f (selected-frame))) - (raise-frame f) (set-mouse-position f (car pos) (cdr pos)) t)) @@ -342,12 +335,18 @@ (let ((modifiers (event-modifiers (car last-input-event)))) (or (memq (car last-input-event) '(mouse-movement scroll-bar-movement - select-window switch-frame)) + select-window focus-out)) (memq 'click modifiers) (memq 'double modifiers) (memq 'triple modifiers) (memq 'drag modifiers) - (memq 'down modifiers))))))) + (memq 'down modifiers) + (memq 'meta modifiers) + (memq 'control modifiers) + (memq 'shift modifiers) + (memq 'hyper modifiers) + (memq 'super modifiers) + (memq 'alt modifiers))))))) (defun mouse-avoidance-banish () (if (not (mouse-avoidance-ignore-p)) @@ -403,8 +402,6 @@ * cat-and-mouse: Same as `animate'. * proteus: As `animate', but changes the shape of the mouse pointer too. -Whenever the mouse is moved, the frame is also raised. - \(See `mouse-avoidance-threshold' for definition of \"too close\", and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for definition of \"random distance\".)" === modified file 'lisp/calendar/todo-mode.el' --- lisp/calendar/todo-mode.el 2014-05-09 07:50:42 +0000 +++ lisp/calendar/todo-mode.el 2014-05-23 16:54:35 +0000 @@ -566,13 +566,13 @@ ;;; Entering and exiting ;; ----------------------------------------------------------------------------- -(defcustom todo-visit-files-commands (list 'find-file 'dired-find-file) - "List of file finding commands for `todo-display-as-todo-file'. -Invoking these commands to visit a todo file or todo archive file -calls `todo-show' or `todo-find-archive', so that the file is -displayed correctly." - :type '(repeat function) - :group 'todo) +;; (defcustom todo-visit-files-commands (list 'find-file 'dired-find-file) +;; "List of file finding commands for `todo-display-as-todo-file'. +;; Invoking these commands to visit a todo file or todo archive file +;; calls `todo-show' or `todo-find-archive', so that the file is +;; displayed correctly." +;; :type '(repeat function) +;; :group 'todo) (defun todo-short-file-name (file) "Return the short form of todo file FILE's name. @@ -740,9 +740,12 @@ "Choose a regexp items file: " rxf) 'regexp)))))) (if (file-exists-p fi-file) - (set-window-buffer - (selected-window) - (set-buffer (find-file-noselect fi-file 'nowarn))) + (progn + (set-window-buffer + (selected-window) + (set-buffer (find-file-noselect fi-file 'nowarn))) + (unless (derived-mode-p 'todo-filtered-items-mode) + (todo-filtered-items-mode))) (message "There is no %s file for %s" (cond ((eq todo-show-first 'top) "top priorities") @@ -757,6 +760,9 @@ (unless (todo-check-file file) (throw 'end nil)) (set-window-buffer (selected-window) (set-buffer (find-file-noselect file 'nowarn))) + (if (equal (file-name-extension (buffer-file-name)) "toda") + (unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode)) + (unless (derived-mode-p 'todo-mode) (todo-mode))) ;; When quitting an archive file, show the corresponding ;; category in the corresponding todo file, if it exists. (when (assoc cat todo-categories) @@ -1090,6 +1096,9 @@ (let* ((prompt (concat "Enter name of new todo file " "(TAB or SPC to see current names): ")) (file (todo-read-file-name prompt))) + ;; Don't accept the name of an existing todo file. + (setq file (todo-absolute-file-name + (todo-validate-name (todo-short-file-name file) 'file))) (with-current-buffer (get-buffer-create file) (erase-buffer) (write-region (point-min) (point-max) file nil 'nomessage nil t) @@ -1179,10 +1188,28 @@ (when (file-exists-p file1) (delete-file file1)) (setq todo-visited (delete file1 todo-visited)) (kill-buffer buf1) - (when delete2 - (when (file-exists-p file2) (delete-file file2)) - (setq todo-visited (delete file2 todo-visited)) - (and buf2 (kill-buffer buf2))) + (if delete2 + (progn + (when (file-exists-p file2) (delete-file file2)) + (setq todo-visited (delete file2 todo-visited)) + (and buf2 (kill-buffer buf2))) + ;; If we deleted an archive but not its todo file, update the + ;; latter's category sexp. + (when (equal (file-name-extension file2) "todo") + (with-current-buffer (or buf2 (find-file-noselect file2)) + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (let ((sexp (read (buffer-substring-no-properties + (line-beginning-position) + (line-end-position)))) + (buffer-read-only nil)) + (mapc (lambda (x) (aset (cdr x) 3 0)) sexp) + (delete-region (line-beginning-position) (line-end-position)) + (prin1 sexp (current-buffer))))) + (todo-set-categories) + (unless buf2 (kill-buffer))))) (setq todo-files (funcall todo-files-function) todo-archives (funcall todo-files-function t)) (when (or (string= file1-sn todo-default-todo-file) @@ -1197,7 +1224,8 @@ (concat "and its " (cond (todo "archive") (archive "todo")) " file ")) - "deleted") file1-sn)))) + "deleted") + file1-sn)))) (defvar todo-edit-buffer "*Todo Edit*" "Name of current buffer in Todo Edit mode.") @@ -1385,8 +1413,7 @@ "Do you want to proceed? "))) (let* ((ofile todo-current-todo-file) (cat (todo-current-category)) - (nfile (todo-read-file-name - "Todo file to move this category to: " nil)) + (nfile (todo-read-file-name "Todo file to move this category to: ")) (archive (concat (file-name-sans-extension ofile) ".toda")) (buffers (append (list ofile) (unless (zerop (todo-get-count 'archived cat)) @@ -1394,7 +1421,7 @@ new) (while (equal nfile (file-truename ofile)) (setq nfile (todo-read-file-name - "Choose a file distinct from this file: " nil))) + "Choose a file distinct from this file: "))) (unless (member nfile todo-files) (with-current-buffer (get-buffer-create nfile) (erase-buffer) @@ -1428,6 +1455,10 @@ (if (member buf (funcall todo-files-function t)) (concat (file-name-sans-extension nfile) ".toda") nfile)) + (if (equal (file-name-extension (buffer-file-name)) "toda") + (unless (derived-mode-p 'todo-archive-mode) + (todo-archive-mode)) + (unless (derived-mode-p 'todo-mode) (todo-mode))) (let* ((nfile-short (todo-short-file-name nfile)) (prompt (concat (format "Todo file \"%s\" already has " @@ -1453,7 +1484,7 @@ "\\(" (regexp-quote cat) "\\)$") nil t) (replace-match new nil nil nil 1))) (setq todo-categories - (append todo-categories (list (cons new counts)))) + (append todo-categories (list (cons (or new cat) counts)))) (todo-update-categories-sexp) ;; If archive was just created, save it to avoid "File ;; no longer exists!" message on invoking @@ -1481,6 +1512,8 @@ (setq todo-categories (delete (assoc cat todo-categories) todo-categories)) (todo-update-categories-sexp) + (when (> todo-category-number (length todo-categories)) + (setq todo-category-number 1)) (todo-category-select))))) (set-window-buffer (selected-window) (set-buffer (find-file-noselect nfile))) @@ -1495,25 +1528,25 @@ otherwise, choose and merge into a category in either the current todo file or a file in `todo-category-completions-files'. -After merging, the current category's todo and done items are +After merging, the source category's todo and done items are appended to the chosen goal category's todo and done items, respectively. The goal category becomes the current category, -and the previous current category is deleted. +and the source category is deleted. -If both the first and goal categories also have archived items, -the former are merged to the latter. If only the first category -has archived items, the archived category is renamed to the goal -category." +If both the source and goal categories also have archived items, +they are also merged. If only the source category has archived +items, the goal category is added as a new category to the +archive file and the source category is deleted." (interactive "P") (let* ((tfile todo-current-todo-file) (cat (todo-current-category)) (cat+file (todo-read-category "Merge into category: " 'todo file)) (goal (car cat+file)) (gfile (cdr cat+file)) - (archive (concat (file-name-sans-extension (if file gfile tfile)) - ".toda")) - archived-count here) - ;; Merge in todo file. + (tarchive (concat (file-name-sans-extension tfile) ".toda")) + (garchive (concat (file-name-sans-extension gfile) ".toda")) + (archived-count (todo-get-count 'archived)) + here) (with-current-buffer (get-buffer (find-file-noselect tfile)) (widen) (let* ((buffer-read-only nil) @@ -1536,94 +1569,102 @@ (point-marker)) (point-max-marker)))) (todo (buffer-substring-no-properties tbeg tend)) - (done (buffer-substring-no-properties dbeg cend))) - (goto-char (point-min)) - ;; Merge any todo items. - (unless (zerop (length todo)) - (re-search-forward - (concat "^" (regexp-quote (concat todo-category-beg goal)) "$") - nil t) - (re-search-forward - (concat "^" (regexp-quote todo-category-done)) nil t) - (forward-line -1) - (setq here (point-marker)) - (insert todo) - (todo-update-count 'todo (todo-get-count 'todo cat) goal)) - ;; Merge any done items. - (unless (zerop (length done)) - (goto-char (if (re-search-forward - (concat "^" (regexp-quote todo-category-beg)) nil t) - (match-beginning 0) - (point-max))) - (when (zerop (length todo)) (setq here (point-marker))) - (insert done) - (todo-update-count 'done (todo-get-count 'done cat) goal)) + (done (buffer-substring-no-properties dbeg cend)) + (todo-count (todo-get-count 'todo cat)) + (done-count (todo-get-count 'done cat))) + ;; Merge into goal todo category. + (with-current-buffer (get-buffer (find-file-noselect gfile)) + (unless (derived-mode-p 'todo-mode) (todo-mode)) + (widen) + (goto-char (point-min)) + (let ((buffer-read-only nil)) + ;; Merge any todo items. + (unless (zerop (length todo)) + (re-search-forward + (concat "^" (regexp-quote (concat todo-category-beg goal)) "$") + nil t) + (re-search-forward + (concat "^" (regexp-quote todo-category-done)) nil t) + (forward-line -1) + (setq here (point-marker)) + (insert todo) + (todo-update-count 'todo todo-count goal)) + ;; Merge any done items. + (unless (zerop (length done)) + (goto-char (if (re-search-forward + (concat "^" (regexp-quote todo-category-beg)) + nil t) + (match-beginning 0) + (point-max))) + (when (zerop (length todo)) (setq here (point-marker))) + (insert done) + (todo-update-count 'done done-count goal))) + (todo-update-categories-sexp)) + ;; Update and clean up source todo file. (remove-overlays cbeg cend) (delete-region cbeg cend) (setq todo-categories (delete (assoc cat todo-categories) - todo-categories)) + todo-categories)) (todo-update-categories-sexp) - (mapc (lambda (m) (set-marker m nil)) (list cbeg tbeg dbeg tend cend)))) - (when (file-exists-p archive) - ;; Merge in archive file. - (with-current-buffer (get-buffer (find-file-noselect archive)) + (when (> todo-category-number (length todo-categories)) + (setq todo-category-number 1)) + (todo-category-select) + (mapc (lambda (m) (set-marker m nil)) + (list cbeg tbeg dbeg tend cend)))) + (when (> archived-count 0) + (with-current-buffer (get-buffer (find-file-noselect tarchive)) (widen) (goto-char (point-min)) - (let ((buffer-read-only nil) - (cbeg (save-excursion - (when (re-search-forward - (concat "^" (regexp-quote - (concat todo-category-beg cat)) "$") - nil t) - (goto-char (match-beginning 0)) - (point-marker)))) - (gbeg (save-excursion - (when (re-search-forward - (concat "^" (regexp-quote - (concat todo-category-beg goal)) "$") - nil t) - (goto-char (match-beginning 0)) - (point-marker)))) - cend carch) - (when cbeg - (setq archived-count (todo-get-count 'done cat)) - (setq cend (save-excursion - (if (re-search-forward - (concat "^" (regexp-quote todo-category-beg)) + (let* ((buffer-read-only nil) + (cbeg (progn + (when (re-search-forward + (concat "^" (regexp-quote + (concat todo-category-beg cat)) "$") nil t) + (goto-char (match-beginning 0)) + (point-marker)))) + (cend (if (re-search-forward + (concat "^" (regexp-quote todo-category-beg)) nil t) + (match-beginning 0) + (point-max))) + (carch (progn + (goto-char cbeg) + (forward-line) + (buffer-substring-no-properties (point) cend)))) + ;; Merge into goal archive category, if it exists, else create it. + (with-current-buffer (get-buffer (find-file-noselect garchive)) + (let ((gbeg (when (re-search-forward + (concat "^" (regexp-quote + (concat todo-category-beg goal)) + "$") + nil t) + (goto-char (match-beginning 0)) + (point-marker)))) + (goto-char (if (and gbeg + (re-search-forward + (concat "^" (regexp-quote todo-category-beg)) + nil t)) (match-beginning 0) - (point-max)))) - (setq carch (save-excursion (goto-char cbeg) (forward-line) - (buffer-substring-no-properties (point) cend))) - ;; If both categories of the merge have archived items, merge the - ;; source items to the goal items, else "merge" by renaming the - ;; source category to goal. - (if gbeg - (progn - (goto-char (if (re-search-forward - (concat "^" (regexp-quote todo-category-beg)) - nil t) - (match-beginning 0) - (point-max))) - (insert carch) - (remove-overlays cbeg cend) - (delete-region cbeg cend)) - (goto-char cbeg) - (search-forward cat) - (replace-match goal)) - (setq todo-categories (todo-make-categories-list t)) - (todo-update-categories-sexp))))) - (with-current-buffer (get-file-buffer tfile) - (when archived-count - (unless (zerop archived-count) - (todo-update-count 'archived archived-count goal) - (todo-update-categories-sexp))) - (todo-category-number goal) - ;; If there are only merged done items, show them. - (let ((todo-show-with-done (zerop (todo-get-count 'todo goal)))) - (todo-category-select) - ;; Put point on the first merged item. - (goto-char here))) + (point-max))) + (unless gbeg (todo-add-category nil goal)) + (insert carch) + (todo-update-categories-sexp))) + ;; Update and clean up source archive file. + (remove-overlays cbeg cend) + (delete-region cbeg cend) + (setq todo-categories (todo-make-categories-list t)) + (todo-update-categories-sexp)))) + ;; Update goal todo file for merged archived items and display it. + (set-window-buffer (selected-window) (set-buffer (get-file-buffer gfile))) + (unless (zerop archived-count) + (todo-update-count 'archived archived-count goal) + (todo-update-categories-sexp)) + (todo-category-number goal) + ;; If there are only merged done items, show them. + (let ((todo-show-with-done (zerop (todo-get-count 'todo goal)))) + (todo-category-select) + ;; Put point on the first merged item. + (goto-char here)) (set-marker here nil))) ;; ----------------------------------------------------------------------------- @@ -2965,6 +3006,7 @@ (when place (set-window-buffer (selected-window) (set-buffer (find-file-noselect archive))) + (unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode)) (if (member place '(other-archive other-cat)) (setq todo-category-number 1) (todo-category-number cat)) @@ -2997,7 +3039,7 @@ (afile (concat (file-name-sans-extension todo-current-todo-file) ".toda")) (archive (find-file-noselect afile t)) - (item (and (todo-done-item-p) + (item (and (not marked) (todo-done-item-p) (concat (todo-item-string) "\n"))) (count 0) (opoint (unless (todo-done-item-p) (point))) @@ -3040,6 +3082,7 @@ (if (not (or marked all item)) (throw 'end (message "Only done items can be archived")) (with-current-buffer archive + (unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode)) (let (buffer-read-only) (widen) (goto-char (point-min)) @@ -3061,12 +3104,12 @@ (todo-update-categories-sexp) ;; If archive is new, save to file now (with ;; write-region to avoid prompt for file to save to) - ;; to update todo-archives, and to let auto-mode-alist - ;; take effect below on visiting the archive. + ;; to update todo-archives, and set the mode for + ;; visiting the archive below. (unless (nth 7 (file-attributes afile)) (write-region nil nil afile t t) (setq todo-archives (funcall todo-files-function t)) - (kill-buffer)))) + (todo-archive-mode)))) (with-current-buffer tbuf (cond (all @@ -3092,7 +3135,8 @@ (todo-update-count 'done -1) (todo-update-count 'archived 1) ;; Don't leave point below last item. - (and item (bolp) (eolp) (< (point-min) (point-max)) + (and (or marked item) (bolp) (eolp) + (< (point-min) (point-max)) (todo-backward-item)) (when item (throw 'done (setq item nil)))) @@ -3182,15 +3226,16 @@ (throw 'done (setq item nil)))) (todo-forward-item)))) (todo-update-count 'done (if marked (- marked-count) -1) cat) - ;; If that was the last category in the archive, delete the whole file. - (if (= (length todo-categories) 1) - (progn - (delete-file todo-current-todo-file) - ;; Kill the archive buffer silently. - (set-buffer-modified-p nil) - (kill-buffer)) - ;; Otherwise, if the archive category is now empty, delete it. - (when (eq (point-min) (point-max)) + ;; If we unarchived the last item in category, then if that was + ;; the only category, delete the whole file, otherwise, just + ;; delete the category. + (when (= 0 (todo-get-count 'done)) + (if (= 1 (length todo-categories)) + (progn + (delete-file todo-current-todo-file) + ;; Kill the archive buffer silently. + (set-buffer-modified-p nil) + (kill-buffer)) (widen) (let ((beg (re-search-backward (concat "^" (regexp-quote todo-category-beg) cat "$") @@ -3203,8 +3248,8 @@ (remove-overlays beg end) (delete-region beg end) (setq todo-categories (delete (assoc cat todo-categories) - todo-categories)) - (todo-update-categories-sexp)))) + todo-categories))))) + (todo-update-categories-sexp) ;; Visit category in todo file and show restored done items. (let ((tfile (buffer-file-name tbuf)) (todo-show-with-done t)) @@ -3925,7 +3970,9 @@ (setq file (completing-read "Choose a filtered items file: " falist nil t nil nil (car falist))) (setq file (cdr (assoc-string file falist))) - (find-file file))) + (find-file file) + (unless (derived-mode-p 'todo-filtered-items-mode) + (todo-filtered-items-mode)))) (defun todo-go-to-source-item () "Display the file and category of the filtered item at point." @@ -4056,6 +4103,8 @@ (completing-read "Choose a regexp items file: " rxf) 'regexp)))) (find-file fname) + (unless (derived-mode-p 'todo-filtered-items-mode) + (todo-filtered-items-mode)) (todo-prefix-overlays) (todo-check-filtered-items-file)) (t @@ -4309,6 +4358,9 @@ todo-global-current-todo-file))) (find-file-noselect file) (with-current-buffer (find-buffer-visiting file) + (if archive + (unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode)) + (unless (derived-mode-p 'todo-mode) (todo-mode))) (save-restriction (widen) (goto-char (point-min)) @@ -4885,23 +4937,28 @@ ;; Make sure to include newly created archives, e.g. due to ;; todo-move-category. (when (member archive (funcall todo-files-function t)) - (let ((archive-count 0)) - (with-current-buffer (find-file-noselect archive) - (widen) - (goto-char (point-min)) - (when (re-search-forward - (concat "^" (regexp-quote todo-category-beg) - cat "$") - (point-max) t) - (forward-line) - (while (not (or (looking-at - (concat - (regexp-quote todo-category-beg) - "\\(.*\\)\n")) - (eobp))) - (when (looking-at todo-done-string-start) - (setq archive-count (1+ archive-count))) - (forward-line)))) + (let ((archive-count 0) + (visiting (find-buffer-visiting archive))) + (with-current-buffer (or visiting + (find-file-noselect archive)) + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (when (re-search-forward + (concat "^" (regexp-quote todo-category-beg) + cat "$") + (point-max) t) + (forward-line) + (while (not (or (looking-at + (concat + (regexp-quote todo-category-beg) + "\\(.*\\)\n")) + (eobp))) + (when (looking-at todo-done-string-start) + (setq archive-count (1+ archive-count))) + (forward-line))))) + (unless visiting (kill-buffer))) (todo-update-count 'archived archive-count cat)))) ((looking-at todo-done-string-start) (todo-update-count 'done 1 cat)) @@ -5125,6 +5182,11 @@ (if (not (and (file-exists-p file) (find-file-other-window file))) (message "Unable to locate this diary entry") + ;; If it's a Todo file, make sure it's in Todo mode. + (when (and (equal (file-name-directory (file-truename file)) + (file-truename todo-directory)) + (not (derived-mode-p 'todo-mode))) + (todo-mode)) (when (eq major-mode 'todo-mode) (widen)) (goto-char (point-min)) (when (re-search-forward (format "%s.*\\(%s\\)" date content) nil t) @@ -5564,6 +5626,9 @@ (add-to-list 'files curfile)) (dolist (f files listall) (with-current-buffer (find-file-noselect f 'nowarn) + (if archive + (unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode)) + (unless (derived-mode-p 'todo-mode) (todo-mode))) ;; Ensure category is properly displayed in case user ;; switches to file via a non-Todo mode command. And if ;; done items in category are visible, keep them visible. @@ -5616,7 +5681,7 @@ "")))) (unless (file-exists-p todo-directory) (make-directory todo-directory)) - (unless mustmatch + (unless (or mustmatch (member file files)) (setq file (todo-validate-name file 'file))) (setq file (file-truename (concat todo-directory file (if archive ".toda" ".todo")))))) @@ -5649,6 +5714,7 @@ (categories (cond (file0 (with-current-buffer (find-file-noselect file0 'nowarn) + (unless (derived-mode-p 'todo-mode) (todo-mode)) (let ((todo-current-todo-file file0)) todo-categories))) ((and add (not file)) @@ -5915,8 +5981,9 @@ (defun todo-reset-nondiary-marker (symbol value) "The :set function for user option `todo-nondiary-marker'." - (let ((oldvalue (symbol-value symbol)) - (files (append todo-files todo-archives))) + (let* ((oldvalue (symbol-value symbol)) + (files (append todo-files todo-archives + (directory-files todo-directory t "\.tod[rty]$" t)))) (custom-set-default symbol value) ;; Need to reset these to get font-locking right. (setq todo-nondiary-start (nth 0 todo-nondiary-marker) @@ -5927,23 +5994,28 @@ (regexp-quote diary-nonmarking-symbol) "\\)?")) (when (not (equal value oldvalue)) (dolist (f files) - (with-current-buffer (find-file-noselect f) - (let (buffer-read-only) - (widen) - (goto-char (point-min)) - (while (not (eobp)) - (if (re-search-forward - (concat "^\\(" todo-done-string-start "[^][]+] \\)?" - "\\(?1:" (regexp-quote (car oldvalue)) - "\\)" todo-date-pattern "\\( " - diary-time-regexp "\\)?\\(?2:" - (regexp-quote (cadr oldvalue)) "\\)") - nil t) - (progn - (replace-match (nth 0 value) t t nil 1) - (replace-match (nth 1 value) t t nil 2)) - (forward-line))) - (todo-category-select))))))) + (let ((buf (find-buffer-visiting f))) + (with-current-buffer (find-file-noselect f) + (let (buffer-read-only) + (widen) + (goto-char (point-min)) + (while (not (eobp)) + (if (re-search-forward + (concat "^\\(" todo-done-string-start "[^][]+] \\)?" + "\\(?1:" (regexp-quote (car oldvalue)) + "\\)" todo-date-pattern "\\( " + diary-time-regexp "\\)?\\(?2:" + (regexp-quote (cadr oldvalue)) "\\)") + nil t) + (progn + (replace-match (nth 0 value) t t nil 1) + (replace-match (nth 1 value) t t nil 2)) + (forward-line))) + (if buf + (when (derived-mode-p 'todo-mode 'todo-archive-mode) + (todo-category-select)) + (save-buffer) + (kill-buffer))))))))) (defun todo-reset-done-separator-string (symbol value) "The :set function for `todo-done-separator-string'." @@ -5963,51 +6035,63 @@ (defun todo-reset-done-string (symbol value) "The :set function for user option `todo-done-string'." (let ((oldvalue (symbol-value symbol)) - (files (append todo-files todo-archives))) + (files (append todo-files todo-archives + (directory-files todo-directory t "\.todr$" t)))) (custom-set-default symbol value) ;; Need to reset this to get font-locking right. (setq todo-done-string-start (concat "^\\[" (regexp-quote todo-done-string))) (when (not (equal value oldvalue)) (dolist (f files) - (with-current-buffer (find-file-noselect f) - (let (buffer-read-only) - (widen) - (goto-char (point-min)) - (while (not (eobp)) - (if (re-search-forward - (concat "^" (regexp-quote todo-nondiary-start) - "\\(" (regexp-quote oldvalue) "\\)") - nil t) - (replace-match value t t nil 1) - (forward-line))) - (todo-category-select))))))) + (let ((buf (find-buffer-visiting f))) + (with-current-buffer (find-file-noselect f) + (let (buffer-read-only) + (widen) + (goto-char (point-min)) + (while (not (eobp)) + (if (re-search-forward + (concat "^" (regexp-quote todo-nondiary-start) + "\\(" (regexp-quote oldvalue) "\\)") + nil t) + (replace-match value t t nil 1) + (forward-line))) + (if buf + (when (derived-mode-p 'todo-mode 'todo-archive-mode) + (todo-category-select)) + (save-buffer) + (kill-buffer))))))))) (defun todo-reset-comment-string (symbol value) "The :set function for user option `todo-comment-string'." (let ((oldvalue (symbol-value symbol)) - (files (append todo-files todo-archives))) + (files (append todo-files todo-archives + (directory-files todo-directory t "\.todr$" t)))) (custom-set-default symbol value) (when (not (equal value oldvalue)) (dolist (f files) - (with-current-buffer (find-file-noselect f) - (let (buffer-read-only) - (save-excursion + (let ((buf (find-buffer-visiting f))) + (with-current-buffer (find-file-noselect f) + (let (buffer-read-only) (widen) (goto-char (point-min)) (while (not (eobp)) (if (re-search-forward - (concat - "\\[\\(" (regexp-quote oldvalue) "\\): [^]]*\\]") + (concat "\\[\\(" (regexp-quote oldvalue) + "\\): [^]]*\\]") nil t) (replace-match value t t nil 1) (forward-line))) - (todo-category-select)))))))) + (if buf + (when (derived-mode-p 'todo-mode 'todo-archive-mode) + (todo-category-select)) + (save-buffer) + (kill-buffer))))))))) (defun todo-reset-highlight-item (symbol value) - "The :set function for `todo-toggle-item-highlighting'." + "The :set function for user option `todo-highlight-item'." (let ((oldvalue (symbol-value symbol)) - (files (append todo-files todo-archives))) + (files (append todo-files todo-archives + (directory-files todo-directory t "\.tod[rty]$" t)))) (custom-set-default symbol value) (when (not (equal value oldvalue)) (dolist (f files) @@ -6399,20 +6483,20 @@ `todo-show-current-file' is set to non-nil." (setq todo-global-current-todo-file todo-current-todo-file)) -(defun todo-display-as-todo-file () - "Show todo files correctly when visited from outside of Todo mode. -Added to `find-file-hook' in Todo mode and Todo Archive mode." - (and (member this-command todo-visit-files-commands) - (= (- (point-max) (point-min)) (buffer-size)) - (member major-mode '(todo-mode todo-archive-mode)) - (todo-category-select))) +;; (defun todo-display-as-todo-file () +;; "Show todo files correctly when visited from outside of Todo mode. +;; Added to `find-file-hook' in Todo mode and Todo Archive mode." +;; (and (member this-command todo-visit-files-commands) +;; (= (- (point-max) (point-min)) (buffer-size)) +;; (member major-mode '(todo-mode todo-archive-mode)) +;; (todo-category-select))) -(defun todo-add-to-buffer-list () - "Add name of just visited todo file to `todo-file-buffers'. -This function is added to `find-file-hook' in Todo mode." - (let ((filename (file-truename (buffer-file-name)))) - (when (member filename todo-files) - (add-to-list 'todo-file-buffers filename)))) +;; (defun todo-add-to-buffer-list () +;; "Add name of just visited todo file to `todo-file-buffers'. +;; This function is added to `find-file-hook' in Todo mode." +;; (let ((filename (file-truename (buffer-file-name)))) +;; (when (member filename todo-files) +;; (add-to-list 'todo-file-buffers filename)))) (defun todo-update-buffer-list () "Make current Todo mode buffer file car of `todo-file-buffers'. @@ -6467,7 +6551,8 @@ "Make some settings that apply to multiple Todo modes." (setq-local todo-categories (todo-set-categories)) (setq-local todo-category-number 1) - (add-hook 'find-file-hook 'todo-display-as-todo-file nil t)) + ;; (add-hook 'find-file-hook 'todo-display-as-todo-file nil t) + ) (put 'todo-mode 'mode-class 'special) @@ -6486,7 +6571,7 @@ (setq-local todo-current-todo-file (file-truename (buffer-file-name)))) (setq-local todo-show-done-only nil) (setq-local todo-categories-with-marks nil) - (add-hook 'find-file-hook 'todo-add-to-buffer-list nil t) + ;; (add-hook 'find-file-hook 'todo-add-to-buffer-list nil t) (add-hook 'post-command-hook 'todo-update-buffer-list nil t) (when todo-show-current-file (add-hook 'pre-command-hook 'todo-show-current-file nil t)) @@ -6555,13 +6640,6 @@ (todo-modes-set-1) (todo-modes-set-2)) -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.todo\\'" . todo-mode)) -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.toda\\'" . todo-archive-mode)) -;;;###autoload -(add-to-list 'auto-mode-alist '("\\.tod[tyr]\\'" . todo-filtered-items-mode)) - ;; ----------------------------------------------------------------------------- (provide 'todo-mode) === modified file 'lisp/cus-face.el' --- lisp/cus-face.el 2014-01-01 07:43:34 +0000 +++ lisp/cus-face.el 2014-05-25 11:47:34 +0000 @@ -218,6 +218,10 @@ (color :tag "Foreground" :help-echo "Set foreground color (name or #RRGGBB hex spec).")) + (:distant-foreground + (color :tag "Distant Foreground" + :help-echo "Set distant foreground color (name or #RRGGBB hex spec).")) + (:background (color :tag "Background" :help-echo "Set background color (name or #RRGGBB hex spec).")) === modified file 'lisp/emacs-lisp/eieio-opt.el' --- lisp/emacs-lisp/eieio-opt.el 2014-01-30 04:13:00 +0000 +++ lisp/emacs-lisp/eieio-opt.el 2014-05-14 20:41:53 +0000 @@ -141,7 +141,7 @@ (insert " " (aref type counter) " " (prin1-to-string (car cur) (current-buffer)) "\n" - (cdr cur))) + (or (cdr cur) ""))) (setq counter (1+ counter)))) (insert "\n\n") (setq methods (cdr methods)))))) === modified file 'lisp/emacs-lisp/lisp.el' --- lisp/emacs-lisp/lisp.el 2014-04-09 16:58:08 +0000 +++ lisp/emacs-lisp/lisp.el 2014-05-26 02:28:09 +0000 @@ -431,16 +431,18 @@ (push-mark)) (if (or (null arg) (= arg 0)) (setq arg 1)) (let ((pos (point)) - (beg (progn (end-of-line 1) (beginning-of-defun-raw 1) (point)))) + (beg (progn (end-of-line 1) (beginning-of-defun-raw 1) (point))) + (skip (lambda () + ;; When comparing point against pos, we want to consider that if + ;; point was right after the end of the function, it's still + ;; considered as "in that function". + ;; E.g. `eval-defun' from right after the last close-paren. + (unless (bolp) + (skip-chars-forward " \t") + (if (looking-at "\\s<\\|\n") + (forward-line 1)))))) (funcall end-of-defun-function) - ;; When comparing point against pos, we want to consider that if - ;; point was right after the end of the function, it's still - ;; considered as "in that function". - ;; E.g. `eval-defun' from right after the last close-paren. - (unless (bolp) - (skip-chars-forward " \t") - (if (looking-at "\\s<\\|\n") - (forward-line 1))) + (funcall skip) (cond ((> arg 0) ;; Moving forward. @@ -463,11 +465,19 @@ (goto-char beg)) (unless (zerop arg) (beginning-of-defun-raw (- arg)) + (setq beg (point)) (funcall end-of-defun-function)))) - (unless (bolp) - (skip-chars-forward " \t") - (if (looking-at "\\s<\\|\n") - (forward-line 1))))) + (funcall skip) + (while (and (< arg 0) (>= (point) pos)) + ;; We intended to move backward, but this ended up not doing so: + ;; Try harder! + (goto-char beg) + (beginning-of-defun-raw (- arg)) + (if (>= (point) beg) + (setq arg 0) + (setq beg (point)) + (funcall end-of-defun-function) + (funcall skip))))) (defun mark-defun (&optional allow-extend) "Put mark at end of this defun, point at beginning. === modified file 'lisp/emacs-lisp/nadvice.el' --- lisp/emacs-lisp/nadvice.el 2014-05-24 19:51:52 +0000 +++ lisp/emacs-lisp/nadvice.el 2014-05-26 02:28:09 +0000 @@ -180,12 +180,16 @@ (advice--make-1 (nth 1 desc) (nth 2 desc) function main props))))) -(defun advice--member-p (function name definition) +(defun advice--member-p (function use-name definition) (let ((found nil)) (while (and (not found) (advice--p definition)) - (if (if name - (equal name (cdr (assq 'name (advice--props definition)))) - (equal function (advice--car definition))) + (if (if (eq use-name :use-both) + (or (equal function + (cdr (assq 'name (advice--props definition)))) + (equal function (advice--car definition))) + (equal function (if use-name + (cdr (assq 'name (advice--props definition))) + (advice--car definition)))) (setq found definition) (setq definition (advice--cdr definition)))) found)) @@ -292,7 +296,7 @@ ;;;###autoload (defun advice--add-function (where ref function props) (let* ((name (cdr (assq 'name props))) - (a (advice--member-p function name (gv-deref ref)))) + (a (advice--member-p (or name function) (if name t) (gv-deref ref)))) (when a ;; The advice is already present. Remove the old one, first. (setf (gv-deref ref) @@ -324,7 +328,7 @@ "Return non-nil if ADVICE is already in FUNCTION-DEF. Instead of ADVICE being the actual function, it can also be the `name' of the piece of advice." - (advice--member-p advice advice function-def)) + (advice--member-p advice :use-both function-def)) ;;;; Specific application of add-function to `symbol-function' for advice. === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2014-05-25 16:53:28 +0000 +++ lisp/emacs-lisp/package.el 2014-05-26 02:28:09 +0000 @@ -1266,10 +1266,7 @@ ;; may fetch a URL redirect page). (when (listp (read (current-buffer))) (make-directory dir t) - (setq buffer-file-name (expand-file-name file dir)) - (let ((version-control 'never) - (require-final-newline nil)) - (save-buffer)))) + (write-region nil nil (expand-file-name file dir) nil 'silent))) (when good-signatures ;; Write out good signatures into archive-contents.signed file. (write-region (mapconcat #'epg-signature-to-string good-signatures "\n") @@ -1515,11 +1512,13 @@ (package--with-work-buffer (package-archive-base desc) (format "%s-readme.txt" name) - (setq buffer-file-name - (expand-file-name readme package-user-dir)) - (let ((version-control 'never) - (require-final-newline t)) - (save-buffer)) + (save-excursion + (goto-char (point-max)) + (unless (bolp) + (insert ?\n))) + (write-region nil nil + (expand-file-name readme package-user-dir) + nil 'silent) (setq readme-string (buffer-string)) t)) (error nil)) === modified file 'lisp/emacs-lisp/timer.el' --- lisp/emacs-lisp/timer.el 2014-02-10 01:34:22 +0000 +++ lisp/emacs-lisp/timer.el 2014-05-18 13:17:10 +0000 @@ -290,42 +290,50 @@ (cell ;; Delete from queue. Record the cons cell that was used. (cancel-timer-internal timer))) - ;; Re-schedule if requested. - (if (timer--repeat-delay timer) - (if (timer--idle-delay timer) - (timer-activate-when-idle timer nil cell) - (timer-inc-time timer (timer--repeat-delay timer) 0) - ;; If real time has jumped forward, - ;; perhaps because Emacs was suspended for a long time, - ;; limit how many times things get repeated. - (if (and (numberp timer-max-repeats) - (< 0 (timer-until timer (current-time)))) - (let ((repeats (/ (timer-until timer (current-time)) - (timer--repeat-delay timer)))) - (if (> repeats timer-max-repeats) - (timer-inc-time timer (* (timer--repeat-delay timer) - repeats))))) - ;; Place it back on the timer-list before running - ;; timer--function, so it can cancel-timer itself. - (timer-activate timer t cell) - (setq retrigger t))) - ;; Run handler. - (condition-case-unless-debug err - ;; Timer functions should not change the current buffer. - ;; If they do, all kinds of nasty surprises can happen, - ;; and it can be hellish to track down their source. - (save-current-buffer - (apply (timer--function timer) (timer--args timer))) - (error (message "Error running timer%s: %S" - (if (symbolp (timer--function timer)) - (format " `%s'" (timer--function timer)) "") - err))) - (when (and retrigger - ;; If the timer's been canceled, don't "retrigger" it - ;; since it might still be in the copy of timer-list kept - ;; by keyboard.c:timer_check (bug#14156). - (memq timer timer-list)) - (setf (timer--triggered timer) nil))))) + ;; If `cell' is nil, it means the timer was already canceled, so we + ;; shouldn't be running it at all. This can happen for example with the + ;; following scenario (bug#17392): + ;; - we run timers, starting with A (and remembering the rest as (B C)). + ;; - A runs and a does a sit-for. + ;; - during sit-for we run timer D which cancels timer B. + ;; - timer A finally finishes, so we move on to timers B and C. + (when cell + ;; Re-schedule if requested. + (if (timer--repeat-delay timer) + (if (timer--idle-delay timer) + (timer-activate-when-idle timer nil cell) + (timer-inc-time timer (timer--repeat-delay timer) 0) + ;; If real time has jumped forward, + ;; perhaps because Emacs was suspended for a long time, + ;; limit how many times things get repeated. + (if (and (numberp timer-max-repeats) + (< 0 (timer-until timer (current-time)))) + (let ((repeats (/ (timer-until timer (current-time)) + (timer--repeat-delay timer)))) + (if (> repeats timer-max-repeats) + (timer-inc-time timer (* (timer--repeat-delay timer) + repeats))))) + ;; Place it back on the timer-list before running + ;; timer--function, so it can cancel-timer itself. + (timer-activate timer t cell) + (setq retrigger t))) + ;; Run handler. + (condition-case-unless-debug err + ;; Timer functions should not change the current buffer. + ;; If they do, all kinds of nasty surprises can happen, + ;; and it can be hellish to track down their source. + (save-current-buffer + (apply (timer--function timer) (timer--args timer))) + (error (message "Error running timer%s: %S" + (if (symbolp (timer--function timer)) + (format " `%s'" (timer--function timer)) "") + err))) + (when (and retrigger + ;; If the timer's been canceled, don't "retrigger" it + ;; since it might still be in the copy of timer-list kept + ;; by keyboard.c:timer_check (bug#14156). + (memq timer timer-list)) + (setf (timer--triggered timer) nil)))))) ;; This function is incompatible with the one in levents.el. (defun timeout-event-p (event) === modified file 'lisp/frame.el' --- lisp/frame.el 2014-04-13 07:49:23 +0000 +++ lisp/frame.el 2014-05-21 16:35:31 +0000 @@ -1107,10 +1107,10 @@ If FRAMES is nil, apply the font to the selected frame only. If FRAMES is non-nil, it should be a list of frames to act upon, -or t meaning all graphical frames. Also, if FRAME is non-nil, -alter the user's Customization settings as though the -font-related attributes of the `default' face had been \"set in -this session\", so that the font is applied to future frames." +or t meaning all existing graphical frames. +Also, if FRAMES is non-nil, alter the user's Customization settings +as though the font-related attributes of the `default' face had been +\"set in this session\", so that the font is applied to future frames." (interactive (let* ((completion-ignore-case t) (font (completing-read "Font name: " @@ -1822,9 +1822,7 @@ :initialize 'custom-initialize-delay :group 'cursor :global t - (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer)) - (setq blink-cursor-idle-timer nil) - (blink-cursor-end) + (blink-cursor-suspend) (remove-hook 'focus-in-hook #'blink-cursor-check) (remove-hook 'focus-out-hook #'blink-cursor-suspend) (when blink-cursor-mode === modified file 'lisp/hippie-exp.el' --- lisp/hippie-exp.el 2014-02-10 01:34:22 +0000 +++ lisp/hippie-exp.el 2014-05-23 18:14:24 +0000 @@ -715,7 +715,7 @@ (defun he-line-search-regexp (pat strip-prompt) (if strip-prompt - (concat "\\(" comint-prompt-regexp "\\|^\\s-*\\)\\(" + (concat "\\(" comint-prompt-regexp "\\|^\\s-*\\)\\(?2:" (regexp-quote pat) "[^\n]*[^ \t\n]\\)") (concat "^\\(\\s-*\\)\\(" === modified file 'lisp/menu-bar.el' --- lisp/menu-bar.el 2014-05-01 23:55:25 +0000 +++ lisp/menu-bar.el 2014-05-21 16:35:31 +0000 @@ -662,7 +662,7 @@ ;; Function for setting/saving default font. (defun menu-set-font () - "Interactively select a font and make it the default." + "Interactively select a font and make it the default on all existing frames." (interactive) (set-frame-font (if (fboundp 'x-select-font) (x-select-font) === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2014-05-23 15:54:44 +0000 +++ lisp/minibuffer.el 2014-05-26 02:28:09 +0000 @@ -529,7 +529,7 @@ (let* ((qpos pred) (ustring (funcall unquote string)) (uprefix (funcall unquote (substring string 0 qpos))) - ;; FIXME: we really should pass `qpos' to `unuote' and have that + ;; FIXME: we really should pass `qpos' to `unquote' and have that ;; function give us the corresponding `uqpos'. But for now we ;; presume (more or less) that `concat' and `unquote' commute. (uqpos (if (string-prefix-p uprefix ustring) === modified file 'lisp/mouse.el' --- lisp/mouse.el 2014-05-11 05:49:14 +0000 +++ lisp/mouse.el 2014-05-26 02:28:09 +0000 @@ -26,8 +26,6 @@ ;; This package provides various useful commands (including help ;; system access) through the mouse. All this code assumes that mouse ;; interpretation has been abstracted into Emacs input events. -;; -;; The code is rather X-dependent. ;;; Code: === modified file 'lisp/net/dbus.el' --- lisp/net/dbus.el 2014-02-27 15:41:13 +0000 +++ lisp/net/dbus.el 2014-05-16 13:11:09 +0000 @@ -277,6 +277,8 @@ => \"i686\"" + (or (featurep 'dbusbind) + (signal 'dbus-error (list "Emacs not compiled with dbus support"))) (or (memq bus '(:system :session)) (stringp bus) (signal 'wrong-type-argument (list 'keywordp bus))) (or (stringp service) @@ -380,6 +382,8 @@ -| i686" + (or (featurep 'dbusbind) + (signal 'dbus-error (list "Emacs not compiled with dbus support"))) (or (memq bus '(:system :session)) (stringp bus) (signal 'wrong-type-argument (list 'keywordp bus))) (or (stringp service) @@ -428,6 +432,8 @@ :session nil \"/org/gnu/Emacs\" \"org.gnu.Emacs.FileManager\" \"FileModified\" \"/home/albinus/.emacs\")" + (or (featurep 'dbusbind) + (signal 'dbus-error (list "Emacs not compiled with dbus support"))) (or (memq bus '(:system :session)) (stringp bus) (signal 'wrong-type-argument (list 'keywordp bus))) (or (null service) (stringp service) @@ -446,6 +452,8 @@ "Return for message SERIAL on the D-Bus BUS. This is an internal function, it shall not be used outside dbus.el." + (or (featurep 'dbusbind) + (signal 'dbus-error (list "Emacs not compiled with dbus support"))) (or (memq bus '(:system :session)) (stringp bus) (signal 'wrong-type-argument (list 'keywordp bus))) (or (stringp service) @@ -460,6 +468,8 @@ "Return error message for message SERIAL on the D-Bus BUS. This is an internal function, it shall not be used outside dbus.el." + (or (featurep 'dbusbind) + (signal 'dbus-error (list "Emacs not compiled with dbus support"))) (or (memq bus '(:system :session)) (stringp bus) (signal 'wrong-type-argument (list 'keywordp bus))) (or (stringp service) @@ -1763,6 +1773,8 @@ GTK+. It should be used with care for at least the `:system' and `:session' buses, because other Emacs Lisp packages might already use this connection to those buses." + (or (featurep 'dbusbind) + (signal 'dbus-error (list "Emacs not compiled with dbus support"))) (dbus--init-bus bus private) (dbus-register-signal bus nil dbus-path-local dbus-interface-local === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2014-05-06 09:51:05 +0000 +++ lisp/net/tramp-sh.el 2014-05-17 09:00:54 +0000 @@ -4137,7 +4137,7 @@ tmpfile) (while (string-match (regexp-quote "-") name) (setq name (replace-match "_" nil t name))) - (when (string-match "%t" value) + (when (string-match "\\(^\\|[^%]\\)%t" value) (setq tmpfile (make-temp-name (expand-file-name === modified file 'lisp/nxml/nxml-mode.el' --- lisp/nxml/nxml-mode.el 2014-04-16 15:28:26 +0000 +++ lisp/nxml/nxml-mode.el 2014-05-21 20:07:27 +0000 @@ -2630,8 +2630,9 @@ (put 'entity-ref 'nxml-friendly-name "entity reference") (put 'char-ref 'nxml-friendly-name "character reference") -;;;###autoload -(defalias 'xml-mode 'nxml-mode) +;; Only do this in loaddefs, so that if someone defines a different +;; alias in .emacs, loading this file afterwards does not clobber it. +;;;###autoload(defalias 'xml-mode 'nxml-mode) (provide 'nxml-mode) === modified file 'lisp/progmodes/scheme.el' --- lisp/progmodes/scheme.el 2014-04-24 22:37:28 +0000 +++ lisp/progmodes/scheme.el 2014-05-26 02:28:09 +0000 @@ -99,7 +99,7 @@ (modify-syntax-entry ?\( "() " st) (modify-syntax-entry ?\) ")( " st) ;; It's used for single-line comments as well as for #;(...) sexp-comments. - (modify-syntax-entry ?\; "< 2 " st) + (modify-syntax-entry ?\; "<" st) (modify-syntax-entry ?\" "\" " st) (modify-syntax-entry ?' "' " st) (modify-syntax-entry ?` "' " st) @@ -147,19 +147,15 @@ (setq-local lisp-indent-function 'scheme-indent-function) (setq mode-line-process '("" scheme-mode-line-process)) (setq-local imenu-case-fold-search t) - (setq imenu-generic-expression scheme-imenu-generic-expression) - (setq-local imenu-syntax-alist - '(("+-*/.<>=?!$%_&~^:" . "w"))) + (setq-local imenu-generic-expression scheme-imenu-generic-expression) + (setq-local imenu-syntax-alist '(("+-*/.<>=?!$%_&~^:" . "w"))) + (setq-local syntax-propertize-function #'scheme-syntax-propertize) (setq font-lock-defaults '((scheme-font-lock-keywords scheme-font-lock-keywords-1 scheme-font-lock-keywords-2) nil t (("+-*/.<>=!?$%_&~^:" . "w") (?#. "w 14")) beginning-of-defun - (font-lock-mark-block-function . mark-defun) - (font-lock-syntactic-face-function - . scheme-font-lock-syntactic-face-function) - (parse-sexp-lookup-properties . t) - (font-lock-extra-managed-props syntax-table))) + (font-lock-mark-block-function . mark-defun))) (setq-local lisp-doc-string-elt-property 'scheme-doc-string-elt)) (defvar scheme-mode-line-process "") @@ -354,28 +350,28 @@ (forward-comment (point-max)) (if (eq (char-after) ?\() 2 0))) -(defun scheme-font-lock-syntactic-face-function (state) - (when (and (null (nth 3 state)) - (eq (char-after (nth 8 state)) ?#) - (eq (char-after (1+ (nth 8 state))) ?\;)) - ;; It's a sexp-comment. Tell parse-partial-sexp where it ends. - (save-excursion - (let ((pos (point)) - (end - (condition-case err - (let ((parse-sexp-lookup-properties nil)) - (goto-char (+ 2 (nth 8 state))) - ;; FIXME: this doesn't handle the case where the sexp - ;; itself contains a #; comment. - (forward-sexp 1) - (point)) - (scan-error (nth 2 err))))) - (when (< pos (- end 2)) - (put-text-property pos (- end 2) - 'syntax-table scheme-sexp-comment-syntax-table)) - (put-text-property (- end 1) end 'syntax-table '(12))))) - ;; Choose the face to use. - (lisp-font-lock-syntactic-face-function state)) +(defun scheme-syntax-propertize (beg end) + (goto-char beg) + (scheme-syntax-propertize-sexp-comment (point) end) + (funcall + (syntax-propertize-rules + ("\\(#\\);" (1 (prog1 "< cn" + (scheme-syntax-propertize-sexp-comment (point) end))))) + (point) end)) + +(defun scheme-syntax-propertize-sexp-comment (_ end) + (let ((state (syntax-ppss))) + (when (eq 2 (nth 7 state)) + ;; It's a sexp-comment. Tell parse-partial-sexp where it ends. + (condition-case nil + (progn + (goto-char (+ 2 (nth 8 state))) + ;; FIXME: this doesn't handle the case where the sexp + ;; itself contains a #; comment. + (forward-sexp 1) + (put-text-property (1- (point)) (point) + 'syntax-table (string-to-syntax "> cn"))) + (scan-error (goto-char end)))))) ;;;###autoload (define-derived-mode dsssl-mode scheme-mode "DSSSL" === modified file 'lisp/simple.el' --- lisp/simple.el 2014-05-13 20:34:12 +0000 +++ lisp/simple.el 2014-05-26 02:28:09 +0000 @@ -5069,7 +5069,15 @@ `most-positive-fixnum'.") (defcustom line-move-ignore-invisible t - "Non-nil means \\[next-line] and \\[previous-line] ignore invisible lines. + "Non-nil means commands that move by lines ignore invisible newlines. +When this option is non-nil, \\[next-line], \\[previous-line], \\[move-end-of-line], and \\[move-beginning-of-line] behave +as if newlines that are invisible didn't exist, and count +only visible newlines. Thus, moving across across 2 newlines +one of which is invisible will be counted as a one-line move. +Also, a non-nil value causes invisible text to be ignored when +counting columns for the purposes of keeping point in the same +column by \\[next-line] and \\[previous-line]. + Outline mode sets this." :type 'boolean :group 'editing-basics) === modified file 'lisp/vc/vc-rcs.el' --- lisp/vc/vc-rcs.el 2014-01-01 07:43:34 +0000 +++ lisp/vc/vc-rcs.el 2014-05-20 15:46:21 +0000 @@ -886,10 +886,9 @@ (minor-num (string-to-number (vc-rcs-minor-part rev)))) (concat branch "." (number-to-string (1+ minor-num)))))) -;; Note that most GNU/Linux distributions seem to supply rcs2log in a -;; standard bin directory. Eg both Red Hat and Debian include it in -;; their cvs packages. It's not obvious why Emacs still needs to -;; provide it as well... +;; You might think that this should be distributed with RCS, but +;; apparently not. CVS sometimes provides a version of it. +;; http://lists.gnu.org/archive/html/emacs-devel/2014-05/msg00288.html (defvar vc-rcs-rcs2log-program (let (exe) (cond ((file-executable-p === modified file 'lisp/window.el' --- lisp/window.el 2014-03-16 09:26:58 +0000 +++ lisp/window.el 2014-05-25 10:06:35 +0000 @@ -1079,7 +1079,6 @@ selected frame. When WINDOW-OR-FRAME is a window, dump that window's frame. The buffer *window-frame-dump* is erased before dumping to it." - (interactive) (let* ((window (cond ((or (not window-or-frame) @@ -1102,7 +1101,9 @@ (frame-text-width frame) (frame-text-height frame) (frame-text-cols frame) (frame-text-lines frame)) (format "tool: %s scroll: %s fringe: %s border: %s right: %s bottom: %s\n\n" - (tool-bar-height frame t) + (if (fboundp 'tool-bar-height) + (tool-bar-height frame t) + "0") (frame-scroll-bar-width frame) (frame-fringe-width frame) (frame-border-width frame) === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-25 10:28:52 +0000 +++ src/ChangeLog 2014-05-26 02:28:09 +0000 @@ -1,3 +1,52 @@ +2014-05-26 Eli Zaretskii + + * xdisp.c (move_it_in_display_line_to): Don't record wrap position + if we are iterating over an object that generates glyphs for + marginal areas. (Bug#17585) + +2014-05-26 Paul Eggert + + * xdisp.c (safe__call1, safe__eval): Now static. + +2014-05-26 Eli Zaretskii + + * xdisp.c (safe__call): Accept va_list argument instead of '...'. + (safe_call, safe__call1): Construct a va_list argument for safe_call. + (safe_call1): Call safe_call instead of safe__call directly. + +2014-05-26 Ken Brown + + * w32term.c (x_delete_display) [CYGWIN]: Don't free + dpyinfo->w32_id_name, to make sure it doesn't get freed more than + once. (Bug#17510) + +2014-05-26 Stefan Monnier + + * xdisp.c: Bind inhibit-quit during pre-redisplay-function. + (safe__call, safe__call1, safe__eval): New functions. + (safe_call): Use it. + (prepare_menu_bars): Use it for pre-redisplay-function (bug#17577). + (display_mode_element): Same for `:eval'. + +2014-05-26 Paul Eggert + + Fix port to 32-bit AIX (Bug#17540). + * unexaix.c (copy_text_and_data): Don't add text_scnptr to ptr + twice. _text already includes this offset. + (unrelocate_symbols): Don't cast 64-bit integer to pointer. + +2014-05-26 Eli Zaretskii + + * xdisp.c (move_it_in_display_line_to): Avoid infinite recursion: + when closest_pos is identical to to_charpos, don't recurse, since + we already tried that, and failed. (Bug#17539) + + * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: If we are + unwinding when frame's faces were not initialized yet, increment + the frame's image-cache reference count before calling + x_free_frame_resources. Don't dereference + dpyinfo->terminal->image_cache if it is NULL. (Bug#17524) + 2014-05-25 Jan Djärv * nsfont.m (nsfont_draw): Simplify as arguments are adjusted in === modified file 'src/lisp.h' --- src/lisp.h 2014-05-22 16:40:35 +0000 +++ src/lisp.h 2014-05-26 02:28:09 +0000 @@ -1718,8 +1718,8 @@ ratio, a float. */ Lisp_Object rehash_threshold; - /* Vector of hash codes.. If hash[I] is nil, this means that that - entry I is unused. */ + /* Vector of hash codes. If hash[I] is nil, this means that the + I-th entry is unused. */ Lisp_Object hash; /* Vector used to chain entries. If entry I is free, next[I] is the === modified file 'src/minibuf.c' --- src/minibuf.c 2014-05-08 03:41:21 +0000 +++ src/minibuf.c 2014-05-26 02:28:09 +0000 @@ -396,7 +396,8 @@ in previous recursive minibuffer, but was not set explicitly to t for this invocation, so set it to nil in this minibuffer. Save the old value now, before we change it. */ - specbind (intern ("minibuffer-completing-file-name"), Vminibuffer_completing_file_name); + specbind (intern ("minibuffer-completing-file-name"), + Vminibuffer_completing_file_name); if (EQ (Vminibuffer_completing_file_name, Qlambda)) Vminibuffer_completing_file_name = Qnil; === modified file 'src/unexaix.c' --- src/unexaix.c 2014-01-01 07:43:34 +0000 +++ src/unexaix.c 2014-05-22 05:00:39 +0000 @@ -379,7 +379,7 @@ char *ptr; lseek (new, text_scnptr, SEEK_SET); - ptr = _text + text_scnptr; + ptr = _text; end = ptr + f_ohdr.tsize; write_segment (new, ptr, end); @@ -606,7 +606,7 @@ PERROR (a_name); } - p = (int *) (ldrel.l_vaddr + d_reloc); + p = (int *) (intptr_t) (ldrel.l_vaddr + d_reloc); switch (ldrel.l_symndx) { case SYMNDX_TEXT: === modified file 'src/w32fns.c' --- src/w32fns.c 2014-05-08 03:41:21 +0000 +++ src/w32fns.c 2014-05-26 02:28:09 +0000 @@ -4244,6 +4244,17 @@ { #ifdef GLYPH_DEBUG struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); + + /* If the frame's image cache refcount is still the same as our + private shadow variable, it means we are unwinding a frame + for which we didn't yet call init_frame_faces, where the + refcount is incremented. Therefore, we increment it here, so + that free_frame_faces, called in x_free_frame_resources + below, will not mistakenly decrement the counter that was not + incremented yet to account for this new frame. */ + if (FRAME_IMAGE_CACHE (f) != NULL + && FRAME_IMAGE_CACHE (f)->refcount == image_cache_refcount) + FRAME_IMAGE_CACHE (f)->refcount++; #endif x_free_frame_resources (f); @@ -4254,7 +4265,8 @@ eassert (dpyinfo->reference_count == dpyinfo_refcount); eassert ((dpyinfo->terminal->image_cache == NULL && image_cache_refcount == 0) - || dpyinfo->terminal->image_cache->refcount == image_cache_refcount); + || (dpyinfo->terminal->image_cache != NULL + && dpyinfo->terminal->image_cache->refcount == image_cache_refcount)); #endif return Qt; } === modified file 'src/w32term.c' --- src/w32term.c 2014-05-14 13:55:37 +0000 +++ src/w32term.c 2014-05-26 02:28:09 +0000 @@ -6419,7 +6419,11 @@ if (dpyinfo->palette) DeleteObject (dpyinfo->palette); } + /* Avoid freeing dpyinfo->w32_id_name more than once if emacs is + running as a daemon; see bug#17510. */ +#ifndef CYGWIN xfree (dpyinfo->w32_id_name); +#endif w32_reset_fringes (); } === modified file 'src/xdisp.c' --- src/xdisp.c 2014-05-12 08:57:59 +0000 +++ src/xdisp.c 2014-05-26 02:28:09 +0000 @@ -2591,8 +2591,8 @@ following. Return the result, or nil if something went wrong. Prevent redisplay during the evaluation. */ -Lisp_Object -safe_call (ptrdiff_t nargs, Lisp_Object func, ...) +static Lisp_Object +safe__call (bool inhibit_quit, ptrdiff_t nargs, Lisp_Object func, va_list ap) { Lisp_Object val; @@ -2600,21 +2600,20 @@ val = Qnil; else { - va_list ap; ptrdiff_t i; ptrdiff_t count = SPECPDL_INDEX (); struct gcpro gcpro1; Lisp_Object *args = alloca (nargs * word_size); args[0] = func; - va_start (ap, func); for (i = 1; i < nargs; i++) args[i] = va_arg (ap, Lisp_Object); - va_end (ap); GCPRO1 (args[0]); gcpro1.nvars = nargs; specbind (Qinhibit_redisplay, Qt); + if (inhibit_quit) + specbind (Qinhibit_quit, Qt); /* Use Qt to ensure debugger does not run, so there is no possibility of wanting to redisplay. */ val = internal_condition_case_n (Ffuncall, nargs, args, Qt, @@ -2626,6 +2625,17 @@ return val; } +Lisp_Object +safe_call (ptrdiff_t nargs, Lisp_Object func, ...) +{ + Lisp_Object retval; + va_list ap; + + va_start (ap, func); + retval = safe__call (false, nargs, func, ap); + va_end (ap); + return retval; +} /* Call function FN with one argument ARG. Return the result, or nil if something went wrong. */ @@ -2636,12 +2646,30 @@ return safe_call (2, fn, arg); } +static Lisp_Object +safe__call1 (bool inhibit_quit, Lisp_Object fn, ...) +{ + Lisp_Object retval; + va_list ap; + + va_start (ap, fn); + retval = safe__call (inhibit_quit, 2, fn, ap); + va_end (ap); + return retval; +} + static Lisp_Object Qeval; Lisp_Object safe_eval (Lisp_Object sexpr) { - return safe_call1 (Qeval, sexpr); + return safe__call1 (false, Qeval, sexpr); +} + +static Lisp_Object +safe__eval (bool inhibit_quit, Lisp_Object sexpr) +{ + return safe__call1 (inhibit_quit, Qeval, sexpr); } /* Call function FN with two arguments ARG1 and ARG2. @@ -8528,7 +8556,7 @@ } else { - if (it->line_wrap == WORD_WRAP) + if (it->line_wrap == WORD_WRAP && it->area == TEXT_AREA) { if (IT_DISPLAYING_WHITESPACE (it)) may_wrap = 1; @@ -8812,8 +8840,11 @@ if (closest_pos < ZV) { RESTORE_IT (it, &ppos_it, ppos_data); - move_it_in_display_line_to (it, closest_pos, -1, - MOVE_TO_POS); + /* Don't recurse if closest_pos is equal to + to_charpos, since we have just tried that. */ + if (closest_pos != to_charpos) + move_it_in_display_line_to (it, closest_pos, -1, + MOVE_TO_POS); result = MOVE_POS_MATCH_OR_ZV; } else @@ -8874,8 +8905,9 @@ && !at_eob_p && closest_pos < ZV) { RESTORE_IT (it, &ppos_it, ppos_data); - move_it_in_display_line_to (it, closest_pos, -1, - MOVE_TO_POS); + if (closest_pos != to_charpos) + move_it_in_display_line_to (it, closest_pos, -1, + MOVE_TO_POS); } result = MOVE_POS_MATCH_OR_ZV; break; @@ -8893,7 +8925,9 @@ if (closest_pos < ZV) { RESTORE_IT (it, &ppos_it, ppos_data); - move_it_in_display_line_to (it, closest_pos, -1, MOVE_TO_POS); + if (closest_pos != to_charpos) + move_it_in_display_line_to (it, closest_pos, -1, + MOVE_TO_POS); } result = MOVE_POS_MATCH_OR_ZV; break; @@ -11543,7 +11577,7 @@ } } } - safe_call1 (Vpre_redisplay_function, windows); + safe__call1 (true, Vpre_redisplay_function, windows); } /* Update all frame titles based on their buffer names, etc. We do @@ -21857,7 +21891,7 @@ if (CONSP (XCDR (elt))) { Lisp_Object spec; - spec = safe_eval (XCAR (XCDR (elt))); + spec = safe__eval (true, XCAR (XCDR (elt))); n += display_mode_element (it, depth, field_width - n, precision - n, spec, props, risky); === modified file 'test/automated/advice-tests.el' --- test/automated/advice-tests.el 2014-05-10 20:07:01 +0000 +++ test/automated/advice-tests.el 2014-05-23 16:17:14 +0000 @@ -184,6 +184,7 @@ (sm-advice (lambda (x) (if (consp x) (list (* 5 (car x))) (* 4 x))))) (should (equal (funcall sm-test10 5) 15)) (add-function :filter-args (var sm-test10) sm-advice) + (should (advice-function-member-p sm-advice sm-test10)) (should (equal (funcall sm-test10 5) 35)) (add-function :filter-return (var sm-test10) sm-advice) (should (equal (funcall sm-test10 5) 60)) ------------------------------------------------------------ revno: 117153 committer: Tassilo Horn branch nick: build timestamp: Sun 2014-05-25 19:40:54 +0200 message: Improve reftex-format-special * lisp/textmodes/reftex-ref.el (reftex-format-special): Make it work also for AMS Math's \eqref macro. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-25 16:53:28 +0000 +++ lisp/ChangeLog 2014-05-25 17:40:54 +0000 @@ -1,3 +1,8 @@ +2014-05-25 Tassilo Horn + + * textmodes/reftex-ref.el (reftex-format-special): Make it work + also for AMS Math's \eqref macro. + 2014-05-25 Thien-Thi Nguyen Arrange to never byte-compile the generated -pkg.el file. === modified file 'lisp/textmodes/reftex-ref.el' --- lisp/textmodes/reftex-ref.el 2014-03-29 00:53:32 +0000 +++ lisp/textmodes/reftex-ref.el 2014-05-25 17:40:54 +0000 @@ -840,8 +840,11 @@ Replace any occurrences of \"\\ref\" with REFSTYLE." ;; Replace instances of \ref in `fmt' with the special reference ;; style selected by the user. - (while (string-match "\\(\\\\ref\\)[ \t]*{" fmt) - (setq fmt (replace-match refstyle t t fmt 1))) + (cond + ((while (string-match "\\(\\\\ref\\)[ \t]*{" fmt) + (setq fmt (replace-match refstyle t t fmt 1)))) + ((string-match "\\(\\\\[[:alpha:]]+\\)[ \t]*{" fmt) + (setq fmt (replace-match refstyle t t fmt 1)))) (format fmt label)) ;;;###autoload ------------------------------------------------------------ revno: 117152 committer: Thien-Thi Nguyen branch nick: trunk timestamp: Sun 2014-05-25 18:53:28 +0200 message: Arrange to never byte-compile the generated -pkg.el file. * lisp/emacs-lisp/package.el (package-generate-description-file): Output first-line comment to set buffer-local var `no-byte-compile'. Suggested by Dmitry Gutov: . diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-25 16:32:08 +0000 +++ lisp/ChangeLog 2014-05-25 16:53:28 +0000 @@ -1,5 +1,14 @@ 2014-05-25 Thien-Thi Nguyen + Arrange to never byte-compile the generated -pkg.el file. + + * emacs-lisp/package.el (package-generate-description-file): + Output first-line comment to set buffer-local var `no-byte-compile'. + Suggested by Dmitry Gutov: + . + +2014-05-25 Thien-Thi Nguyen + Fix bug: Properly quote args to generated -pkg.el `define-package'. * emacs-lisp/package.el (package-generate-description-file): === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2014-05-25 16:32:08 +0000 +++ lisp/emacs-lisp/package.el 2014-05-25 16:53:28 +0000 @@ -688,6 +688,7 @@ (print-length nil)) (write-region (concat + ";;; -*- no-byte-compile: t -*-\n" (prin1-to-string (nconc (list 'define-package ------------------------------------------------------------ revno: 117151 committer: Thien-Thi Nguyen branch nick: trunk timestamp: Sun 2014-05-25 18:32:08 +0200 message: Fix bug: Properly quote args to generated -pkg.el `define-package'. * lisp/emacs-lisp/package.el (package-generate-description-file): Inline `package--alist-to-plist'; rewrite to selectively quote alist values that are not self-quoting. (package--alist-to-plist): Delete func. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-25 08:08:24 +0000 +++ lisp/ChangeLog 2014-05-25 16:32:08 +0000 @@ -1,3 +1,12 @@ +2014-05-25 Thien-Thi Nguyen + + Fix bug: Properly quote args to generated -pkg.el `define-package'. + + * emacs-lisp/package.el (package-generate-description-file): + Inline `package--alist-to-plist'; rewrite to selectively + quote alist values that are not self-quoting. + (package--alist-to-plist): Delete func. + 2014-05-25 Andreas Schwab * term/xterm.el (xterm-function-map): Add mapping for shifted === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2014-05-06 18:11:16 +0000 +++ lisp/emacs-lisp/package.el 2014-05-25 16:32:08 +0000 @@ -702,14 +702,25 @@ (list (car elt) (package-version-join (cadr elt)))) requires)))) - (package--alist-to-plist - (package-desc-extras pkg-desc)))) + (let ((alist (package-desc-extras pkg-desc)) + flat) + (while alist + (let* ((pair (pop alist)) + (key (car pair)) + (val (cdr pair))) + ;; Don't bother ‘quote’ing ‘key’; it is always a keyword. + (push key flat) + (push (if (and (not (consp val)) + (or (keywordp val) + (not (symbolp val)) + (memq val '(nil t)))) + val + `',val) + flat))) + (nreverse flat)))) "\n") nil pkg-file nil 'silent)))) -(defun package--alist-to-plist (alist) - (apply #'nconc (mapcar (lambda (pair) (list (car pair) (cdr pair))) alist))) - (defun package-unpack (pkg-desc) "Install the contents of the current buffer as a package." (let* ((name (package-desc-name pkg-desc)) ------------------------------------------------------------ revno: 117150 committer: Jan D. branch nick: trunk timestamp: Sun 2014-05-25 15:44:14 +0200 message: * admin/mac/uvs.el: New file from Mac port. src/macuvs.h is generated by it. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2014-05-17 08:11:31 +0000 +++ admin/ChangeLog 2014-05-25 13:44:14 +0000 @@ -1,3 +1,8 @@ +2014-05-25 Jan Djärv + + * mac/uvs.el: New file from Mac port. src/macuvs.h is generated + by it. + 2014-05-17 Paul Eggert Assume C99 or later (Bug#17487). === added directory 'admin/mac' === added file 'admin/mac/uvs.el' --- admin/mac/uvs.el 1970-01-01 00:00:00 +0000 +++ admin/mac/uvs.el 2014-05-25 13:44:14 +0000 @@ -0,0 +1,213 @@ +;;; uvs.el --- utility for UVS (format 14) cmap subtables in OpenType fonts. + +;; Copyright (C) 2014 Free Software Foundation, Inc. + +;; Author: YAMAMOTO Mitsuharu + +;; 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 . + +;;; Commentary: + +;; To extract a C array definition of a UVS table for the Adobe-Japan1 +;; character collection from an IVD Sequences file, execute +;; $ emacs -batch -l uvs.el \ +;; --eval '(uvs-print-table-ivd "IVD_Sequences.txt" "Adobe-Japan1")' \ +;; > uvs.h + +;;; Code: + +(defun uvs-fields-total-size (fields) + (apply '+ (mapcar (lambda (field) (get field 'uvs-field-size)) fields))) + +;;; Fields in Format 14 header. +(defconst uvs-format-14-header-fields + '(format length num-var-selector-records)) +(put 'format 'uvs-field-size 2) +(put 'length 'uvs-field-size 4) +(put 'num-var-selector-records 'uvs-field-size 4) +(defconst uvs-format-14-header-size + (uvs-fields-total-size uvs-format-14-header-fields)) + +;;; Fields in Variation Selector Record. +(defconst uvs-variation-selector-record-fields + '(var-selector default-uvs-offset non-default-uvs-offset)) +(put 'var-selector 'uvs-field-size 3) +(put 'default-uvs-offset 'uvs-field-size 4) +(put 'non-default-uvs-offset 'uvs-field-size 4) +(defconst uvs-variation-selector-record-size + (uvs-fields-total-size uvs-variation-selector-record-fields)) + +;;; Fields in Non-Default UVS Table. +(defconst uvs-non-default-uvs-table-header-fields '(num-uvs-mappings)) +(put 'num-uvs-mappings 'uvs-field-size 4) +(defconst uvs-non-default-uvs-table-header-size + (uvs-fields-total-size uvs-non-default-uvs-table-header-fields)) + +;;; Fields in UVS Mapping. +(defconst uvs-uvs-mapping-fields '(unicode-value glyph-id)) +(put 'unicode-value 'uvs-field-size 3) +(put 'glyph-id 'uvs-field-size 2) +(defconst uvs-uvs-mapping-size + (uvs-fields-total-size uvs-uvs-mapping-fields)) + +(defun uvs-alist-from-ivd (collection-id sequence-id-to-glyph-function) + "Create UVS alist from IVD Sequences and COLLECTION-ID. +The IVD (Ideographic Variation Database) Sequences are obtained +from the contents of the current buffer, and should be in the +form of IVD_Sequences.txt specified in Unicode Technical Standard +#37. COLLECTION-ID is a string specifying the identifier of the +collection to extract (e.g., \"Adobe-Japan1\"). +SEQUENCE-ID-TO-GLYPH-FUNC is a function to convert an identifier +string of the sequence to a glyph number. UVS alist is of the +following form: + ((SELECTOR1 . ((BASE11 . GLYPH11) (BASE12 . GLYPH12) ...)) + (SELECTOR2 . ((BASE21 . GLYPH21) (BASE22 . GLYPH22) ...)) ...), +where selectors and bases are sorted in ascending order." + (let (uvs-alist) + (goto-char (point-min)) + (while (re-search-forward + (concat "^[[:blank:]]*" + "\\([[:xdigit:]]+\\) \\([[:xdigit:]]+\\)" + "[[:blank:]]*;[[:blank:]]*" + "\\(?:" (regexp-quote collection-id) "\\)" + "[[:blank:]]*;[[:blank:]]*" + "\\([^\n[:blank:]]+\\)" + "[[:blank:]]*$") nil t) + (let* ((base (string-to-number (match-string 1) 16)) + (selector (string-to-number (match-string 2) 16)) + (sequence-id (match-string 3)) + (glyph (funcall sequence-id-to-glyph-function sequence-id))) + (let ((selector-bgs (assq selector uvs-alist)) + (base-glyph (cons base glyph))) + (if selector-bgs + (setcdr selector-bgs (cons base-glyph (cdr selector-bgs))) + (push (cons selector (list base-glyph)) uvs-alist))))) + (dolist (selector-bgs uvs-alist) + (setcdr selector-bgs + (sort (cdr selector-bgs) + (lambda (bg1 bg2) (< (car bg1) (car bg2)))))) + (sort uvs-alist (lambda (sb1 sb2) (< (car sb1) (car sb2)))))) + +(defun uvs-int-to-bytes (value size) + "Convert integer VALUE to a list of SIZE bytes. +The most significant byte comes first." + (let (result) + (dotimes (i size) + (push (logand value #xff) result) + (setq value (lsh value -8))) + result)) + +(defun uvs-insert-fields-as-bytes (fields &rest values) + "Insert VALUES for FIELDS as a sequence of bytes to the current buffer. +VALUES and FIELDS are lists of integers and field symbols, +respectively. Byte length of each value is determined by the +'uvs-field-size' property of the corresponding field." + (while fields + (let ((field (car fields)) + (value (car values))) + (insert (apply 'unibyte-string + (uvs-int-to-bytes value (get field 'uvs-field-size)))) + (setq fields (cdr fields) values (cdr values))))) + +(defun uvs-insert-alist-as-bytes (uvs-alist) + "Insert UVS-ALIST as a sequence of bytes to the current buffer." + (let* ((nrecords (length uvs-alist)) ; # of selectors + (total-nmappings + (apply '+ (mapcar + (lambda (selector-bgs) (length (cdr selector-bgs))) + uvs-alist))) + (non-default-offset + (+ uvs-format-14-header-size + (* uvs-variation-selector-record-size nrecords)))) + (uvs-insert-fields-as-bytes uvs-format-14-header-fields + 14 + (+ uvs-format-14-header-size + (* uvs-variation-selector-record-size + nrecords) + (* uvs-non-default-uvs-table-header-size + nrecords) + (* uvs-uvs-mapping-size total-nmappings)) + nrecords) + (dolist (selector-bgs uvs-alist) + (uvs-insert-fields-as-bytes uvs-variation-selector-record-fields + (car selector-bgs) + 0 ; No Default UVS Tables. + non-default-offset) + (setq non-default-offset + (+ non-default-offset + uvs-non-default-uvs-table-header-size + (* (length (cdr selector-bgs)) uvs-uvs-mapping-size)))) + (dolist (selector-bgs uvs-alist) + (uvs-insert-fields-as-bytes uvs-non-default-uvs-table-header-fields + (length (cdr selector-bgs))) + (dolist (base-glyph (cdr selector-bgs)) + (uvs-insert-fields-as-bytes uvs-uvs-mapping-fields + (car base-glyph) + (cdr base-glyph)))))) + +(defun uvs-dump (&optional bytes-per-line separator separator-eol line-prefix) + "Print the current buffer as in representation of C array contents." + (or bytes-per-line (setq bytes-per-line 8)) + (or separator (setq separator ", ")) + (or separator-eol (setq separator-eol ",")) + (or line-prefix (setq line-prefix " ")) + (goto-char (point-min)) + (while (> (- (point-max) (point)) bytes-per-line) + (princ line-prefix) + (princ (mapconcat (lambda (byte) (format "0x%02x" byte)) + (string-to-unibyte + (buffer-substring (point) (+ (point) bytes-per-line))) + separator)) + (princ separator-eol) + (terpri) + (forward-char bytes-per-line)) + (princ line-prefix) + (princ (mapconcat (lambda (byte) (format "0x%02x" byte)) + (string-to-unibyte + (buffer-substring (point) (point-max))) + separator)) + (terpri)) + +(defun uvs-print-table-ivd (filename collection-id + &optional sequence-id-to-glyph-func) + "Print a C array definition of a UVS table for IVD Sequences. +FILENAME specifies the IVD Sequences file. COLLECTION-ID is a +string specifying the identifier of the collection to +extract (e.g., \"Adobe-Japan1\"). SEQUENCE-ID-TO-GLYPH-FUNC is a +function to convert an identifier string of the sequence to a +glyph number, and nil means to convert \"CID\\+[0-9]+\" to the +corresponding number." + (or sequence-id-to-glyph-func + (setq sequence-id-to-glyph-func + (lambda (sequence-id) + (string-match "\\`CID\\+\\([[:digit:]]+\\)\\'" sequence-id) + (string-to-number (match-string 1 sequence-id))))) + (let ((uvs-alist + (with-temp-buffer + (insert-file-contents filename) + (setq uvs-alist (uvs-alist-from-ivd collection-id + sequence-id-to-glyph-func))))) + (princ + (format "static const unsigned char mac_uvs_table_%s_bytes[] =\n {\n" + (replace-regexp-in-string "[^_[:alnum:]]" "_" + (downcase collection-id)))) + (with-temp-buffer + (set-buffer-multibyte nil) + (uvs-insert-alist-as-bytes uvs-alist) + (uvs-dump)) + (princ " };\n"))) + +;;; uvs.el ends here ------------------------------------------------------------ revno: 117149 committer: Jan D. branch nick: trunk timestamp: Sun 2014-05-25 12:28:52 +0200 message: Simplify NS font driver draw, merge from Macport. * macfont.m (macfont_draw): Merge changes from Macport. * nsterm.m (ns_draw_glyph_string): Move isComposite and end from macfont.m, call draw with adjusted arguments so font drivers don't need to do that. * nsfont.m (nsfont_draw): Simplify as arguments are adjusted in nsterm.m now. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-24 12:02:25 +0000 +++ src/ChangeLog 2014-05-25 10:28:52 +0000 @@ -1,3 +1,14 @@ +2014-05-25 Jan Djärv + + * nsfont.m (nsfont_draw): Simplify as arguments are adjusted in + nsterm.m now. + + * nsterm.m (ns_draw_glyph_string): Move isComposite and end from + macfont.m, call draw with adjusted arguments so font drivers + don't need to do that. + + * macfont.m (macfont_draw): Merge changes from Macport. + 2014-05-24 Eli Zaretskii * alloc.c (garbage_collect_1): New function, with all of the guts === modified file 'src/macfont.m' --- src/macfont.m 2014-04-03 20:46:04 +0000 +++ src/macfont.m 2014-05-25 10:28:52 +0000 @@ -776,7 +776,7 @@ SInt64 sint64_value; /* Getting symbolic traits with kCFNumberSInt32Type is lossy on Mac - OS 10.6 when the value is greater than or equal to 1 << 31. */ + OS X 10.6 when the value is greater than or equal to 1 << 31. */ if (CFNumberGetValue (number, kCFNumberSInt64Type, &sint64_value)) { *sym_traits = (FontSymbolicTraits) sint64_value; @@ -1251,8 +1251,7 @@ CTFontCopyCharacterSet nor -[NSFont coveredCharacterSet] for this font is correct for non-BMP characters on Mac OS X 10.5, anyway. */ - if (CFStringCompare (key, CFSTR ("LastResort"), 0) - == kCFCompareEqualTo) + if (CFEqual (key, CFSTR ("LastResort"))) { CFRange range = CFRangeMake (0, MAX_UNICODE_CHAR + 1); @@ -2210,27 +2209,26 @@ 10.7 returns NULL if pat_desc represents the LastResort font. So we use CTFontDescriptorCreateMatchingFontDescriptor (no trailing "s") for such a font. */ - if (CFStringCompare (family_name, CFSTR ("LastResort"), 0) - != kCFCompareEqualTo) - descs = mac_font_descriptor_create_matching_font_descriptors (pat_desc, - NULL); + if (!CFEqual (family_name, CFSTR ("LastResort"))) + descs = mac_font_descriptor_create_matching_font_descriptors (pat_desc, + NULL); else - { - FontDescriptorRef lr_desc = - mac_font_descriptor_create_matching_font_descriptor (pat_desc, - NULL); - if (lr_desc) - { - descs = CFArrayCreate (NULL, (const void **) &lr_desc, 1, - &kCFTypeArrayCallBacks); - CFRelease (lr_desc); - } - else - descs = NULL; - } + { + FontDescriptorRef lr_desc = + mac_font_descriptor_create_matching_font_descriptor (pat_desc, + NULL); + if (lr_desc) + { + descs = CFArrayCreate (NULL, (const void **) &lr_desc, 1, + &kCFTypeArrayCallBacks); + CFRelease (lr_desc); + } + else + descs = NULL; + } CFRelease (pat_desc); if (! descs) - goto err; + goto err; descs_count = CFArrayGetCount (descs); if (descs_count == 0 @@ -2571,12 +2569,9 @@ family_name = mac_font_copy_family_name (macfont); if (family_name) { - if ((CFStringCompare (family_name, CFSTR ("Courier"), 0) - == kCFCompareEqualTo) - || (CFStringCompare (family_name, CFSTR ("Helvetica"), 0) - == kCFCompareEqualTo) - || (CFStringCompare (family_name, CFSTR ("Times"), 0) - == kCFCompareEqualTo)) + if (CFEqual (family_name, CFSTR ("Courier")) + || CFEqual (family_name, CFSTR ("Helvetica")) + || CFEqual (family_name, CFSTR ("Times"))) ascent += (ascent + descent) * .15f; else if (CFStringHasPrefix (family_name, CFSTR ("Hiragino"))) { @@ -2711,33 +2706,54 @@ { struct frame * f = s->f; struct macfont_info *macfont_info = (struct macfont_info *) s->font; - FontRef macfont = macfont_info->macfont; + CGRect background_rect; + CGPoint text_position; + CGGlyph *glyphs; + CGPoint *positions; + CGFloat font_size = mac_font_get_size (macfont_info->macfont); + bool no_antialias_p = + (macfont_info->antialias == MACFONT_ANTIALIAS_OFF + || (macfont_info->antialias == MACFONT_ANTIALIAS_DEFAULT + && font_size <= macfont_antialias_threshold)); + int len = to - from; + struct face *face = s->face; CGContextRef context; - BOOL isComposite = s->first_glyph->type == COMPOSITE_GLYPH; - int end = isComposite ? s->cmp_to : s->nchars; - int len = end - s->cmp_from; - struct face *face = s->face; - int i; block_input (); + if (with_background) + background_rect = CGRectMake (x, y - FONT_BASE (s->font), + s->width, FONT_HEIGHT (s->font)); + else + background_rect = CGRectNull; + + text_position = CGPointMake (x, -y); + glyphs = xmalloc (sizeof (CGGlyph) * len); + { + CGFloat advance_delta; + int i; + CGFloat total_width = 0; + + positions = xmalloc (sizeof (CGPoint) * len); + for (i = 0; i < len; i++) + { + int width; + + glyphs[i] = s->char2b[from + i]; + width = (s->padding_p ? 1 + : macfont_glyph_extents (s->font, glyphs[i], + NULL, &advance_delta, + no_antialias_p)); + positions[i].x = total_width + advance_delta; + positions[i].y = 0; + total_width += width; + } + } + context = [[NSGraphicsContext currentContext] graphicsPort]; CGContextSaveGState (context); -#if 0 - if (s->num_clips > 0) - { - CGRect clips[2]; - - for (i = 0; i < s->num_clips; i++) - clips[i] = mac_rect_make (f, s->clip[i].left, s->clip[i].top, - s->clip[i].right - s->clip[i].left, - s->clip[i].bottom - s->clip[i].top); - CGContextClipToRects (context, clips, s->num_clips); - } -#endif - - if (with_background) + if (!CGRectIsNull (background_rect)) { if (s->hl == DRAW_MOUSE_FACE) { @@ -2745,41 +2761,13 @@ if (!face) face = FACE_FROM_ID (s->f, MOUSE_FACE_ID); } - CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND (context, face, f); - CGContextFillRect (context, - CGRectMake (x, y, - s->width, FONT_HEIGHT (s->font))); + CGContextFillRects (context, &background_rect, 1); } if (macfont_info->cgfont) { - CGGlyph *glyphs = alloca (sizeof (CGGlyph) * len); - CGPoint *positions = alloca (sizeof (CGPoint) * len); - CGFloat total_width = 0; - CGFloat font_size = mac_font_get_size (macfont); CGAffineTransform atfm; - CGFloat advance_delta = 0; - int y_draw = -s->ybase; - int no_antialias_p = - (macfont_info->antialias == MACFONT_ANTIALIAS_OFF - || (macfont_info->antialias == MACFONT_ANTIALIAS_DEFAULT - && font_size <= macfont_antialias_threshold)); - - for (i = 0; i < len; i++) - { - int width; - - glyphs[i] = *(s->char2b + s->cmp_from + i); - width = (s->padding_p ? 1 - : macfont_glyph_extents (s->font, glyphs[i], - NULL, &advance_delta, - no_antialias_p)); - positions[i].x = total_width + advance_delta; - positions[i].y = 0; - total_width += width; - } - CGContextScaleCTM (context, 1, -1); CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND (context, face, s->f); if (macfont_info->synthetic_italic_p) @@ -2796,7 +2784,7 @@ CGContextSetShouldAntialias (context, false); CGContextSetTextMatrix (context, atfm); - CGContextSetTextPosition (context, x, y_draw); + CGContextSetTextPosition (context, text_position.x, text_position.y); #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 if (macfont_info->color_bitmap_p @@ -2807,7 +2795,8 @@ { if (len > 0) { - CTFontDrawGlyphs (macfont, glyphs, positions, len, context); + CTFontDrawGlyphs (macfont_info->macfont, glyphs, positions, len, + context); } } else @@ -2819,6 +2808,8 @@ } } + + xfree (glyphs); CGContextRestoreGState (context); unblock_input (); @@ -3557,7 +3548,7 @@ name2 = CTFontCopyPostScriptName (font2); if (name2) { - result = (CFStringCompare (name1, name2, 0) == kCFCompareEqualTo); + result = CFEqual (name1, name2); CFRelease (name2); } CFRelease (name1); @@ -3930,8 +3921,8 @@ for (i = 0; macfont_language_default_font_names[i].language; i++) { - if (CFStringCompare (macfont_language_default_font_names[i].language, - language, 0) == kCFCompareEqualTo) + if (CFEqual (macfont_language_default_font_names[i].language, + language)) { CFMutableArrayRef descriptors = CFArrayCreateMutable (NULL, 0, &kCFTypeArrayCallBacks); @@ -4011,9 +4002,8 @@ if (family) { if (!CFStringHasPrefix (family, CFSTR (".")) - && (CFStringCompare (family, CFSTR ("LastResort"), 0) - != kCFCompareEqualTo)) - { + && !CFEqual (family, CFSTR ("LastResort"))) + { result = family; break; } === modified file 'src/nsfont.m' --- src/nsfont.m 2014-01-01 07:43:34 +0000 +++ src/nsfont.m 2014-05-25 10:28:52 +0000 @@ -1037,8 +1037,7 @@ static int nsfont_draw (struct glyph_string *s, int from, int to, int x, int y, bool with_background) -/* NOTE: focus and clip must be set - also, currently assumed (true in nsterm.m call) from ==0, to ==nchars */ +/* NOTE: focus and clip must be set */ { static unsigned char cbuf[1024]; unsigned char *c = cbuf; @@ -1056,7 +1055,6 @@ unsigned short *t = s->char2b; int i, len, flags; char isComposite = s->first_glyph->type == COMPOSITE_GLYPH; - int end = isComposite ? s->cmp_to : s->nchars; block_input (); @@ -1098,8 +1096,8 @@ int cwidth, twidth = 0; int hi, lo; /* FIXME: composition: no vertical displacement is considered. */ - t += s->cmp_from; /* advance into composition */ - for (i = s->cmp_from; i < end; i++, t++) + t += from; /* advance into composition */ + for (i = from; i < to; i++, t++) { hi = (*t & 0xFF00) >> 8; lo = *t & 0x00FF; @@ -1193,7 +1191,7 @@ /* set up for character rendering */ - r.origin.y = s->ybase; + r.origin.y = y; col = (NS_FACE_FOREGROUND (face) != 0 ? ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), s->f) @@ -1275,13 +1273,13 @@ [col set]; CGContextSetTextPosition (gcontext, r.origin.x, r.origin.y); - CGContextShowGlyphsWithAdvances (gcontext, s->char2b + s->cmp_from, + CGContextShowGlyphsWithAdvances (gcontext, s->char2b + from, advances, len); if (face->overstrike) { CGContextSetTextPosition (gcontext, r.origin.x+0.5, r.origin.y); - CGContextShowGlyphsWithAdvances (gcontext, s->char2b + s->cmp_from, + CGContextShowGlyphsWithAdvances (gcontext, s->char2b + from, advances, len); } === modified file 'src/nsterm.m' --- src/nsterm.m 2014-05-14 13:55:37 +0000 +++ src/nsterm.m 2014-05-25 10:28:52 +0000 @@ -3355,10 +3355,16 @@ NS_FACE_FOREGROUND (s->face) = tmp; } - font->driver->draw - (s, 0, s->nchars, s->x, s->y, - (flags == NS_DUMPGLYPH_NORMAL && !s->background_filled_p) - || flags == NS_DUMPGLYPH_MOUSEFACE); + { + BOOL isComposite = s->first_glyph->type == COMPOSITE_GLYPH; + int end = isComposite ? s->cmp_to : s->nchars; + + font->driver->draw + (s, s->cmp_from, end, s->x, s->ybase, + (flags == NS_DUMPGLYPH_NORMAL && !s->background_filled_p) + || flags == NS_DUMPGLYPH_MOUSEFACE); + + } { NSColor *col = (NS_FACE_FOREGROUND (s->face) != 0 ------------------------------------------------------------ revno: 117148 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2014-05-25 10:08:24 +0200 message: Support shifted keypad keys in xterm * term/xterm.el (xterm-function-map): Add mapping for shifted keypad keys. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-24 20:43:40 +0000 +++ lisp/ChangeLog 2014-05-25 08:08:24 +0000 @@ -1,3 +1,8 @@ +2014-05-25 Andreas Schwab + + * term/xterm.el (xterm-function-map): Add mapping for shifted + keypad keys. + 2014-05-24 Daniel Colascione * progmodes/subword.el (subword-find-word-boundary): Move point to === modified file 'lisp/term/xterm.el' --- lisp/term/xterm.el 2014-04-27 23:26:42 +0000 +++ lisp/term/xterm.el 2014-05-25 08:08:24 +0000 @@ -278,6 +278,70 @@ (define-key map "\eOx" [kp-8]) (define-key map "\eOy" [kp-9]) + (define-key map "\eO2j" [S-kp-multiply]) + (define-key map "\eO2k" [S-kp-add]) + (define-key map "\eO2l" [S-kp-separator]) + (define-key map "\eO2m" [S-kp-subtract]) + (define-key map "\eO2o" [S-kp-divide]) + (define-key map "\eO2p" [S-kp-0]) + (define-key map "\eO2q" [S-kp-1]) + (define-key map "\eO2r" [S-kp-2]) + (define-key map "\eO2s" [S-kp-3]) + (define-key map "\eO2t" [S-kp-4]) + (define-key map "\eO2u" [S-kp-5]) + (define-key map "\eO2v" [S-kp-6]) + (define-key map "\eO2w" [S-kp-7]) + (define-key map "\eO2x" [S-kp-8]) + (define-key map "\eO2y" [S-kp-9]) + + (define-key map "\eO4j" [M-S-kp-multiply]) + (define-key map "\eO4k" [M-S-kp-add]) + (define-key map "\eO4l" [M-S-kp-separator]) + (define-key map "\eO4m" [M-S-kp-subtract]) + (define-key map "\eO4o" [M-S-kp-divide]) + (define-key map "\eO4p" [M-S-kp-0]) + (define-key map "\eO4q" [M-S-kp-1]) + (define-key map "\eO4r" [M-S-kp-2]) + (define-key map "\eO4s" [M-S-kp-3]) + (define-key map "\eO4t" [M-S-kp-4]) + (define-key map "\eO4u" [M-S-kp-5]) + (define-key map "\eO4v" [M-S-kp-6]) + (define-key map "\eO4w" [M-S-kp-7]) + (define-key map "\eO4x" [M-S-kp-8]) + (define-key map "\eO4y" [M-S-kp-9]) + + (define-key map "\eO6j" [C-S-kp-multiply]) + (define-key map "\eO6k" [C-S-kp-add]) + (define-key map "\eO6l" [C-S-kp-separator]) + (define-key map "\eO6m" [C-S-kp-subtract]) + (define-key map "\eO6o" [C-S-kp-divide]) + (define-key map "\eO6p" [C-S-kp-0]) + (define-key map "\eO6q" [C-S-kp-1]) + (define-key map "\eO6r" [C-S-kp-2]) + (define-key map "\eO6s" [C-S-kp-3]) + (define-key map "\eO6t" [C-S-kp-4]) + (define-key map "\eO6u" [C-S-kp-5]) + (define-key map "\eO6v" [C-S-kp-6]) + (define-key map "\eO6w" [C-S-kp-7]) + (define-key map "\eO6x" [C-S-kp-8]) + (define-key map "\eO6y" [C-S-kp-9]) + + (define-key map "\eO8j" [C-M-S-kp-multiply]) + (define-key map "\eO8k" [C-M-S-kp-add]) + (define-key map "\eO8l" [C-M-S-kp-separator]) + (define-key map "\eO8m" [C-M-S-kp-subtract]) + (define-key map "\eO8o" [C-M-S-kp-divide]) + (define-key map "\eO8p" [C-M-S-kp-0]) + (define-key map "\eO8q" [C-M-S-kp-1]) + (define-key map "\eO8r" [C-M-S-kp-2]) + (define-key map "\eO8s" [C-M-S-kp-3]) + (define-key map "\eO8t" [C-M-S-kp-4]) + (define-key map "\eO8u" [C-M-S-kp-5]) + (define-key map "\eO8v" [C-M-S-kp-6]) + (define-key map "\eO8w" [C-M-S-kp-7]) + (define-key map "\eO8x" [C-M-S-kp-8]) + (define-key map "\eO8y" [C-M-S-kp-9]) + ;; These keys are available in xterm starting from version 216 ;; if the modifyOtherKeys resource is set to 1. (dolist (bind '((5 9 [C-tab]) ------------------------------------------------------------ revno: 117147 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-05-24 18:18:16 -0700 message: * NEWS addition diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-05-17 08:11:31 +0000 +++ etc/NEWS 2014-05-25 01:18:16 +0000 @@ -88,6 +88,9 @@ *** Calendar can list and mark diary entries with Chinese dates: `diary-chinese-list-entries' and `diary-chinese-mark-entries'. +** In sh-mode, you can now use `sh-shell' as a file-local variable to +specify the type of shell in use (bash, csh, etc). + ** The URL package accepts now the protocols "ssh", "scp" and "rsync". When `url-handler-mode' is enabled, file operations for these protocols as well as for "telnet" and "ftp" are passed to Tramp. ------------------------------------------------------------ revno: 117146 fixes bug: http://debbugs.gnu.org/17580 committer: Daniel Colascione branch nick: trunk timestamp: Sat 2014-05-24 13:43:40 -0700 message: Fix subword-mode motion * lisp/progmodes/subword.el (subword-find-word-boundary): Move point to correct spot before search. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-24 19:51:52 +0000 +++ lisp/ChangeLog 2014-05-24 20:43:40 +0000 @@ -1,5 +1,8 @@ 2014-05-24 Daniel Colascione + * progmodes/subword.el (subword-find-word-boundary): Move point to + correct spot before search. (Bug#17580) + * emacs-lisp/nadvice.el (defun): Write in eval-and-compile to avoid breaking the build. === modified file 'lisp/progmodes/subword.el' --- lisp/progmodes/subword.el 2014-03-23 07:36:26 +0000 +++ lisp/progmodes/subword.el 2014-05-24 20:43:40 +0000 @@ -355,8 +355,10 @@ (save-restriction (if (< pos limit) (progn + (goto-char pos) (narrow-to-region (point-min) limit) (funcall subword-forward-function)) + (goto-char (1+ pos)) (narrow-to-region limit (point-max)) (funcall subword-backward-function)) (point)))))) ------------------------------------------------------------ revno: 117145 committer: Daniel Colascione branch nick: debug timestamp: Sat 2014-05-24 12:51:52 -0700 message: Unbreak the build * lisp/emacs-lisp/nadvice.el (defun): Write in eval-and-compile to avoid breaking the build. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-24 15:14:47 +0000 +++ lisp/ChangeLog 2014-05-24 19:51:52 +0000 @@ -1,3 +1,8 @@ +2014-05-24 Daniel Colascione + + * emacs-lisp/nadvice.el (defun): Write in eval-and-compile to avoid + breaking the build. + 2014-05-24 Leo Liu * calc/calc.el (math-bignum): Handle most-negative-fixnum. (Bug#17556) === modified file 'lisp/emacs-lisp/nadvice.el' --- lisp/emacs-lisp/nadvice.el 2014-05-12 05:25:34 +0000 +++ lisp/emacs-lisp/nadvice.el 2014-05-24 19:51:52 +0000 @@ -232,11 +232,12 @@ ;; This function acts like the t special value in buffer-local hooks. (lambda (&rest args) (apply (default-value var) args))))) -(defun advice--normalize-place (place) - (cond ((eq 'local (car-safe place)) `(advice--buffer-local ,@(cdr place))) - ((eq 'var (car-safe place)) (nth 1 place)) - ((symbolp place) `(default-value ',place)) - (t place))) +(eval-and-compile + (defun advice--normalize-place (place) + (cond ((eq 'local (car-safe place)) `(advice--buffer-local ,@(cdr place))) + ((eq 'var (car-safe place)) (nth 1 place)) + ((symbolp place) `(default-value ',place)) + (t place)))) ;;;###autoload (defmacro add-function (where place function &optional props) ------------------------------------------------------------ revno: 117144 fixes bug: http://debbugs.gnu.org/17556 committer: Leo Liu branch nick: trunk timestamp: Sat 2014-05-24 23:14:47 +0800 message: * calc/calc.el (math-bignum): Handle most-negative-fixnum. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-23 15:54:44 +0000 +++ lisp/ChangeLog 2014-05-24 15:14:47 +0000 @@ -1,3 +1,7 @@ +2014-05-24 Leo Liu + + * calc/calc.el (math-bignum): Handle most-negative-fixnum. (Bug#17556) + 2014-05-23 Stefan Monnier * minibuffer.el (completion--sreverse): Remove. === modified file 'lisp/calc/calc.el' --- lisp/calc/calc.el 2014-01-01 07:43:34 +0000 +++ lisp/calc/calc.el 2014-05-24 15:14:47 +0000 @@ -2773,9 +2773,18 @@ ;; Coerce integer A to be a bignum. [B S] (defun math-bignum (a) - (if (>= a 0) - (cons 'bigpos (math-bignum-big a)) - (cons 'bigneg (math-bignum-big (- a))))) + (cond + ((>= a 0) + (cons 'bigpos (math-bignum-big a))) + ((= a most-negative-fixnum) + ;; Note: cannot get the negation directly because + ;; (- most-negative-fixnum) is most-negative-fixnum. + ;; + ;; most-negative-fixnum := -most-positive-fixnum - 1 + (math-sub (cons 'bigneg (math-bignum-big most-positive-fixnum)) + 1)) + (t + (cons 'bigneg (math-bignum-big (- a)))))) (defun math-bignum-big (a) ; [L s] (if (= a 0) ------------------------------------------------------------ revno: 117143 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2014-05-24 15:02:25 +0300 message: Avoid marking too deep portions of stack in mark_stack. src/alloc.c (garbage_collect_1): New function, with all of the guts of Fgarbage_collect. (mark_stack): Accept an argument END and don't mark Lisp objects on the stack beyond the address given by END. Calculation of END was moved to Fgarbage_collect. (Fgarbage_collect): Calculate the end address of the stack portion that needs to be examined by mark_stack, and pass that address to garbage_collect_1, which will pass it to mark_stack. See http://lists.gnu.org/archive/html/emacs-devel/2014-05/msg00270.html for more details about the underlying problems. In particular, this avoids dumping Emacs with the large hash-table whose value is held in purify-flag for most of the time loadup.el runs. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-24 08:41:19 +0000 +++ src/ChangeLog 2014-05-24 12:02:25 +0000 @@ -1,3 +1,18 @@ +2014-05-24 Eli Zaretskii + + * alloc.c (garbage_collect_1): New function, with all of the guts + of Fgarbage_collect. + (mark_stack): Accept an argument END and don't mark Lisp objects + on the stack beyond the address given by END. Calculation of END + was moved to Fgarbage_collect. + (Fgarbage_collect): Calculate the end address of the stack portion + that needs to be examined by mark_stack, and pass that address to + garbage_collect_1, which will pass it to mark_stack. See + http://lists.gnu.org/archive/html/emacs-devel/2014-05/msg00270.html + for more details about the underlying problems. In particular, + this avoids dumping Emacs with the large hash-table whose value is + held in purify-flag for most of the time loadup.el runs. + 2014-05-24 Jan Djärv * xfns.c (x_window_property_intern): New function (code from === modified file 'src/alloc.c' --- src/alloc.c 2014-05-19 19:19:05 +0000 +++ src/alloc.c 2014-05-24 12:02:25 +0000 @@ -4876,61 +4876,8 @@ from the stack start. */ static void -mark_stack (void) +mark_stack (void *end) { - void *end; - -#ifdef HAVE___BUILTIN_UNWIND_INIT - /* Force callee-saved registers and register windows onto the stack. - This is the preferred method if available, obviating the need for - machine dependent methods. */ - __builtin_unwind_init (); - end = &end; -#else /* not HAVE___BUILTIN_UNWIND_INIT */ -#ifndef GC_SAVE_REGISTERS_ON_STACK - /* jmp_buf may not be aligned enough on darwin-ppc64 */ - union aligned_jmpbuf { - Lisp_Object o; - sys_jmp_buf j; - } j; - volatile bool stack_grows_down_p = (char *) &j > (char *) stack_base; -#endif - /* This trick flushes the register windows so that all the state of - the process is contained in the stack. */ - /* Fixme: Code in the Boehm GC suggests flushing (with `flushrs') is - needed on ia64 too. See mach_dep.c, where it also says inline - assembler doesn't work with relevant proprietary compilers. */ -#ifdef __sparc__ -#if defined (__sparc64__) && defined (__FreeBSD__) - /* FreeBSD does not have a ta 3 handler. */ - asm ("flushw"); -#else - asm ("ta 3"); -#endif -#endif - - /* Save registers that we need to see on the stack. We need to see - registers used to hold register variables and registers used to - pass parameters. */ -#ifdef GC_SAVE_REGISTERS_ON_STACK - GC_SAVE_REGISTERS_ON_STACK (end); -#else /* not GC_SAVE_REGISTERS_ON_STACK */ - -#ifndef GC_SETJMP_WORKS /* If it hasn't been checked yet that - setjmp will definitely work, test it - and print a message with the result - of the test. */ - if (!setjmp_tested_p) - { - setjmp_tested_p = 1; - test_setjmp (); - } -#endif /* GC_SETJMP_WORKS */ - - sys_setjmp (j.j); - end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; -#endif /* not GC_SAVE_REGISTERS_ON_STACK */ -#endif /* not HAVE___BUILTIN_UNWIND_INIT */ /* This assumes that the stack is a contiguous region in memory. If that's not the case, something has to be done here to iterate @@ -5538,22 +5485,15 @@ } } -DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "", - doc: /* Reclaim storage for Lisp objects no longer needed. -Garbage collection happens automatically if you cons more than -`gc-cons-threshold' bytes of Lisp data since previous garbage collection. -`garbage-collect' normally returns a list with info on amount of space in use, -where each entry has the form (NAME SIZE USED FREE), where: -- NAME is a symbol describing the kind of objects this entry represents, -- SIZE is the number of bytes used by each one, -- USED is the number of those objects that were found live in the heap, -- FREE is the number of those objects that are not live but that Emacs - keeps around for future allocations (maybe because it does not know how - to return them to the OS). -However, if there was overflow in pure space, `garbage-collect' -returns nil, because real GC can't be done. -See Info node `(elisp)Garbage Collection'. */) - (void) +/* Subroutine of Fgarbage_collect that does most of the work. It is a + separate function so that we could limit mark_stack in searching + the stack frames below this function, thus avoiding the rare cases + where mark_stack finds values that look like live Lisp objects on + portions of stack that couldn't possibly contain such live objects. + For more details of this, see the discussion at + http://lists.gnu.org/archive/html/emacs-devel/2014-05/msg00270.html. */ +static Lisp_Object +garbage_collect_1 (void *end) { struct buffer *nextb; char stack_top_variable; @@ -5651,7 +5591,7 @@ #if (GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS \ || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS) - mark_stack (); + mark_stack (end); #else { register struct gcpro *tail; @@ -5674,7 +5614,7 @@ #endif #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES - mark_stack (); + mark_stack (end); #endif /* Everything is now marked, except for the data in font caches @@ -5834,6 +5774,82 @@ return retval; } +DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "", + doc: /* Reclaim storage for Lisp objects no longer needed. +Garbage collection happens automatically if you cons more than +`gc-cons-threshold' bytes of Lisp data since previous garbage collection. +`garbage-collect' normally returns a list with info on amount of space in use, +where each entry has the form (NAME SIZE USED FREE), where: +- NAME is a symbol describing the kind of objects this entry represents, +- SIZE is the number of bytes used by each one, +- USED is the number of those objects that were found live in the heap, +- FREE is the number of those objects that are not live but that Emacs + keeps around for future allocations (maybe because it does not know how + to return them to the OS). +However, if there was overflow in pure space, `garbage-collect' +returns nil, because real GC can't be done. +See Info node `(elisp)Garbage Collection'. */) + (void) +{ +#if (GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS \ + || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS \ + || GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES) + void *end; + +#ifdef HAVE___BUILTIN_UNWIND_INIT + /* Force callee-saved registers and register windows onto the stack. + This is the preferred method if available, obviating the need for + machine dependent methods. */ + __builtin_unwind_init (); + end = &end; +#else /* not HAVE___BUILTIN_UNWIND_INIT */ +#ifndef GC_SAVE_REGISTERS_ON_STACK + /* jmp_buf may not be aligned enough on darwin-ppc64 */ + union aligned_jmpbuf { + Lisp_Object o; + sys_jmp_buf j; + } j; + volatile bool stack_grows_down_p = (char *) &j > (char *) stack_base; +#endif + /* This trick flushes the register windows so that all the state of + the process is contained in the stack. */ + /* Fixme: Code in the Boehm GC suggests flushing (with `flushrs') is + needed on ia64 too. See mach_dep.c, where it also says inline + assembler doesn't work with relevant proprietary compilers. */ +#ifdef __sparc__ +#if defined (__sparc64__) && defined (__FreeBSD__) + /* FreeBSD does not have a ta 3 handler. */ + asm ("flushw"); +#else + asm ("ta 3"); +#endif +#endif + + /* Save registers that we need to see on the stack. We need to see + registers used to hold register variables and registers used to + pass parameters. */ +#ifdef GC_SAVE_REGISTERS_ON_STACK + GC_SAVE_REGISTERS_ON_STACK (end); +#else /* not GC_SAVE_REGISTERS_ON_STACK */ + +#ifndef GC_SETJMP_WORKS /* If it hasn't been checked yet that + setjmp will definitely work, test it + and print a message with the result + of the test. */ + if (!setjmp_tested_p) + { + setjmp_tested_p = 1; + test_setjmp (); + } +#endif /* GC_SETJMP_WORKS */ + + sys_setjmp (j.j); + end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; +#endif /* not GC_SAVE_REGISTERS_ON_STACK */ +#endif /* not HAVE___BUILTIN_UNWIND_INIT */ +#endif /* GC_MARK_STACK */ + return garbage_collect_1 (end); +} /* Mark Lisp objects in glyph matrix MATRIX. Currently the only interesting objects referenced from glyphs are strings. */ ------------------------------------------------------------ revno: 117142 fixes bug: http://debbugs.gnu.org/17537 committer: Jan D. branch nick: trunk timestamp: Sat 2014-05-24 10:41:19 +0200 message: * xfns.c (x_window_property_intern): New function (code from x_window_property). (Fx_window_property): Call x_window_property_intern. If property not found and NILP (source) and outer window != inner window, check outer window for property. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-22 16:40:35 +0000 +++ src/ChangeLog 2014-05-24 08:41:19 +0000 @@ -1,3 +1,11 @@ +2014-05-24 Jan Djärv + + * xfns.c (x_window_property_intern): New function (code from + x_window_property). + (Fx_window_property): Call x_window_property_intern. If property + not found and NILP (source) and outer window != inner window, + check outer window for property (Bug#17537). + 2014-05-22 Paul Eggert Supply malloc and alloc_size attributes for extern allocators. === modified file 'src/xfns.c' --- src/xfns.c 2014-05-13 14:18:54 +0000 +++ src/xfns.c 2014-05-24 08:41:19 +0000 @@ -4550,75 +4550,43 @@ } -DEFUN ("x-window-property", Fx_window_property, Sx_window_property, - 1, 6, 0, - doc: /* Value is the value of window property PROP on FRAME. -If FRAME is nil or omitted, use the selected frame. - -On X Windows, the following optional arguments are also accepted: -If TYPE is nil or omitted, get the property as a string. -Otherwise TYPE is the name of the atom that denotes the type expected. -If SOURCE is non-nil, get the property on that window instead of from -FRAME. The number 0 denotes the root window. -If DELETE-P is non-nil, delete the property after retrieving it. -If VECTOR-RET-P is non-nil, don't return a string but a vector of values. - -On MS Windows, this function accepts but ignores those optional arguments. - -Value is nil if FRAME hasn't a property with name PROP or if PROP has -no value of TYPE (always string in the MS Windows case). */) - (Lisp_Object prop, Lisp_Object frame, Lisp_Object type, - Lisp_Object source, Lisp_Object delete_p, Lisp_Object vector_ret_p) +static Lisp_Object +x_window_property_intern (struct frame *f, + Window target_window, + Atom prop_atom, + Atom target_type, + Lisp_Object delete_p, + Lisp_Object vector_ret_p, + bool *found) { - struct frame *f = decode_window_system_frame (frame); - Atom prop_atom; - int rc; + unsigned char *tmp_data = NULL; Lisp_Object prop_value = Qnil; - unsigned char *tmp_data = NULL; Atom actual_type; - Atom target_type = XA_STRING; int actual_format; unsigned long actual_size, bytes_remaining; - Window target_window = FRAME_X_WINDOW (f); + int rc; struct gcpro gcpro1; GCPRO1 (prop_value); - CHECK_STRING (prop); - - if (! NILP (source)) - { - CONS_TO_INTEGER (source, Window, target_window); - if (! target_window) - target_window = FRAME_DISPLAY_INFO (f)->root_window; - } - - block_input (); - if (STRINGP (type)) - { - if (strcmp ("AnyPropertyType", SSDATA (type)) == 0) - target_type = AnyPropertyType; - else - target_type = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (type), False); - } - - prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (prop), False); + rc = XGetWindowProperty (FRAME_X_DISPLAY (f), target_window, prop_atom, 0, 0, False, target_type, &actual_type, &actual_format, &actual_size, &bytes_remaining, &tmp_data); - if (rc == Success) + + *found = actual_format != 0; + + if (rc == Success && *found) { - int size = bytes_remaining; - XFree (tmp_data); tmp_data = NULL; rc = XGetWindowProperty (FRAME_X_DISPLAY (f), target_window, - prop_atom, 0, bytes_remaining, - ! NILP (delete_p), target_type, - &actual_type, &actual_format, - &actual_size, &bytes_remaining, - &tmp_data); + prop_atom, 0, bytes_remaining, + ! NILP (delete_p), target_type, + &actual_type, &actual_format, + &actual_size, &bytes_remaining, + &tmp_data); if (rc == Success && tmp_data) { /* The man page for XGetWindowProperty says: @@ -4646,7 +4614,7 @@ } if (NILP (vector_ret_p)) - prop_value = make_string ((char *) tmp_data, size); + prop_value = make_string ((char *) tmp_data, actual_size); else prop_value = x_property_data_to_lisp (f, tmp_data, @@ -4658,6 +4626,81 @@ if (tmp_data) XFree (tmp_data); } + UNGCPRO; + return prop_value; +} + +DEFUN ("x-window-property", Fx_window_property, Sx_window_property, + 1, 6, 0, + doc: /* Value is the value of window property PROP on FRAME. +If FRAME is nil or omitted, use the selected frame. + +On X Windows, the following optional arguments are also accepted: +If TYPE is nil or omitted, get the property as a string. +Otherwise TYPE is the name of the atom that denotes the type expected. +If SOURCE is non-nil, get the property on that window instead of from +FRAME. The number 0 denotes the root window. +If DELETE-P is non-nil, delete the property after retrieving it. +If VECTOR-RET-P is non-nil, don't return a string but a vector of values. + +On MS Windows, this function accepts but ignores those optional arguments. + +Value is nil if FRAME hasn't a property with name PROP or if PROP has +no value of TYPE (always string in the MS Windows case). */) + (Lisp_Object prop, Lisp_Object frame, Lisp_Object type, + Lisp_Object source, Lisp_Object delete_p, Lisp_Object vector_ret_p) +{ + struct frame *f = decode_window_system_frame (frame); + Atom prop_atom; + int rc; + Lisp_Object prop_value = Qnil; + Atom target_type = XA_STRING; + Window target_window = FRAME_X_WINDOW (f); + struct gcpro gcpro1; + bool found; + + GCPRO1 (prop_value); + CHECK_STRING (prop); + + if (! NILP (source)) + { + CONS_TO_INTEGER (source, Window, target_window); + if (! target_window) + target_window = FRAME_DISPLAY_INFO (f)->root_window; + } + + block_input (); + if (STRINGP (type)) + { + if (strcmp ("AnyPropertyType", SSDATA (type)) == 0) + target_type = AnyPropertyType; + else + target_type = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (type), False); + } + + prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (prop), False); + prop_value = x_window_property_intern (f, + target_window, + prop_atom, + target_type, + delete_p, + vector_ret_p, + &found); + if (NILP (prop_value) + && ! found + && NILP (source) + && target_window != FRAME_OUTER_WINDOW (f)) + { + prop_value = x_window_property_intern (f, + FRAME_OUTER_WINDOW (f), + prop_atom, + target_type, + delete_p, + vector_ret_p, + &found); + } + + unblock_input (); UNGCPRO; return prop_value; ------------------------------------------------------------ revno: 117141 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2014-05-23 11:54:44 -0400 message: * lisp/minibuffer.el (completion--sreverse): Remove. (completion--common-suffix): Use `reverse' instead. * lisp/emacs-lisp/regexp-opt.el (regexp-opt-group): Use `reverse' on strings. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-22 19:56:49 +0000 +++ lisp/ChangeLog 2014-05-23 15:54:44 +0000 @@ -1,3 +1,9 @@ +2014-05-23 Stefan Monnier + + * minibuffer.el (completion--sreverse): Remove. + (completion--common-suffix): Use `reverse' instead. + * emacs-lisp/regexp-opt.el (regexp-opt-group): Use `reverse' on strings. + 2014-05-22 Glenn Morris * shell.el (shell-mode) : Bypass bash aliases. === modified file 'lisp/emacs-lisp/regexp-opt.el' --- lisp/emacs-lisp/regexp-opt.el 2014-02-10 01:34:22 +0000 +++ lisp/emacs-lisp/regexp-opt.el 2014-05-23 15:54:44 +0000 @@ -205,9 +205,7 @@ (regexp-opt-group suffixes t t) close-group)) - (let* ((sgnirts (mapcar (lambda (s) - (concat (nreverse (string-to-list s)))) - strings)) + (let* ((sgnirts (mapcar #'reverse strings)) (xiffus (try-completion "" sgnirts))) (if (> (length xiffus) 0) ;; common suffix: take it and recurse on the prefixes. @@ -218,8 +216,7 @@ 'string-lessp))) (concat open-group (regexp-opt-group prefixes t t) - (regexp-quote - (concat (nreverse (string-to-list xiffus)))) + (regexp-quote (nreverse xiffus)) close-group)) ;; Otherwise, divide the list into those that start with a === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2014-05-14 17:01:29 +0000 +++ lisp/minibuffer.el 2014-05-23 15:54:44 +0000 @@ -873,6 +873,7 @@ ;; part of the string (e.g. substitute-in-file-name). (let ((requote (when (completion-metadata-get metadata 'completion--unquote-requote) + (cl-assert (functionp table)) (let ((new (funcall table string point 'completion--unquote))) (setq string (pop new)) (setq table (pop new)) @@ -3057,16 +3058,9 @@ (nconc (completion-pcm--hilit-commonality pattern all) (length prefix))))) -(defun completion--sreverse (str) - "Like `reverse' but for a string STR rather than a list." - (apply #'string (nreverse (mapcar 'identity str)))) - (defun completion--common-suffix (strs) "Return the common suffix of the strings STRS." - (completion--sreverse - (try-completion - "" - (mapcar #'completion--sreverse strs)))) + (nreverse (try-completion "" (mapcar #'reverse strs)))) (defun completion-pcm--merge-completions (strs pattern) "Extract the commonality in STRS, with the help of PATTERN. ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.