Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 135

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 135

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 187

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 188

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 189

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 194

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 195

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 196

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 197

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 241

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 264

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 269

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 275

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 285

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 286

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 296

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 297

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 298

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 308

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 309

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 310

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 311

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 321

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 322

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 323

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 324

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 325

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 497

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 527

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 540

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 587

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 626

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 668

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 668

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 670

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 673

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 682

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 688

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 693

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php on line 699

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.http.php on line 410

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.http.php on line 410

Warning: Cannot modify header information - headers already sent by (output started at /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php:309) in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.http.php on line 272

Warning: Cannot modify header information - headers already sent by (output started at /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php:309) in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.http.php on line 274

Warning: Cannot modify header information - headers already sent by (output started at /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php:309) in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.http.php on line 274

Warning: Cannot modify header information - headers already sent by (output started at /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php:309) in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.http.php on line 274

Warning: Cannot modify header information - headers already sent by (output started at /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php:309) in /home/didierve/didierverna.net/blog/inc/public/lib.urlhandlers.php on line 110

Warning: Cannot modify header information - headers already sent by (output started at /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php:309) in /home/didierve/didierverna.net/blog/inc/public/lib.urlhandlers.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.json.php:309) in /home/didierve/didierverna.net/blog/inc/libs/clearbricks/common/lib.http.php on line 295
Didier Verna's Scientific Blog - Tag - Emacs Lisp Didier Verna's scientific blog: Lisp, Emacs, LaTeX and random stuff. 2024-01-31T17:45:28+00:00 Didier Verna urn:md5:a22c53786aff986a2da4c770c233a8f9 Dotclear el-rcfiles is released (first public version) urn:md5:141a5d419d1f7fd494a874bf74ea154d Tuesday, May 28 2013 Tuesday, May 28 2013 Didier Verna (X)Emacs el-rcfilesEmacsEmacs LispreleasesoftwareXEmacs <p>I've been using this for years, but never bothered to make it public until now.</p> <p>el-rcfiles is a very small and simple library which provides Unix-like RC files for Emacs Lisp libraries. It's compatible with GNU Emacs and XEmacs, available in ELPA form, as a tarball and from GitHub. More details (including download) available <a href="http://www.lrde.epita.fr/~didier/software/elisp/#el-rcfiles" hreflang="en">here</a>, but here is also the library's commentary section, for quick reference.</p> <pre> ;;; Commentary: ;; The purpose of el-rcfiles is to provide the equivalent of traditional ;; Unix rc files (i.e. configuration files) for Emacs Lisp ;; libraries. The advantages of using configuration files are the ;; following: ;; - your initialization file is less bloated, ;; - since configuration files are lazily loaded, your Emacs session ;; is (or begins) lighter. That is unless you already use lots of ;; EVAL-AFTER-LOAD forms... ;; Usage: ;; 1. Load the library, go to the rcfiles Custom group and tweak (or not). ;; 2. Put a call to (rcfiles-register-rc-files) in your initialization ;; file. This function can also be called interactively anytime you ;; add, remove or modify a configuration file. ;; 3. Put your configuration code for a library `foo' in a file called ;; `&lt;rcfiles-directory&gt;/foo&lt;rcfiles-pseudo-extension&gt;.el'. </pre> https://www.didierverna.net/blog/index.php?post/2013/05/28/el-rcfiles-is-released-%28first-public-version%29#comment-form https://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/118 Emacs session bootstrap tweaks urn:md5:07e0963dd2a42298f4124e6563a9f391 Tuesday, May 14 2013 Tuesday, May 14 2013 Didier Verna (X)Emacs EmacsEmacs Lisp <p>This article essentially describes the top of my Emacs init file. That part of the code is devoted to modify the session bootstrap process, that is, some things that are normally done very early. It mostly deals with the package infrastructure but also contains a couple of other tricks that some people may consider useful. It goes like this…</p> <p>The first line is self-explanatory (and please, be warned that I will discard any comment about it. You know why).</p> <pre> (require 'cl) </pre> <h3>Platform-specific tweaks</h3> <p>A self-contained Emacs.app on MacOS X has its own <code>site-lisp</code> directory, but I want to make sure that the standard Unix one is here as well, and takes precedence.</p> <pre> (when (featurep 'ns) (add-to-list 'load-path &quot;/usr/local/share/emacs/site-lisp&quot;)) </pre> <p><strong>Updated</strong> When /not/ starting Emacs from the command-line (e.g. MacOS X app clicks or Quicksilver/Alfred, Unitiy launcher on Ubuntu etc.), I don't necessarily get my environment-based exec-path which can be problematic (e.g. for finding auxiliary programs such as movemail, gpg etc.). Emacs used to store the build-time value of exec-path in the custom's standard-value property, which was convenient for me because since I compile it myself, I could reuse that. This has changed however since this commit:</p> <pre> commit 2fc11b3fa3418e0e8a624376ea8bf4cbc70c2657 Author: Ludovic Courtès &lt;ludo@gnu.org&gt; Date: Mon Apr 20 17:44:23 2015 -0400 </pre> <p>So now instead, I have <a href="https://github.com/didierverna/emacs/tree/master" hreflang="en">patched it</a> to save the build-time value in a new variable called <code>BUILD-TIME-EXEC-PATH</code>.</p> <pre> (when (boundp 'build-time-exec-path) (mapc (lambda (path) (setq exec-path (remove path exec-path))) build-time-exec-path) (setq exec-path (append build-time-exec-path exec-path))) </pre> <h3>ELPA infrastructure</h3> <p>Initialize ELPA now so that the rest of the initialization process may rely on packages without having to go through <code>after-init-hook</code>.</p> <pre> (require 'package) </pre> <p>I want system-wide directories to be named <code>emacs-packages</code> instead of <code>site-lisp/elpa</code>.</p> <pre> (setq package-directory-list (let (result) (dolist (path load-path) (and (stringp path) (equal (file-name-nondirectory path) &quot;site-lisp&quot;) (push (expand-file-name &quot;emacs-packages&quot; (file-name-directory (directory-file-name path))) result))) (nreverse result))) </pre> <p>I want my local directory to follow the same convention.</p> <pre> (setq package-user-dir &quot;~/.emacs.d/emacs-packages&quot;) </pre> <p>Now, it's okay to initialize ELPA.</p> <pre> (package-initialize) </pre> <p>Now that the packages have been initialized, I actually want ELPA to install in <code>/usr/local/share/emacs/emacs-packages</code> by default, and keep my local directory for manual installations. One simple way to achieve that is to set my local directory to <code>/usr/local/share/emacs/emacs-packages</code> and to remove that from the system-wide directory list. One small drawback of this is that my local path is gone, so any new package installed there won't be seen until the next restart. This is not much of a problem though.</p> <pre> (setq package-user-dir &quot;/usr/local/share/emacs/emacs-packages&quot; package-directory-list (remove &quot;/usr/local/share/emacs/emacs-packages&quot; package-directory-list)) </pre> <h3>Site and local (non ELPA) packages infrastructure</h3> <p>The purpose of this <em>other</em> infrastructure is to support packages that would be installed manually, outside ELPA, and in a way similar to XEmacs packages. A packages directory has <code>lisp/</code>, <code>etc/</code> and <code>info/</code> subdirectories. Every package installs its stuff directly in <code>etc/</code> and <code>info/</code>, but adds its own subdirectory to <code>lisp/</code> and puts its code (including a potential autoloads file) in there.</p> <p>This additional infrastructure comes in handy in several situations. For instance, having Slime (auto)loaded in your session now becomes as simple as this:</p> <blockquote><p>ln -s /path/to/slime /usr/local/share/emacs/local-packages/lisp/</p></blockquote> <pre> (defun dvl-initialize-packages (directory) &quot;Initialize non-ELPA packages DIRECTORY. This means: - adding the whole lisp/ subtree to LOAD-PATH, - loading the autoload files found there. - adding DIRECTORY to INFO-DEFAULT-DIRECTORY-LIST.&quot; (let ((default-directory (expand-file-name &quot;lisp&quot; directory))) ;; 1. Update LOAD-PATH (setq load-path (append (let ((load-path (copy-sequence load-path))) (append (copy-sequence (normal-top-level-add-to-load-path '(&quot;.&quot;))) (normal-top-level-add-subdirs-to-load-path))) load-path)) ;; 2. Load autoload files (loop for directory in load-path while (string-prefix-p default-directory directory) do (mapc #'load (directory-files directory t &quot;-autoloads\\.el$&quot;)))) ;; 3. Update the default Info directory list (add-to-list 'Info-default-directory-list (expand-file-name &quot;info&quot; directory))) (require 'info) </pre> <p>Be sure to do this by increasing priority order.</p> <pre> (mapc #'dvl-initialize-packages `(&quot;/usr/local/share/emacs/local-packages&quot; &quot;~/.emacs.d/local-packages&quot;)) </pre> <p>And now we can re-initialize Info with the proper defaults.</p> <pre> (setq Info-directory-list nil) (info-initialize) </pre> <h3>Custom settings</h3> <p>Now that we have bootstrapped the complete packages infrastructure, we can set the Custom file to something that makes sense and load it now.</p> <pre> (setq custom-file &quot;~/.emacs.d/custom.el&quot;) (load custom-file) </pre> <h3>RC Files</h3> <p>Finally, install the <a href="http://www.lrde.epita.fr/~didier/software/elisp/#el-rcfiles" hreflang="en">rc files loader</a> and we're done bootstrapping.</p> <pre> (rcfiles-register-rc-files) </pre> <p>That completes my session bootstrap process.</p> https://www.didierverna.net/blog/index.php?post/2013/05/14/Emacs-session-bootstrap-tweaks#comment-form https://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/117 Patcher 4.0 is released urn:md5:af294cfe6b5678e3dac34c0f157d3f47 Tuesday, January 17 2012 Tuesday, January 17 2012 Didier Verna (X)Emacs Emacs LispPatcherreleasesoftwareXEmacs <p>I'm happy to announce the release of <a href="http://www.lrde.epita.fr/~didier/software/elisp/misc.php#patcher">Patcher</a> version 4.0. This is a major release introducing many new features and enhancements.</p> <p>Patcher is a tool designed to automate and ease the maintenance of archive-based projects. It provides assistance in building, reporting and committing patches, as well as in handling the corresponding ChangeLog entries, for example by creating skeletons. Patcher is the official tool for XEmacs development.</p> <h3>NEW FEATURES</h3> <ul> <li>Support floating projects and temporary relocation allowing to use the same project descriptor for various directories.</li> <li>Support for automatic detection of submodules via the :submodule-detection-function project option and the patcher-detect-submodules function. Currently supported RCS submodules are Mercurial and Git via the functions 'patcher-<a href="https://www.didierverna.net/blog/index.php?post/2012/01/17/git">hg</a>-detect-submodules.</li> <li>Support ephemeral ChangeLogs thanks to a new :change-logs-status project option. Ephemeral ChangeLogs are not stored in ChangeLog files, but exist only temporarily for mail or log message insertion (See ChangeLogs Status in the documentation).</li> <li>ChangeLog minor mode providing easy navigation through the mail/ChangeLog buffers cycle via C-c C-p n, C-c C-p p, C-c C-p N, C-c C-p P and C-c C-p m (See ChangeLogs Navigation in the documentation).</li> <li>Support for switching to mail buffer and inserting ChangeLogs at once via C-c C-p l from ChangeLog buffers.</li> <li>patcher-mail-insert-change-logs gets a prefix argument allowing to temporarily change the ChangeLogs appearance. It also supports inserting ChangeLogs even when the project is set not to.</li> <li>Additional binding for patcher-logmsg-commit: C-c C-p c</li> <li>Commit command buffer is now editable Commit is done via C-c C-p c or C-c C-c (patcher-cmtcmd-commit).</li> <li>Fontification of commit command and log message buffers with comment syntax and initial informative help. See new Patcher faces.</li> <li>Support for commit or log message canceling via C-c C-z.</li> <li>Support for project abortion via C-c C-p k or C-c C-k in all relevant buffers, including ChangeLogs.</li> <li>Support Subject: header modification in mail adaptation routines via a new project option :subject-rewrite-format.</li> <li>Support project-wide dynamic subject modification via C-c C-p S in both mail and log message buffers.</li> <li>Implement :kill-source-files-after-sending project option</li> <li>Support for source file saving</li> <li>Support for CVS diff's broken exit code policy via a new project option: :ignore-diff-status.</li> </ul> <h3>FIXES AND IMPROVEMENTS</h3> <ul> <li>Improved support for temporary subprojects making them behave like permanent ones (with a specific subdirectory and set of files).</li> <li>Much better error handling including exit code checking for external processes.</li> <li>Improved support for overlapping Patcher instances through buffer and file referencing for both ChangeLog and source files.</li> <li>Documentation rewrite and sections organization cleanup</li> <li>More checks for project consistency including missing or spurious ChangeLog entries, source diffs, undiffable and uncommittable projects etc.</li> <li>Improved project rediffing including support for partially generated ChangeLog skeletons, and interactive prompting for skeleton un/re-generation.</li> </ul> <h3>BACKWARD INCOMPATIBLE CHANGES</h3> <ul> <li>Mercurial themes renamed from 'mercurial to 'hg in order to remain consistent with the other RCS theme names.</li> <li>ChangeLogs insertion in mail buffers rebound to C-c C-p l</li> <li>Compressed ChangeLogs insertion in logmsg buffers rebound to C-c C-p L</li> <li>Removed directory-sep-char hacks until the need for it raises again. Probably better implemented via project options anyway.</li> <li>Diff commands can no longer be changed from patcher-mail-<a href="https://www.didierverna.net/blog/index.php?post/2012/01/17/adapt" title="adapt">adapt</a> but instead, the prefix argument allows for temporary subproject specification.</li> <li>patcher-*-subproject entry points removed since they are no longer needed (see above).</li> <li>Removed :kill-source-file-after-diffing option</li> <li>:kill-source-files-after-sending renamed to :kill-sources-after-sending</li> <li>patcher-mail-check-change-logs-insertion is now a project option named :check-change-logs-insertion.</li> <li>patcher-mail-check-commit-action is now a project option named :check-commit.</li> <li>:change-logs-diff-command option now understands nil instead of 'diff</li> <li>The 'packed ChangeLogs appearance has been renamed to 'pack</li> </ul> https://www.didierverna.net/blog/index.php?post/2012/01/17/Patcher-4.0-is-released#comment-form https://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/95 XEmacs now has a "foreback" face property urn:md5:c4668448a9ece8521072d70a6bed0478 Tuesday, December 27 2011 Tuesday, December 27 2011 xemacs (X)Emacs Emacs Lispface propertyXEmacs <p><a href="https://www.didierverna.net/sciblog/public/screenshot_08.png" title="The &quot;foreback&quot; face property at work"><img src="https://www.didierverna.net/sciblog/public/.screenshot_08_s.jpg" alt="The &quot;foreback&quot; face property at work" style="float:left; margin: 0 1em 1em 0;" title="The &quot;foreback&quot; face property at work, Dec 2011" /></a>Here's another new face property in XEmacs. This one is probably not going to be used ever, but still it fixes one particular problem. Until now, XEmacs used the background and foreground colors to display a face background <em>bitmap</em> (as opposed to a regular pixmap). This basically rendered the text unreadable.</p> <p>The new face property is called "foreback" (I'm running short of sensible property names these days). It's the "foreground of the background" if you will. When a face has a background bitmap, it uses the regular background color for bitmap's background, but the foreback color for the bitmap's foreground. See the attached screenshot for a concrete example of the problem it fixes.</p> <p>The bitmap I used for this example is X11's <code>xsnow</code> bitmap. Nice Christmas XEmacs screenshot, isn't it? :-)</p> <p>In order to set a face's foreback color, either use the Custom interface, or the <code>set-face-foreback</code> function.</p> https://www.didierverna.net/blog/index.php?post/2011/12/27/XEmacs-now-has-a-foreback-face-property#comment-form https://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/93 XEmacs now has a "flush" face property urn:md5:a4b2b093698cf5985132f87fbe812cad Thursday, December 22 2011 Thursday, December 22 2011 xemacs (X)Emacs Emacs Lispface propertyXEmacs <p><a href="https://www.didierverna.net/sciblog/public/mm-uu-extract.png" title="The &quot;flush&quot; face property at work"><img src="https://www.didierverna.net/sciblog/public/.mm-uu-extract_s.jpg" alt="The &quot;flush&quot; face property at work" style="float:right; margin: 0 0 1em 1em;" title="The &quot;flush&quot; face property at work, Dec 2011" /></a>I have just implemented a new face property in XEmacs 21.5, called "flush". When some text is displayed in a face which has this property set to <code>t</code> (it's a Boolean property), then the face extends until the right border of the window instead of just the end of the actual line of text. The effect is only visible if the face has a non-default background color or pixmap and gives the text segment the appearance of a block instead of being ragged right. In fact (if that rings a bell to you), this is the equivalent of the <code>block</code> value for the HTML <code>display</code> property.</p> <p>See the attached screenshot for an example. In that particular case, the buffer displays an article in Gnus and the concerned face is <code>mm-uu-extract</code>. You can see two versions of the same buffer, with and without the property set. There are a number of situations in which setting a face to flush is nicer visually. Probably the most obvious case is that of text selection. Below is a list of faces that I'm currently setting to flush. I'll be updating this list as needed. In order to set a face to flush, either use the Custom interface or the <code>set-face-flush-p</code> function directly.</p> <pre> zmacs-region diff-nonexistent-face gnus-summary-cancelled[-face] mm-uu-extract mmm-default-submode-face mmm-code-submode-face </pre> https://www.didierverna.net/blog/index.php?post/2011/12/22/XEmacs-now-has-a-flush-face-property#comment-form https://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/92 One more indentation hack urn:md5:3b8c24fe3792a983a2358d415d869534 Wednesday, July 20 2011 Wednesday, July 20 2011 Didier Verna Lisp Common LispEmacs Lispindentationtext editing <p>Here's yet another indentation hack that I came up with recently.</p> <p>All the work done by Nikodemus on the Slime indentation contrib is pretty cool, especially the notion of indentation style (though I wish the styles were Custom variables, but that is another story). I tend to use indentation styles for global, maybe collaborative preferences, but on several occasions however, I find that this approach has a couple of drawbacks.</p> <ul> <li>One of them is that the indentation information is far away from the corresponding symbol, in a separate file. If you change a function's prototype for instance, you may also need to load the file(s) in which the corresponding style(s) is (are) defined and edit them.</li> <li>The other problem is that if you want to let other people edit your source code and honor your indentation style, you also need to provide them with the style definition, and they need to load it separately.</li> </ul> <p>For those reasons, I tend to think that the indentation style approach is not very well suited for project-specific indentation settings. What I would like is to provide indentation information close to the function definition, and also to have that information automatically available when <em>anyone</em> loads the project into Slime. Here's a way to do it. <br /> <br /></p> <p>The key to success here is the function <code>swank:eval-in-emacs</code> which, as its name suggests, sends some Emacs Lisp code to your (X)Emacs session for evaluation. This function effectively allows you to trigger some Emacs Lisp computation from a Common Lisp file. Remember that indentation information is stored in the <code>common-lisp-indent-function</code> property of a symbol. The function <code>clindent</code> below does this:</p> <pre class="lisp lisp" style="font-family:inherit"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> clindent <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">symbol</span> indent<span style="color: #66cc66;">&#41;</span> <span style="color: #ff0000;">&quot;Set SYMBOL's indentation to INDENT in (X)Emacs. This function sets SYMBOL's common-lisp-indent-function property. If INDENT is a symbol, use its indentation definition. Otherwise, INDENT is considered as an indentation definition.&quot;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">when</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">and</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">member</span> <span style="color: #66cc66;">:</span><span style="color: #555;">swank</span> *features*<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>configuration <span style="color: #66cc66;">&#40;</span>find-<span style="color: #b1b100;">symbol</span> <span style="color: #ff0000;">&quot;MY.PACKAGE.CONFIGURATION&quot;</span> <span style="color: #66cc66;">:</span><span style="color: #555;">cl-user</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">when</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">and</span> configuration <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">boundp</span> configuration<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">getf</span> <span style="color: #66cc66;">&#40;</span>symbol-<span style="color: #b1b100;">value</span> configuration<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">:</span><span style="color: #555;">swank-eval-in-emacs</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">funcall</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">intern</span> <span style="color: #ff0000;">&quot;EVAL-IN-EMACS&quot;</span> <span style="color: #66cc66;">:</span><span style="color: #555;">swank</span><span style="color: #66cc66;">&#41;</span> `<span style="color: #66cc66;">&#40;</span>put '<span style="color: #66cc66;">,</span><span style="color: #b1b100;">symbol</span> 'common-lisp-indent-<span style="color: #b1b100;">function</span> <span style="color: #66cc66;">,</span><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">symbolp</span> indent<span style="color: #66cc66;">&#41;</span> `<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">get</span> '<span style="color: #66cc66;">,</span>indent 'common-lisp-indent-<span style="color: #b1b100;">function</span><span style="color: #66cc66;">&#41;</span> `'<span style="color: #66cc66;">,</span>indent<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> t<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre> <p>As explained in the docstring, this function will ask (X)Emacs to put <code>SYMBOL</code>'s <code>common-lisp-indent-function</code> property to a definition, either provided directly, or retrieved from another symbol. For example, if your package defines an <code>econd</code> macro, you may want to call it like this:</p> <pre class="lisp lisp" style="font-family:inherit"><span style="color: #66cc66;">&#40;</span>clindent 'econd '<span style="color: #b1b100;">cond</span><span style="color: #66cc66;">&#41;</span></pre> <p>This function ensures that Swank is actually available before using it (first condition in the <code>and</code> clause). I will explain the other weird bits later on.</p> <p>The next question is when exactly do we want to call this function? The answer is: pretty much on all occasions. Your code might be loaded from source and interpreted, or it might be compiled. But then, it might be compiled within or outside a Slime environment. In any case, you want your indentation information to be sent to (X)Emacs everytime it's possible. So obviously, we're gonna wrap this function in an <code>eval-when</code> form thanks to a macro. This is also a good opportunity to save some quoting.</p> <pre class="lisp lisp" style="font-family:inherit"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defmacro</span> defindent <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">symbol</span> indent<span style="color: #66cc66;">&#41;</span> <span style="color: #ff0000;">&quot;Set SYMBOL's indentation to INDENT in (X)Emacs. SYMBOL and INDENT need not be quoted. See CLINDENT for more information.&quot;</span> `<span style="color: #66cc66;">&#40;</span>eval-<span style="color: #b1b100;">when</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">:</span><span style="color: #555;">compile-toplevel</span> <span style="color: #66cc66;">:</span><span style="color: #555;">execute</span> <span style="color: #66cc66;">:</span><span style="color: #555;">load-toplevel</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>clindent '<span style="color: #66cc66;">,</span><span style="color: #b1b100;">symbol</span> '<span style="color: #66cc66;">,</span>indent<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre> <p>And now, right on top of your <code>econd</code> definition, you can just say this:</p> <pre class="lisp lisp" style="font-family:inherit"><span style="color: #66cc66;">&#40;</span>defindent econd <span style="color: #b1b100;">cond</span><span style="color: #66cc66;">&#41;</span></pre> <p>Now here's one final step. If your package uses its own readtable, it's even more convenient to define a reader-macro for indentation information. I choose <code>#i</code>:</p> <pre class="lisp lisp" style="font-family:inherit"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> i-reader <span style="color: #66cc66;">&#40;</span>stream subchar arg<span style="color: #66cc66;">&#41;</span> <span style="color: #ff0000;">&quot;Read an argument list for the DEFINDENT macro.&quot;</span> <span style="color: #66cc66;">&#40;</span>declare <span style="color: #66cc66;">&#40;</span>ignore subchar arg<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">cons</span> 'defindent <span style="color: #66cc66;">&#40;</span>read stream<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> &nbsp; <span style="color: #66cc66;">&#40;</span>set-dispatch-macro-character #\# #\i #'i-reader *readtable*<span style="color: #66cc66;">&#41;</span></pre> <p>And now, the code in my package will look like this:</p> <pre class="lisp lisp" style="font-family:inherit">#i<span style="color: #66cc66;">&#40;</span>econd <span style="color: #b1b100;">cond</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defmacro</span> econd #<span style="color: #66cc66;">|...|</span>#<span style="color: #66cc66;">&#41;</span></pre> <p>Pretty cool, eh? <br /> <br /> All right. We still have two weirdos to explain in the <code>clindent</code> function.</p> <p>First, you noticed that the function's computation is conditionalized on the existence of a <code>cl-user::my.package.configuration</code> variable, which actually stores a property list of various compiling or loading options for this package. The option we're interested in is <code>:swank-eval-in-emacs</code>, which must be set to non-nil. Here's why. The execution of Emacs Lisp code from Swank is (rightfully) considered as a security risk so it is disabled by default. If you want to authorize that, you need to set the (Emacs) variable <code>slime-enable-evaluate-in-emacs</code> to <code>t</code>. Otherwise, calling <code>swank:evaluate-in-emacs</code> is like calling 911. So we have a chicken-and-egg problem here: if we want to avoid an error in <code>clindent</code>, we would need to check the value of this variable, but in order to do that, we would need to evaluate something in (X)Emacs ;-)</p> <p>The solution I choose is hence to disable the functionality by default, and document the fact that if people want to use my indentation information, they need to set <strong>both</strong> the Slime variable and my package-specific option to non-nil before loading the package (possibly setting them back to nil afterwards). They also need to trust that I'm not going to inject anything suspicious into their (X)Emacs session at the same time... <br /> <br /></p> <p>The last bit we need to explain is the final <code>t</code> argument passed to <code>swank:eval-in-emacs</code>. The corresponding parameter is called <code>nowait</code> in the function's prototype. It has something to do with asynchronous computation, and in fact, I don't really know what's going on under the hood, but what I do know is that if you set it to <code>t</code>, Swank doesn't care about the return value of your form anymore, which is fine because we're only doing a side effect. On the other hand, if you omit that parameter, Swank will try to interpret the return value in some way, and you will most probably get a serialization error. Indeed, the return value is the indentation definition itself, so for example, <code>(&amp;rest (&amp;whole 2 &amp;rest 1))</code> doesn't make (Common Lisp) sense. <br /> <br /></p> <p>That's it. Happy indenting!</p> https://www.didierverna.net/blog/index.php?post/2011/07/20/One-more-indentation-hack#comment-form https://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/88 XEmacs 21.5.30 "garlic" is released urn:md5:c0d12ed9ba6c371ceea3a66ba1e7c316 Wednesday, April 27 2011 Wednesday, April 27 2011 xemacs (X)Emacs Common LispEmacs Lisplicensereleasesoftware <p>At long last, there is a new release of <a href="http://www.xemacs.org">XEmacs</a> 21.5. A lot of stuff has happened in this release, but the most important thing is that this is the last GPLv2 version of XEmacs. Future versions (including the current trunk) will be licensed GPLv3 or later. In fact, the first GPLv3 release, 21.5.31, is expected to follow this one by a couple of days. Thanks mostly to Aidan Kehoe, I'm also quite happy that XEmacs Lisp is more Common Lisp'y than ever.</p> https://www.didierverna.net/blog/index.php?post/2011/04/27/XEmacs-21.5.30-garlic-is-released.#comment-form https://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/79 ELS 2010 paper now available urn:md5:27592ad5d3e84859383a431b58050878 Monday, May 10 2010 Monday, May 10 2010 Didier Verna Lisp CLOSCLoXELSEmacs LispOOPpublication My paper entitled "CLoX: Common Lisp Objects for XEmacs", presented at the 3rd European Lisp Symposium last week, is now available for download on my website.<br /><br />You can find it <a href="http://www.lrde.epita.fr/~didier/research/publis.php" target="_blank">here</a>. https://www.didierverna.net/blog/index.php?post/2010/05/10/ELS-2010-paper-now-available#comment-form https://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/19 Paper accepted at ELS 2010 urn:md5:37e9f738c080399128fba19fb1d28270 Tuesday, March 9 2010 Tuesday, March 9 2010 Didier Verna Lisp CLOSCLoXconferenceELSEmacs LispOOPpublication I'm happy to announce that I will be presenting a paper at ELS 2010, the next European Lisp Symposium, in Lisbon. The abstract is given below:<br /><br /><br />CloX: Common Lisp Objects for XEmacs<br /><br />CloX is an ongoing attempt to provide a full Emacs Lisp implementation of the Common Lisp Object System, including its underlying meta-object protocol, for XEmacs. This paper describes the early development stages of this project. CloX currently consists in a port of Closette to Emacs Lisp, with some additional features, most notably, a deeper integration between types and classes and a comprehensive test suite. All these aspects are described in the paper, and we also provide a feature comparison with an alternative project called EIEIO.<br /> https://www.didierverna.net/blog/index.php?post/2010/03/09/Paper-accepted-at-ELS-2010#comment-form https://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/22 Translucent XEmacs coming in hot !! urn:md5:9bcb3866a6ebd58f796c9ee5b03b250d Thursday, February 25 2010 Thursday, February 25 2010 xemacs (X)Emacs Emacs Lisphacksoftware I'm uploading a set of changes to the XEmacs 21.5 Mercurial repository right now. These changes implement a new face property named "background-placement" which makes an XEmacs frame "slide" over a face's background pixmap when the property is set to 'absolute.<br /><br />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.<br /><br />Here are a couple of screenshots that illustrate this.<br /><br /><a target="_blank" href="https://www.didierverna.net/sciblog/public/txunix.png"><img title="Translucent XEmacs on Unix, Jan 2011" alt="" src="https://www.didierverna.net/sciblog/public/.txunix_s.jpg" /></a>&nbsp; <a target="_blank" href="https://www.didierverna.net/sciblog/public/txosx.png"><img title="Translucent XEmacs on MacOS X, Jan 2011" alt="" src="https://www.didierverna.net/sciblog/public/.txosx_s.jpg" /></a><br /><br /><br /> https://www.didierverna.net/blog/index.php?post/2010/02/25/Translucent-XEmacs-coming-in-hot-%21%21#comment-form https://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/24 RT for Emacs Lisp, version 1.0 urn:md5:f92981e5426b8990f2908eb7bd9666be Monday, February 15 2010 Monday, February 15 2010 Didier Verna Lisp Emacs LispreleaseRTsoftware I'm happy to announce the first public version of RT for Emacs Lisp, a port of the original Common Lisp regression testing package.<br /><br />Grab it <a href="http://www.lrde.epita.fr/~didier/software/xemacs.php?rt" target="_blank">here</a>. https://www.didierverna.net/blog/index.php?post/2010/02/15/RT-for-Emacs-Lisp%2C-version-1.0#comment-form https://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/25 CCL Objective C bridge code indentation urn:md5:dadc3fa8c26c6acf7204374ddaf89533 Tuesday, July 1 2008 Tuesday, July 1 2008 Didier Verna Lisp CCLEmacs LisphackObjective Csoftware A whole bunch of CCL Cocoa coding involves calls to ObjC methods. For instance, the following ObjC code:<pre>[cell drawWithFrame: frame inView: view];</pre> will translate into this in CLL: <pre>(#/drawWithFrame:inView: cell frame view)</pre>. 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.<br /><br />This layout is obviously not optimal for readability. One could define a bracket reader-macro to simulate ObjC's message passing syntax in Lisp, but I prefer to stick to the "Lisp Way". The first argument should still be considered "special" though.<br /><br />For readability (especially when the method name is long), I like to put the arguments to the message (not the receiver!) on subsequent lines. However, XEmacs's <code>cl-indent-function</code> will indent this as an ordinary function call, like this:<pre>(#/drawWithFrame:inView: cell<br /> frame view</pre> which is awfull. What I want is the following indentation: <pre>(#/drawWithFrame:inView: cell<br /> frame view</pre> This kind of indentation is normally achieved by putting a <code>common-lisp-indent-function</code> 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 <code>common-lisp-indent-function</code> (from the <code>cl-indent</code> 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.<pre>(defadvice common-lisp-indent-function (before ccl-objc-bridge activate)<br /> "Improve indentation scheme of the CCL Objective-C bridge.<br />Currently, this does the following:<br /><br />- All (#/doThis:withThat: ...) forms are indented as per a<br />lisp-indent-function property of 1. This effectively treats the first argument<br />(an object or a class) as special. The indentation you get is:<br /><br /> (#/function arg1 instead of: (#/function arg1<br /> arg2 ...) arg2 ...)"<br /> (let ((containing-form-start (elt state 1)))<br /> (save-excursion<br /> (goto-char containing-form-start)<br /> (forward-char 1)<br /> (cond ((looking-at "#/\\(\\w\\|:\\)*:")<br /> ;; We're looking at a (#/doThis:withThat: ...) form. In its holy<br /> ;; brokenness, common-lisp-indent-function with the help of<br /> ;; parse-partial-sexp will consider that the function name in<br /> ;; this form is "/functioncall:". Our trick here is to<br /> ;; dynamically put a lisp-indent-function property of 1 on this<br /> ;; symbol, so that the subsequent (original) indenting function<br /> ;; will handle it.<br /> (let* ((beg (progn (forward-char 1) (point)))<br /> (sym (progn<br /> (forward-sexp 1)<br /> (intern (downcase (buffer-substring beg<br /> (point)))))))<br /> (put sym 'common-lisp-indent-function 1)))))))</pre><br />One last thing and I'll be happy: I want to indent CCL's slet and slet* constructs just as let:<pre>(put 'slet 'common-lisp-indent-function <br /> '((&amp;whole 4 &amp;rest (&amp;whole 1 1 2)) &amp;body))<br />(put 'slet* 'common-lisp-indent-function<br /> '((&amp;whole 4 &amp;rest (&amp;whole 1 1 2)) &amp;body))</pre><br />Et voilà ! https://www.didierverna.net/blog/index.php?post/2008/07/01/CCL-Objective-C-bridge-code-indentation#comment-form https://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/48 Patcher 3.10 is released urn:md5:cb42670c68c577f8c67ee991bc235c81 Wednesday, February 27 2008 Wednesday, February 27 2008 xemacs (X)Emacs Emacs LispPatcherreleasesoftware I'm happy to announce the release of Patcher 3.10. Patcher is an XEmacs package for automating the maintenance of version control system based projects. Patcher is the official tool for XEmacs development.<br /><br />What's new in this version:<br /><br />** New feature: provide built-in themes for some revision control systems<br />These are PRCS, CVS, Subversion, Darcs and Mercurial. Also coming with<br />whitespace-resistant counterparts.<br />** Documentation: a chapter on how to setup Patcher for XEmacs development<br />** Bugfixes:<br />*** Cleanup the log messages wrt trailing whitespaces<br />*** Correctly display a missing theme name in error message<br /> https://www.didierverna.net/blog/index.php?post/2008/02/27/Patcher-3.10-is-released#comment-form https://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/53