emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: syntax highlighting of elisp:blahblah and shell:blablah [8.2.6 (8.2.6-67-g9e09b2-elpa @ c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140602/)]
@ 2014-07-20 13:03 Andrea Rossetti
  2014-07-20 18:08 ` Nick Dokos
  0 siblings, 1 reply; 4+ messages in thread
From: Andrea Rossetti @ 2014-07-20 13:03 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 637 bytes --]


Hi all,

  when I insert some text like "elisp:sometext" or "shell:sometext"
in an Org buffer, it becomes highlighted and clickable. On click,
a prompt asks for confirm to execute "sometext".

  I get the same behaviour if I add tags to a headline, and one
of the tags is "elisp" or "shell".

  I expected this behaviour when I create links with double square
brackets, but not in default text paragraphs, nor in the tags.
May I please ask for some feedback:

1) did I miss something, and this was expected (at least for default
   text paragraphs)?
2) is this reproducible for some of you as well?

  I attach here a small test case:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: test-bug-elisp.org --]
[-- Type: text/x-org, Size: 158 bytes --]

* my elisp tricks collection                            :elisp:andrea:tricks:

I like to write elisp:it is useful.
I seldow use shell:but it's useful as well

[-- Attachment #3: Type: text/plain, Size: 244 bytes --]


  Thanks in advance, kindest regards.

    Andrea

Emacs  : GNU Emacs 24.3.1 (i386-mingw-nt6.1.7600) of 2013-03-17 on MARVIN
Package: Org-mode version 8.2.6 (8.2.6-67-g9e09b2-elpa @ c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140602/)

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

* Re: Bug: syntax highlighting of elisp:blahblah and shell:blablah [8.2.6 (8.2.6-67-g9e09b2-elpa @ c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140602/)]
  2014-07-20 13:03 Bug: syntax highlighting of elisp:blahblah and shell:blablah [8.2.6 (8.2.6-67-g9e09b2-elpa @ c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140602/)] Andrea Rossetti
@ 2014-07-20 18:08 ` Nick Dokos
  2014-07-21 18:28   ` Andrea Rossetti
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Dokos @ 2014-07-20 18:08 UTC (permalink / raw)
  To: emacs-orgmode

Andrea Rossetti <andrea.rossetti@gmail.com> writes:

>   when I insert some text like "elisp:sometext" or "shell:sometext"
> in an Org buffer, it becomes highlighted and clickable. On click,
> a prompt asks for confirm to execute "sometext".
>
>   I get the same behaviour if I add tags to a headline, and one
> of the tags is "elisp" or "shell".
>
>   I expected this behaviour when I create links with double square
> brackets, but not in default text paragraphs, nor in the tags.
> May I please ask for some feedback:
>
> 1) did I miss something, and this was expected (at least for default
>    text paragraphs)?

I don't know whether it's expected (one of these years I really have
to sit down and learn the syntax).

> 2) is this reproducible for some of you as well?
>

Yes.

>   I attach here a small test case:
>
> * my elisp tricks collection                            :elisp:andrea:tricks:
>
> I like to write elisp:it is useful.
> I seldow use shell:but it's useful as well
>
>

Workarounds:

- in text, leave a space after the colon - that's standard practice
  anyway.

- in tags, put the `link' tag at the end:

  :andrea:tricks:elisp:

The latter doesn't help if you have two `link'-type tags, but it should cover
the majority of problematic cases.

-- 
Nick

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

* Re: Bug: syntax highlighting of elisp:blahblah and shell:blablah [8.2.6 (8.2.6-67-g9e09b2-elpa @ c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140602/)]
  2014-07-20 18:08 ` Nick Dokos
@ 2014-07-21 18:28   ` Andrea Rossetti
  2014-07-27 13:58     ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Andrea Rossetti @ 2014-07-21 18:28 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Nick Dokos <ndokos@gmail.com> writes:
> I don't know whether it's expected (one of these years I really have
> to sit down and learn the syntax).

  I digged a bit further about the "linkification"
of shell:bla and elisp:bla (the same applies
to all protocols listed in `org-link-types'):

  - this type of links is defined by the syntax (see "plain link" in
    defcustom `org-activate-links')
  - syntax seems not to consider the corner-case of tags shell:bla
  - the unwanted link inhibits the function "click on tags => do a search by tags"
  - my workaround: I won't use `elisp' and `shell' in the tags, but `el' and `sh'
  - possible actions could be:
    - change the syntax (backward-incompatible): the regexp for plain
      links should not allow for ":" delimiters
    - or (backward-compatible) change `org-activate-plain-links' so that
      a plain link is not activated if it's inside a tag
    - or (backward-compatible) leave everything as it is now,
      as it's a minor bug (note that the tag search with "C-c \"
      works properly, the problem is just that you can't
      start a search with a mouse click)
  
  Kindest regards,

    Andrea

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

* Re: Bug: syntax highlighting of elisp:blahblah and shell:blablah [8.2.6 (8.2.6-67-g9e09b2-elpa @ c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140602/)]
  2014-07-21 18:28   ` Andrea Rossetti
@ 2014-07-27 13:58     ` Bastien
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2014-07-27 13:58 UTC (permalink / raw)
  To: Andrea Rossetti; +Cc: Nick Dokos, emacs-orgmode

Hi Andrea,

Andrea Rossetti <andrea.rossetti@gmail.com> writes:

>     - or (backward-compatible) change `org-activate-plain-links' so that
>       a plain link is not activated if it's inside a tag

I took this road, fixed now, thanks for reporting this.

-- 
 Bastien

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

end of thread, other threads:[~2014-07-28 17:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-20 13:03 Bug: syntax highlighting of elisp:blahblah and shell:blablah [8.2.6 (8.2.6-67-g9e09b2-elpa @ c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140602/)] Andrea Rossetti
2014-07-20 18:08 ` Nick Dokos
2014-07-21 18:28   ` Andrea Rossetti
2014-07-27 13:58     ` Bastien

Code repositories for project(s) associated with this inbox:

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).