平衡点


2025/03/06

_ Emacs30 で lookup-el が動かなくなった.

make-verctorobarray-make という奴ですね.

Old code which (incorrectly) created "obarrays" as Lisp vectors filled with something other than 0, as in '(make-vector N nil)', will no longer work, and should be rewritten to use 'obarray-make'. Alternatively, you can fill the vector with 0.

とりあえず

--- a/lisp/lookup.el
+++ b/lisp/lookup.el
@@ -601,7 +601,7 @@ ID B$O<-=qIDB!#TAG B$O%*%W%7%g%s$N%?%0!#VALUE B$O%;%C%H$9$kCM!#
 ;:: Internal functions
 ;;;

-(defconst lookup-obarray (make-vector 1511 nil))
+(defconst lookup-obarray (if (fboundp 'obarray-make) (obarray-make 1511) (make-vector 1511 nil)))

 (defsubst lookup-intern-string (string)
   (symbol-name (intern string lookup-obarray)))

としたら動くようにはなったけど, これでエエのかしらね…

でもって, 現在の lookup-el の upstream はどこなの?


2025/03/25

_ Wanderlustで日本語の添付ファイルを扱う defadvice を nadvice に書き換える(失敗?)

Emacs30 から defadvice が obsolete となったので, 書き換えてみたり. 自分の設定ファイルを眺めてみたら, 書き換え対象は Wanderlust で日本語の添付ファイルを扱うための advice だった.

添付ファイル名が日本語の場合に正しく表示する advice

修正前

(leaf mime
  :config
  '(defadvice mime-entity-filename
       (after eword-decode-for-broken-MUA activate)
     "Decode eworded file name for *BROKEN* MUA."
     (when (stringp ad-return-value)
       (setq ad-return-value (eword-decode-string ad-return-value t))))
  )

これを修正. ついでに eword-decode-string が autoload される様にしてみたり.

(leaf eword-decode
  :doc "クォートされた文字列もデコードするようにする"
  :commands eword-decode-string
  :config
  (mime-set-field-decoder
   'From nil 'eword-decode-and-unfold-unstructured-field-body)
  (mime-set-field-decoder
   'CC nil 'eword-decode-and-unfold-unstructured-field-body)
  (mime-set-field-decoder
   'To nil 'eword-decode-and-unfold-unstructured-field-body)
  )
;; 
(leaf mime
  :doc "日本語の添付ファイル名を正しく表示する"
  :preface
;;;###autoload
  (defun my:mime-entity-filename (orig-value)
    "Decode eworded file name for *BROKEN* MUA."
    (when (stringp orig-value)
      (eword-decode-string orig-value t)))
  :advice
  (:filter-return mime-entity-filename
                  my:mime-entity-filename)
  )

添付ファイル名が日本語の場合に正しくエンコードする advice

修正前. はて, 私はいつ use-package に書き換えたんだろうか…?

(use-package std11
  :config
  '(defadvice std11-wrap-as-quoted-string (before encode-string activate)
     "Encode a string."
     (use-package eword-encode
       (ad-set-arg 0 (or (eword-encode-string (ad-get-arg 0)) "" ))
       )
     ))

これを修正. はて, 本当に filter-args で良いのかな.

(leaf std11
  :preface
  (leaf eword-encode :commands eword-encode-string)
;;;###autoload
  (defun std11-wrap-as-quoted-string-advice (string)
    "Encode a string before wrapping as RFC 822 quoted-string."
    (or (eword-encode-string string) ""))
  :advice
  ((:filter-args std11-wrap-as-quoted-string
                 std11-wrap-as-quoted-string-advice)
   )
  )

…微妙に上手く動いていない, 様な? :around なんだろうか?

ところで

これらの advice ってまだ必要なんだっけ?


連絡先など
最近の日記
  • 2025/04/03
    • 1. 居室ルータのネットワーク上流が死んでた.
  • 2025/03/25
    • 1. Wanderlustで日本語の添付ファイルを扱う defadvice を nadvice に書き換える(失敗?)
  • 2025/03/06
    • 1. Emacs30 で lookup-el が動かなくなった.
  • 2025/02/20
    • 1. Thinkpad X13 Gen5 を購入した.
  • 2024/12/05
    • 1. 11月末〜12月の出張三昧がようやく一段落
    • 2. サイトの scss を Dart Sass v3.5 に対応
一覧
2006|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|02|03|04|08|09|10|11|12|
2013|01|02|03|04|05|06|08|09|10|11|12|
2014|01|02|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|09|10|
2016|02|03|
2017|01|02|03|05|06|07|09|11|12|
2018|03|06|07|10|11|12|
2019|01|02|03|04|05|07|10|12|
2020|01|02|03|04|05|08|09|10|11|12|
2021|01|02|03|05|06|07|08|09|11|12|
2022|01|02|03|04|05|06|08|10|11|12|
2023|02|03|04|06|08|09|11|12|
2024|01|02|03|04|05|06|10|12|
2025|02|03|04|
Back to Top ▲