From 54d40577c4bb64d25db030b7d11ab553364e375d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 10 Apr 2023 21:33:56 -0400 Subject: [PATCH 1/6] (org-table-make-reference): Fix compiler warning * lisp/org/org-table.el (org-table-make-reference): Don't use `eq` to compare against literal strings. --- lisp/org/org-table.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 5116b1127f7..a38f2a283d7 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -2861,7 +2861,7 @@ list, `literal' is for the format specifier L." (if lispp (if (eq lispp 'literal) elements - (if (and (eq elements "") (not keep-empty)) + (if (and (equal elements "") (not keep-empty)) "" (prin1-to-string (if numbers (string-to-number elements) elements)))) From 0724e0aeb5be7c60cd76c6afc8e22ed47d9c85bd Mon Sep 17 00:00:00 2001 From: Andrew G Cohen Date: Mon, 10 Apr 2023 11:34:43 +0800 Subject: [PATCH 2/6] * lisp/gnus/nnselect.el (nnselect-push-info): Sort artlist --- lisp/gnus/nnselect.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index 9a2957c9f52..af4dbdc35df 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -909,6 +909,7 @@ article came from is also searched." ;; now work on each originating group one at a time (pcase-dolist (`(,artgroup . ,artlist) (numbers-by-group gnus-newsgroup-articles)) + (setq artlist (sort artlist #'<)) (let* ((group-info (gnus-get-info artgroup)) (old-unread (gnus-list-of-unread-articles artgroup)) newmarked delta-marks) From ebac67129e86ce201d88debb1a8c9d6924215e84 Mon Sep 17 00:00:00 2001 From: Antero Mejr Date: Fri, 24 Mar 2023 20:41:41 +0000 Subject: [PATCH 3/6] eshell: Add 'rgrep' builtin * lisp/eshell/em-unix.el (eshell/rgrep): New function. (eshell-unix-initialize): Add "rgrep" to 'eshell-complex-commands'. * etc/NEWS: Add NEWS entry for rgrep. * doc/misc/eshell.texi (Built-ins): Add documentation for rgrep. --- doc/misc/eshell.texi | 2 ++ etc/NEWS | 5 +++++ lisp/eshell/em-unix.el | 11 ++++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 1c33c04f647..4e2bddf42af 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -602,6 +602,8 @@ disabled by default. @cmindex egrep @itemx fgrep @cmindex fgrep +@itemx rgrep +@cmindex rgrep @itemx glimpse @cmindex glimpse The @command{grep} commands are compatible with GNU @command{grep}, diff --git a/etc/NEWS b/etc/NEWS index c61a9ec3c5f..5e1fd76e99e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -174,6 +174,11 @@ correctly unloads Eshell and all of its modules. After manually editing 'eshell-aliases-file', you can use this command to load the edited aliases. ++++ +*** 'rgrep' is now a builtin command. +Running "rgrep" in Eshell now uses the Emacs grep facility instead of +calling external rgrep. + ** Shell Mode +++ diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index d550910f4f0..a792493e071 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -145,9 +145,10 @@ Otherwise, Emacs will attempt to use rsh to invoke du on the remote machine." (add-hook 'pcomplete-try-first-hook 'eshell-complete-host-reference nil t)) (setq-local eshell-complex-commands - (append '("grep" "egrep" "fgrep" "agrep" "glimpse" "locate" - "cat" "time" "cp" "mv" "make" "du" "diff") - eshell-complex-commands))) + (append '("grep" "egrep" "fgrep" "agrep" "rgrep" + "glimpse" "locate" "cat" "time" "cp" "mv" + "make" "du" "diff") + eshell-complex-commands))) (defalias 'eshell/date 'current-time-string) (defalias 'eshell/basename 'file-name-nondirectory) @@ -773,6 +774,10 @@ external command." "Use Emacs grep facility instead of calling external agrep." (eshell-grep "agrep" args)) +(defun eshell/rgrep (&rest args) + "Use Emacs grep facility instead of calling external rgrep." + (eshell-grep "grep" (append '("-rH") args) t)) + (defun eshell/glimpse (&rest args) "Use Emacs grep facility instead of calling external glimpse." (let (null-device) From 5dab172a17320e93332ae6545738b37f4224f2de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Tue, 11 Apr 2023 11:50:17 +0200 Subject: [PATCH 4/6] allout.el: fix subtree expose numbering bug * lisp/allout.el (allout-process-exposed): Reverse the list of indices properly so that the correct numbering for nodes in a subtree is used. Avoid destructive reversing; the list may be a constant (literal). This flaw was revealed by an ignored-return-value warning. --- lisp/allout.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/allout.el b/lisp/allout.el index 4d5d814ae01..be2fd632c69 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -5390,7 +5390,7 @@ Defaults: ;; not specified -- default it: (setq tobuf (concat "*" (buffer-name frombuf) " exposed*"))) (if (listp format) - (nreverse format)) + (setq format (reverse format))) (let* ((listified (progn (set-buffer frombuf) From fb66e4d58bbc24abf44157078e8ca51ffed93113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Tue, 11 Apr 2023 11:57:07 +0200 Subject: [PATCH 5/6] nndiary.el: fix dodgy schedule code * lisp/gnus/nndiary.el (nndiary-last-occurrence): Don't sort a list and throw away the result because that leaves the list variable in an undefined state. Just take the largest element because that was obviously what the author meant. --- lisp/gnus/nndiary.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el index be2bdc9bb15..8728aab1def 100644 --- a/lisp/gnus/nndiary.el +++ b/lisp/gnus/nndiary.el @@ -1373,10 +1373,10 @@ all. This may very well take some time.") (setq day (+ 7 day)))) ;; Finally, if we have some days, they are valid (when days - (sort days #'>) (throw 'found (encode-time 0 minute hour - (car days) month year time-zone))) + (apply #'max days) + month year time-zone))) ))))) ;; There's an upper limit, but we didn't find any last occurrence. ;; This means that the schedule is undecidable. This can happen if From 560950468588117b264a9f916fb578e0eb2a124a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Tue, 11 Apr 2023 13:35:43 +0100 Subject: [PATCH 6/6] Flymake: take advantage of new Eldoc options Only echo the first line of a potentially very large error message. * lisp/progmodes/flymake.el: (flymake-diagnostic-oneliner): New helper. (flymake--tabulated-entries-1) (flymake-eldoc-function): Use it. (Version): Bump to 1.3.2. (Package-Requires): Use Eldoc 1.14.0. --- lisp/progmodes/flymake.el | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index a352adbba19..1cd9f0a6b0c 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -4,9 +4,9 @@ ;; Author: Pavel Kobyakov ;; Maintainer: João Távora -;; Version: 1.2.2 +;; Version: 1.3.2 ;; Keywords: c languages tools -;; Package-Requires: ((emacs "26.1") (eldoc "1.1.0") (project "0.7.1")) +;; Package-Requires: ((emacs "26.1") (eldoc "1.14.0") (project "0.7.1")) ;; This is a GNU ELPA :core package. Avoid functionality that is not ;; compatible with the version of Emacs recorded above. @@ -371,6 +371,12 @@ diagnostics at BEG." (flymake--diag-accessor flymake-diagnostic-end flymake--diag-end end) (flymake--diag-accessor flymake-diagnostic-buffer flymake--diag-locus locus) +(defun flymake-diagnostic-oneliner (diag) + "Get truncated one-line text string for diagnostic DIAG." + (let ((txt (flymake-diagnostic-text diag))) + (substring txt 0 (cl-loop for i from 0 for a across txt + when (eq a ?\n) return i)))) + (cl-defun flymake--overlays (&key beg end filter compare key) "Get flymake-related overlays. If BEG is non-nil and END is nil, consider only `overlays-at' @@ -1254,10 +1260,17 @@ START and STOP and LEN are as in `after-change-functions'." (defun flymake-eldoc-function (report-doc &rest _) "Document diagnostics at point. Intended for `eldoc-documentation-functions' (which see)." - (let ((diags (flymake-diagnostics (point)))) - (when diags - (funcall report-doc - (mapconcat #'flymake-diagnostic-text diags "\n"))))) + (when-let ((diags (flymake-diagnostics (point)))) + (funcall report-doc + (mapconcat #'flymake-diagnostic-text diags "\n") + :echo (mapconcat (lambda (d) + (propertize (flymake-diagnostic-oneliner d) + 'face + (flymake--lookup-type-property + (flymake-diagnostic-type d) + 'face + 'flymake-error))) + diags "\n")))) (defun flymake-goto-next-error (&optional n filter interactive) "Go to Nth next Flymake diagnostic that matches FILTER. @@ -1582,8 +1595,7 @@ filename of the diagnostic relative to that directory." "\\1\\2" bname) "(anon)") 'help-echo (format "From `%s' backend" backend)) - (,(replace-regexp-in-string "\n.*" "" - (flymake-diagnostic-text diag)) + (,(flymake-diagnostic-oneliner diag) mouse-face highlight help-echo "mouse-2: visit this diagnostic" face nil