Skip to content

Commit

Permalink
feat!: remove hardcopy
Browse files Browse the repository at this point in the history
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
  • Loading branch information
lewis6991 and justinmk committed Jan 3, 2023
1 parent c590641 commit e3ded5b
Show file tree
Hide file tree
Showing 95 changed files with 44 additions and 7,868 deletions.
1 change: 0 additions & 1 deletion cmake.config/iwyu/mapping.imp
Expand Up @@ -69,7 +69,6 @@
{ include: [ '"garray.h.generated.h"', private, '"nvim/garray.h"', public ] },
{ include: [ '"getchar.h.generated.h"', private, '"nvim/getchar.h"', public ] },
{ include: [ '"grid.h.generated.h"', private, '"nvim/grid.h"', public ] },
{ include: [ '"hardcopy.h.generated.h"', private, '"nvim/hardcopy.h"', public ] },
{ include: [ '"hashtab.h.generated.h"', private, '"nvim/hashtab.h"', public ] },
{ include: [ '"help.h.generated.h"', private, '"nvim/help.h"', public ] },
{ include: [ '"highlight.h.generated.h"', private, '"nvim/highlight.h"', public ] },
Expand Down
43 changes: 0 additions & 43 deletions runtime/autoload/netrw.vim
Expand Up @@ -6446,7 +6446,6 @@ fun! s:NetrwMaps(islocal)
" if !hasmapto('<Plug>NetrwMarkFileGrep') |nmap <buffer> <silent> <nowait> mg <Plug>NetrwMarkFileGrep|endif
" if !hasmapto('<Plug>NetrwMarkHideSfx') |nmap <buffer> <silent> <nowait> mh <Plug>NetrwMarkHideSfx|endif
" if !hasmapto('<Plug>NetrwMarkFileMove') |nmap <buffer> <silent> <nowait> mm <Plug>NetrwMarkFileMove|endif
" if !hasmapto('<Plug>NetrwMarkFilePrint') |nmap <buffer> <silent> <nowait> mp <Plug>NetrwMarkFilePrint|endif
" if !hasmapto('<Plug>NetrwMarkFileRegexp') |nmap <buffer> <silent> <nowait> mr <Plug>NetrwMarkFileRegexp|endif
" if !hasmapto('<Plug>NetrwMarkFileSource') |nmap <buffer> <silent> <nowait> ms <Plug>NetrwMarkFileSource|endif
" if !hasmapto('<Plug>NetrwMarkFileTag') |nmap <buffer> <silent> <nowait> mT <Plug>NetrwMarkFileTag|endif
Expand Down Expand Up @@ -6509,7 +6508,6 @@ fun! s:NetrwMaps(islocal)
nnoremap <buffer> <silent> <nowait> mg :<c-u>call <SID>NetrwMarkFileGrep(1)<cr>
nnoremap <buffer> <silent> <nowait> mh :<c-u>call <SID>NetrwMarkHideSfx(1)<cr>
nnoremap <buffer> <silent> <nowait> mm :<c-u>call <SID>NetrwMarkFileMove(1)<cr>
nnoremap <buffer> <silent> <nowait> mp :<c-u>call <SID>NetrwMarkFilePrint(1)<cr>
nnoremap <buffer> <silent> <nowait> mr :<c-u>call <SID>NetrwMarkFileRegexp(1)<cr>
nnoremap <buffer> <silent> <nowait> ms :<c-u>call <SID>NetrwMarkFileSource(1)<cr>
nnoremap <buffer> <silent> <nowait> mT :<c-u>call <SID>NetrwMarkFileTag(1)<cr>
Expand Down Expand Up @@ -6622,7 +6620,6 @@ fun! s:NetrwMaps(islocal)
nnoremap <buffer> <silent> <nowait> mg :<c-u>call <SID>NetrwMarkFileGrep(0)<cr>
nnoremap <buffer> <silent> <nowait> mh :<c-u>call <SID>NetrwMarkHideSfx(0)<cr>
nnoremap <buffer> <silent> <nowait> mm :<c-u>call <SID>NetrwMarkFileMove(0)<cr>
nnoremap <buffer> <silent> <nowait> mp :<c-u>call <SID>NetrwMarkFilePrint(0)<cr>
nnoremap <buffer> <silent> <nowait> mr :<c-u>call <SID>NetrwMarkFileRegexp(0)<cr>
nnoremap <buffer> <silent> <nowait> ms :<c-u>call <SID>NetrwMarkFileSource(0)<cr>
nnoremap <buffer> <silent> <nowait> mT :<c-u>call <SID>NetrwMarkFileTag(0)<cr>
Expand Down Expand Up @@ -7839,46 +7836,6 @@ fun! s:NetrwMarkFileMove(islocal)
" call Dret("s:NetrwMarkFileMove")
endfun

