branch: elpa/crux commit 3e07035660f953cb08847362378267f5859bbe69 Author: Philippe Vaucher <philippe.vauc...@stvs.com> Commit: Bozhidar Batsov <bozhidar.bat...@gmail.com>
Add missing autoloads --- crux.el | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/crux.el b/crux.el index 04642ac..dac93f6 100644 --- a/crux.el +++ b/crux.el @@ -99,6 +99,7 @@ :type 'list :group 'crux) +;;;###autoload (defun crux-open-with (arg) "Open visited file in default external program. When in dired mode, open file under the cursor. @@ -137,6 +138,7 @@ the current buffer." (funcall function)) (switch-to-buffer-other-window buffer-name))) +;;;###autoload (defun crux-visit-term-buffer () "Create or visit a terminal buffer. If the process in that buffer died, ask to restart." @@ -149,6 +151,7 @@ If the process in that buffer died, ask to restart." (kill-buffer-and-window) (crux-visit-term-buffer))) +;;;###autoload (defun crux-indent-rigidly-and-copy-to-clipboard (begin end arg) "Indent region between BEGIN and END by ARG columns and copy to clipboard." (interactive "r\nP") @@ -159,6 +162,7 @@ If the process in that buffer died, ask to restart." (indent-rigidly (point-min) (point-max) arg) (clipboard-kill-ring-save (point-min) (point-max))))) +;;;###autoload (defun crux-smart-open-line-above () "Insert an empty line above the current line. Position the cursor at its beginning, according to the current mode." @@ -179,6 +183,7 @@ Position the cursor at its beginning, according to the current mode." (forward-line -1) (indent-according-to-mode))) +;;;###autoload (defun crux-smart-open-line (arg) "Insert an empty line after the current line. Position the cursor at its beginning, according to the current mode. @@ -190,6 +195,7 @@ With a prefix ARG open line above the current line." (move-end-of-line nil) (newline-and-indent))) +;;;###autoload (defun crux-smart-kill-line () "Kill to the end of the line and kill whole line on the next call." (interactive) @@ -200,12 +206,13 @@ With a prefix ARG open line above the current line." (goto-char orig-point) (kill-line)))) - +;;;###autoload (defun crux-top-join-line () "Join the current line with the line beneath it." (interactive) (delete-indentation 1)) +;;;###autoload (defun crux-kill-whole-line (&optional arg) "A simple wrapper around command `kill-whole-line' that respects indentation. Passes ARG to command `kill-whole-line' when provided." @@ -213,6 +220,7 @@ Passes ARG to command `kill-whole-line' when provided." (kill-whole-line arg) (move-to-mode-line-start)) +;;;###autoload (defun crux-kill-line-backwards () "Kill line backwards and adjust the indentation." (interactive) @@ -241,7 +249,7 @@ Used by crux functions like crux-move-beginning-of-line to skip over whitespace" (t crux-line-start-regex)))) (search-forward-regexp line-start-regex (line-end-position) t))) - +;;;###autoload (defun crux-move-beginning-of-line (arg) "Move point back to indentation of beginning of line. @@ -265,6 +273,7 @@ point reaches the beginning or end of the buffer, stop there." (when (= orig-point (point)) (move-beginning-of-line 1)))) +;;;###autoload (defun crux-indent-defun () "Indent the current defun." (interactive) @@ -283,6 +292,7 @@ point reaches the beginning or end of the buffer, stop there." (setq end (line-end-position)) (cons beg end))) +;;;###autoload (defun crux-duplicate-current-line-or-region (arg) "Duplicates the current line or region ARG times. If there's no region, the current line will be duplicated. However, if @@ -298,6 +308,7 @@ there's a region, all lines that region covers will be duplicated." (setq end (point))) (goto-char (+ origin (* (length region) arg) arg)))) +;;;###autoload (defun crux-duplicate-and-comment-current-line-or-region (arg) "Duplicates and comments the current line or region ARG times. If there's no region, the current line will be duplicated. However, if @@ -315,6 +326,7 @@ there's a region, all lines that region covers will be duplicated." (setq end (point))) (goto-char (+ origin (* (length region) arg) arg)))) +;;;###autoload (defun crux-rename-file-and-buffer () "Rename current buffer and if the buffer is visiting a file, rename it too." (interactive) @@ -332,6 +344,7 @@ there's a region, all lines that region covers will be duplicated." (defalias 'crux-rename-buffer-and-file #'crux-rename-file-and-buffer) +;;;###autoload (defun crux-delete-file-and-buffer () "Kill the current buffer and deletes the file it is visiting." (interactive) @@ -346,6 +359,7 @@ there's a region, all lines that region covers will be duplicated." (defalias 'crux-delete-buffer-and-file #'crux-delete-file-and-buffer) +;;;###autoload (defun crux-view-url () "Open a new buffer containing the contents of URL." (interactive) @@ -359,6 +373,7 @@ there's a region, all lines that region covers will be duplicated." (delete-blank-lines) (set-auto-mode))) +;;;###autoload (defun crux-cleanup-buffer-or-region () "Cleanup a region if selected, otherwise the whole buffer." (interactive) @@ -368,6 +383,7 @@ there's a region, all lines that region covers will be duplicated." (call-interactively #'indent-region)) (whitespace-cleanup)) +;;;###autoload (defun crux-eval-and-replace () "Replace the preceding sexp with its value." (interactive) @@ -375,6 +391,7 @@ there's a region, all lines that region covers will be duplicated." (backward-kill-sexp) (insert (format "%S" value)))) +;;;###autoload (defun crux-recompile-init () "Byte-compile all your dotfiles again." (interactive) @@ -396,6 +413,7 @@ See `file-attributes' for more info." (find-alternate-file (concat "/sudo:root@localhost:" filename))) (require 'ido) +;;;###autoload (defun crux-sudo-edit (&optional arg) "Edit currently visited file as root. @@ -408,6 +426,7 @@ buffer is not visiting a file." (ido-read-file-name "Find file (as root): "))) (crux-find-alternate-file-as-root buffer-file-name))) +;;;###autoload (defun crux-reopen-as-root () "Find file as root if necessary. @@ -429,11 +448,13 @@ as the current user." (add-hook 'find-file-hook #'crux-reopen-as-root) (remove-hook 'find-file-hook #'crux-reopen-as-root))) +;;;###autoload (defun crux-insert-date () "Insert a timestamp according to locale's date and time format." (interactive) (insert (format-time-string "%c" (current-time)))) +;;;###autoload (defun crux-recentf-find-file () "Find a recent file using `completing-read'." (interactive) @@ -446,6 +467,7 @@ as the current user." (define-obsolete-function-alias 'crux-recentf-ido-find-file 'crux-recentf-find-file "0.4.0") ;; modified from https://www.emacswiki.org/emacs/TransposeWindows +;;;###autoload (defun crux-transpose-windows (arg) "Transpose the buffers shown in two windows. Prefix ARG determines if the current windows buffer is swapped @@ -463,12 +485,14 @@ transpositions to execute in sequence." (defalias 'crux-swap-windows 'crux-transpose-windows) +;;;###autoload (defun crux-switch-to-previous-buffer () "Switch to previously open buffer. Repeated invocations toggle between the two most recently open buffers." (interactive) (switch-to-buffer (other-buffer (current-buffer) 1))) +;;;###autoload (defun crux-kill-other-buffers () "Kill all buffers but the current one. Doesn't mess with special buffers." @@ -478,6 +502,7 @@ Doesn't mess with special buffers." #'kill-buffer (delete (current-buffer) (seq-filter #'buffer-file-name (buffer-list)))))) +;;;###autoload (defun crux-create-scratch-buffer () "Create a new scratch buffer." (interactive) @@ -485,11 +510,13 @@ Doesn't mess with special buffers." (switch-to-buffer buf) (funcall initial-major-mode))) +;;;###autoload (defun crux-find-user-init-file () "Edit the `user-init-file', in another window." (interactive) (find-file-other-window user-init-file)) +;;;###autoload (defun crux-find-shell-init-file () "Edit the shell init file in another window." (interactive) @@ -507,6 +534,7 @@ Doesn't mess with special buffers." (find-file-other-window (car candidates))))) ;; http://endlessparentheses.com/ispell-and-abbrev-the-perfect-auto-correct.html +;;;###autoload (defun crux-ispell-word-then-abbrev (p) "Call `ispell-word', then create an abbrev for it. With prefix P, create local abbrev. Otherwise it will