;;; この設定を入れるとEmacsを終了してもfoldが持続する ;; (setq fold-this-persistent-folds t) (defun fold-this--this-or-all (all) (interactive "P") (let ((x (bounds-of-thing-at-point 'sexp)) (rap (region-active-p))) (funcall (if all 'fold-this-all 'fold-this) (if rap (region-beginning) (car x)) (if rap (region-end) (cdr x)))) (message (substitute-command-keys "To unfold all, try \\[fold-this-unfold-all]"))) (with-eval-after-load "view" (define-key view-mode-map (kbd "f") 'fold-this--this-or-all))