From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jen-Chieh Shen Newsgroups: gmane.emacs.bugs Subject: bug#43165: [PATCH] Add load this file lisp function. Date: Wed, 2 Sep 2020 11:16:40 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000027cd205ae4c11f1" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36456"; mail-complaints-to="usenet@ciao.gmane.io" To: 43165@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 02 05:17:12 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 1kDJGp-0009Om-K9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Sep 2020 05:17:11 +0200 Original-Received: from localhost ([::1]:38868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDJGo-0005Th-0f for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Sep 2020 23:17:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDJGg-0005TK-SA for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 23:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46335) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDJGg-0000a9-IP for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 23:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kDJGg-0004K1-9Z for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 23:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jen-Chieh Shen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Sep 2020 03:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43165 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.159901661816599 (code B ref -1); Wed, 02 Sep 2020 03:17:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Sep 2020 03:16:58 +0000 Original-Received: from localhost ([127.0.0.1]:57881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDJGc-0004Jf-HQ for submit@debbugs.gnu.org; Tue, 01 Sep 2020 23:16:58 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:46768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDJGY-0004JU-9i for submit@debbugs.gnu.org; Tue, 01 Sep 2020 23:16:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDJGY-0005Sx-4b for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 23:16:54 -0400 Original-Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:44724) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDJGW-0000ZZ-Cs for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 23:16:53 -0400 Original-Received: by mail-wr1-x42f.google.com with SMTP id c15so3572108wrs.11 for ; Tue, 01 Sep 2020 20:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=g4mKjjxFSHrVPySpLG6F5RXWgLvMef9TAeEHljMRO08=; b=ZBzHnri9NI3a8PoFkaIeegpKea3HKik7i2rS0SnC4cuuwsTRRKBDjs4So+h0UewN6L uIGiofTabkW2I0chhp/0PSYb0b7cwI4n3GyMgmxLloren/1DVF69QCD8NDJlAogDAuRy rm1VnmDufSXS+zI84yJ0E+/4lHnx7NJNdaSNQfYl2X8SQps1yIHr0dAihNltyN5qCOCY 8NXPCMcjQs97/GVkoUBEKXkRE/lY/OwT9qP8srUFGNXmDb9MXK9MUHckxVo4YsDqjOlH 3BKOXOs30Ra7Ua+KiYcafI4jtgFT7wl+jTDI9csiS/4F7omcCstilErAe4sXAI8q0aMV b6ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=g4mKjjxFSHrVPySpLG6F5RXWgLvMef9TAeEHljMRO08=; b=Pdc0GHCwbRf1oD3Unn7wahBihqSZ53Vfq0diL4mm0PQ9MDqUBEFWkoRj9ZFOFkK4Oe bpNzXl7ZTRFkCbKuU08EhTDWmZmy4sNFbDO0/RJnn7PMFTQ332NKKcOt7xU7HkgfYk0R PIMiPE+Ifv2P/+em/8pMbv9Scbm0S6NLP5UBr2caJ9miRy/bOp4HBxrkJFr7m44qYYrp A8FaZ1RwSE58+/pqXO5y24Anfad1tYVX4sSKJDTeaXVSF3X1cftbpO8wtJV4xBr+GIld E5VMq+ixYYVYs1LRdKUPLfH2hro/CvuKZ7b1lzImeElfjVWfKm8kf2okmyb8Gup/c7mE 7C/Q== X-Gm-Message-State: AOAM5306omkSugHu6BwPVduTd7UHEqUq8XuMn3oDcXEX4EHBOFiVXWVT FgJtr0X73ZlRw/WRzAFkoIgWCoP+RQRD7Abso7O7MhnZse3DgQ== X-Google-Smtp-Source: ABdhPJzH33eSVGyeSsN/bAjGmnb8A2/OfPKNg/OwVoG4JIVOLwGfpXjiP5gFsVuNgA7wvAGkm8MLSkj8cvuAannFpVE= X-Received: by 2002:adf:828e:: with SMTP id 14mr5182548wrc.217.1599016609620; Tue, 01 Sep 2020 20:16:49 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=jcs090218@gmail.com; helo=mail-wr1-x42f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:186902 Archived-At: --000000000000027cd205ae4c11f1 Content-Type: multipart/alternative; boundary="000000000000027ccf05ae4c11ef" --000000000000027ccf05ae4c11ef Content-Type: text/plain; charset="UTF-8" Hi, I think `load-this-file` could be kind of handy.Is related to `kill-buffer` and `kill-this-buffer`, etc. What do you guys think? Best, Jen-Chieh Shen >From 50101ae92761a51032c469353ff5fb203b83e6ad Mon Sep 17 00:00:00 2001 From: jenchieh Date: Wed, 2 Sep 2020 11:11:57 +0800 Subject: [PATCH] Add load this file lisp function. --- lisp/files.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/files.el b/lisp/files.el index 3403e257a1..374df0d85d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -900,6 +900,11 @@ recursion." (read-file-name "Load file: " nil nil 'lambda)))) (load (expand-file-name file) nil nil t)) +(defun load-this-file () + "Load current Lisp file." + (interactive) + (load-file (buffer-file-name))) + (defun locate-file (filename path &optional suffixes predicate) "Search for FILENAME through PATH. If found, return the absolute file name of FILENAME; otherwise -- 2.27.0.windows.1 --000000000000027ccf05ae4c11ef Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,=C2=A0

