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 Didier Verna's scientific blog: Lisp, Emacs, LaTeX and random stuff. 2024-01-31T17:45:28+00:00 Didier Verna urn:md5:a22c53786aff986a2da4c770c233a8f9 Dotclear Menu bar icons for Emacs urn:md5:0a05c022cec7293040e0f6da6c32b907 Tuesday, September 3 2013 Tuesday, September 3 2013 Didier Verna (X)Emacs EmacsGUIIconsMenu Bar <p><strong>Note:</strong> the feature described below is now available in the <a href="https://github.com/didierverna/emacs/tree/cutebar" hreflang="en">cutebar</a> branch of my Emacs fork on GitHub.</p> <p>A huge peeve of mine on OS X is the mixture of the (application) menu bar, starting on the left, and the status bar, starting on the right: when you have a lot of status indicators like me, even a reasonably sized application menu bar will irreparably hide a lot of status, which is really annoying.</p> <p>One day, I had this idea that application menu bar (wide) titles could be replaced with (narrow) icons, hence leaving more space to the status bar. Of course, it shouldn't be up to the menu, or even to the application itself to choose which icon to use. It should be up to the user. A user will want a single icon set to work with all applications (e.g. you choose a nice File icon, and you want all applications to use it instead of the word "File").</p> <p>So one day, I implemented a SIMBL plugin and preference pane for doing exactly that. Don't look for it, it's never been released. It lets the user create associations between menu titles and icons and hijacks OS X applications to modify the appearance of their menu bar. Alas, it doesn't work very well. Native Cocoa applications not doing anything fancy with their menus are ok, but most other applications are not.</p> <p><a href="https://www.didierverna.net/blog/public/menubar_icons.png" title="Emacs menu bar icons"><img src="https://www.didierverna.net/blog/public/.menubar_icons_s.jpg" alt="Emacs menu bar icons" style="float:right; margin: 0 0 1em 1em;" title="Emacs menu bar icons, Sep 2013" /></a> Today, let me introduce some support for this feature in Emacs. Attached to this article is a patch against the current trunk plus a small image file. For this to work, you will need to put the image file (<code>barsplit.png</code>) in the <code>etc/images/</code> directory of Emacs'source tree, apply the patch and recompile (<code>--with-ns</code> of course). Then, find yourself a nice set of icons and go customize the options <code>menu-bar-use-icons</code>, <code>menu-bar-icons-directory</code> and <code>menu-bar-icons</code> in the "menu" custom group. The docstrings should be self-explanatory. As you can see on the screenshot, what you get is a much narrower, visual menu bar. The first menu (the so-called "application menu") always uses the official application's icon. The other ones are your choice. Finally, the menu bar ends with a visual separator allowing to better distinguish its end from the start of the status bar.</p> <p>The current implementation is very naive (sorry, I meant highly dynamic): titles / icons associations are recomputed every time the menu bar is redrawn. But this has in fact some advantages:</p> <ol> <li>the code is quite simple,</li> <li>customizations made by the user are visible immediately, without the need for a complex event listener / notification / whatever machinery (this machinery may already exist in the Emacs codebase though).</li> </ol> <p>In fact, I've been using this patch for quite a while now and I didn't notice any performance impact on my 3 years-old Mac Book Pro. One last thing you need to know: the behavior of this feature may be unreliable (even if implemented correctly, which I think I did) because messing with the menu bar like this is uncharted territory, totally unsupported by Apple. Enjoy anyway :-)</p> <p>Now, if somebody comes up with a nice and comprehensive set of menu bar icons for Emacs (and other OS X apps), I'd be delighted...</p> https://www.didierverna.net/blog/index.php?post/2013/09/03/Menu-bar-icons-for-Emacs#comment-form https://www.didierverna.net/blog/index.php?feed/navlang:en/atom/comments/124 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