[BUG] org-babel-result-to-file failed when buffer is narrowed [9.7 (9.7-??-f7aa8c1 @ c:/Users/yhht/.config/emacs/.local/straight/build-29.0.60/org/)]

2023-07-14 Thread
Remember to cover the basics, that is, what you expected to happen and 

what in fact did happen. You don't know how to make a good report? See
 https://orgmode.org/manual/Feedback.html#Feedback
Your bug report will be posted to the Org mailing list.

When I try to execute ob-block in a narrowed buffer, there seems to have
a error on org-babel-result-to-file, with msg "wrong argument type
stringp, nil"
As I look into this function:
(defun org-babel-result-to-file (result  description type)
  "Convert RESULT into an Org link with optional DESCRIPTION.
If the `default-directory' is different from the containing
file's directory then expand relative links.
   
If the optional TYPE is passed as `attachment' and the path is a
descendant of the DEFAULT-DIRECTORY, the generated link will be
specified as an an \"attachment:\" style link."
  (when (stringp result)
(let* ((result-file-name (expand-file-name result))
   (base-file-name (buffer-file-name (buffer-base-buffer)))
-2-> (base-directory (and buffer-file-name
(file-name-directory base-file-name)))
   (same-directory?
 (and base-file-name
  (not (string= (expand-file-name default-directory)
-1-> (expand-file-name
   base-directory)
the error line is marked as -1->
and the reason is at line marked as -2->, which "buffer-file-name" would
be nil when in narrowed buffer. I wonder if "buffer-file-name" should be
"base-file-name" here. Anyway, after that change, this issue go away.
Emacs : GNU Emacs 29.0.60 (build 1, x86_64-w64-mingw32)
 of 2023-03-11
Package: Org mode version 9.7 (9.7-??-f7aa8c1 @ 
c:/Users/yhht/.config/emacs/.local/straight/build-29.0.60/org/)




| |
赵一宇
|
|
zhy...@163.com
|

[BUG] after execute +org-realign-table-maybe-h may move point [9.6 (9.6-??-bed47b4 @ c:/Users/yhht/.emacs.d/.local/straight/build-28.2/org/)]

2023-03-09 Thread
+org-realign-table-maybe-h function definition is at the end. 

Instead of using save-excursion macro, it saves current point to a var,
and restore the point after execute org-table-align.
That would cause point move visually. Although the (point) value not changed, 
org-table-align function shall insert  spaces in front of the point. 
Don't know if it has already fixed, or there are some other concerns.
(defun +org-realign-table-maybe-h ()
  "Auto-align table under cursor."
  (when (and org-table-automatic-realign (org-at-table-p) 
org-table-may-need-update)
(let ((pt (point))
  (inhibit-message t))
  (if org-table-may-need-update (org-table-align))
  (goto-char pt
Emacs : GNU Emacs 28.2 (build 2, x86_64-w64-mingw32)
 of 2022-09-13
Package: Org mode version 9.6 (9.6-??-bed47b4 )



Re: BUG: org-sbe not working anymore: Format specifier doesn’t match argument type

2023-02-22 Thread
Here is an example, in org file


#+name: test
#+begin_src emacs-lisp :var a :results silent
a
#+end_src


Now, if I execute 
(org-sbe "test" (a "123°34'23.34\"otherthing"))
it would say: Reference 123°34'23.34"otherthing not found
and
(org-sbe "test" (a $"123°34'23.34\"otherthing"))
would result 123°34'23.34
|
|


|
|
zhy...@163.com
|
 Replied Message 
| From | Ihor Radchenko |
| Date | 2/22/2023 21:57 |
| To | 赵一宇 |
| Cc | mick.da...@gmail.com ,
orgm...@tec.tecosaur.net ,
emacs-orgmode@gnu.org |
| Subject | Re: BUG: org-sbe not working anymore: Format specifier doesn’t 
match argument type |
赵一宇  writes:

However, I wanna figure out if another change would somehow fix another 
problem, when in the (var value) pair, the value contains quotation marks, for 
example 123°34'23.34", the assignment would fail.

Could you please provide a reproducer?

--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


Re: BUG: org-sbe not working anymore: Format specifier doesn’t match argument type

2023-02-22 Thread
Oh thanks, that was clear.
However, I wanna figure out if another change would somehow fix another 
problem, when in the (var value) pair, the value contains quotation marks, for 
example 123°34'23.34", the assignment would fail.


In macro she-org,
change
(quote (format "\"%s\"" el))
to
(quote (format "%S" el))


Now I can use the $ prefix to assign the string value.


|
zhy...@163.com
|
 Replied Message 
| From | Ihor Radchenko |
| Date | 2/22/2023 19:18 |
| To | zhaoyiyu |
| Cc | Michael Dauer ,
Timothy ,
 |
| Subject | Re: BUG: org-sbe not working anymore: Format specifier doesn’t 
match argument type |

zhaoyiyu  writes:
Maybe change the org-sbe macro? Below is a workaround.

Sorry, I was not clear.
This bug has been fixed.
I can no longer reproduce it.

--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at