fix(emacs): Expand paths given to age.el
This commit is contained in:
@@ -1,74 +0,0 @@
|
||||
;;; syd-search.el --- Description -*- lexical-binding: t; -*-
|
||||
;;
|
||||
;; Copyright (C) 2025 Madeleine Sydney
|
||||
;;
|
||||
;; Author: Madeleine Sydney <lomiskiam@gmail.com>
|
||||
;; Maintainer: Madeleine Sydney <lomiskiam@gmail.com>
|
||||
;; Created: January 12, 2025
|
||||
;; Modified: January 12, 2025
|
||||
;; Version: 0.0.1
|
||||
;; Keywords: abbrev bib c calendar comm convenience data docs emulations extensions faces files frames games hardware help hypermedia i18n internal languages lisp local maint mail matching mouse multimedia news outlines processes terminals tex text tools unix vc
|
||||
;; Homepage: https://github.com/crumb/syd-search
|
||||
;; Package-Requires: ((emacs "24.3"))
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
;;
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Description
|
||||
;;
|
||||
;;; Code:
|
||||
|
||||
(cl-defun syd-search-region (beg end &key initial)
|
||||
(save-restriction
|
||||
(narrow-to-region beg end)
|
||||
(consult-line initial)))
|
||||
|
||||
(defun syd-search--escape-regexp (str)
|
||||
(require 'syd-text)
|
||||
(replace-regexp-in-string " " "\\\\ "
|
||||
(syd-pcre-quote str)))
|
||||
|
||||
(defun syd-search-buffer (buffer)
|
||||
"Conduct a text search on BUFFER.
|
||||
|
||||
If a selection is active and multi-line, perform a search restricted to that
|
||||
region.
|
||||
|
||||
If a selection is active and not multi-line, use the selection as the initial
|
||||
input and search the whole buffer for it."
|
||||
(interactive (list (current-buffer)))
|
||||
(save-restriction
|
||||
(let* ((beg (region-beginning))
|
||||
(end (region-end))
|
||||
(multiline-p (/= (line-number-at-pos beg)
|
||||
(line-number-at-pos end))))
|
||||
(if (and beg end (region-active-p))
|
||||
(progn (deactivate-mark)
|
||||
(if multiline-p
|
||||
(syd-search-region beg end)
|
||||
;; Treat as a single pattern, not several
|
||||
;; space-separated patterns.
|
||||
(consult-line (syd-search--escape-regexp
|
||||
(buffer-substring-no-properties beg end)))))
|
||||
(consult-line)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun syd-search-directory (dir)
|
||||
(interactive (list (read-directory-name
|
||||
"Search directory: "
|
||||
default-directory nil t)))
|
||||
(cond ((executable-find "rg")
|
||||
(consult-ripgrep dir))
|
||||
((executable-find "grep")
|
||||
(message "Couldn't find ripgrep; using grep")
|
||||
(consult-grep dir))))
|
||||
|
||||
;;;###autoload
|
||||
(defun syd-search-current-directory ()
|
||||
(interactive)
|
||||
(syd-search-directory default-directory))
|
||||
|
||||
|
||||
(provide 'syd-search)
|
||||
;;; syd-search.el ends here
|
||||
0
users/crumb/programs/emacs/lib/syd-search.el
Normal file → Executable file
0
users/crumb/programs/emacs/lib/syd-search.el
Normal file → Executable file
@@ -3,8 +3,9 @@
|
||||
(use-package age
|
||||
:hook (on-first-file . age-file-enable)
|
||||
:custom
|
||||
;; We use rage over age, as the former supports pinentry.
|
||||
((age-program "rage")
|
||||
(age-default-identity "~/private-keys/age/crumb.age")
|
||||
(age-default-recipient "~/public-keys/age/crumb.pub")))
|
||||
(age-default-identity (expand-file-name "~/private-keys/age/crumb.age"))
|
||||
(age-default-recipient (expand-file-name "~/public-keys/age/crumb.pub"))))
|
||||
|
||||
(provide 'syd-age)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
;;; syd-org.el -*- lexical-binding: t; -*-
|
||||
|
||||
(require 'syd-prose)
|
||||
|
||||
(with-eval-after-load 'org
|
||||
(syd-add-hook 'org-tab-first-hook
|
||||
(defun syd-org-cycle-only-current-subtree-h (&optional arg)
|
||||
@@ -306,9 +304,10 @@ See https://lists.gnu.org/archive/html/emacs-orgmode/2019-07/msg00081.html."
|
||||
;; ol-rmail
|
||||
;; ol-eww
|
||||
))
|
||||
(syd-add-hook 'org-load-hook
|
||||
(add-hook 'org-load-hook
|
||||
#'syd-org-init-popup-rules-h)
|
||||
:config
|
||||
(require 'syd-prose)
|
||||
(syd-add-hook 'org-mode-hook
|
||||
#'org-indent-mode
|
||||
#'syd-prose-mode)
|
||||
|
||||
Reference in New Issue
Block a user