If you do this on the default face, then you can achieve some sort of pseudo-translucency, for example by using the same (or a darkened version of) the root window's background pixmap.
Here are a couple of screenshots that illustrate this.


![]() |
Didier Verna's scientific blog: Lisp, Emacs, LaTeX and random stuff. |
![]() |
Thursday, February 25 2010
By xemacs on Thursday, February 25 2010, 13:25 - (X)Emacs
Tuesday, July 1 2008
By Didier Verna on Tuesday, July 1 2008, 13:07 - Lisp
[cell drawWithFrame: frame inView: view];will translate into this in CLL:
(#/drawWithFrame:inView: cell frame view). Indeed, Objective C is designed around the record-based model (methods belong to classes), so the cell object receives the drawWithFrame:inView: message via the funny bracket syntax. On the other hand, the Lisp translation involves a generic function call with the usual funcall syntax. The dispatch occurs on the first argument (the cell), and the rest is actual arguments to the message.
cl-indent-function
will indent this as an ordinary function call, like this:(#/drawWithFrame:inView: cellwhich is awfull. What I want is the following indentation:
frame view
(#/drawWithFrame:inView: cellThis kind of indentation is normally achieved by putting a
frame view
common-lisp-indent-function
property of 1 on the function symbol. However, you don't want to do that on all possible ObjC message by hand (and you don't know them all in advance anyway). The following advice on common-lisp-indent-function
(from the cl-indent
package does the trick. It dynamically puts the property on each relevant symbol every time it is subject to indentation. A bit brute force, but it works smoothly.(defadvice common-lisp-indent-function (before ccl-objc-bridge activate)
"Improve indentation scheme of the CCL Objective-C bridge.
Currently, this does the following:
- All (#/doThis:withThat: ...) forms are indented as per a
lisp-indent-function property of 1. This effectively treats the first argument
(an object or a class) as special. The indentation you get is:
(#/function arg1 instead of: (#/function arg1
arg2 ...) arg2 ...)"
(let ((containing-form-start (elt state 1)))
(save-excursion
(goto-char containing-form-start)
(forward-char 1)
(cond ((looking-at "#/\\(\\w\\|:\\)*:")
;; We're looking at a (#/doThis:withThat: ...) form. In its holy
;; brokenness, common-lisp-indent-function with the help of
;; parse-partial-sexp will consider that the function name in
;; this form is "/functioncall:". Our trick here is to
;; dynamically put a lisp-indent-function property of 1 on this
;; symbol, so that the subsequent (original) indenting function
;; will handle it.
(let* ((beg (progn (forward-char 1) (point)))
(sym (progn
(forward-sexp 1)
(intern (downcase (buffer-substring beg
(point)))))))
(put sym 'common-lisp-indent-function 1)))))))
(put 'slet 'common-lisp-indent-function
'((&whole 4 &rest (&whole 1 1 2)) &body))
(put 'slet* 'common-lisp-indent-function
'((&whole 4 &rest (&whole 1 1 2)) &body))
Wednesday, June 4 2008
By Didier Verna on Wednesday, June 4 2008, 10:04 - LaTeX
\lstinputlisting
inside a Beamer block.xkeyval
package to create a "title" option:\define@cmdkey[dvl]{lst}[@dvl@lst@]{title}{}
%% \dvlinputlisting{overlay}{title}{lstoption=,...}{file}
\newcommand\dvlinputlisting[4]{%
\begin{block}#1{#2}
%% #### WARNING: I need this hack because keyval-style options
%% mess up the parsing.
\expandafter\lstinputlisting\expandafter[#3]{#4}
\end{block}}
%% Language-specific shortcuts:
%% The title option is used for the beamer block's title.
%% All other options are passed to listings.
%% \XXXinputlisting<overlay>[title=,lstoption=,...]{file}
\newcommand<>\clinputlisting[2][]{%
\def\@dvl@lst@title{Lisp}%
\setkeys*[dvl]{lst}{#1}%
\edef\@dvl@lst@options{language=lisp,\XKV@rm}%
\dvlinputlisting{#3}{\@dvl@lst@title}{\@dvl@lst@options}{#2.lisp}}
\clinputlisting<2->[title={Example 1}, gobble=2]{ex1}
\lstinputlisting
as before to include it. Clever right ?\jobname.dvl
. In the ending, we call our previous macro \dvlinputlisting
on that file (actually, on a dynamically created argument list called \@dvl@args
:\usepackage{verbatim}
\newwrite\lstvrb@out
\def\@dvllisting{%
\begingroup
\@bsphack
\immediate\openout\lstvrb@out\jobname.dvl
\let\do\@makeother\dospecials\catcode`\^^M\active
\def\verbatim@processline{%
\immediate\write\lstvrb@out{\the\verbatim@line}}%
\verbatim@start}
\def\@enddvllisting{%
\immediate\closeout\lstvrb@out
\@esphack
\endgroup
\expandafter\dvlinputlisting\@dvl@args}
\newenvironment<>{cllisting}[1][]{%
\def\@dvl@lst@title{Lisp}%
\setkeys*[dvl]{lst}{#1}%
\edef\@dvl@lst@options{language=lisp,\XKV@rm}%
\xdef\@dvl@args{{#2}{\@dvl@lst@title}{\@dvl@lst@options}{%
\jobname.dvl}}
\@dvllisting}{%
\@enddvllisting}
\begin{cllinsting}<2->[title={Example 1},gobble=2]
(defun foo (x) (* 2 x))
\end{cllisting}
![]() |
![]() |