texts: Inside isearch how to get mouse-2 clicked inside a frame to paste into echoarea?

texts:
When I search with C-s, I can paste a search term (copied outside of emacs frame) with either M-y or mouse-2 click focused inside echoarea. In xemacs it is enough to mouse-2 click inside the main buffer to get the yank happen inside the echoarea. In emacs I have to mouse-2 click inside the tiny echoarea for this to work.

Is there a way to configure emacs to get mouse-2 click in the main frame to replicate M-y-functionality when isearch (C-s) is activated?

The only related custom configuration I have is:

;; paste where the mouse clicks
(setq mouse-yank-at-point nil)

but it doesn't seem to have any impact on what I'm trying to accomplish here.

I suppose I need to get mouse-2 to be re-bound to isearch-yank-kill when in isearch, but I don't know how to do that.

And I read the explanation about echoarea not being a minibuffer, but I don't have enough emacs knowledge to do anything useful with it.


texts: Is there more than mode line (and header line)?

texts: I was wondering if it is possible (with any reasonable amount of work) to add another mode line (i know there is the configurable header line), maybe right above or below the new mode line or even one under the mini buffer for the whole frame (like if i was running Emacs in tmux or GNUScreen).


texts: I often have a situation where I need to apply text around a region. For HTML and simple cases there are libraries for this already. But what about the general case? I'd like to be asked what I'm gonna insert beginning and end of the region.


texts: Org-mode: How to disable automatic doc-view on emacs-25

texts:
On

  GNU Emacs 25.1.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8) of 2016-04-25
  Org-mode version 8.2.10 (release_8.2.10 @ /usr/share/emacs/25.1.50/lisp/org/)

opening a pdf file link (f.ex. [[./9.pdf]]) via C-c C-o  automatically opens that file in docview-mode.

How can this be disabled? (Or is this a bug? Where to submit?)


texts:
I try to use counsel-ag to grep through all files in a directory for a string. Basically, I thought this is what it was made for. I have ag 2.2.0 installed via macports on OS X 10.10.5 and it works fine in shell mode.

If I am in the same directory an invoke M-x counsel-ag I get the ag prompt but if I type a string I get no matches but the message No matches found. I don't see any message or error. Is there any way to check what ag is doing and why ivy is not displaying the candidates like it does in other cases?


texts:
I was wondering how I can make Flycheck check the modules imported in a python file - to check if function used from a module is correct or not. Is there another mode which is able to do that for me?

For example:

import utils
str = utils.chk("is this right?")

How can I make flycheck(or any other checker) check if the imported file utils contains a function called chk?

I'm currently using python-mode on Emacs 24.4 with pylint and flake8 as checkers for Flycheck on Windows 8.1 64 bit. I also have semantic installed.

Can that help me in anyway?


texts:
To match with multiple line regexp, I can use \\(.*\\|\n\\), but I think it should be [.*\\|\n\\] which actually doesn't work as expected.

#+NAME: exam1
#+BEGIN_SRC elisp :results output
(let ((str "")
      (start 0))
  (setq str "this is\na test and this is a test")
  (while (string-match "this is\\(.*\\|\n\\)a test" str start)
    (setq start (match-end 0))
    (print (match-string 0 str))))

#+END_SRC

#+RESULTS:
:
: "this is
: a test"
:
: "this is a test"

#+NAME: exam2
#+BEGIN_SRC elisp :results output
(let ((str "")
      (start 0))
  (setq str "this is\na test and this is a test")
  (while (string-match "this is[.*\\|\n]a test" str start)
    (setq start (match-end 0))
    (print (match-string 0 str))))

#+END_SRC

#+RESULTS: exam2
:
: "this is
: a test"

What's the reason exam1 works but exam2 doesn't?


texts:
I'm on Ubuntu 20.04 (GNU Emacs 26.3), and I would like to swap the Hyper and Ctrl keys. Basically, I have a keyboard map set up (with xkb) that suits my needs, except that in emacs (and only in emacs), I would like the Hyper and Ctrl keys to be swapped.
Based on this
How to have Emacs treat left Ctrl as Hyper?
I've tried adding this
(setq x-ctrl-keysym 'hyper)
(setq x-hyper-keysym 'ctrl)

to .emacs. However, it doesn't have the desired effect. (Incidentally, the variable ns-control-modifier doesn't seem to be defined.)
Ideally, I would like to only swap these keys in the Emacs GUI, but not in the Gnome Terminal (when invoked with emacs -nw).
What am I doing wrong?


texts: How to edit crontab directly within emacs when I already have emacs open?

texts:
I know I can set the EDITOR variable and edit my crontab with emacs but that requires starting the process from a shell with

$ crontab -e

My question is how can I directly modify my crontab if I'm inside of emacs already?  I tried running starting up eshell and running crontab -e from there but the terminal complains:

$ crontab -e
emacs: Terminal type "dumb" is not powerful enough to run Emacs.
It lacks the ability to position the cursor.
If that is not the actual type of terminal you have,
use the Bourne shell command `TERM=... export TERM' (C-shell:
`setenv TERM ...') to specify the correct type.  It may be necessary
to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.
/usr/bin/crontab: no changes made to crontab

If using crontab in eshell worked that would be a step in the right direction but it's still not exactly what I was hoping for.  Attempts to execute crontab -e from within an M-x term buffer in emacs fail as well (at least on OpenBSD 5.6 with emacs 24.3.1).  In the ideal case, there would be a crontab mode that allowed me to

M-x crontab

that fires up a major mode and allowed me to do the usual stuff I do at the command line with crontab and have it all bound to keys.  I figured for sure there'd be a mode or something for this but I haven't had much luck locating one.


texts: Drawing a horizontal line to a specific column number in ESS

texts:
I want to be able to execute a command in ESS to quickly add a horizontal line (using dashes) out to column 80.

This will be used for header comments. I'd like to be able to re-execute the command to redraw the line if I change the header comment as edits will change the end point of the line from column 80. E.g.

## Title here -------------------------

## Edited title here -------------------------

If I execute the command on the second one, it'll shorten it to the same length as the first (imagining that it ends at column 80).


texts:
Windows 10, Emacs 25.1, Magit

I change my simple.xml

I create 2 indents of text (by space key) and add 3 new lines.

Here it's look like in SmartGit:

It's look very nice. I immediately understand where is simple indent and where was add new text.

Now same different on Magit.

As you can see no different between simple indent and new text.

The quesion is: Is it possible to show different the indent and new text?
Like on SmartGit.

Thanks.


texts:
When publishing it's possible to get a list of filetags for an org note by doing something like (org-export-data (plist-get info :filetags) info) in publish.el and loop over them to create markup. I use org-roam and was wondering if there is a way to do something similar with the +#roam_tags: property. Just switching :filetags for :roam_tags doesn't work - no error, it's just empty I think. Could anyone offer some advice on how I might approach this?
FYI I asked this question on the org-mode sub reddit as well but posting here as well.


texts: I am trying to create a github repo of my .emacs.d/ for a group of students. Basically, I have two choices: A) simply take a "git snapshot" of my entire ~/.emacs.d/ including all the packages in elpa/, or, B) figure out how to just have an init.el in .emacs.d/ that, upon the first Emacs start, will go out and get all the packages . . . and the next time know not to because they're already there. How can this be done?


texts: python-send-string echo begins with print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False) import codecs, os;__pyfile

texts:
[OS X 11.6, Emacs 25.1, but also Emacs 24]

In python-mode (from python.el), any of the commands that use python-send-string (e.g., python-send-region) print a mess like this at the prompt:

print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
import codecs, os;__pyfile = codecs.open('''/var/folders/9l/wcyszrfx3kg7s1sv0bp68_740000j7/T/py201356GE''', encoding='''utf-8''');__code = __pyfile.read().encode('''utf-8''');__pyfile.close();os.remove('''/var/folders/9l/wcyszrfx3kg7s1sv0bp68_740000j7/T/py201356GE''');exec(compile(__code, '''PATH-TO-THE--PYTHONFILE-I-AM-EDITING''', 'exec'));

What is this about and how can I stop it?


texts: How do I open a window that will behave like a *Help* window?

texts:
*Help* windows appear to have a special behavior. For example, if I open a help window using C-h f butterfly, the window will open in a separate half-page buffer. If I use the help feature again C-h f tetris, the same help-mode buffer will be reused to display the documentation for tetris. Is there a way to replicate this behavior for other windows? For example, I would like EWW windows to have a behavior similar to *Help*.
So far, I have this:
;; Reuse old *eww* windows.
;; Otherwise, pop up a new window.
(setq-default display-buffer-alist
              (cons '("^\\*\\eww\\*$"
                      (display-buffer-reuse-window
                       display-buffer-pop-up-window))
                     display-buffer-alist))

Is this method correct? I feel uneasy about the use of the use of regex to drive the behavior. Perhaps there is some other way of achieving the same result (e.g. using advice-add)?


texts: Auto-indenting C code with tabs for blocks and spaces for other wrapping?

texts:
Is it possible to setup emacs to indent C code, with tabs for blocks { ... } and spaces with other wrapping (argument, for example)?

Eg:

<-->if (foo) {
<--><-->function(a, b,
<--><-->.........c, d);
<-->}

Currently emacs uses tabs with spaces for padding.

<-->if (foo) {
<--><-->function(a, b,
<--><--><--><-->.c, d);
<-->}

(where <--> is for tabs and . for spaces).

QtCreator has the option to: Align continuation lines --> with spaces.

Is this possible in emacs?

Update, I wasn't aware at time of asking but this is sometimes called "smart-tabs".


texts:
I remember one thing I liked about Windows 3 in the early 90s was that it was possible to dial my desktop phone (via a modem) from the contacts.  I am all-linux now, and spend most of my day in emacs and have a Cisco SIP phone on my desk at work.  I have always wanted to be able to integrate phone calls in particular into my emacs (and org-mode) workflow.
One step in that direction would be to be able to dial the phone from bbdb or some other emacs-based facility.
Later, getting an org-capture to come up on incoming calls would be great, but one step at a time.
Has anyone heard of any facilities for doing this?  It seems like a natural for emacs, but I am coming up empty in searches.


texts:
I'm on Windows 7 using emacs version GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570.

When I create tables with org-mode, I end up having something like this.
.

I searched and found the following questions:

org mode table formatting issue - The answer to this question was to use a monospaced (non-propotional font). In my case I'm using consolas which is a monospace font. So the answer does not apply.
org-mode table layout - The answer to this question is also to use a monospaced font - So does not apply for my case.
org-mode table editor behaves strangely - This question remains unanswered.

I don't remember from when this thing had broken.  I suspected that the contents (some tag settings etc) might be causing this erratic behaviour and created a new test.org file. It was no different as shown below.
.

Note: Are there any updates to org-mode which will fix this issue? BTW, my org-version is
Org mode version 9.1.5 (9.1.5-1-gb3ddb0-elpaplus @ c:/Users/path/to/Roaming/.emacs.d/elpa/org-plus-contrib-20171225/) and I have not been able to update my org-plus-contrib package since Jan 2018.


texts: access remote emacs server via ssh crashed

