diff options
81 files changed, 1025 insertions, 620 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index a85b56c3af7..76d692ae9a6 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,9 @@ +2014-07-03 Glenn Morris <rgm@gnu.org> + + * help.texi (Misc Help): + * trouble.texi (Checklist): "Online" help doesn't mean what it + used to any more. + 2014-06-23 Glenn Morris <rgm@gnu.org> * Makefile.in (%.texi): Disable implicit rules. diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index f47600d97ec..10b5fcfb095 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi @@ -490,8 +490,7 @@ currently in use. @xref{Coding Systems}. @kindex C-h i @findex info @cindex Info -@cindex manuals, on-line -@cindex on-line manuals +@cindex manuals, included @kbd{C-h i} (@code{info}) runs the Info program, which browses structured documentation files. The entire Emacs manual is available within Info, along with many other manuals for the GNU system. Type diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index f0cbbcc5721..09260a1e5a9 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi @@ -847,7 +847,7 @@ conclusion from our observations. @item If the bug is that the Emacs Manual or the Emacs Lisp Reference Manual fails to describe the actual behavior of Emacs, or that the text is -confusing, copy in the text from the online manual which you think is +confusing, copy in the text from the manual which you think is at fault. If the section is small, just the section name is enough. @item diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog index 13bc65eef4a..1ac7258e85a 100644 --- a/doc/lispintro/ChangeLog +++ b/doc/lispintro/ChangeLog @@ -1,3 +1,8 @@ +2014-07-03 Glenn Morris <rgm@gnu.org> + + * emacs-lisp-intro.texi (Note for Novices, Finding More, Conclusion): + "Online" help doesn't mean what it used to any more. + 2014-06-23 Glenn Morris <rgm@gnu.org> * Makefile.in (%.texi): Disable implicit rules. diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 6001e3d0084..7ff91758670 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -903,7 +903,7 @@ file, @file{cl.el}, that adds many Common Lisp features to Emacs Lisp.) If you don't know GNU Emacs, you can still read this document profitably. However, I recommend you learn Emacs, if only to learn to move around your computer screen. You can teach yourself how to use -Emacs with the on-line tutorial. To use it, type @kbd{C-h t}. (This +Emacs with the built-in tutorial. To use it, type @kbd{C-h t}. (This means you press and release the @key{CTRL} key and the @kbd{h} at the same time, and then press and release @kbd{t}.) @@ -4657,7 +4657,7 @@ specialized library, such as a law library or an engineering library, rather than a general library. Each library, or file, contains functions that relate to a particular topic or activity, such as @file{abbrev.el} for handling abbreviations and other typing -shortcuts, and @file{help.el} for on-line help. (Sometimes several +shortcuts, and @file{help.el} for help. (Sometimes several libraries provide code for a single activity, as the various @file{rmail@dots{}} files provide code for reading electronic mail.) In @cite{The GNU Emacs Manual}, you will see sentences such as ``The @@ -18685,9 +18685,9 @@ easy-to-read description of Emacs Lisp. It is written not only for experts, but for people who know what you know. (The @cite{Reference Manual} comes with the standard GNU Emacs distribution. Like this introduction, it comes as a Texinfo source file, so you can read it -on-line and as a typeset, printed book.) +on your computer and as a typeset, printed book.) -Go to the other on-line help that is part of GNU Emacs: the on-line +Go to the other built-in help that is part of GNU Emacs: the built-in documentation for all functions and variables, and @code{find-tag}, the program that takes you to sources. diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 4302b53a63a..cc372b006ed 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,13 @@ +2014-07-03 Glenn Morris <rgm@gnu.org> + + * help.texi (Help Functions): "Online" help doesn't mean what it + used to any more. + +2014-07-02 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymaps.texi (Key Lookup): Remove mention of indirect entries. + (Scanning Keymaps): Reword the `noindirect' argument. + 2014-06-28 Glenn Morris <rgm@gnu.org> * minibuf.texi (Intro to Minibuffers): Batch mode is basic. diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 9a763b60938..20fb0e651f9 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi @@ -508,7 +508,7 @@ non-@code{nil}, the return value is always a vector. @node Help Functions @section Help Functions - Emacs provides a variety of on-line help functions, all accessible to + Emacs provides a variety of built-in help functions, all accessible to the user as subcommands of the prefix @kbd{C-h}. For more information about them, see @ref{Help, , Help, emacs, The GNU Emacs Manual}. Here we describe some program-level interfaces to the same information. diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 7cc2b393456..e652da03385 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -1043,22 +1043,6 @@ lambda expression. This is presumed to be a function, and is treated as such (see above). In order to execute properly as a key binding, this function must be a command---it must have an @code{interactive} specification. @xref{Defining Commands}. - -@item -If the @sc{car} of @var{list} is a keymap and the @sc{cdr} is an event -type, then this is an @dfn{indirect entry}: - -@example -(@var{othermap} . @var{othertype}) -@end example - -When key lookup encounters an indirect entry, it looks up instead the -binding of @var{othertype} in @var{othermap} and uses that. - -This feature permits you to define one key as an alias for another key. -For example, an entry whose @sc{car} is the keymap called @code{esc-map} -and whose @sc{cdr} is 32 (the code for @key{SPC}) means, ``Use the global -binding of @kbd{Meta-@key{SPC}}, whatever that may be''. @end itemize @item @var{symbol} @@ -1066,9 +1050,7 @@ binding of @kbd{Meta-@key{SPC}}, whatever that may be''. The function definition of @var{symbol} is used in place of @var{symbol}. If that too is a symbol, then this process is repeated, any number of times. Ultimately this should lead to an object that is -a keymap, a command, or a keyboard macro. A list is allowed if it is a -keymap or a command, but indirect entries are not understood when found -via symbols. +a keymap, a command, or a keyboard macro. Note that keymaps and keyboard macros (strings and vectors) are not valid functions, so a symbol with a keymap, string, or vector as its @@ -1097,8 +1079,7 @@ binding is not executable as a command. @end table In short, a keymap entry may be a keymap, a command, a keyboard -macro, a symbol that leads to one of them, or an indirection or -@code{nil}. +macro, a symbol that leads to one of them, or @code{nil}. @node Functions for Key Lookup @section Functions for Key Lookup @@ -1945,9 +1926,9 @@ entirely of @acronym{ASCII} characters (or meta variants of @acronym{ASCII} characters) are preferred to all other key sequences and that the return value can never be a menu binding. -If @var{noindirect} is non-@code{nil}, @code{where-is-internal} doesn't -follow indirect keymap bindings. This makes it possible to search for -an indirect definition itself. +If @var{noindirect} is non-@code{nil}, @code{where-is-internal} doesn't look +inside menu-items to find their commands. This makes it possible to search for +a menu-item itself. The fifth argument, @var{no-remap}, determines how this function treats command remappings (@pxref{Remapping Commands}). There are two diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index d7b030fb1aa..6726007c6d8 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,14 @@ +2014-07-03 Michael Albinus <michael.albinus@gmx.de> + + * trampver.texi: Update release number. + +2014-07-03 Glenn Morris <rgm@gnu.org> + + * info.texi, mh-e.texi: "Online help" doesn't mean what it + used to any more. + + * idlwave.texi (Introduction): Comment out dead http screenshot links. + 2014-06-24 Leo Liu <sdl.web@gmail.com> * dired-x.texi (Omitting Files in Dired, Omitting Variables): diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi index 87ddcd4a4ee..5c1c8ba350f 100644 --- a/doc/misc/idlwave.texi +++ b/doc/misc/idlwave.texi @@ -239,24 +239,27 @@ Examining variables and expressions with a mouse click. And much, much more... @end itemize +@c Dead links, 2014/06. +@ignore @ifnottex @cindex Screenshots Here are a number of screenshots showing IDLWAVE in action: @itemize @bullet @item -@uref{http://idlwave.org/screenshots/emacs_21_nav.gif,An IDLWAVE buffer} +@uref{http://github.com/jdtsmith/idlwave/screenshots/emacs_21_nav.gif,An IDLWAVE buffer} @item -@uref{http://idlwave.org/screenshots/emacs_21_keys.gif,A keyword being completed} +@uref{http://github.com/jdtsmith/idlwave/screenshots/emacs_21_keys.gif,A keyword being completed} @item -@uref{http://idlwave.org/screenshots/emacs_21_help.gif,Online help text.} +@uref{http://github.com/jdtsmith/idlwave/screenshots/emacs_21_help.gif,Online help text.} @item -@uref{http://idlwave.org/screenshots/emacs_21_ri.gif,Routine information displayed} +@uref{http://github.com/jdtsmith/idlwave/screenshots/emacs_21_ri.gif,Routine information displayed} @item -@uref{http://idlwave.org/screenshots/emacs_21_bp.gif,Debugging code +@uref{http://github.com/jdtsmith/idlwave/screenshots/emacs_21_bp.gif,Debugging code stopped at a breakpoint} @end itemize @end ifnottex +@end ignore IDLWAVE is the distant successor to the @file{idl.el} and @file{idl-shell.el} files written by Chris Chase. The modes and files diff --git a/doc/misc/info.texi b/doc/misc/info.texi index 87e7794c61e..a3a14a35b80 100644 --- a/doc/misc/info.texi +++ b/doc/misc/info.texi @@ -12,7 +12,7 @@ @comment %**end of header @copying -This file describes how to use Info, the on-line, menu-driven GNU +This file describes how to use Info, the menu-driven GNU documentation system. Copyright @copyright{} 1989, 1992, 1996--2014 Free Software Foundation, Inc. @@ -51,7 +51,7 @@ modify this GNU manual.'' @node Top @top Info: An Introduction -The GNU Project distributes most of its on-line manuals in the +The GNU Project distributes most of its manuals in the @dfn{Info format}, which you read using an @dfn{Info reader}. You are probably using an Info reader to read this now. @@ -98,7 +98,7 @@ program on a computer, so that you can try Info commands while reading about them. Reading it on paper or with an HTML browser is less effective, since you must take it on faith that the commands described really do what the manual says. By all means go through this manual -now that you have it; but please try going through the on-line version +now that you have it; but please try going through the Info version as well. @cindex Info reader, how to invoke diff --git a/doc/misc/mh-e.texi b/doc/misc/mh-e.texi index bad2554e60c..6b64a108af5 100644 --- a/doc/misc/mh-e.texi +++ b/doc/misc/mh-e.texi @@ -227,7 +227,7 @@ have, see @ref{Getting Started}. @kindex C-h t If you don't already use GNU Emacs but want to learn more, you can -read an online tutorial by starting GNU Emacs and typing @kbd{C-h t} +read a built-in tutorial by starting GNU Emacs and typing @kbd{C-h t} (@code{help-with-tutorial}). (To learn about this notation, see @ref{Conventions}.) If you want to take the plunge, consult the @iftex @@ -1066,9 +1066,9 @@ This chapter begins the meat of the manual which goes into more detail about every MH-E command and option. @cindex Emacs, info -@cindex Emacs, online help +@cindex Emacs, built-in help @cindex info -@cindex online help +@cindex built-in help @findex describe-mode @findex mh-help @kindex ? @@ -1083,12 +1083,12 @@ summaries at the beginning of each chapter. In case you have or would like to rebind the keys, the command summaries also list the associated Emacs Lisp function. Furthermore, even if you're stranded on a desert island with a laptop and are without your manuals, you can -get a summary of all these commands with GNU Emacs online help: use +get a summary of all these commands with GNU Emacs built-in help: use @kbd{C-h m} (@code{describe-mode}) for a brief summary of commands, @kbd{?} (@code{mh-help}) for an even briefer summary@footnote{This help appears in a buffer called @file{*MH-E Help*} (@pxref{Miscellaneous}).} (@kbd{C-c ?} in MH-Letter mode), or @kbd{C-h -i} to read this manual via Info. The online help is quite good; try +i} to read this manual via Info. The built-in help is quite good; try running @kbd{C-h C-h}. This brings up a list of available help topics, one of which displays the documentation for a given key (like @kbd{C-h k C-n}). Another useful help feature is to view the manual section @@ -1120,21 +1120,21 @@ exist, @c Yes, some of the stuff in the following sections is redundant, but @c TeX barfs if the @ifs are inside the @footnote. @iftex -@footnote{The @cite{GNU Emacs Lisp Reference Manual} may be available -online in the Info system by typing @kbd{C-h i m Emacs Lisp +@footnote{The @cite{GNU Emacs Lisp Reference Manual} should be available +via the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}. It is also available online at @* @uref{http://www.gnu.org/software/emacs/manual/elisp.html}.} @end iftex @ifinfo @footnote{@xref{Top, The GNU Emacs Lisp Reference Manual, , elisp, GNU -Emacs Lisp Reference Manual}, which may be available online in the +Emacs Lisp Reference Manual}, which should be available via the Info system. It is also available online at @uref{http://www.gnu.org/software/emacs/manual/elisp.html}.} @end ifinfo @ifhtml @footnote{The @uref{http://www.gnu.org/software/emacs/manual/elisp.html, -The GNU Emacs Lisp Reference Manual} may also be available online in +The GNU Emacs Lisp Reference Manual} should be available via the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}.} @end ifhtml and you can look at the code itself for examples. Look in the Emacs @@ -1142,7 +1142,7 @@ Lisp directory on your system (such as @file{/usr/local/share/emacs/lisp/mh-e}) and find all the @file{mh-*.el} files there. When calling MH-E and other Emacs Lisp functions directly from Emacs Lisp code, you'll need to know the correct arguments. Use -the online help for this. For example, try @kbd{C-h f +the built-in help for this. For example, try @kbd{C-h f mh-execute-commands @key{RET}}. If you write your own functions, please do not prefix your symbols (variables and functions) with @samp{mh-}. This prefix is reserved for the MH-E package. To avoid @@ -6405,7 +6405,7 @@ see the section The Menu Bar} in @cite{The GNU Emacs Manual}. @end ifhtml -The Emacs manual describes how to get online help for a particular +The Emacs manual describes how to get help for a particular menu item. You can also look up a menu item in the index of this manual in two ways: all of the menu items are listed alphabetically, and you can also browse all of the items under the index entry diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index b98903972f7..cfcb6640183 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi @@ -5,10 +5,10 @@ @c Copyright (C) 2003-2014 Free Software Foundation, Inc. @c See file doclicense.texi for copying conditions. -@c In the Tramp CVS, the version number is auto-frobbed from +@c In the Tramp GIT, the version number is auto-frobbed from @c configure.ac, so you should edit that file and run @c "autoconf && ./configure" to change the version number. -@set trampver 2.2.10 +@set trampver 2.2.11-pre @c Other flags from configuration @set instprefix /usr/local diff --git a/etc/ChangeLog b/etc/ChangeLog index ae44fc45c3c..5dfb205dce4 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,8 @@ +2014-07-03 Glenn Morris <rgm@gnu.org> + + * refcards/calccard.tex (section{Getting Help}): + Meaning of "on-line" has changed. + 2014-06-28 Glenn Morris <rgm@gnu.org> * publicsuffix.txt: Update from source. diff --git a/etc/refcards/calccard.tex b/etc/refcards/calccard.tex index 982382ecd89..03bc37d8856 100644 --- a/etc/refcards/calccard.tex +++ b/etc/refcards/calccard.tex @@ -297,7 +297,7 @@ The \kbd{h} prefix key is Calc's analogue of \kbd{C-h} in Emacs. \key{describe key briefly}{h c} \key{describe key fully}{h k} \key{describe function or command}{h f} -\key{read on-line manual}{h i{\rm\enskip or\enskip}\calcprefix i} +\key{read Info manual}{h i{\rm\enskip or\enskip}\calcprefix i} \key{read full Calc summary}{h s{\rm\enskip or\enskip}\calcprefix s} \section{Error Recovery} diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0b90c3c98ad..5c91db50037 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,134 @@ +2014-07-04 Michael Albinus <michael.albinus@gmx.de> + + * net/dbus.el (dbus-peer-handler): New defun. + (dbus-register-service): Register it. (Bug#17858) + (dbus-managed-objects-handler): Fix docstring. + +2014-07-04 Phil Sainty <psainty@orcon.net.nz> (tiny change) + + * emacs-lisp/lisp.el (narrow-to-defun-include-comments): New var. + (narrow-to-defun): New arg include-comments, defaulting to it + (bug#16328). + +2014-07-03 Stefan Monnier <monnier@iro.umontreal.ca> + + * rect.el (rectangle--highlight-for-redisplay): Don't pass `orig' with + different calling convention to rectangle--unhighlight-for-redisplay. + +2014-07-03 Michael Albinus <michael.albinus@gmx.de> + + * net/tramp.el (tramp-call-process): Handle error strings. + + * net/tramp-adb.el (tramp-adb-sh-fix-ls-output): Use `bolp'. + + * net/tramp-sh.el (tramp-sh-handle-set-visited-file-modtime) + (tramp-sh-handle-verify-visited-file-modtime): Use `point-at-eol'. + + * net/trampver.el: Update release number. + +2014-07-03 Juri Linkov <juri@jurta.org> + + * desktop.el (desktop-save): Rename arg `auto-save' to + `only-if-changed'. Doc fix. (Bug#17873) + +2014-07-03 Stefan Monnier <monnier@iro.umontreal.ca> + + * mouse.el (mouse-yank-primary, mouse-yank-secondary): + Use insert-for-yank (bug#17271). + +2014-07-03 Leo Liu <sdl.web@gmail.com> + + * emacs-lisp/pp.el (pp-eval-expression, pp-eval-last-sexp): + Support lexical-binding. + +2014-07-03 Stefan Monnier <monnier@iro.umontreal.ca> + + * vc/log-edit.el (log-edit-goto-eoh): New function. + (log-edit--match-first-line): Use it (bug#17861). + +2014-07-03 Glenn Morris <rgm@gnu.org> + + * vc/log-edit.el (log-edit-hook): Add missing :version. + +2014-07-03 Fabián Ezequiel Gallina <fgallina@gnu.org> + + * progmodes/python.el (python-indent-post-self-insert-function): + Enhancements to electric indentation behavior inside + parens. (Bug#17658) + +2014-07-03 Stefan Monnier <monnier@iro.umontreal.ca> + + * ps-def.el (ps-generate-postscript-with-faces1): Don't mess with + buffer-invisibility-spec (bug#17867). + +2014-07-03 Andreas Schwab <schwab@linux-m68k.org> + + * vc/vc-git.el (vc-git-checkin): When operating on the whole tree + pass "-a". + +2014-07-03 Glenn Morris <rgm@gnu.org> + + * cus-edit.el (help): + * finder.el (finder-known-keywords): + * help.el (help-for-help-internal): + * vc/ediff-mult.el (ediff-meta-buffer-verbose-message) + (ediff-redraw-registry-buffer): + * vc/ediff-ptch.el (ediff-patch-file-internal): + Doc fixes re "online" help. (Bug#17803) + + * progmodes/idlwave.el (idlwave): Update url-link for custom group. + (idlwave-mode): Doc URL update. + +2014-07-01 Juri Linkov <juri@jurta.org> + + * man.el: Display man pages immediately and use process-filter + to format them asynchronously. + (Man-width): Doc fix. + (man): Doc fix. + (Man-start-calling): Use `with-selected-window' to get + `frame-width' and `window-width'. + (Man-getpage-in-background): Call `Man-notify-when-ready' + immediately after creating a new buffer. Call `Man-mode' and set + `mode-line-process' in the created buffer. Set process-filter to + `Man-bgproc-filter' in start-process branch. In call-process branch + call either `Man-fontify-manpage' or `Man-cleanup-manpage'. + Use `Man-start-calling' inside `with-current-buffer'. + (Man-fontify-manpage): Don't print messages. Fix boundary condition. + (Man-cleanup-manpage): Don't print messages. + (Man-bgproc-filter): New function. + (Man-bgproc-sentinel): Add `save-excursion' to keep point when + user moved it during asynchronous formatting. Move calls of + `Man-fontify-manpage' and `Man-cleanup-manpage' to + `Man-bgproc-filter'. Move the call of `Man-mode' to + `Man-getpage-in-background'. Use `quit-restore-window' + instead of `kill-buffer'. Use `message' instead of `error' + because errors are caught by process sentinel. + (Man-mode): Move calls of `Man-build-page-list', + `Man-strip-page-headers', `Man-unindent', `Man-goto-page' to + `Man-bgproc-sentinel'. Doc fix. (Bug#2588, bug#5054, bug#9084, bug#17831) + + * man.el (Man-bgproc-sentinel): Use `Man-page-from-arguments' + for the message about the man page cleaned up. + +2014-07-01 Mario Lang <mlang@delysid.org> + + * net/gnutls.el (gnutls-negotiate): Prevent destructive modification of + cosutomization option `gnutls-verify-error'. + +2014-07-01 Stefan Monnier <monnier@iro.umontreal.ca> + + * simple.el (deactivate-mark, set-mark-command, handle-shift-selection): + Don't keep transient-mark-mode buffer-local when not needed (bug#6316). + + * xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal) + (turn-off-xterm-mouse-tracking-on-terminal): Don't burp if the terminal + is suspended (bug#17857). + +2014-07-01 Michael Albinus <michael.albinus@gmx.de> + + * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): + Prefer utf-8 coding. (Bug#17859) + 2014-06-30 Fabián Ezequiel Gallina <fgallina@gnu.org> * emacs-lisp/subr-x.el (string-reverse): Define as obsolete alias @@ -35,8 +166,7 @@ Don't call c-parse-state when c++-template-syntax-table is active. * progmodes/cc-engine.el (c-guess-continued-construct CASE G) (c-guess-basic-syntax CASE 5D.3): Rearrange so that - c-syntactic-skip-backwards isn't called with the pertinent syntax - table. + c-syntactic-skip-backwards isn't called with the pertinent syntax table. 2014-06-28 Stephen Berman <stephen.berman@gmx.net> @@ -1638,7 +1768,7 @@ Remove HISTFILE and HISTSIZE; it's too late to set them here. Add :version entry. (tramp-open-shell): Do not let-bind `tramp-end-of-output'. - Add "HISTSIZE=/dev/null" to the shell's env arguments. Do not send + Add "HISTFILE=/dev/null" to the shell's env arguments. Do not send extra "PSx=..." commands. (tramp-maybe-open-connection): Setenv HISTFILE to /dev/null. (Bug#17295) @@ -3338,7 +3468,7 @@ 2014-03-10 Michael Albinus <michael.albinus@gmx.de> * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): - Do not add `nil' to the environment, when there's no remote `locale'. + Do not add nil to the environment, when there's no remote `locale'. (tramp-find-inline-encoding): Check, that the remote host has installed perl, before sending scripts. diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 212e29069eb..b54898a171c 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -324,7 +324,7 @@ :group 'emacs) (defgroup help nil - "Support for on-line help systems." + "Support for Emacs help systems." :group 'emacs) (defgroup multimedia nil diff --git a/lisp/desktop.el b/lisp/desktop.el index 26d288bf9cd..4bb6fba3532 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -942,12 +942,13 @@ Frames with a non-nil `desktop-dont-save' parameter are not saved." :predicate #'desktop--check-dont-save)))) ;;;###autoload -(defun desktop-save (dirname &optional release auto-save) +(defun desktop-save (dirname &optional release only-if-changed) "Save the desktop in a desktop file. Parameter DIRNAME specifies where to save the desktop file. Optional parameter RELEASE says whether we're done with this desktop. -If AUTO-SAVE is non-nil, compare the saved contents to the one last saved, -and don't save the buffer if they are the same." +If ONLY-IF-CHANGED is non-nil, compare the current desktop information +to that in the desktop file, and if the desktop information has not +changed since it was last saved then do not rewrite the file." (interactive (list ;; Or should we just use (car desktop-path)? (let ((default (if (member "." desktop-path) @@ -1020,7 +1021,7 @@ and don't save the buffer if they are the same." (setq default-directory desktop-dirname) ;; When auto-saving, avoid writing if nothing has changed since the last write. - (let* ((beg (and auto-save + (let* ((beg (and only-if-changed (save-excursion (goto-char (point-min)) ;; Don't check the header with changing timestamp diff --git a/lisp/ehelp.el b/lisp/ehelp.el index dd6c6c4cb28..46db552c3f5 100644 --- a/lisp/ehelp.el +++ b/lisp/ehelp.el @@ -25,7 +25,7 @@ ;;; Commentary: ;; This package provides a pre-packaged `Electric Help Mode' for -;; browsing on-line help screens. There is one entry point, +;; browsing Emacs help screens. There is one entry point, ;; `with-electric-help'; all you have to give it is a no-argument ;; function that generates the actual text of the help into the current ;; buffer. diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 23b021df177..30fee64635c 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -522,11 +522,15 @@ it marks the next defun after the ones already marked." (beginning-of-defun)) (re-search-backward "^\n" (- (point) 1) t))))) -(defun narrow-to-defun (&optional _arg) +(defvar narrow-to-defun-include-comments nil + "If non-nil, `narrow-to-defun' will also show comments preceding the defun.") + +(defun narrow-to-defun (&optional include-comments) "Make text outside current defun invisible. -The defun visible is the one that contains point or follows point. -Optional ARG is ignored." - (interactive) +The current defun is the one that contains point or follows point. +Preceding comments are included if INCLUDE-COMMENTS is non-nil. +Interactively, the behavior depends on `narrow-to-defun-include-comments'." + (interactive (list narrow-to-defun-include-comments)) (save-excursion (widen) (let ((opoint (point)) @@ -562,6 +566,18 @@ Optional ARG is ignored." (setq end (point)) (beginning-of-defun) (setq beg (point))) + (when include-comments + (goto-char beg) + ;; Move back past all preceding comments (and whitespace). + (when (forward-comment -1) + (while (forward-comment -1)) + ;; Move forwards past any page breaks within these comments. + (when (and page-delimiter (not (string= page-delimiter ""))) + (while (re-search-forward page-delimiter beg t))) + ;; Lastly, move past any empty lines. + (skip-chars-forward "[:space:]\n") + (beginning-of-line) + (setq beg (point)))) (goto-char end) (re-search-backward "^\n" (- (point) 1) t) (narrow-to-region beg end)))) diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index 0e4139e1aeb..dd012fab9da 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -129,7 +129,7 @@ Also add the value to the front of the list in the variable `values'." (interactive (list (read--expression "Eval: "))) (message "Evaluating...") - (setq values (cons (eval expression) values)) + (setq values (cons (eval expression lexical-binding) values)) (pp-display-expression (car values) "*Pp Eval Output*")) ;;;###autoload @@ -165,7 +165,7 @@ With argument, pretty-print output into current buffer. Ignores leading comment characters." (interactive "P") (if arg - (insert (pp-to-string (eval (pp-last-sexp)))) + (insert (pp-to-string (eval (pp-last-sexp) lexical-binding))) (pp-eval-expression (pp-last-sexp)))) ;;;###autoload diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 650b8acbb81..d1353bdc8fa 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -107,7 +107,7 @@ ;; ---------------- ;; Bug reports and ideas contributed by many users have helped ;; improve Viper and the various versions of VIP. -;; See the on-line manual for a complete list of contributors. +;; See the manual for a complete list of contributors. ;; ;; ;;; Notes: diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 8d2ea62b231..d43be54de2b 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -9,7 +9,7 @@ ;; Andreas Fuchs (afs@void.at) ;; Gergely Nagy (algernon@midgard.debian.net) ;; David Edmondson (dme@dme.org) -;; Kelvin White <kelvin.white77@gmail.com> +;; Kelvin White (kwhite@gnu.org) ;; Maintainer: emacs-devel@gnu.org ;; Keywords: IRC, chat, client, Internet ;; Version: 5.3 @@ -4252,7 +4252,7 @@ also `erc-format-nick-function'." (let ((nick (erc-server-user-nickname user))) (concat (erc-propertize (erc-get-user-mode-prefix nick) - 'face 'erc-nick-prefix-face) nick nick)))) + 'face 'erc-nick-prefix-face) nick)))) (defun erc-format-my-nick () "Return the beginning of this user's message, correctly propertized." diff --git a/lisp/finder.el b/lisp/finder.el index 092a2ddd8a4..bb5b441e26d 100644 --- a/lisp/finder.el +++ b/lisp/finder.el @@ -52,7 +52,7 @@ (frames . "Emacs frames and window systems") (games . "games, jokes and amusements") (hardware . "interfacing with system hardware") - (help . "on-line help systems") + (help . "Emacs help systems") (hypermedia . "links between text or other media types") (i18n . "internationalization and character-set support") (internal . "code for Emacs internals, build process, defaults") diff --git a/lisp/help.el b/lisp/help.el index 8ba3d86004b..63a658f391c 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -23,7 +23,7 @@ ;;; Commentary: -;; This code implements GNU Emacs's on-line help system, the one invoked by +;; This code implements GNU Emacs's built-in help system, the one invoked by ;; `M-x help-for-help'. ;;; Code: @@ -198,13 +198,13 @@ d PATTERN Show a list of functions, variables, and other items whose documentation matches the PATTERN (a list of words or a regexp). e Go to the *Messages* buffer which logs echo-area messages. f FUNCTION Display documentation for the given function. -F COMMAND Show the on-line manual's section that describes the command. +F COMMAND Show the Emacs manual's section that describes the command. g Display information about the GNU project. h Display the HELLO file which illustrates various scripts. -i Start the Info documentation reader: read on-line manuals. +i Start the Info documentation reader: read included manuals. I METHOD Describe a specific input method, or RET for current. k KEYS Display the full documentation for the key sequence. -K KEYS Show the on-line manual's section for the command bound to KEYS. +K KEYS Show the Emacs manual's section for the command bound to KEYS. l Show last 300 input keystrokes (lossage). L LANG-ENV Describes a specific language environment, or RET for current. m Display documentation of current minor modes and current major mode, @@ -214,7 +214,7 @@ p TOPIC Find packages matching a given topic keyword. P PACKAGE Describe the given Emacs Lisp package. r Display the Emacs manual in Info mode. s Display contents of current syntax table, plus explanations. -S SYMBOL Show the section for the given symbol in the on-line manual +S SYMBOL Show the section for the given symbol in the Info manual for the programming language used in this buffer. t Start the Emacs learn-by-doing tutorial. v VARIABLE Display the given variable's documentation and value. diff --git a/lisp/man.el b/lisp/man.el index 35fab2040a5..4b235302f8b 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -173,13 +173,12 @@ Any other value of `Man-notify-method' is equivalent to `meek'." (defcustom Man-width nil "Number of columns for which manual pages should be formatted. -If nil, the width of the window selected at the moment of man -invocation is used. If non-nil, the width of the frame selected -at the moment of man invocation is used. The value also can be a -positive integer." +If nil, use the width of the window where the manpage is displayed. +If non-nil, use the width of the frame where the manpage is displayed. +The value also can be a positive integer for a fixed width." :type '(choice (const :tag "Window width" nil) (const :tag "Frame width" t) - (integer :tag "Specific width" :value 65)) + (integer :tag "Fixed width" :value 65)) :group 'man) (defcustom Man-frame-parameters nil @@ -930,12 +929,14 @@ test/automated/man-tests.el in the emacs bzr repository." ;;;###autoload (defun man (man-args) "Get a Un*x manual page and put it in a buffer. -This command is the top-level command in the man package. It -runs a Un*x command to retrieve and clean a manpage in the +This command is the top-level command in the man package. +It runs a Un*x command to retrieve and clean a manpage in the background and places the results in a `Man-mode' browsing -buffer. See variable `Man-notify-method' for what happens when -the buffer is ready. If a buffer already exists for this man -page, it will display immediately. +buffer. The variable `Man-width' defines the number of columns in +formatted manual pages. The buffer is displayed immediately. +The variable `Man-notify-method' defines how the buffer is displayed. +If a buffer already exists for this man page, it will be displayed +without running the man command. For a manpage from a particular section, use either of the following. \"cat(1)\" is how cross-references appear and is @@ -1030,15 +1031,22 @@ names or descriptions. The pattern argument is usually an ;; ther is available). (when (or window-system (not (or (getenv "MANWIDTH") (getenv "COLUMNS")))) - ;; This isn't strictly correct, since we don't know how - ;; the page will actually be displayed, but it seems - ;; reasonable. + ;; Since the page buffer is displayed beforehand, + ;; we can select its window and get the window/frame width. (setenv "COLUMNS" (number-to-string (cond ((and (integerp Man-width) (> Man-width 0)) Man-width) - (Man-width (frame-width)) - ((window-width)))))) + (Man-width + (if (window-live-p (get-buffer-window (current-buffer) t)) + (with-selected-window (get-buffer-window (current-buffer) t) + (frame-width)) + (frame-width))) + (t + (if (window-live-p (get-buffer-window (current-buffer) t)) + (with-selected-window (get-buffer-window (current-buffer) t) + (window-width)) + (window-width))))))) ;; Since man-db 2.4.3-1, man writes plain text with no escape ;; sequences when stdout is not a tty. In 2.5.0, the following ;; env-var was added to allow control of this (see Debian Bug#340673). @@ -1057,33 +1065,45 @@ Return the buffer in which the manpage will appear." (message "Invoking %s %s in the background" manual-program man-args) (setq buffer (generate-new-buffer bufname)) (with-current-buffer buffer + (Man-notify-when-ready buffer) (setq buffer-undo-list t) (setq Man-original-frame (selected-frame)) - (setq Man-arguments man-args)) - (Man-start-calling - (if (fboundp 'start-process) - (set-process-sentinel - (start-process manual-program buffer - (if (memq system-type '(cygwin windows-nt)) - shell-file-name - "sh") - shell-command-switch - (format (Man-build-man-command) man-args)) - 'Man-bgproc-sentinel) - (let ((exit-status - (call-process shell-file-name nil (list buffer nil) nil - shell-command-switch - (format (Man-build-man-command) man-args))) - (msg "")) - (or (and (numberp exit-status) - (= exit-status 0)) - (and (numberp exit-status) - (setq msg - (format "exited abnormally with code %d" - exit-status))) - (setq msg exit-status)) - (Man-bgproc-sentinel bufname msg))))) - buffer)) + (setq Man-arguments man-args) + (Man-mode) + (setq mode-line-process + (concat " " (propertize (if Man-fontify-manpage-flag + "[formatting...]" + "[cleaning...]") + 'face 'mode-line-emphasis))) + (Man-start-calling + (if (fboundp 'start-process) + (let ((proc (start-process + manual-program buffer + (if (memq system-type '(cygwin windows-nt)) + shell-file-name + "sh") + shell-command-switch + (format (Man-build-man-command) man-args)))) + (set-process-sentinel proc 'Man-bgproc-sentinel) + (set-process-filter proc 'Man-bgproc-filter)) + (let* ((inhibit-read-only t) + (exit-status + (call-process shell-file-name nil (list buffer nil) nil + shell-command-switch + (format (Man-build-man-command) man-args))) + (msg "")) + (or (and (numberp exit-status) + (= exit-status 0)) + (and (numberp exit-status) + (setq msg + (format "exited abnormally with code %d" + exit-status))) + (setq msg exit-status)) + (if Man-fontify-manpage-flag + (Man-fontify-manpage) + (Man-cleanup-manpage)) + (Man-bgproc-sentinel bufname msg)))))) + buffer)) (defun Man-update-manpage () "Reformat current manpage by calling the man command again synchronously." @@ -1168,7 +1188,6 @@ See the variable `Man-notify-method' for the different notification behaviors." "Convert overstriking and underlining to the correct fonts. Same for the ANSI bold and normal escape sequences." (interactive) - (message "Please wait: formatting the %s man page..." Man-arguments) (goto-char (point-min)) ;; Fontify ANSI escapes. (let ((ansi-color-apply-face-function @@ -1183,7 +1202,7 @@ Same for the ANSI bold and normal escape sequences." ;; Multibyte characters exist. (progn (goto-char (point-min)) - (while (search-forward "__\b\b" nil t) + (while (and (search-forward "__\b\b" nil t) (not (eobp))) (backward-delete-char 4) (put-text-property (point) (1+ (point)) 'face 'Man-underline)) (goto-char (point-min)) @@ -1191,7 +1210,7 @@ Same for the ANSI bold and normal escape sequences." (backward-delete-char 4) (put-text-property (1- (point)) (point) 'face 'Man-underline)))) (goto-char (point-min)) - (while (search-forward "_\b" nil t) + (while (and (search-forward "_\b" nil t) (not (eobp))) (backward-delete-char 2) (put-text-property (point) (1+ (point)) 'face 'Man-underline)) (goto-char (point-min)) @@ -1223,8 +1242,7 @@ Same for the ANSI bold and normal escape sequences." (while (re-search-forward Man-heading-regexp nil t) (put-text-property (match-beginning 0) (match-end 0) - 'face 'Man-overstrike))) - (message "%s man page formatted" (Man-page-from-arguments Man-arguments))) + 'face 'Man-overstrike)))) (defun Man-highlight-references (&optional xref-man-type) "Highlight the references on mouse-over. @@ -1286,8 +1304,6 @@ Normally skip any jobs that should have been done by the sed script, but when called interactively, do those jobs even if the sed script would have done them." (interactive "p") - (message "Please wait: cleaning up the %s man page..." - Man-arguments) (if (or interactive (not Man-sed-script)) (progn (goto-char (point-min)) @@ -1309,8 +1325,35 @@ script would have done them." ;; their preceding chars (but don't put Man-overstrike). (Bug#5566) (goto-char (point-min)) (while (re-search-forward ".\b" nil t) (backward-delete-char 2)) - (Man-softhyphen-to-minus) - (message "%s man page cleaned up" Man-arguments)) + (Man-softhyphen-to-minus)) + +(defun Man-bgproc-filter (process string) + "Manpage background process filter. +When manpage command is run asynchronously, PROCESS is the process +object for the manpage command; when manpage command is run +synchronously, PROCESS is the name of the buffer where the manpage +command is run. Second argument STRING is the entire string of output." + (save-excursion + (let ((Man-buffer (process-buffer process))) + (if (null (buffer-name Man-buffer)) ;; deleted buffer + (set-process-buffer process nil) + + (with-current-buffer Man-buffer + (let ((inhibit-read-only t) + (beg (marker-position (process-mark process)))) + (save-excursion + (goto-char beg) + (insert string) + (save-restriction + (narrow-to-region + (save-excursion + (goto-char beg) + (line-beginning-position)) + (point)) + (if Man-fontify-manpage-flag + (Man-fontify-manpage) + (Man-cleanup-manpage))) + (set-marker (process-mark process) (point-max))))))))) (defun Man-bgproc-sentinel (process msg) "Manpage background process sentinel. @@ -1329,63 +1372,75 @@ manpage command." (set-process-buffer process nil)) (with-current-buffer Man-buffer - (let ((case-fold-search nil)) - (goto-char (point-min)) - (cond ((or (looking-at "No \\(manual \\)*entry for") - (looking-at "[^\n]*: nothing appropriate$")) - (setq err-mess (buffer-substring (point) - (progn - (end-of-line) (point))) - delete-buff t)) - - ;; "-k foo", successful exit, but no output (from man-db) - ;; ENHANCE-ME: share the check for -k with - ;; `Man-highlight-references'. The \\s- bits here are - ;; meant to allow for multiple options with -k among them. - ((and (string-match "\\(\\`\\|\\s-\\)-k\\s-" Man-arguments) - (eq (process-status process) 'exit) - (= (process-exit-status process) 0) - (= (point-min) (point-max))) - (setq err-mess (format "%s: no matches" Man-arguments) - delete-buff t)) - - ((or (stringp process) - (not (and (eq (process-status process) 'exit) - (= (process-exit-status process) 0)))) - (or (zerop (length msg)) - (progn - (setq err-mess - (concat (buffer-name Man-buffer) - ": process " - (let ((eos (1- (length msg)))) - (if (= (aref msg eos) ?\n) - (substring msg 0 eos) msg)))) - (goto-char (point-max)) - (insert (format "\nprocess %s" msg)))) - )) - (if delete-buff - (kill-buffer Man-buffer) - (if Man-fontify-manpage-flag - (Man-fontify-manpage) - (Man-cleanup-manpage)) - - (run-hooks 'Man-cooked-hook) - (Man-mode) - - (if (not Man-page-list) - (let ((args Man-arguments)) - (kill-buffer (current-buffer)) - (user-error "Can't find the %s manpage" - (Man-page-from-arguments args))) - (set-buffer-modified-p nil)))) - ;; Restore case-fold-search before calling - ;; Man-notify-when-ready because it may switch buffers. - - (if (not delete-buff) - (Man-notify-when-ready Man-buffer)) + (save-excursion + (let ((case-fold-search nil)) + (goto-char (point-min)) + (cond ((or (looking-at "No \\(manual \\)*entry for") + (looking-at "[^\n]*: nothing appropriate$")) + (setq err-mess (buffer-substring (point) + (progn + (end-of-line) (point))) + delete-buff t)) + + ;; "-k foo", successful exit, but no output (from man-db) + ;; ENHANCE-ME: share the check for -k with + ;; `Man-highlight-references'. The \\s- bits here are + ;; meant to allow for multiple options with -k among them. + ((and (string-match "\\(\\`\\|\\s-\\)-k\\s-" Man-arguments) + (eq (process-status process) 'exit) + (= (process-exit-status process) 0) + (= (point-min) (point-max))) + (setq err-mess (format "%s: no matches" Man-arguments) + delete-buff t)) + + ((or (stringp process) + (not (and (eq (process-status process) 'exit) + (= (process-exit-status process) 0)))) + (or (zerop (length msg)) + (progn + (setq err-mess + (concat (buffer-name Man-buffer) + ": process " + (let ((eos (1- (length msg)))) + (if (= (aref msg eos) ?\n) + (substring msg 0 eos) msg)))) + (goto-char (point-max)) + (insert (format "\nprocess %s" msg)))) + )) + (if delete-buff + (if (window-live-p (get-buffer-window Man-buffer t)) + (quit-restore-window + (get-buffer-window Man-buffer t) 'kill) + (kill-buffer Man-buffer)) + + (run-hooks 'Man-cooked-hook) + + (Man-build-page-list) + (Man-strip-page-headers) + (Man-unindent) + (Man-goto-page 1 t) + + (if (not Man-page-list) + (let ((args Man-arguments)) + (if (window-live-p (get-buffer-window (current-buffer) t)) + (quit-restore-window + (get-buffer-window (current-buffer) t) 'kill) + (kill-buffer (current-buffer))) + (message "Can't find the %s manpage" + (Man-page-from-arguments args))) + + (if Man-fontify-manpage-flag + (message "%s man page formatted" + (Man-page-from-arguments Man-arguments)) + (message "%s man page cleaned up" + (Man-page-from-arguments Man-arguments))) + (unless (and (processp process) + (not (eq (process-status process) 'exit))) + (setq mode-line-process nil)) + (set-buffer-modified-p nil))))) (if err-mess - (error "%s" err-mess)) + (message "%s" err-mess)) )))) (defun Man-page-from-arguments (args) @@ -1429,7 +1484,7 @@ The following man commands are available in the buffer. Try The following variables may be of some use. Try \"\\[describe-variable] <variable-name> RET\" for more information: -`Man-notify-method' What happens when manpage formatting is done. +`Man-notify-method' What happens when manpage is ready to display. `Man-downcase-section-letters-flag' Force section letters to lower case. `Man-circular-pages-flag' Treat multiple manpage list as circular. `Man-section-translations-alist' List of section numbers and their Un*x equiv. @@ -1458,11 +1513,7 @@ The following key bindings are currently in effect in the buffer: (set (make-local-variable 'outline-regexp) Man-heading-regexp) (set (make-local-variable 'outline-level) (lambda () 1)) (set (make-local-variable 'bookmark-make-record-function) - 'Man-bookmark-make-record) - (Man-build-page-list) - (Man-strip-page-headers) - (Man-unindent) - (Man-goto-page 1 t)) + 'Man-bookmark-make-record)) (defsubst Man-build-section-alist () "Build the list of manpage sections." @@ -1516,7 +1567,6 @@ The following key bindings are currently in effect in the buffer: (page-end (point-max)) (header "")) (goto-char page-start) - ;; (switch-to-buffer (current-buffer))(debug) (while (not (eobp)) (setq header (if (looking-at Man-page-header-regexp) diff --git a/lisp/mouse.el b/lisp/mouse.el index 7beea8e26e6..d3bcf02f217 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -1079,7 +1079,7 @@ regardless of where you click." (unless primary (error "No selection is available")) (push-mark (point)) - (insert primary))) + (insert-for-yank primary))) (defun mouse-kill-ring-save (click) "Copy the region between point and the mouse click in the kill ring. @@ -1361,7 +1361,7 @@ regardless of where you click." (or mouse-yank-at-point (mouse-set-point click)) (let ((secondary (x-get-selection 'SECONDARY))) (if secondary - (insert secondary) + (insert-for-yank secondary) (error "No secondary selection")))) (defun mouse-kill-secondary () diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 66170dafef8..582f54faf4e 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -544,6 +544,10 @@ placed in the queue. `:already-owner': Service is already the primary owner." + ;; Add Peer handler. + (dbus-register-method + bus service nil dbus-interface-peer "Ping" 'dbus-peer-handler 'dont-register) + ;; Add ObjectManager handler. (dbus-register-method bus service nil dbus-interface-objectmanager "GetManagedObjects" @@ -1151,6 +1155,22 @@ apply bus service dbus-path-dbus dbus-interface-peer "Ping"))) (dbus-error nil))) +(defun dbus-peer-handler () + "Default handler for the \"org.freedesktop.DBus.Peer\" interface. +It will be registered for all objects created by `dbus-register-service'." + (let* ((last-input-event last-input-event) + (method (dbus-event-member-name last-input-event))) + (cond + ;; "Ping" does not return an output parameter. + ((string-equal method "Ping") + :ignore) + ;; "GetMachineId" returns "s". + ((string-equal method "GetMachineId") + (signal + 'dbus-error + (list + (format "%s.GetMachineId not implemented" dbus-interface-peer))))))) + ;;; D-Bus introspection. @@ -1672,7 +1692,7 @@ and \"org.freedesktop.DBus.Properties.GetAll\", which is slow." (defun dbus-managed-objects-handler () "Default handler for the \"org.freedesktop.DBus.ObjectManager\" interface. -It will be registered for all objects created by `dbus-register-method'." +It will be registered for all objects created by `dbus-register-service'." (let* ((last-input-event last-input-event) (bus (dbus-event-bus-name last-input-event)) (path (dbus-event-path-name last-input-event))) diff --git a/lisp/net/gnutls.el b/lisp/net/gnutls.el index ea4c0351be7..0c650f38d95 100644 --- a/lisp/net/gnutls.el +++ b/lisp/net/gnutls.el @@ -214,7 +214,7 @@ defaults to GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT." (cl-mapcan (lambda (check) (when (string-match (car check) hostname) - (cdr check))) + (copy-sequence (cdr check)))) gnutls-verify-error)) ;; else it's nil (t nil)))) diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 4f6d5807ba5..16017eebba3 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -458,9 +458,7 @@ Emacs dired can't find files." (insert " " (mapconcat 'identity sorted-lines "\n "))) ;; Add final newline. (goto-char (point-max)) - (unless (= (point) (line-beginning-position)) - (insert "\n")))) - + (unless (bolp) (insert "\n")))) (defun tramp-adb-ls-output-time-less-p (a b) "Sort \"ls\" output by time, descending." diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 68f1ef472f1..315bc08d0ef 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -1265,8 +1265,7 @@ target of the symlink differ." (format "%s -ild %s" (tramp-get-ls-command v) (tramp-shell-quote-argument localname))) - (setq attr (buffer-substring (point) - (progn (end-of-line) (point))))) + (setq attr (buffer-substring (point) (point-at-eol)))) (tramp-set-file-property v localname "visited-file-modtime-ild" attr)) (when (boundp 'last-coding-system-used) @@ -1317,8 +1316,7 @@ of." (tramp-get-ls-command v) (tramp-shell-quote-argument localname))) (with-current-buffer (tramp-get-buffer v) - (setq attr (buffer-substring - (point) (progn (end-of-line) (point))))) + (setq attr (buffer-substring (point) (point-at-eol)))) (equal attr (tramp-get-file-property @@ -3964,15 +3962,16 @@ process to set up. VEC specifies the connection." ;; Try to set up the coding system correctly. ;; CCC this can't be the right way to do it. Hm. (tramp-message vec 5 "Determining coding system") - (tramp-send-command vec "echo foo ; echo bar" t) (with-current-buffer (process-buffer proc) - (goto-char (point-min)) (if (featurep 'mule) ;; Use MULE to select the right EOL convention for communicating ;; with the process. - (let* ((cs (or (tramp-compat-funcall 'process-coding-system proc) - (cons 'undecided 'undecided))) - cs-decode cs-encode) + (let ((cs (or (when (string-match + "utf8" (or (tramp-get-remote-locale vec) "")) + (cons 'utf-8 'utf-8)) + (tramp-compat-funcall 'process-coding-system proc) + (cons 'undecided 'undecided))) + cs-decode cs-encode) (when (symbolp cs) (setq cs (cons cs cs))) (setq cs-decode (car cs)) (setq cs-encode (cdr cs)) @@ -3980,6 +3979,8 @@ process to set up. VEC specifies the connection." (unless cs-encode (setq cs-encode 'undecided)) (setq cs-encode (tramp-compat-coding-system-change-eol-conversion cs-encode 'unix)) + (tramp-send-command vec "echo foo ; echo bar" t) + (goto-char (point-min)) (when (search-forward "\r" nil t) (setq cs-decode (tramp-compat-coding-system-change-eol-conversion cs-decode 'dos))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 6be737eb3f0..921c70135df 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4127,10 +4127,9 @@ ALIST is of the form ((FROM . TO) ...)." (defun tramp-call-process (vec program &optional infile destination display &rest args) "Calls `call-process' on the local host. -This is needed because for some Emacs flavors Tramp has -defadvised `call-process' to behave like `process-file'. The -Lisp error raised when PROGRAM is nil is trapped also, returning 1. -Furthermore, traces are written with verbosity of 6." +It always returns a return code. The Lisp error raised when +PROGRAM is nil is trapped also, returning 1. Furthermore, traces +are written with verbosity of 6." (let ((v (or vec (vector tramp-current-method tramp-current-user tramp-current-host nil nil))) @@ -4144,6 +4143,9 @@ Furthermore, traces are written with verbosity of 6." (setq result (apply 'call-process program infile (or destination t) display args)) + ;; `result' could also be an error string. + (when (stringp result) + (signal 'file-error (list result))) (with-current-buffer (if (bufferp destination) destination (current-buffer)) (tramp-message v 6 "%d\n%s" result (buffer-string)))) diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 9c0beb114bc..065c3f33ebe 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -24,14 +24,14 @@ ;;; Code: -;; In the Tramp CVS repository, the version number and the bug report +;; In the Tramp GIT repository, the version number and the bug report ;; address are auto-frobbed from configure.ac, so you should edit that ;; file and run "autoconf && ./configure" to change them. (X)Emacs ;; version check is defined in macro AC_EMACS_INFO of aclocal.m4; ;; should be changed only there. ;;;###tramp-autoload -(defconst tramp-version "2.2.10" +(defconst tramp-version "2.2.11-pre" "This version of Tramp.") ;;;###tramp-autoload @@ -44,7 +44,7 @@ (= emacs-major-version 21) (>= emacs-minor-version 4))) "ok" - (format "Tramp 2.2.10 is not fit for %s" + (format "Tramp 2.2.11-pre is not fit for %s" (when (string-match "^.*$" (emacs-version)) (match-string 0 (emacs-version))))))) (unless (string-match "\\`ok\\'" x) (error "%s" x))) diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 6431fa4aaf2..c7f018f5f15 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -71,8 +71,8 @@ ;; For example: ;; (add-to-list 'auto-mode-alist '("\\.f\\'" . f90-mode)) -;; Once you have entered f90-mode, you may get more info by using -;; the command describe-mode (C-h m). For online help use +;; Once you have entered f90-mode, you can get more info by using +;; the command describe-mode (C-h m). For help use ;; C-h f <Name of function you want described>, or ;; C-h v <Name of variable you want described>. diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index 6585668b927..f6562f32e94 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el @@ -138,7 +138,8 @@ (defcustom hide-ifdef-exclude-define-regexp nil "Ignore #define names if those names match this exclusion pattern." - :type 'string) + :type 'string + :version "24.5") (defvar hide-ifdef-mode-submap ;; Set up the submap that goes after the prefix key. diff --git a/lisp/progmodes/idlw-complete-structtag.el b/lisp/progmodes/idlw-complete-structtag.el index 39951730ab3..6cb04a03b7e 100644 --- a/lisp/progmodes/idlw-complete-structtag.el +++ b/lisp/progmodes/idlw-complete-structtag.el @@ -49,14 +49,14 @@ ;; ;; New versions of IDLWAVE, documentation, and more information available ;; from: -;; http://idlwave.org +;; http://github.com/jdtsmith/idlwave ;; ;; INSTALLATION ;; ============ ;; Put this file on the emacs load path and load it with the following ;; line in your init file: ;; -;; (add-hook 'idlwave-load-hook +;; (add-hook 'idlwave-load-hook ;; (lambda () (require 'idlw-complete-structtag))) ;; ;; DESCRIPTION diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el index b9c41c9d699..3d42fe231bd 100644 --- a/lisp/progmodes/idlw-help.el +++ b/lisp/progmodes/idlw-help.el @@ -32,7 +32,7 @@ ;; along with new versions of IDLWAVE, documentation, and more ;; information, at: ;; -;; http://idlwave.org +;; http://github.com/jdtsmith/idlwave ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index a0683d1c409..876695b0809 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -40,7 +40,7 @@ ;; ;; New versions of IDLWAVE, documentation, and more information ;; available from: -;; http://idlwave.org +;; http://github.com/jdtsmith/idlwave ;; ;; INSTALLATION: ;; ============= @@ -58,7 +58,7 @@ ;; The newest version of this file can be found on the maintainers ;; web site. ;; -;; http://idlwave.org +;; http://github.com/jdtsmith/idlwave ;; ;; DOCUMENTATION ;; ============= @@ -923,7 +923,7 @@ IDL has currently stepped.") Info documentation for this package is available. Use \\[idlwave-info] to display (complain to your sysadmin if that does not work). For PostScript and HTML versions of the documentation, check IDLWAVE's - homepage at URL `http://idlwave.org'. + homepage at URL `http://github.com/jdtsmith/idlwave'. IDLWAVE has customize support - see the group `idlwave'. 8. Keybindings diff --git a/lisp/progmodes/idlw-toolbar.el b/lisp/progmodes/idlw-toolbar.el index 7844890c22a..45672be7d97 100644 --- a/lisp/progmodes/idlw-toolbar.el +++ b/lisp/progmodes/idlw-toolbar.el @@ -29,7 +29,7 @@ ;; New versions of IDLWAVE, documentation, and more information ;; available from: -;; http://idlwave.org +;; http://github.com/jdtsmith/idlwave ;;; Code: diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 86a16036e10..e66c9655df1 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -44,7 +44,7 @@ ;; ;; New versions of IDLWAVE, documentation, and more information ;; available from: -;; http://idlwave.org +;; http://github.com/jdtsmith/idlwave ;; ;; INSTALLATION ;; ============ @@ -64,7 +64,7 @@ ;; The newest version of this file is available from the maintainer's ;; Webpage: ;; -;; http://idlwave.org +;; http://github.com/jdtsmith/idlwave ;; ;; DOCUMENTATION ;; ============= @@ -179,7 +179,7 @@ "Major mode for editing IDL .pro files." :tag "IDLWAVE" :link '(url-link :tag "Home Page" - "http://idlwave.org") + "http://github.com/jdtsmith/idlwave") :link '(emacs-commentary-link :tag "Commentary in idlw-shell.el" "idlw-shell.el") :link '(emacs-commentary-link :tag "Commentary in idlwave.el" "idlwave.el") @@ -1878,7 +1878,8 @@ The main features of this mode are Info documentation for this package is available. Use \\[idlwave-info] to display (complain to your sysadmin if that does not work). For Postscript, PDF, and HTML versions of the - documentation, check IDLWAVE's homepage at URL `http://idlwave.org'. + documentation, check IDLWAVE's homepage at URL + `http://github.com/jdtsmith/idlwave'. IDLWAVE has customize support - see the group `idlwave'. 10.Keybindings diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el index cedc2986eda..f32d4641af0 100644 --- a/lisp/progmodes/pascal.el +++ b/lisp/progmodes/pascal.el @@ -26,8 +26,8 @@ ;; ===== ;; Emacs should enter Pascal mode when you find a Pascal source file. -;; When you have entered Pascal mode, you may get more info by pressing -;; C-h m. You may also get online help describing various functions by: +;; When you have entered Pascal mode, you can get more info by pressing +;; C-h m. You can also get help describing various functions by: ;; C-h f <Name of function you want described> ;; If you want to customize Pascal mode to fit you better, you may add diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 743981b3714..065a182904f 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1096,16 +1096,28 @@ the line will be re-indented automatically if needed." (when (and electric-indent-mode (eq (char-before) last-command-event)) (cond - ((and (not (bolp)) - (memq (char-after) '(?\) ?\] ?\}))) + ;; Electric indent inside parens + ((and + (not (bolp)) + (let ((paren-start (python-syntax-context 'paren))) + ;; Check that point is inside parens. + (when paren-start + (not + ;; Filter the case where input is happening in the same + ;; line where the open paren is. + (= (line-number-at-pos) + (line-number-at-pos paren-start))))) + ;; When content has been added before the closing paren or a + ;; comma has been inserted, it's ok to do the trick. + (or + (memq (char-after) '(?\) ?\] ?\})) + (eq (char-before) ?,))) (save-excursion (goto-char (line-beginning-position)) - ;; If after going to the beginning of line the point - ;; is still inside a paren it's ok to do the trick - (when (python-syntax-context 'paren) - (let ((indentation (python-indent-calculate-indentation))) - (when (< (current-indentation) indentation) - (indent-line-to indentation)))))) + (let ((indentation (python-indent-calculate-indentation))) + (when (< (current-indentation) indentation) + (indent-line-to indentation))))) + ;; Electric colon ((and (eq ?: last-command-event) (memq ?: electric-indent-chars) (not current-prefix-arg) diff --git a/lisp/ps-def.el b/lisp/ps-def.el index 92a2e0b38cd..db0694549e1 100644 --- a/lisp/ps-def.el +++ b/lisp/ps-def.el @@ -325,8 +325,6 @@ ;; Emacs (property-change from) (overlay-change from) - (save-buffer-invisibility-spec buffer-invisibility-spec) - (buffer-invisibility-spec nil) before-string after-string) (while (< from to) (and (< property-change to) ; Don't search for property change diff --git a/lisp/rect.el b/lisp/rect.el index ac861a0824b..a2f8e4f6371 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -719,7 +719,7 @@ Ignores `line-move-visual'." ((not rectangle-mark-mode) (funcall orig start end window rol)) (rectangle--inhibit-region-highlight - (rectangle--unhighlight-for-redisplay orig rol) + (funcall redisplay-unhighlight-region-function rol) nil) ((and (eq 'rectangle (car-safe rol)) (eq (nth 1 rol) (buffer-chars-modified-tick)) diff --git a/lisp/simple.el b/lisp/simple.el index a8689aaf2e3..6fd50197a10 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4527,9 +4527,11 @@ run `deactivate-mark-hook'." (when mark-active (force-mode-line-update)) ;Refresh toolbar (bug#16382). (cond ((eq (car-safe transient-mark-mode) 'only) - (setq transient-mark-mode (cdr transient-mark-mode))) + (setq transient-mark-mode (cdr transient-mark-mode)) + (if (eq transient-mark-mode (default-value 'transient-mark-mode)) + (kill-local-variable 'transient-mark-mode))) ((eq transient-mark-mode 'lambda) - (setq transient-mark-mode nil))) + (kill-local-variable 'transient-mark-mode))) (setq mark-active nil) (run-hooks 'deactivate-mark-hook) (redisplay--update-region-highlight (selected-window)))) @@ -4756,7 +4758,7 @@ Novice Emacs Lisp programmers often try to use the mark for the wrong purposes. See the documentation of `set-mark' for more information." (interactive "P") (cond ((eq transient-mark-mode 'lambda) - (setq transient-mark-mode nil)) + (kill-local-variable 'transient-mark-mode)) ((eq (car-safe transient-mark-mode) 'only) (deactivate-mark))) (cond @@ -4894,6 +4896,8 @@ its earlier value." (push-mark nil nil t))) ((eq (car-safe transient-mark-mode) 'only) (setq transient-mark-mode (cdr transient-mark-mode)) + (if (eq transient-mark-mode (default-value 'transient-mark-mode)) + (kill-local-variable 'transient-mark-mode)) (deactivate-mark)))) (define-minor-mode transient-mark-mode diff --git a/lisp/vc/ediff-mult.el b/lisp/vc/ediff-mult.el index 9837c20b84d..56ff13fbbb6 100644 --- a/lisp/vc/ediff-mult.el +++ b/lisp/vc/ediff-mult.el @@ -140,7 +140,7 @@ Useful commands (type ? to hide them and free up screen): uh/um:\tunmark all sessions marked for hiding/operation n,SPC:\tnext session p,DEL:\tprevious session - E:\tbrowse Ediff on-line manual + E:\tbrowse Ediff manual T:\ttoggle truncation of long file names q:\tquit this session group ") @@ -1464,7 +1464,7 @@ Useful commands: R in any Ediff session: display session registry n,SPC: next session p,DEL: previous session - E: browse Ediff on-line manual + E: browse Ediff manual q: bury registry diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el index d1332351a74..bb6ab1062c1 100644 --- a/lisp/vc/ediff-ptch.el +++ b/lisp/vc/ediff-ptch.el @@ -735,7 +735,7 @@ The second problem might be due to an incompatibility among these settings: ediff-patch-program = %S ediff-patch-options = %S ediff-backup-extension = %S ediff-backup-specs = %S -See Ediff on-line manual for more details on these variables. +See Ediff manual for more details on these variables. In particular, check the documentation for `ediff-backup-specs'. In any of the above cases, Ediff doesn't compare files automatically. diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el index 927a3ba7fb6..5418039143f 100644 --- a/lisp/vc/ediff.el +++ b/lisp/vc/ediff.el @@ -64,7 +64,7 @@ ;; compressed files. Details are given below. ;; Finally, Ediff supports directory-level comparison, merging and patching. -;; See the on-line manual for details. +;; See the Ediff manual for details. ;; This package builds upon the ideas borrowed from emerge.el and several ;; Ediff's functions are adaptations from emerge.el. Much of the functionality diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index e6bd897f4ac..1d75411ec1f 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -132,6 +132,8 @@ This applies when its SETUP argument is non-nil." log-edit-insert-changelog log-edit-show-files) "Hook run at the end of `log-edit'." + ;; Added log-edit-insert-message-template, moved log-edit-show-files. + :version "24.4" :group 'log-edit :type '(hook :options (log-edit-insert-message-template log-edit-insert-cvs-rcstemplate @@ -355,9 +357,15 @@ The first subexpression is the actual text of the field.") (set-match-data (list start (point))) (point)))) +(defun log-edit-goto-eoh () ;FIXME: Almost rfc822-goto-eoh! + (goto-char (point-min)) + (when (re-search-forward + "^\\([^[:alpha:]]\\|[[:alnum:]-]+[^[:alnum:]-:]\\)" nil 'move) + (goto-char (match-beginning 0)))) + (defun log-edit--match-first-line (limit) (let ((start (point))) - (rfc822-goto-eoh) + (log-edit-goto-eoh) (skip-chars-forward "\n") (and (< start (line-end-position)) (< (point) limit) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index c7cae8359bf..9c8ab3ba393 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -674,7 +674,7 @@ It is based on `log-edit-mode', and has Git-specific extensions.") (cl-flet ((boolean-arg-fn (argument) (lambda (value) (when (equal value "yes") (list argument))))) - ;; When operating on the whole tree, better pass nil than ".", since "." + ;; When operating on the whole tree, better pass "-a" than ".", since "." ;; fails when we're committing a merge. (apply 'vc-git-command nil 0 (if only files) (nconc (list "commit" "-m") @@ -684,7 +684,7 @@ It is based on `log-edit-mode', and has Git-specific extensions.") ("Amend" . ,(boolean-arg-fn "--amend")) ("Sign-Off" . ,(boolean-arg-fn "--signoff"))) comment) - (if only (list "--only" "--"))))))) + (if only (list "--only" "--") '("-a"))))))) (defun vc-git-find-revision (file rev buffer) (let* (process-file-side-effects diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index f9e89880dae..e5e77405b02 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -312,7 +312,8 @@ terminals that support it.") "Enable xterm mouse tracking on TERMINAL." (when (and xterm-mouse-mode (eq t (terminal-live-p terminal)) ;; Avoid the initial terminal which is not a termcap device. - ;; FIXME: is there more elegant way to detect the initial terminal? + ;; FIXME: is there more elegant way to detect the initial + ;; terminal? (not (string= (terminal-name terminal) "initial_terminal"))) (unless (terminal-parameter terminal 'xterm-mouse-mode) ;; Simulate selecting a terminal by selecting one of its frames @@ -320,7 +321,13 @@ terminals that support it.") (with-selected-frame (car (frames-on-display-list terminal)) (define-key input-decode-map "\e[M" 'xterm-mouse-translate) (define-key input-decode-map "\e[<" 'xterm-mouse-translate-extended)) - (send-string-to-terminal xterm-mouse-tracking-enable-sequence terminal) + (condition-case err + (send-string-to-terminal xterm-mouse-tracking-enable-sequence + terminal) + ;; FIXME: This should use a dedicated error signal. + (error (if (equal (cadr err) "Terminal is currently suspended") + nil ;The sequence will be sent upon resume. + (signal (car err) (cdr err))))) (push xterm-mouse-tracking-enable-sequence (terminal-parameter nil 'tty-mode-set-strings)) (push xterm-mouse-tracking-disable-sequence @@ -338,7 +345,13 @@ terminals that support it.") ;; command too many times (or to catch an unintended key sequence), than ;; to send it too few times (or to fail to let xterm-mouse events ;; pass by untranslated). - (send-string-to-terminal xterm-mouse-tracking-disable-sequence terminal) + (condition-case err + (send-string-to-terminal xterm-mouse-tracking-disable-sequence + terminal) + ;; FIXME: This should use a dedicated error signal. + (error (if (equal (cadr err) "Terminal is currently suspended") + nil + (signal (car err) (cdr err))))) (setf (terminal-parameter nil 'tty-mode-set-strings) (remq xterm-mouse-tracking-enable-sequence (terminal-parameter nil 'tty-mode-set-strings))) diff --git a/src/ChangeLog b/src/ChangeLog index 1db9e8768e3..61ada3aa0d5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,9 +1,101 @@ -2014-07-01 K. Handa <handa@gnu.org> +2014-07-04 K. Handa <handa@gnu.org> * coding.c (MIN_CHARBUF_SIZE): Delete it. (MAX_CHARBUF_EXTRA_SIZE): New macro. (ALLOC_CONVERSION_WORK_AREA): Use MAX_CHARBUF_EXTRA_SIZE. +2014-07-04 Dmitry Antipov <dmantipov@yandex.ru> + + * font.h (struct font_driver): Remove get_outline and free_outline; + not used by any font driver. + * ftfont.c (ftfont_driver): + * macfont.m (macfont_driver): + * nsfont.m (nsfont_driver): + * w32font.c (w32font_driver): + * w32uniscribe.c (uniscribe_font_driver): + * xfont.c (xfont_driver): Related users changed. + * xselect.c (x_get_window_property): Use convenient xmalloc. + Call to xfree only if some data was really allocated. + +2014-07-03 Dmitry Antipov <dmantipov@yandex.ru> + + On MS-Windows, display busy cursor on all GUI frames. + This is similar to what we have on X. Quickly tested by Dani Moncayo. + * w32fns.c (toplevel): Remove hourglass_hwnd; no longer used. + (w32_show_hourglass, w32_hide_hourglass, w32_note_current_window): + Likewise. + (hide_hourglass, show_hourglass): Redesign to match X counterparts. + * xdisp.c (start_hourglass): Remove Windows-specific bits. + +2014-07-03 Dmitry Antipov <dmantipov@yandex.ru> + + Use convenient alists to manage per-frame font driver-specific data. + * frame.h (struct frame): Rename font_data_list to... + [HAVE_XFT || HAVE_FREETYPE]: ... font_data, which is a Lisp_Object now. + * font.h (struct font_data_list): Remove; no longer need a special + data type. + (font_put_frame_data, font_get_frame_data) [HAVE_XFT || HAVE_FREETYPE]: + Adjust prototypes. + * font.c (font_put_frame_data, font_get_frame_data) + [HAVE_XFT || HAVE_FREETYPE]: Prefer alist functions to ad-hoc list + management. + * xftfont.c (xftfont_get_xft_draw, xftfont_end_for_frame): + Related users changed. + * ftxfont.c (ftxfont_get_gcs, ftxfont_end_for_frame): Likewise. + Prefer convenient xmalloc and xfree. + +2014-07-03 Eli Zaretskii <eliz@gnu.org> + + * dispnew.c (prepare_desired_row): Accept 2 additional arguments: + the window whose glyph row is being prepared and a flag whether it + is for mode/header line. Make sure the glyph row's marginal areas + are in sync with what the window wants. + (Bug#17892) + + * xdisp.c (display_line, display_mode_line): Call + prepare_desired_row with additional arguments, as appropriate. + + * dispextern.h (prepare_desired_row): Adjust prototype. + +2014-07-03 Dmitry Antipov <dmantipov@yandex.ru> + + * xfaces.c (init_frame_faces): Always realize basic faces (Bug#17889). + * menu.c (Fx_popup_dialog): Set Vmenu_updating_frame to avoid crash + caused by xw_popup_dialog in daemon mode (Bug#17891). + +2014-07-03 Eli Zaretskii <eliz@gnu.org> + + * frame.c (do_switch_frame): When switching to another TTY frame, + make sure FrameCols and FrameRows are in sync with the new frame's + data. (Bug#17875) + +2014-07-02 Dmitry Antipov <dmantipov@yandex.ru> + + Shrink Lisp_Sub_Char_Table by preferring C integers to Lisp_Objects. + * lisp.h (struct Lisp_Sub_Char_Table): Use C integers for depth and + min_char slots. Adjust comment. + (enum char_table_specials): Rename from CHAR_TABLE_STANDARD_SLOTS. + Add SUB_CHAR_TABLE_OFFSET member. + (make_uninit_sub_char_table): New function. + (toplevel): Add compile-time assert to verify suitable member layout + in Lisp_Sub_Char_Table. + * alloc.c (mark_char_table): Add extra argument to denote char table + subtype. Adjust to match new layout of sub char-table. + (mark_object): Always mark sub char-tables with mark_char_table. + * chartab.c (make_sub_char_table, copy_sub_char_table) + (sub_char_table_ref, sub_char_table_ref_and_range, sub_char_table_set) + (sub_char_table_set_range, optimize_sub_char_table, map_sub_char_table) + (map_sub_char_table_for_charset, uniprop_table_uncompress): + All related users changed. + * lread.c (read1): Adjust to match new layout of sub char-table. + * print.c (print_object): Likewise (Bug#17898). + +2014-07-02 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymap.c (get_keyelt): Simplify. + (copy_keymap_item): Remove left-over code for when we had + key-shortcut caches. + 2014-06-30 Jan Djärv <jan.h.d@swipnet.se> * nsterm.m (judge): EmacsScroller: Move dealloc code here. @@ -25,8 +117,7 @@ (mouseMoved:): Set any_help_event_p to YES if help event is generated. Remove else with empty help event that triggered redisplay for every mouse move. - (windowDidResignKey:): If any_help_event_p, generate empty help - event. + (windowDidResignKey:): If any_help_event_p, generate empty help event. 2014-06-29 Dmitry Antipov <dmantipov@yandex.ru> diff --git a/src/alloc.c b/src/alloc.c index e2213db853d..6eb2e756ed1 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5958,14 +5958,15 @@ mark_vectorlike (struct Lisp_Vector *ptr) symbols. */ static void -mark_char_table (struct Lisp_Vector *ptr) +mark_char_table (struct Lisp_Vector *ptr, enum pvec_type pvectype) { int size = ptr->header.size & PSEUDOVECTOR_SIZE_MASK; - int i; + /* Consult the Lisp_Sub_Char_Table layout before changing this. */ + int i, idx = (pvectype == PVEC_SUB_CHAR_TABLE ? SUB_CHAR_TABLE_OFFSET : 0); eassert (!VECTOR_MARKED_P (ptr)); VECTOR_MARK (ptr); - for (i = 0; i < size; i++) + for (i = idx; i < size; i++) { Lisp_Object val = ptr->contents[i]; @@ -5974,7 +5975,7 @@ mark_char_table (struct Lisp_Vector *ptr) if (SUB_CHAR_TABLE_P (val)) { if (! VECTOR_MARKED_P (XVECTOR (val))) - mark_char_table (XVECTOR (val)); + mark_char_table (XVECTOR (val), PVEC_SUB_CHAR_TABLE); } else mark_object (val); @@ -6320,7 +6321,8 @@ mark_object (Lisp_Object arg) break; case PVEC_CHAR_TABLE: - mark_char_table (ptr); + case PVEC_SUB_CHAR_TABLE: + mark_char_table (ptr, (enum pvec_type) pvectype); break; case PVEC_BOOL_VECTOR: @@ -7218,7 +7220,7 @@ The time is in seconds as a floating point value. */); union { enum CHARTAB_SIZE_BITS CHARTAB_SIZE_BITS; - enum CHAR_TABLE_STANDARD_SLOTS CHAR_TABLE_STANDARD_SLOTS; + enum char_table_specials char_table_specials; enum char_bits char_bits; enum CHECK_LISP_OBJECT_TYPE CHECK_LISP_OBJECT_TYPE; enum DEFAULT_HASH_SIZE DEFAULT_HASH_SIZE; diff --git a/src/chartab.c b/src/chartab.c index 4d4e6381b19..3906ad30b37 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -140,15 +140,11 @@ the char-table has no extra slot. */) static Lisp_Object make_sub_char_table (int depth, int min_char, Lisp_Object defalt) { - Lisp_Object table; - int size = (PSEUDOVECSIZE (struct Lisp_Sub_Char_Table, contents) - + chartab_size[depth]); - - table = Fmake_vector (make_number (size), defalt); - XSETPVECTYPE (XVECTOR (table), PVEC_SUB_CHAR_TABLE); - XSUB_CHAR_TABLE (table)->depth = make_number (depth); - XSUB_CHAR_TABLE (table)->min_char = make_number (min_char); + int i; + Lisp_Object table = make_uninit_sub_char_table (depth, min_char); + for (i = 0; i < chartab_size[depth]; i++) + XSUB_CHAR_TABLE (table)->contents[i] = defalt; return table; } @@ -172,8 +168,8 @@ char_table_ascii (Lisp_Object table) static Lisp_Object copy_sub_char_table (Lisp_Object table) { - int depth = XINT (XSUB_CHAR_TABLE (table)->depth); - int min_char = XINT (XSUB_CHAR_TABLE (table)->min_char); + int depth = XSUB_CHAR_TABLE (table)->depth; + int min_char = XSUB_CHAR_TABLE (table)->min_char; Lisp_Object copy = make_sub_char_table (depth, min_char, Qnil); int i; @@ -220,10 +216,8 @@ static Lisp_Object sub_char_table_ref (Lisp_Object table, int c, bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); - int depth = XINT (tbl->depth); - int min_char = XINT (tbl->min_char); Lisp_Object val; - int idx = CHARTAB_IDX (c, depth, min_char); + int idx = CHARTAB_IDX (c, tbl->depth, tbl->min_char); val = tbl->contents[idx]; if (is_uniprop && UNIPROP_COMPRESSED_FORM_P (val)) @@ -265,8 +259,7 @@ sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, Lisp_Object defalt, bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); - int depth = XINT (tbl->depth); - int min_char = XINT (tbl->min_char); + int depth = tbl->depth, min_char = tbl->min_char; int chartab_idx = CHARTAB_IDX (c, depth, min_char), idx; Lisp_Object val; @@ -402,8 +395,7 @@ static void sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); - int depth = XINT ((tbl)->depth); - int min_char = XINT ((tbl)->min_char); + int depth = tbl->depth, min_char = tbl->min_char; int i = CHARTAB_IDX (c, depth, min_char); Lisp_Object sub; @@ -458,8 +450,7 @@ sub_char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val, bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); - int depth = XINT ((tbl)->depth); - int min_char = XINT ((tbl)->min_char); + int depth = tbl->depth, min_char = tbl->min_char; int chars_in_block = chartab_chars[depth]; int i, c, lim = chartab_size[depth]; @@ -689,9 +680,8 @@ static Lisp_Object optimize_sub_char_table (Lisp_Object table, Lisp_Object test) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); - int depth = XINT (tbl->depth); + int i, depth = tbl->depth; Lisp_Object elt, this; - int i; bool optimizable; elt = XSUB_CHAR_TABLE (table)->contents[0]; @@ -778,8 +768,8 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); - depth = XINT (tbl->depth); - min_char = XINT (tbl->min_char); + depth = tbl->depth; + min_char = tbl->min_char; max_char = min_char + chartab_chars[depth - 1] - 1; } else @@ -973,12 +963,10 @@ map_sub_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object), unsigned from, unsigned to) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); - int depth = XINT (tbl->depth); - int c, i; + int i, c = tbl->min_char, depth = tbl->depth; if (depth < 3) - for (i = 0, c = XINT (tbl->min_char); i < chartab_size[depth]; - i++, c += chartab_chars[depth]) + for (i = 0; i < chartab_size[depth]; i++, c += chartab_chars[depth]) { Lisp_Object this; @@ -1000,7 +988,7 @@ map_sub_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object), } } else - for (i = 0, c = XINT (tbl->min_char); i < chartab_size[depth]; i++, c ++) + for (i = 0; i < chartab_size[depth]; i++, c++) { Lisp_Object this; unsigned code; @@ -1147,8 +1135,7 @@ static Lisp_Object uniprop_table_uncompress (Lisp_Object table, int idx) { Lisp_Object val = XSUB_CHAR_TABLE (table)->contents[idx]; - int min_char = (XINT (XSUB_CHAR_TABLE (table)->min_char) - + chartab_chars[2] * idx); + int min_char = XSUB_CHAR_TABLE (table)->min_char + chartab_chars[2] * idx; Lisp_Object sub = make_sub_char_table (3, min_char, Qnil); const unsigned char *p, *pend; diff --git a/src/dispextern.h b/src/dispextern.h index 5396aeb6c8e..0e04cc466d3 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3460,7 +3460,7 @@ void increment_matrix_positions (struct glyph_matrix *, void blank_row (struct window *, struct glyph_row *, int); void clear_glyph_matrix_rows (struct glyph_matrix *, int, int); void clear_glyph_row (struct glyph_row *); -void prepare_desired_row (struct glyph_row *); +void prepare_desired_row (struct window *, struct glyph_row *, bool); void update_single_window (struct window *, bool); void do_pending_window_change (bool); void change_frame_size (struct frame *, int, int, bool, bool, bool, bool); diff --git a/src/dispnew.c b/src/dispnew.c index 163780952a6..2d137b4abbd 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -449,7 +449,8 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y + x); if (w == NULL - || row == matrix->rows + dim.height - 1 + || (row == matrix->rows + dim.height - 1 + && WINDOW_WANTS_MODELINE_P (w)) || (row == matrix->rows && matrix->header_line_p)) { row->glyphs[TEXT_AREA] @@ -492,8 +493,9 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y = xnrealloc (row->glyphs[LEFT_MARGIN_AREA], dim.width, sizeof (struct glyph)); - /* The mode line never has marginal areas. */ - if (row == matrix->rows + dim.height - 1 + /* The mode line, if displayed, never has marginal areas. */ + if ((row == matrix->rows + dim.height - 1 + && !(w && WINDOW_WANTS_MODELINE_P (w))) || (row == matrix->rows && matrix->header_line_p)) { row->glyphs[TEXT_AREA] @@ -1049,13 +1051,16 @@ find_glyph_row_slice (struct glyph_matrix *window_matrix, #endif /* 0 */ -/* Prepare ROW for display. Desired rows are cleared lazily, - i.e. they are only marked as to be cleared by setting their +/* Prepare ROW for display in windows W. Desired rows are cleared + lazily, i.e. they are only marked as to be cleared by setting their enabled_p flag to zero. When a row is to be displayed, a prior - call to this function really clears it. */ + call to this function really clears it. In addition, this function + makes sure the marginal areas of ROW are in sync with the window's + display margins. MODE_LINE_P non-zero means we are preparing a + glyph row for header line or mode line. */ void -prepare_desired_row (struct glyph_row *row) +prepare_desired_row (struct window *w, struct glyph_row *row, bool mode_line_p) { if (!row->enabled_p) { @@ -1065,6 +1070,39 @@ prepare_desired_row (struct glyph_row *row) row->enabled_p = true; row->reversed_p = rp; } + if (mode_line_p) + { + /* Mode and header lines, if displayed, never have marginal + areas. If we are called with MODE_LINE_P non-zero, we are + displaying the mode/header line in this window, and so the + marginal areas of this glyph row should be eliminated. This + is needed when the mode/header line is switched on in a + window that has display margins. */ + if (w->left_margin_cols > 0) + row->glyphs[TEXT_AREA] = row->glyphs[LEFT_MARGIN_AREA]; + if (w->right_margin_cols > 0) + row->glyphs[RIGHT_MARGIN_AREA] = row->glyphs[LAST_AREA]; + } + else if (row == MATRIX_MODE_LINE_ROW (w->desired_matrix) + || row == MATRIX_HEADER_LINE_ROW (w->desired_matrix)) + { + /* The real number of glyphs reserved for the margins is + recorded in the glyph matrix, and can be different from + window's left_margin_cols and right_margin_cols; see + margin_glyphs_to_reserve for when that happens. */ + int left = w->desired_matrix->left_margin_glyphs; + int right = w->desired_matrix->right_margin_glyphs; + + /* Make sure the marginal areas of this row are in sync with + what the window wants, when the 1st/last row of the matrix + actually displays text and not header/mode line. */ + if (w->left_margin_cols > 0 + && (left != row->glyphs[TEXT_AREA] - row->glyphs[LEFT_MARGIN_AREA])) + row->glyphs[TEXT_AREA] = row->glyphs[LEFT_MARGIN_AREA] + left; + if (w->right_margin_cols > 0 + && (right != row->glyphs[LAST_AREA] - row->glyphs[RIGHT_MARGIN_AREA])) + row->glyphs[RIGHT_MARGIN_AREA] = row->glyphs[LAST_AREA] - right; + } } diff --git a/src/font.c b/src/font.c index 251d43ba8b2..7b9edcd3fb8 100644 --- a/src/font.c +++ b/src/font.c @@ -3539,53 +3539,34 @@ font_update_drivers (struct frame *f, Lisp_Object new_drivers) return active_drivers; } -int -font_put_frame_data (struct frame *f, struct font_driver *driver, void *data) -{ - struct font_data_list *list, *prev; +#if defined (HAVE_XFT) || defined (HAVE_FREETYPE) - for (prev = NULL, list = f->font_data_list; list; - prev = list, list = list->next) - if (list->driver == driver) - break; - if (! data) - { - if (list) - { - if (prev) - prev->next = list->next; - else - f->font_data_list = list->next; - xfree (list); - } - return 0; - } +void +font_put_frame_data (struct frame *f, Lisp_Object driver, void *data) +{ + Lisp_Object val = assq_no_quit (driver, f->font_data); - if (! list) + if (!data) + f->font_data = Fdelq (val, f->font_data); + else { - list = xmalloc (sizeof *list); - list->driver = driver; - list->next = f->font_data_list; - f->font_data_list = list; + if (NILP (val)) + f->font_data = Fcons (Fcons (driver, make_save_ptr (data)), + f->font_data); + else + XSETCDR (val, make_save_ptr (data)); } - list->data = data; - return 0; } - void * -font_get_frame_data (struct frame *f, struct font_driver *driver) +font_get_frame_data (struct frame *f, Lisp_Object driver) { - struct font_data_list *list; - - for (list = f->font_data_list; list; list = list->next) - if (list->driver == driver) - break; - if (! list) - return NULL; - return list->data; + Lisp_Object val = assq_no_quit (driver, f->font_data); + + return NILP (val) ? NULL : XSAVE_POINTER (XCDR (val), 0); } +#endif /* HAVE_XFT || HAVE_FREETYPE */ /* Sets attributes on a font. Any properties that appear in ALIST and BOOLEAN_PROPERTIES or NON_BOOLEAN_PROPERTIES are set on the font. diff --git a/src/font.h b/src/font.h index 42137deeaa4..c23b826bd46 100644 --- a/src/font.h +++ b/src/font.h @@ -614,15 +614,6 @@ struct font_driver #endif /* HAVE_WINDOW_SYSTEM */ /* Optional. - Return an outline data for glyph-code CODE of FONT. The format - of the outline data depends on the font-driver. */ - void *(*get_outline) (struct font *font, unsigned code); - - /* Optional. - Free OUTLINE (that is obtained by the above method). */ - void (*free_outline) (struct font *font, void *outline); - - /* Optional. Get coordinates of the INDEXth anchor point of the glyph whose code is CODE. Store the coordinates in *X and *Y. Return 0 if the operations was successful. Otherwise return -1. */ @@ -723,20 +714,6 @@ struct font_driver_list struct font_driver_list *next; }; - -/* Chain of arbitrary data specific to each font driver. - Each frame has its own font data list at F->font_data_list. */ - -struct font_data_list -{ - /* Pointer to the font driver. */ - struct font_driver *driver; - /* Data specific to the font driver. */ - void *data; - /* Pointer to the next element of the chain. */ - struct font_data_list *next; -}; - extern Lisp_Object copy_font_spec (Lisp_Object); extern Lisp_Object merge_font_spec (Lisp_Object, Lisp_Object); @@ -809,11 +786,10 @@ extern void font_fill_lglyph_metrics (Lisp_Object, Lisp_Object); extern Lisp_Object font_put_extra (Lisp_Object font, Lisp_Object prop, Lisp_Object val); -extern int font_put_frame_data (struct frame *f, - struct font_driver *driver, - void *data); -extern void *font_get_frame_data (struct frame *f, - struct font_driver *driver); +#if defined (HAVE_XFT) || defined (HAVE_FREETYPE) +extern void font_put_frame_data (struct frame *, Lisp_Object, void *); +extern void *font_get_frame_data (struct frame *f, Lisp_Object); +#endif /* HAVE_XFT || HAVE_FREETYPE */ extern void font_filter_properties (Lisp_Object font, Lisp_Object alist, diff --git a/src/frame.c b/src/frame.c index c67a233f099..0ccc0f6fcfd 100644 --- a/src/frame.c +++ b/src/frame.c @@ -46,6 +46,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #ifdef HAVE_WINDOW_SYSTEM #include "fontset.h" #endif +#include "cm.h" #ifdef MSDOS #include "msdos.h" #include "dosfns.h" @@ -854,7 +855,9 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor if (FRAME_TERMCAP_P (XFRAME (frame)) || FRAME_MSDOS_P (XFRAME (frame))) { - Lisp_Object top_frame = FRAME_TTY (XFRAME (frame))->top_frame; + struct frame *f = XFRAME (frame); + struct tty_display_info *tty = FRAME_TTY (f); + Lisp_Object top_frame = tty->top_frame; /* Don't mark the frame garbaged and/or obscured if we are switching to the frame that is already the top frame of that @@ -864,9 +867,16 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor if (FRAMEP (top_frame)) /* Mark previously displayed frame as now obscured. */ SET_FRAME_VISIBLE (XFRAME (top_frame), 2); - SET_FRAME_VISIBLE (XFRAME (frame), 1); + SET_FRAME_VISIBLE (f, 1); + /* If the new TTY frame changed dimensions, we need to + resync term.c's idea of the frame size with the new + frame's data. */ + if (FRAME_COLS (f) != FrameCols (tty)) + FrameCols (tty) = FRAME_COLS (f); + if (FRAME_LINES (f) != FrameRows (tty)) + FrameRows (tty) = FRAME_LINES (f); } - FRAME_TTY (XFRAME (frame))->top_frame = frame; + tty->top_frame = frame; } selected_frame = frame; diff --git a/src/frame.h b/src/frame.h index 2da9fff2d4a..4fb98278a51 100644 --- a/src/frame.h +++ b/src/frame.h @@ -159,6 +159,11 @@ struct frame tool bar only supports top. */ Lisp_Object tool_bar_position; +#if defined (HAVE_XFT) || defined (HAVE_FREETYPE) + /* List of data specific to font-driver and frame, but common to faces. */ + Lisp_Object font_data; +#endif + /* Beyond here, there should be no more Lisp_Object components. */ /* Cache of realized faces. */ @@ -328,9 +333,6 @@ struct frame /* List of font-drivers available on the frame. */ struct font_driver_list *font_driver_list; - /* List of data specific to font-driver and frame, but common to - faces. */ - struct font_data_list *font_data_list; /* Total width of fringes reserved for drawing truncation bitmaps, continuation bitmaps and alike. The width is in canonical char diff --git a/src/ftfont.c b/src/ftfont.c index 0f23b086cf5..7c5d01208d2 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -538,8 +538,6 @@ struct font_driver ftfont_driver = NULL, /* draw */ ftfont_get_bitmap, NULL, /* free_bitmap */ - NULL, /* get_outline */ - NULL, /* free_outline */ ftfont_anchor_point, #ifdef HAVE_LIBOTF ftfont_otf_capability, diff --git a/src/ftxfont.c b/src/ftxfont.c index 53f2616bb62..63e3477ebf4 100644 --- a/src/ftxfont.c +++ b/src/ftxfont.c @@ -59,7 +59,7 @@ ftxfont_get_gcs (struct frame *f, unsigned long foreground, unsigned long backgr XColor color; XGCValues xgcv; int i; - struct ftxfont_frame_data *data = font_get_frame_data (f, &ftxfont_driver); + struct ftxfont_frame_data *data = font_get_frame_data (f, Qftx); struct ftxfont_frame_data *prev = NULL, *this = NULL, *new; if (data) @@ -78,19 +78,11 @@ ftxfont_get_gcs (struct frame *f, unsigned long foreground, unsigned long backgr } } - new = malloc (sizeof *new); - if (! new) - return NULL; + new = xmalloc (sizeof *new); new->next = this; if (prev) - { prev->next = new; - } - else if (font_put_frame_data (f, &ftxfont_driver, new) < 0) - { - free (new); - return NULL; - } + font_put_frame_data (f, Qftx, new); new->colors[0].pixel = background; new->colors[1].pixel = foreground; @@ -123,8 +115,8 @@ ftxfont_get_gcs (struct frame *f, unsigned long foreground, unsigned long backgr if (prev) prev->next = new->next; else if (data) - font_put_frame_data (f, &ftxfont_driver, new->next); - free (new); + font_put_frame_data (f, Qftx, new->next); + xfree (new); return NULL; } return new->gcs; @@ -337,7 +329,7 @@ ftxfont_draw (struct glyph_string *s, int from, int to, int x, int y, static int ftxfont_end_for_frame (struct frame *f) { - struct ftxfont_frame_data *data = font_get_frame_data (f, &ftxfont_driver); + struct ftxfont_frame_data *data = font_get_frame_data (f, Qftx); block_input (); while (data) @@ -347,11 +339,11 @@ ftxfont_end_for_frame (struct frame *f) for (i = 0; i < 6; i++) XFreeGC (FRAME_X_DISPLAY (f), data->gcs[i]); - free (data); + xfree (data); data = next; } unblock_input (); - font_put_frame_data (f, &ftxfont_driver, NULL); + font_put_frame_data (f, Qftx, NULL); return 0; } diff --git a/src/keymap.c b/src/keymap.c index 0b2b61dcc05..76119606643 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -727,11 +727,6 @@ get_keyelt (Lisp_Object object, bool autoload) /* This is really the value. */ return object; - /* If the keymap contents looks like (keymap ...) or (lambda ...) - then use itself. */ - else if (EQ (XCAR (object), Qkeymap) || EQ (XCAR (object), Qlambda)) - return object; - /* If the keymap contents looks like (menu-item name . DEFN) or (menu-item name DEFN ...) then use DEFN. This is a new format menu item. */ @@ -768,25 +763,8 @@ get_keyelt (Lisp_Object object, bool autoload) Keymap alist elements like (CHAR MENUSTRING . DEFN) will be used by HierarKey menus. */ else if (STRINGP (XCAR (object))) - { - object = XCDR (object); - /* Also remove a menu help string, if any, - following the menu item name. */ - if (CONSP (object) && STRINGP (XCAR (object))) - object = XCDR (object); - /* Also remove the sublist that caches key equivalences, if any. */ - if (CONSP (object) && CONSP (XCAR (object))) - { - Lisp_Object carcar; - carcar = XCAR (XCAR (object)); - if (NILP (carcar) || VECTORP (carcar)) - object = XCDR (object); - } - } + object = XCDR (object); - /* If the contents are (KEYMAP . ELEMENT), go indirect. */ - else if (KEYMAPP (XCAR (object))) - error ("Wow, indirect keymap entry!!"); else return object; } @@ -990,9 +968,6 @@ copy_keymap_item (Lisp_Object elt) if (CONSP (tem) && EQ (XCAR (tem), Qkeymap)) XSETCAR (elt, Fcopy_keymap (tem)); tem = XCDR (elt); - if (CONSP (tem) && CONSP (XCAR (tem))) - /* Delete cache for key equivalences. */ - XSETCDR (elt, XCDR (tem)); } } else @@ -1011,16 +986,6 @@ copy_keymap_item (Lisp_Object elt) elt = XCDR (elt); tem = XCDR (elt); } - /* There may also be a list that caches key equivalences. - Just delete it for the new keymap. */ - if (CONSP (tem) - && CONSP (XCAR (tem)) - && (NILP (XCAR (XCAR (tem))) - || VECTORP (XCAR (XCAR (tem))))) - { - XSETCDR (elt, XCDR (tem)); - tem = XCDR (tem); - } if (CONSP (tem) && EQ (XCAR (tem), Qkeymap)) XSETCDR (elt, Fcopy_keymap (tem)); } @@ -2572,9 +2537,8 @@ If FIRSTONLY has another non-nil value, prefer bindings that use the modifier key specified in `where-is-preferred-modifier' \(or their meta variants) and entirely reject menu bindings. -If optional 4th arg NOINDIRECT is non-nil, don't follow indirections -to other keymaps or slots. This makes it possible to search for an -indirect definition itself. +If optional 4th arg NOINDIRECT is non-nil, don't extract the commands inside +menu-items. This makes it possible to search for a menu-item itself. The optional 5th arg NO-REMAP alters how command remapping is handled: diff --git a/src/lisp.h b/src/lisp.h index fb832b80940..6af390604d6 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1407,10 +1407,11 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val) sense to handle a char-table with type struct Lisp_Vector. An element of a char table can be any Lisp objects, but if it is a sub char-table, we treat it a table that contains information of a - specific range of characters. A sub char-table has the same - structure as a vector. A sub char table appears only in an element - of a char-table, and there's no way to access it directly from - Emacs Lisp program. */ + specific range of characters. A sub char-table is like a vector but + with two integer fields between the header and Lisp data, which means + that it has to be marked with some precautions (see mark_char_table + in alloc.c). A sub char-table appears only in an element of a char-table, + and there's no way to access it directly from Emacs Lisp program. */ enum CHARTAB_SIZE_BITS { @@ -1465,10 +1466,10 @@ struct Lisp_Sub_Char_Table contains 32 elements, and each element covers 128 characters. A sub char-table of depth 3 contains 128 elements, and each element is for one character. */ - Lisp_Object depth; + int depth; /* Minimum character covered by the sub char-table. */ - Lisp_Object min_char; + int min_char; /* Use set_sub_char_table_contents to set this. */ Lisp_Object contents[FLEXIBLE_ARRAY_MEMBER]; @@ -1539,12 +1540,16 @@ struct Lisp_Subr const char *doc; }; -/* This is the number of slots that every char table must have. This - counts the ordinary slots and the top, defalt, parent, and purpose - slots. */ -enum CHAR_TABLE_STANDARD_SLOTS +enum char_table_specials { - CHAR_TABLE_STANDARD_SLOTS = PSEUDOVECSIZE (struct Lisp_Char_Table, extras) + /* This is the number of slots that every char table must have. This + counts the ordinary slots and the top, defalt, parent, and purpose + slots. */ + CHAR_TABLE_STANDARD_SLOTS = PSEUDOVECSIZE (struct Lisp_Char_Table, extras), + + /* This is an index of first Lisp_Object field in Lisp_Sub_Char_Table + when the latter is treated as an ordinary Lisp_Vector. */ + SUB_CHAR_TABLE_OFFSET = PSEUDOVECSIZE (struct Lisp_Sub_Char_Table, contents) }; /* Return the number of "extra" slots in the char table CT. */ @@ -1556,7 +1561,11 @@ CHAR_TABLE_EXTRA_SLOTS (struct Lisp_Char_Table *ct) - CHAR_TABLE_STANDARD_SLOTS); } - +/* Make sure that sub char-table contents slot + is aligned on a multiple of Lisp_Objects. */ +verify ((offsetof (struct Lisp_Sub_Char_Table, contents) + - offsetof (struct Lisp_Sub_Char_Table, depth)) % word_size == 0); + /*********************************************************************** Symbols ***********************************************************************/ @@ -3723,6 +3732,20 @@ make_uninit_vector (ptrdiff_t size) return v; } +/* Like above, but special for sub char-tables. */ + +INLINE Lisp_Object +make_uninit_sub_char_table (int depth, int min_char) +{ + int slots = SUB_CHAR_TABLE_OFFSET + chartab_size[depth]; + Lisp_Object v = make_uninit_vector (slots); + + XSETPVECTYPE (XVECTOR (v), PVEC_SUB_CHAR_TABLE); + XSUB_CHAR_TABLE (v)->depth = depth; + XSUB_CHAR_TABLE (v)->min_char = min_char; + return v; +} + extern struct Lisp_Vector *allocate_pseudovector (int, int, enum pvec_type); #define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \ ((typ*) \ diff --git a/src/lread.c b/src/lread.c index f252993207d..639d574ac6b 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2619,21 +2619,38 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) c = READCHAR; if (c == '[') { - Lisp_Object tmp; - int depth; - ptrdiff_t size; + /* Sub char-table can't be read as a regular + vector because of a two C integer fields. */ + Lisp_Object tbl, tmp = read_list (1, readcharfun); + ptrdiff_t size = XINT (Flength (tmp)); + int i, depth, min_char; + struct Lisp_Cons *cell; - tmp = read_vector (readcharfun, 0); - size = ASIZE (tmp); if (size == 0) - error ("Invalid size char-table"); - if (! RANGED_INTEGERP (1, AREF (tmp, 0), 3)) - error ("Invalid depth in char-table"); - depth = XINT (AREF (tmp, 0)); + error ("Zero-sized sub char-table"); + + if (! RANGED_INTEGERP (1, XCAR (tmp), 3)) + error ("Invalid depth in sub char-table"); + depth = XINT (XCAR (tmp)); if (chartab_size[depth] != size - 2) - error ("Invalid size char-table"); - XSETPVECTYPE (XVECTOR (tmp), PVEC_SUB_CHAR_TABLE); - return tmp; + error ("Invalid size in sub char-table"); + cell = XCONS (tmp), tmp = XCDR (tmp), size--; + free_cons (cell); + + if (! RANGED_INTEGERP (0, XCAR (tmp), MAX_CHAR)) + error ("Invalid minimum character in sub-char-table"); + min_char = XINT (XCAR (tmp)); + cell = XCONS (tmp), tmp = XCDR (tmp), size--; + free_cons (cell); + + tbl = make_uninit_sub_char_table (depth, min_char); + for (i = 0; i < size; i++) + { + XSUB_CHAR_TABLE (tbl)->contents[i] = XCAR (tmp); + cell = XCONS (tmp), tmp = XCDR (tmp); + free_cons (cell); + } + return tbl; } invalid_syntax ("#^^"); } diff --git a/src/macfont.m b/src/macfont.m index 9b3cb2c29f6..82ee54cdc63 100644 --- a/src/macfont.m +++ b/src/macfont.m @@ -1580,8 +1580,6 @@ static struct font_driver macfont_driver = macfont_draw, NULL, /* get_bitmap */ NULL, /* free_bitmap */ - NULL, /* get_outline */ - NULL, /* free_outline */ NULL, /* anchor_point */ NULL, /* otf_capability */ NULL, /* otf_drive */ diff --git a/src/menu.c b/src/menu.c index a523cfc6010..e0f226562f8 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1529,6 +1529,11 @@ for instance using the window manager, then this produces a quit and but I don't want to make one now. */ CHECK_WINDOW (window); + /* Note that xw_popup_dialog can call menu code, so + Vmenu_updating_frame should be set (Bug#17891). */ + eassert (f && FRAME_LIVE_P (f)); + XSETFRAME (Vmenu_updating_frame, f); + /* Force a redisplay before showing the dialog. If a frame is created just before showing the dialog, its contents may not have been fully drawn, as this depends on timing of events from the X server. Redisplay diff --git a/src/nsfont.m b/src/nsfont.m index 2c5e25b993c..cadc68f9933 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -649,7 +649,7 @@ struct font_driver nsfont_driver = nsfont_encode_char, nsfont_text_extents, nsfont_draw, - /* excluded: get_bitmap, free_bitmap, get_outline, free_outline, + /* excluded: get_bitmap, free_bitmap, anchor_point, otf_capability, otf_driver, start_for_frame, end_for_frame, shape */ }; diff --git a/src/print.c b/src/print.c index 9050a0cb773..2f52f5d03ec 100644 --- a/src/print.c +++ b/src/print.c @@ -1968,7 +1968,7 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) Otherwise we'll make a line extremely long, which results in slow redisplay. */ if (SUB_CHAR_TABLE_P (obj) - && XINT (XSUB_CHAR_TABLE (obj)->depth) == 3) + && XSUB_CHAR_TABLE (obj)->depth == 3) PRINTCHAR ('\n'); PRINTCHAR ('#'); PRINTCHAR ('^'); @@ -1981,16 +1981,24 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) PRINTCHAR ('['); { - register int i; + int i, idx = SUB_CHAR_TABLE_P (obj) ? SUB_CHAR_TABLE_OFFSET : 0; register Lisp_Object tem; ptrdiff_t real_size = size; + /* For a sub char-table, print heading non-Lisp data first. */ + if (SUB_CHAR_TABLE_P (obj)) + { + i = sprintf (buf, "%d %d", XSUB_CHAR_TABLE (obj)->depth, + XSUB_CHAR_TABLE (obj)->min_char); + strout (buf, i, i, printcharfun); + } + /* Don't print more elements than the specified maximum. */ if (NATNUMP (Vprint_length) && XFASTINT (Vprint_length) < size) size = XFASTINT (Vprint_length); - for (i = 0; i < size; i++) + for (i = idx; i < size; i++) { if (i) PRINTCHAR (' '); tem = AREF (obj, i); diff --git a/src/w32fns.c b/src/w32fns.c index e24148af4ff..def9d8acb7a 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -89,9 +89,6 @@ extern void w32_free_menu_strings (HWND); extern const char *map_w32_filename (const char *, const char **); extern char * w32_strerror (int error_no); -/* If non-NULL, a handle to a frame where to display the hourglass cursor. */ -static HWND hourglass_hwnd = NULL; - #ifndef IDC_HAND #define IDC_HAND MAKEINTRESOURCE(32649) #endif @@ -233,10 +230,6 @@ static int menubar_in_use = 0; extern void syms_of_w32uniscribe (void); extern int uniscribe_available; -/* Function prototypes for hourglass support. */ -static void w32_show_hourglass (struct frame *); -static void w32_hide_hourglass (void); - #ifdef WINDOWSNT /* From w32inevt.c */ extern int faked_key; @@ -5500,95 +5493,62 @@ no value of TYPE (always string in the MS Windows case). */) Busy cursor ***********************************************************************/ -void -w32_note_current_window (void) -{ - struct frame * f = SELECTED_FRAME (); - - if (!FRAME_W32_P (f)) - return; - - hourglass_hwnd = FRAME_W32_WINDOW (f); -} +/* Display an hourglass cursor. Set the hourglass_p flag in display info + to indicate that an hourglass cursor is shown. */ void show_hourglass (struct atimer *timer) { - struct frame *f; - hourglass_atimer = NULL; - block_input (); - f = x_window_to_frame (&one_w32_display_info, - hourglass_hwnd); - - if (f) - f->output_data.w32->hourglass_p = 0; - else - f = SELECTED_FRAME (); - - if (!FRAME_W32_P (f)) + if (!hourglass_shown_p) { - unblock_input (); - return; - } - - w32_show_hourglass (f); - unblock_input (); -} + Lisp_Object tail, frame; -void -hide_hourglass (void) -{ - block_input (); - w32_hide_hourglass (); - unblock_input (); -} - - -/* Display an hourglass cursor. Set the hourglass_p flag in display info - to indicate that an hourglass cursor is shown. */ + block_input (); + FOR_EACH_FRAME (tail, frame) + { + struct frame *f = XFRAME (frame); -static void -w32_show_hourglass (struct frame *f) -{ - if (!hourglass_shown_p) - { - f->output_data.w32->hourglass_p = 1; - if (!menubar_in_use && !current_popup_menu) - SetCursor (f->output_data.w32->hourglass_cursor); + if (FRAME_W32_P (f) && !menubar_in_use && !current_popup_menu) + { + f->output_data.w32->hourglass_p = 1; + SetCursor (f->output_data.w32->hourglass_cursor); + } + } + unblock_input (); hourglass_shown_p = 1; } } - /* Hide the hourglass cursor on all frames, if it is currently shown. */ -static void -w32_hide_hourglass (void) +void +hide_hourglass (void) { if (hourglass_shown_p) { - struct frame *f = x_window_to_frame (&one_w32_display_info, - hourglass_hwnd); - if (f) - f->output_data.w32->hourglass_p = 0; - else - /* If frame was deleted, restore to selected frame's cursor. */ - f = SELECTED_FRAME (); + Lisp_Object tail, frame; - if (FRAME_W32_P (f)) - SetCursor (f->output_data.w32->current_cursor); - else - /* No cursors on non GUI frames - restore to stock arrow cursor. */ - SetCursor (w32_load_cursor (IDC_ARROW)); + block_input (); + FOR_EACH_FRAME (tail, frame) + { + struct frame *f = XFRAME (frame); + if (FRAME_W32_P (f)) + { + f->output_data.w32->hourglass_p = 0; + SetCursor (f->output_data.w32->current_cursor); + } + else + /* No cursors on non GUI frames - restore to stock arrow cursor. */ + SetCursor (w32_load_cursor (IDC_ARROW)); + } + unblock_input (); hourglass_shown_p = 0; } } - - /*********************************************************************** Tool tips ***********************************************************************/ @@ -8415,9 +8375,6 @@ only be necessary if the default setting causes problems. */); #endif defsubr (&Sset_message_beep); - - hourglass_hwnd = NULL; - defsubr (&Sx_show_tip); defsubr (&Sx_hide_tip); tip_timer = Qnil; diff --git a/src/w32font.c b/src/w32font.c index 5262f38663f..43b592ee450 100644 --- a/src/w32font.c +++ b/src/w32font.c @@ -757,19 +757,6 @@ w32font_get_bitmap (struct font *font, unsigned code, static void w32font_free_bitmap (struct font *font, struct font_bitmap *bitmap); */ -/* w32 implementation of get_outline for font backend. - Optional. - Return an outline data for glyph-code CODE of FONT. The format - of the outline data depends on the font-driver. -static void * -w32font_get_outline (struct font *font, unsigned code); - */ -/* w32 implementation of free_outline for font backend. - Optional. - Free OUTLINE (that is obtained by the above method). -static void -w32font_free_outline (struct font *font, void *outline); - */ /* w32 implementation of anchor_point for font backend. Optional. Get coordinates of the INDEXth anchor point of the glyph whose @@ -2557,8 +2544,6 @@ struct font_driver w32font_driver = w32font_draw, NULL, /* get_bitmap */ NULL, /* free_bitmap */ - NULL, /* get_outline */ - NULL, /* free_outline */ NULL, /* anchor_point */ NULL, /* otf_capability */ NULL, /* otf_drive */ diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index 5bb444f519a..24fc753e708 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -604,8 +604,6 @@ uniscribe_encode_char (struct font *font, int c) int uniscribe_get_bitmap (struct font *font, unsigned code, struct font_bitmap *bitmap, int bits_per_pixel); void uniscribe_free_bitmap (struct font *font, struct font_bitmap *bitmap); - void * uniscribe_get_outline (struct font *font, unsigned code); - void uniscribe_free_outline (struct font *font, void *outline); int uniscribe_anchor_point (struct font *font, unsigned code, int index, int *x, int *y); int uniscribe_start_for_frame (struct frame *f); @@ -981,8 +979,6 @@ struct font_driver uniscribe_font_driver = w32font_draw, NULL, /* get_bitmap */ NULL, /* free_bitmap */ - NULL, /* get_outline */ - NULL, /* free_outline */ NULL, /* anchor_point */ uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works. */ NULL, /* otf_drive - use shape instead. */ diff --git a/src/window.h b/src/window.h index bdc5dddb7e5..b9c2b1f5ba8 100644 --- a/src/window.h +++ b/src/window.h @@ -271,8 +271,10 @@ struct window int left_fringe_width; int right_fringe_width; - /* Width of left and right marginal areas in columns. - A value of 0 means no margin. */ + /* Requested width of left and right marginal areas in columns. A + value of 0 means no margin. The actual values are recorded in + the window's glyph matrix, in the left_margin_glyphs and + right_margin_glyphs members. */ int left_margin_cols; int right_margin_cols; diff --git a/src/xdisp.c b/src/xdisp.c index 31d293143f3..6cec0bf1925 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -19878,7 +19878,7 @@ display_line (struct it *it) } /* Clear the result glyph row and enable it. */ - prepare_desired_row (row); + prepare_desired_row (it->w, row, false); row->y = it->current_y; row->start = it->start; @@ -21517,7 +21517,7 @@ display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format) /* Don't extend on a previously drawn mode-line. This may happen if called from pos_visible_p. */ it.glyph_row->enabled_p = false; - prepare_desired_row (it.glyph_row); + prepare_desired_row (w, it.glyph_row, true); it.glyph_row->mode_line_p = 1; @@ -30683,13 +30683,6 @@ start_hourglass (void) else delay = make_timespec (DEFAULT_HOURGLASS_DELAY, 0); -#ifdef HAVE_NTGUI - { - extern void w32_note_current_window (void); - w32_note_current_window (); - } -#endif /* HAVE_NTGUI */ - hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, show_hourglass, NULL); } diff --git a/src/xfaces.c b/src/xfaces.c index 4571137a249..ead14f0116d 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -676,19 +676,9 @@ init_frame_faces (struct frame *f) } #endif /* HAVE_WINDOW_SYSTEM */ - /* Realize basic faces. Must have enough information in frame - parameters to realize basic faces at this point. */ -#ifdef HAVE_X_WINDOWS - if (!FRAME_X_P (f) || FRAME_X_WINDOW (f)) -#endif -#ifdef HAVE_NTGUI - if (!FRAME_WINDOW_P (f) || FRAME_W32_WINDOW (f)) -#endif -#ifdef HAVE_NS - if (!FRAME_NS_P (f) || FRAME_NS_WINDOW (f)) -#endif - if (!realize_basic_faces (f)) - emacs_abort (); + /* Realize faces early (Bug#17889). */ + if (!realize_basic_faces (f)) + emacs_abort (); } diff --git a/src/xfont.c b/src/xfont.c index f90904a018e..baed9abbc7e 100644 --- a/src/xfont.c +++ b/src/xfont.c @@ -146,7 +146,7 @@ struct font_driver xfont_driver = xfont_encode_char, xfont_text_extents, xfont_draw, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, xfont_check, NULL, /* get_variation_glyphs */ NULL, /* filter_properties */ diff --git a/src/xftfont.c b/src/xftfont.c index 2b4ec065734..bd3f2c92142 100644 --- a/src/xftfont.c +++ b/src/xftfont.c @@ -593,7 +593,7 @@ xftfont_text_extents (struct font *font, unsigned int *code, int nglyphs, struct static XftDraw * xftfont_get_xft_draw (struct frame *f) { - XftDraw *xft_draw = font_get_frame_data (f, &xftfont_driver); + XftDraw *xft_draw = font_get_frame_data (f, Qxft); if (! xft_draw) { @@ -604,7 +604,7 @@ xftfont_get_xft_draw (struct frame *f) FRAME_X_COLORMAP (f)); unblock_input (); eassert (xft_draw != NULL); - font_put_frame_data (f, &xftfont_driver, xft_draw); + font_put_frame_data (f, Qxft, xft_draw); } return xft_draw; } @@ -680,14 +680,14 @@ xftfont_end_for_frame (struct frame *f) /* Don't do anything if display is dead */ if (FRAME_X_DISPLAY (f) == NULL) return 0; - xft_draw = font_get_frame_data (f, &xftfont_driver); + xft_draw = font_get_frame_data (f, Qxft); if (xft_draw) { block_input (); XftDrawDestroy (xft_draw); unblock_input (); - font_put_frame_data (f, &xftfont_driver, NULL); + font_put_frame_data (f, Qxft, NULL); } return 0; } diff --git a/src/xselect.c b/src/xselect.c index 89ec1da30b2..f23256346cb 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -1299,9 +1299,7 @@ x_get_window_property (Display *display, Window window, Atom property, if (total_size_max < bytes_remaining) goto size_overflow; total_size = bytes_remaining; - data = malloc (total_size + 1); - if (! data) - goto memory_exhausted; + data = xmalloc (total_size + 1); /* Now read, until we've gotten it all. */ while (bytes_remaining) @@ -1352,9 +1350,7 @@ x_get_window_property (Display *display, Window window, Atom property, if (remaining_lim < 0 || remaining_lim < bytes_remaining) goto size_overflow; total_size = offset + bytes_gotten + bytes_remaining; - data1 = realloc (data, total_size + 1); - if (! data1) - goto memory_exhausted; + data1 = xrealloc (data, total_size + 1); data = data1; } @@ -1386,14 +1382,10 @@ x_get_window_property (Display *display, Window window, Atom property, return; size_overflow: - free (data); + if (data) + xfree (data); unblock_input (); memory_full (SIZE_MAX); - - memory_exhausted: - free (data); - unblock_input (); - memory_full (total_size + 1); } /* Use xfree, not XFree, to free the data obtained with this function. */ diff --git a/test/ChangeLog b/test/ChangeLog index 8c28eaf30dc..029360f5664 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,16 @@ +2014-07-04 Michael Albinus <michael.albinus@gmx.de> + + * automated/dbus-tests.el (dbus-test02-register-service-session) + (dbus-test02-register-service-system): Fix docstring. + (dbus-test02-register-service-own-bus) + (dbus-test03-peer-interface): New tests. + +2014-07-03 Fabián Ezequiel Gallina <fgallina@gnu.org> + + * automated/python-tests.el (python-tests-self-insert): New function. + (python-triple-quote-pairing): Use it. + (python-util-forward-comment-1): New test. (Bug#17658) + 2014-06-30 Fabián Ezequiel Gallina <fgallina@gnu.org> * automated/subr-x-tests.el: New file. diff --git a/test/automated/dbus-tests.el b/test/automated/dbus-tests.el index 1af5c77de53..b157a365a4c 100644 --- a/test/automated/dbus-tests.el +++ b/test/automated/dbus-tests.el @@ -103,7 +103,7 @@ (should-error (dbus-unregister-service bus dbus-service-dbus))) (ert-deftest dbus-test02-register-service-session () - "Check service registration at `:session'." + "Check service registration at `:session' bus." (skip-unless (and dbus--test-enabled-session-bus (dbus-register-service :session dbus-service-emacs))) (dbus--test-register-service :session) @@ -121,11 +121,57 @@ (should (eq (dbus-unregister-service :session service) :not-owner))))) (ert-deftest dbus-test02-register-service-system () - "Check service registration at `:system'." + "Check service registration at `:system' bus." (skip-unless (and dbus--test-enabled-system-bus (dbus-register-service :system dbus-service-emacs))) (dbus--test-register-service :system)) +(ert-deftest dbus-test02-register-service-own-bus () + "Check service registration with an own bus. +This includes initialization and closing the bus." + ;; Start bus. + (let ((output + (ignore-errors + (shell-command-to-string "dbus-launch --sh-syntax"))) + bus pid) + (skip-unless (stringp output)) + (when (string-match "DBUS_SESSION_BUS_ADDRESS='\\(.+\\)';" output) + (setq bus (match-string 1 output))) + (when (string-match "DBUS_SESSION_BUS_PID=\\([[:digit:]]+\\);" output) + (setq pid (match-string 1 output))) + (unwind-protect + (progn + (skip-unless + (dbus-ignore-errors + (and bus pid + (featurep 'dbusbind) + (dbus-init-bus bus) + (dbus-get-unique-name bus) + (dbus-register-service bus dbus-service-emacs)))) + ;; Run the test. + (dbus--test-register-service bus)) + + ;; Save exit. + (when pid (call-process "kill" nil nil nil pid))))) + +(ert-deftest dbus-test03-peer-interface () + "Check `dbus-interface-peer' methods." + (skip-unless + (and dbus--test-enabled-session-bus + (dbus-register-service :session dbus-service-emacs) + ;; "GetMachineId" is not implemented (yet). When it returns a + ;; value, another D-Bus client like dbus-monitor is reacting + ;; on `dbus-interface-peer'. We cannot test then. + (not + (dbus-ignore-errors + (dbus-call-method + :session dbus-service-emacs dbus-path-dbus + dbus-interface-peer "GetMachineId" :timeout 100))))) + + (should (dbus-ping :session dbus-service-emacs 100)) + (dbus-unregister-service :session dbus-service-emacs) + (should-not (dbus-ping :session dbus-service-emacs 100))) + (defun dbus-test-all (&optional interactive) "Run all tests for \\[dbus]." (interactive "p") diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index f580e946b8f..a35242fe882 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el @@ -86,6 +86,24 @@ STRING, it is skipped so the next STRING occurrence is selected." found-point (and restore-point (goto-char starting-point))))) +(defun python-tests-self-insert (char-or-str) + "Call `self-insert-command' for chars in CHAR-OR-STR." + (let ((chars + (cond + ((characterp char-or-str) + (list char-or-str)) + ((stringp char-or-str) + (string-to-list char-or-str)) + ((not + (cl-remove-if #'characterp char-or-str)) + char-or-str) + (t (error "CHAR-OR-STR must be a char, string, or list of char"))))) + (mapc + (lambda (char) + (let ((last-command-event char)) + (call-interactively 'self-insert-command))) + chars))) + ;;; Tests for your tests, so you can test while you test. @@ -2715,9 +2733,6 @@ def foo(a, b, c): (should (string= (python-util-strip-string "\n \t \n\r ") "")) (should (string= (python-util-strip-string "") ""))) - -;;; Electricity - (ert-deftest python-util-forward-comment-1 () (python-tests-with-temp-buffer (concat @@ -2730,36 +2745,85 @@ def foo(a, b, c): (python-util-forward-comment -1) (should (= (point) (point-min))))) + +;;; Electricity + +(ert-deftest python-parens-electric-indent-1 () + (require 'electric) + (let ((eim electric-indent-mode)) + (unwind-protect + (progn + (python-tests-with-temp-buffer + " +from django.conf.urls import patterns, include, url + +from django.contrib import admin + +from myapp import views + + +urlpatterns = patterns('', + url(r'^$', views.index +) +" + (electric-indent-mode 1) + (python-tests-look-at "views.index") + (end-of-line) + + ;; Inserting commas within the same line should leave + ;; indentation unchanged. + (python-tests-self-insert ",") + (should (= (current-indentation) 4)) + + ;; As well as any other input happening within the same + ;; set of parens. + (python-tests-self-insert " name='index')") + (should (= (current-indentation) 4)) + + ;; But a comma outside it, should trigger indentation. + (python-tests-self-insert ",") + (should (= (current-indentation) 23)) + + ;; Newline indents to the first argument column + (python-tests-self-insert "\n") + (should (= (current-indentation) 23)) + + ;; All this input must not change indentation + (indent-line-to 4) + (python-tests-self-insert "url(r'^/login$', views.login)") + (should (= (current-indentation) 4)) + + ;; But this comma does + (python-tests-self-insert ",") + (should (= (current-indentation) 23)))) + (or eim (electric-indent-mode -1))))) + (ert-deftest python-triple-quote-pairing () (require 'electric) (let ((epm electric-pair-mode)) (unwind-protect (progn (python-tests-with-temp-buffer - "\"\"\n" - (or epm (electric-pair-mode 1)) - (goto-char (1- (point-max))) - (let ((last-command-event ?\")) - (call-interactively 'self-insert-command)) - (should (string= (buffer-string) - "\"\"\"\"\"\"\n")) - (should (= (point) 4))) + "\"\"\n" + (or epm (electric-pair-mode 1)) + (goto-char (1- (point-max))) + (python-tests-self-insert ?\") + (should (string= (buffer-string) + "\"\"\"\"\"\"\n")) + (should (= (point) 4))) (python-tests-with-temp-buffer - "\n" - (let ((last-command-event ?\")) - (dotimes (i 3) - (call-interactively 'self-insert-command))) - (should (string= (buffer-string) - "\"\"\"\"\"\"\n")) - (should (= (point) 4))) + "\n" + (python-tests-self-insert (list ?\" ?\" ?\")) + (should (string= (buffer-string) + "\"\"\"\"\"\"\n")) + (should (= (point) 4))) (python-tests-with-temp-buffer - "\"\n\"\"\n" - (goto-char (1- (point-max))) - (let ((last-command-event ?\")) - (call-interactively 'self-insert-command)) - (should (= (point) (1- (point-max)))) - (should (string= (buffer-string) - "\"\n\"\"\"\n")))) + "\"\n\"\"\n" + (goto-char (1- (point-max))) + (python-tests-self-insert ?\") + (should (= (point) (1- (point-max)))) + (should (string= (buffer-string) + "\"\n\"\"\"\n")))) (or epm (electric-pair-mode -1))))) |
