unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#43165: [PATCH] Add load this file lisp function.
@ 2020-09-02  3:16 Jen-Chieh Shen
  2020-09-02  9:43 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Jen-Chieh Shen @ 2020-09-02  3:16 UTC (permalink / raw)
  To: 43165


[-- 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-04  2:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-02  3:16 bug#43165: [PATCH] Add load this file lisp function Jen-Chieh Shen
2020-09-02  9:43 ` 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

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).