From: Jen-Chieh Shen <jcs090218@gmail.com>
To: 43165@debbugs.gnu.org
Subject: bug#43165: [PATCH] Add load this file lisp function.
Date: Wed, 2 Sep 2020 11:16:40 +0800 [thread overview]
Message-ID: <CAMiGhTO0n8mKk6Nu4w06yWx=J6mMgbgdkKCj0BUSk22ah1CvRQ@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 974 bytes --]
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 <jcs090218@gmail.com>
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
[-- Attachment #1.2: Type: text/html, Size: 1336 bytes --]
[-- Attachment #2: load-this-file.patch --]
[-- Type: application/octet-stream, Size: 817 bytes --]
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.
---
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
next reply other threads:[~2020-09-02 3:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-02 3:16 Jen-Chieh Shen [this message]
2020-09-02 9:43 ` bug#43165: [PATCH] Add load this file lisp function Lars Ingebrigtsen
[not found] ` <CAMiGhTPP=1ez0x=v19RKHEVPkCfU_AEbN=mDeamXfXey99R3Zw@mail.gmail.com>
2020-09-02 10:23 ` Lars Ingebrigtsen
2020-09-02 15:51 ` Drew Adams
2020-09-03 20:28 ` Stefan Kangas
2020-09-04 1:52 ` Lars Ingebrigtsen
2020-09-04 2:13 ` Drew Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMiGhTO0n8mKk6Nu4w06yWx=J6mMgbgdkKCj0BUSk22ah1CvRQ@mail.gmail.com' \
--to=jcs090218@gmail.com \
--cc=43165@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).