------------------------------------------------------------ revno: 116507 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2014-02-21 11:02:19 +0200 message: Update MS-Windows entries in etc/PROBLEMS. diff: === modified file 'etc/PROBLEMS' --- etc/PROBLEMS 2014-01-23 02:11:13 +0000 +++ etc/PROBLEMS 2014-02-21 09:02:19 +0000 @@ -1901,6 +1901,39 @@ * Runtime problems specific to MS-Windows +** Emacs on Windows 9X requires UNICOWS.DLL + +If that DLL is not available, Emacs will display an error dialog +stating its absence, and refuse to run. + +This is because Emacs 24.4 and later uses functions whose non-stub +implementation is only available in UNICOWS.DLL, which implements the +Microsoft Layer for Unicode on Windows 9X, or "MSLU". This article on +MSDN: + + http://msdn.microsoft.com/en-us/goglobal/bb688166.aspx + +includes a short description of MSLU and a link where it can be +downloaded. + +** A few seconds delay is seen at startup and for many file operations + +This happens when the Net Logon service is enabled. During Emacs +startup, this service issues many DNS requests looking up for the +Windows Domain Controller. When Emacs accesses files on networked +drives, it automatically logs on the user into those drives, which +again causes delays when Net Logon is running. + +The solution seems to be to disable Net Logon with this command typed +at the Windows shell prompt: + + net stop netlogon + +To start the service again, type "net start netlogon". (You can also +stop and start the service from the Computer Management application, +accessible by right-clicking "My Computer" or "Computer", selecting +"Manage", then clicking on "Services".) + ** PATH can contain unexpanded environment variables Old releases of TCC (version 9) and 4NT (up to version 8) do not correctly @@ -1920,8 +1953,8 @@ ** Windows 95 and networking. -To support server sockets, Emacs 22.1 loads ws2_32.dll. If this file -is missing, all Emacs networking features are disabled. +To support server sockets, Emacs loads ws2_32.dll. If this file is +missing, all Emacs networking features are disabled. Old versions of Windows 95 may not have the required DLL. To use Emacs's networking features on Windows 95, you must install the @@ -1940,28 +1973,36 @@ rails-mode that avoids this crash, or avoid using UNC paths if using rails-mode. -** Known problems with the MS-Windows port of Emacs 22.3 - -M-x term does not work on MS-Windows. TTY emulation on Windows is -undocumented, and programs such as stty which are used on posix platforms -to control tty emulation do not exist for native windows terminals. - -Using create-fontset-from-ascii-font or the --font startup parameter +** M-x term does not work on MS-Windows. + +TTY emulation on Windows is undocumented, and programs such as stty +which are used on posix platforms to control tty emulation do not +exist for native windows terminals. + +** Using create-fontset-from-ascii-font or the --font startup parameter with a Chinese, Japanese or Korean font leads to display problems. Use a Latin-only font as your default font. If you want control over which font is used to display Chinese, Japanese or Korean character, use create-fontset-from-fontset-spec to define a fontset. -Frames are not refreshed while the File or Font dialog or a pop-up menu -is displayed. This also means help text for pop-up menus is not -displayed at all. This is because message handling under Windows is -synchronous, so we cannot handle repaint (or any other) messages while -waiting for a system function to return the result of the dialog or -pop-up menu interaction. +** Frames are not refreshed while dialogs or menus are displayed + +This means no redisplay while the File or Font dialog or a pop-up menu +is displayed. This also means tooltips with help text for pop-up +menus is not displayed at all (except in a TTY session, where the help +text is shown in the echo area). This is because message handling +under Windows is synchronous, so we cannot handle repaint (or any +other) messages while waiting for a system function, which popped up +the menu/dialog, to return the result of the dialog or pop-up menu +interaction. + +** Help text in tooltips does not work on old Windows versions Windows 95 and Windows NT up to version 4.0 do not support help text for menus. Help text is only available in later versions of Windows. +** Display problems with ClearType method of smoothing + When "ClearType" method is selected as the "method to smooth edges of screen fonts" (in Display Properties, Appearance tab, under "Effects"), there are various problems related to display of @@ -1973,6 +2014,8 @@ this display feature needs more changes to get it 100% right. A workaround is to disable ClearType. +** Problems with mouse-tracking and focus management + There are problems with display if mouse-tracking is enabled and the mouse is moved off a frame, over another frame then back over the first frame. A workaround is to click the left mouse button inside the frame @@ -1984,22 +2027,22 @@ An inactive cursor remains in an active window after the Windows Manager driven switch of the focus, until a key is pressed. -Windows input methods are not recognized by Emacs. However, some -of these input methods cause the keyboard to send characters encoded -in the appropriate coding system (e.g., ISO 8859-1 for Latin-1 -characters, ISO 8859-8 for Hebrew characters, etc.). To make these -input methods work with Emacs, set the keyboard coding system to the -appropriate value after you activate the Windows input method. For -example, if you activate the Hebrew input method, type this: +** Problems with Windows input methods + +Some of the Windows input methods cause the keyboard to send +characters encoded in the appropriate coding system (e.g., ISO 8859-1 +for Latin-1 characters, ISO 8859-8 for Hebrew characters, etc.). To +make these input methods work with Emacs on Windows 9X, you might need +to set the keyboard coding system to the appropriate value after you +activate the Windows input method. For example, if you activate the +Hebrew input method, type this: C-x RET k hebrew-iso-8bit RET -(Emacs ought to recognize the Windows language-change event and set up -the appropriate keyboard encoding automatically, but it doesn't do -that yet.) In addition, to use these Windows input methods, you -should set your "Language for non-Unicode programs" (on Windows XP, -this is on the Advanced tab of Regional Settings) to the language of -the input method. +In addition, to use these Windows input methods, you might need to set +your "Language for non-Unicode programs" (on Windows XP, this is on +the Advanced tab of Regional Settings) to the language of the input +method. To bind keys that produce non-ASCII characters with modifiers, you must specify raw byte codes. For instance, if you want to bind @@ -2011,20 +2054,28 @@ of the encoded a-grave is 340 octal. For other environments, use the encoding appropriate to that environment. +** Problems with the %b format specifier for format-time-string + The %b specifier for format-time-string does not produce abbreviated month names with consistent widths for some locales on some versions of Windows. This is caused by a deficiency in the underlying system library function. +** Problems with set-time-zone-rule function + The function set-time-zone-rule gives incorrect results for many non-US timezones. This is due to over-simplistic handling of daylight savings switchovers by the Windows libraries. +** Files larger than 4GB report wrong size + Files larger than 4GB cause overflow in the size (represented as a 32-bit integer) reported by `file-attributes'. This affects Dired as well, since the Windows port uses a Lisp emulation of `ls' that relies on `file-attributes'. +** Playing sound doesn't support the :data method + Sound playing is not supported with the `:data DATA' key-value pair. You _must_ use the `:file FILE' method. ------------------------------------------------------------ revno: 116506 committer: Glenn Morris branch nick: trunk timestamp: Fri 2014-02-21 00:08:08 -0800 message: * etc/MACHINES: Add note re Irix 6.5. diff: === modified file 'etc/MACHINES' --- etc/MACHINES 2014-01-01 07:43:34 +0000 +++ etc/MACHINES 2014-02-21 08:08:08 +0000 @@ -100,6 +100,13 @@ ./configure CC='/usr/sfw/bin/gcc -m64' # GCC ./configure CC='cc -m64' # Solaris Studio +** Irix 6.5 + + It *may* be possible to build Emacs on Irix 6.5 with an old version + (3.1) of gcc. Newer versions of gcc may not work. None of the + current Emacs developers use Irix, though. If you want to help + make Emacs on Irix work, see . + * Obsolete platforms ------------------------------------------------------------ revno: 116505 committer: Glenn Morris branch nick: trunk timestamp: Fri 2014-02-21 00:04:15 -0800 message: Some doc updates for default process sentinels and filters not being nil * doc/lispref/internals.texi (Process Internals): * doc/lispref/processes.texi (Deleting Processes, Output from Processes) (Process Buffers, Filter Functions, Accepting Output, Sentinels) (Network, Network Servers, Network Processes, Serial Ports): Filters and sentinels can no longer be nil. * doc/lispref/elisp.texi (Top): Menu update. * doc/misc/flymake.texi (Starting the syntax check process): Grammar fix. * doc/misc/tramp.texi (External packages): Grammar fix. Reword for default sentinel not being nil any more. * src/process.c (Fprocess_buffer, Faccept_process_output) (Finternal_default_process_filter, Finternal_default_process_sentinel): Doc fixes. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-02-20 07:38:47 +0000 +++ doc/lispref/ChangeLog 2014-02-21 08:04:15 +0000 @@ -1,3 +1,12 @@ +2014-02-21 Glenn Morris + + * internals.texi (Process Internals): + * processes.texi (Deleting Processes, Output from Processes) + (Process Buffers, Filter Functions, Accepting Output, Sentinels) + (Network, Network Servers, Network Processes, Serial Ports): + Filters and sentinels can no longer be nil. + * elisp.texi (Top): Menu update. + 2014-02-20 Glenn Morris * functions.texi (Defining Functions): Mention defalias-fset-function. === modified file 'doc/lispref/elisp.texi' --- doc/lispref/elisp.texi 2014-01-10 19:40:32 +0000 +++ doc/lispref/elisp.texi 2014-02-21 08:04:15 +0000 @@ -1305,7 +1305,7 @@ Receiving Output from Processes -* Process Buffers:: If no filter, output is put in a buffer. +* Process Buffers:: By default, output is put in a buffer. * Filter Functions:: Filter functions accept output from the process. * Decoding Output:: Filters can get unibyte or multibyte strings. * Accepting Output:: How to wait until process output arrives. === modified file 'doc/lispref/internals.texi' --- doc/lispref/internals.texi 2014-01-01 07:43:34 +0000 +++ doc/lispref/internals.texi 2014-02-21 08:04:15 +0000 @@ -1469,12 +1469,10 @@ process is running or @code{t} if the process is stopped. @item filter -If non-@code{nil}, a function used to accept output from the process -instead of a buffer. +A function used to accept output from the process. @item sentinel -If non-@code{nil}, a function called whenever the state of the process -changes. +A function called whenever the state of the process changes. @item buffer The associated buffer of the process. === modified file 'doc/lispref/processes.texi' --- doc/lispref/processes.texi 2014-01-01 07:43:34 +0000 +++ doc/lispref/processes.texi 2014-02-21 08:04:15 +0000 @@ -696,7 +696,7 @@ at any time. If you explicitly delete a terminated process before it is deleted automatically, no harm results. Deleting a running process sends a signal to terminate it (and its child processes, if -any), and calls the process sentinel if it has one. @xref{Sentinels}. +any), and calls the process sentinel. @xref{Sentinels}. When a process is deleted, the process object itself continues to exist as long as other Lisp objects point to it. All the Lisp @@ -719,7 +719,7 @@ buffer, or the name of a buffer. (A buffer or buffer-name stands for the process that @code{get-buffer-process} returns.) Calling @code{delete-process} on a running process terminates it, updates the -process status, and runs the sentinel (if any) immediately. If the +process status, and runs the sentinel immediately. If the process has already terminated, calling @code{delete-process} has no effect on its status, or on the running of its sentinel (which will happen sooner or later). @@ -1170,7 +1170,7 @@ shell command. @menu -* Process Buffers:: If no filter, output is put in a buffer. +* Process Buffers:: By default, output is put in a buffer. * Filter Functions:: Filter functions accept output from the process. * Decoding Output:: Filters can get unibyte or multibyte strings. * Accepting Output:: How to wait until process output arrives. @@ -1187,11 +1187,12 @@ Many applications of processes also use the buffer for editing input to be sent to the process, but this is not built into Emacs Lisp. - Unless the process has a filter function (@pxref{Filter Functions}), -its output is inserted in the associated buffer. The position to insert -the output is determined by the @code{process-mark}, which is then -updated to point to the end of the text just inserted. Usually, but not -always, the @code{process-mark} is at the end of the buffer. + By default, process output is inserted in the associated buffer. +(You can change this by defining a custom filter function, +@pxref{Filter Functions}). The position to insert the output is +determined by the @code{process-mark}, which is then updated to point +to the end of the text just inserted. Usually, but not always, the +@code{process-mark} is at the end of the buffer. @findex process-kill-buffer-query-function Killing the associated buffer of a process also kills the process. @@ -1268,10 +1269,9 @@ @cindex process filter A process @dfn{filter function} is a function that receives the -standard output from the associated process. If a process has a filter, -then @emph{all} output from that process is passed to the filter. The -process buffer is used directly for output from the process only when -there is no filter. +standard output from the associated process. @emph{all} output from +that process is passed to the filter. The default filter simply +outputs directly to the process buffer. The filter function can only be called when Emacs is waiting for something, because process output arrives only at such times. Emacs @@ -1300,8 +1300,8 @@ filter function. @xref{Debugger}. Many filter functions sometimes (or always) insert the output in the -process's buffer, mimicking the actions of Emacs when there is no -filter. Such filter functions need to make sure that they save the +process's buffer, mimicking the actions of the default filter. +Such filter functions need to make sure that they save the current buffer, select the correct buffer (if different) before inserting output, and then restore the original buffer. They should also check whether the buffer is still alive, update the @@ -1357,12 +1357,12 @@ @defun set-process-filter process filter This function gives @var{process} the filter function @var{filter}. If -@var{filter} is @code{nil}, it gives the process no filter. +@var{filter} is @code{nil}, it gives the process the default filter, +which inserts the process output into the process buffer. @end defun @defun process-filter process -This function returns the filter function of @var{process}, or @code{nil} -if it has none. +This function returns the filter function of @var{process}. @end defun Here is an example of the use of a filter function: @@ -1401,8 +1401,7 @@ @ignore @c The code in this example doesn't show the right way to do things. Here is another, more realistic example, which demonstrates how to use -the process mark to do insertion in the same fashion as is done when -there is no filter function: +the process mark to do insertion in the same fashion as the default filter: @smallexample @group @@ -1474,9 +1473,9 @@ @defun accept-process-output &optional process seconds millisec just-this-one This function allows Emacs to read pending output from processes. The -output is inserted in the associated buffers or given to their filter -functions. If @var{process} is non-@code{nil} then this function does -not return until some output has been received from @var{process}. +output is given to their filter functions. If @var{process} is +non-@code{nil} then this function does not return until some output +has been received from @var{process}. The arguments @var{seconds} and @var{millisec} let you specify timeout periods. The former specifies a period measured in seconds and the @@ -1591,9 +1590,9 @@ @defun set-process-sentinel process sentinel This function associates @var{sentinel} with @var{process}. If -@var{sentinel} is @code{nil}, then the process will have no sentinel. -The default behavior when there is no sentinel is to insert a message in -the process's buffer when the process status changes. +@var{sentinel} is @code{nil}, then the process will have the default +sentinel, which inserts a message in the process's buffer when the +process status changes. Changes in process sentinels take effect immediately---if the sentinel is slated to be run but has not been called yet, and you specify a new @@ -1616,8 +1615,7 @@ @end defun @defun process-sentinel process -This function returns the sentinel of @var{process}, or @code{nil} if it -has none. +This function returns the sentinel of @var{process}. @end defun @defun waiting-for-user-input-p @@ -1974,7 +1972,7 @@ The @var{buffer} argument is the buffer to associate with the connection. Output from the connection is inserted in the buffer, -unless you specify a filter function to handle the output. If +unless you specify your own filter function to handle the output. If @var{buffer} is @code{nil}, it means that the connection is not associated with any buffer. @@ -2082,7 +2080,7 @@ is unique for each connection in the Emacs session. @item -If the server's filter is non-@code{nil}, the connection process does +If the server has a non-default filter, the connection process does not get a separate process buffer; otherwise, Emacs creates a new buffer for the purpose. The buffer name is the server's buffer name or process name, concatenated with the client identification string. @@ -2284,7 +2282,8 @@ @xref{Query Before Exit}. @item :filter @var{filter} -Initialize the process filter to @var{filter}. +Initialize the process filter to @var{filter}. (Otherwise the default +filter is used.) @item :filter-multibyte @var{multibyte} If @var{multibyte} is non-@code{nil}, strings given to the process @@ -2292,7 +2291,8 @@ default value of @code{enable-multibyte-characters}. @item :sentinel @var{sentinel} -Initialize the process sentinel to @var{sentinel}. +Initialize the process sentinel to @var{sentinel}. (Otherwise the default +sentinel is used.) @item :log @var{log} Initialize the log function of a server process to @var{log}. The log @@ -2580,10 +2580,12 @@ @code{stop-process}. @item :filter @var{filter} -Install @var{filter} as the process filter. +Install @var{filter} as the process filter. (Otherwise the default +filter is used.) @item :sentinel @var{sentinel} -Install @var{sentinel} as the process sentinel. +Install @var{sentinel} as the process sentinel. (Otherwise the default +sentinel is used.) @item :plist @var{plist} Install @var{plist} as the initial plist of the process. === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-02-19 19:31:02 +0000 +++ doc/misc/ChangeLog 2014-02-21 08:04:15 +0000 @@ -1,3 +1,10 @@ +2014-02-21 Glenn Morris + + * flymake.texi (Starting the syntax check process): Grammar fix. + + * tramp.texi (External packages): Grammar fix. + Reword for default sentinel not being nil any more. + 2014-02-19 Michael Albinus * trampver.texi: Update release number. === modified file 'doc/misc/flymake.texi' --- doc/misc/flymake.texi 2014-01-13 15:22:47 +0000 +++ doc/misc/flymake.texi 2014-02-21 08:04:15 +0000 @@ -695,8 +695,8 @@ The command line (command name and the list of arguments) for launching a process is returned by the initialization function. Flymake then just calls @code{start-process} -to start an asynchronous process and configures process filter and -sentinel which is used for processing the output of the syntax check +to start an asynchronous process and configures a process filter and +sentinel, which are used for processing the output of the syntax check tool. @node Parsing the output === modified file 'doc/misc/tramp.texi' --- doc/misc/tramp.texi 2014-01-12 15:19:07 +0000 +++ doc/misc/tramp.texi 2014-02-21 08:04:15 +0000 @@ -3766,10 +3766,10 @@ it has seen so far. This is a performance degradation, because the lost file attributes -must be recomputed when needed again. In cases the caller of +must be recomputed when needed again. In cases where the caller of @code{process-file} knows that there are no file attribute changes, it -shall let-bind the variable @code{process-file-side-effects} to -@code{nil}. @value{tramp} wouldn't flush the file attributes cache then. +should let-bind the variable @code{process-file-side-effects} to +@code{nil}. Then @value{tramp} won't flush the file attributes cache. @lisp (let (process-file-side-effects) @@ -3779,8 +3779,8 @@ For asynchronous processes, @value{tramp} flushes the file attributes cache via a process sentinel. If the caller of @code{start-file-process} knows that there are no file attribute -changes, it shall set the process sentinel to @code{nil}. In case the -caller defines an own process sentinel, @value{tramp}'s process +changes, it should set the process sentinel to the default. In cases +where the caller defines its own process sentinel, @value{tramp}'s process sentinel is overwritten. The caller can still flush the file attributes cache in its process sentinel with this code: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-02-21 08:02:05 +0000 +++ src/ChangeLog 2014-02-21 08:04:15 +0000 @@ -1,3 +1,9 @@ +2014-02-21 Glenn Morris + + * process.c (Fprocess_buffer, Faccept_process_output) + (Finternal_default_process_filter, Finternal_default_process_sentinel): + Doc fixes. + 2014-02-21 Martin Rudalics * window.c (Fwindow_scroll_bar_width): New function. === modified file 'src/process.c' --- src/process.c 2014-01-30 17:22:30 +0000 +++ src/process.c 2014-02-21 08:04:15 +0000 @@ -1,7 +1,7 @@ /* Asynchronous subprocess control for GNU Emacs. -Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2014 Free Software -Foundation, Inc. +Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2014 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -1022,7 +1022,7 @@ DEFUN ("process-buffer", Fprocess_buffer, Sprocess_buffer, 1, 1, 0, doc: /* Return the buffer PROCESS is associated with. -Output from PROCESS is inserted in this buffer unless PROCESS has a filter. */) +The default process filter inserts output from PROCESS into this buffer. */) (register Lisp_Object process) { CHECK_PROCESS (process); @@ -1049,7 +1049,7 @@ The filter gets two arguments: the process and the string of output. The string argument is normally a multibyte string, except: -- if the process' input coding system is no-conversion or raw-text, +- if the process's input coding system is no-conversion or raw-text, it is a unibyte string (the non-converted input), or else - if `default-enable-multibyte-characters' is nil, it is a unibyte string (the result of converting the decoded input multibyte @@ -1061,7 +1061,7 @@ CHECK_PROCESS (process); p = XPROCESS (process); - /* Don't signal an error if the process' input file descriptor + /* Don't signal an error if the process's input file descriptor is closed. This could make debugging Lisp more difficult, for example when doing something like @@ -2758,7 +2758,7 @@ is the server process, CLIENT is the new process for the connection, and MESSAGE is a string. -:plist PLIST -- Install PLIST as the new process' initial plist. +:plist PLIST -- Install PLIST as the new process's initial plist. :server QLEN -- if QLEN is non-nil, create a server process for the specified FAMILY, SERVICE, and connection type (stream or datagram). @@ -2788,21 +2788,21 @@ for the connection with the following parameters: - The client's process name is constructed by concatenating the server -process' NAME and a client identification string. +process's NAME and a client identification string. - If the FILTER argument is non-nil, the client process will not get a separate process buffer; otherwise, the client's process buffer is a newly -created buffer named after the server process' BUFFER name or process +created buffer named after the server process's BUFFER name or process NAME concatenated with the client identification string. - The connection type and the process filter and sentinel parameters are -inherited from the server process' TYPE, FILTER and SENTINEL. -- The client process' contact info is set according to the client's +inherited from the server process's TYPE, FILTER and SENTINEL. +- The client process's contact info is set according to the client's addressing information (typically an IP address and a port number). -- The client process' plist is initialized from the server's plist. +- The client process's plist is initialized from the server's plist. Notice that the FILTER and SENTINEL args are never used directly by the server process. Also, the BUFFER argument is not used directly by the server process, but via the optional :log function, accepted (and -failed) connections may be logged in the server process' buffer. +failed) connections may be logged in the server process's buffer. The original argument list, modified with the actual connection information, is available via the `process-contact' function. @@ -3917,7 +3917,7 @@ DEFUN ("accept-process-output", Faccept_process_output, Saccept_process_output, 0, 4, 0, doc: /* Allow any pending output from subprocesses to be read by Emacs. -It is read into the process' buffers or given to their filter functions. +It is given to their filter functions. Non-nil arg PROCESS means do not return until some output has been received from PROCESS. @@ -5187,7 +5187,8 @@ DEFUN ("internal-default-process-filter", Finternal_default_process_filter, Sinternal_default_process_filter, 2, 2, 0, - doc: /* Function used as default process filter. */) + doc: /* Function used as default process filter. +This inserts the process's output into its buffer. */) (Lisp_Object proc, Lisp_Object text) { struct Lisp_Process *p; @@ -6411,7 +6412,8 @@ DEFUN ("internal-default-process-sentinel", Finternal_default_process_sentinel, Sinternal_default_process_sentinel, 2, 2, 0, - doc: /* Function used as default sentinel for processes. */) + doc: /* Function used as default sentinel for processes. +This inserts a status message into the process's buffer. */) (Lisp_Object proc, Lisp_Object msg) { Lisp_Object buffer, symbol; ------------------------------------------------------------ revno: 116504 committer: martin rudalics branch nick: trunk timestamp: Fri 2014-02-21 09:02:05 +0100 message: Fix handling of window-min-height/-width (Bug#16738). * window.el (window--dump-window, window--dump-frame): New functions. (window--min-size-1): Account for window dividers. When window-resize-pixelwise is nil, delay rounding till after the sum of the window components has been calculated. (window--min-delta-1, window--max-delta-1): When PIXELWISE is nil make sure at least one text line and two text columns remain fully visible. (window-resize): Signal an error when window-resize-apply fails. (window--resize-child-windows): Fix calculation of by how many pixels a window can still be shrunk via window-new-normal. (adjust-window-trailing-edge): Call window--resizable with correct TRAIL argument. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-21 07:56:52 +0000 +++ lisp/ChangeLog 2014-02-21 08:02:05 +0000 @@ -1,3 +1,20 @@ +2014-02-21 Martin Rudalics + + Fix handling of window-min-height/-width (Bug#16738). + * window.el (window--dump-window, window--dump-frame): New + functions. + (window--min-size-1): Account for window dividers. When + window-resize-pixelwise is nil, delay rounding till after the + sum of the window components has been calculated. + (window--min-delta-1, window--max-delta-1): When PIXELWISE is + nil make sure at least one text line and two text columns remain + fully visible. + (window-resize): Signal an error when window-resize-apply fails. + (window--resize-child-windows): Fix calculation of by how many + pixels a window can still be shrunk via window-new-normal. + (adjust-window-trailing-edge): Call window--resizable with + correct TRAIL argument. + 2014-02-21 Michael Albinus * net/tramp.el (tramp-check-cached-permissions): === modified file 'lisp/window.el' --- lisp/window.el 2014-02-19 09:54:35 +0000 +++ lisp/window.el 2014-02-21 08:02:05 +0000 @@ -1012,6 +1012,84 @@ (window--side-check frame) (window--atom-check frame)) +;; Dumping frame/window contents. +(defun window--dump-window (&optional window erase) + "Dump WINDOW to buffer *window-frame-dump*. +WINDOW must be a valid window and defaults to the selected one. +Optional argument ERASE non-nil means erase *window-frame-dump* +before writing to it." + (setq window (window-normalize-window window)) + (with-current-buffer (get-buffer-create "*window-frame-dump*") + (when erase (erase-buffer)) + (insert + (format "%s parent: %s\n" window (window-parent window)) + (format "pixel left: %s top: %s size: %s x %s new: %s\n" + (window-pixel-left window) (window-pixel-top window) + (window-size window t t) (window-size window nil t) + (window-new-pixel window)) + (format "char left: %s top: %s size: %s x %s new: %s\n" + (window-left-column window) (window-top-line window) + (window-total-size window t) (window-total-size window) + (window-new-total window)) + (format "normal: %s x %s new: %s\n" + (window-normal-size window t) (window-normal-size window) + (window-new-normal window))) + (when (window-live-p window) + (let ((fringes (window-fringes window)) + (margins (window-margins window))) + (insert + (format "body pixel: %s x %s char: %s x %s\n" + (window-body-width window t) (window-body-height window t) + (window-body-width window) (window-body-height window)) + (format "width left fringe: %s left margin: %s right margin: %s\n" + (car fringes) (or (car margins) 0) (or (cdr margins) 0)) + (format "width right fringe: %s scroll-bar: %s divider: %s\n" + (cadr fringes) + (window-scroll-bar-width window) + (window-right-divider-width window)) + (format "height header-line: %s mode-line: %s divider: %s\n" + (window-header-line-height window) + (window-mode-line-height window) + (window-bottom-divider-width window))))) + (insert "\n"))) + +(defun window--dump-frame (&optional window-or-frame) + "Dump WINDOW-OR-FRAME to buffer *window-frame-dump*. +WINDOW-OR-FRAME can be a frame or a window and defaults to the +selected frame. When WINDOW-OR-FRAME is a window, dump that +window's frame. The buffer *window-frame-dump* is erased before +dumping to it." + (interactive) + (let* ((window + (cond + ((or (not window-or-frame) + (frame-live-p window-or-frame)) + (frame-root-window window-or-frame)) + ((or (window-live-p window-or-frame) + (window-child window-or-frame)) + window-or-frame) + (t + (frame-root-window)))) + (frame (window-frame window))) + (with-current-buffer (get-buffer-create "*window-frame-dump*") + (erase-buffer) + (insert + (format "frame pixel: %s x %s cols/lines: %s x %s units: %s x %s\n" + (frame-pixel-width frame) (frame-pixel-height frame) + (frame-total-cols frame) (frame-text-lines frame) ; (frame-total-lines frame) + (frame-char-width frame) (frame-char-height frame)) + (format "frame text pixel: %s x %s cols/lines: %s x %s\n" + (frame-text-width frame) (frame-text-height frame) + (frame-text-cols frame) (frame-text-lines frame)) + (format "tool: %s scroll: %s fringe: %s border: %s right: %s bottom: %s\n\n" + (tool-bar-height frame t) + (frame-scroll-bar-width frame) + (frame-fringe-width frame) + (frame-border-width frame) + (frame-right-divider-width frame) + (frame-bottom-divider-width frame))) + (walk-window-tree 'window--dump-window frame t t)))) + ;;; Window sizes. (defun window-total-size (&optional window horizontal round) "Return the total height or width of WINDOW. @@ -1140,55 +1218,46 @@ ;; windows such that the new (or resized) windows can get a ;; size less than the user-specified `window-min-height' and ;; `window-min-width'. - (let ((frame (window-frame window)) - (fringes (window-fringes window)) - (scroll-bars (window-scroll-bars window))) + (let* ((char-size (frame-char-size window t)) + (fringes (window-fringes window)) + (pixel-width + (+ (window-safe-min-size window t t) + (car fringes) (cadr fringes) + (window-scroll-bar-width window) + (window-right-divider-width window)))) (if pixelwise (max - (+ (window-safe-min-size window t t) - (car fringes) (cadr fringes) - (cond - ((memq (nth 2 scroll-bars) '(left right)) - (nth 1 scroll-bars)) - ((memq (frame-parameter frame 'vertical-scroll-bars) - '(left right)) - (frame-parameter frame 'scroll-bar-width)) - (t 0))) + (if window-resize-pixelwise + pixel-width + ;; Round up to next integral of columns. + (* (ceiling pixel-width char-size) char-size)) (if (window--size-ignore-p window ignore) 0 (window-min-pixel-width))) (max - (+ window-safe-min-width - (ceiling (car fringes) (frame-char-width frame)) - (ceiling (cadr fringes) (frame-char-width frame)) - (cond - ((memq (nth 2 scroll-bars) '(left right)) - (nth 1 scroll-bars)) - ((memq (frame-parameter frame 'vertical-scroll-bars) - '(left right)) - (ceiling (or (frame-parameter frame 'scroll-bar-width) 14) - (frame-char-width))) - (t 0))) + (ceiling pixel-width char-size) (if (window--size-ignore-p window ignore) 0 window-min-width))))) - (pixelwise - (max - (+ (window-safe-min-size window nil t) - (window-header-line-height window) - (window-mode-line-height window)) - (if (window--size-ignore-p window ignore) - 0 - (window-min-pixel-height)))) - (t - ;; For the minimum height of a window take any mode- or - ;; header-line into account. - (max (+ window-safe-min-height - (if header-line-format 1 0) - (if mode-line-format 1 0)) - (if (window--size-ignore-p window ignore) - 0 - window-min-height)))))))) + ((let ((char-size (frame-char-size window)) + (pixel-height + (+ (window-safe-min-size window nil t) + (window-header-line-height window) + (window-mode-line-height window) + (window-bottom-divider-width window)))) + (if pixelwise + (max + (if window-resize-pixelwise + pixel-height + ;; Round up to next integral of lines. + (* (ceiling pixel-height char-size) char-size)) + (if (window--size-ignore-p window ignore) + 0 + (window-min-pixel-height))) + (max (ceiling pixel-height char-size) + (if (window--size-ignore-p window ignore) + 0 + window-min-height)))))))))) (defun window-sizable (window delta &optional horizontal ignore pixelwise) "Return DELTA if DELTA lines can be added to WINDOW. @@ -1323,9 +1392,10 @@ (unless (eq sub window) (setq delta (min delta - (- (window-size sub horizontal pixelwise 'floor) - (window-min-size - sub horizontal ignore pixelwise))))) + (max (- (window-size sub horizontal pixelwise 'ceiling) + (window-min-size + sub horizontal ignore pixelwise)) + 0)))) (setq sub (window-right sub)))) (if noup delta @@ -1400,9 +1470,11 @@ (t (setq delta (+ delta - (- (window-size sub horizontal pixelwise 'floor) - (window-min-size - sub horizontal ignore pixelwise)))))) + (max + (- (window-size sub horizontal pixelwise 'ceiling) + (window-min-size + sub horizontal ignore pixelwise)) + 0))))) (setq sub (window-right sub)))) ;; For an ortho-combination throw DELTA when at least one ;; child window is fixed-size. @@ -2317,9 +2389,11 @@ ;; Otherwise, resize all other windows in the same combination. (window--resize-siblings window delta horizontal ignore)) (when (window--resize-apply-p frame horizontal) - (window-resize-apply frame horizontal) - (window--pixel-to-total frame horizontal) - (run-window-configuration-change-hook frame))) + (if (window-resize-apply frame horizontal) + (progn + (window--pixel-to-total frame horizontal) + (run-window-configuration-change-hook frame)) + (error "Failed to apply resizing %s" window)))) (t (error "Cannot resize window %s" window))))) @@ -2560,7 +2634,7 @@ (setq best-value most-negative-fixnum) (while sub (when (and (consp (window-new-normal sub)) - (not (zerop (car (window-new-normal sub)))) + (not (<= (car (window-new-normal sub)) 0)) (> (cdr (window-new-normal sub)) best-value)) (setq best-window sub) (setq best-value (cdr (window-new-normal sub)))) @@ -2576,7 +2650,7 @@ best-window (if (= (car (window-new-normal best-window)) best-delta) 'skip ; We can't shrink best-window any further. - (cons (1- (car (window-new-normal best-window))) + (cons (- (car (window-new-normal best-window)) best-delta) (- (/ (float (window-new-pixel best-window)) parent-total) (window-normal-size best-window horizontal)))))))) @@ -2941,7 +3015,7 @@ (window--resize-reset frame horizontal) ;; Try to enlarge LEFT first. (setq this-delta (window--resizable - left delta horizontal nil nil nil nil pixelwise)) + left delta horizontal nil 'after nil nil pixelwise)) (unless (zerop this-delta) (window--resize-this-window left this-delta horizontal nil t 'before @@ -2970,7 +3044,7 @@ ;; Try to enlarge RIGHT. (setq this-delta (window--resizable - right (- delta) horizontal nil nil nil nil pixelwise)) + right (- delta) horizontal nil 'before nil nil pixelwise)) (unless (zerop this-delta) (window--resize-this-window right this-delta horizontal nil t 'after === modified file 'src/ChangeLog' --- src/ChangeLog 2014-02-21 07:42:42 +0000 +++ src/ChangeLog 2014-02-21 08:02:05 +0000 @@ -1,3 +1,7 @@ +2014-02-21 Martin Rudalics + + * window.c (Fwindow_scroll_bar_width): New function. + 2014-02-21 Paul Eggert Pacify GCC when configuring with --enable-gcc-warnings. === modified file 'src/window.c' --- src/window.c 2014-02-07 10:55:28 +0000 +++ src/window.c 2014-02-21 08:02:05 +0000 @@ -974,6 +974,15 @@ return (make_number (WINDOW_BOTTOM_DIVIDER_WIDTH (decode_live_window (window)))); } +DEFUN ("window-scroll-bar-width", Fwindow_scroll_bar_width, + Swindow_scroll_bar_width, 0, 1, 0, + doc: /* Return the width in pixels of WINDOW's vertical scrollbar. +WINDOW must be a live window and defaults to the selected one. */) + (Lisp_Object window) +{ + return (make_number (WINDOW_SCROLL_BAR_AREA_WIDTH (decode_live_window (window)))); +} + DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0, doc: /* Return the number of columns by which WINDOW is scrolled from left margin. WINDOW must be a live window and defaults to the selected one. */) @@ -7363,6 +7372,7 @@ defsubr (&Swindow_header_line_height); defsubr (&Swindow_right_divider_width); defsubr (&Swindow_bottom_divider_width); + defsubr (&Swindow_scroll_bar_width); defsubr (&Swindow_inside_edges); defsubr (&Swindow_inside_pixel_edges); defsubr (&Swindow_inside_absolute_pixel_edges); ------------------------------------------------------------ revno: 116503 committer: Glenn Morris branch nick: trunk timestamp: Thu 2014-02-20 23:56:52 -0800 message: ChangeLog fix It's "" to indicate a change related to foo. [foo] is for a change conditional on foo being defined. See info node `(standards)Indicating the Part Changed'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-21 07:53:19 +0000 +++ lisp/ChangeLog 2014-02-21 07:56:52 +0000 @@ -41,7 +41,7 @@ (tramp-handle-insert-directory): New defun, taken from tramp-gvfs.el. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) - [insert-directory]: Use `tramp-handle-insert-directory. + : Use `tramp-handle-insert-directory. (tramp-gvfs-handle-insert-directory): Remove function. * net/tramp-sh.el (tramp-sh-handle-insert-directory): @@ -73,10 +73,10 @@ cache is empty. * net/tramp-adb.el (tramp-adb-file-name-handler-alist) - [make-symbolic-link]: Use `tramp-handle-make-symbolic-link'. + : Use `tramp-handle-make-symbolic-link'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) - [make-symbolic-link]: Use `tramp-handle-make-symbolic-link'. + : Use `tramp-handle-make-symbolic-link'. (tramp-gvfs-maybe-open-connection): Set always connection properties, even if target is mounted already. @@ -4710,7 +4710,7 @@ * net/tramp-smb.el (tramp-smb-acl-program): New customer option. (tramp-smb-errors): Add error messages. (tramp-smb-actions-with-acl): New defconst. - (tramp-smb-file-name-handler-alist) [set-file-acl]: Add handler. + (tramp-smb-file-name-handler-alist) : Add handler. (tramp-smb-action-with-acl, tramp-smb-handle-set-file-acl): New defuns. (tramp-smb-handle-file-acl): Rewrite, using "smbcacls". (tramp-smb-handle-file-attributes): Simplify test for "stat" capability. @@ -7679,18 +7679,18 @@ * net/tramp-adb.el (tramp-adb-file-name-handler-alist): Order alphabetically. - [access-file, add-name-to-file, dired-call-process]: - [dired-compress-file, file-acl, file-notify-rm-watch]: - [file-ownership-preserved-p, file-selinux-context]: - [make-directory-internal, make-symbolic-link, set-file-acl]: - [set-file-selinux-context, set-visited-file-modtime]: - [verify-visited-file-modtime]: Add handler. + : + : + : + : + : + : Add handler. (tramp-adb-handle-write-region): Apply `set-visited-file-modtime'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) - [file-notify-add-watch, file-notify-rm-watch]: - [set-file-times, set-visited-file-modtime]: - [verify-visited-file-modtime]: Add handler. + : + : + : Add handler. (with-tramp-gvfs-error-message) (tramp-gvfs-handle-set-visited-file-modtime) (tramp-gvfs-fuse-file-name): Remove. @@ -7700,8 +7700,8 @@ * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Order alphabetically. - [file-notify-rm-watch ]: Use default Tramp handler. - [executable-find]: Remove private handler. + : Use default Tramp handler. + : Remove private handler. (tramp-do-copy-or-rename-file-out-of-band): Do not bind `default-directory'. (tramp-sh-handle-executable-find) @@ -7711,8 +7711,8 @@ Do not use `format' in `tramp-message'. * net/tramp-smb.el (tramp-smb-file-name-handler-alist) - [file-notify-rm-watch, set-visited-file-modtime]: - [verify-visited-file-modtime]: Add handler. + : + : Add handler. (tramp-smb-call-winexe): Do not bind `default-directory'. 2013-08-01 Xue Fuqiao @@ -8426,7 +8426,7 @@ * net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection): * net/tramp-sh.el (tramp-maybe-open-connection): Use `tramp-connection-timeout'. - (tramp-methods) [su, sudo, ksu]: Add method specific timeouts. + (tramp-methods) : Add method specific timeouts. (Bug#14808) 2013-07-11 Leo Liu ------------------------------------------------------------ revno: 116502 committer: Michael Albinus branch nick: trunk timestamp: Fri 2014-02-21 08:53:19 +0100 message: Add ChangeLog entry for previous commit. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-21 04:32:31 +0000 +++ lisp/ChangeLog 2014-02-21 07:53:19 +0000 @@ -1,3 +1,8 @@ +2014-02-21 Michael Albinus + + * net/tramp.el (tramp-check-cached-permissions): + Call `file-attributes' with `suffix' being a symbol but a string. + 2014-02-21 Daniel Colascione * net/dbus.el (dbus-init-bus-1): Declare new subr. ------------------------------------------------------------ revno: 116501 committer: Michael Albinus branch nick: trunk timestamp: Fri 2014-02-21 08:52:04 +0100 message: * net/tramp.el (tramp-check-cached-permissions): Call `file-attributes' with `suffix' being a symbol but a string. diff: === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2014-02-20 14:24:13 +0000 +++ lisp/net/tramp.el 2014-02-21 07:52:04 +0000 @@ -3868,7 +3868,7 @@ (tramp-file-name-user vec) (tramp-file-name-host vec) (tramp-file-name-localname vec)) - suffix))) + (intern suffix)))) (remote-uid (tramp-get-connection-property vec (concat "uid-" suffix) nil)) ------------------------------------------------------------ revno: 116500 committer: Paul Eggert branch nick: trunk timestamp: Thu 2014-02-20 23:42:42 -0800 message: Pacify GCC when configuring with --enable-gcc-warnings. * xdisp.c (move_it_in_display_line_to) [lint]: Initialize recently-added local. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-02-21 04:32:11 +0000 +++ src/ChangeLog 2014-02-21 07:42:42 +0000 @@ -1,3 +1,9 @@ +2014-02-21 Paul Eggert + + Pacify GCC when configuring with --enable-gcc-warnings. + * xdisp.c (move_it_in_display_line_to) [lint]: + Initialize recently-added local. + 2014-02-21 Daniel Colascione * dbusbind.c: Rename dbus-init-bus to dbus-init-bus-1. === modified file 'src/xdisp.c' --- src/xdisp.c 2014-02-20 17:40:56 +0000 +++ src/xdisp.c 2014-02-21 07:42:42 +0000 @@ -8313,7 +8313,7 @@ void *ppos_data = NULL; int may_wrap = 0; enum it_method prev_method = it->method; - ptrdiff_t closest_pos, prev_pos = IT_CHARPOS (*it); + ptrdiff_t closest_pos IF_LINT (= 0), prev_pos = IT_CHARPOS (*it); int saw_smaller_pos = prev_pos < to_charpos; /* Don't produce glyphs in produce_glyphs. */ ------------------------------------------------------------ revno: 116499 [merge] committer: Daniel Colascione branch nick: trunk timestamp: Thu 2014-02-20 20:32:31 -0800 message: Improve dbus error handling; detect bus failure diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-21 03:26:21 +0000 +++ lisp/ChangeLog 2014-02-21 04:32:31 +0000 @@ -1,3 +1,18 @@ +2014-02-21 Daniel Colascione + + * net/dbus.el (dbus-init-bus-1): Declare new subr. + (dbus-init-bus): New function: call into dbus-init-bus-1 + and installs a handler for the disconnect signal. + (dbus-call-method): Rewrite to look for result in cons. + (dbus-call-method-handler): Store result in cons. + (dbus-check-event): Recognize events with nil sender as valid. + (dbus-handle-bus-disconnect): New function. React to bus + disconnection signal by synthesizing dbus error for each + pending synchronous or asynchronous call. + (dbus-notice-synchronous-call-errors): New function. + (dbus-handle-event): Raise errors directly only when `dbus-debug' + is true, not all the time. + 2014-02-21 Juanma Barranquero * w32-fns.el (w32-enable-italics, w32-charset-to-codepage-alist): === modified file 'lisp/net/dbus.el' --- lisp/net/dbus.el 2014-02-17 16:30:09 +0000 +++ lisp/net/dbus.el 2014-02-21 04:32:11 +0000 @@ -35,7 +35,7 @@ ;; Declare used subroutines and variables. (declare-function dbus-message-internal "dbusbind.c") -(declare-function dbus-init-bus "dbusbind.c") +(declare-function dbus-init-bus-1 "dbusbind.c") (defvar dbus-message-type-invalid) (defvar dbus-message-type-method-call) (defvar dbus-message-type-method-return) @@ -154,7 +154,7 @@ (define-obsolete-variable-alias 'dbus-event-error-hooks 'dbus-event-error-functions "24.3") -(defvar dbus-event-error-functions nil +(defvar dbus-event-error-functions '(dbus-notice-synchronous-call-errors) "Functions to be called when a D-Bus error happens in the event handler. Every function must accept two arguments, the event and the error variable caught in `condition-case' by `dbus-error'.") @@ -173,11 +173,23 @@ "Handler for reply messages of asynchronous D-Bus message calls. It calls the function stored in `dbus-registered-objects-table'. The result will be made available in `dbus-return-values-table'." - (puthash (list :serial - (dbus-event-bus-name last-input-event) - (dbus-event-serial-number last-input-event)) - (if (= (length args) 1) (car args) args) - dbus-return-values-table)) + (let* ((key (list :serial + (dbus-event-bus-name last-input-event) + (dbus-event-serial-number last-input-event))) + (result (gethash key dbus-return-values-table))) + (when (consp result) + (setcar result :complete) + (setcdr result (if (= (length args) 1) (car args) args))))) + +(defun dbus-notice-synchronous-call-errors (ev er) + "Detect errors resulting from pending synchronous calls." + (let* ((key (list :serial + (dbus-event-bus-name ev) + (dbus-event-serial-number ev))) + (result (gethash key dbus-return-values-table))) + (when (consp result) + (setcar result :error) + (setcdr result er)))) (defun dbus-call-method (bus service path interface method &rest args) "Call METHOD on the D-Bus BUS. @@ -264,7 +276,8 @@ (key (apply 'dbus-message-internal dbus-message-type-method-call - bus service path interface method 'dbus-call-method-handler args))) + bus service path interface method 'dbus-call-method-handler args)) + (result (cons :pending nil))) ;; Wait until `dbus-call-method-handler' has put the result into ;; `dbus-return-values-table'. If no timeout is given, use the @@ -278,20 +291,23 @@ ;; restructuring dbus as a kind of process object. Poll at most ;; about once per second for completion. - (with-timeout ((if timeout (/ timeout 1000.0) 25)) - (while (eq (gethash key dbus-return-values-table :ignore) :ignore) - (let ((event (let ((inhibit-redisplay t) unread-command-events) - (read-event nil nil check-interval)))) - (when event - (setf unread-command-events - (nconc unread-command-events - (cons event nil)))) - (when (< check-interval 1) - (setf check-interval (* check-interval 1.05)))))) - - ;; Cleanup `dbus-return-values-table'. Return the result. - (prog1 - (gethash key dbus-return-values-table) + (puthash key result dbus-return-values-table) + (unwind-protect + (progn + (with-timeout ((if timeout (/ timeout 1000.0) 25) + (signal 'dbus-error (list "call timed out"))) + (while (eq (car result) :pending) + (let ((event (let ((inhibit-redisplay t) unread-command-events) + (read-event nil nil check-interval)))) + (when event + (setf unread-command-events + (nconc unread-command-events + (cons event nil)))) + (when (< check-interval 1) + (setf check-interval (* check-interval 1.05)))))) + (when (eq (car result) :error) + (signal (cadr result) (cddr result))) + (cdr result)) (remhash key dbus-return-values-table)))) ;; `dbus-call-method' works non-blocking now. @@ -922,7 +938,8 @@ ;; Service. (or (= dbus-message-type-method-return (nth 2 event)) (= dbus-message-type-error (nth 2 event)) - (stringp (nth 4 event))) + (or (stringp (nth 4 event)) + (null (nth 4 event)))) ;; Object path. (or (= dbus-message-type-method-return (nth 2 event)) (= dbus-message-type-error (nth 2 event)) @@ -973,7 +990,7 @@ (nth 1 event) (nth 4 event) (nth 3 event) (cadr err)))) ;; Propagate D-Bus error messages. (run-hook-with-args 'dbus-event-error-functions event err) - (when (or dbus-debug (= dbus-message-type-error (nth 2 event))) + (when dbus-debug (signal (car err) (cdr err)))))) (defun dbus-event-bus-name (event) @@ -1679,6 +1696,64 @@ result) '(:signature "{oa{sa{sv}}}")))))) +(defun dbus-handle-bus-disconnect () + "React to a bus disconnection. +BUS is the bus that disconnected. This routine unregisters all +handlers on the given bus and causes all synchronous calls +pending at the time of disconnect to fail." + (let ((bus (dbus-event-bus-name last-input-event)) + (keys-to-remove)) + (maphash + (lambda (key value) + (when (and (eq (nth 0 key) :serial) + (eq (nth 1 key) bus)) + (run-hook-with-args + 'dbus-event-error-functions + (list 'dbus-event + bus + dbus-message-type-error + (nth 2 key) + nil + nil + nil + nil + value) + '(dbus-error "Bus disconnected")) + (push key keys-to-remove))) + dbus-registered-objects-table) + (dolist (key keys-to-remove) + (remhash key dbus-registered-objects-table)))) + +(defun dbus-init-bus (bus &optional private) + "Establish the connection to D-Bus BUS. + +BUS can be either the symbol `:system' or the symbol `:session', or it +can be a string denoting the address of the corresponding bus. For +the system and session buses, this function is called when loading +`dbus.el', there is no need to call it again. + +The function returns a number, which counts the connections this Emacs +session has established to the BUS under the same unique name (see +`dbus-get-unique-name'). It depends on the libraries Emacs is linked +with, and on the environment Emacs is running. For example, if Emacs +is linked with the gtk toolkit, and it runs in a GTK-aware environment +like Gnome, another connection might already be established. + +When PRIVATE is non-nil, a new connection is established instead of +reusing an existing one. It results in a new unique name at the bus. +This can be used, if it is necessary to distinguish from another +connection used in the same Emacs process, like the one established by +GTK+. It should be used with care for at least the `:system' and +`:session' buses, because other Emacs Lisp packages might already use +this connection to those buses. +" + (dbus-init-bus-1 bus private) + (dbus-register-signal bus nil + "/org/freedesktop/DBus/Local" + "org.freedesktop.DBus.Local" + "Disconnected" + #'dbus-handle-bus-disconnect)) + ;; Initialize `:system' and `:session' buses. This adds their file ;; descriptors to input_wait_mask, in order to detect incoming === modified file 'src/ChangeLog' --- src/ChangeLog 2014-02-20 17:40:56 +0000 +++ src/ChangeLog 2014-02-21 04:32:11 +0000 @@ -1,3 +1,7 @@ +2014-02-21 Daniel Colascione + + * dbusbind.c: Rename dbus-init-bus to dbus-init-bus-1. + 2014-02-20 Eli Zaretskii * xdisp.c (init_iterator): Don't dereference a bogus face === modified file 'src/dbusbind.c' --- src/dbusbind.c 2014-02-18 07:46:38 +0000 +++ src/dbusbind.c 2014-02-21 04:32:11 +0000 @@ -42,7 +42,7 @@ /* Subroutines. */ -static Lisp_Object Qdbus_init_bus; +static Lisp_Object Qdbus_init_bus_1; static Lisp_Object Qdbus_get_unique_name; static Lisp_Object Qdbus_message_internal; @@ -1121,9 +1121,12 @@ return; } -DEFUN ("dbus-init-bus", Fdbus_init_bus, Sdbus_init_bus, 1, 2, 0, +DEFUN ("dbus-init-bus-1", Fdbus_init_bus_1, Sdbus_init_bus_1, 1, 2, 0, doc: /* Establish the connection to D-Bus BUS. +This function is dbus-internal. You almost certainly want to use +dbus-init-bus. + BUS can be either the symbol `:system' or the symbol `:session', or it can be a string denoting the address of the corresponding bus. For the system and session buses, this function is called when loading @@ -1742,8 +1745,8 @@ syms_of_dbusbind (void) { - DEFSYM (Qdbus_init_bus, "dbus-init-bus"); - defsubr (&Sdbus_init_bus); + DEFSYM (Qdbus_init_bus_1, "dbus-init-bus-1"); + defsubr (&Sdbus_init_bus_1); DEFSYM (Qdbus_get_unique_name, "dbus-get-unique-name"); defsubr (&Sdbus_get_unique_name); ------------------------------------------------------------ revno: 116498 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2014-02-21 04:26:21 +0100 message: lisp/w32-fns.el: Remove obsolescence declarations for nonexistent vars. (w32-enable-italics, w32-charset-to-codepage-alist): These variables do not exist anymore. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-21 00:47:17 +0000 +++ lisp/ChangeLog 2014-02-21 03:26:21 +0000 @@ -1,5 +1,8 @@ 2014-02-21 Juanma Barranquero + * w32-fns.el (w32-enable-italics, w32-charset-to-codepage-alist): + Remove obsolescence declarations, these variables do not exist anymore. + * savehist.el (savehist-save-minibuffer-history) (savehist-additional-variables, savehist-file, savehist-mode-hook) (savehist-save-hook, savehist-coding-system, savehist-loaded) === modified file 'lisp/w32-fns.el' --- lisp/w32-fns.el 2014-01-01 07:43:34 +0000 +++ lisp/w32-fns.el 2014-02-21 03:26:21 +0000 @@ -307,11 +307,6 @@ (w32-add-charset-info "tis620-0" 'w32-charset-thai 874) (w32-add-charset-info "iso8859-1" 'w32-charset-ansi 1252) -(make-obsolete-variable 'w32-enable-italics - 'w32-enable-synthesized-fonts "21.1") -(make-obsolete-variable 'w32-charset-to-codepage-alist - 'w32-charset-info-alist "21.1") - ;;;; Support for build process ------------------------------------------------------------ revno: 116497 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2014-02-21 01:47:17 +0100 message: lisp/savehist.el: Fix typos in docstrings. (savehist-save-minibuffer-history, savehist-additional-variables) (savehist-file, savehist-mode-hook, savehist-save-hook, savehist-coding-system) (savehist-loaded, savehist-load, savehist-install, savehist-autosave): Fix typos; mostly, refer to "Savehist mode" when talking about the mode, and not the function. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-21 00:35:08 +0000 +++ lisp/ChangeLog 2014-02-21 00:47:17 +0000 @@ -1,5 +1,12 @@ 2014-02-21 Juanma Barranquero + * savehist.el (savehist-save-minibuffer-history) + (savehist-additional-variables, savehist-file, savehist-mode-hook) + (savehist-save-hook, savehist-coding-system, savehist-loaded) + (savehist-load, savehist-install, savehist-autosave): Fix typos; + mostly, refer to "Savehist mode" when talking about the mode, + and not the function. + * saveplace.el (save-place): Remove redundant info in docstring. (save-place-forget-unreadable-files, toggle-save-place) (save-place-forget-unreadable-files, save-place-dired-hook): === modified file 'lisp/savehist.el' --- lisp/savehist.el 2014-02-10 01:34:22 +0000 +++ lisp/savehist.el 2014-02-21 00:47:17 +0000 @@ -60,21 +60,21 @@ (defcustom savehist-save-minibuffer-history t "If non-nil, save all recorded minibuffer histories. -If you want to save only specific histories, use `savehist-save-hook' to -modify the value of `savehist-minibuffer-history-variables'." +If you want to save only specific histories, use `savehist-save-hook' +to modify the value of `savehist-minibuffer-history-variables'." :type 'boolean :group 'savehist) (defcustom savehist-additional-variables () "List of additional variables to save. Each element is a symbol whose value will be persisted across Emacs -sessions that use savehist. The contents of variables should be +sessions that use Savehist. The contents of variables should be printable with the Lisp printer. You don't need to add minibuffer history variables to this list, all minibuffer histories will be saved automatically as long as `savehist-save-minibuffer-history' is non-nil. -User options should be saved with the customize interface. This +User options should be saved with the Customize interface. This list is useful for saving automatically updated variables that are not minibuffer histories, such as `compile-command' or `kill-ring'." :type '(repeat variable) @@ -89,7 +89,7 @@ (locate-user-emacs-file "history" ".emacs-history") "File name where minibuffer history is saved to and loaded from. The minibuffer history is a series of Lisp expressions loaded -automatically when `savehist-mode' is turned on. See `savehist-mode' +automatically when Savehist mode is turned on. See `savehist-mode' for more details. If you want your minibuffer history shared between Emacs and XEmacs, @@ -115,14 +115,14 @@ :group 'savehist) (defcustom savehist-mode-hook nil - "Hook called when `savehist-mode' is turned on." + "Hook called when Savehist mode is turned on." :type 'hook :group 'savehist) (defcustom savehist-save-hook nil "Hook called by `savehist-save' before saving the variables. -You can use this hook to influence choice and content of variables to -save." +You can use this hook to influence choice and content of variables +to save." :type 'hook :group 'savehist) @@ -134,7 +134,7 @@ (<= emacs-major-version 21) (< emacs-minor-version 5)) 'iso-2022-8 'utf-8-unix) - "The coding system savehist uses for saving the minibuffer history. + "The coding system Savehist uses for saving the minibuffer history. Changing this value while Emacs is running is supported, but considered unwise, unless you know what you are doing.") @@ -158,7 +158,7 @@ (defvar savehist-loaded nil "Whether the history has already been loaded. -This prevents toggling `savehist-mode' from destroying existing +This prevents toggling Savehist mode from destroying existing minibuffer history.") (when (featurep 'xemacs) @@ -205,7 +205,7 @@ (savehist-install))) (defun savehist-load () - "Load the variables stored in `savehist-file' and turn on `savehist-mode'. + "Load the variables stored in `savehist-file' and turn on Savehist mode. If `savehist-file' is in the old format that doesn't record the value of `savehist-minibuffer-history-variables', that value is deducted from the contents of the file." @@ -228,7 +228,7 @@ vars))))) (defun savehist-install () - "Hook savehist into Emacs. + "Hook Savehist into Emacs. Normally invoked by calling `savehist-mode' to set the minor mode. Installs `savehist-autosave' in `kill-emacs-hook' and on a timer. To undo this, call `savehist-uninstall'." @@ -356,7 +356,7 @@ (defun savehist-autosave () "Save the minibuffer history if it has been modified since the last save. -Does nothing if `savehist-mode' is off." +Does nothing if Savehist mode is off." (when savehist-mode (savehist-save t))) ------------------------------------------------------------ revno: 116496 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2014-02-21 01:35:08 +0100 message: lisp/saveplace.el (save-place): Remove redundant info in docstring. (save-place-forget-unreadable-files, toggle-save-place) (save-place-forget-unreadable-files, save-place-dired-hook): Fix typos and remove unneeded backslashes. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-20 14:24:13 +0000 +++ lisp/ChangeLog 2014-02-21 00:35:08 +0000 @@ -1,3 +1,10 @@ +2014-02-21 Juanma Barranquero + + * saveplace.el (save-place): Remove redundant info in docstring. + (save-place-forget-unreadable-files, toggle-save-place) + (save-place-forget-unreadable-files, save-place-dired-hook): + Fix typos and remove unneeded backslashes. + 2014-02-20 Michael Albinus * net/tramp.el (ls-lisp-use-insert-directory-program): Declare. === modified file 'lisp/saveplace.el' --- lisp/saveplace.el 2014-02-10 01:34:22 +0000 +++ lisp/saveplace.el 2014-02-21 00:35:08 +0000 @@ -54,7 +54,6 @@ "Non-nil means automatically save place in each file. This means when you visit a file, point goes to the last place where it was when you previously visited the same file. -This variable is automatically buffer-local. If you wish your place in any file to always be automatically saved, set this to t using the Customize facility, or put the @@ -101,7 +100,7 @@ The filenames in `save-place-alist' that do not match `save-place-skip-check-regexp' are filtered through -`file-readable-p'. if nil, their alist entries are removed. +`file-readable-p'. If nil, their alist entries are removed. You may do this anytime by calling the complementary function, `save-place-forget-unreadable-files'. When this option is turned on, @@ -151,7 +150,7 @@ To save places automatically in all files, put this in your init file: -\(setq-default save-place t\)" +\(setq-default save-place t)" (interactive "P") (if (not (or buffer-file-name (and (derived-mode-p 'dired-mode) dired-directory))) @@ -206,8 +205,8 @@ (defun save-place-forget-unreadable-files () "Remove unreadable files from `save-place-alist'. For each entry in the alist, if `file-readable-p' returns nil for the -filename, remove the entry. Save the new alist \(as the first pair -may have changed\) back to `save-place-alist'." +filename, remove the entry. Save the new alist (as the first pair +may have changed) back to `save-place-alist'." (interactive) ;; the following was adapted from an in-place filtering function, ;; `filter-mod', used in the original. @@ -324,7 +323,7 @@ (declare-function dired-goto-file "dired" (file)) (defun save-place-dired-hook () - "Position the point in a dired buffer." + "Position the point in a Dired buffer." (or save-place-loaded (load-save-place-alist-from-file)) (let ((cell (assoc (and (derived-mode-p 'dired-mode) dired-directory ------------------------------------------------------------ revno: 116495 committer: Michael Albinus branch nick: trunk timestamp: Thu 2014-02-20 19:26:40 +0100 message: * tramp-tests.el (tramp-test19-directory-files-and-attributes): Instrument failed test case. diff: === modified file 'test/automated/tramp-tests.el' --- test/automated/tramp-tests.el 2014-02-20 14:08:00 +0000 +++ test/automated/tramp-tests.el 2014-02-20 18:26:40 +0000 @@ -893,6 +893,7 @@ (tramp-dissect-file-name tramp-test-temporary-file-directory) nil 'keep-password) + (tramp--instrument-test-case 10 (let ((tmp-name (tramp--test-make-temp-name)) attr) (unwind-protect @@ -905,18 +906,16 @@ (setq attr (directory-files-and-attributes tmp-name)) (should (consp attr)) (dolist (elt attr) - (tramp--instrument-test-case 10 - (should - (equal (file-attributes (expand-file-name (car elt) tmp-name)) - (cdr elt))))) + (should + (equal (file-attributes (expand-file-name (car elt) tmp-name)) + (cdr elt)))) (setq attr (directory-files-and-attributes tmp-name 'full)) (dolist (elt attr) - (tramp--instrument-test-case 10 - (should - (equal (file-attributes (car elt)) (cdr elt))))) + (should + (equal (file-attributes (car elt)) (cdr elt)))) (setq attr (directory-files-and-attributes tmp-name nil "^b")) (should (equal (mapcar 'car attr) '("bar" "boz")))) - (ignore-errors (delete-directory tmp-name 'recursive))))) + (ignore-errors (delete-directory tmp-name 'recursive)))))) (ert-deftest tramp-test20-file-modes () "Check `file-modes'. ------------------------------------------------------------ revno: 116494 fixes bug: http://debbugs.gnu.org/15555 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2014-02-20 19:40:56 +0200 message: Fix excessive calls to bidi_shelve_cache reported in bug #15555. src/xdisp.c (move_it_in_display_line_to): Save the iterator state in ppos_it only once per call. Reimplement the method used to return to the best candidate position if all the positions found in display line are beyond TO_CHARPOS. This cuts down the number of calls to bidi_shelve_cache, which moves a lot of stuff when lines are long and include bidirectional text. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-02-20 17:17:54 +0000 +++ src/ChangeLog 2014-02-20 17:40:56 +0000 @@ -5,6 +5,12 @@ (try_cursor_movement): Don't use cursor position if set_cursor_from_row failed to compute it. This avoids assertion violations in MATRIX_ROW. + (move_it_in_display_line_to): Save the iterator state in ppos_it + only once per call. Reimplement the method used to return to the + best candidate position if all the positions found in display line + are beyond TO_CHARPOS. This cuts down the number of calls to + bidi_shelve_cache, which moves a lot of stuff when lines are long + and include bidirectional text. (Bug#15555) 2014-02-20 Glenn Morris === modified file 'src/xdisp.c' --- src/xdisp.c 2014-02-20 17:17:54 +0000 +++ src/xdisp.c 2014-02-20 17:40:56 +0000 @@ -8313,7 +8313,7 @@ void *ppos_data = NULL; int may_wrap = 0; enum it_method prev_method = it->method; - ptrdiff_t prev_pos = IT_CHARPOS (*it); + ptrdiff_t closest_pos, prev_pos = IT_CHARPOS (*it); int saw_smaller_pos = prev_pos < to_charpos; /* Don't produce glyphs in produce_glyphs. */ @@ -8330,16 +8330,21 @@ atx_it.sp = -1; /* Use ppos_it under bidi reordering to save a copy of IT for the - position > CHARPOS that is the closest to CHARPOS. We restore - that position in IT when we have scanned the entire display line - without finding a match for CHARPOS and all the character - positions are greater than CHARPOS. */ + initial position. We restore that position in IT when we have + scanned the entire display line without finding a match for + TO_CHARPOS and all the character positions are greater than + TO_CHARPOS. We then restart the scan from the initial position, + and stop at CLOSEST_POS, which is a position > TO_CHARPOS that is + the closest to TO_CHARPOS. */ if (it->bidi_p) { - SAVE_IT (ppos_it, *it, ppos_data); - SET_TEXT_POS (ppos_it.current.pos, ZV, ZV_BYTE); if ((op & MOVE_TO_POS) && IT_CHARPOS (*it) >= to_charpos) - SAVE_IT (ppos_it, *it, ppos_data); + { + SAVE_IT (ppos_it, *it, ppos_data); + closest_pos = IT_CHARPOS (*it); + } + else + closest_pos = ZV; } #define BUFFER_POS_REACHED_P() \ @@ -8483,8 +8488,8 @@ if (it->bidi_p && (op & MOVE_TO_POS) && IT_CHARPOS (*it) > to_charpos - && IT_CHARPOS (*it) < IT_CHARPOS (ppos_it)) - SAVE_IT (ppos_it, *it, ppos_data); + && IT_CHARPOS (*it) < closest_pos) + closest_pos = IT_CHARPOS (*it); continue; } @@ -8706,9 +8711,11 @@ { if (!saw_smaller_pos && IT_CHARPOS (*it) > to_charpos) { - if (IT_CHARPOS (ppos_it) < ZV) + if (closest_pos < ZV) { RESTORE_IT (it, &ppos_it, ppos_data); + move_it_in_display_line_to (it, closest_pos, -1, + MOVE_TO_POS); result = MOVE_POS_MATCH_OR_ZV; } else @@ -8738,8 +8745,8 @@ if (it->bidi_p && (op & MOVE_TO_POS) && IT_CHARPOS (*it) >= to_charpos - && IT_CHARPOS (*it) < IT_CHARPOS (ppos_it)) - SAVE_IT (ppos_it, *it, ppos_data); + && IT_CHARPOS (*it) < closest_pos) + closest_pos = IT_CHARPOS (*it); /* Stop if lines are truncated and IT's current x-position is past the right edge of the window now. */ @@ -8765,8 +8772,13 @@ && IT_CHARPOS (*it) > to_charpos)) { if (it->bidi_p - && !at_eob_p && IT_CHARPOS (ppos_it) < ZV) - RESTORE_IT (it, &ppos_it, ppos_data); + && !BUFFER_POS_REACHED_P () + && !at_eob_p && closest_pos < ZV) + { + RESTORE_IT (it, &ppos_it, ppos_data); + move_it_in_display_line_to (it, closest_pos, -1, + MOVE_TO_POS); + } result = MOVE_POS_MATCH_OR_ZV; break; } @@ -8780,8 +8792,11 @@ && !saw_smaller_pos && IT_CHARPOS (*it) > to_charpos) { - if (IT_CHARPOS (ppos_it) < ZV) - RESTORE_IT (it, &ppos_it, ppos_data); + if (closest_pos < ZV) + { + RESTORE_IT (it, &ppos_it, ppos_data); + move_it_in_display_line_to (it, closest_pos, -1, MOVE_TO_POS); + } result = MOVE_POS_MATCH_OR_ZV; break; } ------------------------------------------------------------ revno: 116493 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2014-02-20 19:17:54 +0200 message: Fix assertion violation in redisplay. src/xdisp.c (try_cursor_movement): Don't use cursor position if set_cursor_from_row failed to compute it. This avoids assertion violations in MATRIX_ROW. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-02-20 17:13:55 +0000 +++ src/ChangeLog 2014-02-20 17:17:54 +0000 @@ -2,6 +2,9 @@ * xdisp.c (init_iterator): Don't dereference a bogus face pointer. (Bug#16819) + (try_cursor_movement): Don't use cursor position if + set_cursor_from_row failed to compute it. This avoids assertion + violations in MATRIX_ROW. 2014-02-20 Glenn Morris === modified file 'src/xdisp.c' --- src/xdisp.c 2014-02-20 17:13:55 +0000 +++ src/xdisp.c 2014-02-20 17:17:54 +0000 @@ -15470,29 +15470,32 @@ /* As soon as we've found the exact match for point, or the first suitable row whose ends_at_zv_p flag is set, we are done. */ - at_zv_p = - MATRIX_ROW (w->current_matrix, w->cursor.vpos)->ends_at_zv_p; - if (rv && !at_zv_p - && w->cursor.hpos >= 0 - && w->cursor.hpos < MATRIX_ROW_USED (w->current_matrix, - w->cursor.vpos)) + if (rv) { - struct glyph_row *candidate = - MATRIX_ROW (w->current_matrix, w->cursor.vpos); - struct glyph *g = - candidate->glyphs[TEXT_AREA] + w->cursor.hpos; - ptrdiff_t endpos = MATRIX_ROW_END_CHARPOS (candidate); + at_zv_p = MATRIX_ROW (w->current_matrix, + w->cursor.vpos)->ends_at_zv_p; + if (!at_zv_p + && w->cursor.hpos >= 0 + && w->cursor.hpos < MATRIX_ROW_USED (w->current_matrix, + w->cursor.vpos)) + { + struct glyph_row *candidate = + MATRIX_ROW (w->current_matrix, w->cursor.vpos); + struct glyph *g = + candidate->glyphs[TEXT_AREA] + w->cursor.hpos; + ptrdiff_t endpos = MATRIX_ROW_END_CHARPOS (candidate); - exact_match_p = - (BUFFERP (g->object) && g->charpos == PT) - || (INTEGERP (g->object) - && (g->charpos == PT - || (g->charpos == 0 && endpos - 1 == PT))); - } - if (rv && (at_zv_p || exact_match_p)) - { - rc = CURSOR_MOVEMENT_SUCCESS; - break; + exact_match_p = + (BUFFERP (g->object) && g->charpos == PT) + || (INTEGERP (g->object) + && (g->charpos == PT + || (g->charpos == 0 && endpos - 1 == PT))); + } + if (at_zv_p || exact_match_p) + { + rc = CURSOR_MOVEMENT_SUCCESS; + break; + } } if (MATRIX_ROW_BOTTOM_Y (row) == last_y) break; ------------------------------------------------------------ revno: 116492 fixes bug: http://debbugs.gnu.org/16819 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2014-02-20 19:13:55 +0200 message: Fix bug #16819 with dereferencing invalid face pointer. src/xdisp.c (init_iterator): Don't dereference a bogus face pointer. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-02-20 07:38:47 +0000 +++ src/ChangeLog 2014-02-20 17:13:55 +0000 @@ -1,3 +1,8 @@ +2014-02-20 Eli Zaretskii + + * xdisp.c (init_iterator): Don't dereference a bogus face + pointer. (Bug#16819) + 2014-02-20 Glenn Morris * data.c (Fdefalias): Doc fix. === modified file 'src/xdisp.c' --- src/xdisp.c 2014-02-19 17:32:29 +0000 +++ src/xdisp.c 2014-02-20 17:13:55 +0000 @@ -2928,7 +2928,7 @@ /* If we have a boxed mode line, make the first character appear with a left box line. */ face = FACE_FROM_ID (it->f, remapped_base_face_id); - if (face->box != FACE_NO_BOX) + if (face && face->box != FACE_NO_BOX) it->start_of_box_run_p = true; } ------------------------------------------------------------ revno: 116491 committer: Michael Albinus branch nick: trunk timestamp: Thu 2014-02-20 15:24:13 +0100 message: * net/tramp.el (ls-lisp-use-insert-directory-program): Declare. (tramp-handle-insert-directory): New defun, taken from tramp-gvfs.el. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [insert-directory]: Use `tramp-handle-insert-directory. (tramp-gvfs-handle-insert-directory): Remove function. * net/tramp-sh.el (tramp-sh-handle-insert-directory): Call `tramp-handle-insert-directory'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-20 10:33:32 +0000 +++ lisp/ChangeLog 2014-02-20 14:24:13 +0000 @@ -1,3 +1,15 @@ +2014-02-20 Michael Albinus + + * net/tramp.el (ls-lisp-use-insert-directory-program): Declare. + (tramp-handle-insert-directory): New defun, taken from tramp-gvfs.el. + + * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) + [insert-directory]: Use `tramp-handle-insert-directory. + (tramp-gvfs-handle-insert-directory): Remove function. + + * net/tramp-sh.el (tramp-sh-handle-insert-directory): + Call `tramp-handle-insert-directory'. + 2014-02-20 Juanma Barranquero * elec-pair.el (electric-pair-syntax-info): Do not check syntax === modified file 'lisp/net/tramp-gvfs.el' --- lisp/net/tramp-gvfs.el 2014-02-19 19:24:32 +0000 +++ lisp/net/tramp-gvfs.el 2014-02-20 14:24:13 +0000 @@ -108,7 +108,6 @@ (eval-when-compile (require 'cl) (require 'custom)) -(defvar ls-lisp-use-insert-directory-program) ;;;###tramp-autoload (defcustom tramp-gvfs-methods '("dav" "davs" "obex" "synce") @@ -451,7 +450,7 @@ (find-backup-file-name . tramp-handle-find-backup-file-name) ;; `find-file-noselect' performed by default handler. ;; `get-file-buffer' performed by default handler. - (insert-directory . tramp-gvfs-handle-insert-directory) + (insert-directory . tramp-handle-insert-directory) (insert-file-contents . tramp-handle-insert-file-contents) (load . tramp-handle-load) (make-auto-save-file-name . tramp-handle-make-auto-save-file-name) @@ -1006,19 +1005,6 @@ (and (file-directory-p (file-name-directory filename)) (file-writable-p (file-name-directory filename))))))) -(defun tramp-gvfs-handle-insert-directory - (filename switches &optional wildcard full-directory-p) - "Like `insert-directory' for Tramp files." - ;; gvfs-* output is hard to parse. So we let `ls-lisp' do the job. - (unless switches (setq switches "")) - (with-parsed-tramp-file-name (expand-file-name filename) nil - (with-tramp-progress-reporter v 0 (format "Opening directory %s" filename) - (require 'ls-lisp) - (let (ls-lisp-use-insert-directory-program) - (tramp-run-real-handler - 'insert-directory - (list filename switches wildcard full-directory-p)))))) - (defun tramp-gvfs-handle-make-directory (dir &optional parents) "Like `make-directory' for Tramp files." (with-parsed-tramp-file-name dir nil === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2014-02-19 19:24:32 +0000 +++ lisp/net/tramp-sh.el 2014-02-20 14:24:13 +0000 @@ -2516,8 +2516,8 @@ (with-parsed-tramp-file-name filename nil (if (and (featurep 'ls-lisp) (not (symbol-value 'ls-lisp-use-insert-directory-program))) - (tramp-run-real-handler - 'insert-directory (list filename switches wildcard full-directory-p)) + (tramp-handle-insert-directory + filename switches wildcard full-directory-p) (when (stringp switches) (setq switches (split-string switches))) (when (and (member "--dired" switches) === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2014-02-19 19:24:32 +0000 +++ lisp/net/tramp.el 2014-02-20 14:24:13 +0000 @@ -49,9 +49,8 @@ ;; http://lists.gnu.org/mailman/listinfo/tramp-devel ;; ;; For the adventurous, the current development sources are available -;; via CVS. You can find instructions about this at the following URL: +;; via Git. You can find instructions about this at the following URL: ;; http://savannah.gnu.org/projects/tramp/ -;; Click on "CVS" in the navigation bar near the top. ;; ;; Don't forget to put on your asbestos longjohns, first! @@ -66,6 +65,7 @@ (defvar directory-sep-char) (defvar eshell-path-env) (defvar file-notify-descriptors) +(defvar ls-lisp-use-insert-directory-program) (defvar outline-regexp) ;;; User Customizable Internal Variables: @@ -3007,6 +3007,38 @@ (tramp-run-real-handler 'find-backup-file-name (list filename))))) +(defun tramp-handle-insert-directory + (filename switches &optional wildcard full-directory-p) + "Like `insert-directory' for Tramp files." + (unless switches (setq switches "")) + ;; Mark trailing "/". + (when (and (zerop (length (file-name-nondirectory filename))) + (not full-directory-p)) + (setq switches (concat switches "F"))) + (with-parsed-tramp-file-name (expand-file-name filename) nil + (with-tramp-progress-reporter v 0 (format "Opening directory %s" filename) + (require 'ls-lisp) + (let (ls-lisp-use-insert-directory-program start) + (tramp-run-real-handler + 'insert-directory + (list filename switches wildcard full-directory-p)) + ;; `ls-lisp' always returns full listings. We must remove + ;; superfluous parts. + (unless (string-match "l" switches) + (save-excursion + (goto-char (point-min)) + (while (setq start + (text-property-not-all + (point) (point-at-eol) 'dired-filename t)) + (delete-region + start + (or (text-property-any start (point-at-eol) 'dired-filename t) + (point-at-eol))) + (if (= (point-at-bol) (point-at-eol)) + ;; Empty line. + (delete-region (point) (progn (forward-line) (point))) + (forward-line))))))))) + (defun tramp-handle-insert-file-contents (filename &optional visit beg end replace) "Like `insert-file-contents' for Tramp files." ------------------------------------------------------------ revno: 116490 committer: Michael Albinus branch nick: trunk timestamp: Thu 2014-02-20 15:08:00 +0100 message: * automated/tramp-tests.el (tramp--instrument-test-case): New macro. (tramp-test17-insert-directory): First line could contain more text, when produced by `ls-lisp'. (tramp-test19-directory-files-and-attributes): Instrument failed test case. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2014-02-19 19:28:32 +0000 +++ test/ChangeLog 2014-02-20 14:08:00 +0000 @@ -1,3 +1,11 @@ +2014-02-20 Michael Albinus + + * automated/tramp-tests.el (tramp--instrument-test-case): New macro. + (tramp-test17-insert-directory): First line could contain more + text, when produced by `ls-lisp'. + (tramp-test19-directory-files-and-attributes): Instrument failed + test case. + 2014-02-19 Michael Albinus * automated/tramp-tests.el (tramp-test17-insert-directory): === modified file 'test/automated/tramp-tests.el' --- test/automated/tramp-tests.el 2014-02-19 19:28:32 +0000 +++ test/automated/tramp-tests.el 2014-02-20 14:08:00 +0000 @@ -89,6 +89,20 @@ (expand-file-name (make-temp-name "tramp-test") tramp-test-temporary-file-directory)) +(defmacro tramp--instrument-test-case (verbose &rest body) + "Run BODY with `tramp-verbose' equal VERBOSE. +Print the the content of the Tramp debug buffer, if BODY does not +eval properly in `should', `should-not' or `should-error'." + `(let ((tramp-verbose ,verbose)) + (condition-case err + (progn ,@body) + (ert-test-failed + (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil + (with-current-buffer (tramp-get-debug-buffer v) + (message "%s" (buffer-string)))) + (signal (car err) (cdr err)))))) +(put 'tramp--instrument-test-case 'lisp-indent-function 1) + (ert-deftest tramp-test00-availability () "Test availability of Tramp functions." :expected-result (if (tramp--test-enabled) :passed :failed) @@ -823,7 +837,7 @@ (goto-char (point-min)) (should (looking-at-p - "\\(total +[[:digit:]]+\n\\)?.+ \\.\n.+ \\.\\.\n.+ foo$")))) + "\\(total.+[[:digit:]]+\n\\)?.+ \\.\n.+ \\.\\.\n.+ foo$")))) (ignore-errors (delete-directory tmp-name1 'recursive))))) (ert-deftest tramp-test18-file-attributes () @@ -891,13 +905,15 @@ (setq attr (directory-files-and-attributes tmp-name)) (should (consp attr)) (dolist (elt attr) - (should - (equal (file-attributes (expand-file-name (car elt) tmp-name)) - (cdr elt)))) + (tramp--instrument-test-case 10 + (should + (equal (file-attributes (expand-file-name (car elt) tmp-name)) + (cdr elt))))) (setq attr (directory-files-and-attributes tmp-name 'full)) (dolist (elt attr) - (should - (equal (file-attributes (car elt)) (cdr elt)))) + (tramp--instrument-test-case 10 + (should + (equal (file-attributes (car elt)) (cdr elt))))) (setq attr (directory-files-and-attributes tmp-name nil "^b")) (should (equal (mapcar 'car attr) '("bar" "boz")))) (ignore-errors (delete-directory tmp-name 'recursive))))) @@ -1344,8 +1360,6 @@ ;; * set-file-acl ;; * set-file-selinux-context -;; * Fix `tramp-test17-insert-directory' for -;; `ls-lisp-insert-directory' ("plink" and friends, tramp-gvfs.el). ;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). ;; * Fix `tramp-test28-shell-command' on MS Windows (`process-send-eof'?). ;; * Fix `tramp-test30-utf8' on MS Windows. Seems to be in `directory-files'. ------------------------------------------------------------ revno: 116489 fixes bug: http://debbugs.gnu.org/16799 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2014-02-20 11:33:32 +0100 message: lisp/elec-pair.el: Fix bug#16799. (electric-pair-syntax-info): Do not check syntax before the start of buffer/region. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-20 08:14:20 +0000 +++ lisp/ChangeLog 2014-02-20 10:33:32 +0000 @@ -1,3 +1,8 @@ +2014-02-20 Juanma Barranquero + + * elec-pair.el (electric-pair-syntax-info): Do not check syntax + before the start of buffer/region (bug#16799). + 2014-02-20 Glenn Morris * isearch.el (search-invisible): Doc fix. === modified file 'lisp/elec-pair.el' --- lisp/elec-pair.el 2014-02-03 00:28:57 +0000 +++ lisp/elec-pair.el 2014-02-20 10:33:32 +0000 @@ -215,8 +215,9 @@ `electric-pair-pairs' or `electric-pair-text-pairs' were used to lookup syntax. STRING-OR-COMMENT-START indicates that point is inside a comment of string." - (let* ((pre-string-or-comment (nth 8 (save-excursion - (syntax-ppss (1- (point)))))) + (let* ((pre-string-or-comment (or (bobp) + (nth 8 (save-excursion + (syntax-ppss (1- (point))))))) (post-string-or-comment (nth 8 (syntax-ppss (point)))) (string-or-comment (and post-string-or-comment pre-string-or-comment)) ------------------------------------------------------------ revno: 116488 committer: Glenn Morris branch nick: trunk timestamp: Thu 2014-02-20 00:25:12 -0800 message: Rework previous doc/emacs change * doc/emacs/search.texi (Special Isearch): Mention invisible text. * doc/emacs/text.texi (Outline Visibility): Mention `M-s i' in isearch. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2014-02-20 08:14:20 +0000 +++ doc/emacs/ChangeLog 2014-02-20 08:25:12 +0000 @@ -1,6 +1,7 @@ 2014-02-20 Glenn Morris * search.texi (Special Isearch): Mention invisible text. + * text.texi (Outline Visibility): Mention `M-s i' in isearch. 2014-02-18 Glenn Morris === modified file 'doc/emacs/search.texi' --- doc/emacs/search.texi 2014-02-20 08:14:20 +0000 +++ doc/emacs/search.texi 2014-02-20 08:25:12 +0000 @@ -247,14 +247,8 @@ @cindex invisible text, searching for @kindex M-s i @r{(Incremental search)} @findex isearch-toggle-invisible -@vindex search-invisible - Some Emacs modes hide certain text by making it invisible. For -example, Outline major mode (@pxref{Outline Mode}). By default, -incremental search will search for matches in text hidden by Outline -mode (and some other modes), and make the text visible if it finds a match. -To toggle whether or not invisible text is searched, type -@kbd{M-s i} (@code{isearch-toggle-invisible}). To change the default -for future searches, customize the option @code{search-invisible}. + To toggle whether or not invisible text is searched, type +@kbd{M-s i} (@code{isearch-toggle-invisible}). @xref{Outline Search}. To search for a newline character, type @kbd{C-j}. === modified file 'doc/emacs/text.texi' --- doc/emacs/text.texi 2014-02-11 06:34:29 +0000 +++ doc/emacs/text.texi 2014-02-20 08:25:12 +0000 @@ -1124,12 +1124,17 @@ numeric argument @var{n}, it hides everything except the top @var{n} levels of heading lines. +@anchor{Outline Search} @findex reveal-mode +@vindex search-invisible When incremental search finds text that is hidden by Outline mode, it makes that part of the buffer visible. If you exit the search at -that position, the text remains visible. You can also automatically -make text visible as you navigate in it by using Reveal mode (@kbd{M-x -reveal-mode}), a buffer-local minor mode. +that position, the text remains visible. To toggle whether or not +an active incremental search can match hidden text, type @kbd{M-s i}. +To change the default for future searches, customize the option +@code{search-invisible}. You can also automatically make text visible +as you navigate in it by using Reveal mode (@kbd{M-x reveal-mode}), a +buffer-local minor mode. @node Outline Views @subsection Viewing One Outline in Multiple Views ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.