texts: How to replace a block of text with a "query-like" approach all at once?

texts:
I want to search and replace a block of text with a "query-like" approach all at once.
For example, if I have
\emph{``Foo $\bar$ baz''}

to be replaced by
\emph{Foo $\bar$ baz}

using a "query-like" approach all at once, how could I do?
I have tried something like this:
(defun foo ()
  (interactive)

  ;; \emph{``Foo''} --> \emph{Foo}
  (goto-char (point-min))
  (while (re-search-forward "\\\\emph{``" nil t)
    (save-excursion
      (let* ((pos1 (copy-marker (match-beginning 0)))
             (pos2 (copy-marker (progn
                                  (goto-char (- (match-end 0) 3))
                                  (forward-pexp)
                                  (point))))
             (text (buffer-substring-no-properties (+ pos1 8) (- pos2 3))))

        (query-replace-regexp (concat "\\\\emph{``"
                                      text
                                      "''}")
                              (concat "\\\\emph{"
                                      (regexp-quote text)
                                      "}")
                              nil pos1 pos2)))))

but it does not work if there are chars to be escaped (text could be everything, even chars to be escaped, like \ in LaTeX macro or [ ] or $...$ or other).
It works if there are no chars to be escaped.
I have just found a solution for this example with a "query-like" approach, i.e.
(query-replace-regexp "\\\\emph{``"
                      "\\\\emph{" nil pos1 pos2)

(query-replace-regexp "''}"
                      "}" nil (- pos2 3) pos2)

but it is not all at once. I would like to have only one call to query-replace-regexp.
Note
In this answer I have found a solution to be used for solving this question.


texts:
Is there any easy way (or maybe a package) which provides Ctrl-Del/Backspace behavior like in Sublime?
The default rule of sublime is delete-to-next-word-boundary. I did not find similar options. Emacs kinda delete too much for my taste.

Sublime Text Example

