diff options
| -rw-r--r-- | doc/lispref/ChangeLog | 8 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 109 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 4 | ||||
| -rw-r--r-- | doc/misc/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/misc/cl.texi | 16 | ||||
| -rw-r--r-- | doc/misc/tramp.texi | 33 | ||||
| -rw-r--r-- | lisp/ChangeLog | 30 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-lib.el | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-loaddefs.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 8 | ||||
| -rw-r--r-- | lisp/image-mode.el | 31 | ||||
| -rw-r--r-- | lisp/image.el | 10 | ||||
| -rw-r--r-- | lisp/jka-cmpr-hook.el | 10 | ||||
| -rw-r--r-- | lisp/outline.el | 12 | ||||
| -rw-r--r-- | lisp/simple.el | 49 | ||||
| -rw-r--r-- | src/ChangeLog | 29 | ||||
| -rw-r--r-- | src/bidi.c | 13 | ||||
| -rw-r--r-- | src/editfns.c | 5 | ||||
| -rw-r--r-- | src/indent.c | 31 | ||||
| -rw-r--r-- | src/keyboard.c | 101 | ||||
| -rw-r--r-- | src/lisp.h | 7 | ||||
| -rw-r--r-- | src/search.c | 51 | ||||
| -rw-r--r-- | src/sheap.c | 4 | ||||
| -rw-r--r-- | src/xdisp.c | 21 |
24 files changed, 327 insertions, 268 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index fe61fb4dce1..74f2eb9312b 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2013-02-20 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * display.texi (GIF Images, TIFF Images): Delete these nodes. | ||
| 4 | (ImageMagick Images): For :index, use an xref rather than duplicating. | ||
| 5 | (Other Image Types): Add GIF, adjust formatting. | ||
| 6 | (Multi-Frame Images): Rename from Animated Images. Expand section. | ||
| 7 | * elisp.texi (Top): Update menu for these changes. | ||
| 8 | |||
| 1 | 2013-02-19 Glenn Morris <rgm@gnu.org> | 9 | 2013-02-19 Glenn Morris <rgm@gnu.org> |
| 2 | 10 | ||
| 3 | * text.texi (Change Hooks): Fix typo. | 11 | * text.texi (Change Hooks): Fix typo. |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index cc6e980dadc..1e596c14233 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -4199,14 +4199,12 @@ displayed (@pxref{Display Feature Testing}). | |||
| 4199 | * Image Descriptors:: How to specify an image for use in @code{:display}. | 4199 | * Image Descriptors:: How to specify an image for use in @code{:display}. |
| 4200 | * XBM Images:: Special features for XBM format. | 4200 | * XBM Images:: Special features for XBM format. |
| 4201 | * XPM Images:: Special features for XPM format. | 4201 | * XPM Images:: Special features for XPM format. |
| 4202 | * GIF Images:: Special features for GIF format. | ||
| 4203 | * TIFF Images:: Special features for TIFF format. | ||
| 4204 | * PostScript Images:: Special features for PostScript format. | 4202 | * PostScript Images:: Special features for PostScript format. |
| 4205 | * ImageMagick Images:: Special features available through ImageMagick. | 4203 | * ImageMagick Images:: Special features available through ImageMagick. |
| 4206 | * Other Image Types:: Various other formats are supported. | 4204 | * Other Image Types:: Various other formats are supported. |
| 4207 | * Defining Images:: Convenient ways to define an image for later use. | 4205 | * Defining Images:: Convenient ways to define an image for later use. |
| 4208 | * Showing Images:: Convenient ways to display an image once it is defined. | 4206 | * Showing Images:: Convenient ways to display an image once it is defined. |
| 4209 | * Animated Images:: Some image formats can be animated. | 4207 | * Multi-Frame Images:: Some images contain more than one frame. |
| 4210 | * Image Cache:: Internal mechanisms of image display. | 4208 | * Image Cache:: Internal mechanisms of image display. |
| 4211 | @end menu | 4209 | @end menu |
| 4212 | 4210 | ||
| @@ -4541,35 +4539,6 @@ the name of a color as it appears in the image file, and @var{color} | |||
| 4541 | specifies the actual color to use for displaying that name. | 4539 | specifies the actual color to use for displaying that name. |
| 4542 | @end table | 4540 | @end table |
| 4543 | 4541 | ||
| 4544 | @node GIF Images | ||
| 4545 | @subsection GIF Images | ||
| 4546 | @cindex GIF | ||
| 4547 | |||
| 4548 | For GIF images, specify image type @code{gif}. | ||
| 4549 | |||
| 4550 | @table @code | ||
| 4551 | @item :index @var{index} | ||
| 4552 | You can use @code{:index} to specify image number @var{index} from a | ||
| 4553 | GIF file that contains more than one image. If the GIF file doesn't | ||
| 4554 | contain an image with the specified index, the image displays as a | ||
| 4555 | hollow box. GIF files with more than one image can be animated, | ||
| 4556 | @pxref{Animated Images}. | ||
| 4557 | @end table | ||
| 4558 | |||
| 4559 | @node TIFF Images | ||
| 4560 | @subsection TIFF Images | ||
| 4561 | @cindex TIFF | ||
| 4562 | |||
| 4563 | For TIFF images, specify image type @code{tiff}. | ||
| 4564 | |||
| 4565 | @table @code | ||
| 4566 | @item :index @var{index} | ||
| 4567 | You can use @code{:index} to specify image number @var{index} from a | ||
| 4568 | TIFF file that contains more than one image. If the TIFF file doesn't | ||
| 4569 | contain an image with the specified index, the image displays as a | ||
| 4570 | hollow box. | ||
| 4571 | @end table | ||
| 4572 | |||
| 4573 | @node PostScript Images | 4542 | @node PostScript Images |
| 4574 | @subsection PostScript Images | 4543 | @subsection PostScript Images |
| 4575 | @cindex postscript images | 4544 | @cindex postscript images |
| @@ -4653,10 +4622,7 @@ Specifies a rotation angle in degrees. | |||
| 4653 | 4622 | ||
| 4654 | @item :index | 4623 | @item :index |
| 4655 | @c Doesn't work: http://debbugs.gnu.org/7978 | 4624 | @c Doesn't work: http://debbugs.gnu.org/7978 |
| 4656 | This has the same meaning as it does for GIF images (@pxref{GIF Images}), | 4625 | @xref{Multi-Frame Images}. |
| 4657 | i.e., it specifies which image to view inside an image bundle file format | ||
| 4658 | such as DJVM@. You can use the @code{image-metadata} function to | ||
| 4659 | retrieve the total number of images in an image bundle. | ||
| 4660 | @end table | 4626 | @end table |
| 4661 | 4627 | ||
| 4662 | @node Other Image Types | 4628 | @node Other Image Types |
| @@ -4681,13 +4647,27 @@ used for each pixel in the PBM that is 0. The default is the frame's | |||
| 4681 | background color. | 4647 | background color. |
| 4682 | @end table | 4648 | @end table |
| 4683 | 4649 | ||
| 4684 | For JPEG images, specify image type @code{jpeg}. | 4650 | @noindent |
| 4651 | The remaining image types that Emacs can support are: | ||
| 4685 | 4652 | ||
| 4686 | For TIFF images, specify image type @code{tiff}. | 4653 | @table @asis |
| 4654 | @item GIF | ||
| 4655 | Image type @code{gif}. | ||
| 4656 | Supports the @code{:index} property. @xref{Multi-Frame Images}. | ||
| 4657 | |||
| 4658 | @item JPEG | ||
| 4659 | Image type @code{jpeg}. | ||
| 4687 | 4660 | ||
| 4688 | For PNG images, specify image type @code{png}. | 4661 | @item PNG |
| 4662 | Image type @code{png}. | ||
| 4689 | 4663 | ||
| 4690 | For SVG images, specify image type @code{svg}. | 4664 | @item SVG |
| 4665 | Image type @code{svg}. | ||
| 4666 | |||
| 4667 | @item TIFF | ||
| 4668 | Image type @code{tiff}. | ||
| 4669 | Supports the @code{:index} property. @xref{Multi-Frame Images}. | ||
| 4670 | @end table | ||
| 4691 | 4671 | ||
| 4692 | @node Defining Images | 4672 | @node Defining Images |
| 4693 | @subsection Defining Images | 4673 | @subsection Defining Images |
| @@ -4923,20 +4903,45 @@ cache, it can always be displayed, even if the value of | |||
| 4923 | @var{max-image-size} is subsequently changed (@pxref{Image Cache}). | 4903 | @var{max-image-size} is subsequently changed (@pxref{Image Cache}). |
| 4924 | @end defvar | 4904 | @end defvar |
| 4925 | 4905 | ||
| 4926 | @node Animated Images | 4906 | @node Multi-Frame Images |
| 4927 | @subsection Animated Images | 4907 | @subsection Multi-Frame Images |
| 4928 | 4908 | ||
| 4929 | @cindex animation | 4909 | @cindex animation |
| 4930 | @cindex image animation | 4910 | @cindex image animation |
| 4931 | Some image files can contain more than one image. This can be used to | 4911 | @cindex image frames |
| 4932 | create animation. Currently, Emacs only supports animated GIF files. | 4912 | Some image files can contain more than one image. We say that there |
| 4933 | The following functions related to animated images are available. | 4913 | are multiple ``frames'' in the image. At present, Emacs supports |
| 4914 | multiple frames for GIF, TIFF, and certain ImageMagick formats such as | ||
| 4915 | DJVM@. | ||
| 4916 | |||
| 4917 | The frames can be used either to represent multiple ``pages'' (this is | ||
| 4918 | usually the case with multi-frame TIFF files, for example), or to | ||
| 4919 | create animation (usually the case with multi-frame GIF files). | ||
| 4920 | |||
| 4921 | A multi-frame image has a property @code{:index}, whose value is an | ||
| 4922 | integer (counting from 0) that specifies which frame is being displayed. | ||
| 4923 | |||
| 4924 | @defun image-multi-frame-p image | ||
| 4925 | This function returns non-@code{nil} if @var{image} contains more than | ||
| 4926 | one frame. The actual return value is a cons @code{(@var{nimages} | ||
| 4927 | . @var{delay})}, where @var{nimages} is the number of frames and | ||
| 4928 | @var{delay} is the delay in seconds between them, if the image itself | ||
| 4929 | specifies a delay. Images that are intended to be animated usually | ||
| 4930 | specify a frame delay, whereas ones that are intended to be treated as | ||
| 4931 | multiple pages do not. | ||
| 4932 | @end defun | ||
| 4933 | |||
| 4934 | @defun image-current-frame image | ||
| 4935 | This function returns the index of the current frame number for | ||
| 4936 | @var{image}, counting from 0. | ||
| 4937 | @end defun | ||
| 4934 | 4938 | ||
| 4935 | @defun image-animated-p image | 4939 | @defun image-show-frame image n &optional nocheck |
| 4936 | This function returns non-@code{nil} if @var{image} can be animated. | 4940 | This function switches @var{image} to frame number @var{n}. It |
| 4937 | The actual return value is a cons @code{(@var{nimages} . @var{delay})}, | 4941 | replaces a frame number outside the valid range with that of the end |
| 4938 | where @var{nimages} is the number of frames and @var{delay} is the | 4942 | of the range, unless @var{nocheck} is non-@code{nil}. If @var{image} |
| 4939 | delay in seconds between them. | 4943 | does not contain a frame with the specified number, the image displays |
| 4944 | as a hollow box. | ||
| 4940 | @end defun | 4945 | @end defun |
| 4941 | 4946 | ||
| 4942 | @defun image-animate image &optional index limit | 4947 | @defun image-animate image &optional index limit |
| @@ -4948,7 +4953,9 @@ forever; if a number animation stops after that many seconds. | |||
| 4948 | @end defun | 4953 | @end defun |
| 4949 | 4954 | ||
| 4950 | @noindent Animation operates by means of a timer. Note that Emacs imposes a | 4955 | @noindent Animation operates by means of a timer. Note that Emacs imposes a |
| 4951 | minimum frame delay of 0.01 seconds. | 4956 | minimum frame delay of 0.01 (@code{image-minimum-frame-delay}) seconds. |
| 4957 | If the image itself does not specify a delay, Emacs uses | ||
| 4958 | @code{image-default-frame-delay}. | ||
| 4952 | 4959 | ||
| 4953 | @defun image-animate-timer image | 4960 | @defun image-animate-timer image |
| 4954 | This function returns the timer responsible for animating @var{image}, | 4961 | This function returns the timer responsible for animating @var{image}, |
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 3d1c4cf577d..8ff34941b7d 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -1417,15 +1417,13 @@ Images | |||
| 1417 | * Image Descriptors:: How to specify an image for use in @code{:display}. | 1417 | * Image Descriptors:: How to specify an image for use in @code{:display}. |
| 1418 | * XBM Images:: Special features for XBM format. | 1418 | * XBM Images:: Special features for XBM format. |
| 1419 | * XPM Images:: Special features for XPM format. | 1419 | * XPM Images:: Special features for XPM format. |
| 1420 | * GIF Images:: Special features for GIF format. | ||
| 1421 | * TIFF Images:: Special features for TIFF format. | ||
| 1422 | * PostScript Images:: Special features for PostScript format. | 1420 | * PostScript Images:: Special features for PostScript format. |
| 1423 | * ImageMagick Images:: Special features available through ImageMagick. | 1421 | * ImageMagick Images:: Special features available through ImageMagick. |
| 1424 | * Other Image Types:: Various other formats are supported. | 1422 | * Other Image Types:: Various other formats are supported. |
| 1425 | * Defining Images:: Convenient ways to define an image for later use. | 1423 | * Defining Images:: Convenient ways to define an image for later use. |
| 1426 | * Showing Images:: Convenient ways to display an image once | 1424 | * Showing Images:: Convenient ways to display an image once |
| 1427 | it is defined. | 1425 | it is defined. |
| 1428 | * Animated Images:: Some image formats can be animated. | 1426 | * Multi-Frame Images:: Some images contain more than one frame. |
| 1429 | * Image Cache:: Internal mechanisms of image display. | 1427 | * Image Cache:: Internal mechanisms of image display. |
| 1430 | 1428 | ||
| 1431 | Buttons | 1429 | Buttons |
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index d24f2b593d4..41eb17415b7 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-02-20 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * tramp.texi (Android shell setup): Improve. Reported by Thierry | ||
| 4 | Volpiatto <thierry.volpiatto@gmail.com>. | ||
| 5 | |||
| 1 | 2013-02-16 Michael Albinus <michael.albinus@gmx.de> | 6 | 2013-02-16 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 7 | ||
| 3 | * tramp.texi (Top, Configuration): Insert section `Android shell | 8 | * tramp.texi (Top, Configuration): Insert section `Android shell |
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 11f19c8df06..83df411cb23 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi | |||
| @@ -703,14 +703,6 @@ The type symbol @code{real} is a synonym for @code{number}, and | |||
| 703 | The type symbols @code{character} and @code{string-char} match | 703 | The type symbols @code{character} and @code{string-char} match |
| 704 | integers in the range from 0 to 255. | 704 | integers in the range from 0 to 255. |
| 705 | 705 | ||
| 706 | @c No longer relevant, so covered by first item above (float -> floatp). | ||
| 707 | @ignore | ||
| 708 | @item | ||
| 709 | The type symbol @code{float} uses the @code{cl-floatp-safe} predicate | ||
| 710 | defined by this package rather than @code{floatp}, so it will work | ||
| 711 | correctly even in Emacs versions without floating-point support. | ||
| 712 | @end ignore | ||
| 713 | |||
| 714 | @item | 706 | @item |
| 715 | The type list @code{(integer @var{low} @var{high})} represents all | 707 | The type list @code{(integer @var{low} @var{high})} represents all |
| 716 | integers between @var{low} and @var{high}, inclusive. Either bound | 708 | integers between @var{low} and @var{high}, inclusive. Either bound |
| @@ -2921,14 +2913,6 @@ This predicate tests whether @var{integer} is even. It is an | |||
| 2921 | error if the argument is not an integer. | 2913 | error if the argument is not an integer. |
| 2922 | @end defun | 2914 | @end defun |
| 2923 | 2915 | ||
| 2924 | @ignore | ||
| 2925 | @defun cl-floatp-safe object | ||
| 2926 | This predicate tests whether @var{object} is a floating-point | ||
| 2927 | number. On systems that support floating-point, this is equivalent | ||
| 2928 | to @code{floatp}. On other systems, this always returns @code{nil}. | ||
| 2929 | @end defun | ||
| 2930 | @end ignore | ||
| 2931 | |||
| 2932 | @node Numerical Functions | 2916 | @node Numerical Functions |
| 2933 | @section Numerical Functions | 2917 | @section Numerical Functions |
| 2934 | 2918 | ||
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 77a4f632cff..807e6b4db29 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -2016,7 +2016,7 @@ local machine. | |||
| 2016 | 2016 | ||
| 2017 | When an @command{sshd} process runs on the Android device, like | 2017 | When an @command{sshd} process runs on the Android device, like |
| 2018 | provided by the @code{SSHDroid} app, any @option{ssh}-based method can | 2018 | provided by the @code{SSHDroid} app, any @option{ssh}-based method can |
| 2019 | be used. However, this requires some special settings. | 2019 | be used. This requires some special settings. |
| 2020 | 2020 | ||
| 2021 | The default shell @code{/bin/sh} does not exist. Instead, you shall | 2021 | The default shell @code{/bin/sh} does not exist. Instead, you shall |
| 2022 | use just @code{sh}, which invokes the shell installed on the device. | 2022 | use just @code{sh}, which invokes the shell installed on the device. |
| @@ -2031,23 +2031,50 @@ You can instruct @value{tramp} by this form: | |||
| 2031 | with @samp{192.168.0.26} being the IP address of your Android device. | 2031 | with @samp{192.168.0.26} being the IP address of your Android device. |
| 2032 | 2032 | ||
| 2033 | The user settings for the @code{$PATH} environment variable must be | 2033 | The user settings for the @code{$PATH} environment variable must be |
| 2034 | preserved. Add this setting: | 2034 | preserved. It has also been reported, that the commands in |
| 2035 | @file{/system/xbin} are better suited than the ones in | ||
| 2036 | @file{/system/bin}. Add these setting: | ||
| 2035 | 2037 | ||
| 2036 | @lisp | 2038 | @lisp |
| 2037 | (add-to-list 'tramp-remote-path 'tramp-own-remote-path) | 2039 | (add-to-list 'tramp-remote-path 'tramp-own-remote-path) |
| 2040 | (add-to-list 'tramp-remote-path "/system/xbin") | ||
| 2038 | @end lisp | 2041 | @end lisp |
| 2039 | 2042 | ||
| 2043 | @noindent | ||
| 2040 | If the Android device is not @samp{rooted}, you must give the shell a | 2044 | If the Android device is not @samp{rooted}, you must give the shell a |
| 2041 | writable directory for temporary files. You could use this setting: | 2045 | writable directory for temporary files: |
| 2042 | 2046 | ||
| 2043 | @lisp | 2047 | @lisp |
| 2044 | (add-to-list 'tramp-remote-process-environment "TMPDIR=$HOME") | 2048 | (add-to-list 'tramp-remote-process-environment "TMPDIR=$HOME") |
| 2045 | @end lisp | 2049 | @end lisp |
| 2046 | 2050 | ||
| 2051 | @noindent | ||
| 2047 | Now you shall be able to open a remote connection with @kbd{C-x C-f | 2052 | Now you shall be able to open a remote connection with @kbd{C-x C-f |
| 2048 | @trampfn{ssh, , 192.168.0.26#2222, }}, given that @command{sshd} | 2053 | @trampfn{ssh, , 192.168.0.26#2222, }}, given that @command{sshd} |
| 2049 | listens on port @samp{2222}. | 2054 | listens on port @samp{2222}. |
| 2050 | 2055 | ||
| 2056 | It is also recommended to add a corresponding entry to your | ||
| 2057 | @file{~/.ssh/config} for that connection, like | ||
| 2058 | |||
| 2059 | @example | ||
| 2060 | Host android | ||
| 2061 | HostName 192.168.0.26 | ||
| 2062 | User root | ||
| 2063 | Port 2222 | ||
| 2064 | @end example | ||
| 2065 | |||
| 2066 | @noindent | ||
| 2067 | In this case, you must change the setting for the remote shell to | ||
| 2068 | |||
| 2069 | @lisp | ||
| 2070 | (add-to-list 'tramp-connection-properties | ||
| 2071 | (list (regexp-quote "android") "remote-shell" "sh")) | ||
| 2072 | @end lisp | ||
| 2073 | |||
| 2074 | @noindent | ||
| 2075 | You would open the connection with @kbd{C-x C-f @trampfn{ssh, , | ||
| 2076 | android, }} then. | ||
| 2077 | |||
| 2051 | 2078 | ||
| 2052 | @node Auto-save and Backup | 2079 | @node Auto-save and Backup |
| 2053 | @section Auto-save and Backup configuration | 2080 | @section Auto-save and Backup configuration |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c1e75fcdca8..abcf6578060 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,33 @@ | |||
| 1 | 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * simple.el (command-execute): Move from C. Add obsolete check. | ||
| 4 | (extended-command-history): Move from C. | ||
| 5 | |||
| 6 | 2013-02-20 Ulrich Müller <ulm@gentoo.org> | ||
| 7 | |||
| 8 | * jka-cmpr-hook.el (jka-compr-compression-info-list) | ||
| 9 | (jka-compr-mode-alist-additions): Handle .txz suffix for | ||
| 10 | XZ-compressed tar archives (bug#13770). | ||
| 11 | |||
| 12 | 2013-02-20 Bastien Guerry <bzg@gnu.org> | ||
| 13 | |||
| 14 | * outline.el (outline-regexp, outline-heading-end-regexp): | ||
| 15 | Make variables, not options (bug#13731). | ||
| 16 | |||
| 17 | 2013-02-20 Glenn Morris <rgm@gnu.org> | ||
| 18 | |||
| 19 | * image.el (image-current-frame): Change from variable to function. | ||
| 20 | (image-show-frame): Rename from image-nth-frame. Update callers. | ||
| 21 | * image-mode.el (image-multi-frame): New variable. | ||
| 22 | (image-mode-map, image-mode, image-goto-frame): | ||
| 23 | Use image-multi-frame rather than image-current-frame. | ||
| 24 | (image-mode, image-goto-frame): Use image-current-frame as | ||
| 25 | function rather than as variable. | ||
| 26 | |||
| 27 | * emacs-lisp/cl-lib.el (cl-floatp-safe): Make it an alias for floatp. | ||
| 28 | * emacs-lisp/cl-macs.el (cl--make-type-test) | ||
| 29 | (cl--compiler-macro-assoc): Use floatp rather than cl-floatp-safe. | ||
| 30 | |||
| 1 | 2013-02-19 Michael Albinus <michael.albinus@gmx.de> | 31 | 2013-02-19 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 32 | ||
| 3 | * net/tramp-cache.el (tramp-get-hash-table): New defun. | 33 | * net/tramp-cache.el (tramp-get-hash-table): New defun. |
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 2de8260c941..f3bf70b0190 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el | |||
| @@ -271,11 +271,7 @@ so that they are registered at compile-time as well as run-time." | |||
| 271 | 271 | ||
| 272 | ;;; Numbers. | 272 | ;;; Numbers. |
| 273 | 273 | ||
| 274 | (defun cl-floatp-safe (object) | 274 | (define-obsolete-function-alias 'cl-floatp-safe 'floatp "24.4") |
| 275 | "Return t if OBJECT is a floating point number. | ||
| 276 | On Emacs versions that lack floating-point support, this function | ||
| 277 | always returns nil." | ||
| 278 | (and (numberp object) (not (integerp object)))) | ||
| 279 | 275 | ||
| 280 | (defsubst cl-plusp (number) | 276 | (defsubst cl-plusp (number) |
| 281 | "Return t if NUMBER is positive." | 277 | "Return t if NUMBER is positive." |
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index 89e774f830c..40dea8ddebf 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el | |||
| @@ -267,7 +267,7 @@ including `cl-block' and `cl-eval-when'. | |||
| 267 | ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when | 267 | ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when |
| 268 | ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp | 268 | ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp |
| 269 | ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) | 269 | ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) |
| 270 | ;;;;;; "cl-macs" "cl-macs.el" "7614365c56c74e8ed9d098d11801605b") | 270 | ;;;;;; "cl-macs" "cl-macs.el" "b36258e378f078d937e71b70b43fb532") |
| 271 | ;;; Generated autoloads from cl-macs.el | 271 | ;;; Generated autoloads from cl-macs.el |
| 272 | 272 | ||
| 273 | (autoload 'cl--compiler-macro-list* "cl-macs" "\ | 273 | (autoload 'cl--compiler-macro-list* "cl-macs" "\ |
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 8e1f6da3b23..89d022ecced 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el | |||
| @@ -2520,7 +2520,7 @@ The type name can then be used in `cl-typecase', `cl-check-type', etc." | |||
| 2520 | ((memq type '(nil t)) type) | 2520 | ((memq type '(nil t)) type) |
| 2521 | ((eq type 'null) `(null ,val)) | 2521 | ((eq type 'null) `(null ,val)) |
| 2522 | ((eq type 'atom) `(atom ,val)) | 2522 | ((eq type 'atom) `(atom ,val)) |
| 2523 | ((eq type 'float) `(cl-floatp-safe ,val)) | 2523 | ((eq type 'float) `(floatp ,val)) |
| 2524 | ((eq type 'real) `(numberp ,val)) | 2524 | ((eq type 'real) `(numberp ,val)) |
| 2525 | ((eq type 'fixnum) `(integerp ,val)) | 2525 | ((eq type 'fixnum) `(integerp ,val)) |
| 2526 | ;; FIXME: Should `character' accept things like ?\C-\M-a ? --Stef | 2526 | ;; FIXME: Should `character' accept things like ?\C-\M-a ? --Stef |
| @@ -2739,7 +2739,7 @@ surrounded by (cl-block NAME ...). | |||
| 2739 | (cond ((eq test 'eq) `(assq ,a ,list)) | 2739 | (cond ((eq test 'eq) `(assq ,a ,list)) |
| 2740 | ((eq test 'equal) `(assoc ,a ,list)) | 2740 | ((eq test 'equal) `(assoc ,a ,list)) |
| 2741 | ((and (macroexp-const-p a) (or (null keys) (eq test 'eql))) | 2741 | ((and (macroexp-const-p a) (or (null keys) (eq test 'eql))) |
| 2742 | (if (cl-floatp-safe (cl--const-expr-val a)) | 2742 | (if (floatp (cl--const-expr-val a)) |
| 2743 | `(assoc ,a ,list) `(assq ,a ,list))) | 2743 | `(assoc ,a ,list) `(assq ,a ,list))) |
| 2744 | (t form)))) | 2744 | (t form)))) |
| 2745 | 2745 | ||
| @@ -2776,7 +2776,7 @@ surrounded by (cl-block NAME ...). | |||
| 2776 | (put y 'side-effect-free t)) | 2776 | (put y 'side-effect-free t)) |
| 2777 | 2777 | ||
| 2778 | ;;; Things that are inline. | 2778 | ;;; Things that are inline. |
| 2779 | (cl-proclaim '(inline cl-floatp-safe cl-acons cl-map cl-concatenate cl-notany | 2779 | (cl-proclaim '(inline cl-acons cl-map cl-concatenate cl-notany |
| 2780 | cl-notevery cl--set-elt cl-revappend cl-nreconc gethash)) | 2780 | cl-notevery cl--set-elt cl-revappend cl-nreconc gethash)) |
| 2781 | 2781 | ||
| 2782 | ;;; Things that are side-effect-free. | 2782 | ;;; Things that are side-effect-free. |
| @@ -2787,7 +2787,7 @@ surrounded by (cl-block NAME ...). | |||
| 2787 | 2787 | ||
| 2788 | ;;; Things that are side-effect-and-error-free. | 2788 | ;;; Things that are side-effect-and-error-free. |
| 2789 | (mapc (lambda (x) (put x 'side-effect-free 'error-free)) | 2789 | (mapc (lambda (x) (put x 'side-effect-free 'error-free)) |
| 2790 | '(eql cl-floatp-safe cl-list* cl-subst cl-acons cl-equalp | 2790 | '(eql cl-list* cl-subst cl-acons cl-equalp |
| 2791 | cl-random-state-p copy-tree cl-sublis)) | 2791 | cl-random-state-p copy-tree cl-sublis)) |
| 2792 | 2792 | ||
| 2793 | 2793 | ||
diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 7787a26cc08..6ae1bb20cdc 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el | |||
| @@ -329,6 +329,9 @@ call." | |||
| 329 | "The image type for the current Image mode buffer.") | 329 | "The image type for the current Image mode buffer.") |
| 330 | (make-variable-buffer-local 'image-type) | 330 | (make-variable-buffer-local 'image-type) |
| 331 | 331 | ||
| 332 | (defvar-local image-multi-frame nil | ||
| 333 | "Non-nil if image for the current Image mode buffer has multiple frames.") | ||
| 334 | |||
| 332 | (defvar image-mode-previous-major-mode nil | 335 | (defvar image-mode-previous-major-mode nil |
| 333 | "Internal variable to keep the previous non-image major mode.") | 336 | "Internal variable to keep the previous non-image major mode.") |
| 334 | 337 | ||
| @@ -390,7 +393,7 @@ call." | |||
| 390 | ["Animate Image" image-toggle-animation :style toggle | 393 | ["Animate Image" image-toggle-animation :style toggle |
| 391 | :selected (let ((image (image-get-display-property))) | 394 | :selected (let ((image (image-get-display-property))) |
| 392 | (and image (image-animate-timer image))) | 395 | (and image (image-animate-timer image))) |
| 393 | :active image-current-frame | 396 | :active image-multi-frame |
| 394 | :help "Toggle image animation"] | 397 | :help "Toggle image animation"] |
| 395 | ["Loop Animation" | 398 | ["Loop Animation" |
| 396 | (lambda () (interactive) | 399 | (lambda () (interactive) |
| @@ -403,13 +406,13 @@ call." | |||
| 403 | (image-toggle-animation) | 406 | (image-toggle-animation) |
| 404 | (image-toggle-animation))) | 407 | (image-toggle-animation))) |
| 405 | :style toggle :selected image-animate-loop | 408 | :style toggle :selected image-animate-loop |
| 406 | :active image-current-frame | 409 | :active image-multi-frame |
| 407 | :help "Animate images once, or forever?"] | 410 | :help "Animate images once, or forever?"] |
| 408 | ["Next Frame" image-next-frame :active image-current-frame | 411 | ["Next Frame" image-next-frame :active image-multi-frame |
| 409 | :help "Show the next frame of this image"] | 412 | :help "Show the next frame of this image"] |
| 410 | ["Previous Frame" image-previous-frame :active image-current-frame | 413 | ["Previous Frame" image-previous-frame :active image-multi-frame |
| 411 | :help "Show the previous frame of this image"] | 414 | :help "Show the previous frame of this image"] |
| 412 | ["Goto Frame..." image-goto-frame :active image-current-frame | 415 | ["Goto Frame..." image-goto-frame :active image-multi-frame |
| 413 | :help "Show a specific frame of this image"] | 416 | :help "Show a specific frame of this image"] |
| 414 | )) | 417 | )) |
| 415 | map) | 418 | map) |
| @@ -471,12 +474,13 @@ to toggle between display as an image and display as text." | |||
| 471 | ((null image) | 474 | ((null image) |
| 472 | (message "%s" (concat msg1 "an image."))) | 475 | (message "%s" (concat msg1 "an image."))) |
| 473 | ((setq animated (image-multi-frame-p image)) | 476 | ((setq animated (image-multi-frame-p image)) |
| 474 | (setq image-current-frame (or (plist-get (cdr image) :index) 0) | 477 | (setq image-multi-frame t |
| 475 | mode-line-process | 478 | mode-line-process |
| 476 | `(:eval (propertize (format " [%s/%s]" | 479 | `(:eval (propertize |
| 477 | (1+ image-current-frame) | 480 | (format " [%s/%s]" |
| 478 | ,(car animated)) | 481 | (1+ (image-current-frame ',image)) |
| 479 | 'help-echo "Frame number"))) | 482 | ,(car animated)) |
| 483 | 'help-echo "Frame number"))) | ||
| 480 | (message "%s" | 484 | (message "%s" |
| 481 | (concat msg1 "text. This image has multiple frames."))) | 485 | (concat msg1 "text. This image has multiple frames."))) |
| 482 | ;;; (substitute-command-keys | 486 | ;;; (substitute-command-keys |
| @@ -694,10 +698,13 @@ current frame. Frames are indexed from 1." | |||
| 694 | (cond | 698 | (cond |
| 695 | ((null image) | 699 | ((null image) |
| 696 | (error "No image is present")) | 700 | (error "No image is present")) |
| 697 | ((null image-current-frame) | 701 | ((null image-multi-frame) |
| 698 | (message "No image animation.")) | 702 | (message "No image animation.")) |
| 699 | (t | 703 | (t |
| 700 | (image-nth-frame image (if relative (+ n image-current-frame) (1- n))))))) | 704 | (image-show-frame image |
| 705 | (if relative | ||
| 706 | (+ n (image-current-frame image)) | ||
| 707 | (1- n))))))) | ||
| 701 | 708 | ||
| 702 | (defun image-next-frame (&optional n) | 709 | (defun image-next-frame (&optional n) |
| 703 | "Switch to the next frame of a multi-frame image. | 710 | "Switch to the next frame of a multi-frame image. |
diff --git a/lisp/image.el b/lisp/image.el index b91d136443d..ec7b41bf126 100644 --- a/lisp/image.el +++ b/lisp/image.el | |||
| @@ -660,10 +660,11 @@ number, play until that number of seconds has elapsed." | |||
| 660 | (defconst image-minimum-frame-delay 0.01 | 660 | (defconst image-minimum-frame-delay 0.01 |
| 661 | "Minimum interval in seconds between frames of an animated image.") | 661 | "Minimum interval in seconds between frames of an animated image.") |
| 662 | 662 | ||
| 663 | (defvar-local image-current-frame nil | 663 | (defun image-current-frame (image) |
| 664 | "The frame index of the current animated image.") | 664 | "The current frame number of IMAGE, indexed from 0." |
| 665 | (or (plist-get (cdr image) :index) 0)) | ||
| 665 | 666 | ||
| 666 | (defun image-nth-frame (image n &optional nocheck) | 667 | (defun image-show-frame (image n &optional nocheck) |
| 667 | "Show frame N of IMAGE. | 668 | "Show frame N of IMAGE. |
| 668 | Frames are indexed from 0. Optional argument NOCHECK non-nil means | 669 | Frames are indexed from 0. Optional argument NOCHECK non-nil means |
| 669 | do not check N is within the range of frames present in the image." | 670 | do not check N is within the range of frames present in the image." |
| @@ -671,7 +672,6 @@ do not check N is within the range of frames present in the image." | |||
| 671 | (if (< n 0) (setq n 0) | 672 | (if (< n 0) (setq n 0) |
| 672 | (setq n (min n (1- (car (image-multi-frame-p image))))))) | 673 | (setq n (min n (1- (car (image-multi-frame-p image))))))) |
| 673 | (plist-put (cdr image) :index n) | 674 | (plist-put (cdr image) :index n) |
| 674 | (setq image-current-frame n) | ||
| 675 | (force-window-update)) | 675 | (force-window-update)) |
| 676 | 676 | ||
| 677 | ;; FIXME? The delay may not be the same for different sub-images, | 677 | ;; FIXME? The delay may not be the same for different sub-images, |
| @@ -688,7 +688,7 @@ LIMIT determines when to stop. If t, loop forever. If nil, stop | |||
| 688 | after displaying the last animation frame. Otherwise, stop | 688 | after displaying the last animation frame. Otherwise, stop |
| 689 | after LIMIT seconds have elapsed. | 689 | after LIMIT seconds have elapsed. |
| 690 | The minimum delay between successive frames is `image-minimum-frame-delay'." | 690 | The minimum delay between successive frames is `image-minimum-frame-delay'." |
| 691 | (image-nth-frame image n t) | 691 | (image-show-frame image n t) |
| 692 | (setq n (1+ n)) | 692 | (setq n (1+ n)) |
| 693 | (let* ((time (float-time)) | 693 | (let* ((time (float-time)) |
| 694 | (animation (image-multi-frame-p image)) | 694 | (animation (image-multi-frame-p image)) |
diff --git a/lisp/jka-cmpr-hook.el b/lisp/jka-cmpr-hook.el index 7b36f7c1214..851bceccf30 100644 --- a/lisp/jka-cmpr-hook.el +++ b/lisp/jka-cmpr-hook.el | |||
| @@ -234,6 +234,10 @@ options through Custom does this automatically." | |||
| 234 | "XZ compressing" "xz" ("-c" "-q") | 234 | "XZ compressing" "xz" ("-c" "-q") |
| 235 | "XZ uncompressing" "xz" ("-c" "-q" "-d") | 235 | "XZ uncompressing" "xz" ("-c" "-q" "-d") |
| 236 | t t "\3757zXZ\0"] | 236 | t t "\3757zXZ\0"] |
| 237 | ["\\.txz\\'" | ||
| 238 | "XZ compressing" "xz" ("-c" "-q") | ||
| 239 | "XZ uncompressing" "xz" ("-c" "-q" "-d") | ||
| 240 | t nil "\3757zXZ\0"] | ||
| 237 | ;; dzip is gzip with random access. Its compression program can't | 241 | ;; dzip is gzip with random access. Its compression program can't |
| 238 | ;; read/write stdin/out, so .dz files can only be viewed without | 242 | ;; read/write stdin/out, so .dz files can only be viewed without |
| 239 | ;; saving, having their contents decompressed with gzip. | 243 | ;; saving, having their contents decompressed with gzip. |
| @@ -302,7 +306,9 @@ variables. Setting this through Custom does that automatically." | |||
| 302 | :group 'jka-compr) | 306 | :group 'jka-compr) |
| 303 | 307 | ||
| 304 | (defcustom jka-compr-mode-alist-additions | 308 | (defcustom jka-compr-mode-alist-additions |
| 305 | (list (cons (purecopy "\\.tgz\\'") 'tar-mode) (cons (purecopy "\\.tbz2?\\'") 'tar-mode)) | 309 | (purecopy '(("\\.tgz\\'" . tar-mode) |
| 310 | ("\\.tbz2?\\'" . tar-mode) | ||
| 311 | ("\\.txz\\'" . 'tar-mode))) | ||
| 306 | "List of pairs added to `auto-mode-alist' when installing jka-compr. | 312 | "List of pairs added to `auto-mode-alist' when installing jka-compr. |
| 307 | Uninstalling jka-compr removes all pairs from `auto-mode-alist' that | 313 | Uninstalling jka-compr removes all pairs from `auto-mode-alist' that |
| 308 | installing added. | 314 | installing added. |
| @@ -315,7 +321,7 @@ variables. Setting this through Custom does that automatically." | |||
| 315 | :set 'jka-compr-set | 321 | :set 'jka-compr-set |
| 316 | :group 'jka-compr) | 322 | :group 'jka-compr) |
| 317 | 323 | ||
| 318 | (defcustom jka-compr-load-suffixes (list (purecopy ".gz")) | 324 | (defcustom jka-compr-load-suffixes (purecopy '(".gz")) |
| 319 | "List of compression related suffixes to try when loading files. | 325 | "List of compression related suffixes to try when loading files. |
| 320 | Enabling Auto Compression mode appends this list to `load-file-rep-suffixes', | 326 | Enabling Auto Compression mode appends this list to `load-file-rep-suffixes', |
| 321 | which see. Disabling Auto Compression mode removes all suffixes | 327 | which see. Disabling Auto Compression mode removes all suffixes |
diff --git a/lisp/outline.el b/lisp/outline.el index 24f25fd2fb7..0ec5227a286 100644 --- a/lisp/outline.el +++ b/lisp/outline.el | |||
| @@ -43,25 +43,21 @@ | |||
| 43 | :prefix "outline-" | 43 | :prefix "outline-" |
| 44 | :group 'wp) | 44 | :group 'wp) |
| 45 | 45 | ||
| 46 | (defcustom outline-regexp "[*\^L]+" | 46 | (defvar outline-regexp "[*\^L]+" |
| 47 | "Regular expression to match the beginning of a heading. | 47 | "Regular expression to match the beginning of a heading. |
| 48 | Any line whose beginning matches this regexp is considered to start a heading. | 48 | Any line whose beginning matches this regexp is considered to start a heading. |
| 49 | Note that Outline mode only checks this regexp at the start of a line, | 49 | Note that Outline mode only checks this regexp at the start of a line, |
| 50 | so the regexp need not (and usually does not) start with `^'. | 50 | so the regexp need not (and usually does not) start with `^'. |
| 51 | The recommended way to set this is with a Local Variables: list | 51 | The recommended way to set this is with a Local Variables: list |
| 52 | in the file it applies to. See also `outline-heading-end-regexp'." | 52 | in the file it applies to. See also `outline-heading-end-regexp'.") |
| 53 | :type 'regexp | ||
| 54 | :group 'outlines) | ||
| 55 | ;;;###autoload(put 'outline-regexp 'safe-local-variable 'stringp) | 53 | ;;;###autoload(put 'outline-regexp 'safe-local-variable 'stringp) |
| 56 | 54 | ||
| 57 | (defcustom outline-heading-end-regexp "\n" | 55 | (defvar outline-heading-end-regexp "\n" |
| 58 | "Regular expression to match the end of a heading line. | 56 | "Regular expression to match the end of a heading line. |
| 59 | You can assume that point is at the beginning of a heading when this | 57 | You can assume that point is at the beginning of a heading when this |
| 60 | regexp is searched for. The heading ends at the end of the match. | 58 | regexp is searched for. The heading ends at the end of the match. |
| 61 | The recommended way to set this is with a `Local Variables:' list | 59 | The recommended way to set this is with a `Local Variables:' list |
| 62 | in the file it applies to." | 60 | in the file it applies to.") |
| 63 | :type 'regexp | ||
| 64 | :group 'outlines) | ||
| 65 | ;;;###autoload(put 'outline-heading-end-regexp 'safe-local-variable 'stringp) | 61 | ;;;###autoload(put 'outline-heading-end-regexp 'safe-local-variable 'stringp) |
| 66 | 62 | ||
| 67 | (defvar outline-mode-prefix-map | 63 | (defvar outline-mode-prefix-map |
diff --git a/lisp/simple.el b/lisp/simple.el index 138c2420309..3ef700a6058 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1400,6 +1400,8 @@ to get different commands to edit and resubmit." | |||
| 1400 | (error "Argument %d is beyond length of command history" arg) | 1400 | (error "Argument %d is beyond length of command history" arg) |
| 1401 | (error "There are no previous complex commands to repeat"))))) | 1401 | (error "There are no previous complex commands to repeat"))))) |
| 1402 | 1402 | ||
| 1403 | (defvar extended-command-history nil) | ||
| 1404 | |||
| 1403 | (defun read-extended-command () | 1405 | (defun read-extended-command () |
| 1404 | "Read command name to invoke in `execute-extended-command'." | 1406 | "Read command name to invoke in `execute-extended-command'." |
| 1405 | (minibuffer-with-setup-hook | 1407 | (minibuffer-with-setup-hook |
| @@ -1489,6 +1491,53 @@ give to the command you invoke, if it asks for an argument." | |||
| 1489 | (sit-for (if (numberp suggest-key-bindings) | 1491 | (sit-for (if (numberp suggest-key-bindings) |
| 1490 | suggest-key-bindings | 1492 | suggest-key-bindings |
| 1491 | 2)))))))) | 1493 | 2)))))))) |
| 1494 | |||
| 1495 | (defun command-execute (cmd &optional record-flag keys special) | ||
| 1496 | ;; BEWARE: Called directly from the C code. | ||
| 1497 | "Execute CMD as an editor command. | ||
| 1498 | CMD must be a symbol that satisfies the `commandp' predicate. | ||
| 1499 | Optional second arg RECORD-FLAG non-nil | ||
| 1500 | means unconditionally put this command in the variable `command-history'. | ||
| 1501 | Otherwise, that is done only if an arg is read using the minibuffer. | ||
| 1502 | The argument KEYS specifies the value to use instead of (this-command-keys) | ||
| 1503 | when reading the arguments; if it is nil, (this-command-keys) is used. | ||
| 1504 | The argument SPECIAL, if non-nil, means that this command is executing | ||
| 1505 | a special event, so ignore the prefix argument and don't clear it." | ||
| 1506 | (setq debug-on-next-call nil) | ||
| 1507 | (let ((prefixarg (unless special | ||
| 1508 | (prog1 prefix-arg | ||
| 1509 | (setq current-prefix-arg prefix-arg) | ||
| 1510 | (setq prefix-arg nil))))) | ||
| 1511 | (and (symbolp cmd) | ||
| 1512 | (get cmd 'disabled) | ||
| 1513 | ;; FIXME: Weird calling convention! | ||
| 1514 | (run-hooks 'disabled-command-function)) | ||
| 1515 | (let ((final cmd)) | ||
| 1516 | (while | ||
| 1517 | (progn | ||
| 1518 | (setq final (indirect-function final)) | ||
| 1519 | (if (autoloadp final) | ||
| 1520 | (setq final (autoload-do-load final cmd))))) | ||
| 1521 | (cond | ||
| 1522 | ((arrayp final) | ||
| 1523 | ;; If requested, place the macro in the command history. For | ||
| 1524 | ;; other sorts of commands, call-interactively takes care of this. | ||
| 1525 | (when record-flag | ||
| 1526 | (push `(execute-kbd-macro ,final ,prefixarg) command-history) | ||
| 1527 | ;; Don't keep command history around forever. | ||
| 1528 | (when (and (numberp history-length) (> history-length 0)) | ||
| 1529 | (let ((cell (nthcdr history-length command-history))) | ||
| 1530 | (if (consp cell) (setcdr cell nil))))) | ||
| 1531 | (execute-kbd-macro final prefixarg)) | ||
| 1532 | (t | ||
| 1533 | ;; Pass `cmd' rather than `final', for the backtrace's sake. | ||
| 1534 | (prog1 (call-interactively cmd record-flag keys) | ||
| 1535 | (when (and (symbolp cmd) | ||
| 1536 | (get cmd 'byte-obsolete-info) | ||
| 1537 | (not (get cmd 'command-execute-obsolete-warned))) | ||
| 1538 | (put cmd 'command-execute-obsolete-warned t) | ||
| 1539 | (message "%s" (macroexp--obsolete-warning | ||
| 1540 | cmd (get cmd 'byte-obsolete-info) "command"))))))))) | ||
| 1492 | 1541 | ||
| 1493 | (defvar minibuffer-history nil | 1542 | (defvar minibuffer-history nil |
| 1494 | "Default minibuffer history list. | 1543 | "Default minibuffer history list. |
diff --git a/src/ChangeLog b/src/ChangeLog index ff059cf1a3c..d39336f11e6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,32 @@ | |||
| 1 | 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * sheap.c (report_sheap_usage): Prefer message1_nolog. | ||
| 4 | |||
| 5 | * keyboard.c (Qcommand_execute): New var. | ||
| 6 | (command_loop_1, read_char): Use it. | ||
| 7 | (Fcommand_execute): Remove, replace by an Elisp implementation. | ||
| 8 | (syms_of_keyboard): Adjust accordingly. | ||
| 9 | |||
| 10 | 2013-02-19 Daniel Colascione <dancol@dancol.org> | ||
| 11 | |||
| 12 | * sheap.c (report_sheap_usage): Use message, not message1, so | ||
| 13 | that we don't try to create a buffer while we're in the middle | ||
| 14 | of dumping Emacs. Explain why. | ||
| 15 | |||
| 16 | 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 17 | * search.c (find_newline): Return byte position in bytepos. | ||
| 18 | Adjust comment. | ||
| 19 | (find_next_newline_no_quit, find_before_next_newline): | ||
| 20 | Add bytepos argument. | ||
| 21 | * lisp.h (find_newline, find_next_newline_no_quit) | ||
| 22 | (find_before_next_newline): Adjust prototypes. | ||
| 23 | * bidi.c (bidi_find_paragraph_start): | ||
| 24 | * editfns.c (Fconstrain_to_field, Fline_end_position): | ||
| 25 | * indent.c (compute_motion, vmotion): | ||
| 26 | * xdisp.c (back_to_previous_line_start, forward_to_next_line_start): | ||
| 27 | (get_visually_first_element, move_it_vertically_backward): | ||
| 28 | Adjust users and avoid calls to CHAR_TO_BYTE where appropriate. | ||
| 29 | |||
| 1 | 2013-02-19 Eli Zaretskii <eliz@gnu.org> | 30 | 2013-02-19 Eli Zaretskii <eliz@gnu.org> |
| 2 | 31 | ||
| 3 | * w32proc.c (new_child): Avoid leaking handles if the subprocess | 32 | * w32proc.c (new_child): Avoid leaking handles if the subprocess |
diff --git a/src/bidi.c b/src/bidi.c index db2e48a2ca7..364d7e500ba 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -1104,14 +1104,11 @@ bidi_find_paragraph_start (ptrdiff_t pos, ptrdiff_t pos_byte) | |||
| 1104 | while (pos_byte > BEGV_BYTE | 1104 | while (pos_byte > BEGV_BYTE |
| 1105 | && n++ < MAX_PARAGRAPH_SEARCH | 1105 | && n++ < MAX_PARAGRAPH_SEARCH |
| 1106 | && fast_looking_at (re, pos, pos_byte, limit, limit_byte, Qnil) < 0) | 1106 | && fast_looking_at (re, pos, pos_byte, limit, limit_byte, Qnil) < 0) |
| 1107 | { | 1107 | /* FIXME: What if the paragraph beginning is covered by a |
| 1108 | /* FIXME: What if the paragraph beginning is covered by a | 1108 | display string? And what if a display string covering some |
| 1109 | display string? And what if a display string covering some | 1109 | of the text over which we scan back includes |
| 1110 | of the text over which we scan back includes | 1110 | paragraph_start_re? */ |
| 1111 | paragraph_start_re? */ | 1111 | pos = find_next_newline_no_quit (pos - 1, -1, &pos_byte); |
| 1112 | pos = find_next_newline_no_quit (pos - 1, -1); | ||
| 1113 | pos_byte = CHAR_TO_BYTE (pos); | ||
| 1114 | } | ||
| 1115 | if (n >= MAX_PARAGRAPH_SEARCH) | 1112 | if (n >= MAX_PARAGRAPH_SEARCH) |
| 1116 | pos_byte = BEGV_BYTE; | 1113 | pos_byte = BEGV_BYTE; |
| 1117 | return pos_byte; | 1114 | return pos_byte; |
diff --git a/src/editfns.c b/src/editfns.c index bee0bcc158d..831c8359fab 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -736,7 +736,7 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */) | |||
| 736 | FIELD_BOUND are on the same line by seeing whether | 736 | FIELD_BOUND are on the same line by seeing whether |
| 737 | there's an intervening newline or not. */ | 737 | there's an intervening newline or not. */ |
| 738 | || (find_newline (XFASTINT (new_pos), XFASTINT (field_bound), | 738 | || (find_newline (XFASTINT (new_pos), XFASTINT (field_bound), |
| 739 | fwd ? -1 : 1, &shortage, 1), | 739 | fwd ? -1 : 1, &shortage, NULL, 1), |
| 740 | shortage != 0))) | 740 | shortage != 0))) |
| 741 | /* Constrain NEW_POS to FIELD_BOUND. */ | 741 | /* Constrain NEW_POS to FIELD_BOUND. */ |
| 742 | new_pos = field_bound; | 742 | new_pos = field_bound; |
| @@ -821,7 +821,8 @@ This function does not move point. */) | |||
| 821 | CHECK_NUMBER (n); | 821 | CHECK_NUMBER (n); |
| 822 | 822 | ||
| 823 | clipped_n = clip_to_bounds (PTRDIFF_MIN + 1, XINT (n), PTRDIFF_MAX); | 823 | clipped_n = clip_to_bounds (PTRDIFF_MIN + 1, XINT (n), PTRDIFF_MAX); |
| 824 | end_pos = find_before_next_newline (orig, 0, clipped_n - (clipped_n <= 0)); | 824 | end_pos = find_before_next_newline (orig, 0, clipped_n - (clipped_n <= 0), |
| 825 | NULL); | ||
| 825 | 826 | ||
| 826 | /* Return END_POS constrained to the current input field. */ | 827 | /* Return END_POS constrained to the current input field. */ |
| 827 | return Fconstrain_to_field (make_number (end_pos), make_number (orig), | 828 | return Fconstrain_to_field (make_number (end_pos), make_number (orig), |
diff --git a/src/indent.c b/src/indent.c index ce1639eae1e..9bf75bc6d95 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -1328,8 +1328,7 @@ compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos, | |||
| 1328 | TO (we need to go back below). */ | 1328 | TO (we need to go back below). */ |
| 1329 | if (pos <= to) | 1329 | if (pos <= to) |
| 1330 | { | 1330 | { |
| 1331 | pos = find_before_next_newline (pos, to, 1); | 1331 | pos = find_before_next_newline (pos, to, 1, &pos_byte); |
| 1332 | pos_byte = CHAR_TO_BYTE (pos); | ||
| 1333 | hpos = width; | 1332 | hpos = width; |
| 1334 | /* If we just skipped next_boundary, | 1333 | /* If we just skipped next_boundary, |
| 1335 | loop around in the main while | 1334 | loop around in the main while |
| @@ -1583,10 +1582,9 @@ compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos, | |||
| 1583 | /* Skip any number of invisible lines all at once */ | 1582 | /* Skip any number of invisible lines all at once */ |
| 1584 | do | 1583 | do |
| 1585 | { | 1584 | { |
| 1586 | pos = find_before_next_newline (pos, to, 1); | 1585 | pos = find_before_next_newline (pos, to, 1, &pos_byte); |
| 1587 | if (pos < to) | 1586 | if (pos < to) |
| 1588 | pos++; | 1587 | INC_BOTH (pos, pos_byte); |
| 1589 | pos_byte = CHAR_TO_BYTE (pos); | ||
| 1590 | } | 1588 | } |
| 1591 | while (pos < to | 1589 | while (pos < to |
| 1592 | && indented_beyond_p (pos, pos_byte, | 1590 | && indented_beyond_p (pos, pos_byte, |
| @@ -1622,10 +1620,7 @@ compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos, | |||
| 1622 | everything from a ^M to the end of the line is invisible. | 1620 | everything from a ^M to the end of the line is invisible. |
| 1623 | Stop *before* the real newline. */ | 1621 | Stop *before* the real newline. */ |
| 1624 | if (pos < to) | 1622 | if (pos < to) |
| 1625 | { | 1623 | pos = find_before_next_newline (pos, to, 1, &pos_byte); |
| 1626 | pos = find_before_next_newline (pos, to, 1); | ||
| 1627 | pos_byte = CHAR_TO_BYTE (pos); | ||
| 1628 | } | ||
| 1629 | /* If we just skipped next_boundary, | 1624 | /* If we just skipped next_boundary, |
| 1630 | loop around in the main while | 1625 | loop around in the main while |
| 1631 | and handle it. */ | 1626 | and handle it. */ |
| @@ -1845,21 +1840,20 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w) | |||
| 1845 | 1840 | ||
| 1846 | while ((vpos > vtarget || first) && from > BEGV) | 1841 | while ((vpos > vtarget || first) && from > BEGV) |
| 1847 | { | 1842 | { |
| 1843 | ptrdiff_t bytepos; | ||
| 1848 | Lisp_Object propval; | 1844 | Lisp_Object propval; |
| 1849 | 1845 | ||
| 1850 | prevline = find_next_newline_no_quit (from - 1, -1); | 1846 | prevline = find_next_newline_no_quit (from - 1, -1, &bytepos); |
| 1851 | while (prevline > BEGV | 1847 | while (prevline > BEGV |
| 1852 | && ((selective > 0 | 1848 | && ((selective > 0 |
| 1853 | && indented_beyond_p (prevline, | 1849 | && indented_beyond_p (prevline, bytepos, selective)) |
| 1854 | CHAR_TO_BYTE (prevline), | ||
| 1855 | selective)) | ||
| 1856 | /* Watch out for newlines with `invisible' property. | 1850 | /* Watch out for newlines with `invisible' property. |
| 1857 | When moving upward, check the newline before. */ | 1851 | When moving upward, check the newline before. */ |
| 1858 | || (propval = Fget_char_property (make_number (prevline - 1), | 1852 | || (propval = Fget_char_property (make_number (prevline - 1), |
| 1859 | Qinvisible, | 1853 | Qinvisible, |
| 1860 | text_prop_object), | 1854 | text_prop_object), |
| 1861 | TEXT_PROP_MEANS_INVISIBLE (propval)))) | 1855 | TEXT_PROP_MEANS_INVISIBLE (propval)))) |
| 1862 | prevline = find_next_newline_no_quit (prevline - 1, -1); | 1856 | prevline = find_next_newline_no_quit (prevline - 1, -1, &bytepos); |
| 1863 | pos = *compute_motion (prevline, 0, | 1857 | pos = *compute_motion (prevline, 0, |
| 1864 | lmargin, | 1858 | lmargin, |
| 1865 | 0, | 1859 | 0, |
| @@ -1897,21 +1891,20 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w) | |||
| 1897 | from_byte = CHAR_TO_BYTE (from); | 1891 | from_byte = CHAR_TO_BYTE (from); |
| 1898 | if (from > BEGV && FETCH_BYTE (from_byte - 1) != '\n') | 1892 | if (from > BEGV && FETCH_BYTE (from_byte - 1) != '\n') |
| 1899 | { | 1893 | { |
| 1894 | ptrdiff_t bytepos; | ||
| 1900 | Lisp_Object propval; | 1895 | Lisp_Object propval; |
| 1901 | 1896 | ||
| 1902 | prevline = find_next_newline_no_quit (from, -1); | 1897 | prevline = find_next_newline_no_quit (from, -1, &bytepos); |
| 1903 | while (prevline > BEGV | 1898 | while (prevline > BEGV |
| 1904 | && ((selective > 0 | 1899 | && ((selective > 0 |
| 1905 | && indented_beyond_p (prevline, | 1900 | && indented_beyond_p (prevline, bytepos, selective)) |
| 1906 | CHAR_TO_BYTE (prevline), | ||
| 1907 | selective)) | ||
| 1908 | /* Watch out for newlines with `invisible' property. | 1901 | /* Watch out for newlines with `invisible' property. |
| 1909 | When moving downward, check the newline after. */ | 1902 | When moving downward, check the newline after. */ |
| 1910 | || (propval = Fget_char_property (make_number (prevline), | 1903 | || (propval = Fget_char_property (make_number (prevline), |
| 1911 | Qinvisible, | 1904 | Qinvisible, |
| 1912 | text_prop_object), | 1905 | text_prop_object), |
| 1913 | TEXT_PROP_MEANS_INVISIBLE (propval)))) | 1906 | TEXT_PROP_MEANS_INVISIBLE (propval)))) |
| 1914 | prevline = find_next_newline_no_quit (prevline - 1, -1); | 1907 | prevline = find_next_newline_no_quit (prevline - 1, -1, &bytepos); |
| 1915 | pos = *compute_motion (prevline, 0, | 1908 | pos = *compute_motion (prevline, 0, |
| 1916 | lmargin, | 1909 | lmargin, |
| 1917 | 0, | 1910 | 0, |
diff --git a/src/keyboard.c b/src/keyboard.c index 3c00e017498..38136b57b4b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -370,7 +370,7 @@ Lisp_Object Qmenu_bar; | |||
| 370 | 370 | ||
| 371 | static Lisp_Object recursive_edit_unwind (Lisp_Object buffer); | 371 | static Lisp_Object recursive_edit_unwind (Lisp_Object buffer); |
| 372 | static Lisp_Object command_loop (void); | 372 | static Lisp_Object command_loop (void); |
| 373 | static Lisp_Object Qextended_command_history; | 373 | static Lisp_Object Qcommand_execute; |
| 374 | EMACS_TIME timer_check (void); | 374 | EMACS_TIME timer_check (void); |
| 375 | 375 | ||
| 376 | static void echo_now (void); | 376 | static void echo_now (void); |
| @@ -1586,11 +1586,11 @@ command_loop_1 (void) | |||
| 1586 | = (EQ (undo, BVAR (current_buffer, undo_list)) | 1586 | = (EQ (undo, BVAR (current_buffer, undo_list)) |
| 1587 | ? Qnil : BVAR (current_buffer, undo_list)); | 1587 | ? Qnil : BVAR (current_buffer, undo_list)); |
| 1588 | } | 1588 | } |
| 1589 | Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil); | 1589 | call1 (Qcommand_execute, Vthis_command); |
| 1590 | 1590 | ||
| 1591 | #ifdef HAVE_WINDOW_SYSTEM | 1591 | #ifdef HAVE_WINDOW_SYSTEM |
| 1592 | /* Do not check display_hourglass_p here, because | 1592 | /* Do not check display_hourglass_p here, because |
| 1593 | Fcommand_execute could change it, but we should cancel | 1593 | `command-execute' could change it, but we should cancel |
| 1594 | hourglass cursor anyway. | 1594 | hourglass cursor anyway. |
| 1595 | But don't cancel the hourglass within a macro | 1595 | But don't cancel the hourglass within a macro |
| 1596 | just because a command in the macro finishes. */ | 1596 | just because a command in the macro finishes. */ |
| @@ -2845,7 +2845,7 @@ read_char (int commandflag, Lisp_Object map, | |||
| 2845 | { | 2845 | { |
| 2846 | struct buffer *prev_buffer = current_buffer; | 2846 | struct buffer *prev_buffer = current_buffer; |
| 2847 | last_input_event = c; | 2847 | last_input_event = c; |
| 2848 | Fcommand_execute (tem, Qnil, Fvector (1, &last_input_event), Qt); | 2848 | call4 (Qcommand_execute, tem, Qnil, Fvector (1, &last_input_event), Qt); |
| 2849 | 2849 | ||
| 2850 | if (CONSP (c) && EQ (XCAR (c), Qselect_window) && !end_time) | 2850 | if (CONSP (c) && EQ (XCAR (c), Qselect_window) && !end_time) |
| 2851 | /* We stopped being idle for this event; undo that. This | 2851 | /* We stopped being idle for this event; undo that. This |
| @@ -9895,95 +9895,6 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector, | |||
| 9895 | return unbind_to (count, Fvector (i, keybuf)); | 9895 | return unbind_to (count, Fvector (i, keybuf)); |
| 9896 | } | 9896 | } |
| 9897 | 9897 | ||
| 9898 | DEFUN ("command-execute", Fcommand_execute, Scommand_execute, 1, 4, 0, | ||
| 9899 | doc: /* Execute CMD as an editor command. | ||
| 9900 | CMD must be a symbol that satisfies the `commandp' predicate. | ||
| 9901 | Optional second arg RECORD-FLAG non-nil | ||
| 9902 | means unconditionally put this command in the variable `command-history'. | ||
| 9903 | Otherwise, that is done only if an arg is read using the minibuffer. | ||
| 9904 | The argument KEYS specifies the value to use instead of (this-command-keys) | ||
| 9905 | when reading the arguments; if it is nil, (this-command-keys) is used. | ||
| 9906 | The argument SPECIAL, if non-nil, means that this command is executing | ||
| 9907 | a special event, so ignore the prefix argument and don't clear it. */) | ||
| 9908 | (Lisp_Object cmd, Lisp_Object record_flag, Lisp_Object keys, Lisp_Object special) | ||
| 9909 | { | ||
| 9910 | register Lisp_Object final; | ||
| 9911 | register Lisp_Object tem; | ||
| 9912 | Lisp_Object prefixarg; | ||
| 9913 | |||
| 9914 | debug_on_next_call = 0; | ||
| 9915 | |||
| 9916 | if (NILP (special)) | ||
| 9917 | { | ||
| 9918 | prefixarg = KVAR (current_kboard, Vprefix_arg); | ||
| 9919 | Vcurrent_prefix_arg = prefixarg; | ||
| 9920 | kset_prefix_arg (current_kboard, Qnil); | ||
| 9921 | } | ||
| 9922 | else | ||
| 9923 | prefixarg = Qnil; | ||
| 9924 | |||
| 9925 | if (SYMBOLP (cmd)) | ||
| 9926 | { | ||
| 9927 | tem = Fget (cmd, Qdisabled); | ||
| 9928 | if (!NILP (tem)) | ||
| 9929 | { | ||
| 9930 | tem = Fsymbol_value (Qdisabled_command_function); | ||
| 9931 | if (!NILP (tem)) | ||
| 9932 | return Frun_hooks (1, &Qdisabled_command_function); | ||
| 9933 | } | ||
| 9934 | } | ||
| 9935 | |||
| 9936 | while (1) | ||
| 9937 | { | ||
| 9938 | final = Findirect_function (cmd, Qnil); | ||
| 9939 | |||
| 9940 | if (CONSP (final) && (tem = Fcar (final), EQ (tem, Qautoload))) | ||
| 9941 | { | ||
| 9942 | struct gcpro gcpro1, gcpro2; | ||
| 9943 | |||
| 9944 | GCPRO2 (cmd, prefixarg); | ||
| 9945 | Fautoload_do_load (final, cmd, Qnil); | ||
| 9946 | UNGCPRO; | ||
| 9947 | } | ||
| 9948 | else | ||
| 9949 | break; | ||
| 9950 | } | ||
| 9951 | |||
| 9952 | if (STRINGP (final) || VECTORP (final)) | ||
| 9953 | { | ||
| 9954 | /* If requested, place the macro in the command history. For | ||
| 9955 | other sorts of commands, call-interactively takes care of | ||
| 9956 | this. */ | ||
| 9957 | if (!NILP (record_flag)) | ||
| 9958 | { | ||
| 9959 | Vcommand_history | ||
| 9960 | = Fcons (Fcons (Qexecute_kbd_macro, | ||
| 9961 | Fcons (final, Fcons (prefixarg, Qnil))), | ||
| 9962 | Vcommand_history); | ||
| 9963 | |||
| 9964 | /* Don't keep command history around forever. */ | ||
| 9965 | if (NUMBERP (Vhistory_length) && XINT (Vhistory_length) > 0) | ||
| 9966 | { | ||
| 9967 | tem = Fnthcdr (Vhistory_length, Vcommand_history); | ||
| 9968 | if (CONSP (tem)) | ||
| 9969 | XSETCDR (tem, Qnil); | ||
| 9970 | } | ||
| 9971 | } | ||
| 9972 | |||
| 9973 | return Fexecute_kbd_macro (final, prefixarg, Qnil); | ||
| 9974 | } | ||
| 9975 | |||
| 9976 | if (CONSP (final) || SUBRP (final) || COMPILEDP (final)) | ||
| 9977 | /* Don't call Fcall_interactively directly because we want to make | ||
| 9978 | sure the backtrace has an entry for `call-interactively'. | ||
| 9979 | For the same reason, pass `cmd' rather than `final'. */ | ||
| 9980 | return call3 (Qcall_interactively, cmd, record_flag, keys); | ||
| 9981 | |||
| 9982 | return Qnil; | ||
| 9983 | } | ||
| 9984 | |||
| 9985 | |||
| 9986 | |||
| 9987 | /* Return true if input events are pending. */ | 9898 | /* Return true if input events are pending. */ |
| 9988 | 9899 | ||
| 9989 | bool | 9900 | bool |
| @@ -11218,8 +11129,7 @@ syms_of_keyboard (void) | |||
| 11218 | raw_keybuf = Fmake_vector (make_number (30), Qnil); | 11129 | raw_keybuf = Fmake_vector (make_number (30), Qnil); |
| 11219 | staticpro (&raw_keybuf); | 11130 | staticpro (&raw_keybuf); |
| 11220 | 11131 | ||
| 11221 | DEFSYM (Qextended_command_history, "extended-command-history"); | 11132 | DEFSYM (Qcommand_execute, "command-execute"); |
| 11222 | Fset (Qextended_command_history, Qnil); | ||
| 11223 | 11133 | ||
| 11224 | accent_key_syms = Qnil; | 11134 | accent_key_syms = Qnil; |
| 11225 | staticpro (&accent_key_syms); | 11135 | staticpro (&accent_key_syms); |
| @@ -11258,7 +11168,6 @@ syms_of_keyboard (void) | |||
| 11258 | defsubr (&Srecursive_edit); | 11168 | defsubr (&Srecursive_edit); |
| 11259 | defsubr (&Strack_mouse); | 11169 | defsubr (&Strack_mouse); |
| 11260 | defsubr (&Sinput_pending_p); | 11170 | defsubr (&Sinput_pending_p); |
| 11261 | defsubr (&Scommand_execute); | ||
| 11262 | defsubr (&Srecent_keys); | 11171 | defsubr (&Srecent_keys); |
| 11263 | defsubr (&Sthis_command_keys); | 11172 | defsubr (&Sthis_command_keys); |
| 11264 | defsubr (&Sthis_command_keys_vector); | 11173 | defsubr (&Sthis_command_keys_vector); |
diff --git a/src/lisp.h b/src/lisp.h index e7a86892908..7b36878c0c5 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3348,12 +3348,13 @@ extern ptrdiff_t fast_string_match_ignore_case (Lisp_Object, Lisp_Object); | |||
| 3348 | extern ptrdiff_t fast_looking_at (Lisp_Object, ptrdiff_t, ptrdiff_t, | 3348 | extern ptrdiff_t fast_looking_at (Lisp_Object, ptrdiff_t, ptrdiff_t, |
| 3349 | ptrdiff_t, ptrdiff_t, Lisp_Object); | 3349 | ptrdiff_t, ptrdiff_t, Lisp_Object); |
| 3350 | extern ptrdiff_t find_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, | 3350 | extern ptrdiff_t find_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, |
| 3351 | ptrdiff_t *, bool); | 3351 | ptrdiff_t *, ptrdiff_t *, bool); |
| 3352 | extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, | 3352 | extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, |
| 3353 | EMACS_INT, bool); | 3353 | EMACS_INT, bool); |
| 3354 | extern ptrdiff_t find_next_newline (ptrdiff_t, int); | 3354 | extern ptrdiff_t find_next_newline (ptrdiff_t, int); |
| 3355 | extern ptrdiff_t find_next_newline_no_quit (ptrdiff_t, ptrdiff_t); | 3355 | extern ptrdiff_t find_next_newline_no_quit (ptrdiff_t, ptrdiff_t, ptrdiff_t *); |
| 3356 | extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t); | 3356 | extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t, |
| 3357 | ptrdiff_t, ptrdiff_t *); | ||
| 3357 | extern void syms_of_search (void); | 3358 | extern void syms_of_search (void); |
| 3358 | extern void clear_regexp_cache (void); | 3359 | extern void clear_regexp_cache (void); |
| 3359 | 3360 | ||
diff --git a/src/search.c b/src/search.c index d4508004bf6..1c0f57487f9 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -638,15 +638,18 @@ newline_cache_on_off (struct buffer *buf) | |||
| 638 | If we don't find COUNT instances before reaching END, set *SHORTAGE | 638 | If we don't find COUNT instances before reaching END, set *SHORTAGE |
| 639 | to the number of newlines left unfound, and return END. | 639 | to the number of newlines left unfound, and return END. |
| 640 | 640 | ||
| 641 | If BYTEPOS is not NULL, set *BYTEPOS to the byte position corresponding | ||
| 642 | to the returned character position. | ||
| 643 | |||
| 641 | If ALLOW_QUIT, set immediate_quit. That's good to do | 644 | If ALLOW_QUIT, set immediate_quit. That's good to do |
| 642 | except when inside redisplay. */ | 645 | except when inside redisplay. */ |
| 643 | 646 | ||
| 644 | ptrdiff_t | 647 | ptrdiff_t |
| 645 | find_newline (ptrdiff_t start, ptrdiff_t end, | 648 | find_newline (ptrdiff_t start, ptrdiff_t end, ptrdiff_t count, |
| 646 | ptrdiff_t count, ptrdiff_t *shortage, bool allow_quit) | 649 | ptrdiff_t *shortage, ptrdiff_t *bytepos, bool allow_quit) |
| 647 | { | 650 | { |
| 648 | struct region_cache *newline_cache; | 651 | struct region_cache *newline_cache; |
| 649 | ptrdiff_t end_byte = -1; | 652 | ptrdiff_t start_byte = -1, end_byte = -1; |
| 650 | int direction; | 653 | int direction; |
| 651 | 654 | ||
| 652 | if (count > 0) | 655 | if (count > 0) |
| @@ -680,9 +683,7 @@ find_newline (ptrdiff_t start, ptrdiff_t end, | |||
| 680 | the position of the last character before the next such | 683 | the position of the last character before the next such |
| 681 | obstacle --- the last character the dumb search loop should | 684 | obstacle --- the last character the dumb search loop should |
| 682 | examine. */ | 685 | examine. */ |
| 683 | ptrdiff_t ceiling_byte = end_byte - 1; | 686 | ptrdiff_t tem, ceiling_byte = end_byte - 1; |
| 684 | ptrdiff_t start_byte; | ||
| 685 | ptrdiff_t tem; | ||
| 686 | 687 | ||
| 687 | /* If we're looking for a newline, consult the newline cache | 688 | /* If we're looking for a newline, consult the newline cache |
| 688 | to see where we can avoid some scanning. */ | 689 | to see where we can avoid some scanning. */ |
| @@ -745,21 +746,22 @@ find_newline (ptrdiff_t start, ptrdiff_t end, | |||
| 745 | if (--count == 0) | 746 | if (--count == 0) |
| 746 | { | 747 | { |
| 747 | immediate_quit = 0; | 748 | immediate_quit = 0; |
| 749 | if (bytepos) | ||
| 750 | *bytepos = nl + 1 - base + start_byte; | ||
| 748 | return BYTE_TO_CHAR (nl + 1 - base + start_byte); | 751 | return BYTE_TO_CHAR (nl + 1 - base + start_byte); |
| 749 | } | 752 | } |
| 750 | cursor = nl + 1; | 753 | cursor = nl + 1; |
| 751 | } | 754 | } |
| 752 | 755 | ||
| 753 | start = BYTE_TO_CHAR (ceiling_addr - base + start_byte); | 756 | start_byte += ceiling_addr - base; |
| 757 | start = BYTE_TO_CHAR (start_byte); | ||
| 754 | } | 758 | } |
| 755 | } | 759 | } |
| 756 | else | 760 | else |
| 757 | while (start > end) | 761 | while (start > end) |
| 758 | { | 762 | { |
| 759 | /* The last character to check before the next obstacle. */ | 763 | /* The last character to check before the next obstacle. */ |
| 760 | ptrdiff_t ceiling_byte = end_byte; | 764 | ptrdiff_t tem, ceiling_byte = end_byte; |
| 761 | ptrdiff_t start_byte; | ||
| 762 | ptrdiff_t tem; | ||
| 763 | 765 | ||
| 764 | /* Consult the newline cache, if appropriate. */ | 766 | /* Consult the newline cache, if appropriate. */ |
| 765 | if (newline_cache) | 767 | if (newline_cache) |
| @@ -816,18 +818,26 @@ find_newline (ptrdiff_t start, ptrdiff_t end, | |||
| 816 | if (++count >= 0) | 818 | if (++count >= 0) |
| 817 | { | 819 | { |
| 818 | immediate_quit = 0; | 820 | immediate_quit = 0; |
| 821 | if (bytepos) | ||
| 822 | *bytepos = nl - base + start_byte; | ||
| 819 | return BYTE_TO_CHAR (nl - base + start_byte); | 823 | return BYTE_TO_CHAR (nl - base + start_byte); |
| 820 | } | 824 | } |
| 821 | cursor = nl - 1; | 825 | cursor = nl - 1; |
| 822 | } | 826 | } |
| 823 | 827 | ||
| 824 | start = BYTE_TO_CHAR (ceiling_addr - 1 - base + start_byte); | 828 | start_byte += ceiling_addr - 1 - base; |
| 829 | start = BYTE_TO_CHAR (start_byte); | ||
| 825 | } | 830 | } |
| 826 | } | 831 | } |
| 827 | 832 | ||
| 828 | immediate_quit = 0; | 833 | immediate_quit = 0; |
| 829 | if (shortage != 0) | 834 | if (shortage) |
| 830 | *shortage = count * direction; | 835 | *shortage = count * direction; |
| 836 | if (bytepos) | ||
| 837 | { | ||
| 838 | *bytepos = start_byte == -1 ? CHAR_TO_BYTE (start) : start_byte; | ||
| 839 | eassert (*bytepos == CHAR_TO_BYTE (start)); | ||
| 840 | } | ||
| 831 | return start; | 841 | return start; |
| 832 | } | 842 | } |
| 833 | 843 | ||
| @@ -932,9 +942,9 @@ scan_newline (ptrdiff_t start, ptrdiff_t start_byte, | |||
| 932 | } | 942 | } |
| 933 | 943 | ||
| 934 | ptrdiff_t | 944 | ptrdiff_t |
| 935 | find_next_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt) | 945 | find_next_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt, ptrdiff_t *bytepos) |
| 936 | { | 946 | { |
| 937 | return find_newline (from, 0, cnt, (ptrdiff_t *) 0, 0); | 947 | return find_newline (from, 0, cnt, NULL, bytepos, 0); |
| 938 | } | 948 | } |
| 939 | 949 | ||
| 940 | /* Like find_next_newline, but returns position before the newline, | 950 | /* Like find_next_newline, but returns position before the newline, |
| @@ -942,14 +952,19 @@ find_next_newline_no_quit (ptrdiff_t from, ptrdiff_t cnt) | |||
| 942 | find_next_newline (...)-1, because you might hit TO. */ | 952 | find_next_newline (...)-1, because you might hit TO. */ |
| 943 | 953 | ||
| 944 | ptrdiff_t | 954 | ptrdiff_t |
| 945 | find_before_next_newline (ptrdiff_t from, ptrdiff_t to, ptrdiff_t cnt) | 955 | find_before_next_newline (ptrdiff_t from, ptrdiff_t to, |
| 956 | ptrdiff_t cnt, ptrdiff_t *bytepos) | ||
| 946 | { | 957 | { |
| 947 | ptrdiff_t shortage; | 958 | ptrdiff_t shortage; |
| 948 | ptrdiff_t pos = find_newline (from, to, cnt, &shortage, 1); | 959 | ptrdiff_t pos = find_newline (from, to, cnt, &shortage, bytepos, 1); |
| 949 | 960 | ||
| 950 | if (shortage == 0) | 961 | if (shortage == 0) |
| 951 | pos--; | 962 | { |
| 952 | 963 | if (bytepos) | |
| 964 | DEC_BOTH (pos, *bytepos); | ||
| 965 | else | ||
| 966 | pos--; | ||
| 967 | } | ||
| 953 | return pos; | 968 | return pos; |
| 954 | } | 969 | } |
| 955 | 970 | ||
diff --git a/src/sheap.c b/src/sheap.c index 06e205bc0e5..28597ec9b65 100644 --- a/src/sheap.c +++ b/src/sheap.c | |||
| @@ -91,5 +91,7 @@ report_sheap_usage (int die_if_pure_storage_exceeded) | |||
| 91 | char buf[200]; | 91 | char buf[200]; |
| 92 | sprintf (buf, "Static heap usage: %d of %d bytes", | 92 | sprintf (buf, "Static heap usage: %d of %d bytes", |
| 93 | bss_sbrk_ptr - bss_sbrk_buffer, STATIC_HEAP_SIZE); | 93 | bss_sbrk_ptr - bss_sbrk_buffer, STATIC_HEAP_SIZE); |
| 94 | message1 (buf); | 94 | /* Don't log messages, cause at this point, we're not allowed to create |
| 95 | buffers. */ | ||
| 96 | message1_nolog ("%s", buf); | ||
| 95 | } | 97 | } |
diff --git a/src/xdisp.c b/src/xdisp.c index 9207355bc09..7a329c5421b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -5940,8 +5940,9 @@ pop_it (struct it *it) | |||
| 5940 | static void | 5940 | static void |
| 5941 | back_to_previous_line_start (struct it *it) | 5941 | back_to_previous_line_start (struct it *it) |
| 5942 | { | 5942 | { |
| 5943 | IT_CHARPOS (*it) = find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1); | 5943 | IT_CHARPOS (*it) |
| 5944 | IT_BYTEPOS (*it) = CHAR_TO_BYTE (IT_CHARPOS (*it)); | 5944 | = find_next_newline_no_quit (IT_CHARPOS (*it) - 1, |
| 5945 | -1, &IT_BYTEPOS (*it)); | ||
| 5945 | } | 5946 | } |
| 5946 | 5947 | ||
| 5947 | 5948 | ||
| @@ -6012,8 +6013,8 @@ forward_to_next_line_start (struct it *it, int *skipped_p, | |||
| 6012 | short-cut. */ | 6013 | short-cut. */ |
| 6013 | if (!newline_found_p) | 6014 | if (!newline_found_p) |
| 6014 | { | 6015 | { |
| 6015 | ptrdiff_t start = IT_CHARPOS (*it); | 6016 | ptrdiff_t bytepos, start = IT_CHARPOS (*it); |
| 6016 | ptrdiff_t limit = find_next_newline_no_quit (start, 1); | 6017 | ptrdiff_t limit = find_next_newline_no_quit (start, 1, &bytepos); |
| 6017 | Lisp_Object pos; | 6018 | Lisp_Object pos; |
| 6018 | 6019 | ||
| 6019 | eassert (!STRINGP (it->string)); | 6020 | eassert (!STRINGP (it->string)); |
| @@ -6031,7 +6032,7 @@ forward_to_next_line_start (struct it *it, int *skipped_p, | |||
| 6031 | if (!it->bidi_p) | 6032 | if (!it->bidi_p) |
| 6032 | { | 6033 | { |
| 6033 | IT_CHARPOS (*it) = limit; | 6034 | IT_CHARPOS (*it) = limit; |
| 6034 | IT_BYTEPOS (*it) = CHAR_TO_BYTE (limit); | 6035 | IT_BYTEPOS (*it) = bytepos; |
| 6035 | } | 6036 | } |
| 6036 | else | 6037 | else |
| 6037 | { | 6038 | { |
| @@ -7473,11 +7474,9 @@ get_visually_first_element (struct it *it) | |||
| 7473 | if (string_p) | 7474 | if (string_p) |
| 7474 | it->bidi_it.charpos = it->bidi_it.bytepos = 0; | 7475 | it->bidi_it.charpos = it->bidi_it.bytepos = 0; |
| 7475 | else | 7476 | else |
| 7476 | { | 7477 | it->bidi_it.charpos |
| 7477 | it->bidi_it.charpos = find_next_newline_no_quit (IT_CHARPOS (*it), | 7478 | = find_next_newline_no_quit (IT_CHARPOS (*it), -1, |
| 7478 | -1); | 7479 | &it->bidi_it.bytepos); |
| 7479 | it->bidi_it.bytepos = CHAR_TO_BYTE (it->bidi_it.charpos); | ||
| 7480 | } | ||
| 7481 | bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1); | 7480 | bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it, 1); |
| 7482 | do | 7481 | do |
| 7483 | { | 7482 | { |
| @@ -9125,7 +9124,7 @@ move_it_vertically_backward (struct it *it, int dy) | |||
| 9125 | && FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n') | 9124 | && FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n') |
| 9126 | { | 9125 | { |
| 9127 | ptrdiff_t nl_pos = | 9126 | ptrdiff_t nl_pos = |
| 9128 | find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1); | 9127 | find_next_newline_no_quit (IT_CHARPOS (*it) - 1, -1, NULL); |
| 9129 | 9128 | ||
| 9130 | move_it_to (it, nl_pos, -1, -1, -1, MOVE_TO_POS); | 9129 | move_it_to (it, nl_pos, -1, -1, -1, MOVE_TO_POS); |
| 9131 | } | 9130 | } |