" ---------------------------------------------------------------------
" s:NetrwMarkFilePrint: (invoked by mp) This function prints marked files {{{2
" using the hardcopy command. Local marked-file list only.
fun! s:NetrwMarkFilePrint(islocal)
" call Dfunc("s:NetrwMarkFilePrint(islocal=".a:islocal.")")
let curbufnr= bufnr("%")

" sanity check
if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
" call Dret("s:NetrwMarkFilePrint")
return
endif
" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("<slnum>"))
let curdir= s:NetrwGetCurdir(a:islocal)

if exists("s:netrwmarkfilelist_{curbufnr}")
let netrwmarkfilelist = s:netrwmarkfilelist_{curbufnr}
call s:NetrwUnmarkList(curbufnr,curdir)
for fname in netrwmarkfilelist
if a:islocal
if g:netrw_keepdir
let fname= s:ComposePath(curdir,fname)
endif
else
let fname= curdir.fname
endif
1split
" the autocmds will handle both local and remote files
" call Decho("exe sil e ".escape(fname,' '),'~'.expand("<slnum>"))
exe "sil NetrwKeepj e ".fnameescape(fname)
" call Decho("hardcopy",'~'.expand("<slnum>"))
hardcopy
q
endfor
2match none
endif
" call Dret("s:NetrwMarkFilePrint")
endfun

" ---------------------------------------------------------------------
" s:NetrwMarkFileRegexp: (invoked by mr) This function is used to mark {{{2
" files when given a regexp (for which a prompt is
Expand Down
19 changes: 7 additions & 12 deletions runtime/doc/eval.txt
Expand Up @@ -1718,17 +1718,13 @@ v:charconvert_to
Only valid while evaluating the 'charconvert' option.

*v:cmdarg* *cmdarg-variable*
v:cmdarg This variable is used for two purposes:
1. The extra arguments ("++p", "++enc=", "++ff=") given to
a file read/write command. This is set before an
autocommand event for a file read/write command is
triggered. There is a leading space to make it possible to
append this variable directly after the read/write command.
Note: "+cmd" isn't included here, because it will be
executed anyway.
2. When printing a PostScript file with ":hardcopy" this is
the argument for the ":hardcopy" command. This can be used
in 'printexpr'.
v:cmdarg
The extra arguments ("++p", "++enc=", "++ff=") given to a file
read/write command. This is set before an autocommand event
for a file read/write command is triggered. There is a
leading space to make it possible to append this variable
directly after the read/write command. Note: "+cmd" isn't
included here, because it will be executed anyway.

*v:collate* *collate-variable*
v:collate The current locale setting for collation order of the runtime
Expand Down Expand Up @@ -1926,7 +1922,6 @@ v:fname_in The name of the input file. Valid while evaluating:
'charconvert' file to be converted
'diffexpr' original file
'patchexpr' original file
'printexpr' file to be printed
And set to the swap file name for |SwapExists|.

*v:fname_out* *fname_out-variable*
Expand Down
5 changes: 0 additions & 5 deletions runtime/doc/help.txt
Expand Up @@ -169,11 +169,6 @@ DEVELOPING NVIM
|dev-style| Development style guidelines
|debug.txt| Debugging Vim itself

------------------------------------------------------------------------------
OTHER

|print.txt| For your briefcase and fax machine

*standard-plugin-list*
Standard plugins ~
|matchit.txt| Extended |%| matching
Expand Down
1 change: 0 additions & 1 deletion runtime/doc/index.txt
Expand Up @@ -1310,7 +1310,6 @@ tag command action ~
|:grepadd| :grepa[dd] like :grep, but append to current list
|:gui| :gu[i] start the GUI
|:gvim| :gv[im] start the GUI
|:hardcopy| :ha[rdcopy] send text to the printer
|:help| :h[elp] open a help window
|:helpclose| :helpc[lose] close one help window
|:helpgrep| :helpg[rep] like ":grep" but searches help files
Expand Down
11 changes: 11 additions & 0 deletions runtime/doc/news.txt
Expand Up @@ -34,6 +34,17 @@ The following changes may require adaptations in user config or plugins.

See https://github.com/neovim/neovim/pull/20545 for more information.

