mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-23 07:18:53 +00:00
Fixing function call-style source block arguments.
style syntax. There still needs to be work done on the regexps for recognising #+srcname lines possibly with/without parenthesised arguments. This change makes org-babel-block-name return nil rather than fail when it doesn't find a src block head (e.g. in a #+lob line), which seems sensible. The sbe test table is failing half-way down at `simple ruby arrays'. For some reason it is making a mini table ("| |") to the right hand, and point keeps jumping out of the table. My ability to debug sbe-related stuff is hampered by me not understanding the code (I need to learn about macros).
This commit is contained in:
parent
41381781bb
commit
eb7206f744
@ -108,7 +108,7 @@ return nil."
|
||||
(if (let ((result_regexp (concat "^#\\+\\(TBL\\|RES\\)NAME:[ \t]*"
|
||||
(regexp-quote ref) "[ \t]*$"))
|
||||
(regexp (concat "^#\\+SRCNAME:[ \t]*"
|
||||
(regexp-quote ref) "[ \t]*$")))
|
||||
(regexp-quote ref) "\\(\(.*\)\\)?" "[ \t]*$")))
|
||||
(or (re-search-forward result_regexp nil t)
|
||||
(re-search-forward result_regexp nil t)
|
||||
(re-search-forward regexp nil t)
|
||||
|
@ -256,12 +256,15 @@ replaced, and may need to be reinstated in this function. "
|
||||
|
||||
(defun org-babel-get-src-block-name ()
|
||||
"Return the name of the current source block if one exists"
|
||||
(let ((case-fold-search t))
|
||||
(save-excursion
|
||||
(goto-char (org-babel-where-is-src-block-head))
|
||||
(if (save-excursion (forward-line -1)
|
||||
(looking-at "#\\+srcname:[ \f\t\n\r\v]*\\([^ \f\t\n\r\v]+\\)\(\\(.*\\)\)"))
|
||||
(org-babel-clean-text-properties (match-string 1))))))
|
||||
(let ((case-fold-search t)
|
||||
(head (org-babel-where-is-src-block-head)))
|
||||
(when head
|
||||
(save-excursion
|
||||
(goto-char head)
|
||||
(if (save-excursion
|
||||
(forward-line -1)
|
||||
(looking-at "#\\+srcname:[ \f\t\n\r\v]*\\([^ \f\t\n\r\v]+\\)\(\\(.*\\)\)"))
|
||||
(org-babel-clean-text-properties (match-string 1)))))))
|
||||
|
||||
(defun org-babel-get-src-block-info ()
|
||||
"Return the information of the current source block as a list
|
||||
|
Loading…
Reference in New Issue
Block a user