About Lectures Research Software Blog
Musical Site
MySpace
Facebook

Moods Blog

Dojo Shin Kaï

RSS Feed
Thank you!

XHTML 1.0 conformant
CSS 2.0 conformant
Didier Verna's scientific blog: Lisp, Emacs, LaTeX and random stuff.

Tag - XEmacs

Entries feed - Comments feed

Tuesday, May 28 2013

el-rcfiles is released (first public version)

I've been using this for years, but never bothered to make it public until now.

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 here, but here is also the library's commentary section, for quick reference.

;;; 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
;;    `<rcfiles-directory>/foo<rcfiles-pseudo-extension>.el'.


Tuesday, January 17 2012

Patcher 4.0 is released

I'm happy to announce the release of Patcher version 4.0. This is a major release introducing many new features and enhancements.

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.

NEW FEATURES

  • Support floating projects and temporary relocation allowing to use the same project descriptor for various directories.
  • 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-hg-detect-submodules.
  • 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).
  • 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).
  • Support for switching to mail buffer and inserting ChangeLogs at once via C-c C-p l from ChangeLog buffers.
  • 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.
  • Additional binding for patcher-logmsg-commit: C-c C-p c
  • Commit command buffer is now editable Commit is done via C-c C-p c or C-c C-c (patcher-cmtcmd-commit).
  • Fontification of commit command and log message buffers with comment syntax and initial informative help. See new Patcher faces.
  • Support for commit or log message canceling via C-c C-z.
  • Support for project abortion via C-c C-p k or C-c C-k in all relevant buffers, including ChangeLogs.
  • Support Subject: header modification in mail adaptation routines via a new project option :subject-rewrite-format.
  • Support project-wide dynamic subject modification via C-c C-p S in both mail and log message buffers.
  • Implement :kill-source-files-after-sending project option
  • Support for source file saving
  • Support for CVS diff's broken exit code policy via a new project option: :ignore-diff-status.

FIXES AND IMPROVEMENTS

  • Improved support for temporary subprojects making them behave like permanent ones (with a specific subdirectory and set of files).
  • Much better error handling including exit code checking for external processes.
  • Improved support for overlapping Patcher instances through buffer and file referencing for both ChangeLog and source files.
  • Documentation rewrite and sections organization cleanup
  • More checks for project consistency including missing or spurious ChangeLog entries, source diffs, undiffable and uncommittable projects etc.
  • Improved project rediffing including support for partially generated ChangeLog skeletons, and interactive prompting for skeleton un/re-generation.

BACKWARD INCOMPATIBLE CHANGES

  • Mercurial themes renamed from 'mercurial to 'hg in order to remain consistent with the other RCS theme names.
  • ChangeLogs insertion in mail buffers rebound to C-c C-p l
  • Compressed ChangeLogs insertion in logmsg buffers rebound to C-c C-p L
  • Removed directory-sep-char hacks until the need for it raises again. Probably better implemented via project options anyway.
  • Diff commands can no longer be changed from patcher-mail-adapt but instead, the prefix argument allows for temporary subproject specification.
  • patcher-*-subproject entry points removed since they are no longer needed (see above).
  • Removed :kill-source-file-after-diffing option
  • :kill-source-files-after-sending renamed to :kill-sources-after-sending
  • patcher-mail-check-change-logs-insertion is now a project option named :check-change-logs-insertion.
  • patcher-mail-check-commit-action is now a project option named :check-commit.
  • :change-logs-diff-command option now understands nil instead of 'diff
  • The 'packed ChangeLogs appearance has been renamed to 'pack

Tuesday, December 27 2011

XEmacs now has a "foreback" face property

The "foreback" face property at workHere'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 bitmap (as opposed to a regular pixmap). This basically rendered the text unreadable.

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.

The bitmap I used for this example is X11's xsnow bitmap. Nice Christmas XEmacs screenshot, isn't it? :-)

In order to set a face's foreback color, either use the Custom interface, or the set-face-foreback function.

Thursday, December 22 2011

XEmacs now has a "flush" face property

The "flush" face property at workI 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 t (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 block value for the HTML display property.

See the attached screenshot for an example. In that particular case, the buffer displays an article in Gnus and the concerned face is mm-uu-extract. 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 set-face-flush-p function directly.

zmacs-region
diff-nonexistent-face
gnus-summary-cancelled[-face]
mm-uu-extract
mmm-default-submode-face
mmm-code-submode-face

Friday, May 6 2011

Common Lisp indentation in XEmacs

UPDATE: since the original publication of this blog entry, Nikodemus Siivola and I have done some more work on various other aspects of Common Lisp indentation, and I must say that the result is pretty satisfactory. Nikodemus has merged all the changes into Slime, and I have done so for XEmacs. If you're an XEmacs user, you don't need to use the slime-indentation contrib to get these improvements. Simply upgrade the "prog-modes" package and load cl-indent.el.

I have just modified XEmacs to improve the indentation of Common Lisp code. This change involves two things: the support for multiple method qualifiers in a call to defmethod and, much more importantly, a cleaner and more flexible scheme for indenting lambda lists. The patch has also been submitted to the GNU Emacs developers. Below is a more detailed description of what you get with these changes.

Method qualifiers

Until now, only one method qualifier was understood. Below are some examples demonstrating that the one method qualifier and the argument list are indented by 4 characters, and the method's body only by 2:

(defmethod foo :around ()        (defmethod foo :around
  do-this)                           ()
                                   do-this)
(defmethod foo
    :around ()                   (defmethod foo
  do-this)                           :around
                                     ()
                                   do-this)

Now let's add a second method qualifier:

(defmethod foo comb :around ()        (defmethod foo	    
	   do-this)		          comb :around () 
				          do-this)

Woops. Neither is correct. But now, you get this instead:

(defmethod foo comb :around ()        (defmethod foo	    
  do-this)			          comb :around () 
				        do-this)

Three more examples to show how confused we were:

(defmethod foo comb :around     (defmethod foo comb     (defmethod foo 
  ()				    :around	   	    comb       
  do-this)			  ()		   	    :around    
				  do-this)         	  ()	       
							  do-this)

And how better we just got:

(defmethod foo comb :around     (defmethod foo comb     (defmethod foo
    ()			   	    :around	   	    comb      
  do-this)		   	    ()		   	    :around   
				  do-this)         	    ()	      
							  do-this)

Indeed, you can see that everything between the method's name and its body is now correctly indented by 4.

Lambda Lists

The next round of changes deals with the formatting of lambda-lists. As such, this will apply everywhere a lambda-list is expected, such as defun, defgeneric, defmethod etc. First of all, here are two examples showing that we were not very clever before:

(defun foo (mand1 mand2
	    &optional opt1
	    opt2
	    &rest args
	    &key key1 key2
	    (key3 val3) &aux aux1
	    aux2)
  do-this)

(defun foo (mand1 mand2 &optional opt1
	    opt2
	    &rest args
	    &key key1 key2
	    (key3 val3) &aux aux1
	    aux2)
  do-this)

Basically, everything was blindly aligned at the beginning of the lambda-list. Here is what you get now:

(defun foo (mand1 mand2
	    &optional opt1
	      opt2
	    &rest args
	    &key key1 key2
	      (key3 val3) &aux aux1
			    aux2)
  do-this)

(defun foo (mand1 mand2 &optional opt1
			  opt2
	    &rest args
	    &key key1 key2
	      (key3 val3) &aux aux1
			    aux2)
  do-this)

The difference is that keyword parameters are indented with respect to their corresponding keyword. The amount of indentation is provided by a new customizable user option named lisp-lambda-list-keyword-parameter-indentation (oh boy, what a mouthful). If you prefer, you can also have the parameters vertically aligned with each other. Set the new customizable user option named lisp-lambda-list-keyword-parameter-alignment to t and you will get this instead:

(defun foo (mand1 mand2
	    &optional opt1
		      opt2
	    &rest args
	    &key key1 key2
		 (key3 val3) &aux aux1
				  aux2)
  do-this)

(defun foo (mand1 mand2 &optional opt1
				  opt2
	    &rest args
	    &key key1 key2
		 (key3 val3) &aux aux1
				  aux2)
  do-this)

Finally, just as you could align keyword parameters together, you can also align the keywords together. Set the new customizable user option named lisp-lambda-list-keyword-alignment to t, and you will get this (only the second example differs):

(defun foo (mand1 mand2 &optional opt1
				  opt2
			&rest args
			&key key1 key2
			     (key3 val3) &aux aux1
					      aux2)
  do-this)

These are in fact my preferred settings, although both alignment options default to nil. Here is a final example demonstrating how you could format a long lambda-list with plenty of arguments:

(defun foo (mand1 mand2
	    &optional
	      opt1 opt2 opt3
	    &key
	      key1 key2 key3
	    &aux
	      aux1 aux2 aux3)
  do-this)

These indentation problems have been a huge peeve of mine for quite a long time. I hope you will find the changes useful!

French Flag English Flag
Copyright (C) 2008 -- 2013 Didier Verna didier@lrde.epita.fr