emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* link handling for `file:' fails to stay within Emacs but calls `open file:' with TextEdit
@ 2018-05-09  3:02 Van L
  2018-05-24 22:57 ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Van L @ 2018-05-09  3:02 UTC (permalink / raw)
  To: emacs-orgmode

Hello.

The link handling for org mode behaves unexpectedly where a file sets
org mode according to `Local variables:' at the end of the file.

In the following, a.org and b.org files work as expected using M-x
org-store-link and M-x org-insert-link for `file:' link.

Without the .org filename extension, following the link calls

  `open file:' which leads to Org Mode opening the file with TextEdit

under mac os, Emacs 26.1 rc-1.


;;;; ------------------------------------

;; running	: Emacs.app/Contents/MacOS/Emacs -Q
;; problem	: This two file arrangment for `Emacs -Q' *fails* to follow the link.
;; expect	: Emacs to open a link to org file.
;; unexpected	: Emacs calls TextEdit to open org file.
;; solution	: if file a and b are called a.org and b.org then there is no problem.

;; Solution needs org files named without the `.org’ extension
;; to follow `file:’ links without leaving Emacs.


;;;; ------------------------------------
;; file		: a


* one

** two

*** three

[[file:b::*title%20%E4%B8%AD][title 中]]

# Local variables:
# mode: org
# End:


;;;; ------------------------------------
;; file : b

* work

** title 中

*** chapter


# Local variables:
# mode: org
# End:

;;;; ============================================================
;; file a.org

* one

** two

*** three

[[file:b.org::*title%20%E4%B8%AD][title 中]]





;;;; ============================================================
;; file b.org

* work

** title 中

*** chapter

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

* Re: link handling for `file:' fails to stay within Emacs but calls `open file:' with TextEdit
  2018-05-09  3:02 link handling for `file:' fails to stay within Emacs but calls `open file:' with TextEdit Van L
@ 2018-05-24 22:57 ` Nicolas Goaziou
  2018-05-25  3:01   ` Van L
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2018-05-24 22:57 UTC (permalink / raw)
  To: Van L; +Cc: emacs-orgmode

Hello,

Van L <van@scratch.space> writes:

> The link handling for org mode behaves unexpectedly where a file sets
> org mode according to `Local variables:' at the end of the file.
>
> In the following, a.org and b.org files work as expected using M-x
> org-store-link and M-x org-insert-link for `file:' link.
>
> Without the .org filename extension, following the link calls
>
>   `open file:' which leads to Org Mode opening the file with TextEdit
>
> under mac os, Emacs 26.1 rc-1.
>
>
> ;;;; ------------------------------------
>
> ;; running	: Emacs.app/Contents/MacOS/Emacs -Q
> ;; problem	: This two file arrangment for `Emacs -Q' *fails* to follow the link.
> ;; expect	: Emacs to open a link to org file.
> ;; unexpected	: Emacs calls TextEdit to open org file.
> ;; solution	: if file a and b are called a.org and b.org then there is no problem.
>
> ;; Solution needs org files named without the `.org’ extension
> ;; to follow `file:’ links without leaving Emacs.

Files are selected by their extension, not by their major mode. You may
want to tweak `org-file-apps'.

Regards,

-- 
Nicolas Goaziou

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

* Re: link handling for `file:' fails to stay within Emacs but calls `open file:' with TextEdit
  2018-05-24 22:57 ` Nicolas Goaziou
@ 2018-05-25  3:01   ` Van L
  2018-05-26 10:34     ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Van L @ 2018-05-25  3:01 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode


> Nicolas Goaziou writes:
> 
> You may
> want to tweak `org-file-apps’.

I chose `Default for unrecognized files’, `Visit with Emacs’; 
but `Default for files in directory’ or use of the hidden file in the directory for setting the mode would be better.

Thanks.

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

* Re: link handling for `file:' fails to stay within Emacs but calls `open file:' with TextEdit
  2018-05-25  3:01   ` Van L
@ 2018-05-26 10:34     ` Nicolas Goaziou
  2018-05-26 12:18       ` Van L
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2018-05-26 10:34 UTC (permalink / raw)
  To: Van L; +Cc: emacs-orgmode

Hello,

Van L <van@scratch.space>

> I chose `Default for unrecognized files’, `Visit with Emacs’; 
> but `Default for files in directory’ or use of the hidden file in the
> directory for setting the mode would be better.

I don't understand your answer.

