#+TITLE: Emacs Configuration #+HTML_DOCTYPE: xhtml # xhtml for gogs needed, bug showing table in the footer, bc/ html5 creates instead of This is an ongoing evolution of Emacs configuration files, inspired by a bunch of online resources. * Installation :PROPERTIES: :CUSTOM_ID: installation :END: Download repo and point the emacs =init= (and =early-init.el=) file to this configuration. Or run one of the following install script commands (using curl, wget or fetch). #+begin_src sh sh -c "$(curl -fsSL http://gitea.weseng.de/daniel/emacs/raw/master/scripts/install.sh)" sh -c "$(wget -O- http://gitea.weseng.de/daniel/emacs/raw/master/scripts/install.sh)" sh -c "$(fetch -o - http://gitea.weseng.de/daniel/emacs/raw/master/scripts/install.sh)" #+end_src Installation path is =~/.config/emacs=. See details and other installed linux packages as requirements inside =sripts/install.sh=. * Usage :PROPERTIES: :CUSTOM_ID: usage :END: See the emacs command =my-help= for some key-bindings and further commands and information. - Org Templates - Article: =?article[TAB]= / YASnippet - org-mode - Article Templates - Article - Letter: =?letter[TAB]= / YASnippet - org-mode - Letter Templates - Letter - Org Export - To Article HTML (extended version) - =my-org-article-html-export-to-html= / My - Org Export - Article HTML - =my-org-article-html-export-to-html-notify-async= (=F5=) / My - Org Export - Article HTML async - To Article PDF (LaTeX, extended version) - =my-org-article-latex-export-to-pdf= / My - Org Export - Article PDF - =my-org-article-latex-export-to-pdf-notify-async= (=F6=) / My - Org Export - Article PDF async - To Letter (LaTeX) - =my-org-letter-latex-export-to-pdf= (=C-c C-e l t=) * Packages :PROPERTIES: :CUSTOM_ID: packages :END: General key bindings and functions - =C-r= (=query-replace-regexp=) replace text - =C-x RET f= (=set-buffer-file-coding-system=) e.g. set to =utf-8 - (=decode-coding-region=) e.g. decode to =utf-8= (郭富城Aaron Kwok) - (=diff-buffer-with-file=) show a diff between buffer (current state) and file (saved state) #+begin_src sh :results output :exports results dir=$HOME/repos/emacs-conf/lisp verinfo() { #echo -n $1 '' if test -f $dir/$1.el; then ver=$(grep -i package-version: $dir/$1.el | cut -d":" -f2 | xargs) if test -z $ver; then ver=$(grep -i version: $dir/$1.el | cut -d":" -f2 | xargs) fi echo $ver elif test -d $dir/$1; then emacs --batch --eval "(princ (nth 2 (read (with-temp-buffer (insert-file-contents \"$dir/$1/$1-pkg.el\") (buffer-string)))))" echo '' fi } pkg_custom=$( for i in $(echo awesome-tray dialog); do pkg=$(sed 's/-[0-9].*//' <(basename $i)) ver=$(verinfo $pkg) echo $pkg $ver custom done) pkg_elpagnu=$( for i in $(ls -F ~/repos/my-elpa-gnu/archive/*.tar | grep -v @); do pkg=$(sed 's/-[0-9].*//' <(basename $i)) ver=$(verinfo $pkg) echo $pkg $ver elpa-gnu done) pkg_elpanongnu=$( for i in $(ls -F ~/repos/my-elpa-nongnu/archive/*.tar | grep -v @); do pkg=$(sed 's/-[0-9].*//' <(basename $i)) ver=$(verinfo $pkg) echo $pkg $ver elpa-nongnu done) pkg_melpa=$( for i in $(sort <(ls ~/repos/my-melpa/packages/*.tar | xargs -n1) <(ls ~/repos/my-melpa/packages/*.el | xargs -n1)); do pkg=$(sed 's/-[0-9].*//' <(basename $i)) ver=$(verinfo $pkg) echo $pkg $ver melpa done) echo -e "$pkg_custom\n$pkg_elpagnu\n$pkg_elpanongnu\n$pkg_melpa" | sort | column -t -N PACKAGE_____________________,VERSION______,REPO_______ #+end_src #+RESULTS: #+begin_example PACKAGE_____________________ VERSION______ REPO_______ ace-window 20200606.1259 melpa adaptive-wrap 0.8 elpa-gnu all-the-icons 20211225.506 melpa amx 20210305.118 melpa anaconda-mode 20211122.817 melpa async 20210823.528 melpa avy 20220102.805 melpa awesome-tray 4.2 custom biblio 20210418.406 melpa biblio-core 20210418.406 melpa bibtex-completion 20211019.1306 melpa bind-key 20210210.1609 melpa citeproc 20220101.1527 melpa cl-libify 20181130.230 melpa company 20220103.351 melpa company-anaconda 20200404.1859 melpa company-ledger 20210910.250 melpa company-quickhelp 20211115.1335 melpa company-web 20180402.1155 melpa counsel 20211230.1909 melpa crdt 0.2.7 elpa-gnu ctable 20210128.629 melpa dash 20210826.1149 melpa dashboard 20211221.2005 melpa deft 20210707.1633 melpa delight 1.7 elpa-gnu dialog 0.2 custom diff-hl 20211106.2353 melpa dim 20160818.949 melpa elisp-refs 20211009.1531 melpa emojify 20210108.1111 melpa ess 20211231.1746 melpa ess-R-data-view 20130509.1158 melpa f 20210624.1103 melpa flycheck 20210825.1804 melpa flycheck-ledger 20200304.2204 melpa flycheck-pos-tip 20200516.1600 melpa flyspell-correct 20210724.1042 melpa flyspell-correct-ivy 20210124.1143 melpa focus 20191209.2210 melpa git-commit 20220101.841 melpa git-messenger 20201202.1637 melpa gnuplot 20220102.1637 melpa helpful 20211226.1843 melpa ht 20210119.741 melpa htmlize 20210825.2150 melpa hydra 20220102.803 melpa indent-guide 20210115.400 melpa iscroll 20210128.1938 melpa ivy 20211231.1730 melpa ivy-bibtex 20210927.1205 melpa ivy-rich 20210409.931 melpa js2-mode 20211229.135 melpa key-chord 20201222.2030 melpa langtool 20200529.230 melpa ledger-mode 20211214.1449 melpa lv 20200507.1518 melpa magit 20220126.1645 melpa magit-section 20220101.841 melpa markdown-mode 20211022.55 melpa memoize 20200103.2036 melpa mu4e-maildirs-extension 20201028.921 melpa multiple-cursors 20211112.2223 melpa ob-async 20210428.2052 melpa org 9.5.2 elpa-gnu org-appear 20211202.604 melpa org-brain 20210706.1519 melpa org-cliplink 20201126.1020 melpa org-contrib 0.3 elpa-nongnu org-drill 20210427.2003 melpa org-fancy-priorities 20210830.1657 melpa org-fragtog 20220106.758 melpa orgit 20210620.1943 melpa org-ref 20220101.1941 melpa org-sticky-header 20201223.143 melpa org-superstar 20210915.1934 melpa org-table-sticky-header 20190924.506 melpa ov 20200326.1042 melpa ox-reveal 20220410.1533 melpa ox-tufte 20160926.1607 melpa page-break-lines 20210104.2224 melpa parsebib 20211208.2335 melpa pdf-tools 20220103.308 melpa persist 0.4 elpa-gnu pfuture 20211229.1513 melpa php-mode 20210808.1745 melpa plantuml-mode 20191102.2056 melpa polymode 20211124.913 melpa popup 20211231.1823 melpa popwin 20210215.1849 melpa pos-tip 20191227.1356 melpa powershell 20220103.925 melpa pythonic 20210122.1247 melpa queue 0.2 elpa-gnu rainbow-mode 1.0.5 elpa-gnu restart-emacs 20201127.1425 melpa s 20210616.619 melpa spacemacs-theme 20210924.1220 melpa sphinx-doc 20210213.1250 melpa sql-indent 1.6 elpa-gnu srefactor 20180703.1810 melpa stickyfunc-enhance 20150429.1814 melpa string-inflection 20210918.419 melpa swiper 20210919.1221 melpa systemd 20210209.2052 melpa transient 20220104.1601 melpa treemacs 20220104.1302 melpa treemacs-magit 20211010.1005 melpa use-package 20210207.1926 melpa virtual-auto-fill 20200906.2038 melpa visual-fill-column 20211118.33 melpa vterm 20211226.817 melpa web-completion-data 20160318.848 melpa web-mode 20220104.1504 melpa which-key 20220102.1433 melpa with-editor 20220101.1316 melpa yasnippet 20200604.246 melpa yasnippet-snippets 20210910.1959 melpa #+end_example * Information :PROPERTIES: :CUSTOM_ID: information :END: Interlock symlinks and auto-save files. Be aware that symbolic links of the form “.#*” are not auto-save files but interlocks to prevent the simultaneous editing of the same file. See [[https://www.emacswiki.org/info-ref?find=Interlocking][Interlocking]] in the [[https://www.emacswiki.org/emacs/EmacsManual][EmacsManual]] for details. * Errors :PROPERTIES: :CUSTOM_ID: errors :END: - failed execution of bibtex2html - see bib2htmlxxxxxx.blg for errors, e.g. - I couldn't open style file acmu.bst - copy/merge the texmf directory into your home directory. - when using this in an Org mode buffer: =#+HEADER: :fit yes :imagemagick yes :iminoptions -density 300= - can leads to: - =convert: attempt to perform an operation not allowed by the security policy `gs' @ error/delegate.c/ExternalDelegateCommand/378.= - =convert: no images defined `DESY_logo_tikz.png' @ error/convert.c/ConvertImageCommand/3282.= - edit =/etc/ImageMagick-7/policy.xml= and comment out - ~~ * TODOs :PROPERTIES: :CUSTOM_ID: todos :END: - Org / global configuration - Page formatting - Modify HTML styling - Printed page layout, white styled figures - Figures - Gnuplot - plot transposed files/tables - Tables - Wrap Table in div element. For smartphone scrolling. - Table of contents - \(\LaTeX\); currently headers with no-number property means not included in TOC - HTML; currently generated list, like lot and lol, are not included in toc but own headers without numbers are. - Equation cancel/strike out with color line - hcancel[color]{} - Example: ~\(\hcancel[red]{f_{X_2}(x_2)}}\)~ - Definition: - Preamble: ~#+LATEX_HEADER: \usepackage{cancel}~ \\ ~#+LATEX_HEADER: \newcommand\hcancel[2][black]{\setbox0=\hbox{$#2$}%~ \\ ~#+LATEX_HEADER: \rlap{\raisebox{.45\ht0}{\textcolor{#1}{\rule{\wd0}{1pt}}}}#2}~ \\ - ~hcancel: [\"{\\\\setbox0=\\\\hbox{$#2$}\\\\rlap{\\\\raisebox{.45\\\\ht0}{\\\\textcolor{#1}{\\\\rule{\\\\wd0}{1pt}}}}#2}\",2]~ #+Begin_example MathJax.Ajax.config.path[\"Contrib\"] = \"https://cdn.mathjax.org/mathjax/contrib\"; MathJax.Hub.Register.StartupHook(\"TeX Jax Ready\",function () { MathJax.Hub.Insert(MathJax.InputJax.TeX.Definitions.macros,{ cancel: [\"Extension\",\"cancel\"], bcancel: [\"Extension\",\"cancel\"], xcancel: [\"Extension\",\"cancel\"], cancelto: [\"Extension\",\"cancel\"] }); }); #+End_example