texts:
I run an emacs server on a remote server.

emacs --daemon

and I access this server with

ssh user@server -Y 'emacsclient -c &'

everything works fine until I close the client.

SSH session doesn't end,once I kill the SSH session,emacs server process die...

Is there anyway to make emacs server process immortal?

The server is  Raspbian on raspberrypi.
Emacs:

GNU Emacs 24.5.2

with configure option --with-x-toolkit=lucid

Thanks for your help.


texts: How can I make a custom font-lock keyword regex?

texts:
I'm new to emacs (spacemacs) and have been trying to get org-mode to highlight quoted strings "like this" and quoted strings 'like this'. I followed the example here, and came up with this:

  ;; Fancy custom syntax highlighting of quoted strings!
  (add-hook 'org-mode-hook
            (lambda ()
              (font-lock-add-keywords nil '(("\".*?\"" 1 font-lock-constant-face t)
                                            ("'.*?'" 1 font-lock-doc-face t)))))

This seems to break syntax highlighting all together, and doesn't succeed in higlighting my quoted strings at all. What am I doing wrong?


texts: How to use a github package instead of the built-in version?

texts:
I tried to install verilog-mode from github to replace the version built in to Emacs.

I'm using spacemacs.  I created a layer for verilog and added verilog-mode in packages.el:

(verilog-mode :location (recipe
                         :fetcher github
                         :repo "veripool/verilog-mode"))

I have enabled the verilog layer but the verilog-mode is still the built-in version.

How could I make spacemacs use the version from Github?


texts: Agenda view for all tasks with a project tag and at a certain level

texts:
Projects with multiple subprojects are tagged with PROJ, e.g.

** PROJ Master Project
*** PROJ Subproject 1
**** Task 1a
*** PROJ Subproject 2
**** Task 2a

Currently, I have a custom agenda view that will simply display all items with a PROJ tag:

("p" "all projects" todo "PROJ")

How do I modify it so that only master projects (which are all level 2 headings) are displayed?
How do I modify it so that only subprojects (level 3 or more) are displayed?


texts: "Run all code blocks above this point" in org-babel?

texts: I know you can use org-babel-execute-src-block (C-c C-c) to execute individual code blocks, but is there something akin to "Run all chunks above" that RStudio has for Rmarkdown files?


texts: Shutting down computer from emacs killing gracefully emacs itself

texts:
I am using EXWM on Arch as my windows manager. Substantially my startx launches
exec dbus-launch --exit-with-session emacs so I am running only emacs and living inside it. I would like to define a function shutdown to properly handle the shutdown of my computer terminating
every process in a graceful way. This function has to:

Execute (save-some-buffers)
Check in every frame if there are running processes that I've personally started
Ask if I want to continue
Send SIGHUP to each of these process
Check if those process have quit, if not send them a stronger signal
Exit emacs
Shutdown the computer

