all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: emacs-devel@gnu.org
Subject: Help hyperlinks only work when auto-compression-mode is enabled.
Date: Sun, 10 Jun 2007 11:11:59 +0100	[thread overview]
Message-ID: <20070610101159.GA2311@muc.de> (raw)

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)

             reply	other threads:[~2007-06-10 10:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-10 10:11 Alan Mackenzie [this message]
2007-06-10 19:26 ` Help hyperlinks only work when auto-compression-mode is enabled 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070610101159.GA2311@muc.de \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.