texts: Use two different Fortran standards in flycheck

texts:
I work a lot with Fortran, both with newer standards like f90/f95 (f90-mode in emacs) as well as the f77 standard (fortran-mode in emacs). I want to enable flycheck so it works with both standards (depending on mode), instead of just one. By default, flycheck only works on the newer f90/f95 standard.
According to their documentation, one can modify the flycheck-gfortran-language-standard variable to control the fortran standard in use, but so far I've only been able to make it work with one at a time. I tried the following solution:
(add-hook 'f90-mode-hook
  (lambda ()
    (make-local-variable 'flycheck-gfortran-language-standard)
    (setq flycheck-gfortran-language-standard "f95")))

(add-hook 'fortran-mode-hook
      (lambda ()
        (make-local-variable 'flycheck-gfortran-language-standard)
        (setq flycheck-gfortran-language-standard "legacy")))

but it didn't seem to have any effect. Basically, what I was hoping would happen is that the variable flycheck-gfortran-language-standard would be modified according to the major mode that I was in. That is, it would have the value "f95" in f90-mode and the value "legacy" in fortran-mode.
Any suggestions?


texts: typesetting matrix output from maxima using org-mode

texts:
How can I make org-mode typeset matrices output from maxima?

For example, the following code produces tex output that display

#+BEGIN_SRC maxima :results raw
m: matrix([1, 2], [3, 4]);
tex(m);
#+END_SRC

It produces the result:

#+RESULTS:
$$\pmatrix{1&2\cr 3&4\cr }$$

This does not display anything. Is there an easy way to make this code valid so that it will display?

Apparently I had mostly the same question 2 years ago (but with a more complicated example). Unfortunately, I didn't get a reproducible answer at the time:

Getting maxima source block to return and display latex equations


texts: magit-checkout does not update current buffer

texts:
When I checkout an existing remote branch, the current buffer remains on the old branch.
However if I open a new file, that new file is on the checked-out branch.

My current workflow is this:

editing file a.txt
magit-checkout feature (a.txt exists on feature)
close a.txt
open a.txt

And the workflow I want to get is this:

editing file a.txt
magit-checkout feature (a.txt exists on feature)
a.txt is now the version from feature

Is there a way to make the current buffer file be checked out on the new branch?

p.s. I'm using Spacemacs, don't know if that matters here.


texts: I use Emacs in command-line always on my Ubuntu 14.04 machine. And I use two languages frequently. Bengali/Bangla and English. Problem is when I use Bangla, commands with Ctrl as modifier work fine (e.g. C-x C-s) but with Meta they are not. e.g. M-x is not opening the minibuffer instead Emacs understands it as M-ূ. Is there any way to use Meta like Ctrl?


texts: How to fold nested list items in markdown-mode

texts:
I would like to be able to fold nested list items in markdown-mode in the same way that it is possible to do in org-mode, so that, for example, the first sub-item in the following list can be easily hidden.

List item 1

List item 1.1

List item 2

The result would look something like the following.

List item 1 ...
List item 2

And ideally I would like to be able to use the mouse to fold and unfold the relevant blocks of text, and to have a marker displayed in the left margin to indicate that a block can be, or has been, folded.
From what I've read, it looks like the most promising option may be to use hs-minor-mode, which allows the use of the mouse to fold and unfold blocks, along with hideshowvis, which displays indicators in the margin for the blocks that can be folded, or have been folded, by hs-minor-mode. I've tried out a few other ways of doing the folding that work ok---in particular, selective display, origami, and yafolding---but, as far as I could see, none of them allowed for the use of the mouse to fold and unfold blocks.
I tried to set this up using hs-minor-mode but couldn't get it to work. I think I needed to define a 'forward-sexp' function, or something, but this is beyond my current capabilities.
Has anyone set up markdown-mode to fold nested list items like this? Does anyone have any advice on how I could get it working?


texts: Org async export show pdf after completion

texts:
With synchronous export I can call C-c C-e l o to generate a pdf and open it. If I try the same keys with the async export, i.e. C-c C-e C-a l o, then the pdf will be generated but the pdf won't open.

How can I fix this behaviour?


texts: org mode to latex: weird export of "1.00E-10"

texts:
I am writing a report in org-mode, and I have some tables with elements of the form "1.00E-10". When I export the document, these elements are converted in the Latex file as:

  1.00\,(-10)

How to prevent this behaviour ? I was not able to find any documentation on this.

Thanks !


texts: Don't focus on evince, when compiling pdf from org-mode

texts:
I'm using Evince as my Pdf-Viewer (In a split-screen-setup) whenever i write something in org-mode and compile it as a pdf. To achieve this, i've added

(add-to-list 'org-file-apps '("pdf" . "evince %s"))

to my .emacs and it simply works. However, when i compile and open as a pdf from org-mode, Emacs loses focus onto Evince.

The desired behavior would be for Emacs to obtain focus and run Evince in the background so that i wouldn't have to switch back to Emacs, whenever i compile as a pdf


texts: Windows: Open files by default application

texts:
Windows 10, Emacs 25.1, Dired+

In my folder "test" I have different file:

So I want when press Enter on file 97_things_for_programmer.pdf to open this pdf file by my default application - Adobe Reader.

When press Enter on file my_photo.jpg to open this jpg file by my default application - XnView.
And so on.
But the text file to open by Emacs (as usual).


texts: How to debug errors in sentinels and during font-lock

texts:
When an error occurs inside a process sentinel or during font-locking, then Emacs doesn't show a backtrace even though debug-on-error was previously enabled.

I understand why these errors are caught, the same error might be triggered again while trying to present the backtrace. However when I want to actually debug that error it is not very helpful. I would rather risk Emacs becoming unresponsive than having to work from this:

error in process sentinel: Wrong type argument: stringp, nil

After all I can just start a second instance, if the first starts going crazy. A little more context would help when there are many places where such an error could theoretically occur in a sentinel.

So how can I force Emacs to show a backtrace even in cases where debug-on-error has no effect?


texts: hide-show display multiple lines while collapsed

texts:
Is it possible to have hide-show folding display multiple lines (probably 3) in the folded version? This would get us practically to having a codox-like view right inside a buffer.
What I'm trying to accomplish is using clojure-mode to display the function signature and docstring. AFAICT, hs-toggle-hiding (and hs-hide-* etc) always collapse to a single line. If hide-show isn't capable of this, do you know of another tool that could do the job?
Presently, a multi-line fn loses some key parts.
Today
(defn foo
  "Does something really fancy, and there are. Maybe. Multiple. Sentences/lines. Here."
  [x y]
  (some code ,,,))

becomes:
(defn foo...)

which is informationally kinda useless.
Goal
Instead, folds to:
(defn foo
  "Does something really fancy, and there are. Maybe. Multiple. Sentences/lines. Here."
  [x y] ...)

or maybe optimally:
(defn foo
  "Does something really fancy, and there are..."
  [x y] ...)

Attempts
I've tried setting things like this, but I still don't see that hide-show support multi-line display:
(setq hs-special-modes-alist '((clojure-mode "(defn [-a-z]+ \"[^\"]+\"" ")" ";; " nil nil)))

(A workaround is to use set-selective-display with an argument of 3, but that only operates at a whole-buffer level, and shows other unwanted things.)


texts:
I have a lot of occurances of something =like_this= and I need to replace the both equals signs with this character: `

After looking at this question I thought the following would do it:

M-x query-replace-regex =\(.*\)?= RET `\1`

That doesn't seem to do it, though. Any suggestions?


texts:
I extensively use links to refer to different org files/ headings. All my links are created using IDs.
But it might happen that in the course of work, some links might get broken --- the reference is deleted. It also might happen that an ID was created for the heading but the linking never happened.
org-lint can identify broken links. But in my case, it identified some working links also as broken links. Secondly, it works only on the current buffer.
Is it possible to generate a list of all the broken links and list of all the unused IDs across all files in directory (including sub-directories)?


texts: How to use dired to open a folder as root

texts:
I want to batch editing some files as root in dired, however, when I open dired with /sudo::/my/path/to/dir, dired window does not list anything.

What is the correct way to do this ?


texts:
Q: is there a general way to detect whether or not point is inside a matched pair of characters?

That is: is there a general predicate function (or something) that can determine if point is in-between a matched pair or some arbitrarily-chosen characters?  I'm thinking about one that would evaluate to t in, say, the following scenarios, with ! referring to point:

"!"   (quotes in general)
``!'' (LaTeX quotes)
$!$   (LaTeX math)
(!)   (lisp parens)
*!*   (org emphasis)

Edit: syntax-ppss seems to be a good starting point, but it's not clear to me how one would adapt it to multi-character matched pairs (eg, the ``LaTeX quotes'', or even matched <b>html tags</b>).  I'm wondering if there's a general solution, or if it would require a purpose-built parser.


texts: org capture at point as sibling of heading

texts:
org 9.2 used to support this feature. when (org-capture 0), it used to place the selected template entry as a sibling of heading at point. in org 9.3 however, it fully respects the heading level defined in the template.
How can I automatically shift the level of the template heading to match the heading at point?


texts: How to embed external file contents in org file?

texts:
I'm creating a simple bash tool that uses various flags/arguments from the user, and I'm using an org file for the documentation. I have several examples and I'd like to include some explanation of each. Instead of copying the code from each example into the file, I'd like to create a link to the file and display the contents in the org file. Something like

This example does such and such...
[[/path/to/ex-file-1.sh]]

my-tool -f "user-input" # these are the contents of ex-file-1.sh

While this example does this and that...
[[/path/to/ex-file-2/sh]]

my-tool -r "user-input # these are the contents of ex-file-2.sh

This way, I don't have to modify the README.org if I modify the individual example files. I'd also like to do the same thing with the contents of the tool's help (which is activated with the -h flag). Basically I want modifying the documentation to be less tedious.

I know that images can be embedded into org files (and are even visible within the file before exporting), so I would assume the same is possible with text? What do I need to use for this? Or I am I just being too lazy with my documentation?


texts:
I am improving the C++ highlighting in Emacs with the minor mode: modern-cpp-font-lock.

Consider this following C++14 code:

int main() { int i = 1'2'3l; }

From cppreference.com

  Optional single quotes(') may be inserted between the digits as a
  separator. They are ignored by the compiler.

In modern-cpp-font-lock, I set 1'2'3 to font-lock-constant-face and I set the integer suffix l to font-lock-keyword-face.

In fundamental-mode and modern-c++-font-lock-mode activated, I see the expected result. However, with c++-mode and modern-c++-font-lock-mode activated, '2' is highlighted as a string (l is correctly font locked).

I know the highlighting rely on the principle "first come first served" - meaning rules will not apply on words already highlighted.

Do you know if it is possible to override font-lock of a major mode? Or is it possible to change the order of rules to apply the font-lock (for example, longer rules first)?


texts: How to make implicit link target from timestamp in org-mode?

texts:
In org-mode I usually create several notes with timestamps under a headline, for example:

* idea
  [2018-09-26 Wed 09:39] \\
  General description of idea.

** idea development
   [2018-09-26 Wed 09:40] \\
   First step description.

   [2018-09-26 Wed 09:41] \\
   Second step description.

   [2018-09-26 Wed 09:42] \\
   Final notes on idea development.

I would like to reference some steps inder ** idea development in other org-files. Of course it is possible to create headers for every step or to make a dedicated target, but this would make my notes unreadable. Therefore I'd like to have an implicit targets from timestamps and reference them as [[2018-09-26 Wed 09:42][final note]], but this link does not work. How to make it work?

There is another complication in my case, I set custom date display for time stamps in ~/.emacs

(setq org-display-custom-times t)
(setq org-time-stamp-custom-formats
  (quote ("<%d.%m.%Y %a>" . "<%d.%m.%Y %a %H:%M>")))


texts: Open file in existing GUI Emacs from shell

texts:
I would like to set the shell EDITOR to use the existing running instance of GUI Emacs.

On macOS I can type open -a Emacs file to edit file that way. But how would EDITOR look to work that way?

What does not work:

export EDITOR="emacs" # launches new gui emacs
export EDITOR="emacsclient" # launches terminal emacs in current shell
export EDITOR="open -a Emacs" # quits editing right away


texts: Is there any way to add a line or vertical sparation before the next date in org-agenda-view

texts:
I would like to add a line to separate the current block of tasks from the next date, so the last task of the date is not just above the next date.

I know I can use :box with set-face-attribute 'org-agenda-date for , but is a solution that it has some inconveniences. So I would like to add a line if possible or a separation between those blocks.


texts:
I've recently moved to a new computer and cannot get org babel to work with Python (it worked fine on my old machine). I'm using OS X 10.12.6 with Emacs for Mac OS X based on Emacs 25.3 with org-mode-9.1.12 and Anaconda3 as my Python distribution.

The problem is that whenever I try and evaluate a code block I get the message

  Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support
  readline, yet ‘python-shell-completion-native-enable’ was t and "python"
  is not part of the ‘python-shell-completion-native-disabled-interpreters’
  list.  Native completions have been disabled locally."

In my init.el file I load exec-path-from-shell (because I'm using a Mac and not calling Emacs from the command line). My shell (bash) has the path to my Python distribution, anaconda3, which is in my home directory (because of new computer security rules at my place of work prevents a system wide installation). Python works fine from the command line (the commands python and python3 are symbolic links to the python executable) and from Jupyter notebooks, but not from within an emacs org file. My Python distribution has the readline module and it loads fine from the terminal.

I set up org-babel using

(org-babel-do-load-languages
  'org-babel-load-languages
    '((python . t)
      (matlab . t)))

This used to all work on my older system (before the new security rules, which might be a red-herring). My guess is that somehow org is picking up the wrong python but I can't figure out how or why.

Any thoughts on this would be greatly appreciated.


texts: Help with auto-complete in Windows/MinGW64

texts:
I‘ve download the “LLVM source code (.sig)” and “Clang source code (.sig)” and build Clang on Windows/MinGW. After that, I’ve install emacs (25.1) and the following three packages from melpa:

irony
company
company-irony

My init.el file configuration is the next (nothing else):

(require 'package)

(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))

(package-initialize)

(add-hook 'after-init-hook 'global-company-mode)

(eval-after-load 'company
  '(add-to-list 'company-backends 'company-irony))

(add-hook 'c++-mode-hook 'irony-mode)

(add-hook 'c-mode-hook 'irony-mode)

(defun my-irony-mode-hook ()
  (define-key irony-mode-map [remap completion-at-point]
    'irony-completion-at-point-async)

(define-key irony-mode-map [remap complete-symbol]
    'irony-completion-at-point-async))

(add-hook 'irony-mode-hook 'my-irony-mode-hook)

(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)

(when (boundp 'w32-pipe-read-delay)
  (setq w32-pipe-read-delay 0))

(when (boundp 'w32-pipe-buffer-size)
  (setq irony-server-w32-pipe-buffer-size (* 64 1024)))

After that, I proceed to compile the Irony-server, with these steps:

cd to Irony’s package site.

D:\hh_home\.emacs.d\elpa\irony-20171002.1130\server
create build directory.

mkdir build && cd build
compile with cmake(cmake-3.9.4-win64-x64) typing in cmd these three commands

cmake -DLIBCLANG_LIBRARY=D:\tt_tools\LLVM\5_0_0\llvm\bin\libclang.dll -G "MinGW Makefiles" ..
mingw32-make
"cmake" "-DCMAKE_INSTALL_PREFIX=d:/hh_home/.emacs.d/irony/" "d:/hh_home/.emacs.d/elpa/irony-20171002.1130/server" && "cmake" --build . --use-stderr --config Release --target install

Everything seems OK at this point. I checked that the Cmake placed irony-server.exe in the specified folder.

After that, I run emacs with simple hello.cpp file (at source  path D:) and check emacs starts company-mode and irony-mode but irony-server.exe is not running.

Just when I type M-x company-irony is when irony-server.exe starts but doesn’t show anything related apparently with the completion at point that should be and seems that company-irony is deactivated (or switched to another ?) with company-mode and irony-mode active.

Additionally checking other completion tests, i.e: std::vector vec; vec. ¿? doesn’t show anything and when I type M-x company-mode at completion point the buffer says “Cannot complete at point”.

To specify the compilation flags and the system header locations I’m using the following .clang_format file in D:\

-std=c++14

-target
x86_64-w64-mingw32

-Wall

-pedantic

-DDEBUG

-ID:\tt_tools\mingw\distro\15_3\bin\../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../include/c++/7.2.0

-ID:\tt_tools\mingw\distro\15_3\bin\../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../include/c++/7.2.0/bits

-ID:\tt_tools\mingw\distro\15_3\bin\../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../include/c++/7.2.0/x86_64-w64-mingw32

-ID:\tt_tools\mingw\distro\15_3\bin\../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../include/c++/7.2.0/backward

-ID:\tt_tools\mingw\distro\15_3\bin\../lib/gcc/x86_64-w64-mingw32/7.2.0/include

-ID:\tt_tools\mingw\distro\15_3\bin\../lib/gcc/x86_64-w64-mingw32/7.2.0/include-fixed

-ID:\tt_tools\mingw\distro\15_3\bin\../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/include

I’ve obtained the location of my paths typing cpp -xc++ -Wp,-v < NUL  and copying literally from …search stars here. By the way: gcc version 7.2.0 (GCC), Target: x86_64-w64-mingw32 and Thread model: posix.

I’ve made a lot of test to try to enable this feature but nothing… :-(
Hope someone can help me litle bit…

Many thanks


texts:
Consider the following two snapshots: The first below is coming from Emacs on Python mode (with Jedi & Elpy)

This second one below comes from manually photoshopping the previous one to make it easier to distinguish between so many indentation levels.

Are there any packages that can help accomplish the latter effect? In the example above, I used two colors (enough to distinguish indentation levels from their neighbors), but other color schemes using more colors could make navigation even easier.

Note that in Emacs, the indentation character is dictated by:

# Insert multiple spaces for indentation:
(setq indent-tabs-mode nil)

# Insert TAB for indentation:
(setq indent-tabs-mode nil)


texts: *compilation* buffer doesn't show colours until focussed

texts:
I am using Emacs 26.3 on Ubuntu 20.04. When I run a command (say, clang) through the (compile ...) function, colors that should have been visible in the output *compilation* buffer are not made visible until I manually switch over to that buffer (move my cursor into it).
This only happens for text that would have been colored by Emacs (e.g., compilation errors, file names, green "finished" message, etc.). If I manually try to emit some text with ANSI color codes, those colors show up immediately with the text.
I tried to solve this problem by trying to run (font-lock-fontify-buffer), but it doesn't take a buffer name as an argument.
Any idea why this might be happening, and what would be the right way to solve it?


texts:
Scenario: I'm working with a horizontal split

---------------------
|  File 1  |  File 2 |
|          |         |
|          |         |
----------------------

and I'm working on File 2.

Question 1: Sometimes when I use a command like M-x helm-mini and load up another file the new file opens up in File 1's window.  I'd like it to open up in the current window

This happens:

----------------------                   ----------------------
|  File 1  | *File 2* |                  | File 3  |  File 2  |
|----------|----------|   --Select--->   |         |          |
|       Helm          |                  |         |          |
----------------------                   |---------------------

I'd like to keep file 1 active.  This is very annoying Emacs behavior

Question 2: M-x helm-mini (for example) does a few other annoying thing.  First, it expands the size of File 2's window to full width.  Secondly, the temp vertically split buffer for the helm-mini buffer is full width as well

Preferably I'd like this to happen:

---------------------                   ----------------------
|  File 1  |  File 2 |                  | File 1  |  File 3  |
|          |---------|   --Select--->   |         |          |
|          | Helm    |                  |         |          |
----------------------                  |---------------------

I'd like the new split helm screen (or any new command window) to only fill the current working window.  Is that possible?

-- Update --

I didn't intend to make this a helm only type question.  I think simply put I'd like:  If I have 2 files horizontally split I don't want emacs to disturb those windows unless I open a new file.

Like if I'm working in file1, file2 window should never change.  I can't stand when emacs does this.  I am either working on file2 or using it as a reference -- I don't want that buffer changed


texts: Using equal-including-properties to compare # string and propertized string

texts:
I'm writing some tests for my first emacs package but am running into an issue to do with asserting that two text properties are the same - one that's created with # and another with propertize:

;; this fails
(ert-deftest equal-properties ()
  (should
   (equal-including-properties
    #("Utils" 0 5 (:annotation nil :candidate "type" :meta nil))
    (propertize "Utils" :annotation nil :candidate "type" :meta nil))))

In the ert runner, the forms look the same as well:

F equal-properties
    (ert-test-failed
     ((should
       (equal-including-properties
        #("Utils" 0 5
          (:meta nil :candidate "type" :annotation nil))
        (propertize "Utils" :annotation nil :candidate "type" :meta nil)))
      :form
      (equal-including-properties
       #("Utils" 0 5
         (:meta nil :candidate "type" :annotation nil))
       #("Utils" 0 5
         (:meta nil :candidate "type" :annotation nil)))
      :value nil))

Any pointers would be much appreciated, I'm sure (/I hope) I've missed something simple!


texts: How to convert Unicode backslash octal representation to the character it represents?

texts:
If I paste a string from some web page into an Emacs buffer sometimes it will show the Unicode representation of some characters with a backslash and some octal code.  How can I convert this to the character representation?

Thanks.


texts: How to allow org-insert-link to accept mail addresses like 'Name '?

texts:
When I add a mailto link with C-c C-l, the closing > is missing.

If I enter:

mailto:Apa <apa@bepa.cepa>

Leaving the description blank, I get a link like

mailto:Apa <apa@bepa.cepa

If I end with >>, the link is correct. If I enter it with markup like below, it works.

[[mailto:Apa <apa@bepa.cepa>]]

This comes from the following snippet of org-insert-link (Emacs 24.4.1)

(if (and (string-match org-plain-link-re link)
         (not (string-match org-ts-regexp link)))
    ;; URL-like link, normalize the use of angular brackets.
    (setq link (org-remove-angle-brackets link)))

So modifying org-plain-link-re or org-ts-regexp is one way to achieve this. These are pretty impressive expressions, which looks a bit intimidating to touch.

I understand that <> tags are used by org, and this is the likely reason for these types of mail links not getting treated like one would naively think, but I also can't believe I'm the only one that uses addresses of this type.

So has anyone tweaked emacs org to accept this, or is it a bug, or is this address format considered evil?


texts: Draw a rectangle in artist-mode that gets past the last line

texts:
Artist-mode on an empty buffer. C-c C-a C-o rectangle <RET>, <RET> to start drawing a rectangle. You can go right and left, but you can't go down. On a non empty buffer, you can actually go up or down, but not past the last line of the buffer, at least with the keyboard. The question is how do you draw a rectangle with the keyboard even on an empty buffer ?
video illustration : https://vimeo.com/491189784


texts:
I set my theme with load-theme in a use-package macro loaded at startup. The theme has also been installed with use-package, from the repository.

At each start emacs asks me if I really want to load the theme in case it's not safe, how can I tell him to stop ?


texts:
I have create this little helper to easy jump to my last used git projects, I using magit-status-internal to open a status buffer and I set magit-display-buffer-function so that the status is open in a full
frame,  that works but I don't want the change to affect other magit calls should I just set magit-display-buffer-function to its previous value after the call to magit-status-internal or is there a better way to archive that.

(defun git-repository-p (d)
  (file-exists-p (concat d "/.git/config")))

(defun find-git-repository (d)
  (if (equal (file-name-directory (directory-file-name d)) d)
      nil
    (if (git-repository-p d)
        d
      (find-git-repository (file-name-directory (directory-file-name d))))))

(defvar recentf-list)

(defun counsel-recentp ()
  (interactive)
  (require 'recentf)
  (recentf-mode)
  (ivy-read "Recentp: " (delq nil (delete-dups (mapcar #'find-git-repository recentf-list)))
            :action (lambda (f)
                      (with-ivy-window
                        (setq magit-display-buffer-function 'magit-display-buffer-fullframe-status-v1)
                        (magit-status-internal f)))
            :caller 'counsel-recentp))


texts: Is it possible to change the font size in specific buffers?

texts: I would like to have different font sizes for the buffer windows in Emacs. That is, I would like to have a bigger font in the buffer where i write the code, and a smaller font in the buffer where i use the term to browse and run the scripts. Is it possible ?


texts: How to make homebrew emacsclient open files in Emacs.app frame from terminal?

texts: When I run emacsclient -nc filename.txt in my terminal, emacs opens in my terminal. I would prefer it to open in the main Emacs.app frame. Similar to how the terminal shortcuts work for Atom.


texts: How do I get rid of the red boxes around the links in the TOC?

texts: I wanted to get rid if the red boxes in TOC that we obtain when exporting org to pdf. The red boxes looks absolutely ugly and spoil the appearance of the entire document.


texts: How can I change the parentheses highlight style?

texts:
When the cursor in next to a parenthesis, bracket, or brace, it highlights it and the matching one (if any). This is expected.

But by "highlights", I mean it entirely hides the things under a small block of color that nearly matches the text, making it impossible to read which kind of symbol it is. Is there a way to change this highlight style to a border-like box instead?

Here's a screenshot of my issue:


texts: Suitability of Emacs as a Java development IDE

texts:
I'm making yet another attempt to convert over to Emacs. I'm a decent Vi user but have been using Eclipse for most of my development work for the past 10+ years (has it been that long).

So I did some reading up and thought that JDEE is the way to go -- have it configured but still have some basic questions.

But, after doing some more research -- it seems JDEE may not be well maintained and perhaps all I need is CEDET?

So question:

Can Emacs serve as my Eclipse replacement? I organize my build using Maven?
If "1" is yes that what suite of tools should I start with: CEDET? JDEE?

Thanks.


texts: Insert one character 2 chars before end of string

texts: For creating Zim wiki pages, I need to generate a timestamp that ends with a time zone in ±hh:mm format. format-time-string has a %z format string that can insert it without the colon. Right now I use with-temp-buffer to generate the timestamp using %z, moving point back two characters and inserting a colon. My question is, is there a more sophisticated way to do this?


texts:
A style guide for DocBook XML that I must adhere to states "Content within elements should be indented by two spaces if the content runs over more than one line."  They give this example.

<para>See the <link
    linkend="gmirror-troubleshooting">Troubleshooting</link>
  section if there are problems booting.  Powering down and
  disconnecting the original <filename>ada0</filename> disk
  will allow it to be kept as an offline backup.</para>

<para>It is also possible to journal the boot disk of a &os;
  system.  Refer to the article <link
    xlink:href="&url.articles.gjournal-desktop;">Implementing UFS
    Journaling on a Desktop PC</link> for detailed
  instructions.</para>

They also state that,

  Tags containing long attributes follow the same rules.
  See the linkend element of the link tag.

None of the customizable nxml-mode variables seem to help.  In fact, some of the docstrings describe the opposite behaviour.

nxml-child-indent:

  This only applies when the line or lines containing the start-tag
  contains nothing else other than that start-tag.

nxml-attribute-indent:

  Indentation for the attributes of an element relative to the
  start-tag.

I think I prefer keeping opening an closing tags on separate lines like nxml-mode promotes.  Unfortunately the guide specifically prohibits some "straggling" tags (tags on their own line).

Am I out of luck conforming to this style guide with nxml-mode?


texts: Re-generating citation key for all entries in .bib file

texts:
I'm trying to figure out a way to take an existing .bib file and replace all the citation keys using bibtex-generate-autokey. Unfortunately, I keep encountering roadblock after roadblock. From what I can tell, I should be able to run bibtex-clean-entry to all entries in a buffer by evaluating this at the top of it:
% (bibtex-map-entries (lambda (key start end) (bibtex-clean-entry t)))

But this doesn't quite work for a few reasons:

First, if I set the dialect to biblatex, I get errors whenever e.g. I use journal instead of
journaltitle in an entry. I understand journaltitle is the correct biblatex label, but since biblatex understands journal as an alias for journaltitle, I would have thought I could run bibtex-clean-entry and at best get a warning. Instead, the process is aborted after the first occurrence of journal.
Second, I get an error message whenever I'm relying on a crossref value to an entry to specify some of the fields (e.g. if I have an entry whose date value is supposed to be inherited from the entry listed as the value of crossref, I get an error telling me that a mandatory value is missing). This happens whether I set the dialect to BibTeX or to biblatex. (EDIT: it also happens if I set bibtex-maintain-sorted-entries to crossref, so that all entries inheriting values via crossref from another entry get placed before it in the buffer.)

So I started looking into ebib (yes, I'm new to Emacs, in case it wasn't obvious), which seems to have better support for crossref fields. There, I can run ebib-generate-autokey on an entry without a year and a crossref value, as long as the linked reference has the missing information. Moreover, I do not get error messages when using e.g. journal even if the dialect is set to biblatex. But I cannot figure out how to run ebib-generate-autokey on all entries in a buffer.
OK, so my question is: is there a simple way of changing the cite keys of all entries in a file that both understands crossref information and doesn't lead to error when using aliases (in biblatex) like journal etc?
(I do not know enough elisp to see how to attempt to adapt the bibtex-map-entries method and try to run bibtex-generate-autokey on all entries instead of bibtex-clean-entry. But maybe that's a way to go?)


texts: Return to original buffer after opening REPL

texts:
I've got this in my config.org , which is called by my init.el:

#+begin_src emacs-lisp
  (defun bauf/execute-startup-block ()
    (interactive)
    (progn (org-babel-goto-named-src-block "startup")
       (org-babel-execute-src-block)))
#+end_src

then in an org-mode file I have this at the bottom:

...

* Comments

#+name: startup
#+BEGIN_SRC emacs-lisp :results silent
;(progn (slime) (org-babel-execute-buffer))
(slime)
(org-babel-execute-buffer)
#+END_SRC

# Local Variables:
# eval: (bauf/execute-startup-block)
# End:

What I want is that when I open this file, it should automatically start a slime repl, then run all the code blocks in the org-mode file. The code above will start the slime repl just fine, but then it's not doing the (org-babel-execute-buffer). I can then manually run C-c C-v b and it indeed runs all the code blocks. So, I'm guessing that after the (slime) is performed, it doesn't return focus to my calling org-mode buffer and the (org-babel-execute-buffer) is running to no avail in the slime repl buffer? If this is true, how do I tell it to return to the org-mode file and there run (org-babel-execute-buffer)?


texts:
So buffer-string gets the content of the current buffer. But it doesn't allow specifying other buffers.

How can I get around that? Do I need something like save-window-excursion to make it work?


texts: Key binding help for magit popup-based commands

texts:
Magit implements multi-key bindings in a nonstandard way: the first key runs a command that displays a “popup”, i.e. a buffer in a special mode that displays usage instructions, and the second key is bound in that special mode. That second key invokes magit-invoke-popup-action which looks up the event that invoked it in a table.

This breaks Emacs's help mechanism: if I want to know what command a key binding invokes, C-h c or C-h k isn't helpful. If I use these commands before the first key (the one that brings the popup), I get the help for the command that displays the popup (e.g. C-h c c → “c runs the command magit-commit-popup”). If I use these commands before the second key (the one that runs in the popup buffer), I get the help for the generic second-key lookup function (e.g. c C-h c c → “c runs the command magit-invoke-popup-action”). And if I want to look up the key that invokes a command, C-h w truthfully tells me that the command isn't bound to any key — it's hidden behind the popup.

How can I find out Magit's key binding information from within Emacs? I am not interested in loading the documentation in Info and searching through it. I want to obtain the information automatically, following Emacs's self-documented principles, and accurately even if the documentation isn't up-to-date or I'm using customized key bindings.


texts: No sound when using hyperlinks for videos in org-mode

texts:
I am working in GNU Emacs 27.1 (2020-08-26). My operating systems is Ubuntu 20.04 and I am using Firefox 83.0 (64-Bit) for Ubuntu.
Currently I observe the following challenge: When starting a hyperlink in org-mode written as [[Internet address][Title]] the side is correctly opening, but no tone is to hear. Copying the Internet address only and searching it in a freshly opened Firefox gives a correct result.
Who can help ?


texts:
Is there any way to set a custom face for the echo area (and, by extension, the Isearch input text)?

So far my searching hasn't turned up anything, except that it seems like there isn't a way to modify this. Is that correct?


texts: Cannot assign current buffer name in let statement

texts:
I'm trying to write some buffer switching function (which in itself may be a fool's errand, but I digress...) - and it looks a little like this

(defun swk--quit-buffer (original-buffer)
  (switch-to-buffer (original-buffer))
  (kill-buffer "*tmp*")
  (local-unset-key "q"))

(defun swk-switcheroo ()
  (interactive)
  (let ((temp-buf-name "*tmp*")
        (current-buffer-name (buffer-name)))
    (get-buffer-create temp-buf-name)
    (switch-to-buffer temp-buf-name)
    (local-set-key "q" (lambda ()
                         (interactive)
                         (swk--quit-buffer current-buffer-name)))))

My aim is to be able to temporarily bind "q" to this window, to simulate special-mode's "quittable" buffer. Sure enough, the "q" key works once, but I get the message:

Symbol's value as variable is void current-buffer-name

Ideally, I want to replace the current buffer with the result of invoking swk-switcheroo - and then reinstate the original buffer when the user presses "q".


texts: How can I use Helm File Finder to copy a file path to a buffer?

texts: Is there a way, in the buffer launched from helm-find-files, to copy a file path to the kill ring?


texts: display lines from org-table on org-agenda

texts:
I'm wondering if it is possible to display lines from an org table on my agenda.

Suppose I have an org file with the following content:

* expense

| <2017-08-17 15:11> | 13.00 | barber | :care: |
| <2017-08-17 12:06> |  7.60 | lunch  | :food: |

I would like to see the following on my agenda:

Donnerstag 17 August 2017
               8:00...... ----------------
              10:00...... ----------------
              12:00...... ----------------
  gtd:        12:06...... 7.60 lunch :food:
              14:00...... ----------------
  gtd:        15:11...... 13.00 barber :care:

But unfortunately, the following is displayed:

Donnerstag 17 August 2017
               8:00...... ----------------
              10:00...... ----------------
              12:00...... ----------------
  gtd:        12:06...... expense
              14:00...... ----------------
  gtd:        15:11...... expense

If I do string-replace "|<" with "** <" and then "|" with " " (whitespace) I get the desired result.

Is there any way to make it work without modifying the table?


texts: Peculiar Error triggered when calling ERC, org2blog from Windows, OS X

texts:
When I launch ERC or org2blog I get the following error:

  dbus-call-method: peculiar error: "Emacs not compiled with dbus
  support"

I've been trying to run down this error for weeks. How do I find out where dbus is called from? And how can I make it a non-blocking error?

Let me know if you need more information, other than this is happening on 24.4+.


texts: How can I make it so that when I press C-xC-b to access the Buffer List that that buffer automatically takes focus instead of having to switch to it manually with C-xo? I can't find a variable that customizes this.


texts: Output of ipython shell much slower than python shell

texts:
Even turning off font-lock-mode and set (setq python-shell-font-lock-enable nil), the output of an ipython shell

(setq python-shell-interpreter "ipython")

seems much slow than the python shell

(setq python-shell-interpreter "python").

A test snippet would be

import numpy as np
np.set_printoptions(precision=8, threshold=10000, linewidth=120)
np.random.randn(99, 99)

My emacs version is GNU Emacs 25.1.1 (x86_64-apple-darwin16.3.0, Carbon Version 157 AppKit 1504.76) of 2017-01-14 and ipython version is 5.1.0.

Is it possible to speed up the output of ipython shell ? Any help will be appreciated.


texts: Is it possible to display and edit the contents of a linked file?

texts:
In a Stack Overflow question, another poster wants to write OpenGL shader programs near to where they are used. However, performance tuning indicates that you should compile these shaders once at the beginning of your program, which means you need access to the shaders in a non-local manner.

Would it be possible to have some indication to "inline" a view of another file? For example, say I had some raw source pseudocode like this:

// ~magic~ shader1.txt
fn my_awesome_method() {
    // do some things
}

When actually viewing this file, I would see the contents of the file shader1.txt instead of the comment. Ideally, I could even edit it in place, with modifications being written to the original file. In a way, it's kind of like a "live" insert-file, except it isn't modifying the containing file.

This way, the shader would actually be non-local, but you can view and edit it in the context that it will be run in.


texts: How to install mu and mu4e with GUI Emacs

texts:
I've been using this guide to set up email in Emacs on macOS. I managed the offlineimap connection and replication into a Maildir. I installed mu with brew install mu:

$ which mu
/usr/local/bin/mu

But I cannot find anything in the Emacs site-lisp to launch mu4e:

$ ls /usr/local/share/emacs/site-lisp/mu/
ls: /usr/local/share/emacs/site-lisp/mu/: No such file or directory

But the website suggests that mu4e is installed:

  mu includes an emacs-based e-mail client (mu4e)

I tried building from git and using brew in this way:

EMACS=$(which emacs) brew install mu --with-emacs --HEAD

and in both cases I get:

configure: error: Package requirements (gmime-3.0) were not met:

No package 'gmime-3.0' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GMIME_CFLAGS
and GMIME_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

and this package is not in brew:

Error: No formulae found in taps.

Furthermore, on my home computer the command EMACS=$(which emacs) brew install mu --with-emacs --HEAD reinstalls emacs with brew, despite it being already installed.

Another attempt is to install mu, then just copy the mu4e files to site-lisp:

brew install mu
git clone git://github.com/djcb/mu.git
mkdir /usr/local/share/emacs/site-lisp/mu/
cp -r mu4e /usr/local/share/emacs/site-lisp/mu/

and adding this in ~/.emacs:

(require 'mu4e)
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu/mu4e")

But I get the error Cannot open load file: No such file or directory, mu4e-meta. And still, M-x mu4e doesn't work.

How can I install mu4e?


texts: Mac OS X: How to permanently change the prompt (value of PS1) in the shell of emacs client?

texts:
I have start emacs as daemon through (emacs --daemon). I then launch the client (emacsclient -c) and use its shell mode through (M-x shell RET). However the prompt starts with:

  bash-3.2$

I have changed the value of PS1 by export PS1="\w\$ " in .bash_profile. So any idea how to change the value of PS1 in the shell of emacsclient?

Edit: or an equal question is: where does emacsclient get environment variables, e.g. $PATH, $PS1 ...? Knowing this will solve my question.


texts: How to modify a file you're debugging with realgud

texts:
I understand mechanically from here:

debugging: how to optimize a RealGUD workflow
How to edit code in the source window using realgud?

I can use C-x C-q to disable read-only mode on the python file I am debugging.  I can then make changes and use run to restart the debugger.
However, I find that when I do this, whenever I edit the file that I am debugging, I am faced with the following error:
That’s all folks.... exited abnormally with code 1

How can I make changes to a file I am debugging and then re-run it without the debugger crashing?  My read is that the file is read-only for a reason, and when I modify it while pdb is running I invite disaster---but this suggests to me there is an approved way to do this correctly.  What is it?


texts: Proper way to change prefix key for minor-mode map?

texts:
The package HideShow (hs-minor-mode) defines some key bindings with prefix key C-c @.

What is the proper way to change this prefix key to C-c h?

The new key binding should also replace the old key bindings in the menu bar items of Hide/Show menu.

I came up with this solution for remapping:

(setcar (cadr (lookup-key hs-minor-mode-map (kbd "C-c"))) (elt (kbd "h") 0)))

It does what I want, but it looks wrong.

Note: I found this similar question. This Answer adds another Prefix but does not change the key binding shown in menu.


texts: xclip fails to set selection when using tramp

texts:
I use Emacs in the terminal (emacs -nw) and xclip.el for synchronising the kill ring with the X clipboard. Under normal circumstances this works fine, but when visiting buffers with tramp xclip is not able to set the X clipboard. I believe something is failing with the xclip shell command when run through tramp, but I don't know how to debug it.

Investigating so far I have found:

Yanking in a tramp buffer works fine and is able to yank from the kill ring or X clipboard.
Killing text under tramp causes the text to be added to the kill ring, but the X clipboard does not get set.
It doesn't matter which user or host is used to access files through tramp - I can visit files using /sudo:myusername@localhost:/... and the failure still occurs.
xclip processes don't get closed after killing text in a tramp process, which is what leads me to believe something is failing there. I see the text below when I close Emacs. (This does not occur when killing to xclip in a normal buffer).

Active processes exist; kill them and exit anyway? (yes or no)

Process [v]     Status  Buffer          TTY          Command
xclip           run     --              /dev/pts/6   /bin/sh -i
xclip<1>        run     --              /dev/pts/7   /bin/sh -i

xclip.el uses start-file-process and process-send-string to run xclip, but I don't know how to debug these functions or see if there is any error output. There are no errors in the Messages buffer.

Is there something I can do to fix this problem or some way to debug what is going wrong with the xclip shell commands?


texts: mark a second type of holidays in calendar

texts:
Emacs calendar can show holidays, so I know when I'm required to stay at home. ;)
(lets say: these are marked with red background, and this feature is already working)

But what if I'm a teacher and like to see (in calendar) when my pupils are staying at home and I'm required to go to work. (lets say, I'd like to mark them with a green background)

How can I achieve this highligting of those second type of holidays?


texts: proper file for spacemacs configuration: init.el vs. .spacemacs

texts:
I'm setting some personal preferences to my spacemacs. Some of them are in init.el file, some other in .spacemacs file.

If I recall correctly that's because some of the settings did not work other way. But I'm concerned about the proper way of doing such things.

maybe is mandatory to use .spacemacs instead of init.el?

which should be the preferred method? which are the main functions of both files?

thanks


texts: US-Intl layout EU users of Emacs in WSL - how do you input those Alt-Gr characters?

texts:
I am a user of the US-International keyboard layout and the German language. Somehow Emacs does not allow me to access those Alt-Gr characters for example the German Eszett "ß" and many others:

How do you access those characters in Emacs?
Edit: I'm calling emacs from WSL (Debian is installed) in Windows 10, displaying emacs through the VcXsrv X Server. Within Windows 10, Eszett "ß" can be access by pressing AltGr + S, for applications such as Notepad. However, this doesn't work in this emacs: basically none of the AltGr combinations work, and only those dead keys work to create modified characters, e.g. ä, ö, ü.
1


texts: How to highlight specific keywords inside strings/quotes?

texts:
I have another syntax highlighting for SQL keywords inside strings (inside quotes) in VIM. It looks like this:

Then in Emacs with PHP-mode, everything between quotes (') will be considered as a string by the font lock:

As you can see, the first example with another font face properties (no cursive keywords) is more clear. The keywords are much easier to distinct.

When I'm looking into my font face properties:

 (font-lock-string-face ((t (:foreground "#536991" :slant italic))))

Then I'm wondering how I could tell that there another face inside a font-lock-string-face should be applied, if it matchs the specific keywords.

Any suggestion would be appreciated.


texts: What is the correct way skip to prev/next method/function definition?

texts:
I do not want an answer about something like Imenu or tags - features that suppose you know some keywords about the method/function name to move to.

What I want is just general commands which jump forward to next or jumps backward to previous method, e.g. in ruby-mode or emacs-lisp-mode.


texts: `magit-tag-release` error: "Invalid version syntax: '0.7-5'"

texts:
I'm unable to tag releases with current Magit from Elpa.  Doing:

t RET r (magit-tag-release)

I immediately get the error message: "Invalid version syntax: '0.7-5'" in the minibuffer.

This happens either from the magit-log buffer or the main magit buffer.

Below is partial output from git tag:

release-0.7-5
release-0.7-6
release-0.7-7
release-0.7-8
release-0.7-9

which shows the naming pattern of my release tags.  Any pointers welcome.


texts: How to enable org mode and evil mode for untitled buffer when creating a new frame

texts:
The code below creates a new frame with an untitled buffer, how to make this buffer default with org-mode and evil-mode?
(global-set-key (kbd "s-n") 'new-empty-frame)

(defun new-empty-frame ()
  "Create a new frame with a new empty buffer."
  (interactive)
  (let ((buffer (generate-new-buffer "untitled")))
    (set-buffer-major-mode buffer)
    (display-buffer buffer '(display-buffer-pop-up-frame . nil))))

M-x org-mode RET worked, but how to do it with elisp?
M-x evil-mode RET didn't even work.

The code is from: https://stackoverflow.com/a/25792276/5520270


texts:
The dark blue color on my terminal emulator is hard to read.

Does emacs have the ability to completely disable colors in its output, regardless of whether the colors are used for underlining file names or are part of the prompt of M-x?

I've tried using

(global-font-lock-mode 0)

and the equivalent

(setq-default global-font-lock-mode nil)

but that just disables applying colors to keywords and bits of syntax in the buffer text itself.


texts: How can I quickly toggle between string and regexp versions of functions such as replace-string/replace-regexp, query-replace/query-replace-regexp etc? Pretty sure I saw a shortcut once but now I cant find it.


texts: Can I convince EPA encrypt for an expired key

texts:
Through a series of my own errors my public key is expired and I don't have the master key with me to re-sign it. I use this key to encrypt many files i use on a daily basis, most importantly org files in emacs.

Can I convince EPA to encrypt for the expired key anyway even though it's expired?

my org file starts with

# -*- mode:org; epa-file-encrypt-to: ("B66NNNNNNNNNNN3EA") -*-

does it take additional options or can I change other things in gpg to make it trusted, provided i have only the encryption and signing (non-master) keys with me?


texts:
Using forward-word with this line:

foo *** *** bar,

I want to have the folowing behavior:

foo| ***| ***| bar|,

Not:

foo| *** *** bar|,

So, if between spaces there are only non-letter symbols, let's consider this a word too. forward-whitespace is not good enough, cause it loses distinction between letters and non-letters at all.
How this can be done?


texts:
No items are showing when I load the agenda view. When I press C-c a, the agenda view menu comes up fine. But hitting a brings up an empty list, and so does t.

M-x describe-variable RET org-agenda-files shows

There are tonnes of TODO items in ~/org/todo.org, eg:

My init is defined in ~/.emacs.d/init.el and I do not have an ~/.emacs. My init.el has only one definition of org-agenda-files.

I really am at a loss as to why this is not working.

Emacs version 26.3
Org version 9.3.1

Not sure what other information might be useful?

I have been using Emacs for a while, but would consider myself a noob with custom configuration and org mode.

UPDATE:

The Messages buffer is showing errors like this:

Press key for agenda command (unrestricted):
org-agenda-get-todos: Wrong type argument: number-or-marker-p, "E"
user-error: Command not allowed in this line [3 times]

I set debug-on-entry for org-agenda-get-todos, and it shows this in the debug buffer:

Debugger entered--entering a function:
* org-agenda-get-todos()
org-agenda-get-day-entries("~/org/todo.org" (1 21 2020) :todo)
org-todo-list(nil)
funcall-interactively(org-todo-list nil)
call-interactively(org-todo-list)
org-agenda(nil)
funcall-interactively(org-agenda nil)
call-interactively(org-agenda nil nil)
command-execute(org-agenda)


texts: how to automatically open .ics file after org-icalendar-export-to-ics?

texts:
I use org-icalendar-export-to-ics to export org-agenda scheduled tasks to iCal format, which works nicely. In my use case, I always select export the "current file" (as opposed to "combine all agenda files").

This has the effect of creating an .ics file with a name like foo.ics. I then have to go navigate in Finder to go find that file and then open it in iCal.

How can I direct Emacs to open or open-with that .ics file automatically upon org-icalendar-export-to-ics? I can't imagine a scenario where I would want to export to an .ics file but not go on to open the .ics file and import the task into iCal.

Maybe some bash scripting around org-after-save-iCalendar-file-hook? The documentation for org-after-save-iCalendar-file-hook says "A good way to use this is to tell a desktop calendar application to re-read the iCalendar file," but it doesn't say how to go about telling my desktop calendar to do that.


texts: Is there a keybind or a way of undoing each of ediff A-B change? I often want to revert the previous modification.


texts: Calling a function when emacs process is killed (MS Windows)

texts:
I would like to call a function just before emacs exits. Normally the following can do job:

(add-hook 'kill-emacs-hook 'my-function)

Unfortunately when I shutdown the system (MS Windows) or terminating the emacs process by some external tools, this does not work.

Is it impossible to achieve this goal in such situations?


texts: Increase minubuffer font size for quail mode completion

texts:
I am trying to increase the font size of the text overlay displayed in the minibuffer when using quail completion without success so far.

Does anyone have any idea how to achieve this?

EDIT:
I was able to change the font size in common minibuffers like " Minibuf-0" ", Minibuf-1", " Echo Area 0", " Echo Area 1", but statement used to work for that purpose (set (make-local-variable 'face-remapping-alist) '((default :height 3))) doesn't work for this particular overlay or overlays in general.

I to created around advice on execution of quail-setup-overlays to amend text size, but it doesn't solve the issue.

(defun my/quail-setup-overlays-advice (orig-fun &rest args)
  (let ((res (apply orig-fun args))
         (buf-guidence (get-buffer " *Quail-guidance*"))
         (buf-completions (get-buffer "*Quail Completions*")))

    (dolist
      (buf (list buf-guidence buf-completions))
      (when (bufferp buf)
        (with-current-buffer buf
          (set (make-local-variable 'face-remapping-alist)
            `((default :height 3))))))
    res))

