From 8511ebb82acbd151c57ad16a867d04921ef2b3e6 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Wed, 21 Dec 2022 09:34:56 +0100 Subject: [PATCH] Replace personal function redefinitions with around advices This way the original function definition is left intact and can be found via the help buffer. The manual overwrite of `org-ql--link-regexp` has been left as it is, as it's a `cl-defun` definition and I am not quite sure how turn this into an ELisp around advice without breaking things. The manual fix for `enriched-decode-display-prop` has also been left untouched, maybe this should be an around advice as well? --- init.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/init.el b/init.el index f4e38cf..a12f530 100644 --- a/init.el +++ b/init.el @@ -964,7 +964,10 @@ ;; this to only parse what we are looking for. This makes tag ;; search *much* faster! (with-eval-after-load 'org - (defun org-cached-entry-get (pom property) + (define-advice org-cached-entry-get (:around + (orig-fun pom property) + speed-up-cache-lookup) + (ignore orig-fun) (if (or (eq t org-use-property-inheritance) (and (stringp org-use-property-inheritance) (let ((case-fold-search t)) @@ -1761,8 +1764,9 @@ point to the beginning of buffer first." ;; and the mail as well. Redefining `mm-copy-to-buffer' to also ;; search for ^\r\n might help. - (defun mm-copy-to-buffer () - "Copy the contents of the current buffer to a fresh buffer." + (define-advice mm-copy-to-buffer (:around (orig-fun) also-consider-crlf) + "Overwrite `mm-copy-to-buffer' to allow for CRLF in addition to LF." + (ignore orig-fun) (let ((obuf (current-buffer)) (mb enable-multibyte-characters) beg)