("C-h" . neotree-hidden-file-toggle)
("< |

Hit Ctrl-Backspace

("C-h" . neotree-hidden-file-toggle)
|

Hit Ctrl-Backspace

("C-h" . neotree-hidden-file-toggle)

Emacs Example

("C-h" . neotree-hidden-file-toggle)
("< |

Hit Ctrl-Backspace

("C-h" . neotree-hidden-file-


texts: Editing subtitles or closed caption files?

texts:
I'm having trouble locating any Emacs modes supporting YouTube caption/subtitles files.

This YouTube help page details the list of file formats for subtitles and captioning supported by YouTube:

Basic file formats

SubRip (.srt)
SubViewer (.sbv or .sub)
MPsub (.mpsub)
LRC (.lrc)
Videotron Lambda (.cap)

Advanced file formats

SAMI (.smi or .sami)
RealText (.rt)
WebVTT (.vtt)
TTML (.ttml)
DFXP (.ttml or .dfxp)

Broadcast file formats

Scenarist (.scc)
EBU-STL (.stl)
Caption Center (.tds)
Captions Inc. (.cin)
Cheetah (.asc)
NCI (.cap)

The help page ends with the note:

  Scenarist Closed Caption (.scc file extension) files are our preferred file format. These files have an exact representation of CEA-608 data, which is the preferred format whenever captions are based on CEA-608 features.

Short of trying each of these formats and seeing if any of them are close enough to a mode Emacs does deal with, I'm not sure which of these, if any, are editable with Emacs as more than plain text or XML. (Most of the "broadcast" ones listed above aren't even that, they're binary files.)

TTML, being an XML language (see, for example, this gist), obviously can be edited and syntax-highlighted. But what dedicated captions editors do goes far beyond this; at a minimum, you need a programmatic way of dealing with timestamps.

Anyone have any suggestions for solutions here for Emacs?


texts: org-mode list DONE tasks with parent level two task as context?

texts:
I'd like to list tasks done with their parent org hierarchy (projects/purposes).
In my setup, the level 2 tasks are the projects. Under each project,
I have org subheadings as tasks for the project.
So I wonder if there is already available implementation to achieve that, or
there is some similar logic that I can borrow from?

Essentially, it will do like the code for agenda views,
to scan the files in org-agenda-files,
but keep the parent context for those DONE tasks, and
present the found tasks with its top-level 2 headings.
So far, it seems to me that the implementation of the agenda views will only
show the tasks themselves, without context.

I've searched here but haven't found a clue that shows how to
have the parent heading of a task in the filter/scan.

Alternatively, I might do a work-around to list the top-level "project" headings with subtasks that have been done. I guess that this is doable.

Then it would serve my purpose to list those done tasks by combining the view of the project list with tasks done, and the view of the done tasks, arranging them in the proper project hierarchy.

So the more fundamental requirement is to present the tasks in a hierarchy (sparse-tree?).

Based on the concept of sparse tree, the requirements may be transformed as:
to show the sparse-tree of the DONE tasks with its respective project headings

Update 1:

Based on my research it is not yet possible to show sparse-tree in agenda view across multiple org agenda files as the question: Display multi-file org agenda as a sparse tree?

The work-around, for now, is to have all the org headings that I care for sparse-tree in one file, perform a sparse-tree search there with command C-c /

Update 2:

Based on @Hubisan's suggestion, I ended up adopting the following solution (right align at the 30 space characters if the bread-crumb is less than 30 characters):

(setq org-agenda-prefix-format '((todo . "%-30b") (tags . "%-30b") (agenda . "%-30b"))

Here is the output:

Worship->Fellowship->         DONE Arrange the Zoom or Google hangout for bible pre-study
Job->DR->                     TODO [#A] Arrange the disposal at W20/train control room
Job->DSS->                    TODO Study the feasibility of fanless treatment with LCD monitors

It's good enough for my purpose.


texts:
I just upgraded to the newest version of Magit having used the old version for years. All the improvements are great after a little searching around and figuring out the differences.

Now, I'm just trying to do the simplest (non-interactive) rebase in magit and I can't figure out how to do it. This example is from https://git-scm.com/docs/git-rebase.

git checkout topic
git rebase master

Hit r
?
My topic branch is rebased with the newest changes from master.


texts: Can I "find-file //hostname/dirname/filename"

texts:
GNU Emacs 24.5.1 (i686-pc-mingw32); local host is MS Windows 7; remote machines are all running variants of MS Windows.

I would swear I've used this syntax (most recently less than a month ago) but it "no longer works" (or I no longer remember.) The Windows explorer shows that the hostname, dirname, and filename exist and are accessible.

I've even forgotten the name of the access method indicated by "//hostname" so my net searches are less than useful.

I could "net use 'g:' '\hostname\dirname' /persist:yes" but I consider that a gross hack to be used only in the case I can't get the easier (for me) direct naming mechanism to work.


texts: backword-sentence and forward-sentence are moving over paragraphs

texts:
I use markdown-mode to edit markdown, but it's missing one very useful feature. Whenever I press M-a (backward-sentence) or M-e (forward-sentence) it takes me to the start or end of the paragraph, respectively. I want it to send me to start/end of the sentence (to the nearest period, question mark, etc).

Is there way to get markdown-mode to properly go to the start or end of the sentence?


texts: What is the variable for having multiple minibuffers?

texts:
I remember a while back that I could open a minibuffer within a minibuffer.

But now I can't seem remember what the variable was or if it was package specific.

I'm using Ivy, Swiper, and Counsel.

Does anyone know?


texts: How execute multiple lists in a true statement?

texts:
For this simple question, I never found any answer. Let assume I have the following:

(if (true)
    (foo1) ;; When true
    (bar) ;; When false)

So I would like to combine foo1 and foo2

(if (true)
    (foo1)(foo2) ;; When true
    (bar) ;; When false)

The problem is that the Emacs Lisp interpreter consider foo2 as false statement. Trying to devise some workaround, I could get away with the following:

(if (true)
    (foo3) ;; When true
    (bar) ;; When false)

(defun foo3 ()
    (foo1)
    (foo2))

But this could be quite cumbersome when you use if-else statements a lot.  How
could I find a more practical way for this?


texts: function that takes a command and a mode-map returning the bound string

texts:
Is there a command ie: get-bounded-string that is available that performs this?
(defun no-op () nil)

(define-key dired-mode-map (kbd  "C-c C-7") 'no-op)

then
(get-bound-string dired-mode-map 'no-op)
=> "C-c C-7"


texts: "Making tag completion table" Freezes/Blocks -- how to disable

texts:
TLDR: I've got a large tags file that loads multiple times per session, making it unusable.  Can't find the source of issue or how to disable it -- main goal is to jump to tags, but completion would be nice

I recently posted on the emacs subreddit and a user recommended that I join this group because it's also friendly towards newbies.

I've been using emacs as a C++ IDE, and I'm slowly correcting things that are annoying.  I'm essentially using redguardtoo's emacs.d file.

I have a tag file that is 225MB (1.6M Tags).  My intent for the tag is not necessarily completion (using company), but more for jumping around source code.  I'm working with an unfamiliar code base and often need to see macro or class definitions.

When I start typing, at random times, I'll see a message in the minibuffer

Making tag completion table for [tag file]...0-100%

Then, a popup listbox shows up with autocompletion options.

Because this tag file is so large, and it doesn't seem like the tag loading is asynchronous, it freezes emacs for around a minute.  This also happens multiple times per a session (with the same file, and with other files in the same directory that use the same tag file)!

Questions

Does anyone know what's initializing the loading of the tag table for completion and how to disable it?  I did a grep on my emacs.d directory for "Making tag completion" and found nothing (note, IIRC the loading tags was present regardless of using company or auto-complete
Completion would be nice, but I'd settle just for the ability to jump to the tag location.  Is there a way to get this?
What is the mindset to take when approaching problems like this?  I'd like to be able to troubleshoot further on my own next time.

Additional info

Enabled minor modes (C-h m)

Enabled minor modes: Abbrev Auto-Composition Auto-Compression
Auto-Encryption Blink-Cursor Column-Number Company Desktop-Save
Display-Time Electric-Indent Electric-Pair Evil Evil-Local
Evil-Matchit Evil-Surround Fic File-Name-Shadow Flyspell-Lazy
Font-Lock Ggtags Global-Auto-Revert Global-Company Global-Eldoc
Global-Evil-Matchit Global-Evil-Surround Global-Font-Lock Global-Linum
Global-Page-Break-Lines Global-Pointback Global-Undo-Tree Helm
Helm-Match-Plugin Helm-Occur-Match-Plugin Line-Number Linum Menu-Bar
Mouse-Wheel Override-Global Pointback Recentf Savehist Shell-Dirtrack
Subword Tooltip Undo-Tree Which-Function Window-Numbering Winner Yas
Yas-Global

package-activated-list is equal to

(ace-jump-mode ag s dash anaconda-mode f dash s dash json-rpc auto-compile packed bbdb bookmark+ browse-kill-ring buffer-move clean-aindent-mode cmake-mode coffee-mode color-theme company cpputils-cmake crontab-mode csharp-mode diminish dired+ dired-details dropdown-list dsvn elnode kv db kv fakir kv dash noflet creole kv noflet s noflet dash web s dash emmet-mode erlang evil-args evil goto-chg undo-tree evil-search-highlight-persist exec-path-from-shell expand-region f dash s fakir kv dash noflet fancy-narrow flymake-coffee flymake-easy flymake-css flymake-easy flymake-haml flymake-easy flymake-jslint flymake-easy flymake-lua flymake-python-pyflakes flymake-easy flymake-ruby flymake-easy flymake-sass flymake-easy flymake-shell flymake-easy flyspell-lazy fringe-helper ggtags git-gutter git-timemachine gitconfig-mode gitignore-mode goto-chg haskell-mode helm-descbinds helm async helm-gtags helm async hl-sexp htmlize ibuffer-vc idomenu iedit json-mode json-snatcher json-reformat json-reformat json-rpc json-snatcher kv legalese less-css-mode lua-mode magit git-rebase-mode git-commit-mode markdown-mode maxframe mic-paren move-text multi-term mwe-log-commands noflet org-fstree packed page-break-lines paredit pointback pomodoro pretty-mode project-local-variables quack rainbow-delimiters regex-tool rinari jump inflections findr ruby-compilation inf-ruby inf-ruby robe inf-ruby ruby-compilation inf-ruby rvm sass-mode haml-mode scratch scss-mode session sr-speedbar string-edit dash switch-window tagedit dash s textile-mode undo-tree unfill w3m web s dash wgrep ws-butler yaml-mode yasnippet


texts: Restricting helm's fuzzy match to a substring of the candidate

texts:
helm sources have a slot named match-part which, IIUC, is the part of the transformed candidate that will be matched. In particular, the source helm-files-in-current-dir-source has the following match-part:

(match-part :initform (lambda (candidate)
                           (if (or helm-ff-transformer-show-only-basename
                                   helm-recentf--basename-flag)
                               (helm-basename candidate) candidate)))

This source also has fuzzy-match set to t. With helm-ff-transformer-show-only-basename set to t, I still see this source, when used as part of helm-for-files, doing fuzzy-matching on the full file name and not just the basename. For example, abc matches the file aaa/bbb/ccc. I had assumed match-part would transform the candidate aaa/bbb/ccc to just ccc, which abc would fail to match even with fuzzy matching on. What am I doing wrong?

The fuzzy match function which kicks in for the source helm-files-in-current-dir-source is the default helm-fuzzy-match.


texts:
I can't see that there is anyway in dired to hide permissions and ownership, but show size and date.

As the only user on the system and using a version control system, my files generally belong to me and are read-write.


texts:
According to match-string help:

  Value is nil if NUMth pair didn't match

In fact:

(string-match "\\(hullo\\)" "hello")
(match-string 1 "hello")

gives nil

Also, a NUM

  Zero means the entire text matched by the whole regexp or whole string.

Therefore, given:

(string-match "hullo" "hello")
(match-string 0 "hello")

I'd expect a nil, as above, since since the 0-th pair didn't match.
Instead, I get the Lisp error args-out-of-range.


texts:
I'm running Spacemacs and have eshell enabled. I want to run the elixir tests every time I change any files in the directory.

This is the command I'm running

ls * | entr elixir bob_test.exs

This runs perfects through external terminal but when in eshell it returns with this output

release: 4.1
usage: entr [-cdnprs] utility [argument [/_] ...] < filenames

What is the issue? I'm using the fish shell.


texts:
Emacs 26.1
I has keybinding
‘C-a C-SPC C-e M-w’ copies the current line without the newline.
But it's to long shorcut.
I want to change it to C-c
So as result when I press C-c to copies the current line without the newline.
Is it  possible?


texts: Function to highlight timestamp generated from org-time-stamp

texts: We can create a timestamp (e.g., <2018-01-11 Thu>) by C-c . which runs the command org-time-stamp.  How can we highlight (i.e., create a region) the whole timestamp when the cursor is on it?


texts: Is it possible to transform emacs to something like bpython?

texts:
bpython detects what libraries are installed and has autocompletion for codes that weren't previously written in the text, if you ever used bpython you know what I mean.

Sometimes i use bpython because i can't remember all the functions that a certain library has by default and bpython autocompletes it. Is that possible in emacs?

A plugin that detects what python libraries you have installed, either on the PC or in a virtualenv and predicts the name of the function you're calling based on that.

Originally I asked this question on askubuntu, it was about emacs and sublime text, and they told me that the emacs part can be answered here, so here I am!


texts: Org-mode : disable indentation when promoting and demoting trees + subtrees

texts:
In org-mode, when you press M-S-right or M-S-left to demote or promote a tree with all it's subtrees, the content text is also indented.

So suppose I want to deomote the following structure by two levels, in order to replace it as a part of another tree structure. Then from this:

* A
text
** A.I
text
*** A.I.1
text

...I get this:

*** A
  text
**** A.I
  text
***** A.I.1
  text

How can I disable this indentation? Thanks.


texts: Latex fragment preview doesn't work with ImageMagick

texts:
In org mode, previewing a particular latex fragment with C-c C-x C-l renders incorrectly when using ImageMagick instead of the default dvipng.

Rendering with dvipng works:

Rendering with ImageMagick doesn't work:

Elisp to use ImageMagick instead of dvipng:

(setq org-latex-create-formula-image-program 'imagemagick)

Note: I need to use ImageMagick because the dvipng setting doesn't respect org-latex-pdf-process, as documented here.

Emacs 25.0.50.1 64bit linux

ImageMagick 6.7.7


texts: Merging consecutive entries that share the same headline

texts:
I've been trying to achieve the following:

* Riviere
Contents of Riviere title

* Riviere
More contents of Riviere

turn into:

* Riviere
Contents of Riviere title
More contents of Riviere

I found a function that almost gets the job done. I tried adding a heading2 variable and changing the condition to match heading and heading2:

(defun promote-screenings-and-readings (&optional backend)
  (org-map-entries
   (lambda ()
     (let ((point (point))
           (heading (buffer-substring-no-properties
                     (point)
                     (save-excursion
                       (forward-line)
                       (point))))
           (heading2 (save-excursion
                       (org-backward-heading-same-level 1)
                       (forward-line))))
       (when (or (string= heading heading2))
         (org-map-entries
          (lambda ()
            (unless (= (point) point)
              (org-promote)))
          nil 'tree)
         (forward-line)
         (delete-region point (point)))))))

But it still doesn't work. That's how I set heading2, right? If I change string= heading "* Anything here\n" the heading gets deleted.

The reason behind this is I keep all my college slides inside an org file, and I want to avoid repetitive headlines when exporting to something other than Beamer. There are 5k lines in the document, so I think using the :no_title: method would be inefficient.


texts: Org-mode doesn't seem to be exporting listings/minted correctly

texts:
Emacs is exporting listings blocks (i.e. #+BEGIN_SRC <lang>) in a strange, incorrect way. Here's an example of what I mean with a simple org file:

#+AUTHOR:
#+BEGIN_SRC js
var dog = "dog!"
#+END_SRC

#+BEGIN_SRC R
dog <- "dog!"
#+END_SRC

Here is the output LaTeX:

% Created 2014-12-15
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\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}
\usepackage{listings}
\usepackage{color}
\tolerance=1000
\date{\today}
\title{test}
\hypersetup{
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs 24.3.1 (Org mode 8.2.7c)}}
\begin{document}

\maketitle
\tableofcontents

\lstset{backgroundcolor=gray,language=js
var,label= ,caption= ,numbers=none}
\begin{lstlisting}
var dog = "dog!"
\end{lstlisting}

\lstset{backgroundcolor=gray,language=R
dog,label= ,caption= ,numbers=none}
\begin{lstlisting}
dog <- "dog!"
\end{lstlisting}
% Emacs 24.3.1 (Org mode 8.2.7c)
\end{document}

The \lstset lines are messed up: they have an extra new line, and they repeat the first word given after language.

Here are the relevant lines from the (custom-set-variables section of my dotfile:

 '(org-latex-listings t)
 '(org-latex-listings-langs (quote ((emacs-lisp "Lisp") (lisp "Lisp") (clojure "Lisp") (c "C") (cc "C++") (fortran "fortran") (perl "Perl") (cperl "Perl") (python "Python") (ruby "Ruby") (html "HTML") (xml "XML") (tex "TeX") (latex "[LaTeX]TeX") (shell-script "bash") (gnuplot "Gnuplot") (ocaml "Caml") (caml "Caml") (sql "SQL") (sqlite "sql") (R-mode "R"))))

 '(org-export-latex-listings t)
 '(org-export-latex-listings-langs (quote ((emacs-lisp "Lisp") (lisp "Lisp") (clojure "Lisp") (c "C") (cc "C++") (fortran "fortran") (perl "Perl") (cperl "Perl") (python "Python") (ruby "Ruby") (html "HTML") (xml "XML") (tex "TeX") (latex "TeX") (shell-script "bash") (gnuplot "Gnuplot") (ocaml "Caml") (caml "Caml") (sql "SQL") (sqlite "sql") (R-mode "R"))))

This also seems to occur if the above listings options are removed and org-export-latex-listings is set to minted:

pdfcreator={Emacs 24.3.1 (Org mode 8.2.10)}}
\begin{document}

\maketitle
\tableofcontents

\begin{minted}[]{js
var}
var dog = "dog!"
\end{minted}

\begin{minted}[]{r
dog}
dog <- "dog!"
\end{minted}
% Emacs 24.3.1 (Org mode 8.2.10)
\end{document}


texts: How to restore window layout on `org-agenda-switch-to`?

texts: Pressing q in an agenda view restores the window layout if org-agenda-restore-windows-after-quit is non-nil. Is there a way to do the same on RET (org-agenda-switch-to)?


texts:
I recently switched to emacs. Just wanted to see how it works and if it'll help with productivity.

Right now I'm working in Haskell, which means a lot of function composition with . operator.

I have a code block that looks like this

certainat :: Certain -> Maybe Double
certainat = join . fmap at . certainCalls . certainEffects

certainld :: Certain -> Maybe Double
certainld = join . fmap maybeIDFunctionCallld . certainCalls . certainEffects

certainxin :: Certain -> Maybe Double
certainxin = join . fmap insert . certainCalls . certainEffects

and I want to align entire block on .

Reading through wiki docs, I tried doing it with C-u M-x align-regexp .\(\) but the result was weird spacing between characters. Plus that only worked on one line.

What should I do?


texts: Get a better printed representation of a hash-table

texts:
I work with ELisp hash-table and I would like to have a better printed representation of it. I'm on Emacs version 24.5.1. When I create a hash-table

(setq table (make-hash-table))
(puthash :name "john" table)
(puthash :age 31 table)

I get something like:

#s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8 data
          (:name "john" :age 31))

But I just want to have the content (i.e. data) of my hash-table.

(:name "john" :age 31)

I know that you can have a specific printed representation in Common Lisp thanks to the print-object method. Even the pretty printer pp displays the hash-table metadata. Any idea?

Thanks


texts: How to find a file recusively in children directories?

texts: How to find a file recursively in children? Like the opposite of locate-dominating-file (locate-dominating-file finds file recursively in its parent directory)?


texts:
I am facing a strange behavior regarding the implementation of color for shell outputs when using eshell. This is the content of my .emacs:
(require 'xterm-color)
(require 'eshell)
(add-hook 'eshell-before-prompt-hook
          (lambda ()
            (setq xterm-color-preserve-properties t)))

(add-to-list 'eshell-preoutput-filter-functions 'xterm-color-filter)
(setq eshell-output-filter-functions (remove 'eshell-handle-ansi-color eshell-output-filter-functions))
(setenv "TERM" "xterm-256color")

Strangely enough, eshell does not correctly show the colors on outputs (of git, or pytest for example) after emacs is initialized. However it does not raise any errors and, after it has been initialized, I evaluate this section of my init file with C-x C-e and, after I do that and restart eshell, it works fine as I expected.
I don't understand why it would work only if executed after emacs is initialized but would not have the expected effect on .emacs.
I do have the line (setq initial-buffer-choice 'eshell) on my .emacs, but only after the section above.
Any insight on why that might be happening would be helpful.
Thank you,


texts: different settings for ido-find-file and ido-switch-buffer

texts:
I like arbitrary substring matching for buffer completion but I want to disable it when completing file names or directories.  The idea is to set ido-enable-prefix to t only when ido-find-file is being used, and nil otherwise.

So something like this looks like it should work but it doesn't.

(setq ido-enable-prefix nil)

(defun ido-init-file-dir ()
  (when (or (eq ido-cur-item 'file) (eq ido-cur-item 'dir))
    (set (make-local-variable 'ido-enable-prefix) t)))

(add-hook 'ido-setup-hook 'ido-init-file-dir)

Any ideas?


texts: Read a config file and get some value into elisp variable

texts:
I'm trying to read a value of variable context from the config file. I use something like this (but have got an error..):

(with-current-buffer
(insert-file-contents "/home/user/liquibase.properties")
(keep-lines "contexts" point-min point-max)
)

The file /home/user/liquibase.properties has the following structure:

logLevel: off
contexts: my_context
...

Give me a direction please. How to read the content of properties-file, filter it and store some value into a variable? To have the same result as after a call:

(setq ctx "my_context")


texts: How to have org-publish automatically publish generated images?

texts:
I use org-publish to publish HTML exports of org-mode files quite often to share documents with my coworkers, however, I generate a lot of diagrams with plantuml and gnuplot. These diagrams aren't sent to the remote server when I export the file with C-c C-e P f.

My configuration looks like:

("org-pastebin"
 :base-directory "~/org/"
 :base-extension "org\\|zsh\\|html\\|png"
 :publishing-directory "/ssh:user@server:~/public_html/org/"
 :publishing-function org-html-publish-to-html
 :with-toc t
 :html-preamble t)

If I have an org-mode file that looks like:

* Header
Some prose

#+BEGIN_SRC plantuml :file my-file.png :results raw
...
#+END_SRC

#+RESULTS:
[[file:my-file.png]]

How can I get Emacs to automatically publish the linked file (my-file.png) in this case? Even if I publish the whole project the images are not copied.


texts: How to change the buffer unification suffix for non local files?

texts:
When I open for example the file syslog.conf on four different hosts with Tramp the buffer names are

syslog.conf
syslog.conf<2>
syslog.conf<3>
syslog.conf<4>

When I try to change the buffer with tab completion, this is all I see.  The information which buffer belongs to which host is not visible.

Is it possible to tell Emacs to put the name of the remote host into the buffer name?

I would prefer the following buffer names for non local files.

syslog.conf@host1
syslog.conf@host2
syslog.conf@host3
syslog.conf@host4


texts: Prevent fill-paragraph from breaking Org Mode inline source block

texts:
The fill-paragraph function isn't aware of the inline Org Mode source block syntax and is able to destroy it. For instance the following paragraph

Lorem ipsum dolor sit amet, consectetur src_emacs-lisp[:var x='adipiscing]{x} elit.
Proin nibh augue, suscipit a, scelerisque sed, lacinia in, mi.

(after invoking the fill-paragraph) is rearranged into

Lorem ipsum dolor sit amet, consectetur src_emacs-lisp[:var
x='adipiscing]{x} elit. Proin nibh augue, suscipit a, scelerisque
sed, lacinia in, mi.

and the source block functionality is broken.

How can I prevent fill-paragraph from breaking Org Mode inline source block?

UPDATE:

I had this issue in Org Mode version 8.3.4. The problem does not apply to the Org Mode version 9.0.3 (at the time of writing this, 9.0.3 is the latest version available on Melpa).

Beware of this issue when updating to 9.X version!


texts: M-= shortcut suddenly stops working in Emacs in KDE

texts:
I'm trying to run M-= on a region of text, but nothing happens. I think the shortcut is registered (I don't get a message like "M-= is undefined") but the execution stops for some reason and there is no output.

If I run the command that the shortcut is bound to manually, count-words-region, it works fine. It also works if I type Esc =.

I added (global-set-key (kbd "M-=") 'count-words-region) to my initialization file, just to be sure that it is bound, but no effect. In fact, even if I bind some other function to M-=, pressing it has no effect.

I suspected that a recent update of the desktop environment might have redefined M-= (I'm using KDE), but currently nothing seems to be bound to that key.

How to debug this?

Update. If I run M-= through xev, I get the following output:

Alt pressed:

KeyPress event, serial 40, synthetic NO, window 0x5800001,
    root 0x1c9, subw 0x0, time 3737607, (61,104), root:(1461,133),
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

= pressed:

FocusOut event, serial 40, synthetic NO, window 0x5800001,
    mode NotifyGrab, detail NotifyAncestor

FocusOut event, serial 40, synthetic NO, window 0x5800001,
    mode NotifyUngrab, detail NotifyPointer

FocusIn event, serial 40, synthetic NO, window 0x5800001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 40, synthetic NO, window 0x0,
    keys:  4294967241 0   32  0   0   0   0   0   1   0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

= released:

KeyRelease event, serial 40, synthetic NO, window 0x5800001,
    root 0x1c9, subw 0x0, time 3738919, (61,104), root:(1461,133),
    state 0x8, keycode 21 (keysym 0x3d, equal), same_screen YES,
    XLookupString gives 1 bytes: (3d) "="
    XFilterEvent returns: False

Alt released:

KeyRelease event, serial 40, synthetic NO, window 0x5800001,
    root 0x1c9, subw 0x0, time 3739829, (61,104), root:(1461,133),
    state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Does this mean the shortcut is handled by another process and how to find out which one?


texts: Using package siunitx when previewing latex fragments in org-mode

texts:
I'm using siunitx extensively in my lab reports, but I'm unable to get units to appear correctly when previewing latex fragments.

This is what the latex fragment looks like:

... with preview applied:

The final result is just fine:

I've looked at the documentation for preview-latex, but it's not clear what I need to add to preview-default-preamble or preview-default-option-list in order to use a particular latex package in the preview. How do I include packages for use in rendering the preview? In addition, I'm using \sisetup{per-mode=fraction} to get the units formatted in the way that I like; is there a way to include this in the list of options?


texts: Checking whether an org headline or any of its parents is done

texts:
One can use org-entry-is-done-p to check whether a headline is locally done:
(defun org-entry-is-done-p ()
  (member (org-get-todo-state) org-done-keywords))

So for example Task B is considered "done" using this methodology:
* Task A
** COMPLETE Task B
   CLOSED: [2021-03-08 Mon 15:51]
*** Task C

Question: How can one modify this function that it will consider Task C also done?  That is, how can one make a function that checks whether the current headline or any of its parents is done?


texts: after update from ubuntu 16.04 to 18.04 cannot publish project; getting "eval: Symbol’s value as variable is void: org-enable-table-editor"

texts: It appears that I've also lost the ability to use Emacs Org basic table editing commands. For example, when I start a table with a | and add the column headings then hit TAB, Emacs returns the same message: Symbol’s value as variable is void: org-enable-table-editor.


texts: function to put current buffer in temporary register

texts:
I want to access any current file quickly. Therefore I want to build a function that put a file the register.

I've started with this function:

(defun tmp-register ()
""" put the current buffer in the temporary register """
(interactive)
(set-register , ?q  (file . buffer-file-name))
)

but it fails as expected as I need a string instead of buffer-file-name. Do you see a way around this?

Update

I have tweaked some code from Sacha Chua here. I've come up with this. I don't understand it entirely yet and it can probably be improved. Do you have something else in mind?

(defun tmp-register ()
""" put the current buffer in the temporary register """
(interactive)
(my/defshortcut ?q buffer-file-name)
)

(defvar my/refile-map (make-sparse-keymap))
(defmacro my/defshortcut (key file)
  `(progn
    (set-register ,key (cons 'file ,file))
 (define-key my/refile-map
   (char-to-string ,key)
   (lambda (prefix)
     (interactive "p")
     (let ((org-refile-targets '(((,file) :maxlevel . 6)))
           (current-prefix-arg (or current-prefix-arg '(4))))
       (call-interactively 'org-refile))))))

(global-set-key (kbd "<f12>") 'tmp-register)


texts:
How does M-x transpose-sentences work? I tested it by executing the command with point at various places (as indicated) in the following:

this is sentence 1. this is sentence 2. this is sentence 3.
^       ^        ^^^^       ^        ^^^^       ^        ^^

It either appears to do nothing, or returns "Don't have two things to transpose".


texts: How to refile to the top of another heading?

texts:
When refile a heading in org mode, I would like to refile it to the top of the target heading so that the new subheading is the first entry.

For my use case, I use org-capture for meeting notes, and when I'm done, I will file the meeting notes to my * MEETINGS heading. I order all the meeting notes in reverse order under * MEETINGS, and I'd like to refile the new meeting notes to the top.


texts: Faster way to store an org link to an identifier in a projectile project?

texts:
I'm trying to come up with a faster workflow for storing org-file links to parts of a source code tree. I'm generally starting in my org file taking notes, doing a helm-ag to search for some function or variable, doing an org-store-link from the found file, going back to the org file and then doing an org-insert-link.

While this works, it feels a bit clunky. I'm wondering if I can do this perhaps straight from the helm session - helm-find-files provides a 'Insert as Org Link' (helm-ff-run-insert-org-link). Is there a library or something else that provides a similar feature for helm-ag (or for other search buffers)?


texts: Additional binding for keyboard-quit doesn't work with minibuffer

texts:
I set (global-set-key (kbd "H-g") 'keyboard-quit).

When the minibuffer is open and waiting for input, and I want to quit out of it, when I hit H-g, the bell rings and I see the Quit message, but the minibuffer remains open and accepting input. C-g works as expected: closes the minibuffer.

How can I make H-g quit the minibuffer?


texts: How to prevent eshell interpret bash shell command?

texts:
I want to execute the source shell command from the eshell environment in Emacs. But the source is also a lisp function, so the two command confilicts, and eshell always execute the source function, instead of the source shell command.

How to prevent this?


texts: Display TODO Count/custom variable in Org agenda header

texts:
I grabbed code from org effectiveness as shown below:

  (defun org-effectiveness-count-todo()       ;;org-effectiveness-count-todo
  "Print a message with the number of todo tasks in the current buffer"
  (interactive)
  (save-excursion
    (goto-char (point-min))
    (message "Number of TODO: %d" (count-matches "TODO"))))

When I put org-effectiveness-count-todo in any buffer, it shows TODO count correctly.  When I put this code in agenda header, it shows only zero.

(org-agenda-overriding-header (org-effectiveness-count-todo) ...

]2


texts:
I'm using evil-mode and olivetti-mode, which adjusts the margins so that the text is centered in the window. My screen usually looks like this:

               Voluptatem tempore unde eveniet cumque dolores
               aliquid veritatis. Rem ea voluptas sed minus qui
               illo. Magni reiciendis excepturi dolorem. Est
               pariatur sed rerum. Quis nobis laboriosam sint
               ut qui neque.

               Inventore quod eveniet tenetur quod doloribus
               possimus. Aut sed est sunt id sit nihil. Minima
               aut eius quas. Enim voluptatem quos et
               cupiditate consequuntur voluptatem aut sint.
               Voluptates maxime in autem ut. Voluptatem quasi
               vel neque tenetur illo quod.

               Iure cumque ut quas sapiente. Id voluptatibus
               vero libero ipsum. Quaerat consequuntur quam
               accusamus. Impedit illo sed aut quia sit.

               Autem saepe perferendis vero. At deleniti
               nesciunt sunt molestiae quo. Qui ab et quam ut.
               Est est ut mollitia sunt.

-UU-:----F1  test.md        Top L2       (Markdown Olv Undo-Tree ElDoc Wrap)

However, when I run a command, the margins get set to zero, and my screen looks like this:

Voluptatem tempore unde eveniet cumque dolores aliquid veritatis. Rem ea
voluptas sed minus qui illo. Magni reiciendis excepturi dolorem. Est pariatur
sed rerum. Quis nobis laboriosam sint ut qui neque.

Inventore quod eveniet tenetur quod doloribus possimus. Aut sed est sunt id
sit nihil. Minima aut eius quas. Enim voluptatem quos et cupiditate
consequuntur voluptatem aut sint. Voluptates maxime in autem ut. Voluptatem
quasi vel neque tenetur illo quod.

Iure cumque ut quas sapiente. Id voluptatibus vero libero ipsum. Quaerat
consequuntur quam accusamus. Impedit illo sed aut quia sit.

Autem saepe perferendis vero. At deleniti nesciunt sunt molestiae quo. Qui ab
et quam ut. Est est ut mollitia sunt.

Consequatur inventore qui sequi exercitationem necessitatibus necessitatibus
sed iusto. Beatae tempora sit quia. Aliquid sed nulla quia.

Consequatur quia nisi in. Adipisci alias et magnam quia voluptatem ut. Modi
optio et aut iste saepe laboriosam. Rem exercitationem sed similique
laboriosam eum dolor. Et sit autem ea non. Dolorem omnis enim eos cum.
-UU-:----F1  test.md        Top L2       (Markdown Olv Undo-Tree ElDoc Wrap)
:!wc -w %

This is incredibly annoying. I want the text I'm editing to stay in place while I run a command.

I get the same problem with other plugins that modify the margins, such as linum-mode. As far as I can understand, the margins are being adjusted to match the margins of the minibuffer, which is zero. So, to fix this problem, I need to either add a margin to the minibuffer, or disable this behavior. However, I'm not sure how to do either of those thing. Is there a way?


texts: Using a sh-basic-offset value with a multiple of tab-width has side effects when building function using "C-c ("

texts:
When using a multiple of the tab-width value for sh-basic-offset, creating a function using the built-in command C-c ( removes characters from the expected result.  That being said, I can create a shell function by manually typing it.  It is just this built-in command, which causes odd behavior.

When tab-width and/or sh-basic-offset are not set inside the .emacs file or the latter is not a multiple of the former, it works as expected.

Here are the tests I did:
In the below examples I use "asdf" as the function name and the pipe character ("|") is the visualization of where point is located after I completed the built-in command.

With either variables not defined or not a multiple of one another, the (default) result is:

function asdf() {
    |
}

With both set to 4, the result is:

function asdf() {}|

With tab-width set to 4 and sh-basic-offset to 8, the result is:

function asdf()}|

With both set to 8, the result is:

function asdf}|

With both set to 16 (just for a test), the result is (semantically a rather amusing):

fu}|

Is this a bug or do I need to set another variable to a certain value for it to work?  I at least tried the variables stated in this question, but they did not have any effect at all for this issue.


texts: Icomplete and Ido: Why are both in the codebase?

texts:
My question is pretty simple, and that is why Ido and Icomplete are both available in emacs.

I find it very strange that the two modes exist together, seeing that they both do what is essentially the same thing, incremental completion for different minibuffer queries. What I find annoying about the two is that Ido is much cleaner and nice to use, but doesn't add completion for M-x. In order for that to be implemented, you have to download an external package, smex. On the other hand, Icomplete seems like an early version of Ido, but with completion for M-x.

Really, what I'm asking, is why Ido can't replace Icomplete entirely by fully replacing all of Icomplete's features instead of replacing most of them.


texts:
I've noticed that the more frames i have open the slower any one frame becomes.  This is a big problem over an exported X session.

Ive noticed that compiling with some X-toolkits (GTK in particualar) activity in one frame will cause updating of all the other frames contents.  That is the scroll-bars in all frames flicker & occasionally it appears as though all the text in all frames is being re-rendered, there's a very slight flicker.  Eventually the rate buffers can scroll drops to a point where its silly.

So I want to debug what's going on & causing these frames to be redrawn/updated.

With a single buffer frame editing C++ code Emacs is near fluid smooth (4k screen) even with a lot of extensions running, but as I open more frames, the whole editor becomes less responsive, especially if I split some of these frames.


texts: "Symbol's value as variable is void: *" using load-file

texts:
I have this function in my config file and for some reason, I'm getting this error: Symbol's value as variable is void: *.

 (defun reload-config()
   "Reload config.org"
   (interactive)
   (load-file (concat EMACS_DIR CONFIG_FILE)))

I have a similar function that works right.

 (defun find-config ()
   "Edit config.org"
   (interactive)
   (find-file (concat EMACS_DIR CONFIG_FILE)))

Ps: I'm defining EMACS_DIR and CONFIG_FILE as

 (setq EMACS_DIR "~/.emacs.d/")
 (setq CONFIG_FILE "config.org")


texts: emacs lisp error : Need a pre-parsed url

texts:
I'm trying to use tern with the latest version of emacs (27 : master branch) and I'm getting the following error :

  Request failed: ((wrong-type-argument Need a pre-parsed URL.
  [cl-struct-url http nil nil 127.0.0.1 39585 / nil nil nil nil t] url))

Basically : tern is unable to perform any kind of request because of this error.
It seems to come from tern-req function in tern.el, this line :

(url (url-parse-make-urlobj "http" nil nil tern-server port "/" nil nil nil))

But I don't know how to fix it, 'cause I'm not really familiar with lisp development.

I've opened an issue on Github, but since "Tern is not being actively maintained right now.", I'm asking here


texts: Make org mode use helm-find files when inserting local file links

texts: How can I achieve that org mode uses helm-find-files if I insert a link to a local file via C-u C-c C-l?


texts: Org mode export to Latex: #+CAPTION: not working as plantUML inserts \includegraphics

texts:
How to disable plantUML inserting the images automatically?

Code block inside a org file:

#+NAME: fig:1
#+CAPTION: IETF-draft
[[./draft.png]]

#+begin_src plantuml :file draft.png
  Alice -> Bob: Authentication Request
  Bob --> Alice: Authentication Response
#+end_src

export to latex : ->C-c C-e l l

Produces two images:
1. As the result of [[./draft.png]] together with CAPTION, NAME.

\begin{figure}[htb]
\centering
\includegraphics[height=0.6\textheight,keepaspectratio,width=.9\linewidth]{./pbk.png}
\caption{\label{fig:pbk-draft}PBK-framework-IETF-draft}
\end{figure}

2. The following img is inserted by plantUML automatically ( I want to disable this, how to do this ? }

\includegraphics[height=0.6\textheight,keepaspectratio,width=.9\linewidth]{draft.png}

-- Edited following the request from @Emacs User--

Code block inside a org file:

#+NAME: fig:1
#+CAPTION: IETF-draft
#+begin_src plantuml :file draft.png
  Alice -> Bob: Authentication Request
  Bob --> Alice: Authentication Response
#+end_src

export to latex : ->C-c C-e l l

Produces just the second image and I lose the control over the CAPTION, FIG NAME references; the latex code is the following:

\includegraphics[height=0.6\textheight,keepaspectratio,width=.9\linewidth]{draft.png}


texts: Please explain the behaviour of this emacs feature. (Lisp Interaction mode, truncate long lines)

texts:
Sometimes when a function or variable outputs a very long line, it ends with ...). When the cursor is on that line and I press return, the line gets longer (probably expanded). I guess this is some sort of folding.

How is this feature called? How can I disable it? How can I use it? How can I split this line into two lines?

How to reproduce:

start emacs with: emacs -Q
load proced to create that variable for my example: M-x proced
switch to *scratch* buffer
enter proced-grammar-alist and press C-j
then you have that long line with this behaviour.

Edit: changed the title and tags to reflect the topic (after knowing the answer).


texts: How can I force emacs to never split frames, in particular for compile-goto-error?

texts:
I want emacs to always display new buffers in the current frame, but always taking the whole frame, rather than splitting it.

I currently have customized display-buffer-alist to the following

'(display-buffer-alist (quote ((".*" display-buffer-same-window))))

This seems to work in many cases (e.g. it works for C-x C-b) but not for all cases, most notably compile-goto-error, which still splits the frame.

I've looked at documentation and other questions, including the similar How can I block a frame from being split?, but I can't find a correct solution. In particular, that question uses display-buffer-reuse-window, while I'm pretty sure I want display-buffer-same-window, and also I want to have absolutely no exceptions.

Emacs version is 24.5


texts: How can I tell evil which language mode to use for indentation?

texts: evil-indent does not work in ein, it simply collapses all indentations of the selected region. Can I somehow tell Evil that it is dealing with Python code?


texts: Ignore meta key when inputting unicode on OSX

texts:
I'm a newbie running emacs 26.3 (9.0) on OSX in the graphical mode (i.e. not in the terminal) and am writing a document with Devanagari (sanskrit text).
Some of the letters in the inbuilt devanagari keyboard can only be input with a combination of the meta key and another letter. For e.g. META i prints इ
However, emacs interprets the META + <somekey> and claims that it is an invalid command. Is there a way to disable the meta-key feature of emacs, even temporarily, so as to input the characters that I want? If this isn't possible, how can I input characters that require the META key?


texts:
The minibuffer is only displayed on the active window's frame.

For instance, the following creates three frames.  The minibuffer shows on the first frame (the initial frame created and, thus, the active frame).  The two additional frames do not display the minibuffer.  I would expect the minibuffer to appear on all three frames.

emacs -q --eval "(progn (make-frame) (make-frame) (execute-extended-command nil))"

I am aware of packages that display the minibuffer as a separate frame itself, but of no option to display the minibuffer on each frame.

How might I display the minibuffer within each frame?


texts:
I had inserted the following code in .emacs:

(quail-define-package "LaTeX-UTF-8" "TeX" "TeX")

(quail-defrule "α" ["\\alpha"])

what I want to do is the following: when I insert the character "α" (I remapped the keyboard so I can do easily) I would like to see it replaced by \alpha. As it is it doesn't work. However if I replace α by some other string it works. How can I do?


texts: How to define a custom function that runs a command twice?

texts:
In dired mode, 'm trying to make a function that runs  dired-next-line twice and then bind to SPC so that I navigate files faster in dired mode.

I tried to add this in my dired.el file but it didn't work

(defun my-spcnxt-command()
  "Run `dired-next-line' twice."
  (interactive)
  (dired-next-line)
  (dired-next-line))


texts: Function for creating a new line but leaving point in same column

texts: Is there such a function?  It should correspond to pressing return and space enough times to get back to the old column.  I believe this is known as a linefeed?


texts: Stop org-fill-paragraph from joining lines after a list

texts:
I use m-q in org mode to fill paragraphs.

For the below,

- asdf
  asdf

When pressing m-q, it will be joined together,

- asdfasdf

Adding a forced newline can avoid that,

- asdf \\
  asdf

But how to achieve that without adding \\ ?


texts: Possible not to use undo-tree in evil mode?

texts:
Every so often I run into bugs in undo-tree, where I can't redo, with the following known bug, another report & reddit thread.

primitive-undo: Unrecognized entry in undo list undo-tree-canary

This is really bad and can cause loss of work if you didn't happen to save the newest version of the file.

Since I never use the branching undo tree functionality, is it possible to use emacs linear undo with evil mode?

Note: I've tried setting (global-undo-tree-mode -1) directly after (evil-mode 1) which disables undo tree, but redo (Ctrl-R) doesnt work after doing this.


texts: I would like to use global-hl-line-mode, but some of my themes lack a good highlight face. Is there a general way to define one (that's not inverse-color)? I would like to maintain syntax highlighting, which has broken in my attempts.


texts: How to trigger a hydra when entering evil-mode normal state?

texts:
I have the following:
(use-package evil
  :hook
  (after-init . evil-mode)
  (evil-normal-state-entry . hydra-evil/body))

When leaving the emacs state (with C-z) and entering normal state, all my buffers are killed and the *Messages* buffer reads:
walk-window-tree-1: Lisp nesting exceeds ‘max-lisp-eval-depth’

Here is the backtrace if relevant: http://ix.io/2sI9


texts:
I need to create a weekly agenda that has the same outline.  I currently have a Word template file that I use, but would like to convert it to emacs.  I want the emacs "template" to pre-fill the common text and present me with fields for updating the information that changes week to week.

I looked into Forms Mode, but that looks more database oriented.  I read some information about using Skeleton Mode, but I would like to have fillable fields that I could quickly enter throughout the skeleton text.


texts: Don't show "." and ".." in counsel-find-file

texts:
I have a thing where I just don't like editing directories in emacs, and I never want to enter dired mode.  Any time anything might want to put me into dired mode, I would prefer it not do that and instead do something else useful or else do nothing at all (perhaps there could be some obscure keypress to edit the directory).
In particular one thing that annoys me about the otherwise excellent ivy / counsel-find-file is that it always shows "." and ".." as the first two entries in any completion buffer.  If I happen to hit TAB twice (maybe I'm over-zealously completing from the last directory) it will open dired on the local directory.
Ideally I'd like way to tell counsel-find-file it should never open a directory (maybe unless I use immediate-open).
But if not that, I'd at least like a way to tell it to never display the "." and ".." entries.  These take up useful screen space that could be showing actual files I might want to visit.
Or if not that, then at least sort those entries at the bottom of the list instead of the top.
How can I do this?


texts:
I have an odd intermittent problem with Emacs disappearing from view.  I haven't quite figured out the trigger for this.  It doesn't happen often and I can't reproduce it on purpose. Sometimes it happens when losing focus, sometimes while navigating the menu bar, sometimes seemingly random.  I'm hoping someone else has seen this and can shed some light on what is going on.

What I mean by "disappearing" is just that, the frame is no longer drawn and cannot be raised into view.  The task bar still indicates an Emacs instance and I can interact with that to minimize/maximize it.  When the click into the task bar should maximize/raise the frame, the window manager does change to indicate that there is something in the desktop, but nothing is shown.  Occasionally I can see the contents of the Emacs frame flash on screen before disappearing again.  When I click the task bar again to minimize the window manager changes to reflect an empty desktop again.  The only way I've found to fix this is to kill the emacs process and start it back up.

I'm hesitant to blame this on the window manager because I can put other things onto that desktop and interact with them normally.  Even other Emacs frames continue to behave normally.  I've also never observed the behavior with anything but Emacs frames.

I'm running:

Emacs 24.4 (gtk3 toolkit) compiled from source w/ gcc 5.1.0  (.emacs)
Awesome WM 3.4.15
Xorg 7.4 w/ nvidia-drivers 352.21

I run X across three displays at 5760x1080. The Emacs frame that disappears is generally running maximized on the primary display (the center monitor). The WM is set to floating windows on the desktop that the Emacs frame is on so it shouldn't be some odd interaction from the WM tiling.

Does anyone have any ideas what might be causing this?  Has anyone seen this themselves?  One second the Emacs frame is in view, then it is just gone, never to reappear.

Some additional details:

When the window is invisible, wmctrl reports its resolution as 1918x1059 which is full screen (minus window decoration and taskbar).

I have also just discovered the invisible window (Emacs frame) can still be interacted with.  If I load up another emacsclient somewhere else and then unminimize the invisible window, position the mouse so it would have focus and type I see the text on the buffer I have open elsewhere.  Clearly X11 keyboard events are being sent to the window and it is seen as having focus by X.

If the disappearing frame is part an emacsclient GUI frame, I can still connect to the server (started as emacs --daemon) and access all of the buffers and interact with the invisible frame.

As this is likely a bug in emacs, I have filed a bug report and should a solution be found through that channel, I'll post an answer here.


texts: How to make magit use --force-with-lease as default when pushing?

texts:
As per Magit's visual walkthrough, it is possible to save some configs as defaults, e.g: for diffing (section "Changing diff arguments").

I went through the documentation, but did not find anything referencing how to save configs for pushing. All I found was this bit from magit-remote.el library, with which I can figure out how to add more configurations to magit-push-popup:

   (magit-define-popup-switch 'magit-push-popup
   ?X "My flag" "--force-with-lease")

How can I set --force-with-lease as default when pushing?


texts: Why does the example with two echo statements output a table instead of the expected string?

texts:
In the second example of the code snippet I am expecting

foo are you
I am emacs

but get a table instead. What sort of commands or options are required to get the expected output. What is the significance of the colon in the first results line? I suspect it is of some relevance.

#+TITLE: Test Use of :var across multiple lines

#+begin_src sh :var x="foo" :var y=" are you?" :var z="I am Emacs"
echo $x $y
# echo $z
#+end_src

#+RESULTS:
: foo are you?

#+begin_src sh :var x="foo" :var y=" are you?" :var z="I am Emacs"
echo $x $y
echo $z
#+end_src

#+RESULTS:
| foo | are | you?  |
| I   | am  | Emacs |


texts: Aligning (ditaa) rectangles with variable string width in yasnippet

texts:
To quickly add simple diagrams to notes, I've created yasnippets for ditaa boxes. The text inside each box is a $x - and therefore has a length I do not know at snippet design time. As a consequence, the ditaa boxes are not aligned the way they should be to allow ditaa to render a correct diagram.

Like this:

/-------------------------------\
| Text                              |
|                               |
|                               |
\-------------------------------/

(Related: https://stackoverflow.com/questions/41352871/how-to-write-text-inside-a-rectangle-in-emacs-artist-mode)

Possible solutions might be

To go into overwrite mode, just for the input of the $x's inside the boxes.
To use a (non-existent - to the best of my knowledge) (ditaa-)rectangle align macro
To use an elisp function in the snippet that kills one character for each character that is typed.

Below an example of an implementation of option 3:

# -*- mode: snippet overwrite -*-
# name: ditaa2
# key: ditaa2
# --

#+name ${1:unique-name}
#+begin_src ditaa :file diagram.png

  /-------------------------------\        /-------------------------------\
  | c147                          |        | c603                          |
  +-------------------------------+        +-------------------------------+
  | $2 ${2:$(delete-forward-char (string-width yas-text))}                              +------->+ $3                              |
  |                               |        |                               |
  |                               |        |                               |
  \-------------------------------/        \-------------------------------/

#+end_src

${1:$(make-string (string-width yas-text) ?\=)}

This kills one space for character 1, but two spaces for character two, and three for the third character (instead of 1, 1 and 1).

(Note in the example my failed attempt to set an overwrite minor mode and a simple example with ='s at the bottom of the snippet - straight from the yasnippet manual.)

I thought that perhaps everytime yas-text was updated, the mirror receives a new string-width and therefore the subsequent delete was increasingly large. But using (delete-forward-char 1) just kills 1 character and then stops - even after continued editing of $2.

How to remove exactly as much spaces as the input is long?

Or, more broadly, how to align the ditaa rectangle after the string length is known?


texts: Is there a hook for a recursive minibuffer setup?

texts:
I have this code:

(minibuffer-with-setup-hook
    #'ivy--minibuffer-setup
  (read-from-minibuffer
   ;; ...
   ))

It works fine unless the code is called when already in the minibuffer. In that case ivy--minibuffer-setup isn't called.  Is there a way to achieve what I want: while in minibuffer, call read-from-minibuffer and call some code after the recursive minibuffer is entered?


texts: Syntax highlighting and indentation not working at the end of a specific file in python-mode

texts: At the end of one of my files for loops stop being highlighted, aren't automatically indented when I enter them, and TAB won't indent four spaces either. I don't have this issue in any other of my python buffers.  How do I figure out what's wrong, and how do I fix it?


texts: I can I get `+vterm/toggle` to popup from the right side of the screen instead of from the bottom?

texts:
I am using doom emacs, and frequently use the vterm popup/toggle functionality (defined as +vterm/toggle here, which is used, as the name suggests, to toggle a vterm buffer.
The default is to toggle from the bottom of the screen, but I'd like it to toggle from the right side of my screen if possible.


texts:
I'm want to export php code snippets to html in org-mode.  But as you see signs : '$' and '->' are highlighted by black color which looks terrible. Is it a some kind of error?
Btw. is there any themes for highlighting code exported by org-mode?


texts:
I am trying to make an interactive toggle in emacs 27.0.90
When I eval-region no warnings or errors are shown.
However, when I do (helm/toggle-frame) in ielm it throws
Symbol’s function definition is void: helm-in-frame-p
Here is the code,
(let ((helm-in-frame-p t))
  (defun helm/toggle-frame ()
    "Toggle helm in frame or in buffer.
    Default is buffer because it is faster on Xforwarding."
    (interactive)
    (setq helm-in-frame-p (not helm-in-frame-p))
    (if (helm-in-frame-p)
        (progn
          (global-set-key (kbd "M-x") 'helm-M-x-in-frame))
      (progn
        (global-set-key (kbd "M-x") 'helm-M-x)))
    (message "Helm in frame is now %s"
             (if helm-in-frame-p "Enabled" "Disabled"))))

Here is the ielm output
ELISP> helm/toggle-frame
*** Eval error ***  Symbol’s value as variable is void: helm/toggle-frame
ELISP> (helm/toggle-frame)
*** Eval error ***  Symbol’s function definition is void: helm-in-frame-p


texts: Temporarily show the documentation for a emacs lisp function

texts: I want to bind a key which when pressed shows the documentation for an emacs lisp function, but as non-disruptive as possible. I want the contents of describe-function but jumping directly to the docs for the symbol I'm at if there is an exact match and shown in a temporary popup, perhaps at the bottom of the screen, that goes away if any key is pressed.


texts: How to byte-compile a file in the background?

texts:
To cut time on untangling my org setup file, I now only compile on save.
However it is somewhat annoying to have the compile buffer popup on every save.

  ;; Only untangle on a change/save
  (defun my/tangle-dotfiles ()
    "If the current file is this file, the code blocks are tangled"
    (interactive)
    (when (equal (buffer-file-name) (file-truename (expand-file-name "myinit.org" user-emacs-directory)))
      (org-babel-tangle-file (expand-file-name "myinit.org" user-emacs-directory)
                             (expand-file-name "myinit.el" user-emacs-directory)
                             )
      (byte-compile-file (expand-file-name "myinit.el" user-emacs-directory))
      )
    )
  (add-hook 'after-save-hook #'my/tangle-dotfiles)

Is there a way to have this statement:

(byte-compile-file (expand-file-name "myinit.el" user-emacs-directory))

Run in the background instead in a buffer that pops up every time I save?


texts: If I were trying to use a list as a data structure -- and it was getting really big -- is there a precedent of breaking it up and having it span files? One particular list of mine is looking very tree-ish (as Treebeard might say), and it's getting huge. I know I should just think "graph theory" and have branches of the tree in one file "linked" (edged) to others, but I thought I'd ask here for guidance, experiences on list size issues and handling in the real world.


texts: whitespace-style "face" activates highlighting of quoted string in fundamental mode

texts:
After putting face to whitespace-style:
(setq whitespace-style '(trailing tabs empty face))
(global-whitespace-mode 1)

string enclosed in a double quote started to be highlighted by font-lock-string-face in fundamental-mode.
As workaround I disabled global-whitespace-mode and switched to old good v21.1 style:
(setq-default show-trailing-whitespace t)
(set-face-attribute 'trailing-whitespace nil :background "magenta")

Still I like whitespace-mode goodies. It is a bug? How can I debug an issue with double quotation highlighting?
EXTRA When problem is here font-lock-keywords has value:
(t
 ((whitespace-point--flush-used)
  (#1="\\(  +\\)" . #2=(1 whitespace-tab t))
  (whitespace-trailing-regexp . #3=(1 whitespace-trailing t))
  (whitespace-empty-at-bob-regexp . #4=(1 whitespace-empty t))
  (whitespace-empty-at-eob-regexp . #5=(1 whitespace-empty t)))
 (whitespace-point--flush-used
  (0 nil))
 (#1# #2#)
 (whitespace-trailing-regexp #3#)
 (whitespace-empty-at-bob-regexp #4#)
 (whitespace-empty-at-eob-regexp #5#))


texts:
With long files, I like to have two buffers that display the same file but at different positions.  However, since I have two physical displays, I'd like to have two Emacs buffer, each on its own monitor, and then I could open 3, or even 4 copies of the same file!  In theory...

In practice, when I try C-x 5 b or C-x 5 f, instead of opening the file / creating a new buffer with the same content in another frame, the focus goes back into original frame, original buffer...

Any thoughts?

OK, I now realized that I can create a new frame, which will then automatically show the currently selected buffer: M-xnew-frame.  But what about existing frames?


texts: Preventing Org-Mode PDF Tables from Running Off the Page

texts:
Consider the following long org-mode table.

#+TBLNAME: Bitcoin
#+PLOT: title:"Bitcoin Return in 1,2, and 10 Years" ind:1 deps:(3 5 7) type:2d with:histograms set:"yrange [0:]" set:"style fill solid 1.0" exports:both
| Return Interval | $ for EV Calc | Probability in Year 1 | Dist1         | Probability in Year 2 | Dist2         | Probability in Year 10 | Dist3                          |
|-----------------+---------------+-----------------------+---------------+-----------------------+---------------+------------------------+--------------------------------|
| [0x, 0.2x]      |           0.1 |                  0.15 | WWWWWWW!      |                   0.2 | WWWWWWWWWW    |                    0.6 | WWWWWWWWWWWWWWWWWWWWWWWWWWWWWW |
| [0.2x, 0.5x]    |          0.35 |                   0.1 | WWWWW         |                  0.15 | WWWWWWW!      |                   0.05 | WW!                            |
| [0.5x, 1x]      |          0.75 |                  0.15 | WWWWWWW!      |                  0.05 | WW!           |                      0 |                                |
| [1x, 2x]        |           1.5 |                   0.2 | WWWWWWWWWW    |                  0.05 | WW!           |                      0 |                                |
| [2x, 5x]        |           3.5 |                  0.25 | WWWWWWWWWWWW! |                  0.25 | WWWWWWWWWWWW! |                      0 |                                |
| [5x, 10x]       |           7.5 |                   0.1 | WWWWW         |                   0.2 | WWWWWWWWWW    |                      0 |                                |
| [10x, 100x]     |            55 |                  0.05 | WW!           |                   0.1 | WWWWW         |                   0.35 | WWWWWWWWWWWWWWWWW!             |
#+TBLFM: $4='(orgtbl-ascii-draw $3 0.0 1 50)::$6='(orgtbl-ascii-draw $5 0.0 1 50)::$8='(orgtbl-ascii-draw $7 0.0 1 50)

When exported to markdown format this long table shows up just fine and perfectly formatted; however, when I export to PDF I get something very ugly:

The table runs off the width of the page.
The table runs into the second page.

Here's what it looks like:

Question: Is there a way to force this table to at least not run off the width of the page?


texts: How can I jump back after `rope-goto-definition`?

texts:
I am using rope-goto-definition to jump into a module's definition, link. But I cannot jump back to where I was. xref-pop-marker-stack says Marker stack is empty. Is it possible to jump back after running rope-goto-definition? Similiar behavior is done using jedi:goto-definition-pop-marker.

My setup:
(require 'pymacs)
(pymacs-load "ropemacs" "rope-")
(setq ropemacs-enable-autoimport 't)
(setq ropemacs-autoimport-modules '("os" "shutil"))

(defun goto-def-or-jedi ()
  "Go to definition of thing at point or do an rgrep in project if that fails"
  (interactive)
  (condition-case nil (rope-goto-definition)
    (error (rope-goto-definition (thing-at-point 'symbol)))))

Note: On there github its said that: ropemacs is completely unmaintained and abandoned. link. So there is no hope to have support from developers. Maybe before jump, the location can be pushed into the stack?


texts: How to replace the buffer without slowing down the undo system?

texts:
Say I have a command that operates on the entire buffer.

The simple solution is to:

Run the command taking the entire buffer as input.
Store the output.
Clear the current buffer.
Insert the new contents.

The problem with this is it's quite slow and it seems the undo system stores a lot of data for this operation.

In cases where only a few changes are made - is there a way to only apply changes - in a way doesn't require the heavy operation of replacing the entire contents?

Something like creating a diff and applying it, instead of replacing the entire buffer, however it need not use the diff format.

Or do I need to write my own code to detect differences and apply them as edits?


texts: How to allow org-babel to play with python virtual environment?

texts: I have virtual environment set on my system (actually virtualenvwrapper). I would like to direct org babel to use a specific environment in a single code block or on the whole buffer. How can I do it?


texts: How to choose the order of clocktable columns?

texts:
Simply put, I have clocktables such as the following:

 #+BEGIN: clocktable :block today :scope tree2 :maxlevel 15 :properties ("Effort") :compact t
 #+CAPTION: Clock summary at [2018-06-29 Fri 17:53], for Friday, June 29, 2018.
 | Effort | Headline                      |   Time |
 |--------+-------------------------------+--------|
 |        | *Total time*                  | *0:19* |
 |--------+-------------------------------+--------|
 |        | \_  Org                       |   0:19 |
 |        | \_    Fix problems            |   0:19 |
 |   4:00 | \_      Refactor tagged trees |   0:19 |
 |   3:00 | \_        Sample tree         |   0:05 |
 #+END:

What I'd like is for the Effort column to be beside Time so that I can more easily compare the times. How do I achieve this?


texts: org files are not refreshed in emacsclient

texts: My org files are stored on the cloud so I can edit them from multiple machines. Whenever I make a change to an org file (from a different machine), emacsclient does not reflect these changes, but a regular instance of emacs does. I understand that the emacsclient is just an emacs server. How can I get emacsclient to show the changes to my org files?


texts:
I use pywal on Linux which is really cool and works on everything I use except for Firefox (gotta tinker with it) and (GTK) Emacs.
For Emacs the author recommends this which is awesome but requires me to restart Emacs whenever I change my wallpaper (and my global colorscheme).
For terminal Neovim with the wal vim theme it just works, I reload my colorscheme and wallpaper and the terminal AND Neovim change colors, but for Emacs I must restart it for it to use the new .Xresources, which is a PITA since I use Spacemacs.
Now I'd like to know if there's any way at all to make Emacs reload it's .Xresources data on the fly (if there isn't any way then I'll seriously consider switching full-time to Neovim because with some configuration it can be really, really good. One thing I really like about it is the terminal, lightyears better than ansi-term)


texts:
I have such a block

Function    Description
count   Number of non-NA observations
sum     Sum of values
mean    Mean of values
mad     Mean absolute deviation
median  Arithmetic median of values
min     Minimum
max     Maximum
mode    Mode
abs     Absolute Value
prod    Product of values
std     Bessel-corrected sample standard deviation
var     Unbiased variance
sem     Standard error of the mean
skew    Sample skewness (3rd moment)
kurt    Sample kurtosis (4th moment)
quantile    Sample quantile (value at %)
cumsum  Cumulative sum
cumprod     Cumulative product
cummax  Cumulative maximum
cummin  Cumulative minimum

How could convert it to org table?


texts: How to sort an association list (alist)?

texts:
Is there a way to sort an association list? In my case I would like to sort the alist elements by the values in each list element (represented by the integers in the example below).

Example:

(setq my-alist '((red . 2) (blue . 1) (yellow . 8) )) ; make an alist

(sort my-alist '<) ; does not work


texts: Tell ido-find-file not to run py-shell on python-mode

texts:
I have python-mode installed.

When editing any python script, if I have the point over any python statement, I noted that when using ido-mode and using any ido-find function, py-shell runs, opening a new buffer for the python shell, and then ido prompting me for the file to find.

When point is not on any python statement, this behavior doesn't occur.

Is there some kind of conflict between python-mode and ido-mode ? I have been looking if anything gets defined making this strange (and annoying) behavior but couldn't find anything.

How can I tell ido-find commands to stop running py-shell?


texts: How to check for new messages on thread before sending with gnus' message-mode?

texts:
I use gnus for email, including its built-in message-mode for composing/replying to email.  Just before sending mail, I'd like to query my IMAP server to see if there have been any new messages on this thread since I started composing.

It looks like I can do my check in a message-send-hook function, but what API can I use to check for new mail on a thread?  Does gnus provide any interface for this?  I'd like to avoid dropping to IMAP directly since I might not always be using IMAP...


texts:
I recently started using recentf-mode. However, during a package refresh (using auto-package-update) my recentf list gets cluttered with all the package autoloads file:

/home/polesz/.emacs.d/elpa/yasnippet-20170808.940/yasnippet-autoloads.el
/home/polesz/.emacs.d/elpa/async-20170804.2158/async-autoloads.el
/home/polesz/.emacs.d/elpa/dash-20170810.137/dash-autoloads.el
/home/polesz/.emacs.d/elpa/with-editor-20170803.917/with-editor-autoloads.el
/home/polesz/.emacs.d/elpa/web-mode-20170807.903/web-mode-autoloads.el
/home/polesz/.emacs.d/elpa/typescript-mode-20170813.1541/typescript-mode-autoloads.el
/home/polesz/.emacs.d/elpa/markdown-mode-20170812.1201/markdown-mode-autoloads.el
/home/polesz/.emacs.d/elpa/rich-minority-20170813.622/rich-minority-autoloads.el
/home/polesz/.emacs.d/elpa/org-20170814/org-loaddefs.el
/home/polesz/.emacs.d/elpa/org-20170814/org-autoloads.el
/home/polesz/.emacs.d/elpa/secretaria-20170813.1107/secretaria-autoloads.el
/home/polesz/.emacs.d/elpa/helm-core-20170810.2231/helm-core-autoloads.el
/home/polesz/.emacs.d/elpa/helm-20170813.1420/helm-autoloads.el
/home/polesz/.emacs.d/elpa/multiple-cursors-20170813.38/multiple-cursors-autoloads.el
/home/polesz/.emacs.d/elpa/pdf-tools-20170813.731/pdf-tools-autoloads.el
/home/polesz/.emacs.d/elpa/helm-bibtex-20170808.1124/helm-bibtex-autoloads.el
/home/polesz/.emacs.d/elpa/ivy-20170813.351/ivy-autoloads.el
/home/polesz/.emacs.d/elpa/hydra-20170813.1058/hydra-autoloads.el
/home/polesz/.emacs.d/elpa/org-ref-20170808.625/org-ref-autoloads.el
/home/polesz/.emacs.d/elpa/org-category-capture-20170731.2235/org-category-capture-autoloads.el

Is there a way to disable recentf saving while package update is ongoing? If not, is there a way to remove a specific directory (/home/polesz/.emacs.d/elpa in my case) from the recentf list?


texts: Determine if emacs knows the mode for a file

texts:
I'd like to add another system to set the major modes of file visiting buffers. To do so, I need to know if any of the existing major mode setting systems know how to set the mode, and do my thing only when they do not.

How can I tell if Emacs already knows how to set the mode for a given buffer?


texts: Accept and submit minibuffer isearch result with a single keypress

texts:
I like how Bash handles i-search: C-r, type some characters, C-r a couple more times to find the desired command, then hit Return and the command is executed.

If I want to edit the command before it's executed, I type any of C-e, C-a, C-l, <left>, <right>, which exits isearch, leaving the result on the command line.

I love using C-r to search Emacs' minibuffer history, but having to hit Return once to accept the search result and a second time to submit it is annoying. I guess it's partly psychological...

Me (searching): There, that's the one. Enter!
Emacs: um, this one?
Me (eyeroll): Yes, that one. Enter.

I want to fix this. Return is bound to isearch-exit in overriding-terminal-local-map. This appears to be the case both inside and outside the minibuffer. It also seems that the aforementioned map is not defined until you've entered isearch.

My current solution:

(defun ivan/isearch-exit ()
  (interactive)
  (isearch-exit)
  (if (minibuffer-window-active-p (selected-window))
      (minibuffer-complete-and-exit)))

(defun ivan/remap-isearch-exit ()
  (define-key
    overriding-terminal-local-map
    [remap isearch-exit]
    #'ivan/isearch-exit))

(add-hook 'isearch-mode-hook #'ivan/remap-isearch-exit)

So far, this seems to work, but is there a cleaner approach?


texts:
There is a disassembler for functions, but is there something that will disassemble a bytecode file?

Thoughts on how to accomplish?


texts: Auctex align-current does not properly align table in Aquamacs - what's wrong?

texts:
I'm working with very large tables (14 columns for example) and it's really difficult to find the right cell to edit.

I discovered the align-current command and tried to use it on my table, but the result is still not very helpful: In Aquamacs, it looks like that:

the red signs are the "&" characters, which separate the table columns. Ideally they should be placed on straight vertical lines, but you can see that they don't in my case

However, if I copy the text into another text editor, it looks properly aligned:

I wonder if it is a problem with the font used in emacs, describe-font in my .tex buffer gives

name (opened by): -apple-Monaco-medium-normal-normal--12----m-0-iso10646-1
       full name: Monaco
            size: 12
          height: 17
 baseline-offset:  0
relative-compose:  0

I thought that Monaco is a monospaced font, so that should not be the problem, or could it?


texts: I have some log files which contain ANSI colors, but ansi-color-for-comint-mode-on doesn't work, to get emacs to properly display the colors, and still shows the control codes. Is there another way to either show the colors, or at the very least remove the control codes for the colors.


texts: Freeing cons cells after use in emacs-lisp?

texts:
Is there a way in emacs-lisp to return cells to the free list once I do not use them any more? This would be useful in code where I build huge lists temporarily and can free them without waiting for garbage collector to do it.

This exists in other lisps but C-h a free did not return anything, and the Manual page about garbage collection does not mention anything like a free-cell function either.


texts: How to build and install R package in ESS?

texts:
Some time ago I've written function to build R package using "CMD INSTALL" the problem is that I can't do the same with ESS. There is function ess-r-devtools-build but it seems that it don't actually install the package I'm working on it just build tar.gz file.
How can I build and install R package I'm developing in Emacs ESS?


texts: How to get xemacs-like Buffers menu entry in emacs?

texts:
xemacs has a nicely organized Buffers entry in its built-in menu. As you can see from the snapshot, it's sorted alphabetically and grouped by modes:

I can't find how to make emacs do the same. menu-bar.el provides a very rudimentary recent 10 entries listing. I looked at menu-bar-update-buffers and I don't see how I could adjust things on the user-side, short of rewriting that function. Unfortunately I don't know lisp.

Do you know of anybody implementing an alternative version?

I'm aware of C-left-mouse-click mouse-buffer-menu - which is much better (does grouping and sorting), but requires more steps to get to the right buffer when grouped. And when forced to not group (via large setting for mouse-buffer-menu-mode-mult), it throws them all into one pile.

I'm aware of ibuffer and its extensions (and set it to C-x C-b), which is even better and more customizable - but I can't see how I could inject its listing into the menu bar. Other than going through Buffers -> *IBuffer*. Is there way to replace that entry, so that the Buffers menu entry will take me directly to IBuffer listing?


texts: How to count characters in buffer including spaces?

texts:
I need to see, how many characters contains my text, as I type. I found this pages of Emacs Wiki: Word count, and there is a solution very close to what I need: I used the second solution from this page (Show the number of words in the mode-line), because it shows the amount of characters too.

But it doesn't count spaces. Is there any solution, that will show amount of characters including spaces in mode-line? Ideally, with setting target amount of characters (but this is not necessary).


texts:
I recently installed meghanada-mode from melpa to help with some Java I am writing.  Mostly I like it.  However, it has started showing the following messages (in my *Messages* buffer):
Error:jetbrains.exodus.ExodusException: . Please check *meghanada-server-log*
WARN not match type

However, I cannot find a buffer by that name, nor a file (using the find command).
Moreover, if I compile my project (with Maven) it gives no errors and runs, but I assume something is not completely correct and would like to fix it.  However, I don't know where to look.


texts:
I'm using org mode beamer export.

I have an itemized list

I want an item to start with the text "<7ms"

It seems to be almost impossible to quote the "<" character so that the org parser doesn't think it's an overlay, and pass it into LaTeX, which then chokes on it.

I believe writing "\item{} <7ms" would work, but I can't seem to find any way to write this in org so that I get that result in the LaTeX

For now the only workaround is write $7ms$, but that isn't really the effect I wanted.  And I have no idea why writing $7$ms doesn't work either.


texts: Org-mode overline emphasis not able to be followed by other characters

texts:
I use a lot of overline (in statistical formulae) and so I have the following in my .emacs:
(custom-set-variables
  '(org-emphasis-alist
     (quote (("*" bold)
             ("/" italic)
             ("_" underline)
             ("=" org-verbatim verbatim)
             ("+" (:strike-through t))
             ("~" (:overline t) verbatim))))
     '(org-hide-emphasis-markers t)
     '(org-pretty-entities t))

In other words, I want ~ to define overline and I want it to render in-line in Emacs.
This works great, however I cannot follow that emphasis (or any emphasis for that matter) with more characters such as superscript or subscript numbers. For example, ~X~_1 renders as literally ~X~ followed by a subscript 1. The X is overlined until I type the underscore, then the emphasis tildes reappear.
I assume the solution has something to do with modifying org-emphasis-regexp-components and maybe use of a zero-width space between the emphasis and the subscript, but there I get lost.
Also I would love my PDF exports to render the same (at the moment, since I am using the ~ for overline, my overlined segments get rendered as code) so for a part 2, if we can update the PDF export to render overlines properly too, that would be amazing.


texts: What is the meaning of the ellipsis at the end of some output?

texts:
When I do a C-j ie eval-print-last-sexp on an expression such as (copy-tree package-activated-list)

the output as an ellipsis at the end as shown below

(ac-ispell auto-complete popup ace-jump-helm-line helm helm-core async popup async avy ace-link avy ...)

What is the meaning of the ellipsis?


texts: "bookmark" a lisp code block and launch through emacs bookmarking system

texts:
I googled for this with no success. im looking to "bookmark" a lisp code block so that it appears in the emacs/bookmark+ bookmark lists. for example i want to launch this lisp code when i launch a bookmark "xxz"

(defun xxz ()
 "jump"
  (interactive)
  (bmkp-dired-jump "h.nyc" )
  (org-narrow-to-subtree)
   )

anyone know if this is possible at all?


texts: GUD debugger says: Undefined command: "-interpreter-exec"

texts:
I am following the tutorial Open GDB (within Emacs for added functionality) on Emacs 25.2.1 with Evil Spacemacs and Ivy
(the commands gud-gdb and gdb get the same results):

SPC f f (counsel-find-file) Find file: tutorial/foo.c
SPC c C (compile) Compile command: gcc -g -o foo foo.c
SPC SPC M-x gud-gdb foo (match required)
SPC SPC M-x gud-gdb
Run gud-gdb (like this): gud-gdb foo

Here are the screen shots:

What does "like this" mean?

It opens GUD interaction buffer *gud-avg*.
avg is the name of a previous program I was trying to debug.

Update: the GUD interaction buffer now opens to *gud-foo*.

Here are the screen shot:

Any how, the GUD interaction buffer did open, but it's broken:

(gdb) list
Undefined command: "-interpreter-exec".  Try "help".
(gdb) help
Undefined command: "-interpreter-exec".  Try "help".


texts: How to stop Emacs from using LaTeX mode key bindings for `*.tex` files?

texts:
It seems that Emacs tries to autodetect the type of file and changes some of its behaviors accordingly. I don't want any of this behavior. I just want Emacs to treat every file as if it were some generic text file. The thing that is currently annoying me is that when Emacs thinks I'm editing a LaTeX file, it won't let me type the " character without changing it to tex-style quotes. Is there a line I can put in my .emacs file to simply turn off all of this kind of stuff completely?
From googling, it looks like this is called an "input method," but the only lisp code I can find doesn't seem like it would do what I want. For example, there is a function called set-input-mode, but it doesn't seem to allow control over this. There are also things like toggle-input-method and (setq-default default-input-method ..., but those don't seem like what I'm looking for either.


texts: Org-mode: how to prevent line from being included in section?

texts:
I have an org-file, which I've wrapped in a div for html export. This div is necessary because it is targeted by some custom css.

#+html: <div id="wrapper-div">

* Section One
* Section Two
* Etc.

#+html: </div>

The problem is that the </div> always gets folded into the last section. This wouldn't be a huge deal, but it's annoying when I add a new section to the end because this misplaces the </div> tag (being folded into the previous section).

Can I somehow mark the line, #+html: </div>, as non-collapsible?


texts: $\mathscr{..}$ Expressions Fail to Render Properly in Org-Mode

texts:
Consider the expression \mathscr{APPLE}. This should render as follows:

Yet in org-mode (using latex fragment previews), it renders as:

Moreover, when exporting, matscr renders properly in HTML (when viewed in a browser), but does not render properly when exporting to pdf! How does one fix this behavior?

EDIT: Certain unicode characters also fail to render properly. For example $\phi$ renders fine but $ϕ$ does not render fine. I hope these errors are related so that fixing one fixes the other.

EDIT2: I get the following error message when using the settings suggested by Omar: link.

EDIT3: The more specific error I'm getting (after checking *Org Preview LaTeX Output* buffer is:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Fatal fontspec error: "cannot-use-pdftex"
!
! The fontspec package requires either XeTeX or LuaTeX.
!
! You must change your typesetting engine to, e.g., "xelatex" or
! "lualatex"instead of plain "latex" or "pdflatex".
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................


texts:
I use ediff to merge mercurial conflicts (and sometimes git conflicts), but I can't seem to abort.  Ediff pops up as soon as a conflict is detected, and quitting and not saving results in mercurial accepting the existing version and drops the commit, saying the destination already has the changes.

I can't seem to suspend and abort the commit because the rebase/merge already has a lock.

What is the workflow for safely aborting a merge, restoring the previous state as though a merge/rebase was never attempted.  To be clear, I'm not sure if this is a mercurial/git question or an ediff question.


texts: Long pause after typing `std::` when using semantic with auto-complete

texts:
I am using auto-complete-mode with ac-c-headers and whenever I type std:: There is a long (~30 seconds) pause, presumably while the candidates list is populated.  This happens every time, which suggests that there is no caching to speed things up for the next time.

Is there a way to avoid the pause after every time I type std::?

Update

Using the emacs profiler, I have now discovered that the pretty much all of the time is being spent in the functions semantic-analyze-possible-completions and semantic-analyze-current-context. This suggests that the real problem probably lies with semantic.  I have also learned that including anything from the Boost libraries causes a significant increase in the amount of time required for semantic to return possible completions.

(In case it makes a difference, I am using Emacs 24.5 on Linux)


texts: Different themes for text buffers vs ansi-term?

texts: I'd like to be able to use different color themes when I'm editing text versus when I'm using a terminal such as ansi-term. (Note: I'm not referring to different color schemes for GUI mode versus terminal mode). Is this possible? In general, is it possible to switch the color scheme on a per-buffer basis rather than global?


texts: How to delete the contents of a buffer by name

texts: For example in gdb mode, there is a buffer named *input/output of <program name>*, that I want to clear each time I press C-c l.


texts:
I have a shared init.el emacs configuration for windows and linux (vm as well as mainOS).
The VM is used for work. There we use svn and git repos. On Windows projectile works just fine with svn. I use shared folders so that the files themself used for that projectile example are the same.
[tietan@localhost sharedFolder]$ which svn
/usr/bin/svn

exec-path includes that location:
exec-path is a variable defined in ‘C source code’.
Its value is
("/usr/local/bin" "/usr/local/sbin" "/usr/bin" "/usr/sbin" "/usr/libexec/emacs/27.1/x86_64-redhat-linux-gnu" "/home/tietan/.local/bin")

C-c p p on linux (fedora32) shows /bin/bash: svn: command not found
C-c p p on windows 10 shows:
2374 [Source] Load buffer or file:
...fileList...

svn also works on the linux vm
[christian@localhost sharedFolder]$ svn info
Path: .
Working Copy Root Path: /mnt/hgfs/wprojects/repos/sharedFolder
URL: [blanked]
Relative URL: [blanked]
Repository Root: [blanked]
Repository UUID: [blanked]
Revision: [blanked]
Node Kind: [blanked]
Schedule: [blanked]
Last Changed Author: [blanked]
Last Changed Rev: [blanked]
Last Changed Date: [blanked]

My setup for projectile looks like this:
;; https://github.com/bbatsov/projectile
;; https://projectile.mx/
;; https://docs.projectile.mx/projectile/index.html
;; TODO: svn projects not working on linux os VM
(use-package projectile
  :config
  (projectile-global-mode)
  (projectile-mode +1)
  (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
  (setq projectile-project-search-path '("~/projects/"))
  (setq projectile-require-project-root t)
  (setq projectile-switch-project-action #'projectile-dired)
  (setq projectile-completion-system 'ivy)
  (setq projectile-enable-caching t))

Has anyone a hint how to fix that or what's the actual problem.


texts: How to access the declare specifications of a function

texts:
How does one access the declare specification of a function?

Edit: After the answer of npostavs I have to correct myself.

As long as a function is not byte-compiled the declare forms are still in its symbol-function. Where do they go after byte-compilation?

Example: (content of scratch buffer with lisp code and evaluation results)

(defun test (&rest args)
  "Function with declare form."
  (declare (indent 1))
  (interactive)
  (message args))
;; repl: test

(symbol-function 'test)
;; repl: (lambda (&rest args) "Function with declare form." (interactive) (message args))

(symbol-plist 'test)
;; repl: (lisp-indent-function 1)

That means the declare forms are not contained in the function cell of the symbol after the defun.

(defun test (&rest args)
  "Function with declare form."
  (interactive)
  (declare (indent 1))
  (message args))

(symbol-function 'test)
(lambda (&rest args) "Function with declare form." (interactive) (declare (indent 1)) (message args))

(setf f (byte-compile 'test))
#[(&rest args) "\301!\207" [args message] 2 "Function with declare form." nil]

What is the right way to access the declare information of a function in elisp?


texts: How to increase the number of recent file listings in helm-mini?

texts: Is there a way to configure the number of recent files that will be in the Recentf section of a helm-mini buffer?


texts: Easiest way to downgrade a package installed via MELPA

texts:
Sometimes, package updates from MELPA can break some part of emacs and when that happens I'd like to be able to revert back to using an older version of the package.

Right now, I can do it in two ways:

I've set emacs to delete files by moving to trash and when I update a package, the older version is trashed. I can retrieve the older version and replace the one in ~/.emacs.d/elpa.
Go to the github repo of the package that broke functionality, fetch an older version of the package, replace the one in ~/.emacs.d/elpa with the one from gitub, byte-recompile the file(s).

Both these ways involve a lot of manual work moving things around. Is there an easier(preferably automatic) way to downgrade packages installed from MELPA?


texts: Scheduling an item on different days org-mode

texts:
Is it possible to place a list-item scheduled for different days? The item should then be displayed when I hit C-c a a for agenda-view. I don΄t mean a date that is repeated on a regular basis, or a range, which both are described in the manual under Timestamps, deadlines, and scheduling, but dates that are scheduled in a random way.

What I did was place three SCHEDULED below the date:

* TODO Get schwifty
SCHEDULED: <2018-08-04 Sa>
SCHEDULED: <2018-08-06 Mo>
SCHEDULED: <2018-08-09 Th>

This makes them available agenda-view, but the second and third entry look a bit odd as they lack the SCHEDULED. Are there any drawbacks to what I did or is there a more elegant way to achieve this?


texts: In egrep, how to click a matched line and let it show the matched line in another buffer without moving the cursor

texts:
In notepad++, I could search a folder, and then click the match line to display the matched line of the corresponding buffer. How to do this in emacs?

What I can do now is to press "ENTER" on the matched line. But that moves the cursor to the other window with the matched data. But I don't want to move the cursor. Is this doable? Or anyway to click the matched line?


texts: Add (copy) to kill ring current branch name with Magit

texts:
Is there a way to easily copy the current branch name in Magit via M-x?
At the moment I open the status pop up magit-status and copy the name from there.

Best & thanks for your help!


texts:
I configured org-capture with below elisp in init.el:

(define-key global-map "\C-cc" 'org-capture)
(setq my-org-capture-file (concat org-directory "/capture.org"))
(setq my/line "%(with-current-buffer (org-capture-get :original-file-nondirectory) (thing-at-point 'line t))")
(setq org-capture-templates
      `(
        ("n" "Review Notes"
         entry (file+headline ,my-org-capture-file "Code Review")
         ,(format "* TODO %%?\n %%l\n  %s" my/line))
      ))

Then when I review code to take notes with 'n', I got below results:

** TODO
 [[file:/tmp/linux-4.14-rc8/drivers/video/fbdev/geode/video_cs5530.c::static%20int%20cs5530_blank_display(struct%20fb_info%20*info,%20int%20blank_mode)]]
  static int cs5530_blank_display(struct fb_info *info, int blank_mode)

It works perfect but the link description is too long. I wish to display the file name without path and line info, e.g. video_cs5530.c for this case.

I try to use %a to replace %l, results is the same.


texts: Evil mode - How to go into Insert mode after Org-capture with %? cursor placement

texts:
After creating an org-capture with the %? to place the cursor, the cursor will be in command mode. Is there a variable for putting it into insert mode or does org-capture elisp code need to be directly editted?

(setq org-capture-templates
      '(("e" "Example" entry (file+headline "~/org/notes.org" "Example")
         "* TODO  %?\n  %u\n")))


texts: How can I display inline org images using external programs for the TUI?

texts:
I like to display the inline images either using programs that produce colored text (like https://github.com/hpjansson/chafa), or use ANSI escape codes like https://sw.kovidgoyal.net/kitty/graphics-protocol.html to display them directly via the terminal emulator. But I have no idea where I should hook into ...
Related:

https://stackoverflow.com/questions/54759330/displaying-images-in-an-emacs-process-running-within-iterm2
https://stackoverflow.com/questions/15407485/inline-pdf-images-in-org-mode


texts: Tab completion in minibuffer moves cursor out of minibuffer

texts:
Problem: When pressing TAB in the minibuffer to get completions, the cursor is moved to the window of whatever file I am editing.

Expected result: Pressing TAB in the minibuffer should keep the cursor in the minibuffer (or move it to the Completions window).

Actual result: Pressing TAB in the minibuffer moves the cursor to the window of the file I'm editing, requiring me to move it back to the minibuffer to continue working. This only happens when a Completions window is opened.

How can I keep the cursor in the minibuffer after tab completion?


texts:
Windows 10 (64 bit), Emacs 25.1

I want when I save any file to save them (by default) with coding system = UTF-8.

So In my init.el I has :

(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-language-environment 'utf-8)
(set-selection-coding-system 'utf-8)

But it not help. When I try to save file (C-x C-s) Emacs prompt me: "Select coding system"