`:hardcopy` is now removed (see |hardcopy| and |nvim-features-removed|):
- Commands removed:
- `:hardcopy`
- Options removed:
- `printdevice`
- `printencoding`
- `printexpr`
- `printfont`
- `printheader`
- `printmbcharset`

==============================================================================
NEW FEATURES *news-features*

Expand Down
58 changes: 2 additions & 56 deletions runtime/doc/options.txt
Expand Up @@ -163,7 +163,7 @@ halved and when you expect the backslashes to be kept. The third gives a
result which is probably not what you want. Avoid it.

*add-option-flags* *remove-option-flags*
*E539* *E550* *E551* *E552*
*E539*
Some options are a list of flags. When you want to add a flag to such an
option, without changing the existing ones, you can do it like this: >
:set guioptions+=a
Expand Down Expand Up @@ -4681,58 +4681,6 @@ A jump table for the options with a short description can be found at |Q_op|.
set. It's normally not set directly, but by using one of the commands
|:ptag|, |:pedit|, etc.

*'printdevice'* *'pdev'*
'printdevice' 'pdev' string (default empty)
global
The name of the printer to be used for |:hardcopy|.
See |pdev-option|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.

*'printencoding'* *'penc'*
'printencoding' 'penc' string (default empty, except for some systems)
global
Sets the character encoding used when printing.
See |penc-option|.

*'printexpr'* *'pexpr'*
'printexpr' 'pexpr' string (default: see below)
global
Expression used to print the PostScript produced with |:hardcopy|.
See |pexpr-option|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.

*'printfont'* *'pfn'*
'printfont' 'pfn' string (default "courier")
global
The name of the font that will be used for |:hardcopy|.
See |pfn-option|.

*'printheader'* *'pheader'*
'printheader' 'pheader' string (default "%<%f%h%m%=Page %N")
global
The format of the header produced in |:hardcopy| output.
See |pheader-option|.

*'printmbcharset'* *'pmbcs'*
'printmbcharset' 'pmbcs' string (default "")
global
The CJK character set to be used for CJK output from |:hardcopy|.
See |pmbcs-option|.

*'printmbfont'* *'pmbfn'*
'printmbfont' 'pmbfn' string (default "")
global
List of font names to be used for CJK output from |:hardcopy|.
See |pmbfn-option|.

*'printoptions'* *'popt'*
'printoptions' 'popt' string (default "")
global
List of items that control the format of the output of |:hardcopy|.
See |popt-option|.

*'pumblend'* *'pb'*
'pumblend' 'pb' number (default 0)
global
Expand Down Expand Up @@ -5004,7 +4952,6 @@ A jump table for the options with a short description can be found at |Q_op|.
pack/ packages |:packadd|
parser/ |treesitter| syntax parsers
plugin/ plugin scripts |write-plugin|
print/ files for printing |postscript-print-encoding|
query/ |treesitter| queries
rplugin/ |remote-plugin| scripts
spell/ spell checking files |spell|
Expand Down Expand Up @@ -6126,7 +6073,6 @@ A jump table for the options with a short description can be found at |Q_op|.
o N Byte number in file of byte under cursor, first byte is 1.
Mnemonic: Offset from start of file (with one added)
O N As above, in hexadecimal.
N N Printer page number. (Only works in the 'printheader' option.)
l N Line number.
L N Number of lines in buffer.
c N Column number (byte index).
Expand Down Expand Up @@ -6407,7 +6353,7 @@ A jump table for the options with a short description can be found at |Q_op|.
the |:retab| command, and the 'softtabstop' option.

Note: Setting 'tabstop' to any other value than 8 can make your file
appear wrong in many places, e.g., when printing it.
appear wrong in many places.
The value must be more than 0 and less than 10000.

There are four main ways to use tabs in Vim:
Expand Down
9 changes: 0 additions & 9 deletions runtime/doc/pi_netrw.txt
Expand Up @@ -2419,15 +2419,6 @@ from the current window (where one does the mf) to the target.

Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|

MARKED FILES: PRINTING *netrw-mp* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked file list)

When "mp" is used, netrw will apply the |:hardcopy| command to marked files.
What netrw does is open each file in a one-line window, execute hardcopy, then
close the one-line window.


MARKED FILES: SOURCING *netrw-ms* {{{2
(See |netrw-mf| and |netrw-mr| for how to mark files)
(uses the local marked file list)
Expand Down

0 comments on commit e3ded5b

Please sign in to comment.