Compare commits

...

2 commits

Author SHA1 Message Date
4879514190 Add emacs-24.3 2013-05-16 22:39:20 +02:00
27cb0dd97e Add stumpwm-scm 2013-05-16 21:05:52 +02:00
9 changed files with 494 additions and 0 deletions

View file

@ -1,4 +1,6 @@
app-editors
app-security
dev-lang
dev-python
media-sound
x11-wm

View file

@ -0,0 +1,14 @@
# Copyright 2008 Ingmar Vanhassel <ingmar@exherbo.org>
# Distributed under the terms of the GNU General Public License v2
require emacs
PLATFORMS="~amd64 ~x86"
DEPENDENCIES="
build+run:
dev-libs/gnutls[>=2.8]
"
DEFAULT_SRC_PREPARE_PATCHES=( "${FILES}"/emacs-python-docstrings.patch )

View file

@ -0,0 +1,172 @@
# Copyright 2008, 2009 Ingmar Vanhassel <ingmar@exherbo.org>
# Distributed under the terms of the GNU General Public License v2
# Based in part upon 'emacs-22.2-r2.ebuild' from Gentoo, which is:
# Copyright 1999-2008 Gentoo Foundation.
require game alternatives elisp-module
if [[ -z $(ever range 3) ]]; then
require gnu [ suffix=xz ]
else
require gnu [ alpha=true subdir=pretest suffix=xz ]
fi
if [[ $(ever range 3) == rc* ]]; then
MY_PV=$(ever range 1-2)
MY_PNV=${PN}-${MY_PV}
fi
export_exlib_phases src_prepare src_configure src_install pkg_postinst
SUMMARY="The extensible, customizable, self-documenting, real-time display editor"
LICENCES="GPL-3"
SLOT="0"
MYOPTIONS="
X alsa dbus freetype gif gpm gtk gtk3 otf svg tiff tiff xpm
( freetype gif gtk gtk3 otf svg tiff xpm ) [[ requires = X ]]
( gtk gtk3 ) [[ number-selected = at-most-one ]]
gconf [[
description = [ Allows emacs to determine the system font ]
requires = X
]]
otf [[
description = [ Support for OpenType fonts ]
requires = freetype
]]
"
DEPENDENCIES="
build:
X? ( dev-util/pkg-config )
alsa? ( dev-util/pkg-config )
dbus? ( dev-util/pkg-config )
gtk? ( dev-util/pkg-config )
gtk3? ( dev-util/pkg-config )
svg? ( dev-util/pkg-config )
build+run:
dev-libs/libxml2:2.0 [[ note = [ used for html rendering; could be made optional ] ]]
net-libs/liblockfile
sys-libs/ncurses
alsa? ( sys-sound/alsa-lib[>=1.0.0] )
X? (
media-libs/jpeg
media-libs/libpng
x11-data/xbitmaps
x11-libs/libICE
x11-libs/libSM
x11-libs/libX11
gif? ( media-libs/giflib )
gtk? (
dev-libs/glib:2[>=2.10]
x11-libs/gtk+:2[>=2.10]
)
gtk3? (
dev-libs/glib:2[>=2.28]
x11-libs/gtk+:3[>=3.0]
)
otf? ( dev-libs/libotf )
svg? ( gnome-desktop/librsvg:2[>=2.11.0] )
tiff? ( media-libs/tiff )
xpm? ( x11-libs/libXpm )
)
dbus? ( sys-apps/dbus[>=1.0.0] )
freetype? (
media-libs/fontconfig[>=2.2.0]
media-libs/freetype:2
x11-libs/libXft[>=0.13.0]
x11-libs/libXrender [[ note = [ because of libXft ] ]]
)
gconf? ( gnome-platform/GConf:2 )
gpm? ( sys-libs/gpm )
suggestion:
app-spell/aspell [[ description = [ For ispell and flyspell mode ] ]]
"
WORK=${WORKBASE}/${MY_PNV-${PNV}}
emacs_src_prepare() {
# Compressing *.el files saves 25MB diskspace, which is not worth it on modern systems
edo sed -i -e 's/@GZIP_PROG@//' {.,leim}/Makefile.in
default
# Create a copy of the clean source (it will be installed in src_install)
edo tar cf source.tar src/
}
emacs_src_configure() {
config_params=(
--infodir=/usr/share/info/emacs
--without-compress-info # applies to manpages as well
--without-gsettings
--without-hesiod
--without-imagemagick
--without-kerberos
--without-kerberos5
--without-m17n-flt
--without-selinux
--without-xim
)
config_withs=(
'X x' 'X jpeg' 'X png'
'alsa sound'
'freetype xft'
'otf libotf'
'svg rsvg'
'dbus' 'gconf' 'gif' 'gpm' 'tiff' 'xpm'
)
local toolkit=no
option gtk && toolkit=gtk;
option gtk3 && toolkit=gtk3;
econf \
"${config_params[@]}" \
$(for s in "${config_withs[@]}" ; do option_with ${s} ; done ) \
$(option gtk || option gtk3 || echo --without-toolkit-scroll-bars) \
--with-x-toolkit=${toolkit}
}
emacs_src_install() {
default
insinto ${ELISP_SITE_LISP}
hereins site-start.el <<EOF
(require 'site-exherbo)
EOF
keepdir /var/lib/games/emacs
dovarlibgames -R
# they lose group write permission anyway after being updated
edo chmod g-w "${IMAGE}"/var/lib/games/emacs/*
preserve_scores "${IMAGE}"/var/lib/games/emacs/*
edo chown wizard:games "${IMAGE}"/usr/libexec/emacs/${MY_PV-${PV}}/${CHOST}/update-game-score
edo chmod ug+s "${IMAGE}"/usr/libexec/emacs/${MY_PV-${PV}}/${CHOST}/update-game-score
elisp-install-site-file
# Install a copy of the clean source to `source-directory`. The builtin help system of emacs
# requires it in order to fully function.
local emacs_source_root=/usr/src/emacs
dodir ${emacs_source_root}
edo tar xf source.tar -C "${IMAGE}"${emacs_source_root}
cd "${IMAGE}"
edo mv usr/share/man/man1/ctags{,-emacs}.1
edo mv usr/bin/ctags{,-emacs}
alternatives_for ctags emacs 500 \
/usr/bin/ctags ctags-emacs \
/usr/share/man/man1/ctags.1 ctags-emacs.1
hereenvd 70${PN} <<EOF
INFOPATH="/usr/share/info/${PN}"
EOF
}
emacs_pkg_postinst() {
game_pkg_postinst
alternatives_pkg_postinst
elisp-generate-global-site-file
}

View file

@ -0,0 +1 @@
(setq source-directory "/usr/src/emacs")

View file

@ -0,0 +1,40 @@
diff --git a/python.el b/python.el
index 54a657a..f01360c 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -405,6 +405,23 @@ The type returned can be `comment', `string' or `paren'."
'python-info-ppss-comment-or-string-p
#'python-syntax-comment-or-string-p "24.3")
+(defun python-doc-string-at-p (pos)
+ "Check to see if there is a docstring at POS."
+ (save-excursion
+ (goto-char pos)
+ (if (looking-at-p "'''\\|\"\"\"")
+ (progn
+ (python-nav-backward-statement)
+ (looking-at "\\`\\|class \\|def "))
+ nil)))
+
+(defun python-font-lock-syntactic-face-function (state)
+ (if (nth 3 state)
+ (if (python-doc-string-at-p (nth 8 state))
+ font-lock-doc-face
+ font-lock-string-face)
+ font-lock-comment-face))
+
(defvar python-font-lock-keywords
;; Keywords
`(,(rx symbol-start
@@ -3226,7 +3243,10 @@ if that value is non-nil."
'python-nav-forward-sexp)
(set (make-local-variable 'font-lock-defaults)
- '(python-font-lock-keywords nil nil nil nil))
+ '(python-font-lock-keywords
+ nil nil nil nil
+ (font-lock-syntactic-face-function
+ . python-font-lock-syntactic-face-function)))
(set (make-local-variable 'syntax-propertize-function)
python-syntax-propertize-function)

View file

@ -0,0 +1 @@
(autoload 'stumpwm-mode "stumpwm-mode" nil t)

View file

@ -0,0 +1,132 @@
diff --git a/color.lisp b/color.lisp
index 2085fbc..5ada58a 100644
--- a/color.lisp
+++ b/color.lisp
@@ -66,31 +66,38 @@ then call (update-color-map).")
(xlib:alloc-color (xlib:screen-default-colormap (screen-number screen)) color))
(defun lookup-color (screen color)
- (cond
- ((typep color 'xlib:color) color)
- (t (xlib:lookup-color (xlib:screen-default-colormap (screen-number screen)) color))))
+ (flet ((hex ()
+ (apply #'xlib:make-color
+ (loop for (x y) in '((:red 16) (:green 8) (:blue 0))
+ nconcing (list x (/ (ldb (byte 8 y) color)
+ 256))))))
+ (cond ((integerp color) (hex))
+ ((typep color 'xlib:color) color)
+ (t (xlib:lookup-color (xlib:screen-default-colormap (screen-number screen)) color)))))
;; Normal colors are dimmed and bright colors are intensified in order
;; to more closely resemble the VGA pallet.
(defun update-color-map (screen)
"Read *colors* and cache their pixel colors for use when rendering colored text."
- (let ((scm (xlib:screen-default-colormap (screen-number screen))))
- (labels ((map-colors (amt)
- (loop for c in *colors*
- as color = (lookup-color screen c)
- do (adjust-color color amt)
- collect (xlib:alloc-color scm color))))
- (setf (screen-color-map-normal screen) (apply #'vector (map-colors -0.25))
- (screen-color-map-bright screen) (apply #'vector (map-colors 0.25))))))
+ (labels ((map-colors (amt)
+ (loop for c in *colors*
+ as color = (lookup-color screen c)
+ do (adjust-color color amt)
+ collect (alloc-color screen color))))
+ (let ((amt (if *bright-colors*
+ '(-0.25 . 0.25)
+ '(0.0 . 0.0))))
+ (setf (screen-color-map-normal screen) (apply #'vector (map-colors (car amt)))
+ (screen-color-map-bright screen) (apply #'vector (map-colors (cdr amt)))))))
(defun update-screen-color-context (screen)
- (let* ((cc (screen-message-cc screen))
- (bright (lookup-color screen *text-color*)))
- (setf
- (ccontext-default-fg cc) (screen-fg-color screen)
- (ccontext-default-bg cc) (screen-bg-color screen))
- (adjust-color bright 0.25)
- (setf (ccontext-default-bright cc) (alloc-color screen bright))))
+ (let ((cc (screen-message-cc screen))
+ (bright (lookup-color screen *text-color*)))
+ (when *bright-colors*
+ (adjust-color bright 0.25))
+ (setf (ccontext-default-fg cc) (screen-fg-color screen)
+ (ccontext-default-bg cc) (screen-bg-color screen)
+ (ccontext-default-bright cc) (alloc-color screen bright))))
(defun get-bg-color (screen cc color)
(setf *background* color)
diff --git a/mode-line.lisp b/mode-line.lisp
index d30dfb9..42c3bc2 100644
--- a/mode-line.lisp
+++ b/mode-line.lisp
@@ -282,8 +282,8 @@ critical."
(xlib:create-window
:parent parent
:x 0 :y 0 :width 1 :height 1
- :background (alloc-color screen *mode-line-background-color*)
- :border (alloc-color screen *mode-line-border-color*)
+ :background (alloc-color screen (lookup-color screen *mode-line-background-color*))
+ :border (alloc-color screen (lookup-color screen *mode-line-border-color*))
:border-width *mode-line-border-width*
;; You can click the modeline
:event-mask (xlib:make-event-mask :button-press :exposure)
@@ -350,15 +350,16 @@ critical."
(defun make-mode-line-gc (window screen)
(xlib:create-gcontext :drawable window
:font (screen-font screen)
- :foreground (alloc-color screen *mode-line-foreground-color*)
- :background (alloc-color screen *mode-line-background-color*)))
+ :foreground (alloc-color screen (lookup-color screen *mode-line-foreground-color*))
+ :background (alloc-color screen (lookup-color screen *mode-line-background-color*))))
(defun update-mode-line-color-context (ml)
(let* ((cc (mode-line-cc ml))
(screen (mode-line-screen ml))
(bright (lookup-color screen *mode-line-foreground-color*)))
- (adjust-color bright 0.25)
+ (when *bright-colors*
+ (adjust-color bright 0.25))
(setf (ccontext-default-bright cc) (alloc-color screen bright))))
(defun make-head-mode-line (screen head format)
diff --git a/primitives.lisp b/primitives.lisp
index 50d062e..c37a028 100644
--- a/primitives.lisp
+++ b/primitives.lisp
@@ -109,6 +109,7 @@
*default-group-name*
*window-border-style*
*data-dir*
+ *bright-colors*
add-hook
clear-window-placement-rules
concat
@@ -153,6 +154,9 @@ be an integer.")
(defvar *grab-pointer-count* 0
"The number of times the pointer has been grabbed")
+(defvar *bright-colors* t
+ "Make colors brighter. This is the default.")
+
;;; Hooks
(defvar *command-mode-start-hook* '(command-mode-start-message)
diff --git a/screen.lisp b/screen.lisp
index ab708c3..562dbf4 100644
--- a/screen.lisp
+++ b/screen.lisp
@@ -249,7 +249,7 @@ identity with a range check."
(defmacro set-any-color (val color)
`(progn (dolist (s *screen-list*)
- (setf (,val s) (alloc-color s ,color)))
+ (setf (,val s) (alloc-color s (lookup-color s ,color))))
(update-colors-all-screens)))
;; FIXME: I don't like any of this. Isn't there a way to define

View file

@ -0,0 +1,77 @@
Source: Elias Pipping <pipping@exherbo.org>
Upstream: no (pasted on irc)
Reason: A window whose title contains the string ^\ cannot have it printed
From 56b478ae447ca8bf4b0d6d80e10fe00fb1c8d95b Mon Sep 17 00:00:00 2001
From: Elias Pipping <pipping@exherbo.org>
Date: Sat, 5 Jan 2013 22:03:53 +0100
Subject: [PATCH 1/2] Typo
---
primitives.lisp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/primitives.lisp b/primitives.lisp
index 50d062e..3d42012 100644
--- a/primitives.lisp
+++ b/primitives.lisp
@@ -753,7 +753,7 @@ do:
(format t "%~a~@[~a~]" len from-left-p)
(let* ((fmt (cadr (assoc (car cur) fmt-alist :test 'char=)))
(str (cond (fmt
- ;; it can return any type, not jut as string.
+ ;; it can return any type, not just a string.
(format nil "~a" (apply fmt args)))
((char= (car cur) #\%)
(string #\%))
--
1.8.0.3
From db588e4393567b3016c2be57511d35d3c01e4e46 Mon Sep 17 00:00:00 2001
From: Elias Pipping <pipping@exherbo.org>
Date: Sat, 5 Jan 2013 22:08:11 +0100
Subject: [PATCH 2/2] Escape window information before printing
Otherwise, a window with a title like ^\ will wreak havoc when
echo-string-list fails to parse it.
---
primitives.lisp | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/primitives.lisp b/primitives.lisp
index 3d42012..88b45d4 100644
--- a/primitives.lisp
+++ b/primitives.lisp
@@ -732,6 +732,15 @@ do:
;;;
;;; formatting routines
+(defun escape-string (str)
+ (let (buf)
+ (map nil #'(lambda (ch)
+ (push ch buf)
+ (when (char= ch #\^)
+ (push ch buf)))
+ str)
+ (coerce (reverse buf) 'string)))
+
(defun format-expand (fmt-alist fmt &rest args)
(let* ((chars (coerce fmt 'list))
(output "")
@@ -753,8 +762,11 @@ do:
(format t "%~a~@[~a~]" len from-left-p)
(let* ((fmt (cadr (assoc (car cur) fmt-alist :test 'char=)))
(str (cond (fmt
- ;; it can return any type, not just a string.
- (format nil "~a" (apply fmt args)))
+ ;; Any sequence that could be interpreted as
+ ;; a colorisation directive is escaped here
+ (escape-string
+ ;; it can return any type, not just a string.
+ (format nil "~a" (apply fmt args))))
((char= (car cur) #\%)
(string #\%))
(t
--
1.8.0.3

View file

@ -0,0 +1,55 @@
# Copyright 2011 Elias Pipping <pipping@exherbo.org>
# Distributed under the terms of the GNU General Public License v2
require github [ user=sabetts ] autotools [ supported_autoconf=[ 2.5 ] supported_automake=[ none ] ]
require elisp-optional [ source_directory=contrib ]
SUMMARY="A tiling, keyboard driven X11 Window Manager written entirely in Common Lisp"
HOMEPAGE="http://www.nongnu.org/stumpwm/"
LICENCES="GPL-2"
SLOT="0"
PLATFORMS="~amd64"
MYOPTIONS="emacs"
DEPENDENCIES="
build:
dev-lisp/cl-ppcre
dev-lisp/clx[~scm]
build+run:
dev-lang/sbcl [[ note = [ contains asdf ] ]]
suggestion:
(
app-misc/rlwrap
x11-apps/xprop
) [[ *description = [ For stumpish ] ]]
"
RESTRICT="strip"
DEFAULT_SRC_PREPARE_PATCHES=( "${FILES}"/stumpwm-printing.patch
"${FILES}"/stumpwm-hex-colours.patch )
DEFAULT_SRC_CONFIGURE_PARAMS=( --with-lisp=sbcl )
DEFAULT_SRC_COMPILE_PARAMS=( -j1 LISP='/usr/bin/sbcl --disable-debugger' )
src_prepare() {
default
eautoconf
}
src_compile() {
default
elisp-optional_src_compile
}
src_install() {
emake install destdir="${IMAGE}"
insinto /usr/share/${PN}/contrib
doins contrib/*.lisp
dobin contrib/stumpish
elisp-optional_src_install
}