12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- (require 'org)
- (defun al/next-link (&optional search-backward)
- "Go to the next link."
-
- (interactive)
- (when (and org-link-search-failed
- (eq this-command last-command))
- (goto-char (point-min))
- (message "Link search wrapped back to beginning of buffer"))
- (setq org-link-search-failed nil)
- (let* ((pos (point))
- (srch-fun (if search-backward
- 're-search-backward
- 're-search-forward)))
- (when (looking-at org-any-link-re)
-
- (forward-char (if search-backward -1 1)))
- (if (funcall srch-fun org-any-link-re nil t)
- (progn
- (goto-char (match-beginning 0))
- (if (outline-invisible-p) (org-show-context)))
- (goto-char pos)
- (setq org-link-search-failed t)
- (message "No further link found"))))
- (defun al/previous-link ()
- "Go to the previous link."
- (interactive)
- (al/next-link t))
- (defun al/create-tags (shell-cmd)
- "Create tags file using shell command SHELL-CMD.
- Interactively prompt for shell command.
- With prefix, prompt for directory as well."
- (interactive
- (let ((dir (if current-prefix-arg
- (read-directory-name "Root tags directory: ")
- "")))
- (list (read-shell-command
- "Shell command for generating tags: "
- (format "find %s -type f -name '*.[ch]' | etags -" dir)))))
- (eshell-command shell-cmd))
- (defun al/show-disabled-commands ()
- "Show all disabled commands."
- (interactive)
- (with-output-to-temp-buffer "*Disabled commands*"
- (mapatoms (lambda (symbol)
- (when (get symbol 'disabled)
- (prin1 symbol)
- (princ "\n"))))))
- (defun al/refontify (&rest _)
- "Refontify the current buffer."
- (jit-lock-refontify))
- (defun al/set-isearch-input-method (input-method)
- "Activate input method INPUT-METHOD in interactive search.
- See `set-input-method' for details."
- (set-input-method input-method)
- (setq isearch-input-method-function input-method-function)
- (isearch-update))
- (provide 'al-misc-cmd)
|