Re: [O] error on make
Hello, Giri Prashanth writes: > I got the following error while I ran make on latest org-mode code from git > got from git://orgmode.org/org-mode.git in OS X: > > rm -f > /Applications/Xcode.app/Contents/Developer/usr/bin/make -C lisp clean > rm -f org-version.el org-loaddefs.el org-version.elc org-loaddefs.elc > org-install.elc > rm -f *.elc > /Applications/Xcode.app/Contents/Developer/usr/bin/make -C lisp autoloads > rm -f org-version.el org-loaddefs.el org-version.elc org-loaddefs.elc > org-install.elc > org-version: 8.3.5 (release_8.3.5-1027-g04e0bc) > Loading ~/.emacs.d/org-mode/lisp/org-compat.el (source)... > Cannot open load file: cl-lib > make[1]: *** [org-version.el] Error 255 > make: *** [autoloads] Error 2 > > > Any ideas on how to fix ? What is your Emacs version? Development branch requires at least Emacs 24.3. Regards, -- Nicolas Goaziou
[O] Bug: 25.1; org-modify-ts-extra: Symbol’s function definition is void: signum [8.3.5 (8.3.5-elpaplus @ /home/jorge/.emacs.d/elpa/org-plus-contrib-20160725/)]
Please paste the following timestamp in an Org Mode buffer: <2016-06-10 Fri 07:40-08:50 ++1w> Try changing the minutes (not the hours) with or . I expected each key press to change the minutes by ±5min. Instead the entire timestamp is deleted and the echo area shows the following message: org-modify-ts-extra: Symbol’s function definition is void: signum I reproduced this with an Emacs session loaded with an empty init.el, from which I invoked org-submit-bug-report. Emacs : GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9) of 2016-07-25 Package: Org-mode version 8.3.5 (8.3.5-elpaplus @ /home/jorge/.emacs.d/elpa/org-plus-contrib-20160725/) current state: == (setq org-tab-first-hook '(org-hide-block-toggle-maybe org-babel-hide-result- toggle-maybe org-babel-header-arg-expand) org-speed-command-hook '(org-speed-command-default-hook org-babel-speed- command-hook) org-occur-hook '(org-first-headline-recenter) org-metaup-hook '(org-babel-load-in-session-maybe) org-confirm-shell-link-function 'yes-or-no-p org-after-todo-state-change-hook '(org-clock-out-if-current) org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode- configure-edit-buffer) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-babel-pre-tangle-hook '(save-buffer) org-mode-hook '(#[nil "\300\301\302\303\304$\207" [org-add-hook change-major- mode-hook org-show-block-all append local] 5] #[nil "\300\301\302\303\304$\207" [org-add-hook change-major- mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes org- eldoc-load) org-archive-hook '(org-attach-archive-delete-maybe) org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely- maybe) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org- cycle-show-empty-lines org-optimize-window-after-visibility-change) org-confirm-elisp-link-function 'yes-or-no-p org-metadown-hook '(org-babel-pop-to-session-maybe) org-clock-out-hook '(org-clock-remove-empty-clock-drawer) ) -- • I am Brazilian. I hope my English is correct and I welcome corrections. • Please adopt free formats like PDF, ODF, LaTeX, Opus, WebM and 7z. • Free software for Android: https://f-droid.org/
[O] error on make
Hi, I got the following error while I ran make on latest org-mode code from git got from git://orgmode.org/org-mode.git in OS X: rm -f /Applications/Xcode.app/Contents/Developer/usr/bin/make -C lisp clean rm -f org-version.el org-loaddefs.el org-version.elc org-loaddefs.elc org-install.elc rm -f *.elc /Applications/Xcode.app/Contents/Developer/usr/bin/make -C lisp autoloads rm -f org-version.el org-loaddefs.el org-version.elc org-loaddefs.elc org-install.elc org-version: 8.3.5 (release_8.3.5-1027-g04e0bc) Loading ~/.emacs.d/org-mode/lisp/org-compat.el (source)... Cannot open load file: cl-lib make[1]: *** [org-version.el] Error 255 make: *** [autoloads] Error 2 Any ideas on how to fix ? Thank you in advance.
Re: [O] pagebreak
> Uwe Brauer writes: > Can you try the attached styles.xml? I just moved the style to another > place and I get the page break (whereas I did not get it with your > original styles.xml). But I really don't know the rules: somebody else > might be able to offer some enlightenment (assuming that it even works). It works! Great thanks, so it seems important where to put In the styles.xml file Uwe
Re: [O] pagebreak
Uwe Brauer writes: >> Uwe Brauer writes: > >> Did you add the PageBreak style (mentioned in the hint on the above >> page) to your styles.xml? Check the value of org-odt-styles-dir for >> where that file is read from. > > Hm, I was not sure about that part, so first did it without a modified > styles.xml, but then I tried it with that option. It did not work > neither. Here are the steps I did. > > - first create a dummy.org file with just one line, > > - export it to dummy.odt > > - unzip the odt which results in various xml, one of them is the >file styles.xml, > > - take it as a template. > > - add to the file page.org the following line > > #+ODT_STYLES_FILE: "/home/oub/test/styles.xml" > > > - add to the file styles.xml the lines > > style:parent-style-name="Text_20_body"> > > > > > > - export page.org again. The resulting odt has *no* pagebreak. I >attach, page.org, page.odt and styles.xml. > > Can you try the attached styles.xml? I just moved the style to another place and I get the page break (whereas I did not get it with your original styles.xml). But I really don't know the rules: somebody else might be able to offer some enlightenment (assuming that it even works). http://www.w3.org/1999/xlink"; xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML"; xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office"; xmlns:ooow="http://openoffice.org/2004/writer"; xmlns:oooc="http://openoffice.org/2004/calc"; xmlns:dom="http://www.w3.org/2001/xml-events"; xmlns:rpt="http://openoffice.org/2005/report"; xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml"; xmlns:grddl="http://www.w3.org/2003/g/data-view#"; office:version="1.2"> / /
Re: [O] verse
>>> "Christian" == Christian Moe writes: > Uwe Brauer writes: >> It seems that the verse environment does what I want, it is however >> exported in a ugly font (type writer), how can I change that font. > See the manual, section 12.9.4 "Applying custom styles". That section is a very general one, I cannot find anything about the verse environment and its setting. Uwe
Re: [O] pagebreak
> Uwe Brauer writes: > Did you add the PageBreak style (mentioned in the hint on the above > page) to your styles.xml? Check the value of org-odt-styles-dir for > where that file is read from. Ok I checked that also , | | org-odt-styles-dir is a variable defined in ‘ox-odt.el’. | Its value is | "/home/oub/.emacs.d/elpa/org-plus-contrib-20160516/etc/styles/ ` So I modified the OrgOdtStyles.xml, adding again But it did not help neither regards Uwe OrgOdtStyles.xml Description: XML document
Re: [O] pagebreak
> Uwe Brauer writes: > Did you add the PageBreak style (mentioned in the hint on the above > page) to your styles.xml? Check the value of org-odt-styles-dir for > where that file is read from. Hm, I was not sure about that part, so first did it without a modified styles.xml, but then I tried it with that option. It did not work neither. Here are the steps I did. - first create a dummy.org file with just one line, - export it to dummy.odt - unzip the odt which results in various xml, one of them is the file styles.xml, - take it as a template. - add to the file page.org the following line #+ODT_STYLES_FILE: "/home/oub/test/styles.xml" - add to the file styles.xml the lines - export page.org again. The resulting odt has *no* pagebreak. I attach, page.org, page.odt and styles.xml. Uwe Brauer page.odt Description: application/vnd.oasis.opendocument.text #+ODT_STYLES_FILE: "/home/oub/test/styles.xml" * This is the header First page: #+ODT: * This is a header Second page styles.xml Description: XML document
Re: [O] [BUG] External unicode links without a description in ox-html
Hello, Michael Brand writes: >>This prevent any link with a description to contain either "]]" or > > ... a single bracket at the border or a link destination part to > contain "][" or "]]" or a single bracket at the border or ... Correct. >>multiple spaces, but these requirements are so uncommon we probably >>shouldn't bother. > > I never had such links and don't bother. If I am right these could > even be tweaked manually with %20, %5B and %5D to get working. Not really, because Org would no longer un-escape the URI. This could work for links opened with a browser, but not for other types (e.g., a target). > Do I understand right that not escaping and unescaping would allow > > : https://duckduckgo.com/?q=[dest]dest This one is already possible, isn't it? Also, I suggest to change brackets links, not plain links. > : [[https://duckduckgo.com/?q=[dest]dest]] > : [[https://duckduckgo.com/?q=[dest]dest][desc[desc]desc]] Yes, those would become valid. The following regexp could be used as a replacement for `org-bracket-link-regexp' "\\[\\[[^]+?\\(\\]\\[[^]]\\)?\\]\\]" or, with groups, "\\[\\[\\([^]+?\\)\\(?:\\]\\[\\([^]+?\\)\\)?\\]\\]" Regards, -- Nicolas Goaziou
Re: [O] orgmode aquivalent of hfill?
Hi Uwe, Uwe Brauer writes: > I am currently writing an org document which I would like later to > convert to odt. > > Moreover I want to have a structure, which in latex would look like this > > My name \hfill You name. > > So on the left margin is on element and on the right margin another with > a variable empty space between them. Can I do something like this using > the org syntax? AFAIK there's not. If you can find out what the syntax for that is in odt you can make a macro. Rasmus -- I feel emotional landscapes they puzzle me
Re: [O] error while upgrading to 8.3.5
Hello, Vikas Rawal writes: > * Output of BTEST_RE=indented-cached-org-bracket-link make test > > Test test-ob/indented-cached-org-bracket-link condition: > (ert-test-failed > ((should >(let > (...) >(org-test-with-temp-text "\n* Test\n #+BEGIN_SRC emacs-lisp > :file test.txt :cache yes\n(message \"test\")\n #+END_SRC" ... ...))) > :form > (let > ((default-directory temporary-file-directory)) > (org-test-with-temp-text "\n* Test\n #+BEGIN_SRC emacs-lisp > :file test.txt :cache yes\n(message \"test\")\n #+END_SRC" > (org-babel-execute-src-block) > (string= ... ...))) > :value nil)) >FAILED 1/1 test-ob/indented-cached-org-bracket-link This doesn't ring a bell. It would help to know what is hidden behind the ellipsis. > Ran 1 tests, 0 results as expected, 1 unexpected (2016-07-26 05:06:12+0530) > > 1 unexpected results: >FAILED test-ob/indented-cached-org-bracket-link > > * (org-parse-time-string "<2014-03-04 Tue>”) > (apply #'encode-time (org-parse-time-string "<2014-03-04 Tue>")) > > Evaluating these in emacs does not seem to do anything. No message. The return value is displayed in the minibuffer. Use C-x C-e right after the closing parens of each form. Also, did you set some weird variable like `org-extend-today-until'? Regards, -- Nicolas Goaziou
Re: [O] Bug: can't export after install org from `list-packages` [8.2.10 (release_8.2.10 @ /Users/HanYong/.emacs.d/elpa/org-20160725/)]
Hello, YongHan writes: > I install a new org from elpa. After installed, when I use `C-c > C-e h o` to export a html and open it, an error occurs. I can export > normally before I install the new version `org-20160725` [...] > Emacs : GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) > of 2015-04-11 on builder10-9.porkrind.org > Package: Org-mode version 8.2.10 (release_8.2.10 @ > /Users/Simon/.emacs.d/elpa/org-20160725/) Something is wrong above: org-20160725/ is not tagged "8.2.10" but "8.3.5". Your installation probably went wrong. See (info "(org) Installation"), in particular the "Important:" notice when "Using Emacs packaging system". If the solution above does not work, please report the error you encounter. Regards, -- Nicolas Goaziou
Re: [O] Echo heading hierarchy at point
Hello, "Roelli, Charles A" writes: > Sent this in a few days ago, and it does not seem to have gone through: > > --- > > If I have this structure, with point marked by the "$": > > * Heading Level 1 > ** Heading Level 2 > $ > > Is there a way to have the current place in the outline [Heading Level > 1 => Heading Level 2] temporarily echoed in the minibuffer? Also > important is that the point shouldn't have to be on the heading title > for it to work. See `org-display-outline-path' and `org-get-outline-path'. Regards, -- Nicolas Goaziou
[O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)
tags 23917 fixed close 23917 25.1 quit Eli Zaretskii writes: >> From: npost...@users.sourceforge.net >> Cc: 23...@debbugs.gnu.org, nljlistb...@gmail.com, jwieg...@gmail.com, >> rpl...@gmail.com, monn...@iro.umontreal.ca, alex.ben...@linaro.org >> Date: Thu, 21 Jul 2016 21:08:43 -0400 >> >> I made the same adjustments to the saved sub_start and sub_end >> variables, but I had a mistake in that adjustment which caused the false >> positives. Fixed in the attached v2 patch. We could just drop the >> check, though I've already found it useful to catch bugs >> (https://github.com/joaotavora/yasnippet/issues/720). >> >> If I drop the checks (see attached v3 patch), then after following the >> bug#23869 recipe, I get: >> >> ## -*- Octave -*- >> -module(bug). >> -export([identity/1, is_even/1, size/1, reverse/1]). > > OK, let's wait for a few days to give time to the people who were > affected by the issue to test the patch, and if no new issues come up, > please push the version with the error code to emacs-25. Since they've now reported that the new patch is working well, I've pushed it as e1def617.
Re: [O] Patch: default CSS class for SVG images in HTML export
Hello, Jarmo Hurri writes: > Please see attachment. Applied. Thank you! Regards, -- Nicolas Goaziou
[O] Bug: can't export after install org from `list-packages` [8.2.10 (release_8.2.10 @ /Users/HanYong/.emacs.d/elpa/org-20160725/)]
I install a new org from elpa. After installed, when I use `C-c C-e h o` to export a html and open it, an error occurs. I can export normally before I install the new version `org-20160725` 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 http://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org-mode mailing list. Emacs : GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 2015-04-11 on builder10-9.porkrind.org Package: Org-mode version 8.2.10 (release_8.2.10 @ /Users/Simon/.emacs.d/elpa/org-20160725/) current state: == (setq org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook) org-occur-hook '(org-first-headline-recenter) org-metaup-hook '(org-babel-load-in-session-maybe) org-html-format-drawer-function '(lambda (name contents) contents) org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function org-confirm-shell-link-function 'yes-or-no-p org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default org-latex-format-headline-function 'org-latex-format-headline-default-function org-after-todo-state-change-hook '(org-clock-out-if-current) org-latex-format-drawer-function '(lambda (name contents) contents) org-from-is-user-regexp "\\" org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-babel-pre-tangle-hook '(save-buffer) org-mode-hook '(#[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-show-block-all append local] 5] #[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes (lambda nil (setq truncate-lines nil))) org-archive-hook '(org-attach-archive-delete-maybe) org-ascii-format-drawer-function '(lambda (name contents width) contents) org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-hide-inline-tasks org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-confirm-elisp-link-function 'yes-or-no-p org-metadown-hook '(org-babel-pop-to-session-maybe) org-html-format-headline-function 'org-html-format-headline-default-function org-babel-load-languages '((emacs-lisp) (R . t)) org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function org-clock-out-hook '(org-clock-remove-empty-clock-drawer) )
[O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)
Eli Zaretskii writes: >> From: npost...@users.sourceforge.net >> Cc: 23...@debbugs.gnu.org, nljlistb...@gmail.com, jwieg...@gmail.com, >> rpl...@gmail.com, monn...@iro.umontreal.ca, alex.ben...@linaro.org >> Date: Wed, 20 Jul 2016 23:00:59 -0400 >> >> > Please also make sure bug#23869 is still fixed after this. >> >> Following the recipe in >> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23869#11 gives me 'Lisp >> error: (error "Match data clobbered by buffer modification hooks")', >> that indicates it's still fixed, right? > > Yes, but I thought we want to remove the error-out code. Since we now > protect ourselves from clobbered data, we don't need that extra > protection, and I think leaving it in place will cause false positives > (as a few people already reported). That's because the adjustment of > the search registers in the new function you introduce will itself > trigger the error message, won't it? I made the same adjustments to the saved sub_start and sub_end variables, but I had a mistake in that adjustment which caused the false positives. Fixed in the attached v2 patch. We could just drop the check, though I've already found it useful to catch bugs (https://github.com/joaotavora/yasnippet/issues/720). If I drop the checks (see attached v3 patch), then after following the bug#23869 recipe, I get: ## -*- Octave -*- -module(bug). -export([identity/1, is_even/1, size/1, reverse/1]). >From 3e8f9b9f89108bcebf04e06e41a5ce2c719c6ad2 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 20 Jul 2016 20:15:14 -0400 Subject: [PATCH v2] Adjust match data before calling after-change-funs * src/insdel.c (replace_range): Add new parameter ADJUST_MATCH_DATA, if true call update_search_regs. Update all callers (except Freplace_match) to pass 0 for the new parameter. * src/search.c (update_search_regs): New function, extracted from Freplace_match. (Freplace_match): Remove match data adjustment code, pass 1 for ADJUST_MATCH_DATA to replace_range instead. --- src/cmds.c| 2 +- src/editfns.c | 6 +++--- src/insdel.c | 10 -- src/lisp.h| 4 +++- src/search.c | 52 ++-- 5 files changed, 45 insertions(+), 29 deletions(-) diff --git a/src/cmds.c b/src/cmds.c index 1e44ddd..4003d8b 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -447,7 +447,7 @@ internal_self_insert (int c, EMACS_INT n) string = concat2 (string, tem); } - replace_range (PT, PT + chars_to_delete, string, 1, 1, 1); + replace_range (PT, PT + chars_to_delete, string, 1, 1, 1, 0); Fforward_char (make_number (n)); } else if (n > 1) diff --git a/src/editfns.c b/src/editfns.c index 412745d..32c8bec 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3192,7 +3192,7 @@ DEFUN ("subst-char-in-region", Fsubst_char_in_region, /* replace_range is less efficient, because it moves the gap, but it handles combining correctly. */ replace_range (pos, pos + 1, string, - 0, 0, 1); + 0, 0, 1, 0); pos_byte_next = CHAR_TO_BYTE (pos); if (pos_byte_next > pos_byte) /* Before combining happened. We should not increment @@ -3405,7 +3405,7 @@ DEFUN ("translate-region-internal", Ftranslate_region_internal, /* This is less efficient, because it moves the gap, but it should handle multibyte characters correctly. */ string = make_multibyte_string ((char *) str, 1, str_len); - replace_range (pos, pos + 1, string, 1, 0, 1); + replace_range (pos, pos + 1, string, 1, 0, 1, 0); len = str_len; } else @@ -3446,7 +3446,7 @@ DEFUN ("translate-region-internal", Ftranslate_region_internal, { string = Fmake_string (make_number (1), val); } - replace_range (pos, pos + len, string, 1, 0, 1); + replace_range (pos, pos + len, string, 1, 0, 1, 0); pos_byte += SBYTES (string); pos += SCHARS (string); cnt += SCHARS (string); diff --git a/src/insdel.c b/src/insdel.c index 4ad1074..fc3f19f 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1268,7 +1268,9 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte, /* Replace the text from character positions FROM to TO with NEW, If PREPARE, call prepare_to_modify_buffer. If INHERIT, the newly inserted text should inherit text properties - from the surrounding non-deleted text. */ + from the surrounding non-deleted text. + If ADJUST_MATCH_DATA, then adjust the match data before calling + signal_after_change. */ /* Note that this does not yet handle markers quite right. Also it needs to record a single undo-entry that does a replacement @@ -1279,7 +1281,8 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte, void replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, - bool prepare, bool inherit, bool markers) + bool prepare, bool inherit, bool markers, + bool adjust_match_data) { ptrdiff_t inschars = SCHA
[O] Echo heading hierarchy at point
Sent this in a few days ago, and it does not seem to have gone through: --- If I have this structure, with point marked by the "$": * Heading Level 1 ** Heading Level 2 $ Is there a way to have the current place in the outline [Heading Level 1 => Heading Level 2] temporarily echoed in the minibuffer? Also important is that the point shouldn't have to be on the heading title for it to work. At the moment I am using 'which-function-mode' to accomplish something similar: it displays the current subheading in the mode line. However it relies on Imenu (so it needs to be rescanned when new headings are added). If anybody knows a better way I would be interested in hearing about it. Cheers, Charles
[O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)
Eli Zaretskii writes: >> From: npost...@users.sourceforge.net >> Cc: Eli Zaretskii , 23...@debbugs.gnu.org, >> nljlistb...@gmail.com, jwieg...@gmail.com, rpl...@gmail.com, >> alex.ben...@linaro.org >> Date: Wed, 20 Jul 2016 20:56:28 -0400 >> >> >> Maybe there's a misunderstanding. What Noam suggested was just to >> >> move the code which adjusts search_regs.start[i] and .end[i] to before >> >> the call to replace_range. >> > >> > Oh, right, that's also an option. It might suffer from another problem, >> > which is that the match-data will be broken while the >> > before-change-functions are run, so if there's a save-match-data there >> > we're back to square one. >> >> Solution: adjust in between the before and after change functions. >> Patch below. I think there shouldn't be performance problems, although >> it does add yet another flag to replace_range (by the way, I noticed >> that the MARKERS flags is never 0, so it's redundant). I tested with >> the attached bug-23917-match-data-buffer-modhook.el. > > Thanks. > > Please also make sure bug#23869 is still fixed after this. Following the recipe in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23869#11 gives me 'Lisp error: (error "Match data clobbered by buffer modification hooks")', that indicates it's still fixed, right?
[O] Echo heading hierarchy at point
If I have this structure, with point marked by the "$": * Heading Level 1 ** Heading Level 2 $ Is there a way to have the current place in the outline [Heading Level 1 => Heading Level 2] temporarily echoed in the minibuffer? Also important is that the point shouldn't have to be on the heading title for it to work. At the moment I am using 'which-function-mode' to accomplish something similar: it displays the current subheading in the mode line. However it relies on Imenu (so it needs to be rescanned when new headings are added). If anybody knows a better way I would be interested in hearing about it. Cheers, Charles
[O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)
Eli Zaretskii writes: >> From: Stefan Monnier >> Cc: rpl...@gmail.com, 23...@debbugs.gnu.org, alex.ben...@linaro.org, >> jwieg...@gmail.com, nljlistb...@gmail.com >> Date: Tue, 19 Jul 2016 00:48:19 -0400 >> >> > The more general problem is when there's at least one more >> > sub-expression, whose start and/or end are after the new EOB. >> > Those sub-expression's data will be completely bogus after the >> > adjustment, >> >> If they were after the EOB, they were already bogus to start with. > > I think we are mis-communicating. I mean the following scenario: > > Before call to replace_range in replace-match: > >|---|---|--|| >s1 e1 s2e2 EOB > > (s1, e1, etc. are the start and end of the corresponding > sub-expressions.) > > After the call to replace_range in replace-match: > >|-|---|--|| >s1 e1 s2e2 EOB > > IOW, the 1st sub-expression got replaced with a much shorter text, > which made EOB be smaller than the original beginning and end of the > 2nd sub-expression. There's nothing bogus with this, is there? The > user will expect to get match-data adjusted as shown in the second > diagram, and that's what she will really get -- unless there are > buffer-modification hooks that use save-match-data. In the latter > case, what the user will get instead is this: > >|-|---|--|| >s1 EOB > e1 > s2 > e2 > > and that is even before the adjustment code kicks in and makes > "adjustments" with an incorrect adjustment value, which is computed as > > newpoint = search_regs.start[sub] + SCHARS (newtext); > [...] > ptrdiff_t change = newpoint - search_regs.end[sub]; > > and so will use the new EOB as search_regs.end[sub], instead of the > correct original value of e1 from the first diagram above. > > IOW, the call to save-match-data in a buffer-modification hook > _disrupts_ the normal operation of replace-match in this case, by > indirectly sabotaging the adjustment of match data after the > replacement. Is it not possible to adjust the match data *before* calling buffer modification hooks? Seems to me the root of the problem is that buffer modification hooks get to see this invalid intermediate state where the match data is out of sync with the buffer.
[O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)
Stefan Monnier writes: >> Maybe there's a misunderstanding. What Noam suggested was just to >> move the code which adjusts search_regs.start[i] and .end[i] to before >> the call to replace_range. > > Oh, right, that's also an option. It might suffer from another problem, > which is that the match-data will be broken while the > before-change-functions are run, so if there's a save-match-data there > we're back to square one. Solution: adjust in between the before and after change functions. Patch below. I think there shouldn't be performance problems, although it does add yet another flag to replace_range (by the way, I noticed that the MARKERS flags is never 0, so it's redundant). I tested with the attached bug-23917-match-data-buffer-modhook.el. >From a8098080dff5f83f7cbcbec2bc263f9db3b45ad9 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 20 Jul 2016 20:15:14 -0400 Subject: [PATCH v1] Adjust match data before calling after-change-funs * src/insdel.c (replace_range): Add new parameter ADJUST_MATCH_DATA, if true. Update all callers except Freplace_match to pass 0 for the new parameter. * src/search.c (update_search_regs): New function, extracted from Freplace_match. (Freplace_match): Remove match data adjustment code, pass 1 for ADJUST_MATCH_DATA to replace_range instead. --- src/cmds.c| 2 +- src/editfns.c | 6 +++--- src/insdel.c | 10 -- src/lisp.h| 4 +++- src/search.c | 50 +- 5 files changed, 44 insertions(+), 28 deletions(-) diff --git a/src/cmds.c b/src/cmds.c index 1e44ddd..4003d8b 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -447,7 +447,7 @@ internal_self_insert (int c, EMACS_INT n) string = concat2 (string, tem); } - replace_range (PT, PT + chars_to_delete, string, 1, 1, 1); + replace_range (PT, PT + chars_to_delete, string, 1, 1, 1, 0); Fforward_char (make_number (n)); } else if (n > 1) diff --git a/src/editfns.c b/src/editfns.c index 412745d..32c8bec 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3192,7 +3192,7 @@ DEFUN ("subst-char-in-region", Fsubst_char_in_region, /* replace_range is less efficient, because it moves the gap, but it handles combining correctly. */ replace_range (pos, pos + 1, string, - 0, 0, 1); + 0, 0, 1, 0); pos_byte_next = CHAR_TO_BYTE (pos); if (pos_byte_next > pos_byte) /* Before combining happened. We should not increment @@ -3405,7 +3405,7 @@ DEFUN ("translate-region-internal", Ftranslate_region_internal, /* This is less efficient, because it moves the gap, but it should handle multibyte characters correctly. */ string = make_multibyte_string ((char *) str, 1, str_len); - replace_range (pos, pos + 1, string, 1, 0, 1); + replace_range (pos, pos + 1, string, 1, 0, 1, 0); len = str_len; } else @@ -3446,7 +3446,7 @@ DEFUN ("translate-region-internal", Ftranslate_region_internal, { string = Fmake_string (make_number (1), val); } - replace_range (pos, pos + len, string, 1, 0, 1); + replace_range (pos, pos + len, string, 1, 0, 1, 0); pos_byte += SBYTES (string); pos += SCHARS (string); cnt += SCHARS (string); diff --git a/src/insdel.c b/src/insdel.c index 4ad1074..fc3f19f 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1268,7 +1268,9 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte, /* Replace the text from character positions FROM to TO with NEW, If PREPARE, call prepare_to_modify_buffer. If INHERIT, the newly inserted text should inherit text properties - from the surrounding non-deleted text. */ + from the surrounding non-deleted text. + If ADJUST_MATCH_DATA, then adjust the match data before calling + signal_after_change. */ /* Note that this does not yet handle markers quite right. Also it needs to record a single undo-entry that does a replacement @@ -1279,7 +1281,8 @@ adjust_after_insert (ptrdiff_t from, ptrdiff_t from_byte, void replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, - bool prepare, bool inherit, bool markers) + bool prepare, bool inherit, bool markers, + bool adjust_match_data) { ptrdiff_t inschars = SCHARS (new); ptrdiff_t insbytes = SBYTES (new); @@ -1426,6 +1429,9 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, MODIFF++; CHARS_MODIFF = MODIFF; + if (adjust_match_data) +update_search_regs (from, to, from + SCHARS (new)); + signal_after_change (from, nchars_del, GPT - from); update_compositions (from, GPT, CHECK_BORDER); } diff --git a/src/lisp.h b/src/lisp.h index 6a98adb..25f811e 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3516,7 +3516,7 @@ extern void adjust_after_insert (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t); extern void adjust_markers_for_delete (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t); -extern void replace_range
[O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)
On Wed, Jul 20, 2016 at 9:47 PM, Stefan Monnier wrote: > - maybe we can even adjust_match_data in every call to replace_range > rather than just in the one from Freplace_match. That would be simpler, though I wasn't sure if it would be correct.
[O] [PATCH] Added possibility of overriding PGF inclusion command
* ox-latex.el (org-latex--inline-image): The user can now customize the way PGF images are included by changing the (new) variable `org-latex-inline-pgf-command'. If the PGF file is stored in a subdirectory and references an external image file in the same directory, LaTeX will complain about not finding it. A workaround could be to define a function like this in the preamble: \newcommand\inputpgf[2]{{ \let\pgfimageWithoutPath\pgfimage \renewcommand{\pgfimage}[2][]{\pgfimageWithoutPath[##1]{#1/##2}} \input{#1/#2} }} and customizing `org-latex-inline-pgf-command' to hold this function: (lambda (path) (let ((dir-name (substring (file-name-directory path) 0 -1)) (file-name (file-name-nondirectory path))) (format "\\inputpgf{%s}{%s}" dir-name file-name))) This way, LaTeX will be able to find the external images. The idea came from here: http://tex.stackexchange.com/a/282110/9742 TINYCHANGE --- lisp/ox-latex.el | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 0901726..419f608 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -730,6 +730,19 @@ default we use here encompasses both." :type '(alist :key-type (string :tag "Type") :value-type (regexp :tag "Path"))) +(defcustom org-latex-inline-pgf-command + (lambda (path) (format "\\input{%s}" path)) + "Function used to include PGF images as links. By default, the +pgf images is included with a simple \input{file.pgf} command, +but the user might want to redefine this behaviour, if the pgf +file is stored in a subdirectory, and it references external +image files, as is the case when saving to PGF format from +matplotlib. The user can then specify a LaTeX command that takes +care of providing the correct search path for the external +dependencies, by redefining \pgfimage suitably." + :group 'org-export-latex + :type 'function) + (defcustom org-latex-link-with-unknown-path-format "\\texttt{%s}" "Format string for links with unknown path type." :group 'org-export-latex @@ -2300,12 +2313,12 @@ used as a communication channel." image-code) (if (member filetype '("tikz" "pgf")) ;; For tikz images: - ;; - use \input to read in image file. + ;; - use \input (default, can be overridden) to read in image file. ;; - if options are present, wrap in a tikzpicture environment. ;; - if width or height are present, use \resizebox to change ;; the image size. (progn - (setq image-code (format "\\input{%s}" path)) + (setq image-code (funcall org-latex-inline-pgf-command path)) (when (org-string-nw-p options) (setq image-code (format "\\begin{tikzpicture}[%s]\n%s\n\\end{tikzpicture}" -- 2.7.4 (Apple Git-66)
[O] bug#23917: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)
Please do not CC me on Emacs bug threads. If there's an issue in Flycheck please take it to our issue tracker at https://github.com/flycheck/flycheck/issues where we can keep track of it.
[O] bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)
Eli Zaretskii writes: > OK, let's wait for a few days to give time to the people who were > affected by the issue to test the patch, and if no new issues come up, > please push the version with the error code to emacs-25. I'll wait until Monday for the first release candidate to give time to this patch to be applied to emacs-25. Nico signature.asc Description: PGP signature
Re: [O] Patch: default CSS class for SVG images in HTML export
Nicolas Goaziou writes: > Would you mind providing an entry in ORG-NEWS for that change? It can > go in Version 9.0 > New features > Export. No need for a commit > message for this. Please see attachment. Jarmo >From 843f67d1fbed5a70e1b18de6dc25ee694694ebc5 Mon Sep 17 00:00:00 2001 From: Jarmo Hurri Date: Tue, 26 Jul 2016 10:36:10 +0300 Subject: [PATCH] --- etc/ORG-NEWS | 5 + 1 file changed, 5 insertions(+) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 391e282..12db376 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -208,6 +208,11 @@ point for the SRC/EXAMPLE block. With the global variable ~org-latex-images-centered~ or the local attribute ~:center~ it is now possible to center an image in LaTeX export. + Default CSS class ~org-svg~ for SVG images in HTML export +SVG images exported in HTML are now by default assigned a CSS class +~org-svg~ if no CSS class is specified with the ~:class~ attribute. By +default, the CSS styling of class ~org-svg~ specifies an image width +of 90\thinsp{}% of the container the image. *** Babel Support for SLY in Lisp blocks See ~org-babel-lisp-eval-fn~ to activate it. -- 2.4.11