In the interest of making the SLIME ChangeLogs more useful, I have written the following notes concerning Change Log mode.
1. The major mode Change Log can be used with ChangeLog files to make them behave as hypertext that can then be used to review quickly the changes that are described. To do this, type C-c C-c when point is before or on a properly-formatted ChangeLog entry, and the changed file will displayed in another window, optionally, at the definition of a specified symbol.
As the documentation for C-c C-c (change-log-goto-source) says:
"Go to source location of "change log tag" near `point'. A change log tag is a symbol within a parenthesized, comma-separated list. If no suitable tag can be found nearby, try to visit the file for the change under `point' instead."
A properly-formatted ChangeLog entry has the form:
[white-space]* [file name] (symbol name,...): [descriptive text] [white-space](symbol name): [descriptive text]
The trailing ':' is customary, but C-c C-c will attempt to find the definition of the parenthesized symbol(s) listed without it, or even if the symbol is listed after it.
Examples:
* slime.el (slime-edit-uses-xrefs): New variable. For contribs to
* swank-cmucl.lisp (reset-sigio-handlers): New function.
* swank-backend.lisp (socket-fd, make-fd-stream, dup, exec-image)
* slime.el (slime-selector-other-window): New variable. (slime-selector): Bind it as need. (def-slime-selector-method): Use the other window if so indicated.
Pressing C-c C-c while the cursor is anywhere on the first two entries will cause Emacs to locate those symbols' definitions (only) in those files. In the comma-delimited list of the third entry, C-c C-c will locate the definition of the symbol closest to point. In the multi-line fourth entry, C-c C-c will locate in slime.el the definition of the symbol closest to point.
If the file or symbol name is misspelled or the parenthesized text is not (strictly) a symbol name, then Emacs will indicate this with a message rather than locating the symbol's definition. So, for example,
* foo.lisp: Fix a typo (grammar error)
will cause Emacs to look in the file foo.lisp for the symbol 'grammar' because it is parenthesized text following a file name.
Authors of ChangeLog entries should be able to quickly check the validity of their entries by typing C-c C-c before committing them to CVS.
2. It is also possible to "walk through" a sequence of ChangeLog entries just as you do with compiler errors by typing C-x ` (backquote), which is mapped to `next-error'. This will:
- open the file in another window at the definition specified by the ChangeLog entry - move the cursor to that definition - move point in the ChangeLog file to the next entry for when you return to the ChangeLog
(Be aware that once the cursor is in the source file, `next-error' does not have the same meaning as it does in the ChangeLog file. After reviewing the change, you will need to move the cursor back to the ChangeLog file before typing C-x ` to examine the file/symbol-definition of the next ChangeLog entry.)
3. This capability of Change Log mode exists for Lisp code. It does not work with, for example, texinfo files, that is, it does not understand texinfo symbol definitions. The following entry will open "doc/slime.texi", but will not move point to the definition of the symbol:
* doc/slime.texi (swank-loader:init): is also needed for loading swank.
Similarly, non-symbol-name text inside parentheses is meaningless to C-c C-c. So, for example, this entry:
* slime.el (compile-defun [test]): Add two cases.
cannot be found using C-c C-c. But the following entry can locate the definition of `compile-defun', which can then be reviewed for the two test cases.
* slime.el (compile-defun): Add two test cases.
Also, non-definitions of symbols (that is, when you call a function or reference a variable) cannot be found by C-c C-c. So, the following entry:
* swank.lisp: (decode-message): Adopted
will cause Emacs to do nothing except display an informative message when C-c C-c is pressed because, while `decode-message' is *used* in swank.lisp, it is not defined there.
"Source location of tag `decode-message' not found in file `swank.lisp'"
An alternative entry that does not use the (symbol-name) syntax would have the benefit of opening swank.lisp, allowing the user to then search for references of `decode-message', for example:
* swank.lisp: Adopted the function `decode-message' where appropriate.
4. Finally, on-the-fly spelling checking can be added to Change Log mode with, for example, the following:
(add-hook 'change-log-mode-hook 'turn-on-flyspell)
or, indirectly, with
(add-hook 'text-mode-hook 'turn-on-flyspell)
This could be of help to non-native English readers who may have a harder time guessing what a misspelled word should be. A misspelled word can be quickly repaired by cycling through possible corrections using repeated M-Tab key presses.
Thank you again to the authors of SLIME.
On 1/27/10 8:50 PM, Mark Harig wrote:
In the interest of making the SLIME ChangeLogs more useful, I have written the following notes concerning Change Log mode.
- The major mode Change Log can be used with ChangeLog files to make
them behave as hypertext that can then be used to review quickly the changes that are described. To do this, type C-c C-c when point is before or on a properly-formatted ChangeLog entry, and the changed file will displayed in another window, optionally, at the definition of a specified symbol.
[…]
Is there a convention to specify which specialization of a CL generic function a comment refers to? Emacs 23.1 just seems to go to the first DEFMETHOD it finds.
* Mark Evenson [2010-01-28 10:49+0100] writes:
Is there a convention to specify which specialization of a CL generic function a comment refers to? Emacs 23.1 just seems to go to the first DEFMETHOD it finds.
No official one and nothing that would be supported. I tend to write things like: (inspect-object (cons)).
Helmut
-----Original Message-----From: Helmut Eller heller@common-lisp.net* Mark Evenson [2010-01-28 10:49+0100] writes:> Is there a convention to specify which specialization of a CL generic > function a comment refers to? Emacs 23.1 just seems to go to the first > DEFMETHOD it finds.No official one and nothing that would be supported. I tend to writethings like: (inspect-object (cons)).Helmut---- Beware of using nested parenthesized expressions if you want tomaintain the hypertext capability of Change Log mode. For example, * slime.el (inspect-object (cons)): [descriptive text]would lead C-c C-c to attempt to locate the definition of the symbol`cons' in the file slime.el, which is probably not what you want. Theregular expression that Change Log mode uses to identify a symbol inparentheses locates the symbol in the inner-most set of parentheses,rather than the outer-most set of parentheses.If they want to gain the hypertext- like capability that Change Logmode provides, then writers of ChangeLog entries may want to stick tothe simple rule of providing filenames and parenthesized (optionally,comma-separated lists of) symbols whose definitions have been added,changed, or deleted, followed by colons and descriptions. Then theburden of providing detail about the change falls to the description.
On 01/28/2010 04:49 AM, Mark Evenson wrote:> On 1/27/10 8:50 PM, Mark Harig wrote:>>>> In the interest of making the SLIME ChangeLogs more useful, I have>> written the following notes concerning Change Log mode.>>>>>> 1. The major mode Change Log can be used with ChangeLog files to make>> them behave as hypertext that can then be used to review quickly the>> changes that are described. To do this, type C-c C-c when point is>> before or on a properly-formatted ChangeLog entry, and the changed>> file will displayed in another window, optionally, at the definition>> of a specified symbol.>> […]>> Is there a convention to specify which specialization of a CL generic > function a comment refers to? Emacs 23.1 just seems to go to the first > DEFMETHOD it finds.>>Although there is no way to specify what you have asked, Change Logmode's C-c C-c can still be used to find quickly the particular methodthat you have defined. For example, with the ChangeLog entry: * swank-abcl.lisp (emacs-inspect)typing C-c C-c repeatedly will cause Emacs to cycle through theseveral definitions of the method `emacs-inspect'. The descriptionfollowing the file name and parenthesized symbol name might containsomething like: * swank-abcl.lisp (emacs-inspect): [o java:java-object]...other descriptive text...This avoids using parentheses that confuse Change Log mode, but stillhelp readers quickly locate the definition that has been changed.