Skip to main content

Questions tagged [macro]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
7 views

define an array in c using a macro as length in C [migrated]

I want to defined an array, the length from a macro as below, #define A (2.5) #define B (2.0) #define LEN (A*B) // I know LEN is an integer, not decimal numbers static int array[LEN] // define ...
Keely Darien's user avatar
12 votes
1 answer
3k views

Why does typing 'q' exit vim? (.man file)

When I type the character q on my keyboard in vim, it exits vim. Why? Today I tried it edit a file with the file extension .man. I wanted to edit the file with a macro, so I tried to type qq -- but ...
Michael Altfield's user avatar
1 vote
1 answer
70 views

Mutt: ask before deleting messages from Trash

I have defined in Mutt two "trash" macros -- one for the Trash folder (just mark as deleted and sync) and one for the remaining folders (save into Trash and sync): folder-hook . 'macro index ...
nvx's user avatar
  • 35
2 votes
1 answer
50 views

output redirection issue - m4 macro with self increasing build counter

My goal is to create a m4 macro, that reads a value from a file (BUILD), increases it and then saves the output into the file. I came up with the following solution (BUILD.m4): define(`__buildnumber__'...
bckmnn's user avatar
  • 23
1 vote
1 answer
758 views

How do I search for a string and then insert a newline at the beginning, for all lines in file?

I want to search an entire file for the string --- when it appears at the beginning of a line. I then want to insert a newline before each instance of that string. In my .vimrc file, I added this ...
Bastette's user avatar
0 votes
0 answers
325 views

How do I make an emoji macro keyboard for linux?

I want to make a macro keyboard that types emoji for my Raspberry Pi 4 with a quite old spare keyboard. I got this idea from Tom Scott (British youtuber) and he made it in windows. Although I could ...
NHbinaaa111's user avatar
0 votes
1 answer
834 views

Which RPM Spec Macro provides OS Minor in Release, eg el8_4?

How do I get the OS Minor in the Release field of the RPMs? I understand that the spec file entry %{?dist} expands to the OS Major Name: mypkg Version: 2.3 Release: 1.2%{?dist} ...
Amitava's user avatar
1 vote
1 answer
24 views

LibreOffice Upgrade from 3.5.4 to 4.3.3 Broke Lots of Macros

Recently upgraded from Debian Wheezy to Jessie (yeah, I know...). During said upgrade, the LibreOffice suite got upgraded from version 3.5.4 to 4.3.3. Well, lots of my Writer macros were broken after ...
Digger's user avatar
  • 405
0 votes
2 answers
456 views

Calling macdef macro within the .netrc file

I get this error: Unknown .netrc keyword $download The script reads: machine **.gov login anonymous password none macdef download cd some directory quit $ download
Barry 's user avatar
0 votes
1 answer
166 views

How can you customise headings in the ms package for groff?

I noticed there's a similar answered question here, but that one's pertaining to the me package. I'd like to know if and how, if so, is it possible to that using ms instead.
Jamie Ramone's user avatar
0 votes
0 answers
51 views

press the button continuously doesn't work after running macro with cnee

When I play a recorded macro with cnee, pressing a key continuously doesn't work anymore until the next system start. Is this a known problem?
o. kahn's user avatar
  • 21
1 vote
1 answer
958 views

RPM Spec file %setup macro when you don't know the root name?

How do I use the %setup macro if I don't know the root name of the archive. For example, in my case I have archive.tar.gz that extracts to myproject-<githsha>/ Each time I run that I may get a ...
Evan Carroll's user avatar
  • 31.7k
2 votes
1 answer
2k views

How can I find where an RPM macro is defined or what it expands to?

Inside of an RPM I have %{__install} %{SOURCE2} %{buildroot} I believe that %{__install} is a macro. Where do I find where it is defined? What is the definition? Was it provided by the system or ...
Evan Carroll's user avatar
  • 31.7k
0 votes
1 answer
2k views

How to resolve SAS macro variable in shell script

I am running a shell script via X command within a SAS macro. I want to use a macro variable defined in SAS macro, in my shell script. I know if I pass that macro variable as parameter to shell script,...
Deepak Malhotra's user avatar
14 votes
4 answers
9k views

Can I launch macros and shortcuts from a second keyboard on Linux?

I have a small numpad keyboard which I would like to use for launching macros and shortcuts, along side my regular keyboard. I can attach macros and shortcuts to these keys (i.e, numpad 1 minimises ...
umbro_tracksuit's user avatar
0 votes
1 answer
353 views

Mutt: Save message to different folder but stay on it

I'd like to write a macro (index, pager) that saves a message to the Archive mailbox but keep the current message open / selected, or even to to the previous entry. My current macro: macro index,...
sudoremo's user avatar
  • 103
1 vote
1 answer
495 views

Mutt: move emails only if some emails are tagged

I use mutt and I like to sort out some emails from various mailing lists. I still like them to come to my inbox, but when read, I want to move them somehow automatically. Currently, I do the ...
clem steredenn's user avatar
4 votes
2 answers
661 views

Undoing C syntax mangling macros to make exctags able to create prototype tags

I can successfully create a tags file for vim with exctags (Exuberant Ctags). However, creating tags allowing to jump to the prototype of a function does not work, due the system headers using a ...
Jens's user avatar
  • 1,787
1 vote
1 answer
867 views

LibreOffice placeholder fields documentation

I have to modify a LibreOffice template with a number of conditional statements. I managed to figure out one can add such statements through Insert > Fields > More fields, tab Functions, type ...
Skippy le Grand Gourou's user avatar
1 vote
1 answer
980 views

vim: how to record norm commands?

I edit and correct a lot of identical files using those commands :%norm f^ID :%s/\s\+$// :%norm A, :%norm GG$x I also used the macro mode qa for record macro a and @a to execute But for some ...
elbarna's user avatar
  • 12.8k
1 vote
1 answer
979 views

find and replace macro in libreoffice

How can I write a find and replace macro to merge many items in few, as "USA, Mexico, Canada, Honduras" in "America", "China, India, Vietnam" in "Asia" and so. Before macro: USA, Mexico, Canada, ...
Duns's user avatar
  • 111
2 votes
1 answer
2k views

Put long list of e-mail addresses in multiple-row macro variable

I have a list of 20 e-mail addresses that I'm trying to put in a macro variable as multiple rows in a shell script. In "wide" format it works fine and appears as: to_list="[email protected],email2@test....
RedFox's user avatar
  • 23
0 votes
1 answer
54 views

How to test whether the present build platform is Scientific Linux from within an RPM spec file?

I would like to test if the present build platform is Scientific Linux from within a spec file. But I want this test to only return true if and only if the platform is Scientific Linux, so even the ...
Josh Pinto's user avatar
  • 3,503
1 vote
1 answer
1k views

How to determine whether the system an RPM package is built on is CentOS from within a spec file?

I have a spec file where its Requires: fields depend on the specific distribution it's being built on. So I need to be able to create a conditional structure along the lines of: %if %{?fedora} ...
Josh Pinto's user avatar
  • 3,503
1 vote
1 answer
110 views

Global "swap characters" macro in KDE

After moving from OSX back to KDE I found the thing I'm missing most is the Cmd+t global shortcut that flips the characters surrounding the cursor, making it easy to fix typos. The important aspect of ...
kryger's user avatar
  • 115
3 votes
2 answers
5k views

Checking for required M4 macros... yelp.m4 not found

I am on Linux Mint 18 Cinnamon 64-bit. I was about to compile file-roller known as Archive manager for GNOME from source. But when running: ./autogen.sh There is a following M4 macro missing: ...
Vlastimil Burián's user avatar
4 votes
2 answers
29k views

Execute script from i3 config

Question: I'm using i3-wm and I have Mod3 working as a hotkey. I have the following in ./config/i3/config: #This command works bindsym Mod3+f exec "firefox" #This doesn't work nor do my other ...
Philip Kirkbride's user avatar
3 votes
1 answer
5k views

How to run batch sas job in unix sas?

I have 5 SAS jobs that I need to run sequentially, one after the other. I typically type in nohup sas filename1.sas & in the command line to run and manually check for progress every few hours. ...
SuperKing's user avatar
1 vote
2 answers
390 views

m4 macro implementation of global (non-volatile) counter

Is it possible to define a m4 macro (without arguments), which expands to 1 on first invocation, expands to 2 on second invocation, and so on? In other words, it should have internal memory storing ...
adgadg's user avatar
  • 69
3 votes
2 answers
752 views

Can mutt macros obtain properties from the current message?

In mutt, can macros can obtain some of the properties from the current message, in order to use them as variables? Here are some examples of potential macros, with the properties I'd wish to obtain in ...
Sparhawk's user avatar
  • 20.1k
2 votes
2 answers
1k views

Auto-Complete and Shortcut Keys for Linux

I'm looking for something that will allow me to type anywhere, on anything and for this software to auto-complete. I used FastKeys on Windows which would also allow you to do custom shortcuts to open ...
Mike Wentworth's user avatar
1 vote
2 answers
489 views

Create files from templates, substitutions in middle of other words

Is there a way to convince m4 to replace a macro in the middle of a word? I would like this file, day.m4: define(Sat,Cat)dnl Saturday and this command: m4 day.m4 to produce this output: Caturday ...
Praxeolitic's user avatar
  • 1,678
2 votes
1 answer
3k views

Gmake macro expansion: macro calls macro with variable in arguments

In the following makeffile one macro process it's arguments to call another macro. I expect that makefile below will generate two targets and correct list of the targets in $TARGETS. But in fact it ...
gena2x's user avatar
  • 2,397
1 vote
1 answer
825 views

dot command in Vim, last change?

The dot command in Vim repeats the "last change", but I am not exactly sure what constitutes the "last change". For example, if I type the sequence: A;{ESC}j. Then a semi-colon is appended to the ...
Tyler Durden's user avatar
  • 5,763
3 votes
1 answer
2k views

mutt: ask for confirmation before moving message to archive

I have following macro defined in my muttrc: macro index s ":set confirmappend=no delete=yes auto_tag=yes\n\ <save-message>=archive\n<sync-mailbox>:set delete=ask-yes\n" When I ...
Martin Vegter's user avatar
151 votes
6 answers
387k views

How to comment multiple lines at once? [duplicate]

How can I select a bunch of text and comment it all out? Currently I go to the first line, go to insert mode then type # left-arrowdown-arrow and then I repeat that sequence, perhaps saving a few ...
Michael Durrant's user avatar
2 votes
1 answer
2k views

Send keystrokes to a process on Console

If I have a terminal with a shell open, how can I write a shell script (any scripting language is ok with me!) that will send a keystroke to any one of the running processes? As an example, how could ...
themirror's user avatar
  • 7,028
2 votes
2 answers
3k views

How to run a script by shortkey in elementaryOS?

I want to be able to run certain scripts by shortcut the way I do in ubuntu - for example some similar to this awesome script. (On that model I can search google the text selected in any text editor, ...
user avatar
1 vote
0 answers
573 views

How to setup keyboard shortcut that enters predefined text into X11 xterminal via SSH from mac OS?

I do a lot of remote programming on my CentOS linux server by opening an X11 xterminal window on my Mac OS, and SSH into the server. I'm looking for an easy to use method to enter a predefined text ...
user42606's user avatar
8 votes
3 answers
4k views

Interacting with X applications programmatically

I have an application which is built using GTK+. The application has a very simple interface. When started, the same window always opens, with a few input controls. We want to write a script to fill ...
Tom Marthenal's user avatar
1 vote
1 answer
92 views

Emacs: mode-local macro with dashes and dots

In Emacs, how can I make a macro, that is local to the HTML mode, and uses dashes and dots? Take a look at the Elisp below: (define-abbrev-table 'html-mode-abbrev-table '(("..." "&hellip;") ;...
Emanuel Berg's user avatar
  • 6,921
2 votes
1 answer
209 views

Expand pattern under cursor to all files matching it

Is there anyway to let VIM expand the glob pattern to all files that match it? e.g when I type *.c, and press some key, it would become a.c b.c
daisy's user avatar
  • 54.8k
2 votes
0 answers
80 views

Handle local links to local files in emacs

I have a LaTeX document where I often have to insert pathnames of files on my machine of other LaTeX files. Is there a way in emacs do get the following: A command which opens a file selection ...
student's user avatar
  • 18.5k
22 votes
5 answers
28k views

Keyboard Shortcut To Send Text Strings To Program

How can I configure a shortcut key to send a text string to the current program? The purpose is to type common entries quicker (email address, street address, phone number, username, favorite quote, ...
Steven's user avatar
  • 738
1 vote
1 answer
536 views

Is it possible to have a screen macro for this?

Here's my .screenrc: defscrollback 5000 vbell on vbell_msg " dierre!!! ---- Wuff!! " screen -t GRINDER ssh [email protected] screen -t TRUNK attrcolor b ".I" termcap xterm 'Co#256:AB=\...
dierre's user avatar
  • 645
5 votes
3 answers
203 views

Making shortcuts cross desktop environment, possible?

I'm a big fan of keyboards, so a lot of thing a done by combination of keys, like open a file browser, web browser etc. Is there some daemon that can monitor my key presses, and launch some program ...
daisy's user avatar
  • 54.8k
4 votes
2 answers
475 views

Vim markers and macros

Is there a way to make a macro operate up to a marker? I know if I do 5@a my macro will operate on 5 lines. Example: set marker with `mc` record a macro with `qa` ... now what? Obviously 'c@a just ...
zje's user avatar
  • 2,301
14 votes
4 answers
2k views

Is there a vim shortcut for <name of current file>?

In vim, if I'm working on a Python script, I will commonly type: :! python this_script.py to execute the script. Is there a shortcut for the name of the current file? If not, can I easily make one? ...
Eric Wilson's user avatar
  • 4,792
4 votes
1 answer
2k views

Automating typing strings in xmacro

Could you show me how to write macro in xmacro (that will work in whole desktop environment) that is able to expand strings? E.g. I will type "thx" and it will expand to "thank you".
xralf's user avatar
  • 15.2k
15 votes
2 answers
8k views

How to invoke an Openoffice macro from the Linux command line

I have an OpenOfice macro that I want to use to process the contents of an OpenOffice file. I am able to do this by opening the file with OpenOffice and then running the macro. How do I invoke the ...
CW Holeman II's user avatar