I want to kill processes with SIGHUP, which is the signal (kill-buffer)
sends, because using (save-buffer-kill-emacs) kills them too brutally.
For example Chromium always asks me if I want to restore previous session,
whereas killing Chromium with SIGHUP makes it restore the correct session the
next time I start it.
I want to properly quit emacs before shutting down the computer because if I use (shell-command "shutdown now") it prevents emacs to correctly run every exit-hook (for
example it doesn't remove the desktop-file.lock of (desktop-save-mode).
My workaround for this problem is to schedule a shutdown 3 seconds in the
future, so emacs can properly quit, but it is not very elegant.

How can I do?


texts: How to syntax highlight #+BEGIN_EXPORT HTML environment in org-mode buffer?

texts:
Is it possible to get syntax highlight for HTML code within a #+BEGIN_EXPORT HTML environment block in org-mode?

I know it is possible to highlight HTML within a #+BEGIN_SRC block using ob-browser. Is there a way to "extend" such highlighting to other blocks as well?


texts: How to get `window-end` when the window scrolls?

texts:
From the doc of window-end function:

  Even if update is non-nil, window-end does not attempt to scroll the display if point has moved off the screen, the way real redisplay would do. It does  not alter the window-start value. In effect, it reports where the displayed  text will end if scrolling is not required.

Since the window-end only reports where the displayed text will end if scrolling is not required, what should I do to get the correct window-end after I call next-line at the end of the current window, which causes the window to scroll by one line? Do I need something like forcing the window to redisplay before calling window-end function?


texts: How can I generate a link back to a specific point in an org mode file that I can paste into an external application?

texts:
I am working on a Mac. I want to capture a link to a specific note within an org document that I can paste into another external application. In this case, I am using 'Things' (an external Mac OS X specific app) as my to-do list app, but capturing detailed notes in an org mode file. I would like Emacs to construct a URL that when clicked in 'Things' will take me to the precise note in Emacs.

Is this possible?

I have tried generating a link as per this question.

For example

[[file:~/Library/Mobile%20Documents/com~apple~CloudDocs/00%20meta/00.01%20deft/agenda.org::*my%20test%20note][my test note]]

And then manually editing the link to the following

file:///~/Library/Mobile%20Documents/com~apple~CloudDocs/00%20meta/00.01%20deft/agenda.org::*my%20test%20note

... but with no success. I suspect I will need to use another OS X scripting somehow, but I would like to know if anyone has some advice?


texts: comint-input-ring-size ignored in shell-mode

texts: I am trying to change comint-input-ring-size in shell mode in Emacs. The comint-input-file-name is correctly set to ~/.bash_history file which is a big file (around 5000 commands). However, if I set the comint-input-ring-size to 2000, I don't seem to be able to recall really old commands (which could be like 1000 commands away) with comint-history-isearch-backward.


texts: Emacs directory is not readable on Ubuntu

texts:
When I start Emacs 25 on Ubuntu, I get this message:

cannot open load file permission non accordée , mode-util

With emacs25 -debug I've got:

Warning: Lisp directory '/usr/share/emacs/25.2/lisp': Permission non accordée
Warning: Could not find simple.el or simple.elc


texts: Ignoring line when exporting with latex backend

texts:
I have an org file that I want to export to both latex and html.

The file contains a bibliography, so I want to make sure that my org-exporter processes it correctly for both export backends.

For Latex things are easy, all I have to do is add the following:

#+BEGIN_EXPORT latex
\printbibliography
#+END_EXPORT

For html, things are also simple. All I have to do is add the following:

bibliography:~/org/library.bib

The problem is that, when I export to latex, I get \bibliography{../../org/library} written at the end of the file, which is unnecessary.

What I want, thus, is to wrap the call to bibliography within an IGNORE_LATEX block. How can I achieve that?

# # What I would like to have:

#+IGNORE_LATEX
bibliography:~/org/library.bib
#+END_IGNORE


texts:
I would like to use Meta + Tab or Meta + ; keybindings in emacs to correct a spelling instead of using the ispells default one. Please note that I am open emacs in terminal.

I have tried following but it did not help. Is there any way to fix it?

(global-set-key (kbd "<M-tab>") 'helm-flyspell-correct)
(global-set-key (kbd "<M-;>") 'helm-flyspell-correct)


texts:
I am trying to write a small function where I extract two sub-strings from a cite-key, e.g. cite:rammstein2017paris.
(defun citekey-get-author-and-year ()
          "Get the _author_ and _YEAR_ from a cite:authorYEARtitle key."
          (interactive) ; allow this to be user-callable
          (let
              ((regexp ":\(.*\)\([0-9]*\)[a-z]") ; the regex to parse
               author
               year
               (citekey (buffer-substring (line-beginning-position) (line-end-position)))))

          (when (string-match 'regexp 'citekey)
            (setq author (match-string 1 string)
                  year (match-string 2 string)))
          )

The above code gives me a "Wrong type argument: stringp, regexp" error. I came up with it after reading the manual. If I do it without the 'regexp 'citekey line, I get the error "Symbols value as a variable is void: regexp".
Based on the error description, the function doesn't know what regexp and citekey are, but why?

I tried debugging it with debug-on-entry, as described here. Unfortunately I did not really see or understand where the error is.
My code is inspired by the string-match documentation, and it confuses me very much that it doesn't work.

Demos
#+BEGIN_SRC elisp
(let ((string "Today is <2018-11-07>."))
  (when (string-match "<\\([-0-9]+\\)>" string)
    (match-string 1 string)))
#+END_SRC

When searching online for the error code, there are a bunch of results, but as the error seems very generic I didn't find anything that solved my problem.

I believe that the mistake is really basic and obvious, it is just that my understanding of elisp is lacking, as this is the first function I write.


texts: C-x C-f, Cannot complete file name for desktop folders

texts:
I am new to Emacs. I am trying to access a file in the "Emacs" folder on my desktop.
I run the C-x C-f command, then type ~/Desktop/Em.
I then hit TAB, but there's no completion. Emacs says [No Match].
Could someone please explain why the file name doesn't complete? I am working on Mac OS 10.15.6.


texts: How to set tags-table-list as a per-directory local variable?

texts:
I have two tags tables that I would like to be searched/visited when I'm working on one of my R packages. I am able to set them globally with the following code in my .emacs config file:

(setq tags-table-list '("/R/Source/R-devel-SVN/TAGS" "/gitRepos/DADS/TAGS"))

But I cannot for the life of me figure out how to get the equivalent effect by directives placed in the project's .dir-locals.el. I've tried each the following (one at a time, of course), and many others, without success:

(nil (tags-table-list ("/R/Source/R-devel-SVN/" "/gitRepos/DADS/"))
((nil (tags-table-list ("/R/Source/R-devel-SVN/" "/gitRepos/DADS/")))
(nil (tags-table-list ("/R/Source/R-devel-SVN/TAGS" "/gitRepos/DADS/TAGS"))
(nil (tags-table-list '("/R/Source/R-devel-SVN/" "/gitRepos/DADS/"))
(nil (tags-table-list . ('("/R/Source/R-devel-SVN/" "/gitRepos/DADS/"))))
(nil . ((tags-table-list . (("/R/Source/R-devel-SVN/" "/gitRepos/DADS/")))))

Perhaps relevant is that setting the following variable does work as expected, which makes me suspect that I'm just missing the right incantation for setting tags-table-list -- not that the mechanism underlying .dir-locals.el is broken:

((nil (tags-file-name . "/gitRepos/DADS/TAGS")))

How can I set the value of tags-table-list using the notation required by .dir-locals.el?


texts: Rebind backspace to C-d for deleting char backwards

texts:
I want to delete char backwards using C-d, not the backspace key. I could do it like that:

(global-set-key (kbd "\C-d") 'delete-backward-char)

However, I have noticed that in fact backspace points to different functions in different major modes. For example, in lisp-mode it is backward-delete-char-untabify function, in C mode c-electric-backspace, in Help mode it is cua-scroll-down. Is it possible to emulate backspace behaviour with C-d without remapping it for every major mode separately?
I also tried this:

 (global-set-key (kbd "\C-d") (kbd "<DEL>"))

But it obviously turns every C-d key into <DEL>, so keybindings such C-c C-d stop working, making this not a suitable solution either.

P.S. I am slightly suprised that (as it seems after some googling) not so many people rebind backspace key. You have to take away your hand from home  row every time you need to delete a character! This is so uncomfortable...how do you, Emacs people, delete characters?


texts:
I often use the web service Kobra.io, in which we can edit a specific file with some people together at the same time.

Is there such a package on Emacs?

I'd like to edit a specific lisp code at the same time with some people.

If I change some parts in the code, the other people can see the change at the same time.

Could you tell me how to implement this function?

I'd appreciate your help.


texts: How to Detect Current Workgroup in Workgroups2?

texts:
I was looking through the code and found wg-current-workgroup-p ("Return t when WORKGROUP is the current workgroup, nil otherwise.") which seemed to be what I want, but if the current workgroup is called "main" and I do

(wg-current-workgroup-p "main")

I get nil. I'm not sure if I'm doing something wrong or misunderstanding the function. I couldn't find a way to get the current workgroup name either. I'd also like to be able to do this with the workgroup index as well.


texts:
I successfully attach to my java app with emacs & gud, but gud-break doesn't work as expected: it runs only:

stop at :48

if the line number is 48. So even the class name is missing and the command fails. If I manually type in the gud prompt stop at <class>:48 that also doesn't work, I must type in the full package name: stop at com.app.Class:48.

How can I make gud run the correct command? I found about gud-def but I am baffled that this is not done properly out of the box and secondly, gud-def allows to insert the file name (class name) but I have no idea how I would insert the package name?


texts: How to see the source code of a built-in function?

texts:
I want to see the source code of the function other-buffer.
When I use M-x- xref-find-definitions, Emacs shows:visit tags table (default TAGS). Then I press RET, Emacs shows:File /TAGS does not exist.
What should I do if I want to see the source code?
I'm reading an introduction book and I got stuck with the expression:
(other-buffer (current-buffer) t)
This is why I want to see the source code. And this is my second day learning Emacs.
System: macOS


texts: How do I add autocompletion for a new language?

texts:
I have written code that returns lists of symbols representing modules and exported functions of a programming language. How do I integrate it with some autocompletion in Emacs?

I looked at company and completion-at-point-functions. I managed to run simple example successfully, and then I realised that all these examples use a predefined list of completion candidates.

Last code sample on the following page is a good example
http://sixty-north.com/blog/writing-the-simplest-emacs-company-mode-backend

I do not know what the completion candidates will be at this point. How do I create a dynamic list of candidates generated when I run M-x company-sample-backend?

Actually, the example at sixty-north.com can be easily modified to use dynamic completion. The problem lies elsewhere.

Replacing constant

(defconst sample-completions
  '("alan" "john" "ada" "don"))

with a function returning strings with random content and calling that function at the bottom of the backend function works.

In the end I have settled on following code:

(require 'company)

(defun company-lfe-backend (command &optional arg &rest ignored)
  (interactive (list 'interactive))

  (case command
    (interactive (company-begin-backend 'company-lfe-backend))
    ;; unfinished code related to major modes
    (prefix (and (or t
                     (eq major-mode 'fundamental-mode))
                 (company-grab-symbol)))
    (candidates
     (-map 'symbol-name
           (-flatten
            ;; following function returns the structure containing possible
            ;; auto completions
            (lfedoc-sexp-autocompletion-at-point))))))

(add-to-list 'company-backends 'company-lfe-backend)


texts: parse-time-string: doesn't accept ISO 8601 string contrary to what the documentation claim

texts:
The documentation suggests that parse-time-string can be fed ISO 8601 string, such as "1998-09-12T12:21:54-0200". However, (parse-time-string "1998-09-12T12:21:54-0200") returns (nil nil nil nil nil nil nil nil nil).

— Function: parse-time-string string
This function parses the time-string string into a list of the following form:
(sec min hour day mon year dow dst tz)
The format of this list is the same as what decode-time accepts (see Time Conversion), and is described in more detail there. Any element that cannot be determined from the input will be set to nil. The argument string should resemble an RFC 822 (or later) or ISO 8601 string, like “Fri, 25 Mar 2016 16:24:56 +0100” or “1998-09-12T12:21:54-0200”, but this function will attempt to parse less well-formed time strings as well.

Related question: Parsing formatted time string (inverse of format-time-string)
EDIT:
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: Automatically scroll *compilation* window, beside source-buffer window

texts:
I edit C in two windows side-by-side, source on left, compilation results on right.  I have F5 bound to recompile.

Currently I have to do:

F5 to run make,
Move to *compilation* buffer in right window,
Scroll down to end of buffer,
Move back to left window to continue to edit.

I would prefer to have all the above happen automatically by pressing [F5], without leaving the left window, so I can see the results, and continue to work.

I write C, not Lisp! ;^)


texts: Don't let the daemon frame make a file visible

texts:
I normally start Emacs in daemon mode and reload my last session with the desktop package. This causes whichever file desktop-read open last to remain visited in a buffer which is selected in the window which is selected in the “dummy” frame created for the daemon. As far as Emacs is concerned, this file is visible in a frame. But as far as I'm concerned, it's not.

I could fix all my code to skip the daemon's frame… if I could identify it. But it would be easier to just make the daemon frame visit a buffer whose visibility I don't particularly care about, like *Messages* or  *Minibuf-0.

What can I put in my init file to

identify whether Emacs was started in daemon mode;
identify the frame corresponding to the daemon;
make this frame visit a harmless buffer, or kill it (what can go wrong if I do that), or otherwise not let it continue “showing” some interesting buffer?

Test by running emacs --daemon -q -l foo.emacs where foo.emacs is

;; -*-emacs-lisp-*-
(setq server-name "foo")
;; Simulate loading a desktop session
(find-file "~/.emacs")
;; Test code
(defun foo ()
  (interactive)
  (let* ((buffer (find-buffer-visiting "~/.emacs"))
         (window (get-buffer-window buffer t)))
    (if (interactive-p) (message "%S" window) window)))
;; Here goes the code I want

then I want emacsclient -s foo -e '(foo)' to return nil.


texts: I'm curious about Doxygen, how do you guys manage documentation in C/C++ projects on emacs? I didn't find a good package that does it consistently. So far I did use gendoxy and doxymacs. I had problems with gendoxy related to function commentaries, there is a bug when the function returns different of void and there is some parameter, the last parameter is seen as output. After that, I did try doxymacs and it worked well, but the problem is that I don't know how to customize somethings, for example in function commentaries I would like to use "@brief" above the parameters, there isn't this tagging.


texts:
When I navigate through `describe-function' to the source of a function, very often the buffer is visiting a file with a ".el.gz" extension.

Often these files are multi-thousand lines, so a list of functions and variables would be quite useful.  And speedbar-mode provides exactly the sort of listing that I'm thinking about.

However, speedbar-mode doesn't work in these buffers.  Is there an easy way to get speedbar-mode to work in these buffers?


texts: magit - triangle workflow with branches in fork

texts:
I am using a triangle workflow. Upstream is called upstream and my forked repository is called fork.

I want to have multiple branches and each of those branches should exist both locally as well as in my forked remote repository. My plan is to synchronize from my fork into a local feature branch, work on it some, and push it to the corresponding branch on my forked repository again.

When I create the branches in fork (using Github's UI), I can't seem to get my local repository to pull that new branch.

I've tried pulling from fork as well as upstream, but neither works. I can only think I'm doing something stupid - anyone care to tell me what?


texts: LSP does not see root directory in doom emacs

texts:
I am trying desperately to import:
from src.test2 import test
but it does not work, though i have a /src/test2/test.py
file.
I have tried so much (adding extra paths, adding pythonpath, adding init.py in each directory), but nothing worked. The file test cannot be imported from src/Main.py in that manner described above. Somehow lsp does not know, that i want to import from src.


texts: Reference cells of other tables in org-mode table

texts:
I have a long document with 10 tables, and I want to to have a summary table at the end of the document. Something like that:

tab1

| Nº | Description | Value |
+----+-------------+-------+
|...                       |
+----+-------------+-------+
|    | TOTAL       |   XXX |

...

tab10

| Nº | Description | Value |
+----+-------------+-------+
|...                       |
+----+-------------+-------+
|    | TOTAL       |   XXX |

tab-summary

| Description      | Value |
+------------------+-------|
| Total of Table 1 |   XXX |
| Total of Table 2 |   XXX |
| ...                      |
+------------------+-------|
| Grand Total      |   XXX |

Is there a way to reference the total of each table, instead of manually coping the results in the summary table?


texts:
I got such a error report  but confused with 'position 2767`

Debugger entered--Lisp error: (void-variable |)
  eval-buffer(#<buffer  *load*-518868> nil "/home/me/.emacs.d/lisp/init-company.el" nil t)  ; Reading at buffer position 2
  load-with-code-conversion("/home/me/.emacs.d/lisp/init-company.el" "/home/me/.emacs.d/lisp/init-company.el" nil t)
  #<subr require>(init-company)
  apply(#<subr require> init-company nil)
  (prog1 (apply orig feature args) (if (and (not already-loaded) (memq feature features)) (progn (let ((time (sanityinc/time-subtract-millis (current-time) require-start-time))) (add-to-list 'sanityinc/require-times (list feature require-start-time time) t)))))
  (let* ((already-loaded (memq feature features)) (require-start-time (and (not already-loaded) (current-time)))) (prog1 (apply orig feature args) (if (and (not already-loaded) (memq feature features)) (progn (let ((time (sanityinc/time-subtract-millis (current-time) require-start-time))) (add-to-list 'sanityinc/require-times (list feature require-start-time time) t))))))
  sanityinc/require-times-wrapper(#<subr require> init-company)
  apply(sanityinc/require-times-wrapper #<subr require> init-company)
  require(init-company)
  eval-buffer(#<buffer  *load*> nil "/home/me/.emacs.d/init.el" nil t)  ; Reading at buffer position 2767
  load-with-code-conversion("/home/me/.emacs.d/init.el" "/home/me/.emacs.d/init.el" t t)
  load("/home/me/.emacs.d/init" t t)
  #f(compiled-function () #<bytecode 0x1dda69>)()
  command-line()
  normal-top-level()

What does the  Reading at buffer position 2, and  Reading at buffer position 2767,

It seems not helpful because the max-line number is less than 500.


texts: pressing return in paragraph-indent-text-mode deletes whitespace indenting beginning of paragraph

texts:
I'm currently using emacs 25.3 on Mac OSX installed using Homebrew, and without any modifications in my .emacs file or anywhere else. I think I may be fundamentally misunderstanding what paragraph-indent-text-mode is for. I enter paragraph-indent-text-mode using M-x. Then, I type four spaces (which from the documentation I'm assuming is supposed to indicate that I'm beginning a paragraph), then a few sentences that visually wraps around several times (with a \ (backslash) character). Then, I use RET to begin a new paragraph.

Strangely, the whitespace at the beginning of the text that I just typed gets deleted automatically.

Now I repeat a few more times, and each time I use RET, the whitespace that I inserted previously gets deleted automatically, which I find to be extremely odd. I'm not putting any blank lines between paragraphs, because I'm assuming that's the entire point of paragraph-indent-text-mode: that you don't need to. However, because of this automatic deletion, all the text that I have typed now belongs to a single paragraph.

There must be something that I am completely missing here; how am I supposed to be using this mode to write paragraphs, if the very action that I'm supposed to be taking to indicate that I'm starting a new paragraph always gets deleted every time I use RET?


texts: Marking a TODO item DONE with or without a timestamp

texts:
it was established in a previous post that (setq org-log-done 'time) should be substituted for (setq org-log-done t) in the init file, so that C-c C-t would close a TODO with a timestamp. I would like to be able to choose between closing with or without a timestamp. How, please?

This is the current setup:

(require 'package)
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)
(require 'org)
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
  ;;(setq org-log-done t)
(setq org-log-done 'time)
;; Conventional selection/deletion
(setq org-support-shift-select t)


texts: Broken hightlighting code src block in org-mode 9.4 and org-babel

texts:
I found that org-mode org-babel hightlighting is broken by nix line of script.
How to reproduce :
a) create a nix block
#+name: home-manager-section
#+begin_src nix
home.file."nixpkgs".source = inputs.nixpkgs;
#end_src

b) add this line
#+name: home-manager-section
#+begin_src nix
{
  home.file."nixpkgs".source = inputs.nixpkgs;
  systemd.user.sessionVariables.NIX_PATH = lib.mkForce "nixpkgs=$HOME/nixpkgs\${NIX_PATH:+:}$NIX_PATH";
#+end_src

Is there a way to encapsulate string which broke hightlighting or this is a bug ?


texts: How to shift vertical column of windows left and right in a frame?

texts:
Q: how can I shift a window column left and right in a frame?

I use a single frame with multiple windows side-by-side.  Usually each window takes up the full height of the frame, but occasionally, one of those windows will be split vertically (eg, when reading mail, the headers above and the message body below).

Now: I often swap buffers from window to window, which is easy enough to do.  But: the vertically-split windows almost always contain buffers that logically go together (as in the email example), and I want to move their columns together, rather than just one buffer at a time.  In other words, in involves manipulating the window layout itself, rather than just which buffer is visible in which window.

Visual example: I'd like to be able to move the column containing windows (A) and (D) from the left-most column to the middle column:

+-------+-------+-------+    +-------+-------+-------+
|       |       |       |    |       |       |       |
|  (A)  |       |       |    |       |  (A)  |       |
|       |  (B)  |  (C)  | => |  (B)  |       |  (C)  |
+-------+       |       |    |       +-------+       |
|  (D)  |       |       |    |       |  (D)  |       |
+-------+-------+-------+    +-------+-------+-------+

How can one accomplish this cleanly?  I say "cleanly" because I've hacked together something that is pretty slow, pretty ugly, and pretty convoluted -- strong suggesting that I'm Doing It Wrong™.


texts: How to use the highlight-chars.el package?

texts:
How can I use the highlight-chars.el package mentioned here (and here's its code) to highlight custom characters?

Specifically, I'd like to highlight the unicode directional formatting characters for embedding right-to-left languages in a predominantly left-to-right text and vice versa.

Before you say "But what do you need the directional formatting characters for? The newer versions of Emacs handle bidirectional text natively.", I'd like to remind you that there is a reason why the unicode algorithm allows for explicit bidirectional markers.


texts: How can I predefine helm search patterns?

texts:
I have some commonly used helm regexp search patterns, can I save them for quick reuse?

Maybe bind them to shortcuts?


texts: Set buffer-local variable in buffer other than the current one?

texts:
I'm in buffer A and I want to set a buffer-local variable in buffer B. I'm currently doing:

(with-current-buffer B
  (setq-local some-var 'some-val))

but is there a way to do this without changing the current buffer, i.e. can I explicitly specify the buffer whose value I want to change?


texts:
I can read a string in the minibuffer, with completion, using completing-read:

(completing-read "Chose one: " '("Han Solo" "Chewbacca" "Lando Calrissian"))

I would like to use my own completion function, which searches some of my files, instead of a list. The Programmed Completion page of the manual details just how to do that, but does not give any example.

The best I could achieve is this :

(defun completion-function (input-string predicate flag)
  (if flag
      '("Chewbacca" "C3-PO" "Calrissian")
  "C3-PO"))

(completing-read "Chose one: " 'completion-function)

However, this does not behave at all like I would :

it suggests only one choice on the first TAB press (I would like all of them to be shown, as what shows a second TAB push)
it does not filter the results on the input string (do I need to implement that as well?)

Can someone give a better, more complete example?


texts: Trouble with link to position in current file when capturing

texts:
So I'm fairly competent with org-mode, and I make constant use of custom templates. I'm just now exploring the idea of integrating capture into my programming work flow so I can whip up skeletons quickly and worry about details later. That being said, I've devised a template as follows:

("p" "Programming TODO" entry
            (file+headline "~/orgfiles/personalorg.org" "Tasks")
            "* %^{Description}
             %i%a")

This seems to be working pretty well, except that whenever I try to click on the link it generates, I get a coderef error if there's real data there, or whatever the first match was if I capture on something like a comment. Since I can't seem to anchor the captures back to a point in the file, it's not very much more useful than just putting "TODO"s into the comments near the code.

Can someone explain what's going on here, and how I should work around this?


texts:
Emacs has been favorite editor for more than twenty five years but it looks like one feature is missing. That one is text completion suggestions.

In most of the editors once you start typing, it keeps suggesting the completions. Sometimes, these are based on previous sessions, sometimes based on common words applicable to the current mode. Notepad++ is one notable example.

A quick search did not reveal any such feature package for emacs.

Do you think that you can suggest something?


texts:
The minor-mode show-paren-mode does not have a keymap. Is there a way to add such a keymap so that I can define some key-bindings that depend on this minor mode?

I saw a solution here which involves modifying minor-mode-map-alist, with a comment saying that the solution is "rather hacky". Is there a better solution in my case?


texts: How to access the original buffer when running M-x compile and friends?

texts:
For example, take any buffer. Maybe one named my-file. I want to run M-x compile in it and have access to the my-file buffer in compilation-finish-functions. You'd think think might work:

(setq compilation-finish-functions
      (lambda (buf string)
        (message "Buffer name: %s" (buffer-name (other-buffer buf)))))

But it actually echos my-file's other-buffer. current-buffer just returns the compilation buffer.

How would I reference the my-file buffer in a compilation-finish-functions function?


texts: Create a directory when a file has a similar name

texts:
I'm using ivy-mode and when I try and make a directory and it has the same sort of name as an autocomplete then the directory will not be made.

eg:
if I have webapp.pdf and I want to create a directory called webapp then autocomplete kicks in and thinks I want to call it webapp.pdf and then doesn't create the directory as it has the same name as a file. Is there a way around this?


texts: Function to return a quoted function for a given key binding

texts: I am looking for a function that returns a function (preferably quoted) for a given key binding. I know about C-h k (e.g. M-x describe-key), but I am looking for a lower-level function. (My use case is that I want to save a previous key binding before rebinding it.)


texts:
I use helm-recentf to receive the list of recent files.
I would like to have an opportunity to search over the list of recently viewed files.
Can I do it with grep or helm-swoop? Is there any other way?

UPDATE:
Lets say I have the list of recent files, and I want to find all occurrences of blah in all recent files. How would I do this?


texts:
I invested a lot of time to get a Windows file association working with cygwin emacsclient-w32. But every "solution" has some dead end that I can't solve. Any help really appreciated.

What I want is a simple file association for .cfg and .txt files to be opened by cygwin emacsclient-w32 (gui-version). The association has to work for local drive pathes and UNC pathes. What command will do the job?

Let's start at the basic. Command

"C:\cygwin64\bin\run.exe" emacsclient-w32 "%1"

Gets me /cygdrive/c/Users/MYUSERNAME/Desktop/C:\Users\MYUSERNAME\Desktop\myfile.cfg

Drag and dropping files works. Doesn't result in the path problem above.

I even tried cygpath. Problem there was that for UNC pathes there was one missing leading slash. When I add it local files were broken. The cygpath try looked like this:

C:\cygwin64\bin\bash.exe -c "emacsclient-w32 $(cygpath -u '%L')"


texts: built-in function to return the argument itself

texts:
The line below shows the first element which is not nil.

(message "%s" (cl-some  #'(lambda (x) x) '(nil nil "hello" nil)))
;; Output: hello

Is there a built-in function which is equivalent to (lambda (x) x)?


texts: I want to simplify repeated calls in my init.el file

texts:
I've got a lot of:

(desktop-save-mode 1)
(show-paren-mode 1)

which I'd like to collapse into:

(mapcar (lambda (fn) (fn 1)) '(desktop-save-mode show-paren-mode))

but I get an error:

Symbol’s function definition is void: fn

How can I call a list of functions with the same argument?


texts: Magit throws error when I press "h" or "c"

texts:
I have installed Emacs on a fresh install of Elementary OS, and I have just installed Magit. When I run magit-status in a repository, and press either  the c or h key, magit throws an error. The error starts with cl-etypecase failed:, but I do not understand what is wrong, or how I can fix it.

Does anyone know why this fails?

The error message is pasted below. My magit version is Magit 20190214.2056, Git 2.17.1, Emacs 25.2.1, gnu/linux.

cl-etypecase failed: [eieio-class-tag--transient-columns 1 nil nil nil nil nil nil nil nil ([eieio-class-tag--transient-column 1 nil nil nil nil nil nil nil nil ([eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil A magit-cherry-pick unbound  %k %d Apply] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil b magit-branch unbound  %k %d Branch] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil B magit-bisect unbound  %k %d Bisect] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil c magit-commit unbound  %k %d Commit] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil d magit-diff unbound  %k %d Diff] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil D magit-diff-refresh unbound  %k %d Diff (change)] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil e magit-ediff-dwim unbound  %k %d Ediff (dwim)] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil E magit-ediff unbound  %k %d Ediff]) nil nil] [eieio-class-tag--transient-column 1 nil nil nil nil nil nil nil nil ([eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil f magit-fetch unbound  %k %d Fetch] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil F magit-pull unbound  %k %d Pull] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil l magit-log unbound  %k %d Log] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil L magit-log-refresh unbound  %k %d Log (change)] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil m magit-merge unbound  %k %d Merge] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil M magit-remote unbound  %k %d Remote] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil o magit-submodule unbound  %k %d Submodule] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil O magit-subtree unbound  %k %d Subtree]) nil nil] [eieio-class-tag--transient-column 1 nil nil nil nil nil nil nil nil ([eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil P magit-push unbound  %k %d Push] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil r magit-rebase unbound  %k %d Rebase] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil t magit-tag unbound  %k %d Tag] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil T magit-notes unbound  %k %d Note] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil V magit-revert unbound  %k %d Revert] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil w magit-am unbound  %k %d Apply patches] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil W magit-patch unbound  %k %d Format patches] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil X magit-reset unbound  %k %d Reset]) nil nil] [eieio-class-tag--transient-column 1 nil nil nil nil nil nil nil nil ([eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil y magit-show-refs unbound  %k %d Show Refs] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil z magit-stash unbound  %k %d Stash] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil ! magit-run unbound  %k %d Run] [eieio-class-tag--transient-suffix 1 nil nil nil nil nil nil nil nil % magit-worktree unbound  %k %d Worktree]) nil nil]) nil Transient and dwim commands], (integer string list transient-group transient-suffix


texts: Accidentally killed a Gnus group, how do I restore it?

texts: I use Gnus for mail with nnmail backend. I was in Gnus group buffer and accidentally pressed C-k, which called gnus-group-kill-group. Did I just mindlessly deleted important mail? How do I restore my mail?


texts: What does it mean to type the "at" symbol in `C-c @ C-h`?

texts: I'm using hideshow and I like it. The package is recommending me that I use the keys C-c @ C-h to hide a block instead of typing some really long command. I'm familiar with C-c and with C-h, but I can't figure out what the @ means.


texts: How to save vim registers in evil mode for use after restarting emacs

texts: In evil mode, I can save text in named registers with "ay etc. These registers are lost whenever emacs is restarted. Is there a way to save these registers? Vim seems to do this automatically.


texts: mu4e change the face for my own mails in the header view

texts:
I am fairly new with mu4e and set it up for multiple accounts in combination with mbsync on macos.
It is quite unconvenient for me to see my own email, which I sent on the header view for each maildir. I think I see the benefit and I am looking now for an option to change the face a bit to distinguish easier my own mails from the other mails.
Unfortunately I could not find a special mu4e face for it!?
And I tried out the proposal Colouring mail headers by recipient email addr but this is removing all other faces and results in plain white faces for all headers.
The :from-or-to option does not help so much for this it seems.
Does anyone have a hint?


texts: open buffers from sr-speedbar in previously active window instead of splitting window

texts:
I'm using sr-speedbar to manage a list of buffers. After M-x sr-speedbar-toggle, I switch to the speedbar window, press b to switch into Quick Buffer mode, and then press Enter to select a buffer. In this example my main window is displaying *scratch* and I am pressing Enter on the *Messages* buffer.

I want *Messages* to open in the main window, but instead it opens in a new split window.

Here is how it appears before pressing Enter on the speedbar window:

Actual behavior:
The *Messages* buffer opens in a new split window.

Desired behavior:
The *Messages* buffer should open in the previously active window.

How can I configure emacs to achieve the desired behavior?


texts: How to get the merged face attributes at point?

texts:
The appearance of a given character is determined by faces from various sources and face-remapping-alist. How to determine the properties Emacs ultimately uses after taking all sources into account? What I'm looking for is an attribute list that could be used for the default face, i.e. one specifiying all attributes.
background-color-at-point and foreground-color-at-point come close for the respective attributes. But they don't take into account face-remapping-alist.


texts: how to tell graphical Emacs to shutdown cleanly from tty1?

texts:
problem

Lately I run GNU Emacs mostly as GUI on X/tty7 (which I'll call "the desktop" as opposed to emacs-desktop) on one of my Debian laptops. Occasionally the desktop hangs, in which case I usually can goto tty1 and sudo shutdown -[whatever] now. Unfortunately this does not cause Emacs to shut down as cleanly as I'd like: I'd like Emacs to (e.g.) save any unsaved buffers and desktop-save, but that doesn't seem to get done.

So I'm thinking that, in this usecase, I should utter something from tty1 (before shutdown) to tell Emacs to shutdown cleanly ... but I don't know what to say. How to do this?

solution

thanks

TIA and for past help to the many fine folks @ help-gnu-emacs, esp Yuri Khan for the initial suggestion and Jorge A. Alfaro-Murillo for the more important details of this solution. Special thanks to Faried Nawaz for 2 important advances that pretty-much solve the problem.

server and client

One way that WFM (not entirely without problems--see notes below) is

Preparation:

1.1. Whenever you start Emacs, make it start a server instance. I did this by adding the following line to my ~/.emacs.d/init.el:

    (server-start)

1.2. Also in ~/.emacs.d/init.el, define a callable function to tell emacs to shutdown cleanly, with as few prompts as possible. Faried Nawaz recommended

    (defun my-kill-emacs ()
      "Set kill-emacs-query-functions , confirm-kill-emacs , and
    kill-emacs-hook to nil to quit emacs without any pesky prompts
    (except to save buffers)"
      (let (kill-emacs-query-functions confirm-kill-emacs kill-emacs-hook)
        (save-buffers-kill-emacs)))

1.3. Restart your emacs to be sure to incorporate your new init.el code.

When you encounter tty7/desktop hang: Goto tty1, and login if not already. Then do either of the following:

2.1. manually: from bash commandline, run

emacsclient -c -a '' -e '(my-kill-emacs)'

2.2. scripted: save the above line into an executable file à la ~/bin/shutdown_Emacs_cleanly.sh and run it. E.g.:

#!/bin/sh
emacsclient -c -a '' -e '(my-kill-emacs)'

notes

If your (graphical) Emacs has no unsaved buffers when you kill it (as described above), Emacs will exit with no prompts. If your Emacs has unsaved buffers when you kill it, you will get prompts (from your character-mode Emacs in tty1) to save the buffers. (Writing a function that saves all unsaved buffers without any prompts is left as an exercise for the reader :-)
Whether or not you have unsaved buffers, when your tty1 commandline exits, its terminal handling may be "polluted": e.g. (and in roughly decreasing order of importance),

You will no longer see what you type at the bash prompt.
History browsing (via up/down-arrow key) also fails--at least, I cannot see anything on the commandline.
Hitting RET at the bash prompt no longer does a line feed, though it still produces a new prompt. This results in a display like

me@it:~$ me@it:~$ me@it:~$ me@it:~$ me@it:~$ me@it:~$ me@it:~$ me@it:~$ me@it:~$

My tty1 is always polluted by running the above; YMMV. Fortunately, as Nawaz points out, one can unpollute by calling reset from the tty1 commandline (after installing package=ncurses-bin).


texts: How can I edit files within encrypted zip files?

texts:
Currently I can use emacs to edit text files within zip files no problem. I simply get a directory listing from which I can choose the document that I want to edit.

Is there anyway to edit text files that are located within encrypted zip files?

I know this is possible with .gpg files, but not so sure about encrypted zip files.


texts:
Trying to eww https://github.com on emacs -q with the following debug stacktrace:

Debugger entered--Lisp error: (error "Could not create connection to github.com:443")
  signal(error ("Could not create connection to github.com:443"))
  error("Could not create connection to %s:%d" "github.com" 443)
  url-http([cl-struct-url "https" nil nil "github.com" nil "/" nil nil t nil t] eww-render (nil "https://github.com/" nil #<buffer *eww*>) nil tls)
  url-https([cl-struct-url "https" nil nil "github.com" nil "/" nil nil t nil t] eww-render (nil "https://github.com/" nil #<buffer *eww*>))
  url-retrieve-internal("https://github.com/" eww-render (nil "https://github.com/" nil #<buffer *eww*>) nil nil)
  url-retrieve("https://github.com/" eww-render ("https://github.com/" nil #<buffer *eww*>))
  eww("https://github.com/")
  funcall-interactively(eww "https://github.com/")
  #<subr call-interactively>(eww t nil)
  elmacro-record-command(#<subr call-interactively> eww nil nil)
  apply(elmacro-record-command #<subr call-interactively> (eww nil nil))
  call-interactively(eww nil nil)
  command-execute(eww)

Mac OS version 10.11.6, GnuTLS 3.5.18 from Brew.

GNU Emacs 25.3.1 (x86_64-apple-darwin15.6.0, Carbon Version 157 AppKit 1404.47) of 2018-03-20

curl works fine, regular browser works fine, any other website through eww works fine.

For some reason, specifically github.com:443 with url-http.el library fails.

To be clear, I'm not trying to browse github.com in eww. However, tooling that relies on the same library as eww breaks in the same way as eww - I'm confident if I can figure out I'll fix the other.

Looking for any help on how to troubleshoot this.


texts: Simple regexp inside emacs keyboard macro

texts: Newbie question: I'm trying to record a keyboard macro with a simple regexp inside (search-backward-regexp ^[0-9]). This works well when recording the macro, but as soon as I try to execute it, the search fails because emacs puts the brackets twice (message Search failed: "^[[0-9]]"). How do I do this right?


texts: Text and backround colour with auctex has the same colour, how to change

texts:
In LaTeX mode with Auctex, I have a problem with \textbf and that is that the text inside the {} has the same colour as the background of the textbf field, as illustrated here:

This is only a problem in some themes, but how do I solve this?
It is only a problem with Auctex


texts: mu4e: do not display messages in the thread that does not respect the query

texts:
It seems that when I do a search like date:2d..now AND NOT flag:trashed, mu4e display all the messages that respect the query... but also some others that are in the same thread (here I got some deleted messages).

It can be really practical to follow a discussion, however it can be a problem when I want to do a specific operation on them (like select all the lower part of the screen and move them to a specific directory)... Any idea how I could disable these messages that should not be there?

Thanks.


texts: Edit with Emacs chrome extension closing windows

texts:
I have the edit with emacs chrome extension.

I have emacs open in one frame with multiple windows on different buffers open.  When I am in chrome and focused on a text box I press Alt-Enter. This pops up a new emacs frame and I can edit the text from the text box. When finished I press C-c C-c and the frame closes and I go back to my main emacs frame (Ideally at this stage I should go to the browser... ) however one of the windows in my main emacs frame has closed. If I only have one window open in my main emacs frame then I get the message delete-window: Attempt to delete minibuffer or sole ordinary window. The text from the edit frame enters the browser text box as expected when I have switched back to the browser.

So it seems the C-c C-c command is attempting to close two windows rather than just the new pop up one. How can I stope this, or failing that is there a way to undo the last closed window in my main emacs frame?


texts:
Js2-mode is showing error when there are not registered globals. I've try this code:

(defun js2-hook ()
  ;; setting symbols instead of strings also don't work
  (dolist (global '("angular" "$" "jQuery" "console" "_" "window" "setTimeout"))
    (add-to-list 'js2-additional-externs global)))

(add-hook 'js2-mode-hook 'js2-hook)

but this don't work. How can I set globals, setting js2-additional-externs directly don't work also, because describe-variable says that this variable is automatically local when set.


texts: How to make web-mode handle HTML inside  element?

texts:
I have  elements that contain various things. Some contain HTML; web-mode does not realize that so it messes up the indentation. Some contain CSS; same issue.

My first preference is, can I somehow tell web-mode what language is inside each  element? (I can mechanically intuit from the  attributes. I can do light Emacs hacking.

My second preference is, can I somehow tell web-mode just to not mess with any formatting inside a  element? At least then, after I manually get it formatted right, web-mode won't clobber it.

<html>
    <head>
    </head>
    <body>
        <script type="text/x-LP5">
        <!-- need to tell web-mode this is HTML; otherwise it has no clue and indents like thi: -->
        <!doctype html>
        <html lang="en">
        <head>
        <meta charset="utf-8">
        <title>LP5 bootstrap</title>
        <style>
        @<LP5_GlobalCSS@>
        </style>
        </head>
        <body>
        @<LP5_1@>
        </body>
        </html>
        </script>
    </body>
</html>


texts: Indentation in Org Mode Source Block with Return

texts:
I have a weird behavior in org-mode.  When I create a source block, pressing RET indents the current and all previous lines with 2 spaces, resulting in something like
#+begin_src bash :results output
      a=0
    b=1
  c=2

#+end_src

No "manual" indentation was applied, it all came from pressing RET after each line.
I do not have this behavior if I press C-j instead instead of RET.
I also do not have it if I start Emacs with the -Q option, but I disabled all my org-mode configuration and had the same results, so I am not sure what is causing it.


texts: Company printing stuff to console in ESS

texts:
I am using company with ESS, and in some contexts, company will print weird documentation messages to the console:

(list "" '(("..." . "")) '("recursive" "use.names" "..." "x" "replace" "drop_null" "con"))

This seems to happen when the cursors is inside certain functions like c.
Is there any way to deactivate this behavior?

Edit:

For now, a workaround is to uninstall eldoc and eldoc-stan. This doesn't seem optimal, though...


texts: How to replace a letter with its numerical alphabetic position?

texts:
I have this code:

\author[p]{...}
\author[bc]{...}
\author[p]{...}
\author[l,o]{...}
\author[t,q]{...}
\author[at]{...}
\author[z]{...}
\author[ak]{...}
\author[az]{...}
\author[ah,bq]{...}

...

I want to replace all letters in square brackets with their corresponding numeric positions in alphabet, i.e.

a  --> 1
...
z  --> 26

aa --> 27
...
az --> 52

ba --> 53
...
bz --> 78
...

How can I do this replacement?


texts: Prevent Helm from opening in a new frame

texts:
I recently updated Helm from MELPA to version helm-20180305.1056 and helm-core-20180306.2241. Now sometimes when I use Helm it opens in a new frame. I think this happens when I have 2x1 or 2x2 window configuration and point is currently in the part of the frame where there is one window above another window:

+----+----+          +----+----+
|    |    |          |    |    |
+----+    |    or    +----+----+
|    |    |          |    |    |
+----+----+          +----+----+

I do not experience this with only one horizontal or vertical split like below:

+------------+          +----+----+
|            |          |    |    |
+------------+    or    |    |    |
|            |          |    |    |
+------------+          +----+----+

My Helm config is;

(use-package helm
  :ensure t
  :diminish
  :config
  (use-package helm-config)
  (helm-mode 1)
  (helm-autoresize-mode 1)
  (setq helm-split-window-in-side-p t)
  :bind
  (("M-x" . helm-M-x)
   ("C-x C-f" . helm-find-files)
   ("C-x C-b" . helm-buffers-list)
   ("M-s o" . helm-occur)
   ("M-s i" . helm-imenu)
   ("M-s I" . helm-imenu-in-all-buffers)))

How do I prevent Helm from ever opening in a new frame and instead always use the current window?


texts: Can font faces be dynamically assigned with font-lock-add-keywords?

texts:
In all the examples of font-lock-add-keywords I've seen, the font face is static.
That is, there is a regex or a matcher function and a literal font face identifier.
Is it possible to set the face dynamically? So the font face used can be selected using code that interacts with the matches for example?
Otherwise I would have to register multiple matchers, one for each face used.


texts: Where is the file for the Fancy Startup Screen

texts:
I'm trying to find where the contents of the *GNU Emacs* buffer, aka fancy startup screen, are located on my hard drive.

When I M-x eval-expression buffer-file-name to find the file of the current buffer it returns nil. The buffer-file-name documentation says:

  If buffer is not visiting any file, buffer-file-name returns nil.

so this is expected.

If it is not a file then where is this text coming from? I checked the source code at https://github.com/emacs-mirror/emacs/tree/master/doc but I didn't see anything.


texts: change the default directory that's suggested in desktop-save command

texts:
When you run M-x desktop-save, you're prompted with the message and the default option: Directory to save desktop file in: "~/.emacs.d"

How can I change this default path to something else like "~/.emacs1.d" in my init.el, so that I won't have to insert "1" each time I want to save my session, and so that I won't overwrite the desktop file in ~/.emacs.d by mistake?


texts: Doom emacs dired +ranger not obeying evil-mode

texts:
I am using doom emacs and in my init file I have (dired +ranger)
The problem is when I open dired, I cannot press tab to select for example. I have first to toggle off evil-mode. If I do, I lose all doom key bindings.
There should be a work around as in regular dired, I didn't have to toggle off evil mode and doom still working!


texts: Using Tabs as indentation with Cython emacs

texts:
Under my home directory I have a .emacs file which has the following lines -

(add-to-list 'load-path "~/.emacs.d/")
(require 'cython-mode)

and under the .emacs.d directory I have this file - cython-mode.el which I downloaded from here - Cython-mode.el and I have been using emacs with Cython for over a week now but I cannot seem to do a tab. When I hit tab it does not indent at all. Where am I going wrong ?

Sample example -

cdef extern from "Skip_list.cpp":
pass

The pass word should come under extern but it does not. I am not able to figure out why.

OS - Ubuntu 18.04 LTS, Cython 0.24 , Emacs version - 25.2

UPDATE

When I type M-x cython-mode the word "pass" does get indented properly but I get this message at the bottom of emacs. Why is this not done automatically and does this mean I have to do it manually every single time ?

Can't guess python-indent-offset ,using defaults : 4

I also did a

 find . -name "python.el"

and

 find . -name "python-mode.el"

as user root on my Ubuntu and both these finds gave me null results.


texts: How can I rotate window configurations among frames?

texts: At work, I have a dual-monitor setup and, naturally, both of them are fullscreened to emacs.  I have bindings to switch between the two frames with other-frame, but sometimes I just want particular content on the screen directly in front of me.  (One is off to the side.)  How can I rotate window configurations among frames (in this case, effectively swapping them)?


texts: How to show remaining task effort in org-mode's column view

texts: I use the column view to show my estimated effort for my tasks, and work. It is very useful to schedule the tasks of the day. But I would like to see the remaining effort of each task, i.e., (estimated effort) - (clocksum) instead of the estimated effort. Is it possible to add a column with the Remaining effort instead of the Estimated effort?


texts: How to grep marked files in the dired mode of emacs?

texts:
I hope it's a simple problem..

I'd like to search for the regexp 'thisWord' only in the marked files of a dired buffer.

Usually I used in the dired buffer:

M-x grep and then in the mini-buffer
grep -r -nH 'thisWord' .

But this searches all the files of the directory not just the marked ones.

Well, the dired mode of emacs has the possibility to restrict the search on the marked files with just using A  (dired-do-find-regexp). But the results are listed in the unusual "xref format", I need the "grep format":

./file-a.org:16253: ..thisWord...

I there a simple way to get the search results of the marked files in the "grep format"?


texts:
I would like to add an alternative answer to the thread  How do I force re-evaluation of a defvar?  Before doing so, however, I would like to learn how to eliminate the single-quote to prevent evaluation of the argument INPUT to the new function defvar-reevaluate.  Perhaps I need a macro instead of a function ....?

BEFORE:

  (defun defvar-reevaluate (input)
"Force revelaution of a defvar."
  (let* ((string (prin1-to-string input))
         (form (read string))
         (form (elisp--eval-defun-1 (macroexpand form))))
    (eval form)))

(defvar-reevaluate
  '(defvar undo-auto--this-command-amalgamating "hello-world"
  "My new doc-string"))

AFTER -- without the single quote.

  (defvar-reevaluate
  (defvar undo-auto--this-command-amalgamating "hello-world"
  "My new doc-string"))


texts: How to make a temporary directory that gets deleted once the body is finished?

texts:
Is there a way to temporarily create a new directory, then remove it when the body of the code has finished?

(with-temp-directory path
   (write-test-files-into path)
   (other-test-functions path))
;; path is now deleted!

Similar to the Python function tempfile.TemporaryDirectory by a similar name:

# create a temporary directory using the context manager
with tempfile.TemporaryDirectory() as tmpdirname:
    print('created temporary directory', tmpdirname)


texts:
I've written a very simple mode using SMIE (see code below) that produces some weird indentation after comments that I do not understand. Here is an example:
int a /**/ ;
int b;

int a /**/;
      int b;

Why is the last line indented? I expected the last line to look like the second line.
Here is the code to replicate this result:
(require 'smie)

(setq foobar-grammar
  (smie-prec2->grammar
   (smie-bnf->prec2
    `((insts (insts ";" insts) (inst))
      (inst ("int" id))
      (id))
    '((assoc ";")))))

(defun foobar-rules (kind token)
  (message "rule: (%s . %s) at point %d" kind token (point))
  (pcase (list kind token)
    ;; ???
    ))

(define-derived-mode foobar-mode prog-mode "foobar"
  :syntax-table nil
  (modify-syntax-entry ?/ ". 124")
  (modify-syntax-entry ?* ". 23b")
  (modify-syntax-entry ?\n ">")
  (setq comment-start "//")
  (smie-setup foobar-grammar #'foobar-rules)
  (font-lock-add-keywords nil '(("int" . font-lock-keyword-face)))
  (font-lock-mode)
  (font-lock-ensure (point-min) (point-max)))


texts: Using tab-bar.el with automatic tab management

texts:
I want to implement automatic tab management. Every file I open needs to go into a tab. The tab into which any given buffer goes is determined by root directory of the VC repo the file belongs to.
The mechanism used by tabbar.el was tabbar-buffer-groups-function where I could use a function like
(defun my/find-vc-root ()
  "Retuns the repository root as per [vc]."
  (vc-call-backend (vc-responsible-backend default-directory)
           'root default-directory))

I do see tab-bar-new-tab-group in the code but I can't wrap my head around how it is to be used.


texts: Bind keys differently when in any minibuffer

texts:
I normally use my keypad numbers to perform various navigation commands, but one of those commands is goto-line, and when I'm in the minibuffer entering the line number, I want my keypad to run self-insert-command instead of all those other commands.

How can I do this?


texts: Byte-compiling a file loads macros with `(eval-and-compile)` but not `(eval-when-compile)`

texts:
I created a buffer, test1.el:

(eval-when-compile
  (defmacro dummy-macro (_) nil)
  (dummy-macro s))

Trying to compile this file, I get the following errors:

In toplevel form:
test1.el:3:16:Warning: reference to free variable `s'
test1.el:3:16:Error: Symbol's value as variable is void: s

If I change eval-when-compile to eval-and-compile I do not get these errors. Why is this?

I'm running Emacs 24.4.1.


texts: Custom bullet style for org-mode plain lists

texts: One of the possible bullet styles for plain lists is -.  Can I replace this with --?  (I'm afraid of seeming unable to tell a hyphen from an en-rule.)


texts:
Not sure what's going on here, but if I open a file in emacs (no window mode), and just do a search (ctrl-s), the buffer gets garbled. It fixes itself when I ctrl-l, but that's annoying to have to do so frequently.

I'm using OS X's Terminal declaring terminal as xterm-256color. Text encoding Unicode (UTF-8).

I'm ssh-ing to a VM and launching emacs in that VM.

Here's an example:


texts: How to stop mu4e from inserting line breaks?

texts:
When I write a long line while composing a mail in mu4e, the lines are truncated for viewing (toggle-truncate-lines), but as soon as I hit Enter fixed line breaks (column width seems to be 70 or something) are introduced.

How can I stop mu4e from introducing these line breaks?


texts: How to remove org- ID drawer + location file entry

texts: What is the reverse method of org-id-get-create -- i.e., remove the ID property drawer and also remove the corresponding entry in the org-id-locations-file?


texts: Using magit for the most basic add, commit, push

texts:
I normally use only a few git commands each time I want to commit changes to a repository:

$ git add --all .
$ git commit -m "update."
$ git push -u origin master

Can magit be useful in this regard? M-x magit-status seems helpful but I am not fulling understanding the language of "staging/unstaging" "hunks" etc. from ref1 ref2 ref3.

What might be the equivalent commands in magit? Thanks in advance -

Edit This page seems to speak better to my level but is C-u s the equivalent of git add --all .? Though that page says it does not work.


texts: How to fully fontify latex snippets including subscript and superscript within org-mode

texts: I have many latex snippets delimited by $ inside my org notes. I recently discovered org-highlight-latex-and-related, which highlights latex snippets a certain face. However, I want to also apply the specially subscript/superscript faces, which shift the face up and diminish the size, as this helps distinguish things visually. Is this possible?


texts: How can I initialize all environment variables in OSX?

texts:
If I start GUI emacs in OSX (not from the terminal) it does not know about my user environment variables.

The exec-path-from-shell package mostly solves this, but while you can explicitly initialize specific environment variables, I can't see a way to initialize all environment variables.

I use environment variables to supply secrets to my applications, so I tend to have a lot of them and would prefer not to have to add and remove them from my init.el.


texts: Multiple URL formats for bug-reference-mode

texts:
I’m working on a project which is version controlled using GitLab.  GitLab, unlike GitHub, uses two separate URL endpoints for issues and merge requests (AKA Pull Requests):

https://gitlab.example.com/group/project/issues/<issue_number>
https://gitlab.example.com/group/project/merge_requests/<mr_number>

Also, issues are represented as #1 while merge requests are represented as !1.

It is fairly easy to write a regex to match both, but is there a way to tell bug-reference-mode to use different URL formats for them?


texts: EMMS fetch music track data from online database like freedb or cddb?

texts:
Does this functionality exist?

I would like to add missing metadata top files in my music library, similar to how itunes does it (with Gracenote's CDDB or freedb).


texts:
What Emacs utilities can provide better browsing and navigation of reST documents? Alternatively, how to configure existing utilities to work with reST? What I mean, why I ask:

Of the lightweight markups I lately mostly compose reST [1], and of course I do so with God's Own Editor (currently version='GNU Emacs 24.4.1' as packaged for Debian stable). Some of my reST docs are rather large, hence I seek better ways to

high-level-view reST doc sections. E.g., un/folding at section headings, or (better yet) providing a speedbar-like tree browser.
navigate between doc sections. Again, speedbar for reST would be great, but even an occur-like view would be helpful. (Unfortunately I lack sufficient multiline-regexp-fu to tell occur how to match reST section headings--your assistance is appreciated!)

Unfortunately

the otherwise-quite-useful rst-mode does not currently provide this functionality, though I am also pinging its maintainer regarding this. It does provide rst-backward-section (C-M-a) and rst-forward-section (C-M-e), but linear navigation is well short of what I want.
When I M-x speedbar from an rst-mode buffer, I get basically an empty frame.
When I M-x imenu from an rst-mode buffer, it seems only able to find the first-level headers. (Am I missing something?)
set-selective-display (e.g., M-1 C-x $) seems quite confused: it folds some sections and list items but not others, apparently at random (at least, I'm seeing no sense to it).
As noted above, I don't know the correct regexp to give occur to parse reST section heads.

[1] except when on an SE site :-(


texts: Can i assign tags to list items in orgmode?

texts: Is there a way to assign tags to list items and not just to headings? I can't seem to find anything relevant in the orgmode manual.


texts: Highlight (and increase font) for specific words in the buffer when it's opened

texts:
I'm looking for functionality that will allow me to highlight specific words of text when I open the buffer in specific mode, like it should work if you're in

js2-mode
web-mode
vue-mode

and the words I'm looking for are

props
data
computed etc

I have found highlight-phrase function, but I would like to change the font size of the found word. Any ideas?

Where do I start?


texts: orgmode - change sample block width locally

texts:
I want to change sample block width locally. for example:

#+OPTIONS: html-postamble:nil
#+HTML_HEAD: <style type="text/css">.example {width:50%; background-color: #eff0e0;}</style>

* half width sample
#+BEGIN_EXAMPLE
half block
#+END_EXAMPLE
* full width sample
#+HTML_HEAD: <style type="text/css">.example {width:100%; background-color: #eff0f1; width:50%;}</style>
#+BEGIN_EXAMPLE
full block
#+END_EXAMPLE

But current code will output all sample block as full width.The second css define will take effect. I am thinking about #+ATTR_HTML but it doesn't work.

#+ATTR_HTML :width 50%


texts: How to move elpy interactive python shell from bottom to the side?

texts: I am using elpy as a python development environment. when I run a code in interactive python shell  it shows the output in the bottom of the window. Can I move this bottom interactive python shell to the side


texts:
Windows 10, Emacs 25.1, Dired+

I try to copy a file from test folder to nonexistent folder new:

But I get this error:

Is it possible to make Emacs autocreate folder new and copy the file to it?
It would be very convenient.

(In file manager Total Commander it's possible. And it's very good.)


texts: Emoji icons pasted in emacs are shown as blank spaces

texts:
I have some emoji icons inserted in my shell terminal, which i am trying to copy and paste it into emacs

When i copy the above text and paste it into my emacs window, it shows blank space in the place of emojis like,

echo I am not very happy  ;;<-- an extra space is visible at the line end instead of an angry face icon.

I use Mac OS El Capitan.


texts: Double click on a web link results in visiting the link in the default browser

texts: Assume that in the current buffer there is some text like http://emacs.stackexchange.com/. Is it possible to customize Emacs so that double clicking on this text, results in visiting the link by the deafult browser? (i.e., like hyperref in LaTeX).


texts: Default hour of day when setting Deadline or Scheduled in org-mode

texts:
Hello everybody it is quite easy question.

I'm using org-mobile so it synchronize my android agenda with org mode.

When I use org-deadline (C-c C-d) and I choose today,
the format will look like this: DEADLINE: <2015-08-03 Pzt>,

I just want it to make all deadlines always be at 10 am instead, like this: DEADLINE: <2015-08-03 Pzt 10:00>.
I would also like the same behaviour with org-schedule (C-c C-s).

How can achieve this?


texts:
I want to change the foreground color of my fringes, in my theme file.

I changed (line 84):

- `(fringe ((t (:foreground ,bisque-fg :background ,bisque-bg))))

to

+ `(fringe ((t (:foreground ,bisque-red :background ,bisque-bg))))
                                    ^^^

Then with customize-group I removed what was manually changed. Now, the sample field for Fringe in the customize window reflects the bisque-red color in my theme file.

This is the result:

The foreground color is honored, but what the foreground is isn't what I expected.

The line continuation arrows have the foreground color I set.

What I want is to change the color of the vertical line itself.

I even manually removed the fringe-related things in the custom-set-faces section of my init file.

However when I load the theme (or start a new emacs), the fringes still have the default foreground face color.

If I do the same thing with the fringes' background color, all works well.

Something takes precedence over the foreground color of the fringes, although Customize shows the right one. What is it? How do I make sure the fringe foreground in my theme file works?


texts: org-mode cannot find pdflatex using Mac OS

texts:
When I try to export an org file to pdf using C-c C-e l o I get the following message:

Saving file /Users/user/tmp/test.tex...
Wrote /Users/user/tmp/test.tex
Processing LaTeX file ./test.tex...
/bin/bash: pdflatex: command not found [3 times]
org-latex-compile: PDF file ./test.pdf wasn't produced

This happens when I open emacs by clicking on the icon that can be found in /Applications. However, if I open emacs from the command line:

/Applications/Emacs.app/Contents/MacOS/Emacs

I can export the org file without any problem. It seems like in both cases the same init file is loaded and I fail to understand the problem. Any ideas?

NB: version returns:

GNU Emacs 24.4.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 2014-10-21 on builder10-9.porkrind.org

and org-version returns:

Org-mode version 8.2.10 (8.2.10-21-ga712ce-elpaplus @ /Users/drorata/.emacs.d/elpa/org-plus-contrib-20141201/)

Finally, I'm using OS X 10.10.

The $PATH:

I tried to include either (add-to-list 'exec-path "/usr/texbin/pdflatex") or (add-to-list 'exec-path "/usr/texbin") in my .emacs but this didn't help.


texts: fork in org-mode babel source block executes incorrectly

texts:
I have this small piece of code on emacs org-mode :

#+BEGIN_SRC C :eval
#+BEGIN_SRC C :fork-example1.c :noweb no-export :eval :flags -Wall -Werror -pedantic
//Fork-exemplec-cours.c
#include <stdio.h>
#include <unistd.h> // pour fork
int main()
{
    int i = 0;
    printf("Before fork, %d\n", i);
    fork();
    printf("After fork, %d\n", ++i);
    return 0;
}
#+END_SRC

And the result is the following:

#+RESULTS:
| Before fork | 0 |
| After fork  | 1 |
| Before fork | 0 |
| After fork  | 1 |

As you see there is an issue because I should have :

#+RESULTS:
| Before fork | 0 |
| After fork  | 1 |
| After fork  | 1 |

The most surprising is that I look for /tmp/babel-5930pB/ and I execute
vince@debianvs:/tmp/babel-5930pB/$ ./C-bin-BbVB44

I have exactly this :

Before fork, 0
After fork, 1
After fork, 1

Can you help me..... I can't understand why I have this behaviour in org-mode.


texts: Org Mode - Tags are not available across agenda files

texts:
In ~/.emacs I have the following:

(setq org-agenda-files (quote ("~/Documents/organize/org-mode/")))

In ~/D/o/o/ there are multiple files and I can cycle through them using C-,.

While adding content to a file, I can C-c C-q TAB, enter the first few characters and hit TAB again to autocomplete a tag. But this works ONLY for the tags in the current file. It ignores tags present in other agenda files.

How do I make tags available across agenda files?


texts: Bind a key to a lambda: what am I doing wrong?

texts:
I'm reading about some concepts of Emacs Lisp. The lambda's seems interesting to me. After reading the manuals about lambda's in Emacs Lisp, I decided to play with it.

For example, I have this snippet:

(defun my-insert-arrow ()
    (interactive)
    (insert "->"))

(evil-define-key 'insert php-mode map (kbd "C-<next>") 'my-insert-arrow))

Okay, then I replace that function with a lambda:

(evil-define-key 'insert php-mode map (kbd "C-<next>") (lambda () (insert "->")))

But I got the following error:

command-execute: Wrong type argument: commandp, (lambda nil (insert "->"))

So it seems I applied the lambda in the wrong way. But I found no difference with the manuals, except that the lambda's in the tutorial examples contains arguments.


texts: Enable mode association with backup files as well

texts:
I want to enable mode association with backup files as well. E.g., if I backup my my-markdown.md file as my-markdown.md.orig or my-markdown.md.lastweek etc, I want them still be associated with the markdown mode. This is how I'm trying to fix it:

 (use-package markdown-mode
-  :mode ("\\.\\(txt\\|markdown\\|md\\)\\'" . markdown-mode))
+  :mode ("\\.\\(txt\\|markdown\\|md\\)\\(\\'\\|\\.)" . markdown-mode))

It was working fine before my hack, but now neither the .md files nor the .md.lastweek are associated.

UPDATE, for the record, for all my questions, I gather all the answers to here.


texts: How to disable code blocks in an Emacs org-mode init file

texts: My dot emacs config consists of a short init.el file and a very large org file in which I have created dozens of emacs-lisp code-blocks. This works very well for me, especially in terms of organization. Every now I then I wish to temporarily disable one of these code blocks without having to delete the blocks in part or altogether. Is there a more elegant way of doing this? At present I tend to archive the code blacks to another file. However, I would like to keep them in the same file, and activate them if I need them. Is there a tag that might do this?


texts: How to use customize to turn on viper mode by default?

texts:
I see on the Viper page that the way to turn on viper mode by default is

 (setq viper-mode t)
 (require 'viper)

I've been trying to move over to using customize to do emacs configuration. Is there a way to turn on viper mode on start using customize?


texts: Use edebug to trace ivy-read OR how to prevent focusing in minibuffer

texts:
I would like to understand more of the internals of ivy-read. So I tried using edebug to trace some of the helper functions in ivy.el. However, upon entering edebug, the focus always is in the minibuffer makes it impossible to trace.
A similar question on SE is How to debug helm. Apparently tracing helm code would encounter the same problem. The good news is there is a switch for ease of debug in helm.
I'm wondering if there is a similar switch in ivy. (Or how abo-abo debugs when developing ivy :-)
The link also mentions Recursive Editing. I've read elisp info node "Edebug recursive editing". But I can't understand what it says.


texts: Tried to install package, got "Error during download request: Not found"

texts: This is when I was trying to install helm-projectile package via M-x package-install. What's this mean? How do I resolve?


texts: How to erase the old value in "exec-path" value

texts:
I try to create an own portable installation (in USB pen drive).
The first problem is to cancel the "old" values looks in exec-path stored.
When I insert the command C-h v, I see together "exec-path is a variable defined in C source code" followed by current exec path settings, the sentences "the old value was". Is there a way to remove the last entry from the path?


texts: 25.2 - documentation for "experimental cairo drawing"

texts:
Can anyone provide some hints on how the "experimental cairo drawing" works in recent GNU Emacs?  Specifically, what can I do to test this functionality (as requested in release docs).

[joe@localhost emacs-25.2]$ find ./ -name *.el | xargs grep "cairo"
./lisp/version.el:(defvar cairo-version-string)
./lisp/version.el:       (if (featurep 'cairo)
./lisp/version.el:           (format ", cairo version %s" cairo-version-string)

From the NEWS file for 25.1:

  ** New configure option --with-cairo. This builds Emacs with Cairo drawing.  As a side effect, it provides support for built-in printing,
  when Emacs was built with GTK+. The Emacs Cairo drawing is
  experimental and still has some known display problems.  We encourage
  more testing of this build and reporting any problems you find, but it
  is not recommended for production.


texts: How to export svg images as  in html export

texts:
Normally, when I export to html an org-mode buffer that contains a
link to an image, the link is coverted to a proper html <img...>.
However, if that image has a .svg extension, it is exported as an <object...> instead.

How do I prevent this?

For instance, the following link:

[[file:https://clojars.org/malabarba/lazy-map/latest-version.svg]]

gets exported like this:

<object type="image/svg+xml" data="https://clojars.org/malabarba/lazy-map/latest-version.svg" >
Sorry, your browser does not support SVG.</object>

But I'd like it to be exported like this:

<img src="https://clojars.org/malabarba/lazy-map/latest-version.svg">


texts: How to write a frontend for company-mode that allows the pseudo-tooltip but restricts it further?

texts:
I'd like to have a pseudo tooltip available but restrict its appearance more than the default options allow. For example, I might want it to only appear if no input has come for some period of time, or to wait for a tab before appearing. I know how to sleep and how to wait for a tab, but I do not know how to make sure the tooltip appears only under certain circumstances but also always disappears and changes as normal when visible.

For reference, this is some of the relevant code in company.el. It takes one of the following arguments: 'show, 'hide, 'update, 'pre-command, or 'post-command.

(defun company-pseudo-tooltip-unless-just-one-frontend (command)
  "`company-pseudo-tooltip-frontend', but not shown for single candidates."
  (unless (and (eq command 'post-command)
               (company--show-inline-p))
    (company-pseudo-tooltip-frontend command)))

(defun company-pseudo-tooltip-frontend (command)
  "`company-mode' frontend similar to a tooltip but based on overlays."
  (cl-case command
    (pre-command (company-pseudo-tooltip-hide-temporarily))
    (post-command
     (unless (when (overlayp company-pseudo-tooltip-overlay)
              (let* ((ov company-pseudo-tooltip-overlay)
                     (old-height (overlay-get ov 'company-height))
                     (new-height (company--pseudo-tooltip-height)))
                (and
                 (>= (* old-height new-height) 0)
                 (>= (abs old-height) (abs new-height))
                 (equal (company-pseudo-tooltip-guard)
                        (overlay-get ov 'company-guard)))))
       ;; Redraw needed.
       (company-pseudo-tooltip-show-at-point (point) (length company-prefix))
       (overlay-put company-pseudo-tooltip-overlay
                    'company-guard (company-pseudo-tooltip-guard)))
     (company-pseudo-tooltip-unhide))
    (hide (company-pseudo-tooltip-hide)
          (setq company-tooltip-offset 0))
    (update (when (overlayp company-pseudo-tooltip-overlay)
              (company-pseudo-tooltip-edit company-selection)))))

I haven't been able to understand what all the component parts do.


texts: How show multicursor only from cursor position?

texts:
emacs 26

in my scratch buffer I select dash

Now I want to show multicursors only from cursor position (line 5).

M-x mc/mark-all-like-this

But it show multicursors in whole buffer

I also try M-x mc/mark-next-like-this

But it not help.

But I need to show multicursors only from cursor position (line 5).


texts:
My main setup uses zsh and prezto on Mac OS with a custom prompt theme (I use iTerm2 and not Terminal.app).

I was wondering what's the best way to have a similar experience with an Emacs terminal emulator.

I seems that the answer is easy: M-x ansi-term (or just M-x term ?)

However the prompt is not very nice as Emacs doesn't understand the special character my theme uses (some kind of fat arrow).

How could I fix this? Can I 'detect' in my zshrc file that I'm inside Emacs and change the prompt?


texts:
I have an org file of 470 lines, 20 headings and 15 noweb references.

From it I tangle 2 files that are 250 lines and differ very little. Tangling takes over a minute and a lot of painful redisplay:

the modeline shows clauses being tangled
the buffer jumps to the different references

How can I speed this up? I tried the following but it has no effect:

;; tangle is too slow, try to speed it up
(add-hook 'org-babel-pre-tangle-hook
          (defun my-org-babel-pre-tangle-hook () (setq inhibit-redisplay t)))
(add-hook 'org-babel-post-tangle-hook
          (defun my-org-babel-pre-tangle-hook () (setq inhibit-redisplay nil)))

Also, I'm afraid that if it had effect, an exception (or user-quit) may leave inhibit-display on and lock me out of emacs.


texts: How to get diffstat in magit revision buffer?

texts:
In MacOS Mojave, I am using magit version 20190319.1911, emacs v26.1, git v2.20.1 (Apple Git-117).

How do I get a diffstat in a magit revision buffer? I remember seeing such a diffstat in this buffer, but can't get it now. When I type j in a revision buffer, the response is "no diffstat in this buffer". I can get a diffstat in the log buffer, but I would prefer it in the revision buffer that is automatically updated as I move through commits in the log buffer.


texts: Spaces don't work as expected in isearch

texts: I recently installed a new major mode for something I'm working on, and suddenly spaces in expressions I'm searching for don't work as expected. Help!


texts: Run command in an emacsclient instance from the terminal

texts: How can one run a command (e.g. to open a file) in an existing emacsclient instance, from the terminal (i.e. not from Emacs itself)?


texts: How to format a presentation in ox-reveal / Reveal.js export in Org mode

texts:
Following are the list of default options for Reveal.js, which I got when I did C-c C-e #

#+OPTIONS: reveal_control:t reveal_height:-1
#+OPTIONS: reveal_history:nil reveal_keyboard:t reveal_overview:t
#+OPTIONS: reveal_progress:t reveal_rolling_links:nil
#+OPTIONS: reveal_single_file:nil reveal_slide_number:"c"
#+OPTIONS: reveal_title_slide:auto reveal_width:-1
#+REVEAL_MARGIN: -1
#+REVEAL_MIN_SCALE: -1
#+REVEAL_MAX_SCALE: -1
#+REVEAL_ROOT: file:///C:\Users\nd04805\Documents\99 EMACS\work\PPT\reveal.js
#+REVEAL_TRANS: none
#+REVEAL_SPEED: default
#+REVEAL_THEME: moon
#+REVEAL_EXTRA_CSS:
#+REVEAL_EXTRA_JS:
#+REVEAL_HLEVEL:
#+REVEAL_TITLE_SLIDE_BACKGROUND:
#+REVEAL_TITLE_SLIDE_BACKGROUND_SIZE:
#+REVEAL_TITLE_SLIDE_BACKGROUND_REPEAT:
#+REVEAL_TITLE_SLIDE_BACKGROUND_TRANSITION:
#+REVEAL_MATHJAX_URL: https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
#+REVEAL_PREAMBLE:
#+REVEAL_HEAD_PREAMBLE:
#+REVEAL_POSTAMBLE:
#+REVEAL_MULTIPLEX_ID:
#+REVEAL_MULTIPLEX_SECRET:
#+REVEAL_MULTIPLEX_URL:
#+REVEAL_MULTIPLEX_SOCKETIO_URL:
#+REVEAL_SLIDE_HEADER:
#+REVEAL_SLIDE_FOOTER:Process Automation
#+REVEAL_PLUGINS:
#+REVEAL_DEFAULT_FRAG_STYLE:
#+REVEAL_INIT_SCRIPT:
#+REVEAL_HIGHLIGHT_CSS: %r/lib/css/zenburn.css

I could edit a few of them to get some fancy slide show set up.

The following things what I'm looking for (which are rather basic) could not be found.

1. How to set the title/author_name/email_address?

I tried using the #+TITLE #+AUTHOR - but could not get it to work. Reference

2. How to align text (at least left align)?

I tried deleting reveal_center:t from the template - but no use

I'm using Section 12.3 of Org manual as reference, but failing somehow to see it through.

Any pointers to lead me to the right direction would be helpful.