Skip to content

Latest commit

 

History

History
213 lines (195 loc) · 10.9 KB

emacsNotes.org

File metadata and controls

213 lines (195 loc) · 10.9 KB

compiling native comp from source

First download the code (could git clone or src tarball from https://git.savannah.gnu.org/cgit/emacs.git/?h=feature/native-comp)

in that directory run autogen.sh

Then run a command like this:

./configure PKG_CONFIG_PATH='/path/to/individual/pkgconfig:/path/to/another/pkgconfig' CPPFLAGS='-I/path/to/pkg/include' LDFLAGS='-O3 -L/path/to/package/lib' CFLAGS='-O3 -march=native' --prefix /path/to/install_dir --with-gif=ifavailable --with-tiff=ifavailable --with-gnutls=yes --with-json=yes --with-nativecomp=yes --with-mailutils --with-dbus=yes --with-x-toolkit=lucid

followed by ==make -j8== and ==make install==

Then commands like these can be helpful to force native compilation and regular byte compilation of stuff

byte-recompile-directory
native-compile-async

helm and marginalia

(use-package marginalia
  :ensure t
  :init
  (marginalia-mode))

debug-on-entry reveals helm-completing-read-default-1 is getting called as a result of this bit:

https://github.com/emacs-helm/helm/blob/431e34dcc9d38c10eb8b9f22c3b5a10a0bf250f7/helm-mode.el#L1139-L1148

emacs style makes marginalia work for helpful but issue is that it is very slow

(setq helm-completion-style 'helm)
(setq completion-styles '(basic partial-completion emacs22))

;(setq helm-completion-style 'emacs)
;(setq completion-styles '(flex))

for M-x and find-file not yet but in the case of M-x this seems variable is neat: helm-M-x-show-short-doc can toggle with C-]

dir-locals

use ((nil . ((buffer-read-only . t)))) per this stack exchange to open in read-only for reference sub-directories

custom info manuals

per this blogpost from this reddit post the snippet (add-to-list 'Info-additional-directory-list "/path/to/your/texinfo") can go along with use-package info to point to a custom make texinfo manual from something using sphinx documentation remember after the .info file gets created to add a file called dir which can be copied from one of the emacs packages with an info manual like magit

cd ~/development
git clone https://github.com/python/cpython.git
cd cpython/Doc
make venv # if you dont have sphinx-build and friends
make texinfo
(cd build/texinfo && make)
mkdir -p ~/.texinfo/python
rsync -avz build/texinfo/* ~/.texinfo/python/
cp ~/.emacs.d/elpa/magit-20230215.1054/dir ~/.texinfo/python/ # and rename it

org settings for a good research notebook

:PROPERTIES:
#+TITLE: some title
#+PROPERTY: header-args:R :session *R:topic:* :eval never-export :exports code
#+PROPERTY: header-args:python :session *Python[topic]* :eval never-export :exports code
#+EXPORT_EXCLUDE_TAGS: noexport
#+OPTIONS: num:nil
#+OPTIONS: ^:nil
#+OPTIONS: toc:nil
#+OPTIONS: tex:imagemagick
#+EXCLUDE_TAGS: noexport
#+EXPORT_FILE_NAME: README.md
:END:

emacs reference configs

a compiled list: https://github.com/caisah/emacs.dz

declare -A repos=(
    ["https://github.com/bnbeckwith/bnb-emacs.git"]="bnbeckwith"
    ["https://github.com/howardabrams/dot-files.git"]="howardabrams"
    ["https://github.com/chrisbarrett/.emacs.d.git"]="chrisbarrett"
    ["https://github.com/skeeto/.emacs.d.git"]="skeeto"
    ["https://github.com/a13/emacs.d.git"]="a13"
    ["https://github.com/IQSS/IQSS.emacs.git"]="IQSS"
    ["https://github.com/IvanMalison/dotfiles.git"]="IvanMalison"
    ["https://github.com/incandescentman/Emacs-Settings.git"]="incandescentman"
    ["https://github.com/joedicastro/dotfiles.git"]="joedicastro"
    ["https://github.com/jwiegley/dot-emacs.git"]="jwiegley"
    ["https://github.com/joodie/emacs-literal-config.git"]="joodie"
    ["https://github.com/magnars/.emacs.d.git"]="magnars"
    ["https://github.com/MatthewZMD/.emacs.d.git"]="MatthewZMD"
    ["https://github.com/NicolasPetton/emacs.d.git"]="NicolasPetton"
    ["https://gitlab.com/protesilaos/dotfiles.git"]="protesilaos"
    ["https://github.com/raxod502/radian.git"]="raxod502"
    ["https://github.com/DarwinAwardWinner/dotemacs.git"]="DarwinAwardWinner"
    ["https://github.com/sachac/.emacs.d.git"]="sachac"
    ["https://github.com/purcell/emacs.d.git"]="purcell"
    ["https://github.com/rememberYou/.emacs.d.git"]="rememberYou"
    ["https://github.com/xiongtx/.emacs.d.git"]="xiongtx"
    ["https://github.com/tecosaur/emacs-config.git"]="tecosaur"
    ["https://github.com/daviwil/emacs-from-scratch.git"]="daviwil"
    ["https://github.com/jakebox/jake-emacs.git"]="jakebox"
    ["https://github.com/Eason0210/dot-emacs.git"]="eason0210"
    ["https://github.com/DiamondBond/emacs.git"]="diamondbond"
    ["https://github.com/bbatsov/prelude.git"]="prelude"
    ["https://gitlab.com/skybert/my-little-friends.git"]="skybert"
    ["https://github.com/redguardtoo/emacs.d.git"]="redguardtoo"
    ["https://github.com/xuchunyang/emacs.d.git"]="xuchunyang"
    ["https://github.com/DamienCassou/emacs.d.git"]="DamienCassou"
    ["https://github.com/dakra/dmacs.git"]="dakra"
    ["https://github.com/PythonNut/quark-emacs.git"]="PythonNut"
    ["https://github.com/jordonbiondo/.emacs.d.git"]="jordonbiondo"
    ["https://github.com/cute-jumper/.emacs.d.git"]="cutejumper"
    ["https://github.com/waymondo/hemacs.git"]="waymondo"
    ["https://github.com/novoid/dot-emacs.git"]="novoid"
    ["https://github.com/kaushalmodi/.emacs.d.git"]="kaushalmodi"
    ["https://github.com/expez/.emacs.d.git"]="expez"
    ["https://github.com/matthewbauer/bauer.git"]="matthewbauer"
    ["https://github.com/Fuco1/.emacs.d.git"]="Fuco1"
    ["https://github.com/alhassy/emacs.d.git"]="alhassy"
    ["https://github.com/nathantypanski/emacs.d.git"]="nathantypanski"
    ["https://github.com/abo-abo/oremacs.git"]="aboabo"
    ["https://github.com/kuanyui/.emacs.d.git"]="kuanyui"
    ["https://github.com/karthink/.emacs.d.git"]="karthink"
    ["https://github.com/HannesHaglund/my-emacs.git"]="hannes"
    ["https://github.com/zoliky/dotemacs.git"]="zoliky"
    ["https://github.com/justinbarclay/.emacs.d.git"]="justinbarclay"
    ["https://github.com/fbkarsdorp/.emacs.d.git"]="fbkarsdorp"
    ["https://gitlab.com/bkhl/dotfiles.git"]="bkhl"
    ["https://github.com/frap/emacs-literate.git"]="frap"
    ["https://github.com/mxco86/emacs-config.git"]="mxco86"
    ["https://github.com/legoscia/dotemacs.git"]="legoscia"
    ["https://github.com/thierryvolpiatto/emacs-config.git"]="thierryvolpiatto"
    ["https://github.com/mrvdb/emacs-config.git"]="mrvdb"
    ["https://codeberg.org/vifon/emacs-config.git"]="vifon"
    ["https://git.sr.ht/~northyear/dotemacs"]="northyear"
    ["https://github.com/zsxh/emacs.d.git"]="zsxh"
    ["https://github.com/skyler544/rex.git"]="skyler544"
    ["https://github.com/rdbeni0/emacs.d.git"]="rdbeni0"
    ["https://github.com/jackkamm/.emacs.d.git"]="jackkamm"
    ["https://github.com/amno1/.emacs.d.git"]="amno1"
    ["https://github.com/benjamin-asdf/dotfiles.git"]="benjamin-asdf"
    ["https://github.com/garyo/emacs-config.git"]="garyo"
    ["https://github.com/munen/emacs.d.git"]="munen"
    ["https://github.com/condy0919/.emacs.d.git"]="condy0919"
    ["https://github.com/oantolin/emacs-config.git"]="oantolin"
    ["https://github.com/jcs-emacs/jcs-emacs.git"]="jcs-emacs"
    ["https://github.com/rileyrg/Emacs-Customisations.git"]="rileyrg"
    ["https://github.com/casouri/lunarymacs.git"]="casouri"
    ["https://github.com/jimenezrick/emacs.d.git"]="jimenezrick"
    ["https://github.com/bunnylushington/dot-emacs-v29.git"]="bunnylushington"
    ["https://github.com/gopar/.emacs.d.git"]="gopar"
    ["https://gitlab.com/Clsmith1/dotfiles.git"]="clsmith1"
)

pushd ~/development/emacsRefCfgs &> /dev/null
for url in "${!repos[@]}"; do
    name=${repos[$url]}

    if [ ! -d "$name" ]; then
        echo "$name missing, cloning!"
        git clone $url $name
    fi
done
popd
bash ~/scripts/emacs_clones.sh
(cd ~/development/emacsRefCfgs && for d in *; do pushd $d ; git reset --hard HEAD; git pull --rebase --autostash; popd; done)
(cd ~/development/emacsRefCfgs && for d in *; do cd $d; echo "UPDATES FOR $d"; git --no-pager log --pretty=format:"%h%x09%an%x09%ad%x09%s" --since="2 weeks ago" --no-merges -10; cd -; done)

misc

how arch builds emacs

system-configuration-options variable, arch one is: “–prefix=/usr –sysconfdir=/etc –libexecdir=/usr/lib –localstatedir=/var –with-x-toolkit=gtk3 –with-xft –with-wide-int –with-modules –with-cairo –with-harfbuzz ‘CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt’ CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,–sort-common,–as-needed,-z,relro,-z,now”

random tips

M-x apropos-user-option then a package name to see all the configurable variables

emacs 29 prep

look into treesit-auto package

troubleshooting

general

byte recompiling everything refs: https://emacs.stackexchange.com/questions/72655/after-updating-my-packages-two-packages-are-not-working-anymore-how-to-solve-t) https://stackoverflow.com/questions/24725778/how-to-rebuild-elpa-packages-after-upgrade-of-emacs

(byte-recompile-directory package-user-dir nil 'force)

some fixes for mid may 2023 update

to fix the org error message: https://emacs.stackexchange.com/questions/70081/how-to-deal-with-this-message-important-please-install-org-from-gnu-elpa-as-o the answer with 4 steps worked

for doom-modeline just wait for this commit to get to melpa: https://github.com/seagle0128/doom-modeline/commit/9d6a39f97055b6b92ea2c51decb9547bad5106dc or add the quote yourself after it updates

then for orgit error with emacsql can delete emacsql old package and reinstall a fresh one as well as do the same for closql after that is done you may get this warning but all should be ok at least (it will build it) - but also very easy to just install sqlite3 package (likely libsqlite3 already installed pacman -Ss libsqlite3)

Warning (emacsql): Since your Emacs does not come with built-in SQLite support [1], but does support C modules, the best EmacSQL backend is provided by the third-party `sqlite3’ package [2].

Please install the `sqlite3’ Elisp package using your preferred Emacs package manager, and install the SQLite shared library using your distribution’s package manager. That package should be named something like `libsqlite3’ [3] and NOT just `sqlite3’.

In the current Emacs instance the legacy backend is used, which uses a custom SQLite executable. Using an external process like that is less reliable and less performant, and in a few releases support for that might be removed.