Mail Archives: djgpp/1999/03/28/20:46:22
chiry AT nospam DOT csua DOT Berkeley DOT EDU writes:
> > (setq Info-suffix-list '((".info.gz" . "gunzip")
> > ...
>
> Hi Michael, thanks for the reply. Is there a way I can setup my .emacs
> file to append to the list instead of setting it directly? I tried
> add-hook to info-mode, but it doesn't seem to do anything.
>
> (defun my-info-mode-hook ()
> (setq Info-suffix-list
> (append
> '((".inf" . nil))
> Info-suffix-list)
> )
> )
>
> (add-hook 'info-mode-hook 'my-info-mode-hook)
If I change info-mode-hook to Info-mode-hook, it works for me with
Emacs-20.3. But it will add one entry in Info-suffix-list each time
you are running info. It is possible to write the following
(defun append-once (elt list)
(if (assoc (car elt) list)
list
(append (list elt) list)))
(defun my-info-mode-hook ()
(append-once '(".inf" . nil)
Info-suffix-list))
(add-hook 'Info-mode-hook 'my-info-mode-hook)
Note that you cannot pass several lists to append-once and expect them
to be appended, you need to add elements by one, or write another
function which accepts any number of lists and concatenates them using
append-once or similar function.
--
Michael Bukin
- Raw text -