(advice-add 'quail-setup-overlays :after #'my/quail-setup-overlays-advice)

Maybe the solution would be to use this around advice but to change 'display property of overlay with construction similar to (overlay-put quail-overlay 'display 'underline) rather than remapping faces, but I don't have much clue how to do it.

Any ideas?


texts:
I am trying to write two functions to do these:

Function 1:

When the point is on a link (in an Org file), generate a PDF from that link (I am thinkng of using wkhtmltopdf. Side question: does wkhtmltopdf give a truer-to-original-look PDF as opposed to Pandoc through LaTeX? Is there a better option?);
Generate a name from the title of that link plus some (random) unique identifier;
Save that file with that name to a specific directory;
Create a link to that PDF file just after the link the point was at in the Org file with "(PDF)" as the description of that link;
Bind that function to a key sequence (I am using Doom Emacs).

Function 2:

When point is on a link to a PDF file in an Org file, open the file in Org-noter;
Create a link right after the link to the PDF file in the Org file with "(Notes)" as description, pointing to that particular Org-noter Org file just created;
Bind that function to a key sequence (again, I am using Doom Emacs).
I would be really grateful if anybody help me with any part of doing that? I am very new to Emacs and Emacs Lisp.


texts: kill-this-buffer doesn't work in all buffers yet the emacs menu "close" does, what's the difference?

