all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Toggle WikiLink on and off does not work?
@ 2017-08-16  8:55 Csányi Pál
  2017-08-16 14:50 ` Emanuel Berg
  0 siblings, 1 reply; 13+ messages in thread
From: Csányi Pál @ 2017-08-16  8:55 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I'm running GNU Emacs 25.2.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.16)
 of 2017-08-14 on my Gentoo Linux system.

I have in my .emacs file these lines:
;; Toggle WikiLink on and off
(defun emacs-wiki-unlink-toggle ()
      "Toggle <nop> 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 cursor
    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 is
    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 "<nop>")
        (delete-char 5)
      (insert "<nop>"))))

(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?


-- 
Best, Pali



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

end of thread, other threads:[~2017-08-19 15:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-16  8:55 Toggle WikiLink on and off does not work? Csányi Pál
2017-08-16 14:50 ` Emanuel Berg
2017-08-16 15:32   ` Emanuel Berg
2017-08-17  8:17   ` Csányi Pál
2017-08-17 11:42     ` Emanuel Berg
2017-08-17 18:53       ` Csányi Pál
2017-08-17 21:12         ` Emanuel Berg
2017-08-18  5:06           ` Csányi Pál
2017-08-19 14:13             ` Emanuel Berg
2017-08-19 14:41               ` Csányi Pál
2017-08-19 14:52                 ` Emanuel Berg
2017-08-19 15:15                   ` Csányi Pál
2017-08-17 11:54     ` Emanuel Berg

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.