commit a17f40911e26e35f9df50ca0c04dcb4ab504114b (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Sun Jun 20 10:01:25 2021 +0300 ; * lisp/help-mode.el (help-customize): Doc fix. (Bug#36767) diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 24b7ffaa2a..4e73551cfb 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -750,7 +750,7 @@ See `help-make-xrefs'." 'emacs-lisp-mode)) (defun help-customize () - "Customize variable or face." + "Customize variable or face whose doc string is shown in the current buffer." (interactive nil help-mode) (let ((sym (plist-get help-mode--current-data :symbol))) (unless (or (boundp sym) (facep sym)) commit 415143de47089983bb3f3d6ba1a610d13166969e Author: Juri Linkov Date: Sun Jun 20 02:14:29 2021 +0300 Add new convenience command for *Help* * doc/emacs/help.texi (Help Mode): Document it (bug#36767). * lisp/help-mode.el (help-mode-map): Add 'c'. (help-mode-menu): Add help-customize. (help-customize): New command. diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index 8c24a926af..f144fd2922 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi @@ -456,6 +456,8 @@ View the source of the current help topic (if any) (@code{help-view-source}). @item i Look up the current topic in the manual(s) (@code{help-goto-info}). +@item c +Customize the variable or the face (@code{help-customize}). @end table @cindex hyperlink diff --git a/etc/NEWS b/etc/NEWS index b5c1fa79ff..889a0e690e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1131,13 +1131,12 @@ This change is for better compatibility with old versions of non-GNU ** Help +++ -*** New command 'help-view-source' ('s') -This command will view the source file (if any) of the current help -topic. - -+++ -*** New command 'help-goto-info' ('i') -This command will look up the current symbol (if any) in Info. +*** New convenience commands with short keys in the Help buffer. +New command 'help-view-source' ('s') will view the source file (if +any) of the current help topic. New command 'help-goto-info' ('i') +will look up the current symbol (if any) in Info. New command +'help-customize' ('c') will customize the variable or the face +(if any) whose doc string is being shown in the Help buffer. --- *** The 'help-for-help' ('C-h C-h') screen has been redesigned. diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 48cf435f97..24b7ffaa2a 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -46,6 +46,7 @@ (define-key map "\r" 'help-follow) (define-key map "s" 'help-view-source) (define-key map "i" 'help-goto-info) + (define-key map "c" 'help-customize) map) "Keymap for Help mode.") @@ -63,11 +64,13 @@ ["Move to Previous Button" backward-button :help "Move to the Previous Button in the help buffer"] ["Move to Next Button" forward-button - :help "Move to the Next Button in the help buffer"] + :help "Move to the Next Button in the help buffer"] ["View Source" help-view-source :help "Go to the source file for the current help item"] ["Goto Info" help-goto-info - :help "Go to the info node for the current help item"])) + :help "Go to the info node for the current help item"] + ["Customize" help-customize + :help "Customize variable or face"])) (defvar help-mode-tool-bar-map (let ((map (make-sparse-keymap))) @@ -746,6 +749,16 @@ See `help-make-xrefs'." (info-lookup-symbol (plist-get help-mode--current-data :symbol) 'emacs-lisp-mode)) +(defun help-customize () + "Customize variable or face." + (interactive nil help-mode) + (let ((sym (plist-get help-mode--current-data :symbol))) + (unless (or (boundp sym) (facep sym)) + (user-error "No variable or face to customize")) + (cond + ((boundp sym) (customize-variable sym)) + ((facep sym) (customize-face sym))))) + (defun help-do-xref (_pos function args) "Call the help cross-reference function FUNCTION with args ARGS. Things are set up properly so that the resulting help-buffer has commit 6636a644599c95517b3935f831fa0df42cb16bf3 Author: Michael Albinus Date: Sat Jun 19 18:11:50 2021 +0200 Fix error in tramp-archive.el * lisp/net/tramp-archive.el (tramp-archive-file-name-handler): Archive must exist. (Bug#49030, Bug#49043) * test/lisp/net/tramp-archive-tests.el (tramp-archive-test06-directory-file-name): Tag it :unstable temporarily. diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index d2ee7299be..d723fd5c6d 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -328,6 +328,8 @@ arguments to pass to the OPERATION." ;; `filename' could be a quoted file name. Or the file ;; archive could be a directory, see Bug#30293. (if (or (null archive) + (not (tramp-archive-run-real-handler + #'file-exists-p (list archive))) (tramp-archive-run-real-handler #'file-directory-p (list archive))) (tramp-archive-run-real-handler operation args) diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el index 773bc8f459..9a97974c93 100644 --- a/test/lisp/net/tramp-archive-tests.el +++ b/test/lisp/net/tramp-archive-tests.el @@ -321,6 +321,7 @@ They shall still be supported" "Check `directory-file-name'. This checks also `file-name-as-directory', `file-name-directory', `file-name-nondirectory' and `unhandled-file-name-directory'." + :tags '(:unstable) ;; Temporarily. (skip-unless tramp-archive-enabled) (should commit 510458a9f1e7e5a4924e80ceafbaf35e73cfac02 Merge: f8e5871c16 7722b510aa Author: Glenn Morris Date: Sat Jun 19 08:17:47 2021 -0700 Merge from origin/emacs-27 7722b510aa (origin/emacs-27) Another improvement in documentation of ... 8d5c70d73a Improve documentation of profiler 0ffef0b46b Document 'ispell-program-name' 7be610f911 Fix documentation of 'face-extend-p' # Conflicts: # doc/lispref/debugging.texi commit f8e5871c16a7b36b46833485dbe198ce90922ea5 Merge: 01bbe4c305 b94532f028 Author: Glenn Morris Date: Sat Jun 19 07:50:54 2021 -0700 ; Merge from origin/emacs-27 The following commit was skipped: b94532f028 * src/xdisp.c (Fwindow_text_pixel_size): Plug memory leak.... commit 01bbe4c3058a52758763eea711aabfefae28b179 Author: Lars Ingebrigtsen Date: Sat Jun 19 15:58:09 2021 +0200 Use file-truename on files loaded with "emacs -l" * lisp/startup.el (command-line-1): When loading a file, use the truename so that eval-after-load works more reliably (bug#49009). Change suggested by ctarbide@tuta.io. diff --git a/lisp/startup.el b/lisp/startup.el index ac319612e8..456c01efd1 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -2500,7 +2500,7 @@ nil default-directory" name) (or argval (pop command-line-args-left)))) ;; Take file from default dir if it exists there; ;; otherwise let `load' search for it. - (file-ex (expand-file-name file))) + (file-ex (file-truename (expand-file-name file)))) (when (file-regular-p file-ex) (setq file file-ex)) (load file nil t))) @@ -2511,7 +2511,7 @@ nil default-directory" name) (let* ((file (command-line-normalize-file-name (or argval (pop command-line-args-left)))) ;; Take file from default dir. - (file-ex (expand-file-name file))) + (file-ex (file-truename (expand-file-name file)))) (load file-ex nil t t))) ((equal argi "-insert") commit e910ef344f879605e32aa53430baa285a3ea81b1 Author: Lars Ingebrigtsen Date: Sat Jun 19 15:21:18 2021 +0200 Improve bound-and-true-p doc string * lisp/bindings.el (bound-and-true-p): Improve doc string (bug#49116). diff --git a/lisp/bindings.el b/lisp/bindings.el index 6eac528eb6..4e5497cc79 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -610,7 +610,9 @@ Switch to the most recently selected buffer other than the current one." (previous-buffer))) (defmacro bound-and-true-p (var) - "Return the value of symbol VAR if it is bound, else nil." + "Return the value of symbol VAR if it is bound, else nil. +Note that if `lexical-binding' is in effect, this refers to the +global value outside of any lexical scope." `(and (boundp (quote ,var)) ,var)) ;; Use mode-line-mode-menu for local minor-modes only. commit 234bf1b6363a3d5db8e73c422d87a0bf1aa4b2e3 Author: dickmao Date: Sat Jun 19 15:19:04 2021 +0200 De-obfuscate gnutls_handshake loop * src/gnutls.c (gnutls_try_handshake): Rewrite the handshake loop for greater clarity (bug#49055). diff --git a/src/gnutls.c b/src/gnutls.c index 4d5a909db0..22e7f2cbc1 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -625,16 +625,11 @@ gnutls_try_handshake (struct Lisp_Process *proc) while ((ret = gnutls_handshake (state)) < 0) { - if (gnutls_error_is_fatal (ret)) - return emacs_gnutls_handle_error (state, ret); - do - ret = gnutls_handshake (state); - while (ret == GNUTLS_E_INTERRUPTED); - - if (0 <= ret || emacs_gnutls_handle_error (state, ret) == 0 - || non_blocking) + if (emacs_gnutls_handle_error (state, ret) == 0) /* fatal */ break; maybe_quit (); + if (non_blocking && ret != GNUTLS_E_INTERRUPTED) + break; } proc->gnutls_initstage = GNUTLS_STAGE_HANDSHAKE_TRIED; commit 1293ece4613319629f08926d78b6cd5afdc9b2e9 Author: Alex Bochannek Date: Sat Jun 19 15:13:12 2021 +0200 New Gnus Summary buffer sort options for extra headers * lisp/gnus/gnus-sum.el (gnus-article-sort-functions) (gnus-thread-sort-functions, gnus-subthread-sort-functions) (gnus-summary-mode-map, gnus-summary-make-menu-bar) (gnus-article-sort-by-newsgroups) (gnus-summary-sort-by-newsgroups, gnus-summary-sort-by-extra): Sort by Newsgroups extra header. Prompt for header name for other extra headers. * doc/misc/gnus.texi (Summary Sorting): Document new sort functions * etc/NEWS: New Gnus Summary buffer sort feature (bug#49081). diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index ff8404e532..c9b5b2d9ff 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -7527,6 +7527,7 @@ Matching}). @findex gnus-thread-sort-by-author @findex gnus-thread-sort-by-recipient @findex gnus-thread-sort-by-number +@findex gnus-thread-sort-by-newsgroups @findex gnus-thread-sort-by-random @vindex gnus-thread-sort-functions @findex gnus-thread-sort-by-most-recent-number @@ -7544,6 +7545,7 @@ predicate functions include @code{gnus-thread-sort-by-number}, @code{gnus-thread-sort-by-score}, @code{gnus-thread-sort-by-most-recent-number}, @code{gnus-thread-sort-by-most-recent-date}, +@code{gnus-thread-sort-by-newsgroups} and @code{gnus-thread-sort-by-random} and @code{gnus-thread-sort-by-total-score}. @@ -7605,6 +7607,7 @@ tickles your fancy. @findex gnus-article-sort-by-score @findex gnus-article-sort-by-subject @findex gnus-article-sort-by-author +@findex gnus-article-sort-by-newsgroups @findex gnus-article-sort-by-random @findex gnus-article-sort-by-number @findex gnus-article-sort-by-most-recent-number @@ -7616,8 +7619,8 @@ different functions for article comparison. Available sorting predicate functions are @code{gnus-article-sort-by-number}, @code{gnus-article-sort-by-author}, @code{gnus-article-sort-by-subject}, @code{gnus-article-sort-by-date}, -@code{gnus-article-sort-by-random}, and -@code{gnus-article-sort-by-score}. +@code{gnus-article-sort-by-newsgroups}, @code{gnus-article-sort-by-random}, +and @code{gnus-article-sort-by-score}. If you want to sort an unthreaded summary display by subject, you could say something like: @@ -10405,6 +10408,17 @@ Sort by article ``readedness'' marks (@code{gnus-summary-sort-by-marks}). @findex gnus-summary-sort-by-score Sort by score (@code{gnus-summary-sort-by-score}). +@item C-c C-s C-u +@kindex C-c C-s C-u @r{(Summary)} +@findex gnus-summary-sort-by-newsgroups +Sort by newsgroups (@code{gnus-summary-sort-by-newsgroups}). + +@item C-c C-s C-x +@kindex C-c C-s C-x @r{(Summary)} +@findex gnus-summary-sort-by-extra +Prompts for extra header to sort by (@code{gnus-summary-sort-by-extra}). +An error will be raised if no sort functions for the header are defined. + @item C-c C-s C-r @kindex C-c C-s C-r @r{(Summary)} @findex gnus-summary-sort-by-random diff --git a/etc/NEWS b/etc/NEWS index da1372baf4..b5c1fa79ff 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -897,6 +897,12 @@ String or list of strings specifying switches for Git log under VC. ** Gnus ++++ +*** New Summary buffer sort options for extra headers. +The extra header sort option ('C-c C-s C-x') prompts for a header +and fails if no sort function has been defined. Sorting by +Newsgroups ('C-c C-s C-u') has been pre-defined. + +++ *** The '#' command in the Group and Summary buffer now toggles, instead of sets, the process mark. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index bcd76dda29..908c10c11d 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -879,8 +879,9 @@ this reverses the sort order. Ready-made functions include `gnus-article-sort-by-number', `gnus-article-sort-by-author', `gnus-article-sort-by-subject', -`gnus-article-sort-by-date', `gnus-article-sort-by-random' -and `gnus-article-sort-by-score'. +`gnus-article-sort-by-date', `gnus-article-sort-by-score', +`gnus-article-sort-by-rsv', `gnus-article-sort-by-newsgroups', +and `gnus-article-sort-by-random'. When threading is turned on, the variable `gnus-thread-sort-functions' controls how articles are sorted." @@ -892,6 +893,7 @@ controls how articles are sorted." (function-item gnus-article-sort-by-date) (function-item gnus-article-sort-by-score) (function-item gnus-article-sort-by-rsv) + (function-item gnus-article-sort-by-newsgroups) (function-item gnus-article-sort-by-random) (function :tag "other")) (boolean :tag "Reverse order")))) @@ -916,8 +918,8 @@ Ready-made functions include `gnus-thread-sort-by-number', `gnus-thread-sort-by-author', `gnus-thread-sort-by-recipient' `gnus-thread-sort-by-subject', `gnus-thread-sort-by-date', `gnus-thread-sort-by-score', `gnus-thread-sort-by-most-recent-number', -`gnus-thread-sort-by-most-recent-date', `gnus-thread-sort-by-random', -and `gnus-thread-sort-by-total-score' (see +`gnus-thread-sort-by-most-recent-date', `gnus-thread-sort-by-newsgroups', +`gnus-thread-sort-by-random', and `gnus-thread-sort-by-total-score' (see `gnus-thread-score-function'). When threading is turned off, the variable @@ -938,6 +940,7 @@ subthreads, customize `gnus-subthread-sort-functions'." (function-item gnus-thread-sort-by-rsv) (function-item gnus-thread-sort-by-most-recent-number) (function-item gnus-thread-sort-by-most-recent-date) + (function-item gnus-thread-sort-by-newsgroups) (function-item gnus-thread-sort-by-random) (function-item gnus-thread-sort-by-total-score) (function :tag "other")) @@ -961,6 +964,7 @@ according to the value of `gnus-thread-sort-functions'." (function-item gnus-thread-sort-by-score) (function-item gnus-thread-sort-by-most-recent-number) (function-item gnus-thread-sort-by-most-recent-date) + (function-item gnus-thread-sort-by-newsgroups) (function-item gnus-thread-sort-by-random) (function-item gnus-thread-sort-by-total-score) (function :tag "other")) @@ -1976,6 +1980,8 @@ increase the score of each group you read." "\C-c\C-s\C-i" gnus-summary-sort-by-score "\C-c\C-s\C-o" gnus-summary-sort-by-original "\C-c\C-s\C-r" gnus-summary-sort-by-random + "\C-c\C-s\C-u" gnus-summary-sort-by-newsgroups + "\C-c\C-s\C-x" gnus-summary-sort-by-extra "=" gnus-summary-expand-window "\C-x\C-s" gnus-summary-reselect-current-group "\M-g" gnus-summary-rescan-group @@ -2831,6 +2837,8 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) ["Sort by lines" gnus-summary-sort-by-lines t] ["Sort by characters" gnus-summary-sort-by-chars t] ["Sort by marks" gnus-summary-sort-by-marks t] + ["Sort by newsgroup" gnus-summary-sort-by-newsgroups t] + ["Sort by extra" gnus-summary-sort-by-extra t] ["Randomize" gnus-summary-sort-by-random t] ["Original sort" gnus-summary-sort-by-original t]) ("Help" @@ -5180,6 +5188,23 @@ Unscored articles will be counted as having a score of zero." "Sort threads such that the thread with the most recently dated article comes first." (> (gnus-thread-latest-date h1) (gnus-thread-latest-date h2))) +(defun gnus-article-sort-by-newsgroups (h1 h2) + "Sort articles by newsgroups." + (let ((ex + (lambda (h) + (let ((extract + (funcall gnus-extract-address-components + (or (cdr (assq 'Newsgroups (mail-header-extra h))) + "")))) + (or (car extract) (cadr extract)))))) + (gnus-string< (funcall ex h1) (funcall ex h2)))) + +(defun gnus-thread-sort-by-newsgroups (h1 h2) + "Sort threads by root newsgroups." + (gnus-article-sort-by-newsgroups + (gnus-thread-header h1) (gnus-thread-header h2))) + + ; Since this is called not only to sort the top-level threads, but ; also in recursive sorts to order the articles within a thread, each ; article will be processed many times. Thus it speeds things up @@ -12122,6 +12147,12 @@ Argument REVERSE means reverse order." (interactive "P" gnus-summary-mode) (gnus-summary-sort 'marks reverse)) +(defun gnus-summary-sort-by-newsgroups (&optional reverse) + "Sort the summary buffer by newsgroups alphabetically. +Argument REVERSE means reverse order." + (interactive "P" gnus-summary-mode) + (gnus-summary-sort 'newsgroups reverse)) + (defun gnus-summary-sort-by-original (&optional _reverse) "Sort the summary buffer using the default sorting method. Argument REVERSE means reverse order." @@ -12133,6 +12164,24 @@ Argument REVERSE means reverse order." ;; Hide subthreads if needed. (gnus-summary-maybe-hide-threads))) +(defun gnus-summary-sort-by-extra (&optional reverse) + "Sort the summary buffer using an extra header. +Argument REVERSE means reverse order." + (interactive "P" gnus-summary-mode) + (let* ((extra-header + (gnus-completing-read "Sort by extra header" + (mapcar #'symbol-name gnus-extra-headers) + t nil nil + (symbol-name + (car gnus-extra-headers)))) + (header (downcase extra-header))) + (if (and (fboundp (intern + (format "gnus-thread-sort-by-%s" header))) + (fboundp + (intern (format "gnus-article-sort-by-%s" header)))) + (gnus-summary-sort header reverse) + (error "No sort function defined for header: %s" extra-header)))) + (defun gnus-summary-sort (predicate reverse) "Sort summary buffer by PREDICATE. REVERSE means reverse order." (let* ((current (gnus-summary-article-number)) commit 7722b510aae119162a20cfc67d3057152835a4ba (refs/remotes/origin/emacs-27) Author: Eli Zaretskii Date: Sat Jun 19 16:08:50 2021 +0300 Another improvement in documentation of "memory" profiler * lisp/profiler.el (profiler-start): Fix the doc string to better explain what is "memory" profiler. diff --git a/lisp/profiler.el b/lisp/profiler.el index eb0e2c94e2..7cdd351127 100644 --- a/lisp/profiler.el +++ b/lisp/profiler.el @@ -812,8 +812,12 @@ below entry at point." (defun profiler-start (mode) "Start/restart profilers. MODE can be one of `cpu', `mem', or `cpu+mem'. -If MODE is `cpu' or `cpu+mem', time-based profiler will be started. -Also, if MODE is `mem' or `cpu+mem', then memory profiler will be started." +If MODE is `cpu' or `cpu+mem', start the time-based profiler, + whereby CPU is sampled periodically using the SIGPROF signal. +If MODE is `mem' or `cpu+mem', start profiler that samples CPU + whenever memory-allocation functions are called -- this is useful + if SIGPROF is not supported, or is unreliable, or is not sampling + at a high enough frequency." (interactive (list (if (not (fboundp 'profiler-cpu-start)) 'mem (intern (completing-read "Mode (default cpu): " commit 989de3b824e5d999c2b63f3067f2628da6034d8c Author: Ɓukasz Stelmach Date: Sat Jun 19 15:07:13 2021 +0200 Allow `message-replace-header' to take a list of AFTERs * lisp/gnus/message.el (message-replace-header): Facilitate capability of message-position-on-field to accept multiple headers as AFTERS argument and make possible to mimic behavioir of message-goto-* functions with message-replace-header in case the header does not exist (bug#49070). diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 02db38725a..0c027ca290 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -8722,16 +8722,19 @@ Header and body are separated by `mail-header-separator'." (defun message-replace-header (header new-value &optional after force) "Remove HEADER and insert the NEW-VALUE. -If AFTER, insert after this header. If FORCE, insert new field -even if NEW-VALUE is empty." +If AFTER, insert after this header. AFTER may be a list of +headers. If FORCE, insert new field even if NEW-VALUE is empty." ;; Similar to `nnheader-replace-header' but for message buffers. (save-excursion (save-restriction (message-narrow-to-headers) (message-remove-header header)) (when (or force (> (length new-value) 0)) - (if after - (message-position-on-field header after) + (when after + (if (listp after) + (apply #'message-position-on-field + (append (list header) after)) + (message-position-on-field header after)) (message-position-on-field header)) (insert new-value)))) commit 6ea7e338466056c10402005a2c2425dfd3c76299 Author: Alex Bochannek Date: Sat Jun 19 15:04:37 2021 +0200 Add support for displaying total number of groups in subgroups in Gnus * lisp/gnus/gnus-topic.el (gnus-topic-line-format) (gnus-topic-line-format-alist, gnus-topic-prepare-topic) (gnus-topic-insert-topic-line, ) (gnus-topic-display-missing-topic, ) (gnus-topic-update-topic-line): Provide number of groups in subtopics for topic line display and add 'G' element to be used for 'gnus-topic-line-format' variable * doc/misc/gnus.texi (Topic Variables): Document 'G' element for 'gnus-topic-line-format' variable (bug#49068). diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index b63947c044..ff8404e532 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -4126,6 +4126,8 @@ Visibility. Level. @item g Number of groups in the topic. +@item G +Number of groups in the topic and all its subtopics. @item a Number of unread articles in the topic. @item A diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el index b974dff372..568fbbcafb 100644 --- a/lisp/gnus/gnus-topic.el +++ b/lisp/gnus/gnus-topic.el @@ -54,6 +54,7 @@ with some simple extensions. %n Topic name. %v Nothing if the topic is visible, \"...\" otherwise. %g Number of groups in the topic. +%G Number of groups in the topic and its subtopics. %a Number of unread articles in the groups in the topic. %A Number of unread articles in the groups in the topic and its subtopics. @@ -87,6 +88,7 @@ See Info node `(gnus)Formatting Variables'." (?v visible ?s) (?i indentation ?s) (?g number-of-groups ?d) + (?G total-number-of-groups ?d) (?a (gnus-topic-articles-in-topic entries) ?d) (?A total-number-of-articles ?d) (?l level ?d))) @@ -485,16 +487,18 @@ If LOWEST is non-nil, list all newsgroups of level LOWEST or higher." If SILENT, don't insert anything. Return the number of unread articles in the topic and its subtopics." (let* ((type (pop topicl)) + (entries-level (if gnus-group-listed-groups + gnus-level-killed + list-level)) + (all (or predicate gnus-group-listed-groups + (cdr (assq 'visible + (gnus-topic-hierarchical-parameters + (car type)))))) + (lowest (if gnus-group-listed-groups 0 lowest)) (entries (gnus-topic-find-groups - (car type) - (if gnus-group-listed-groups - gnus-level-killed - list-level) - (or predicate gnus-group-listed-groups - (cdr (assq 'visible - (gnus-topic-hierarchical-parameters - (car type))))) - (if gnus-group-listed-groups 0 lowest))) + (car type) entries-level all lowest)) + (all-groups (gnus-topic-find-groups + (car type) entries-level all lowest t)) (visiblep (and (eq (nth 1 type) 'visible) (not silent))) (gnus-group-indentation (make-string (* gnus-topic-indent-level level) ? )) @@ -573,7 +577,7 @@ articles in the topic and its subtopics." (gnus-topic-insert-topic-line (car type) visiblep (not (eq (nth 2 type) 'hidden)) - level all-entries unread)) + level all-entries unread all-groups)) (gnus-topic-update-unreads (car type) unread) (gnus-group--setup-tool-bar-update beg end) (goto-char end) @@ -627,10 +631,10 @@ articles in the topic and its subtopics." (defvar gnus-tmp-header) (defun gnus-topic-insert-topic-line (name visiblep shownp level entries - &optional unread) + &optional unread all-groups) (gnus--\,@ (let ((vars '(indentation visible name level number-of-groups - total-number-of-articles entries))) + total-number-of-groups total-number-of-articles entries))) `((with-suppressed-warnings ((lexical ,@vars)) ,@(mapcar (lambda (s) `(defvar ,s)) vars))))) (let* ((visible (if visiblep "" "...")) @@ -639,6 +643,7 @@ articles in the topic and its subtopics." (indentation (make-string (* gnus-topic-indent-level level) ? )) (total-number-of-articles unread) (number-of-groups (length entries)) + (total-number-of-groups (length all-groups)) (active-topic (eq gnus-topic-alist gnus-topic-active-alist)) gnus-tmp-header) (gnus-topic-update-unreads name unread) @@ -731,6 +736,9 @@ articles in the topic and its subtopics." (entries (gnus-topic-find-groups (car type) (car gnus-group-list-mode) (cdr gnus-group-list-mode))) + (all-groups (gnus-topic-find-groups + (car type) (car gnus-group-list-mode) + (cdr gnus-group-list-mode) nil t)) entry) (while children (cl-incf unread (gnus-topic-unread (caar (pop children))))) @@ -738,7 +746,7 @@ articles in the topic and its subtopics." (when (numberp (car entry)) (cl-incf unread (car entry)))) (gnus-topic-insert-topic-line - topic t t (car (gnus-topic-find-topology topic)) nil unread))) + topic t t (car (gnus-topic-find-topology topic)) nil unread all-groups))) (defun gnus-topic-goto-missing-topic (topic) (if (gnus-topic-goto-topic topic) @@ -768,6 +776,9 @@ articles in the topic and its subtopics." (entries (gnus-topic-find-groups (car type) (car gnus-group-list-mode) (cdr gnus-group-list-mode))) + (all-groups (gnus-topic-find-groups + (car type) (car gnus-group-list-mode) + (cdr gnus-group-list-mode) t)) (parent (gnus-topic-parent-topic topic-name)) (all-entries entries) (unread 0) @@ -786,7 +797,7 @@ articles in the topic and its subtopics." (gnus-topic-insert-topic-line (car type) (gnus-topic-visible-p) (not (eq (nth 2 type) 'hidden)) - (gnus-group-topic-level) all-entries unread) + (gnus-group-topic-level) all-entries unread all-groups) (gnus-delete-line) (forward-line -1) (setq new-unread (gnus-group-topic-unread))) commit 8d5c70d73acf2fe05494dde5fdffa13e257bf819 Author: Eli Zaretskii Date: Sat Jun 19 15:39:11 2021 +0300 Improve documentation of profiler * doc/lispref/debugging.texi (Profiling): Stop misleading users about what "memory" profiling really is. diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi index 1b28bf7aa5..ed3160f454 100644 --- a/doc/lispref/debugging.texi +++ b/doc/lispref/debugging.texi @@ -997,11 +997,12 @@ start looking for ways to optimize that piece. @findex profiler-report @findex profiler-stop Emacs has built-in support for this. To begin profiling, type -@kbd{M-x profiler-start}. You can choose to profile by processor -usage, memory usage, or both. Then run the code you'd like to speed -up. After that, type @kbd{M-x profiler-report} to display a summary -buffer for each resource (cpu and memory) that you chose to profile. -The names of the report buffers include the times at which the reports +@w{@kbd{M-x profiler-start}}. You can choose to sample CPU usage +periodically (@code{cpu}), when memory is allocated (@code{memory}), +or both. Then run the code you'd like to speed up. After that, type +@kbd{M-x profiler-report} to display a summary buffer for CPU usage +sampled by each type (cpu and memory) that you chose to profile. The +names of the report buffers include the times at which the reports were generated, so you can generate another report later on without erasing previous results. When you have finished profiling, type @kbd{M-x profiler-stop} (there is a small overhead associated with @@ -1009,7 +1010,7 @@ profiling, so we don't recommend leaving it active except when you are actually running the code you want to examine). The profiler report buffer shows, on each line, a function that was -called, followed by how much resources (cpu or memory) it used in +called, followed by how much CPU resources it used in absolute and percentage terms since profiling started. If a given line has a @samp{+} symbol at the left-hand side, you can expand that line by typing @kbd{@key{RET}}, in order to see the function(s) called commit 75b68c322716068466ea7b42bc5ff9aea77e3311 Author: Jim Porter Date: Sat Jun 19 14:25:22 2021 +0200 Improve to selsel doc strings * lisp/delsel.el (delete-active-region): Document interactive behavior. * lisp/delsel.el (delete-selection-repeat-replace-region): Use "\\[universal-argument]" instead of literal "C-u" in docstring. diff --git a/lisp/delsel.el b/lisp/delsel.el index 96a9dcc0c7..3c99dd2344 100644 --- a/lisp/delsel.el +++ b/lisp/delsel.el @@ -87,7 +87,8 @@ information on adapting behavior of commands in Delete Selection mode." ;;;###autoload (defun delete-active-region (&optional killp) "Delete the active region. -If KILLP in not-nil, the active region is killed instead of deleted." +If KILLP is non-nil, or if called interactively with a prefix argument, +the active region is killed instead of deleted." (interactive "P") (cond (killp @@ -107,7 +108,7 @@ If KILLP in not-nil, the active region is killed instead of deleted." "Repeat replacing text of highlighted region with typed text. Search for the next stretch of text identical to the region last replaced by typing text over it and replaces it with the same stretch of text. -With ARG, repeat that many times. `C-u' means until end of buffer." +With ARG, repeat that many times. `\\[universal-argument]' means until end of buffer." (interactive "P") (let ((old-text (and delete-selection-save-to-register (get-register delete-selection-save-to-register))) commit 284dfd3613128a6993dc2386cc6000db96e760b8 Author: Michael Albinus Date: Sat Jun 19 14:01:13 2021 +0200 Revert "Add `file-name-set-extension'" This reverts commit 4f1a5e456e35930e8d0713b990bd7b14923cfe97. diff --git a/lisp/files.el b/lisp/files.el index 5fb9b9dcdc..2450daf5bf 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4892,20 +4892,6 @@ extension, the value is \"\"." (if period ""))))) -(defun file-name-with-extension (filename extension) - "Set the EXTENSION of a FILENAME. -Consolidates leading/trailing dots so that either `foo' or `.foo' -can be passed as an EXTENSION. - -See also `file-name-sans-extension'." - (let* ((patt "[ .]+") - (file (string-trim-right filename patt)) - (extn (string-trim-left extension patt))) - (cond ((string-empty-p file) (error "Malformed filename: %s" filename)) - ((string-empty-p extn) (error "Malformed extension: %s" extension)) - ((directory-name-p file) (error "Filename is a directory: %s" filename)) - (t (concat (file-name-sans-extension file) "." extn))))) - (defun file-name-base (&optional filename) "Return the base name of the FILENAME: no directory, no extension." (declare (advertised-calling-convention (filename) "27.1")) diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index 80f47a78dc..dc96dff639 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -1478,25 +1478,5 @@ The door of all subtleties! (buffer-substring (point-min) (point-max)) nil nil))))) -(ert-deftest files-tests-file-name-with-extension-good () - "Test that `file-name-with-extension' succeeds with reasonable input." - (should (string= (file-name-with-extension "Jack" "css") "Jack.css")) - (should (string= (file-name-with-extension "Jack" ".css") "Jack.css")) - (should (string= (file-name-with-extension "Jack.scss" "css") "Jack.css")) - (should (string= (file-name-with-extension "Jack..." "...css") "Jack.css")) - (should (string= (file-name-with-extension "/path/to/Jack.md" "org") "/path/to/Jack.org"))) - -(ert-deftest files-tests-file-name-with-extension-bad () - "Test that `file-name-with-extension' fails on malformed input." - (should-error (file-name-with-extension nil nil)) - (should-error (file-name-with-extension "Jack" nil)) - (should-error (file-name-with-extension nil "css")) - (should-error (file-name-with-extension "" "")) - (should-error (file-name-with-extension "" "css")) - (should-error (file-name-with-extension "Jack" "")) - (should-error (file-name-with-extension "Jack" "...")) - (should-error (file-name-with-extension "..." "css")) - (should-error (file-name-with-extension "/is/a/directory/" "css"))) - (provide 'files-tests) ;;; files-tests.el ends here commit 4f1a5e456e35930e8d0713b990bd7b14923cfe97 Author: Michael Albinus Date: Sat Jun 19 11:10:46 2021 +0200 Add `file-name-set-extension' * lisp/files.el (file-name-with-extension): New defun. * test/lisp/files-tests.el (files-tests-file-name-with-extension-good) (files-tests-file-name-with-extension-bad): New tests. diff --git a/lisp/files.el b/lisp/files.el index 2450daf5bf..5fb9b9dcdc 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4892,6 +4892,20 @@ extension, the value is \"\"." (if period ""))))) +(defun file-name-with-extension (filename extension) + "Set the EXTENSION of a FILENAME. +Consolidates leading/trailing dots so that either `foo' or `.foo' +can be passed as an EXTENSION. + +See also `file-name-sans-extension'." + (let* ((patt "[ .]+") + (file (string-trim-right filename patt)) + (extn (string-trim-left extension patt))) + (cond ((string-empty-p file) (error "Malformed filename: %s" filename)) + ((string-empty-p extn) (error "Malformed extension: %s" extension)) + ((directory-name-p file) (error "Filename is a directory: %s" filename)) + (t (concat (file-name-sans-extension file) "." extn))))) + (defun file-name-base (&optional filename) "Return the base name of the FILENAME: no directory, no extension." (declare (advertised-calling-convention (filename) "27.1")) diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index dc96dff639..80f47a78dc 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -1478,5 +1478,25 @@ The door of all subtleties! (buffer-substring (point-min) (point-max)) nil nil))))) +(ert-deftest files-tests-file-name-with-extension-good () + "Test that `file-name-with-extension' succeeds with reasonable input." + (should (string= (file-name-with-extension "Jack" "css") "Jack.css")) + (should (string= (file-name-with-extension "Jack" ".css") "Jack.css")) + (should (string= (file-name-with-extension "Jack.scss" "css") "Jack.css")) + (should (string= (file-name-with-extension "Jack..." "...css") "Jack.css")) + (should (string= (file-name-with-extension "/path/to/Jack.md" "org") "/path/to/Jack.org"))) + +(ert-deftest files-tests-file-name-with-extension-bad () + "Test that `file-name-with-extension' fails on malformed input." + (should-error (file-name-with-extension nil nil)) + (should-error (file-name-with-extension "Jack" nil)) + (should-error (file-name-with-extension nil "css")) + (should-error (file-name-with-extension "" "")) + (should-error (file-name-with-extension "" "css")) + (should-error (file-name-with-extension "Jack" "")) + (should-error (file-name-with-extension "Jack" "...")) + (should-error (file-name-with-extension "..." "css")) + (should-error (file-name-with-extension "/is/a/directory/" "css"))) + (provide 'files-tests) ;;; files-tests.el ends here commit 0ffef0b46b4e68e3f4113042f036f3a295498855 Author: Eli Zaretskii Date: Tue Jun 15 18:21:50 2021 +0300 Document 'ispell-program-name' * doc/emacs/fixit.texi (Spelling): Document 'ispell-program-name'. (Bug#49039) diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi index 35601708d3..aa511fdcb5 100644 --- a/doc/emacs/fixit.texi +++ b/doc/emacs/fixit.texi @@ -260,6 +260,13 @@ systems. @xref{Top, Aspell,, aspell, The Aspell Manual}. @end ifnottex +@vindex ispell-program-name + If you have only one of the spelling checker programs installed, +Emacs will find it when you invoke for the first time one of the +commands described here. If you have more than one of them installed, +you can control which one is used by customizing the variable +@code{ispell-program-name}. + @table @kbd @item M-$ Check and correct spelling of the word at point (@code{ispell-word}). commit 7be610f911037e494fae9195c02dd1e33bf08269 Author: Eli Zaretskii Date: Sun Jun 13 17:10:51 2021 +0300 Fix documentation of 'face-extend-p' * doc/lispref/display.texi (Attribute Functions): Fix description of 'face-extend-p'. (Bug#48936) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 5290a04337..d8181ecfbe 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2979,9 +2979,10 @@ This function returns non-@code{nil} if face @var{face} specifies a non-@code{nil} @code{:inverse-video} attribute. @end defun -@defun face-extend-p face &optional frame +@defun face-extend-p face &optional frame inherit This function returns non-@code{nil} if face @var{face} specifies -a non-@code{nil} @code{:extend} attribute. +a non-@code{nil} @code{:extend} attribute. The @var{inherit} argument +is passed to @code{face-attribute}. @end defun commit b94532f02883988aec5ea9b0e4a06bcfe28b2268 Author: Eli Zaretskii Date: Mon Jun 7 15:03:06 2021 +0300 * src/xdisp.c (Fwindow_text_pixel_size): Plug memory leak. (Bug#48884) (cherry picked from commit 69a65212a233333ab0605374b4985ead23f4a541) diff --git a/src/xdisp.c b/src/xdisp.c index 77c9af747c..8dcecc2be6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10592,6 +10592,9 @@ include the height of both, if present, in the return value. */) it.max_descent = max (it.max_descent, it.descent); } } + else + bidi_unshelve_cache (it2data, true); + if (!NILP (x_limit)) { /* Don't return more than X-LIMIT. */