From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Toggle WikiLink on and off does not work? Date: Wed, 16 Aug 2017 17:32:23 +0200 Message-ID: <861soby1dk.fsf@zoho.com> References: <86valnzhwa.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1502897604 11493 195.159.176.226 (16 Aug 2017 15:33:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 16 Aug 2017 15:33:24 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 16 17:33:20 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1di0Jh-0002EH-AX for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Aug 2017 17:33:09 +0200 Original-Received: from localhost ([::1]:54549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1di0Jo-0004l9-0R for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Aug 2017 11:33:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1di0JF-0004iq-8p for help-gnu-emacs@gnu.org; Wed, 16 Aug 2017 11:32:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1di0JC-0001K5-3y for help-gnu-emacs@gnu.org; Wed, 16 Aug 2017 11:32:41 -0400 Original-Received: from [195.159.176.226] (port=50176 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1di0JB-0001Ix-TH for help-gnu-emacs@gnu.org; Wed, 16 Aug 2017 11:32:38 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1di0J0-0008Ma-9P for help-gnu-emacs@gnu.org; Wed, 16 Aug 2017 17:32:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 28 Original-X-Complaints-To: usenet@blaine.gmane.org Mail-Copies-To: never Cancel-Lock: sha1:zgAmYMKHRRF9NrsvD0j8bUxRMCM= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:114062 Archived-At: Emanuel Berg wrote: >> (add-hook 'emacs-wiki-mode-hook '(lambda () >> (local-set-key "\C-c\C-n" >> 'emacs-wiki-unlink-toggle))) but in Wiki >> mode I can't toggle on or off >> a WikiLink. Why? > > You don't need a lambda here (and they need not > be quoted). You can put a # before the > function quote. ... maybe you *do* need a lambda here? Just not quoted? It seems the form is evaluated. Anyway, the other suggestion is still better, faster and more reliable, than to use hooks. If you still want hooks, here is a construct that makes it more orderly: ;; (setq text-mode-hook nil) (defun text-mode-hook-f () (auto-fill-mode) (abbrev-mode) ) (add-hook 'text-mode-hook #'text-mode-hook-f) -- underground experts united http://user.it.uu.se/~embe8573