unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Help hyperlinks only work when auto-compression-mode is enabled.
@ 2007-06-10 10:11 Alan Mackenzie
  2007-06-10 19:26 ` Stefan Monnier
  2007-06-10 21:00 ` Richard Stallman
  0 siblings, 2 replies; 9+ messages in thread
From: Alan Mackenzie @ 2007-06-10 10:11 UTC (permalink / raw)
  To: emacs-devel

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  <acm@muc.de>

	* 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)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-06-16 18:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-10 10:11 Help hyperlinks only work when auto-compression-mode is enabled Alan Mackenzie
2007-06-10 19:26 ` Stefan Monnier
2007-06-10 21:04   ` Alan Mackenzie
2007-06-11  1:11     ` Stefan Monnier
2007-06-10 21:00 ` Richard Stallman
2007-06-10 23:49   ` Alan Mackenzie
2007-06-12 16:00     ` Richard Stallman
2007-06-15 22:35       ` Alan Mackenzie
2007-06-16 18:50         ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).