リビジョン | 5e7152e0ebbc3d3885d070b1856df417578dda9f (tree) |
---|---|
日時 | 2023-05-04 22:14:40 |
作者 | badcoff33 <none@none> |
コミッター | badcoff33 |
move navigator code to find-in-files
@@ -98,9 +98,9 @@ case the buffer is modofied, the buffer will not be reverted." t nil) | ||
98 | 98 | ;;; Generated autoloads from find-in-files.el |
99 | 99 | |
100 | 100 | (autoload '+find-any-file "find-in-files" "\ |
101 | -Find a file in root directory. The root directory is evaluatd by | |
102 | -function `+utils-find-root-dir'. When called with prefix, the | |
103 | -`default-directoy' is used. | |
101 | +Find rekursive any file matching glob pattern *.* in root | |
102 | +directory. Root directory is determined by `+utils-find-root-dir'. | |
103 | +When called with prefix, the root directory is requested first. | |
104 | 104 | |
105 | 105 | \(fn &optional PREFIX)" t nil) |
106 | 106 |
@@ -125,34 +125,29 @@ relative to project's root dir. | ||
125 | 125 | |
126 | 126 | \(fn &optional PREFIX)" t nil) |
127 | 127 | |
128 | -(register-definition-prefixes "find-in-files" '("+find-in-files-" "fif-all-options")) | |
129 | - | |
130 | -;;;*** | |
131 | - | |
132 | -;;;### (autoloads nil "navigator" "navigator.el" (0 0 0 0)) | |
133 | -;;; Generated autoloads from navigator.el | |
134 | - | |
135 | -(autoload '+find-file-in-tag-files "navigator" "\ | |
128 | +(autoload '+find-file-in-tag-files "find-in-files" "\ | |
136 | 129 | An method to open a file, that is listed in the visited |
137 | 130 | tags file." t nil) |
138 | 131 | |
139 | -(autoload '+store-last-insertation-point "navigator" "\ | |
132 | +(autoload '+store-last-insertation-point "find-in-files" "\ | |
140 | 133 | Store in `go-back-marker' last point where |
141 | 134 | `self-insert-command' was called. Function shall be called by |
142 | 135 | `after-change-functions'. |
143 | 136 | |
144 | 137 | \(fn BEG END LEN)" nil nil) |
145 | 138 | |
146 | -(autoload '+go-back-to-last-insertion-point "navigator" "\ | |
139 | +(autoload '+go-back-to-last-insertion-point "find-in-files" "\ | |
147 | 140 | Go back to point of the last text insertion. No stack of |
148 | 141 | insertation points implemented (dumb and simple). The |
149 | 142 | point-marker is stored in a variable `go-back-marker'." t nil) |
150 | 143 | |
151 | -(autoload '+show-dir-info "navigator" "\ | |
144 | +(autoload '+show-dir-info "find-in-files" "\ | |
152 | 145 | |
153 | 146 | |
154 | 147 | \(fn &optional PREFIX)" t nil) |
155 | 148 | |
149 | +(register-definition-prefixes "find-in-files" '("+find-in-files-" "fif-all-options")) | |
150 | + | |
156 | 151 | ;;;*** |
157 | 152 | |
158 | 153 | ;;;### (autoloads nil "skeletons" "skeletons.el" (0 0 0 0)) |
@@ -190,5 +190,60 @@ relative to project's root dir." | ||
190 | 190 | (grep fif-command) |
191 | 191 | (add-to-list '+find-in-files-history fif-command))) |
192 | 192 | |
193 | +;;;###autoload | |
194 | +(defun +find-file-in-tag-files () | |
195 | + "An method to open a file, that is listed in the visited | |
196 | +tags file." | |
197 | + (interactive) | |
198 | + (save-excursion | |
199 | + (let* ((all-files nil)) | |
200 | + (visit-tags-table-buffer nil) | |
201 | + (setq all-files (tags-table-files)) | |
202 | + (while (visit-tags-table-buffer t) | |
203 | + (setq all-files (append all-files (tags-table-files)))) | |
204 | + (find-file | |
205 | + (expand-file-name | |
206 | + (completing-read "Open file: " all-files nil t)))))) | |
207 | + | |
208 | +;;;###autoload | |
209 | +(defun +store-last-insertation-point (beg end len) | |
210 | + "Store in `go-back-marker' last point where | |
211 | +`self-insert-command' was called. Function shall be called by | |
212 | +`after-change-functions'." | |
213 | + (when buffer-file-name | |
214 | + (when (not (equal "TAGS" (upcase (file-name-nondirectory buffer-file-name)))) | |
215 | + (setq go-back-marker (point-marker))))) | |
216 | + | |
217 | +;;;###autoload | |
218 | +(defun +go-back-to-last-insertion-point () | |
219 | + "Go back to point of the last text insertion. No stack of | |
220 | +insertation points implemented (dumb and simple). The | |
221 | +point-marker is stored in a variable `go-back-marker'." | |
222 | + (interactive) | |
223 | + (when (boundp 'go-back-marker) | |
224 | + (switch-to-buffer (marker-buffer go-back-marker)) | |
225 | + (goto-char (marker-position go-back-marker)))) | |
226 | + | |
227 | +;;;###autoload | |
228 | +(defun +show-dir-info (&optional prefix) | |
229 | + (interactive "P") | |
230 | + (let* ((help-window-select t)) | |
231 | + (if (not prefix) | |
232 | + (message (if (buffer-file-name) | |
233 | + (format-message "buffer's file '%s'" (expand-file-name (buffer-file-name))) | |
234 | + "buffer has no file")) | |
235 | + (with-help-window | |
236 | + "*buffer-info*" | |
237 | + '(display-buffer-same-window) nil | |
238 | + (progn | |
239 | + (princ (format-message "buffer file name: %s\n" (or (buffer-file-name) "NO FILE"))) | |
240 | + (princ (format "default directory: %s\n" (file-name-as-directory default-directory))) | |
241 | + (princ (format "desktop directory: %s\n" (file-name-as-directory desktop-dirname))) | |
242 | + (princ (format "project root: %s\n" (or (locate-dominating-file default-directory dir-locals-file) "none"))) | |
243 | + (if tags-table-list | |
244 | + (dolist (tf tags-table-list) | |
245 | + (princ (format "visited tag file: %s" tf))) | |
246 | + (princ "visited tag file: NONE"))))))) | |
247 | + | |
193 | 248 | (provide 'find-in-files) |
194 | 249 | ;;; find-in-files.el ends here |
@@ -1,84 +0,0 @@ | ||
1 | -;;; navigator.el --- functions to give a better edit experience | |
2 | - | |
3 | -;; Copyright (C) 2022 Markus | |
4 | - | |
5 | -;; Author: Markus <markus.prepens@gmail.com> | |
6 | -;; Keywords: elisp support | |
7 | - | |
8 | -;; This program is free software; you can redistribute it and/or modify | |
9 | -;; it under the terms of the GNU General Public License as published by | |
10 | -;; the Free Software Foundation, either version 3 of the License, or | |
11 | -;; (at your option) any later version. | |
12 | - | |
13 | -;; This program is distributed in the hope that it will be useful, | |
14 | -;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | -;; GNU General Public License for more details. | |
17 | - | |
18 | -;; You should have received a copy of the GNU General Public License | |
19 | -;; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 | - | |
21 | -;;; Commentary: | |
22 | - | |
23 | -;; Some work to be done .... | |
24 | - | |
25 | -;;; Code: | |
26 | - | |
27 | -;;;###autoload | |
28 | -(defun +find-file-in-tag-files () | |
29 | - "An method to open a file, that is listed in the visited | |
30 | -tags file." | |
31 | - (interactive) | |
32 | - (save-excursion | |
33 | - (let* ((all-files nil)) | |
34 | - (visit-tags-table-buffer nil) | |
35 | - (setq all-files (tags-table-files)) | |
36 | - (while (visit-tags-table-buffer t) | |
37 | - (setq all-files (append all-files (tags-table-files)))) | |
38 | - (find-file | |
39 | - (expand-file-name | |
40 | - (completing-read "Open file: " all-files nil t)))))) | |
41 | - | |
42 | -;;;###autoload | |
43 | -(defun +store-last-insertation-point (beg end len) | |
44 | - "Store in `go-back-marker' last point where | |
45 | -`self-insert-command' was called. Function shall be called by | |
46 | -`after-change-functions'." | |
47 | - (when buffer-file-name | |
48 | - (when (not (equal "TAGS" (upcase (file-name-nondirectory buffer-file-name)))) | |
49 | - (setq go-back-marker (point-marker))))) | |
50 | - | |
51 | -;;;###autoload | |
52 | -(defun +go-back-to-last-insertion-point () | |
53 | - "Go back to point of the last text insertion. No stack of | |
54 | -insertation points implemented (dumb and simple). The | |
55 | -point-marker is stored in a variable `go-back-marker'." | |
56 | - (interactive) | |
57 | - (when (boundp 'go-back-marker) | |
58 | - (switch-to-buffer (marker-buffer go-back-marker)) | |
59 | - (goto-char (marker-position go-back-marker)))) | |
60 | - | |
61 | -;;;###autoload | |
62 | -(defun +show-dir-info (&optional prefix) | |
63 | - (interactive "P") | |
64 | - (let* ((help-window-select t)) | |
65 | - (if (not prefix) | |
66 | - (message (if (buffer-file-name) | |
67 | - (format-message "buffer's file '%s'" (expand-file-name (buffer-file-name))) | |
68 | - "buffer has no file")) | |
69 | - (with-help-window | |
70 | - "*buffer-info*" | |
71 | - '(display-buffer-same-window) nil | |
72 | - (progn | |
73 | - (princ (format-message "buffer file name: %s\n" (or (buffer-file-name) "NO FILE"))) | |
74 | - (princ (format "default directory: %s\n" (file-name-as-directory default-directory))) | |
75 | - (princ (format "desktop directory: %s\n" (file-name-as-directory desktop-dirname))) | |
76 | - (princ (format "project root: %s\n" (or (locate-dominating-file default-directory dir-locals-file) "none"))) | |
77 | - (if tags-table-list | |
78 | - (dolist (tf tags-table-list) | |
79 | - (princ (format "visited tag file: %s" tf))) | |
80 | - (princ "visited tag file: NONE"))))))) | |
81 | - | |
82 | -(provide 'navigator) | |
83 | - | |
84 | -;;; navigator.el ends here |