commit 32a67a5cfbfb92a9f76a5caf1c4b84beffcb1d9e (HEAD, refs/remotes/origin/master) Author: Juanma Barranquero Date: Tue Oct 8 02:53:02 2019 +0200 Set default colors for tick faces * lisp/faces.el (line-number-major-tick, line-number-minor-tick): Set default color different from `line-number' so after customizing the tick number variables, the ticks are immediately visible. Suggested by Juri Linkov . diff --git a/lisp/faces.el b/lisp/faces.el index 58b6349ccf..c789d3729e 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2391,7 +2391,11 @@ unwanted effects." :group 'display-line-numbers) (defface line-number-major-tick - '((t :inherit line-number)) + '((((class color grayscale) (background light)) + :foreground "grey55" :bold t) + (((class color grayscale) (background dark)) + :foreground "grey75" :bold t) + (t :inherit line-number)) "Face for highlighting \"major ticks\" (as in a ruler). When `display-line-numbers-major-tick' is positive, highlight the line numbers of lines which are a multiple of its value. @@ -2408,7 +2412,11 @@ unwanted effects." :group 'display-line-numbers) (defface line-number-minor-tick - '((t :inherit line-number)) + '((((class color grayscale) (background light)) + :foreground "grey65" :bold t) + (((class color grayscale) (background dark)) + :foreground "grey55" :bold t) + (t :inherit line-number)) "Face for highlighting \"minor ticks\" (as in a ruler). When `display-line-numbers-minor-tick' is positive, highlight the line numbers of lines which are a multiple of its value. commit 373ffc59317cb96e253a0b0939b921e9172b44ff Author: Basil L. Contovounesios Date: Wed Jul 17 13:05:42 2019 +0100 Clarify docs on newline and auto-fill-mode * doc/lispref/text.texi (Commands for Insertion): * lisp/simple.el (newline): Do not mention conditions specific to 'do-auto-fill' under documentation of 'newline' (bug#36702). diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 8d78a9b24f..ef1d8ebc57 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -545,25 +545,28 @@ Do not try substituting your own definition of loop handles this function specially. @end deffn -@deffn Command newline &optional number-of-newlines +@deffn Command newline &optional number-of-newlines interactive This command inserts newlines into the current buffer before point. If @var{number-of-newlines} is supplied, that many newline characters -are inserted. +are inserted. In an interactive call, @var{number-of-newlines} is the +numeric prefix argument. @cindex newline and Auto Fill mode -This function calls @code{auto-fill-function} if the current column -number is greater than the value of @code{fill-column} and -@var{number-of-newlines} is @code{nil}. Typically what +This command calls @code{self-insert-command} to insert newlines, +which may subsequently break the preceding line by calling +@code{auto-fill-function} (@pxref{Auto Filling}). Typically what @code{auto-fill-function} does is insert a newline; thus, the overall result in this case is to insert two newlines at different places: one at point, and another earlier in the line. @code{newline} does not auto-fill if @var{number-of-newlines} is non-@code{nil}. +This command does not run the hook @code{post-self-insert-hook} unless +called interactively or @var{interactive} is non-@code{nil}. + This command indents to the left margin if that is not zero. @xref{Margins}. -The value returned is @code{nil}. In an interactive call, @var{count} -is the numeric prefix argument. +The value returned is @code{nil}. @end deffn @defvar overwrite-mode diff --git a/lisp/simple.el b/lisp/simple.el index ecd7eb797e..b5205dd764 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -500,17 +500,18 @@ If `electric-indent-mode' is enabled, this indents the final new line that it adds, and reindents the preceding line. To just insert a newline, use \\[electric-indent-just-newline]. -Calls `auto-fill-function' if the current column number is greater -than the value of `fill-column' and ARG is nil. +If `auto-fill-mode' is enabled, this may cause automatic line +breaking of the preceding line. A non-nil ARG inhibits this. + A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'." (interactive "*P\np") (barf-if-buffer-read-only) - ;; Call self-insert so that auto-fill, abbrev expansion etc. happens. + ;; Call self-insert so that auto-fill, abbrev expansion etc. happen. ;; Set last-command-event to tell self-insert what to insert. (let* ((was-page-start (and (bolp) (looking-at page-delimiter))) (beforepos (point)) (last-command-event ?\n) - ;; Don't auto-fill if we have a numeric argument. + ;; Don't auto-fill if we have a prefix argument. (auto-fill-function (if arg nil auto-fill-function)) (arg (prefix-numeric-value arg)) (postproc commit 3f9ad4e725788dff5eaafc4678286c9386302a17 Author: Juri Linkov Date: Tue Oct 8 01:28:42 2019 +0300 * lisp/tab-bar.el (tab-bar-tab-name-function): Turn defvar into defcustom. (tab-bar-tab-name-all-windows): Rename from tab-bar-tab-name. (tab-bar-tab-name-selected-window): New function used by default. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 1c1acaafa4..91bc589ae2 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -249,13 +249,29 @@ This helps to select the tab by its number using `tab-bar-select-tab'." (defvar tab-bar-separator nil) -(defvar tab-bar-tab-name-function #'tab-bar-tab-name +(defcustom tab-bar-tab-name-function #'tab-bar-tab-name-selected-window "Function to get a tab name. Function gets no arguments. -By default, use function `tab-bar-tab-name'.") +The choice is between displaying only the name of the current buffer +in the tab name (default), or displaying the names of all buffers +from all windows in the window configuration." + :type '(choice (const :tag "Selected window buffer" tab-bar-tab-name-selected-window) + (const :tag "All window buffers" tab-bar-tab-name-all-windows) + (function :tag "Function")) + :initialize 'custom-initialize-default + :set (lambda (sym val) + (set-default sym val) + (force-mode-line-update)) + :group 'tab-bar + :version "27.1") + +(defun tab-bar-tab-name-selected-window () + "Generate tab name from the buffer of the selected window. +Also add the number of windows in the window configuration." + (format "%s (%d)" (buffer-name) (length (window-list-1 nil 'nomini)))) -(defun tab-bar-tab-name () - "Generate tab name in the context of the selected frame." +(defun tab-bar-tab-name-all-windows () + "Generate tab name from buffers of all windows." (mapconcat #'buffer-name (delete-dups (mapcar #'window-buffer (window-list-1 (frame-first-window) commit 9839466b231b6384055b9b137405730876413cbe Author: Stefan Kangas Date: Sun Oct 6 03:08:27 2019 +0200 Add "python3 -m twine" example to comint-password-prompt tests * test/lisp/comint-tests.el (comint-testsuite-password-strings): Add new example for "python3 -m twine" to test suite. (Bug#37636) diff --git a/test/lisp/comint-tests.el b/test/lisp/comint-tests.el index 09f10879f9..068fec8995 100644 --- a/test/lisp/comint-tests.el +++ b/test/lisp/comint-tests.el @@ -34,6 +34,7 @@ "Enter passphrase: " ; ssh-add "Enter passphrase (empty for no passphrase): " ; ssh-keygen "Enter same passphrase again: " ; ssh-keygen + "Enter your password: " ; python3 -m twine ... Bug#37636 "Passphrase for key root@GNU.ORG: " ; plink "[sudo] password for user:" ; Ubuntu sudo "[sudo] user 的密码:" ; localized commit 18251fb73941bc2aac5aac8d5e63bfdcfa9d3c8a Author: Eli Zaretskii Date: Mon Oct 7 21:22:03 2019 +0300 Fix a crash in TTY sessions caused by recent changes * src/xdisp.c (redisplay_internal): Fix crashes in TTY sessions when turning on tab-mode. Reported by Ergus . diff --git a/src/xdisp.c b/src/xdisp.c index 192bf01013..29d49d57df 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -15680,9 +15680,11 @@ redisplay_internal (void) /* On some platforms (at least MS-Windows), the scroll_run_hook called from scrolling_window called from update_frame could set the frame's - garbaged flag, in which case we need to - redisplay the frame. */ - if (FRAME_GARBAGED_P (f)) + garbaged flag, in which case we need to redisplay + the frame. Don't do that on TTY frames, since we + need to keep the garbaged flag in that case when + the frame has been resized. */ + if (FRAME_WINDOW_P (f) && FRAME_GARBAGED_P (f)) { fset_redisplay (f); f->garbaged = false; commit 67830e756911f0c262bb3a447e58b9ff6739a60f Author: Lars Ingebrigtsen Date: Mon Oct 7 20:11:26 2019 +0200 Use text properties instead of truncating strings * lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag): Use this to allow using commands like `C-s' to search for even truncated bits. * lisp/international/mule-util.el (truncate-string-to-width): Allow using text properties to truncate strings instead of actually truncating strings (bug#17782). diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index ade6028588..66a859f56c 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -544,7 +544,7 @@ Return the column number after insertion." (when (and not-last-col (> label-width available-space) (setq label (truncate-string-to-width - label available-space nil nil t) + label available-space nil nil t t) label-width available-space))) (setq label (bidi-string-mark-left-to-right label)) (when (and right-align (> width label-width)) diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el index 19d6d165cf..a1603e0671 100644 --- a/lisp/international/mule-util.el +++ b/lisp/international/mule-util.el @@ -50,7 +50,8 @@ Serves as default value of ELLIPSIS argument to `truncate-string-to-width'.") ;;;###autoload (defun truncate-string-to-width (str end-column - &optional start-column padding ellipsis) + &optional start-column padding ellipsis + ellipsis-text-property) "Truncate string STR to end at column END-COLUMN. The optional 3rd arg START-COLUMN, if non-nil, specifies the starting column; that means to return the characters occupying columns @@ -72,7 +73,11 @@ If ELLIPSIS is non-nil, it should be a string which will replace the end of STR (including any padding) if it extends beyond END-COLUMN, unless the display width of STR is equal to or less than the display width of ELLIPSIS. If it is non-nil and not a string, then ELLIPSIS -defaults to `truncate-string-ellipsis'." +defaults to `truncate-string-ellipsis'. + +If ELLIPSIS-TEXT-PROPERTY in non-nil, a too-long string will not +be truncated, but instead the elided parts will be covered by a +`display' text property showing the ellipsis." (or start-column (setq start-column 0)) (when (and ellipsis (not (stringp ellipsis))) @@ -113,8 +118,16 @@ defaults to `truncate-string-ellipsis'." idx last-idx)) (when (and padding (< column end-column)) (setq tail-padding (make-string (- end-column column) padding)))) - (concat head-padding (substring str from-idx idx) - tail-padding ellipsis)))) + (if (and ellipsis-text-property + (not (equal ellipsis "")) + idx) + ;; Use text properties for the ellipsis. + (concat head-padding + (substring str from-idx idx) + (propertize (substring str idx) 'display (or ellipsis ""))) + ;; (Possibly) chop off bits of the string. + (concat head-padding (substring str from-idx idx) + tail-padding ellipsis))))) ;;; Nested alist handler. commit 7b3932f2440df61acd20743f230b05ffc4f8d2d8 Author: Lars Ingebrigtsen Date: Mon Oct 7 19:44:17 2019 +0200 dired-move-to-filename doc string fix * lisp/dired.el (dired-move-to-filename): Document the parameters (bug#17566). diff --git a/lisp/dired.el b/lisp/dired.el index efe00d1ba4..6e48d28b4c 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2582,7 +2582,13 @@ See options: `dired-hide-details-hide-symlink-targets' and ;; Returns position (point) or nil if no filename on this line." (defun dired-move-to-filename (&optional raise-error eol) "Move to the beginning of the filename on the current line. -Return the position of the beginning of the filename, or nil if none found." +Return the position of the beginning of the filename, or nil if none found. + +If RAISE-ERROR, signal an error if we can't find the filename on +the current line. + +If EOL, it should be an position to use instead of +`line-end-position' as the end of the line." ;; This is the UNIX version. (or eol (setq eol (line-end-position))) (beginning-of-line) commit bb596474207632ac5cfd139baad000c5470f6dae Author: Basil L. Contovounesios Date: Mon Oct 7 17:54:18 2019 +0100 Improve recent doc fix for cl-reduce * lisp/emacs-lisp/cl-seq.el: (cl-reduce): Clarify treatment of :INITIAL-VALUE when :FROM-END is non-nil. Improve wording when SEQ is empty and :INITIAL-VALUE is unspecified (bug#37400). Describe behavior when SEQ comprises a single element. diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el index 520d450481..df3fbe89e9 100644 --- a/lisp/emacs-lisp/cl-seq.el +++ b/lisp/emacs-lisp/cl-seq.el @@ -129,14 +129,16 @@ second element of SEQ, then calling FUNCTION with that result and the third element of SEQ, then with that result and the fourth element of SEQ, etc. -If :INITIAL-VALUE is specified, it is added to the front of SEQ. -If SEQ is empty, return :INITIAL-VALUE and FUNCTION is not -called. - -If SEQ is empty and no :INITIAL-VALUE is given, then the function -is called with zero arguments, and reduce returns whatever -function does. This is the only case where the function is called -with other than two arguments. +If :INITIAL-VALUE is specified, it is logically added to the +front of SEQ (or the back if :FROM-END is non-nil). If SEQ is +empty, return :INITIAL-VALUE and FUNCTION is not called. + +If SEQ is empty and no :INITIAL-VALUE is specified, then return +the result of calling FUNCTION with zero arguments. This is the +only case where FUNCTION is called with fewer than two arguments. + +If SEQ contains exactly one element and no :INITIAL-VALUE is +specified, then return that element and FUNCTION is not called. \n(fn FUNCTION SEQ [KEYWORD VALUE]...)" (cl--parsing-keywords (:from-end (:start 0) :end :initial-value :key) () commit 6fe58ff08865c4fd1ffaf3b01e4f1bbaa1c98ed3 Author: Lars Ingebrigtsen Date: Mon Oct 7 18:05:58 2019 +0200 Make completion in the `E' command in *Ibuffer* work * lisp/ibuf-ext.el (eval): Make completion (etc) work as normal (bug#16239). diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 2746e4115a..44c7e74839 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -563,10 +563,7 @@ format. See `ibuffer-update-saved-filters-format' and Does not display the buffer during evaluation. See `ibuffer-do-view-and-eval' for that." (:interactive - (list - (read-from-minibuffer - "Eval in buffers (form): " - nil read-expression-map t 'read-expression-history)) + (list (read--expression "Eval in buffers (form): ")) :opstring "evaluated in" :modifier-p :maybe) (eval form)) commit 00787a2abd3b15699c12bbe8a2be08db2c0aa313 Author: Eli Zaretskii Date: Mon Oct 7 19:03:04 2019 +0300 Fix infloop in redisplay caused by a recent change * src/xdisp.c (redisplay_internal): Avoid inflooping due to a frame's garbaged flag being set after update_frame. Reported by Michael Heerdegen . diff --git a/src/xdisp.c b/src/xdisp.c index 1f3a8136f8..192bf01013 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -15683,7 +15683,11 @@ redisplay_internal (void) garbaged flag, in which case we need to redisplay the frame. */ if (FRAME_GARBAGED_P (f)) - goto retry_frame; + { + fset_redisplay (f); + f->garbaged = false; + goto retry_frame; + } f->cursor_type_changed = false; f->updated_p = true; f->inhibit_clear_image_cache = false; commit 0811177c96c3265b88592cfb4d83eab53b9b98ba Author: Lars Ingebrigtsen Date: Mon Oct 7 17:25:07 2019 +0200 Feval_buffer doc string lexical-binding clarification * src/lread.c (Feval_buffer): Mention that the lexical-binding variable is ignored in the doc string (bug#20139). diff --git a/src/lread.c b/src/lread.c index 5000b38a01..1098190ae7 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2147,6 +2147,12 @@ DO-ALLOW-PRINT, if non-nil, specifies that output functions in the evaluated code should work normally even if PRINTFLAG is nil, in which case the output is displayed in the echo area. +This function ignores the current value of the `lexical-binding' +variable. Instead it will heed any + -*- lexical-binding: t -*- +settings in the buffer, and if there is no such setting, the buffer +will be evaluated without lexical binding. + This function preserves the position of point. */) (Lisp_Object buffer, Lisp_Object printflag, Lisp_Object filename, Lisp_Object unibyte, Lisp_Object do_allow_print) { commit 672fb2c769512730ba6dabe6f95dd1aa94aeb489 Author: Lars Ingebrigtsen Date: Mon Oct 7 17:14:10 2019 +0200 Make ido-display-buffer work interactively more like display-buffer * lisp/ido.el (ido-display-buffer): Take an interactive parameter, like `display-buffer' (bug#14904). (ido-visit-buffer): Use it to emulate `C-u M-x display-buffer'. diff --git a/lisp/ido.el b/lisp/ido.el index faa6e678f9..1cfcb0f535 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -4141,6 +4141,9 @@ Record command in `command-history' if optional RECORD is non-nil." ((eq method 'display) (display-buffer buffer)) + ((eq method 'display-even-when-displayed) + (display-buffer buffer t)) + ((eq method 'other-frame) (switch-to-buffer-other-frame buffer) (select-frame-set-input-focus (selected-frame))) @@ -4225,12 +4228,20 @@ For details of keybindings, see `ido-switch-buffer'." (ido-buffer-internal 'other-window 'switch-to-buffer-other-window)) ;;;###autoload -(defun ido-display-buffer () +(defun ido-display-buffer (&optional action) "Display a buffer in another window but don't select it. + +If ACTION (the prefix argument interactively), display the buffer +in another windown even if it's already displayed in the current +window. + The buffer name is selected interactively by typing a substring. For details of keybindings, see `ido-switch-buffer'." - (interactive) - (ido-buffer-internal 'display 'display-buffer nil nil nil 'ignore)) + (interactive "P") + (ido-buffer-internal (if action + 'display-even-when-displayed + 'display) + 'display-buffer nil nil nil 'ignore)) ;;;###autoload (defun ido-display-buffer-other-frame () commit 130b1321eda817727f361037b6c93d6a90bc0619 Author: Stefan Kangas Date: Wed Oct 2 15:50:54 2019 +0200 Quadruple term-buffer-maximum-size (Bug#37584) * lisp/term.el (term-buffer-maximum-size): Quadruple to 8192. diff --git a/lisp/term.el b/lisp/term.el index 43239d9b6c..50a0c80bcf 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -23,7 +23,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . -;; Marck 13 2001 +;; March 13 2001 ;; Fixes for CJK support by Yong Lu . ;; Dir/Hostname tracking and ANSI colorization by @@ -102,9 +102,8 @@ ;; ;; ---------------------------------------- ;; -;; With the term-buffer-maximum-size you can finally decide how many -;; scrollback lines to keep: its default is 2048 but you can change it as -;; usual. +;; With the variable term-buffer-maximum-size you can decide how many +;; scrollback lines to keep: its default is 8192. ;; ;; ---------------------------------------- ;; @@ -800,14 +799,15 @@ Buffer local variable.") "Face used to render white color code." :group 'term) -;; Inspiration came from comint.el -mm -(defcustom term-buffer-maximum-size 2048 +(defcustom term-buffer-maximum-size 8192 "The maximum size in lines for term buffers. Term buffers are truncated from the top to be no greater than this number. Notice that a setting of 0 means \"don't truncate anything\". This variable is buffer-local." :group 'term - :type 'integer) + :type 'integer + :version "27.1") + ;; Set up term-raw-map, etc.