texts: Show the current command line the frame title in a GDB session

texts:
I sometimes run multiple instances of Emacs, each running a GDB session. These GDB sessions are often running different versions of the same program, or the same program with different arguments, so I'd like the frame title to indicate what program is running, with what arguments, and in what directory.

Right now I'm doing it with

(set-frame-name (format "gdb: %s (%s)" command-string default-directory))

where command-string is the command line that GDB runs. But this doesn't change when I use commands such as cd, file or set args in GDB.

How can I keep the frame title automatically updated when I change the debugged file, run it with different arguments, or change to another directory?

For example, suppose I start Emacs telling it to run myprogram foo. The frame title would initially be something like gdb: myprogram foo (/some/path). I run set args bar, I want this to automatically update the frame title to gdb: myprogram bar (/some/path). If I run file myotherprogram then the frame title should change to gdb: myotherprogram (/some/path), and so on.

It's ok to assume that there is exactly one Gdb session in this Emacs instance and that there is a single frame. It's ok to use something other than set-frame-name to set the frame title initially — anything that works.


texts: Is there a gccemacs (native-comp) build for MS-Windows?

texts: I use the official binaries (28.0.50 prerelease) for MS Windows. I am using gccemacs on my home Linux machines, and feel like native-comp on Windows would be really useful for me at work. However, I don't have a MingW toolchain installed. Is anyone providing gccemacs binaries for MS-Windows?


texts:
I've used emacs in various configurations over the years, but the one aspect I couldn't find a good proxy for is relative directory logic.

My goal is to use evil-mode + web-mode. I'm not interested in doing everything possible in emacs. I just want really good vim emulation and syntax highlighting. I think emacs does a better job of these things at the cost of added complexity and trying to parse emacs-lisp.

In Sublime Text you can "open a folder" and then when you go to open a file it assumes it's contained within the "current" directory.

In VIM I can "cd" to a directory and all all files I open are relative to that directory i.e. "e foo/bar.py" in the command prompt assumes current_directory/foo/bar.py.

tl;dr Is there a simple way to "cd" to a folder, so that opening and searching for files to open are relative to that folder? I've tried dired & projectile but wonder if there's a much simpler option that more closely maps to the UX of vim.


texts:
I need to call a function and perform a cleanup only if the function fails, and then relaunch the error.  Here is the pseudo-code:

(condition-case err
    (call-function)
  (error
   (cleanup)
   ;; how do I raise `err`?
   ))


texts: Running emacsclient causes some flashing effect to happen on other frames

texts:
I picked up this code from:

Is there any way to run a hook function only once?