I think `load-this-file` coul= d be kind of handy.Is related to `kill-buffer` and `kill-this-buffer`, etc.=

What do you guys think?

= Best,

Jen-Chieh Shen


=

From 50101ae92761a51032c469353ff5fb203b83e6ad Mon= Sep 17 00:00:00 2001
From: jenchieh <jcs090218@gmail.com>
Date: Wed, 2 Sep 2020 11:11:57 +0800=
Subject: [PATCH] Add load this file lisp function.

---
=C2=A0= lisp/files.el | 5 +++++
=C2=A01 file changed, 5 insertions(+)

dif= f --git a/lisp/files.el b/lisp/files.el
index 3403e257a1..374df0d85d 100= 644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -900,6 +900,11 @@ r= ecursion."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (read-file-name "Load= file: " nil nil 'lambda))))
=C2=A0 =C2=A0(load (expand-file-na= me file) nil nil t))
=C2=A0
+(defun load-this-file ()
+ =C2=A0&quo= t;Load current Lisp file."
+ =C2=A0(interactive)
+ =C2=A0(load-f= ile (buffer-file-name)))
+
=C2=A0(defun locate-file (filename path &a= mp;optional suffixes predicate)
=C2=A0 =C2=A0"Search for FILENAME t= hrough PATH.
=C2=A0If found, return the absolute file name of FILENAME; = otherwise
--
2.27.0.windows.1

--000000000000027ccf05ae4c11ef-- --000000000000027cd205ae4c11f1 Content-Type: application/octet-stream; name="load-this-file.patch" Content-Disposition: attachment; filename="load-this-file.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kekt347n0 RnJvbSA1MDEwMWFlOTI3NjFhNTEwMzJjNDY5MzUzZmY1ZmIyMDNiODNlNmFkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBqZW5jaGllaCA8amNzMDkwMjE4QGdtYWlsLmNvbT4KRGF0ZTog V2VkLCAyIFNlcCAyMDIwIDExOjExOjU3ICswODAwClN1YmplY3Q6IFtQQVRDSF0gQWRkIGxvYWQg dGhpcyBmaWxlIGxpc3AgZnVuY3Rpb24uCgotLS0KIGxpc3AvZmlsZXMuZWwgfCA1ICsrKysrCiAx IGZpbGUgY2hhbmdlZCwgNSBpbnNlcnRpb25zKCspCgpkaWZmIC0tZ2l0IGEvbGlzcC9maWxlcy5l bCBiL2xpc3AvZmlsZXMuZWwKaW5kZXggMzQwM2UyNTdhMS4uMzc0ZGYwZDg1ZCAxMDA2NDQKLS0t IGEvbGlzcC9maWxlcy5lbAorKysgYi9saXNwL2ZpbGVzLmVsCkBAIC05MDAsNiArOTAwLDExIEBA IHJlY3Vyc2lvbi4iCiAJCSAgICAgICAocmVhZC1maWxlLW5hbWUgIkxvYWQgZmlsZTogIiBuaWwg bmlsICdsYW1iZGEpKSkpCiAgIChsb2FkIChleHBhbmQtZmlsZS1uYW1lIGZpbGUpIG5pbCBuaWwg dCkpCiAKKyhkZWZ1biBsb2FkLXRoaXMtZmlsZSAoKQorICAiTG9hZCBjdXJyZW50IExpc3AgZmls ZS4iCisgIChpbnRlcmFjdGl2ZSkKKyAgKGxvYWQtZmlsZSAoYnVmZmVyLWZpbGUtbmFtZSkpKQor CiAoZGVmdW4gbG9jYXRlLWZpbGUgKGZpbGVuYW1lIHBhdGggJm9wdGlvbmFsIHN1ZmZpeGVzIHBy ZWRpY2F0ZSkKICAgIlNlYXJjaCBmb3IgRklMRU5BTUUgdGhyb3VnaCBQQVRILgogSWYgZm91bmQs IHJldHVybiB0aGUgYWJzb2x1dGUgZmlsZSBuYW1lIG9mIEZJTEVOQU1FOyBvdGhlcndpc2UKLS0g CjIuMjcuMC53aW5kb3dzLjEKCg== --000000000000027cd205ae4c11f1--