Questions tagged [file-header]

11 questions
7
votes
1 answer

Inserting/updating source file header comments

How can I insert header comments in source files of arbitrary languages? If the file is newly created, the header should be inserted. If a file already exists, then it should be possible to insert a header at the top of the file, or update as…
Kaushal Modi
  • 25,203
  • 3
  • 74
  • 179
3
votes
1 answer

How to have two different headers for two different modes with header2?

How to have two different headers for two different modes with header2? For instance, to have a header like : % ---------- % File-name : % ---------- when I create a .el file and a header like : # ---------- # Location : # ---------- when I…
P.-A.
  • 115
  • 10
2
votes
2 answers

How do I add text to every new buffer that I create?

Suppose I want to put my name and the date at the top of every new buffer that I create. How would I do that? Furthermore, suppose I want to use the name of the new buffer in the text that I want to place automatically, where what text is placed…
Prikshet Sharma
  • 237
  • 1
  • 3
1
vote
2 answers

Prepend text to files or buffers

Is there a function that allows to prepend text to a list of files / buffers? I tried this: (defun prepend-to-org-files (text) (let* ((path "~/Dropbox/org/database") (regex "org$") (org-files (directory-files-recursively path…
Ugur
  • 139
  • 1
  • 6
1
vote
0 answers

Including a header-section to text-file?

I'm occasionally writing fanfiction-stories as plain-text files in emacs. It would be great if emacs could add a "header-section" in the beginning of these documents, for example: Title: Author: Chapter: Series: Rating: Email: Some fields - like…
0
votes
1 answer

Insert boilerplate automatically when a new file is created

I have a commonly used c++ boilerplate for competitive coding (looks something like this), I'm looking for some way to insert this boilerplate code which is in a file named competitiveCoding/cpp_template.cpp automatically when ever I create a new…
Adeeb HS
  • 3
  • 2
0
votes
2 answers

How to use C header files in org-mode source code blocks?

I have a C code block in my org-mode document like the following: #+begin_src C :exports both #include "my_header.h" int main(void) { function_from_my_header(); return 0; } #+end_src When I have point inside the code block and C-c C-c to…
bashfuloctopus
  • 203
  • 1
  • 6
0
votes
1 answer

Auto insert include guard in cpp header when inside projectile project

I am currently learning C++ and I came across include guards to avoid double inclusion. Now I would like to use the google's style convention like this : // project/src/app.hpp #ifndef PROJECT_SRC_APP_HPP_ #define PROJECT_SRC_APP_HPP_ ... #endif …
johhnry
  • 31
  • 3
0
votes
1 answer

header2.el: insert header between second and third row?

I customized my own header and want it to be inserted between the second and the third line of the document. Unfortunately I'm not very used to Lisp, therefore I have a hard time trying to find the corresponding lines in header2.el. Any ideas on how…
quark
  • 43
  • 3
0
votes
1 answer

Automatic headers

I'm looking for an extension of emacs that automaticaly generate headers from source like C code. I made a script for this in the past using awk. I put my source path and it generate a header with all the function prototypes. I have look for…
user3593232
  • 383
  • 1
  • 8
0
votes
0 answers

header2 . . . how to use

I've just installed header2 from elpa and -- now what? I'm afraid I can't fathom where to begin with this beast. I'd like to make a custom org-mode header. Is there a tutorial somewhere that can get me going on it? I've only found the original…
147pm
  • 2,907
  • 1
  • 18
  • 39