From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#12443: 24.2.50; Default values in the minibuffer prompt (fix inconsisntecy) Date: Sun, 06 Sep 2020 20:10:42 +0200 Message-ID: <87363uepy5.fsf@gnus.org> References: <871ui48di4.fsf@mail.jurta.org> <878se2aox0.fsf@gnus.org> <87imd669dh.fsf@gnus.org> <875z961u2l.fsf@mail.linkov.net> <871rjt1uc1.fsf@gnus.org> <878se0gc25.fsf@mail.linkov.net> <87imd2vp1k.fsf@gnus.org> <87sgbv7xtn.fsf@gnus.org> <877dt6er29.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13879"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Dani Moncayo , Stefan Kangas , 12443@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 06 20:11:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kEz8A-0003UP-D1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Sep 2020 20:11:10 +0200 Original-Received: from localhost ([::1]:51364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEz89-0005m4-CG for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Sep 2020 14:11:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEz82-0005lv-L5 for bug-gnu-emacs@gnu.org; Sun, 06 Sep 2020 14:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35585) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kEz82-00023P-C3 for bug-gnu-emacs@gnu.org; Sun, 06 Sep 2020 14:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kEz82-0004pw-7L for bug-gnu-emacs@gnu.org; Sun, 06 Sep 2020 14:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Sep 2020 18:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12443 X-GNU-PR-Package: emacs Original-Received: via spool by 12443-submit@debbugs.gnu.org id=B12443.159941585618580 (code B ref 12443); Sun, 06 Sep 2020 18:11:02 +0000 Original-Received: (at 12443) by debbugs.gnu.org; 6 Sep 2020 18:10:56 +0000 Original-Received: from localhost ([127.0.0.1]:47131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEz7w-0004pc-0f for submit@debbugs.gnu.org; Sun, 06 Sep 2020 14:10:56 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:47336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEz7u-0004pO-5o for 12443@debbugs.gnu.org; Sun, 06 Sep 2020 14:10:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=tbDtS3P1JYJovPIAxm8fHu0mqwVVTuJhPEJL19o21lE=; b=gqOjmlLn1ysxvKR6lnQaDS2RTk RrhZM3NydvbSGDGaDVX+/K5LHEWXgaIO3fmP05s2HgsEsKZC60L0OFmue6wAtq0mqO8yRIOKPGcr0 ZAEhBQXZt/GB8Wsv0MvUvV2A+VwtWKK+ifXuZstTDwGKwrP25TLCVI9W0vIVTZ2LjaEY=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kEz7k-0004Tz-9a; Sun, 06 Sep 2020 20:10:46 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEVBLzo3O5Q6QJv/ ///qBynDAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+QJBhEaCMpodTcAAAGRSURBVCjPPVExjtswEBwa RwJJdUVUyNU1AYK8ggLuAQzAIWRXKizjTq+Qr0jtIjTOrlycC/OVGeqCEAK1g92dnVkC/88aeDTP n7FvAoI7d16xydMV4Wu5HBX73TgAP0u5mqvz38YAjKmU9buBzTOwc6WUDxWe1RrtpEKBfiEVmLHC j89ph3uA83iqwB3uY9h6DEvKlcvt5M1VaYf1Nm/G7AbY0M7rQnLPCtZ+unC/SqtBolqWkpNLRhmw TCU50gc0HW+/T71ABNSasK9AcviaIkYacgMk8kU2usyTr2U8nHknuyOiaF6VfkvSpoTncuYnBAGT Fb9pBYbT/Ctn8Uf5kZHxvSWRZUaWtruWvaGXUJiP0HLjBPThKOW8JY9OJOpauBFi3QJtnQc0VOrx H7C65gf7pZYJHM1sk2UbKhjsbGmi21U9WlbbI5pF3HM7NxFErGxTma1HWvV4aEQ66OGoB2r67978 UUEQoNQZLtMEOgbH6rcCcuc4VvMLkK+qLMcKlks7CstfsyS9OlWvuOoT+L/9yo/D5a1fkAAAACV0 RVh0ZGF0ZTpjcmVhdGUAMjAyMC0wOS0wNlQxNzoyNjowOCswMDowMAev8gQAAAAldEVYdGRhdGU6 bW9kaWZ5ADIwMjAtMDktMDZUMTc6MjY6MDgrMDA6MDB28kq4AAAAAElFTkSuQmCC X-Now-Playing: Stephan Mathieu's _Radiance (9): Feldman_: "Feldman" In-Reply-To: <877dt6er29.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 06 Sep 2020 19:46:38 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:187371 Archived-At: Lars Ingebrigtsen writes: > It doesn't sound that difficult to do, but I > thought I'd ask before I start typing... Well, whaddaya know, I started typing. *sigh* Anyway, this seems to actually work, and I'm amazed at how speedy an all Emacs solution for this is: Running it over all the Lisp files on trunk takes 3.2s (on this laptop). Is this something Emacs should have? It's not very... user-friendly; you have to write the predicate yourself, but it should allow people to refactor with slightly more ease than with `M-x grep'. Usage example: (lars-find-sexp-in-files "~/src/emacs/trunk/lisp" "[.]el\\'" 'completing-read (lambda (form) (and (nth 7 form) (stringp (nth 1 form))))) (defun lars-find-sexp-in-files (directory match symbol predicate) (pop-to-buffer "*matches*") (let ((inhibit-read-only t)) (erase-buffer) (dolist (file (directory-files-recursively directory match)) (message "%s" file) (lars-find-sexp-in-file file symbol predicate)) (grep-mode))) (defun lars-find-sexp-in-file (file symbol predicate) (let ((lines (with-temp-buffer (insert-file-contents file) (lars-find-sexp-in-buffer symbol predicate)))) (dolist (line lines) (insert file ":" line)))) (defun lars-find-sexp-in-buffer (symbol predicate) (let ((lines nil)) (while (re-search-forward (format "(%s[^-a-zA-Z0-9]" symbol) nil t) (let ((start (match-beginning 0))) (goto-char start) (let ((form (ignore-errors (read (current-buffer))))) (when (and (eq (car form) symbol) (funcall predicate form)) (goto-char (1+ start)) (push (format "%d:%s\n" (count-lines (point-min) start) (buffer-substring-no-properties (line-beginning-position) (line-end-position))) lines))))) (nreverse lines))) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no