Bram Moolenaar wrote:
> Lech Lorens wrote:
>> The attached patch makes the quickfix / location list window's title
>> reflect the command that yielded the error list.
>>
>> Additionally, two commands have been added:
>> :cse[ttitle]
>> :lse[ttitle]
>>
>> The former allows for setting a custom title of the quickfix window. The
>> latter changes the title of the location list window.
>>
>> An example can be found here:
>> http://i41.tinypic.com/nd8obr.png
>>
>> The patch was made against Vim 7.2.147.
> 
> Thanks.  I'll await comments.

Seems to work.
Passes all tests.

Some remarks on qf_title_src.patch:
* Shouldn't the new qf_title argument to qf_init be commented? Same for
  qf_init_ext.

* Without the patch, the quickfix buffer name is '[Quickfix List]', with
  :csettitle it is '[Quickfix List] ' (note the extra space, visible via
  ':buffers'). Maybe we want to keep this consistently '[Quickfix List]'?
  Ditto for lsettitle.

* Changes at the end of hunk src/quickfix.c @@ -257,12 +319,13 @@, and hunk
  src/if_cscope.c @@ -1194,7 +1208,7 @@ are
  only prettyfying the source/adding comments and have nothing to do with the
  proposed feature.
  (I don't know if this is ok or not, I just wanted to mention it.)

* I also want to point out that the patch changes the semantics of buf_spname in
  src/buffer.c: buf_spname now returns an allocated string, which has to be
  freed by the caller. The patch takes care that all (other) calls to buf_spname
  free the returned string, but other patches might not be aware of this change,
  or this change might be considered as an unwanted side effect.

* In hunk @@ -5101,9 +5121,30 @@, _(btname) is unnecessarily called twice.
  Can't you assign btname = _("[Location List") right away?

* Could src/main.c, hunk @@ -662,10 +662,12 @@ use IObuff instead of introducing
  own buffer 'qf_title_buf[IOSIZE]'?

* The patch adds a terminating NUL at strings created with STRNCPY, which is
  fine. Maybe this could be done for other calls to STRNCPY, too, in a
  separate patch? And do this in src/buffer.c @@ -2554,8 +2555,11 @@,
  @@ -2974,8 +2979,11 @@, @@ -3659,8 +3672,11 @@,
  too (or add short comment why this is not necessary)?

* src/screen.c @@ -9342,8 +9342,12 @@ is STRCPY(NameBuff, bname). Do we know
  bname is shorter than NameBuff's size? At least, bname comes from some
  arbitrary command line.  src/memline.c @@ -1060,8 +1064,12 @@ uses STRNCPY.


Remarks for improvement:
* :[l]grepadd adds new matches to the location/error list. Should the title
  show this? Ditto for caddfile, etc.

* The generated quickfix title seems to be saved somewhere. Is it difficult to
  add :csettitle! and :lsettitle! which switch back to the generated/default
  name?

* When the error list is loaded with 'cfile /tmp/errors', could the title just
  say '/tmp/errors' or ':cfile /tmp/errors'. This would give a visual hint
  that the error list was loaded with a vim command and not by a program called
  'cfile'. Ditto for 'lfile', 'cgetfile', 'lgetfile'.

* Loading the error list from a buffer with 'cbuffer' just mentions the buffer
  number ("cbuffer 24"), which is not very helpful. Could the title also
  display the buffer name?


-- 
Andreas.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui