I have some text "bar" contained in files FOO and foo.cc.
Is there a way to tell ack-grep to search inside files with no extension (namely FOO)?
I've tried something like this:
ack-grep --type-set=foo=FOO bar
which returns the text in foo.cc, but not file FOO.
I've also added the --type-set to my .ackrc file, calling
ack-grep --help-types
shows that ack-grep is looking for .FOO files.
You can combine ack-grep's -a (search everything) with -G (only search files that match a given regex). Something like:
ack-grep -a -G '^[^.]+$' what-to-search-for
should do the trick.
Under ack2 you have to define a custom type:
ack-grep --WANTED --type-set WANTED:match:^[^.]+$ what-to-search-for
works for me.
My ack is of version 2.12. Bellow command should work.
$ ack --type-set make:is:Makefile --type=make string-pattern
So similarly,
$ ack --type-set foo:is:FOO --type=foo string-pattern
You cannot do what you want with ack 1.x. You need to upgrade to ack 2.0.
ack 1.x did not have a way to deal with files without extensions. ack 2.0 adds a much more flexible file-specification system.
Related
How bb translation works together?
When I used bb b -l 1 worked fine but there is still needed to rewrite all strings for other languages.
bb t -a adds new language, e.g. "cs-CZ" and creates json file with language code.
The question is how can I export/import all strings into json file to translation?
bb t -e - fileName is json or js in dist? Export doesn't work in my case no strings are exported.
bb t -e filename.txt -l cs-CZ is correct way to export untranslated strings to text file with very simple structure. After it will get back from translation agency you can just import it by bb t -i filename.txt -l cs-CS.
Before exporting always update translation files by bb b -l 1 -u 1 as you already find out. Actual JSON files in translations directory contains array of arrays of 3 or 4 items [original, hint, 0/1 - with/out parameters, translation]. So you can directly translate them if you will create some editor for these...
Also please update bobril-build to 0.56.1, I just fixed wrong error message in export even-though everything was ok. Maybe that confuse you so you have to ask, sorry for that.
I would like to change package prefix and suffix in my ant build while generating java from idl. This has to be generic solution! The idea goes like that:
I have idl files (ONE.idl, TWO.idl) with namespace ONE_cb in first and TWO_cb in second (as _cb suffix is required for c++ compatibility). TWO_cb has atributes from ONE_cb, ONE_cb has only basic types. I want to change that to packages going like com.example.ONE and com.example.TWO.
I'm using JacORB 3.6. and I don't know how to do it.
My code looks like that:
<target name="idlj-generate">
<idl2java
srcdir="${psm.dir}/${project}/"
destdir="${build.generated.dir}"
includepath="${psm.dir}"
all="true">
<define key="__JACORB_GENERATE__"/>
<i2jpackage names=":com.example"/>
<i2jpackage names="_cb:"/>
</idl2java>
</target>
It doesn't work. As I stated before it has to be generic solution. adding
<i2jpackage names="TWO_cb:TWO"/> //option 2
<i2jpackage names="ONE_cb:ONE"/> //option 2b
Is not acceptable
Thank you for Your time.
If I understand you correctly you have something like
module ONE_cb
{
...
}
but you want it to be
com.example.ONE { ... }
This is feasible with i2jpackage e.g.
idl -forceOverwrite -d /tmp/generated -i2jpackage ONE_cb:com.example.ONE myfile.idl
The problem you have is that you are compiling both files at once. Remove the "all" and try compiling them in two phases.
If you are using Maven I would also recommend trying org.codehaus.mojo:idlj-maven-plugin as you can do multiple executions very easily with that.
To use multiple i2jpackage I got it working with
idl -forceOverwrite -d /tmp/generated -all -i2jpackagefile /tmp/file antBugJac608-2.idl
(where antBugJac608-2 #includes antBugJac608).
For various research I concluded that generic solution is immpossible.
Only way to perform changing prefix and suffix the same time is to explicite set all included names.
Spanish chracter and some spaceial chracter not allowed in Imagmagick when creating images from pdf.
There is showing error message "no decode delegate for this image".
Can i ignore that text while creating images from pdf.
Any solution for this?
Thanks!
Try running the following:
convert -list configure | grep -i "DELEGATES"
What does that mean?
**convert -list configure** - displays your imagemagick configuration
**grep -i "DELEGATES"** - takes the results from above and does a case insensitive search for what you're looking for, in this case, you're looking for the section marked DELEGATES
This should return all of the packages that you need in order to run your command.
Using your favorite package manage ( apt, yum,brew, etc ), install those packages ( including their development packages ), then try again.
Here is a thread you can check out, where someone had a very similar issue:
http://www.imagemagick.org/discourse-server/viewtopic.php?t=22488
Hope this helps!
I've just installed via elpa auto-complete 1.4 and I can see the directory in my .emacs.d/elpa/ folder. Now what do I do? I've tried various .emacs lines, but I'm never sure what an elpa install really does and what I would still need to do to my .emacs file. AFA Emacs is concerned, it can't find auto-complete. I saw this on another install:
(add-to-list 'load-path "~/.emacs.d")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "/home/memyselfi/.emacs.d/ac-dict")
(ac-config-default)
(add-to-list 'ac-modes 'lisp-mode)
(require 'auto-complete)
. . . but this doesn't work. Actually, I'd like auto-complete to do the advance guess/autocomplete in the minibuffer, as when it suggests files, commands, etc.
auto-complete does not do fuzzy matching in the minibuffer.
You probably want to enable ido-mode.
Try putting this in your init.el
(ido-mode t) ;; auto-completes file-names etc
(setq ido-enable-flex-matching t) ;; enables fuzzy matching
There are other packages that do this, but ido-mode comes standard with Emacs, so is probably easiest to get going.
I am looking for command line tool to do diff between two HTML files.
I have analysed kdiff3/command line of bbedit but my problem is dont want to open any GUI.
I want to write a java program to call command line options of the diff program to compare html files and save result in a different file or probably show in a report file.
Any pointers will be very helpful
Thanks
Vishal
If you have xcode installed, you can call up opendiff, it's a (graphical) compare tool from the command line. From it's man page:
opendiff file1 file2 [-ancestor ancestorFile] [-merge mergeFile]
opendiff dir1 dir2 [-ancestor ancestorDirectory] [-merge mergeDirectory]
I thought mac had diff built in. Have you tried using diff from the mac terminal?