[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 267e9c3 04/14: New functions for opening files.
From: |
Rocky Bernstein |
Subject: |
[elpa] master 267e9c3 04/14: New functions for opening files. |
Date: |
Wed, 25 Feb 2015 01:24:38 +0000 |
branch: master
commit 267e9c382addeace22f46adefe654198aaf921e5
Author: Phillip Lord <address@hidden>
Commit: Phillip Lord <address@hidden>
New functions for opening files.
find-file-noselect-relative opens a file with a relative path.
with-relative-file is a macro that runs in a buffer created with the
contents of the file.
---
load-relative.el | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/load-relative.el b/load-relative.el
index 16661bc..6fac96f 100644
--- a/load-relative.el
+++ b/load-relative.el
@@ -180,6 +180,30 @@ finding __FILE__ don't work."
)
;;;###autoload
+(defun find-file-noselect-relative (filename &optional nowarn rawfile
wildcards)
+ "Read relative FILENAME into a buffer and return the buffer.
+If a buffer exists visiting FILENAME, return that one, but
+verify that the file has not changed since visited or saved.
+The buffer is not selected, just returned to the caller.
+Optional second arg NOWARN non-nil means suppress any warning messages.
+Optional third arg RAWFILE non-nil means the file is read literally.
+Optional fourth arg WILDCARDS non-nil means do wildcard processing
+and visit all the matching files. When wildcards are actually
+used and expanded, return a list of buffers that are visiting
+the various files."
+ (find-file-noselect (relative-expand-file-name filename)
+ nowarn rawfile wildcards))
+
+;;;###autoload
+(defmacro with-relative-file (file &rest body)
+ "Read relative FILE into a temporary buffer and evaluated BODY
+in this buffer."
+ (declare (indent 1) (debug t))
+ `(with-current-buffer
+ (find-file-noselect-relative ,file)
+ ,@body))
+
+;;;###autoload
(defun load-relative (file-or-list &optional symbol)
"Load an Emacs Lisp file relative to Emacs Lisp code that is in
the process of being loaded or eval'd.
- [elpa] master updated (286ef6a -> a0983c1), Rocky Bernstein, 2015/02/24
- [elpa] master 3fa56d7 01/14: Forgot to add email, Rocky Bernstein, 2015/02/24
- [elpa] master 84151d4 02/14: Merge commit '3fa56d7925d5b24c5cd11c61bd6b3235e753a055', Rocky Bernstein, 2015/02/24
- [elpa] master 267e9c3 04/14: New functions for opening files.,
Rocky Bernstein <=
- [elpa] master fd0e5ca 06/14: with-relative-file is now idempotent and tests!, Rocky Bernstein, 2015/02/24
- [elpa] master c72495c 08/14: Change require to path relative load., Rocky Bernstein, 2015/02/24
- [elpa] master 44980ef 07/14: Merge pull request #4 from phillord/feature/find-file-relative, Rocky Bernstein, 2015/02/24
- [elpa] master 933969e 05/14: Merge pull request #3 from phillord/feature/find-file-relative, Rocky Bernstein, 2015/02/24
- [elpa] master c0eb1f2 09/14: Commentary updates for new functions., Rocky Bernstein, 2015/02/24
- [elpa] master 8bacd50 03/14: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa, Rocky Bernstein, 2015/02/24
- [elpa] master 4e7b211 11/14: Thank you, Phil Lord!, Rocky Bernstein, 2015/02/24
- [elpa] master 61be439 10/14: Merge pull request #5 from phillord/feature/find-file-relative, Rocky Bernstein, 2015/02/24
- [elpa] master a0983c1 14/14: Merge commit '0e1d1440e4819d76cc68b213431722884af66e89', Rocky Bernstein, 2015/02/24
- [elpa] master 0e1d144 12/14: Bump version number, Rocky Bernstein, 2015/02/24