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?
This commit is contained in:
Daniel - 2022-12-21 09:34:56 +01:00
parent 1eee33ea5d
commit 8511ebb82a
No known key found for this signature in database
GPG Key ID: 784AA8DF0CCDF625
1 changed files with 7 additions and 3 deletions

10
init.el
View File

@ -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)