emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Recently master branch commit breaks open file: link
@ 2020-02-24  6:38 stardiviner
  2020-02-24  8:41 ` Bastien
  0 siblings, 1 reply; 11+ messages in thread
From: stardiviner @ 2020-02-24  6:38 UTC (permalink / raw)
  To: Org Mode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


When I open a link like this:

#+begin_src org
[[file:~/Org/Tasks/Computer Todos.org::*TODO 厉害的人是怎么分析问题的?][厉害的人是怎么分析问题的?]]
#+end_src

I =[M-x toggle-debug-on-error]= got following stacktrace:

#+begin_example
Debugger entered--Lisp error: (file-missing "Reading directory" "No such file or directory" "/home/stardiviner/Org/Wiki/Thought/Data/Manuals/My...")
  access-file("/home/stardiviner/Org/Wiki/Thought/Data/Manuals/My..." "Reading directory")
  #f(compiled-function (file switches &optional wildcard full-directory-p) "Insert directory listing for FILE, formatted according to SWITCHES.\nLeaves point after the inserted text.\nSWITCHES may be a string of options, or a list of strings\nrepresenting individual options.\nOptional third arg WILDCARD means treat FILE as shell wildcard.\nOptional fourth arg FULL-DIRECTORY-P means file is a directory and\nswitches do not contain `d', so that a full listing is expected.\n\nThis works by running a directory listing program\nwhose name is in the variable `insert-directory-program'.\nIf WILDCARD, it also runs the shell specified by `shell-file-name'.\n\nWhen SWITCHES contains the long `--dired' option, this function\ntreats it specially, for the sake of dired.  However, the\nnormally equivalent short `-D' option is just passed on to\n`insert-directory-program', as any other option." #<bytecode 0x1fd4cbe79ddd>)("/home/stardiviner/Org/Wiki/Thought/Data/Manuals/My..." "--dired -al" t nil)
  ls-lisp--insert-directory(#f(compiled-function (file switches &optional wildcard full-directory-p) "Insert directory listing for FILE, formatted according to SWITCHES.\nLeaves point after the inserted text.\nSWITCHES may be a string of options, or a list of strings\nrepresenting individual options.\nOptional third arg WILDCARD means treat FILE as shell wildcard.\nOptional fourth arg FULL-DIRECTORY-P means file is a directory and\nswitches do not contain `d', so that a full listing is expected.\n\nThis works by running a directory listing program\nwhose name is in the variable `insert-directory-program'.\nIf WILDCARD, it also runs the shell specified by `shell-file-name'.\n\nWhen SWITCHES contains the long `--dired' option, this function\ntreats it specially, for the sake of dired.  However, the\nnormally equivalent short `-D' option is just passed on to\n`insert-directory-program', as any other option." #<bytecode 0x1fd4cbe79ddd>) "/home/stardiviner/Org/Wiki/Thought/Data/Manuals/My..." "--dired -al" t nil)
  apply(ls-lisp--insert-directory #f(compiled-function (file switches &optional wildcard full-directory-p) "Insert directory listing for FILE, formatted according to SWITCHES.\nLeaves point after the inserted text.\nSWITCHES may be a string of options, or a list of strings\nrepresenting individual options.\nOptional third arg WILDCARD means treat FILE as shell wildcard.\nOptional fourth arg FULL-DIRECTORY-P means file is a directory and\nswitches do not contain `d', so that a full listing is expected.\n\nThis works by running a directory listing program\nwhose name is in the variable `insert-directory-program'.\nIf WILDCARD, it also runs the shell specified by `shell-file-name'.\n\nWhen SWITCHES contains the long `--dired' option, this function\ntreats it specially, for the sake of dired.  However, the\nnormally equivalent short `-D' option is just passed on to\n`insert-directory-program', as any other option." #<bytecode 0x1fd4cbe79ddd>) ("/home/stardiviner/Org/Wiki/Thought/Data/Manuals/My..." "--dired -al" t nil))
  insert-directory("/home/stardiviner/Org/Wiki/Thought/Data/Manuals/My..." "--dired -al" t nil)
  dired-insert-directory("/home/stardiviner/Org/Wiki/Thought/Data/Manuals/My..." "-al" nil t t)
  dired-readin-insert()
  dired-readin()
  dired-internal-noselect("~/Org/Wiki/Thought/Data/Manuals/My Thought Manuals..." nil)
  dired-noselect("~/Org/Wiki/Thought/Data/Manuals/My Thought Manuals..." nil)
  #f(compiled-function (dirname &optional switches) "\"Edit\" directory DIRNAME--delete, rename, print, etc. some files in it.\nOptional second argument SWITCHES specifies the `ls' options used.\n(Interactively, use a prefix argument to be able to specify SWITCHES.)\n\nIf DIRNAME is a string, Dired displays a list of files in DIRNAME (which\nmay also have shell wildcards appended to select certain files).\n\nIf DIRNAME is a cons, its first element is taken as the directory name\nand the rest as an explicit list of files to make directory entries for.\nIn this case, SWITCHES are applied to each of the files separately, and\ntherefore switches that control the order of the files in the produced\nlisting have no effect.\n\n\\<dired-mode-map>You can flag files for deletion with \\[dired-flag-file-deletion] and then\ndelete them by typing \\[dired-do-flagged-delete].\nType \\[describe-mode] after entering Dired for more info.\n\nIf DIRNAME is already in a Dired buffer, that buffer is used without refresh." (interactive (dired-read-dir-and-switches "")) #<bytecode 0x155ef9d2f645>)("~/Org/Wiki/Thought/Data/Manuals/My Thought Manuals..." nil)
  ls-lisp--dired(#f(compiled-function (dirname &optional switches) "\"Edit\" directory DIRNAME--delete, rename, print, etc. some files in it.\nOptional second argument SWITCHES specifies the `ls' options used.\n(Interactively, use a prefix argument to be able to specify SWITCHES.)\n\nIf DIRNAME is a string, Dired displays a list of files in DIRNAME (which\nmay also have shell wildcards appended to select certain files).\n\nIf DIRNAME is a cons, its first element is taken as the directory name\nand the rest as an explicit list of files to make directory entries for.\nIn this case, SWITCHES are applied to each of the files separately, and\ntherefore switches that control the order of the files in the produced\nlisting have no effect.\n\n\\<dired-mode-map>You can flag files for deletion with \\[dired-flag-file-deletion] and then\ndelete them by typing \\[dired-do-flagged-delete].\nType \\[describe-mode] after entering Dired for more info.\n\nIf DIRNAME is already in a Dired buffer, that buffer is used without refresh." (interactive (dired-read-dir-and-switches "")) #<bytecode 0x155ef9d2f645>) "~/Org/Wiki/Thought/Data/Manuals/My Thought Manuals...")
  apply(ls-lisp--dired #f(compiled-function (dirname &optional switches) "\"Edit\" directory DIRNAME--delete, rename, print, etc. some files in it.\nOptional second argument SWITCHES specifies the `ls' options used.\n(Interactively, use a prefix argument to be able to specify SWITCHES.)\n\nIf DIRNAME is a string, Dired displays a list of files in DIRNAME (which\nmay also have shell wildcards appended to select certain files).\n\nIf DIRNAME is a cons, its first element is taken as the directory name\nand the rest as an explicit list of files to make directory entries for.\nIn this case, SWITCHES are applied to each of the files separately, and\ntherefore switches that control the order of the files in the produced\nlisting have no effect.\n\n\\<dired-mode-map>You can flag files for deletion with \\[dired-flag-file-deletion] and then\ndelete them by typing \\[dired-do-flagged-delete].\nType \\[describe-mode] after entering Dired for more info.\n\nIf DIRNAME is already in a Dired buffer, that buffer is used without refresh." (interactive (dired-read-dir-and-switches "")) #<bytecode 0x155ef9d2f645>) "~/Org/Wiki/Thought/Data/Manuals/My Thought Manuals...")
  dired("~/Org/Wiki/Thought/Data/Manuals/My Thought Manuals...")
  (if (string-match "[*?{]" (file-name-nondirectory path)) (dired path) (let* ((option (and (string-match "::\\(.*\\)\\'" path) (match-string 1 path))) (path (if (not option) path (substring path 0 (match-beginning 0))))) (apply #'org-open-file path arg (cond ((not option) nil) ((string-match-p "\\`[0-9]+\\'" option) (list (string-to-number option))) (t (list nil option))))))
  org-link-open-as-file("~/Org/Wiki/Thought/Data/Manuals/My Thought Manuals..." nil)
  (let* ((option (org-element-property :search-option link)) (path (if option (concat path "::" option) path))) (org-link-open-as-file path (let* ((val (org-element-property :application link))) (cond (arg arg) ((equal val '"emacs") 'emacs) ((equal val '"sys") 'system) (t nil)))))
  (cond ((equal type '"file") (let* ((option (org-element-property :search-option link)) (path (if option (concat path "::" option) path))) (org-link-open-as-file path (let* ((val (org-element-property :application link))) (cond (arg arg) ((equal val ...) 'emacs) ((equal val ...) 'system) (t nil)))))) ((member type '("radio" "fuzzy" "custom-id" "coderef")) (if (run-hook-with-args-until-success 'org-open-link-functions path) nil (if (not arg) (org-mark-ring-push) (switch-to-buffer-other-window (org-link--buffer-for-internals))) (let ((destination (save-excursion (save-restriction ... ... ...)))) (if (and (<= (point-min) destination) (>= (point-max) destination)) nil (widen)) (goto-char destination)))) (t (let ((f (org-link-get-parameter type :follow))) (if (functionp f) (progn (condition-case nil (funcall (org-link-get-parameter type :follow) path arg) (wrong-number-of-arguments (funcall ... path))))))))
  (let ((type (org-element-property :type link)) (path (org-element-property :path link))) (cond ((equal type '"file") (let* ((option (org-element-property :search-option link)) (path (if option (concat path "::" option) path))) (org-link-open-as-file path (let* ((val ...)) (cond (arg arg) (... ...) (... ...) (t nil)))))) ((member type '("radio" "fuzzy" "custom-id" "coderef")) (if (run-hook-with-args-until-success 'org-open-link-functions path) nil (if (not arg) (org-mark-ring-push) (switch-to-buffer-other-window (org-link--buffer-for-internals))) (let ((destination (save-excursion ...))) (if (and (<= ... destination) (>= ... destination)) nil (widen)) (goto-char destination)))) (t (let ((f (org-link-get-parameter type :follow))) (if (functionp f) (progn (condition-case nil (funcall ... path arg) (wrong-number-of-arguments ...))))))))
  org-link-open((link (:type "file" :path "~/Org/Wiki/Thought/Data/Manuals/My Thought Manuals..." :format bracket :raw-link "file:~/Org/Wiki/Thought/Data/Manuals/My Thought Ma..." :application nil :search-option "*厉害的人是怎么分析问题的?" :begin 401398 :end 401511 :contents-begin 401496 :contents-end 401509 :post-blank 0 :parent (paragraph (:begin 401398 :end 401513 :contents-begin 401398 :contents-end 401512 :post-blank 1 :post-affiliated 401398 :parent nil)))) nil)
  (cond ((not type) (user-error "No link found")) ((memq type '(comment comment-block node-property keyword)) (call-interactively #'org-open-at-point-global)) ((memq type '(headline inlinetask)) (org-match-line org-complex-heading-regexp) (let ((tags-beg (match-beginning 5)) (tags-end (match-end 5))) (if (and tags-beg (>= (point) tags-beg) (< (point) tags-end)) (org-tags-view arg (save-excursion (let* (... ...) (buffer-substring ... ...)))) (let* ((val (org-offer-links-in-entry ... ... arg))) (if (consp val) (let* (...) (if ... ... ...)) nil))))) ((or (eq type 'footnote-reference) (and (eq type 'footnote-definition) (save-excursion (skip-chars-forward " \11") (let ((begin ...)) (if begin (< ... begin) (= ... ...)))))) (org-footnote-action)) ((and (eq type 'planning) (org-in-regexp org-ts-regexp-both nil t)) (org-follow-timestamp-link)) ((and (eq type 'clock) value (>= (point) (org-element-property :begin value)) (<= (point) (org-element-property :end value))) (org-follow-timestamp-link)) ((eq type 'src-block) (org-babel-open-src-block-result)) ((>= (point) (save-excursion (goto-char (org-element-property :end context)) (skip-chars-backward " \11") (point))) (user-error "No link found")) ((eq type 'inline-src-block) (org-babel-open-src-block-result)) ((eq type 'timestamp) (org-follow-timestamp-link)) ((eq type 'link) (org-link-open context arg)) (t (user-error "No link found")))
  (let* ((context (org-element-lineage (org-element-context) '(clock comment comment-block footnote-definition footnote-reference headline inline-src-block inlinetask keyword link node-property planning src-block timestamp) t)) (type (org-element-type context)) (value (org-element-property :value context))) (cond ((not type) (user-error "No link found")) ((memq type '(comment comment-block node-property keyword)) (call-interactively #'org-open-at-point-global)) ((memq type '(headline inlinetask)) (org-match-line org-complex-heading-regexp) (let ((tags-beg (match-beginning 5)) (tags-end (match-end 5))) (if (and tags-beg (>= (point) tags-beg) (< (point) tags-end)) (org-tags-view arg (save-excursion (let* ... ...))) (let* ((val ...)) (if (consp val) (let* ... ...) nil))))) ((or (eq type 'footnote-reference) (and (eq type 'footnote-definition) (save-excursion (skip-chars-forward " \11") (let (...) (if begin ... ...))))) (org-footnote-action)) ((and (eq type 'planning) (org-in-regexp org-ts-regexp-both nil t)) (org-follow-timestamp-link)) ((and (eq type 'clock) value (>= (point) (org-element-property :begin value)) (<= (point) (org-element-property :end value))) (org-follow-timestamp-link)) ((eq type 'src-block) (org-babel-open-src-block-result)) ((>= (point) (save-excursion (goto-char (org-element-property :end context)) (skip-chars-backward " \11") (point))) (user-error "No link found")) ((eq type 'inline-src-block) (org-babel-open-src-block-result)) ((eq type 'timestamp) (org-follow-timestamp-link)) ((eq type 'link) (org-link-open context arg)) (t (user-error "No link found"))))
  (if (run-hook-with-args-until-success 'org-open-at-point-functions) nil (let* ((context (org-element-lineage (org-element-context) '(clock comment comment-block footnote-definition footnote-reference headline inline-src-block inlinetask keyword link node-property planning src-block timestamp) t)) (type (org-element-type context)) (value (org-element-property :value context))) (cond ((not type) (user-error "No link found")) ((memq type '(comment comment-block node-property keyword)) (call-interactively #'org-open-at-point-global)) ((memq type '(headline inlinetask)) (org-match-line org-complex-heading-regexp) (let ((tags-beg (match-beginning 5)) (tags-end (match-end 5))) (if (and tags-beg (>= ... tags-beg) (< ... tags-end)) (org-tags-view arg (save-excursion ...)) (let* (...) (if ... ... nil))))) ((or (eq type 'footnote-reference) (and (eq type 'footnote-definition) (save-excursion (skip-chars-forward " \11") (let ... ...)))) (org-footnote-action)) ((and (eq type 'planning) (org-in-regexp org-ts-regexp-both nil t)) (org-follow-timestamp-link)) ((and (eq type 'clock) value (>= (point) (org-element-property :begin value)) (<= (point) (org-element-property :end value))) (org-follow-timestamp-link)) ((eq type 'src-block) (org-babel-open-src-block-result)) ((>= (point) (save-excursion (goto-char (org-element-property :end context)) (skip-chars-backward " \11") (point))) (user-error "No link found")) ((eq type 'inline-src-block) (org-babel-open-src-block-result)) ((eq type 'timestamp) (org-follow-timestamp-link)) ((eq type 'link) (org-link-open context arg)) (t (user-error "No link found")))))
  org-open-at-point(nil)
  funcall-interactively(org-open-at-point nil)
  call-interactively(org-open-at-point nil nil)
  command-execute(org-open-at-point)
#+end_example

I remember I saw some commit has diff on this change, but when I grepped on git log, I can't find them...

- -- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      
-----BEGIN PGP SIGNATURE-----

iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5Tb3AUHG51bWJjaGls
ZEBnbWFpbC5jb20ACgkQG13xyVromsN62Qf/UjunbVY8MFwQ8kdq+iitDNERskm9
hPNEEAH1uV0HKdg5n3UvIuySPntxPtzvQPQQdT0ADMun8sN4sbkEX3wKJ5wz8qkb
kd7ia3hpAW139mhaXqcbnhbibtM280nwRjbsomK4uEIN/mNmrnxjw/qqvj9cSlmk
Vo2ELa54lZcaA67oPQAiLrFWcgN9c1DQOx7Ip4sgEamLUmns1i0DF4k94QmvxKsQ
r5CAiEfw4BBmDZA91qzIPGLTZYfjxXhJITm3V8Z60n/Qug9bg4HBGAe62R96XoVr
+TdfFFGXin9dp1b61wtkvhCfsWHBeylukqBgcHnAocJIAPa6J4vOv0N0cQ==
=CBYb
-----END PGP SIGNATURE-----

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

end of thread, other threads:[~2020-02-25 19:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-24  6:38 [BUG] Recently master branch commit breaks open file: link stardiviner
2020-02-24  8:41 ` Bastien
2020-02-24 12:06   ` stardiviner
2020-02-24 12:15     ` Bastien
2020-02-24 15:09       ` stardiviner
2020-02-24 20:30         ` Bastien
2020-02-24 20:35         ` Document backward-incompatible change in ORG-NEWS? (was: [BUG] Recently master branch commit breaks open file: link) Bastien
2020-02-24 21:31           ` Samuel Wales
2020-02-25  7:02             ` stardiviner
2020-02-25  9:10           ` Document backward-incompatible change in ORG-NEWS? Nicolas Goaziou
2020-02-25 19:34             ` Bastien

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).