What is your `org-file-apps'? What is not working according to your
setup?

Regards,

-- 
Nicolas Goaziou

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

* Re: link handling for `file:' fails to stay within Emacs but calls `open file:' with TextEdit
  2018-05-26 10:34     ` Nicolas Goaziou
@ 2018-05-26 12:18       ` Van L
  2018-05-26 12:31         ` Nicolas Goaziou
  2018-05-26 15:27         ` Eric S Fraga
  0 siblings, 2 replies; 8+ messages in thread
From: Van L @ 2018-05-26 12:18 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode


> On 26 May 2018, at 20:34, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> 
> What is your `org-file-apps’?

Value:
((auto-mode . emacs)
 ("\\.mm\\'" . default)
 ("\\.x?html?\\'" . default)
 ("\\.pdf\\'" . default)
 (t . emacs))
Original value was 
((auto-mode . emacs)
 ("\\.mm\\'" . default)
 ("\\.x?html?\\'" . default)
 ("\\.pdf\\'" . default))

> What is not working according to your
> setup?

It is working now since I was advised to look there and I made the above change.

I am now able to link file to file and stay within Emacs for a directory having only files in Org Mode but without the .org filename extension.

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

* Re: link handling for `file:' fails to stay within Emacs but calls `open file:' with TextEdit
  2018-05-26 12:18       ` Van L
@ 2018-05-26 12:31         ` Nicolas Goaziou
  2018-05-26 12:38           ` Van L
  2018-05-26 15:27         ` Eric S Fraga
  1 sibling, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2018-05-26 12:31 UTC (permalink / raw)
  To: Van L; +Cc: emacs-orgmode

Van L <van@scratch.space> writes:

> It is working now since I was advised to look there and I made the above change.
>
> I am now able to link file to file and stay within Emacs for a directory having only files in Org Mode but without the .org filename extension.

Great!

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

* Re: link handling for `file:' fails to stay within Emacs but calls `open file:' with TextEdit
  2018-05-26 12:31         ` Nicolas Goaziou
@ 2018-05-26 12:38           ` Van L
  0 siblings, 0 replies; 8+ messages in thread
From: Van L @ 2018-05-26 12:38 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode


> Nicolas Goaziou writes:
> 
> Van L <van@scratch.space> writes:
> 
>> It is working now since I was advised to look there and I made the above change.
>> 
>> I am now able to link file to file and stay within Emacs for a directory having only files in Org Mode but without the .org filename extension.
> 
> Great!

To be better, I’d like to set the local directory where emacs opens all the files.

The current setting opens everything unknown to emacs in emacs.

There is a hidden file method to have emacs open files according to the mode set there for the directory.

But the link mechanism doesn’t read that.

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

* Re: link handling for `file:' fails to stay within Emacs but calls `open file:' with TextEdit
  2018-05-26 12:18       ` Van L
  2018-05-26 12:31         ` Nicolas Goaziou
@ 2018-05-26 15:27         ` Eric S Fraga
  1 sibling, 0 replies; 8+ messages in thread
From: Eric S Fraga @ 2018-05-26 15:27 UTC (permalink / raw)
  To: Van L; +Cc: emacs-orgmode, Nicolas Goaziou

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

On Saturday, 26 May 2018 at 22:18, Van L wrote:
>> What is your `org-file-apps’?
>
> Value:
> ((auto-mode . emacs)
>  ("\\.mm\\'" . default)
>  ("\\.x?html?\\'" . default)
>  ("\\.pdf\\'" . default)
>  (t . emacs))
> Original value was 
> ((auto-mode . emacs)
>  ("\\.mm\\'" . default)
>  ("\\.x?html?\\'" . default)
>  ("\\.pdf\\'" . default))
>
> It is working now since I was advised to look there and I made the
> above change.

Thanks for this.  I had been struggling to figure out why opening an
attachment directory did not use Emacs (it used to just fine but
something changed over the past months).  Adding that last line makes it
work.  

I think having '((t . emacs)) alone will suffice for me.  I mean, why
would I want to invoke something other than Emacs? ;-)

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-591-gee336b

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

end of thread, other threads:[~2018-05-26 15:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-09  3:02 link handling for `file:' fails to stay within Emacs but calls `open file:' with TextEdit Van L
2018-05-24 22:57 ` Nicolas Goaziou
2018-05-25  3:01   ` Van L
2018-05-26 10:34     ` Nicolas Goaziou
2018-05-26 12:18       ` Van L
2018-05-26 12:31         ` Nicolas Goaziou
2018-05-26 12:38           ` Van L
2018-05-26 15:27         ` Eric S Fraga

Code repositories for project(s) associated with this public 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).