Emacs 初级配置: Difference between revisions

From 清冽之泉
Jump to navigation Jump to search
Line 1: Line 1:
== basic ==
<syntaxhighlight lang="elisp" line>
;; (set-face-attribute 'default nil :font "DejaVu Serif:pixelsize=30")
;; (set-fontset-font t 'han "TW-MOE-Std-Kai:pixelsize=30")
;; (set-fontset-font t 'han "WenQuanYi Zen Hei:pixelsize=25" nil 'append)
;; DejaVu Serif, TW-MOE-Std-Kai, WenQuanYi Micro Hei
(set-face-attribute 'default nil :height 160)
(set-fontset-font t 'han "WenQuanYi Micro Hei:pixelsize=20")
</syntaxhighlight>
== onoff ==
== onoff ==
<syntaxhighlight lang="elisp" line>
<syntaxhighlight lang="elisp" line>

Revision as of 22:44, 13 July 2026

onoff

(load-theme 'adwaita t)

defun

say-ok-after-server-edit

;; 抄自 https://www.emacswiki.org/emacs/YesOrNoP,负作用不详,symbol-function 不懂
;; 作用为:建议server-edit函数执行后的询问是否保存,一概选是
;; (defadvice server-edit (around auto-confirm compile activate)
  ;; (cl-letf (((symbol-function 'yes-or-no-p) (lambda (&rest args) t))
  ;;           ((symbol-function 'y-or-n-p) (lambda (&rest args) t)))
  ;;   ad-do-it)
  ;; (sanityinc/maybe-suspend-frame))

(defadvice kill-current-buffer (around auto-confirm compile activate)
  (cl-letf (((symbol-function 'yes-or-no-p) (lambda (&rest args) t))
            ((symbol-function 'y-or-n-p) (lambda (&rest args) t)))
    ad-do-it)
  (sanityinc/maybe-suspend-frame))

t-mw-define

(defun t-mw-define ()
  (interactive)
  "give mediawiki define element a :"
  (replace-regexp "^ ?" ": " nil))

mediawiki

'(mediawiki-site-alist
   '(("name" "http://n.n.n.n/mediawiki/" "user" "passwd" nil "Main Page")
     ("name" "https://someplace.com/mediawiki/" "user" "passwd" nil "Main Page")))