From: Juergen Spitzmueller Date: Tue, 31 Mar 2020 06:01:17 +0000 (+0200) Subject: Implement buffer-write force X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e0a8aa937a5e32cd88ec5bbbe147c5e36ca656ac;p=features.git Implement buffer-write force --- diff --git a/lib/bind/cua.bind b/lib/bind/cua.bind index 31a493b09a..918ca02d7a 100644 --- a/lib/bind/cua.bind +++ b/lib/bind/cua.bind @@ -105,7 +105,7 @@ Format 5 #bind "F1" "help" # Not yet implemented! #bind "C-F1" "help-context" # Not yet implemented! -\bind "F2" "buffer-write" +\bind "F2" "buffer-write force" \bind "F3" "word-find" \bind "C-F4" "buffer-close" \bind "M-F4" "lyx-quit" diff --git a/lib/bind/emacs.bind b/lib/bind/emacs.bind index 60f849b67d..e7c587d004 100644 --- a/lib/bind/emacs.bind +++ b/lib/bind/emacs.bind @@ -136,8 +136,8 @@ Format 4 #bind "F1" "help" # Not yet implemented! #bind "C-F1" "help-context" # Not yet implemented! -#\bind "F2" "buffer-write" -#\bind "F3" "file-open" +\bind "F2" "buffer-write force" +#\bind "F3" "file-open" #bind "F4" "------" #bind "F5" "------" #bind "F6" "------" diff --git a/lib/bind/mac.bind b/lib/bind/mac.bind index bceea69026..0d7459fbe2 100644 --- a/lib/bind/mac.bind +++ b/lib/bind/mac.bind @@ -271,7 +271,7 @@ Format 4 #bind "F1" "help" # Not yet implemented! #bind "C-F1" "help-context" # Not yet implemented! -\bind "F2" "buffer-write" +\bind "F2" "buffer-write force" \bind "C-F4" "buffer-close" \bind "C-A-Up" "scroll line up" \bind "C-A-Down" "scroll line down" diff --git a/lib/bind/xemacs.bind b/lib/bind/xemacs.bind index 776f5d5e84..13decd3860 100644 --- a/lib/bind/xemacs.bind +++ b/lib/bind/xemacs.bind @@ -130,7 +130,7 @@ Format 4 #bind "F1" "help" # Not yet implemented! #bind "C-F1" "help-context" # Not yet implemented! -#\bind "F2" "buffer-write" +\bind "F2" "buffer-write force" #\bind "F3" "file-open" #bind "F4" "------" #bind "F5" "------" diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index a9789ad290..6089e5e8d9 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -892,7 +892,8 @@ void LyXAction::init() * \li Notion: Saves the current buffer to disk, using the filename that is already associated with the buffer, asking for one if none is yet assigned. - * \li Syntax: buffer-write + * \li Syntax: buffer-write [force] + * \li Params: force: write even if buffer is clean. * \endvar */ { LFUN_BUFFER_WRITE, "buffer-write", ReadOnly, Buffer }, diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp index c7a1bd9458..78e0817cdd 100644 --- a/src/frontends/qt/GuiView.cpp +++ b/src/frontends/qt/GuiView.cpp @@ -1996,7 +1996,9 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag) } case LFUN_BUFFER_WRITE: - enable = doc_buffer && (doc_buffer->isUnnamed() || !doc_buffer->isClean()); + enable = doc_buffer && (doc_buffer->isUnnamed() + || (!doc_buffer->isClean() + || cmd.argument() == "force")); break; //FIXME: This LFUN should be moved to GuiApplication.