Benno Schulenberg
e915fb1650
tweaks: adjust the indentation after the previous change, and another
2019-10-17 11:45:03 +02:00
Benno Schulenberg
4e40ec057e
tweaks: elide an unneeded check when making a backup
...
When making a backup, we can be certain that the relevant file
is not a temporary file, so 'stream' will necessarily be NULL.
2019-10-17 11:45:03 +02:00
Benno Schulenberg
bd0026be86
tweaks: elide another two calls of umask(), and rename two variables
2019-10-17 11:43:42 +02:00
Benno Schulenberg
a1bef0e953
tweaks: avoid three unneeded calls of umask() in the normal case
2019-10-16 19:17:42 +02:00
Benno Schulenberg
f5693d4151
tweaks: elide a duplicate opening of the existing file when prepending
2019-10-16 17:40:52 +02:00
Benno Schulenberg
e3807f00a2
tweaks: rename two variables, and add a third, for more contrast
2019-10-16 17:16:48 +02:00
Benno Schulenberg
022cc084a7
files: when opening a file for copying, it should NOT be created
...
Weird bug. The first occurrence is probably never hit because the
existing file has been tentatively opened fourteen lines earlier,
but that looks superfluous: double work. And the second occurrence
will not be hit because the temp file is unlikely to have disappeared.
2019-10-16 16:27:23 +02:00
Benno Schulenberg
0f98466e2f
tweaks: adjust the indentation after the previous change
...
Also, don't bother assigning the stream pointer of the existing file
to variable 'f', as it gets overwritten right away by the pointer of
the temp file.
2019-10-16 16:05:40 +02:00
Benno Schulenberg
40c067133a
tweaks: remove two superfluous conditions when prepending
...
When prepending, we cannot be writing to a temp file,
so 'stream' (and thus 'f') will necessarily be NULL.
2019-10-16 15:47:35 +02:00
Benno Schulenberg
36270748dc
tweaks: condense or improve some comments
2019-10-16 13:47:30 +02:00
Benno Schulenberg
1894c81412
tweaks: rename two parameters, for contrast and to match others
2019-10-16 13:07:41 +02:00
Benno Schulenberg
e917ef0105
tweaks: die on an impossible condition -- to be removed later
2019-10-16 12:27:27 +02:00
Benno Schulenberg
3347682fd0
tweaks: remove a pointless updating of the title bar
...
A possible change in filename won't be pushed to the screen until a
doupdate() is done, and that won't happen until nano is waiting for
a keystroke again. So... just let it be.
2019-10-16 12:22:39 +02:00
Benno Schulenberg
3b9a24a7ca
tweaks: rename a local variable, to not shadow another
2019-10-16 11:11:19 +02:00
Benno Schulenberg
7d3290fb91
tweaks: rename three variables, to be consistent with other linestructs
2019-10-16 11:04:26 +02:00
Benno Schulenberg
df0ae2ace5
tweaks: reshuffle a few declarations, and reduce the scope of one
2019-10-16 10:48:14 +02:00
Benno Schulenberg
34170611d3
restored feature: a per-syntax 'fixer' command that processes the buffer
...
The command can be used to run some kind of formatter or corrector or
arranging tool on the buffer. By default the command is bound to M-F.
The formatter/corrector/arranging program must be non-interactive.
This addresses https://savannah.gnu.org/bugs/?55365 ,
and addresses https://savannah.gnu.org/bugs/?54651 .
2019-10-14 10:28:45 +02:00
Benno Schulenberg
094758be15
tweaks: reshuffle a fragment of code into two alternatives
2019-10-13 16:11:15 +02:00
Benno Schulenberg
06bbc70d4a
tweaks: use a string-copy function that checks for out-of-memory
2019-10-13 12:38:46 +02:00
Benno Schulenberg
d256d0cbc0
tweaks: add a helper function without the ubiquitous NULL argument
...
For conciseness and clarity.
2019-10-13 12:24:27 +02:00
Benno Schulenberg
d12191db5a
tweaks: pass any special undo/redo messages to the add_undo() function
...
For the three operations (justification, spell checking, and filtering)
that need to undo or redo two suboperations (cutting and then pasting)
in one go, pass the message that describes the operation to add_undo(),
so that the undo item does not need to be modified after the call.
This looks better, but does add some twenty NULL parameters elsewhere.
2019-10-09 19:21:27 +02:00
Benno Schulenberg
785efc2087
tweaks: make a function do a check so its calls don't need to
2019-10-09 18:58:30 +02:00
Benno Schulenberg
557ad827f9
tweaks: condense two comments, and rewrap a line
2019-10-09 14:49:42 +02:00
Benno Schulenberg
600f81cf98
tweaks: rename three variables, and reshuffle some lines
2019-10-09 14:20:29 +02:00
Benno Schulenberg
cc4ce8d83b
tweaks: rename a type, to better fit the general pattern
2019-10-02 17:09:22 +02:00
Benno Schulenberg
2a4d338d97
tweaks: reshuffle a fragment, to group some toggles together
2019-10-02 15:07:04 +02:00
Benno Schulenberg
ab6390cad0
tweaks: remove two superfluous macros, as sizeof(char) is always 1
2019-09-18 15:20:08 +02:00
Benno Schulenberg
ebd9eb346d
tweaks: improve a bunch of comments, and reshuffle some declarations
2019-09-17 17:38:42 +02:00
Benno Schulenberg
413116e1b5
tweaks: rename another variable, for a better fit
2019-09-17 16:46:11 +02:00
Benno Schulenberg
69a3d39bc4
tweaks: rename three variables, for more contrast
2019-09-17 16:42:53 +02:00
Benno Schulenberg
f081fa3047
tweaks: rename two variables, to better describe what they contain
...
The 'tilded' variable is used for two purposes: a user's home directory,
and an intermediate user name.
2019-09-17 14:26:09 +02:00
Benno Schulenberg
4383b01b9b
tweaks: adjust indentation after previous change, reshuffle declarations
2019-09-17 14:11:45 +02:00
Benno Schulenberg
b901a20a06
tweaks: use an early return when there is no tilde
...
Also improve a comment, and use a 'while' instead of a 'for'.
2019-09-17 14:09:40 +02:00
Benno Schulenberg
63e04ac31e
tweaks: make a function name unique, to not overlap with others
2019-08-09 19:34:03 +02:00
Benno Schulenberg
bbab9e2e62
tweaks: shorten two messages that translators tend to make too long
2019-06-19 19:34:19 +02:00
Benno Schulenberg
345cf5accc
files: don't close a newly-created buffer when it is the only one
...
This fixes https://savannah.gnu.org/bugs/?56504 .
Reported-by: Liu Hao <lh_mouse@126.com>
Bug existed since commit 7e422402 from two weeks ago.
2019-06-16 19:12:52 +02:00
Benno Schulenberg
ce69d5be88
tweaks: condense two comments, and normalize the whitespace of a label
2019-06-12 11:10:27 +02:00
Benno Schulenberg
3da4240229
tweaks: rename a variable, to fit a little better
2019-06-12 11:03:03 +02:00
Benno Schulenberg
43caf7bb7b
tweaks: avoid an unneeded, extra stat() for temporary files
2019-06-12 10:48:03 +02:00
Benno Schulenberg
e8e30e5197
tweaks: elide an unneeded, duplicate stat() for the FIFO check
2019-06-12 10:34:53 +02:00
Benno Schulenberg
189de5ee78
files: suppress feedback when writing an emergency or temporary file
...
This fixes https://savannah.gnu.org/bugs/?56474 .
Bug existed since commit 47770bd3 from two weeks ago.
2019-06-12 09:51:14 +02:00
Benno Schulenberg
967f581860
tweaks: adjust some whitespace and rewrap a few lines
...
And remove two unneeded casts.
2019-06-09 20:03:44 +02:00
Benno Schulenberg
f63fee79e3
tweaks: merge two functions, as the first is called just once
2019-06-01 11:14:21 +02:00
Benno Schulenberg
2003413989
tweaks: move a function to the file where it is used
2019-06-01 10:52:38 +02:00
Benno Schulenberg
7e9dd385f5
tweaks: elide a parameter and a return value
...
As 'filepart' is a global variable, there is no need to pass it around.
Just use it directly.
2019-05-31 19:00:20 +02:00
Benno Schulenberg
122cabd3ba
tweaks: elide another parameter, and rename the function to match
2019-05-31 09:33:28 +02:00
Benno Schulenberg
c5d157dd9d
tweaks: close a buffer differently and elide a parameter
2019-05-31 09:15:12 +02:00
Benno Schulenberg
484523b3bb
tweaks: drop two checks that were made redundant by the previous commit
2019-05-30 17:18:30 +02:00
Benno Schulenberg
5a48edc9ae
tweaks: reshuffle some code to the one place that needs it
...
The extra things that close_buffer() did are only needed and useful
when manually closing a buffer, so move them there. The other three
calls of close_buffer() only need to get rid of the current buffer
(making the preceding buffer the new current one) and nothing else.
2019-05-30 17:09:49 +02:00
Benno Schulenberg
7e422402d5
tweaks: change a function to void, to make things more direct
2019-05-29 20:02:50 +02:00