(setq myGraphicModeHash (make-hash-table :test 'equal :size 2))
(puthash "gui" t myGraphicModeHash)
(puthash "term" t myGraphicModeHash)
(defun emacsclient-setup-theme-function (frame)
  (let ((gui (gethash "gui" myGraphicModeHash))
        (ter (gethash "term" myGraphicModeHash)))
    (progn
      (select-frame frame)
      (when (or gui ter)
        (progn
          ;; setup the smart-mode-line and its theme
          (setq sml/no-confirm-load-theme t)
          (sml/setup)
          (sml/apply-theme 'dark)
          (load-theme 'material t)
          (if (display-graphic-p)
              (puthash "gui" nil myGraphicModeHash)
            (puthash "term" nil myGraphicModeHash))))
      (when (not (and gui ter))
        (remove-hook 'after-make-frame-functions 'emacsclient-setup-theme-function)))))
(if (daemonp)
    (add-hook 'after-make-frame-functions 'emacsclient-setup-theme-function)
  (progn
    (setq sml/no-confirm-load-theme t)
    (sml/setup)
    (load-theme 'material t)
    ))

starting the first frame runs fine, the second frame causes the flash effect and the rest of new frames have no problem. It is just the second starting frame that still has this issue. OP in the above link says that the code fixed it for him, What is my code missing?


texts: org-mode , export , how to 'force' newline on lines between paragraphs?

texts:
I have an org-mode file, some sub-sections have some big paragraphs.
When I export as html the whole paragraphs are displayed as single lines.

I understand that I have to put a '\\' on every line, a bit PITA, its around 4000 lines there. Is there any way, a parameter perhaps, that forces new line to each line that sits between paragraphs?

thx


texts: Customizing indentation in makefile mode?

texts:
In my makefiles, I prefer the following indentation for continuation lines:

FILES:=                \
    file1.cpp          \
    file2.cpp          \
    fileYetAnother.cpp

LIBS:=                 \
    libsth1.so         \
    libelsewhere.so

still, makefile mode indents it in the following way (when asked to reindent file or region):

FILES:=            \
file1.cpp          \
file2.cpp          \
fileYetAnother.cpp

LIBS:=             \
libsth1.so         \
libelsewhere.so

Is it possible to configure it somehow to use the former variant (= indent continuation lines by 4 spaces or tab) ?


texts: docview: suppress "File X is too large, really open?" confirmation

texts:
Is it possible to avoid the "File X is too large, really open?" confirmation?

If not, would it be possible for Emacs to remember my answer the first time I visited a large file? If I visited it once, I will surely want to really visit it again.


texts: How to prevent Emacs from converting JavaScript symbols to HTML code?

texts:
When I insert a portion of JavaScript code within an HTML file, Emacs convert some basic JS symbols to their HTML code. For example when I type >, Emacs convert it automatically to &gt; which this makes it impossible to code JS.

How to circumvent this issue?

EDIT:

Here is the content of my .emacs file:

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(ansi-color-faces-vector
   [default default default italic underline success warning error])
 '(custom-enabled-themes (quote (tango-dark)))
 '(package-selected-packages (quote (js2-mode green-is-the-new-black-theme))))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
(package-initialize)
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(add-to-list 'package-archives '("melpa-stable" . "http://melpa-stable.milkbox.net/packages/"))

(require 'green-is-the-new-black-theme)

(setq column-number-mode t)

(setq-default indent-tabs-mode nil)

(setq sgml-quick-keys 'indent)

;; For JavaScript
(require 'js2-mode)
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
;; Better imenu
(add-hook 'js2-mode-hook #'js2-imenu-extras-mode)


texts:
I tried to convert a texinfo file to an org file:

pandoc --wrap=none calendar.texi  -o calendar.org

Unfortunately, it outputs a messy text.

Since texinfo act as emacs default markup language, while org act the king extension.

Is there an easy solution to perform such a conversion?


texts: make `previous-buffer` and `next-buffer` to ignore some buffers

texts: in Helm I ignore some buffers from showing when using C-x b, I'm looking for a way to make the commands previous-buffer and next-buffer behave the same ignoring some buffers.


texts: Have shell inherit buffer local process-environment

texts:
I have made buffer local changes to `process-environment' using the technique described in How can I get buffer-local environment variables via .dir-locals. I then call shell from that buffer. If I then view the environment variables in that shell using the following command, the buffer local changes are not included.

set | sort

I have used C-h v process-environment to confirm that the buffer local changes were made. However, if I added a variable in the buffer local process-environment it is not available in the shell.

For example, I set the environment variable P4ROOT in the buffer local process-environment. When I open a shell from that buffer, the P4ROOT environment variable is not set in the shell.


texts: How do I override a keybinding defined by evil-mode?

texts:
I've searched for this before but I've only seen questions like the below:

https://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs
How to override major mode bindings

I don't have an understanding of what a major / minor mode really is (which both questions reference) (or whether it's relevant).

I'm trying to redefine the - key when I'm editing any file. It's currently defined by the evil-mode package in:

evil-maps.el:

243:(define-key evil-motion-state-map "-" 'evil-previous-line-first-non-blank)

How would I go about redefining this to instead run a other function? What are my options - and their implications?

I've managed to what I assume redefines the keybinding by adding the following to my .spacemacs user-config:

  (define-key evil-motion-state-map "-" 'deer)

Which works, but it feels a bit hacky / cumbersome in case it ever conflicts with a future keybinding with another package.


texts:
Is it possible to use occur or something else to edit multiple lines of code within a certain tag. For example:
#*
some code
some more code
#*

I've tried using occur, but it edits only the first line -- the line that gets a line number. In multiline match, the rest of the lines don't get a line number.
Basic example, I've tried using occur interactively for this:
#*
p
#*

M-x occur then #*C-qC-jpC-qC-j#*:
30:#*
  :p
  :#*

Then e in occur mode and C-c C-c to finish editing. Only the edits on the first line with line number 30 got passed on to the source file.


texts:
evil-vimish-fold is really great for custom folds. However it's not clear to me how you would accomplish syntax based folds.

Does evil-vimish-fold work with JavaScript mode? Can I set evil-vimish-fold's foldmethod

The following is what I would do in vim ftplugin/javascript.vim

syntax region foldBraces start=/{/ end=/}/ transparent fold keepend extend
setlocal foldmethod=syntax
setlocal foldlevel=99


texts: How to bind a key in Evil Spacemacs when the leader key is comma?

texts:
I have rebound "SPC m c" so it opens a file (from How to a create keybinding to open a particular file?):

(spacemacs/set-leader-keys "mc" (lambda () (interactive) (find-file "~/capture.org")))

And it opens the file as intended, because spacemacs/set-leader-keys is for binding with the leader key SPC.

Now I want to bind the same thing to ", c".
How to bind a key when the leader key is comma?

I am using Emacs 25.2.1 with Evil Spacemacs on Linux.

UPDATE_1

I put this in ~/.spacemacs but then Emacs would say "Spacemacs encountered an error while loading your ~/.spacemacs file.":

(define-key evil-normal-state-map ",c" (lambda () (interactive) (find-file "~/capture.org")))

I put this in ~/.spacemacs but it had no effect (", c" opened agenda dispatcher as usual):

(with-eval-after-load 'evil-maps
  (define-key evil-normal-state-map ",c" (lambda () (interactive) (find-file "~/capture.org"))))


texts: Export latex-pdf and loose references: how to fix?

texts:
When I export a org file in latex and generate the pdf (recompiling after a modification in the org file), the pdf file loose the references to section and citation. Here is the line in my .emacs

(setq org-latex-pdf-process
  '("latexmk -pdflatex='pdflatex -interaction nonstopmode' -bibtex -f -pdf %f"))

I have to manually delete the bbl file and compile again so that the pdf shows the right references. How to I do that automatically?


texts: org-agenda-sorting-strategy: items containing no time-of-day specification first

texts:
The manual says

  For the daily/weekly agenda, the items for each day are sorted. The
  default order is to first collect all items containing an explicit
  time-of-day specification.

    8:30-13:00 Arthur Dent lies in front of the bulldozer
    12:45...... Ford Prefect arrives and takes Arthur to the pub
    14:00-15:00 TODO Call John regarding memo
    19:00...... The Vogon reads his poem
    20:30-22:15 Marvin escorts the Hitchhikers to the bridge
    TODO send newsletter to mailing list
    TODO buy John birthday gift           :errands:
    Internship period for Alex

How can I tweak `org-agenda-sorting-strategy' so that I can first display all items containing no time-of-day specification like in

    Internship period for Alex
    TODO send newsletter to mailing list
    TODO buy John birthday gift           :errands:
    8:30-13:00 Arthur Dent lies in front of the bulldozer
    12:45...... Ford Prefect arrives and takes Arthur to the pub
    14:00-15:00 TODO Call John regarding memo
    19:00...... The Vogon reads his poem
    20:30-22:15 Marvin escorts the Hitchhikers to the bridge


texts:
An Emacs configuration is vital to an effective efficient workflow thus it would advantageous to have ubiquitous access to the Emacs, I have laboriously, setup. I would prefer mobile storage solution because of internet restrictions and problematic connections, and the difficultly and hassle associated with transport a computer. I have try consulting searching for the solution - even venturing beyond the first page of results - and have not found something that works well.

Relocating the initialization file for Emacs, of which there are several examples, however by default Emacs still has problems and requires a native init to redirect it and tends to want to find package files on the drive. Portable apps has Emacs which installed and seems quite promising, because it's specifically designed for this purpose, though has difficulty installing packages as in using the standard package.el seems missing and require package in my _emacs throws errors.

Finally if its necessary or preferable to store Emacs configurations online then is it possible and how would one pursue using google drive, as the storage solution, rather then dropbox which I have seen as an option.


texts: Adding padding between the fringe and the text

texts:
How can I add padding between the right side of the fringe and the left side of my code?
I have tried using (set-window-margins nil 1) but the margin is on the left side of the fringe. I'd like to have it on the right side, for more reading clarity (see capture below)

EDIT : I forgot to mention that I'm using Emacs in GUI mode on Windows


texts: Powerline: how to show whether buffer is modified more prominently

texts:
I've just installed powerline to update my emacs looks for the 21. century.
I like it, but I'm bothered that the modified-buffer indicator is just a simple, barely discernible asterisk.

Is there a way to make the fact that the buffer is modified to be more eye-catching?

My config up to now is very simple:

(use-package powerline
  :config
  (setq powerline-display-buffer-size nil)
  (setq powerline-display-mule-info nil)
  (setq powerline-display-hud nil)
  (which-function-mode)
  (when (display-graphic-p)
    (powerline-default-theme)))

Is there a simple way to change certain faces without creating custom poweline themes (I also don't like the color of the (which-function-mode) output.

Thank you very much!


texts: How to add function call highlighting in ESS?

texts: I currently have some syntax highlighting in my ESS code (e.g., for brackets, =, and strings). I would like to add highlighting of function calls, like RStudio's "Highlight R function calls" option. How can I do this?


texts: How do I write a function to replace specific Markdown text?

texts:
At work, I mostly use Emacs for all my programming and text editing but I wouldn't really say I'm a pro. I'm more like beginner or intermediate so I'm not sure if this is really even a question.

I have been tasked with migrating our documentation from LaTeX to Markdown (Our own flavor of Markdown) and after converting to vanilla markdown with pandoc, I have found myself repeating the following pattern a lot.

Say I need to include an image in the .md file from the figures/ directory. My markdown will look something like this

![Fission gas release experimental comparison of IFA-535 rod 809 during
the ramp test.](rod809_fgr){width="4in"}

And I need to convert it to this

!media figures/rod809_fgr.png
    id=rod809_fgr
    caption=Fission gas release experimental comparison of IFA-535 rod 809 during the ramp test.
    style=width:50%

Notice how the file name in the parenths (rod809_fgr) became figures/rod809_fgr.png and id=rod809_fgr and the description was put into the caption. Also the text was indented a specific way.

How can I write a Lisp function that highlights the original markdown and gives me the output I want? Once again, not too familiar with Lisp and still a beginner with Emacs.


texts: I'm managing workspaces by creating new frames, but running C-x 5 C-h couldn't find anything like "run command in new frame", basically what I'd like to do is to run some REPL or shell in new frame. Is it possible?


texts: Can't make emacs compile with locally installed harfbuzz

texts:
Whenever I start the ./configure script for emacs at the end of it I get the following message:
configure: WARNING: This configuration uses the Cairo graphics library,
    but not the HarfBuzz font shaping library (minimum version 0.9.42).
    We recommend the use of HarfBuzz when using Cairo, please install
    appropriate HarfBuzz development packages.

I compiled and installed harfbuzz 2.7.2 in my ~/opt/harfbuzz-2.7.2 directory. In my .profile I put:
export CPPFLAGS="-I/home/myuser/opt/harfbuzz-2.7.2/include/ $CPPFLAGS"
export LDFLAGS="-L/home/myuser/opt/harfbuzz-2.7.2/lib/ $LDFLAGS"

But emacs configure doesn't pick it up. I guess it only finds my system harfbuzz-dev (debian 8, not recent enough).
What do I need to do to make configure understand where harfbuzz is? Do I need to recompile Cairo?


texts: Org mode attachments: how to change the default directory for added attachment folders?

texts: I am using org mode and its attachment functionality, letting me make a directory attached to a task (C-cC-as). The default folder is not the one I would like it to be. How can I change the default folder? Can I somehow call the function org-attach-set-directory in my init file to change this default folder?


texts: How to get emacs to prompt when a new buffer is changed on save?

texts:
for background, I am an emacs newbie and long time unix user... What I am trying to do is to work in emacs in a pattern that is familiar to someone who has used a windows, linux, mac text editor such as notepad, vi, textwrangler, etc:

Open the editor
Open a blank buffer if necessary (sometimes called Untitled)
Type and edit text
Exit the editor after being asked to save the changes to the buffer

In my experience, this is not how it works in emacs, but I am hoping to hear from y'all about how it can be, or how my thinking about editing might be changed for the better. Here is how it seems to work in emacs:

Open the editor emacs
Open a blank buffer C-x b Untitled
Type and edit some text
Exit the editor...

Oops, after losing some changes without prompting, I caught on that this wasn't an ideal workflow (call me slow), so I thought about alternatives and tried visiting a new file instead of a new buffer: C-x C-f Untitled, but this meant I had to provide a path and be saddled with it throughout the life of the session - meaning that when exiting, emacs would think that was where it should save the file (reasonable of emacs really). I don't like having to provide this information up-front as I may not want to save my edits later.

So, my question, is it possible to replicate the workflow above in an emacsy way, ie. prompt on changes to a buffer, but only buffers like the described Untitled, not *Messages*, or am I just thinking wrongly and there's a better workflow that I'm somehow overlooking?

If this is duplicated elsewhere, please point that out, I searched, but searches are fickle.


texts: Repeat regexp from isearc-forward-regexp on a subsequent replace-regexp?

texts:
I use C-M-s to search for a regexp. Then I use M-x replace-regexp to replace the same regexp with some string. Can I save typing the regexp for the second time?

Generally, when typing an argument for a command, and then the same argument for a different command, can I save typing the argument for the second time?


texts: How can I get the same emacs experience on any computer?

texts:
I really enjoy my emacs config (the autocomplete and indentation settings, the use of things like jedi and tern etc.)

Most of the time I use emacs at home on my personal macbook pro laptop but I am wondering if there is a way I could make my system more portable.  I already store my .emacs.d on github, but my dream is that I could go to any computer in the world and somehow recreate my experience.

It is strange because even when I have cloned my repo into a remote machine and ssh'd into that remote machine, most things are completely different.

Beginning with the theme, my understanding is that this has something to do with the way the host (computer I am on) terminal is setup.  For instance it might not support colors.

But, should autocomplete drop downs like those for tern and jedi still work when I am ssh'd in?

I would very much appreciate any suggestions on how I could best recreate my emacs experience on a remote machine.

Thank


texts: Calfw calendar: how to apply different colors to just a type of Holidays?

texts:
I am happy with Calfw calendar, but I would like to see the "Solar Holidays" without confusing them with regular holidays.

By now I have set them as nil:

(setq holiday-solar-holidays nil)

But, could I apply them a different color?, like:

 '(cfw:face-holiday ((t :background "grey10" :foreground "#8c5353" :weight bold)))

But applying just for solar-holidays?


texts: How can I globally replace C-c with another key binding?

texts:
The key combination C-c is not convenient to type in the keyboard layout I use, and I'm trying to do change it globally. The goal is to replace every occurrence of C-c with another binding <apps> d, such that sending a message in Gnus would be <apps> d <apps> d, compiling in auxtex would be the same, and the user prefix key C-c would also always be <apps> d. The key <apps> is <f19> on my keyboard.

Reading the manual, it seems that I need to use key-translation map. It does work great with the translation of <f19> to <apps>

(define-key key-translation-map (kbd "<f19>") (kbd "<apps>"))
(global-set-key (kbd "<apps> s") 'save-buffer)

Unfortunately, it does not work when I want to do this for C-c.

(define-key key-translation-map (kbd "<apps> d") (kbd "C-c"))

When I try to use it, I get

<apps> d is undefined

and if I look it up (C-h k), I see

<apps> d (translated from <f19> d) is undefined

Is there a way to make this work?


texts: M-x query-replace but replace all in a file

texts: I can do M-x query-replace and replace all strings with another one. But it only replaces ones below the current cursor position. Is there any way to replace all the occurrences regardless the position of the cursor?


texts: Show compilation errors with async export in org-mode?

texts:
When exporting to PDF via LaTeX, compilation errors are shown in a buffer Org PDF LaTeX output, which is fine but can be time-consuming.

Using async export is faster but I do know how to show the compilation errors. The documentation only talks about an "export stack" (C-u C-u and C-c C-e), which only shows a list of process like :

# Backend Age  Source
1 latex   0:05 /home/john/test.tex

I would like

to know if the compilation is successful
otherwise, to show the error log

Thanks !


texts: Unicode character display in emacs info under Chromebook secure shell

texts:
This may not be an Emacs configuration issue, but here are the symptoms:

On a Chromebook, I'm using chrome's Secure Shell Extension v0.18 to
ssh in to an Ubuntu 16.04 host, LANG set to en_US.UTF-8, and
Run Emacs 24.5.1 in the terminal via emacs -nw, and
Pull up the Gnu Calc info documentation, and search for calc-exp

It displays \u entities in the *info* buffer (below), which are all Unicode left/right single quotes.  However, I couldn't find anything in searches, and viewing the info file directly using less showed the characters in angle brackets and hex digits.

I'd appreciate it if someone could even just note if/where they can see *info* come up similarly, maybe using a different ssh client or Emacs/Ubuntu version.

Verbatim from *info* buffer:

The \u2018B\u2019 (\u2018calc-log\u2019) [\u2018log\u2019] command computes a logarithm to any
base.  For example, \u20181024 <RET> 2 B\u2019 produces 10, since \u20182^10 = 1024\u2019.

Verbatim from less:

The <E2><80><98>B<E2><80><99> (<E2><80><98>calc-log<E2><80><99>) [<E2><80><98>log<E2><80><99>] command computes a logarithm to any
base.  For example, <E2><80><98>1024 <RET> 2 B<E2><80><99> produces 10, since <E2><80><98>2^10 = 1024<E2><80><99>.


texts:
From org-refile to a known fixed location I have learned that the argument RFLOC looks like this:

'(heading file regular-expression position-of-target-heading)

I am trying to programmatically refile a subtree to become the child of a given heading. This is easy, manually, as long as I have (file :maxlevel . 1) as part of the org-refile-targets.

With point on the heading of the subtree, I call (org-refile nil nil ("Projects" "/tmp/projects.org" nil nil)). This does refile to the /tmp/projects.org file but the refiled subtree becomes a sibling of Projects, not a child.

How can I change my code so that the subtree properly moves under Projects ?


texts: Can an emacs command tell if it was called via key binding or via M-x command-name?

texts:
Is there a way to program some Emacs command in elisp that could tell whether it is called interactively through some key binding or by typing its full name after M-x? I thought this could be done using called-interactively-p but it seems that it isn't.

My motivation: if called via M-x command-name, the command would gently remind me of the key binding. Would be great for learning again key bindings that I have forgotten after some lapse in usage.


texts:
Org mode lets you monospace text by enclosing it within = signs. However, I don't think the regex actually considers if it is a "starting" = or a "closing" =.

Example: =s[=$i$=]= renders not only the s[ and ] as monospace, but also the enclosed $i$, which is not what I want. Another example:

In =bar=s case, blabla, =something monospaced=

This monospaces  not only bar and something monospaced, but also the text within, i.e. s case, blablabla,. I have to insert a space between =bar= and the following s, but this is not something I want to do. Any help?


texts:
I want to replace the regular expression `.*` by bolding .* and not displaying the backticks. So I want `elem` to become elem

I looked into these questions about how to prettify strings rather than chars:

Using Prettify Symbols with strings instead of characters

prettify-symbols-mode and multi-character replacements?

I do not understand the answers however. But the answer to this question states prettify-symbols does not support regular expressions anyway and that one needs to use font lock keywords. The wiki entry is not exactly helpful in my opinion; it does not show what the code on the page actually does, but as far as I understand it, apparently it coincidentally is supposed to make some keywords bold (page uses the word highlight... whatever that is supposed to mean here). So I copied and modified it into my init.el like so:

(font-lock-add-keywords 'haskell-mode
                    '(("`.*`"
                       (1 'font-lock-variable-name-face)
                       (3 'font-lock-keyword-face)
                       (5 'font-lock-keyword-face)
                       (6 'font-lock-keyword-face))))

When I do M + x font-lock-mode a string matched by the regex won't by changed.

But I did not expect this to work as I have no idea what I am doing here anyway. Am I even going in the right direction here with that font-lock thing?


texts:
Since I need to search some pattern frequently, I wish to write some code there then execute it in org-mode. for example:

#+begin_src elisp :results output
(defun myoccur (arg)
  (occur (s-replace " " "\\|" arg))
)
(myoccur "cat dog mouse")
#+end_src

#+RESULTS:

this is a dog.
this is a cat.
this is a mouse.
this is a pig.

If I do C-c C-c, one Occur buffer will be generated but it do not popup to split the screen, I have to switch to that buffer to view the result.

How can I make this code popup the Occur buffer after C-c C-c command?


texts: How come newline does not match [[:space:]] in tex-mode and bibtex-mode?

texts:
I was debugging some of my elisp code and realized that, in a tex-mode buffer, the newline character at end of line did not match [[:space:]].
In most other textmodes or progmodes, ie, the few I tested before posting :-), newline does match [[:space:]].

The above situation breaks a lot of my old pattern-matching code and raises two questions:

What is the rationale for this design?

In case I want to change the status of ?\n so that it matches [[:space:]], are there hidden inconvenients to using (modify-syntax-entry ?\n " " st) ?


texts: Changing the order of the entries of the bibtex-autokey generator-*

texts: I am trying to migrate from Zotero to org-ref, and got stuck when trying to use the doi-utils-add-bibtex-entry-from-doi command. After reading the Automatic Reference Key Generation section and searching online couldn't find an answer to this question. Can I change the order of the auto-generated entries (author, year, title), for example, to have an author_title_year bibtex key? Thank you in advance.


texts: Expanding some elisp into HTML inside Org

texts:
I am creating an HTML file containing some notes exported from org mode. I would like to add all images from a folder into the HTML file generated i.e the images should display in the webpage when opened.
Is there a way to insert a bit of local Emacs-Lisp code in the org mode file such that on exporting to HTML, the code block expands to something a sequence of  tags containing file names from the folder images. (I guess I am looking for something like a kind of local macro expansion?)
To be precise I want something like
blah blah
blah blah

<<< Elisp code that expands to HTML inside Org file>>>

blah blah blah
blah blah

to be converted into
blah blah
blah blah

.
.
.

blah blah blah
blah blah

Note that I don't want this expanded HTML gunk inside the org mode file itself, but inside the exported HTML file.


texts: Spacemacs keybinding to execute shell script in directory the file in the current windows buffer is located in

texts:
I need a keybinding (either a key like F12 or a mnemonic key sequence like SPC f12) in Spacemacs. When hitting the keybinding in a window containing a file in its buffer the shell script script in the directory the file is located in shall be executed.

Which one of the alternatives to define key bindings should I use? I thought about calling a function when the key binding is triggered. How could I get the directory the file in the current window buffer is located in when this function is executed? But probably there is another way to solve this problem.


texts: How to force completions buffer to appear in a side window?

texts:
I normally have my main Emacs frame split vertically into two side-by-side windows (as one gets with split-window-right, better known as C-x 3).

For as long as I can remember, whenever the need arose for a temporary *Completions* buffer, the inactive one of the two side-by-side windows would be used to hold this buffer.

I don't know what changed but now this is no longer what happens.  Instead, a third window appears holding the *Completions* buffer, and running horizontally the full width of the Emacs frame.  (So I now see the two original side-by-side windows on top, and one wide window for the transient *Completions* buffer along the bottom.  IOW, the frame window topology looks similar to what it would look like if one ran the sequence C-x 1 C-x 2 C-x 3.)

I don't like this at all.  I have a fairly wide monitor, which makes it uncomfortable to read completion options that are spread out along its full width.

Is it possible to customize this behavior?


texts: Configuration steps for Emacs Python / IDE

texts:
I'm newbie.
Which is the best configuration for develop in Python using Emacs?
Thanks


texts: Regex: Don't Match Text Between Curly Braces (LaTeX Commands)

texts:
I've been using pandoc and emacs to convert beamer presentations to markdown format. In the beamer presentations we highlighted certain code in example code blocks red. Pandoc has left me to get rid of these by hand. I have been trying to use M-x replace-regexp to find all $\alert{...}$ and replace it with ....

I keep getting an error saying:

  Invalid use of '\' in replacement text

Here is an example of what I'm trying to replace

$\alert{bool has_burnup;}$
$\alert{const Variable Value & _burnup;}$

$\alert{THERMAL_H}$

Should be replaced as:

bool has_burnup;
const Variable Value & _burnup;

THERMAL_H

Here is what I'm currently trying

M-x replace-regex <RET> \$\\alert{.+}\$ <RET> [^{\}]+(?=})

These regexp work when using an online testing environment. Why won't it work in emacs?


texts: Why does `narrow-to-region` complain that its args are not `integer-or-marker-p`?

texts:
I have some functions that depend on smart-parens code.

(defun outer-paren ()
  "Move point to the  outermost parenthesis."
  (interactive)
  (ignore-errors
    (while t
      (up-list)))
  (sp-backward-sexp))

(defun func ()
  (let ((start (outer-paren))
    (end (sp-forward-sexp)))
    (narrow-to-region start end)))

The above func code returns a plist set by let:

(:beg 145 :end 163 :op "「" :cl "」" :prefix "" :suffix "") (:beg 145 :end 163 :op "「" :cl "」" :prefix "" :suffix "")

This causes an error from narrow-to-region() when func is called.

  (wrong-type-argument integer-or-marker-p (:beg 145 :end 163 :op "「" :cl "」" :prefix "" :suffix ""))

How do I access start and end as variables within func?


texts:
When inserting an equation with C-c C-e it prompts if a label is wanted, if the label is wanted it inserts \label{eq:1}. Is it possible to modify this prompt to allow me to enter the label name similar to when a figure element is added?

TL;DR, Any ideas on how to make the prompt to ask me what to put as the label after inserting an equation with C-c C-e.


texts: Automatic gpg signature verification and decryption with gnus

texts:
I am trying to use Gnus for sending and receiving gpg signed/encrypted emails. I am following these tutorials for the setup etc.

https://github.com/kensanata/ggg
https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/gnus-guide-en.org

By the way, I am using this Emacs setup as well:

https://github.com/purcell/emacs.d

However, signed/encrypted emails are not verified/decrypted automatically when I open them, and I cannot figure out how to setup this.
I beleive that this manual page contains some clues, but still I don't see how to include them in the setup:

https://www.gnu.org/software/emacs/manual/html_node/gnus/Security.html#Security


texts: how to use helm-do-grep to search within subdirectories?

texts: I am running the command helm-do-grep and I notice that the search is not recursive, i.e. it searches only in the directory I specify and not in subdirectories. How do I direct helm-grep to automatically search recursively?


texts: From stock Emacs to Emacs Doom - Issues with Key Bindings and de-activating Evil-mode - ORG-MODE use

texts:
I have migrated to emacs-Doom and wish to keep the emacs vanilla key-bindings. I also use emacs exclusively for org-mode
I have amended the init.el file to remove the evil and removed any attributes that call evil-mode.
I still am having issues with evil-mode being activated. C-z works for me on some occasions, not others.
Is there any comprehensive docs that deal with this issue? I have researched the various emacs-doom docs and specific docs on evil-mode, but I cannot seem to wipe out evil mode entirely.
Ultimately what I am seeking is use of emacs-doom without evil-mode for org-mode use only.


texts: How do I read the entire contents of stdin into an Emacs buffer in #! /usr/bin/env emacs --script mode? Stdin may not be a regular file.


texts:
I would like to repeat replacing a string with another string in a text file, until it is not possible. Is it possible to do that in Emacs?
I only know to replace just once with M-% and !.

For example, replace "  " (two spaces) with " " (one space) repeatedly until not possible.


texts: Large blank space between menu-bar and buffer window

texts: There is a large blank space between the top of the buffer and the bottom of the menu-bar in my Emacs 24 on Ubunutu 16.10 that doesn't want to go away.  I've tried Googling but can't really find anything to help, would appreciate some ideas!  Screenshot included:


texts: Org export to pdf inserts ^I for indentation in code

texts:
I have worked around the problem by customizing org-src-preserve-indentation to true, but by default when I export my code snippets to pdf, My code winds up looking like this:

void foo()
{
^I//bla bla bla;
}

Which is kind of irritating.  Anyone know whats going on?  I am using xelatex for pdf generation (because of unicode in the sources), and minted for syntax highlighting.

Is there a best way to get beatiful code formatting in my pdf?  Can I tell it to use clang-format from within xelatex?

Minumum Sample

It took me a while to make a minimum sample, since the issue is configuration file, not the code snippet.  With the following as your .emacs, you should be able to reproduce the failure (you will need xelatex and the fontspec package of course).  I apologize that there's some unecessary noise form copy-pasting my custom-set-variables block, but it would have taken some effort for me to extract just the salient

  (setq-default c-basic-offset 4
                tab-width 4
                indent-tabs-mode t)

  ;; ;; fontify code in code blocks
  (setq org-src-fontify-natively t)
  (setq org-latex-listings 'minted)
  ;; ;; Let the exporter use the -shell-escape option to let latex
  ;; ;; execute external programs.
  ;; ;; This obviously and can be dangerous to activate!
  (setq org-latex-pdf-process
        '("xelatex -shell-escape -interaction nonstopmode -output-directory %o %f"))

  (provide 'dotemacs)
  ;;; dotemacs.el ends here
  (custom-set-variables
   ;; custom-set-variables was added by Custom.
   ;; If you edit it by hand, you could mess it up, so be careful.
   ;; Your init file should contain only one such instance.
   ;; If there is more than one, they won't work right.
   '(org-latex-default-packages-alist
     (quote
      (("T1" "fontenc" t)
       ("" "fixltx2e" nil)
       ("" "graphicx" t)
       ("" "longtable" nil)
       ("" "float" nil)
       ("" "wrapfig" nil)
       ("" "rotating" nil)
       ("normalem" "ulem" t)
       ("" "amsmath" t)
       ("" "textcomp" t)
       ("" "marvosym" t)
       ("" "wasysym" t)
       ("" "amssymb" t)
       ("" "hyperref" nil)
       "\\tolerance=1000")))
   '(org-latex-packages-alist (quote (("" "fontspec" t) ("" "minted" nil)))))

With that, even a trivial (indented) code sample will produce the erroneous results:

* Foo

    #+BEGIN_SRC C++
    void foo()
    {
        void bar = fb();
        std::cout << "fbar" << "\n"
    }
    #+END_SRC

(sorry, I don't know how to get an org src block to show up right on this sight).  Create an indented source code block to reproduce the error.

Which produces the following LaTeX:

   % Created 2015-09-02 Wed 23:17
   \documentclass[11pt]{article}
   \usepackage[T1]{fontenc}
   \usepackage{fixltx2e}
   \usepackage{graphicx}
   \usepackage{longtable}
   \usepackage{float}
   \usepackage{wrapfig}
   \usepackage{rotating}
   \usepackage[normalem]{ulem}
   \usepackage{amsmath}
   \usepackage{textcomp}
   \usepackage{marvosym}
   \usepackage{wasysym}
   \usepackage{amssymb}
   \usepackage{hyperref}
   \tolerance=1000
   \usepackage{fontspec}
   \usepackage{minted}
   \author{Glen Stark}
   \date{\today}
   \title{sample}
   \hypersetup{
     pdfkeywords={},
     pdfsubject={},
     pdfcreator={Emacs 24.5.1 (Org mode 8.2.10)}}
   \begin{document}

   \maketitle
   \tableofcontents

   \section{Foo}
   \label{sec-1}

   \begin{minted}[]{c++}
   void foo()
   {
       void bar = fb();
       std::cout << "fbar" << "\n"
   }
   \end{minted}
   % Emacs 24.5.1 (Org mode 8.2.10)
   \end{document}

The whitespace in the minted block is a tab.  Obviously xelatex is inserting something funny in place of the tabs.  Unfortunately my companies coding standards are tabs not spaces, so it would be inconvenient to change this (more inconvenient than my current workaround).

Anyone know what the fix is?


texts: Limit targets for org-refile in narrowed/indirect buffers

texts:
Is there a way to limit the targets that are offered for org-refile to the currently visible sub-tree in a buffer that has been created with org-tree-to-indirect or org-narrow-to-subtree

The goal is to make re-organizing entries easier in a file with several large sub-trees.


texts: Make helm-recentf open files with external program?

texts:
tl;dr Which keymap is active in helm-recentf? Or is there a better way to accomplish my goal?

I want to use emacs as my file browser. When I select a file with helm-find-files or helm-recentf, I want to check whether the extension is in a whitelist (eg. "pdf", "png", "docx") and if it is, open the file in the appropriate external program. If it's not, the file should be visited normally in emacs.

Solutions I've rejected:

Use C-c C-x in helm to open candidate externally. I don't want to press a separate keybinding or to be prompted for a program name, I just want to press return as usual and have helm figure out the right thing to do.
Use the openwith package. It breaks things like mu4e attachments and images embedded in org buffers. I only ever want files I explicitly open through helm to be opened externally.

What I've tried so far:

I remapped RET to a custom function that does what I want. It's probably a horrible hack, but it works for helm-find-files!

(define-key helm-find-files-map (kbd "RET") 'my-helm-ff-run-open-in-emacs-or-externally)

(defun my-helm-ff-run-open-in-emacs-or-externally ()
  (interactive)
  (with-helm-alive-p
    (helm-exit-and-execute-action 'my-helm-ff-open-in-emacs-or-externally)
    )
  )

(defun my-helm-ff-open-in-emacs-or-externally (file)
  ;; based on helm-open-file-externally,
  ;; Copyright (C) 2012 ~ 2016 Thierry Volpiatto <thierry.volpiatto@gmail.com>
  "Open FILE either with emacs or with an external program.
Try to guess which external program to use with `helm-get-default-program-for-file'.
If not found, open file in emacs."
  (if (bufferp file)
      (switch-to-buffer file)
    (let* ((file-name      (expand-file-name file))
           (collection      (helm-external-commands-list-1 'sort))
           (default-program   (helm-get-default-program-for-file file-name)))
      (if (not default-program)
          (find-file file) ;; open in emacs
        (helm-run-or-raise default-program file) ;; open in external program
        ))))

The only problem is, I can't define this mapping for helm-recentf. I assumed that the helm-buffer-map would be active in helm-recentf, but it's not:

(define-key helm-buffer-map (kbd "RET") '(lambda () (interactive) (message "define-key worked!")))

The message prints when I select a buffer in helm-mini, but not when I select a file in helm-recentf.

Questions

So, which keymap is active in helm-recentf?

Or, am I doing this all wrong, and is there a much better to intelligently open some files with an external program?


texts: polymode with fsharp-mode has trouble sending last line in code block to interactive

texts:
I just started setting up polymode

I got ESS and r going nicely with markdown.

(use-package markdown-mode)
(use-package polymode)
(require 'poly-R)
(require 'poly-markdown)

I was able to put r code blocks inside a markdown file, and send lines one at a time to the r interactive window

Next, I want to do the same for f#.
Here is my markdown document

# Title

```{fsharp}
let x = 5
x
```

That's all.

Now, when I start poly-markdown-mode, it automatically picks up on the fsharp mode, and I get the keybindingd I usually use for fsharp mode.  I tried sending the first line to the interactive process, and it worked.

Then I tried sending the second line (just x), and it gave me an error

path/to/file.md(6,1): error FS0010: Unexpected reserved keyword in interaction

If I understand correctly, polymode splits the file into virtual buffers or something and splices them back together.  It seems that somehow there is something at the end of the fsharp virtual buffer that I can't see, but is messing the interpreter up.

I tried adding a blank line to the end of the code block, but the result was the same.

fsharp mode has a function for sending the current region; when I use that, it actually works.  This seems to confirm my diagnosis. Now, I could just select the last line any time I need to evaluate it, but that is inconvenient. Is there a way to solve this problem


texts: delete-trailing-whitespace on save while always preserving location of cursor

texts:
I have the following before save hook defined which deletes all trailing whitespace and converts tabs to spaces (except in makefile mode since makefiles need tabs to work).  This works great, however, it creates a little bit of an annoying side effect where if my cursor has some space before it, removing the space, moves the cursor back.  I would like to tweak this a little by removing all trailing space, except if the cursor is at the end of a line.

(defun my-before-save-hook ()
  (progn
    (if (not (string-match ".*makefile.*" (message "%s" major-mode))) ; Makefiles require tabs
        (untabify (point-min) (point-max)))                           ; Convert tabs to spaces
    (delete-trailing-whitespace)))                                    ; Remote trailing spaces
(add-hook 'before-save-hook 'my-before-save-hook)


texts:
pyvenv and virtualenvwrapper emacs packages work well with virtualenv, but neither appears to support the core venv module which is now packaged with releases of Python.

Are there any actively developed packages with support for venv?

pyvenv:             https://github.com/jorgenschaefer/pyvenv
virtualenvwrapper:  https://github.com/porterjamesj/virtualenvwrapper.el


texts:
Due to versionitis I upgraded my old emacs 25.1.1
to 27.1
I have some old menu elisp code (that I dont pretend to understand) which I found broke: viz the menu opens but is a thin bar with no text
Searching around for how to make menus I find this doc
When I copy the example there to an el file and load it I see the same erroneous behavior. The example:
(define-key global-map [menu-bar words]
  (cons "Words" (make-sparse-keymap "Words")))

;; Define specific subcommands in this menu.
(define-key global-map
  [menu-bar words forward]
  '("Forward word" . forward-word))

(define-key global-map
  [menu-bar words backward]
  '("Backward word" . backward-word))

I asked a colleague with 26.3; where it works
In other words the doc menus are broken/works as follows

broken on my old 25.1.1
works on 26.3
again broken on 27.1

So I cant make out whether its emacs or underlying (gtk??) that is broken.
Does someone have a clue?
I've extracted the relevant part of my old code that is broken on 27 and works on 25. Full repo emacs part here
This is 30 year old code with this "recent" patch from about emacs24 (6-7 years ago)
(defun pugofer-mode-commands (map)

  (let ((menuMap (make-sparse-keymap "Pugofer")))
    (define-key map
      [menu-bar pugofer]
      (cons "Pugofer" menuMap))

    (define-key menuMap "d"
      '("Run Pugofer Constructor" . run-pugofer-cc))
    (define-key menuMap "c"
      '("Run Pugofer Standard" . run-pugofer-std))
    (define-key menuMap "b"
      '("Run Pugofer Simple" . run-pugofer-simple))
    (define-key menuMap "a"
      '("Load File" . pugofer-load-file))
    ))

Added later
It occurred to me to try F10
["works" means my code as well as the doc code... May not have tried all combinations]

With F10 it works
While it doesnt work with emacs initially, 2nd time round, after the F10, it works
With emacs -nw it works
If emacs started as daemon, it works in the client

Since I get a flurry of such gtk warnings, I assume emacs is not playing nice with gtk??
(emacs-27-1-1:3122): Gtk-WARNING **: Attempting to add a widget with type GtkLabel to a GtkMenuItem, but as a GtkBin subclass a GtkMenuItem can only contain one widget at a time; it already contains a widget of type GtkAccelLabel

(emacs-27-1-1:3122): Gtk-CRITICAL **: IA__gtk_label_get_label: assertion 'GTK_IS_LABEL (label)' failed


texts:
I'm using gnus and trying to send email through it. This works for my gmail account (which receives outgoing emails on smpt port 587 using tls). My university uses smpt on port 465 and no tls, but ssl. Receiving email via IMAP port 993 works perfectly, but I have found no setup which allows email to be sent via port 465 ssl.

Short of looking at the source and debugging this myself, which would likely involve looking at how gnus is doing authentication and learning about the authentication methods and the smpt protocol, I don't think I will get any further.

I notice that everywhere that this question exists, it never gets answered.

http://comments.gmane.org/gmane.emacs.gnus.general/83505

https://groups.google.com/forum/#!topic/gnu.emacs.gnus/1_8s2pCWy4I

https://groups.google.com/d/topic/gnu.emacs.gnus/ikGoITEYIf4

http://www.linuxquestions.org/questions/linux-software-2/sending-email-with-gnu-emacs-process-smtp-not-running-error-4175415954/

And this has apparently been going on since 2010, so I thought it'd post it here.

What is a working setup for sending email from gnus via port 465 ssl?


texts: Accessing the character in the line below

texts:
I am writing an Emacs Lisp function which needs to know the character directly under point in the line below, returning nil when no such character exists. I thus defined the function char-below, which seems to work well except that it breaks down in case the line below has tabs.

(defun char-below ()
  (condition-case nil
      (aref
        (buffer-substring-no-properties (line-beginning-position 2) (line-end-position 2))
        (- (point) (line-beginning-position)))
    (error nil)))

Is there a built-in elisp function to accomplish this?  If not, is there a cleverer way to write char-below, accounting for the presence of tabs?

EDIT:  I tried a solution based on next-line but there seems to be a problem with using next-line in Lisp code, as observed in its doc-string:

  "This function is for interactive use only; in Lisp code use forward-line instead."

A way to illustrate the problem is by defining the following key-binding, using the char-below function proposed by Erik Sjöstrand, which is supposed to display the character below in the message area and move forward one char.

 (global-set-key (kbd "<f12>")
   (lambda ()
     (interactive)
     (message (char-below))
     (forward-char)))

Curiously, repeated pressed of the key f12 thus defined keep messaging the same character below the position point was at the time of the FIRST invocation of f12.

I think this is because  next-line uses goal columns, and somehow the goal column is not updated when the above key is repeated.

EDIT 2

By the way, Erik initially proposed the  function char-below as follows

(defun char-below ()
  (ignore-errors
    (save-excursion
      (next-line)
      (string (following-char)))))

and this is the function that causes the error I mentioned above.  Since then Eric has edited his function inserting the command
(setq temporary-goal-column nil) which fixes this issue.


texts: How to expand different snippets depending upon file directory

texts:
I have a yasnippet for cperl-mode:

# -*- mode: snippet -*-
# name: print Dumper
# key: vd
# --
print Dumper($0);

I need to expand this snippet to different strings depending upon the directory of the file I'm editing:

if dir contains /mnt/beta/ - output "die Dumper($0);"
otherwise - output "print Dumper($0);"

I created the following function:

(defun print-dumper ()
  "Print certain snippet depending upon file directory"
  (interactive)
      (let ((file-name (buffer-file-name)))
            (if (string-match "/mnt/beta/" file-name)
                  (insert "die Dumper();")
                  (insert "print Dumper();")))
      (backward-char 2))

It works. But how to call it in cperl mode instead of expanding yasnippet? Is there a better way to do this?


texts: Does something like a auto-function-list exist?

texts:
I had the following hook:

(add-hook 'image-mode-hook 'imagex-sticky-maximize)

imagex-sticky-maximize is a function that maximizes the image to the borders of the window. I prefer to see my images to his fullest inside the window.

This works fine so far. But I noticed that Emacs crashes if the next file is a *.gif file. So disabling the imagex-sticky-maximize helps.
But I would like to enable that function when the file is a *.PNG, or *.JPG or *.TIFF image.

So I was looking for a solution. I know you have the auto-mode-alist. When you declare something like this:

(add-to-list 'auto-mode-alist '("\\.clj$\\'" . paredit-mode))

Then paredit mode will be called as minor mode, when you open file with the extension *.clj. This works only for minor modes.
I was looking for a sort of auto-function-alist, that calls imagex-sticky-maximize when a specifix extension is being opened. However, I couldn't find anything of this.

Any suggestion in that direction would be appreciated.


texts: Key binding for letters with diacritics?

texts: I want to create a new key binding that puts out a single letter with a key combination. For example: M-E inserts an "ê" character. Is this possible?


texts: Search through text of org-mode headings and body (but recursively)

texts:
I am using helm-org-rifle to search through my notes. This is such an awesome package.
But one issue I am running into is shown in the following example:
* Week of Aug 3rd (this week)

** Projects

These are projects for the week.

*** Fix emacs config

- Some example text about how to test org-mode

Now, wnen I go an search, I don't quite remember if I put the Projects heading or not. I want to be able to search this week org mode and find the 3rd level heading.
Essentially, I want to use helm-org-rifle but search in the heading and all subheadings (their title and body). Is there a config of helm-org-rifle to do that?
Or some other package or pointer for doing it?


texts: org babel sql results output in raw form

texts:
Is the way to get same output as in terminal with ob-doc-sql.

Executing the sql-query in org will process results into org-table
ignoring other than table information. It doesn't fare well with
multiple query in the block as show below will squash both into
single table.

#+BEGIN_SRC sql :engine postgresql :database postgres
  SELECT 'hello';
  SELECT 'hello', 'world';
#+END_SRC

#+RESULTS:
| ?column? |          |
|----------+----------|
| hello    |          |
| ?column? | ?column? |
| hello    | world    |

header argument :results with output or verbatim value produce correct structure but table formatting is stripped out. But stil doesn't produce any terminal like output as shown below.

#+RESULTS:
: ?column?
: hello world
: ?column?  ?column?
: hello  world

Althouh expected output can be produced via shell execution,

#+BEGIN_SRC sh :results output
  psql postgres -X -c "SELECT 'hello'" -c "SELECT 'hello', 'world';"
#+END_SRC

#+RESULTS:
#+begin_example
 ?column?
----------
 hello
(1 row)

 ?column? | ?column?
----------+----------
 hello    | world
(1 row)

#+end_example


texts: Remove entries in Dired buffer without deleting actual underlying objects

texts:
Is there a way to do this for both non-Elisp and Elisp? For Elisp, the only thing I can think of is to create a new Dired buffer from a new list of files, but is there a better way?

Note: I want to do this without external dependency.


texts: org-mode: Make C-a and C-e go to beginning or ending of logical line

texts:
What I'm trying to do is have C-a and C-e take me to the beginning or ending, respectively, of the logical line, not the visual line, in org-mode (with visual-line-mode active). I see that C-a is mapped to org-beginning-of-line, which, like a lot of org-mode things, seems to be context-dependent.
Here's what I'm trying.
        (define-key org-mode-map (kbd "C-a") 'move-beginning-of-line)
        (define-key org-mode-map (kbd "C-a") 'move-end-of-line)

This seems to do nothing. C-h k  followed by C-a still shows it's still mapped to org-beginning-of-line.  I also tried using the angle bracket form of calling kbd: (kbd "<C-a>"), which made no difference.
If it helps, here's what I get when I do C-h m:
Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption
Blink-Cursor Electric-Indent File-Name-Shadow Font-Lock Global-Eldoc
Global-Font-Lock Global-Visual-Line Line-Number Mac-Mouse-Wheel
Menu-Bar Show-Paren Tool-Bar Tooltip Transient-Mark Visual-Line

UPDATE: both @Tyler and @NickD solved the problem with their answers. Also it turns out the visual-line-mode-map had a remapping as well, which also needed to be unmapped. Here's specifically what I added to my .emacs file to solve the entire thing:
(add-hook 'visual-line-mode-hook
      (lambda ()
        (define-key visual-line-mode-map [remap move-beginning-of-line] nil)
        (define-key visual-line-mode-map (kbd "C-a") 'move-beginning-of-line)
        (define-key visual-line-mode-map [remap move-end-of-line] nil)
        (define-key visual-line-mode-map (kbd "C-e") 'move-end-of-line)))

(add-hook 'org-mode-hook
      (lambda ()
        (define-key org-mode-map [remap move-beginning-of-line] nil)
        (define-key org-mode-map (kbd "C-a") 'move-beginning-of-line)
        (define-key org-mode-map [remap move-end-of-line] nil)
        (define-key org-mode-map (kbd "C-e") 'move-end-of-line)))


texts: Highlight compilation error in compilation mode buffer

texts:
I know how to highlight the source code corresponding to the
selected compilation-mode error.  I also know about the little
arrow in the fringe that points to the error in the compilation
buffer, and that if the fringe is not visible, next-error will
show the error right at the top of the window to indicate which
error is selected.

What I want to know instead is: How can I highlight the selected
error in the compilation-mode buffer with a face that I can
customize?

I want this because I want to see where I've jumped to when I
both:

am running emacs in a terminal (-nw)
have compilation-context-lines set to some high value like 15
so I can see a whole Python traceback rather than just the last line


texts: org-mode: Export or show only headlines and the first paragraph below them

texts:
I want to export my org-mode document, but filter out all the actual content (well, ideally, just show it in the current buffer, but if that's harder to do, export is fine). That is, I want to only see the headlines. Except, the first paragraph after each headline should still be shown. Or, what would be even cooler, if I could use a demarcation such as a horizontal line ("-----") to indicate where it should end.

Basically, I intend these first paragraphs to be short summaries of what follows. (But I dont want to split it into two sub-headings 'summary' and 'content', which is what I've been doing so far.)

Could you help me, give some pointers, or maybe examples for something similar that I could modify? I am sadly not well-versed in emacs lisp.

Thank you!


texts: Using org-ref to download pdfs using sci-hub as a fallback

texts: I've developed a solution that allows to download pdfs from sci-hub as a fallback option to the functions provided by org-ref. I am a newbie to elisp, so please feel free to update this answer as necessary.


texts: In Org-Mode, is there a way to narrow the buffer to just the text under a heading?

texts:
For example, say I have a buffer that looks like this:

* Org-Mode

This is a document written in Org-Mode

** This is a subheading below that

Would it be possible to narrow the buffer to just "This is a document written in Org-Mode" and continue on then come back to the full buffer, excluding the subheading below.

(Edited to clarify regarding subheadings)


texts: Org link search fallback, if no matching headlines?

texts:
With the variable org-link-search-must-match-exact-headline you can only choose between various search options but I would like to have the following behaviour:

First try to match against headlines only
If the above fails fallback to searching the whole buffer

Is there an option for this, or how could I achieve that?


texts: How to open two files in two frames on startup?

texts:
Here's what I'm trying to make happen: on startup, I want emacs to split vertically into two windows displaying two different files, with my to-do list on the left side of the screen and my notes on the right.

I've already set things up to automatically split the screen into two buffers by adding (split-window-right) to my init file. I've also set it to automatically load the two files I want, using (find-file...). But I can't figure out how to assign a different file to each window at startup. Instead, it's just loading the same buffer in both windows.

Any help?


texts: Any way to embed links with part of their content in Emacs?

texts:
The question itself might be confusing given I'm using the word embed here, which have different meaning. What i mean by that is:

Embed like what chat.stackoverflow does. Say I'm posting a single SO/SE link (from a post) on any chat on SO/SE, it will embed like so:

Where this is the embedded link (do bear in mind this is just an example to illustrate what i mean, and not intended to be the final form).
Basically, what i mean by embed is either:

Show a part of the link, either at the start, end or any wanted part?
Show the whole content of the link in current buffer, but in a separate block (so it doesn't clutter any other existing text in the current buffer)

I'm also aware of possibly related things, like org-screenshot, though it's not exactly what i want, but still useful.
How could i do this?


texts:
I have the following definition in my init.el:

(define-key evil-motion-state-map (kbd "SPC j") #'evilem-motion-next-line)

This works if I want to do dSPCj, but I'd like to be able to do SPCdj as well. (Here, SPC is meant to take the place of the prefix argument or "count", which can come in either location. see evil-easymotion for a description of its behavior).

The naive solution

(define-key evil-normal-state-map (kbd "SPC d") (kbd "d SPC"))

Does not work for the same reason described in Emacs bind key to prefix. The solution to that question doesn't work for me because there is no prefix command to bind to, as all commands are hidden behind evil-delete.

Is there any way to accomplish this?


texts: Why doesn't the window begin and end update after `outline-show-all`?

texts:
I'm using this test code.

(defun +outline~show-all (orig-fn &rest args)
  "Show all."
  (let ((beg1 (window-start))
        (end1 (window-end))
        (beg2) (end2))
    (apply orig-fn args)
    (setq beg2 (window-start) end2 (window-end))
    (message "before (%d , %d) | after (%d , %d)" beg1 end1 beg2 end2)))

(advice-add #'outline-show-all :around #'outline~show-all)

I expect difference between (window-start) and (window-end) to be smaller after calling outline-show-all in a (sufficiently large) org file with folded headings. This is because the window can't show as much of the text now that the contents of org headings are visible. But the window beginning and end before calling outline-show-all and after are the same according to the output of my advice.

Here's an example of the output in a huge orgfile.

before (1 , 246850) | after (1 , 246850)

It is visibly obvious that the window beginning and end have changed. But to make sure I use eval-expression and indeed (window-end) is smaller.
I evaluated this form: (message "wndow-beg: %d | window-end: %d" (window-start) (window-end)).

I get this output.

window-beg: 1 | window-end: 884

But why didn't I get this output from my advice?


texts: In auctex, to insert citation, how to display all the search results

texts:
In emacs, auctex, when I use C-c [, I only get a list of my previous searches

When I start typing a search term such as sengul, it highlights my previous search sengul2013 and when I press return, I only get the result sengul2013 and I can not choose another citation which has the search term sengul in it. I am trying to clear the other entries but could not do it.

Any help is appreciated.


texts: Can properties of events be viewed in org-agenda?

texts:
I have a recurring event that takes place in a specific location:

#+Title: My Agenda

* Coffee
** Drink Coffee
   :PROPERTIES:
   :LOCATION: Room 237
   :END:
   <2017-01-01 Sun 09:00-10:00 +1w>

My agenda, however, ignores the location of my event:

Month-agenda (W52-W05):
Sunday      1 January 2017
  tasks:       9:00am-10:00am Drink Coffee
Monday      2 January 2017 W01
Tuesday     3 January 2017
Wednesday   4 January 2017
Thursday    5 January 2017
Friday      6 January 2017
Saturday    7 January 2017
Sunday      8 January 2017
  tasks:       9:00am-10:00am Drink Coffee
Monday      9 January 2017 W02
Tuesday    10 January 2017
Wednesday  11 January 2017
Thursday   12 January 2017
Friday     13 January 2017
Saturday   14 January 2017
Sunday     15 January 2017
  tasks:       9:00am-10:00am Drink Coffee
Monday     16 January 2017 W03
Tuesday    17 January 2017
Wednesday  18 January 2017
Thursday   19 January 2017
Friday     20 January 2017
Saturday   21 January 2017
Sunday     22 January 2017
  tasks:       9:00am-10:00am Drink Coffee
Monday     23 January 2017 W04
Tuesday    24 January 2017
Wednesday  25 January 2017
Thursday   26 January 2017
Friday     27 January 2017
Saturday   28 January 2017
Sunday     29 January 2017
  tasks:       9:00am-10:00am Drink Coffee
Monday     30 January 2017 W05
Tuesday    31 January 2017

Is there a way to view the location of my event in my agenda?


texts: How can I bind F12 in serial-term mode to minicom's F12?

texts:
When I use emacs serial-term mode
Can I invoke F12 or other function keys as minicom's F12?
I tried below... but it doesn't work
(global-set-key [f12] nil)

Thank you in advance!


texts: php-mode overwrites c-basic-offset customization, how can I set it to my preferred value?

texts:
GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21)
PHP-Mode: https://github.com/emacs-php/php-mode, Version: 1.21.1

I customized c-basic-offset to 2.

When I open a php-File, php-mode is automatically invoked (by (add-to-list 'auto-mode-alist '("\\.php\\'" . php-mode)) in .emacs) and c-basic-offset is set to 4. By C-h v c-basic-offset I can clearly see: 2 is recognized as global customization but the buffer-local setting is 4. Obviously, php-mode is doing this.

How can I alter this behaviour? Either, php-mode invocation does not touch c-basic-offset? Or, after loading php-mode a hook sets it back to 2.

Every attempt from my side failed so far.


texts: How can I get a listing of all buffers and the frames displaying them?

texts:
I want to get a list of all the windows and their frames, so I can jump directly to the frame and window.
If a buffer is not open in a window then the command should still jump to the last frame in which that buffer was displayed and open a window on the buffer in that frame, else it should open it in a frame designated as the default for opening existing buffers, or the current one if none has been set.


texts: what to do with "magit-wip-commit-worktree: Cannot read tree refs/heads/master"?

texts:
When I commit via magit I get:

magit-wip-commit-worktree: Cannot read tree refs/heads/master

while it commits ok.  But the message frightens me.  There seems to be nothing wrong with the repo:

$ git fsck
Checking object directories: 100% (256/256), done.
Checking objects: 100% (2270/2270), done.
dangling blob  ff2aef45cae6a3b1f980c192c748af754fb538d4

and there are readable files which match the message:

$ find .git | grep refs/heads/master | xargs ls -l
-rw-r--r-- 1 grfz grfz 12505 Okt 28 13:20 .git/logs/refs/heads/master
-rw-r--r-- 1 grfz grfz   495 Okt 28 13:20 .git/logs/refs/wip/index/refs/heads/master
-rw-r--r-- 1 grfz grfz    41 Okt 28 13:20 .git/refs/heads/master
-rw-r--r-- 1 grfz grfz    41 Okt 28 13:20 .git/refs/wip/index/refs/heads/master

There is nothing special about this repo:

core.excludesfile=/home/grfz/.gitignore_global
core.whitespace=trailing-space,space-before-tab,indent-with-non-tab
sendemail.chainreplyto=false
transfer.fsckobjects=true
fetch.fsckobjects=true
receive.fsckobjects=true
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true

The customizables in cutomize-group magit-wip and magit-wip-legacy are all at standard values.

I used the worlds mightiest search engine and found: nothing besides magit documentation and the like.  This astonishes me.

I would at least like to silence this message, better find its root cause.


texts: Terminal (shell) side by side with editor, how to navigate back and forth?

texts:
I am new to Emacs.  I can invoke a shell or eshell using M-x shell or M-x eshell.  This created a shell and I can run executables from it.  By default, this shell is in the same window as my source code.  So, I can switch between the source code and the shell using: C-x Right/ Left.

I would like to have this shell to be side by side with my source code.  So, I tried to do : C-x 3.  This creates a vertical split. I then have shell on 1 side and source code on the other.  But, how do I switch back and forth between the splits? I can click on which split I want, but I am struggling to find the shortcut to switch.

Please help


texts: How to make a Customize setting depend on another? or make a `setq` depend over a Customize setting?

texts:
I heard it’s better to use Customize to define variables/settings instead of just some setq inside .emacs.d… because it autoloads when loading packages, because it’s more consistent, more checked/restricted, better updated, etc. I heard the only case where it could be better not to use Customize is setting programmatically variables. Like depending upon context or other variables with functions, etc.

But is it really always the case or is there even with Customize some way of doing it? Especially, is there a way to define a variable within Customize, that would depend upon another? like org-agenda-files depending on org-directory ((setq org-agenda-files (concat org-directory "agenda.org")))? Because I’d like it to being updated wether I update org-directory. And I’d like for consistency being able to set everything within setq or Customize, and I don’t know how to do it programmatically within Customize.

EDIT : also, if that’s not possible, I’d like to know at least how to make setq acts after the definition of a variable by customize. To take again the previous example: org-directory get defined only when org is loaded, so I can’t define org-agenda-files before in my .emacs.d: what’s the proper solution? (eval-after-load 'org […])?


texts: When I go to commit my changes VC seems only allows me to commit one file at a time via C-x v v. Is there a way for VC to commit more than 1 file at a time?


texts: Git Repo for Doom Config With Different Platforms

texts:
I have emacs on two separate platforms, and I would like it to function in much the same way on both, but there is some platform-dependent configuration as well. I have created a git repository in my .doom.d directory (where the doom configuration files are stored). I could have two branches, one for each platform, but then I end up re-implementing much of my config. I found this: https://softwareengineering.stackexchange.com/questions/200068/applying-commits-into-another-branch-without-merging.
I would like to know if there is a better way (I am pretty new to git), preferably simpler. Is there something like a C preprocessor directive I could use where certain portions of my config are ommitted before they are evaluated based on the platform I am on? Is there something else that I don't know about? Any help is appreciated.


texts: Fontify a region of a buffer with another major mode

texts:
I have a buffer that shows documentation for Ansible modules.  This buffer has its own major mode which provides all the standard stuff.  Notably, it fontifies the buffer to highlight inline markup, options, sections, etc.  All in all, it is pretty similar to M-x man.

At the bottom of the documentation there are usually some code examples in YAML.  I'd like to fontify these as well.  I could add my own font lock keywords for YAML, of course, but I'd rather prefer to re-use the fontification of YAML Mode.

How can I do that?  Specifically, how can I use a different major mode to fontify a particular region of a buffer?

Note that YAML Mode doesn't need to be active in this region.  The whole buffer is only a passive display buffer, and not intended to be edited.  I really only need the fontification produced as if YAML Mode were active in that region.

I presume I could copy the region of the buffer to a temporary buffer, enable YAML Mode, fontify the buffer, and the copy all text properties over.  Would that work?  If so, how do I copy text properties, and what are the relevant properties to copy?  Or is there a better approach?


texts: Org-mode function to duplicate current header and change ID

texts:
I noticed I copy-paste entire headers (with content) quite often. The problem I also notice is that this creates a lot of headers with duplicate IDs. I wonder if anyone has a function he would like to share or can help me create a function that will

copy current header and contents (org-copy-subtree) at point
paste it below current header
change ID


texts: emacs pinentry in minibuffer prompt blocks other frames?

texts:
I use Emacs in a terminal to read email using mu4e, mbsync. I have

PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.authinfo.gpg | awk '/machine imap.gmail.com login rudolf.sykora@gmail.com/ {print $NF}'"

in my .mbsyncrc. I use Emacs in its server mode and use emacsclient -c to connect to it. Further, pinentry-emacs is used to get a prompt for a passphrase whenever the passphrase's lifetime has ended.

The prompt appears in the minibuffer of just one frame and blocks all other frames. As the prompt may show on a at-the-time remote computer, I now always have to kill Emacs completely, which however spoils the whole meaning of the setup.

Can I do something to have the prompt for a passphrase appear in all frames and so that I can enter the passphrase from any frame? (and all the frames be responsive?)


texts: How to call export function, bypassing interactive menu

texts:
The shortcut C-c C-e is linked to org-export-dispatch. Whenever I want to export my current org buffer as html, I do C-c C-e R R, which is Export to reveal.js HTML Presentation -> To File. I am working on a presentation and I will be doing this dozens of times in the coming days. I would like to have my own keyboard shortcut to hit that export method.

Doing this:

(global-set-key (kbd "C-<")     'org-export-dispatch)

Will allow me to reach the interactive menu of org-export-dispatch, but I still need to select R -> R.

How can I embed that selection into the keyboard shortcut?


texts: How can I use helm-descbinds to execute a function?

texts:
I am using helm-descbinds to help me locate functions and the documentation says it should be possible to execute the function once you select it.

What keys should I use to execute the functions:

The options are

Execute the command
Describe the command
Find the command

Selecting the command displays info about the command below so I assume it is the same as Describe the command. Find the command must be superfluous at this state. But how about Execute the command?


texts: Evil-mode text objects not working in python.el's python-mode

texts:
This only happens in python-mode. When I try to use a text object to, for example, change everything inside or around some brackets (eg ci() it instead edits the first line of the file. So if I have this:

from somewhere import something
something("hello")

and my cursor is on the hello and I type ci( then it changes to:

fg
something("hello")

with my cursor between the f and the g. This happens no matter what else is in the file.

Try to edit inside quotes (eg ci")also fails but in a different way. It just drops into insert mode and leaves the contents unchanged.

Any ideas where I should start with tracking down the source of this issue?


texts: How to send *shell* stdout directly to kill-ring?

texts:
Suppose that I have a *shell* buffer (i.e. a subordinate shell, started with M-x shell).  Suppose also that at this shell's prompt, I can execute some command foo that sends some output to stdout.

I know that, in general, I can always select the region in the *shell* buffer corresponding to foo's output and add it to the kill-ring with C-w.

I'd like, however, to pipe foo's output directly to the kill-ring, so that it never appears in the *shell* buffer (and thus obviating the need to select the appropriate region and run C-w).

Is there a way to do this?

For example, is there some Unix command bar such that running

% foo | bar

...in the *shell* buffer will cause the output of foo to be added to Emacs's kill-ring?

In case there's a difference between them, I'd like to know the answer to this question for 3 different cases (in order of importance):

Emacs is running as an X11 application (Debian Linux + Xfce4 + Xfwm4);
Emacs is running in "text-only mode" (e.g. started with emacs -nw);
Emacs is running as a Cocoa application in OS X (i.e. it is /Applications/Emacs.app, installed from here);

PS: I just learned that eshell (not to be confused with M-x shell/comint) implements the /dev/kill pseudo-file, which solve's this post's problem (i.e. foo > /dev/kill adds foo's output to the kill-ring).  Unfortunately, IME, using eshell has always been an absolute nightmare, since so little of what I know from bash works with eshell; I don't want to learn a whole new---and totally weird--shell from the bottom up just to solve this post's problem.  Therefore, at the moment at least, eshell-based solutions are out of the question.  This may change, however, depending on the answers I get to another question I just posted.


texts:
Aim

I would like to get PDF Tools installed on my GUI Emacs on MacOSX (version 25.0.50 installed via Homebrew on MacOSX 10.10.2) because the README says it's possible.

Setup

I installed poppler and exported the PKG_CONFIG_PATH variable to my shell as advised by the README.

I then installed PDF Tools via MELPA and it installed a directory in my .emacs.d/elpa directory named ~/.emacs.d/elpa/pdf-tools-20150620.1632

Problem

When I ran the pdf-tools-install command I get the following errors about not being able to find the correct directory:

Need to build the server, do it now ? (y or n) y

pdf-tools--melpa-build-server: No such directory: /Users/m/.emacs.d/elpa/pdf-tools-20150613.414/build

What I've tried

I have tried re-installing the package with package-reinstall
I have searched for specific answers on EmacsWiki, this site, reddit.


texts: Compile remote project fails with "no such file or directory"

texts:
I'm trying to compile a remote project using M-x compile. I have the remote project directory open in a remote Dired buffer. M-x compile results in the following command:

Compile command: make -C
/ssh:xxx@yyy.zzz.se:/home/bob/micke/projects/LCC/ clean

The command fails with the following error message:

-*- mode: compilation; default-directory:
"/scp:xxx@yyy.zzz.se:/home/bob/micke/projects/LCC/" -*-
Compilation started at Mon Aug 21 10:38:30

make -C /ssh:xxx@yyy.zzz.se:/home/bob/micke/projects/LCC/ clean
make: *** /ssh:xxx@yyy.zzz.se:/home/bob/micke/projects/LCC/: No
such file or directory.  Stop.

Compilation exited abnormally with code 2 at Mon Aug 21 10:38:31

(I have masked the remote server user and name). I have passwordless log in setup on the remote host using a certificate, I use this without any problems outside Emacs.

I know the directory on the remote machine exist and I know the remote user and remote machine is correct (I have the remote directory opened in a remote Dired buffer).

Do I have to setup anything else when doing remote development and compilation?

Regards, Micke.


texts: why won't this combo animate: sleep-for n and next-line

texts:
Why can't I see this "animation"?
I only see the end result.
This function is invoked via a keyboard shortcut
on a elfeed-search buffer.

(defun my/elfeed-extra-info-2 ()
  (interactive)
  (next-line)
  (sleep-for 0.5)
  (next-line)
  (sleep-for 0.5)
  (next-line)
)


texts: Preventing font-lock string match from going past end of line

texts:
I have a custom mode to highlight my log files.  In it, I attempt to highlight strings that are surrounded by double quotes("[^"]*").  In the files, there are sometimes lines with an odd number of double quotes.  This results in many lines being treated as a string, up to the next line with a double quote.

The mode is defined by

(defun my--one-line-string-p (limit)
  "Match strings, but do not cross line boundaries"

  (when (search-forward "\"" limit 'no-error)
    (backward-char 1)
    (let ((end (min limit
                  (save-excursion
                    (end-of-line)
                    (point)))))
      (when
          (search-forward-regexp "\"[^\"]*\"" end 'no-error)
;;        (message "Found match from %d to %d" (match-beginning 0) (match-end 0))
        t
        )))
  )

(defvar my-log-file-mode-font-lock-defaults
  `((
     ("\\[WARN *\\].*" . font-lock-warning-face)
     ("\\[ERROR *\\].*" . 'my-error-face)
     (my--one-line-string-p . font-lock-string-face)
     ("{[^}
]+}" . font-lock-builtin-face)
     ("\\[akka://[^]]+\\]" . font-lock-doc-face)
     ("\\([a-zA-Z0-9]+\\)=\\([-a-zA-Z0-9:]+\\)"
      (1 font-lock-variable-name-face)
      (2 font-lock-constant-face))
     )))
;; log file mode
(define-derived-mode my-log-file-mode fundamental-mode
  "Log"
  "Major mode for viewing log files"

  (setq font-lock-defaults my-log-file-mode-font-lock-defaults)
)

font-lock-multiline is nil in the buffer.

font-lock-keywords is

 (t
 (("\\[WARN *\\].*" . font-lock-warning-face)
  ("\\[ERROR *\\].*" quote my-error-face)
  (my--one-line-string-p . font-lock-string-face)
  ("{[^}\n]+}" . font-lock-builtin-face)
  ("\\[akka://[^]]+\\]" . font-lock-doc-face)
  ("\\([a-zA-Z0-9]+\\)=\\([-a-zA-Z0-9:]+\\)"
   (1 font-lock-variable-name-face)
   (2 font-lock-constant-face)))
 ("\\[WARN *\\].*"
  (0 font-lock-warning-face))
 ("\\[ERROR *\\].*"
  (0 'my-error-face))
 (my--one-line-string-p
  (0 font-lock-string-face))
 ("{[^}\n]+}"
  (0 font-lock-builtin-face))
 ("\\[akka://[^]]+\\]"
  (0 font-lock-doc-face))
 ("\\([a-zA-Z0-9]+\\)=\\([-a-zA-Z0-9:]+\\)"
  (1 font-lock-variable-name-face)
  (2 font-lock-constant-face)))

It looks like an line with an unmatched double quote should not trigger highlighting, but it does.

I have these minor modes:

  Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption
  Blink-Cursor Desktop-Save Diff-Auto-Refine Ede Electric-Indent
  File-Name-Shadow Flycheck Flycheck-Color-Mode-Line Font-Lock
  Global-Ede Global-Flycheck Global-Font-Lock Global-Semantic-Decoration
  Global-Semantic-Highlight-Func Global-Semantic-Idle-Breadcrumbs
  Global-Semantic-Idle-Completions
  Global-Semantic-Idle-Local-Symbol-Highlight
  Global-Semantic-Idle-Scheduler Global-Semantic-Idle-Summary
  Global-Semantic-Stickyfunc Global-Semanticdb Jdee-Etrace Line-Number
  Menu-Bar Mode-Icons Mouse-Wheel Pallet Schrute Semantic Shell-Dirtrack
  Show-Paren Tool-Bar Tooltip Which-Function Yas Yas-Global

Is there some other variable that I need to set to prevent multi-line string highlighting?


texts: Can we force emacs to not load byte compiled files?

texts:
I would like Emacs to not use byte-compiled files because the stack-trace is really messy.

So for my own elisp files, I can add ;; -*-no-byte-compile: t; -*- to disallow byte-compilation.

But how can I enforce this for the packages like evil downloaded from elpa, melpa etc?

Can I prevent package installation from byte-compiling so
that there are no .elc's created in the first place?
If that is not possible, I could probably delete them, but would
that not be recreated or is that automatically happening during
the installation only?

The comment says that I can remove the load-path of .elc, but as far as I know, both .el and .elc is on the same path!


texts:
Is there a way to open multiple buffers that are open at the same time?
The idea is to be able to refactor code and variable names in multiple files at once. I know that dired-do-find-regexp-and-replace exists but I was hopeing for a way where I could more clearly see what was happening.

Perhaps something related to multi-occur. Or allowing me to have multiple files open in one buffer and then using multiple-cursors.


texts: File names encoding when running shell-command on Windows XP

texts:
I faced a problem when pdflatex launched from Emacs couldn't compile files whose name contained Russian characters. The same code worked on Linux, so I suspected that something is wrong with encoding of file name. OS: Windows XP, file system encoding is cp-1251, Emacs:  24.5.1.

I created 2 files:

D:/Russia.tex
D:/Россия.tex

Then I tried this:

;works fine, produces Russia.pdf
(shell-command "pdflatex D:/Russia.tex")

;doesn't work. TeX error: I can't find file `D:/Россия.tex'
(shell-command "pdflatex D:/Россия.tex")

Then I tried to convert the Russian name to cp-1251:

;This works, but hard-coded 'cp1251 is bad
(setq file-name (encode-coding-string "D:/Россия.tex" 'cp1251))
(shell-command (concat "pdflatex " file-name))

This code has 1 defect - the file system encoding is hard-coded. Encoding and I/O page says that there is a variable file-name-coding-system --- "specifies the coding system to use for encoding file names". But it is nil for me.

Also the fact that utf-8 code doesn't work is weird as the page says:

  On Windows 2000 and later, Emacs by default uses Unicode APIs to pass
  file names to the OS, so the value of file-name-coding-system is
  largely ignored. Lisp applications that need to encode or decode file
  names on the Lisp level should use utf-8 coding-system when
  system-type is windows-nt; the conversion of UTF-8 encoded file names
  to the encoding appropriate for communicating with the OS is performed
  internally by Emacs.

Maybe this note about utf-8 is not applicable to shell-command? How to get the encoding of the file system?


texts: Meta key sending some commands two times over Citrix VDI

texts:
I am using Emacs 26.1 on a Windows machine that I connect to via Citrix Viewer running on MacOS 11.1.
I'm using left-option as my meta key.
When using org-mode, the meta key is behaving inconsistently. Some commands are sent twice on a single press, and other commands are sent correctly just once. Some other behaviours don't work at all, or send something completely different.
I'm running command-log-mode to capture commands, and I can see the following:
<M-up>
<M-down>   org-metadown[2 times]
<M-right>  org-metaright
<M-left>   org-metaleft

<M-x> doesn't work correctly either, and in command log shows a double decker ~ with a command of org-self-insert-command
Has anyone else encountered anything like this and possibly have any advice on how to make this consistent?


texts:
Can Emacs update itself?  (with user action or automatically does not matter)
Is it possible to hit a chord or a M-x emacs-update like function to update to a desired version of Emacs or to the latest? Is there such a feature built-in or through a package?
Is it even possbile?


texts: Customize modeline to display name of prev/next buffer

texts:
As topic says - I'm using tabbar + tabbar-forward-tab to quickly switch between recent buffers right now, but I don't really like it. I'd rather have the names of the previous and next buffer show up in my modeline, and use the built in buffer switch functions instead. Sounds easy, but I couldn't find where the buffer names are stored. Also, I don't know if modifying the modeline is trivial either.

Is this possible?


texts: Constant not recognized in lisp formula within org-mode spreadsheet

texts:
Here is a simple org-mode spreadsheet in which the third column is computed in terms of the second column by multiplying it
by the exchange rate between Euros and Dollars (taken to be 1.23) thru the lisp formula $3='(* $2 1.23)

|---------+----------------+------------------|
| Produce | Price in Euros | Price in Dollars |
|---------+----------------+------------------|
| Apples  |           3.00 |             3.69 |
| Oranges |           3.50 |            4.305 |
| Pears   |           4.00 |             4.92 |
|---------+----------------+------------------|
#+TBLFM: $3='(* $2 1.23);N

I'd like to be able to store the exchange rate in a constant, such as in

#+CONSTANTS: exchange=1.23

and then use it in my table, namely

|---------+----------------+------------------|
| Produce | Price in Euros | Price in Dollars |
|---------+----------------+------------------|
| Apples  |           3.00 | #ERROR           |
| Oranges |           3.50 | #ERROR           |
| Pears   |           4.00 | #ERROR           |
|---------+----------------+------------------|
#+TBLFM: $3='(* $2 exchange);N

However I am getting an error.  It seems to me that in the new version of the formula, namely  $3='(* $2 exchange), the
constant exchange is not being recognized.  And yes, I did press C-c C-c in the CONSTANTS line above to refresh the local setup.


texts: Org-mode: Disable `t` + `TAB` => `# TODO: ` autocomplete feature

texts:
There is a built-in org-mode shortcut where a t character followed by TAB key results in an auto-complete function that produces the # TODO: string literal. How can I disable this? Even better, how can I look up the function/key-binding that is called when this org-mode shortcut occurs so I can disable similar auto-complete functions from getting called?

I am aware of the C-h k and C-h f commands, but this is not a normal key-binding and I don't know what the function is called.

I would like to disable this shortcut because I find it annoying, especially when tabbing through org-mode tables.


texts:
Is there an emacs mode/package/whatever where a specific file size (and/or number of lines) is enforced in a visual way?

Something like this:

1st line
2nd line

where adding some text to the 2nd line will result in

1st line
2nd usele
----
ss line

where the "\n----\n" marks the part that will be cut off, allowing the user to bring it back in by removing spaces from the lines before it?

(this is just an example, the thing could be of course nicer, and in the case the file gets shorter, extra newlines would be appended and highlighted with some color, etc).


texts:
Auctex comes with a folding mode that already folds most of the uninteresting things. However, acronym macros are not folded. How can I instruct Auctex to fold acronym macros (e.g., \ac, \acp, \acf, etc.)?

\documentclass[12pt]{article}

\usepackage[printonlyused,nolist]{acronym}

% Acronyms
\begin{acronym}
  \acro{IDS}{Intrusion Detection Systems}
  \acro{ML}{Machine Learning}
\end{acronym}

\begin{document}

\title{Just another Auctex document}

\section{Section 1}
This section uses acronyms. For example, \ac{IDS} or \ac{ML}.

\end{document}

If I enable folding mode (TeX-fold-mode), how could I instruct Auctex to also fold the macros \ac{}?


texts:
I want to remove the push branch for a repository. I only use merge branch to push to a remote repository and now I have two headers with the same info all the time:

Head:     master Merge pull request #zzz in xxxxxxx from yyyyyyyyyy to master
Merge:    origin/master Merge pull request #zzz in xxxxxx from yyyyyyyyyy to master
Push:     origin/master Merge pull request #zzz in xxxxxx from yyyyyyyyyy to master

The adding of a push branch was a mistake but I don't know how to remove it.


texts: How can I create an Org link for each email sent by mu4e?

texts:
I'm using org-mode and mu4e. I'd like to have each email become the active link so that I can link to it in Org. When viewing an email, I can C-c C-l (bound to (org-store-link)) to make a link to it, and then elsewhere in Org C-c l to paste the link. I'd like the (org-store-link) part to happen automagically each time I send an email.

I've found two hooks: message-send-hook and message-sent-hook but am not sure where to call (org-store-link). I've tried that in a function on each hook, but it doesn't work. I think there is additional trickery to catch the just-sent (or sending) message.


texts: Applying additional display settings on new client frames

texts:
I have the following function in my emacs config:

(defun *make-frame-pretty (frame)
  "`*make-frame-pretty' will apply additional theme settings to make it prettier"
  ;; Add a fringe.
  ;; It's quite nice and makes things easier to read
  (set-fringe-mode
   (/ (- (frame-pixel-width)
         (* 75 (frame-char-width)))
      16))

  (set-default-font "Fira Code"))
(add-hook 'after-make-frame-functions '*make-frames-pretty t)

Outside the function, when starting emacs directly, this code applies the font and fringe size, however when starting an emacs daemon and then starting a client frame, it doesn't apply. When setup as a function as a hook like this, it doesn't apply at all.

How can I get this code to run when a new frame is created?


texts: How to get html tag completion working with smartparens in emacs?

texts:
I've installed the smartparens package, and features involving the normal pairs (parenthesis, brackets, curly braces, etc...) work fine; however, none of the features around tags (html tags for example) work for me. In particular, I can't get wrapping a selection in an html tag or auto-completing closing html tags to work in html-mode. Here's the relevant portion of my .emacs file, where I install the smartparens package:

(require 'smartparens-config)
(smartparens-global-mode t)
(show-smartparens-global-mode t)
(setq sp-show-pair-delay 0)

;; print offscreen matches in the echo buffer
(require 's)
;; show matching parens on steroids
(defadvice sp-show--pair-function
  (after sp-show--pair-function-offscreen activate)
  "If the matching paren is offscreen, show the matching line in the
          echo area."
  (interactive)
  (let ((vis-buf (save-excursion
           (cons (progn (move-to-window-line 0) (point))
             (progn (move-to-window-line -1) (line-end-position)))))
    (matching-sexp (if (and (sp-get (sp-get-sexp nil) :beg)
                (= (point) (sp-get (sp-get-sexp nil) :beg)))
               (cons (sp-get (sp-get-sexp nil) :beg)
                 (sp-get (sp-get-sexp nil) :end))
             (if (and (sp-get (sp-get-sexp t) :end)
                  (= (point) (sp-get (sp-get-sexp t) :end)))
                 (cons (sp-get (sp-get-sexp t) :beg)
                   (sp-get (sp-get-sexp t) :end))
               nil))))
    (when matching-sexp
      (if (> (car vis-buf)
         (car matching-sexp))
      ;; opening delim is offscreen
      (message "Matches %s"
           (s-trim
            (save-excursion (goto-char (car matching-sexp))
                    (thing-at-point 'line))))
    (if (< (cdr vis-buf)
           (cdr matching-sexp))
        ;; closing delim is offscreen
        (message "Matches %s"
             (s-trim
              (save-excursion (goto-char (cdr matching-sexp))
                      (thing-at-point 'line)))))))))

The long second piece is a snippet from this issue on github. I've been searching around awhile for a solution to this. Is there a key combination I need to use in order to start a 'tag' as opposed to a 'pair'? I'm using emacs 24.3, and I also have the packages linum-relative, autocomplete, auctex, and a couple others installed.


texts:
In a dired buffer of a directory, how do I copy the file names of all files matching [tT]ypolog[yi]?

Getting them from an elisp list format, \n separated format or otherwise into a python list format will be trivial, so the precise content of the kill ring matters little.


texts:
In org-mode, you are able to set the directory property for a heading in a straightforward manner by placing the following text under your heading of choice:
:PROPERTIES:
:DIR: ~/path/to/my_folder/
:END:

I frequently switch back and forth between a mac and a PC and the pathname to a particular directory might change slightly between the two platforms (e.g., ~/path/to/my_folder in my mac and c://users/me/path/to/my_folder in my PC.)
In lieu of changing my home variable, is there a way to make a heading-specific property conditional in org-mode? Or is there a way to set the dir property of a specific heading to a variable that I define in my init file?


texts: Avoid query to recover `buffer-undo-list`

texts:
Every time I commit via Magit before the buffer COMMIT_EDITSMSG is opened I get the question
buffer-undo-list is not empty. Do you want to recover now? (yes or no)
I'm guessing this is coming from an Emacs extension but I haven't been able to locate the source that prints this message neither in the Emacs sources nor under my ELPA root. Is this a known type of message or could it be triggered by the extensions https://gitlab.com/ideasman42/emacs-undo-fu and https://github.com/m2ym/undohist-el I'm using?