From 540933912679eac7bf95d7750059eb5397aa6440 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sat, 13 Apr 2013 20:23:47 +0200 Subject: [PATCH] Emacs: C++ mode. Pkg lists. Various comments --- .emacs.d/mc-lists.el | 3 +- .emacs.d/modes.el | 71 ++++++++++++++++++++++++++++--------- .pkg-arch-aur-peteramd | 11 +++--- .pkg-arch-explicit-peteramd | 23 ++++++++---- .pkg-arch-official-peteramd | 36 +++++++++++++------ .pkg-texlive-Linux-peteramd | 2 ++ .scripts/.pacman-init | 4 +++ README | 37 +++++++++++++------ 8 files changed, 137 insertions(+), 50 deletions(-) diff --git a/.emacs.d/mc-lists.el b/.emacs.d/mc-lists.el index 661b94ad..d0d1109a 100644 --- a/.emacs.d/mc-lists.el +++ b/.emacs.d/mc-lists.el @@ -3,10 +3,9 @@ (setq mc/cmds-to-run-for-all '( - org-beginning-of-line - org-delete-char )) (setq mc/cmds-to-run-once '( + set-fill-column )) diff --git a/.emacs.d/modes.el b/.emacs.d/modes.el index 0b06c557..78fe405f 100644 --- a/.emacs.d/modes.el +++ b/.emacs.d/modes.el @@ -346,22 +346,6 @@ properly escaped with double-quotes in case it has spaces." ;; Identation style (setq c-default-style "linux" c-basic-offset 4) -;; TODO: test this! -;; (defun vlad-cc-style() -;; (c-set-style "linux") -;; (c-set-offset 'innamespace '0) -;; (c-set-offset 'inextern-lang '0) -;; (c-set-offset 'inline-open '0) -;; (c-set-offset 'label '*) -;; (c-set-offset 'case-label '*) -;; (c-set-offset 'access-label '/) -;; (setq c-basic-offset 4) -;; (setq tab-width 4) -;; (setq indent-tabs-mode nil) -;; ) - -;; (add-hook 'c++-mode-hook 'vlad-cc-style) - (defcustom c-compile-ldflags "" "[Local variable] Custom linker flags for C compilation." :safe 'stringp) @@ -397,6 +381,61 @@ properly escaped with double-quotes in case it has spaces." (local-set-key (kbd "") 'next-error) (local-set-key (kbd "") 'previous-error))) +;;============================================================================== +;; C++-mode +;;============================================================================== +(require 'compile) + +;; TODO: test this! +;; (defun vlad-cc-style() +;; (c-set-style "linux") +;; (c-set-offset 'innamespace '0) +;; (c-set-offset 'inextern-lang '0) +;; (c-set-offset 'inline-open '0) +;; (c-set-offset 'label '*) +;; (c-set-offset 'case-label '*) +;; (c-set-offset 'access-label '/) +;; (setq c-basic-offset 4) +;; (setq tab-width 4) +;; (setq indent-tabs-mode nil) +;; ) + +;; (add-hook 'c++-mode-hook 'vlad-cc-style) + +(defcustom c++-compile-ldflags "" + "[Local variable] Custom linker flags for C compilation." + :safe 'stringp) + +(defun c++-compile () + (interactive) + (progn + (unless (or (file-exists-p "Makefile") (file-exists-p "makefile") (file-exists-p "GNUMakefile")) + (set (make-local-variable 'compile-command) + ;; Emulate make's .c.o implicit pattern rule, but with + ;; different defaults for the CC, CPPFLAGS, and CFLAGS + ;; variables: + ;; $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $< + ;; (setq compile-command + (let + ((file (file-name-nondirectory buffer-file-name))) + (format "%s -o %s %s %s %s %s" + (or (getenv "CXX") "g++") + (file-name-sans-extension file) + (or (getenv "CPPFLAGS") "-DDEBUG=9") + (or (getenv "CFLAGS") "-Wall -Wextra -Wshadow -g3 -O0") + (or (getenv "LDFLAGS") c++-compile-ldflags) + file)))) + (compile compile-command))) + +(add-hook + 'c++-mode-hook + (lambda () + (local-set-key (kbd "C-c C-c") 'c++-compile) + (local-set-key (kbd "M-TAB") 'semantic-complete-analyze-inline) + (local-set-key (kbd "") 'next-error) + (local-set-key (kbd "") 'previous-error))) + + ;;============================================================================== ;; Common LISP ;;============================================================================== diff --git a/.pkg-arch-aur-peteramd b/.pkg-arch-aur-peteramd index 2ab5bfe8..07c7d50f 100644 --- a/.pkg-arch-aur-peteramd +++ b/.pkg-arch-aur-peteramd @@ -1,26 +1,29 @@ -awesome-git +arx-libertatis cblas dropbox dropbox-cli eduke32 eduke32-dukeplus +emacs-bison-mode +emacs-flex-mode emacs-glsl-mode +emacs-make-regexp emacs-mediawiki-bzr +emacs-multiple-cursors emacs-xclip emacs-yasnippet fortune-mod-tbbt -gens-gs google-talkplugin +innoextract libimago2-svn movgrab mutt-sidebar +openmw-git package-query -pacman-color rxvt-unicode-patched supermeatboy textadept-latest-stable trash-cli wikiex -wine-1.5.12 worldofgoo yaourt diff --git a/.pkg-arch-explicit-peteramd b/.pkg-arch-explicit-peteramd index 195792ed..f6cc186f 100644 --- a/.pkg-arch-explicit-peteramd +++ b/.pkg-arch-explicit-peteramd @@ -4,6 +4,7 @@ acpi alsa-utils antiword apvlv +arx-libertatis aspell-en aspell-fr astyle @@ -14,11 +15,10 @@ at-spi2-core attr autoconf automake -awesome-git +awesome bash bison blas -bomberclone bzip2 calc cblas @@ -41,6 +41,7 @@ diffutils djvulibre dosbox dosfstools +doxygen driconf dropbox dropbox-cli @@ -48,9 +49,13 @@ dwb e2fsprogs eduke32 eduke32-dukeplus +emacs-bison-mode +emacs-flex-mode emacs-glsl-mode emacs-lua-mode +emacs-make-regexp emacs-mediawiki-bzr +emacs-multiple-cursors emacs-nox emacs-xclip emacs-yasnippet @@ -59,7 +64,6 @@ feh file filesystem findutils -firefox flashplugin flex fortune-mod @@ -76,9 +80,11 @@ git glfw glibc glm +gnumeric gnuplot google-talkplugin gparted +graphviz grep gsfonts gst-libav @@ -99,6 +105,7 @@ ifplugd indent inetutils inkscape +innoextract iotop iproute2 iptables @@ -118,6 +125,7 @@ lib32-libpulse lib32-libsamplerate lib32-libtxc_dxtn lib32-libxml2 +lib32-mesa-libgl lib32-mpg123 lib32-openal lib32-sdl @@ -156,6 +164,7 @@ man-db man-pages mdadm mediainfo +mesa-libgl movgrab mp3info mpg123 @@ -176,11 +185,12 @@ ntfs-3g numlockx odt2txt opengl-man-pages +openmw-git openssh oss p7zip +package-query pacman -pacman-color pacman-mirrorlist pam pari @@ -200,12 +210,12 @@ psmisc pwgen python2-dbus python2-gobject +qt4 ranger reiserfsprogs rtorrent rxvt-unicode-patched scrot -sdlmame sed shadow slock @@ -213,7 +223,6 @@ splint steam strace subdl -subversion sudo supermeatboy sxiv @@ -251,7 +260,7 @@ w3m wget which wikiex -wine-1.5.12 +wine winetricks wipe wmname diff --git a/.pkg-arch-official-peteramd b/.pkg-arch-official-peteramd index 4b7b6d34..1419ee5e 100644 --- a/.pkg-arch-official-peteramd +++ b/.pkg-arch-official-peteramd @@ -9,8 +9,6 @@ alsa-oss alsa-plugins alsa-utils antiword -apr -apr-util apvlv archlinux-keyring aspell @@ -27,14 +25,17 @@ attr autoconf automake avahi +awesome babl bash bc binutils-multilib bison blas -bomberclone +boost +boost-libs box2d +bullet bzip2 cabextract ca-certificates @@ -70,6 +71,7 @@ dbus-glib dconf desktop-file-utils device-mapper +devil dhcpcd dialog diffutils @@ -79,6 +81,8 @@ dkms dnssec-anchors dosbox dosfstools +dotconf +doxygen driconf dwb e2fsprogs @@ -97,7 +101,6 @@ fftw file filesystem findutils -firefox fixesproto flac flashplugin @@ -110,6 +113,7 @@ foomatic-filters fortune-mod freealut freeglut +freeimage freetype2 fribidi fuse @@ -125,6 +129,7 @@ gdb gdbm gdk-pixbuf2 gegl +gens-gs geoclue gettext ghostscript @@ -134,6 +139,7 @@ gimp girara-common girara-gtk2 git +glamor-egl glew glfw glib2 @@ -143,14 +149,17 @@ glib-networking glm glu gmp +gnumeric gnupg gnuplot gnutls gobject-introspection +goffice gparted gpgme gpm graphite +graphviz grep groff gsettings-desktop-schemas @@ -174,6 +183,7 @@ gtk3 gtkmm gtkspell gtk-update-icon-cache +gts guile gzip harfbuzz @@ -191,6 +201,7 @@ hwids iana-etc icu ifplugd +ilmbase imagemagick imlib2 indent @@ -416,6 +427,7 @@ libvdpau libvisual libvorbis libvpx +libwebp libwmf libx11 libx86 @@ -490,6 +502,7 @@ mplayer2 mtdev mtools musicbrainz +mygui namcap nano nawk @@ -509,9 +522,13 @@ nspr nss ntfs-3g numlockx +nvidia-cg-toolkit odt2txt +ogre +ois openal opencore-amr +openexr opengl-man-pages openjpeg openssh @@ -572,8 +589,10 @@ python2-markupsafe python2-notify python-dbus-common python-pyelftools +python-xdg pyxml qpdf +qt4 randrproto ranger raptor @@ -590,14 +609,10 @@ schroedinger scrnsaverproto scrot sdl -sdl_image -sdlmame sdl_mixer sdl_net sdl_sound -sdl_ttf sed -serf sg3_utils shadow shared-color-profiles @@ -605,6 +620,7 @@ shared-mime-info slock smpeg soundtouch +speech-dispatcher speex splint sqlite @@ -613,7 +629,6 @@ steam stfl strace subdl -subversion sudo sxiv sysfsutils @@ -636,7 +651,6 @@ ttf-liberation tzdata udiskie udisks -unixodbc unrar unrtf unzip @@ -658,6 +672,7 @@ webkitgtk2 wget which wildmidi +wine winetricks wipe wmname @@ -722,3 +737,4 @@ zenity zip zlib zsh +zziplib diff --git a/.pkg-texlive-Linux-peteramd b/.pkg-texlive-Linux-peteramd index 0d2b2ed9..cc801e6e 100644 --- a/.pkg-texlive-Linux-peteramd +++ b/.pkg-texlive-Linux-peteramd @@ -13,6 +13,7 @@ epstopdf etoolbox euenc eukdate +eurosym fancyhdr fancyvrb fontspec @@ -57,6 +58,7 @@ pgf preprint synctex tabu +texinfo tipa tools url diff --git a/.scripts/.pacman-init b/.scripts/.pacman-init index a7a83325..e2c45bb2 100644 --- a/.scripts/.pacman-init +++ b/.scripts/.pacman-init @@ -14,6 +14,9 @@ if [ -z "$(command -v makepkg)" ]; then exit fi +## We use tzdata as reference for the output fields, because it is almost always +## installed. This let's us access the entry of pacman's output independently of +## the current locale. pacman_var_list="$(pacman -Qi tzdata | cut -f1 -d':')" if [ -z "$pacman_var_list" ]; then echo "Could not get pacman's variables." @@ -25,3 +28,4 @@ pacman_deps="$(echo "$pacman_var_list" | sed -n '9{p;q}')" pacman_deps_none="$(pacman -Qi tzdata | sed -n '9{s/.*: //;p;q}')" pacman_optdeps="$(echo "$pacman_var_list" | sed -n '10{p;q}')" pacman_size="$(echo "$pacman_var_list" | sed -n '15{p;q}')" + diff --git a/README b/README index 7125257f..f811b7bf 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ ################################################################################ # Unix Home Configuration # # Author: P. Neidhardt # -# Date: 2013-03-02 # +# Date: 2013-04-13 # ################################################################################ Synopsis @@ -99,7 +99,9 @@ Some custom options, download location, search engines, etc. Emacs ***** -Extra deps: emacs-lua-mode, emacs-mediawiki, emacs-yasnippet. +Extra deps: emacs-bison-mode emacs-flex-mode emacs-glsl-mode emacs-lua-mode + emacs-make-regexp emacs-mediawiki-bzr emacs-multiple-cursors emacs-nox + emacs-xclip emacs-yasnippet Emacs daemon is integrated flawlessly thanks to a small script. See homeinit. @@ -155,14 +157,25 @@ Custom bindings, file association, tweaked a few options. Scripts ******* +abs-*: helper scripts to compile pacman-based packages (using makepkg). With + these scripts you can recompile your whole system. + +archive: simple tar wrapper to create archive for files and folders. + +asciify: convert many non-ASCII characters to their nearest ASCII counterpart. + +ediff: diff with Emacs. + +formatc: wrapper for 'indent' to prettify C source code. + homeinit: initialize a new home configuration, i.e. get needed files, create - symlinks, etc. + symlinks, etc. netinit: network setup. Works with wpa_supplicant. May replace any network - manager. + manager. pkggen: generates lists of installed with pacman, FreeBSD's pkg and tlmgr (TeX - Live manager). + Live manager). Shell ***** @@ -181,12 +194,12 @@ appropriate shell name. TeX *** -plainTeX macros, most importantly a partial UTF-8 support (taken from LaTeX). +Plain TeX macros, most importantly a partial UTF-8 support (taken from LaTeX). A lot of LaTeX macros. Among others: pie charts, dynamic plots with input file and trend. -plainTeX macros are in the '.texmf' folder. LaTeX macros are all bundled into +Plain TeX macros are in the '.texmf' folder. LaTeX macros are all bundled into Emacs snippets so that .tex documents do not rely on any external file. URxvt @@ -204,11 +217,13 @@ I've only been a casual Vim user, so do not expect too much from it. Known issues ************ -Emacs: some colors do not work as intended. MediaWiki fails to upload pages -after some idle time. +Emacs + From times to times Emacs daemon will 'break' after a while: indentation and + colors will stop work properly. Investigation in progress. -URxvt: using the paste function from Muennich's clipboard on the same terminal -where text was copied will make xsel crash. +URxvt + Using the paste function from Muennich's clipboard on the same terminal where + text was copied will make it crash. ################################################################################ Noteworthy apps