[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Help hyperlinks only work when auto-compression-mode is enabled.
From: |
Alan Mackenzie |
Subject: |
Help hyperlinks only work when auto-compression-mode is enabled. |
Date: |
Sun, 10 Jun 2007 11:11:59 +0100 |
User-agent: |
Mutt/1.5.9i |
Hi, Emacs!
Emacs -Q
M-x auto-compression-mode
C-h f revert-buffer
C-x o <tab> ; Point is now over `files.el'
<CR> ; To go to the definition of `revert-buffer'
This gives the error message "Can't find library files.el". The reason
for this is that the source is actually in files.el.gz, and this can
only be read when auto-compression-mode is enabled. This is not good;
even though a-c-m is enabled by default, our help system should still
work if a user disables a-c-m (OUTCH!!! ;-). This can even happen by
accident, for example when a user had "(auto-compression-mode)" in his
Emacs-21 .emacs when he really wanted "(auto-compression-mode 1)".
The solution is to surround the calls that visit the source with
`with-auto-compression-mode'. Kudos to the genius who had the foresight
to write `with-auto-compression-mode', and thanks again to Johan
Bockgård who showed me yesterday where the help-mode source code was.
Here's a patch: I suggest I install it into both EMACS_22_BASE and the
trunk:
2007-06-10 Alan Mackenzie <address@hidden>
* help-mode.el (help-function-def, help-variable-def,
help-face-def): Use `with-auto-compression-mode'.
Index: help-mode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/help-mode.el,v
retrieving revision 1.51
diff -c -r1.51 help-mode.el
*** help-mode.el 21 Jan 2007 03:53:11 -0000 1.51
--- help-mode.el 10 Jun 2007 08:24:29 -0000
***************
*** 155,161 ****
;; Don't use find-function-noselect because it follows
;; aliases (which fails for built-in functions).
(let ((location
! (find-function-search-for-symbol fun nil file)))
(pop-to-buffer (car location))
(if (cdr location)
(goto-char (cdr location))
--- 155,162 ----
;; Don't use find-function-noselect because it follows
;; aliases (which fails for built-in functions).
(let ((location
! (with-auto-compression-mode
! (find-function-search-for-symbol fun nil file))))
(pop-to-buffer (car location))
(if (cdr location)
(goto-char (cdr location))
***************
*** 167,173 ****
'help-function (lambda (var &optional file)
(when (eq file 'C-source)
(setq file (help-C-file-name var 'var)))
! (let ((location (find-variable-noselect var file)))
(pop-to-buffer (car location))
(if (cdr location)
(goto-char (cdr location))
--- 168,176 ----
'help-function (lambda (var &optional file)
(when (eq file 'C-source)
(setq file (help-C-file-name var 'var)))
! (let ((location
! (with-auto-compression-mode
! (find-variable-noselect var file))))
(pop-to-buffer (car location))
(if (cdr location)
(goto-char (cdr location))
***************
*** 181,187 ****
;; Don't use find-function-noselect because it follows
;; aliases (which fails for built-in functions).
(let ((location
! (find-function-search-for-symbol fun 'defface file)))
(pop-to-buffer (car location))
(if (cdr location)
(goto-char (cdr location))
--- 184,191 ----
;; Don't use find-function-noselect because it follows
;; aliases (which fails for built-in functions).
(let ((location
! (with-auto-compression-mode
! (find-function-search-for-symbol fun 'defface
file))))
(pop-to-buffer (car location))
(if (cdr location)
(goto-char (cdr location))
--
Alan Mackenzie (Ittersbach, Germany)
- Help hyperlinks only work when auto-compression-mode is enabled.,
Alan Mackenzie <=