Re: Deleting outline entry
On 2023-09-24 20:20, Dan via lyx-users wrote: 24 de set. de 2023, 3:25 per xraco...@gmx.de: On 2023-09-23 21:09, Daniel wrote: On 2023-09-23 18:50, Dan via lyx-users wrote: Is there a way to delete an outline entry? A right-click on the entry does not offer that option and the delete key removes characters in the chapter/section title, not the chapter/section itself. I do not see any way of accomplishing this via the GUI, but it can be done by means of the command interpreter with a pair of commands. Say you want to delete section 2.2 of your document 1. Place the cursor at the title of section 2.2. 2. Issue in the command interpreter "section-select". This will select the whole section 2.2. 3. To delete the entire section, then enter this command: "char-delete-forward". This will erase the whole section. These steps work for any kind of sectioning (division of the text hierarchycally): parts, chapters, paragraphs, etc. You could even customize your UI file to bind these pair of commands to a button in the toolbars. I was about to suggest to add a "Delete Section" menu entry to the TOC context menu. But that doesn't work for some reason and I am not sure why. In any case, such a (working) menu entry should probably be available. Daniel Maybe there is some kind of cursor update missing after the "section-select" command? command-sequence section-select;char-delete-forward apparently works fine when the cursor is already in the heading but not when executed merely from the context-menu. Daniel Apparently the command "char-delete-forward" (and its twin "char-delete-backward") is "forbidden" in that location. Thus, adding the item "Delete Section|e" "command-sequence section-select; char-delete-forward" to stdcontext.inc does not work, by design. Try it by yourself with the debugging category "action" enabled in the messages pane (View > Messages Pane). Otherwise, see the debug messages attached. It may be possible, but I do not know how. Daniel. -- Enviat amb Tutanota. What works is to add a context-menu entry to the "context-edit" menu. I don't know whether it is really by design that it does not work from the outline. A command being disabled is often dependent on a rather coarse condition. It might still be just an oversight. In any case, it seems non-ideal that the command cannot be executed from the outline. Daniel -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Re: Deleting outline entry
24 de set. de 2023, 3:25 per xraco...@gmx.de: > On 2023-09-23 21:09, Daniel wrote: > >> On 2023-09-23 18:50, Dan via lyx-users wrote: >> Is there a way to delete an outline entry? A right-click on the entry does not offer that option and the delete key removes characters in the chapter/section title, not the chapter/section itself. >>> I do not see any way of accomplishing this via the GUI, but it can be done >>> by means of the command interpreter with a pair of commands. >>> >>> Say you want to delete section 2.2 of your document >>> 1. Place the cursor at the title of section 2.2. >>> 2. Issue in the command interpreter "section-select". This will select >>> the whole section 2.2. >>> 3. To delete the entire section, then enter this command: >>> "char-delete-forward". This will erase the whole section. >>> >>> These steps work for any kind of sectioning (division of the text >>> hierarchycally): parts, chapters, paragraphs, etc. You could even customize >>> your UI file to bind these pair of commands to a button in the toolbars. >>> >> >> I was about to suggest to add a "Delete Section" menu entry to the TOC >> context menu. But that doesn't work for some reason and I am not sure why. >> >> In any case, such a (working) menu entry should probably be available. >> >> Daniel >> > > Maybe there is some kind of cursor update missing after the "section-select" > command? > > command-sequence section-select;char-delete-forward > > apparently works fine when the cursor is already in the heading but not when > executed merely from the context-menu. > > Daniel > Apparently the command "char-delete-forward" (and its twin "char-delete-backward") is "forbidden" in that location. Thus, adding the item "Delete Section|e" "command-sequence section-select; char-delete-forward" to stdcontext.inc does not work, by design. Try it by yourself with the debugging category "action" enabled in the messages pane (View > Messages Pane). Otherwise, see the debug messages attached. It may be possible, but I do not know how. Daniel. -- Enviat amb Tutanota. 20:12:26.110: Command disabledGuiApplication.cpp (1746): cmd: action: 173 [command-sequence] arg: 'section-select; char-delete-forward' x: 0 y: 0 GuiApplication.cpp (1746): cmd: action: 332 [section-select] arg: '' x: 0 y: 0 GuiApplication.cpp (1746): cmd: action: 196 [paragraph-goto] arg: '1 0' x: 0 y: 0 BufferView.cpp (1366): BufferView::dispatch: cmd: action: 196 [paragraph-goto] arg: '1 0' x: 0 y: 0 GuiApplication.cpp (1514): dispatch msg is `' Cursor.cpp (781): Cursor::dispatch: cmd: action: 332 [section-select] arg: '' x: 0 y: 0 Cursor.cpp (811): Cursor::dispatch: cmd: action: 332 [section-select] arg: '' x: 0 y: 0 insets/InsetText.cpp (311): InsetText::doDispatch(): cmd: action: 332 [section-select] arg: '' x: 0 y: 0 Text.cpp (4038): Text::dispatch: cmd: action: 332 [section-select] arg: '' x: 0 y: 0 GuiApplication.cpp (1514): dispatch msg is `' GuiApplication.cpp (1746): cmd: action: 61 [char-delete-forward] arg: '' x: 0 y: 0 GuiApplication.cpp (1754): action char-delete-forward [] is disabled at this location GuiApplication.cpp (1514): dispatch msg is `Command disabled' GuiApplication.cpp (1514): dispatch msg is `' -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Re: Deleting outline entry
On Sat, 23 Sep 2023, Dan via lyx-users wrote: I am dumb. I have just realized there is a context-menu item "Select Section": right-clicking on any section in the outline pane. So you could just use that and then the "delete" key. Daniel, I looked at the choices presented when a right click was made on an item in the outline pane, but didn't think to use the `Select section' key. Yeah, that does work to delete the selected section. Thanks for spending your time on this. Regards, Rich -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Re: Deleting outline entry
> On 2023-09-23 18:50, Dan via lyx-users wrote: > >>> Is there a way to delete an outline entry? A right-click on the entry does >>> not offer that option and the delete key removes characters in the >>> chapter/section title, not the chapter/section itself. >>> >> I do not see any way of accomplishing this via the GUI, but it can be done >> by means of the command interpreter with a pair of commands. >> I am dumb. I have just realized there is a context-menu item "Select Section": right-clicking on any section in the outline pane. So you could just use that and then the "delete" key. > I was about to suggest to add a "Delete Section" menu entry to the TOC > context menu. But that doesn't work for some reason and I am not sure why. > > In any case, such a (working) menu entry should probably be available. > > Daniel > I have just run a couple of tests and, unexpectedly, the sequence of commands works when added to the toolbars (only if cursor is in the title), but not when added to the context menu of the TOC. See the attached (diff) files to see the changes I made to "stdcontext.inc" and "stdtoolbars.inc", and try it out by yourself. Daniel. -- Enviat amb Tutanota. 717d716 < Item "Delete Section|S" "command-sequence section-select; char-delete-forward" 106d105 < Item "Delete section" "command-sequence section-select; char-delete-forward" -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Re: Deleting outline entry
On 2023-09-23 18:50, Dan via lyx-users wrote: Is there a way to delete an outline entry? A right-click on the entry does not offer that option and the delete key removes characters in the chapter/section title, not the chapter/section itself. I do not see any way of accomplishing this via the GUI, but it can be done by means of the command interpreter with a pair of commands. Say you want to delete section 2.2 of your document 1. Place the cursor at the title of section 2.2. 2. Issue in the command interpreter "section-select". This will select the whole section 2.2. 3. To delete the entire section, then enter this command: "char-delete-forward". This will erase the whole section. These steps work for any kind of sectioning (division of the text hierarchycally): parts, chapters, paragraphs, etc. You could even customize your UI file to bind these pair of commands to a button in the toolbars. I was about to suggest to add a "Delete Section" menu entry to the TOC context menu. But that doesn't work for some reason and I am not sure why. In any case, such a (working) menu entry should probably be available. Daniel -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Re: Deleting outline entry
On Sat, 23 Sep 2023, Dan wrote: I do not see any way of accomplishing this via the GUI, but it can be done by means of the command interpreter with a pair of commands. Say you want to delete section 2.2 of your document 1. Place the cursor at the title of section 2.2. 2. Issue in the command interpreter "section-select". This will select the whole section 2.2. 3. To delete the entire section, then enter this command: "char-delete-forward". This will erase the whole section. These steps work for any kind of sectioning (division of the text hierarchycally): parts, chapters, paragraphs, etc. You could even customize your UI file to bind these pair of commands to a button in the toolbars. Daniel, Thank you. This makes creating a MWE from a large document much easier. Regards, Rich -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users
Re: Deleting outline entry
> Is there a way to delete an outline entry? A right-click on the entry does > not offer that option and the delete key removes characters in the > chapter/section title, not the chapter/section itself. > I do not see any way of accomplishing this via the GUI, but it can be done by means of the command interpreter with a pair of commands. Say you want to delete section 2.2 of your document 1. Place the cursor at the title of section 2.2. 2. Issue in the command interpreter "section-select". This will select the whole section 2.2. 3. To delete the entire section, then enter this command: "char-delete-forward". This will erase the whole section. These steps work for any kind of sectioning (division of the text hierarchycally): parts, chapters, paragraphs, etc. You could even customize your UI file to bind these pair of commands to a button in the toolbars. If you do not know how to open the command interpreter, do this 1. Place the mouse pointer on the toolbars. 2. Right click and set the toolbar "Command Buffer" visibility to "On". This will bring up a text box to type command in. Use the tab key when typing to autocomplete commands. Hope this helps. Kind regards. Daniel. -- Enviat amb Tutanota. -- lyx-users mailing list lyx-users@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-users