栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

如何重置emacs以utf-8-unix字符编码保存文件?

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

如何重置emacs以utf-8-unix字符编码保存文件?

这是我的设置:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ENCODING ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; C-h C RET;; M-x describe-current-coding-system(add-to-list 'file-coding-system-alist '("\.tex" . utf-8-unix) )(add-to-list 'file-coding-system-alist '("\.txt" . utf-8-unix) )(add-to-list 'file-coding-system-alist '("\.el" . utf-8-unix) )(add-to-list 'file-coding-system-alist '("\.scratch" . utf-8-unix) )(add-to-list 'file-coding-system-alist '("user_prefs" . utf-8-unix) )(add-to-list 'process-coding-system-alist '("\.txt" . utf-8-unix) )(add-to-list 'network-coding-system-alist '("\.txt" . utf-8-unix) )(prefer-coding-system 'utf-8-unix)(set-default-coding-systems 'utf-8-unix)(set-terminal-coding-system 'utf-8-unix)(set-keyboard-coding-system 'utf-8-unix)(set-selection-coding-system 'utf-8-unix)(setq-default buffer-file-coding-system 'utf-8-unix);; Treat clipboard input as UTF-8 string first; compound text next, etc.(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING));; mnemonic for utf-8 is "U", which is defined in the mule.el(setq eol-mnemonic-dos ":CRLF")(setq eol-mnemonic-mac ":CR")(setq eol-mnemonic-undecided ":?")(setq eol-mnemonic-unix ":LF")(defalias 'read-buffer-file-coding-system 'lawlist-read-buffer-file-coding-system)(defun lawlist-read-buffer-file-coding-system ()  (let* ((bcss (find-coding-systems-region (point-min) (point-max)))         (css-table          (unless (equal bcss '(undecided)) (append '("dos" "unix" "mac")         (delq nil (mapcar (lambda (cs)       (if (memq (coding-system-base cs) bcss)(symbol-name cs)))     coding-system-list)))))         (combined-table          (if css-table   (completion-table-in-turn css-table coding-system-alist) coding-system-alist))         (auto-cs          (unless find-file-literally (save-excursion   (save-restriction     (widen)     (goto-char (point-min))     (funcall set-auto-coding-function   (or buffer-file-name "") (buffer-size))))))         (preferred 'utf-8-unix)         (default 'utf-8-unix)         (completion-ignore-case t)         (completion-pcm--delim-wild-regex ; Let "u8" complete to "utf-8".          (concat completion-pcm--delim-wild-regex       "\|\([[:alpha:]]\)[[:digit:]]"))         (cs (completing-read   (format "Coding system for saving file (default %s): " default)   combined-table   nil t nil 'coding-system-history   (if default (symbol-name default)))))    (unless (zerop (length cs)) (intern cs))))


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/394251.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号