From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: [BUG] Recently master branch commit breaks open file: link Date: Mon, 24 Feb 2020 14:38:40 +0800 Message-ID: <87o8tofq1b.fsf@gmail.com> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:47194) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j67OV-0005qj-13 for emacs-orgmode@gnu.org; Mon, 24 Feb 2020 01:39:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j67OS-0005kS-AL for emacs-orgmode@gnu.org; Mon, 24 Feb 2020 01:39:06 -0500 Received: from [183.249.128.110] (port=12993 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j67OQ-0005g7-D6 for emacs-orgmode@gnu.org; Mon, 24 Feb 2020 01:39:04 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: Org Mode =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 When I open a link like this: #+begin_src org [[file:~/Org/Tasks/Computer Todos.org::*TODO =E5=8E=89=E5=AE=B3=E7=9A=84=E4= =BA=BA=E6=98=AF=E6=80=8E=E4=B9=88=E5=88=86=E6=9E=90=E9=97=AE=E9=A2=98=E7=9A= =84=EF=BC=9F][=E5=8E=89=E5=AE=B3=E7=9A=84=E4=BA=BA=E6=98=AF=E6=80=8E=E4=B9= =88=E5=88=86=E6=9E=90=E9=97=AE=E9=A2=98=E7=9A=84=EF=BC=9F]] #+end_src I =3D[M-x toggle-debug-on-error]=3D got following stacktrace: #+begin_example Debugger entered--Lisp error: (file-missing "Reading directory" "No such fi= le or directory" "/home/stardiviner/Org/Wiki/Thought/Data/Manuals/My...") access-file("/home/stardiviner/Org/Wiki/Thought/Data/Manuals/My..." "Read= ing directory") #f(compiled-function (file switches &optional wildcard full-directory-p) = "Insert directory listing for FILE, formatted according to SWITCHES.\nLeave= s point after the inserted text.\nSWITCHES may be a string of options, or a= list of strings\nrepresenting individual options.\nOptional third arg WILD= CARD means treat FILE as shell wildcard.\nOptional fourth arg FULL-DIRECTOR= Y-P means file is a directory and\nswitches do not contain `d', so that a f= ull listing is expected.\n\nThis works by running a directory listing progr= am\nwhose name is in the variable `insert-directory-program'.\nIf WILDCARD,= it also runs the shell specified by `shell-file-name'.\n\nWhen SWITCHES co= ntains the long `--dired' option, this function\ntreats it specially, for t= he sake of dired. However, the\nnormally equivalent short `-D' option is j= ust passed on to\n`insert-directory-program', as any other option." #)("/home/stardiviner/Org/Wiki/Thought/Data/Manuals/My...= " "--dired -al" t nil) ls-lisp--insert-directory(#f(compiled-function (file switches &optional w= ildcard full-directory-p) "Insert directory listing for FILE, formatted acc= ording 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.\nOptiona= l fourth arg FULL-DIRECTORY-P means file is a directory and\nswitches do no= t 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-directo= ry-program'.\nIf WILDCARD, it also runs the shell specified by `shell-file-= name'.\n\nWhen SWITCHES contains the long `--dired' option, this function\n= treats it specially, for the sake of dired. However, the\nnormally equival= ent short `-D' option is just passed on to\n`insert-directory-program', as = any other option." #) "/home/stardiviner/Org/Wiki/= Thought/Data/Manuals/My..." "--dired -al" t nil) apply(ls-lisp--insert-directory #f(compiled-function (file switches &opti= onal wildcard full-directory-p) "Insert directory listing for FILE, formatt= ed according to SWITCHES.\nLeaves point after the inserted text.\nSWITCHES = may be a string of options, or a list of strings\nrepresenting individual o= ptions.\nOptional third arg WILDCARD means treat FILE as shell wildcard.\nO= ptional 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 r= unning a directory listing program\nwhose name is in the variable `insert-d= irectory-program'.\nIf WILDCARD, it also runs the shell specified by `shell= -file-name'.\n\nWhen SWITCHES contains the long `--dired' option, this func= tion\ntreats it specially, for the sake of dired. However, the\nnormally e= quivalent short `-D' option is just passed on to\n`insert-directory-program= ', as any other option." #) ("/home/stardiviner/Or= g/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/M= y..." "-al" nil t t) dired-readin-insert() dired-readin() dired-internal-noselect("~/Org/Wiki/Thought/Data/Manuals/My Thought Manua= ls..." nil) dired-noselect("~/Org/Wiki/Thought/Data/Manuals/My Thought Manuals..." ni= l) #f(compiled-function (dirname &optional switches) "\"Edit\" directory DIR= NAME--delete, rename, print, etc. some files in it.\nOptional second argume= nt 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 a= ppended to select certain files).\n\nIf DIRNAME is a cons, its first elemen= t 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\\Yo= u can flag files for deletion with \\[dired-flag-file-deletion] and then\nd= elete them by typing \\[dired-do-flagged-delete].\nType \\[describe-mode] a= fter entering Dired for more info.\n\nIf DIRNAME is already in a Dired buff= er, that buffer is used without refresh." (interactive (dired-read-dir-and-= switches "")) #)("~/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.\nOptiona= l 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 sh= ell wildcards appended to select certain files).\n\nIf DIRNAME is a cons, i= ts first element is taken as the directory name\nand the rest as an explici= t list of files to make directory entries for.\nIn this case, SWITCHES are = applied to each of the files separately, and\ntherefore switches that contr= ol the order of the files in the produced\nlisting have no effect.\n\n\\You can flag files for deletion with \\[dired-flag-file-deleti= on] and then\ndelete them by typing \\[dired-do-flagged-delete].\nType \\[d= escribe-mode] after entering Dired for more info.\n\nIf DIRNAME is already = in a Dired buffer, that buffer is used without refresh." (interactive (dire= d-read-dir-and-switches "")) #) "~/Org/Wiki/Though= t/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.\nO= ptional second argument SWITCHES specifies the `ls' options used.\n(Interac= tively, use a prefix argument to be able to specify SWITCHES.)\n\nIf DIRNAM= E is a string, Dired displays a list of files in DIRNAME (which\nmay also h= ave shell wildcards appended to select certain files).\n\nIf DIRNAME is a c= ons, its first element is taken as the directory name\nand the rest as an e= xplicit list of files to make directory entries for.\nIn this case, SWITCHE= S 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\\You can flag files for deletion with \\[dired-flag-file-= deletion] and then\ndelete them by typing \\[dired-do-flagged-delete].\nTyp= e \\[describe-mode] after entering Dired for more info.\n\nIf DIRNAME is al= ready in a Dired buffer, that buffer is used without refresh." (interactive= (dired-read-dir-and-switches "")) #) "~/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) (le= t* ((option (and (string-match "::\\(.*\\)\\'" path) (match-string 1 path))= ) (path (if (not option) path (substring path 0 (match-beginning 0))))) (ap= ply #'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 opti= on (concat path "::" option) path))) (org-link-open-as-file path (let* ((va= l (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))) (c= ond (arg arg) ((equal val ...) 'emacs) ((equal val ...) 'system) (t nil))))= )) ((member type '("radio" "fuzzy" "custom-id" "coderef")) (if (run-hook-wi= th-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-inter= nals))) (let ((destination (save-excursion (save-restriction ... ... ...)))= ) (if (and (<=3D (point-min) destination) (>=3D (point-max) destination)) n= il (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 (func= all ... path)))))))) (let ((type (org-element-property :type link)) (path (org-element-propert= y :path link))) (cond ((equal type '"file") (let* ((option (org-element-pro= perty :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" "codere= f")) (if (run-hook-with-args-until-success 'org-open-link-functions path) n= il (if (not arg) (org-mark-ring-push) (switch-to-buffer-other-window (org-l= ink--buffer-for-internals))) (let ((destination (save-excursion ...))) (if = (and (<=3D ... destination) (>=3D ... destination)) nil (widen)) (goto-char= destination)))) (t (let ((f (org-link-get-parameter type :follow))) (if (f= unctionp 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/D= ata/Manuals/My Thought Ma..." :application nil :search-option "*=E5=8E=89= =E5=AE=B3=E7=9A=84=E4=BA=BA=E6=98=AF=E6=80=8E=E4=B9=88=E5=88=86=E6=9E=90=E9= =97=AE=E9=A2=98=E7=9A=84=EF=BC=9F" :begin 401398 :end 401511 :contents-begi= n 401496 :contents-end 401509 :post-blank 0 :parent (paragraph (:begin 4013= 98 :end 401513 :contents-begin 401398 :contents-end 401512 :post-blank 1 :p= ost-affiliated 401398 :parent nil)))) nil) (cond ((not type) (user-error "No link found")) ((memq type '(comment com= ment-block node-property keyword)) (call-interactively #'org-open-at-point-= global)) ((memq type '(headline inlinetask)) (org-match-line org-complex-he= ading-regexp) (let ((tags-beg (match-beginning 5)) (tags-end (match-end 5))= ) (if (and tags-beg (>=3D (point) tags-beg) (< (point) tags-end)) (org-tags= -view arg (save-excursion (let* (... ...) (buffer-substring ... ...)))) (le= t* ((val (org-offer-links-in-entry ... ... arg))) (if (consp val) (let* (..= .) (if ... ... ...)) nil))))) ((or (eq type 'footnote-reference) (and (eq t= ype 'footnote-definition) (save-excursion (skip-chars-forward " \11") (let = ((begin ...)) (if begin (< ... begin) (=3D ... ...)))))) (org-footnote-acti= on)) ((and (eq type 'planning) (org-in-regexp org-ts-regexp-both nil t)) (o= rg-follow-timestamp-link)) ((and (eq type 'clock) value (>=3D (point) (org-= element-property :begin value)) (<=3D (point) (org-element-property :end va= lue))) (org-follow-timestamp-link)) ((eq type 'src-block) (org-babel-open-s= rc-block-result)) ((>=3D (point) (save-excursion (goto-char (org-element-pr= operty :end context)) (skip-chars-backward " \11") (point))) (user-error "N= o link found")) ((eq type 'inline-src-block) (org-babel-open-src-block-resu= lt)) ((eq type 'timestamp) (org-follow-timestamp-link)) ((eq type 'link) (o= rg-link-open context arg)) (t (user-error "No link found"))) (let* ((context (org-element-lineage (org-element-context) '(clock commen= t 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 co= ntext))) (cond ((not type) (user-error "No link found")) ((memq type '(comm= ent comment-block node-property keyword)) (call-interactively #'org-open-at= -point-global)) ((memq type '(headline inlinetask)) (org-match-line org-com= plex-heading-regexp) (let ((tags-beg (match-beginning 5)) (tags-end (match-= end 5))) (if (and tags-beg (>=3D (point) tags-beg) (< (point) tags-end)) (o= rg-tags-view arg (save-excursion (let* ... ...))) (let* ((val ...)) (if (co= nsp val) (let* ... ...) nil))))) ((or (eq type 'footnote-reference) (and (e= q type 'footnote-definition) (save-excursion (skip-chars-forward " \11") (l= et (...) (if begin ... ...))))) (org-footnote-action)) ((and (eq type 'plan= ning) (org-in-regexp org-ts-regexp-both nil t)) (org-follow-timestamp-link)= ) ((and (eq type 'clock) value (>=3D (point) (org-element-property :begin v= alue)) (<=3D (point) (org-element-property :end value))) (org-follow-timest= amp-link)) ((eq type 'src-block) (org-babel-open-src-block-result)) ((>=3D = (point) (save-excursion (goto-char (org-element-property :end context)) (sk= ip-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 c= omment-block footnote-definition footnote-reference headline inline-src-blo= ck inlinetask keyword link node-property planning src-block timestamp) t)) = (type (org-element-type context)) (value (org-element-property :value conte= xt))) (cond ((not type) (user-error "No link found")) ((memq type '(comment= comment-block node-property keyword)) (call-interactively #'org-open-at-po= int-global)) ((memq type '(headline inlinetask)) (org-match-line org-comple= x-heading-regexp) (let ((tags-beg (match-beginning 5)) (tags-end (match-end= 5))) (if (and tags-beg (>=3D ... tags-beg) (< ... tags-end)) (org-tags-vie= w arg (save-excursion ...)) (let* (...) (if ... ... nil))))) ((or (eq type = 'footnote-reference) (and (eq type 'footnote-definition) (save-excursion (s= kip-chars-forward " \11") (let ... ...)))) (org-footnote-action)) ((and (eq= type 'planning) (org-in-regexp org-ts-regexp-both nil t)) (org-follow-time= stamp-link)) ((and (eq type 'clock) value (>=3D (point) (org-element-proper= ty :begin value)) (<=3D (point) (org-element-property :end value))) (org-fo= llow-timestamp-link)) ((eq type 'src-block) (org-babel-open-src-block-resul= t)) ((>=3D (point) (save-excursion (goto-char (org-element-property :end co= ntext)) (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 c= ontext 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... =2D --=20 [ 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 =20=20=20=20=20=20 =2D----BEGIN PGP SIGNATURE----- iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5Tb3AUHG51bWJjaGls ZEBnbWFpbC5jb20ACgkQG13xyVromsN62Qf/UjunbVY8MFwQ8kdq+iitDNERskm9 hPNEEAH1uV0HKdg5n3UvIuySPntxPtzvQPQQdT0ADMun8sN4sbkEX3wKJ5wz8qkb kd7ia3hpAW139mhaXqcbnhbibtM280nwRjbsomK4uEIN/mNmrnxjw/qqvj9cSlmk Vo2ELa54lZcaA67oPQAiLrFWcgN9c1DQOx7Ip4sgEamLUmns1i0DF4k94QmvxKsQ r5CAiEfw4BBmDZA91qzIPGLTZYfjxXhJITm3V8Z60n/Qug9bg4HBGAe62R96XoVr +TdfFFGXin9dp1b61wtkvhCfsWHBeylukqBgcHnAocJIAPa6J4vOv0N0cQ=3D=3D =3DCBYb =2D----END PGP SIGNATURE-----