texts: I have the command kill-this-buffer bound to C-x C-x. yet it seems it doesn't work in all buffers (such as the calendar month view etc. yet the emacs menu close always does work. whats the difference between the two (the menu close doesn't seem to have a keybind) and how does one bind it to a key?


texts: I am trying to install the gauche-mode. Running the M-x package-install-file and giving the /path/to/gacuhe-mode/ directory gives the Read error: is a directory, /path/to/gacuhe-mode/. How can i install it with this command otherwise? I am using emacs 24


texts: "VC method not implemented for backend" for project-find call

texts:
I am trying out project based search via project-find-regexp, but I get the error:
vc-call-backend: VC method not implemented for backend: find-ignore-file, CVS

How can I fix this? I assume this is a CVS specific problem. Is there way to make CVS working with the project system? (Or just ignoring the CVS aspect when doing the project search?)


texts:
C-[ is equivalent to the escape key on US English keyboards, thus, any attempt at binding it will mess up M- behaviour.

Emacs seems to have no trouble telling <escape> and C-[ apart in GUI frames. The following works fine and bindings starting with M- remain to be working:

(global-set-key (kbd "<escape>") (lambda () (interactive) (message "<escape>")))

However, if I bind

(global-set-key (kbd "C-[") (lambda () (interactive) (message "C-[")))

suddenly emacs goes crazy and binding like M-x break. Moreover, pressing C-[ refuses to trigger the bound lambda. Interestingly enough, C-x @ c [ (apply modifier control to open bracket) still says C-[ is undefined.

Is there any way of binding something to C-[ without breaking emacs?


texts:
Hi I am new to emacs and  am having trouble installing flycheck.

I have modified my ~/.emacs.d/init.el file to:

(require 'package)

(add-to-list 'package-archives
             '("MELPA Stable" . "https://stable.melpa.org/packages/")t)
(add-to-list 'package-archives
             '("gnu"."http://elpa.gnu.org/packages/"))

(packages-initialize)

(add-hook 'after-init-hook #'global-flycheck-mode)

and when I try and  install flycheck with
M-x package-install RET flycheck RET

I get as far as M-x package-install RET flycheck - and I am asked to complete flycheck with a -option.

If I list the packages there are several flycheck -apertium, flycheck-cask but there isn’t one for just flycheck.

I would like to use flycheck with syntax checking for php. As far as I understood I would need to install flycheck (not flycheck- some option) then phpcli.

If someone could point me in the right direction it would be greatly appreciated


texts: How can I move all my file-local LocalWords to .dir-locals.el?

texts:
This is a follow-up question to Can I instruct ispell to insert LocalWords in a different file?.

So now that I've got a way to use a separate file for my local dictionary, is there any way to move the words in my file to .dir-locals.el automatically?


texts:
Using org source blocks with OCaml, I get a blank resulting output with that code :

#+BEGIN_SRC ocaml :results output
print_string "hello"
#+END_SRC

#+RESULTS:

And without the :results value parameter :

#+RESULTS:
: ()

How to catch the output of OCaml in org source blocks ?

Edit : My init parts about ocaml

(use-package utop
  :ensure t)

(use-package merlin
  :ensure
  :config
  ;; Add opam emacs directory to the load-path
  (setq opam-share (substring (shell-command-to-string "opam config var share 2> /dev/null") 0 -1))
  (add-to-list 'load-path (concat opam-share "/emacs/site-lisp"))
  ;; Load merlin-mode
  (require 'merlin)
  ;; Start merlin on ocaml files
  (add-hook 'tuareg-mode-hook 'merlin-mode t)
  (add-hook 'caml-mode-hook 'merlin-mode t)
  ;; Make company aware of merlin
  (with-eval-after-load 'company
    (add-to-list 'company-backends 'merlin-company-backend))
  ;; Enable company on merlin managed buffers
  (add-hook 'merlin-mode-hook 'company-mode)
  ;; Or enable it globally:
                    ;(add-hook 'after-init-hook 'global-company-mode)

  ;; Use opam switch to lookup ocamlmerlin binary
  (setq merlin-command 'opam)
;;  (define-key tuareg-mode-map (kbd "C-c M-s") ')
  ;;;###autoload
  (defun tuareg-run-metaocaml ()
    "Run an OCaml toplevel process.  I/O via buffer `*ocaml-toplevel*'."
    (interactive)
    (tuareg-run-process-if-needed
     "/usr/bin/opam config exec -- metaocaml")
    (display-buffer tuareg-interactive-buffer-name))

  (add-hook 'tuareg-mode-hook
        ' (lambda ()
              (define-key tuareg-mode-map (kbd "C-c M-s")
            'tuareg-run-metaocaml)))

  (setq tuareg-interactive-program "/usr/local/bin/opam config -- exec metaocaml")
  ;;(setq merlin-use-auto-complete-mode t)
  ;;(setq merlin-error-after-save nil)
  )

(use-package tuareg
  :ensure t
  :config
  (setq auto-mode-alist (cons '("\\.ml\\w?" . tuareg-mode) auto-mode-alist))
  (autoload 'tuareg-mode "tuareg" "Mode majeur pour éditer du code Caml" t)
  (autoload 'camldebug "camldebug" "Exécuter le débogueur Caml" t)
  (when (string= (getenv "MY_EMACS_DAEMON") "ocaml")
    (load-file "~/.emacs.d/elisp/daemon/my-tuareg-daemon.el"))
  ;; Setup environment variables using opam
  (dolist (var (car (read-from-string (shell-command-to-string "opam config env --sexp"))))
    (setenv (car var) (cadr var)))
  ;; Update the emacs path
  (setq exec-path (append (parse-colon-path (getenv "PATH"))
                        (list exec-directory)))
  ;; Update the emacs load path
  (add-to-list 'load-path (expand-file-name "../../share/emacs/site-lisp"
                        (getenv "OCAML_TOPLEVEL_PATH")))
  ;; utop top level
  (autoload 'utop "utop" "Toplevel for OCaml" t)
  (autoload 'utop-minor-mode "utop" "Minor mode for utop" t)
  (add-hook 'tuareg-mode-hook 'utop-minor-mode)
  )

I tried without utop but output remained the same.


texts: Fix line height of special keyword lines (set face for logbook sum)

texts:
I would like to make the lines with special keywords less disturbing, so I reduced the height of org-special-keyword. But the lines have a lot of space. This is not the case for the source-lines, where everything arranges neatly (see image below). The culprit is apparently the sum of logbook entries.

Is there a way to lower height of this part without affecting regular content, too?


texts:
Coming from casual IDEs I used CUA mode. Switching back to the vanilla keymaps I noticed that M-w & C-y (copy&yank) is significant harder to use with one hand than Ctrl c & Ctrl v

Why are the original keymaps for copy and paste so far apart? Is there a historical/shell-like explanation for this?

Besides that, is there a convenient way to use copy&paste with one hand in Emacs w.r.t to the vanilla keymaps.


texts:
I have searched the googlewebs, but I have been unable to find an emacs package that will automatically break long lines in a (Python) language conforming way.  For example:

    def _formatDependencyList(usedList):
        if len(usedList) == 0:
            return '(This thing does not use modules)'
        return ', '.join([_escapeUnderscores(_getBaseNameHead(s)) for s in usedList])

The s in the rightmost occurrence of usedList is in column 80 in my file, and having gotten to the end of the line, I would like to issue a command, much like the M-q/fill-paragraph command, to 'fix' this one line and make it look like this:

        return ', '.join([
                _escapeUnderscores(_getBaseNameHead(s)) for s in usedList])

In this special case the ( and the [ that follow join are adjacent, so I would break the line after [.  (In the more typical case, I would break the line at the first ( or [ character.)

This seems to me like something that emacs could do, and probably does (somewhere), and it would save me a whole lotta keystrokes.  Honestly, I do not know how people use editors that cannot fill paragraphs, and if I had this too I would likewise be unable to continue living without it.


texts:
I am using emacs 24.3 (ubuntu 14.10) and would like the daemon to participate in the graphical desktop session lifecycle while using desktop-mode. I went through http://www.emacswiki.org/emacs/EmacsAsDaemon but it still does not play nice for me. One problem is that the daemon SIGTERM termination does not clean up .emacs.desktop.lock so the next start will refuse to pick up the saved state.

Does anyone have a recipe to make emacs daemon + desktop mode play nice with the graphical desktop session?

As a sidenote: Sending SIGHUP frequently crashes emacs for me.


texts: How to force Magit to use current Emacs instance to edit commit message?

texts:
I use emacs -nw + tmux. Just upgraded Magit from 2.8.0 to 2.90.1, and found it always open a new Emacs GUI window when committing instead of use current Emacs instance directly (the behavior in 2.8.0). I cannot find the option to customize this annoying behavior.

I'm not using emacsclient


texts:
I have a longish document and I want to number the paragraphs.

So,

Here is the first paragraph. It could span multiple visual lines.

Two paragraphs are separated by an empty line.

converts to :

1 Here is the first paragraph. It could span multiple visual lines.

2 Two paragraphs are separated by an empty line.

How can I do that?

And of course, if I add/ delete paragraphs, there should be some way to adjust the numbers. And it should be possible to remove the numbers.

If it can be done in some other mode like org-mode, etc. that would be fine.


texts:
I was reading about dir-locals and wanted to set up per project settings. However whatever I try results in a malformed function. Why is this ?

.dir-locals.el:4:1:Warning: ‘(php-mode (php-executable . /usr/bin/php))’ is a
malformed function

So I tried this as the most basic example I could think of, and even this raises an error.

((php-mode
  (php-executable . /usr/bin/php)))

So what am i doing wrong? I edit the file and then compile it to check things are working and checked multiple examples online and they all seem to use this format.

From the answers below this is an example I wanted to make work, the above was just a simpler test.

((nil .
      ((pony-settings (make-pony-project
                       :python "/docker:root@app_django_1:/usr/local/bin/python"
                       :pythonpath "/app"
                       :settings "local_settings_file"
                       :appsdir "/app")
                      ))))

This is where my issues stemmed from, I can switch to a file and I hit an error which is what made me try and compile the code so I could test quickly.

eval: Invalid function: (make-pony-project :python "/docker:root@app_django_1:/usr/local/bin/python" :pythonpath "/app" :settings "local_settings_file" :appsdir "/app")

Perhaps this should be another question now, but in away this is still an issue I am getting an error but cant modify and apply changes quickly to see if its valid. Anyone have any idea on the above error ?


texts:
How to insert <TAB> while in iedit mode?

following example:

int blah; //< x
float moo; //< y
void foobar; //< z

Now I select '//<' and go into iedit-mode, because I want to align those comments nicely with a single tab character. I'd like to get following result:

int blah;   //< x
float moo;  //< y
void foobar;    //< z

It doesn't look good here on stackexchange, because of wrong tab width.

Anyway, when in iedit-mode <tab> and S-<tab> switches to next/previous occurence.

Edit: Duplicate of question to Emacs shell and telnet? This question is solved by the same solution. But I would have never searched for that to solve my iedit problem.


texts: How emacsclient automatically startup with the most recent file?

texts:
With the help of recentf I am able to open recently open files from its buffer list. As an example when I execute icicle-buffer, I can see the buffer list.
I was wondering can I do this operation automatically where the most recent file (buffer) will be open with the help of a function instead of manually selecting.
Basically my main goal is: when I open emacsclient I want to start it with the most recently file, which is I belive the first index file on the buffer list.


texts: emacs24 Mac - Mouse works but keyboard input stays in terminal

texts:
When I run emacs24 on my Mac, the keyboard input continues to appear in the terminal instead of in the emacs shell.

I just installed emacs on my Mac using Homebrew. eg

brew install emacs --cocoa
ln -s /opt/boxen/homebrew/Cellar/emacs/24.3/Emacs.app /Applications
emacs-24.3

Loads a graphical version of emacs.  When I mouseover and click things move as expected.  But the keyboard does not. eg I can't type anything in and have the cursor respond.  Instead the keyboard input remains on the terminal.  So if I type right-arrow

^[[C

Appears in terminal...


texts:
Can someone point me to a working setup for using babel with IPython?

I'm witnessing strange indentation behavior when I try to define functions. This happens whether or not I specify the --classic flag in org-babel-python-command. My current command (running linux with Emacs 24.4):

(setq org-babel-python-command
      "ipython --pylab=qt4 --pdb --nosep --classic --no-banner --no-confirm-exit")

This doesn't work with function definitions.

#+BEGIN_SRC python :session *Broken IPython* :results output pp
  def g(x, lst):
      if isinstance(x, float):
          x = x + 0
      return [item + x for item in lst]
#+END_SRC

This doesn't seem related to --classic either as I get the same error:

Bonus points if you have a working setup that doesn't force me to use --classic as I do like the formatting of "modern" interface.

Update

Using the magic command lets me define functions and evaluate a session, but I can't get a value output without one. Instead, I get:

#+BEGIN_SRC python :results output
   def f(x):
       return x + 2

   f(2)
#+END_SRC

#+RESULTS:
: >>> ... ... >>> 4
: >>>

#+BEGIN_SRC python :results value
   def f(x):
       return x + 2

   f(2)
#+END_SRC

#+RESULTS:

No results are returned, seemingly because of all the >>> in the output not being parsed correctly.


texts: Evil-mode mixed tabs & spaces indentation

texts:
I'm having extreme issues at the moment with evil mode where I am working on Jade/Pug and Stylus files for Node.JS where it is white space sensitive. I installed  pug-mode but when you indent via >> the indentation goes 4 spaces and on the 2nd >> the spaces get converted into one tab I think. Backspace isn't even removing the tabwidth of spaces, only the tabs. Also, how do I setup proper indentation with evil-mode for files that are not known to emacs like .styl (stylus) files? I am still new to emacs where I am experiencing hell with this mixed white-space of tabs and spaces along with the non-intuitive indentation.

What I want:

tab and >> does the same indentation
backspace removes a tabwidth of indentation
autoindent when in insert state and carriage returned as well with 'o'
no mixed tabs or spaces
stylus files having proper indentation with CSS coloring


texts:
What should I do when Emacs stops responding?

My current "emacs-is-frozen" protocol looks like this:

Spam C-g (it sometimes works)
Wait for a while.
pkill -9 emacs

What alternate steps could I try to avoid losing work that hasn't been autosaved yet?

If anything, could I attach GDB to know what the likely issue is?


texts: Why isn't url-http-end-of-headers set correctly when using url-automatic-caching?

texts:
This is a follow-up question to How can I make url.el work with the If-None-Match header?

Evaluate the following form:

(let ((url-request-method "GET")
      (url-automatic-caching t))
  (with-current-buffer
      (url-retrieve-synchronously
       "https://api.github.com/users/octocat")
    (message "'%c' (%S)"
             (char-after url-http-end-of-headers)
             url-http-end-of-headers)))

It thinks url-http-end-of-headers is position 1 in the following buffer:

HTTP/1.1 200 OK
Server: GitHub.com
Date: Fri, 19 May 2017 12:18:32 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Status: 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 55
X-RateLimit-Reset: 1495197406
Cache-Control: public, max-age=60, s-maxage=60
Vary: Accept
ETag: W/"d093767a41c43cbc64dcc3bda1b5880f"
Last-Modified: Wed, 17 May 2017 21:18:07 GMT
X-GitHub-Media-Type: github.v3; format=json
Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
Access-Control-Allow-Origin: *
Content-Security-Policy: default-src 'none'
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-XSS-Protection: 1; mode=block
Vary: Accept-Encoding
X-Served-By: 075bb2f6b7031ca3c0e69edb17939fae
Content-Encoding: gzip
X-GitHub-Request-Id: E86D:15875:2064CAA:268A8E5:591EE291

{"login":"octocat","id":583231,...}


texts: Python formatting not working on Doom Emacs

texts:
I activated the formatting on save in the init.el file uncommenting the following line
(format +onsave)  ; automated prettiness

But when I save a Python file, I get the following error message:
Error (before-save-hook): Error running hook "+format-buffer-h" because: (error You need the "black" command. You may be able to install it via "pip install black".)

I installed black with pip, as the message says, but I keep getting the same message.
I set the following settings for the Python black formatter (found it here):
;; package.el
(package! python-black)

;; config.el
(use-package! python-black
  :demand t
  :after python
  :config
  (add-hook! 'python-mode-hook #'python-black-on-save-mode)
  ;; Feel free to throw your own personal keybindings here
  (map! :leader :desc "Blacken Buffer" "m b b" #'python-black-buffer)
  (map! :leader :desc "Blacken Region" "m b r" #'python-black-region)
  (map! :leader :desc "Blacken Statement" "m b s" #'python-black-statement)
)

I did run doom sync after changing the settings, and it installed some packages, but I still get the same error when saving Python files.
I'm using Fedora 34, and installed black for Python 3.9. I also tried to install black for Python 2.7, but it's not supported anymore, so I was guessing that maybe Emacs is expecting black to be installed for Python 2.7, That's only a conjecture because I'm new to Emacs and don't know much about it.
Is there a way to make Python formatting work?


texts:
I am trying to get the perlcritic minor mode (v 1.10) to work with the cperl mode. What happens is that the minor mode is activated for the buffer but is then deactivated. I've used edebug to try to figure out what's going on by instrumenting the perlcritic-mode function inside perlcritic.el. The section of code in that function that toggles the mode is cycled through twice for some reason I haven't been able to figure out. If I invoke the minor mode from the minibuffer (M-x perlcritic-mode) you can actually see Critic (the label for the minor mode) appear on the mode line the first time through that section and then disappear as the code is cycled through again and the minor mode is toggled off.

The method is autoloaded in my .emacs using the code I copied out of perlcritic.el. I don't know if its somehow been loaded twice but during debugging I see two entries under the Emacs-Lisp menu. I have no idea if that's significant or not.

Here are the relevant sections of my .emacs:

(add-to-list 'load-path "~/.emacs.d/elpa/perlcritic-1.10")

(add-to-list 'auto-mode-alist '("\\.pl\\'" . cperl-mode))
(add-to-list 'auto-mode-alist '("\\.pm\\'" . cperl-mode))
(add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))

(autoload 'perlcritic        "perlcritic" "" t)
(autoload 'perlcritic-region "perlcritic" "" t)
(autoload 'perlcritic-mode   "perlcritic" "" t)

(eval-after-load "cperl-mode"
  '(add-hook 'cperl-mode-hook 'perlcritic-mode))

Note that I need to use both the auto-mode-alist and the interpreter-mode-alist to get the cperl mode for existing scripts and modules as well as new scripts and modules. The reason has to do with pre-defined values in those lists that map Perl stuff to perl-mode. I don't know if this is what's causing the problem I'm seeing but I did some testing and it did not seem to be the case.

Here's the function in perlcritic.el that's behaving strangely:

(defun perlcritic-mode (&optional arg)
  "Perl::Critic checking minor mode."
  (interactive "P")

  ;; Enable/disable perlcritic-mode
  (setq perlcritic-mode (if (null arg)
                ;; Nothing! Just toggle it.
                (not perlcritic-mode)
              ;; Set it.
              (> (prefix-numeric-value arg) 0)))

;;  (make-local-hook 'write-file-hooks)
  (if perlcritic-mode
      (add-hook 'write-file-hooks 'perlcritic-write-hook)
    (remove-hook 'write-file-hooks 'perlcritic-write-hook)))

;; Make a nice name for perl critic mode. This string will appear at
;; the bottom of the screen.
(if (not (assq 'perlcritic-mode minor-mode-alist))
    (setq minor-mode-alist
          (cons '(perlcritic-mode " Critic")
                minor-mode-alist)))

The part that it cycles through twice is the section under the comment Enable/disable perlcritic-mode.

Update: I used the d command in edebug each time the debugger hit the line stat begins (setq perlcritic-mode.

Both traces showed the same information:

  perlcritic-mode()
  run-hooks(change-major-mode-after-body-hook prog-mode-hook cperl-mode-hook cperl-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook cperl-mode-hook cperl-mode-hook))
  run-mode-hooks(cperl-mode-hook)
  cperl-mode()
  set-auto-mode-0(cperl-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(t t)
  find-file-noselect-1(#<buffer junk.pl> "~/junk.pl" nil nil "~/junk.pl" nil)
  find-file-noselect("~/junk.pl" nil nil t)
  find-file("~/junk.pl" t)
  funcall-interactively(find-file "~/junk.pl" t)
  call-interactively(find-file nil nil)
  command-execute(find-file)

I don't know if the fact that cperl-mode-hook appears twice in the lines beginning with run-hooks and apply is significant or what would cause that.


texts: How to write a loop to remove all the items in menubar?

texts:
The menubar of the mac port emacs can not be disabled.

I currently use

 (define-key global-map [menu-bar file] nil)
 (define-key global-map [menu-bar edit] nil)
 (define-key global-map [menu-bar options] nil)
 (define-key global-map [menu-bar buffer] nil)
 (define-key global-map [menu-bar tools] nil)
 (define-key global-map [menu-bar help-menu] nil)

to remove items from the global map.

But I tried to use a loop to do so but failed

(dolist (menu '(file edit options buffer tools help-menu))
  (define-key global-map [menu-bar menu] nil))

I just get confused with the variable type of menu in [menubar menu]. I'm not sure whether it is a symbol or not. So any suggestion on this will be appreciated.

P.S. I'd like to get all the menubar items like from check-doc-minor-map rather than just the global-map. Can I achieve it? Or if there's some method to add hook to remove all the items before showing the menubar item, please let me know! Thanks!


texts:
When I have a buffer with unsaved changes, magit asks for each and every action to save that changes.

I didn't save that changes on purpose, so is there a way to disable this behaviour? My Magit should simply ignore unsaved changes.


texts: rgrep doesn't search in specified directory

texts:
According to the documentation :

  (rgrep REGEXP &optional FILES DIR CONFIRM)

  Recursively grep for REGEXP in FILES in directory tree rooted at DIR.

  [...]

But when I call it in some Elisp code like this :

(rgrep "test" "*\\.org" "\\~/Org")

It ends up neglecting the third argument DIR and instead uses the current directory.

The corresponding output and the find command of the above code is :

-*- mode: grep; default-directory: <current_directory> -*-
Grep started at Fri May  1 14:24:46

find . <exclude_expr> -type f \( -name \*\\.org \) -exec grep --color -i -nH --null -e test \{\} +

but the output I obtained interactively with M-X rgrep

-*- mode: grep; default-directory: ~/Org -*-
Grep started at Fri May  1 14:24:46

find . <exclude_expr> -type f \( -name \*\\.org \) -exec grep --color -i -nH --null -e test \{\} +

is expected.

Note: GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8, cairo version 1.16.0) of 2020-01-13


texts:
There are many nice column editing features in CUA mode. After hitting Ctrl+RETURN, binded to cua-set-rectangle-mark, you get some help in the minibuffer:

But I can't find the shortcut to cut/kill rectangle text, e.g.: I want to get rid of all hardly stuff:

Any hints?


texts: Error in post-command-hook during org-agenda-todo

texts:
Ever since upgrading to emacs 24.4.1, when I set something as 'done' from the agenda, I frequently get the error:

Error in post-command-hook (org-add-log-note): (error "Variable binding depth exceeds   max-specpdl-size")

When this happens, the Agenda does not reappear and the org buffer being modified continues being show.

What is the best way to debug this?


texts: Function like `setcar` that doesn't change the value of the input function?

texts:
Early beginner here. I'm looking for a function that takes a list and changes only its first element, using some function or other. I realize setcar sort of does that, but it also changes the initial list. Thus if I have
(setq mylist '("Red" "Green" "Blue"))

and then run
(setcar mylist (downcase (car mylist))

the value of mylist will change to ("red" "Green" "Blue").
What I'm looking for, though, is a function that only outputs the value that setcar will set mylist to but does not change the value of mylist.
I realize I could do, e.g.
(setq mynewlist mylist)
(setcar mynewlist (downcase (car mynewlist))

and get essentially the same result. But I wanted to know if this is the best way to do it.


texts: (Evil) Binding "q" to "View-quit" in view mode (instead of "evil-record-macro")

texts:
I'd like to be able to exit view mode by pressing "q". However, in evil "q" is bound to evil-record-macro, even in view mode. I wasn't able to find a solution using evil-define-key.

I was excited to find a similar question here, which proposes using eval-after-load, like so:

(defun testing ()
  (interactive)
  (message "Testing..."))

(eval-after-load "view" '(evil-define-key 'normal view-mode-map "q" #'testing))

This produces some strange behavior. When I enter view mode, C-h k q reports the following: "q runs the command evil-record-macro (found in evil-normal-state-map)... It is bound to q.". But, I discovered that if I do press "q", record a macro, and press "q" again to exit the recording, I see the "Testing..." message. Following this, pressing "q" continues to produce the message, and I no longer enter macro recording. "C-h k q" reports: q runs the command testing... It is bound to q, <normal-state> q.

Can someone propose a solution or workaround? Thanks!


texts:
I am after the key-binding C-x-TAB S-rightarrow to indent each line in a block by a TAB see - https://www.gnu.org/software/emacs/manual/html_node/emacs/Indentation-Commands.html.

I always open emacs in the -nw mode. On my local computer (Emacs 24.5.1) when I press C-x-TAB I am asked for the arguments to this command:

but on a remote computer (Emacs 24.3.1) the arguments are not asked for and indentation is done immediately with a space.

The goal is to have indentation with a TAB. What is going wrong on the remote computer and how to fix?


texts: Is there a way of calling (end-of-buffer) that excludes trailing empty lines?


texts: How to fold the highest headline which I am currently in?

texts:
I often do the following sequence in my org-mode file:

Go to the root headline from current position
Fold the whole subtree

Is there a way to this sequence with a shortcut?


texts: Define key to toggle between javascript implementation and test file

texts:
I have been trying to set up a shortcut for jumping between a JavaScript implementation and test. I have particular requirements that are making examples I see harder to apply.

I currently work with many very small javascript projects. The structure of the project normally has its tests in a mirrored directory structure (like so: )

lib/foo.js
lib/someDir/bar.js
test/fooSpec.js
test/someDir/barSpec.js

So the spec files are not in the same directory, as the implementation

I first was looking at examples for ff-find-other-file, but they were for situations when the files were located in the same directories. I'm looking to configure it a little more dynamically (walking up the directory tree until lib, then adding a similar path with test replacing lib)

I also know projectile has a function for doing just this. I use projectile in my setup, but when attempting to use its built in method (C-c p t) I get the message "Project type not supported!". Interestingly enough, projectile is able to list all my test files via (C-c p T).
Is there way of configuring projectile for javascript, so that it knows how to find a corresponding spec file?

I also saw the project toggle test, but am looking for a more automatic solution. It requires a configuration for each project to enable toggling between tests. This is rather inconvenient to me because when working with Node/JS I bounce between many projects (it's very common to divide an application into many very small projects with their own tests). I also often look at external dependencies, and then their specs. More often then not they have this structure. Having to configure toggle test each time I need to use this feature makes it not very useful.


texts:
Is there a function that applies a transformation to a sequence and returns only the non-nil values?
Right now I am using the following (as an example):
(seq-filter #'identity (mapcar (lambda (x)
                                 (when (< x 3) (+ x 5)))
                               '(1 2 3 4 5 6)))

Or through dolist
(defun mapcar-true (func list)
  (let (value)
    (dolist (elt list value)
      (when-let ((trans (funcall func elt)))
        (setq value (append value (list trans)))))))

But I feel there must be a more straightforward way.


texts: Tell packages not to change certain variables

texts:
It seems like some variables that I set at one place in my init file could potentially be modified by other packages that are loaded later.

One place where this has come up for me is the variable yas-snippet-dirs which I set after I load yasnippet, but which is then modified when I load elpy (elpy appends its own snippet directory to the list).

If I want to ensure that all that is contained in yas-snippet-dirs is "~/.emacs.d/snippets", I can simply make sure that I set

(setq yas-snippet-dirs '("~/.emacs.d/snippets"))

after I load elpy.

However, I am wondering if there is a general way to tell packages not to modify a variable. Thank you!


texts: Emacs (semantic) include not working for relative personal includes

texts:
This works:

Running semantic-decoration-include-visit  (opens the included header):

#include <string.h>
#include "/usr/include/gtk-3.0/gtk/gtk.h"

Works well.

This does not:

But if I run it on a relative gtk path:

#include <gtk/gtk.h>

Then I get an error:
semantic-decoration-include-visit: Could not location include gtk/gtk.h

Troubleshooting attempts:

Add include manually:

(semantic-add-system-include "/usr/include/gtk-3.0/gtk")
My own .h file:
If I create a 'hello.h' inside /usr/include, and add the following to some C file, then semantic include visit works on that also:

#include <hello.c>
Sym linking /usr/include/gtk to /usr/include/gtk-3.0/gtk

cd /usr/include
sudo ln -s gtk-3.0/gtk gtk

This actually gets the desired result. (but this has issues as I do Gtk2/Gtk3 development and I'd have to re-link many many many times...

My question being, why doesn't (semantic-add-system-include "/usr/include/gtk-3.0/gtk") make it so that  is properly located?

Please note
- I'm an intern, learning about C development. I might be missing something obvious.
- I'm setting up Emacs for C-Development as per this guide
- I'm on Emacs 25.0.50.4, using build-in CEDET (although tried with latest CEDET, had same error)
- I compile the gtk using pkg-config which appends some flags:

gcc `pkg-config --cflags gtk+-3.0` -o main main.c `pkg-config --libs gtk+-3.0`

SOLUTION
As per comment below, It turns out this is wrong:

(semantic-add-system-include "/usr/include/gtk-3.0/gtk")

This is Correct (minus 'gtk' at end), to match the  pattern:

(semantic-add-system-include "/usr/include/gtk-3.0/)


texts: How to convert a series of lines into a working HTML list?

texts:
Right now, this is a task I find a lot easier in something like gedit, because I can just replace "\n" (the line break) with "</li>\n<li>" and then I have a list.

One of the few little things I don't seem to be able to in Emacs quickly, but something I use a lot.


texts:
I'm trying to run latex on remote host from the local host with tramp.
But it seems that it cannot find the file. To be more specific:

Update

start emacs on localhost:
/ssh:user@remotehost:/tmp/test.tex
compile latex on remote host using C-c C-c
error cannot find the file test.tex
" ! I can't find file `test.tex'."

so I guess it's trying to find /ssh:user@remotehost:/tmp/test.tex but somehow cannot find it. May be it should look for /tmp/test.tex

I've tried knitr as well and found that it tries to execute
/ssh:user@remotehost:foobar.rnw".

I think it should use the /ssh command since the program is running locally but I can't grasp what's happening.

Any help?

Update 2
Works fine when using emacs -Q. See comment below. will keep you posted once I have found what's wrong in the .emacs.

Update 3
The problem does not lies in the .emacs file though. I commented out everything in the .emacs and still got the same issue. I'll continue the investigation. But we are getting there.

Update 4
As suggested in the comments below firing emacs with the -Q option works find. I've got good results even with emacs -q.

Launching emacs -q is supposed to prevent loading the .emacs and the default.el files at startup. I place (setq inhibit-default-init 1) in my .emacs file and commented the rest of the commands. Therefore only the command (setq inhibit-default-init 1) is active in my .emacs file.

I launch emacs without any options and load tramp by hand (require 'tramp) and tried latex again but still no success.

I must be missing something that the -q option does not load but I can't figure it out right now.


texts: Org footnote mark prevents end of sentence from being recognized

texts:
I use a double spaces after full stops to seperate sentences, and
this is respected by M-q.  But with an org footnote mark after
the full stop, the sentence limit is not recognized, and the space
is reduced to a single after M-q.[1] Can I make emacs ignore the
footnote mark?

Footnotes

[1] ...


texts: Is there a mechanism for clearing all breakpoints (remove instrumentation en masse) so as to avoid the need to manually run eval-defun on each instrumented function's definition?


texts: Is there a mode to indent doxygen type comment block with function parameters?

texts:
Consider the following php function:

public function test(array $a, SomeObject $b)
{
  return 0;
}

I would like to automatically generate the following code block:

/**
 * @param  array       $a
 * @param  SomeObject  $b
 * @return int
 */
public function test(array $a, SomeObject $b)
{
  return 0;
}

Also, after modifying the code block, I would like to reformat the code block so that all the types, names and documentation are aligned as columns e.g. if the type of SomeObject changes to SomeOtherObject, the line with the variable $a is also updated with the required spaces:

/**
 * @param  array       _____$a  // 5 spaces added to align $a with $b
 * @param  SomeOtherObject  $b
 * @return int
 */
public function test(array $a, SomeOtherObject $b)
{
  return 0;
}

Is there a minor mode available that does this?

I have looked at: Is there a yasnippet producing a prepopulated doxygen comment?, but it relies on doxymacs which I believe is not maintained anymore.


texts: Overriding configuration folder defaults

texts:
I have a few different configuration files for Gnus. I don't fully understand best practice here, but I'd like to move them out of my user home directory so that my path is ~/.emacs.d/gnus/gnus, ~/.emacs.d/gnus/profile, etc... how do I configure this?

Thanks!


texts: turn coherent string into individual characters

texts:
I have a text with a number of coherent strings, e.g.:

ax923fasd
asidna1
xxa008

Is there a quick way to convert these so that there be a space between each of them, i.e.:

a x 9 2 3 f a s d
a s i d n a 1
x x a 0 0 8


texts:
In the minibuffer, M-p (previous-history-element) is useful, but I find C-r (isearch-backward) to be even better, as it lets me recall a specific history element without going through them one by one.

When using isearch outside of the minibuffer (in the main text area), I can hit M-p at the isearch prompt to run isearch-ring-retreat, which pulls up the previous search string at the prompt. But I might be looking for a prior search string farther back, do it would be nice if I could use isearch to search the search-ring itself.

Is this possible?


texts:
I'd like to add this solarized theme to my spacemacs. How do I do it?

So far I added (load-theme 'solarized t) to my .spacemacs and I included it to my themes list. what I don't know is, where to put the downloaded directory from github.


texts: Dired stopped working (trace with debug-on-error)

texts:
I just installed Emacs on a new laptop, moved over my init files, and all of a sudden Dired+ stopped working.

With:

(setq debug-on-error t)

I see:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  call-process(nil nil nil nil "--dired")
  dired-insert-directory("/Users/loaner/" "-alh" nil nil t)
  dired-readin-insert()
  dired-readin()
  dired-internal-noselect("~/" nil)
  dired-noselect("/Users/loaner/" nil)
  #[513 "\300\301\"!\207" [switch-to-buffer dired-noselect] 6 ("/usr/local/Cellar/emacs/HEAD-e951aa1/share/emacs/25.1.50/lisp/dired.elc" . 22310) (dired-read-dir-and-switches "")]("/Users/loaner/" nil)
  ad-Advice-dired(#[513 "\300\301\"!\207" [switch-to-buffer dired-noselect] 6 ("/usr/local/Cellar/emacs/HEAD-e951aa1/share/emacs/25.1.50/lisp/dired.elc" . 22310) (dired-read-dir-and-switches "")] "/Users/loaner/")
  apply(ad-Advice-dired #[513 "\300\301\"!\207" [switch-to-buffer dired-noselect] 6 ("/usr/local/Cellar/emacs/HEAD-e951aa1/share/emacs/25.1.50/lisp/dired.elc" . 22310) (dired-read-dir-and-switches "")] "/Users/loaner/")
  dired("/Users/loaner/")
  dired-jump(nil nil)
  funcall-interactively(dired-jump nil nil)
  call-interactively(dired-jump nil nil)
  command-execute(dired-jump)

Here's my emacs version:

"GNU Emacs 25.1.50.1 (x86_64-apple-darwin15.6.0, NS appkit-1404.47 Version 10.11.6 (Build 15G31))
 of 2016-09-08"

What could be going on?


texts: Setting minimum time between consecutive reparses by semantic

texts: According to the Semantic docs, semantic-edit.el is the file which handles all incremental parsing. I see frequent incremental parse errors(not information messages, since I have semantic-edits-verbose-flag nil) and would like to set a minimum time interval between consecutive reparses of my cpp files. Other than semantic-edits-verbose-flag, I don't see any defcustom's in semantic-edit.el. Is there a way of customizing this behaviour?


texts: How to specify number of digits to print from a table using babel?

texts:
New to org/babel, so forgive me if this doesn't make sense. I have some code (in R) that produces a table. I also specify (in R) the number of digits that I want with options(digits = 2). When I run the code to produce the table in R, everything works well. However, when I do C-c C-c on the source block, it inserts results with many digits. Why is this and how can I fix it?

#+BEGIN_SRC R :exports results :colnames yes
  options(digits = 2)
  thedata <- data.frame(
    a = runif(100),
    b = runif(100))

  library(dplyr)

  thedata %>%
    summarize(meana = mean(a), meanb = mean(b))

#+END_SRC


texts:
I tried to use a following

(global-set-key (kbd "C-[") nil)

but it also disables M-x. How can I properly disable it?