What is Macro "Don't Save" command? - macros

I can use the following command to stop a PDF or any file from opening:
OpenAfterExport:=False
Does anyone know the command to suppress the 'Don't Save' prompt?
Thanks a lot

For excel, there are several ways to 'hide' or 'suppress' the save prompt.
ThisWorkBook.Saved = True
and
Application.DisplayAlerts = False
will both disable the save prompt from appearing. However, the latter has problems of its own, for example, if you have other issues, I believe those message will also be disabled which could be problematic. After both of these you could add a
ActiveWorkBook.Close
to close the workbook.
You can do all this in one line with
ActiveWorkbook.Close savechanges:=False
If you need to save the workbook, make sure you add a piece of code to autosave before that line of code.
Hope that helps. If that's not what you're looking for, please elaborate and I'll try again.

Related

Powershell commands?

Ok I'm having trouble and google isn't helping, so I thought I'd come to you geniuses. I'm using Powershell and posh-git, and it keeps doing something that I'm sure I can exit out of with a magic command, I just don't know it yet.
Basically, when I run git diff (or something else with a long result), it will only give me a screen's worth of information, and end the screen with a colon
:
And if I keep pressing Enter it will add more to the screen til it is done showing everything for that command, and shows
<END>
But now what? How do I get out of this and back to calling commands? Enter, Esc and the other things I thought to try are not helping. I'm sure this must be a simple thing, but I don't know how to explain to Google what I want.
Anyone know?
if you do a git config -l you may see some relevant entries like:
core.pager='less'
pager.diff=false
pager.log=true
You can enable or disable the pager for different commands, or set a different pager. https://www.kernel.org/pub/software/scm/git/docs/git-config.html has the details, check out the core.pager section and pager.<cmd> sections for specifics.
If you're using 'less' as your pager, hit 'h' at that : prompt to get lots of details about what you can do there, and as pointed out by others, q, Q, or ZZ will get you back to the command line.
You can terminate the current command using CTRL+C. Is that what you're asking?

Clearing output from Scala Worksheet

Every-time you save a Scala Worksheet in the Scala IDE, the output of each expression is printed as comments on the right-hand side of the editor. Is there a way to clear this output from a Scala Worksheet so that you can cut and paste code?
Currently, my solution is to save my worksheet with an error, so that the output would disappear. There must be a better way... a keyboard shortcut or something.
There is no such feature yet. There is a related ticket: The Format action should strip comments.
While waiting for the ticket to be resolved, this regular expression can be used in Find/Replace (Ctrl/Cmd+F) to delete the comments.
*//[>|].*$
Update:
This has been fixed: #132
It's jerry-rigged, but gets the job done.
Make a small edit (e.g. delete a space where it doesn't matter) to prompt a save.
Save.
Press Esc immediately to terminate worksheet process.
You now have a clean worksheet!
Ctrl+Shift+C does the job in Scala IDE 4.7.0
Alt+Shift+A enables Block selection mode. You will be able to select only left part of screen (columns with code). Block mode also makes possible to select only columns with output.
More on block selection mode

Changing the hot key for run selection in Powershell ISE

I'm not sure what is the best approach for asking these question, so I'm putting them all together here. After some googling these questions didn't have an obvious answer.
1) In Powershell ISE is there a way to change the "run selection" quick-key/hot-key so that it's something other than the default (which is F8)?
2) For that matter, is there a way to add quick-key bindings without adding a menu?
3) Can one add key cords to the ISE like in Visual Studio (Ctrl-d, Ctrl-h) for example.
I don't think you can change, but you can add another key to do the same:
function invoke-selection
{
iex $psISe.CurrentFile.Editor.SelectedText
}
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add("Run selection",{invoke-selection},'f7')
Add the above to your Powershell ISE profile - $profile from ISE
Simple answer in no.
Unfortunately the ISE is a very basic editor and doesn't provide much in the way of customisation.
This might change when the ISE for PSv3.0 is released.
In the mean time this post has a list of PowerShell ISEs that you might want to try:
https://stackoverflow.com/questions/171514/best-ide-for-powershell
regards
Arcass

Running octave in Emacs

I am using run-octave in Emacs to trigger octave. Something is acting abnormally.
Every time I hit TAB to complete, there would be a tailing ^M; If I edit a .m file using edit a.m, it would start a new frame instead of a new buffer and the prompt is waiting for the closure of that frame so it would not respond to any input. How could I configure .emacs so that run-octave would behave normally?
Any comment is appreciated!
You seem to have two problems. I'm not sure about the trailing ^M, which seems to be caused by some sort of Windows/Unix CR/LF problem, but maybe I can help with the second problem.
The edit command uses the EDITOR environment variable to decide what to run. It seems that yours is either set to emacsclient or has defaulted to it. You haven't said whether you're on Unix or Windows, so I'm going to assume the former: you'll have to change this a bit for Windows.
To avoid the waiting thing, try running octave with a different EDITOR. For example, try out running
EDITOR='emacsclient -n' octave
When you type edit foo, it should bring up an Emacs buffer (if you want a new frame as well, use -c too) but not wait until you're done.
If this fixes things for you, you could change your ~/.bashrc to include the line
export EDITOR='emacsclient -n'

Running Emacs ispell command doesn't ask confirmation to save to private dictionary

Everytime I run ispell-buffer and add things to the private dictionary. It asks me confirmation whether I want to save it or not at the end. Can I turn this off?? So it doesn't ask me the confirmation and just automatically saves it.
Then on a side note in addition to that. After I add something to the personal dictionary it doesn't seem to unmark the red underline until next time I pass over the word. Can I have ispell immediately rescan the document after running it so these red underlines disappear. I have saved the word in the private dictionary but still won't remove it. It is just quite distracting.
Thanks for any help.
Added
(setq ispell-silently-savep t)
to the .emacs file.
Rupert's answer let me know the function to set. Seems when doing this that it also solves problem 2 if you are running it on that word. If you run it on a region the red underline still remains.
For the personal dictionary saving thing, I think you want to set the variable ispell-silently-savep to true (you can change it via M-x customize-group ispell).