diff options
| author | Po Lu | 2023-02-19 22:41:42 +0800 |
|---|---|---|
| committer | Po Lu | 2023-02-19 22:41:42 +0800 |
| commit | e5232fc0e508464533f783d6c03bf1aec29a58e5 (patch) | |
| tree | 042fac18d2bc683e4e9171e9461cca7ea8de67a5 | |
| parent | 05791d09f65ebefdf00bf5711845b5ed6cf37e07 (diff) | |
| parent | 34f44ae07e0a3ba7ae43d79ab71b03795cb4acf5 (diff) | |
| download | emacs-e5232fc0e508464533f783d6c03bf1aec29a58e5.tar.gz emacs-e5232fc0e508464533f783d6c03bf1aec29a58e5.zip | |
Merge remote-tracking branch 'origin/master' into feature/android
| -rw-r--r-- | admin/make-tarball.txt | 5 | ||||
| -rw-r--r-- | doc/lispref/compile.texi | 18 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 239 | ||||
| -rw-r--r-- | doc/misc/calc.texi | 24 | ||||
| -rw-r--r-- | doc/misc/gnus-faq.texi | 16 | ||||
| -rw-r--r-- | etc/NEWS.29 | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/comp-cstr.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/comp.el | 3 | ||||
| -rw-r--r-- | lisp/emacs-lisp/rmc.el | 27 | ||||
| -rw-r--r-- | lisp/gnus/message.el | 5 | ||||
| -rw-r--r-- | lisp/image/image-dired.el | 3 | ||||
| -rw-r--r-- | lisp/mail/hashcash.el | 18 | ||||
| -rw-r--r-- | lisp/progmodes/project.el | 4 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 26 | ||||
| -rw-r--r-- | lisp/progmodes/rust-ts-mode.el | 1 | ||||
| -rw-r--r-- | lisp/simple.el | 7 | ||||
| -rw-r--r-- | lisp/treesit.el | 8 | ||||
| -rw-r--r-- | lisp/window.el | 169 | ||||
| -rw-r--r-- | src/treesit.c | 10 | ||||
| -rw-r--r-- | src/window.c | 33 | ||||
| -rw-r--r-- | src/xdisp.c | 4 | ||||
| -rw-r--r-- | test/lisp/progmodes/python-tests.el | 62 |
22 files changed, 485 insertions, 205 deletions
diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 45da3ed6be5..232053e5e96 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt | |||
| @@ -150,10 +150,11 @@ General steps (for each step, check for possible errors): | |||
| 150 | 4. autoreconf -i -I m4 --force | 150 | 4. autoreconf -i -I m4 --force |
| 151 | make bootstrap | 151 | make bootstrap |
| 152 | 152 | ||
| 153 | The below script checks for any mistakes in the source text of | ||
| 154 | manual pages. Fix any errors and re-run the script to verify. | ||
| 155 | |||
| 153 | ./admin/check-man-pages | 156 | ./admin/check-man-pages |
| 154 | 157 | ||
| 155 | The above script checks for any mistakes in the source text of | ||
| 156 | manual pages. Fix any errors and re-run the script to verify. | ||
| 157 | Then do this: | 158 | Then do this: |
| 158 | 159 | ||
| 159 | make -C etc/refcards | 160 | make -C etc/refcards |
diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi index cdbf64036da..6ae6755ad76 100644 --- a/doc/lispref/compile.texi +++ b/doc/lispref/compile.texi | |||
| @@ -1120,16 +1120,18 @@ the trampoline generation, unless you know that all the trampolines | |||
| 1120 | needed by your Lisp programs are already compiled and accessible to | 1120 | needed by your Lisp programs are already compiled and accessible to |
| 1121 | Emacs. | 1121 | Emacs. |
| 1122 | 1122 | ||
| 1123 | The value of this variable can also be a string, in which case it is | 1123 | The value of this variable can also be a string, in which case it |
| 1124 | interpreted as the name of a directory in which to store the generated | 1124 | specifies the name of a directory in which to store the generated |
| 1125 | trampoline @file{*.eln} files, overriding the directories specified by | 1125 | trampoline @file{*.eln} files, overriding the directories in |
| 1126 | @code{native-comp-eln-load-path}. This is useful if you want the | 1126 | @code{native-comp-eln-load-path}. This is useful if you want the |
| 1127 | trampolines to be generated as needed, but don't want to store them | 1127 | trampolines to be generated as needed, but don't want to store them |
| 1128 | under the user's @env{HOME} directory or the other public directories | 1128 | under the user's @env{HOME} directory or in the other public |
| 1129 | where @file{*.eln} files are kept. However, unlike with directories | 1129 | directories where @file{*.eln} files are kept. However, unlike with |
| 1130 | in @code{native-comp-eln-load-path}, the trampolines will be stored in | 1130 | directories in @code{native-comp-eln-load-path}, the trampolines will |
| 1131 | the directory given by the value of this variable, not in its | 1131 | be stored in the directory given by the value of this variable, not in |
| 1132 | version-specific subdirectory. | 1132 | its version-specific subdirectory. If the name of this directory is |
| 1133 | not absolute, it is interpreted relative to | ||
| 1134 | @code{invocation-directory} (@pxref{System Environment}) | ||
| 1133 | 1135 | ||
| 1134 | If this variable is non-@code{nil}, and Emacs needs to produce a | 1136 | If this variable is non-@code{nil}, and Emacs needs to produce a |
| 1135 | trampoline, but it cannot find any writable directory to store the | 1137 | trampoline, but it cannot find any writable directory to store the |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 441e7f1b16d..01ac6fb901a 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -629,6 +629,12 @@ example, by calling @code{select-window} with argument @var{norecord} | |||
| 629 | @code{nil}. Hence, this macro is the preferred way to temporarily work | 629 | @code{nil}. Hence, this macro is the preferred way to temporarily work |
| 630 | with @var{window} as the selected window without needlessly running | 630 | with @var{window} as the selected window without needlessly running |
| 631 | @code{buffer-list-update-hook}. | 631 | @code{buffer-list-update-hook}. |
| 632 | |||
| 633 | Note that this macro temporarily puts the window management code in an | ||
| 634 | unstable state. In particular, the most recently used window (see below) | ||
| 635 | will not necessarily match the selected one. Hence, functions like | ||
| 636 | @code{get-lru-window} and @code{get-mru-window} may return unexpected | ||
| 637 | results when called from the body of this macro. | ||
| 632 | @end defmac | 638 | @end defmac |
| 633 | 639 | ||
| 634 | @defmac with-selected-frame frame forms@dots{} | 640 | @defmac with-selected-frame frame forms@dots{} |
| @@ -650,15 +656,17 @@ The @dfn{use time} of a window is not really a time value, but an | |||
| 650 | integer that does increase monotonically with each call of | 656 | integer that does increase monotonically with each call of |
| 651 | @code{select-window} with a @code{nil} @var{norecord} argument. The | 657 | @code{select-window} with a @code{nil} @var{norecord} argument. The |
| 652 | window with the lowest use time is usually called the least recently | 658 | window with the lowest use time is usually called the least recently |
| 653 | used window while the window with the highest use time is called the | 659 | used window. The window with the highest use time is called the most |
| 654 | most recently used one (@pxref{Cyclic Window Ordering}). | 660 | recently used one (@pxref{Cyclic Window Ordering}) and is usually the |
| 661 | selected window unless @code{with-selected-window} has been used. | ||
| 655 | @end defun | 662 | @end defun |
| 656 | 663 | ||
| 657 | @defun window-bump-use-time &optional window | 664 | @defun window-bump-use-time &optional window |
| 658 | This function marks @var{window} as being the most recently used | 665 | This function marks @var{window} as being the second most recently |
| 659 | one. This can be useful when writing certain @code{pop-to-buffer} | 666 | used one (after the selected window). It does nothing if @var{window} |
| 660 | scenarios (@pxref{Switching Buffers}). @var{window} must be a live | 667 | is the selected window or the selected window does not have the |
| 661 | window and defaults to the selected one. | 668 | highest use time among all windows which may happen within the scope |
| 669 | of @code{with-selected-window}. | ||
| 662 | @end defun | 670 | @end defun |
| 663 | 671 | ||
| 664 | @anchor{Window Group}Sometimes several windows collectively and | 672 | @anchor{Window Group}Sometimes several windows collectively and |
| @@ -2755,14 +2763,40 @@ before. | |||
| 2755 | 2763 | ||
| 2756 | @defun display-buffer-use-some-window buffer alist | 2764 | @defun display-buffer-use-some-window buffer alist |
| 2757 | This function tries to display @var{buffer} by choosing an existing | 2765 | This function tries to display @var{buffer} by choosing an existing |
| 2758 | window and displaying the buffer in that window. It can fail if all | 2766 | window and displaying the buffer in that window. It first tries to find |
| 2759 | windows are dedicated to other buffers (@pxref{Dedicated Windows}). | 2767 | a window that has not been used recently (@pxref{Cyclic Window |
| 2768 | Ordering}) on any frame specified by a @code{lru-frames} @var{alist} | ||
| 2769 | entry, falling back to the selected frame if no such entry exists. It | ||
| 2770 | also prefers windows that satisfy the constraints specified by | ||
| 2771 | @code{window-min-width} and @code{window-min-height} @var{alist} | ||
| 2772 | entries; preferring full-width windows if no @code{window-min-width} | ||
| 2773 | entry is found. Finally, it will not return a window whose use time is | ||
| 2774 | higher than that specified by any @code{lru-time} entry provided by | ||
| 2775 | @var{alist}. | ||
| 2776 | |||
| 2777 | If no less recently used window is found, this function will try to use | ||
| 2778 | some other window, preferably a large window on some visible frame. It | ||
| 2779 | can fail if all windows are dedicated to other buffers (@pxref{Dedicated | ||
| 2780 | Windows}). | ||
| 2760 | @end defun | 2781 | @end defun |
| 2761 | 2782 | ||
| 2762 | @defun display-buffer-use-least-recent-window buffer alist | 2783 | @defun display-buffer-use-least-recent-window buffer alist |
| 2763 | This function is like @code{display-buffer-use-some-window}, but will | 2784 | This function is similar to @code{display-buffer-use-some-window}, but |
| 2764 | not reuse the current window, and will use the least recently | 2785 | will try harder to not use the a recently used window. In particular, |
| 2765 | switched-to window. | 2786 | it does not use the selected window. In addition, it will first try to |
| 2787 | reuse a window that shows @var{buffer} already, base the decision | ||
| 2788 | whether it should use a window showing another buffer on that window's | ||
| 2789 | use time alone and pop up a new window if no usable window is found. | ||
| 2790 | |||
| 2791 | Finally, this function will bump the use time (@pxref{Selecting | ||
| 2792 | Windows}) of any window it returns in order to avoid that further | ||
| 2793 | invocations will use that window for showing another buffer. An | ||
| 2794 | application that wants to display several buffers in a row can help this | ||
| 2795 | function by providing a @code{lru-time} @var{alist} entry it has | ||
| 2796 | initially set to the value of the selected window's use time. Each | ||
| 2797 | invocation of this function will then bump the use time of the window | ||
| 2798 | returned to a value higher than that and a subsequent invocation will | ||
| 2799 | inhibit this function to use a window it returned earlier. | ||
| 2766 | @end defun | 2800 | @end defun |
| 2767 | 2801 | ||
| 2768 | @defun display-buffer-in-direction buffer alist | 2802 | @defun display-buffer-in-direction buffer alist |
| @@ -3032,12 +3066,40 @@ The value specifies an alist of window parameters to give the chosen | |||
| 3032 | window. All action functions that choose a window should process this | 3066 | window. All action functions that choose a window should process this |
| 3033 | entry. | 3067 | entry. |
| 3034 | 3068 | ||
| 3069 | @vindex window-min-width@r{, a buffer display action alist entry} | ||
| 3070 | @item window-min-width | ||
| 3071 | The value specifies a minimum width of the window used, in canonical | ||
| 3072 | frame columns. The special value @code{full-width} means the chosen | ||
| 3073 | window should be one that has no other windows on the left or right of | ||
| 3074 | it in its frame. | ||
| 3075 | |||
| 3076 | This entry is currently honored by @code{display-buffer-use-some-window} | ||
| 3077 | and @code{display-buffer-use-least-recent-window}, which try hard to avoid | ||
| 3078 | returning a less recently used window that does not satisfy the entry. | ||
| 3079 | |||
| 3080 | Note that providing such an entry alone does not necessarily make the | ||
| 3081 | window as wide as specified by its value. To actually resize an | ||
| 3082 | existing window or make a new window as wide as specified by this | ||
| 3083 | entry's value, a @code{window-width} entry specifying that value | ||
| 3084 | should be provided as well. Such a @code{window-width} entry can, | ||
| 3085 | however, specify a completely different value, or ask the window width | ||
| 3086 | to fit that of its buffer, in which case the | ||
| 3087 | @code{window-min-width} entry provides the guaranteed minimum width of | ||
| 3088 | the window. | ||
| 3089 | |||
| 3035 | @vindex window-min-height@r{, a buffer display action alist entry} | 3090 | @vindex window-min-height@r{, a buffer display action alist entry} |
| 3036 | @item window-min-height | 3091 | @item window-min-height |
| 3037 | The value specifies a minimum height of the window used, in lines. If | 3092 | The value specifies a minimum height of the window used, in canonical |
| 3038 | a window is not or cannot be made as high as specified by this entry, | 3093 | frame lines. The special value @code{full-height} means the chosen |
| 3039 | the window is not considered for use. The only client of this entry | 3094 | window should be a full-height window, one that has no other windows |
| 3040 | is presently @code{display-buffer-below-selected}. | 3095 | above or below it in its frame. |
| 3096 | |||
| 3097 | This entry is currently honored by @code{display-buffer-below-selected} | ||
| 3098 | which does not use a window that is not as high as specified by this | ||
| 3099 | entry. It's also honored by @code{display-buffer-use-some-window} and | ||
| 3100 | @code{display-buffer-use-least-recent-window} which try hard to avoid | ||
| 3101 | returning a less recently used window if it does not satisfy this | ||
| 3102 | constraint. | ||
| 3041 | 3103 | ||
| 3042 | Note that providing such an entry alone does not necessarily make the | 3104 | Note that providing such an entry alone does not necessarily make the |
| 3043 | window as tall as specified by its value. To actually resize an | 3105 | window as tall as specified by its value. To actually resize an |
| @@ -3166,6 +3228,40 @@ preserve both, its width and its height. This entry should be | |||
| 3166 | processed only under certain conditions which are specified right | 3228 | processed only under certain conditions which are specified right |
| 3167 | after this list. | 3229 | after this list. |
| 3168 | 3230 | ||
| 3231 | @vindex lru-frames@r{, a buffer display action alist entry} | ||
| 3232 | @item lru-frames | ||
| 3233 | The value specifies the set of frames to search for a window that can be | ||
| 3234 | used to display the buffer. It is honored by | ||
| 3235 | @code{display-buffer-use-some-window} and | ||
| 3236 | @code{display-buffer-use-least-recent-window} when trying to find a less | ||
| 3237 | recently used window showing some other buffer. Its values are the same | ||
| 3238 | as for the @code{reusable-frames} entry described above. | ||
| 3239 | |||
| 3240 | @vindex lru-time@r{, a buffer display action alist entry} | ||
| 3241 | @item lru-time | ||
| 3242 | The value is supposed to specify a use time (@pxref{Selecting Windows}). | ||
| 3243 | This entry is honored by @code{display-buffer-use-some-window} and | ||
| 3244 | @code{display-buffer-use-least-recent-window} when trying to find a less | ||
| 3245 | recently used window showing some other buffer. If a window's use time | ||
| 3246 | is higher than the value specified by this option, these action | ||
| 3247 | functions will not consider such a window for displaying the buffer. | ||
| 3248 | |||
| 3249 | @vindex bump-use-time@r{, a buffer display action alist entry} | ||
| 3250 | @item bump-use-time | ||
| 3251 | If non-@code{nil}, such an entry will cause @code{display-buffer} to | ||
| 3252 | bump the use time (@pxref{Selecting Windows}) of the window it uses. | ||
| 3253 | This should avoid later use of this window by action functions | ||
| 3254 | like @code{display-buffer-use-some-window} and | ||
| 3255 | @code{display-buffer-use-least-recent-window} for showing another | ||
| 3256 | buffer. | ||
| 3257 | |||
| 3258 | There is a fine difference between using this entry and using the action | ||
| 3259 | function @code{display-buffer-use-least-recent-window}. Calling the | ||
| 3260 | latter means to only bump the use times of windows that function uses | ||
| 3261 | for displaying the buffer. The entry described here will cause | ||
| 3262 | @code{display-buffer} to bump the use time of @emph{any} window used for | ||
| 3263 | displaying a buffer. | ||
| 3264 | |||
| 3169 | @vindex pop-up-frame-parameters@r{, a buffer display action alist entry} | 3265 | @vindex pop-up-frame-parameters@r{, a buffer display action alist entry} |
| 3170 | @item pop-up-frame-parameters | 3266 | @item pop-up-frame-parameters |
| 3171 | The value specifies an alist of frame parameters to give a new frame, | 3267 | The value specifies an alist of frame parameters to give a new frame, |
| @@ -3321,13 +3417,6 @@ window has at least that many columns. If the value is @code{nil}, | |||
| 3321 | that means not to split this way. | 3417 | that means not to split this way. |
| 3322 | @end defopt | 3418 | @end defopt |
| 3323 | 3419 | ||
| 3324 | @defopt display-buffer-avoid-small-windows | ||
| 3325 | If non-@code{nil}, this should be a number. Windows that have fewer | ||
| 3326 | lines than that will be avoided when choosing an existing window. The | ||
| 3327 | value is interpreted in units of the frame's canonical line height, | ||
| 3328 | like @code{window-total-height} does (@pxref{Window Sizes}). | ||
| 3329 | @end defopt | ||
| 3330 | |||
| 3331 | @defopt even-window-sizes | 3420 | @defopt even-window-sizes |
| 3332 | This variable, if non-@code{nil}, causes @code{display-buffer} to even | 3421 | This variable, if non-@code{nil}, causes @code{display-buffer} to even |
| 3333 | window sizes whenever it reuses an existing window, and that window is | 3422 | window sizes whenever it reuses an existing window, and that window is |
| @@ -3992,53 +4081,79 @@ related to the new window. For non-input related actions | |||
| 3992 | @code{display-buffer-below-selected} might be preferable because the | 4081 | @code{display-buffer-below-selected} might be preferable because the |
| 3993 | selected window usually already has the user's attention. | 4082 | selected window usually already has the user's attention. |
| 3994 | 4083 | ||
| 3995 | @item Handle subsequent invocations of @code{display-buffer} | 4084 | @item Take care which window is selected |
| 3996 | @code{display-buffer} is not overly well suited for displaying several | 4085 | Many applications call @code{display-buffer} from within window |
| 3997 | buffers in sequence and making sure that all these buffers are shown | 4086 | excursions produced by @code{with-selected-window} or |
| 3998 | orderly in the resulting window configuration. Again, the standard | 4087 | @code{select-window} calls with a non-@code{nil} @var{norecord} |
| 3999 | action functions @code{display-buffer-pop-up-window} and | 4088 | argument. This is almost always a bad idea because the window selected |
| 4000 | @code{display-buffer-use-some-window} are not very suited for this | 4089 | within such an excursion is usually not the window selected in the |
| 4001 | purpose due to their somewhat chaotic nature in more complex | 4090 | configuration presented to the user. |
| 4002 | configurations. | 4091 | |
| 4092 | If, for example, a user had added an @code{inhibit-same-window} alist | ||
| 4093 | entry, that entry would have avoided the window selected within the | ||
| 4094 | scope of the excursion and not the window selected in the resulting | ||
| 4095 | configuration. Even if no such entry has been added, the resulting | ||
| 4096 | behavior might be strange. While in a frame containing one live | ||
| 4097 | window, evaluating the following form | ||
| 4003 | 4098 | ||
| 4004 | To produce a window configuration displaying multiple buffers (or | 4099 | @example |
| 4005 | different views of one and the same buffer) in one and the same | 4100 | @group |
| 4006 | display cycle, Lisp programmers will unavoidably have to write | 4101 | (progn |
| 4007 | their own action functions. A few tricks listed below might help in | 4102 | (split-window) |
| 4008 | this regard. | 4103 | (display-buffer "*Messages*")) |
| 4104 | @end group | ||
| 4105 | @end example | ||
| 4009 | 4106 | ||
| 4010 | @itemize @bullet | 4107 | @noindent |
| 4011 | @item | 4108 | will display a window showing the @file{*Messages*} buffer at the bottom |
| 4012 | Making windows atomic (@pxref{Atomic Windows}) avoids breaking an | 4109 | and leave the other window selected. Evaluating the next form |
| 4013 | existing window composition when popping up a new window. | ||
| 4014 | The new window will pop up outside the composition instead. | ||
| 4015 | 4110 | ||
| 4016 | @item | 4111 | @example |
| 4017 | Temporarily dedicating windows to their buffers (@pxref{Dedicated | 4112 | @group |
| 4018 | Windows}) avoids using a window for displaying a different | 4113 | (with-selected-window (split-window) |
| 4019 | buffer. A non-dedicated window will be used instead. | 4114 | (display-buffer "*Messages*")) |
| 4115 | @end group | ||
| 4116 | @end example | ||
| 4020 | 4117 | ||
| 4021 | @item | 4118 | @noindent |
| 4022 | Calling @code{window-preserve-size} (@pxref{Preserving Window Sizes}) | 4119 | will display @file{*Messages*} in a window on the top and select it |
| 4023 | will try to keep the size of the argument window unchanged when | 4120 | which is usually not what @code{display-buffer} is supposed to do. |
| 4024 | popping up a new window. You have to make sure that another window in | ||
| 4025 | the same combination can be shrunk instead, though. | ||
| 4026 | 4121 | ||
| 4027 | @item | 4122 | On the other hand, while evaluating the following form |
| 4028 | Side windows (@pxref{Side Windows}) can be used for displaying | ||
| 4029 | specific buffers always in a window at the same position of a frame. | ||
| 4030 | This permits grouping buffers that do not compete for being shown at | ||
| 4031 | the same time on a frame and showing any such buffer in the same window | ||
| 4032 | without disrupting the display of other buffers. | ||
| 4033 | 4123 | ||
| 4034 | @item | 4124 | @example |
| 4035 | Child frames (@pxref{Child Frames}) can be used to display a buffer | 4125 | @group |
| 4036 | within the screen estate of the selected frame without disrupting that | 4126 | (progn |
| 4037 | frame's window configuration and without the overhead associated with | 4127 | (split-window) |
| 4038 | full-fledged frames as inflicted by @code{display-buffer-pop-up-frame}. | 4128 | (pop-to-buffer "*Messages*")) |
| 4039 | @end itemize | 4129 | @end group |
| 4040 | @end table | 4130 | @end example |
| 4041 | 4131 | ||
| 4132 | @noindent | ||
| 4133 | will correctly select the @file{*Messages*} buffer, the next form | ||
| 4134 | |||
| 4135 | @example | ||
| 4136 | @group | ||
| 4137 | (progn | ||
| 4138 | (split-window) | ||
| 4139 | (with-selected-window (selected-window) | ||
| 4140 | (pop-to-buffer "*Messages*"))) | ||
| 4141 | @end group | ||
| 4142 | @end example | ||
| 4143 | |||
| 4144 | @noindent | ||
| 4145 | will not. | ||
| 4146 | |||
| 4147 | Also, invocations of action functions like | ||
| 4148 | @code{display-buffer-use-some-window} and | ||
| 4149 | @code{display-buffer-use-least-recent-window} that expect the selected | ||
| 4150 | window to have the highest use time among all windows, may fail to | ||
| 4151 | produce a window according to their specifications. | ||
| 4152 | |||
| 4153 | Hence, an application that relies on using a window excursion should try | ||
| 4154 | to postpone the @code{display-buffer} call until after the excursion has | ||
| 4155 | terminated. | ||
| 4156 | @end table | ||
| 4042 | 4157 | ||
| 4043 | @node Window History | 4158 | @node Window History |
| 4044 | @section Window History | 4159 | @section Window History |
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 5424995534e..044c018080c 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi | |||
| @@ -232,7 +232,8 @@ series of calculators, its many features include: | |||
| 232 | 232 | ||
| 233 | @itemize @bullet | 233 | @itemize @bullet |
| 234 | @item | 234 | @item |
| 235 | Choice of algebraic or RPN (stack-based) entry of calculations. | 235 | Choice of algebraic or Reverse Polish notation (RPN), |
| 236 | i.e. stack-based, entry of calculations. | ||
| 236 | 237 | ||
| 237 | @item | 238 | @item |
| 238 | Arbitrary precision integers and floating-point numbers. | 239 | Arbitrary precision integers and floating-point numbers. |
| @@ -421,8 +422,8 @@ difference between lower-case and upper-case letters. Remember, | |||
| 421 | @key{RET}, @key{TAB}, @key{DEL}, and @key{SPC} are the Return, Tab, | 422 | @key{RET}, @key{TAB}, @key{DEL}, and @key{SPC} are the Return, Tab, |
| 422 | Delete, and Space keys. | 423 | Delete, and Space keys. |
| 423 | 424 | ||
| 424 | @strong{RPN calculation.} In RPN, you type the input number(s) first, | 425 | @strong{RPN calculation.} In Reverse Polish notation (RPN), you type |
| 425 | then the command to operate on the numbers. | 426 | the input number(s) first, then the command to operate on the numbers. |
| 426 | 427 | ||
| 427 | @noindent | 428 | @noindent |
| 428 | Type @kbd{2 @key{RET} 3 + Q} to compute | 429 | Type @kbd{2 @key{RET} 3 + Q} to compute |
| @@ -1348,18 +1349,19 @@ to control various modes of the Calculator. | |||
| 1348 | @subsection RPN Calculations and the Stack | 1349 | @subsection RPN Calculations and the Stack |
| 1349 | 1350 | ||
| 1350 | @cindex RPN notation | 1351 | @cindex RPN notation |
| 1352 | @cindex Reverse Polish notation | ||
| 1351 | @noindent | 1353 | @noindent |
| 1352 | @ifnottex | 1354 | @ifnottex |
| 1353 | Calc normally uses RPN notation. You may be familiar with the RPN | 1355 | Calc normally uses Reverse Polish notation (RPN). You may be familiar |
| 1354 | system from Hewlett-Packard calculators, FORTH, or PostScript. | 1356 | with the RPN system from Hewlett-Packard calculators, FORTH, or |
| 1355 | (Reverse Polish Notation, RPN, is named after the Polish mathematician | 1357 | PostScript. (Reverse Polish Notation is named after the Polish |
| 1356 | Jan Lukasiewicz.) | 1358 | mathematician Jan Lukasiewicz.) |
| 1357 | @end ifnottex | 1359 | @end ifnottex |
| 1358 | @tex | 1360 | @tex |
| 1359 | Calc normally uses RPN notation. You may be familiar with the RPN | 1361 | Calc normally uses Reverse Polish notation (RPN). You may be familiar |
| 1360 | system from Hewlett-Packard calculators, FORTH, or PostScript. | 1362 | with the RPN system from Hewlett-Packard calculators, FORTH, or |
| 1361 | (Reverse Polish Notation, RPN, is named after the Polish mathematician | 1363 | PostScript. (Reverse Polish Notation is named after the Polish |
| 1362 | Jan \L ukasiewicz.) | 1364 | mathematician Jan \L ukasiewicz.) |
| 1363 | @end tex | 1365 | @end tex |
| 1364 | 1366 | ||
| 1365 | The central component of an RPN calculator is the @dfn{stack}. A | 1367 | The central component of an RPN calculator is the @dfn{stack}. A |
diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi index f7d528511a0..eb416fe47d6 100644 --- a/doc/misc/gnus-faq.texi +++ b/doc/misc/gnus-faq.texi | |||
| @@ -76,16 +76,15 @@ misprints are the Gnus team's fault, sorry. | |||
| 76 | @subsection Installation FAQ | 76 | @subsection Installation FAQ |
| 77 | 77 | ||
| 78 | @menu | 78 | @menu |
| 79 | * FAQ 1-1:: What is the latest version of Gnus? | 79 | * FAQ 1-1:: Where can I get the latest version of Gnus? |
| 80 | * FAQ 1-2:: Where and how to get Gnus? | 80 | * FAQ 1-2:: I sometimes read references to No Gnus and Oort Gnus, |
| 81 | * FAQ 1-3:: I sometimes read references to No Gnus and Oort Gnus, | ||
| 82 | what are those? | 81 | what are those? |
| 83 | @end menu | 82 | @end menu |
| 84 | 83 | ||
| 85 | @node FAQ 1-1 | 84 | @node FAQ 1-1 |
| 86 | @subsubheading Question 1.1 | 85 | @subsubheading Question 1.1 |
| 87 | 86 | ||
| 88 | What is the latest version of Gnus? | 87 | What is the latest version of Gnus and where can I find it? |
| 89 | 88 | ||
| 90 | @subsubheading Answer | 89 | @subsubheading Answer |
| 91 | 90 | ||
| @@ -94,15 +93,6 @@ The latest version of Gnus is bundled with Emacs. | |||
| 94 | @node FAQ 1-2 | 93 | @node FAQ 1-2 |
| 95 | @subsubheading Question 1.2 | 94 | @subsubheading Question 1.2 |
| 96 | 95 | ||
| 97 | Where and how to get Gnus? | ||
| 98 | |||
| 99 | @subsubheading Answer | ||
| 100 | |||
| 101 | Gnus is bundled with Emacs. | ||
| 102 | |||
| 103 | @node FAQ 1-3 | ||
| 104 | @subsubheading Question 1.3 | ||
| 105 | |||
| 106 | I sometimes read references to No Gnus and Oort Gnus, | 96 | I sometimes read references to No Gnus and Oort Gnus, |
| 107 | what are those? | 97 | what are those? |
| 108 | 98 | ||
diff --git a/etc/NEWS.29 b/etc/NEWS.29 index b140d1dcbfd..0106953c1e0 100644 --- a/etc/NEWS.29 +++ b/etc/NEWS.29 | |||
| @@ -1162,12 +1162,6 @@ commands are now available with key sequences that start with the | |||
| 1162 | 'C-x w' prefix. | 1162 | 'C-x w' prefix. |
| 1163 | 1163 | ||
| 1164 | +++ | 1164 | +++ |
| 1165 | *** New user option 'display-buffer-avoid-small-windows'. | ||
| 1166 | If non-nil, this should be a window height in lines, a number. | ||
| 1167 | Windows smaller than this will be avoided by 'display-buffer', if | ||
| 1168 | possible. | ||
| 1169 | |||
| 1170 | +++ | ||
| 1171 | *** New display action 'display-buffer-full-frame'. | 1165 | *** New display action 'display-buffer-full-frame'. |
| 1172 | This action removes other windows from the frame when displaying a | 1166 | This action removes other windows from the frame when displaying a |
| 1173 | buffer on that frame. | 1167 | buffer on that frame. |
diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 98e50f53b5f..d4200c16c19 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el | |||
| @@ -483,7 +483,7 @@ Return them as multiple value." | |||
| 483 | ;;; Union specific code. | 483 | ;;; Union specific code. |
| 484 | 484 | ||
| 485 | (defun comp-cstr-union-homogeneous-no-range (dst &rest srcs) | 485 | (defun comp-cstr-union-homogeneous-no-range (dst &rest srcs) |
| 486 | "As `comp-cstr-union' but escluding the irange component. | 486 | "As `comp-cstr-union' but excluding the irange component. |
| 487 | All SRCS constraints must be homogeneously negated or non-negated." | 487 | All SRCS constraints must be homogeneously negated or non-negated." |
| 488 | 488 | ||
| 489 | ;; Type propagation. | 489 | ;; Type propagation. |
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 5e707d2d631..872c757be1f 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el | |||
| @@ -3794,7 +3794,8 @@ Return the trampoline if found or nil otherwise." | |||
| 3794 | "Return the absolute filename for a trampoline for SUBR-NAME." | 3794 | "Return the absolute filename for a trampoline for SUBR-NAME." |
| 3795 | (cl-loop | 3795 | (cl-loop |
| 3796 | with dirs = (if (stringp native-comp-enable-subr-trampolines) | 3796 | with dirs = (if (stringp native-comp-enable-subr-trampolines) |
| 3797 | (list native-comp-enable-subr-trampolines) | 3797 | (list (expand-file-name native-comp-enable-subr-trampolines |
| 3798 | invocation-directory)) | ||
| 3798 | (if native-compile-target-directory | 3799 | (if native-compile-target-directory |
| 3799 | (list (expand-file-name comp-native-version-dir | 3800 | (list (expand-file-name comp-native-version-dir |
| 3800 | native-compile-target-directory)) | 3801 | native-compile-target-directory)) |
diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el index 542c96512f5..bfd7434be9a 100644 --- a/lisp/emacs-lisp/rmc.el +++ b/lisp/emacs-lisp/rmc.el | |||
| @@ -162,8 +162,10 @@ dialogs. Otherwise, the function will always use text-mode dialogs. | |||
| 162 | 162 | ||
| 163 | The return value is the matching entry from the CHOICES list. | 163 | The return value is the matching entry from the CHOICES list. |
| 164 | 164 | ||
| 165 | If LONG-FORM, do a `completing-read' over the NAME elements in | 165 | If LONG-FORM is non-nil, do a `completing-read' over the NAME elements |
| 166 | CHOICES instead. | 166 | in CHOICES instead. In this case, GUI dialog is not used, regardless |
| 167 | of the value of `use-dialog-box' and whether the function was invoked | ||
| 168 | via a mouse gesture. | ||
| 167 | 169 | ||
| 168 | Usage example: | 170 | Usage example: |
| 169 | 171 | ||
| @@ -177,8 +179,9 @@ Usage example: | |||
| 177 | prompt choices help-string show-help))) | 179 | prompt choices help-string show-help))) |
| 178 | 180 | ||
| 179 | (defun read-multiple-choice--short-answers (prompt choices help-string show-help) | 181 | (defun read-multiple-choice--short-answers (prompt choices help-string show-help) |
| 180 | (let* ((prompt-choices | 182 | (let* ((dialog-p (use-dialog-box-p)) |
| 181 | (if show-help choices (append choices '((?? "?"))))) | 183 | (prompt-choices |
| 184 | (if (or show-help dialog-p) choices (append choices '((?? "?"))))) | ||
| 182 | (altered-names (mapcar #'rmc--add-key-description prompt-choices)) | 185 | (altered-names (mapcar #'rmc--add-key-description prompt-choices)) |
| 183 | (full-prompt | 186 | (full-prompt |
| 184 | (format | 187 | (format |
| @@ -192,16 +195,14 @@ Usage example: | |||
| 192 | (setq buf (rmc--show-help prompt help-string show-help | 195 | (setq buf (rmc--show-help prompt help-string show-help |
| 193 | choices altered-names))) | 196 | choices altered-names))) |
| 194 | (while (not tchar) | 197 | (while (not tchar) |
| 195 | (message "%s%s" | 198 | (unless dialog-p |
| 196 | (if wrong-char | 199 | (message "%s%s" |
| 197 | "Invalid choice. " | 200 | (if wrong-char |
| 198 | "") | 201 | "Invalid choice. " |
| 199 | full-prompt) | 202 | "") |
| 203 | full-prompt)) | ||
| 200 | (setq tchar | 204 | (setq tchar |
| 201 | (if (and (display-popup-menus-p) | 205 | (if dialog-p |
| 202 | last-input-event ; not during startup | ||
| 203 | (consp last-nonmenu-event) | ||
| 204 | use-dialog-box) | ||
| 205 | (x-popup-dialog | 206 | (x-popup-dialog |
| 206 | t | 207 | t |
| 207 | (cons prompt | 208 | (cons prompt |
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index c697b8d7a7f..f4cfffa2e8a 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el | |||
| @@ -1926,9 +1926,10 @@ no, only reply back to the author." | |||
| 1926 | "Whether to generate X-Hashcash: headers. | 1926 | "Whether to generate X-Hashcash: headers. |
| 1927 | If t, always generate hashcash headers. If `opportunistic', | 1927 | If t, always generate hashcash headers. If `opportunistic', |
| 1928 | only generate hashcash headers if it can be done without the user | 1928 | only generate hashcash headers if it can be done without the user |
| 1929 | waiting (i.e., only asynchronously). | 1929 | waiting (i.e., only asynchronously). If nil, don't generate |
| 1930 | hashcash headers. | ||
| 1930 | 1931 | ||
| 1931 | You must have the \"hashcash\" binary installed, see `hashcash-path'." | 1932 | You must have the \"hashcash\" binary installed, see `hashcash-program'." |
| 1932 | :version "24.1" | 1933 | :version "24.1" |
| 1933 | :group 'message-headers | 1934 | :group 'message-headers |
| 1934 | :link '(custom-manual "(message)Mail Headers") | 1935 | :link '(custom-manual "(message)Mail Headers") |
diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 49b8d9f03c8..cfcd1851188 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el | |||
| @@ -593,7 +593,8 @@ thumbnail buffer to be selected." | |||
| 593 | (if do-not-pop | 593 | (if do-not-pop |
| 594 | (display-buffer buf) | 594 | (display-buffer buf) |
| 595 | (pop-to-buffer buf)) | 595 | (pop-to-buffer buf)) |
| 596 | (image-dired--line-up-with-method)))) | 596 | (image-dired--line-up-with-method) |
| 597 | (image-dired--update-header-line)))) | ||
| 597 | 598 | ||
| 598 | ;;;###autoload | 599 | ;;;###autoload |
| 599 | (defun image-dired-show-all-from-dir (dir) | 600 | (defun image-dired-show-all-from-dir (dir) |
diff --git a/lisp/mail/hashcash.el b/lisp/mail/hashcash.el index 72d532d6f62..ecc03bfb537 100644 --- a/lisp/mail/hashcash.el +++ b/lisp/mail/hashcash.el | |||
| @@ -25,16 +25,16 @@ | |||
| 25 | 25 | ||
| 26 | ;; The hashcash binary is at http://www.hashcash.org/. | 26 | ;; The hashcash binary is at http://www.hashcash.org/. |
| 27 | ;; | 27 | ;; |
| 28 | ;; Call mail-add-payment to add a hashcash payment to a mail message | 28 | ;; Call `mail-add-payment' to add a hashcash payment to a mail message |
| 29 | ;; in the current buffer. | 29 | ;; in the current buffer. |
| 30 | ;; | 30 | ;; |
| 31 | ;; Call mail-add-payment-async after writing the addresses but before | 31 | ;; Call `mail-add-payment-async' after writing the addresses but |
| 32 | ;; writing the mail to start calculating the hashcash payment | 32 | ;; before writing the mail to start calculating the hashcash payment |
| 33 | ;; asynchronously. | 33 | ;; asynchronously. |
| 34 | ;; | 34 | ;; |
| 35 | ;; The easiest way to do this automatically for all outgoing mail | 35 | ;; The easiest way to do this automatically for all outgoing mail is |
| 36 | ;; is to set `message-generate-hashcash' to t. If you want more | 36 | ;; to set `message-generate-hashcash' to `opportunistic' or t. If you |
| 37 | ;; control, try the following hooks. | 37 | ;; want more control, try the following hooks. |
| 38 | ;; | 38 | ;; |
| 39 | ;; To automatically add payments to all outgoing mail when sending: | 39 | ;; To automatically add payments to all outgoing mail when sending: |
| 40 | ;; (add-hook 'message-send-hook 'mail-add-payment) | 40 | ;; (add-hook 'message-send-hook 'mail-add-payment) |
| @@ -44,6 +44,8 @@ | |||
| 44 | ;; | 44 | ;; |
| 45 | ;; To check whether calculations are done before sending: | 45 | ;; To check whether calculations are done before sending: |
| 46 | ;; (add-hook 'message-send-hook 'hashcash-wait-or-cancel) | 46 | ;; (add-hook 'message-send-hook 'hashcash-wait-or-cancel) |
| 47 | ;; | ||
| 48 | ;; For more information, see Info node `(gnus) Hashcash'. | ||
| 47 | 49 | ||
| 48 | ;;; Code: | 50 | ;;; Code: |
| 49 | 51 | ||
| @@ -87,7 +89,9 @@ is used instead." | |||
| 87 | (define-obsolete-variable-alias 'hashcash-path 'hashcash-program "24.4") | 89 | (define-obsolete-variable-alias 'hashcash-path 'hashcash-program "24.4") |
| 88 | (defcustom hashcash-program "hashcash" | 90 | (defcustom hashcash-program "hashcash" |
| 89 | "The name of the hashcash executable. | 91 | "The name of the hashcash executable. |
| 90 | If this is not in your PATH, specify an absolute file name." | 92 | If this is not in your PATH, specify an absolute file name. |
| 93 | |||
| 94 | See also `message-generate-hashcash'." | ||
| 91 | :type '(choice (const nil) file)) | 95 | :type '(choice (const nil) file)) |
| 92 | 96 | ||
| 93 | (defcustom hashcash-extra-generate-parameters '("-Z2") | 97 | (defcustom hashcash-extra-generate-parameters '("-Z2") |
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1228c73fee8..11228226592 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- | 1 | ;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2015-2023 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2015-2023 Free Software Foundation, Inc. |
| 4 | ;; Version: 0.9.7 | 4 | ;; Version: 0.9.8 |
| 5 | ;; Package-Requires: ((emacs "26.1") (xref "1.4.0")) | 5 | ;; Package-Requires: ((emacs "26.1") (xref "1.4.0")) |
| 6 | 6 | ||
| 7 | ;; This is a GNU ELPA :core package. Avoid using functionality that | 7 | ;; This is a GNU ELPA :core package. Avoid using functionality that |
| @@ -512,8 +512,6 @@ project backend implementation of `project-external-roots'.") | |||
| 512 | See `project-vc-extra-root-markers' for the marker value format.") | 512 | See `project-vc-extra-root-markers' for the marker value format.") |
| 513 | 513 | ||
| 514 | (defun project-try-vc (dir) | 514 | (defun project-try-vc (dir) |
| 515 | (defvar vc-svn-admin-directory) | ||
| 516 | (require 'vc-svn) | ||
| 517 | ;; FIXME: Learn to invalidate when the value of | 515 | ;; FIXME: Learn to invalidate when the value of |
| 518 | ;; `project-vc-merge-submodules' or `project-vc-extra-root-markers' | 516 | ;; `project-vc-merge-submodules' or `project-vc-extra-root-markers' |
| 519 | ;; changes. | 517 | ;; changes. |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index df0d1c96965..0d714c31e9e 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -3759,14 +3759,15 @@ the python shell: | |||
| 3759 | whitespaces will be removed. Otherwise, wraps indented | 3759 | whitespaces will be removed. Otherwise, wraps indented |
| 3760 | regions under an \"if True:\" block so the interpreter | 3760 | regions under an \"if True:\" block so the interpreter |
| 3761 | evaluates them correctly." | 3761 | evaluates them correctly." |
| 3762 | (let* ((single-p (save-restriction | 3762 | (let* ((single-p (save-excursion |
| 3763 | (narrow-to-region start end) | 3763 | (save-restriction |
| 3764 | (= (progn | 3764 | (narrow-to-region start end) |
| 3765 | (goto-char start) | 3765 | (= (progn |
| 3766 | (python-nav-beginning-of-statement)) | 3766 | (goto-char start) |
| 3767 | (progn | 3767 | (python-nav-beginning-of-statement)) |
| 3768 | (goto-char end) | 3768 | (progn |
| 3769 | (python-nav-beginning-of-statement))))) | 3769 | (goto-char end) |
| 3770 | (python-nav-beginning-of-statement)))))) | ||
| 3770 | (start (save-excursion | 3771 | (start (save-excursion |
| 3771 | ;; If we're at the start of the expression, and if | 3772 | ;; If we're at the start of the expression, and if |
| 3772 | ;; the region consists of a single statement, then | 3773 | ;; the region consists of a single statement, then |
| @@ -3785,10 +3786,11 @@ the python shell: | |||
| 3785 | (line-beginning-position) | 3786 | (line-beginning-position) |
| 3786 | start)))) | 3787 | start)))) |
| 3787 | (substring (buffer-substring-no-properties start end)) | 3788 | (substring (buffer-substring-no-properties start end)) |
| 3788 | (starts-at-first-line-p (save-restriction | 3789 | (starts-at-first-line-p (save-excursion |
| 3789 | (widen) | 3790 | (save-restriction |
| 3790 | (goto-char start) | 3791 | (widen) |
| 3791 | (= (line-number-at-pos) 1))) | 3792 | (goto-char start) |
| 3793 | (= (line-number-at-pos) 1)))) | ||
| 3792 | (encoding (python-info-encoding)) | 3794 | (encoding (python-info-encoding)) |
| 3793 | (toplevel-p (zerop (save-excursion | 3795 | (toplevel-p (zerop (save-excursion |
| 3794 | (goto-char start) | 3796 | (goto-char start) |
diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el index ec823d09d8c..e53cdb5ce7d 100644 --- a/lisp/progmodes/rust-ts-mode.el +++ b/lisp/progmodes/rust-ts-mode.el | |||
| @@ -158,6 +158,7 @@ | |||
| 158 | (macro_definition (identifier) @font-lock-preprocessor-face) | 158 | (macro_definition (identifier) @font-lock-preprocessor-face) |
| 159 | (field_declaration name: (field_identifier) @font-lock-property-face) | 159 | (field_declaration name: (field_identifier) @font-lock-property-face) |
| 160 | (parameter pattern: (_) @rust-ts-mode--fontify-pattern) | 160 | (parameter pattern: (_) @rust-ts-mode--fontify-pattern) |
| 161 | (closure_parameters (_) @rust-ts-mode--fontify-pattern) | ||
| 161 | (let_declaration pattern: (_) @rust-ts-mode--fontify-pattern) | 162 | (let_declaration pattern: (_) @rust-ts-mode--fontify-pattern) |
| 162 | (for_expression pattern: (_) @rust-ts-mode--fontify-pattern) | 163 | (for_expression pattern: (_) @rust-ts-mode--fontify-pattern) |
| 163 | (let_condition pattern: (_) @rust-ts-mode--fontify-pattern) | 164 | (let_condition pattern: (_) @rust-ts-mode--fontify-pattern) |
diff --git a/lisp/simple.el b/lisp/simple.el index c290468928b..594f2d6aa73 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1088,7 +1088,8 @@ Leave one space or none, according to the context." | |||
| 1088 | 1088 | ||
| 1089 | (defun delete-horizontal-space (&optional backward-only) | 1089 | (defun delete-horizontal-space (&optional backward-only) |
| 1090 | "Delete all spaces and tabs around point. | 1090 | "Delete all spaces and tabs around point. |
| 1091 | If BACKWARD-ONLY is non-nil, delete them only before point." | 1091 | If BACKWARD-ONLY is non-nil (interactively, the prefix argument), delete |
| 1092 | them only before point." | ||
| 1092 | (interactive "*P") | 1093 | (interactive "*P") |
| 1093 | (delete-space--internal " \t" backward-only)) | 1094 | (delete-space--internal " \t" backward-only)) |
| 1094 | 1095 | ||
| @@ -1114,6 +1115,7 @@ If BACKWARD-ONLY is non-nil, delete them only before point." | |||
| 1114 | 1115 | ||
| 1115 | (defun just-one-space (&optional n) | 1116 | (defun just-one-space (&optional n) |
| 1116 | "Delete all spaces and tabs around point, leaving one space (or N spaces). | 1117 | "Delete all spaces and tabs around point, leaving one space (or N spaces). |
| 1118 | Interactively, N is the prefix numeric argument. | ||
| 1117 | If N is negative, delete newlines as well, leaving -N spaces. | 1119 | If N is negative, delete newlines as well, leaving -N spaces. |
| 1118 | See also `cycle-spacing'." | 1120 | See also `cycle-spacing'." |
| 1119 | (interactive "*p") | 1121 | (interactive "*p") |
| @@ -10832,7 +10834,8 @@ If the buffer doesn't exist, create it first." | |||
| 10832 | '((?y "yes" "kill buffer without saving") | 10834 | '((?y "yes" "kill buffer without saving") |
| 10833 | (?n "no" "exit without doing anything") | 10835 | (?n "no" "exit without doing anything") |
| 10834 | (?s "save and then kill" "save the buffer and then kill it")) | 10836 | (?s "save and then kill" "save the buffer and then kill it")) |
| 10835 | nil nil (not use-short-answers))))) | 10837 | nil nil (and (not use-short-answers) |
| 10838 | (not (use-dialog-box-p))))))) | ||
| 10836 | (if (equal response "no") | 10839 | (if (equal response "no") |
| 10837 | nil | 10840 | nil |
| 10838 | (unless (equal response "yes") | 10841 | (unless (equal response "yes") |
diff --git a/lisp/treesit.el b/lisp/treesit.el index d7f34146852..077f1da6e47 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el | |||
| @@ -1204,6 +1204,11 @@ See `treesit-simple-indent-presets'.") | |||
| 1204 | (cons 'grand-parent | 1204 | (cons 'grand-parent |
| 1205 | (lambda (_n parent &rest _) | 1205 | (lambda (_n parent &rest _) |
| 1206 | (treesit-node-start (treesit-node-parent parent)))) | 1206 | (treesit-node-start (treesit-node-parent parent)))) |
| 1207 | (cons 'great-grand-parent | ||
| 1208 | (lambda (_n parent &rest _) | ||
| 1209 | (treesit-node-start | ||
| 1210 | (treesit-node-parent | ||
| 1211 | (treesit-node-parent parent))))) | ||
| 1207 | (cons 'parent-bol (lambda (_n parent &rest _) | 1212 | (cons 'parent-bol (lambda (_n parent &rest _) |
| 1208 | (save-excursion | 1213 | (save-excursion |
| 1209 | (goto-char (treesit-node-start parent)) | 1214 | (goto-char (treesit-node-start parent)) |
| @@ -2462,7 +2467,8 @@ to the offending pattern and highlight the pattern." | |||
| 2462 | (with-current-buffer buf | 2467 | (with-current-buffer buf |
| 2463 | (let* ((data (cdr err)) | 2468 | (let* ((data (cdr err)) |
| 2464 | (message (nth 0 data)) | 2469 | (message (nth 0 data)) |
| 2465 | (start (nth 1 data))) | 2470 | (start (nth 1 data)) |
| 2471 | (inhibit-read-only t)) | ||
| 2466 | (erase-buffer) | 2472 | (erase-buffer) |
| 2467 | (insert (treesit-query-expand query)) | 2473 | (insert (treesit-query-expand query)) |
| 2468 | (goto-char start) | 2474 | (goto-char start) |
diff --git a/lisp/window.el b/lisp/window.el index 6f9cd9fc3bf..576478eef88 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -2484,14 +2484,6 @@ and no others." | |||
| 2484 | 2484 | ||
| 2485 | (defalias 'some-window 'get-window-with-predicate) | 2485 | (defalias 'some-window 'get-window-with-predicate) |
| 2486 | 2486 | ||
| 2487 | (defcustom display-buffer-avoid-small-windows nil | ||
| 2488 | "If non-nil, windows that have fewer lines than this are avoided. | ||
| 2489 | This is used by `get-lru-window'. The value is interpreted in units | ||
| 2490 | of the frame's canonical line height, like `window-total-height' does." | ||
| 2491 | :type '(choice (const nil) number) | ||
| 2492 | :version "29.1" | ||
| 2493 | :group 'windows) | ||
| 2494 | |||
| 2495 | (defun get-lru-window (&optional all-frames dedicated not-selected no-other) | 2487 | (defun get-lru-window (&optional all-frames dedicated not-selected no-other) |
| 2496 | "Return the least recently used window on frames specified by ALL-FRAMES. | 2488 | "Return the least recently used window on frames specified by ALL-FRAMES. |
| 2497 | Return a full-width window if possible. A minibuffer window is | 2489 | Return a full-width window if possible. A minibuffer window is |
| @@ -2517,11 +2509,7 @@ have special meanings: | |||
| 2517 | - A frame means consider all windows on that frame only. | 2509 | - A frame means consider all windows on that frame only. |
| 2518 | 2510 | ||
| 2519 | Any other value of ALL-FRAMES means consider all windows on the | 2511 | Any other value of ALL-FRAMES means consider all windows on the |
| 2520 | selected frame and no others. | 2512 | selected frame and no others." |
| 2521 | |||
| 2522 | `display-buffer-avoid-small-windows', if non-nil, is also taken into | ||
| 2523 | consideration. Windows whose height is smaller that the value of that | ||
| 2524 | variable will be avoided if larger windows are available." | ||
| 2525 | (declare (side-effect-free error-free)) | 2513 | (declare (side-effect-free error-free)) |
| 2526 | (let ((windows (window-list-1 nil 'nomini all-frames)) | 2514 | (let ((windows (window-list-1 nil 'nomini all-frames)) |
| 2527 | best-window best-time second-best-window second-best-time time) | 2515 | best-window best-time second-best-window second-best-time time) |
| @@ -2532,9 +2520,6 @@ variable will be avoided if larger windows are available." | |||
| 2532 | (not (window-parameter window 'no-other-window)))) | 2520 | (not (window-parameter window 'no-other-window)))) |
| 2533 | (setq time (window-use-time window)) | 2521 | (setq time (window-use-time window)) |
| 2534 | (if (or (eq window (selected-window)) | 2522 | (if (or (eq window (selected-window)) |
| 2535 | (and display-buffer-avoid-small-windows | ||
| 2536 | (< (window-height window) | ||
| 2537 | display-buffer-avoid-small-windows)) | ||
| 2538 | (not (window-full-width-p window))) | 2523 | (not (window-full-width-p window))) |
| 2539 | (when (or (not second-best-time) (< time second-best-time)) | 2524 | (when (or (not second-best-time) (< time second-best-time)) |
| 2540 | (setq second-best-time time) | 2525 | (setq second-best-time time) |
| @@ -7283,6 +7268,11 @@ entry. Otherwise, if WINDOW is new and the value of | |||
| 7283 | dedicated flag to that value. In any other case, reset WINDOW's | 7268 | dedicated flag to that value. In any other case, reset WINDOW's |
| 7284 | dedicated flag to nil. | 7269 | dedicated flag to nil. |
| 7285 | 7270 | ||
| 7271 | If ALIST contains a non-nil `bump-use-time' entry, bump use time | ||
| 7272 | of WINDOW so further calls of `display-buffer-use-some-window' | ||
| 7273 | and `display-buffer-use-least-recent-window' will try to avoid | ||
| 7274 | it. | ||
| 7275 | |||
| 7286 | Return WINDOW if BUFFER and WINDOW are live." | 7276 | Return WINDOW if BUFFER and WINDOW are live." |
| 7287 | (when (and (buffer-live-p buffer) (window-live-p window)) | 7277 | (when (and (buffer-live-p buffer) (window-live-p window)) |
| 7288 | (display-buffer-record-window type window buffer) | 7278 | (display-buffer-record-window type window buffer) |
| @@ -7290,6 +7280,10 @@ Return WINDOW if BUFFER and WINDOW are live." | |||
| 7290 | ;; Unless WINDOW already shows BUFFER reset its dedicated flag. | 7280 | ;; Unless WINDOW already shows BUFFER reset its dedicated flag. |
| 7291 | (set-window-dedicated-p window nil) | 7281 | (set-window-dedicated-p window nil) |
| 7292 | (set-window-buffer window buffer)) | 7282 | (set-window-buffer window buffer)) |
| 7283 | (when (cdr (assq 'bump-use-time alist)) | ||
| 7284 | ;; Bump WINDOW's use time so 'display-buffer--lru-window' will try | ||
| 7285 | ;; to avoid it. | ||
| 7286 | (window-bump-use-time window)) | ||
| 7293 | (let ((alist-dedicated (assq 'dedicated alist))) | 7287 | (let ((alist-dedicated (assq 'dedicated alist))) |
| 7294 | ;; Maybe dedicate WINDOW to BUFFER if asked for. | 7288 | ;; Maybe dedicate WINDOW to BUFFER if asked for. |
| 7295 | (cond | 7289 | (cond |
| @@ -8511,15 +8505,64 @@ indirectly called by the latter." | |||
| 8511 | (when (setq window (or best-window second-best-window)) | 8505 | (when (setq window (or best-window second-best-window)) |
| 8512 | (window--display-buffer buffer window 'reuse alist)))) | 8506 | (window--display-buffer buffer window 'reuse alist)))) |
| 8513 | 8507 | ||
| 8514 | (defun display-buffer-use-least-recent-window (buffer alist) | 8508 | (defun display-buffer--lru-window (alist) |
| 8515 | "Display BUFFER in an existing window, but that hasn't been used lately. | 8509 | "Return the least recently used window according to ALIST. |
| 8516 | This `display-buffer' action function is like | 8510 | Do not return a minibuffer window or a window dedicated to its |
| 8517 | `display-buffer-use-some-window', but will cycle through windows | 8511 | buffer. ALIST is a buffer display action alist as compiled by |
| 8518 | when displaying buffers repeatedly, and if there's only a single | 8512 | `display-buffer'. The following ALIST entries are honored: |
| 8519 | window, it will split the window." | 8513 | |
| 8520 | (when-let ((window (display-buffer-use-some-window | 8514 | - `lru-frames' specifies the frames to investigate and has the |
| 8521 | buffer (cons (cons 'inhibit-same-window t) alist)))) | 8515 | same meaning as the ALL-FRAMES argument of `get-lru-window'. |
| 8522 | (window-bump-use-time window))) | 8516 | |
| 8517 | - `lru-time' specifies a use time. Do not return a window whose | ||
| 8518 | use time is higher than this. | ||
| 8519 | |||
| 8520 | - `window-min-width' specifies a preferred minimum width in | ||
| 8521 | canonical frame columns. If it is the constant `full-width', | ||
| 8522 | prefer a full-width window. | ||
| 8523 | |||
| 8524 | - `window-min-height' specifies a preferred minimum height in | ||
| 8525 | canonical frame lines. If it is the constant `full-height', | ||
| 8526 | prefer a full-height window. | ||
| 8527 | |||
| 8528 | If ALIST contains a non-nil `inhibit-same--window' entry, do not | ||
| 8529 | return the selected window." | ||
| 8530 | (let ((windows | ||
| 8531 | (window-list-1 nil 'nomini (cdr (assq 'lru-frames alist)))) | ||
| 8532 | (lru-time (cdr (assq 'lru-time alist))) | ||
| 8533 | (min-width (cdr (assq 'window-min-width alist))) | ||
| 8534 | (min-height (cdr (assq 'window-min-height alist))) | ||
| 8535 | (not-this-window (cdr (assq 'inhibit-same-window alist))) | ||
| 8536 | best-window best-time second-best-window second-best-time time) | ||
| 8537 | (dolist (window windows) | ||
| 8538 | (when (and (not (window-dedicated-p window)) | ||
| 8539 | (or (not not-this-window) | ||
| 8540 | (not (eq window (selected-window))))) | ||
| 8541 | (setq time (window-use-time window)) | ||
| 8542 | (unless (and (numberp lru-time) (> time lru-time)) | ||
| 8543 | (if (or (eq window (selected-window)) | ||
| 8544 | (and min-width | ||
| 8545 | (or (and (numberp min-width) | ||
| 8546 | (< (window-width window) min-width)) | ||
| 8547 | (and (eq min-width 'full-width) | ||
| 8548 | (not (window-full-width-p window))))) | ||
| 8549 | (and min-height | ||
| 8550 | (or (and (numberp min-height) | ||
| 8551 | (< (window-height window) min-height)) | ||
| 8552 | (and (eq min-height 'full-height) | ||
| 8553 | (not (window-full-height-p window)))))) | ||
| 8554 | ;; This window is either selected or does not meet the size | ||
| 8555 | ;; restrictions - so it's only a second best choice. Try to | ||
| 8556 | ;; find a more recently used one that fits. | ||
| 8557 | (when (or (not second-best-time) (< time second-best-time)) | ||
| 8558 | (setq second-best-time time) | ||
| 8559 | (setq second-best-window window)) | ||
| 8560 | ;; This window is not selected and does meet the size | ||
| 8561 | ;; restrictions. It's the best choice so far. | ||
| 8562 | (when (or (not best-time) (< time best-time)) | ||
| 8563 | (setq best-time time) | ||
| 8564 | (setq best-window window)))))) | ||
| 8565 | (or best-window second-best-window))) | ||
| 8523 | 8566 | ||
| 8524 | (defun display-buffer-use-some-window (buffer alist) | 8567 | (defun display-buffer-use-some-window (buffer alist) |
| 8525 | "Display BUFFER in an existing window. | 8568 | "Display BUFFER in an existing window. |
| @@ -8543,7 +8586,11 @@ indirectly called by the latter." | |||
| 8543 | (window--frame-usable-p (last-nonminibuffer-frame)))) | 8586 | (window--frame-usable-p (last-nonminibuffer-frame)))) |
| 8544 | (window | 8587 | (window |
| 8545 | ;; Reuse an existing window. | 8588 | ;; Reuse an existing window. |
| 8546 | (or (get-lru-window frame nil not-this-window) | 8589 | (or (display-buffer--lru-window |
| 8590 | ;; If ALIST specifies 'lru-frames' or 'window-min-width' | ||
| 8591 | ;; let them prevail. | ||
| 8592 | (append alist `((lru-frames . ,frame) | ||
| 8593 | (window-min-width . full-width)))) | ||
| 8547 | (let ((window (get-buffer-window buffer 'visible))) | 8594 | (let ((window (get-buffer-window buffer 'visible))) |
| 8548 | (unless (and not-this-window | 8595 | (unless (and not-this-window |
| 8549 | (eq window (selected-window))) | 8596 | (eq window (selected-window))) |
| @@ -8573,6 +8620,76 @@ indirectly called by the latter." | |||
| 8573 | (unless (cdr (assq 'inhibit-switch-frame alist)) | 8620 | (unless (cdr (assq 'inhibit-switch-frame alist)) |
| 8574 | (window--maybe-raise-frame (window-frame window))))))) | 8621 | (window--maybe-raise-frame (window-frame window))))))) |
| 8575 | 8622 | ||
| 8623 | (defun display-buffer-use-least-recent-window (buffer alist) | ||
| 8624 | "Display BUFFER trying to avoid windows used recently. | ||
| 8625 | This is similar to `display-buffer-use-some-window' but tries | ||
| 8626 | hard to avoid using a window recently used by `display-buffer'. | ||
| 8627 | |||
| 8628 | Distinctive features are: | ||
| 8629 | |||
| 8630 | - Do not use the selected window. | ||
| 8631 | |||
| 8632 | - Try first to reuse a window that shows BUFFER already on a | ||
| 8633 | frame specified by a `reusable-frames' ALIST entry, using the | ||
| 8634 | selected frame if no such entry has been specified. | ||
| 8635 | |||
| 8636 | - Next try to show BUFFER in the least recently used window. The | ||
| 8637 | frames to search for such a window can be specified via a | ||
| 8638 | `lru-frames' ALIST entry; if no such entry exists, search the | ||
| 8639 | selected frame only. In addition, try to satisfy constraints | ||
| 8640 | specified by the following ALIST entries, if present: | ||
| 8641 | |||
| 8642 | `lru-time' specifies a use time. Do not return a window whose | ||
| 8643 | use time is higher than this. When calling this action | ||
| 8644 | function repeatedly (presumably to display several buffers in | ||
| 8645 | a row), an application should first save the use time of the | ||
| 8646 | selected window and pass that same value via such an entry in | ||
| 8647 | each call of `display-buffer'. This reduces the probability | ||
| 8648 | that `display-buffer' uses the same window as a previous | ||
| 8649 | call. | ||
| 8650 | |||
| 8651 | `window-min-width' specifies a preferred minimum width in | ||
| 8652 | canonical frame columns. If it is the constant `full-width', | ||
| 8653 | prefer a full-width window. | ||
| 8654 | |||
| 8655 | `window-min-height' specifies a preferred minimum height in | ||
| 8656 | canonical frame lines. If it is the constant `full-height', | ||
| 8657 | prefer a full-height window. | ||
| 8658 | |||
| 8659 | - If the preceding steps fail, try to pop up a new window on the | ||
| 8660 | selected frame. | ||
| 8661 | |||
| 8662 | If a window is found, bump the use time of that window to the | ||
| 8663 | highest use time after the selected window. This makes it less | ||
| 8664 | probable that a future invocation of this function uses that | ||
| 8665 | window for another buffer." | ||
| 8666 | (let* ((alist (cons (cons 'inhibit-same-window t) alist)) | ||
| 8667 | (window | ||
| 8668 | (or (display-buffer-reuse-window buffer alist) | ||
| 8669 | (let ((window (display-buffer--lru-window alist))) | ||
| 8670 | (when (window-live-p window) | ||
| 8671 | (let* ((quit-restore (window-parameter window 'quit-restore)) | ||
| 8672 | (quad (nth 1 quit-restore))) | ||
| 8673 | ;; If the window was used by `display-buffer' before, try to | ||
| 8674 | ;; resize it to its old height but don't signal an error. | ||
| 8675 | (when (and (listp quad) | ||
| 8676 | (integerp (nth 3 quad)) | ||
| 8677 | (> (nth 3 quad) (window-total-height window))) | ||
| 8678 | (condition-case nil | ||
| 8679 | (window-resize | ||
| 8680 | window (- (nth 3 quad) (window-total-height window))) | ||
| 8681 | (error nil))) | ||
| 8682 | (prog1 | ||
| 8683 | (window--display-buffer buffer window 'reuse alist) | ||
| 8684 | (window--even-window-sizes window) | ||
| 8685 | (unless (cdr (assq 'inhibit-switch-frame alist)) | ||
| 8686 | (window--maybe-raise-frame (window-frame window))))))) | ||
| 8687 | (display-buffer-pop-up-window buffer alist)))) | ||
| 8688 | ;; Don't bump use time twice. | ||
| 8689 | (when (and window (not (cdr (assq 'bump-use-time alist)))) | ||
| 8690 | (window-bump-use-time window)) | ||
| 8691 | window)) | ||
| 8692 | |||
| 8576 | (defun display-buffer-no-window (_buffer alist) | 8693 | (defun display-buffer-no-window (_buffer alist) |
| 8577 | "Display BUFFER in no window. | 8694 | "Display BUFFER in no window. |
| 8578 | ALIST is an association list of action symbols and values. See | 8695 | ALIST is an association list of action symbols and values. See |
diff --git a/src/treesit.c b/src/treesit.c index e1d6f1ef79f..ef0f2407840 100644 --- a/src/treesit.c +++ b/src/treesit.c | |||
| @@ -797,12 +797,10 @@ treesit_record_change (ptrdiff_t start_byte, ptrdiff_t old_end_byte, | |||
| 797 | max (visible_beg, old_end_byte)) | 797 | max (visible_beg, old_end_byte)) |
| 798 | - visible_beg); | 798 | - visible_beg); |
| 799 | /* We don't clip new_end_offset under visible_end, because | 799 | /* We don't clip new_end_offset under visible_end, because |
| 800 | inserting in narrowed region always extends the visible | 800 | otherwise we would miss updating the clipped part. Plus, |
| 801 | region. If we clip new_end_offset here, and re-add the | 801 | when inserting in narrowed region, the narrowed region |
| 802 | clipped "tail" in treesit_sync_visible_region later, | 802 | will grow to accommodate the new text, so this is the |
| 803 | while it is technically equivalent, tree-sitter's | 803 | correct behavior. (Bug#61369). */ |
| 804 | incremental parsing algorithm doesn't seem to like it | ||
| 805 | (bug#61369). */ | ||
| 806 | ptrdiff_t new_end_offset = (max (visible_beg, new_end_byte) | 804 | ptrdiff_t new_end_offset = (max (visible_beg, new_end_byte) |
| 807 | - visible_beg); | 805 | - visible_beg); |
| 808 | eassert (start_offset <= old_end_offset); | 806 | eassert (start_offset <= old_end_offset); |
diff --git a/src/window.c b/src/window.c index 9334f922f89..bf89261e79c 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -762,10 +762,15 @@ future use. */) | |||
| 762 | 762 | ||
| 763 | DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0, | 763 | DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0, |
| 764 | doc: /* Return the use time of window WINDOW. | 764 | doc: /* Return the use time of window WINDOW. |
| 765 | WINDOW must be a live window and defaults to the selected one. | 765 | WINDOW must specify a live window and defaults to the selected one. |
| 766 | The window with the highest use time is the most recently selected | 766 | |
| 767 | one. The window with the lowest use time is the least recently | 767 | The window with the highest use time is usually the one most recently |
| 768 | selected one. */) | 768 | selected by calling `select-window' with NORECORD nil. The window with |
| 769 | the lowest use time is usually the least recently selected one chosen in | ||
| 770 | such a way. | ||
| 771 | |||
| 772 | Note that the use time of a window can be also changed by calling | ||
| 773 | `window-bump-use-time' for that window. */) | ||
| 769 | (Lisp_Object window) | 774 | (Lisp_Object window) |
| 770 | { | 775 | { |
| 771 | return make_fixnum (decode_live_window (window)->use_time); | 776 | return make_fixnum (decode_live_window (window)->use_time); |
| @@ -773,15 +778,27 @@ selected one. */) | |||
| 773 | 778 | ||
| 774 | DEFUN ("window-bump-use-time", Fwindow_bump_use_time, | 779 | DEFUN ("window-bump-use-time", Fwindow_bump_use_time, |
| 775 | Swindow_bump_use_time, 0, 1, 0, | 780 | Swindow_bump_use_time, 0, 1, 0, |
| 776 | doc: /* Mark WINDOW as having been most recently used. | 781 | doc: /* Mark WINDOW as second most recently used. |
| 777 | WINDOW must be a live window and defaults to the selected one. */) | 782 | WINDOW must specify a live window. |
| 783 | |||
| 784 | If WINDOW is not selected and the selected window has the highest use | ||
| 785 | time of all windows, set the use time of WINDOW to that of the selected | ||
| 786 | window, increase the use time of the selected window by one and return | ||
| 787 | the new use time of WINDOW. Otherwise, do nothing and return nil. */) | ||
| 778 | (Lisp_Object window) | 788 | (Lisp_Object window) |
| 779 | { | 789 | { |
| 780 | struct window *w = decode_live_window (window); | 790 | struct window *w = decode_live_window (window); |
| 791 | struct window *sw = XWINDOW (selected_window); | ||
| 781 | 792 | ||
| 782 | w->use_time = ++window_select_count; | 793 | if (w != sw && sw->use_time == window_select_count) |
| 794 | { | ||
| 795 | w->use_time = window_select_count; | ||
| 796 | sw->use_time = ++window_select_count; | ||
| 783 | 797 | ||
| 784 | return Qnil; | 798 | return make_fixnum (w->use_time); |
| 799 | } | ||
| 800 | else | ||
| 801 | return Qnil; | ||
| 785 | } | 802 | } |
| 786 | 803 | ||
| 787 | DEFUN ("window-pixel-width", Fwindow_pixel_width, Swindow_pixel_width, 0, 1, 0, | 804 | DEFUN ("window-pixel-width", Fwindow_pixel_width, Swindow_pixel_width, 0, 1, 0, |
diff --git a/src/xdisp.c b/src/xdisp.c index 21362d0b9d8..879ce4ca8b2 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -9609,8 +9609,8 @@ move_it_in_display_line_to (struct it *it, | |||
| 9609 | else | 9609 | else |
| 9610 | line_number_pending = true; | 9610 | line_number_pending = true; |
| 9611 | } | 9611 | } |
| 9612 | /* If there's a line-/wrap-prefix, handle it. */ | 9612 | /* If there's a line-/wrap-prefix, handle it, if we didn't already. */ |
| 9613 | if (it->method == GET_FROM_BUFFER) | 9613 | if (it->area == TEXT_AREA && !it->string_from_prefix_prop_p) |
| 9614 | handle_line_prefix (it); | 9614 | handle_line_prefix (it); |
| 9615 | } | 9615 | } |
| 9616 | 9616 | ||
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index df71990278e..4f24c042c6a 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el | |||
| @@ -189,6 +189,14 @@ default to `point-min' and `point-max' respectively." | |||
| 189 | (overlay-end overlay)))) | 189 | (overlay-end overlay)))) |
| 190 | (buffer-substring-no-properties (point-min) (point-max))))) | 190 | (buffer-substring-no-properties (point-min) (point-max))))) |
| 191 | 191 | ||
| 192 | (defun python-tests-should-not-move (func &rest args) | ||
| 193 | "Assert that point does not move while calling FUNC with ARGS. | ||
| 194 | Returns the value returned by FUNC." | ||
| 195 | (let ((pos (point)) | ||
| 196 | (ret (apply func args))) | ||
| 197 | (should (= pos (point))) | ||
| 198 | ret)) | ||
| 199 | |||
| 192 | (defun python-virt-bin (&optional virt-root) | 200 | (defun python-virt-bin (&optional virt-root) |
| 193 | "Return the virtualenv bin dir, starting from VIRT-ROOT. | 201 | "Return the virtualenv bin dir, starting from VIRT-ROOT. |
| 194 | If nil, VIRT-ROOT defaults to `python-shell-virtualenv-root'. | 202 | If nil, VIRT-ROOT defaults to `python-shell-virtualenv-root'. |
| @@ -4213,7 +4221,8 @@ class Bar(models.Model): | |||
| 4213 | pass | 4221 | pass |
| 4214 | " | 4222 | " |
| 4215 | (should (string= (buffer-string) | 4223 | (should (string= (buffer-string) |
| 4216 | (python-shell-buffer-substring (point-min) (point-max)))))) | 4224 | (python-tests-should-not-move |
| 4225 | #'python-shell-buffer-substring (point-min) (point-max)))))) | ||
| 4217 | 4226 | ||
| 4218 | (ert-deftest python-shell-buffer-substring-2 () | 4227 | (ert-deftest python-shell-buffer-substring-2 () |
| 4219 | "Main block should be removed if NOMAIN is non-nil." | 4228 | "Main block should be removed if NOMAIN is non-nil." |
| @@ -4229,7 +4238,8 @@ if __name__ == \"__main__\": | |||
| 4229 | foo = Foo() | 4238 | foo = Foo() |
| 4230 | print (foo) | 4239 | print (foo) |
| 4231 | " | 4240 | " |
| 4232 | (should (string= (python-shell-buffer-substring (point-min) (point-max) t) | 4241 | (should (string= (python-tests-should-not-move |
| 4242 | #'python-shell-buffer-substring (point-min) (point-max) t) | ||
| 4233 | " | 4243 | " |
| 4234 | class Foo(models.Model): | 4244 | class Foo(models.Model): |
| 4235 | pass | 4245 | pass |
| @@ -4256,7 +4266,8 @@ if __name__ == \"__main__\": | |||
| 4256 | class Bar(models.Model): | 4266 | class Bar(models.Model): |
| 4257 | pass | 4267 | pass |
| 4258 | " | 4268 | " |
| 4259 | (should (string= (python-shell-buffer-substring (point-min) (point-max) t) | 4269 | (should (string= (python-tests-should-not-move |
| 4270 | #'python-shell-buffer-substring (point-min) (point-max) t) | ||
| 4260 | " | 4271 | " |
| 4261 | class Foo(models.Model): | 4272 | class Foo(models.Model): |
| 4262 | pass | 4273 | pass |
| @@ -4284,7 +4295,8 @@ if __name__ == \"__main__\": | |||
| 4284 | class Bar(models.Model): | 4295 | class Bar(models.Model): |
| 4285 | pass | 4296 | pass |
| 4286 | " | 4297 | " |
| 4287 | (should (string= (python-shell-buffer-substring | 4298 | (should (string= (python-tests-should-not-move |
| 4299 | #'python-shell-buffer-substring | ||
| 4288 | (python-tests-look-at "class Foo(models.Model):") | 4300 | (python-tests-look-at "class Foo(models.Model):") |
| 4289 | (progn (python-nav-forward-sexp) (point))) | 4301 | (progn (python-nav-forward-sexp) (point))) |
| 4290 | "# -*- coding: latin-1 -*- | 4302 | "# -*- coding: latin-1 -*- |
| @@ -4307,7 +4319,8 @@ if __name__ == \"__main__\": | |||
| 4307 | class Bar(models.Model): | 4319 | class Bar(models.Model): |
| 4308 | pass | 4320 | pass |
| 4309 | " | 4321 | " |
| 4310 | (should (string= (python-shell-buffer-substring | 4322 | (should (string= (python-tests-should-not-move |
| 4323 | #'python-shell-buffer-substring | ||
| 4311 | (python-tests-look-at "class Bar(models.Model):") | 4324 | (python-tests-look-at "class Bar(models.Model):") |
| 4312 | (progn (python-nav-forward-sexp) (point))) | 4325 | (progn (python-nav-forward-sexp) (point))) |
| 4313 | "# -*- coding: latin-1 -*- | 4326 | "# -*- coding: latin-1 -*- |
| @@ -4338,7 +4351,8 @@ if __name__ == \"__main__\": | |||
| 4338 | class Bar(models.Model): | 4351 | class Bar(models.Model): |
| 4339 | pass | 4352 | pass |
| 4340 | " | 4353 | " |
| 4341 | (should (string= (python-shell-buffer-substring | 4354 | (should (string= (python-tests-should-not-move |
| 4355 | #'python-shell-buffer-substring | ||
| 4342 | (python-tests-look-at "# coding: latin-1") | 4356 | (python-tests-look-at "# coding: latin-1") |
| 4343 | (python-tests-look-at "if __name__ == \"__main__\":")) | 4357 | (python-tests-look-at "if __name__ == \"__main__\":")) |
| 4344 | "# -*- coding: latin-1 -*- | 4358 | "# -*- coding: latin-1 -*- |
| @@ -4365,7 +4379,8 @@ if __name__ == \"__main__\": | |||
| 4365 | class Bar(models.Model): | 4379 | class Bar(models.Model): |
| 4366 | pass | 4380 | pass |
| 4367 | " | 4381 | " |
| 4368 | (should (string= (python-shell-buffer-substring | 4382 | (should (string= (python-tests-should-not-move |
| 4383 | #'python-shell-buffer-substring | ||
| 4369 | (python-tests-look-at "# coding: latin-1") | 4384 | (python-tests-look-at "# coding: latin-1") |
| 4370 | (python-tests-look-at "if __name__ == \"__main__\":")) | 4385 | (python-tests-look-at "if __name__ == \"__main__\":")) |
| 4371 | "# -*- coding: utf-8 -*- | 4386 | "# -*- coding: utf-8 -*- |
| @@ -4385,7 +4400,8 @@ class Foo(models.Model): | |||
| 4385 | class Foo(models.Model): | 4400 | class Foo(models.Model): |
| 4386 | pass | 4401 | pass |
| 4387 | " | 4402 | " |
| 4388 | (should (string= (python-shell-buffer-substring (point-min) (point-max)) | 4403 | (should (string= (python-tests-should-not-move |
| 4404 | #'python-shell-buffer-substring (point-min) (point-max)) | ||
| 4389 | "# coding: utf-8 | 4405 | "# coding: utf-8 |
| 4390 | 4406 | ||
| 4391 | 4407 | ||
| @@ -4404,7 +4420,8 @@ class Foo(models.Model): | |||
| 4404 | class Bar(models.Model): | 4420 | class Bar(models.Model): |
| 4405 | pass | 4421 | pass |
| 4406 | " | 4422 | " |
| 4407 | (should (string= (python-shell-buffer-substring | 4423 | (should (string= (python-tests-should-not-move |
| 4424 | #'python-shell-buffer-substring | ||
| 4408 | (point-min) | 4425 | (point-min) |
| 4409 | (python-tests-look-at "class Bar(models.Model):")) | 4426 | (python-tests-look-at "class Bar(models.Model):")) |
| 4410 | "# coding: utf-8 | 4427 | "# coding: utf-8 |
| @@ -4421,7 +4438,8 @@ class Foo(models.Model): | |||
| 4421 | def foo(): | 4438 | def foo(): |
| 4422 | print ('a') | 4439 | print ('a') |
| 4423 | " | 4440 | " |
| 4424 | (should (string= (python-shell-buffer-substring | 4441 | (should (string= (python-tests-should-not-move |
| 4442 | #'python-shell-buffer-substring | ||
| 4425 | (python-tests-look-at "print ('a')") | 4443 | (python-tests-look-at "print ('a')") |
| 4426 | (point-max)) | 4444 | (point-max)) |
| 4427 | "# -*- coding: utf-8 -*-\nif True:\n print ('a')\n\n")))) | 4445 | "# -*- coding: utf-8 -*-\nif True:\n print ('a')\n\n")))) |
| @@ -4433,7 +4451,8 @@ def foo(): | |||
| 4433 | def foo(): | 4451 | def foo(): |
| 4434 | print ('a') | 4452 | print ('a') |
| 4435 | " | 4453 | " |
| 4436 | (should (string= (python-shell-buffer-substring | 4454 | (should (string= (python-tests-should-not-move |
| 4455 | #'python-shell-buffer-substring | ||
| 4437 | (progn | 4456 | (progn |
| 4438 | (python-tests-look-at "print ('a')") | 4457 | (python-tests-look-at "print ('a')") |
| 4439 | (backward-char 1) | 4458 | (backward-char 1) |
| @@ -4451,7 +4470,8 @@ def foo(): | |||
| 4451 | 4470 | ||
| 4452 | print ('a') | 4471 | print ('a') |
| 4453 | " | 4472 | " |
| 4454 | (should (string= (python-shell-buffer-substring | 4473 | (should (string= (python-tests-should-not-move |
| 4474 | #'python-shell-buffer-substring | ||
| 4455 | (python-tests-look-at "# Whitespace") | 4475 | (python-tests-look-at "# Whitespace") |
| 4456 | (point-max)) | 4476 | (point-max)) |
| 4457 | "# -*- coding: utf-8 -*-\n\nif True:\n # Whitespace\n\n print ('a')\n\n")))) | 4477 | "# -*- coding: utf-8 -*-\n\nif True:\n # Whitespace\n\n print ('a')\n\n")))) |
| @@ -4463,7 +4483,8 @@ def foo(): | |||
| 4463 | def foo(): | 4483 | def foo(): |
| 4464 | a = 1 | 4484 | a = 1 |
| 4465 | " | 4485 | " |
| 4466 | (should (string= (python-shell-buffer-substring | 4486 | (should (string= (python-tests-should-not-move |
| 4487 | #'python-shell-buffer-substring | ||
| 4467 | (python-tests-look-at "a = 1") | 4488 | (python-tests-look-at "a = 1") |
| 4468 | (pos-eol)) | 4489 | (pos-eol)) |
| 4469 | "# -*- coding: utf-8 -*-\n\na = 1")))) | 4490 | "# -*- coding: utf-8 -*-\n\na = 1")))) |
| @@ -4476,7 +4497,8 @@ def foo(): | |||
| 4476 | a = \"\"\"Some | 4497 | a = \"\"\"Some |
| 4477 | string\"\"\" | 4498 | string\"\"\" |
| 4478 | " | 4499 | " |
| 4479 | (should (string= (python-shell-buffer-substring | 4500 | (should (string= (python-tests-should-not-move |
| 4501 | #'python-shell-buffer-substring | ||
| 4480 | (python-tests-look-at "a = \"\"\"Some") | 4502 | (python-tests-look-at "a = \"\"\"Some") |
| 4481 | (pos-eol 2)) | 4503 | (pos-eol 2)) |
| 4482 | "# -*- coding: utf-8 -*-\n\na = \"\"\"Some\n string\"\"\"")))) | 4504 | "# -*- coding: utf-8 -*-\n\na = \"\"\"Some\n string\"\"\"")))) |
| @@ -4488,7 +4510,8 @@ def foo(): | |||
| 4488 | def foo(): | 4510 | def foo(): |
| 4489 | a = 1 | 4511 | a = 1 |
| 4490 | " | 4512 | " |
| 4491 | (should (string= (python-shell-buffer-substring | 4513 | (should (string= (python-tests-should-not-move |
| 4514 | #'python-shell-buffer-substring | ||
| 4492 | (python-tests-look-at " a = 1") | 4515 | (python-tests-look-at " a = 1") |
| 4493 | (python-tests-look-at " = 1")) | 4516 | (python-tests-look-at " = 1")) |
| 4494 | "# -*- coding: utf-8 -*-\n\na")))) | 4517 | "# -*- coding: utf-8 -*-\n\na")))) |
| @@ -4500,7 +4523,8 @@ def foo(): | |||
| 4500 | def foo(): | 4523 | def foo(): |
| 4501 | a = 1 | 4524 | a = 1 |
| 4502 | " | 4525 | " |
| 4503 | (should (string= (python-shell-buffer-substring | 4526 | (should (string= (python-tests-should-not-move |
| 4527 | #'python-shell-buffer-substring | ||
| 4504 | (python-tests-look-at "1") | 4528 | (python-tests-look-at "1") |
| 4505 | (1+ (point))) | 4529 | (1+ (point))) |
| 4506 | "# -*- coding: utf-8 -*-\n\n1")))) | 4530 | "# -*- coding: utf-8 -*-\n\n1")))) |
| @@ -4515,7 +4539,8 @@ def foo(): | |||
| 4515 | b = 2 | 4539 | b = 2 |
| 4516 | \"\"\" | 4540 | \"\"\" |
| 4517 | " | 4541 | " |
| 4518 | (should (string= (python-shell-buffer-substring | 4542 | (should (string= (python-tests-should-not-move |
| 4543 | #'python-shell-buffer-substring | ||
| 4519 | (python-tests-look-at "a = 1") | 4544 | (python-tests-look-at "a = 1") |
| 4520 | (python-tests-look-at "\"\"\"")) | 4545 | (python-tests-look-at "\"\"\"")) |
| 4521 | "# -*- coding: utf-8 -*-\n\nif True:\n a = 1\n b = 2\n\n")))) | 4546 | "# -*- coding: utf-8 -*-\n\nif True:\n a = 1\n b = 2\n\n")))) |
| @@ -4525,7 +4550,8 @@ def foo(): | |||
| 4525 | (python-tests-with-temp-buffer | 4550 | (python-tests-with-temp-buffer |
| 4526 | "s = 'test' | 4551 | "s = 'test' |
| 4527 | " | 4552 | " |
| 4528 | (should (string= (python-shell-buffer-substring | 4553 | (should (string= (python-tests-should-not-move |
| 4554 | #'python-shell-buffer-substring | ||
| 4529 | (python-tests-look-at "'test'") | 4555 | (python-tests-look-at "'test'") |
| 4530 | (pos-eol)) | 4556 | (pos-eol)) |
| 4531 | "'test'")))) | 4557 | "'test'")))) |