From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?B?Q3PDoW55aSBQw6Fs?= Newsgroups: gmane.emacs.help Subject: Re: Toggle WikiLink on and off does not work? Date: Fri, 18 Aug 2017 07:06:31 +0200 Message-ID: References: <86valnzhwa.fsf@zoho.com> <86tw16whck.fsf@zoho.com> <86vallvqyd.fsf@zoho.com> Reply-To: csanyipal@gmail.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1503032844 26040 195.159.176.226 (18 Aug 2017 05:07:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 18 Aug 2017 05:07:24 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 18 07:07:21 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 1diZUz-0005nL-PG for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Aug 2017 07:07:10 +0200 Original-Received: from localhost ([::1]:56034 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diZV4-0002pQ-MA for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Aug 2017 01:07:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diZUR-0002mE-4F for help-gnu-emacs@gnu.org; Fri, 18 Aug 2017 01:06:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1diZUQ-0001qO-18 for help-gnu-emacs@gnu.org; Fri, 18 Aug 2017 01:06:35 -0400 Original-Received: from mail-pg0-x235.google.com ([2607:f8b0:400e:c05::235]:36508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1diZUP-0001q8-Qj for help-gnu-emacs@gnu.org; Fri, 18 Aug 2017 01:06:33 -0400 Original-Received: by mail-pg0-x235.google.com with SMTP id i12so56840254pgr.3 for ; Thu, 17 Aug 2017 22:06:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:content-transfer-encoding; bh=C46vpxxSHD2mJMWjtRh042w815aAD81Y9rtk6P82MnY=; b=PczkZS77XYKHcwjn2e4QsSsESiTdzC1OgL+b2heCH48+gBYzddUsUVG74X/rI0398K MmyRVj7yoMEiFDx8mFWJleJEkn/1izgldfJAYimYq2S+QriS4EphkgpvdFDyvGQAasEA eOJvOuHpuBLeFxt7f6TND/Bfnh4LNRgQ8lqJEWUimaRKCoEtUbo2W9TUFFJl5dWsQ79X bgKy6V8VcWD4tRC/ZWzQcbBsDZgriFWQSNp6ZGaA1boiZB/02Z46HwuXZwUgGciXEn/l poJx3pirA8KzsFREP+XBIRyKNk8uHJSvLLBF8ZjYzBzjIOPmOXu6lX/PCCLcNwfpBSoq fjOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:content-transfer-encoding; bh=C46vpxxSHD2mJMWjtRh042w815aAD81Y9rtk6P82MnY=; b=EsEQ5HX89XPE1ncmsMgle7Bv6lzAMv409gntobS7jzQXr0BO8d4dXCtpim5iZ64l10 ZmMv31viWOn9i75GW3IyyKcYzMQ64mRaJcTXOWNfWPnyHjKYrD1cmspYRCR6yRgciq6y Qf7ijGOoLi8Src4vMfJlu2Ophvt+jSnLPvJZ+YsejRW92iqepWKmGK/EeBT0EcKxsDpA +cxPfAfmxNEfzWsa4lPF45HPCLNP7jvXIJPd7bxRJ9IBvQQAfIzyJyiPo0yZPunMes1l hG+YjoXVLlVYNZ1ZsCJ7A/TH2jJyQSnrlPU0jTxQtWiqKn3hY8LWAJy3EDjE4hN5E4Xb 2CSw== X-Gm-Message-State: AHYfb5gB6anCntDT2ozPgs5Y9xYiWI6RKJiZnz+n410HU7p3vW36BWoK vgGCIvhNYg6LJ6Wgm2m9lf9b4VuSzucV9lc= X-Received: by 10.99.44.78 with SMTP id s75mr7315081pgs.146.1503032792461; Thu, 17 Aug 2017 22:06:32 -0700 (PDT) Original-Received: by 10.100.142.22 with HTTP; Thu, 17 Aug 2017 22:06:31 -0700 (PDT) In-Reply-To: <86vallvqyd.fsf@zoho.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::235 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:114078 Archived-At: 2017-08-17 23:12 GMT+02:00 Emanuel Berg : > Cs=C3=A1nyi P=C3=A1l wrote: > >> It is all the same whether is a before >> a CamelCase or is not there, the CamelCase >> remain wikilink. I expect that, if a is >> before a such CamelCase, like CamelCase >> then it should turn into non-link. Right? >> This turn thing does not works here. > > There is nothing specifically about CamelCase > in that function! > > Can you give us a piece of code and tell where > point is and what you want to happen when the > function is invoked? As you know, I am not who wrote this code down, but yason: Toggle WikiLink on and off Depending on the type of the text you write, you might be typing a lot of CamelCase words that are, however, not links. Writing is cumbersome after a few iterations, and sometimes you=E2=80=99ll have to rem= ove it again. Here=E2=80=99s a short function that toggles the current CamelCap= s word between wikilink and non-link: (defun emacs-wiki-unlink-toggle () "Toggle string in the beginning of the current word, to un/make a word emacs-wiki link. The current word depends on the point: if the cur= sor is on a non-whitespace character, it's considered a word surrounded by whitespace. If the cursor is on a whitespace character, the next word i= s looked up. This way addressing a word works intuitively after having arrived on the spot using forward-word." (interactive) (save-excursion (if (looking-at "[[:space:]]") (goto-char (- (re-search-forward "[A-Za-z<]") 1)) (goto-char (+ (re-search-backward "[[:space:]]") 1))) (if (looking-at "") (delete-char 5) (insert "")))) I hook it up to C-n with this: (add-hook 'emacs-wiki-mode-hook '(lambda () (local-set-key "\C-c\C-n" 'emacs-wiki-unlink-toggle))) --yason > This issue is a bit trivial - why not just > type? - but OK, I sense it has a trivial > solution as well where that function > fails... :) In Wiki Mode if one write down a CamelCase word, it turns automatically in to wikilink. I thought the code abowe was for turning off wikilink into non-link in such case when one want to write down a CamelCase word in Wiki Mode, but want it not to be a wikilink. If this code write down by yason does this not, then what is it for?? What is the purpose of the at the start of such CamelCase word in Wiki Mode then?? --=20 Best, Pali