平衡点
2026/03/08
_ 日記データの重複削除など (3/n)[Computer]
日記関連の整理中
データ消失(?)からの復旧などを行なったり, json の読み込みを preload 化したり.
- amp-image はそのまま image_ex.rb に戻せば良いかな?
- loading="lazy" を付けたりじたばたしたいので, 少し弄る必要があるかな.
- どうせなら thumbnail 生成弄りたいし, 今時なら webp とかに変えるのかね.
- amp-twitter は, どうせなら oembed で書き直したい所
さて, どうなることやら.
本業はどうした?
_ orgmine の修正[Computer] [Emacs]
報告したあと, 調べる余裕がなくて
(setq org-element-use-cache nil)
として凌いでいたけれど,
org-entry-get の第4引数を t にすればその場探索になるので無限ループしなくて良い, ということで.
From 76a059c5490f81f10319f501a5c715dfbee2a921 Mon Sep 17 00:00:00 2001
From: Youhei SASAKI <uwabami@gfd-dennou.org>
Date: Sun, 8 Mar 2026 18:57:00 +0900
Subject: [PATCH] Fix max-lisp-eval-depth error by bypassing org-element-cache
Org 9.6 and later enable org-element-cache by default. When performing
recursive buffer operations, frequent property access via org-entry-get
triggers heavy re-parsing and cache synchronization, leading to infinite
recursion or "Invalid search bound" errors.
This commit updates org-entry-get calls to use the 4th argument (LITERAL)
set to 't', forcing the use of faster regex-based property retrieval
instead of the complex element parser. This stabilizes synchronization
tasks in large buffers and archived files.
Fixes #16
Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
---
orgmine.el | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/orgmine.el b/orgmine.el
index 2375f50..703775f 100644
--- a/orgmine.el
+++ b/orgmine.el
@@ -1131,7 +1131,7 @@ from the headline property drawer."
(save-restriction
;; (widen)
;; (org-show-hidden-entry) ;XXX
- (org-entry-get pom name inherit))
+ (org-entry-get pom name inherit t))
;; (or properties
;; (setq properties (orgmine-entry-properties pom 'all)))
(cdr (assoc-string name properties t)))))
@@ -1166,7 +1166,7 @@ Only the properties given by PROPERTY-LIST are retrieved."
(defun orgmine-todo-keyword (name)
"Convert Redmine a status name to orgmode todo keyword.
Space characters and brackets are removed from the status name."
- (replace-regexp-in-string "(.*)" ""
+ (replace-regexp-in-string "(.*)" ""
(replace-regexp-in-string " " "" name)))
(defvar orgmine-statuses)
@@ -1252,9 +1252,9 @@ is returned."
(goto-char beg)
(let* ((title (org-element-property :title issue))
(todo-keyword (org-element-property :todo-keyword issue))
- (scheduled (org-entry-get nil "SCHEDULED"))
- (deadline (org-entry-get nil "DEADLINE"))
- (effort (org-entry-get nil org-effort-property)) ; "Effort"
+ (scheduled (org-entry-get nil "SCHEDULED" nil t))
+ (deadline (org-entry-get nil "DEADLINE" nil t))
+ (effort (org-entry-get nil org-effort-property t)) ; "Effort"
(plist-inherit
(orgmine-get-properties nil '(tracker fixed_version project) t))
(plist
@@ -2018,12 +2018,12 @@ The variables to be copies are whose names start with
\"orgmine-\", \"org-\", or \"elmine/\"."
(with-current-buffer buf-to
(mapc (lambda (var)
- (let ((symbol (car var))
- (value (cdr var)))
- (if (string-match "^\\(orgmine-\\|org-\\|elmine/\\)"
- (symbol-name symbol))
- (set (make-local-variable symbol) value))))
- (buffer-local-variables buf-from))))
+ (let ((symbol (car var))
+ (value (cdr var)))
+ (if (and (string-match "^\\(orgmine-\\|org-\\|elmine/\\)" (symbol-name symbol))
+ (not (string-match "^\\(org-element-\\|org-outline-\\)" (symbol-name symbol))))
+ (set (make-local-variable symbol) value))))
+ (buffer-local-variables buf-from))))
(defvar orgmine-id-list-alist nil)
@@ -2055,7 +2055,7 @@ The variables to be copies are whose names start with
(defun orgmine-archived-ids (tag id-prop)
(let ((afile (car (org-archive--compute-location
- (or (org-entry-get nil "ARCHIVE" 'inherit) org-archive-location)))))
+ (or (org-entry-get nil "ARCHIVE" 'inherit t) org-archive-location)))))
;; (let ((afile (org-extract-archive-file)))
(if (file-exists-p afile)
(let* ((curbuf (current-buffer))
@@ -2846,7 +2846,7 @@ found in the region from BEG to END."
(defun orgmine-show-assigned-to-me (todo-only)
"Show entries of Redmine issue/version to update."
(interactive "P")
- (let ((me (org-entry-get (point-min) "om_me" t)))
+ (let ((me (org-entry-get (point-min) "om_me" t t)))
(unless me
(error
"om_me property not found. define it by \"#+PROPERTY om_me\" line"))
--
2.53.0
などなど.
…あれ, =tDiary= の org-mode style, ちょっと変かな?
[ツッコミを入れる]